From 6069a1585f34d46178b38554c8d547a266bb4123 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 10 Jan 2022 14:04:28 -0300 Subject: [PATCH] `z_actor` with some documentation, with 1 NON_EQUIVALENTs (#401) * Match Player_GetHeight * Another bunch * Fix merge conflict * rename Gfx_DrawDListXlu * add WEEROR * Actor_Spawn * almost Actor_SpawnTransitionActors and Actor_Delete * A bunch of small actors * More renames * format * Some Player renames * a few more * import data * run formatter * func_800B7170 * whoops * Fix merge issues * Whoops 2 * func_800B83BC and func_800B83F8 * Actor_IsActorFacingPlayerAndWithinRange * add some prototypes * match Actor_UpdateBgCheckInfo * func_800B7678 * mark Actor_SpawnAsChildAndCutscene as non_matching * Actor_Draw * Update is chaotic * 2 new matches * func_800BC8B8 * Another bunch * function renames * run formatter * cleanup * remove unnecesary casts * add missing sfx * Fix renames * fix merge * func_800BF7CC * small bunch * another bunch * func_800BE184 non_matching * two more * split z_cheap_proc * Another bunch * another bunch * a few and a non matching * yeee * a * Actor_DrawAll non_equivalent * Actor_RecordUndrawnActor * i don't know what to put in this commit message * func_800B4B50 non matching * func_800B42F8 non matching * func_800B5040 * func_800B5814 non_equiv * func_800B6584 * func_800B6608 * func_800B6680 * func_800B7E04 * func_800B8118 * func_800b9170 * , * func_800BC4EC * func_800BA6FC * func_800BA798 * func_800BA8B8 * Actor_LoadOverlay * small cleanup * func_800BB2D0 * meh * func_800BBAC0 * func_800BC270 * func_800B5208 non matching * Fix warnings * meh * rename some ActorShadow_ functions * fairy * Flags_ * fix warnings * format * Actor_PickUp and family * func_800B8E58 * match Actor_RemoveFromCategory * another bit of docs * Match func_800B86C8 * And another bit * rename Player_GetRunSpeedLimit * func_800B9E84 * func_800BE63C * func_800BB8EC * match func_800B5814 * match func_800B9334 * cleanup * fix conflicts: first pass * another fix * actorfixer fix * fix conflicts * func_800BE680 non_equivalent * Improve func_800BE680 a bit * func_800BE680 equivalent (?) * func_800BE680 equivalent * Actor_UpdateActor equivalent * format * use some ExchangeItemID enum values * Some more cleaning * more cleanup * More name stealing from OoT * match func_800B82EC * match func_800B9D1C and a bit of cleanup * Add ACTOR_FLAGS placeholders * Renames and match func_800BE184 * last pass of name stealing * format * fix conflicts * more cleanup * more cleanup * cleanup and OVERLAY_RELOCATION_OFFSET macro * Remove prototypes of obviously internal-only functions, update variable names, forward declare where necessary, remove all `param_\d`s * remove newlines * minor rename * Use ACTOR_FLAGS in z_actor * Match func_800BE3D0 * Rename movement functions * Document Actor_CalcOffsetOrientedToDrawRotation * velX -> horizontalSpeed * A bit of documentation for actor movement functions * format * Fix merge issues * format * Format * Fix renames * fix warnings * fix conflicts * review :D * Update src/overlays/actors/ovl_En_Ma4/z_en_ma4.c Co-authored-by: Derek Hensley * Fix * format * Actor_SpawnSetupActors * engineer review * Update src/code/z_actor.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * A bunch of Engineer's reviews * more Engineer's review * a * whoops * run actorfixer * c'mon * :face_exhaling: * whoops * warning * More engineer's review * run format * I'm dumb * a * match func_800BE680 * Match Actor_DrawZTarget * Match Actor_SpawnAsChildAndCutscene, fix non-equivalent in Actor_UpdateActor * Fix merge issue * format * update actor * Steal a bit of @Thar0 documentation from OoT's z_message * Run actorfixer * Fix renames * Match func_800B4B50 thanks to @hensldm * Improve ActorShadow_DrawFeet thanks to @hensldm * whoops * Actor_PlaySfxAtProjectedPos * Actor_UpdateActor matched by @hensldm * Match func_800BA2FC by @hensldm * Match Actor_SpawnTransitionActors by @hensldm * Match func_800BB604 by @hensldm * Match Actor_DrawAll by @hensldm * ActorShadow_DrawFeet by @hensldm * Actor_UpdateAll by @hensldm * Match func_800BCCDC by @engineer124 * Small Actor_PlaySfxAtPos by @engineer124 * ACTOR_FLAGS_ALL and a bit of cleanup * Add invisible comment * Small docs pass * Fix merge * Engineer's review * format lol * Actor_DrawDoorLock docs * Actor_SpawnShieldParticlesMetal * fix merge issues * sActorFaultClient * fix * commit message * Run actorfixer.py && format.sh * Fix warnings * fixes * format * bss * Update include/functions.h Co-authored-by: Derek Hensley * Address review * Fix merge issues, format and such * fix merge issues * Add ACTORCAT_MAX * actorList -> actorLists * Fix merge issues * format * Enable WERROR on jenkinsfile * Fix merge * Use object symbols * address review * format * review * fix merge issues * fix * VRAM_PTR_SIZE, small cleanup and format * review Co-authored-by: Elliptic Ellipsis Co-authored-by: Derek Hensley Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: engineer124 --- Makefile | 14 +- assets/xml/objects/gameplay_dangeon_keep.xml | 4 +- assets/xml/objects/gameplay_keep.xml | 12 +- docs/tutorial/advanced_control_flow.md | 64 +- docs/tutorial/documenting.md | 18 +- docs/tutorial/introduction.md | 4 +- docs/tutorial/other_functions.md | 22 +- include/functions.h | 530 +- include/io/controller.h | 7 + include/macros.h | 9 +- include/ultra64/hardware.h | 2 + include/variables.h | 33 +- include/z64.h | 150 +- include/z64actor.h | 182 +- include/z64item.h | 9 + include/z64player.h | 21 +- include/z64save.h | 2 +- include/z64scene.h | 2 +- spec | 1 - src/boot_O2/__osMalloc.c | 8 +- src/boot_O2_g3/z_std_dma.c | 1 + src/buffers/gfxyield.c | 1 + src/code/audio/code_801A5BD0.c | 2 +- src/code/graph.c | 2 +- src/code/sched.c | 1 + src/code/sys_math3d.c | 2 +- src/code/z_actor.c | 4749 +++++++++++++++-- src/code/z_actor_dlftbls.c | 4 +- src/code/z_bgcheck.c | 2 +- src/code/z_camera.c | 2 +- src/code/z_cheap_proc.c | 39 + src/code/z_effect_soft_sprite.c | 8 +- src/code/z_effect_soft_sprite_old_init.c | 6 +- src/code/z_en_a_keep.c | 12 +- src/code/z_en_hy.c | 6 +- src/code/z_en_item00.c | 32 +- src/code/z_kaleido_manager.c | 6 +- src/code/z_lifemeter.c | 4 +- src/code/z_lights.c | 2 +- src/code/z_message.c | 2 +- src/code/z_player_lib.c | 4 +- src/code/z_quake.c | 2 +- src/code/z_snap.c | 4 +- src/code/z_sub_s.c | 4 +- .../actors/ovl_Arms_Hook/z_arms_hook.c | 6 +- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 2 +- .../ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c | 4 +- .../ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c | 12 +- .../actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c | 4 +- .../ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c | 6 +- .../actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c | 7 +- .../ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c | 16 +- .../actors/ovl_Bg_Icicle/z_bg_icicle.c | 8 +- .../actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c | 2 +- .../ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c | 8 +- .../ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c | 12 +- .../actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c | 4 +- .../ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c | 4 +- .../ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c | 4 +- .../ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c | 2 +- .../actors/ovl_Bg_Ladder/z_bg_ladder.c | 2 +- .../actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c | 2 +- src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c | 2 +- .../ovl_Bg_Market_Step/z_bg_market_step.c | 4 +- .../ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c | 2 +- .../actors/ovl_Bg_Tobira01/z_bg_tobira01.c | 2 +- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 34 +- src/overlays/actors/ovl_Boss_04/z_boss_04.c | 24 +- src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c | 4 +- .../actors/ovl_Dm_Statue/z_dm_statue.c | 2 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 184 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 2 +- .../actors/ovl_Door_Spiral/z_door_spiral.c | 6 +- .../actors/ovl_Door_Warp1/z_door_warp1.c | 32 +- .../ovl_En_Akindonuts/z_en_akindonuts.c | 42 +- .../actors/ovl_En_Aob_01/z_en_aob_01.c | 54 +- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 2 +- src/overlays/actors/ovl_En_Baguo/z_en_baguo.c | 32 +- .../actors/ovl_En_Baisen/z_en_baisen.c | 16 +- src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c | 38 +- .../actors/ovl_En_Bigslime/z_en_bigslime.c | 34 +- .../actors/ovl_En_Bji_01/z_en_bji_01.c | 15 +- .../actors/ovl_En_Bomjima/z_en_bomjima.c | 36 +- .../actors/ovl_En_Bomjimb/z_en_bomjimb.c | 26 +- src/overlays/actors/ovl_En_Box/z_en_box.h | 6 +- src/overlays/actors/ovl_En_Bu/z_en_bu.c | 2 +- src/overlays/actors/ovl_En_Cha/z_en_cha.c | 8 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 +- .../actors/ovl_En_Col_Man/z_en_col_man.c | 16 +- src/overlays/actors/ovl_En_Cow/z_en_cow.c | 20 +- src/overlays/actors/ovl_En_Dai/z_en_dai.c | 20 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 10 +- .../actors/ovl_En_Daiku2/z_en_daiku2.c | 18 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 36 +- src/overlays/actors/ovl_En_Dg/z_en_dg.c | 76 +- .../actors/ovl_En_Dinofos/z_en_dinofos.c | 66 +- src/overlays/actors/ovl_En_Dnk/z_en_dnk.c | 6 +- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 38 +- src/overlays/actors/ovl_En_Dnp/z_en_dnp.c | 36 +- src/overlays/actors/ovl_En_Dnq/z_en_dnq.c | 8 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 16 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 53 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 4 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 64 +- .../actors/ovl_En_Elfbub/z_en_elfbub.c | 4 +- .../actors/ovl_En_Elforg/z_en_elforg.c | 22 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 14 +- .../ovl_En_Ending_Hero/z_en_ending_hero.c | 4 +- .../ovl_En_Ending_Hero2/z_en_ending_hero2.c | 4 +- .../ovl_En_Ending_Hero3/z_en_ending_hero3.c | 4 +- .../ovl_En_Ending_Hero4/z_en_ending_hero4.c | 4 +- .../ovl_En_Ending_Hero5/z_en_ending_hero5.c | 4 +- .../ovl_En_Ending_Hero6/z_en_ending_hero6.c | 4 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 20 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 16 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 30 +- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 34 +- src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 20 +- .../actors/ovl_En_Fishing/z_en_fishing.c | 72 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 78 +- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 67 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 48 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 25 +- src/overlays/actors/ovl_En_Gb2/z_en_gb2.c | 36 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 36 +- src/overlays/actors/ovl_En_Giant/z_en_giant.c | 12 +- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 70 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 2 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 32 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 56 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 22 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 52 +- .../actors/ovl_En_Guruguru/z_en_guruguru.c | 20 +- .../actors/ovl_En_Hakurock/z_en_hakurock.c | 10 +- src/overlays/actors/ovl_En_Hg/z_en_hg.c | 32 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 6 +- src/overlays/actors/ovl_En_Horse/z_en_horse.h | 6 +- src/overlays/actors/ovl_En_In/z_en_in.c | 59 +- .../actors/ovl_En_Invadepoh/z_en_invadepoh.c | 106 +- .../z_en_invadepoh_demo.c | 2 +- .../z_en_invisible_ruppe.c | 2 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 28 +- .../actors/ovl_En_Jc_Mato/z_en_jc_mato.c | 4 +- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 50 +- src/overlays/actors/ovl_En_Kame/z_en_kame.c | 54 +- src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 56 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 2 +- src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c | 36 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 24 +- .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 74 +- .../actors/ovl_En_Ma_Yts/z_en_ma_yts.c | 7 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 29 +- .../actors/ovl_En_Minislime/z_en_minislime.c | 10 +- src/overlays/actors/ovl_En_Mkk/z_en_mkk.c | 2 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 14 +- src/overlays/actors/ovl_En_Mm2/z_en_mm2.c | 6 +- src/overlays/actors/ovl_En_Ms/z_en_ms.c | 18 +- .../actors/ovl_En_Mushi2/z_en_mushi2.c | 24 +- src/overlays/actors/ovl_En_Muto/z_en_muto.c | 12 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 28 +- src/overlays/actors/ovl_En_Nnh/z_en_nnh.c | 4 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 4 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 48 +- src/overlays/actors/ovl_En_Ot/z_en_ot.c | 32 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 44 +- .../actors/ovl_En_Pamera/z_en_pamera.c | 60 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 62 +- src/overlays/actors/ovl_En_Part/z_en_part.h | 3 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 30 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 34 +- .../actors/ovl_En_Po_Fusen/z_en_po_fusen.c | 6 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 36 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 42 +- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 98 +- .../actors/ovl_En_Railgibud/z_en_railgibud.c | 100 +- .../actors/ovl_En_Railgibud/z_en_railgibud.h | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 70 +- .../actors/ovl_En_Recepgirl/z_en_recepgirl.c | 8 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 38 +- src/overlays/actors/ovl_En_Rsn/z_en_rsn.c | 6 +- .../actors/ovl_En_Ruppecrow/z_en_ruppecrow.c | 38 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 14 +- .../actors/ovl_En_Scopecoin/z_en_scopecoin.c | 8 +- .../actors/ovl_En_Sellnuts/z_en_sellnuts.c | 72 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 102 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 50 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 36 +- src/overlays/actors/ovl_En_St/z_en_st.c | 34 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 90 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 54 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 54 +- src/overlays/actors/ovl_En_Talk/z_en_talk.c | 6 +- .../ovl_En_Talk_Gibud/z_en_talk_gibud.c | 72 +- .../actors/ovl_En_Tanron3/z_en_tanron3.c | 12 +- .../actors/ovl_En_Tanron6/z_en_tanron6.c | 4 +- src/overlays/actors/ovl_En_Test5/z_en_test5.c | 6 +- .../actors/ovl_En_Thiefbird/z_en_thiefbird.c | 42 +- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 80 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 28 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 8 +- src/overlays/actors/ovl_En_Toto/z_en_toto.c | 32 +- src/overlays/actors/ovl_En_Toto/z_en_toto.h | 2 +- src/overlays/actors/ovl_En_Trt/z_en_trt.c | 86 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 28 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 18 +- .../actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c | 4 +- .../ovl_En_Water_Effect/z_en_water_effect.c | 4 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 104 +- .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 20 +- src/overlays/actors/ovl_En_Zog/z_en_zog.c | 40 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 88 +- .../actors/ovl_Item_B_Heart/z_item_b_heart.c | 8 +- .../actors/ovl_Item_Inbox/z_item_inbox.c | 2 +- src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c | 8 +- src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c | 4 +- src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c | 2 +- .../actors/ovl_Obj_Dowsing/z_obj_dowsing.c | 4 +- .../actors/ovl_Obj_Ending/z_obj_ending.c | 4 +- .../actors/ovl_Obj_Etcetera/z_obj_etcetera.c | 2 +- .../ovl_Obj_Flowerpot/z_obj_flowerpot.c | 19 +- .../actors/ovl_Obj_Ghaka/z_obj_ghaka.c | 4 +- .../ovl_Obj_Grass_Carry/z_obj_grass_carry.c | 2 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 2 +- .../actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c | 6 +- .../actors/ovl_Obj_HsStump/z_obj_hsstump.c | 2 +- .../ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c | 4 +- .../actors/ovl_Obj_Iceblock/z_obj_iceblock.c | 29 +- .../actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c | 2 +- .../ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 25 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 6 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 2 +- .../ovl_Obj_Lightblock/z_obj_lightblock.c | 2 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 12 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 8 +- .../actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c | 2 +- .../ovl_Obj_Moon_Stone/z_obj_moon_stone.c | 8 +- .../actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c | 6 +- .../actors/ovl_Obj_Raillift/z_obj_raillift.c | 6 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 6 +- .../ovl_Obj_Skateblock/z_obj_skateblock.c | 2 +- .../actors/ovl_Obj_Snowball/z_obj_snowball.c | 22 +- .../ovl_Obj_Snowball2/z_obj_snowball2.c | 2 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 12 +- src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c | 2 +- .../ovl_Obj_Tokei_Step/z_obj_tokei_step.c | 4 +- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 24 +- src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 2 +- .../ovl_Obj_Visiblock/z_obj_visiblock.c | 2 +- .../ovl_Obj_Warpstone/z_obj_warpstone.c | 13 +- src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c | 4 +- src/overlays/gamestates/ovl_title/z_title.c | 2 +- tools/actorfixer.py | 97 +- tools/disasm/functions.txt | 212 +- tools/disasm/variables.txt | 16 +- tools/m2ctx.py | 2 +- tools/permuter_settings.toml | 1 + tools/sizes/code_functions.csv | 212 +- undefined_syms.txt | 8 +- 260 files changed, 7753 insertions(+), 3747 deletions(-) create mode 100644 src/code/z_cheap_proc.c diff --git a/Makefile b/Makefile index 7d08aadce..98aa5b1b4 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ COMPARE ?= 1 NON_MATCHING ?= 0 # If ORIG_COMPILER is 1, compile with QEMU_IRIX and the original compiler ORIG_COMPILER ?= 0 +# if WERROR is 1, pass -Werror to CC_CHECK, so warnings would be treated as errors +WERROR ?= 0 # Keep .mdebug section in build KEEP_MDEBUG ?= 0 # Disassembles all asm from the ROM instead of skipping files which are entirely in C @@ -110,6 +112,10 @@ ifneq ($(NON_MATCHING),1) COMPFLAGS += --matching endif +ifneq ($(WERROR), 0) + CC_CHECK += -Werror +endif + #### Files #### # ROM image @@ -290,8 +296,8 @@ build/data/%.o: data/%.s $(AS) $(ASFLAGS) $< -o $@ build/src/overlays/%.o: src/overlays/%.c - $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC_CHECK) $< + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< @$(OBJDUMP) -d $@ > $(@:.o=.s) # TODO: `() || true` is currently necessary to suppress `Error 1 (ignored)` make warnings caused by `test`, but this will go away if # the following is moved to a separate rule that is only run once when all the required objects have been compiled. @@ -300,21 +306,21 @@ build/src/overlays/%.o: src/overlays/%.c $(RM_MDEBUG) build/src/%.o: src/%.c - $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC_CHECK) $< + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< @$(OBJDUMP) -d $@ > $(@:.o=.s) $(RM_MDEBUG) build/src/libultra/libc/ll.o: src/libultra/libc/ll.c - $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC_CHECK) $< + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< python3 tools/set_o32abi_bit.py $@ @$(OBJDUMP) -d $@ > $(@:.o=.s) $(RM_MDEBUG) build/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c - $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< $(CC_CHECK) $< + $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< python3 tools/set_o32abi_bit.py $@ @$(OBJDUMP) -d $@ > $(@:.o=.s) $(RM_MDEBUG) diff --git a/assets/xml/objects/gameplay_dangeon_keep.xml b/assets/xml/objects/gameplay_dangeon_keep.xml index 19fabad2b..8237f6380 100644 --- a/assets/xml/objects/gameplay_dangeon_keep.xml +++ b/assets/xml/objects/gameplay_dangeon_keep.xml @@ -1,7 +1,7 @@  - - + + diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index d8ab73a83..5e5b9b4f5 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -866,7 +866,7 @@ - + @@ -1301,13 +1301,13 @@ - + - + - + - + @@ -1322,7 +1322,7 @@ - + diff --git a/docs/tutorial/advanced_control_flow.md b/docs/tutorial/advanced_control_flow.md index 953e3e44d..3420fc597 100644 --- a/docs/tutorial/advanced_control_flow.md +++ b/docs/tutorial/advanced_control_flow.md @@ -63,7 +63,7 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &D_80952BA0); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.015f); this->actor.colChkInfo.mass = 0xFF; this->actionFunc = func_80952734; @@ -87,7 +87,7 @@ void func_80952734(EnMs* this, GlobalContext* globalCtx) { this->actor.textId = 0x932; } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { this->actionFunc = func_809527F8; return; } @@ -107,12 +107,12 @@ void func_809529AC(EnMs *this, GlobalContext *globalCtx) { func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0); this->actionFunc = func_80952A1C; } else { - func_800B8A1C(&this->actor, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); } } void func_80952A1C(EnMs *this, GlobalContext *globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80151938(globalCtx, 0x936U); this->actionFunc = func_809527F8; } else { @@ -124,7 +124,7 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnMs* this = THIS; - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); this->actor.targetArrowOffset = 500.0f; Actor_SetScale(&this->actor, 0.015f); SkelAnime_Update(&this->skelAnime); @@ -156,7 +156,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { u8 temp_v0; u8 temp_v0_2; - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 != 4) { if (temp_v0 != 5) { if ((temp_v0 == 6) && (func_80147624(globalCtx) != 0)) { @@ -168,7 +168,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { } if (func_80147624(globalCtx) != 0) { func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; return; } @@ -198,7 +198,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { return; } func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; } @@ -208,7 +208,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { which is long, messy, and contains some rather nasty-looking control flow, including horrors like ```C - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 != 4) { if (temp_v0 != 5) { if ((temp_v0 == 6) && (func_80147624(globalCtx) != 0)) { @@ -238,7 +238,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { u8 temp_v0; u8 temp_v0_2; - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 4) { goto block_7; } @@ -258,7 +258,7 @@ block_5: goto block_17; } func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; return; block_7: @@ -290,7 +290,7 @@ block_13: return; block_15: func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; return; @@ -340,7 +340,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { u8 temp_v0; u8 temp_v0_2; - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 4) { goto block_7; } @@ -360,7 +360,7 @@ block_5: goto block_17; } func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; return; block_7: @@ -390,7 +390,7 @@ block_11: } func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; return; @@ -410,7 +410,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { u8 temp_v0; u8 temp_v0_2; - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 4) { goto block_7; } @@ -430,7 +430,7 @@ block_5: return; } func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; return; block_7: @@ -460,7 +460,7 @@ block_11: } func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; return; @@ -509,7 +509,7 @@ So let us rewrite the entire second half as a switch: } func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; return; @@ -540,7 +540,7 @@ There's a couple of other obvious things here: func_80151938(globalCtx, 0x937U); } else { func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; } @@ -568,7 +568,7 @@ can be swapped round and made to wrap the switch. This leaves us with void func_809527F8(EnMs *this, GlobalContext *globalCtx) { u8 temp_v0; - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 4) { goto block_7; } @@ -588,7 +588,7 @@ block_5: return; } func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; return; block_7: @@ -605,7 +605,7 @@ block_7: func_80151938(globalCtx, 0x937U); } else { func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; } @@ -623,7 +623,7 @@ block_7: Now, the top of the function also looks like a switch: ```C - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 4) { goto block_7; } @@ -641,7 +641,7 @@ Putting all this together, we write down a function with no gotos in it: ```C void func_809527F8(EnMs *this, GlobalContext *globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 6: this->actionFunc = func_80952734; break; @@ -651,7 +651,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { return; } func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; break; @@ -660,7 +660,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { switch (globalCtx->msgCtx.choiceIndex) { case 0: func_801477B4(globalCtx); - + if (gSaveContext.rupees < 0xA) { play_sound(0x4806U); func_80151938(globalCtx, 0x935U); @@ -669,7 +669,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { func_80151938(globalCtx, 0x937U); } else { func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; } @@ -694,7 +694,7 @@ Lastly, we can simplify `case 5` to replace the return in the if by the rest of ```C void func_809527F8(EnMs *this, GlobalContext *globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 6: this->actionFunc = func_80952734; break; @@ -702,7 +702,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { case 5: if (func_80147624(globalCtx) != 0) { func_801477B4(globalCtx); - func_800B8A1C((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809529AC; } break; @@ -712,7 +712,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { switch (globalCtx->msgCtx.choiceIndex) { case 0: func_801477B4(globalCtx); - + if (gSaveContext.rupees < 0xA) { play_sound(0x4806U); func_80151938(globalCtx, 0x935U); @@ -721,7 +721,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) { func_80151938(globalCtx, 0x937U); } else { func_8019F208(); - func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); + Actor_PickUp((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f); func_801159EC(-0xA); this->actionFunc = func_809529AC; } diff --git a/docs/tutorial/documenting.md b/docs/tutorial/documenting.md index 9b2c8e177..de82b54f9 100644 --- a/docs/tutorial/documenting.md +++ b/docs/tutorial/documenting.md @@ -148,9 +148,9 @@ void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) { } } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { func_80C10290(this); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2000)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2000)) { func_800B8614(&this->actor, globalCtx, 60.0f); if (Player_GetMask(globalCtx) == 2) { this->actor.textId = 0x2367; @@ -188,7 +188,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) { } } - temp_v0_2 = func_80152498(&globalCtx->msgCtx); + temp_v0_2 = Message_GetState(&globalCtx->msgCtx); if (temp_v0_2 == 2) { this->actor.textId = 0x2ADC; func_80C10148(this); @@ -197,7 +197,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) { if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) { if (this->actor.textId == 0x2AD9) { - Actor_SetSwitchFlag(globalCtx, this->actor.params); + Flags_SetSwitch(globalCtx, this->actor.params); Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f); if ((gSaveContext.weekEventReg[63] & 0x80)) { this->actor.textId = 0x2ADF; @@ -476,9 +476,9 @@ void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) { } } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { func_80C10290(this); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2000)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2000)) { func_800B8614(&this->actor, globalCtx, 60.0f); if (Player_GetMask(globalCtx) == PLAYER_MASK_KAFEIS_MASK) { this->actor.textId = 0x2367; // "... doesn't Kafei want to break off his engagement ... ?" @@ -514,13 +514,13 @@ void func_80C102D4(EnRecepgirl* this, GlobalContext* globalCtx) { } } - temp_v0_2 = func_80152498(&globalCtx->msgCtx); + temp_v0_2 = Message_GetState(&globalCtx->msgCtx); if (temp_v0_2 == 2) { this->actor.textId = 0x2ADC; // hear directions again? func_80C10148(this); } else if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) { if (this->actor.textId == 0x2AD9) { // "Welcome..." - Actor_SetSwitchFlag(globalCtx, this->actor.params); + Flags_SetSwitch(globalCtx, this->actor.params); Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f); if (gSaveContext.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting this->actor.textId = 0x2ADF; // Mayor's office is on the left (meeting ended) @@ -546,7 +546,7 @@ void func_80C102D4(EnRecepgirl* this, GlobalContext* globalCtx) { } } ``` -All this branching is to make the conversation look more diverse and interesting. Notably, though, `func_80C1019C` is set to start with, and is only changed when `func_800B84D0(&this->actor, globalCtx) != 0`. This is something to do with talking. The other function handles the rest of the conversation, and hands back to the first if `func_80152498(&globalCtx->msgCtx) == 2`. This function is *something* to do with the text state, which will require `z_message` to be decomped. However, observation in-game will reveal this is something to do with ending dialogue. So we can conclude that the action functions are `EnRecepgirl_Wait` and `EnRecepgirl_Talk`. The setup functions are thus `EnRecepgirl_SetupWait` and `EnRecepgirl_SetupTalk`. +All this branching is to make the conversation look more diverse and interesting. Notably, though, `func_80C1019C` is set to start with, and is only changed when `Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0`. This is something to do with talking. The other function handles the rest of the conversation, and hands back to the first if `Message_GetState(&globalCtx->msgCtx) == 2`. This function is *something* to do with the text state, which will require `z_message` to be decomped. However, observation in-game will reveal this is something to do with ending dialogue. So we can conclude that the action functions are `EnRecepgirl_Wait` and `EnRecepgirl_Talk`. The setup functions are thus `EnRecepgirl_SetupWait` and `EnRecepgirl_SetupTalk`. For more complex actors, we have a tool called `graphovl.py` that can produce function flow graphs for actors: running ``` diff --git a/docs/tutorial/introduction.md b/docs/tutorial/introduction.md index 4e2d8324d..6178019c8 100644 --- a/docs/tutorial/introduction.md +++ b/docs/tutorial/introduction.md @@ -27,7 +27,7 @@ glabel func_809529AC /* 0003D8 809529F8 C484009C */ lwc1 $f4, 0x9c($a0) /* 0003DC 809529FC 8C870098 */ lw $a3, 0x98($a0) /* 0003E0 80952A00 24060035 */ addiu $a2, $zero, 0x35 -/* 0003E4 80952A04 0C02E287 */ jal func_800B8A1C +/* 0003E4 80952A04 0C02E287 */ jal Actor_PickUp /* 0003E8 80952A08 E7A40010 */ swc1 $f4, 0x10($sp) .L80952A0C: /* 0003EC 80952A0C 8FBF001C */ lw $ra, 0x1c($sp) @@ -46,7 +46,7 @@ void func_809529AC(EnMs *this, GlobalContext *globalCtx) { func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0); this->actionFunc = func_80952A1C; } else { - func_800B8A1C(&this->actor, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel); } } ``` diff --git a/docs/tutorial/other_functions.md b/docs/tutorial/other_functions.md index bdc49036d..870b490ea 100644 --- a/docs/tutorial/other_functions.md +++ b/docs/tutorial/other_functions.md @@ -116,11 +116,11 @@ void func_80C1019C(EnRecepgirl *this, GlobalContext *globalCtx) { Animation_ChangeTransitionRepeat(temp_a0, &D_06009890, -4.0f); } } - if (func_800B84D0((Actor *) this, globalCtx) != 0) { + if (Actor_ProcessTalkRequest((Actor *) this, globalCtx) != 0) { func_80C10290(this); return; } - if (Actor_IsActorFacingLink((Actor *) this, 0x2000) != 0) { + if (Actor_IsFacingPlayer((Actor *) this, 0x2000) != 0) { func_800B8614((Actor *) this, globalCtx, 60.0f); if (Player_GetMask(globalCtx) == 2) { this->actor.textId = 0x2367; @@ -168,11 +168,11 @@ void func_80C1019C(EnRecepgirl *this, GlobalContext *globalCtx) { Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, -4.0f); } } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { func_80C10290(this); return; } - if (Actor_IsActorFacingLink(&this->actor, 0x2000) != 0) { + if (Actor_IsFacingPlayer(&this->actor, 0x2000) != 0) { func_800B8614(&this->actor, globalCtx, 60.0f); if (Player_GetMask(globalCtx) == 2) { this->actor.textId = 0x2367; @@ -203,9 +203,9 @@ void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) { } } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { func_80C10290(this); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2000)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2000)) { func_800B8614(&this->actor, globalCtx, 60.0f); if (Player_GetMask(globalCtx) == 2) { this->actor.textId = 0x2367; @@ -282,7 +282,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) { Animation_MorphToPlayOnce(sp20, &D_0600A280, -4.0f); } } - temp_v0_2 = func_80152498(&globalCtx->msgCtx); + temp_v0_2 = Message_GetState(&globalCtx->msgCtx); if (temp_v0_2 == 2) { this->actor.textId = 0x2ADC; func_80C10148(this); @@ -291,7 +291,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) { if (((temp_v0_2 & 0xFF) == 5) && (func_80147624(globalCtx) != 0)) { temp_v0_3 = this->actor.textId; if (temp_v0_3 == 0x2AD9) { - Actor_SetSwitchFlag(globalCtx, (s32) this->actor.params); + Flags_SetSwitch(globalCtx, (s32) this->actor.params); Animation_MorphToPlayOnce(sp20, &D_0600AD98, 10.0f); if ((*(&gSaveContext + 0xF37) & 0x80) != 0) { this->actor.textId = 0x2ADF; @@ -340,7 +340,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) { } } - temp_v0_2 = func_80152498(&globalCtx->msgCtx); + temp_v0_2 = Message_GetState(&globalCtx->msgCtx); if (temp_v0_2 == 2) { this->actor.textId = 0x2ADC; func_80C10148(this); @@ -349,7 +349,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) { if (((temp_v0_2 & 0xFF) == 5) && (func_80147624(globalCtx) != 0)) { if (this->actor.textId == 0x2AD9) { - Actor_SetSwitchFlag(globalCtx, this->actor.params); + Flags_SetSwitch(globalCtx, this->actor.params); Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f); if ((*(&gSaveContext + 0xF37) & 0x80) != 0) { this->actor.textId = 0x2ADF; @@ -390,7 +390,7 @@ The yellow shows registers that don't match, the different colours on the regist ``` somehow we skipped over `t0`. Where is this in the code? The `153` in the middle is the line number in the C file (the `3f0`s are the offsets into the assembly file), we have `--source` if you want to see the code explicitly, or you can do it the old-fashioned way, and work it out from nearby function calls. In this case, `func_80C10148` is run straight after, and the only place that is called is ```C - temp_v0_2 = func_80152498(&globalCtx->msgCtx); + temp_v0_2 = Message_GetState(&globalCtx->msgCtx); if (temp_v0_2 == 2) { this->actor.textId = 0x2ADC; func_80C10148(this); diff --git a/include/functions.h b/include/functions.h index 1522d6c1b..30f577b50 100644 --- a/include/functions.h +++ b/include/functions.h @@ -15,8 +15,7 @@ s32 DmaMgr_FindDmaIndex(u32 vromAddr); const char* func_800809F4(u32 param_1); void DmaMgr_ProcessMsg(DmaRequest* req); void DmaMgr_ThreadEntry(void* arg); -s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, uintptr_t vromStart, size_t size, UNK_TYPE4 unused, - OSMesgQueue* callback, void* callbackMesg); +s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, uintptr_t vromStart, size_t size, UNK_TYPE4 unused, OSMesgQueue* callback, void* callbackMesg); s32 DmaMgr_SendRequest0(void* vramStart, uintptr_t vromStart, size_t size); void DmaMgr_Start(void); void DmaMgr_Stop(void); @@ -317,8 +316,7 @@ void osViSetMode(OSViMode* modep); void guLookAtF(float mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); void guLookAt(Mtx* m, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 fileSize, s32* fileNo); -s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared, - s32* finalPage); +s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared, s32* finalPage); s32 osStopTimer(OSTimer* t); u32 __osProbeTLB(void* param_1); void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt); @@ -551,45 +549,31 @@ s16 func_800B09D0(s16 a0, s16 a1, f32 a2); u8 func_800B0A24(u8 a0, u8 a1, f32 a2); void EffectSs_DrawGEffect(GlobalContext* globalCtx, EffectSs* this, void* texture); void EffectSsDust_Spawn(GlobalContext* globalCtx, u16 drawFlags, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life, u8 updateMode); -void func_800B0DE0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_800B0E48(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_800B0EB0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -void func_800B0F18(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -void func_800B0F80(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); -void func_800B0FE8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); -void func_800B1054(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B0DE0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B0E48(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B0EB0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_800B0F18(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_800B0F80(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep, s16 life); +void func_800B0FE8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); +void func_800B1054(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 scaleStep); void func_800B10C0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel); void func_800B1130(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel); void func_800B11A0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); void func_800B1210(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); -void func_800B1280(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 life); -void func_800B12F0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 life); -void func_800B1360(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor); -void func_800B139C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, - Color_RGBA8* envColor); +void func_800B1280(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 life); +void func_800B12F0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 life); +void func_800B1360(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor); +void func_800B139C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor); void func_800B13D8(Vec3f* srcPos, f32 randScale, Vec3f* newPos, Vec3f* velocity, Vec3f* accel); void func_800B14D4(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos); void func_800B1598(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos); void EffectSsKiraKira_SpawnSmallYellow(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel); -void EffectSsKiraKira_SpawnSmall(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor); -void EffectSsGSpk_SpawnSmall(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor); +void EffectSsKiraKira_SpawnSmall(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor); +void EffectSsGSpk_SpawnSmall(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor); void EffectSsKiraKira_SpawnDispersed(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s32 life); // void EffectSsKiraKira_SpawnFocused(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE2 param_7, UNK_TYPE4 param_8); // void EffectSsBomb2_SpawnFade(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4); -void EffectSsBomb2_SpawnLayered(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, - s16 scaleStep); +void EffectSsBomb2_SpawnLayered(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep); // void EffectSsBlast_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, Color_RGBA8* param_5, Color_RGBA8* param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9, UNK_TYPE2 param_10); void EffectSsBlast_SpawnWhiteCustomScale(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 life); @@ -600,22 +584,16 @@ void EffectSsBlast_SpawnWhiteShockwave(GlobalContext* globalCtx, Vec3f* arg1, Ve // void EffectSsGSpk_SpawnFuse(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void EffectSsGSpk_SpawnRandColor(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); // void EffectSsGSpk_SpawnSmall(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); -void EffectSsDFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s16 alpha, s16 fadeDelay, s16 life, s32 arg9); -void EffectSsBubble_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 yPosOffset, f32 yPosRandScale, f32 xzPosRandScale, - f32 scale); +void EffectSsDFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 alpha, s16 fadeDelay, s16 life, s32 arg9); +void EffectSsBubble_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 yPosOffset, f32 yPosRandScale, f32 xzPosRandScale, f32 scale); void EffectSsGRipple_Spawn(GlobalContext* globalCtx, Vec3f* pos, s16 radius, s16 radiusMax, s16 life); -void EffectSsGSplash_Spawn(GlobalContext* globalCtx, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, - s16 type, s16 scale); +void EffectSsGSplash_Spawn(GlobalContext* globalCtx, Vec3f* pos, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 type, s16 scale); // void EffectSsGFire_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2); // void EffectSsLightning_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Color_RGBA8* pzParm3, Color_RGBA8* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); // void EffectSsDtBubble_SpawnColorProfile(UNK_TYPE4 param_1, Vec3f* param_2, Vec3f* param_3, Vec3f* param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8); -void EffectSsDtBubble_SpawnCustomColor(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 life, s16 randXZ); -void EffectSsHahen_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16 scale, - s16 objId, s16 life, Gfx* dList); -void EffectSsHahen_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos, f32 burstScale, s16 unused, s16 scale, - s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList); +void EffectSsDtBubble_SpawnCustomColor(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 life, s16 randXZ); +void EffectSsHahen_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16 scale, s16 objId, s16 life, Gfx* dList); +void EffectSsHahen_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos, f32 burstScale, s16 unused, s16 scale, s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList); // void func_800B2364(void); // void EffectSsStick_Spawn(UNK_TYPE4 uParm1, UNK_PTR puParm2, UNK_TYPE2 uParm3); // void EffectSsSibuki_Spawn(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); @@ -626,28 +604,22 @@ void EffectSsHitMark_SpawnFixedScale(GlobalContext* globalCtx, s32 type, Vec3f* // void EffectSsHitMark_SpawnCustomScale(void); // void EffectSsFhgFlash_SpawnShock(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE2 uParm4, UNK_TYPE1 param_5); // void EffectSsKFire_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE1 param_6); -void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, - s16* linkDetected, s16 drawFlag); -void EffectSsKakera_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, - s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, - s16 objId, Gfx* dList); +void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16* linkDetected, s16 drawFlag); +void EffectSsKakera_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, s16 objId, Gfx* dList); // void EffectSsIcePiece_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, UNK_TYPE4 uParm3, Vec3f* pzParm4, Vec3f* param_5, UNK_TYPE4 param_6); // void EffectSsIcePiece_SpawnBurst(void); // void EffectSsEnIce_SpawnFlyingVec3f(UNK_TYPE4 uParm1, Actor* pzParm2, Vec3f* pzParm3, Color_RGBA8* pzParm4, Color_RGBA8* param_5, UNK_TYPE4 param_6); // void func_800B2B44(void); // void func_800B2B7C(void); -void EffectSsEnIce_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 scale, Vec3f* velocity, Vec3f* accel, - Color_RGBA8* primColor, Color_RGBA8* envColor, s32 life); +void EffectSsEnIce_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 scale, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s32 life); // void EffectSsFireTail_Spawn(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE4 uParm4, Vec3f* param_5, UNK_TYPE2 param_6, Color_RGBA8* param_7, Color_RGBA8* param_8, UNK_TYPE2 param_9, UNK_TYPE2 param_10, UNK_TYPE4 param_11); // void EffectSsFireTail_SpawnFlame(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6); // void EffectSsFireTail_SpawnFlameOnPlayer(void); void EffectSsEnFire_SpawnVec3f(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, s16 scale, s16 arg4, s16 flags, s16 bodyPart); // void EffectSsEnFire_SpawnVec3s(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); // void EffectSsExtra_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6); -void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* prim, Color_RGBA8* env, - s16 scale, s16 scaleStep, s32 unk); -void func_800B3030(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, - s32 colorIndex); +void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* prim, Color_RGBA8* env, s16 scale, s16 scaleStep, s32 unk); +void func_800B3030(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s32 colorIndex); // void EffectSsDeadDd_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE1* param_5, UNK_TYPE1* param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9, UNK_TYPE4 param_10); // void EffectSsDeadDs_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE4 param_8); // void func_800B31BC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6); @@ -657,73 +629,60 @@ void FlagSet_Update(GameState* gameState); void FlagSet_Draw(GameState* gameState); void Overlay_LoadGameState(GameStateOverlay* gameState); void Overlay_FreeGameState(GameStateOverlay* gameState); -void Actor_PrintLists(ActorContext* actorCtx); -void ActorShape_Init(ActorShape* actorShape, f32 yOffset, ActorShadowFunc func, f32 scale); -void ActorShadow_Draw(Actor* actor, Lights* mapper, GlobalContext* globalCtx, Gfx* displayList, Color_RGBA8* color); -void func_800B3FC0(Actor* actor, Lights* mapper, GlobalContext* globalCtx); -void func_800B4024(Actor* actor, Lights* mapper, GlobalContext* globalCtx); -void func_800B4088(Actor* actor, Lights* mapper, GlobalContext* globalCtx); -void func_800B40B8(Actor* actor, Lights* mapper, GlobalContext* globalCtx); -void func_800B40E0(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6); -void func_800B42F8(Actor* actor, Lights* mapper, GlobalContext* globalCtx); -// void func_800B4A98(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -void func_800B4AEC(GlobalContext* globalCtx, Actor* actor, f32 param_3); + +void ActorShape_Init(ActorShape* actorShape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale); +void ActorShadow_DrawCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawSquare(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawHorse(Actor* actor, Lights* lights, GlobalContext* globalCtx); + +void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx); +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, Vec3f* rightFootPos); +void func_800B4AEC(GlobalContext* globalCtx, Actor* actor, f32 y); void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx); -void func_800B4EDC(GlobalContext* globalCtx, Vec3f* pzParm2, Vec3f* pzParm3, f32* pfParm4); -// void func_800B4F40(TargetContext* targetCtx, s32 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE4 param_5); -void func_800B4F78(TargetContext* targetCtx, u8 type, GlobalContext* globalCtx); -void func_800B5040(TargetContext* targetCtx, Actor* actor, u8 type, GlobalContext* globalCtx); -void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx); -void func_800B5208(TargetContext* targetCtx, GlobalContext* globalCtx); -void func_800B5814(TargetContext* targetCtx, Player* player, Actor* actor, GlobalContext* globalCtx); -u32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag); -void Actor_SetSwitchFlag(GlobalContext* globalCtx, s32 flag); -void Actor_UnsetSwitchFlag(GlobalContext* globalCtx, s32 flag); -u32 Actor_GetChestFlag(GlobalContext* globalCtx, u32 flag); -void Actor_SetChestFlag(GlobalContext* globalCtx, u32 flag); -void Actor_SetAllChestFlag(GlobalContext* globalCtx, u32 flags); -u32 Actor_GetAllChestFlag(GlobalContext* globalCtx); -u32 Actor_GetRoomCleared(GlobalContext* globalCtx, u32 roomNumber); -void Actor_SetRoomCleared(GlobalContext* globalCtx, u32 roomNumber); -void Actor_UnsetRoomCleared(GlobalContext* globalCtx, u32 roomNumber); -u32 Actor_GetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber); -void Actor_SetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber); -void Actor_UnsetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber); -u32 Actor_GetCollectibleFlag(GlobalContext* globalCtx, s32 index); -void Actor_SetCollectibleFlag(GlobalContext* globalCtx, s32 index); -void Actor_TitleCardContextInit(GlobalContext* globalCtx, TitleCardContext* titleCardCtx); -void Actor_TitleCardCreate(GlobalContext* globalCtx, TitleCardContext* titleCardCtx, u32 texture, s16 param_4, s16 param_5, u8 param_6, u8 param_7); -// void Actor_Nop800B5E50(UNK_TYPE4 param_1, UNK_TYPE4 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4); -void Actor_TitleCardUpdate(GlobalContext* globalCtx, TitleCardContext* titleCardCtx); -void Actor_TitleCardDraw(GlobalContext* globalCtx, TitleCardContext* titleCardCtx); -// UNK_TYPE4 func_800B6434(GlobalContext* globalCtx, TitleCardContext* titleCardCtx); -// UNK_TYPE4 func_800B645C(void); -void func_800B6468(GlobalContext* globalCtx); -void func_800B6474(GlobalContext* globalCtx); -// UNK_TYPE4 func_800B648C(GlobalContext* globalCtx, UNK_TYPE1 param_2, UNK_TYPE1 param_3, f32 param_4, Vec3f* param_5); -f32 func_800B64FC(GlobalContext* globalCtx, f32 fParm2, Vec3f* pzParm3, u32* puParm4); -void* func_800B6584(GlobalContext* globalCtx, s16 sParm2, void* pvParm3, u32 uParm4); -// UNK_TYPE4 func_800B6608(s32 iParm1, s16 sParm2); -// void func_800B6680(void); +void Actor_GetProjectedPos(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3); + +void Actor_DrawZTarget(TargetContext* targetCtx, GlobalContext* globalCtx); + +s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag); +void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag); +void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag); +s32 Flags_GetTreasure(GlobalContext* globalCtx, s32 flag); +void Flags_SetTreasure(GlobalContext* globalCtx, s32 flag); +void Flags_SetAllTreasure(GlobalContext* globalCtx, s32 flag); +s32 Flags_GetAllTreasure(GlobalContext* globalCtx); +s32 Flags_GetClear(GlobalContext* globalCtx, s32 roomNumber); +void Flags_SetClear(GlobalContext* globalCtx, s32 roomNumber); +void Flags_UnsetClear(GlobalContext* globalCtx, s32 roomNumber); +s32 Flags_GetClearTemp(GlobalContext* globalCtx, s32 roomNumber); +void Flags_SetClearTemp(GlobalContext* globalCtx, s32 roomNumber); +void Flags_UnsetClearTemp(GlobalContext* globalCtx, s32 roomNumber); +s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag); +void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag); + +void TitleCard_InitBossName(GameState* gameState, TitleCardContext* titleCtx, TexturePtr texture, s16 x, s16 y, u8 width, u8 height); + +s32 func_800B648C(GlobalContext* globalCtx, s32 arg1, s32 arg2, f32 arg3, Vec3f* arg4); +f32 func_800B64FC(GlobalContext* globalCtx, f32 arg1, Vec3f* arg2, u32* arg3); +void* func_800B6584(GlobalContext* globalCtx, s16 id, void* arg2, size_t size); +void* func_800B6608(GlobalContext* globalCtx, s16 id); +void* func_800B6680(GlobalContext* globalCtx, s16 id); void Actor_MarkForDeath(Actor* actor); -void Actor_InitCurrPosition(Actor* actor); -void Actor_SetHeight(Actor* actor, f32 height); -void Actor_SetRotationFromDrawRotation(Actor* actor); -void Actor_InitDrawRotation(Actor* actor); +void Actor_SetWorldToHome(Actor* actor); +void Actor_SetFocus(Actor* actor, f32 height); +void Actor_SetWorldRotToShape(Actor* actor); +void Actor_SetShapeRotToWorld(Actor* actor); void Actor_SetScale(Actor* actor, f32 scale); -void Actor_SetObjectSegment(GlobalContext* globalCtx, Actor* actor); -void Actor_InitToDefaultValues(Actor* actor, GlobalContext* globalCtx); -void Actor_FiniActor(Actor* actor, GlobalContext* globalCtx); +void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor); void Actor_SetMovementScale(s32 scale); -void Actor_ApplyMovement(Actor* actor); -void Actor_SetVelocityYRotationAndGravity(Actor* actor); -void Actor_SetVelocityAndMoveYRotationAndGravity(Actor* actor); -void Actor_SetVelocityXYRotation(Actor* actor); -void Actor_SetVelocityAndMoveXYRotation(Actor* actor); -void Actor_SetVelocityXYRotationReverse(Actor* actor); -void Actor_SetVelocityAndMoveXYRotationReverse(Actor* actor); -void func_800B6C04(Actor* actor, f32 fParm2); -// void func_800B6C58(Actor* actor, UNK_TYPE4 param_2); +void Actor_UpdatePos(Actor* actor); +void Actor_UpdateVelocityWithGravity(Actor* actor); +void Actor_MoveWithGravity(Actor* actor); +void Actor_UpdateVelocityWithoutGravity(Actor* actor); +void Actor_MoveWithoutGravity(Actor* actor); +void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor); +void Actor_MoveWithoutGravityReverse(Actor* actor); +void Actor_SetSpeeds(Actor* actor, f32 speed); s16 Actor_YawBetweenActors(Actor* from, Actor* to); s16 Actor_YawBetweenActorsTop(Actor* from, Actor* to); s16 Actor_YawToPoint(Actor* actor, Vec3f* point); @@ -734,171 +693,142 @@ f32 Actor_DistanceBetweenActors(Actor* actor1, Actor* actor2); f32 Actor_DistanceToPoint(Actor* actor, Vec3f* point); f32 Actor_XZDistanceBetweenActors(Actor* actor1, Actor* actor2); f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point); -void Actor_CalcOffsetOrientedToDrawRotation(Actor* actor, Vec3f* offset, Vec3f* point); -f32 Actor_YDistance(Actor* actor1, Actor* actor2); -void func_800B6F20(GlobalContext* globalCtx, s32 param_2, f32 param_3, s16 param_4); -float func_800B6FC8(Player* player); -// void func_800B7090(void); -// void func_800B7118(void); -// void func_800B7128(void); +void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point); +f32 Actor_HeightDiff(Actor* actor1, Actor* actor2); +void func_800B6F20(GlobalContext* globalCtx, Input* input, f32 arg2, s16 arg3); +f32 Player_GetHeight(Player* player); +f32 Player_GetRunSpeedLimit(Player* player); +s32 func_800B7118(Player* player); +s32 func_800B7128(Player* player); s32 func_800B715C(GlobalContext* globalCtx); -// void func_800B7170(void); -// void func_800B71DC(void); -u32 func_800B7200(s32 param_1); -// void func_800B722C(void); -void func_800B724C(GlobalContext* globalCtx, Actor* actor, u8 arg2); -u32 func_800B7298(GlobalContext* globalCtx, Actor* actor, u8 arg2); -void func_800B72E0(s32 param_1); -void func_800B72F8(DynaPolyActor* dpactor, f32 a1, s16 a2); -s32 Actor_IsLinkFacingActor(Actor* actor, s16 tolerance, GlobalContext* globalCtx); -s32 Actor_IsActorFacedByActor(Actor* actor, Actor* other, s16 tolerance); -s32 Actor_IsActorFacingLink(Actor* actor, s16 angle); -s32 Actor_IsActorFacingActor(Actor* actor, Actor* other, s16 tolerance); -s32 Actor_IsActorFacingLinkAndWithinRange(Actor* actor, f32 range, s16 tolerance); -s32 Actor_IsActorFacingActorAndWithinRange(Actor* actor, Actor* other, f32 range, s16 tolerance); -void func_800B75A0(CollisionPoly* param_1, Vec3f* param_2, s16* param_3); -// UNK_TYPE4 func_800B761C(Actor* param_1, UNK_TYPE4 param_2, u32 param_3); -// UNK_TYPE4 func_800B7678(GlobalContext* globalCtx, Actor* param_2, s32 param_3, u32 param_4); +void Actor_SetCameraHorseSetting(GlobalContext* globalCtx, Player* player); +void Actor_MountHorse(GlobalContext* globalCtx, Player* player, Actor* horse); +s32 func_800B724C(GlobalContext* globalCtx, Actor* actor, u8 csMode); +u32 func_800B7298(GlobalContext* globalCtx, Actor* actor, u8 csMode); +void func_800B72F8(DynaPolyActor* dyna, f32 extraPushForce, s16 yRotation); + +s32 Player_IsFacingActor(Actor* actor, s16 maxAngleDiff, GlobalContext* globalCtx); +s32 Actor_ActorBIsFacingActorA(Actor* actorA, Actor* actorB, s16 maxAngleDiff); +s32 Actor_IsFacingPlayer(Actor* actor, s16 angle); +s32 Actor_ActorAIsFacingActorB(Actor* actorA, Actor* actorB, s16 maxAngleDiff); +s32 Actor_IsFacingAndNearPlayer(Actor* actor, f32 range, s16 maxAngleDiff); +s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s16 maxAngleDiff); + +void func_800B75A0(CollisionPoly* poly, Vec3f* normal, s16* azimuth); void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallCheckHeight, f32 wallCheckRadius, f32 ceilingCheckHeight, u32 flags); -// void func_800B7E04(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -Hilite* func_800B7FE0(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); -// void func_800B8018(void); -void func_800B8050(Actor* actor, GlobalContext* globalCtx, s32 iParm3); -void func_800B8118(Actor* actor, GlobalContext* globalCtx, s32 iParm3); -// void func_800B81E0(void); -UNK_PTR func_800B8214(PosRot* param_1, Actor* param_2); -f32* func_800B8248(PosRot* param_1, Player* param_2); -// void func_800B82EC(void); -// void func_800B83BC(void); -// void func_800B83F8(void); -s32 func_800B84D0(Actor* actor, GlobalContext* globalCtx); // Actor_IsTalking -s32 func_800B8500(Actor* actor, GlobalContext* globalCtx, f32 fParm3, f32 fParm4, s32 param_5); -s32 func_800B85E0(Actor* actor, GlobalContext* globalCtx, f32 uParm3, s32 uParm4); -s32 func_800B8614(Actor* actor, GlobalContext* globalCtx, f32 uParm3); +Hilite* Hilite_DrawOpa(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); +void func_800B8050(Actor* actor, GlobalContext* globalCtx, s32 flag); +void func_800B8118(Actor* actor, GlobalContext* globalCtx, s32 flag); +PosRot* Actor_GetFocus(PosRot* dest, Actor* actor); +PosRot* Actor_GetWorld(PosRot* dest, Actor* actor); +PosRot* Actor_GetWorldPosShapeRot(PosRot* dest, Actor* actor); + +s32 func_800B83F8(Actor* actor, Player* player, s32 flag); +s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState); +s32 func_800B8500(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRange, s32 exchangeItemId); +s32 func_800B85E0(Actor* actor, GlobalContext* globalCtx, f32 radius, s32 exchangeItemId); +s32 func_800B8614(Actor* actor, GlobalContext* globalCtx, f32 radius); s32 func_800B863C(Actor* actor, GlobalContext* globalCtx); -u32 func_800B867C(Actor* actor, GlobalContext* globalCtx); -UNK_TYPE4 func_800B86C8(Actor* actor1, GlobalContext* globalCtx, Actor* actor2); -s32 func_800B8708(GlobalContext* globalCtx); -s32 func_800B8718(Actor* actor, GlobalContext* globalCtx); -void func_800B874C(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3); -// void func_800B8804(void); -// void func_800B882C(void); -// void func_800B886C(void); -void func_800B8898(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3); +s32 Actor_TextboxIsClosing(Actor* actor, GlobalContext* globalCtx); +s32 Actor_ChangeFocus(Actor* actor1, GlobalContext* globalCtx, Actor* actor2); +s32 Player_GetExchangeItemId(GlobalContext* globalCtx); +s32 func_800B8718(Actor* actor, GameState* gameState); +s32 func_800B874C(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRange); +s32 func_800B8804(Actor* actor, GlobalContext* globalCtx, f32 xzRange); +s32 func_800B886C(Actor* actor, GlobalContext* globalCtx); +void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* x, s16* y); s32 func_800B8934(GlobalContext* globalCtx, Actor* actor); -u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx); -UNK_TYPE4 func_800B8A1C(Actor* actor, GlobalContext* globalCtx, s32 iParm3, f32 fParm4, f32 param_5); -// void func_800B8B84(void); -void func_800B8BB0(Actor* actor, GlobalContext* globalCtx); -// void func_800B8BD0(void); +s32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx); +s32 Actor_PickUp(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange); +s32 Actor_PickUpNearby(Actor* actor, GlobalContext* globalCtx, s32 getItemId); +s32 Actor_LiftActor(Actor* actor, GlobalContext* globalCtx); +s32 Actor_PickUpFar(Actor* actor, GlobalContext* globalCtx, s32 getItemId); s32 Actor_HasNoParent(Actor* actor, GlobalContext* globalCtx); -// void func_800B8C20(void); +void func_800B8C20(Actor* actorA, Actor* actorB, GlobalContext* globalCtx); void func_800B8C50(Actor* actor, GlobalContext* globalCtx); -// void func_800B8C78(void); -// void func_800B8C9C(void); -// void func_800B8CEC(void); -// void func_800B8D10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); +s32 Actor_HasRider(GlobalContext* globalCtx, Actor* horse); +s32 Actor_SetRideActor(GlobalContext* globalCtx, Actor* horse, s32 mountSide); +s32 Actor_HasNoRider(GlobalContext* globalCtx, Actor* horse); +void func_800B8D10(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6); void func_800B8D50(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 yaw, f32 arg4, u32 arg5); void func_800B8D98(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4); -// void func_800B8DD4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_800B8E1C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -void func_800B8E58(Actor* actor, u16 sfxId); -void Audio_PlayActorSound2(Actor* actor, u16 sfxId); -// void func_800B8FC0(void); +void func_800B8DD4(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5); +void func_800B8E1C(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4); +void func_800B8E58(Player* player, u16 sfxId); +void Actor_PlaySfxAtPos(Actor* actor, u16 sfxId); +void func_800B8EF4(GlobalContext* globalCtx, Actor* actor); void func_800B8F98(Actor* actor, u16 sfxId); +void func_800B8FC0(Actor* actor, u16 sfxId); void func_800B8FE8(Actor* actor, u16 sfxId); void func_800B9010(Actor* actor, u16 sfxId); -// void func_800B9038(void); -// void func_800B9084(void); +void func_800B9038(Actor* actor, s32 timer); +void func_800B9084(Actor* actor); void func_800B9098(Actor* actor); -s32 func_800B90AC(GlobalContext* globalCtx, Actor* actor, UNK_TYPE arg2, UNK_TYPE arg3, UNK_TYPE arg4); -// void func_800B90F4(void); +s32 func_800B90AC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* polygon, s32 index, s32 arg4); +void func_800B90F4(GlobalContext* globalCtx); void func_800B9120(ActorContext* actorCtx); -// void Actor_Init(GlobalContext* globalCtx, ActorContext* actorCtx, UNK_TYPE4 uParm3); -void func_800B9334(GlobalContext* globalCtx, ActorContext* actorCtx); -Actor* Actor_UpdateActor(s800B948C* params); +void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry); void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx); -void Actor_DrawActor(GlobalContext* globalCtx, Actor* actor); -void func_800B9D1C(Actor* actor); -void Actor_DrawAllSetup(GlobalContext* globalCtx); s32 Actor_RecordUndrawnActor(GlobalContext* globalCtx, Actor* actor); -// void func_800B9E84(void); -void func_800B9EF4(GlobalContext* globalCtx, s32 numActors, Actor** actors); -s32 func_800BA2D8(GlobalContext* globalCtx, Actor* actor); -s32 func_800BA2FC(GlobalContext* globalCtx, Actor* actor, Vec3f* param_3, f32 param_4); void Actor_DrawAll(GlobalContext* globalCtx, ActorContext* actorCtx); void func_800BA6FC(GlobalContext* globalCtx, ActorContext* actorCtx); void func_800BA798(GlobalContext* globalCtx, ActorContext* actorCtx); -void func_800BA8B8(GlobalContext* globalCtx, ActorContext* actorCtx); -// void func_800BA9B4(void); -void Actor_InsertIntoTypeList(ActorContext* actorCtx, Actor* actor, u8 type); -Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor); -void Actor_FreeOverlay(ActorOverlay* entry); -Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s16 sParm10); -ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index); -Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 variable, u32 cutscene, s32 param_12, Actor* parent); -Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 variable); +void Actor_CleanupContext(ActorContext* actorCtx, GlobalContext* globalCtx); +Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params); +Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 cutscene, s32 arg11, Actor* parent); +Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params); void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx); -void func_800BB2D0(ActorContext* actorCtx, u16* param_2, GlobalContext* globalCtx); -Actor* func_800BB498(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx); -// void func_800BB59C(void); -// void func_800BB604(void); -// void func_800BB8EC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); void Enemy_StartFinishingBlow(GlobalContext* globalCtx, Actor* actor); -// void func_800BBAC0(void); -void func_800BBB74(s16* arg1, UNK_TYPE1 arg2, UNK_TYPE1 arg3, UNK_TYPE4 arg4); -// void func_800BBC20(void); -void func_800BBCEC(Actor* actor, GlobalContext* globalCtx, s16 arg2, Gfx** dList); -void func_800BBDAC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, UNK_TYPE4 arg4, f32 arg5, s16 arg6, s16 arg7, u8 arg8); -void func_800BBFB0(GlobalContext* globalCtx, Vec3f* position, f32 param3, s32 param_4, s16 param_5, s16 param_6, u8 param_7); +s16 func_800BBAC0(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3); +s16 func_800BBB74(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3); +void Actor_SpawnBodyParts(Actor* actor, GlobalContext* globalCtx, s32 arg2, Gfx** dList); +void Actor_SpawnFloorDustRing(GlobalContext* globalCtx, Actor* actor, Vec3f* posXZ, f32 radius, s32 countMinusOne, f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting); +void func_800BBFB0(GlobalContext* globalCtx, Vec3f* position, f32 arg2, s32 arg3, s16 arg4, s16 scaleStep, u8 arg6); void func_800BC154(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory); -// void func_800BC188(void); -// void func_800BC1B4(void); -Actor* func_800BC270(GlobalContext* globalCtx, Actor* actor, f32 arg2, UNK_TYPE4 arg3); +s32 func_800BC188(s32 index); +Actor* func_800BC270(GlobalContext* globalCtx, Actor* actor, f32 arg2, s32 arg3); Actor* func_800BC444(GlobalContext* globalCtx, Actor* actor, f32 arg2); -s16 func_800BC4EC(Actor* actor, GlobalContext* globalCtx, f32 distance, s16 angle); -s32 func_800BC5B8(GlobalContext* globalCtx, Actor* actor); -s32 func_800BC5EC(GlobalContext* globalCtx, Actor* actor); -void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 arg2, GlobalContext* globalCtx); -// void func_800BC770(void); -// void func_800BC7D8(void); +s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 distance, s16 angle); +s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor); +s32 Actor_OtherIsTargeted(GlobalContext* globalCtx, Actor* actor); +void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx); +void func_800BC770(GlobalContext* globalCtx, s16 y, s16 countdown); +void func_800BC7D8(GlobalContext* globalCtx, s16 y, s16 countdown, s16 speed); void func_800BC848(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3); -// void func_800BC8B8(void); -// void func_800BCB50(void); -void func_800BCB70(Actor* actor, u16 arg1, u16 arg2, s16 arg3, s16 arg4); -void func_800BCBF4(Vec3f* uParm1, GlobalContext* globalCtx); -void func_800BCC68(Vec3f* param_1, GlobalContext* globalCtx); -UNK_RET func_800BCCDC(Vec3s* points, u8 pathcount, Vec3f* pos1, Vec3f* pos2, UNK_TYPE parm5); -// void func_800BD2B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_800BD384(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE1 param_9); -// void func_800BD6E4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5); -void func_800BD888(Actor*, struct_800BD888_arg1*, s16, s16); // This function is very similar to OoT's func_80034A14 -// void func_800BD9A0(void); -// void func_800BD9E0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6); -// void func_800BDAA0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6); -// void func_800BDB6C(void); -void func_800BDC5C(SkelAnime* skelAnime, ActorAnimationEntry animation[], s32 index); -// void func_800BDCF4(void); +void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type); +void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 xluFlag, u16 duration); +Hilite* func_800BCBF4(Vec3f* arg0, GlobalContext* globalCtx); +Hilite* func_800BCC68(Vec3f* arg0, GlobalContext* globalCtx); +void func_800BCCDC(Vec3s* points, s32 pathCount, Vec3f* pos1, Vec3f* pos2, s32 parm5); +s32 func_800BD2B4(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*textIdCallback)(GlobalContext*, Actor*), s16 (*arg5)(GlobalContext*, Actor*)); +void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3); +void func_800BD9E0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); +void func_800BDAA0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); +void Actor_ChangeAnimation(SkelAnime* skelAnime, ActorAnimationEntry* animation, s32 index); void Actor_Noop(Actor* actor, GlobalContext* globalCtx); -void func_800BDFC0(GlobalContext* globalCtx, Gfx* dl); -void func_800BE03C(GlobalContext* globalCtx, Gfx* dl); -Actor* func_800BE0B8(GlobalContext* globalCtx, Actor* inActor, s16 arg2, u8 arg3, f32 arg4); -s32 func_800BE184(GlobalContext* globalCtx, Actor* actor, f32 arg2, s32 arg3, s32 arg4, s32 arg5); -u8 Actor_ApplyDamage(Actor* actor); // returns current health -void func_800BE258(Actor* actor, UNK_PTR arg1); -void func_800BE2B8(Actor* actor, ColliderJntSph* jntSphere); + +void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist); +void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist); + +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* inActor, s16 actorId, u8 actorCategory, f32 distance); +s32 func_800BE184(GlobalContext* globalCtx, Actor* actor, f32 xzDist, s16 arg3, s16 arg4, s16 arg5); +u8 Actor_ApplyDamage(Actor* actor); +void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo); +void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSphere); void func_800BE33C(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3); void func_800BE3D0(Actor* actor, s16 angle, Vec3s* arg2); void func_800BE504(Actor* actor, ColliderCylinder* collider); void func_800BE568(Actor* actor, ColliderSphere* collider); -void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 arg2); -// void func_800BE63C(void); -void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s16 arg3, f32 arg4, f32 arg5, f32 arg6, u8 mode); -void func_800BF7CC(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s32 arg3, s32 arg4, f32 arg5, f32 arg6); -void ActorOverlayTable_FaultPrint(void* arg0, void* arg1); // ActorOverlayTable_FaultPrint -void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1); // ActorOverlayTable_FaultAddrConv -void ActorOverlayTable_Init(void); // ActorOverlayTable_Init -void ActorOverlayTable_Cleanup(void); // ActorOverlayTable_Cleanup +void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 colliderIndex); +s32 func_800BE63C(struct EnBox* chest); +void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s16 arg3, f32 effectScale, f32 steamScale, f32 effectAlpha, u8 mode); +void Actor_SpawnIceEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange); + +void ActorOverlayTable_FaultPrint(void* arg0, void* arg1); +void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1); +void ActorOverlayTable_Init(void); +void ActorOverlayTable_Cleanup(void); + void SSNode_SetValue(SSNode* node, s16* polyIndex, u16 next); void SSList_SetNull(SSList* head); void SSNodeList_SetSSListHead(SSNodeList* list, SSList* ssList, s16* polyIndex); @@ -1228,7 +1158,7 @@ void func_800DE0EC(Camera* camera, Actor* actor); Vec3s* Camera_Update(Vec3s* param_1, Camera* camera); // void func_800DF498(void); u32 Camera_SetMode(Camera* camera, s16 mode, s8 param_3); -// void func_800DF840(void); +s32 Camera_ChangeMode(Camera* camera, s16 mode); // void func_800DF86C(void); // void func_800DF8EC(void); s32 func_800DFAC8(Camera* camera, s16 param_2); @@ -1619,14 +1549,11 @@ void ActorCutscene_SetReturnCamera(s16 index); // void func_800F23E0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); f32 func_800F2478(f32 target, TransformData* transData, s32 refIdx); void SkelCurve_Clear(SkelAnimeCurve* skelCurve); -s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurveLimbList* limbListSeg, - TransformUpdateIndex* transUpdIdx); +s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurveLimbList* limbListSeg, TransformUpdateIndex* transUpdIdx); void SkelCurve_Destroy(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve); -void SkelCurve_SetAnim(SkelAnimeCurve* skelCurve, TransformUpdateIndex* transUpdIdx, f32 arg2, f32 animFinalFrame, - f32 animCurFrame, f32 animSpeed); +void SkelCurve_SetAnim(SkelAnimeCurve* skelCurve, TransformUpdateIndex* transUpdIdx, f32 arg2, f32 animFinalFrame, f32 animCurFrame, f32 animSpeed); s32 SkelCurve_Update(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve); -void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, - OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, Actor* thisx); +void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, Actor* thisx); void FireObj_SetPosition(FireObj* fire, Vec3f* pos); void FireObj_Draw(GlobalContext* globalCtx, FireObj* fire); void FireObj_Init(GlobalContext* globalCtx, FireObj* fire, FireObjInitParams* init, Actor* actor); @@ -1640,7 +1567,7 @@ void FireObj_Update(GlobalContext* globalCtx, FireObj* fire, Actor* actor); // void func_800F3B68(void); // void func_800F3C44(void); // void func_800F3ED4(void); -void func_800F40A0(GlobalContext* globalCtx, s32 param_2); +void func_800F40A0(GameState* gameState, Player* player); // void func_800F415C(void); UNK_TYPE func_800F41E4(GlobalContext* globalCtx, ActorContext* actorCtx); @@ -2137,7 +2064,7 @@ void func_80122F28(Player* player, GlobalContext* globalCtx, Actor* actor); void func_8012301C(s32 iParm1, GlobalContext* globalCtx); void func_80123140(GlobalContext* globalCtx, Player* param_2); u32 func_80123358(GlobalContext* globalCtx, Player* player); -u32 func_801233E4(GlobalContext* globalCtx); +s32 Player_InCsMode(GameState* gameState); // void func_80123420(void); // void func_80123434(void); // void func_80123448(void); @@ -2173,7 +2100,7 @@ s32 func_801240C8(Player* player); // void func_801241E0(void); // void func_8012420C(void); // void func_8012422C(void); -// void func_80124258(void); +s32 Player_GetExplosiveHeld(Player* player); // void func_80124278(void); s32 func_801242B4(Player* player); // void func_801242DC(void); @@ -2466,35 +2393,20 @@ UNK_TYPE func_80133038(GlobalContext* globalCtx, UNK_TYPE* arg1, struct_80133038 void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod); void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod); void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor, s32 lod, Mtx** mtx); -void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, - OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor, - s32 lod); -void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, - OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); -void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, - OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); -void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, - OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, - Mtx** limbMatricies); -void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, - OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); -void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, - OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor, - Mtx** mtx); -void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, - OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor); +void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor, s32 lod); +void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); +void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); +void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, Mtx** limbMatricies); +void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor); +void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor, Mtx** mtx); +void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor); void SkelAnime_GetFrameData(AnimationHeader* animationSeg, s32 currentFrame, s32 limbCount, Vec3s* dst); s16 Animation_GetLength(void* animation); s16 Animation_GetLastFrame(void* animation); -Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, - OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); -Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, - OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); -Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, - OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, - Mtx** mtx, Gfx* gfx); -Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, - OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); +Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); +Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); +Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx); +Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx); s16 SkelAnime_GetFrameDataLegacy(LegacyAnimationHeader* animation, s32 frame, Vec3s* frameTable); s16 Animation_GetLimbCount2(LegacyAnimationHeader* animation); s16 Animation_GetLength2(LegacyAnimationHeader* animation); @@ -2504,8 +2416,7 @@ void AnimationContext_Reset(AnimationContext* animationCtx); void AnimationContext_SetNextQueue(GlobalContext* globalCtx); void AnimationContext_DisableQueue(GlobalContext* globalCtx); AnimationEntry* AnimationContext_AddEntry(AnimationContext* animationCtx, AnimationType type); -void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader* animation, s32 frame, - s32 limbCount, Vec3s* frameTable); +void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader* animation, s32 frame, s32 limbCount, Vec3s* frameTable); void AnimationContext_SetCopyAll(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src); void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 limbCount, Vec3s* arg2, Vec3s* arg3, f32 arg4); void AnimationContext_SetCopyTrue(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* index); @@ -2518,9 +2429,7 @@ void AnimationContext_CopyTrue(GlobalContext* globalCtx, AnimationEntryData* dat void AnimationContext_CopyFalse(GlobalContext* globalCtx, AnimationEntryData* data); void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* data); void AnimationContext_Update(GlobalContext* globalCtx, AnimationContext* animationCtx); -void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - LinkAnimationHeader* animation, s32 flags, Vec3s* jointTable, - Vec3s* morphTable, s32 limbBufCount); +void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, LinkAnimationHeader* animation, s32 flags, Vec3s* jointTable, Vec3s* morphTable, s32 limbBufCount); void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime); s32 LinkAnimation_Update(GlobalContext* globalCtx, SkelAnime* skelAnime); s32 LinkAnimation_Morph(GlobalContext* globalCtx, SkelAnime* skelAnime); @@ -2544,8 +2453,7 @@ void LinkAnimation_EndLoop(SkelAnime* skelAnime); s32 Animation_OnFrameImpl(SkelAnime* skelAnime, f32 arg1, f32 updateRate); s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 arg1); void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animationSeg, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); -void SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); +void SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); void SkelAnime_InitSkin(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animationSeg); void SkelAnime_SetUpdate(SkelAnime* skelAnime); s32 SkelAnime_Update(SkelAnime* skelAnime); @@ -2740,8 +2648,7 @@ void VisMono_Draw(void* arg0, Gfx** gfx, u32 arg2); void func_801420C0(void* arg0); void func_801420F4(void* arg0); void func_80142100(void* arg0, Gfx** gfx, u32 arg2); -s32 func_80142440(SkyboxContext* skyboxCtx, Vtx* vtx, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, - s32 arg8); +s32 func_80142440(SkyboxContext* skyboxCtx, Vtx* vtx, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8); void func_80143148(SkyboxContext* skyboxCtx, s32 arg1); void func_801431E8(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType); void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyType); @@ -2823,7 +2730,7 @@ void func_80151BB4(GlobalContext* globalCtx, u32 uParm2); // void func_80151DA4(void); void func_80152434(GlobalContext* globalCtx, u16 arg2); // void func_80152464(void); -u8 func_80152498(MessageContext* msgCtx); +u8 Message_GetState(MessageContext* msgCtx); // void func_8015268C(void); // void func_80152C64(void); // void func_80152CAC(void); @@ -2925,7 +2832,7 @@ void* TransitionFade_Init(void* param_1); // void TransitionCircle_Update(void); // void TransitionCircle_SetColor(void); // void TransitionCircle_SetType(void); -// void func_80164C14(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); +void func_80164C14(Gfx** arg0, TexturePtr* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, f32 arg6); // void TransitionCircle_Draw(void); // void TransitionCircle_IsDone(void); // void func_801651B0(void); @@ -2961,7 +2868,7 @@ void Play_Draw(GlobalContext* globalCtx); void func_80168DAC(GlobalContext* globalCtx); void Play_Update(GlobalContext* globalCtx); s32 func_801690CC(GlobalContext* globalCtx); -// void func_80169100(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); +f32 func_80169100(GlobalContext* globalCtx, MtxF* mtx, CollisionPoly** arg2, s32* arg3, Vec3f* feetPosPtr); // void func_801691F0(void); void* Play_LoadScene(GlobalContext* globalCtx, RomFile* entry); void func_8016927C(GlobalContext* globalCtx, s16 sParm2); @@ -2984,7 +2891,7 @@ void func_801699D4(GlobalContext* globalCtx, s16 arg1, s16 arg2); void func_80169AFC(GlobalContext* globalCtx, s16 camId, s16 arg2); // void func_80169C64(void); // void func_80169C84(void); -// void convert_scene_number_among_shared_scenes(void); +s16 convert_scene_number_among_shared_scenes(s16 arg0); void func_80169D40(GlobalContext* globalCtx); void func_80169DCC(GlobalContext* globalCtx, s32 arg1, u16 arg2, s32 arg3, s32 arg4, Vec3f* arg5, s16 arg6); void func_80169E6C(GlobalContext* globalCtx, s32 param_1, s32 param_2); @@ -3039,8 +2946,7 @@ void PreRender_ApplyFiltersSlowlyInit(PreRender* this); void PreRender_ApplyFiltersSlowlyDestroy(PreRender* this); void func_801720C4(PreRender* this); void func_801720FC(PreRenderParams* params, Gfx** gfxp); -void func_80172758(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x, - f32 y, f32 xScale, f32 yScale, u32 flags); +void func_80172758(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags); void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, size_t size); void THGA_Dt(TwoHeadGfxArena* thga); u32 THGA_IsCrash(TwoHeadGfxArena* thga); @@ -3284,7 +3190,7 @@ s32 Math3D_TriChkLineSegParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, // void func_8017D404(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11); void Math3D_TriSetCoords(TriNorm* tri, Vec3f* pointA, Vec3f* pointB, Vec3f* pointC); u32 Math3D_IsPointInSphere(Sphere16* sphere, Vec3f* point); -// void func_8017D668(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9); +s32 Math3D_PointDistToLine2D(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32* arg6, f32* arg7, f32* arg8); // returns boolean // void func_8017D7C0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); // void func_8017D814(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_8017D91C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); @@ -3787,8 +3693,8 @@ void func_8019F170(Vec3f* pos, u16 sfxId); void func_8019F1C0(Vec3f* pos, u16 sfxId); void play_sound(u16 sfxId); void func_8019F128(u16 sfxId); -void func_8019F208(void); // decide -void func_8019F230(void); // cancel +void func_8019F208(void); // Decide sound +void func_8019F230(void); // Cancel sound // void func_8019F258(void); // void func_8019F300(void); void func_8019F420(Vec3f* pos, u16 sfxId); @@ -3827,7 +3733,7 @@ void func_801A0204(s8 seqId); // void func_801A0554(void); // void func_801A05F0(void); void func_801A0654(Vec3f* arg0, u16 sfxId, s32 arg2); -// void func_801A0810(void); +void func_801A0810(s32* arg0, u16 sfxId, u8 arg2); // void func_801A0868(void); // void func_801A09D4(void); // void func_801A0CB0(void); @@ -3845,7 +3751,7 @@ void func_801A1DB8(Vec3f* vec, u8 seqId, f32 arg2); // void func_801A1E0C(void); void func_801A1F00(u8 arg0, u16 seqId); void func_801A1F88(void); -// void func_801A1FB4(void); +void func_801A1FB4(u8 playerIdx, Vec3f* pos, u16 seqId, f32 maxDist); // void func_801A2090(void); void func_801A246C(u8 param_1, u8 param_2); // void func_801A2544(void); @@ -3937,7 +3843,7 @@ UNK_TYPE func_801A51F0(UNK_TYPE arg0); void func_801A5BD0(s32 param_1); // void func_801A5C28(void); // void func_801A5C8C(void); -void func_801A5CFC(u16 sfxId, Vec3f* param_2, u8 param_3, f32* param_4, f32* param_5, s8* param_6); +void Audio_PlaySfxGeneral(u16 sfxId, Vec3f* param_2, u8 param_3, f32* param_4, f32* param_5, s8* param_6); // void func_801A5DDC(void); // void func_801A5F7C(void); // void func_801A6430(void); diff --git a/include/io/controller.h b/include/io/controller.h index 9e36f9b62..4321df096 100644 --- a/include/io/controller.h +++ b/include/io/controller.h @@ -153,4 +153,11 @@ extern u8 __osMaxControllers; // extern OSMesgQueue D_8009CF38; // extern OSMesg D_8009CF50; +typedef struct { + /* 0x00 */ OSContPad cur; + /* 0x06 */ OSContPad prev; + /* 0x0C */ OSContPad press; // X/Y store delta from last frame + /* 0x12 */ OSContPad rel; // X/Y store adjusted +} Input; // size = 0x18 + #endif diff --git a/include/macros.h b/include/macros.h index 1afbde243..7e6104317 100644 --- a/include/macros.h +++ b/include/macros.h @@ -39,9 +39,9 @@ } \ (void)0 -#define GET_PLAYER(globalCtx) ((Player*)(globalCtx)->actorCtx.actorList[ACTORCAT_PLAYER].first) +#define GET_PLAYER(globalCtx) ((Player*)(globalCtx)->actorCtx.actorLists[ACTORCAT_PLAYER].first) -#define GET_FIRST_ENEMY(globalCtx) ((Actor*)(globalCtx)->actorCtx.actorList[ACTORCAT_ENEMY].first) +#define GET_FIRST_ENEMY(globalCtx) ((Actor*)(globalCtx)->actorCtx.actorLists[ACTORCAT_ENEMY].first) // linkAge still exists in MM, but is always set to 0 (always adult) // There are remnants of these macros from OOT, but they are essentially useless @@ -86,6 +86,8 @@ #define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) #define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0) +#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) + extern GraphicsContext* __gfxCtx; #define WORK_DISP __gfxCtx->work.p @@ -147,6 +149,9 @@ extern GraphicsContext* __gfxCtx; (b) = _temp; \ } +#define OVERLAY_RELOCATION_OFFSET(overlayEntry) ((uintptr_t)((overlayEntry)->vramStart) - (uintptr_t)((overlayEntry)->loadedRamAddr)) +#define VRAM_PTR_SIZE(entry) ((uintptr_t)((entry)->vramEnd) - (uintptr_t)((entry)->vramStart)) + #ifdef __GNUC__ #define ALIGNED8 __attribute__ ((aligned (8))) #else diff --git a/include/ultra64/hardware.h b/include/ultra64/hardware.h index ae6470d51..57d560ab0 100644 --- a/include/ultra64/hardware.h +++ b/include/ultra64/hardware.h @@ -53,6 +53,8 @@ #define SP_DMEM_START 0x04000000 #define SP_DMEM_SIZE 0x1000 +#define TMEM_SIZE 0x1000 + #define SP_MEM_ADDR_REG 0x04040000 #define SP_DRAM_ADDR_REG 0x04040004 #define SP_RD_LEN_REG 0x04040008 diff --git a/include/variables.h b/include/variables.h index cced17fc8..6d1fc3ef9 100644 --- a/include/variables.h +++ b/include/variables.h @@ -374,7 +374,6 @@ extern u8 D_801AE214[32]; // extern UNK_TYPE4 D_801AE240; // extern UNK_TYPE4 D_801AE250; extern UNK_PTR D_801AE260[3]; -// extern UNK_TYPE4 D_801AE26C; // extern UNK_TYPE4 D_801AE27C; // extern UNK_TYPE4 D_801AE28C; // extern UNK_TYPE4 D_801AE29C; @@ -415,11 +414,8 @@ extern EffectSsOverlay gParticleOverlayTable[39]; // extern s32 sEntryIndex; // extern u32 sCurrentBit; // extern s32 sTimer; -extern Color_RGBA8 D_801AEC80; -extern s801AEC84 D_801AEC84[13]; extern f32 actorMovementScale; -extern f32 D_801AECF0; -extern f32 D_801AECF4; +extern TargetRangeParams gTargetRanges[]; extern s16 D_801AED48[8]; // extern UNK_TYPE4 D_801AED58; extern Color_RGBA8 actorDefaultHitColor; @@ -2838,7 +2834,7 @@ extern f32 D_801DE860; extern f32 D_801DE864; extern f32 D_801DE868; extern f32 D_801DE884; -// extern UNK_TYPE1 D_801DE890; +extern TexturePtr D_801DE890[]; extern f32 D_801DF090; extern f32 D_801DF094; extern f32 D_801DF0A0; @@ -3102,15 +3098,15 @@ extern u64 gJpegUCodeData[]; // bss // extern UNK_TYPE1 D_801ED890; -// extern UNK_TYPE1 D_801ED8A0; -// extern UNK_TYPE1 D_801ED8B0; -// extern UNK_TYPE1 D_801ED8B4; +// extern UNK_TYPE1 D_801ED894; +extern CollisionPoly* D_801ED8B0; +extern s32 D_801ED8B4; // extern UNK_TYPE1 D_801ED8B8; // extern UNK_TYPE1 D_801ED8BC; // extern UNK_TYPE1 D_801ED8C0; // extern UNK_TYPE1 D_801ED8C4; extern f32 D_801ED8C8; -extern f32 D_801ED8CC; +extern f32 sBgmEnemyDistSq; extern f32 D_801ED8D0; // extern UNK_TYPE1 D_801ED8D4; // extern UNK_TYPE1 D_801ED8D8; @@ -3887,8 +3883,6 @@ extern Gfx D_04023210[]; extern UNK_TYPE D_04023288; extern Gfx D_04023348[]; extern Gfx D_04023428[]; -extern Gfx D_04025850[]; -extern Gfx D_04025970[]; extern UNK_TYPE D_04025DD0; extern UNK_TYPE D_040281DC; extern UNK_TYPE D_04028FEC; @@ -3920,8 +3914,8 @@ extern UNK_TYPE D_0403F230; extern UNK_TYPE D_04044300; extern Gfx D_04048DF0[]; extern UNK_TYPE D_04050D10; -extern UNK_TYPE D_04051180; -extern UNK_TYPE D_04051238; +extern Gfx D_04051180[]; +extern Gfx D_04051238[]; extern AnimationHeader D_0405140C; extern Gfx D_040527F0[]; extern Gfx D_040528B0[]; @@ -3940,7 +3934,8 @@ extern TexturePtr D_0408EFE0[]; // gDust6Tex extern TexturePtr D_0408F3E0[]; // gDust7Tex extern TexturePtr D_0408F7E0[]; // gDust8Tex extern UNK_TYPE D_04050550; -extern UNK_TYPE D_04050648; +extern Gfx D_04050648[]; +extern Gfx D_040506E0[]; extern UNK_TYPE D_040510B0; extern UNK_TYPE D_04054940; extern Gfx D_0405AAB0[]; @@ -3969,15 +3964,11 @@ extern UNK_TYPE D_0406F380; extern Gfx D_040706E0[]; extern UNK_TYPE D_04073F00; extern UNK_TYPE D_04075400; -extern Gfx D_04075A40[]; -extern Gfx D_04075B30[]; extern Gfx D_04076BC0[]; -extern Gfx D_04077480[]; extern UNK_TYPE D_04079B10; extern Gfx D_0407AB10[]; // sun (sparkles when small) displaylist extern Gfx D_0407AB58[]; extern UNK_TYPE D_0407AFB0; -extern Gfx gGameplayKeepDrawFlameDL[]; extern UNK_TYPE D_0407D650; extern UNK_TYPE D_0407F218; extern UNK_TYPE D_040815D0; @@ -3985,6 +3976,10 @@ extern UNK_TYPE D_04081628; extern UNK_TYPE D_04083534; extern UNK_TYPE D_04091BE0; extern UNK_TYPE D_04091CE0; +extern TexturePtr D_04091DE0[]; +extern TexturePtr D_04091FE0[]; +extern TexturePtr D_040921E0[]; +extern TexturePtr D_040923E0[]; extern Gfx D_05000C40[]; extern UNK_TYPE D_05001D20; diff --git a/include/z64.h b/include/z64.h index 636449c33..248c0f7ba 100644 --- a/include/z64.h +++ b/include/z64.h @@ -334,26 +334,6 @@ typedef struct { /* 0x24 */ s16 unk_24; } SramContext; // size = 0x28 -typedef struct { - /* 0x00 */ UNK_TYPE4 unk0; - /* 0x04 */ UNK_TYPE4 unk4; - /* 0x08 */ UNK_TYPE4 unk8; - /* 0x0C */ f32 unkC; - /* 0x10 */ Color_RGBA8 unk10; -} TargetContextEntry; // size = 0x14 - -typedef struct { - /* 0x0 */ u32 texture; - /* 0x4 */ s16 unk4; - /* 0x6 */ s16 unk6; - /* 0x8 */ u8 unk8; - /* 0x9 */ u8 unk9; - /* 0xA */ u8 fadeOutDelay; - /* 0xB */ u8 fadeInDelay; - /* 0xC */ s16 alpha; - /* 0xE */ s16 color; -} TitleCardContext; // size = 0x10 - typedef struct { /* 0x0 */ s32 topY; /* 0x4 */ s32 bottomY; @@ -392,15 +372,27 @@ typedef struct { } s80185D40; // size = 0x2C typedef struct { - /* 0x0 */ u8 unk0; - /* 0x1 */ u8 unk1; - /* 0x2 */ u8 unk2; - /* 0x3 */ u8 unk3; - /* 0x4 */ u8 unk4; - /* 0x5 */ u8 unk5; - /* 0x6 */ u8 unk6; - /* 0x7 */ u8 unk7; -} s801AEC84; // size = 0x8 + /* 0x00 */ u32 unk0; + /* 0x04 */ u8 unk4; + /* 0x05 */ u8 unk5; + /* 0x06 */ u8 unk6; + /* 0x07 */ UNK_TYPE1 pad7[0x2]; + /* 0x09 */ u8 unk9; + /* 0x0A */ UNK_TYPE1 padA[0x2]; + /* 0x0C */ u32 unkC; + /* 0x10 */ u16 unk10; + /* 0x12 */ u16 unk12; + /* 0x14 */ u16 unk14; + /* 0x16 */ UNK_TYPE1 pad16[0x2]; + /* 0x18 */ u32 unk18; + /* 0x1C */ u32 unk1C; + /* 0x20 */ u32 unk20; + /* 0x24 */ u32 unk24; + /* 0x28 */ u32 unk28; + /* 0x2C */ u32 unk2C; + /* 0x30 */ u32 unk30; + /* 0x34 */ u32 unk34; +} s8018CFAC; // size = 0x38 typedef struct { /* 0x00 */ Vec3f unk0; @@ -480,13 +472,6 @@ typedef struct { /* 0x10 */ Vec3f relativePos; } SoundSource; // size = 0x1C -typedef struct { - /* 0x00 */ OSContPad cur; - /* 0x06 */ OSContPad prev; - /* 0x0C */ OSContPad press; // X/Y store delta from last frame - /* 0x12 */ OSContPad rel; // X/Y store adjusted -} Input; // size = 0x18 - typedef struct { /* 0x000 */ u32 magic; /* 0x004 */ GraphicsContext* gfxCtx; @@ -743,7 +728,7 @@ typedef struct { /* 0x22 */ u16 unk_22; /* 0x24 */ u16 unk_24; /* 0x26 */ u8 unk_26; - /* 0x28 */ LightInfo unk_28; // sun 1 + /* 0x28 */ LightInfo dirLight1; // sun 1 /* 0x36 */ LightInfo unk_36; // sun 2 /* 0x44 */ s8 unk_44; /* 0x48 */ DmaRequest unk_48; @@ -877,7 +862,9 @@ typedef struct { /* 0x1202A */ u16 unk1202A; /* 0x1202C */ UNK_TYPE1 pad1202C[0x2]; /* 0x1202E */ u16 unk1202E; - /* 0x12030 */ UNK_TYPE1 pad12030[0x14]; + /* 0x12030 */ s16 unk_12030; + /* 0x12032 */ UNK_TYPE1 unk_12032[0x2]; + /* 0x12034 */ UNK_TYPE1 pad12034[0x10]; /* 0x12044 */ s16 unk12044; /* 0x12046 */ UNK_TYPE1 pad12046[0x2]; /* 0x12048 */ u8 unk12048; // EnKakasi @@ -1197,24 +1184,12 @@ typedef enum { STACK_STATUS_OVERFLOW = 2 } StackStatus; -typedef struct TargetContext TargetContext; - -typedef struct ActorContext ActorContext; - -typedef struct s800B948C s800B948C; - struct FireObjLight { /* 0x00 */ LightNode* light; /* 0x04 */ LightInfoPositional lightInfo; /* 0x12 */ u8 unk12; }; // size = 0x13 -typedef struct ActorListEntry { - /* 0x0 */ s32 length; // number of actors loaded of this type - /* 0x4 */ Actor* first; // pointer to first actor of this type - /* 0x8 */ UNK_TYPE1 pad8[0x4]; -} ActorListEntry; // size = 0xC - #define OS_SC_RETRACE_MSG 1 #define OS_SC_DONE_MSG 2 #define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c @@ -1271,72 +1246,6 @@ struct FireObj { /* 0x78 */ FireObjLight light; }; // size = 0x8B -struct TargetContext { - /* 0x00 */ Vec3f unk0; - /* 0x0C */ Vec3f unkC; - /* 0x18 */ Color_RGBAf unk18; - /* 0x28 */ Color_RGBAf unk28; - /* 0x38 */ Actor* unk38; - /* 0x3C */ Actor* unk3C; - /* 0x40 */ f32 unk40; - /* 0x44 */ f32 unk44; - /* 0x48 */ s16 unk48; - /* 0x4A */ u8 unk4A; - /* 0x4B */ u8 unk4B; - /* 0x4C */ s8 unk4C; - /* 0x4D */ UNK_TYPE1 pad4D[0x3]; - /* 0x50 */ TargetContextEntry unk50[3]; - /* 0x8C */ Actor* unk8C; - /* 0x90 */ Actor* unk90; - /* 0x94 */ Actor* unk_94; -}; // size = 0x98 - -struct s800B948C { - /* 0x00 */ GlobalContext* globalCtx; - /* 0x04 */ Actor* actor; - /* 0x08 */ u32 updateActorIfSet; - /* 0x0C */ u32 unkC; - /* 0x10 */ Actor* unk10; - /* 0x14 */ Player* player; - /* 0x18 */ u32 runMainIfSet; // Bitmask of actor flags. The actor will only have main called if it has at least 1 flag set that matches this bitmask -}; // size = 0x1C - -struct ActorContext { - /* 0x000 */ UNK_TYPE1 pad0[0x2]; - /* 0x002 */ u8 unk2; - /* 0x003 */ u8 unk3; - /* 0x004 */ s8 unk4; - /* 0x005 */ u8 unk5; - /* 0x006 */ UNK_TYPE1 pad6[0x5]; - /* 0x00B */ s8 unkB; - /* 0x00C */ s16 unkC; - /* 0x00E */ u8 totalLoadedActors; - /* 0x00F */ u8 undrawnActorCount; - /* 0x010 */ ActorListEntry actorList[12]; - /* 0x0A0 */ Actor* undrawnActors[32]; // Records the first 32 actors drawn each frame - /* 0x120 */ TargetContext targetContext; - /* 0x1B8 */ u32 switchFlags[4]; // First 0x40 are permanent, second 0x40 are temporary - /* 0x1C8 */ u32 chestFlags; - /* 0x1CC */ u32 clearedRooms; - /* 0x1D0 */ u32 clearedRoomsTemp; - /* 0x1D4 */ u32 collectibleFlags[4]; // bitfield of 128 bits - /* 0x1E4 */ TitleCardContext titleCtxt; - /* 0x1F4 */ u8 unk1F4; - /* 0x1F5 */ u8 unk1F5; - /* 0x1F6 */ UNK_TYPE1 pad1F6[0x2]; - /* 0x1F8 */ f32 unk1F8; - /* 0x1FC */ Vec3f unk1FC; - /* 0x208 */ UNK_TYPE1 pad208[0x48]; - /* 0x250 */ void* unk250; // allocation of 0x20f0 bytes? - /* 0x254 */ u32 unk254[5]; - /* 0x268 */ u8 unk268; - /* 0x269 */ UNK_TYPE1 pad269[0x3]; - /* 0x26C */ UNK_TYPE1 pad26C[0xC]; - /* 0x278 */ u16 unk278; - /* 0x27A */ UNK_TYPE1 pad27A[0x2]; - /* 0x27C */ UNK_TYPE1 pad27C[0x8]; -}; // size = 0x284 - typedef struct { /* 0x00 */ u8 seqIndex; /* 0x01 */ u8 nightSeqIndex; @@ -1448,7 +1357,9 @@ struct GlobalContext { /* 0x18B4C */ PreRender pauseBgPreRender; /* 0x18B9C */ char unk_18B9C[0x2B8]; /* 0x18E54 */ SceneTableEntry* loadedScene; - /* 0x18E58 */ char unk_18E58[0x400]; + /* 0x18E58 */ char unk_18E58[0x10]; + /* 0x18E68 */ s32 unk_18E68; + /* 0x18E6C */ char unk_18E6C[0x3EC]; }; // size = 0x19258 typedef struct { @@ -1577,6 +1488,11 @@ typedef struct DebugDispObject { /* 0x2C */ s32 pad; //Padding not in the OOT version } DebugDispObject; // size = 0x30 +typedef struct { + /* 0x0 */ f32 rangeSq; + /* 0x4 */ f32 leashScale; +} TargetRangeParams; // size = 0x8 + typedef struct { /* 0x00 */ u8* value; /* 0x04 */ const char* name; diff --git a/include/z64actor.h b/include/z64actor.h index 9cbf9885e..3ed9e2a33 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -1,5 +1,5 @@ -#ifndef _Z64ACTOR_H_ -#define _Z64ACTOR_H_ +#ifndef Z64ACTOR_H +#define Z64ACTOR_H #include "PR/ultratypes.h" #include "z64math.h" @@ -7,6 +7,8 @@ #include "z64collision_check.h" #include "unk.h" +// This value is hardcoded to be the size of ovl_Arrow_Fire which currently is the biggest actor that uses the AM_FIELD. +#define AM_FIELD_SIZE SEGMENT_SIZE(ovl_Arrow_Fire) #define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions #define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects. @@ -15,6 +17,7 @@ struct GlobalContext; struct Lights; struct CollisionPoly; +struct EnBox; struct EnDoor; typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* globalCtx); @@ -118,6 +121,8 @@ typedef struct { /* 0x10 */ f32 shadowScale; // Changes the size of the shadow /* 0x14 */ u8 shadowAlpha; // Default is 255 /* 0x15 */ u8 feetFloorFlags; // Set if the actor's foot is clipped under the floor. & 1 is right foot, & 2 is left + /* 0x16 */ u8 unk_16; + /* 0x17 */ u8 unk_17; /* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDrawOpa } ActorShape; // size = 0x30 @@ -133,15 +138,15 @@ typedef struct Actor { /* 0x020 */ s16 unk20; /* 0x024 */ PosRot world; // Position/rotation in the world /* 0x038 */ s8 cutscene; - /* 0x039 */ s8 unk39; + /* 0x039 */ u8 audioFlags; // Another set of flags? Seems related to sfx or bgm /* 0x03C */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot - /* 0x050 */ u16 sfx; // SFX ID to play. Sound plays when value is set, then is cleared the following update cycle + /* 0x050 */ u16 sfxId; // Id of sound effect to play. Plays when value is set, then is cleared the following update cycle /* 0x054 */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position /* 0x058 */ Vec3f scale; // Scale of the actor in each axis /* 0x064 */ Vec3f velocity; // Velocity of the actor in each axis /* 0x070 */ f32 speedXZ; // How fast the actor is traveling along the XZ plane /* 0x074 */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame - /* 0x078 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis + /* 0x078 */ f32 terminalVelocity; // Sets the lower bounds cap on velocity along the Y axis /* 0x07C */ struct CollisionPoly* wallPoly; // Wall polygon the actor is touching /* 0x080 */ struct CollisionPoly* floorPoly; // Floor polygon directly below the actor /* 0x084 */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching @@ -170,12 +175,12 @@ typedef struct Actor { /* 0x11C */ u8 colorFilterTimer; // A non-zero value enables the color filter. Decrements automatically /* 0x11D */ u8 isDrawn; // Set to true if the actor is currently being drawn. Always stays false for lens actors /* 0x11E */ u8 dropFlag; // Configures what item is dropped by the actor from `Item_DropCollectibleRandom` - /* 0x11F */ u8 hintId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF + /* 0x11F */ u8 hintId; // Sets what 0600 dialog to display when talking to Tatl. Default 0xFF /* 0x120 */ struct Actor* parent; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild` /* 0x124 */ struct Actor* child; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild` /* 0x128 */ struct Actor* prev; // Previous actor of this category /* 0x12C */ struct Actor* next; // Next actor of this category - /* 0x130 */ ActorFunc init; // Initialization Routine. Called by `Actor_Init` or `Actor_UpdateAll` + /* 0x130 */ ActorFunc init; // Initialization Routine. Called by `Actor_InitContext` or `Actor_UpdateAll` /* 0x134 */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy` /* 0x138 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll` /* 0x13C */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw` @@ -289,7 +294,8 @@ typedef enum { /* 0x08 */ ACTORCAT_MISC, /* 0x09 */ ACTORCAT_BOSS, /* 0x0A */ ACTORCAT_DOOR, - /* 0x0B */ ACTORCAT_CHEST + /* 0x0B */ ACTORCAT_CHEST, + /* 0x0C */ ACTORCAT_MAX } ActorType; typedef struct { @@ -310,6 +316,96 @@ typedef struct { /* 0x0E */ s16 transitionRate; } ActorAnimationEntryS; // size = 0x10 +typedef struct { + /* 0x00 */ Vec3f pos; + /* 0x0C */ f32 unkC; + /* 0x10 */ Color_RGBA8 color; +} TargetContextEntry; // size = 0x14 + +typedef struct TargetContext { + /* 0x00 */ Vec3f unk0; + /* 0x0C */ Vec3f targetCenterPos; + /* 0x18 */ Color_RGBAf fairyInner; + /* 0x28 */ Color_RGBAf fairyOuter; + /* 0x38 */ Actor* arrowPointedActor; + /* 0x3C */ Actor* targetedActor; + /* 0x40 */ f32 unk40; + /* 0x44 */ f32 unk44; + /* 0x48 */ s16 unk48; // alpha + /* 0x4A */ u8 unk4A; + /* 0x4B */ u8 unk4B; + /* 0x4C */ s8 unk4C; + /* 0x4D */ UNK_TYPE1 pad4D[0x3]; + /* 0x50 */ TargetContextEntry unk50[3]; + /* 0x8C */ Actor* unk8C; + /* 0x90 */ Actor* bgmEnemy; + /* 0x94 */ Actor* unk_94; +} TargetContext; // size = 0x98 + +typedef struct { + /* 0x0 */ TexturePtr texture; + /* 0x4 */ s16 x; + /* 0x6 */ s16 y; + /* 0x8 */ u8 width; + /* 0x9 */ u8 height; + /* 0xA */ u8 durationTimer; // how long the title card appears for before fading + /* 0xB */ u8 delayTimer; // how long the title card waits to appear + /* 0xC */ s16 alpha; + /* 0xE */ s16 intensity; +} TitleCardContext; // size = 0x10 + +typedef struct ActorContext_unk_20C { + /* 0x0 */ s16 id; + /* 0x2 */ s8 isDynamicallyInitialised; + /* 0x4 */ void* ptr; +} ActorContext_unk_20C; // size = 0x8 + +typedef struct ActorContextFlags { + /* 0x00 */ u32 switches[4]; // First 0x40 are permanent, second 0x40 are temporary + /* 0x10 */ u32 chest; + /* 0x14 */ u32 clearedRoom; + /* 0x18 */ u32 clearedRoomTemp; + /* 0x1C */ u32 collectible[4]; // bitfield of 128 bits +} ActorContextFlags; // size = 0x2C + +typedef struct ActorListEntry { + /* 0x0 */ s32 length; // number of actors loaded of this type + /* 0x4 */ Actor* first; // pointer to first actor of this type + /* 0x8 */ s32 unk_08; +} ActorListEntry; // size = 0xC + +typedef struct ActorContext { + /* 0x000 */ u8 freezeFlashTimer; + /* 0x001 */ UNK_TYPE1 pad1; + /* 0x002 */ u8 unk2; + /* 0x003 */ u8 unk3; + /* 0x004 */ s8 unk4; + /* 0x005 */ u8 unk5; + /* 0x006 */ UNK_TYPE1 pad6[0x5]; + /* 0x00B */ s8 unkB; + /* 0x00C */ s16 unkC; + /* 0x00E */ u8 totalLoadedActors; + /* 0x00F */ u8 undrawnActorCount; + /* 0x010 */ ActorListEntry actorLists[ACTORCAT_MAX]; + /* 0x0A0 */ Actor* undrawnActors[32]; // Records the first 32 actors drawn each frame + /* 0x120 */ TargetContext targetContext; + /* 0x1B8 */ ActorContextFlags flags; + /* 0x1E4 */ TitleCardContext titleCtxt; + /* 0x1F4 */ u8 unk1F4; + /* 0x1F5 */ u8 unk1F5; + /* 0x1F6 */ UNK_TYPE1 pad1F6[0x2]; + /* 0x1F8 */ f32 unk1F8; + /* 0x1FC */ Vec3f unk1FC; + /* 0x208 */ UNK_TYPE1 unk_208[0x4]; + /* 0x20C */ ActorContext_unk_20C unk_20C[8]; + /* 0x24C */ UNK_TYPE1 unk_24C[0x4]; + /* 0x250 */ void* absoluteSpace; // Space used to allocate actor overlays of alloc type ALLOCTYPE_ABSOLUTE + /* 0x254 */ u32 unk254[5]; + /* 0x268 */ u8 unk268; + /* 0x269 */ UNK_TYPE1 pad269[0x3]; + /* 0x26C */ Input unk_26C; +} ActorContext; // size = 0x284 + typedef enum { /* 0x000 */ ACTOR_PLAYER, /* 0x001 */ ACTOR_EN_TEST, @@ -1004,6 +1100,76 @@ typedef enum { /* 0x2B2 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX" } ActorID; +typedef enum { + /* 0 */ DOORLOCK_NORMAL, + /* 1 */ DOORLOCK_BOSS, + /* 2 */ DOORLOCK_2, // DOORLOCK_NORMAL_SPIRIT on OoT + /* 3 */ DOORLOCK_MAX +} DoorLockType; + +// Targetability / ACTOR_FLAG_TARGETABLE? +#define ACTOR_FLAG_1 (1 << 0) +// +#define ACTOR_FLAG_2 (1 << 1) +// +#define ACTOR_FLAG_4 (1 << 2) +// +#define ACTOR_FLAG_8 (1 << 3) +// +#define ACTOR_FLAG_10 (1 << 4) +// +#define ACTOR_FLAG_20 (1 << 5) +// +#define ACTOR_FLAG_40 (1 << 6) +// Invisible +#define ACTOR_FLAG_80 (1 << 7) +// Related to talk +#define ACTOR_FLAG_100 (1 << 8) +// +#define ACTOR_FLAG_200 (1 << 9) +// +#define ACTOR_FLAG_400 (1 << 10) +// +#define ACTOR_FLAG_800 (1 << 11) +// +#define ACTOR_FLAG_1000 (1 << 12) +// +#define ACTOR_FLAG_2000 (1 << 13) +// +#define ACTOR_FLAG_4000 (1 << 14) +// +#define ACTOR_FLAG_8000 (1 << 15) +// +#define ACTOR_FLAG_10000 (1 << 16) +// +#define ACTOR_FLAG_20000 (1 << 17) +// +#define ACTOR_FLAG_40000 (1 << 18) +// +#define ACTOR_FLAG_80000 (1 << 19) +// +#define ACTOR_FLAG_100000 (1 << 20) +// +#define ACTOR_FLAG_200000 (1 << 21) +// +#define ACTOR_FLAG_400000 (1 << 22) +// +#define ACTOR_FLAG_800000 (1 << 23) +// +#define ACTOR_FLAG_1000000 (1 << 24) +// +#define ACTOR_FLAG_2000000 (1 << 25) +// +#define ACTOR_FLAG_4000000 (1 << 26) +// +#define ACTOR_FLAG_8000000 (1 << 27) +// +#define ACTOR_FLAG_10000000 (1 << 28) +// +#define ACTOR_FLAG_20000000 (1 << 29) +// +#define ACTOR_FLAG_40000000 (1 << 30) + typedef enum { /* 0x00 */ CLEAR_TAG_SMALL_EXPLOSION, /* 0x01 */ CLEAR_TAG_LARGE_EXPLOSION, diff --git a/include/z64item.h b/include/z64item.h index af9c94233..f7ce84a39 100644 --- a/include/z64item.h +++ b/include/z64item.h @@ -343,6 +343,7 @@ typedef enum { /* 0x9F */ GI_SHIELD_HERO_2, // Code that treats this as hero's shield is unused, so take with a grain of salt /* 0xA1 */ GI_LETTER_TO_MAMA = 0xA1, /* 0xA9 */ GI_BOTTLE = 0xA9, + /* 0xAB */ GI_PENDANT_OF_MEMORIES = 0xAB, /* 0xBA */ GI_MAX = 0xBA } GetItemID; @@ -373,4 +374,12 @@ typedef enum { /* 0x68 */ GID_SWORD_GREAT_FAIRY } GetItemDrawID; +// TODO: fill +typedef enum { + /* -1 */ EXCH_ITEM_MINUS1 = -1, // Unknown usage or function + /* 0x00 */ EXCH_ITEM_NONE, + /* 0x1E */ EXCH_ITEM_1E = 0x1E, // BOTTLE_MUSHROOM + /* 0x2A */ EXCH_ITEM_2A = 0x2A // MOON_TEAR? +} ExchangeItemID; + #endif diff --git a/include/z64player.h b/include/z64player.h index 6b156372e..4066e2baf 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1,5 +1,5 @@ -#ifndef _Z64PLAYER_H_ -#define _Z64PLAYER_H_ +#ifndef Z64PLAYER_H +#define Z64PLAYER_H #include "z64actor.h" #include "os.h" @@ -252,7 +252,7 @@ typedef struct Player { /* 0x32A */ Vec3s morphTable[5]; /* 0x348 */ s16 eyeTexId; /* 0x34A */ s16 eyeAnimTimer; - /* 0x34C */ Actor* leftHandActor; + /* 0x34C */ Actor* heldActor; /* 0x350 */ PosRot leftHandWorld; /* 0x364 */ Actor* rightHandActor; /* 0x368 */ PosRot rightHandWorld; @@ -261,12 +261,12 @@ typedef struct Player { /* 0x37E */ s8 doorTimer; /* 0x37F */ s8 doorNext; // used with spiral staircase /* 0x380 */ Actor* doorActor; - /* 0x384 */ s16 unk_384; - /* 0x386 */ u16 unk_386; - /* 0x388 */ Actor* unk_388; - /* 0x38C */ s16 unk_38C; + /* 0x384 */ s16 getItemId; + /* 0x386 */ u16 getItemDirection; + /* 0x388 */ Actor* interactRangeActor; + /* 0x38C */ s8 mountSide; /* 0x390 */ Actor* rideActor; - /* 0x394 */ u8 unk_394; + /* 0x394 */ u8 csMode; /* 0x395 */ u8 unk_395; /* 0x396 */ u8 unk_396; /* 0x397 */ u8 unk_397; @@ -289,7 +289,8 @@ typedef struct Player { /* 0x664 */ ColliderQuad shieldQuad; /* 0x6E4 */ ColliderCylinder shieldCylinder; /* 0x730 */ Actor* unk_730; - /* 0x734 */ char unk_734[8]; + /* 0x734 */ char unk_734[4]; + /* 0x738 */ s32 unk_738; /* 0x73C */ s32 blureEffectIndex[3]; /* 0x748 */ char unk_748[0x320]; /* 0xA68 */ PlayerAgeProperties* ageProperties; // repurposed as "transformation properties"? @@ -301,7 +302,7 @@ typedef struct Player { /* 0xA80 */ Actor* tatlActor; /* 0xA84 */ s16 tatlTextId; /* 0xA86 */ s8 unk_A86; - /* 0xA87 */ s8 unk_A87; + /* 0xA87 */ s8 exchangeItemId; /* 0xA88 */ Actor* targetActor; /* 0xA8C */ f32 targetActorDistance; /* 0xA90 */ Actor* unk_A90; diff --git a/include/z64save.h b/include/z64save.h index 63d0372dc..8e08a550a 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -174,7 +174,7 @@ typedef struct { /* 0x3F5C */ s32 unk_3F5C; // "bet_rupees" /* 0x3F60 */ u8 unk_3F60; // "framescale_flag" /* 0x3F64 */ f32 unk_3F64; // "framescale_scale" - /* 0x3F68 */ u32 unk_3F68[5][120]; + /* 0x3F68 */ u32 cycleSceneFlags[120][5]; /* 0x48C8 */ u16 unk_48C8; // "scene_id_mix" /* 0x48CA */ u8 maskMaskBit[3]; // masks given away on the Moon /* 0x48CD */ char unk_48CD[24]; diff --git a/include/z64scene.h b/include/z64scene.h index 333569974..8d301d1d1 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -295,7 +295,7 @@ typedef struct { /* 0x04 */ s16 id; /* 0x06 */ Vec3s pos; /* 0x0C */ s16 rotY; - /* 0x0E */ s16 params; + /* 0x0E */ u16 params; } TransitionActorEntry; // size = 0x10 typedef struct { diff --git a/spec b/spec index e2c4e9d4f..20c127ac2 100644 --- a/spec +++ b/spec @@ -441,7 +441,6 @@ beginseg include "build/src/code/pad_801DC9C0.o" include "build/src/code/z_DLF.o" include "build/src/code/z_actor.o" - include "build/data/code/z_actor.data.o" include "build/data/code/z_actor.bss.o" include "build/src/code/z_actor_dlftbls.o" include "build/src/code/z_bgcheck.o" diff --git a/src/boot_O2/__osMalloc.c b/src/boot_O2/__osMalloc.c index 503c7c25a..c74c34866 100644 --- a/src/boot_O2/__osMalloc.c +++ b/src/boot_O2/__osMalloc.c @@ -182,7 +182,7 @@ void __osFree(Arena* arena, void* ptr) { ArenaNode* newNext; ArenaImpl_Lock(arena); - node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); + node = (ArenaNode*)((uintptr_t)ptr - sizeof(ArenaNode)); if (ptr == NULL || (node->magic != NODE_MAGIC) || node->isFree) { goto end; @@ -190,10 +190,10 @@ void __osFree(Arena* arena, void* ptr) { next = node->next; prev = node->prev; - node->isFree = 1; + node->isFree = true; newNext = next; - if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) { + if ((uintptr_t)next == (uintptr_t)node + sizeof(ArenaNode) + node->size && next->isFree) { newNext = next->next; if (newNext != NULL) { newNext->prev = node; @@ -205,7 +205,7 @@ void __osFree(Arena* arena, void* ptr) { next = newNext; } - if (prev != NULL && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) { + if (prev != NULL && prev->isFree && (uintptr_t)node == (uintptr_t)prev + sizeof(ArenaNode) + prev->size) { if (next) { next->prev = prev; } diff --git a/src/boot_O2_g3/z_std_dma.c b/src/boot_O2_g3/z_std_dma.c index ebf390924..190536b21 100644 --- a/src/boot_O2_g3/z_std_dma.c +++ b/src/boot_O2_g3/z_std_dma.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" u32 sDmaMgrDmaBuffSize = 0x2000; diff --git a/src/buffers/gfxyield.c b/src/buffers/gfxyield.c index 73810d4ac..94a5f55c9 100644 --- a/src/buffers/gfxyield.c +++ b/src/buffers/gfxyield.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; diff --git a/src/code/audio/code_801A5BD0.c b/src/code/audio/code_801A5BD0.c index 32889dcb8..0a13b00ec 100644 --- a/src/code/audio/code_801A5BD0.c +++ b/src/code/audio/code_801A5BD0.c @@ -6,7 +6,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/func_801A5C8C.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/func_801A5CFC.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/Audio_PlaySfxGeneral.s") #pragma GLOBAL_ASM("asm/non_matchings/code/code_801A5BD0/func_801A5DDC.s") diff --git a/src/code/graph.c b/src/code/graph.c index b874fef51..e09cfedc4 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -97,7 +97,7 @@ void* Graph_FaultAddrConvFunc(void* address, void* param) { s32 i; for (i = 0; i < graphNumGameStates; i++, gamestateOvl++) { - diff = (uintptr_t)gamestateOvl->vramEnd - (uintptr_t)gamestateOvl->vramStart; + diff = VRAM_PTR_SIZE(gamestateOvl); ramStart = gamestateOvl->loadedRamAddr; ramConv = (uintptr_t)gamestateOvl->vramStart - (uintptr_t)ramStart; diff --git a/src/code/sched.c b/src/code/sched.c index 927a48f66..5f9cdf236 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #define RSP_DONE_MSG 667 diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 50fd1211e..d676a437c 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -138,7 +138,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_IsPointInSphere.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D668.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PointDistToLine2D.s") #pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D7C0.s") diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 42f67987a..49eee7235 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,7 +1,44 @@ +/* + * File: z_actor.c + * Description: + */ + #include "global.h" +#include "overlays/actors/ovl_En_Horse/z_en_horse.h" +#include "overlays/actors/ovl_En_Part/z_en_part.h" +#include "overlays/actors/ovl_En_Box/z_en_box.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" +#include "objects/object_bdoor/object_bdoor.h" + +// bss +extern FaultClient sActorFaultClient; // 2 funcs +extern CollisionPoly* D_801ED8B0; // 1 func +extern s32 D_801ED8B4; // 2 funcs +extern Actor* D_801ED8B8; // 2 funcs +extern Actor* D_801ED8BC; // 2 funcs +extern Actor* D_801ED8C0; // 2 funcs +extern Actor* D_801ED8C4; // 2 funcs +extern f32 D_801ED8C8; // 2 funcs +extern f32 sBgmEnemyDistSq; // 2 funcs +extern f32 D_801ED8D0; // 2 funcs +extern s32 D_801ED8D4; // 2 funcs +extern s32 D_801ED8D8; // 2 funcs +extern s16 D_801ED8DC; // 2 funcs +extern Mtx D_801ED8E0; // 1 func +extern Actor* D_801ED920; // 2 funcs. 1 out of z_actor + +// Internal forward declarations +void func_800BA8B8(GlobalContext* globalCtx, ActorContext* actorCtx); +Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx); +Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx); +void func_800BB8EC(GameState* gameState, ActorContext* actorCtx, Actor** arg2, Actor** arg3, Player* player); +s32 func_800BA2FC(GlobalContext* globalCtx, Actor* actor, Vec3f* projectedPos, f32 projectedW); +void Actor_AddToCategory(ActorContext* actorCtx, Actor* actor, u8 actorCategory); +Actor* Actor_RemoveFromCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove); void Actor_PrintLists(ActorContext* actorCtx) { - ActorListEntry* actorList = &actorCtx->actorList[0]; + ActorListEntry* actorList = &actorCtx->actorLists[0]; Actor* actor; s32 i; @@ -9,7 +46,7 @@ void Actor_PrintLists(ActorContext* actorCtx) { FaultDrawer_Printf("actor\n", gMaxActorId); FaultDrawer_Printf("No. Actor Name Part SegName\n"); - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { actor = actorList[i].first; while (actor != NULL) { @@ -26,7 +63,6 @@ void ActorShape_Init(ActorShape* actorShape, f32 yOffset, ActorShadowFunc shadow actorShape->shadowAlpha = 255; } -#ifdef NON_MATCHING void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* dlist, Color_RGBA8* color) { if (actor->floorPoly != NULL) { f32 dy = actor->world.pos.y - actor->floorHeight; @@ -43,7 +79,10 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gf COMBINED); dy = CLAMP(dy, 0.0f, 150.0f); - shadowScale = 1.0f - (dy * 0.0028571428f); + shadowScale = 1.0f - (dy * (1.0f / 350.0f)); + if ((dy * (1.0f / 350.0f)) > 1.0f) { + shadowScale = 0.0f; + } if (color != NULL) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color->r, color->g, color->b, @@ -55,13 +94,12 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gf func_800C0094(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &mtx); Matrix_SetCurrentState(&mtx); - if (dlist != D_04076BC0) { - Matrix_RotateY((f32)actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); + if ((dlist != gCircleShadowDL) || (actor->scale.x != actor->scale.z)) { + Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY); } - shadowScale = 1.0f - (dy * 0.0028571428f); shadowScale *= actor->shape.shadowScale; - Matrix_Scale(shadowScale * actor->scale.x, 1.0f, shadowScale * actor->scale.z, MTXMODE_APPLY); + Matrix_Scale(actor->scale.x * shadowScale, 1.0f, actor->scale.z * shadowScale, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, dlist); @@ -70,244 +108,949 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gf } } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_Draw.s") -#endif -/* ActorShadow_DrawCircle */ -void func_800B3FC0(Actor* actor, Lights* lights, GlobalContext* globalCtx) { +void ActorShadow_DrawCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { if (actor->bgCheckFlags & 0x400) { func_800B4AEC(globalCtx, actor, 50.0f); } - ActorShadow_Draw(actor, lights, globalCtx, D_04076BC0, NULL); + ActorShadow_Draw(actor, lights, globalCtx, gCircleShadowDL, NULL); } -/* ActorShadow_DrawSquare */ -void func_800B4024(Actor* actor, Lights* lights, GlobalContext* globalCtx) { +void ActorShadow_DrawSquare(Actor* actor, Lights* lights, GlobalContext* globalCtx) { if (actor->bgCheckFlags & 0x400) { func_800B4AEC(globalCtx, actor, 50.0f); } - ActorShadow_Draw(actor, lights, globalCtx, D_04075A40, NULL); + ActorShadow_Draw(actor, lights, globalCtx, gSquareShadowDL, NULL); } -/* ActorShadow_DrawWhiteCircle */ -void func_800B4088(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - ActorShadow_Draw(actor, lights, globalCtx, D_04076BC0, &D_801AEC80); +void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + static Color_RGBA8 color = { 255, 255, 255, 255 }; + + ActorShadow_Draw(actor, lights, globalCtx, gCircleShadowDL, &color); } -/* ActorShadow_DrawHorse */ -void func_800B40B8(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - ActorShadow_Draw(actor, lights, globalCtx, D_04077480, NULL); +void ActorShadow_DrawHorse(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + ActorShadow_Draw(actor, lights, globalCtx, gHorseShadowDL, NULL); } -/* ActorShadow_DrawFoot */ -#ifdef NON_MATCHING -void func_800B40E0(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { - s32 pad1; +void ActorShadow_DrawFoot(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 lightNum, f32 shadowAlpha, + f32 shadowScaleX, f32 shadowScaleZ) { + s32 pad; s16 sp58; - s32 pad2[2]; + f32 dir2; + f32 dir0; OPEN_DISPS(globalCtx->state.gfxCtx); - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, - (u32)(((arg3 * 1.3e-05f) > 1.0f ? 1.0f : (arg3 * 1.3e-05f)) * arg4) & 0xFF); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u8)(CLAMP_MAX(lightNum * 1.3e-05f, 1.0f) * shadowAlpha)); - sp58 = Math_FAtan2F(light->l.dir[0], light->l.dir[2]); - arg6 *= (4.5f - (light->l.dir[1] * 0.035f)); - arg6 = (arg6 < 1.0f) ? 1.0f : arg6; + dir0 = light->l.dir[0]; + dir2 = light->l.dir[2]; + sp58 = Math_FAtan2F(dir2, dir0); + shadowScaleZ *= (4.5f - (light->l.dir[1] * 0.035f)); + shadowScaleZ = CLAMP_MIN(shadowScaleZ, 1.0f); Matrix_SetCurrentState(arg2); Matrix_RotateY(sp58, MTXMODE_APPLY); - Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY); + Matrix_Scale(shadowScaleX, 1.0f, shadowScaleX * shadowScaleZ, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(POLY_OPA_DISP++, D_04075B30); + gSPDisplayList(POLY_OPA_DISP++, gFootShadowDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B40E0.s") -#endif -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B42F8.s") +void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx) { + f32 distToFloor = actor->world.pos.y - actor->floorHeight; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B4A98.s") + if (distToFloor > 0.0f) { + f32 shadowScale = actor->shape.shadowScale; + u8 shadowAlpha = actor->shape.shadowAlpha; + f32 alphaRatio; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B4AEC.s") + if ((actor->id == ACTOR_PLAYER) && (((Player*)actor)->stateFlags3 & 0x8000)) { + f32 tmpScaleZ = actor->scale.z; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B4B50.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B4EDC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B4F40.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B4F78.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B5040.s") - -void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx) { - targetCtx->unk90 = NULL; - targetCtx->unk8C = NULL; - targetCtx->unk3C = NULL; - targetCtx->unk38 = NULL; - targetCtx->unk4B = 0; - targetCtx->unk4C = 0; - targetCtx->unk40 = 0; - func_800B5040(targetCtx, actor, actor->category, globalCtx); - func_800B4F78(targetCtx, actor->category, globalCtx); -} - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B5208.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B5814.s") - -u32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) { - if (flag >= 0 && flag < 0x80) { - return globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F)); - } - return 0; -} - -void Actor_SetSwitchFlag(GlobalContext* globalCtx, s32 flag) { - if (flag >= 0 && flag < 0x80) { - globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] |= 1 << (flag & 0x1F); - } -} - -void Actor_UnsetSwitchFlag(GlobalContext* globalCtx, s32 flag) { - if (flag >= 0 && flag < 0x80) { - globalCtx->actorCtx.switchFlags[(flag & -0x20) >> 5] &= ~(1 << (flag & 0x1F)); - } -} - -u32 Actor_GetChestFlag(GlobalContext* globalCtx, u32 flag) { - return globalCtx->actorCtx.chestFlags & (1 << flag); -} - -void Actor_SetChestFlag(GlobalContext* globalCtx, u32 flag) { - globalCtx->actorCtx.chestFlags |= (1 << flag); -} - -void Actor_SetAllChestFlag(GlobalContext* globalCtx, u32 flag) { - globalCtx->actorCtx.chestFlags = flag; -} - -u32 Actor_GetAllChestFlag(GlobalContext* globalCtx) { - return globalCtx->actorCtx.chestFlags; -} - -u32 Actor_GetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) { - return globalCtx->actorCtx.clearedRooms & (1 << roomNumber); -} - -void Actor_SetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) { - globalCtx->actorCtx.clearedRooms |= (1 << roomNumber); -} - -void Actor_UnsetRoomCleared(GlobalContext* globalCtx, u32 roomNumber) { - globalCtx->actorCtx.clearedRooms &= ~(1 << roomNumber); -} - -u32 Actor_GetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) { - return globalCtx->actorCtx.clearedRoomsTemp & (1 << roomNumber); -} - -void Actor_SetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) { - globalCtx->actorCtx.clearedRoomsTemp |= (1 << roomNumber); -} - -void Actor_UnsetRoomClearedTemp(GlobalContext* globalCtx, u32 roomNumber) { - globalCtx->actorCtx.clearedRoomsTemp &= ~(1 << roomNumber); -} - -u32 Actor_GetCollectibleFlag(GlobalContext* globalCtx, s32 index) { - if (index > 0 && index < 0x80) { - return globalCtx->actorCtx.collectibleFlags[(index & -0x20) >> 5] & (1 << (index & 0x1F)); - } - return 0; -} - -void Actor_SetCollectibleFlag(GlobalContext* globalCtx, s32 index) { - if (index > 0 && index < 0x80) { - globalCtx->actorCtx.collectibleFlags[(index & -0x20) >> 5] |= 1 << (index & 0x1F); - } -} - -void Actor_TitleCardContextInit(GlobalContext* globalCtx, TitleCardContext* titleCardCtx) { - titleCardCtx->fadeOutDelay = 0; - titleCardCtx->fadeInDelay = 0; - titleCardCtx->color = 0; - titleCardCtx->alpha = 0; -} - -void Actor_TitleCardCreate(GlobalContext* globalCtx, TitleCardContext* titleCardCtx, u32 texture, s16 param_4, - s16 param_5, u8 param_6, u8 param_7) { - titleCardCtx->texture = texture; - titleCardCtx->unk4 = param_4; - titleCardCtx->unk6 = param_5; - titleCardCtx->unk8 = param_6; - titleCardCtx->unk9 = param_7; - titleCardCtx->fadeOutDelay = 80; - titleCardCtx->fadeInDelay = 0; -} - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_Nop800B5E50.s") - -void Actor_TitleCardUpdate(GlobalContext* globalCtx, TitleCardContext* titleCardCtx) { - if (DECR(titleCardCtx->fadeInDelay) == 0) { - if (DECR(titleCardCtx->fadeOutDelay) == 0) { - Math_StepToS(&titleCardCtx->alpha, 0, 30); - Math_StepToS(&titleCardCtx->color, 0, 70); + actor->scale.z += 0.03f * fabsf(Math_CosS(((Player*)actor)->unk_AAA)); + actor->shape.shadowScale *= 0.2f; + alphaRatio = distToFloor * 0.03f; + actor->shape.shadowAlpha = actor->shape.shadowAlpha * CLAMP_MAX(alphaRatio, 1.0f); + ActorShadow_Draw(actor, mapper, globalCtx, gCircleShadowDL, NULL); + actor->scale.z = tmpScaleZ; } else { - Math_StepToS(&titleCardCtx->alpha, 255, 10); - Math_StepToS(&titleCardCtx->color, 255, 20); + actor->shape.shadowScale *= 0.3f; + alphaRatio = (distToFloor - 20.0f) * 0.02f; + actor->shape.shadowAlpha = actor->shape.shadowAlpha * CLAMP_MAX(alphaRatio, 1.0f); + ActorShadow_DrawCircle(actor, mapper, globalCtx); + } + + actor->shape.shadowScale = shadowScale; + actor->shape.shadowAlpha = shadowAlpha; + } + + if (distToFloor < 200.0f) { + MtxF sp13C; + MtxF spFC; + CollisionPoly* spF8; + s32 bgId; + f32 floorHeight[2]; + f32 pad; + f32 shadowAlpha; + f32 shadowScaleX; + f32 shadowScaleZ; + Light* lightPtr; + s32 lightNumMax; + s32 i; + s32 j; + s32 lightNum; + Vec3f* feetPosPtr; + s32 numLights; + f32* floorHeightPtr; + s32 spB8; + + numLights = mapper->numLights - 2; + feetPosPtr = actor->shape.feetPos; + floorHeightPtr = floorHeight; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP, 0x2C); + actor->shape.feetFloorFlags = 0; + spB8 = 2; + + for (i = 0; i < ARRAY_COUNT(floorHeight); i++, spB8 >>= 1) { + feetPosPtr->y += 50.0f; + *floorHeightPtr = func_80169100(globalCtx, &sp13C, &spF8, &bgId, feetPosPtr); + feetPosPtr->y -= 50.0f; + + distToFloor = feetPosPtr->y - *floorHeightPtr; + if ((distToFloor >= -1.0f) && (distToFloor < 500.0f)) { + lightNumMax = 0; + + if (distToFloor <= 10.0f) { + actor->shape.feetFloorFlags |= spB8; + + if ((actor->depthInWater < 0.0f) && (bgId == 0x32) && ((actor->shape.unk_17 & spB8) != 0)) { + if (func_800C9C24(&globalCtx->colCtx, spF8, bgId, 1) != 0) { + SkinMatrix_MtxFCopy(&sp13C, &spFC); + SkinMatrix_MulYRotation(&spFC, actor->shape.rot.y); + EffFootmark_Add(globalCtx, &spFC, actor, i, feetPosPtr, (actor->shape.shadowScale * 0.3f), + IREG(88) + 80, IREG(89) + 60, IREG(90) + 40, 30000, 200, 60); + } + actor->shape.unk_17 &= ~spB8; + + if (!mapper->l.l) {} // POSSIBLE FAKE MATCH + } + } + + if (distToFloor > 30.0f) { + distToFloor = 30.0f; + } + + shadowAlpha = actor->shape.shadowAlpha * (1.0f - (distToFloor * (1 / 30.0f))); + shadowScaleZ = 1.0f - (distToFloor * (1.0f / 70.0f)); + shadowScaleX = actor->shape.shadowScale * shadowScaleZ * actor->scale.x; + + for (lightPtr = mapper->l.l, j = 0; j < numLights; lightPtr++, j++) { + if (lightPtr->l.dir[1] > 0) { + lightNum = (lightPtr->l.col[0] + lightPtr->l.col[1] + lightPtr->l.col[2]) * + ABS_ALT(lightPtr->l.dir[1]); + + if (lightNum > 0) { + lightNumMax += lightNum; + ActorShadow_DrawFoot(globalCtx, lightPtr, &sp13C, lightNum, shadowAlpha, shadowScaleX, + shadowScaleZ); + } + } + } + + for (j = 0; j < 2; lightPtr++, j++) { + if (lightPtr->l.dir[1] > 0) { + lightNum = ((lightPtr->l.col[0] + lightPtr->l.col[1] + lightPtr->l.col[2]) * + ABS_ALT(lightPtr->l.dir[1])) - + (lightNumMax * 8); + if (lightNum > 0) { + ActorShadow_DrawFoot(globalCtx, lightPtr, &sp13C, lightNum, shadowAlpha, shadowScaleX, + shadowScaleZ); + } + } + } + } + feetPosPtr++; + floorHeightPtr++; + } + + if (!(actor->bgCheckFlags & 1)) { + actor->shape.feetFloorFlags = 0; + } else if (actor->shape.feetFloorFlags == 3) { + f32 footDistY = actor->shape.feetPos[FOOT_LEFT].y - actor->shape.feetPos[FOOT_RIGHT].y; + + if ((floorHeight[0] + footDistY) < (floorHeight[1] - footDistY)) { + actor->shape.feetFloorFlags = 2; + } else { + actor->shape.feetFloorFlags = 1; + } + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } +} + +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, + Vec3f* rightFootPos) { + if (limbIndex == leftFootIndex) { + Matrix_MultiplyVector3fByState(leftFootPos, &actor->shape.feetPos[FOOT_LEFT]); + } else if (limbIndex == rightFootIndex) { + Matrix_MultiplyVector3fByState(rightFootPos, &actor->shape.feetPos[FOOT_RIGHT]); + } +} + +void func_800B4AEC(GlobalContext* globalCtx, Actor* actor, f32 y) { + s32 floorBgId; + f32 yPos = actor->world.pos.y; + + actor->world.pos.y += y; + actor->floorHeight = BgCheck_EntityRaycastFloor5_2(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &floorBgId, + actor, &actor->world.pos); + actor->floorBgId = floorBgId; + actor->world.pos.y = yPos; +} + +void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) { + f32 spEC; + f32 temp_f12; + f32 temp_f20; + f32 shadowScaleZ; + f32 temp_f22; + f32 temp_f24; + f32 temp_f8; + MtxF sp94; + s32 lightNum; + s32 numLights; + s8 phi_v1; + u8 temp_v0; + Light* phi_s0; + s32 lightNumMax; + + if (actor->bgCheckFlags & 0x400) { + func_800B4AEC(globalCtx, actor, 50.0f); + } + + if (actor->floorPoly != NULL) { + s32 j; + + spEC = actor->world.pos.y - actor->floorHeight; + if (spEC > 20.0f) { + temp_f20 = actor->shape.shadowScale; + temp_v0 = actor->shape.shadowAlpha; + actor->shape.shadowScale *= 0.3f; + temp_f12 = (spEC - 20.0f) * 0.02f; + actor->shape.shadowAlpha = CLAMP_MAX(temp_f12, 1.0f) * actor->shape.shadowAlpha; + ActorShadow_DrawCircle(actor, mapper, globalCtx); + actor->shape.shadowScale = temp_f20; + actor->shape.shadowAlpha = temp_v0; + dummy_label_111649:; + } else if (spEC >= -1.0f) { + numLights = mapper->numLights - 2; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP, 0x2C); + + func_800C0094(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &sp94); + temp_f22 = (f32)actor->shape.shadowAlpha * (1.0f - (spEC * (1.0f / 30.0f))); + phi_s0 = mapper->l.l; + shadowScaleZ = 1.0f - (spEC * (1.0f / 70.0f)); + temp_f24 = actor->shape.shadowScale * shadowScaleZ * actor->scale.x; + + lightNumMax = 0; + for (j = 0; j < numLights; j++, phi_s0++) { + if (phi_s0->l.dir[1] > 0) { + lightNum = (phi_s0->l.col[0] + phi_s0->l.col[1] + phi_s0->l.col[2]) * ABS_ALT(phi_s0->l.dir[1]); + if (lightNum > 0) { + lightNumMax += lightNum; + ActorShadow_DrawFoot(globalCtx, phi_s0, &sp94, lightNum, temp_f22, temp_f24, shadowScaleZ); + } + } + } + + for (j = 0; j < 2; j++, phi_s0++) { + if (phi_s0->l.dir[1] > 0) { + lightNum = (ABS_ALT(phi_s0->l.dir[1]) * (phi_s0->l.col[0] + phi_s0->l.col[1] + phi_s0->l.col[2])) - + (lightNumMax * ((void)0, 8)); + if (lightNum > 0) { + ActorShadow_DrawFoot(globalCtx, phi_s0, &sp94, lightNum, temp_f22, temp_f24, shadowScaleZ); + } + } + } + CLOSE_DISPS(globalCtx->state.gfxCtx); } } } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_TitleCardDraw.s") +void Actor_GetProjectedPos(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3) { + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, arg1, arg2, arg3); + if (*arg3 < 1.0f) { + *arg3 = 1.0f; + } else { + *arg3 = 1.0f / *arg3; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6434.s") +void Target_SetPos(TargetContext* targetCtx, s32 index, f32 x, f32 y, f32 z) { + targetCtx->unk50[index].pos.x = x; + targetCtx->unk50[index].pos.y = y; + targetCtx->unk50[index].pos.z = z; + targetCtx->unk50[index].unkC = targetCtx->unk44; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6468.s") +typedef struct { + /* 0x0 */ Color_RGBA8 inner; + /* 0x4 */ Color_RGBA8 outer; +} TatlColor; // size = 0x8 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6474.s") +TatlColor sTatlColorList[] = { + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, + { { 255, 255, 230, 255 }, { 220, 160, 80, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, + { { 150, 150, 255, 255 }, { 150, 150, 255, 0 } }, { { 255, 255, 0, 255 }, { 200, 155, 0, 0 } }, + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 255, 255, 0, 255 }, { 200, 155, 0, 0 } }, + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } }, + { { 0, 255, 0, 255 }, { 0, 255, 0, 0 } } +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B648C.s") +void func_800B4F78(TargetContext* targetCtx, s32 type, GlobalContext* globalCtx) { + TatlColor* tatlColorEntry; + s32 i; + TargetContextEntry* targetEntry; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B64FC.s") + Math_Vec3f_Copy(&targetCtx->targetCenterPos, &globalCtx->view.eye); + targetCtx->unk48 = 0x100; + tatlColorEntry = &sTatlColorList[type]; + targetCtx->unk44 = 500.0f; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6584.s") + targetEntry = targetCtx->unk50; + for (i = 0; i < ARRAY_COUNT(targetCtx->unk50); i++, targetEntry++) { + Target_SetPos(targetCtx, i, 0.0f, 0.0f, 0.0f); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6608.s") + targetEntry->color.r = tatlColorEntry->inner.r; + targetEntry->color.g = tatlColorEntry->inner.g; + targetEntry->color.b = tatlColorEntry->inner.b; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6680.s") +void Target_SetColors(TargetContext* targetCtx, Actor* actor, s32 type, GlobalContext* globalCtx) { + targetCtx->unk0.x = actor->focus.pos.x; + targetCtx->unk0.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y); + targetCtx->unk0.z = actor->focus.pos.z; + + targetCtx->fairyInner.r = sTatlColorList[type].inner.r; + targetCtx->fairyInner.g = sTatlColorList[type].inner.g; + targetCtx->fairyInner.b = sTatlColorList[type].inner.b; + targetCtx->fairyInner.a = sTatlColorList[type].inner.a; + targetCtx->fairyOuter.r = sTatlColorList[type].outer.r; + targetCtx->fairyOuter.g = sTatlColorList[type].outer.g; + targetCtx->fairyOuter.b = sTatlColorList[type].outer.b; + targetCtx->fairyOuter.a = sTatlColorList[type].outer.a; +} + +void Actor_TargetContextInit(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx) { + targetCtx->bgmEnemy = NULL; + targetCtx->unk8C = NULL; + targetCtx->targetedActor = NULL; + targetCtx->arrowPointedActor = NULL; + targetCtx->unk4B = 0; + targetCtx->unk4C = 0; + targetCtx->unk40 = 0.0f; + Target_SetColors(targetCtx, actor, actor->category, globalCtx); + func_800B4F78(targetCtx, actor->category, globalCtx); +} + +void Actor_DrawZTarget(TargetContext* targetCtx, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + if (!(player->stateFlags1 & 0x300006C2)) { + Actor* actor = targetCtx->targetedActor; + + OPEN_DISPS(globalCtx->state.gfxCtx); + if (targetCtx->unk48 != 0) { + TargetContextEntry* entry; + s16 alpha = 255; + f32 var1 = 1.0f; + Vec3f spBC; + s32 spB8; + f32 spB4; + s32 spB0; + s32 spAC; + f32 var2; + s32 i; + + if (targetCtx->unk4B != 0) { + spB8 = 1; + } else { + spB8 = 3; + } + + if (actor != NULL) { + Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->focus.pos); + var1 = (500.0f - targetCtx->unk44) / 420.0f; + } else { + targetCtx->unk48 -= 120; + if (targetCtx->unk48 < 0) { + targetCtx->unk48 = 0; + } + alpha = targetCtx->unk48; + } + + Actor_GetProjectedPos(globalCtx, &targetCtx->targetCenterPos, &spBC, &spB4); + + spBC.x = (160 * (spBC.x * spB4)) * var1; + spBC.x = CLAMP(spBC.x, -320.0f, 320.0f); + + spBC.y = (120 * (spBC.y * spB4)) * var1; + spBC.y = CLAMP(spBC.y, -240.0f, 240.0f); + + spBC.z = spBC.z * var1; + + targetCtx->unk4C--; + if (targetCtx->unk4C < 0) { + targetCtx->unk4C = 2; + } + + Target_SetPos(targetCtx, targetCtx->unk4C, spBC.x, spBC.y, spBC.z); + + if ((!(player->stateFlags1 & 0x40)) || (actor != player->unk_730)) { + OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x39); + + for (spB0 = 0, spAC = targetCtx->unk4C; spB0 < spB8; spB0++, spAC = (spAC + 1) % 3) { + entry = &targetCtx->unk50[spAC]; + + if (entry->unkC < 500.0f) { + if (entry->unkC <= 120.0f) { + var2 = 0.15f; + } else { + var2 = ((entry->unkC - 120.0f) * 0.001f) + 0.15f; + } + + Matrix_InsertTranslation(entry->pos.x, entry->pos.y, 0.0f, MTXMODE_NEW); + Matrix_Scale(var2, 0.15f, 1.0f, MTXMODE_APPLY); + + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, entry->color.r, entry->color.g, entry->color.b, + (u8)alpha); + + Matrix_InsertZRotation_s((targetCtx->unk4B * 512), MTXMODE_APPLY); + + for (i = 0; i < 4; i++) { + Matrix_InsertZRotation_s(0x4000, MTXMODE_APPLY); + Matrix_StatePush(); + Matrix_InsertTranslation(entry->unkC, entry->unkC, 0.0f, MTXMODE_APPLY); + gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_MODELVIEW | G_MTX_LOAD); + gSPDisplayList(OVERLAY_DISP++, gZTargetLockOnTriangleDL); + Matrix_StatePop(); + } + } + + alpha -= 255 / 3; + if (alpha < 0) { + alpha = 0; + } + } + } + } + + actor = targetCtx->unk_94; + if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_8000000)) { + TatlColor* color = &sTatlColorList[actor->category]; + + POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x07); + + Matrix_InsertTranslation(actor->focus.pos.x, + actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y) + 17.0f, + actor->focus.pos.z, MTXMODE_NEW); + Matrix_RotateY((globalCtx->gameplayFrames * 3000), MTXMODE_APPLY); + Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, + MTXMODE_APPLY); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, color->inner.r, color->inner.g, color->inner.b, 255); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); + gSPDisplayList(POLY_XLU_DISP++, gZTargetArrowDL); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } +} + +// OoT: func_8002C7BC +void func_800B5814(TargetContext* targetCtx, Player* player, Actor* actor, GameState* gameState) { + GlobalContext* globalCtx = (GlobalContext*)gameState; + Actor* sp68 = NULL; + s32 category; + Vec3f sp58; + f32 sp54; + + if ((player->unk_730 != 0) && (player->unk_AE3[player->unk_ADE] == 2)) { + targetCtx->unk_94 = NULL; + } else { + func_800BB8EC(gameState, &globalCtx->actorCtx, &sp68, &D_801ED920, player); + targetCtx->unk_94 = sp68; + } + + if (targetCtx->unk8C != 0) { + sp68 = targetCtx->unk8C; + targetCtx->unk8C = NULL; + } else if (actor != 0) { + sp68 = actor; + } + + if (sp68 != NULL) { + category = sp68->category; + } else { + category = player->actor.category; + } + + if ((sp68 != targetCtx->arrowPointedActor) || (category != targetCtx->unk4A)) { + targetCtx->arrowPointedActor = sp68; + targetCtx->unk4A = category; + targetCtx->unk40 = 1.0f; + } + + if (sp68 == NULL) { + sp68 = &player->actor; + } + + if (!Math_StepToF(&targetCtx->unk40, 0.0f, 0.25f)) { + f32 temp_f0; + f32 x; + f32 y; + f32 z; + + temp_f0 = 0.25f / targetCtx->unk40; + + x = sp68->focus.pos.x - targetCtx->unk0.x; + y = (sp68->focus.pos.y + (sp68->targetArrowOffset * sp68->scale.y)) - targetCtx->unk0.y; + z = sp68->focus.pos.z - targetCtx->unk0.z; + + targetCtx->unk0.x += x * temp_f0; + targetCtx->unk0.y += y * temp_f0; + targetCtx->unk0.z += z * temp_f0; + } else { + Target_SetColors(targetCtx, sp68, category, globalCtx); + } + + if (actor != NULL && targetCtx->unk4B == 0) { + Actor_GetProjectedPos(globalCtx, &actor->focus.pos, &sp58, &sp54); + if ((sp58.z <= 0.0f) || (fabsf(sp58.x * sp54) >= 1.0f) || (fabsf(sp58.y * sp54) >= 1.0f)) { + actor = NULL; + } + } + + if (actor != NULL) { + if (actor != targetCtx->targetedActor) { + s32 sfxId; + + func_800B4F78(targetCtx, actor->category, globalCtx); + + targetCtx->targetedActor = actor; + + if (actor->id == ACTOR_EN_BOOM) { + targetCtx->unk48 = 0; + } + + sfxId = + CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_4 | ACTOR_FLAG_1) ? NA_SE_SY_LOCK_ON : NA_SE_SY_LOCK_ON_HUMAN; + play_sound(sfxId); + } + + targetCtx->targetCenterPos.x = actor->world.pos.x; + targetCtx->targetCenterPos.y = actor->world.pos.y - (actor->shape.yOffset * actor->scale.y); + targetCtx->targetCenterPos.z = actor->world.pos.z; + + if (targetCtx->unk4B == 0) { + f32 temp_f0_2; + f32 clampedFloat; + + temp_f0_2 = (500.0f - targetCtx->unk44) * 3.0f; + clampedFloat = CLAMP(temp_f0_2, 30.0f, 100.0f); + + if (Math_StepToF(&targetCtx->unk44, 80.0f, clampedFloat)) { + targetCtx->unk4B++; + } + } else { + targetCtx->unk4B = (targetCtx->unk4B + 3) | 0x80; + targetCtx->unk44 = 120.0f; + } + } else { + targetCtx->targetedActor = NULL; + Math_StepToF(&targetCtx->unk44, 500.0f, 80.0f); + } +} + +/* Start of Flags section */ + +/** + * Tests if current scene switch flag is set. + */ +s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) { + if (flag >= 0 && flag < 0x80) { + return globalCtx->actorCtx.flags.switches[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F)); + } + return 0; +} + +/** + * Sets current scene switch flag. + */ +void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag) { + if (flag >= 0 && flag < 0x80) { + globalCtx->actorCtx.flags.switches[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F); + } +} + +/** + * Unsets current scene switch flag. + */ +void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag) { + if (flag >= 0 && flag < 0x80) { + globalCtx->actorCtx.flags.switches[(flag & ~0x1F) >> 5] &= ~(1 << (flag & 0x1F)); + } +} + +/** + * Tests if current scene chest flag is set. + */ +s32 Flags_GetTreasure(GlobalContext* globalCtx, s32 flag) { + return globalCtx->actorCtx.flags.chest & (1 << flag); +} + +/** + * Sets current scene chest flag. + */ +void Flags_SetTreasure(GlobalContext* globalCtx, s32 flag) { + globalCtx->actorCtx.flags.chest |= (1 << flag); +} + +/** + * Overrides the all the chest flags. + */ +void Flags_SetAllTreasure(GlobalContext* globalCtx, s32 flag) { + globalCtx->actorCtx.flags.chest = flag; +} + +/** + * Returns all the chest flags. + */ +s32 Flags_GetAllTreasure(GlobalContext* globalCtx) { + return globalCtx->actorCtx.flags.chest; +} + +/** + * Tests if current scene clear flag is set. + */ +s32 Flags_GetClear(GlobalContext* globalCtx, s32 roomNumber) { + return globalCtx->actorCtx.flags.clearedRoom & (1 << roomNumber); +} + +/** + * Sets current scene clear flag. + */ +void Flags_SetClear(GlobalContext* globalCtx, s32 roomNumber) { + globalCtx->actorCtx.flags.clearedRoom |= (1 << roomNumber); +} + +/** + * Unsets current scene clear flag. + */ +void Flags_UnsetClear(GlobalContext* globalCtx, s32 roomNumber) { + globalCtx->actorCtx.flags.clearedRoom &= ~(1 << roomNumber); +} + +/** + * Tests if current scene temp clear flag is set. + */ +s32 Flags_GetClearTemp(GlobalContext* globalCtx, s32 roomNumber) { + return globalCtx->actorCtx.flags.clearedRoomTemp & (1 << roomNumber); +} + +/** + * Sets current scene temp clear flag. + */ +void Flags_SetClearTemp(GlobalContext* globalCtx, s32 roomNumber) { + globalCtx->actorCtx.flags.clearedRoomTemp |= (1 << roomNumber); +} + +/** + * Unsets current scene temp clear flag. + */ +void Flags_UnsetClearTemp(GlobalContext* globalCtx, s32 roomNumber) { + globalCtx->actorCtx.flags.clearedRoomTemp &= ~(1 << roomNumber); +} + +/** + * Tests if current scene collectible flag is set. + */ +s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag) { + if (flag > 0 && flag < 0x80) { + return globalCtx->actorCtx.flags.collectible[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F)); + } + return 0; +} + +/** + * Sets current scene collectible flag. + */ +void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) { + if (flag > 0 && flag < 0x80) { + globalCtx->actorCtx.flags.collectible[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F); + } +} + +/* End of Flags section */ + +/* Start of TitleCard section */ + +void TitleCard_ContextInit(GameState* gameState, TitleCardContext* titleCtx) { + titleCtx->durationTimer = 0; + titleCtx->delayTimer = 0; + titleCtx->intensity = 0; + titleCtx->alpha = 0; +} + +void TitleCard_InitBossName(GameState* gameState, TitleCardContext* titleCtx, TexturePtr texture, s16 x, s16 y, + u8 width, u8 height) { + titleCtx->texture = texture; + titleCtx->x = x; + titleCtx->y = y; + titleCtx->width = width; + titleCtx->height = height; + titleCtx->durationTimer = 80; + titleCtx->delayTimer = 0; +} + +void TitleCard_InitPlaceName(GameState* gameState, TitleCardContext* titleCtx, TexturePtr texture, s32 x, s32 y, + s32 width, s32 height, s32 delay) { +} + +void TitleCard_Update(GameState* gameState, TitleCardContext* titleCtx) { + if (DECR(titleCtx->delayTimer) == 0) { + if (DECR(titleCtx->durationTimer) == 0) { + Math_StepToS(&titleCtx->alpha, 0, 30); + Math_StepToS(&titleCtx->intensity, 0, 70); + } else { + Math_StepToS(&titleCtx->alpha, 255, 10); + Math_StepToS(&titleCtx->intensity, 255, 20); + } + } +} + +void TitleCard_Draw(GameState* gameState, TitleCardContext* titleCtx) { + if (titleCtx->alpha != 0) { + s32 width = titleCtx->width; + s32 height = titleCtx->height; + s32 unk1; + s32 spC0; + s32 sp38; + s32 spB8; + s32 spB4; + s32 temp; + + temp = width * 2; + spC0 = (titleCtx->x * 4) - temp; + spB8 = (titleCtx->y * 4) - (height * 2); + sp38 = width * 2; + + OPEN_DISPS(gameState->gfxCtx); + + height = (width * height > TMEM_SIZE) ? TMEM_SIZE / width : height; + spB4 = spB8 + (height * 4); + + if (1) {} + + OVERLAY_DISP = func_8012C014(OVERLAY_DISP); + + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, + (u8)titleCtx->alpha); + + gDPLoadTextureBlock(OVERLAY_DISP++, (s32*)titleCtx->texture, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); + + gSPTextureRectangle(OVERLAY_DISP++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 + (height * 4) - 1, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + + height = titleCtx->height - height; + + if (height > 0) { + gDPLoadTextureBlock(OVERLAY_DISP++, (s32)titleCtx->texture + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, width, + height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + + gSPTextureRectangle(OVERLAY_DISP++, spC0, spB4, ((sp38 * 2) + spC0) - 4, spB4 + (height * 4) - 1, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } + + CLOSE_DISPS(gameState->gfxCtx); + } +} + +/* End of TitleCard section */ + +// unused +s32 func_800B6434(GlobalContext* globalCtx, TitleCardContext* titleCtx) { + if ((globalCtx->actorCtx.titleCtxt.delayTimer != 0) || (globalCtx->actorCtx.titleCtxt.alpha != 0)) { + titleCtx->durationTimer = 0; + titleCtx->delayTimer = 0; + return false; + } + return true; +} + +void func_800B6468(GlobalContext* globalCtx) { + globalCtx->actorCtx.unk1F5 = 0; +} + +void func_800B6474(GlobalContext* globalCtx) { + if (globalCtx->actorCtx.unk1F5 != 0) { + globalCtx->actorCtx.unk1F5--; + } +} + +s32 func_800B648C(GlobalContext* globalCtx, s32 arg1, s32 arg2, f32 arg3, Vec3f* arg4) { + if ((globalCtx->actorCtx.unk1F5 != 0) && (arg3 < globalCtx->actorCtx.unk1F8)) { + return false; + } + + globalCtx->actorCtx.unk1F4 = arg1; + globalCtx->actorCtx.unk1F5 = arg2; + globalCtx->actorCtx.unk1F8 = arg3; + Math_Vec3f_Copy(&globalCtx->actorCtx.unk1FC, arg4); + + return true; +} + +f32 func_800B64FC(GlobalContext* globalCtx, f32 arg1, Vec3f* arg2, u32* arg3) { + f32 temp_f8; + + if ((globalCtx->actorCtx.unk1F5 == 0) || (arg1 == 0.0f)) { + return -1.0f; + } + + temp_f8 = Math_Vec3f_DistXYZ(&globalCtx->actorCtx.unk1FC, arg2) / arg1; + *arg3 = globalCtx->actorCtx.unk1F4; + return globalCtx->actorCtx.unk1F8 - temp_f8; +} + +/** + * Initializes an element of the `globalCtx->actorCtx.unk_20C` array to the `arg2` pointer, or allocates one using the + * `size` argument in case `arg2` is NULL. This element is associated to an `id` + * + * In success returns the allocated pointer if `arg2` was NULL or the `arg2` pointer otherwise + * In failure (There's no space left in `globalCtx->actorCtx.unk_20C` or an allocation error happened) returns NULL + * + * Note there are no duplicated id checks. + * + * Used only by EnLiftNuts. + */ +void* func_800B6584(GlobalContext* globalCtx, s16 id, void* arg2, size_t size) { + ActorContext_unk_20C* entry = globalCtx->actorCtx.unk_20C; + s32 i; + + for (i = 0; i < ARRAY_COUNT(globalCtx->actorCtx.unk_20C); i++) { + if (entry->id == 0) { + if (arg2 == NULL) { + arg2 = ZeldaArena_Malloc(size); + if (arg2 == NULL) { + return NULL; + } + entry->isDynamicallyInitialised = true; + } + + entry->id = id; + entry->ptr = arg2; + return arg2; + } + + entry++; + } + + return NULL; +} + +/** + * Frees the first element of `globalCtx->actorCtx.unk_20C` with id `id`. + * + * If success, the free'd pointer is returned. + * If failure, NULL is returned. + * + * Used only by EnLiftNuts. + */ +void* func_800B6608(GlobalContext* globalCtx, s16 id) { + ActorContext_unk_20C* entry = globalCtx->actorCtx.unk_20C; + s32 i; + + for (i = 0; i < ARRAY_COUNT(globalCtx->actorCtx.unk_20C); i++) { + if (id == entry->id) { + entry->id = 0; + if (entry->isDynamicallyInitialised) { + ZeldaArena_Free(entry->ptr); + entry->isDynamicallyInitialised = false; + } + return entry->ptr; + } + + entry++; + } + + return NULL; +} + +/** + * Retrieves the first pointer stored with the id `id`. + * If there's no pointer stored with that id, NULL is returned. + * + * Used only by EnLiftNuts. + */ +void* func_800B6680(GlobalContext* globalCtx, s16 id) { + ActorContext_unk_20C* entry = globalCtx->actorCtx.unk_20C; + s32 i; + + for (i = 0; i < ARRAY_COUNT(globalCtx->actorCtx.unk_20C); i++) { + if (id == entry->id) { + return entry->ptr; + } + + entry++; + } + + return NULL; +} void Actor_MarkForDeath(Actor* actor) { actor->draw = NULL; actor->update = NULL; - actor->flags &= ~0x1; + actor->flags &= ~ACTOR_FLAG_1; } -void Actor_InitCurrPosition(Actor* actor) { +void Actor_SetWorldToHome(Actor* actor) { actor->world = actor->home; } -void Actor_SetHeight(Actor* actor, f32 height) { +void Actor_SetFocus(Actor* actor, f32 height) { actor->focus.pos.x = actor->world.pos.x; actor->focus.pos.y = actor->world.pos.y + height; actor->focus.pos.z = actor->world.pos.z; + actor->focus.rot.x = actor->world.rot.x; actor->focus.rot.y = actor->world.rot.y; actor->focus.rot.z = actor->world.rot.z; } -void Actor_SetRotationFromDrawRotation(Actor* actor) { +void Actor_SetWorldRotToShape(Actor* actor) { actor->world.rot = actor->shape.rot; } -void Actor_InitDrawRotation(Actor* actor) { +void Actor_SetShapeRotToWorld(Actor* actor) { actor->shape.rot = actor->world.rot; } @@ -317,43 +1060,38 @@ void Actor_SetScale(Actor* actor, f32 scale) { actor->scale.x = scale; } -void Actor_SetObjectSegment(GlobalContext* globalCtx, Actor* actor) { - // TODO: Segment number enum +void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor) { gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment); } -#if 0 -void Actor_InitToDefaultValues(Actor* actor, GlobalContext* globalCtx) { - Actor_InitCurrPosition(actor); - Actor_InitDrawRotation(actor); - Actor_SetHeight(actor, 0); +void Actor_Init(Actor* actor, GlobalContext* globalCtx) { + Actor_SetWorldToHome(actor); + Actor_SetShapeRotToWorld(actor); + Actor_SetFocus(actor, 0.0f); Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); - Actor_SetScale(actor, 0.01); + Actor_SetScale(actor, 0.01f); actor->targetMode = 3; - actor->minYVelocity = -20.0f; + actor->terminalVelocity = -20.0f; - actor->meshAttachedTo = 0x32; - - actor->sqrdDistToLink = D_801DCA54; - CollisionCheck_InitInfo(&actor->colChkInfo); + actor->xyzDistToPlayerSq = FLT_MAX; actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; - actor->naviMsgId = 255; + actor->hintId = 255; - Actor_Setshape(&actor->shape, 0, 0, 0); - if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex) != 0) { - Actor_SetObjectSegment(globalCtx, actor); + CollisionCheck_InitInfo(&actor->colChkInfo); + actor->floorBgId = BGCHECK_SCENE; + + ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); + if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { + Actor_SetObjectDependency(globalCtx, actor); actor->init(actor, globalCtx); actor->init = NULL; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_InitToDefaultValues.s") -#endif -void Actor_FiniActor(Actor* actor, GlobalContext* globalCtx) { +void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) { if (actor->init == NULL) { if (actor->destroy != NULL) { actor->destroy(actor, globalCtx); @@ -362,60 +1100,111 @@ void Actor_FiniActor(Actor* actor, GlobalContext* globalCtx) { } } +f32 actorMovementScale = 1.0f; + void Actor_SetMovementScale(s32 scale) { actorMovementScale = scale * 0.5f; } -void Actor_ApplyMovement(Actor* actor) { +/** + * Update actor position using velocity and any push from z_collision_check. + */ +void Actor_UpdatePos(Actor* actor) { f32 speedRate = actorMovementScale; - actor->world.pos.x += ((actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x); - actor->world.pos.y += ((actor->velocity.y * speedRate) + actor->colChkInfo.displacement.y); - actor->world.pos.z += ((actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z); + actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x; + actor->world.pos.y += (actor->velocity.y * speedRate) + actor->colChkInfo.displacement.y; + actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z; } -void Actor_SetVelocityYRotationAndGravity(Actor* actor) { +/** + * Updates actor's velocity accounting for gravity (without exceeding terminal velocity) + * The operation is performed in cylindrical coordinates + * + * It is recommended to not call this function directly and use `Actor_MoveWithGravity` instead + */ +void Actor_UpdateVelocityWithGravity(Actor* actor) { actor->velocity.x = actor->speedXZ * Math_SinS(actor->world.rot.y); actor->velocity.z = actor->speedXZ * Math_CosS(actor->world.rot.y); - actor->velocity.y += actor->gravity; - if (actor->velocity.y < actor->minVelocityY) { - actor->velocity.y = actor->minVelocityY; + actor->velocity.y += actor->gravity; + if (actor->velocity.y < actor->terminalVelocity) { + actor->velocity.y = actor->terminalVelocity; } } -void Actor_SetVelocityAndMoveYRotationAndGravity(Actor* actor) { - Actor_SetVelocityYRotationAndGravity(actor); - Actor_ApplyMovement(actor); +/** + * Moves actor accounting for its current velocity and applying gravity + * The operation is performed in cylindrical coordinates + */ +void Actor_MoveWithGravity(Actor* actor) { + Actor_UpdateVelocityWithGravity(actor); + Actor_UpdatePos(actor); } -void Actor_SetVelocityXYRotation(Actor* actor) { - f32 velX = Math_CosS(actor->world.rot.x) * actor->speedXZ; - actor->velocity.x = Math_SinS(actor->world.rot.y) * velX; +/** + * Updates actor's velocity, ignoring gravity + * The operation is performed in spherical coordinates + * + * It is recommended to not call this function directly and use `Actor_MoveWithoutGravity` instead + */ +void Actor_UpdateVelocityWithoutGravity(Actor* actor) { + f32 horizontalSpeed = Math_CosS(actor->world.rot.x) * actor->speedXZ; + + actor->velocity.x = Math_SinS(actor->world.rot.y) * horizontalSpeed; actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * velX; + actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed; } -void Actor_SetVelocityAndMoveXYRotation(Actor* actor) { - Actor_SetVelocityXYRotation(actor); - Actor_ApplyMovement(actor); +/** + * Moves actor accounting for its current velocity, without applying gravity + * The operation is performed in spherical coordinates + * + * Useful for flying or swimming actors + */ +void Actor_MoveWithoutGravity(Actor* actor) { + Actor_UpdateVelocityWithoutGravity(actor); + Actor_UpdatePos(actor); } -void Actor_SetVelocityXYRotationReverse(Actor* actor) { - f32 velX = Math_CosS(-actor->world.rot.x) * actor->speedXZ; - actor->velocity.x = Math_SinS(actor->world.rot.y) * velX; +/** + * Like `Actor_UpdateVelocityWithoutGravity`, but the actor is moved backwards instead of forwards + * + * It is recommended to not call this function directly and use `Actor_MoveWithoutGravityReverse` instead + */ +void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor) { + f32 horizontalSpeed = Math_CosS(-actor->world.rot.x) * actor->speedXZ; + + actor->velocity.x = Math_SinS(actor->world.rot.y) * horizontalSpeed; actor->velocity.y = Math_SinS(-actor->world.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * velX; + actor->velocity.z = Math_CosS(actor->world.rot.y) * horizontalSpeed; } -void Actor_SetVelocityAndMoveXYRotationReverse(Actor* actor) { - Actor_SetVelocityXYRotationReverse(actor); - Actor_ApplyMovement(actor); +/** + * Like `Actor_MoveWithoutGravity`, but the actor is moved backwards instead of forwards + */ +void Actor_MoveWithoutGravityReverse(Actor* actor) { + Actor_UpdateVelocityWithoutGravityReverse(actor); + Actor_UpdatePos(actor); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6C04.s") +/** + * Sets horizontal speed and Y velocity using the `speed` argument and current pitch + */ +void Actor_SetSpeeds(Actor* actor, f32 speed) { + actor->speedXZ = Math_CosS(actor->world.rot.x) * speed; + actor->velocity.y = -Math_SinS(actor->world.rot.x) * speed; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6C58.s") +// unused +void Actor_UpdatePosFromSkelAnime(Actor* actor, SkelAnime* skelAnime) { + Vec3f pos; + + SkelAnime_UpdateTranslation(skelAnime, &pos, actor->shape.rot.y); + actor->world.pos.x += pos.x * actor->scale.x; + actor->world.pos.y += pos.y * actor->scale.y; + actor->world.pos.z += pos.z * actor->scale.z; +} s16 Actor_YawBetweenActors(Actor* from, Actor* to) { return Math_Vec3f_Yaw(&from->world.pos, &to->world.pos); @@ -457,171 +1246,744 @@ f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point) { return Math_Vec3f_DistXZ(&actor->world.pos, point); } -/** Performs the affine (linear) transformation from world coordinates to actor coordinates +/** + * Find the offset of a point from an actor in that actor's own coordinates (origin at the actor's + * world.pos, z-axis is facing angle, i.e. shape.rot.y) * * @param[in] actor The actor whose coordinate system to transform to. * @param[out] offset The transformed coordinates. * @param[in] point The point to transform to actor coordinates. */ -void Actor_CalcOffsetOrientedToDrawRotation(Actor* actor, Vec3f* offset, Vec3f* point) { - f32 cos_rot_y; - f32 sin_rot_y; - f32 imm_x; - f32 imm_z; +void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point) { + f32 cos = Math_CosS(actor->shape.rot.y); + f32 sin = Math_SinS(actor->shape.rot.y); + f32 diffX; + f32 diffZ; - cos_rot_y = Math_CosS(actor->shape.rot.y); - sin_rot_y = Math_SinS(actor->shape.rot.y); - imm_x = point->x - actor->world.pos.x; - imm_z = point->z - actor->world.pos.z; - offset->x = ((imm_x * cos_rot_y) - (imm_z * sin_rot_y)); - offset->z = ((imm_z * cos_rot_y) + (imm_x * sin_rot_y)); + // Shift X,Z to actor coordinates origin + diffX = point->x - actor->world.pos.x; + diffZ = point->z - actor->world.pos.z; + + // Rotate X and Z offsets to align Z to actor's shape.rot.y + offset->x = ((diffX * cos) - (diffZ * sin)); + offset->z = ((diffZ * cos) + (diffX * sin)); + + // Shift Y to origin offset->y = point->y - actor->world.pos.y; } -f32 Actor_YDistance(Actor* actor1, Actor* actor2) { +f32 Actor_HeightDiff(Actor* actor1, Actor* actor2) { return actor2->world.pos.y - actor1->world.pos.y; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6F20.s") +/** + * Sets the current and new inputs. + */ +void func_800B6F20(GlobalContext* globalCtx, Input* input, f32 magnitude, s16 baseYaw) { + s16 relativeYaw = baseYaw - func_800DFC68(GET_ACTIVE_CAM(globalCtx)); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B6FC8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7090.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7118.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7128.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B715C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7170.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B71DC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7200.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B722C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B724C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7298.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B72E0.s") - -void func_800B72F8(DynaPolyActor* dpactor, f32 a1, s16 a2) { - dpactor->yRotation = a2; - dpactor->pushForce += a1; + input->cur.stick_x = -Math_SinS(relativeYaw) * magnitude; + input->rel.stick_x = input->cur.stick_x; + input->cur.stick_y = Math_CosS(relativeYaw) * magnitude; + input->rel.stick_y = input->cur.stick_y; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_IsLinkFacingActor.s") +f32 Player_GetHeight(Player* player) { + f32 extraHeight; -s32 Actor_IsActorFacedByActor(Actor* actor, Actor* other, s16 tolerance) { - s16 angle; - s16 dist; - - angle = BINANG_ROT180(Actor_YawBetweenActors(actor, other)); - dist = angle - other->shape.rot.y; - if (ABS_ALT(dist) < tolerance) { - return 1; + if (player->stateFlags1 & 0x800000) { + extraHeight = 32.0f; + } else { + extraHeight = 0.0f; } - return 0; -} -s32 Actor_IsActorFacingLink(Actor* actor, s16 angle) { - s16 dist; - - dist = actor->yawTowardsPlayer - actor->shape.rot.y; - if (ABS_ALT(dist) < angle) { - return 1; + switch (player->transformation) { + default: + case PLAYER_FORM_FIERCE_DEITY: + return extraHeight + 124.0f; + case PLAYER_FORM_GORON: + // (player->stateFlags3 & 0x1000): being curled? + return extraHeight + ((player->stateFlags3 & 0x1000) ? 34.0f : 80.0f); + case PLAYER_FORM_ZORA: + return extraHeight + 68.0f; + case PLAYER_FORM_DEKU: + return extraHeight + 36.0f; + case PLAYER_FORM_HUMAN: + return extraHeight + 44.0f; } - return 0; } -s32 Actor_IsActorFacingActor(Actor* actor, Actor* other, s16 tolerance) { - s16 dist; - - dist = Actor_YawBetweenActors(actor, other) - actor->shape.rot.y; - if (ABS_ALT(dist) < tolerance) { - return 1; +f32 Player_GetRunSpeedLimit(Player* player) { + if (player->stateFlags1 & 0x800000) { + return 15.0f; + } else if (player->stateFlags1 & 0x8000000) { + return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f; + } else { + return R_RUN_SPEED_LIMIT / 100.0f; } - return 0; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_IsActorFacingLinkAndWithinRange.s") +s32 func_800B7118(Player* player) { + return player->stateFlags1 & 0x8; +} -s32 Actor_IsActorFacingActorAndWithinRange(Actor* actor, Actor* other, f32 range, s16 tolerance) { - s16 dist; +s32 func_800B7128(Player* player) { + return func_800B7118(player) && player->unk_ACC; +} - if (Actor_DistanceBetweenActors(actor, other) < range) { - dist = Actor_YawBetweenActors(actor, other) - actor->shape.rot.y; - if (ABS_ALT(dist) < tolerance) { - return 1; +s32 func_800B715C(GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + return player->stateFlags2 & 0x8; +} + +void Actor_SetCameraHorseSetting(GlobalContext* globalCtx, Player* player) { + if ((globalCtx->roomCtx.currRoom.unk3 != 4) && (player->actor.id == ACTOR_PLAYER)) { + EnHorse* rideActor = (EnHorse*)player->rideActor; + + if ((rideActor != NULL) && !(rideActor->unk_1EC & 0x10)) { + func_800DFAC8(Play_GetCamera(globalCtx, MAIN_CAM), 4); } } - return 0; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B75A0.s") +void Actor_MountHorse(GlobalContext* globalCtx, Player* player, Actor* horse) { + player->rideActor = horse; + player->stateFlags1 |= 0x800000; + horse->child = &player->actor; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B761C.s") +s32 func_800B7200(Player* player) { + return (player->stateFlags1 & 0x20000080) || (player->csMode != 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7678.s") +void func_800B722C(GameState* gameState, Player* player) { + func_800F40A0(gameState, player); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_UpdateBgCheckInfo.s") +s32 func_800B724C(GlobalContext* globalCtx, Actor* actor, u8 csMode) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7E04.s") + if ((player->csMode == 5) || ((csMode == 6) && (player->csMode == 0))) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B7FE0.s") + player->csMode = csMode; + player->unk_398 = actor; + player->unk_3BA = 0; + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8018.s") +u32 func_800B7298(GlobalContext* globalCtx, Actor* actor, u8 csMode) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8050.s") + if (func_800B724C(globalCtx, actor, csMode)) { + player->unk_3BA = 1; + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8118.s") +// Unused +void func_800B72E0(DynaPolyActor* dyna) { + dyna->unk14C = 0.0f; + dyna->pushForce = 0.0f; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B81E0.s") +void func_800B72F8(DynaPolyActor* dyna, f32 extraPushForce, s16 yRotation) { + dyna->yRotation = yRotation; + dyna->pushForce += extraPushForce; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8214.s") +/** + * Check if the player is facing the specified actor. + * The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`. + */ +s32 Player_IsFacingActor(Actor* actor, s16 maxAngleDiff, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + s16 yawDiff = BINANG_ADD(actor->yawTowardsPlayer, 0x8000) - player->actor.shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8248.s") + if (ABS_ALT(yawDiff) < maxAngleDiff) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B82EC.s") +/** + * Check if `actorB` is facing `actorA`. + * The maximum angle difference that qualifies as "facing" is specified by `maxAngle`. + * + * This function is unused in the original game. + */ +s32 Actor_ActorBIsFacingActorA(Actor* actorA, Actor* actorB, s16 maxAngleDiff) { + s16 angle = BINANG_ROT180(Actor_YawBetweenActors(actorA, actorB)); + s16 dist = angle - actorB->shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B83BC.s") + if (ABS_ALT(dist) < maxAngleDiff) { + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B83F8.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B84D0.s") +/** + * Check if the specified actor is facing the player. + * The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`. + */ +s32 Actor_IsFacingPlayer(Actor* actor, s16 angle) { + s16 dist = actor->yawTowardsPlayer - actor->shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8500.s") + if (ABS_ALT(dist) < angle) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B85E0.s") +/** + * Check if `actorA` is facing `actorB`. + * The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`. + */ +s32 Actor_ActorAIsFacingActorB(Actor* actorA, Actor* actorB, s16 maxAngleDiff) { + s16 dist = Actor_YawBetweenActors(actorA, actorB) - actorA->shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8614.s") + if (ABS_ALT(dist) < maxAngleDiff) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B863C.s") +/** + * Check if the specified actor is facing the player and is nearby. + * The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`. + * The maximum distance that qualifies as "nearby" is specified by `range`. + */ +s32 Actor_IsFacingAndNearPlayer(Actor* actor, f32 range, s16 maxAngleDiff) { + s16 yaw = actor->yawTowardsPlayer - actor->shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B867C.s") + if (ABS_ALT(yaw) < maxAngleDiff) { + s16 pad; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B86C8.s") + if (sqrtf(SQ(actor->xzDistToPlayer) + SQ(actor->playerHeightRel)) < range) { + return true; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8708.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8718.s") +/** + * Check if `actorA` is facing `actorB` and is nearby. + * The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`. + * The maximum distance that qualifies as "nearby" is specified by `range`. + */ +s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s16 maxAngleDiff) { + if (Actor_DistanceBetweenActors(actorA, actorB) < range) { + s16 dist = Actor_YawBetweenActors(actorA, actorB) - actorA->shape.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B874C.s") + if (ABS_ALT(dist) < maxAngleDiff) { + return true; + } + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8804.s") +/* Start of BgCheck related section */ -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B882C.s") +void func_800B75A0(CollisionPoly* poly, Vec3f* normal, s16* azimuth) { + normal->x = COLPOLY_GET_NORMAL(poly->normal.x); + normal->y = COLPOLY_GET_NORMAL(poly->normal.y); + normal->z = COLPOLY_GET_NORMAL(poly->normal.z); + *azimuth = Math_FAtan2F(normal->z, normal->x); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B886C.s") +s32 func_800B761C(Actor* actor, f32 arg1, s32 arg2) { + if (actor->bgCheckFlags & 1) { + actor->bgCheckFlags &= ~1; + actor->bgCheckFlags |= 4; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8898.s") + if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) { + actor->velocity.y = 0.0f; + } + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8934.s") + return true; +} -u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) { +s32 func_800B7678(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, s32 flags) { + f32 distToFloor; + s32 bgId; + + pos->y += (flags & 0x800) ? 10.0f : 50.0f; + + actor->floorHeight = + BgCheck_EntityRaycastFloor5_2(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &bgId, actor, pos); + actor->bgCheckFlags &= ~(0x80 | 0x04 | 0x02); + if (actor->floorHeight <= BGCHECK_Y_MIN) { + return func_800B761C(actor, BGCHECK_Y_MIN, flags); + } + + distToFloor = actor->floorHeight - actor->world.pos.y; + actor->floorBgId = bgId; + if ((distToFloor >= 0.0f) || (((actor->bgCheckFlags & 1)) && !(actor->bgCheckFlags & 0x800) && + (distToFloor >= -11.0f) && (actor->velocity.y < 0.0f))) { + actor->bgCheckFlags |= 0x80; + + if (actor->bgCheckFlags & 0x10) { + if (bgId != D_801ED8B4) { + if (distToFloor > 15.0f) { + actor->bgCheckFlags |= 0x100; + } + } else { + actor->world.pos.x = actor->prevPos.x; + actor->world.pos.z = actor->prevPos.z; + } + } + + actor->world.pos.y = actor->floorHeight; + + if (actor->velocity.y <= 0.0f) { + if (!(actor->bgCheckFlags & 1)) { + actor->bgCheckFlags |= 2; + } else if ((flags & 8) && (actor->gravity < 0.0f)) { + actor->velocity.y = -4.0f; + } else if (!(flags & 0x100)) { + actor->velocity.y = 0.0f; + } + + actor->bgCheckFlags |= 1; + BgCheck2_AttachToMesh(&globalCtx->colCtx, actor, (s32)actor->floorBgId); + } + } else { + return func_800B761C(actor, distToFloor, flags); + } + + return true; +} + +void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 wallCheckHeight, f32 wallCheckRadius, + f32 ceilingCheckHeight, u32 flags) { + f32 sp94 = actor->world.pos.y - actor->prevPos.y; + s32 pad; + Vec3f pos; + + if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) { + BgCheck2_UpdateActorAttachedToMesh(&globalCtx->colCtx, actor->floorBgId, actor); + } + + if (flags & 1) { + s32 bgId; + + actor->bgCheckFlags &= ~0x1000; + if ((!(flags & 0x80) && + (BgCheck_EntitySphVsWall3(&globalCtx->colCtx, &pos, &actor->world.pos, &actor->prevPos, wallCheckRadius, + &actor->wallPoly, &bgId, actor, wallCheckHeight))) || + ((flags & 0x80) && + (BgCheck_EntitySphVsWall4(&globalCtx->colCtx, &pos, &actor->world.pos, &actor->prevPos, wallCheckRadius, + &actor->wallPoly, &bgId, actor, wallCheckHeight)))) { + CollisionPoly* sp7C = actor->wallPoly; + + actor->bgCheckFlags |= 8; + if ((flags & 0x200) && (actor->bgCheckFlags & 0x1000) && ((s32)sp7C->normal.y > 0) && + (sqrtf(SQXYZ(actor->colChkInfo.displacement)) < 10.0f)) { + actor->bgCheckFlags &= ~8; + } else if (actor->bgCheckFlags & 8) { + Math_Vec3f_Copy(&actor->world.pos, &pos); + } + + actor->wallYaw = Math_FAtan2F(sp7C->normal.z, sp7C->normal.x); + actor->wallBgId = bgId; + } else { + actor->bgCheckFlags &= ~8; + } + } + + pos.x = actor->world.pos.x; + pos.z = actor->world.pos.z; + if (flags & 2) { + f32 y; + + pos.y = actor->prevPos.y + 4.0f; + if (BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &y, &pos, (ceilingCheckHeight + sp94) - 4.0f, &D_801ED8B0, + &D_801ED8B4, actor)) { + actor->bgCheckFlags |= 0x10; + actor->world.pos.y = (y + sp94) - 4.0f; + } else { + actor->bgCheckFlags &= ~0x10; + } + } + if (flags & 4) { + WaterBox* waterbox; + f32 y; + + pos.y = actor->prevPos.y; + func_800B7678(globalCtx, actor, &pos, flags); + y = actor->world.pos.y; + + if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, actor->world.pos.x, actor->world.pos.z, &y, + &waterbox)) { + actor->depthInWater = y - actor->world.pos.y; + if (actor->depthInWater <= 0.0f) { + actor->bgCheckFlags &= ~(0x40 | 0x20); + } else if (!(actor->bgCheckFlags & 0x20)) { + actor->bgCheckFlags |= (0x40 | 0x20); + if (!(flags & 0x40)) { + Vec3f sp64; + + sp64.x = actor->world.pos.x; + sp64.y = y; + sp64.z = actor->world.pos.z; + + EffectSsGRipple_Spawn(globalCtx, &sp64, 100, 500, 0); + EffectSsGRipple_Spawn(globalCtx, &sp64, 100, 500, 4); + EffectSsGRipple_Spawn(globalCtx, &sp64, 100, 500, 8); + } + } else { + actor->bgCheckFlags &= ~0x40; + } + } else { + actor->bgCheckFlags &= ~(0x40 | 0x20); + actor->depthInWater = BGCHECK_Y_MIN; + } + } + + if (flags & 0x400) { + WaterBox* waterbox; + f32 y = actor->world.pos.y; + + if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, actor->world.pos.x, actor->world.pos.z, &y, + &waterbox)) { + actor->depthInWater = y - actor->world.pos.y; + + if (actor->depthInWater < 0.0f) { + actor->bgCheckFlags &= ~(0x40 | 0x20); + } else if (!(actor->bgCheckFlags & 0x20)) { + actor->bgCheckFlags |= (0x40 | 0x20); + if (!(flags & 0x40)) { + Vec3f sp50; + + sp50.x = actor->world.pos.x; + sp50.y = y; + sp50.z = actor->world.pos.z; + + EffectSsGRipple_Spawn(globalCtx, &sp50, 100, 500, 0); + EffectSsGRipple_Spawn(globalCtx, &sp50, 100, 500, 4); + EffectSsGRipple_Spawn(globalCtx, &sp50, 100, 500, 8); + } + } else { + actor->bgCheckFlags &= ~0x40; + } + } else { + actor->bgCheckFlags &= ~(0x40 | 0x20); + actor->depthInWater = BGCHECK_Y_MIN; + } + } +} + +Gfx* Hilite_Draw(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx, Gfx* dl, Hilite** hilite) { + LookAt* lookAt = GRAPH_ALLOC(gfxCtx, sizeof(LookAt)); + f32 correctedEyeX = (eye->x == object->x) && (eye->z == object->z) ? eye->x + 0.001f : eye->x; + + *hilite = GRAPH_ALLOC(gfxCtx, sizeof(Hilite)); + + guLookAtHilite(&D_801ED8E0, lookAt, *hilite, correctedEyeX, eye->y, eye->z, object->x, object->y, object->z, 0.0f, + 1.0f, 0.0f, lightDir->x, lightDir->y, lightDir->z, lightDir->x, lightDir->y, lightDir->z, 0x10, + 0x10); + + gSPLookAt(dl++, lookAt); + gDPSetHilite1Tile(dl++, 1, *hilite, 0x10, 0x10); + + return dl; +} + +Hilite* Hilite_DrawOpa(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) { + Hilite* hilite; + + OPEN_DISPS(gfxCtx); + + POLY_OPA_DISP = Hilite_Draw(object, eye, lightDir, gfxCtx, POLY_OPA_DISP, &hilite); + + CLOSE_DISPS(gfxCtx); + + return hilite; +} + +Hilite* Hilite_DrawXlu(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) { + Hilite* hilite; + + OPEN_DISPS(gfxCtx); + + POLY_XLU_DISP = Hilite_Draw(object, eye, lightDir, gfxCtx, POLY_XLU_DISP, &hilite); + + CLOSE_DISPS(gfxCtx); + + return hilite; +} + +void func_800B8050(Actor* actor, GlobalContext* globalCtx, s32 flag) { + Hilite* hilite = func_800BCBF4(&actor->world.pos, globalCtx); + + if (flag != 0) { + Gfx* displayListHead; + Gfx* displayList = GRAPH_ALLOC(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); + + displayListHead = displayList; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + gDPSetHilite1Tile(displayListHead++, 1, hilite, 0x10, 0x10); + gSPEndDisplayList(displayListHead); + gSPSegment(POLY_OPA_DISP++, 0x07, displayList); + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } +} + +void func_800B8118(Actor* actor, GlobalContext* globalCtx, s32 flag) { + Hilite* hilite = func_800BCC68(&actor->world.pos, globalCtx); + + if (flag != 0) { + Gfx* displayListHead; + Gfx* displayList = GRAPH_ALLOC(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); + + displayListHead = displayList; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + gDPSetHilite1Tile(displayListHead++, 1, hilite, 0x10, 0x10); + gSPEndDisplayList(displayListHead); + gSPSegment(POLY_XLU_DISP++, 0x07, displayList); + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } +} + +PosRot* Actor_GetFocus(PosRot* dest, Actor* actor) { + *dest = actor->focus; + + return dest; +} + +PosRot* Actor_GetWorld(PosRot* dest, Actor* actor) { + *dest = actor->world; + + return dest; +} + +PosRot* Actor_GetWorldPosShapeRot(PosRot* dest, Actor* actor) { + PosRot sp1C; + + Math_Vec3f_Copy(&sp1C.pos, &actor->world.pos); + if (actor->id == ACTOR_PLAYER) { + Player* player = (Player*)actor; + + sp1C.pos.y += player->unk_AC0 * actor->scale.y; + } + sp1C.rot = actor->shape.rot; + *dest = sp1C; + + return dest; +} + +f32 func_800B82EC(Actor* actor, Player* player, s16 angle) { + f32 temp_f12; + s16 temp_v0 = BINANG_SUB(BINANG_SUB(actor->yawTowardsPlayer, 0x8000), angle); + s16 yaw = ABS_ALT(temp_v0); + + if (player->unk_730 != NULL) { + if ((yaw > 0x4000) || ((actor->flags & ACTOR_FLAG_8000000))) { + return FLT_MAX; + } + + temp_f12 = actor->xyzDistToPlayerSq - ((actor->xyzDistToPlayerSq * 0.8f) * ((0x4000 - yaw) * (1.0f / 0x8000))); + return temp_f12; + } + + if (yaw >= 0x2AAB) { + return FLT_MAX; + } + return actor->xyzDistToPlayerSq; +} + +#define TARGET_RANGE(range, leash) \ + { SQ(range), (f32)range / leash } + +TargetRangeParams gTargetRanges[] = { + TARGET_RANGE(70, 140), TARGET_RANGE(170, 255), TARGET_RANGE(280, 5600), TARGET_RANGE(350, 525), + TARGET_RANGE(700, 1050), TARGET_RANGE(1000, 1500), TARGET_RANGE(100, 105.36842), TARGET_RANGE(140, 163.33333), + TARGET_RANGE(240, 576), TARGET_RANGE(280, 280000), TARGET_RANGE(2500, 3750), +}; + +s32 func_800B83BC(Actor* actor, f32 arg1) { + return arg1 < gTargetRanges[actor->targetMode].rangeSq; +} + +s32 func_800B83F8(Actor* actor, Player* player, s32 flag) { + if ((actor->update == NULL) || !(actor->flags & ACTOR_FLAG_1) || (actor->flags & ACTOR_FLAG_8000000)) { + return true; + } + + if (!flag) { + s16 yaw = BINANG_SUB(actor->yawTowardsPlayer, 0x8000) - player->actor.shape.rot.y; + s16 phi_v1 = ABS_ALT(yaw); + f32 dist; + + if ((player->unk_730 == NULL) && (phi_v1 >= 0x2AAB)) { + dist = FLT_MAX; + } else { + dist = actor->xyzDistToPlayerSq; + } + + return !func_800B83BC(actor, gTargetRanges[actor->targetMode].leashScale * dist); + } + + return false; +} + +s16 D_801AED48[] = { + 0x101, 0x141, 0x111, 0x151, 0x105, 0x145, 0x115, 0x155, +}; + +s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState) { + if (actor->flags & ACTOR_FLAG_100) { + actor->flags &= ~ACTOR_FLAG_100; + return true; + } + + return false; +} + +// Actor_PickUpExchange? Seems to be called with exchangeItemId -1 if the same actor used Actor_PickUp +// This function is also used to toggle the "Speak" action on the A button +s32 func_800B8500(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRange, s32 exchangeItemId) { + Player* player = GET_PLAYER(globalCtx); + + if ((player->actor.flags & ACTOR_FLAG_100) || + ((exchangeItemId > EXCH_ITEM_NONE) && Player_InCsMode(&globalCtx->state)) || + (!actor->isTargeted && + ((fabsf(actor->playerHeightRel) > fabsf(yRange)) || ((actor->xzDistToPlayer > player->targetActorDistance)) || + (xzRange < actor->xzDistToPlayer)))) { + return false; + } + + player->targetActor = actor; + player->targetActorDistance = actor->xzDistToPlayer; + player->exchangeItemId = exchangeItemId; + + ActorCutscene_SetIntentToPlay(0x7C); + return true; +} + +s32 func_800B85E0(Actor* actor, GlobalContext* globalCtx, f32 radius, s32 exchangeItemId) { + return func_800B8500(actor, globalCtx, radius, radius, exchangeItemId); +} + +s32 func_800B8614(Actor* actor, GlobalContext* globalCtx, f32 radius) { + return func_800B85E0(actor, globalCtx, radius, EXCH_ITEM_NONE); +} + +s32 func_800B863C(Actor* actor, GlobalContext* globalCtx) { + f32 cylRadius = actor->colChkInfo.cylRadius + 50.0f; + + return func_800B8614(actor, globalCtx, cylRadius); +} + +s32 Actor_TextboxIsClosing(Actor* actor, GlobalContext* globalCtx) { + if (Message_GetState(&globalCtx->msgCtx) == 2) { + actor->flags &= ~ACTOR_FLAG_100; + return true; + } + + return false; +} + +/** + * Changes the actor the Player is focussing on + * Fails if Player is not already focussing on an actor or in a talking state + */ +s32 Actor_ChangeFocus(Actor* actor1, GlobalContext* globalCtx, Actor* actor2) { + Actor* targetActor; + Player* player = GET_PLAYER(globalCtx); + + targetActor = player->targetActor; + + if ((player->actor.flags & ACTOR_FLAG_100) && (targetActor != NULL)) { + player->targetActor = actor2; + player->unk_730 = actor2; + return true; + } + + return false; +} + +s32 Player_GetExchangeItemId(GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + return player->exchangeItemId; +} + +s32 func_800B8718(Actor* actor, GameState* gameState) { + if (actor->flags & ACTOR_FLAG_20000000) { + actor->flags &= ~ACTOR_FLAG_20000000; + return true; + } + + return false; +} + +// Similar to func_800B8500 +s32 func_800B874C(Actor* actor, GlobalContext* globalCtx, f32 xzRange, f32 yRange) { + Player* player = GET_PLAYER(globalCtx); + + if ((player->actor.flags & ACTOR_FLAG_20000000) || Player_InCsMode(&globalCtx->state) || + (yRange < fabsf(actor->playerHeightRel)) || ((player->unk_A94 < actor->xzDistToPlayer)) || + (xzRange < actor->xzDistToPlayer)) { + return false; + } + + player->unk_A90 = actor; + player->unk_A94 = actor->xzDistToPlayer; + return true; +} + +s32 func_800B8804(Actor* actor, GlobalContext* globalCtx, f32 xzRange) { + return func_800B874C(actor, globalCtx, xzRange, 20.0f); +} + +s32 func_800B882C(Actor* actor, GlobalContext* globalCtx) { + f32 cylRadius = actor->colChkInfo.cylRadius + 50.0f; + + return func_800B8804(actor, globalCtx, cylRadius); +} + +s32 func_800B886C(Actor* actor, GlobalContext* globalCtx) { + if (!(GET_PLAYER(globalCtx)->actor.flags & ACTOR_FLAG_20000000)) { + return true; + } + + return false; +} + +void Actor_GetScreenPos(GlobalContext* globalCtx, Actor* actor, s16* x, s16* y) { + Vec3f projectedPos; + f32 w; + + Actor_GetProjectedPos(globalCtx, &actor->focus.pos, &projectedPos, &w); + *x = (projectedPos.x * w * (SCREEN_WIDTH / 2)) + (SCREEN_WIDTH / 2); + *y = (projectedPos.y * w * -(SCREEN_HEIGHT / 2)) + (SCREEN_HEIGHT / 2); +} + +s32 func_800B8934(GlobalContext* globalCtx, Actor* actor) { + Vec3f sp2C; + f32 sp28; + s32 pad[2]; + + Actor_GetProjectedPos(globalCtx, &actor->focus.pos, &sp2C, &sp28); + + return (sp2C.x * sp28 >= -1.0f) && (sp2C.x * sp28 <= 1.0f) && (sp2C.y * sp28 >= -1.0f) && (sp2C.y * sp28 <= 1.0f); +} + +s32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) { if (actor->parent != NULL) { return true; } else { @@ -629,119 +1991,1126 @@ u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx) { } } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8A1C.s") +/** + * Allows to pick up an item (GetItem or GI), lift an actor or catch various actors in bottles + * within the specified range. + * + * GI_NONE is usually used as a special case to lift an actor + * GI_MAX is usually used to catch an actor in a bottle + */ +s32 Actor_PickUp(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8B84.s") + if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { + if ((actor->xzDistToPlayer <= xzRange) && (fabsf(actor->playerHeightRel) <= fabsf(yRange))) { + if (((getItemId == GI_MASK_CIRCUS_LEADER) || (getItemId == GI_PENDANT_OF_MEMORIES) || + (getItemId == GI_DEED_LAND) || + (((player->heldActor != NULL) || (actor == player->targetActor)) && + (getItemId > GI_NONE && getItemId < GI_MAX))) || + (!(player->stateFlags1 & 0x20000800))) { + s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; + s32 absYawDiff = ABS_ALT(yawDiff); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8BB0.s") + if ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) { + player->getItemId = getItemId; + player->interactRangeActor = actor; + player->getItemDirection = absYawDiff; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8BD0.s") + if ((getItemId > GI_NONE) && (getItemId < GI_MAX)) { + ActorCutscene_SetIntentToPlay(globalCtx->unk_1879C[1]); + } + + return true; + } + } + } + } + + return false; +} + +s32 Actor_PickUpNearby(Actor* actor, GlobalContext* globalCtx, s32 getItemId) { + return Actor_PickUp(actor, globalCtx, getItemId, 50.0f, 10.0f); +} + +s32 Actor_LiftActor(Actor* actor, GlobalContext* globalCtx) { + return Actor_PickUpNearby(actor, globalCtx, GI_NONE); +} + +s32 Actor_PickUpFar(Actor* actor, GlobalContext* globalCtx, s32 getItemId) { + return Actor_PickUp(actor, globalCtx, getItemId, 9999.9f, 9999.9f); +} s32 Actor_HasNoParent(Actor* actor, GlobalContext* globalCtx) { - if (!actor->parent) { + if (actor->parent == NULL) { return true; - } else { - return false; + } + + return false; +} + +void func_800B8C20(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) { + Actor* parent = actorA->parent; + + if (parent->id == ACTOR_PLAYER) { + Player* player = (Player*)parent; + + player->heldActor = actorB; + player->interactRangeActor = actorB; + } + + parent->child = actorB; + actorB->parent = parent; + actorA->parent = NULL; +} + +void func_800B8C50(Actor* actor, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + if (actor->xyzDistToPlayerSq < player->unk_AA0) { + player->unk_AA0 = actor->xyzDistToPlayerSq; } } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8C20.s") +s32 Actor_HasRider(GlobalContext* globalCtx, Actor* horse) { + if (horse->child != NULL) { + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8C50.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8C78.s") +s32 Actor_SetRideActor(GlobalContext* globalCtx, Actor* horse, s32 mountSide) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8C9C.s") + if (!(player->stateFlags1 & 0x003C7880)) { + player->rideActor = horse; + player->mountSide = mountSide; + ActorCutscene_SetIntentToPlay(0x7C); + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8CEC.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8D10.s") +s32 Actor_HasNoRider(GlobalContext* globalCtx, Actor* horse) { + if (horse->child == NULL) { + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8D50.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8D98.s") +void func_800B8D10(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8DD4.s") + player->unk_B74 = arg6; + player->unk_B75 = arg5; + player->unk_B78 = arg2; + player->unk_B76 = arg3; + player->unk_B7C = arg4; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8E1C.s") +void func_800B8D50(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 yaw, f32 arg4, u32 arg5) { + func_800B8D10(globalCtx, actor, arg2, yaw, arg4, 3, arg5); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8E58.s") +void func_800B8D98(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4) { + func_800B8D50(globalCtx, actor, arg2, arg3, arg4, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Audio_PlayActorSound2.s") +void func_800B8DD4(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) { + func_800B8D10(globalCtx, actor, arg2, arg3, arg4, 2, arg5); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8EF4.s") +void func_800B8E1C(GlobalContext* globalCtx, Actor* actor, f32 arg2, s16 arg3, f32 arg4) { + func_800B8DD4(globalCtx, actor, arg2, arg3, arg4, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8F98.s") +void func_800B8E58(Player* player, u16 sfxId) { + if (player->currentMask == PLAYER_MASK_GIANT) { + func_8019F170(&player->actor.projectedPos, sfxId); + } else { + Audio_PlaySfxGeneral(sfxId, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8FC0.s") +/** + * Plays the sound effect at the actor's position + */ +void Actor_PlaySfxAtPos(Actor* actor, u16 sfxId) { + func_8019F1C0(&actor->projectedPos, sfxId); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B8FE8.s") +void func_800B8EF4(GlobalContext* globalCtx, Actor* actor) { + u32 sfxId; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9010.s") + if (actor->bgCheckFlags & 0x20) { + if (actor->depthInWater < 20.0f) { + sfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; + } else { + sfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG; + } + } else { + sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, actor->floorPoly, actor->floorBgId); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9038.s") + func_8019F1C0(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); + func_8019F1C0(&actor->projectedPos, sfxId + SFX_FLAG); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9084.s") +void func_800B8F98(Actor* actor, u16 sfxId) { + actor->sfxId = sfxId; + actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); + actor->audioFlags |= 0x02; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9098.s") +void func_800B8FC0(Actor* actor, u16 sfxId) { + actor->sfxId = sfxId; + actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); + actor->audioFlags |= 4; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B90AC.s") +void func_800B8FE8(Actor* actor, u16 sfxId) { + actor->sfxId = sfxId; + actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); + actor->audioFlags |= 0x08; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B90F4.s") +void func_800B9010(Actor* actor, u16 sfxId) { + actor->sfxId = sfxId; + actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); + actor->audioFlags |= 0x01; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9120.s") +void func_800B9038(Actor* actor, s32 timer) { + actor->audioFlags &= ~(0x10 | 0x08 | 0x04 | 0x02 | 0x01); + actor->audioFlags |= 0x10; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_Init.s") + // The sfxId here are not actually sound effects, but instead this is data that gets sent into + // the io ports of the music macro language (func_801A0810 / Audio_PlaySfxAtPosWithSoundScriptIO is + // the function that it's used for) + if (timer < 40) { + actor->sfxId = 3; + } else if (timer < 100) { + actor->sfxId = 2; + } else { + actor->sfxId = 1; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9334.s") +void func_800B9084(Actor* actor) { + actor->audioFlags |= 0x20; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_UpdateActor.s") +void func_800B9098(Actor* actor) { + actor->audioFlags |= 0x40; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_UpdateAll.s") +s32 func_800B90AC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* polygon, s32 index, s32 arg4) { + if (func_800C99D4(&globalCtx->colCtx, polygon, index) == 8) { + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_DrawActor.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9D1C.s") +void func_800B90F4(GlobalContext* globalCtx) { + if (globalCtx->actorCtx.unk3 != 0) { + globalCtx->actorCtx.unk3 = 0; + func_80115D5C(&globalCtx->state); + } +} + +void func_800B9120(ActorContext* actorCtx) { + s32 phi_v0 = CURRENT_DAY * 2; + + if (gSaveContext.time < CLOCK_TIME(6, 0) || gSaveContext.time > CLOCK_TIME(18, 0)) { + phi_v0++; + } + + actorCtx->unkC = 0x200 >> phi_v0; +} + +void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) { + ActorOverlay* overlayEntry; + u32* cycleFlags; + s32 i; + + gSaveContext.weekEventReg[92] |= 0x80; + cycleFlags = gSaveContext.cycleSceneFlags[convert_scene_number_among_shared_scenes(globalCtx->sceneNum)]; + + bzero(actorCtx, sizeof(ActorContext)); + ActorOverlayTable_Init(); + Matrix_MtxFCopy(&globalCtx->billboardMtxF, &gIdentityMtxF); + Matrix_MtxFCopy(&globalCtx->viewProjectionMtxF, &gIdentityMtxF); + + overlayEntry = gActorOverlayTable; + for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++) { + overlayEntry->loadedRamAddr = NULL; + overlayEntry->numLoaded = 0; + overlayEntry++; + } + + actorCtx->flags.chest = cycleFlags[0]; + actorCtx->flags.switches[0] = cycleFlags[1]; + actorCtx->flags.switches[1] = cycleFlags[2]; + if (globalCtx->sceneNum == SCENE_INISIE_R) { + cycleFlags = gSaveContext.cycleSceneFlags[globalCtx->sceneNum]; + } + actorCtx->flags.collectible[0] = cycleFlags[4]; + actorCtx->flags.clearedRoom = cycleFlags[3]; + + TitleCard_ContextInit(&globalCtx->state, &actorCtx->titleCtxt); + func_800B6468(globalCtx); + + actorCtx->absoluteSpace = NULL; + + Actor_SpawnEntry(actorCtx, actorEntry, globalCtx); + Actor_TargetContextInit(&actorCtx->targetContext, actorCtx->actorLists[ACTORCAT_PLAYER].first, globalCtx); + func_800B9120(actorCtx); + Fault_AddClient(&sActorFaultClient, (void*)Actor_PrintLists, actorCtx, NULL); + func_800B722C(&globalCtx->state, (Player*)actorCtx->actorLists[ACTORCAT_PLAYER].first); +} + +/** + * Spawns the actors in the current setup (of the current scene/setup/room triple) + * Only spawns actors based on the time flags embedded in their rotation parameters + */ +void Actor_SpawnSetupActors(GlobalContext* globalCtx, ActorContext* actorCtx) { + if (globalCtx->numSetupActors > 0) { + ActorEntry* actorEntry = globalCtx->setupActorList; + s32 temp_fp = actorCtx->unkC; + s32 temp_s1; + s32 phi_v0; + s32 i; + + func_800B9120(actorCtx); + func_800BA8B8(globalCtx, &globalCtx->actorCtx); + + temp_s1 = (actorCtx->unkC * 2) & 0x2FF; + + for (i = 0; i < globalCtx->numSetupActors; i++) { + phi_v0 = ((actorEntry->rot.x & 7) << 7) | (actorEntry->rot.z & 0x7F); + if (phi_v0 == 0) { + phi_v0 = 0x3FF; + } + + if (!(phi_v0 & temp_fp) && (phi_v0 & actorCtx->unkC) && + (!(gSaveContext.eventInf[1] & 0x80) || !(phi_v0 & temp_s1) || !(actorEntry->id & 0x800))) { + Actor_SpawnEntry(&globalCtx->actorCtx, actorEntry, globalCtx); + } + actorEntry++; + } + + // Prevents re-spawning the setup actors + globalCtx->numSetupActors = -globalCtx->numSetupActors; + } +} + +typedef struct { + /* 0x00 */ GlobalContext* globalCtx; + /* 0x04 */ Actor* actor; + /* 0x08 */ u32 unk_08; + /* 0x0C */ u32 unkC; + /* 0x10 */ Actor* unk10; + /* 0x14 */ Player* player; + /* 0x18 */ u32 unk_18; // Bitmask of actor flags. The actor will only have main called if it has at least 1 + // flag set that matches this bitmask +} UpdateActor_Params; // size = 0x1C + +Actor* Actor_UpdateActor(UpdateActor_Params* params) { + GlobalContext* globalCtx = params->globalCtx; + Actor* actor = params->actor; + Actor* nextActor; + + if (actor->world.pos.y < -25000.0f) { + actor->world.pos.y = -25000.0f; + } + + actor->sfxId = 0; + actor->audioFlags &= ~0x7F; + + if (actor->init != NULL) { + if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { + Actor_SetObjectDependency(globalCtx, actor); + actor->init(actor, globalCtx); + actor->init = NULL; + } + nextActor = actor->next; + } else if (actor->update == NULL) { + if (!actor->isDrawn) { + nextActor = Actor_Delete(&globalCtx->actorCtx, actor, globalCtx); + } else { + Actor_Destroy(actor, globalCtx); + nextActor = actor->next; + } + } else { + if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { + Actor_MarkForDeath(actor); + } else { + s32 tmp = (params->unk_08 == 0); + + if (((params->unk_08) && !(actor->flags & params->unk_08)) || + ((tmp = (params->unk_08 == 0)) && + (!(actor->flags & ACTOR_FLAG_100000) || + ((actor->category == ACTORCAT_EXPLOSIVES) && (params->player->stateFlags1 & 0x200))) && + (params->unkC != 0) && (actor != params->unk10) && ((actor != params->player->heldActor)) && + (actor->parent != ¶ms->player->actor))) { + CollisionCheck_ResetDamage(&actor->colChkInfo); + } else { + Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); + actor->xzDistToPlayer = Actor_XZDistanceBetweenActors(actor, ¶ms->player->actor); + actor->playerHeightRel = Actor_HeightDiff(actor, ¶ms->player->actor); + actor->xyzDistToPlayerSq = SQ(actor->xzDistToPlayer) + SQ(actor->playerHeightRel); + + actor->yawTowardsPlayer = Actor_YawBetweenActors(actor, ¶ms->player->actor); + actor->flags &= ~ACTOR_FLAG_1000000; + + if ((DECR(actor->freezeTimer) == 0) && (actor->flags & params->unk_18)) { + if (actor == params->player->unk_730) { + actor->isTargeted = true; + } else { + actor->isTargeted = false; + } + + if ((actor->targetPriority != 0) && (params->player->unk_730 == 0)) { + actor->targetPriority = 0; + } + + Actor_SetObjectDependency(globalCtx, actor); + + if (actor->colorFilterTimer != 0) { + actor->colorFilterTimer--; + } + + actor->update(actor, globalCtx); + BgCheck_ResetFlagsIfLoadedActor(globalCtx, &globalCtx->colCtx.dyna, actor); + } + + CollisionCheck_ResetDamage(&actor->colChkInfo); + } + } + nextActor = actor->next; + } + return nextActor; +} + +u32 D_801AED58[] = { + 0x100002C2, 0x100002C2, 0x00000200, 0x100006C2, 0x00000282, 0x300002C2, + 0x10000282, 0x00000002, 0x300002C2, 0x100006C2, 0x00000002, 0x100002C2, +}; + +void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { + s32 i; + Actor* actor; + Player* player = GET_PLAYER(globalCtx); + u32* tmp; + s32 cat; + Actor* next; + ActorListEntry* entry; + UpdateActor_Params params; + + params.player = player; + params.globalCtx = globalCtx; + + if (globalCtx->unk_18844 != 0) { + params.unk_18 = ACTOR_FLAG_200000; + } else { + params.unk_18 = ACTOR_FLAG_200000 | ACTOR_FLAG_40 | ACTOR_FLAG_10; + } + + Actor_SpawnSetupActors(globalCtx, actorCtx); + + if (actorCtx->unk2 != 0) { + actorCtx->unk2--; + } + + tmp = D_801AED58; + + if (player->stateFlags2 & 0x8000000) { + params.unk_08 = 0x2000000; + } else { + params.unk_08 = 0; + } + + if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x1900)) { + params.unk10 = player->targetActor; + } else { + params.unk10 = NULL; + } + + for (i = 0, entry = actorCtx->actorLists; i < ARRAY_COUNT(actorCtx->actorLists); entry++, tmp++, i++) { + params.unkC = *tmp & player->stateFlags1; + params.actor = entry->first; + + while (params.actor != NULL) { + params.actor = Actor_UpdateActor(¶ms); + } + + if (i == ACTORCAT_BG) { + DynaPoly_Setup(globalCtx, &globalCtx->colCtx.dyna); + } + } + + for (i = 0, entry = actorCtx->actorLists; i < ARRAY_COUNT(actorCtx->actorLists); entry++, i++) { + if (entry->unk_08 != 0) { + actor = entry->first; + + while (actor != NULL) { + if (i == actor->category) { + actor = actor->next; + } else { + next = actor->next; + cat = actor->category; + actor->category = i; + Actor_RemoveFromCategory(globalCtx, actorCtx, actor); + Actor_AddToCategory(actorCtx, actor, cat); + actor = next; + } + } + entry->unk_08 = 0; + } + } + + actor = player->unk_730; + if ((actor != NULL) && (actor->update == NULL)) { + actor = NULL; + func_80123DA4(player); + } + + if ((actor == NULL) || (player->unk_738 < 5)) { + actor = NULL; + if (actorCtx->targetContext.unk4B != 0) { + actorCtx->targetContext.unk4B = 0; + play_sound(NA_SE_SY_LOCK_OFF); + } + } + + if (!(player->stateFlags1 & 2)) { + func_800B5814(&actorCtx->targetContext, player, actor, &globalCtx->state); + } + + TitleCard_Update(&globalCtx->state, &actorCtx->titleCtxt); + func_800B6474(globalCtx); + DynaPoly_UpdateBgActorTransforms(globalCtx, &globalCtx->colCtx.dyna); +} + +void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { + Lights* light; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + light = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx); + if ((actor->flags & ACTOR_FLAG_10000000) && (globalCtx->roomCtx.currRoom.enablePosLights || (MREG(93) != 0))) { + light->enablePosLights = true; + } + + Lights_BindAll(light, globalCtx->lightCtx.listHead, + (actor->flags & (ACTOR_FLAG_10000000 | ACTOR_FLAG_400000)) ? NULL : &actor->world.pos, globalCtx); + Lights_Draw(light, globalCtx->state.gfxCtx); + + if (actor->flags & ACTOR_FLAG_1000) { + Matrix_SetStateRotationAndTranslation( + actor->world.pos.x + globalCtx->mainCamera.skyboxOffset.x, + actor->world.pos.y + ((actor->shape.yOffset * actor->scale.y) + globalCtx->mainCamera.skyboxOffset.y), + actor->world.pos.z + globalCtx->mainCamera.skyboxOffset.z, &actor->shape.rot); + } else { + Matrix_SetStateRotationAndTranslation(actor->world.pos.x, + actor->world.pos.y + (actor->shape.yOffset * actor->scale.y), + actor->world.pos.z, &actor->shape.rot); + } + + Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY); + Actor_SetObjectDependency(globalCtx, actor); + + gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); + + if (actor->colorFilterTimer != 0) { + s32 temp_v0_2 = actor->colorFilterParams & 0xC000; + Color_RGBA8 actorDefaultHitColor = { 0, 0, 0, 255 }; + + if (temp_v0_2 == 0x8000) { + actorDefaultHitColor.r = actorDefaultHitColor.g = actorDefaultHitColor.b = + ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + } else if (temp_v0_2 == 0x4000) { + actorDefaultHitColor.r = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + } else if (temp_v0_2 == 0xC000) { + actorDefaultHitColor.b = actorDefaultHitColor.g = actorDefaultHitColor.r = 0; + } else { + actorDefaultHitColor.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + } + + if (actor->colorFilterParams & 0x2000) { + func_800AE778(globalCtx, &actorDefaultHitColor, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); + } else { + func_800AE434(globalCtx, &actorDefaultHitColor, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); + } + } + + actor->draw(actor, globalCtx); + + if (actor->colorFilterTimer != 0) { + if (actor->colorFilterParams & 0x2000) { + func_800AE8EC(globalCtx); + } else { + func_800AE5A0(globalCtx); + } + } + + if (actor->shape.shadowDraw != NULL) { + actor->shape.shadowDraw(actor, light, globalCtx); + } + actor->isDrawn = true; + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_800B9D1C(Actor* actor) { + s32 sfxId = actor->sfxId; + + if (sfxId != 0) { + if (actor->audioFlags & 2) { + Audio_PlaySfxGeneral(sfxId, &actor->projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); + } else if (actor->audioFlags & 4) { + play_sound(sfxId); + } else if (actor->audioFlags & 8) { + func_8019F128(sfxId); + } else if (actor->audioFlags & 0x10) { + func_801A0810(&D_801DB4A4, NA_SE_SY_TIMER - SFX_FLAG, (sfxId - 1)); + } else if (actor->audioFlags & 1) { + func_8019F1C0(&actor->projectedPos, sfxId); + } + } + + if (sfxId) {} + + if (actor->audioFlags & 0x40) { + func_801A1FB4(3, &actor->projectedPos, NA_BGM_MUSIC_BOX_HOUSE, 1500.0f); + } + + if (actor->audioFlags & 0x20) { + func_801A1FB4(0, &actor->projectedPos, NA_BGM_KAMARO_DANCE, 900.0f); + } +} void Actor_DrawAllSetup(GlobalContext* globalCtx) { globalCtx->actorCtx.undrawnActorCount = 0; globalCtx->actorCtx.unkB = 0; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_RecordUndrawnActor.s") +s32 Actor_RecordUndrawnActor(GlobalContext* globalCtx, Actor* actor) { + if (globalCtx->actorCtx.undrawnActorCount >= 32) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9E84.s") + globalCtx->actorCtx.undrawnActors[globalCtx->actorCtx.undrawnActorCount] = actor; + globalCtx->actorCtx.undrawnActorCount++; + return true; +} +void func_800B9E84(Gfx** arg0, s32 arg1) { + func_80164C14(arg0, D_801DE890, 4, 0, 6, 6, ((100 - arg1) * 0.003f) + 1.0f); +} + +#ifdef NON_EQUIVALENT +// Related to draw actors with lens +void func_800B9EF4(GlobalContext* globalCtx, s32 numActors, Actor** actors) { + s32 spB4; + Gfx* spAC; + void* spA8; // pad + s32 spA4; + // void* sp34; + // Gfx* temp_s1_11; + // Gfx** temp_a0_2; + // Gfx** temp_a1; + // GraphicsContext* temp_s2; + // void* temp_s1_10; + // void* temp_s1_7; + // void* temp_s1_8; + // void* temp_s1_9; + // Gfx* phi_s1; + Gfx* phi_s1_2; + // void* phi_s1_4; + + OPEN_DISPS(globalCtx->state.gfxCtx); + // temp_s2 = globalCtx->state.gfxCtx; + + if (numActors > 0) { + spAC = POLY_XLU_DISP; + // sp34 = globalCtx + 0x18000; + spA4 = globalCtx->unk_18E68; + + PreRender_SetValues(&globalCtx->pauseBgPreRender, D_801FBBCC, D_801FBBCE, __gfxCtx->curFrameBuffer, + __gfxCtx->zbuffer); + + func_80170200(&globalCtx->pauseBgPreRender, &spAC, __gfxCtx->zbuffer, (void*)spA4); + + // spAC->words.w0 = 0xE7000000; + // spAC->words.w1 = 0; + // temp_s1_2 = spAC + 8; + gDPPipeSync(spAC++); + + // temp_s1_2->words.w0 = 0xEE000000; + // temp_s1_2->words.w1 = 0; + // temp_s1_3 = temp_s1_2 + 8; + gDPSetPrimDepth(spAC++, 0, 0); + + // temp_s1_3->words.w0 = 0xEF002C30; + // temp_s1_3->words.w1 = 0xAF504365; + // temp_s1_4 = temp_s1_3 + 8; + gDPSetOtherMode(spAC++, + G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | + GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) | + GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA)); + + // temp_s1_4->words.w1 = 0xFF; + // temp_s1_4->words.w0 = 0xFA000000; + // temp_s1_5 = temp_s1_4 + 8; + gDPSetPrimColor(spAC++, 0, 0, 0, 0, 0, 255); + // temp_s1_5 = spAC; + + if (globalCtx->roomCtx.currRoom.unk5 == 0) { + // temp_s1_5->words.w0 = 0xFC61E6C3; + // temp_s1_5->words.w1 = 0x11CF9FCF; + // phi_s1 = temp_s1_5 + 8; + gDPSetCombineLERP(spAC++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + TEXEL0, PRIMITIVE, 0); + } else { + // temp_s1_5->words.w0 = 0xFC119623; + // temp_s1_5->words.w1 = 0xFF2FFFFF; + // phi_s1 = temp_s1_5 + 8; + gDPSetCombineMode(spAC++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + } + + // spAC = phi_s1; + func_800B9E84(&spAC, globalCtx->actorCtx.unk4); + phi_s1_2 = func_801660B8(globalCtx, spAC); + + for (spB4 = 0; spB4 < numActors; spB4++, actors++) { + Actor_Draw(globalCtx, *actors); + } + + // temp_s0_2 = &globalCtx->pauseBgPreRender; + + // phi_s1_2->words.w0 = 0xE7000000; + // phi_s1_2->words.w1 = 0; + // temp_s1_7 = phi_s1_2 + 8; + gDPPipeSync(phi_s1_2++); + + // temp_s1_7->unk_0 = 0xEF002CF0; + // temp_s1_7->unk_4 = 0xF5A714D; + // temp_s1_8 = temp_s1_7 + 8; + gDPSetOtherMode(phi_s1_2++, + G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PRIM | AA_EN | IM_RD | CVG_DST_WRAP | ZMODE_OPA | CVG_X_ALPHA | + ALPHA_CVG_SEL | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1) | + GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_1)); + + // temp_s1_8->unk_4 = -0x100; + // temp_s1_8->unk_0 = 0xF9000000; + // temp_s1_9 = temp_s1_8 + 8; + gDPSetBlendColor(phi_s1_2++, 255, 255, 255, 0); + + // temp_s1_9->unk_4 = 0x20; + // temp_s1_9->unk_0 = 0xFA0000FF; + // temp_s1_10 = temp_s1_9 + 8; + gDPSetPrimColor(phi_s1_2++, 0, 0xFF, 0, 0, 0, 32); + + // temp_a0_2 = &spAC; + // if (sp34->unk_6E5 == 0) { + if (globalCtx->roomCtx.currRoom.unk5 == 0) { + // temp_s1_10->unk_0 = 0xFC119623; + // temp_s1_10->unk_4 = 0xFF2FFFFF; + // phi_s1_4 = temp_s1_10 + 8; + gDPSetCombineMode(phi_s1_2++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + //} else { + } else { + // temp_s1_10->unk_4 = 0x11CF9FCF; + // temp_s1_10->unk_0 = 0xFC61E6C3; + // phi_s1_4 = temp_s1_10 + 8; + gDPSetCombineLERP(phi_s1_2++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, + TEXEL0, PRIMITIVE, 0); + + //} + } + // phi_s1_4->unk_0 = (s32) (((sp34->unk_B4C - 1) & 0xFFF) | 0xFF100000); + // temp_s1_11 = phi_s1_4 + 8; + // phi_s1_4->unk_4 = spA4; + gDPSetColorImage(phi_s1_2++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ((globalCtx->pauseBgPreRender.width - 1) & 0xFFF), + spA4); + // temp_s1_11 = phi_s1_2; + + spAC = phi_s1_2; + + // spAC = temp_s1_11; + func_800B9E84(&spAC, (s32)globalCtx->actorCtx.unk4); + // temp_s1_11->words.w0 = 0xE7000000; + // temp_s1_11->words.w1 = 0; + // temp_s1_12 = temp_s1_11 + 8; + gDPPipeSync(spAC++); + + // temp_s1_12->words.w1 = -0xF8; + // temp_s1_12->words.w0 = 0xF9000000; + // temp_s1_13 = temp_s1_12 + 8; + gDPSetBlendColor(spAC++, 255, 255, 255, 8); + + // temp_s1_14 = temp_s1_13 + 8; + // temp_s1_13->words.w0 = ((sp34->unk_B4C - 1) & 0xFFF) | 0xFF100000; + // temp_s1_13->words.w1 = sp34->unk_B5C; + gDPSetColorImage(spAC++, G_IM_FMT_RGBA, G_IM_SIZ_16b, ((globalCtx->pauseBgPreRender.width - 1) & 0xFFF), + globalCtx->pauseBgPreRender.fbuf); + + // temp_a1 = &spAC; + // spAC = temp_s1_14; + // func_8016FDB8(&globalCtx->pauseBgPreRender, temp_a1, (void* ) spA4, spA8, 1U); + func_8016FDB8(&globalCtx->pauseBgPreRender, &spAC, (void*)spA4, __gfxCtx->zbuffer, 1U); + // + // POLY_OPA_DISP = temp_s1_14; + POLY_OPA_DISP = spAC; + } + + // temp_s1_15 = OVERLAY_DISP; + // temp_s1_15->words.w0 = 0xE7000000; + // temp_s1_15->words.w1 = 0; + // temp_s1_16 = temp_s1_15 + 8; + spAC = OVERLAY_DISP; + gDPPipeSync(spAC++); + + // temp_s1_16->words.w0 = 0xEF002C30; + // temp_s1_16->words.w1 = 0x00504345; + // temp_s1_17 = temp_s1_16 + 8; + gDPSetOtherMode(spAC++, + G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | + G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2); + + // temp_s1_17->words.w0 = 0xFC61E6C3; + // temp_s1_17->words.w1 = 0x11CF9FCF; + // temp_s1_18 = temp_s1_17 + 8; + gDPSetCombineLERP(spAC++, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, PRIMITIVE, 0, 1, TEXEL0, + PRIMITIVE, 0); + + // temp_s1_18->words.w0 = 0xFA000000; + // temp_s1_18->words.w1 = 0x4A00004A; + // spAC = temp_s1_18 + 8; + gDPSetPrimColor(spAC++, 0, 0, 74, 0, 0, 74); + + func_800B9E84(&spAC, (s32)globalCtx->actorCtx.unk4); + + OVERLAY_DISP = spAC; + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} +#else +void func_800B9EF4(GlobalContext* globalCtx, s32 numActors, Actor** actors); #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9EF4.s") +#endif -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BA2D8.s") +s32 func_800BA2D8(GlobalContext* globalCtx, Actor* actor) { + return func_800BA2FC(globalCtx, actor, &actor->projectedPos, actor->projectedW); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BA2FC.s") +s32 func_800BA2FC(GlobalContext* globalCtx, Actor* actor, Vec3f* projectedPos, f32 projectedW) { + if ((-actor->uncullZoneScale < projectedPos->z) && + (projectedPos->z < (actor->uncullZoneForward + actor->uncullZoneScale))) { + f32 phi_f12; + f32 phi_f2 = CLAMP_MIN(projectedW, 1.0f); + f32 phi_f14; + f32 phi_f16; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_DrawAll.s") + if (globalCtx->view.fovy != 60.0f) { + phi_f12 = actor->uncullZoneScale * globalCtx->unk_187F0.x * 0.76980036f; // sqrt(16/27) -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BA6FC.s") + phi_f14 = globalCtx->unk_187F0.y * 0.57735026f; // 1 / sqrt(3) + phi_f16 = actor->uncullZoneScale * phi_f14; + phi_f14 *= actor->uncullZoneDownward; + } else { + phi_f16 = phi_f12 = actor->uncullZoneScale; + phi_f14 = actor->uncullZoneDownward; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BA798.s") + if (((fabsf(projectedPos->x) - phi_f12) < phi_f2) && ((-phi_f2 < (projectedPos->y + phi_f14))) && + ((projectedPos->y - phi_f16) < phi_f2)) { + return true; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BA8B8.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BA9B4.s") +void Actor_DrawAll(GlobalContext* globalCtx, ActorContext* actorCtx) { + s32 pad[2]; + Gfx* ref2; + Gfx* tmp2; + s32 pad2; + Gfx* sp58; + ActorListEntry* actorEntry; + Actor* actor; + s32 actorFlags; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_InsertIntoTypeList.s") + if (globalCtx->unk_18844 != 0) { + actorFlags = ACTOR_FLAG_200000; + } else { + actorFlags = ACTOR_FLAG_200000 | ACTOR_FLAG_40 | ACTOR_FLAG_20; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_RemoveFromTypeList.s") + OPEN_DISPS(globalCtx->state.gfxCtx); + + Actor_DrawAllSetup(globalCtx); + + sp58 = POLY_XLU_DISP; + POLY_XLU_DISP = &sp58[1]; + + for (i = 0, actorEntry = actorCtx->actorLists; i < ARRAY_COUNT(actorCtx->actorLists); i++, actorEntry++) { + actor = actorEntry->first; + + while (actor != NULL) { + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &actor->world.pos, &actor->projectedPos, + &actor->projectedW); + + if (actor->audioFlags & 0x7F) { + func_800B9D1C(actor); + } + + if (func_800BA2D8(globalCtx, actor)) { + actor->flags |= ACTOR_FLAG_40; + } else { + actor->flags &= ~ACTOR_FLAG_40; + } + + actor->isDrawn = false; + if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & actorFlags)) { + if ((actor->flags & ACTOR_FLAG_80) && + ((globalCtx->roomCtx.currRoom.unk5 == 0) || (globalCtx->actorCtx.unk4 == 0x64) || + (actor->room != globalCtx->roomCtx.currRoom.num))) { + if (Actor_RecordUndrawnActor(globalCtx, actor)) {} + } else { + Actor_Draw(globalCtx, actor); + } + } + + actor = actor->next; + } + } + + Effect_DrawAll(globalCtx->state.gfxCtx); + EffectSS_DrawAllParticles(globalCtx); + EffFootmark_Draw(globalCtx); + + ref2 = POLY_XLU_DISP; + gSPDisplayList(sp58, &ref2[1]); + POLY_XLU_DISP = &ref2[1]; + + if (globalCtx->actorCtx.unk3 != 0) { + Math_StepToC(&globalCtx->actorCtx.unk4, 100, 20); + if (GET_PLAYER(globalCtx)->stateFlags2 & 0x8000000) { + func_800B90F4(globalCtx); + } + } else { + Math_StepToC(&globalCtx->actorCtx.unk4, 0, 10); + } + if (globalCtx->actorCtx.unk4 != 0) { + globalCtx->actorCtx.unkB = 1; + func_800B9EF4(globalCtx, globalCtx->actorCtx.undrawnActorCount, globalCtx->actorCtx.undrawnActors); + } + + tmp2 = POLY_XLU_DISP; + gSPEndDisplayList(&tmp2[0]); + gSPBranchList(ref2, &tmp2[1]); + POLY_XLU_DISP = &tmp2[1]; + + if (globalCtx->unk_18844 == 0) { + Lights_DrawGlow(globalCtx); + } + + TitleCard_Draw(&globalCtx->state, &actorCtx->titleCtxt); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +/** + * Kills every actor which its object is not loaded + */ +void func_800BA6FC(GlobalContext* globalCtx, ActorContext* actorCtx) { + Actor* actor; + s32 i; + + for (i = 0; i != ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].first; + + while (actor != NULL) { + if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { + Actor_MarkForDeath(actor); + } + + actor = actor->next; + } + } +} + +/** + * Kill actors on room change and update flags accordingly + */ +void func_800BA798(GlobalContext* globalCtx, ActorContext* actorCtx) { + Actor* actor; + s32 i; + + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].first; + + while (actor != NULL) { + if ((actor->room >= 0) && (actor->room != globalCtx->roomCtx.currRoom.num) && + (actor->room != globalCtx->roomCtx.prevRoom.num)) { + if (!actor->isDrawn) { + actor = Actor_Delete(actorCtx, actor, globalCtx); + } else { + Actor_MarkForDeath(actor); + Actor_Destroy(actor, globalCtx); + actor = actor->next; + } + } else { + actor = actor->next; + } + } + } + + CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); + actorCtx->flags.clearedRoomTemp = 0; + actorCtx->flags.switches[3] = 0; + actorCtx->flags.collectible[3] = 0; + globalCtx->msgCtx.unk_12030 = 0; +} + +void func_800BA8B8(GlobalContext* globalCtx, ActorContext* actorCtx) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + Actor* actor = actorCtx->actorLists[i].first; + + while (actor != NULL) { + if (!(actor->unk20 & actorCtx->unkC)) { + func_80123590(globalCtx, actor); + if (!actor->isDrawn) { + actor = Actor_Delete(actorCtx, actor, globalCtx); + } else { + Actor_MarkForDeath(actor); + Actor_Destroy(actor, globalCtx); + actor = actor->next; + } + } else { + actor = actor->next; + } + } + } + + CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); + globalCtx->msgCtx.unk_12030 = 0; +} + +void Actor_CleanupContext(ActorContext* actorCtx, GlobalContext* globalCtx) { + s32 i; + + Fault_RemoveClient(&sActorFaultClient); + + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + if (i != ACTORCAT_PLAYER) { + Actor* actor = actorCtx->actorLists[i].first; + + while (actor != NULL) { + Actor_Delete(actorCtx, actor, globalCtx); + actor = actorCtx->actorLists[i].first; + } + } + } + + while (actorCtx->actorLists[ACTORCAT_PLAYER].first != NULL) { + Actor_Delete(actorCtx, actorCtx->actorLists[ACTORCAT_PLAYER].first, globalCtx); + } + + if (actorCtx->absoluteSpace != NULL) { + ZeldaArena_Free(actorCtx->absoluteSpace); + actorCtx->absoluteSpace = NULL; + } + + func_80169D40(globalCtx); + ActorOverlayTable_Cleanup(); +} + +/** + * Adds a given actor instance at the front of the actor list of the specified category. + * Also sets the actor instance as being of that category. + */ +void Actor_AddToCategory(ActorContext* actorCtx, Actor* actor, u8 actorCategory) { + Actor* actorAux; + Actor* lastActor; + + actor->category = actorCategory; + + actorCtx->totalLoadedActors++; + actorCtx->actorLists[actorCategory].length++; + lastActor = actorCtx->actorLists[actorCategory].first; + + if (lastActor == NULL) { + actorCtx->actorLists[actorCategory].first = actor; + return; + } + + actorAux = lastActor->next; + while (actorAux != NULL) { + lastActor = actorAux; + actorAux = actorAux->next; + } + + lastActor->next = actor; + actor->prev = lastActor; +} + +/** + * Removes a given actor instance from its actor list. + * Also sets the temp clear flag of the current room if the actor removed was the last enemy loaded. + */ +Actor* Actor_RemoveFromCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) { + Actor* newHead; + + actorCtx->totalLoadedActors--; + actorCtx->actorLists[actorToRemove->category].length--; + + if (actorToRemove->prev != NULL) { + actorToRemove->prev->next = actorToRemove->next; + } else { + actorCtx->actorLists[actorToRemove->category].first = actorToRemove->next; + } + + newHead = actorToRemove->next; + + if (newHead != NULL) { + newHead->prev = actorToRemove->prev; + } + + actorToRemove->next = NULL; + actorToRemove->prev = NULL; + + if ((actorToRemove->room == globalCtx->roomCtx.currRoom.num) && (actorToRemove->category == ACTORCAT_ENEMY) && + (actorCtx->actorLists[ACTORCAT_ENEMY].length == 0)) { + Flags_SetClearTemp(globalCtx, globalCtx->roomCtx.currRoom.num); + } + + return newHead; +} void Actor_FreeOverlay(ActorOverlay* entry) { - void* ramAddr; - if (entry->numLoaded == 0) { - ramAddr = entry->loadedRamAddr; + void* ramAddr = entry->loadedRamAddr; + if (ramAddr != NULL) { - // Bit 1 - always loaded - if ((entry->allocType & 2) == 0) { - // Bit 0 - don't alloc memory - if ((entry->allocType & 1) != 0) { + if (!(entry->allocType & ALLOCTYPE_PERMANENT)) { + if (entry->allocType & ALLOCTYPE_ABSOLUTE) { entry->loadedRamAddr = NULL; } else { ZeldaArena_Free(ramAddr); @@ -752,115 +3121,1183 @@ void Actor_FreeOverlay(ActorOverlay* entry) { } } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_Spawn.s") +Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ, + s16 rotX, s16 rotY, s16 rotZ, s32 params) { + return Actor_SpawnAsChildAndCutscene(actorCtx, globalCtx, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, -1, + 0x3FF, NULL); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_LoadOverlay.s") +ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) { + size_t overlaySize; + ActorOverlay* overlayEntry = &gActorOverlayTable[index]; + ActorInit* actorInit; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_SpawnAsChildAndCutscene.s") + overlaySize = VRAM_PTR_SIZE(overlayEntry); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_SpawnAsChild.s") + if (overlayEntry->vramStart == NULL) { + actorInit = overlayEntry->initInfo; + } else { + if (overlayEntry->loadedRamAddr == NULL) { + if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) { + if (actorCtx->absoluteSpace == NULL) { + actorCtx->absoluteSpace = ZeldaArena_MallocR(AM_FIELD_SIZE); + } + gActorOverlayTable[index].loadedRamAddr = actorCtx->absoluteSpace; + } else if (overlayEntry->allocType & ALLOCTYPE_PERMANENT) { + gActorOverlayTable[index].loadedRamAddr = ZeldaArena_MallocR(overlaySize); + } else { + gActorOverlayTable[index].loadedRamAddr = ZeldaArena_Malloc(overlaySize); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_SpawnTransitionActors.s") + if (overlayEntry->loadedRamAddr == NULL) { + return NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BB2D0.s") + Load2_LoadOverlay(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, + overlayEntry->vramEnd, overlayEntry->loadedRamAddr); + overlayEntry->numLoaded = 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BB498.s") + actorInit = + (uintptr_t)((overlayEntry->initInfo != NULL) + ? (void*)(-OVERLAY_RELOCATION_OFFSET(overlayEntry) + (uintptr_t)overlayEntry->initInfo) + : NULL); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BB59C.s") + return actorInit; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BB604.s") +Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, GlobalContext* globalCtx, s16 index, f32 x, f32 y, f32 z, + s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 cutscene, s32 arg11, Actor* parent) { + s32 pad; + Actor* actor; + ActorInit* actorInit; + s32 objBankIndex; + ActorOverlay* overlayEntry; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BB8EC.s") + if (actorCtx->totalLoadedActors >= 0xFF) { + return NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Enemy_StartFinishingBlow.s") + actorInit = Actor_LoadOverlay(actorCtx, index); + if (actorInit == NULL) { + return NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BBAC0.s") + objBankIndex = Object_GetIndex(&globalCtx->objectCtx, actorInit->objectId); + if ((objBankIndex < 0) || + ((actorInit->type == ACTORCAT_ENEMY) && Flags_GetClear(globalCtx, globalCtx->roomCtx.currRoom.num) && + (actorInit->id != ACTOR_BOSS_05))) { + Actor_FreeOverlay(&gActorOverlayTable[index]); + return NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BBB74.s") + actor = ZeldaArena_Malloc(actorInit->instanceSize); + if (actor == NULL) { + Actor_FreeOverlay(&gActorOverlayTable[index]); + return NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BBC20.s") + overlayEntry = &gActorOverlayTable[index]; + if (overlayEntry->vramStart != 0) { + overlayEntry->numLoaded++; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BBCEC.s") + bzero(actor, actorInit->instanceSize); + actor->overlayEntry = overlayEntry; + actor->id = actorInit->id; + actor->flags = actorInit->flags; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BBDAC.s") + if (actorInit->id == ACTOR_EN_PART) { + actor->objBankIndex = rotZ; + rotZ = 0; + } else { + actor->objBankIndex = objBankIndex; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BBFB0.s") + actor->init = actorInit->init; + actor->destroy = actorInit->destroy; + actor->update = actorInit->update; + actor->draw = actorInit->draw; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC154.s") + if (parent != NULL) { + actor->room = parent->room; + actor->parent = parent; + parent->child = actor; + } else { + actor->room = globalCtx->roomCtx.currRoom.num; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC188.s") + actor->home.pos.x = x; + actor->home.pos.y = y; + actor->home.pos.z = z; + actor->home.rot.x = rotX; + actor->home.rot.y = rotY; + actor->home.rot.z = rotZ; + actor->params = params & 0xFFFF; + actor->cutscene = (cutscene & 0x7F); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC1B4.s") + if (actor->cutscene == 0x7F) { + actor->cutscene = -1; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC270.s") + if (arg11 != 0) { + actor->unk20 = arg11; + } else { + actor->unk20 = 0x3FF; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC444.s") + Actor_AddToCategory(actorCtx, actor, actorInit->type); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC4EC.s") + { + u32 sp20 = gSegments[6]; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC5B8.s") + Actor_Init(actor, globalCtx); + gSegments[6] = sp20; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC5EC.s") + return actor; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC620.s") +Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, GlobalContext* globalCtx, s16 actorId, f32 posX, + f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params) { + return Actor_SpawnAsChildAndCutscene(actorCtx, globalCtx, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, -1, + parent->unk20, parent); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC770.s") +void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx) { + TransitionActorEntry* transitionActorList = globalCtx->doorCtx.transitionActorList; + s32 i; + s16 numTransitionActors = globalCtx->doorCtx.numTransitionActors; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC7D8.s") + for (i = 0; i < numTransitionActors; transitionActorList++, i++) { + if (transitionActorList->id >= 0) { + if ((transitionActorList->sides[0].room >= 0 && + (globalCtx->roomCtx.currRoom.num == transitionActorList->sides[0].room || + globalCtx->roomCtx.prevRoom.num == transitionActorList->sides[0].room)) || + (transitionActorList->sides[1].room >= 0 && + (globalCtx->roomCtx.currRoom.num == transitionActorList->sides[1].room || + globalCtx->roomCtx.prevRoom.num == transitionActorList->sides[1].room))) { + s16 rotY = ((transitionActorList->rotY >> 7) & 0x1FF) * (0x10000 / 360.0f); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC848.s") + if (Actor_SpawnAsChildAndCutscene(actorCtx, globalCtx, transitionActorList->id & 0x1FFF, + transitionActorList->pos.x, transitionActorList->pos.y, + transitionActorList->pos.z, 0, rotY, 0, + (i << 0xA) + (transitionActorList->params & 0x3FF), + transitionActorList->rotY & 0x7F, 0x3FF, 0) != NULL) { + transitionActorList->id = -transitionActorList->id; + } + numTransitionActors = globalCtx->doorCtx.numTransitionActors; + } + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BC8B8.s") +Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx) { + s16 rotX = (actorEntry->rot.x >> 7) & 0x1FF; + s16 rotY = (actorEntry->rot.y >> 7) & 0x1FF; + s16 rotZ = (actorEntry->rot.z >> 7) & 0x1FF; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BCB50.s") + if (!(actorEntry->id & 0x8000)) { + rotY *= 0x10000 / 360.0f; + } else if (rotY > 180) { + rotY -= 360; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BCB70.s") + if (!(actorEntry->id & 0x4000)) { + rotX *= 0x10000 / 360.0f; + } else if (rotX > 180) { + rotX -= 360; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BCBF4.s") + if (!(actorEntry->id & 0x2000)) { + rotZ *= 0x10000 / 360.0f; + } else if (rotZ > 180) { + rotZ -= 360; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BCC68.s") + return Actor_SpawnAsChildAndCutscene(actorCtx, globalCtx, actorEntry->id & 0x1FFF, actorEntry->pos.x, + actorEntry->pos.y, actorEntry->pos.z, rotX, rotY, rotZ, + actorEntry->params & 0xFFFF, actorEntry->rot.y & 0x7F, + ((actorEntry->rot.x & 7) << 7) | (actorEntry->rot.z & 0x7F), NULL); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BCCDC.s") +Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx) { + s32 pad; + Player* player = GET_PLAYER(globalCtx); + Actor* newHead; + ActorOverlay* overlayEntry = actor->overlayEntry; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD2B4.s") + if ((player != NULL) && (actor == player->unk_730)) { + func_80123DA4(player); + Camera_ChangeMode(Play_GetCamera(globalCtx, Play_GetActiveCameraIndex(globalCtx)), 0); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD384.s") + if (actor == actorCtx->targetContext.arrowPointedActor) { + actorCtx->targetContext.arrowPointedActor = NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD6B8.s") + if (actor == actorCtx->targetContext.unk8C) { + actorCtx->targetContext.unk8C = NULL; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD6E4.s") + if (actor == actorCtx->targetContext.bgmEnemy) { + actorCtx->targetContext.bgmEnemy = NULL; + } + + func_801A72CC(&actor->projectedPos); + Actor_Destroy(actor, globalCtx); + + newHead = Actor_RemoveFromCategory(globalCtx, actorCtx, actor); + ZeldaArena_Free(actor); + + if (overlayEntry->vramStart != NULL) { + overlayEntry->numLoaded--; + Actor_FreeOverlay(overlayEntry); + } + + return newHead; +} + +s32 func_800BB59C(GlobalContext* globalCtx, Actor* actor) { + s16 x; + s16 y; + + Actor_GetScreenPos(globalCtx, actor, &x, &y); + + return (x > -20) && (x < gScreenWidth + 20) && (y > -160) && (y < gScreenHeight + 160); +} + +void func_800BB604(GameState* gameState, ActorContext* actorCtx, Player* player, s32 actorCategory) { + GlobalContext* globalCtx = (GlobalContext*)gameState; + f32 temp_f0_2; + Actor* sp8C; + Actor* actor; + s32 phi_s2; + CollisionPoly* sp80; + s32 sp7C; + Vec3f sp70; + s32 phi_s2_2; + + actor = actorCtx->actorLists[actorCategory].first; + sp8C = player->unk_730; + while (actor != NULL) { + if ((actor->update != NULL) && ((Player*)actor != player)) { + if (actor->flags & (ACTOR_FLAG_40000000 | ACTOR_FLAG_1)) { + if ((actorCategory == ACTORCAT_ENEMY) && CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_4 | ACTOR_FLAG_1)) { + if ((actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sBgmEnemyDistSq)) { + actorCtx->targetContext.bgmEnemy = actor; + sBgmEnemyDistSq = actor->xyzDistToPlayerSq; + } + } + + if ((actor != sp8C) || (actor->flags & ACTOR_FLAG_80000)) { + temp_f0_2 = func_800B82EC(actor, player, D_801ED8DC); + phi_s2_2 = (actor->flags & 1) != 0; + if (phi_s2_2) { + phi_s2_2 = temp_f0_2 < D_801ED8C8; + } + phi_s2 = phi_s2_2; + phi_s2_2 = (actor->flags & ACTOR_FLAG_40000000) != 0; + if (phi_s2_2) { + phi_s2_2 = temp_f0_2 < D_801ED8D0; + } + + if (((phi_s2) || (phi_s2_2)) && (func_800B83BC(actor, temp_f0_2))) { + if (func_800BB59C(globalCtx, actor)) { + if (((!BgCheck_CameraLineTest1(&globalCtx->colCtx, &player->actor.focus.pos, + &actor->focus.pos, &sp70, &sp80, 1, 1, 1, 1, &sp7C)) || + (SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, sp80, sp7C)))) { + if (actor->targetPriority != 0) { + if ((phi_s2 != 0) && (actor->targetPriority < D_801ED8D4)) { + D_801ED8BC = actor; + D_801ED8D4 = actor->targetPriority; + } + if ((phi_s2_2 != 0) && (actor->targetPriority < D_801ED8D8)) { + D_801ED8C4 = actor; + D_801ED8D8 = actor->targetPriority; + } + } else { + if (phi_s2 != 0) { + D_801ED8B8 = actor; + D_801ED8C8 = temp_f0_2; + } + if (phi_s2_2 != 0) { + D_801ED8C0 = actor; + D_801ED8D0 = temp_f0_2; + } + } + } + } + } + } + } + } + + actor = actor->next; + } +} + +u8 D_801AED8C[] = { + ACTORCAT_BOSS, ACTORCAT_ENEMY, ACTORCAT_BG, ACTORCAT_EXPLOSIVES, ACTORCAT_NPC, ACTORCAT_ITEMACTION, + ACTORCAT_CHEST, ACTORCAT_SWITCH, ACTORCAT_PROP, ACTORCAT_MISC, ACTORCAT_DOOR, ACTORCAT_SWITCH, +}; + +void func_800BB8EC(GameState* gameState, ActorContext* actorCtx, Actor** arg2, Actor** arg3, Player* player) { + u8* actorCategories; + s32 i; + + D_801ED8B8 = D_801ED8BC = D_801ED8C0 = D_801ED8C4 = NULL; + D_801ED8C8 = D_801ED8D0 = sBgmEnemyDistSq = FLT_MAX; + D_801ED8D4 = D_801ED8D8 = INT32_MAX; + + actorCtx->targetContext.bgmEnemy = NULL; + D_801ED8DC = player->actor.shape.rot.y; + + actorCategories = D_801AED8C; + + for (i = 0; i < 3; i++) { + func_800BB604(gameState, actorCtx, player, *actorCategories); + actorCategories++; + } + + if (D_801ED8B8 == NULL) { + for (; i < ARRAY_COUNT(D_801AED8C); i++) { + func_800BB604(gameState, actorCtx, player, *actorCategories); + actorCategories++; + } + } + + if (D_801ED8B8 == NULL) { + *arg2 = D_801ED8BC; + } else { + *arg2 = D_801ED8B8; + } + + if (D_801ED8C0 == NULL) { + *arg3 = D_801ED8C4; + } else { + *arg3 = D_801ED8C0; + } +} + +/** + * Play the death sound effect and flash the screen white for 4 frames. + * While the screen flashes, the game freezes. + */ +void Enemy_StartFinishingBlow(GlobalContext* globalCtx, Actor* actor) { + globalCtx->actorCtx.freezeFlashTimer = 5; + Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); +} + +// blinking routine +s16 func_800BBAC0(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) { + if (DECR(arg0[1]) == 0) { + arg0[1] = Rand_S16Offset(arg1, arg2); + } + + if (arg0[1] - arg3 > 0) { + arg0[0] = 0; + } else if ((arg0[1] - arg3 >= -1) || (arg0[1] < 2)) { + arg0[0] = 1; + } else { + arg0[0] = 2; + } + + return arg0[0]; +} + +// blinking routine +s16 func_800BBB74(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) { + if (DECR(arg0[1]) == 0) { + arg0[1] = Rand_S16Offset(arg1, arg2); + } + + if (arg0[1] - arg3 > 0) { + arg0[0] = 0; + } else if (arg0[1] - arg3 == 0) { + arg0[0] = 1; + } else { + arg0[0] = 2; + } + + return arg0[0]; +} + +// unused blinking routine +s16 func_800BBC20(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) { + if (DECR(arg0[1]) == 0) { + arg0[1] = Rand_S16Offset(arg1, arg2); + arg0[0]++; + if ((arg0[0] % 3) == 0) { + arg0[0] = (s32)(Rand_ZeroOne() * arg3) * 3; + } + } + return arg0[0]; +} + +void Actor_SpawnBodyParts(Actor* actor, GlobalContext* globalCtx, s32 arg2, Gfx** dList) { + EnPart* part; + Actor* spawnedPart; + MtxF* currentMatrix; + + if (*dList != NULL) { + currentMatrix = Matrix_GetCurrentState(); + spawnedPart = + Actor_SpawnAsChild(&globalCtx->actorCtx, actor, globalCtx, ACTOR_EN_PART, currentMatrix->mf[3][0], + currentMatrix->mf[3][1], currentMatrix->mf[3][2], 0, 0, actor->objBankIndex, arg2); + if (spawnedPart != NULL) { + part = (EnPart*)spawnedPart; + + func_8018219C(currentMatrix, &part->actor.shape.rot, 0); + part->unk_150 = *dList; + Math_Vec3f_Copy(&part->actor.scale, &actor->scale); + } + } +} + +void Actor_SpawnFloorDustRing(GlobalContext* globalCtx, Actor* actor, Vec3f* posXZ, f32 radius, s32 countMinusOne, + f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting) { + Vec3f pos; + Vec3f accel = { 0.0f, 0.3f, 0.0f }; + s32 pad[2]; + f32 angle; + s32 i; + + angle = (Rand_ZeroOne() - 0.5f) * (2.0f * 3.14f); + pos.y = actor->floorHeight; + accel.y += (Rand_ZeroOne() - 0.5f) * 0.2f; + + for (i = countMinusOne; i >= 0; i--) { + pos.x = (sin_rad(angle) * radius) + posXZ->x; + pos.z = (cos_rad(angle) * radius) + posXZ->z; + accel.x = (Rand_ZeroOne() - 0.5f) * randAccelWeight; + accel.z = (Rand_ZeroOne() - 0.5f) * randAccelWeight; + + if (scale == 0) { + func_800B10C0(globalCtx, &pos, &gZeroVec3f, &accel); + } else if (useLighting) { + func_800B1210(globalCtx, &pos, &gZeroVec3f, &accel, scale, scaleStep); + } else { + func_800B11A0(globalCtx, &pos, &gZeroVec3f, &accel, scale, scaleStep); + } + angle += (2.0f * 3.14f) / (countMinusOne + 1.0f); + } +} + +void func_800BBFB0(GlobalContext* globalCtx, Vec3f* position, f32 arg2, s32 arg3, s16 arg4, s16 scaleStep, u8 arg6) { + Vec3f pos; + Vec3f accel = { 0.0f, 0.3f, 0.0f }; + s32 i; + + for (i = arg3; i >= 0; i--) { + s16 scale; + + pos.x = ((Rand_ZeroOne() - 0.5f) * arg2) + position->x; + pos.y = ((Rand_ZeroOne() - 0.5f) * arg2) + position->y; + pos.z = ((Rand_ZeroOne() - 0.5f) * arg2) + position->z; + + scale = (s32)(Rand_ZeroOne() * arg4 * 0.2f); + scale += arg4; + + if (arg6) { + func_800B1210(globalCtx, &pos, &gZeroVec3f, &accel, scale, scaleStep); + } else { + func_800B11A0(globalCtx, &pos, &gZeroVec3f, &accel, scale, scaleStep); + } + } +} + +void func_800BC154(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory) { + actorCtx->actorLists[actor->category].unk_08 = 1; + actor->category = actorCategory; +} + +// Damage flags for EnArrow +s32 D_801AEDB0[] = { + 0x800, 0x20, 0x20, 0x800, 0x1000, 0x2000, 0x1, 0x10000, 0x1, +}; + +s32 func_800BC188(s32 index) { + if ((index < 0) || (index >= ARRAY_COUNT(D_801AEDB0))) { + return 0; + } + + return D_801AEDB0[index]; +} + +s32 func_800BC1B4(Actor* actor, Actor* arg1, f32 arg2, f32 arg3) { + if ((arg3 > 0.0f) && (Actor_DistanceBetweenActors(arg1, actor) < ((arg3 * 2.5f) + arg2))) { + s16 temp_v1 = BINANG_SUB(Actor_YawBetweenActors(arg1, actor), arg1->world.rot.y); + + if (ABS_ALT(temp_v1) < 0x1400) { + return true; + } + } + + return false; +} + +Actor* func_800BC270(GlobalContext* globalCtx, Actor* actor, f32 arg2, s32 arg3) { + Actor* itemAction = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; + + while (itemAction != NULL) { + if (((itemAction->id == ACTOR_ARMS_HOOK) && (arg3 & 0x80)) || + ((itemAction->id == ACTOR_EN_BOOM) && (arg3 & 0x10)) || + ((itemAction->id == ACTOR_EN_ARROW) && (func_800BC188(itemAction->params) & arg3))) { + f32 speedXZ; + + if ((itemAction->speedXZ <= 0.0f) && (GET_PLAYER(globalCtx)->unk_D57 != 0)) { + if (itemAction->id == ACTOR_ARMS_HOOK) { + speedXZ = 20.0f; + } else if (itemAction->id == ACTOR_EN_BOOM) { + speedXZ = 12.0f; + } else { + s32 temp_v0_3 = func_800BC188(itemAction->params); + + if (temp_v0_3 == 1) { + speedXZ = 80.0f; + } else if (temp_v0_3 == 0x10000) { + speedXZ = 60.0f; + } else { + speedXZ = 150.0f; + } + } + } else { + speedXZ = itemAction->speedXZ; + } + + if (func_800BC1B4(actor, itemAction, arg2, speedXZ)) { + break; + } + } + + itemAction = itemAction->next; + } + + return itemAction; +} + +Actor* func_800BC444(GlobalContext* globalCtx, Actor* actor, f32 arg2) { + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; + + while (explosive != NULL) { + if (((explosive->id == ACTOR_EN_BOM) || (explosive->id == ACTOR_EN_BOM_CHU) || + (explosive->id == ACTOR_EN_BOMBF))) { + if (func_800BC1B4(actor, explosive, arg2, explosive->speedXZ)) { + break; + } + } + explosive = explosive->next; + } + + return explosive; +} + +/** + * Checks if a given actor will be standing on the ground after being translated + * by the provided distance and angle. + * + * Returns true if the actor will be standing on ground. + */ +s16 Actor_TestFloorInDirection(Actor* actor, GlobalContext* globalCtx, f32 distance, s16 angle) { + s16 ret; + u16 bgCheckFlags; + f32 dx; + f32 dz; + Vec3f actorPos; + + Math_Vec3f_Copy(&actorPos, &actor->world.pos); + + bgCheckFlags = actor->bgCheckFlags; + + dx = Math_SinS(angle) * distance; + dz = Math_CosS(angle) * distance; + + actor->world.pos.x += dx; + actor->world.pos.z += dz; + + Actor_UpdateBgCheckInfo(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4); + Math_Vec3f_Copy(&actor->world.pos, &actorPos); + + ret = actor->bgCheckFlags & 1; + + actor->bgCheckFlags = bgCheckFlags; + + return ret; +} + +/** + * Returns true if the player is targeting the provided actor + */ +s32 Actor_IsTargeted(GlobalContext* globalCtx, Actor* actor) { + Player* player = GET_PLAYER(globalCtx); + + if ((player->stateFlags3 & 0x80000000) && actor->isTargeted) { + return true; + } + + return false; +} + +/** + * Returns true if the player is targeting an actor other than the provided actor + */ +s32 Actor_OtherIsTargeted(GlobalContext* globalCtx, Actor* actor) { + Player* player = GET_PLAYER(globalCtx); + + if ((player->stateFlags3 & 0x80000000) && !actor->isTargeted) { + return true; + } + + return false; +} + +void func_800BC620(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) { + MtxF sp58; + f32 sp54; + Vec3f sp48; + CollisionPoly* sp44; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP, 0x2C); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, alpha); + + sp48.x = arg0->x; + sp48.y = arg0->y + 1.0f; + sp48.z = arg0->z; + + sp54 = BgCheck_EntityRaycastFloor2(globalCtx, &globalCtx->colCtx, &sp44, &sp48); + if (sp44 != NULL) { + func_800C0094(sp44, arg0->x, sp54, arg0->z, &sp58); + Matrix_SetCurrentState(&sp58); + } else { + Matrix_InsertTranslation(arg0->x, arg0->y, arg0->z, MTXMODE_NEW); + } + Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gCircleShadowDL); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_800BC770(GlobalContext* globalCtx, s16 y, s16 countdown) { + s16 idx = Quake_Add(&globalCtx->mainCamera, 3); + + Quake_SetSpeed(idx, 20000); + Quake_SetQuakeValues(idx, y, 0, 0, 0); + Quake_SetCountdown(idx, countdown); +} + +void func_800BC7D8(GlobalContext* globalCtx, s16 y, s16 countdown, s16 speed) { + s16 idx = Quake_Add(&globalCtx->mainCamera, 3); + + Quake_SetSpeed(idx, speed); + Quake_SetQuakeValues(idx, y, 0, 0, 0); + Quake_SetCountdown(idx, countdown); +} + +void func_800BC848(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) { + if (arg2 >= 5) { + func_8013ECE0(actor->xyzDistToPlayerSq, 255, 20, 150); + } else { + func_8013ECE0(actor->xyzDistToPlayerSq, 180, 20, 100); + } + func_800BC770(globalCtx, arg2, arg3); +} + +typedef struct { + /* 0x00 */ f32 chainAngle; + /* 0x04 */ f32 chainLength; + /* 0x08 */ f32 yShift; + /* 0x0C */ f32 chainsScale; + /* 0x10 */ f32 chainsRotZInit; + /* 0x14 */ Gfx* chainDL; + /* 0x18 */ Gfx* lockDL; +} DoorLockInfo; // size = 0x1C + +DoorLockInfo sDoorLocksInfo[DOORLOCK_MAX] = { + /* DOORLOCK_NORMAL */ { 0.54f, 6000.0f, 5000.0, 1.0f, 0.0f, gDoorChainsDL, gDoorLockDL }, + /* DOORLOCK_BOSS */ { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, object_bdoor_DL_000530, object_bdoor_DL_000400 }, + /* DOORLOCK_2 */ { 0.6400000453f, 8500.0f, 8000.0f, 1.75f, 0.1f, gDoorChainsDL, gDoorLockDL }, +}; + +/** + * Draws chains and lock of a locked door, of the specified `type` (see `DoorLockType`). + * `frame` can be 0 to 10, where 0 is "open" and 10 is "closed", the chains slide accordingly. + */ +void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { + s32 pad[2]; + MtxF baseMtxF; + s32 i; + f32 chainsTranslateX; + f32 chainsTranslateY; + DoorLockInfo* entry = &sDoorLocksInfo[type]; + f32 chainRotZ = entry->chainsRotZInit; + f32 rotZStep; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + Matrix_InsertTranslation(0.0f, entry->yShift, 500.0f, MTXMODE_APPLY); + Matrix_CopyCurrentState(&baseMtxF); + + chainsTranslateX = __sinf(entry->chainAngle - chainRotZ) * -(10 - frame) * 0.1f * entry->chainLength; + chainsTranslateY = __cosf(entry->chainAngle - chainRotZ) * (10 - frame) * 0.1f * entry->chainLength; + + for (i = 0; i < 4; i++) { + Matrix_SetCurrentState(&baseMtxF); + Matrix_InsertZRotation_f(chainRotZ, MTXMODE_APPLY); + Matrix_InsertTranslation(chainsTranslateX, chainsTranslateY, 0.0f, MTXMODE_APPLY); + if (entry->chainsScale != 1.0f) { + Matrix_Scale(entry->chainsScale, entry->chainsScale, entry->chainsScale, MTXMODE_APPLY); + } + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, entry->chainDL); + + if ((i % 2) != 0) { + rotZStep = 2.0f * entry->chainAngle; + } else { + rotZStep = M_PI - (2.0f * entry->chainAngle); + } + + chainRotZ += rotZStep; + } + + Matrix_SetCurrentState(&baseMtxF); + Matrix_Scale(frame * 0.1f, frame * 0.1f, frame * 0.1f, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, entry->lockDL); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void Actor_SpawnShieldParticlesMetal(GlobalContext* globalCtx, Vec3f* pos) { + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, pos); +} + +void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 xluFlag, u16 duration) { + if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) { + Actor_PlaySfxAtPos(actor, NA_SE_EN_LIGHT_ARROW_HIT); + } + + actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration; + actor->colorFilterTimer = duration; +} + +Hilite* func_800BCBF4(Vec3f* arg0, GlobalContext* globalCtx) { + Vec3f lightDir; + + lightDir.x = globalCtx->envCtx.dirLight1.params.dir.x; + lightDir.y = globalCtx->envCtx.dirLight1.params.dir.y; + lightDir.z = globalCtx->envCtx.dirLight1.params.dir.z; + + return Hilite_DrawOpa(arg0, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); +} + +Hilite* func_800BCC68(Vec3f* arg0, GlobalContext* globalCtx) { + Vec3f lightDir; + + lightDir.x = globalCtx->envCtx.dirLight1.params.dir.x; + lightDir.y = globalCtx->envCtx.dirLight1.params.dir.y; + lightDir.z = globalCtx->envCtx.dirLight1.params.dir.z; + + return Hilite_DrawXlu(arg0, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); +} + +void func_800BCCDC(Vec3s* points, s32 pathCount, Vec3f* pos1, Vec3f* pos2, s32 arg4) { + s32 spB4; + s32 spB0; + s32 spA8[2] = { 0, 0 }; + s32 spA0[2] = { 0, 0 }; + Vec3f sp94; + Vec3f sp7C[2]; + Vec3f sp70; + Vec3f sp64; + f32 sp60; + f32 sp5C; + f32 sp54[2]; + + spB0 = 0; + sp5C = SQ(40000.0f); + + for (spB4 = 0; spB4 < pathCount; spB4++) { + sp60 = Math3D_XZDistanceSquared(pos1->x, pos1->z, points[spB4].x, points[spB4].z); + if (sp60 < sp5C) { + sp5C = sp60; + spB0 = spB4; + } + } + + sp94.x = (points + spB0)->x; + sp94.z = (points + spB0)->z; + pos2->y = (points + spB0)->y; + if (spB0 != 0) { + sp64.x = (points + spB0 - 1)->x; + sp64.z = (points + spB0 - 1)->z; + } else if (arg4) { + sp64.x = (points + pathCount - 1)->x; + sp64.z = (points + pathCount - 1)->z; + } + + if ((spB0 != 0) || arg4) { + spA8[0] = + Math3D_PointDistToLine2D(pos1->x, pos1->z, sp64.x, sp64.z, sp94.x, sp94.z, &sp7C[0].x, &sp7C[0].z, &sp60); + } + + if (spB0 + 1 != pathCount) { + sp70.x = (points + spB0 + 1)->x; + sp70.z = (points + spB0 + 1)->z; + } else if (arg4) { + sp70.x = points->x; + sp70.z = points->z; + } + + if ((spB0 + 1 != pathCount) || arg4) { + spA8[1] = + Math3D_PointDistToLine2D(pos1->x, pos1->z, sp94.x, sp94.z, sp70.x, sp70.z, &sp7C[1].x, &sp7C[1].z, &sp60); + } + + if (arg4) { + s32 phi_s0_2; + + spA0[0] = ((sp64.x - pos1->x) * (sp94.z - pos1->z)) < ((sp64.z - pos1->z) * (sp94.x - pos1->x)); + spA0[1] = ((sp70.z - pos1->z) * (sp94.x - pos1->x)) < ((sp94.z - pos1->z) * (sp70.x - pos1->x)); + + for (phi_s0_2 = 0; phi_s0_2 < ARRAY_COUNT(sp54); phi_s0_2++) { + if (spA8[phi_s0_2] != 0) { + sp54[phi_s0_2] = Math3D_XZDistanceSquared(pos1->x, pos1->z, sp7C[phi_s0_2].x, sp7C[phi_s0_2].z); + } else { + sp54[phi_s0_2] = SQ(40000.0f); + } + } + } + + if (arg4 && (((spA0[0] != 0) && (spA0[1] != 0)) || ((spA0[0] != 0) && (spA8[0] != 0) && (sp54[0] < sp54[1])) || + ((spA0[1] != 0) && (spA8[1] != 0) && (sp54[1] < sp54[0])))) { + pos2->x = pos1->x; + pos2->z = pos1->z; + } else if ((spA8[0] != 0) && (spA8[1] != 0)) { + if ((spA0[0] == 0) && (spA0[1] == 0)) { + if (Math3D_PointDistToLine2D(pos1->x, pos1->z, sp7C[0].x, sp7C[0].z, sp7C[1].x, sp7C[1].z, &pos2->x, + &pos2->z, &sp60) == 0) { + pos2->x = (sp7C[1].x + sp7C[0].x) * 0.5f; + pos2->z = (sp7C[1].z + sp7C[0].z) * 0.5f; + } + } else if (sp54[1] < sp54[0]) { + pos2->x = sp7C[1].x; + pos2->z = sp7C[1].z; + } else { + pos2->x = sp7C[0].x; + pos2->z = sp7C[0].z; + } + } else if (spA8[0] != 0) { + pos2->x = sp7C[0].x; + pos2->z = sp7C[0].z; + } else if (spA8[1] != 0) { + pos2->x = sp7C[1].x; + pos2->z = sp7C[1].z; + } else if (arg4 && ((((sp64.x - pos1->x) * (sp70.z - pos1->z)) < ((sp64.z - pos1->z) * (sp70.x - pos1->x))))) { + pos2->x = pos1->x; + pos2->z = pos1->z; + } else { + pos2->x = sp94.x; + pos2->z = sp94.z; + } +} + +// unused +s32 func_800BD2B4(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, + u16 (*textIdCallback)(GlobalContext*, Actor*), s16 (*arg5)(GlobalContext*, Actor*)) { + if (Actor_ProcessTalkRequest(actor, &globalCtx->state)) { + *arg2 = true; + return true; + } else if (*arg2) { + *arg2 = arg5(globalCtx, actor); + return false; + } else if (!func_800B8934(globalCtx, actor)) { + return false; + } else if (!func_800B8614(actor, globalCtx, arg3)) { + return false; + } else { + actor->textId = textIdCallback(globalCtx, actor); + return false; + } +} + +typedef struct { + /* 0x00 */ s16 unk_00; + /* 0x02 */ s16 unk_02; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 unk_06; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ u8 unk_0C; +} struct_801AEE38_0; // size = 0x10 + +typedef struct { + /* 0x00 */ struct_801AEE38_0 sub_00; + /* 0x10 */ f32 unk_10; + /* 0x14 */ s16 unk_14; +} struct_801AEE38; // size = 0x18 + +struct_801AEE38 D_801AEE38[] = { + { { 0x1C20, 0xE390, 0x1C70, 0x1554, 0x0000, 0x0000, 0x0000 }, 170.0f, 0x3FFC }, + { { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, 0x0001 }, 170.0f, 0x3FFC }, + { { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, 0x0001 }, 170.0f, 0x3FFC }, + { { 0x1554, 0xF1C8, 0x0000, 0x071C, 0xF8E4, 0x0000, 0x0001 }, 170.0f, 0x3FFC }, + { { 0x2AA8, 0xF8E4, 0x071C, 0x0E38, 0xD558, 0x2AA8, 0x0001 }, 170.0f, 0x3FFC }, + { { 0x0000, 0xE390, 0x2AA8, 0x3FFC, 0xF1C8, 0x0E38, 0x0001 }, 170.0f, 0x3FFC }, + { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, 0x0001 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, + { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, + { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, 0x0001 }, 0.0f, 0x0000 }, + { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, 0x0001 }, 0.0f, 0x0000 }, + { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 0x0001 }, 0.0f, 0x0000 }, + { { 0x2A6C, 0xE390, 0x1C70, 0x1554, 0x0000, 0x0000, 0x0000 }, 170.0f, 0x3FFC }, +}; + +void func_800BD384(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, + u8 arg8) { + s16 sp46; + s16 sp44; + s16 temp2; + s16 sp40; + s16 temp1; + Vec3f sp30; + + sp30.x = actor->world.pos.x; + sp30.y = actor->world.pos.y + arg1->unk_14; + sp30.z = actor->world.pos.z; + + sp46 = Math_Vec3f_Pitch(&sp30, &arg1->unk_18); + sp44 = Math_Vec3f_Yaw(&sp30, &arg1->unk_18); + sp40 = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18) - actor->shape.rot.y; + + temp1 = CLAMP(sp40, -arg2, arg2); + Math_SmoothStepToS(&arg1->unk_08.y, temp1, 6, 2000, 1); + + temp1 = (ABS_ALT(sp40) >= 0x8000) ? 0 : ABS_ALT(sp40); + arg1->unk_08.y = CLAMP(arg1->unk_08.y, -temp1, temp1); + + sp40 -= arg1->unk_08.y; + + temp1 = CLAMP(sp40, -arg5, arg5); + Math_SmoothStepToS(&arg1->unk_0E.y, temp1, 6, 2000, 1); + + temp1 = (ABS_ALT(sp40) >= 0x8000) ? 0 : ABS_ALT(sp40); + arg1->unk_0E.y = CLAMP(arg1->unk_0E.y, -temp1, temp1); + + if (arg8) { + Math_SmoothStepToS(&actor->shape.rot.y, sp44, 6, 2000, 1); + } + + temp1 = CLAMP(sp46, arg4, (s16)(u16)arg3); + Math_SmoothStepToS(&arg1->unk_08.x, temp1, 6, 2000, 1); + + temp2 = sp46 - arg1->unk_08.x; + + temp1 = CLAMP(temp2, arg7, arg6); + Math_SmoothStepToS(&arg1->unk_0E.x, temp1, 6, 2000, 1); +} + +// unused +s16 func_800BD6B8(s16 arg0) { + return D_801AEE38[arg0].unk_14; +} + +s16 func_800BD6E4(Actor* actor, struct_800BD888_arg1* arg1, f32 arg2, s16 arg3, s16 flag) { + s32 pad; + + if (flag) { + return flag; + } else if (arg1->unk_00 != 0) { + return 4; + } else if (arg2 < Math_Vec3f_DistXYZ(&actor->world.pos, &arg1->unk_18)) { + arg1->unk_04 = 0; + arg1->unk_06 = 0; + return 1; + } else { + s16 yaw = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18); + s16 phi_a0 = ABS_ALT(BINANG_SUB(yaw, actor->shape.rot.y)); + + if (arg3 >= phi_a0) { + arg1->unk_04 = 0; + arg1->unk_06 = 0; + return 2; + } else if (DECR(arg1->unk_04) != 0) { + return arg1->unk_02; + } else { + switch (arg1->unk_06) { + case 0: + case 2: + arg1->unk_04 = Rand_S16Offset(30, 30); + arg1->unk_06++; + return 1; + + case 1: + arg1->unk_04 = Rand_S16Offset(10, 10); + arg1->unk_06++; + return 3; + + default: + return 4; + } + } + } +} // This function is very similar to OoT's func_80034A14 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD888.s") +void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3) { + struct_801AEE38_0 sp38; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD9A0.s") + arg1->unk_02 = func_800BD6E4(actor, arg1, D_801AEE38[arg2].unk_10, D_801AEE38[arg2].unk_14, arg3); + sp38 = D_801AEE38[arg2].sub_00; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BD9E0.s") + switch (arg1->unk_02) { + case 1: + sp38.unk_00 = 0; + sp38.unk_04 = 0; + sp38.unk_02 = 0; + case 3: + sp38.unk_06 = 0; + sp38.unk_0A = 0; + sp38.unk_08 = 0; + case 2: + sp38.unk_0C = 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BDAA0.s") + func_800BD384(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02, sp38.unk_06, sp38.unk_0A, sp38.unk_08, + sp38.unk_0C); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BDB6C.s") +Gfx D_801AEF88[] = { + gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + G_RM_FOG_SHADE_A, + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), + gsDPSetAlphaCompare(G_AC_THRESHOLD), + gsSPEndDisplayList(), +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BDC5C.s") +Gfx D_801AEFA0[] = { + gsSPEndDisplayList(), +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BDCF4.s") +void* func_800BD9A0(GraphicsContext* gfxCtx) { + Gfx* displayListHead; + Gfx* displayList; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_Noop.s") + displayListHead = displayList = GRAPH_ALLOC(gfxCtx, 0x10); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BDFC0.s") + gDPSetRenderMode(displayListHead++, + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + G_RM_FOG_SHADE_A, + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); + gSPEndDisplayList(displayListHead++); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE03C.s") + return displayList; +} -Actor* func_800BE0B8(GlobalContext* globalCtx, Actor* inActor, s16 arg2, u8 arg3, f32 arg4) { - Actor* actor = globalCtx->actorCtx.actorList[arg3].first; +// unused +void func_800BD9E0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, + PostLimbDraw postLimbDraw, Actor* actor, s16 alpha) { + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, alpha); + gSPSegment(POLY_OPA_DISP++, 0x0C, gEmptyDL); + + POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, + overrideLimbDraw, postLimbDraw, actor, POLY_OPA_DISP); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_800BDAA0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, + PostLimbDraw postLimbDraw, Actor* actor, s16 alpha) { + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C2DC(globalCtx->state.gfxCtx); + + gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, alpha); + gSPSegment(POLY_XLU_DISP++, 0x0C, func_800BD9A0(globalCtx->state.gfxCtx)); + + POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, + overrideLimbDraw, postLimbDraw, actor, POLY_XLU_DISP); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +// Unused +s16 func_800BDB6C(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) { + Player* player = GET_PLAYER(globalCtx); + f32 phi_f2; + + if ((globalCtx->csCtx.state != 0) || (D_801D0D50 != 0)) { + phi_f2 = Math_Vec3f_DistXYZ(&actor->world.pos, &globalCtx->view.eye) * 0.25f; + } else { + phi_f2 = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); + } + + if (arg3 < phi_f2) { + actor->flags &= ~ACTOR_FLAG_1; + Math_SmoothStepToS(&arg2, 0, 6, 0x14, 1); + } else { + actor->flags |= ACTOR_FLAG_1; + Math_SmoothStepToS(&arg2, 0xFF, 6, 0x14, 1); + } + + return arg2; +} + +void Actor_ChangeAnimation(SkelAnime* skelAnime, ActorAnimationEntry* animation, s32 index) { + f32 frameCount; + + animation += index; + if (animation->frameCount > 0.0f) { + frameCount = animation->frameCount; + } else { + frameCount = Animation_GetLastFrame(&animation->animation->common); + } + + Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount, + animation->mode, animation->morphFrames); +} + +// Unused +void func_800BDCF4(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 size) { + s32 frames = globalCtx->gameplayFrames; + s32 i; + + for (i = 0; i < size; i++) { + arg1[i] = (0x814 + 50 * i) * frames; + arg2[i] = (0x940 + 50 * i) * frames; + } +} + +void Actor_Noop(Actor* actor, GlobalContext* globalCtx) { +} + +#include "z_cheap_proc.c" + +/** + * Finds the first actor instance of a specified Id and category within a given range from + * an actor if there is one. If the Id provided is -1, this will look for any actor of the + * specified category rather than a specific Id. + */ +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* inActor, s16 actorId, u8 actorCategory, f32 distance) { + Actor* actor = globalCtx->actorCtx.actorLists[actorCategory].first; while (actor != NULL) { - if (actor == inActor || ((arg2 != -1) && (arg2 != actor->id))) { + if (actor == inActor || ((actorId != -1) && (actorId != actor->id))) { actor = actor->next; continue; } - if (Actor_DistanceBetweenActors(inActor, actor) <= arg4) { + if (Actor_DistanceBetweenActors(inActor, actor) <= distance) { return actor; } @@ -870,26 +4307,434 @@ Actor* func_800BE0B8(GlobalContext* globalCtx, Actor* inActor, s16 arg2, u8 arg3 return NULL; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE184.s") +s32 func_800BE184(GlobalContext* globalCtx, Actor* actor, f32 xzDist, s16 arg3, s16 arg4, s16 arg5) { + Player* player = GET_PLAYER(globalCtx); + s16 phi_v0 = BINANG_SUB(BINANG_ROT180(actor->yawTowardsPlayer), player->actor.shape.rot.y); + s16 temp_t0 = actor->yawTowardsPlayer - arg5; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_ApplyDamage.s") + if ((actor->xzDistToPlayer <= xzDist) && (player->swordState != 0)) { + if ((arg4 >= ABS_ALT(phi_v0)) && (arg3 >= ABS_ALT(temp_t0))) { + return true; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE258.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE2B8.s") +u8 Actor_ApplyDamage(Actor* actor) { + if (actor->colChkInfo.damage >= actor->colChkInfo.health) { + actor->colChkInfo.health = 0; + } else { + actor->colChkInfo.health -= actor->colChkInfo.damage; + } + return actor->colChkInfo.health; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE33C.s") +void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo) { + ColliderInfo* acHitInfo = colInfo->acHitInfo; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE3D0.s") + if (acHitInfo == NULL) { + actor->dropFlag = 0; + } else if (acHitInfo->toucher.dmgFlags & 0x800) { // DMG_FIRE_ARROW + actor->dropFlag = 1; + } else if (acHitInfo->toucher.dmgFlags & 0x1000) { // DMG_ICE_ARROW + actor->dropFlag = 2; + } else if (acHitInfo->toucher.dmgFlags & 0x2000) { // DMG_LIGHT_ARROW + actor->dropFlag = 0x20; + } else { + actor->dropFlag = 0; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE504.s") +void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSphere) { + s32 i; + ColliderJntSphElement* jntElement; + ColliderInfo* acHitInfo; + s32 flag; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE568.s") + actor->dropFlag = 0; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE5CC.s") + for (i = jntSphere->count - 1; i >= 0; i--) { + jntElement = &jntSphere->elements[i]; + acHitInfo = jntElement->info.acHitInfo; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE63C.s") + if (acHitInfo == NULL) { + flag = 0; + } else { + s32 dmgFlags = acHitInfo->toucher.dmgFlags; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BE680.s") + if (dmgFlags & 0x800) { + flag = 1; + } else if (dmgFlags & 0x1000) { + flag = 2; + } else { + flag = (dmgFlags & 0x2000) ? 0x20 : 0; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800BF7CC.s") + actor->dropFlag |= flag; + } +} + +void func_800BE33C(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3) { + f32 xDiff = arg1->x - arg0->x; + f32 zDiff = arg1->z - arg0->z; + f32 yDiff = arg3 ? (arg1->y - arg0->y) : (arg0->y - arg1->y); + + arg2->y = Math_FAtan2F(zDiff, xDiff); + arg2->x = Math_FAtan2F(sqrtf(SQ(xDiff) + SQ(zDiff)), yDiff); +} + +void func_800BE3D0(Actor* actor, s16 angle, Vec3s* arg2) { + f32 sp44; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp34; + f32 sp30; + f32 sp2C; + s32 pad[3]; + + if (actor->floorPoly != NULL) { + CollisionPoly* floorPoly = actor->floorPoly; + + sp44 = COLPOLY_GET_NORMAL(floorPoly->normal.x); + sp40 = COLPOLY_GET_NORMAL(floorPoly->normal.y); + sp3C = COLPOLY_GET_NORMAL(floorPoly->normal.z); + + sp38 = Math_SinS(angle); + sp34 = Math_CosS(angle); + arg2->x = (s16)-Math_Atan2S((-(sp44 * sp38) - (sp3C * sp34)) * sp40, 1.0f); + + sp2C = Math_SinS(angle - 0x3FF7); + sp30 = Math_CosS(angle - 0x3FF7); + arg2->z = (s16)-Math_Atan2S((-(sp44 * sp2C) - (sp3C * sp30)) * sp40, 1.0f); + } +} + +void func_800BE504(Actor* actor, ColliderCylinder* collider) { + // Checks if was hit by either DMG_NORMAL_ARROW, DMG_FIRE_ARROW, DMG_ICE_ARROW, DMG_LIGHT_ARROW or DMG_DEKU_BUBBLE + if ((collider->info.acHitInfo->toucher.dmgFlags & (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20))) { + actor->world.rot.y = collider->base.ac->shape.rot.y; + } else { + actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor); + } +} + +void func_800BE568(Actor* actor, ColliderSphere* collider) { + if (collider->info.acHitInfo->toucher.dmgFlags & (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20)) { + actor->world.rot.y = collider->base.ac->shape.rot.y; + } else { + actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor); + } +} + +void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 colliderIndex) { + if (collider->elements[colliderIndex].info.acHitInfo->toucher.dmgFlags & + (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20)) { + actor->world.rot.y = collider->base.ac->shape.rot.y; + } else { + actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor); + } +} + +s32 func_800BE63C(struct EnBox* chest) { + if ((chest->unk_1F1 == 5) || (chest->unk_1F1 == 6) || (chest->unk_1F1 == 7) || (chest->unk_1F1 == 8) || + (chest->unk_1F1 == 0xC)) { + return true; + } + return false; +} + +TexturePtr D_801AEFA8[] = { + gameplay_keep_Tex_091DE0, + gameplay_keep_Tex_091FE0, + gameplay_keep_Tex_0921E0, + gameplay_keep_Tex_0923E0, +}; + +// Draw common damageEffects +void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s16 arg3, f32 effectScale, f32 steamScale, + f32 effectAlpha, u8 mode) { + if (effectAlpha > 0.001f) { + s32 temp_v1_3; + s16 i; + MtxF* temp_s3; + f32 alpha; + f32 sp124; + f32 sp120; + f32 sp11C; + f32 sp118; + Vec3f* limbAux = limbPos; + u32 sp110 = globalCtx->gameplayFrames; + f32 sp74; + + temp_s3 = Matrix_GetCurrentState(); + + if ((actor != NULL) && (effectAlpha > 0.05f) && (globalCtx->gameOverCtx.state == 0)) { + if (mode == 0) { + Actor_PlaySfxAtPos(actor, NA_SE_EV_BURN_OUT - SFX_FLAG); + } else if (mode == 1) { + Actor_PlaySfxAtPos(actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); + } else if (mode == 0xB) { + Actor_PlaySfxAtPos(actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + } else if ((mode == 0x14) || (mode == 0x15)) { + Actor_PlaySfxAtPos(actor, NA_SE_EN_COMMON_DEADLIGHT - SFX_FLAG); + } + } + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C2DC(globalCtx->state.gfxCtx); + + switch (mode) { + case 0xA: + case 0xB: + sp124 = ((KREG(19) * 0.01f) + 2.3f) * effectScale; + sp118 = ((KREG(28) * 0.0001f) + 0.035f) * steamScale; + func_800BCC68(limbPos, globalCtx); + + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, sp110 & 0xFF, 0x20, 0x10, 1, 0, + (sp110 * 2) & 0xFF, 0x40, 0x20)); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, 255); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_050648); + + sp74 = effectAlpha * 255.0f; + for (i = 0; i < arg3; i++) { + alpha = i & 3; + alpha = sp74 - (30.0f * alpha); + if (sp74 < (30.0f * (i & 3))) { + alpha = 0.0f; + } + if (alpha > 255.0f) { + alpha = 255.0f; + } + + gDPSetEnvColor(POLY_XLU_DISP++, KREG(20) + 0xC8, KREG(21) + 0xC8, KREG(22) + 0xFF, (u8)alpha); + + Matrix_InsertTranslation(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW); + Matrix_Scale(sp124, sp124, sp124, MTXMODE_APPLY); + if (i & 1) { + Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY); + } + if (i & 2) { + Matrix_InsertZRotation_f(M_PI, MTXMODE_APPLY); + } + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0506E0); + + limbPos++; + } + + limbPos = limbAux; + + gDPSetColorDither(POLY_XLU_DISP++, G_CD_BAYER); + + gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_PATTERN); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_051180); + + alpha = effectAlpha * 100.0f; + if (alpha > 100.0f) { + alpha = 100.0f; + } + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (u8)alpha); + + for (i = 0; i < arg3; i++) { + temp_v1_3 = ((i * 3) + sp110); + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, temp_v1_3 * 3, temp_v1_3 * -0xC, 0x20, 0x40, + 1, 0, 0, 0x20, 0x20)); + + Matrix_InsertTranslation(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW); + Matrix_NormalizeXYZ(&globalCtx->billboardMtxF); + Matrix_Scale(sp118, sp118, 1.0f, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_051238); + + limbPos++; + } + break; + + case 0x0: + case 0x1: + if (mode == 0) { + gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, 0); + } else { + gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, 0); + mode = 0xFF; + } + + Matrix_SetCurrentState(&globalCtx->billboardMtxF); + Matrix_Scale((effectScale * 0.005f) * 1.35f, (effectScale * 0.005f), (effectScale * 0.005f) * 1.35f, 1); + + sp74 = effectAlpha * 255.0f; + + for (i = 0; i < arg3; i++) { + alpha = i & 3; + alpha = sp74 - 30.0f * alpha; + if (sp74 < 30.0f * (i & 3)) { + alpha = 0.0f; + } + if (alpha > 255.0f) { + alpha = 255.0f; + } + + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, mode, (u8)alpha); + + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, + ((i * 10 + sp110) * -0x14) & 0x1FF, 0x20, 0x80)); + + Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY); + temp_s3->mf[3][0] = limbPos->x; + temp_s3->mf[3][1] = limbPos->y; + temp_s3->mf[3][2] = limbPos->z; + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL); + + limbPos++; + } + break; + + case 0x14: + case 0x15: + sp120 = ((KREG(19) * 0.01f) + 4.0f) * effectScale; + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023348); + + alpha = effectAlpha * 255.0f; + if (alpha > 255.0f) { + alpha = 255.0f; + } + + if (mode == 0x15) { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (u8)(sREG(16) + 0xFF), (u8)(sREG(17) + 0xFF), + (u8)(sREG(18) + 0xFF), (u8)alpha); + + gDPSetEnvColor(POLY_XLU_DISP++, (u8)sREG(19), (u8)(sREG(20) + 0xFF), (u8)(sREG(21) + 0xFF), 0x80); + } else { + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, (u8)alpha); + + gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 128); + } + Matrix_SetCurrentState(&globalCtx->billboardMtxF); + Matrix_Scale(sp120, sp120, 1.0f, MTXMODE_APPLY); + + for (i = 0; i < arg3; i++) { + Matrix_InsertZRotation_f(randPlusMinusPoint5Scaled(2 * M_PI), MTXMODE_APPLY); + temp_s3->mf[3][0] = limbPos->x; + temp_s3->mf[3][1] = limbPos->y; + temp_s3->mf[3][2] = limbPos->z; + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428); + + limbPos++; + } + break; + + case 0x1E: + case 0x1F: + case 0x20: + if (mode == 0x1E) { + sp11C = (KREG(19) * 0.01f + 1.0f) * effectScale; + } else if (mode == 0x1F) { + sp11C = (KREG(19) * 0.01f + 1.5f) * effectScale; + } else { + sp11C = (KREG(19) * 0.01f + 2.0f) * effectScale; + } + + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_801AEFA8[globalCtx->gameplayFrames & 3])); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023480); + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (u8)(sREG(16) + 0xFF), (u8)(sREG(17) + 0xFF), + (u8)(sREG(18) + 0x96), (u8)(sREG(19) + 0xFF)); + + gDPSetEnvColor(POLY_XLU_DISP++, (u8)(sREG(20) + 0xFF), (u8)(sREG(21) + 0xFF), (u8)sREG(22), + (u8)sREG(23)); + + Matrix_SetCurrentState(&globalCtx->billboardMtxF); + Matrix_Scale(sp11C, sp11C, sp11C, MTXMODE_APPLY); + + for (i = 0; i < arg3; i++) { + Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI)); + Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), 1); + temp_s3->mf[3][0] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->x; + temp_s3->mf[3][1] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->y; + temp_s3->mf[3][2] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->z; + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0234F0); + + Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI)); + Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), 1); + temp_s3->mf[3][0] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->x; + temp_s3->mf[3][1] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->y; + temp_s3->mf[3][2] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->z; + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0234F0); + + limbPos++; + } + break; + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } +} + +void Actor_SpawnIceEffects(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s32 limbPosCount, + s32 effectsPerLimb, f32 scale, f32 scaleRange) { + static Color_RGBA8 primColor = { 170, 255, 255, 255 }; + static Color_RGBA8 envColor = { 200, 200, 255, 255 }; + static Vec3f accel = { 0.0f, -1.0f, 0.0f }; + s32 i; + s32 pad; + Vec3f velocity; + s16 randomYaw; + s16 yaw; + s32 j; + + Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 30, NA_SE_EV_ICE_BROKEN); + + for (i = 0; i < limbPosCount; i++) { + yaw = Actor_YawToPoint(actor, limbPos); + + for (j = 0; j < effectsPerLimb; j++) { + randomYaw = (Rand_Next() >> 0x13) + yaw; + + velocity.z = Rand_ZeroFloat(5.0f); + + velocity.x = Math_SinS(randomYaw) * velocity.z; + velocity.y = Rand_ZeroFloat(4.0f) + 8.0f; + velocity.z *= Math_CosS(randomYaw); + + EffectSsEnIce_Spawn(globalCtx, limbPos, Rand_ZeroFloat(scaleRange) + scale, &velocity, &accel, &primColor, + &envColor, 30); + } + + limbPos++; + } +} diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index f33fcd538..77b6546ff 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -722,7 +722,7 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n"); for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxActorId; i++, overlayEntry++) { - overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart; + overlaySize = VRAM_PTR_SIZE(overlayEntry); if (overlayEntry->loadedRamAddr != NULL) { FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->numLoaded, ""); @@ -740,7 +740,7 @@ void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) { u32 offset; for (i = 0; i < gMaxActorId; i++, overlayEntry++) { - size = (u8*)overlayEntry->vramEnd - (u8*)overlayEntry->vramStart; + size = VRAM_PTR_SIZE(overlayEntry); ramStart = overlayEntry->loadedRamAddr; ramEnd = ramStart + size; offset = (u8*)overlayEntry->vramStart - ramStart; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index d7a94da5b..850d5234b 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -3991,7 +3991,7 @@ void BgCheck_InitCollisionHeaders(CollisionContext* colCtx, GlobalContext* globa for (i = 0; i < BG_ACTOR_MAX; i++) { flag = dyna->bgActorFlags[i]; if ((flag & 1) && !(flag & 2)) { - Actor_SetObjectSegment(globalCtx, dyna->bgActors[i].actor); + Actor_SetObjectDependency(globalCtx, dyna->bgActors[i].actor); CollisionHeader_SegmentedToVirtual(dyna->bgActors[i].colHeader); } } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 4c2502470..1e983c954 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -312,7 +312,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetMode.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DF840.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeMode.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DF86C.s") diff --git a/src/code/z_cheap_proc.c b/src/code/z_cheap_proc.c new file mode 100644 index 000000000..d0709fde9 --- /dev/null +++ b/src/code/z_cheap_proc.c @@ -0,0 +1,39 @@ +#include "global.h" + +/** + * Draws a display list to the opaque display buffer + */ +void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist) { + Gfx* dl; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + dl = POLY_OPA_DISP; + + gSPDisplayList(&dl[0], &sSetupDL[6 * 0x19]); + gSPMatrix(&dl[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(&dl[2], dlist); + + POLY_OPA_DISP = &dl[3]; + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +/** + * Draws a display list to the translucent display buffer + */ +void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist) { + Gfx* dl; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + dl = POLY_XLU_DISP; + + gSPDisplayList(&dl[0], &sSetupDL[6 * 0x19]); + gSPMatrix(&dl[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(&dl[2], dlist); + + POLY_XLU_DISP = &dl[3]; + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 424166f89..fddcf7f95 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -172,7 +172,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init } sEffectSsInfo.searchIndex = index + 1; - overlaySize = (uintptr_t)entry->vramEnd - (uintptr_t)entry->vramStart; + overlaySize = VRAM_PTR_SIZE(entry); if (entry->vramStart == NULL) { initInfo = entry->initInfo; @@ -187,10 +187,8 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init Load2_LoadOverlay(entry->vromStart, entry->vromEnd, entry->vramStart, entry->vramEnd, entry->loadedRamAddr); } - initInfo = (u32)((entry->initInfo != NULL) - ? (EffectSsInit*)(-((uintptr_t)entry->vramStart - (uintptr_t)entry->loadedRamAddr) + - (uintptr_t)entry->initInfo) - : NULL); + initInfo = (uintptr_t)( + (entry->initInfo != NULL) ? (void*)(-OVERLAY_RELOCATION_OFFSET(entry) + (uintptr_t)entry->initInfo) : NULL); } if (initInfo->init != NULL) { diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 1c69f57f3..3f868ecc3 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -795,7 +795,7 @@ void EffectSsEnIce_SpawnFlyingVec3f(GlobalContext* globalCtx, Actor* actor, Vec3 initParams.scale = scale; if (actor != NULL) { - Audio_PlayActorSound2(actor, NA_SE_PL_FREEZE_S); + Actor_PlaySfxAtPos(actor, NA_SE_PL_FREEZE_S); } EffectSs_Spawn(globalCtx, EFFECT_SS_EN_ICE, 80, &initParams); @@ -888,7 +888,7 @@ void EffectSsEnFire_SpawnVec3f(GlobalContext* globalCtx, Actor* actor, Vec3f* po initParams.bodyPart = bodyPart; if (actor != NULL) { - Audio_PlayActorSound2(actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION); } EffectSs_Spawn(globalCtx, EFFECT_SS_EN_FIRE, 128, &initParams); @@ -908,7 +908,7 @@ void EffectSsEnFire_SpawnVec3s(GlobalContext* globalCtx, Actor* actor, Vec3s* po initParams.bodyPart = bodyPart; if (actor != NULL) { - Audio_PlayActorSound2(actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION); } EffectSs_Spawn(globalCtx, EFFECT_SS_EN_FIRE, 128, &initParams); diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index d5125d249..1d083b2c7 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -11,10 +11,10 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.textId = ((this->actor.params >> 8) & 0xFF) | 0x300; this->actor.params = (this->actor.params & 0xFF) - 9; Actor_ProcessInitChain(&this->actor, &enAObjInitVar); - ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 12); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 12); Collider_InitAndSetCylinder(globalCtx, &this->collision, &this->actor, &enAObjCylinderInit); Collider_UpdateCylinder(&this->actor, &this->collision); - this->actor.colChkInfo.mass = 255; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actionFunc = EnAObj_Update1; } @@ -27,7 +27,7 @@ void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx) { s32 yawDiff; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = EnAObj_Update2; } else { yawDiff = ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); @@ -39,7 +39,7 @@ void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx) { } void EnAObj_Update2(EnAObj* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actionFunc = EnAObj_Update1; } } @@ -48,10 +48,10 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) { EnAObj* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 45.0f); + Actor_SetFocus(&this->actor, 45.0f); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collision.base); } void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, enAObjDisplayLists[thisx->params]); + Gfx_DrawDListOpa(globalCtx, enAObjDisplayLists[thisx->params]); } diff --git a/src/code/z_en_hy.c b/src/code/z_en_hy.c index 323dc14f8..e0c487262 100644 --- a/src/code/z_en_hy.c +++ b/src/code/z_en_hy.c @@ -131,7 +131,7 @@ void func_800F0BB4(EnHy* enHy, GlobalContext* globalCtx, Actor* door, s16 arg3, Vec3f offset; f32 phi_f0; - Actor_CalcOffsetOrientedToDrawRotation(door, &offset, &enHy->actor.world.pos); + Actor_OffsetOfPointInActorCoords(door, &offset, &enHy->actor.world.pos); phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f; sp3B = ((s8)phi_f0 < 0) ? 0 : 2; EnHy_ChangeObjectAndAnim(enHy, globalCtx, (sp3B == 0) ? arg3 : arg4); @@ -260,12 +260,12 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, GlobalContext* globalCtx, f32 distAboveThr enHy->isLeftFootOnGround = isFootOnGround = func_8013DB90(globalCtx, &enHy->leftFootPos, distAboveThreshold); if (enHy->isLeftFootOnGround && !wasLeftFootOnGround && isFootOnGround) { - Audio_PlayActorSound2(&enHy->actor, sfxId); + Actor_PlaySfxAtPos(&enHy->actor, sfxId); } enHy->isRightFootOnGround = isFootOnGround = func_8013DB90(globalCtx, &enHy->rightFootPos, distAboveThreshold); if (enHy->isRightFootOnGround && !wasRightFootOnGround && isFootOnGround) { - Audio_PlayActorSound2(&enHy->actor, sfxId); + Actor_PlaySfxAtPos(&enHy->actor, sfxId); } return 0; } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index f2fb0e45a..ec32550f8 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -43,7 +43,7 @@ static InitChainEntry sInitChain[] = { }; void EnItem00_SetObject(EnItem00* this, GlobalContext* globalCtx, f32* shadowOffset, f32* shadowScale) { - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); Actor_SetScale(&this->actor, 0.5f); this->unk154 = 0.5f; *shadowOffset = 0.0f; @@ -63,7 +63,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->params &= 0xFF; // Has to be thisx to match - if (Actor_GetCollectibleFlag(globalCtx, this->collectibleFlag)) { + if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) { if (this->actor.params == ITEM00_HEART_PIECE) { sp30 = 0; this->collectibleFlag = 0; @@ -169,7 +169,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { } this->unk14E = 0; - ActorShape_Init(&this->actor.shape, shadowOffset, func_800B3FC0, shadowScale); + ActorShape_Init(&this->actor.shape, shadowOffset, ActorShadow_DrawCircle, shadowScale); this->actor.shape.shadowAlpha = 180; this->actor.focus.pos = this->actor.world.pos; this->unk14A = GI_NONE; @@ -251,7 +251,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((getItemId != GI_NONE) && (Actor_HasParent(&this->actor, globalCtx) == 0)) { - func_800B8A1C(&this->actor, globalCtx, getItemId, 50.0f, 20.0f); + Actor_PickUp(&this->actor, globalCtx, getItemId, 50.0f, 20.0f); } this->actionFunc = func_800A6A40; @@ -407,7 +407,7 @@ void func_800A6A40(EnItem00* this, GlobalContext* globalCtx) { if (this->unk14A != GI_NONE) { if (Actor_HasParent(&this->actor, globalCtx) == 0) { - func_800B8A1C(&this->actor, globalCtx, this->unk14A, 50.0f, 80.0f); + Actor_PickUp(&this->actor, globalCtx, this->unk14A, 50.0f, 80.0f); this->unk152++; } else { this->unk14A = GI_NONE; @@ -457,7 +457,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.y = this->actor.scale.x; if (this->actor.gravity != 0.0f) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 15.0f, 15.0f, 0x1D); if (this->actor.floorHeight <= BGCHECK_Y_MIN) { @@ -574,7 +574,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { if (getItemId != GI_NONE) { if (!Actor_HasParent(&this->actor, globalCtx)) { - func_800B8A1C(&this->actor, globalCtx, getItemId, 50.0f, 20.0f); + Actor_PickUp(&this->actor, globalCtx, getItemId, 50.0f, 20.0f); } } @@ -586,7 +586,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { case ITEM00_MAP: case ITEM00_COMPASS: if (Actor_HasParent(&this->actor, globalCtx)) { - Actor_SetCollectibleFlag(globalCtx, this->collectibleFlag); + Flags_SetCollectible(globalCtx, this->collectibleFlag); Actor_MarkForDeath(&this->actor); } return; @@ -598,7 +598,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { play_sound(NA_SE_SY_GET_RUPY); } else if (getItemId != GI_NONE) { if (Actor_HasParent(&this->actor, globalCtx)) { - Actor_SetCollectibleFlag(globalCtx, this->collectibleFlag); + Flags_SetCollectible(globalCtx, this->collectibleFlag); Actor_MarkForDeath(&this->actor); } return; @@ -606,7 +606,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { play_sound(NA_SE_SY_GET_ITEM); } - Actor_SetCollectibleFlag(globalCtx, this->collectibleFlag); + Flags_SetCollectible(globalCtx, this->collectibleFlag); this->unk152 = 15; this->unk14C = 35; @@ -651,7 +651,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { this->actor.objBankIndex = bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); this->unk152 = -2; } } else { @@ -848,7 +848,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 param } } else if (paramFF == ITEM00_MUSHROOM_CLOUD) { param7F00 >>= 8; - if (!Actor_GetCollectibleFlag(globalCtx, param7F00)) { + if (!Flags_GetCollectible(globalCtx, param7F00)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_KINOKO, spawnPos->x, spawnPos->y, spawnPos->z, 0, 0, 0, param7F00); } @@ -857,7 +857,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 param if (newParamFF == ITEM00_FLEXIBLE) { spawnedActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) << 9) & 0xFE00) | 0x102); - if (!Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F)) { + if (!Flags_GetCollectible(globalCtx, (param7F00 >> 8) & 0x7F)) { Audio_PlaySoundAtPosition(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY); } } else { @@ -865,7 +865,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 param Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELFORG, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) & 0x7F) << 9) | 7); if (param20000 == 0) { - if (!Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F)) { + if (!Flags_GetCollectible(globalCtx, (param7F00 >> 8) & 0x7F)) { Audio_PlaySoundAtPosition(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY); } } @@ -923,7 +923,7 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s32 para Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELFORG, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) & 0x7F) << 9) | 7); } - if (Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F) == 0) { + if (Flags_GetCollectible(globalCtx, (param7F00 >> 8) & 0x7F) == 0) { Audio_PlaySoundAtPosition(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY); } } else { @@ -1179,5 +1179,5 @@ s32 func_800A817C(s32 index) { } s32 func_800A81A4(GlobalContext* globalCtx, s32 a1, s32 a2) { - return (func_800A8150(a1) == ITEM00_BIG_FAIRY) && (!Actor_GetCollectibleFlag(globalCtx, a2)); + return (func_800A8150(a1) == ITEM00_BIG_FAIRY) && (!Flags_GetCollectible(globalCtx, a2)); } diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 318b033f6..5e89f49e9 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -24,7 +24,7 @@ void* KaleidoManager_FaultAddrConvFunc(void* address, void* param) { uintptr_t offset; if (ovl != NULL) { - size = (u8*)ovl->vramEnd - (u8*)ovl->vramStart; + size = VRAM_PTR_SIZE(ovl); ramStart = ovl->loadedRamAddr; ramEnd = ramStart + size; offset = (u8*)ovl->vramStart - ramStart; @@ -47,7 +47,7 @@ void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) { void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl) { if (ovl->loadedRamAddr != NULL) { ovl->offset = 0; - bzero(ovl->loadedRamAddr, (uintptr_t)ovl->vramEnd - (uintptr_t)ovl->vramStart); + bzero(ovl->loadedRamAddr, VRAM_PTR_SIZE(ovl)); ovl->loadedRamAddr = NULL; gKaleidoMgrCurOvl = NULL; } @@ -59,7 +59,7 @@ void KaleidoManager_Init(GlobalContext* globalCtx) { u32 i; for (i = 0; i < ARRAY_COUNT(gKaleidoMgrOverlayTable); i++) { - size = (uintptr_t)gKaleidoMgrOverlayTable[i].vramEnd - (uintptr_t)gKaleidoMgrOverlayTable[i].vramStart; + size = VRAM_PTR_SIZE(&gKaleidoMgrOverlayTable[i]); if (size > largestSize) { largestSize = size; } diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index bbfad829f..738f9373e 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -399,9 +399,9 @@ void LifeMeter_UpdateSizeAndBeep(GlobalContext* globalCtx) { if (interfaceCtx->lifeSizeChange <= 0) { interfaceCtx->lifeSizeChange = 0; interfaceCtx->lifeSizeChangeDirection = 0; - if (func_801233E4(globalCtx) == 0 && (globalCtx->pauseCtx.state == 0) && + if (Player_InCsMode(&globalCtx->state) == 0 && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && LifeMeter_IsCritical() && func_801690CC(globalCtx) == 0) { - // func_801233E4 and func_801690CC : Check if in Cutscene + // Player_InCsMode and func_801690CC : Check if in Cutscene play_sound(NA_SE_SY_HITPOINT_ALARM); } } diff --git a/src/code/z_lights.c b/src/code/z_lights.c index 4d649da2d..fae6af51e 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -382,7 +382,7 @@ void Lights_GlowCheck(GlobalContext* globalCtx) { pos.x = params->x; pos.y = params->y; pos.z = params->z; - func_800B4EDC(globalCtx, &pos, &multDest, &wDest); + Actor_GetProjectedPos(globalCtx, &pos, &multDest, &wDest); params->drawGlow = 0; diff --git a/src/code/z_message.c b/src/code/z_message.c index 0bfbdc53d..84f2ab951 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -80,7 +80,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80152464.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80152498.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/Message_GetState.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_8015268C.s") diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index c03c0dfc7..99253188c 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -38,7 +38,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123358.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_801233E4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_InCsMode.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123420.s") @@ -114,7 +114,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8012422C.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124258.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_GetExplosiveHeld.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124278.s") diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 9c5288139..e699ff086 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -608,7 +608,7 @@ void Quake2_Update(void) { player = GET_PLAYER(globalCtx); if (&player->actor != NULL) { - func_800B8248(&playerPosRot, player); + Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor); } angle1Speed = 359.2f; diff --git a/src/code/z_snap.c b/src/code/z_snap.c index 1c0ab3a27..6d206eea5 100644 --- a/src/code/z_snap.c +++ b/src/code/z_snap.c @@ -20,7 +20,7 @@ s32 func_8013A240(GlobalContext* globalCtx) { } for (; type < 12; type++) { - for (actor = globalCtx->actorCtx.actorList[type].first; actor != NULL; actor = actor->next) { + for (actor = globalCtx->actorCtx.actorLists[type].first; actor != NULL; actor = actor->next) { seen = 0; switch (globalCtx->sceneNum) { @@ -134,7 +134,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos, ret |= 0x3e; } - func_800B4EDC(globalCtx, pos, &screenSpace, &distance); + Actor_GetProjectedPos(globalCtx, pos, &screenSpace, &distance); x = (s16)(screenSpace.x * distance * 160.0f + 160.0f) - 85; y = (s16)(screenSpace.y * distance * -120.0f + 120.0f) - 67; if ((x < 0) || (0x96 < x) || (y < 0) || (0x69 < y)) { diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index 3255b86d8..8f0599b55 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -142,7 +142,7 @@ Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorC Actor* actor = actorListStart; if (actor == NULL) { - actor = globalCtx->actorCtx.actorList[actorCategory].first; + actor = globalCtx->actorCtx.actorLists[actorCategory].first; } while (actor != NULL && actorId != actor->id) { @@ -191,7 +191,7 @@ Actor* SubS_FindActorCustom(GlobalContext* globalCtx, Actor* actor, Actor* actor Actor* actorIter = actorListStart; if (actorListStart == NULL) { - actorIter = globalCtx->actorCtx.actorList[actorCategory].first; + actorIter = globalCtx->actorCtx.actorLists[actorCategory].first; } while (actorIter != NULL && (actorId != actorIter->id || diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 42834bb57..6e4841bce 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -77,7 +77,7 @@ void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) { void ArmsHook_Wait(ArmsHook* this, GlobalContext* globalCtx) { if (this->actor.parent == NULL) { ArmsHook_SetupAction(this, ArmsHook_Shoot); - func_800B6C04(&this->actor, 20.0f); + Actor_SetSpeeds(&this->actor, 20.0f); this->actor.parent = &GET_PLAYER(globalCtx)->actor; this->timer = 26; } @@ -90,7 +90,7 @@ void func_808C1154(ArmsHook* this) { s32 ArmsHook_AttachToPlayer(ArmsHook* this, Player* player) { player->actor.child = &this->actor; - player->leftHandActor = &this->actor; + player->heldActor = &this->actor; if (this->actor.child != NULL) { player->actor.parent = this->actor.child = NULL; return 1; @@ -237,7 +237,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { Vec3f prevFrameDiff; Vec3f sp60; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Sum(&this->unk1E0, &prevFrameDiff, &this->unk1E0); this->actor.shape.rot.x = Math_FAtan2F(this->actor.speedXZ, -this->actor.velocity.y); diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 14bfdce02..2bea2f0ff 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -162,7 +162,7 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) { ArrowIce_LerpFiredPosition(&this->firedPos, &this->actor.world.pos, 0.05f); if (arrow->unk_261 & 1) { - Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_ICE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_ICE); ArrowIce_SetupAction(this, ArrowIce_Hit); this->timer = 32; this->alpha = 255; diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index 5b47f8e4e..5ce8f18e9 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -123,7 +123,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) { } } } - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WATERWHEEL_LEVEL); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WATERWHEEL_LEVEL); } } @@ -200,7 +200,7 @@ void BgCtowerGear_UpdateOrgan(Actor* thisx, GlobalContext* globalCtx) { // Using BgCtowerGear *this = THIS causes regalloc issues void BgCtowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_80AD32E8[BGCTOWERGEAR_GET_TYPE(thisx)]); + Gfx_DrawDListOpa(globalCtx, D_80AD32E8[BGCTOWERGEAR_GET_TYPE(thisx)]); } void BgCtowerGear_DrawOrgan(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c index 94868e0cd..168690623 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c @@ -67,7 +67,7 @@ void BgCtowerRot_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017650); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y - 0x4000; } - Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); if (offset.z < 0.0f) { this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f); this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f); @@ -91,7 +91,7 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, GlobalContext* globalCtx) { f32 offsetDiffZ; f32 rotZtmp; - Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); if (offset.z > 1100.0f) { rotZ = 0.0f; } else { @@ -114,7 +114,7 @@ void BgCtowerRot_DoorDoNothing(BgCtowerRot* this, GlobalContext* globalCtx) { void BgCtowerRot_DoorClose(BgCtowerRot* this, GlobalContext* globalCtx) { if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) { if (this->dyna.actor.params == MAIN_DOOR) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); ActorCutscene_Stop(this->dyna.actor.cutscene); } this->actionFunc = BgCtowerRot_DoorDoNothing; @@ -131,7 +131,7 @@ void BgCtowerRot_DoorIdle(BgCtowerRot* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); Vec3f offset; - Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); if (offset.z > 30.0f) { this->unk160 = 0.0f; ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); @@ -159,8 +159,8 @@ void BgCtowerRot_Update(Actor* thisx, GlobalContext* globalCtx) { void BgCtowerRot_Draw(Actor* thisx, GlobalContext* globalCtx) { BgCtowerRot* this = THIS; - func_800BDFC0(globalCtx, bgCtowerRotDlists[this->dyna.actor.params]); + Gfx_DrawDListOpa(globalCtx, bgCtowerRotDlists[this->dyna.actor.params]); if (this->dyna.actor.params == CORRIDOR) { - func_800BE03C(globalCtx, D_060129D0); + Gfx_DrawDListXlu(globalCtx, D_060129D0); } } diff --git a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c index 3d0f5c204..389f80809 100644 --- a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c +++ b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c @@ -95,8 +95,8 @@ void func_80B401F8(BgGoronOyu* this, GlobalContext* globalCtx) { if (dist.x >= 0.0f && dist.x <= this->waterBoxXLength && dist.z >= 0.0f && dist.z <= this->waterBoxZLength && fabsf(dist.y) < 100.0f && player->actor.depthInWater > 12.0f) { - func_800B8A1C(&this->dyna.actor, globalCtx, 0xBA, this->dyna.actor.xzDistToPlayer, - fabsf(this->dyna.actor.playerHeightRel)); + Actor_PickUp(&this->dyna.actor, globalCtx, 0xBA, this->dyna.actor.xzDistToPlayer, + fabsf(this->dyna.actor.playerHeightRel)); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c index fceb27755..87686f4c8 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c +++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c @@ -53,7 +53,7 @@ void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001588); - if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) { + if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { func_80B6DE80(this); return; } @@ -71,7 +71,7 @@ void func_80B6DC98(BgHakaCurtain* this) { } void func_80B6DCAC(BgHakaCurtain* this, GlobalContext* globalCtx) { - if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) { + if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { func_80B6DCEC(this); } } @@ -137,5 +137,5 @@ void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHakaCurtain_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06001410); + Gfx_DrawDListOpa(globalCtx, D_06001410); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c index 58ccf1cd9..a36055a3d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c @@ -84,11 +84,10 @@ s32 func_80BD6638(s16* arg0, s16* arg1, s32 arg2) { void func_80BD66AC(BgHakaTomb* this, GlobalContext* globalCtx) { s16 temp; - if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) { + if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { this->dyna.actor.flags |= 9; } - if (!func_80BD6638(&temp, this->cutscenes, 1) && (temp < 0) && - Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) { + if (!func_80BD6638(&temp, this->cutscenes, 1) && (temp < 0) && Flags_GetClear(globalCtx, this->dyna.actor.room)) { this->dyna.actor.flags |= 1; if (this->dyna.actor.isTargeted) { func_80BD6754(this); @@ -129,5 +128,5 @@ void BgHakaTomb_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHakaTomb_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_060007B0); + Gfx_DrawDListOpa(globalCtx, D_060007B0); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index cf628cc95..0a3ef22eb 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -187,7 +187,7 @@ void func_80A9B160(BgHakuginPostUnkStruct* unkStruct, GlobalContext* globalCtx) unkStruct->unk_0000[i].unk_24 = 0.0f; unkStruct->unk_0000[i].unk_34 = 1; if (D_80A9D880[unkStruct->unk_0000[i].unk_00].unk_04 != 0) { - Actor_UnsetSwitchFlag(globalCtx, unkStruct->unk_0000[i].unk_2E); + Flags_UnsetSwitch(globalCtx, unkStruct->unk_0000[i].unk_2E); } } } @@ -261,7 +261,7 @@ void func_80A9B3BC(BgHakuginPost* this, GlobalContext* globalCtx) { } if (!(sp20 | sp1C)) { - Actor_SetSwitchFlag(globalCtx, sp28); + Flags_SetSwitch(globalCtx, sp28); this->unk_170 = true; } else { this->unk_170 = sp20; @@ -290,9 +290,9 @@ void func_80A9B46C(BgHakuginPost* this, GlobalContext* globalCtx) { } if (!this->unk_170 && (sp28 == 1)) { - Actor_UnsetSwitchFlag(globalCtx, sp2C); + Flags_UnsetSwitch(globalCtx, sp2C); } else if (!this->unk_174 && (sp24 == 1)) { - Actor_UnsetSwitchFlag(globalCtx, sp30); + Flags_UnsetSwitch(globalCtx, sp30); } this->unk_170 = sp28; @@ -682,9 +682,9 @@ void func_80A9C854(BgHakuginPost* this, GlobalContext* globalCtx) { } if (sp38) { - Actor_SetSwitchFlag(globalCtx, this->dyna.actor.home.rot.x & 0x7F); + Flags_SetSwitch(globalCtx, this->dyna.actor.home.rot.x & 0x7F); } else { - Actor_UnsetSwitchFlag(globalCtx, this->dyna.actor.home.rot.x & 0x7F); + Flags_UnsetSwitch(globalCtx, this->dyna.actor.home.rot.x & 0x7F); } } @@ -840,9 +840,9 @@ void func_80A9CE1C(BgHakuginPost* this, GlobalContext* globalCtx) { temp = (s16)(this->dyna.actor.yawTowardsPlayer + 0x58F0); D_80A9E028.unk_0000[i].unk_28 = ((s16)(player->actor.shape.rot.y - temp) / 3) + temp; D_80A9E028.unk_0000[i].unk_34 = 2; - func_800B8E58(&player->actor, NA_SE_IT_HAMMER_HIT); + func_800B8E58(player, NA_SE_IT_HAMMER_HIT); func_8019F128(NA_SE_EV_SLIDE_DOOR_OPEN); - Actor_SetSwitchFlag(globalCtx, D_80A9E028.unk_0000[i].unk_2E); + Flags_SetSwitch(globalCtx, D_80A9E028.unk_0000[i].unk_2E); this->unk_178 = 20; func_80A9D2C4(this, func_80A9CE00, D_80A9E028.unk_0000[i].unk_14.y + 50.0f, D_80A9E028.unk_0000[i].unk_2A, D_80A9E028.unk_0000[i].unk_2C); diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c index 653e12504..44f67c5bd 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -56,7 +56,7 @@ const ActorInit Bg_Icicle_InitVars = { static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE), ICHAIN_F32(gravity, -3, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -30, ICHAIN_CONTINUE), + ICHAIN_F32(terminalVelocity, -30, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; @@ -144,7 +144,7 @@ void BgIcicle_Shiver(BgIcicle* this, GlobalContext* globalCtx) { } if (!(this->shiverTimer % 4)) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ICE_SWING); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ICE_SWING); } if (this->shiverTimer == 0) { @@ -184,7 +184,7 @@ void BgIcicle_Fall(BgIcicle* this, GlobalContext* globalCtx) { return; } } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->dyna.actor); + Actor_MoveWithGravity(&this->dyna.actor); this->dyna.actor.world.pos.y += 40.0f; Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); this->dyna.actor.world.pos.y -= 40.0f; @@ -245,5 +245,5 @@ void BgIcicle_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgIcicle_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_060000D0); + Gfx_DrawDListOpa(globalCtx, D_060000D0); } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c index bc3ee7880..e96c20acc 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c @@ -119,5 +119,5 @@ void BgIkanaRay_Draw(Actor* thisx, GlobalContext* globalCtx) { BgIkanaRay* this = THIS; AnimatedMat_Draw(globalCtx, this->animatedTextures); - func_800BE03C(globalCtx, D_06001100); + Gfx_DrawDListXlu(globalCtx, D_06001100); } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c index 503c09048..70b58b482 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c @@ -77,7 +77,7 @@ void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) { func_80BD5828(this); return; } - if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) { + if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { BgIkanaShutter_SetupDoNothing(this); return; } @@ -166,7 +166,7 @@ void func_80BD5AE8(BgIkanaShutter* this) { } void func_80BD5B04(BgIkanaShutter* this, GlobalContext* globalCtx) { - if (Actor_GetRoomClearedTemp(globalCtx, this->dyna.actor.room)) { + if (Flags_GetClearTemp(globalCtx, this->dyna.actor.room)) { func_80BD5B44(this); } } @@ -179,7 +179,7 @@ void func_80BD5B44(BgIkanaShutter* this) { void func_80BD5B60(BgIkanaShutter* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - Actor_SetRoomCleared(globalCtx, this->dyna.actor.room); + Flags_SetClear(globalCtx, this->dyna.actor.room); func_80BD5BC4(this); return; } @@ -213,5 +213,5 @@ void BgIkanaShutter_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgIkanaShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000CE8); + Gfx_DrawDListOpa(globalCtx, D_06000CE8); } diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c index 10454f2cb..f4dca549b 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c @@ -57,7 +57,7 @@ s32 func_80C0A740(BgIkninSusceil* this, GlobalContext* globalCtx) { Vec3f offset; Player* player = GET_PLAYER(globalCtx); - Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); return (D_80C0B0E8.x < offset.z) && (offset.z < D_80C0B0E8.y) && (offset.x > -240.0f) && (offset.x < D_80C0B0E4); } @@ -94,7 +94,7 @@ s32 func_80C0A95C(BgIkninSusceil* this, GlobalContext* globalCtx) { Vec3f offset; f32 temp1, temp2, temp3, temp4; - Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); for (i = 0; i < 7; i++) { temp3 = (D_80C0B0F0[i] * 80.0f) + 0.5f; temp4 = (D_80C0B0F0[i] * 80.0f) + 79.5f; @@ -155,8 +155,8 @@ void func_80C0ABA8(BgIkninSusceil* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { func_80C0A86C(this, globalCtx, 4, 14, 1); - Actor_UnsetSwitchFlag(globalCtx, GET_SUSCEIL_SWITCHFLAG(this)); - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); + Flags_UnsetSwitch(globalCtx, GET_SUSCEIL_SWITCHFLAG(this)); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGWALL_BOUND); func_80C0AC74(this); } else { func_800B9010(&this->dyna.actor, NA_SE_EV_ICE_PILLAR_FALL - SFX_FLAG); @@ -229,7 +229,7 @@ void BgIkninSusceil_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & 0x100) && (player->unk_B48 > 1000.0f)) { this->unk168 = 2; if ((func_80C0A95C(this, globalCtx) != 0) && (this->actionFunc != func_80C0AE5C)) { - func_800B8E58(&player->actor, NA_SE_PL_BODY_HIT); + func_800B8E58(player, NA_SE_PL_BODY_HIT); func_80C0AE3C(this); } } @@ -260,5 +260,5 @@ void BgIkninSusceil_Draw(Actor* thisx, GlobalContext* globalCtx) { BgIkninSusceil* this = THIS; AnimatedMat_Draw(globalCtx, this->animatedTexture); - func_800BDFC0(globalCtx, D_0600C308); + Gfx_DrawDListOpa(globalCtx, D_0600C308); } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index 3bf7bf988..53a0b5ea2 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -90,7 +90,7 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->dyna.actor, &this->collider); this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; gSaveContext.weekEventReg[51] &= (u8)~0x10; - Actor_SetHeight(&this->dyna.actor, IREG(88)); + Actor_SetFocus(&this->dyna.actor, IREG(88)); break; default: Actor_MarkForDeath(&this->dyna.actor); @@ -154,7 +154,7 @@ s32 func_80BD7E0C(BgIknvObj* this, s16 targetRotation, GlobalContext* globalCtx) func_800B9010(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG); return false; } - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); return true; } diff --git a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c index c75db5306..61e684563 100644 --- a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c +++ b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c @@ -71,11 +71,11 @@ void BgInibsMovebg_Draw(Actor* thisx, GlobalContext* globalCtx) { dl1 = this->unk_15C; if (dl1 != NULL) { - func_800BDFC0(globalCtx, this->unk_15C); + Gfx_DrawDListOpa(globalCtx, this->unk_15C); } dl2 = this->unk_160; if (dl2 != NULL) { - func_800BE03C(globalCtx, this->unk_160); + Gfx_DrawDListXlu(globalCtx, this->unk_160); } } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c index ac5672238..d526c458b 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c @@ -228,7 +228,7 @@ void BgKin2Fence_SetupPlayOpenCutscene(BgKin2Fence* this) { void BgKin2Fence_PlayOpenCutscene(BgKin2Fence* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - Actor_SetSwitchFlag(globalCtx, this->dyna.actor.params & 0x7F); + Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x7F); BgKin2Fence_SetupWaitBeforeOpen(this); return; } @@ -272,5 +272,5 @@ void BgKin2Fence_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgKin2Fence_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000828); + Gfx_DrawDListOpa(globalCtx, D_06000828); } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c index c646c3e6c..e9326d8cd 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c @@ -55,7 +55,7 @@ static ColliderTrisInit D_80B6FA08 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_80B6FA24[] = { ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_CONTINUE), diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index 0acccbc56..070d8776b 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -110,7 +110,7 @@ void BgLadder_ActionStartCutscene(BgLadder* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); this->dyna.actor.draw = BgLadder_Draw; - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR); this->action = BgLadder_ActionFadeIn; } else { ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c index c07f419f9..11132cf64 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c @@ -47,5 +47,5 @@ void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) { DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } void BgLbfshot_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000228); + Gfx_DrawDListOpa(globalCtx, D_06000228); } diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c index 7499e35cd..e8a2d0b4c 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c @@ -173,5 +173,5 @@ void BgLotus_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgLotus_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000040); + Gfx_DrawDListOpa(globalCtx, D_06000040); } diff --git a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c index b5f8e9c49..e9a365c91 100644 --- a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c +++ b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c @@ -41,6 +41,6 @@ void BgMarketStep_Init(Actor* thisx, GlobalContext* globalCtx) { void BgMarketStep_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 index = thisx->params & 1; - func_800BDFC0(globalCtx, D_80AF0120[index]); - func_800BDFC0(globalCtx, D_80AF0128[index]); + Gfx_DrawDListOpa(globalCtx, D_80AF0120[index]); + Gfx_DrawDListOpa(globalCtx, D_80AF0128[index]); } diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c index c805de05c..8a31c536b 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c @@ -55,5 +55,5 @@ void BgMbarChair_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgMbarChair_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000288); + Gfx_DrawDListOpa(globalCtx, D_06000288); } diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index 69ba3e652..38ce543cc 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -65,7 +65,7 @@ void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) { if (this->timer != prevTimer) { if (1) {} - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_OPEN_S - SFX_FLAG); this->dyna.actor.world.pos.y = (this->yOffset = (this->timer * (5.0f / 3.0f)) + this->dyna.actor.home.pos.y); this->timer2 = 180; } diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index f0455bb05..2d404126d 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -740,8 +740,8 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) { this->actor.speedXZ = this->unk_01A8 * D_809DF5B0; } - Actor_SetVelocityXYRotation(&this->actor); - Actor_ApplyMovement(&this->actor); + Actor_UpdateVelocityWithoutGravity(&this->actor); + Actor_UpdatePos(&this->actor); spD0 = this->actor.world.pos; if (D_809E0422 != 0) { @@ -756,7 +756,7 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) { this->unk_0170 = this->unk_017C; this->unk_0170.y = temp_f0; this->unk_016C = 120; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); } this->actor.flags &= ~1; @@ -965,7 +965,7 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) { D_809E042C->unk_1D5C = 0.0f; play_sound(NA_SE_EN_INBOSS_DEAD_PRE2_OLD); } else if (!(this->unk_0146[1] & 0xF) && (Rand_ZeroOne() < 0.5f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); } return; @@ -987,7 +987,7 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) { this->unk_0144 = 22; this->actor.gravity = -1.0f * D_809DF5B0; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = -1000.0f * D_809DF5B0; + this->actor.terminalVelocity = -1000.0f * D_809DF5B0; this->unk_0164 = randPlusMinusPoint5Scaled(0.05f); spCC = player->actor.world.pos.x - this->actor.world.pos.x; @@ -1006,7 +1006,7 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) { Audio_QueueSeqCmd(NA_BGM_CLEAR_BOSS | 0x8000); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_INBOSS_DEAD_OLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_DEAD_OLD); } } return; @@ -1017,7 +1017,7 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&this->unk_01BC[i], &this->actor.world.pos); this->unk_0B1C[i].y += this->unk_0164; Math_ApproachF(&this->unk_0B1C[i].x, -(M_PI / 2), 0.1f, 0.07f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 150.0f, 100.0f, 4); if (this->actor.bgCheckFlags & 1) { @@ -1100,7 +1100,7 @@ void func_809DBFB4(Boss02* this, GlobalContext* globalCtx) { this->unk_0156 = 15; if (i == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_DAMAGE_OLD); this->unk_015C = 1; } else { func_8019F1C0(&this->unk_167C, NA_SE_EN_INBOSS_DAMAGE_OLD); @@ -1227,9 +1227,9 @@ void Boss02_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_016C != 0) { if ((this->unk_016C == 60) && (this->unk_0144 < 20)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_INBOSS_SAND_OLD - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_SAND_OLD - SFX_FLAG); if (this->unk_0144 > 20) { sp3C.x = randPlusMinusPoint5Scaled(100.0f * D_809DF5B0) + this->unk_0170.x; @@ -1959,7 +1959,7 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) { player->actor.home.pos = player->actor.world.pos; player->actor.prevPos = player->actor.world.pos; - temp_a0_5 = globalCtx->actorCtx.actorList[ACTORCAT_BG].first; + temp_a0_5 = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first; while (temp_a0_5 != NULL) { if (temp_a0_5->id == ACTOR_BG_INIBS_MOVEBG) { Actor_MarkForDeath(temp_a0_5); @@ -1971,7 +1971,7 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_INIBS_MOVEBG, 0, D_809E0422 ? 3150.0f : 0.0f, 0, 0, 0, 0, D_809E0422); - temp_a0_5 = globalCtx->actorCtx.actorList[ACTORCAT_BOSS].first; + temp_a0_5 = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first; while (temp_a0_5 != NULL) { if ((temp_a0_5->id == ACTOR_EN_TANRON5) || (temp_a0_5->id == ACTOR_ITEM_B_HEART)) { if (D_809E0422 == 0) { @@ -2002,7 +2002,7 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) { temp_a0_5->velocity.z *= phi_f0_2; temp_a0_5->gravity *= phi_f0_2; - temp_a0_5->minVelocityY *= phi_f0_2; + temp_a0_5->terminalVelocity *= phi_f0_2; temp_a0_5->scale.x *= phi_f0_2; temp_a0_5->scale.y *= phi_f0_2; @@ -2109,11 +2109,11 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) { player->actor.shape.rot.y = -0x8000; player->actor.world.rot.y = player->actor.shape.rot.y; this->unk_1D24.x = player->actor.world.pos.x - 20.0f; - this->unk_1D24.y = (func_800B6FC8(player) + player->actor.world.pos.y) - 29.0f; + this->unk_1D24.y = (Player_GetHeight(player) + player->actor.world.pos.y) - 29.0f; this->unk_1D24.z = player->actor.world.pos.z - 50; this->unk_1D30.x = player->actor.world.pos.x; - this->unk_1D30.y = (func_800B6FC8(player) + player->actor.world.pos.y) - 17.0f; + this->unk_1D30.y = (Player_GetHeight(player) + player->actor.world.pos.y) - 17.0f; this->unk_1D30.z = player->actor.world.pos.z; if (this->unk_1D1C >= 30) { if (this->unk_1D1C == 30) { @@ -2177,8 +2177,8 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) { } if (this->unk_1D1C == (u32)(KREG(92) + 125)) { - Actor_TitleCardCreate(globalCtx, &globalCtx->actorCtx.titleCtxt, Lib_SegmentedToVirtual(&D_06008650), - 160, 180, 128, 40); + TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, + Lib_SegmentedToVirtual(&D_06008650), 160, 180, 128, 40); } if (this->unk_1D1C == (u32)(BREG(27) + 335)) { diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index ace591bb9..6e3fa14e3 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -156,7 +156,7 @@ void Boss04_Init(Actor* thisx, GlobalContext* globalCtx2) { s16 phi_s0_2; s32 pad; - if (Actor_GetRoomCleared(globalCtx, globalCtx->roomCtx.currRoom.num)) { + if (Flags_GetClear(globalCtx, globalCtx->roomCtx.currRoom.num)) { Actor_MarkForDeath(&this->actor); return; } @@ -274,7 +274,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) { func_8016566C(150); this->unk_744 = 60.0f; - boss = globalCtx->actorCtx.actorList[ACTORCAT_BOSS].first; + boss = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first; while (boss != NULL) { if (boss->id == ACTOR_EN_WATER_EFFECT) { Actor_MarkForDeath(boss); @@ -289,7 +289,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) { case 10: if (this->unk_704 == 3) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); this->unk_74A = 1; } this->unk_2D0 = 10000.0f; @@ -319,7 +319,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) { } case 12: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); Math_ApproachF(&this->unk_718.x, this->actor.world.pos.x, 0.5f, 1000.0f); Math_ApproachF(&this->unk_718.y, this->actor.world.pos.y, 0.5f, 1000.0f); Math_ApproachF(&this->unk_718.z, this->actor.world.pos.z, 0.5f, 1000.0f); @@ -331,7 +331,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) { this->unk_2DA = 10; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_SPLASH); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_JUMP_LEV_OLD - SFX_FLAG); this->unk_748 = 20; } break; @@ -342,11 +342,11 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) { Matrix_GetStateTranslationAndScaledZ(-100.0f, &this->unk_70C); this->unk_70C.x += player->actor.world.pos.x; - this->unk_70C.y = func_800B6FC8(player) + player->actor.world.pos.y + 36.0f; + this->unk_70C.y = Player_GetHeight(player) + player->actor.world.pos.y + 36.0f; this->unk_70C.z += player->actor.world.pos.z; this->unk_718.x = player->actor.world.pos.x; - this->unk_718.y = (func_800B6FC8(player) + player->actor.world.pos.y) - 4.0f; + this->unk_718.y = (Player_GetHeight(player) + player->actor.world.pos.y) - 4.0f; this->unk_718.z = player->actor.world.pos.z; if (this->unk_704 >= 35) { @@ -501,7 +501,7 @@ void func_809ECF58(Boss04* this, GlobalContext* globalCtx) { sp3C.y = this->actor.floorHeight + 2.0f; sp3C.z = this->actor.world.pos.z; EffectSsGRipple_Spawn(globalCtx, &sp3C, 1400, 500, 0); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); } } @@ -520,7 +520,7 @@ void func_809ED224(Boss04* this) { this->actor.speedXZ = 0.0f; this->unk_2D0 = 10000.0f; this->unk_2C8 = 200; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ME_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_DEAD); this->actor.flags &= ~1; func_801A2ED8(); this->unk_1F6 = 10; @@ -569,7 +569,7 @@ void func_809ED45C(Boss04* this, GlobalContext* globalCtx) { if ((this->unk_1FE == 0) && (this->collider1.elements[0].info.bumperFlags & BUMP_HIT)) { this->collider1.elements[0].info.bumperFlags &= ~BUMP_HIT; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ME_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_DAMAGE); damage = this->actor.colChkInfo.damage; this->actor.colChkInfo.health = this->actor.colChkInfo.health - damage; if ((s8)this->actor.colChkInfo.health <= 0) { @@ -706,7 +706,7 @@ void Boss04_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); this->actor.world.pos.y -= 100.0f; this->actor.prevPos.y -= 100.0f; Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 100.0f, 120.0f, 200.0f, 5); @@ -765,7 +765,7 @@ void Boss04_Update(Actor* thisx, GlobalContext* globalCtx2) { } if (this->unk_74A != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ME_EXIST - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_EXIST - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c index ccda78a8e..586b231ae 100644 --- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c +++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c @@ -53,8 +53,8 @@ void DmSa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk2E0 = 0; this->alpha = 0xFF; this->actor.targetArrowOffset = 3000.0f; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, 0, 0, 0); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, NULL, NULL, 0); func_80A2E960(&this->skelAnime, D_80A2ED00, 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmSa_DoNothing; diff --git a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c index 8234deec6..edfa0567d 100644 --- a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c +++ b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c @@ -44,5 +44,5 @@ void DmStatue_Update(Actor* thisx, GlobalContext* globalCtx) { void DmStatue_Draw(Actor* thisx, GlobalContext* globalCtx) { AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001788)); - func_800BE03C(globalCtx, D_06000520); + Gfx_DrawDListXlu(globalCtx, D_06000520); } diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index bf934be08..ef6f258a7 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -260,7 +260,7 @@ void func_80A9FE3C(DmStk* this, GlobalContext* globalCtx, SkelAnime* skelAnime, void func_80A9FED8(DmStk* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.frames + 20) { case 1195: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); break; case 1232: @@ -268,48 +268,48 @@ void func_80A9FED8(DmStk* this, GlobalContext* globalCtx) { case 1252: case 1255: case 1257: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); break; case 1285: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); break; case 1343: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 1410: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); break; case 1603: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); break; case 1610: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_REVERSE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_REVERSE); break; case 2095: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_SURPRISED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SURPRISED); break; case 2190: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_JUMP); break; case 2212: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_ONGND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_ONGND); break; case 2214: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); break; case 2250: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL06_SURPRISED); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL06_SURPRISED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); break; case 2255: @@ -338,7 +338,7 @@ void func_80A9FED8(DmStk* this, GlobalContext* globalCtx) { case 2508: case 2519: case 2530: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; } } @@ -368,11 +368,11 @@ void func_80AA0100(DmStk* this, GlobalContext* globalCtx) { case 232: case 243: case 254: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 173: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); break; } } @@ -380,15 +380,15 @@ void func_80AA0100(DmStk* this, GlobalContext* globalCtx) { void func_80AA0158(DmStk* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.frames) { case 18: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_GASAGOSO); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_GASAGOSO); break; case 90: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); break; case 142: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EVIL_POWER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER); break; } } @@ -405,11 +405,11 @@ void func_80AA01C0(DmStk* this, GlobalContext* globalCtx) { break; case 560: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL02_LAUGH_SHORT); break; case 890: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL21_PSYCHO_VOICE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL21_PSYCHO_VOICE); break; } } @@ -423,7 +423,7 @@ void func_80AA0264(DmStk* this, GlobalContext* globalCtx) { break; case 71: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_BODY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_BODY); break; case 365: @@ -435,30 +435,30 @@ void func_80AA0264(DmStk* this, GlobalContext* globalCtx) { break; case 265: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL03_LAUGH_BIG); break; case 126: - Audio_PlayActorSound2(&player->actor, NA_SE_VO_DUMMY_150); + Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_150); break; case 197: - Audio_PlayActorSound2(&player->actor, NA_SE_VO_DUMMY_134); + Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_134); break; case 207: - Audio_PlayActorSound2(&player->actor, NA_SE_VO_DUMMY_135); + Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_135); break; case 217: - Audio_PlayActorSound2(&player->actor, NA_SE_VO_DUMMY_136); + Actor_PlaySfxAtPos(&player->actor, NA_SE_VO_DUMMY_136); break; } if (player) {} if ((globalCtx->csCtx.frames >= 263) && (globalCtx->csCtx.frames < 698)) { - Audio_PlayActorSound2(&player->actor, NA_SE_EN_STALKIDS_BODY_LEV - SFX_FLAG); + Actor_PlaySfxAtPos(&player->actor, NA_SE_EN_STALKIDS_BODY_LEV - SFX_FLAG); } } @@ -471,37 +471,37 @@ void func_80AA0420(DmStk* this, GlobalContext* globalCtx) { break; case 258: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_TURN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_TURN); break; case 524: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_TURN); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL04_ANGER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_TURN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL04_ANGER); break; case 534: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); break; case 678: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_STRETCH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_STRETCH); break; } if ((this->unk_2E0 == 31) && (globalCtx->csCtx.frames < 700)) { if (Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1); } else if (Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA2); } } if (globalCtx->csCtx.frames >= 700) { if (D_80AA3CB8 < 128) { if ((D_80AA3CB8 & 0x1F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL20_CALL_MOON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON); } else if ((D_80AA3CB8 & 0x1F) == 16) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); } D_80AA3CB8++; } @@ -512,14 +512,14 @@ void func_80AA0420(DmStk* this, GlobalContext* globalCtx) { void func_80AA05F0(DmStk* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.frames == 3) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL06_SURPRISED); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL06_SURPRISED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); } } void func_80AA0634(DmStk* this, GlobalContext* globalCtx) { if ((globalCtx->csCtx.frames >= 642) && (globalCtx->csCtx.frames < 845)) { - Audio_PlayActorSound2(&this->actor, NA_SE_NE_STAL23_COLD - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_NE_STAL23_COLD - SFX_FLAG); } } @@ -531,16 +531,16 @@ void func_80AA066C(DmStk* this, GlobalContext* globalCtx) { case 72: case 77: case 79: - Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_WATER2); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_WATER2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); break; case 186: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); break; case 230: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL22_LAUGH_KID_L); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL22_LAUGH_KID_L); break; } } @@ -552,7 +552,7 @@ void func_80AA071C(DmStk* this, GlobalContext* globalCtx) { break; case 660: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); break; } } @@ -566,27 +566,27 @@ void func_80AA076C(DmStk* this, GlobalContext* globalCtx) { break; case 45: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 93: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 245: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 269: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL11_LAUGH_SHY2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL11_LAUGH_SHY2); break; case 327: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_SHAKEHEAD); break; case 455: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 1730: @@ -594,7 +594,7 @@ void func_80AA076C(DmStk* this, GlobalContext* globalCtx) { break; case 1395: - func_800B8E58(&player->actor, NA_SE_VO_DUMMY_34); + func_800B8E58(player, NA_SE_VO_DUMMY_34); break; case 1850: @@ -608,20 +608,20 @@ void func_80AA076C(DmStk* this, GlobalContext* globalCtx) { if (this->unk_2E0 == 0) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } if (Animation_OnFrame(&this->skelAnime, 28.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); } } else if (this->unk_2E0 == 71) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } } else if ((this->unk_2E0 == 70) && (Animation_OnFrame(&this->skelAnime, 16.0f) || Animation_OnFrame(&this->skelAnime, 23.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_NOSE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_NOSE); } } @@ -634,25 +634,25 @@ void func_80AA09DC(DmStk* this, GlobalContext* globalCtx) { break; case 234: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_TURN); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL04_ANGER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_TURN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL04_ANGER); break; case 244: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); break; case 388: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_STRETCH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_STRETCH); break; } if (globalCtx->csCtx.frames >= 408) { if (D_80AA3CBC < 128) { if ((D_80AA3CBC & 0x1F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL20_CALL_MOON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON); } else if ((D_80AA3CBC & 0x1F) == 16) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL20_CALL_MOON2); } D_80AA3CBC++; } @@ -675,19 +675,19 @@ void func_80AA0B08(DmStk* this, GlobalContext* globalCtx) { case 332: case 335: case 344: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 367: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); break; case 470: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_HEADACHE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_HEADACHE); break; case 486: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); func_8019F1C0(&this->unk_310, NA_SE_EN_STAL08_CRY_BIG); break; @@ -696,11 +696,11 @@ void func_80AA0B08(DmStk* this, GlobalContext* globalCtx) { break; case 590: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 592: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_RIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_RIDE); break; case 594: @@ -712,16 +712,16 @@ void func_80AA0B08(DmStk* this, GlobalContext* globalCtx) { if ((globalCtx->csCtx.frames >= 62) && (globalCtx->csCtx.frames < 273)) { if ((Rand_ZeroOne() < 0.75f) && ((globalCtx->state.frames % 2) != 0)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_EARTHQUAKE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_EARTHQUAKE); } } if ((globalCtx->csCtx.frames >= 498) && (globalCtx->csCtx.frames < 577)) { if ((globalCtx->state.frames % 4) == 0) { if ((globalCtx->state.frames & 4) != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); } } } @@ -734,16 +734,16 @@ void func_80AA0B08(DmStk* this, GlobalContext* globalCtx) { void func_80AA0DA8(DmStk* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.frames) { case 551: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_PULLED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_PULLED); break; case 711: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 716: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_ONGND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_ONGND); break; } } @@ -751,16 +751,16 @@ void func_80AA0DA8(DmStk* this, GlobalContext* globalCtx) { void func_80AA0E1C(DmStk* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.frames) { case 311: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_PULLED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_PULLED); break; case 365: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_OFF); break; case 372: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_ONGND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_MASK_ON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_ONGND); break; } } @@ -834,24 +834,24 @@ void func_80AA0E90(DmStk* this, GlobalContext* globalCtx) { if (this->unk_2E0 == 1) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_WALK); } } else if (this->unk_2E0 == 19) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 20.0f) || Animation_OnFrame(&this->skelAnime, 27.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_CALM_HIT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_CALM_HIT); } } else if (this->unk_2E0 == 14) { if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_PUT_OUT_ITEM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PUT_OUT_ITEM); } } else if (this->unk_2E0 == 15) { if (Animation_OnFrame(&this->skelAnime, 14.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_UNSKILLFUL_OCARINA); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_UNSKILLFUL_OCARINA); } if (Animation_OnFrame(&this->skelAnime, 45.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL01_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STAL01_LAUGH); } } } @@ -964,7 +964,7 @@ void DmStk_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2E4 = this->unk_2E4; this->actor.targetArrowOffset = 1100.0f; this->unk_334 = 99; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, NULL, NULL, 0); func_80A9FE3C(this, globalCtx, &this->skelAnime, &sAnimations[this->unk_2E0], 0); } @@ -1062,7 +1062,7 @@ void func_80AA19EC(DmStk* this, GlobalContext* globalCtx) { void func_80AA1A50(DmStk* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(0xA)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DAMAGE); ActorCutscene_Start(0xA, &this->actor); this->actor.shape.rot.x = 0; this->actor.world.rot.x = this->actor.shape.rot.x; @@ -1109,7 +1109,7 @@ void func_80AA1B9C(DmStk* this, GlobalContext* globalCtx) { this->unk_2E0 = 39; func_80A9FE3C(this, globalCtx, &this->skelAnime, &sAnimations[this->unk_2E0], 0); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); this->actionFunc = func_80AA1C64; } @@ -1568,9 +1568,9 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.params != 1) { if (this->unk_2E0 == 33) { - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } else { - Actor_SetHeight(&this->actor, 6.0f); + Actor_SetFocus(&this->actor, 6.0f); } func_80A9FDB0(this, globalCtx); @@ -1592,7 +1592,7 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) { switch (this->unk_33A) { case 1: - if (func_800B8718(&this->actor, globalCtx)) { + if (func_800B8718(&this->actor, &globalCtx->state)) { this->unk_33A = 2; } else { func_800B874C(&this->actor, globalCtx, this->actor.xzDistToPlayer, @@ -1719,7 +1719,7 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_337].segment); AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06008658)); - func_800BDFC0(globalCtx, D_06007840); + Gfx_DrawDListOpa(globalCtx, D_06007840); gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_336].segment); gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_336].segment); @@ -1829,7 +1829,7 @@ void DmStk_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_33B != 0) { if (this->actor.params == 1) { - func_800BDFC0(globalCtx, D_06006BB0); + Gfx_DrawDListOpa(globalCtx, D_06006BB0); return; } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index fb983aa6f..167dbfe69 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -208,5 +208,5 @@ void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx) { } void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BE03C(globalCtx, D_05000C40); + Gfx_DrawDListXlu(globalCtx, D_05000C40); } diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index 1716721de..3e9754ccf 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -205,7 +205,7 @@ void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) { } DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); } void DoorSpiral_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -237,7 +237,7 @@ f32 DoorSpiral_GetDistFromPlayer(GlobalContext* globalCtx, DoorSpiral* this, f32 target.y = player->actor.world.pos.y + yOffset; target.z = player->actor.world.pos.z; - Actor_CalcOffsetOrientedToDrawRotation(&this->actor, &offset, &target); + Actor_OffsetOfPointInActorCoords(&this->actor, &offset, &target); if ((spiralWidth < fabsf(offset.x)) || (spiralHeight < fabsf(offset.y))) { return FLT_MAX; @@ -252,7 +252,7 @@ f32 DoorSpiral_GetDistFromPlayer(GlobalContext* globalCtx, DoorSpiral* this, f32 s32 DoorSpiral_PlayerShouldClimb(DoorSpiral* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (!(func_801233E4(globalCtx))) { + if (!Player_InCsMode(&globalCtx->state)) { SpiralInfo* spiralInfo = &sSpiralInfo[this->spiralType]; f32 dist = DoorSpiral_GetDistFromPlayer(globalCtx, this, 0.0f, spiralInfo->spiralWidth, spiralInfo->spiralHeight); diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index b37a3df2f..6d933ecd9 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -327,7 +327,7 @@ void func_808B90CC(DoorWarp1* this, GlobalContext* globalCtx) { DoorWarp1_SetupAction(this, func_808B921C); } - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WARP_HOLE_ENERGY - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE_ENERGY - SFX_FLAG); } void func_808B921C(DoorWarp1* this, GlobalContext* globalCtx) { @@ -348,14 +348,14 @@ void func_808B921C(DoorWarp1* this, GlobalContext* globalCtx) { DoorWarp1_SetupAction(this, func_808B93A0); } - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); } void func_808B93A0(DoorWarp1* this, GlobalContext* globalCtx) { s32 pad; Player* player = GET_PLAYER(globalCtx); - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 4 && func_80147624(globalCtx)) { func_801477B4(globalCtx); if (globalCtx->msgCtx.choiceIndex == 0) { func_8019F208(); @@ -371,7 +371,7 @@ void func_808B93A0(DoorWarp1* this, GlobalContext* globalCtx) { } } func_808BB8D4(this, globalCtx, 1); - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); } void func_808B94A4(DoorWarp1* this, GlobalContext* globalCtx) { @@ -379,7 +379,7 @@ void func_808B94A4(DoorWarp1* this, GlobalContext* globalCtx) { DoorWarp1_SetupAction(this, func_808B921C); } func_808BB8D4(this, globalCtx, 1); - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BOSS_WARP_HOLE - SFX_FLAG); } void func_808B9524(DoorWarp1* this, GlobalContext* globalCtx) { @@ -414,14 +414,14 @@ void func_808B958C(DoorWarp1* this, GlobalContext* globalCtx) { } Math_SmoothStepToF(&this->unk_1A8, 6.0f, 0.2f, 0.02f, 0.01f); - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_LINK_WARP - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_LINK_WARP - SFX_FLAG); } void func_808B96A0(DoorWarp1* this, GlobalContext* globalCtx) { } void func_808B96B0(DoorWarp1* this, GlobalContext* globalCtx) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); Math_SmoothStepToF(&this->unk_1B0, 255.0f, 0.4f, 10.0f, 0.01f); Math_SmoothStepToF(&this->unk_1B4, 255.0f, 0.4f, 10.0f, 0.01f); @@ -441,11 +441,11 @@ void func_808B96B0(DoorWarp1* this, GlobalContext* globalCtx) { } void func_808B977C(DoorWarp1* this, GlobalContext* globalCtx) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); if (func_808B866C(this, globalCtx) && !func_801690CC(globalCtx)) { Player* player = GET_PLAYER(globalCtx); - func_801A5CFC(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); + Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); func_800B7298(globalCtx, &this->dyna.actor, 9); player->unk_3A0.x = this->dyna.actor.world.pos.x; player->unk_3A0.z = this->dyna.actor.world.pos.z; @@ -514,7 +514,7 @@ void func_808B9B30(DoorWarp1* this, GlobalContext* globalCtx) { } void func_808B9BE8(DoorWarp1* this, GlobalContext* globalCtx) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); Math_SmoothStepToF(&this->unk_1B0, 255.0f, 0.2f, 2.0f, 0.1f); Math_SmoothStepToF(&this->unk_1B4, 255.0f, 0.2f, 2.0f, 0.1f); if (this->unk_1C4 < 10) { @@ -546,7 +546,7 @@ void func_808B9CE8(DoorWarp1* this, GlobalContext* globalCtx) { } if (!Actor_HasParent(&this->dyna.actor, globalCtx)) { - func_800B8A1C(&this->dyna.actor, globalCtx, func_808B849C(this, globalCtx) + 84, 30.0f, 80.0f); + Actor_PickUp(&this->dyna.actor, globalCtx, func_808B849C(this, globalCtx) + 84, 30.0f, 80.0f); return; } @@ -579,7 +579,7 @@ void func_808B9CE8(DoorWarp1* this, GlobalContext* globalCtx) { } void func_808B9E94(DoorWarp1* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 2) { + if (Message_GetState(&globalCtx->msgCtx) == 2) { this->unk_1CE = 110; DoorWarp1_SetupAction(this, func_808B9ED8); } @@ -593,7 +593,7 @@ void func_808B9ED8(DoorWarp1* this, GlobalContext* globalCtx) { } void func_808B9F10(DoorWarp1* this, GlobalContext* globalCtx) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WARP_HOLE - SFX_FLAG); if ((this->unk_203 == 0) && func_808B866C(this, globalCtx) && !func_801690CC(globalCtx) && (this->unk_203 == 0)) { Player* player = GET_PLAYER(globalCtx); @@ -619,7 +619,7 @@ void func_808B9FD0(DoorWarp1* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(globalCtx->unk_1879C[9]); } else { ActorCutscene_Start(globalCtx->unk_1879C[9], NULL); - func_801A5CFC(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); + Audio_PlaySfxGeneral(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &D_801DB4B0, &D_801DB4B0, &D_801DB4B8); Animation_ChangeImpl(&this->skelAnime, &object_warp1_Anim_001374, 1.0f, Animation_GetLastFrame(&object_warp1_Anim_001374.common), Animation_GetLastFrame(&object_warp1_Anim_001374.common), 2, 40.0f, 1); @@ -1015,7 +1015,7 @@ void func_808BAE9C(DoorWarp1* this, GlobalContext* globalCtx) { } void func_808BB4C4(DoorWarp1* this, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, object_warp1_DL_0076C0); + Gfx_DrawDListOpa(globalCtx, object_warp1_DL_0076C0); } #ifdef NON_MATCHING @@ -1036,7 +1036,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) { this->dyna.actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(4.0f, this->unk_1AC, 4.0f, MTXMODE_APPLY); AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_0044D8)); - func_800BE03C(globalCtx, object_warp1_DL_003230); + Gfx_DrawDListXlu(globalCtx, object_warp1_DL_003230); return; } diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 4010b1e12..a638422bf 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -129,7 +129,7 @@ void func_80BECBE0(EnAkindonuts* this, s16 arg1) { this->actor.velocity.z = 0.0f; } - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); } void func_80BECC7C(EnAkindonuts* this, GlobalContext* globalCtx) { @@ -1036,7 +1036,7 @@ void func_80BEE73C(EnAkindonuts* this, GlobalContext* globalCtx) { player->actor.textId = D_80BF048C[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x15E4) { - player->unk_A87 = itemActionParam; + player->exchangeItemId = itemActionParam; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; @@ -1045,7 +1045,7 @@ void func_80BEE73C(EnAkindonuts* this, GlobalContext* globalCtx) { player->actor.textId = D_80BF0494[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x15F9) { - player->unk_A87 = itemActionParam; + player->exchangeItemId = itemActionParam; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; @@ -1054,7 +1054,7 @@ void func_80BEE73C(EnAkindonuts* this, GlobalContext* globalCtx) { player->actor.textId = D_80BF049C[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x160C) { - player->unk_A87 = itemActionParam; + player->exchangeItemId = itemActionParam; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; @@ -1063,7 +1063,7 @@ void func_80BEE73C(EnAkindonuts* this, GlobalContext* globalCtx) { player->actor.textId = D_80BF04A4[params]; this->unk_33C = player->actor.textId; if (this->unk_33C == 0x1621) { - player->unk_A87 = itemActionParam; + player->exchangeItemId = itemActionParam; this->actionFunc = func_80BEF20C; } else { this->actionFunc = func_80BEF18C; @@ -1162,7 +1162,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { } if (phi_v0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BEEDC0; this->unk_338 = 3; this->collider.dim.height = 64; @@ -1175,12 +1175,12 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) { if ((this->unk_338 == 4) || (this->unk_338 == 18)) { this->unk_338 = 17; this->collider.dim.height = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); func_8013BC6C(&this->skelAnime, sAnimations, 17); } else if (this->unk_338 == 2) { this->unk_338 = 16; this->collider.dim.height = 32; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); func_8013BC6C(&this->skelAnime, sAnimations, 16); } else if (this->unk_338 == 17) { phi_v0 = DECR(this->unk_33A); @@ -1213,7 +1213,7 @@ void func_80BEEE10(EnAkindonuts* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2DC(this, globalCtx); this->actionFunc = func_80BEEFA8; } else if (((this->actor.xzDistToPlayer < 100.0f) && @@ -1229,7 +1229,7 @@ void func_80BEEE10(EnAkindonuts* this, GlobalContext* globalCtx) { } void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) { - u8 temp_v0 = func_80152498(&globalCtx->msgCtx); + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 5) { if (func_80147624(globalCtx)) { @@ -1274,7 +1274,7 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) { } void func_80BEF18C(EnAkindonuts* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; this->unk_33C = 0; @@ -1283,7 +1283,7 @@ void func_80BEF18C(EnAkindonuts* this, GlobalContext* globalCtx) { } void func_80BEF20C(EnAkindonuts* this, GlobalContext* globalCtx) { - u8 sp27 = func_80152498(&globalCtx->msgCtx); + u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 sp24 = this->skelAnime.curFrame; s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common); @@ -1319,25 +1319,25 @@ void func_80BEF360(EnAkindonuts* this, GlobalContext* globalCtx) { this->unk_32C &= ~0x40; this->actionFunc = func_80BEF450; } else { - func_800B8A1C(&this->actor, globalCtx, func_80BED034(this), 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, func_80BED034(this), 300.0f, 300.0f); } } else if (Actor_HasParent(&this->actor, globalCtx)) { this->actor.parent = NULL; this->actionFunc = func_80BEF450; } else { - func_800B8A1C(&this->actor, globalCtx, func_80BECFBC(this), 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, func_80BECFBC(this), 300.0f, 300.0f); } } void func_80BEF450(EnAkindonuts* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { func_800B85E0(&this->actor, globalCtx, 400.0f, -1); this->actionFunc = func_80BEF4B8; } } void func_80BEF4B8(EnAkindonuts* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2DC(this, globalCtx); this->actionFunc = func_80BEEFA8; } else { @@ -1422,7 +1422,7 @@ void func_80BEF518(EnAkindonuts* this, GlobalContext* globalCtx) { this->unk_33E = 3; this->unk_338 = 19; func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_32C &= ~2; this->unk_32C |= 0x80; this->unk_358 = this->actor.world.pos.y; @@ -1481,7 +1481,7 @@ void func_80BEF83C(EnAkindonuts* this, GlobalContext* globalCtx) { this->unk_34C = 0.3f; this->unk_338 = 9; func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80BEF9F0; } } @@ -1587,7 +1587,7 @@ void EnAkindonuts_Init(Actor* thisx, GlobalContext* globalCtx) { this->morphTable, 28); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.01f); this->actor.colChkInfo.cylRadius = 0; @@ -1620,9 +1620,9 @@ void EnAkindonuts_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnAkindonuts_Update(Actor* thisx, GlobalContext* globalCtx) { EnAkindonuts* this = THIS; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); SkelAnime_Update(&this->skelAnime); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index c26081e0d..4c7b1d6cb 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -150,7 +150,7 @@ s32 func_809C1424(EnAob01* this) { if (this->unk_43C == 1) { if (curFrame == lastFrame) { this->unk_43C = 2; - func_800BDC5C(&this->skelAnime, D_809C3790, 2); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 2); return true; } } else if (this->unk_43C == 2) { @@ -166,13 +166,13 @@ s32 func_809C14D0(EnAob01* this) { if ((this->unk_43C == 0) || (this->unk_43C == 5)) { if (curFrame == lastFrame) { this->unk_43C = 3; - func_800BDC5C(&this->skelAnime, D_809C3790, 3); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 3); return true; } } else if (this->unk_43C == 3) { if (curFrame == lastFrame) { this->unk_43C = 4; - func_800BDC5C(&this->skelAnime, D_809C3790, 4); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 4); return true; } } else if (this->unk_43C == 4) { @@ -188,7 +188,7 @@ s32 func_809C15BC(EnAob01* this) { if ((this->unk_43C != 0) && (this->unk_43C != 5)) { if (curFrame == lastFrame) { this->unk_43C = 5; - func_800BDC5C(&this->skelAnime, D_809C3790, 5); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 5); return true; } } else { @@ -330,7 +330,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 0x40; this->unk_2D2 |= 0x10; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); break; case 0x3525: @@ -345,7 +345,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 0x40; this->unk_2D2 |= 0x10; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); break; } @@ -360,7 +360,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 4; this->unk_2D2 |= 0x10; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); break; case 0x3527: @@ -372,7 +372,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_210 = 0x3536; this->unk_2D2 |= 0x40; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); break; } @@ -380,7 +380,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) { this->unk_210 = 0x3537; this->unk_2D2 |= 0x40; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); break; } @@ -427,7 +427,7 @@ void func_809C1C9C(EnAob01* this, GlobalContext* globalCtx) { } void func_809C1D64(EnAob01* this, GlobalContext* globalCtx) { - u8 temp_v0 = func_80152498(&globalCtx->msgCtx); + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 4) { if (func_80147624(globalCtx)) { @@ -499,7 +499,7 @@ void func_809C2060(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 8; this->actionFunc = func_809C21E0; } - } else if (func_800B84D0(&this->actor, globalCtx) && (this->unk_2D2 & 0x100)) { + } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_2D2 & 0x100)) { this->unk_2D2 &= ~0x100; this->unk_2E6 = this->unk_2D4; this->unk_2EC = this->unk_2DA; @@ -517,7 +517,7 @@ void func_809C2060(EnAob01* this, GlobalContext* globalCtx) { } void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) { - u8 sp2F = func_80152498(&globalCtx->msgCtx); + u8 sp2F = Message_GetState(&globalCtx->msgCtx); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1); @@ -542,7 +542,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) { } if (this->unk_2D2 & 8) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_80123E90(globalCtx, &this->actor); if (this->unk_2D2 & 4) { @@ -552,7 +552,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) { this->unk_2D2 |= 0x10; this->unk_2D2 |= 0x40; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); func_801518B0(globalCtx, 0x354B, &this->actor); } this->unk_2D2 &= ~8; @@ -593,7 +593,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) { } s32 func_809C2504(EnAob01* this, GlobalContext* globalCtx) { - Actor* npc = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* npc = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (npc != NULL) { if ((npc->id == ACTOR_EN_RACEDOG) && (func_800F2178(this->unk_430) == ((EnRacedog*)npc)->unk_1E8)) { @@ -609,7 +609,7 @@ s32 func_809C2504(EnAob01* this, GlobalContext* globalCtx) { } s32 func_809C2594(EnAob01* this, GlobalContext* globalCtx) { - Actor* npc = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* npc = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (npc != NULL) { if ((npc->id == ACTOR_EN_RACEDOG) && (((EnRacedog*)npc)->unk_290 == ((EnRacedog*)npc)->unk_292)) { @@ -623,7 +623,7 @@ s32 func_809C2594(EnAob01* this, GlobalContext* globalCtx) { } s32 func_809C25E4(EnAob01* this, GlobalContext* globalCtx) { - Actor* npc = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* npc = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; s16 count = 0; while (npc != NULL) { @@ -699,7 +699,7 @@ void func_809C2824(EnAob01* this, GlobalContext* globalCtx) { } void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_80123E90(globalCtx, &this->actor); this->unk_434 = gSaveContext.unk_3F5C; @@ -731,7 +731,7 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) { this->unk_210 = 0x352D; this->unk_2D2 |= 0x40; this->unk_43C = 1; - func_800BDC5C(&this->skelAnime, D_809C3790, 1); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1); break; } @@ -743,7 +743,7 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) { } void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) { - u8 sp2F = func_80152498(&globalCtx->msgCtx); + u8 sp2F = Message_GetState(&globalCtx->msgCtx); if (func_809C15BC(this)) { if ((sp2F == 5) && func_80147624(globalCtx)) { @@ -765,15 +765,15 @@ void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) { this->actionFunc = func_809C2BE4; } } else if (gSaveContext.weekEventReg[8] & 0x20) { - func_800B8A1C(&this->actor, globalCtx, 4, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, 4, 300.0f, 300.0f); } else { - func_800B8A1C(&this->actor, globalCtx, 12, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, 12, 300.0f, 300.0f); } } } void func_809C2BE4(EnAob01* this, GlobalContext* globalCtx) { - u8 temp_v0 = func_80152498(&globalCtx->msgCtx); + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); if (((temp_v0 == 5) || (temp_v0 == 6)) && func_80147624(globalCtx)) { if (gSaveContext.weekEventReg[63] & 2) { @@ -792,7 +792,7 @@ void func_809C2BE4(EnAob01* this, GlobalContext* globalCtx) { } void func_809C2C9C(EnAob01* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_210 = 0x354C; func_80151938(globalCtx, this->unk_210); this->actionFunc = func_809C1D64; @@ -802,7 +802,7 @@ void func_809C2C9C(EnAob01* this, GlobalContext* globalCtx) { } void func_809C2D0C(EnAob01* this, GlobalContext* globalCtx) { - u8 sp2F = func_80152498(&globalCtx->msgCtx); + u8 sp2F = Message_GetState(&globalCtx->msgCtx); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1); @@ -847,7 +847,7 @@ void func_809C2D0C(EnAob01* this, GlobalContext* globalCtx) { } s32 func_809C2EC4(EnAob01* this, GlobalContext* globalCtx) { - Actor* dog = globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first; + Actor* dog = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first; while (dog != NULL) { if (dog->id == ACTOR_EN_DG) { @@ -927,7 +927,7 @@ void EnAob01_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->unk_43C = 0; - func_800BDC5C(&this->skelAnime, D_809C3790, 0); + Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 0); Actor_SetScale(&this->actor, 0.01f); switch (gSaveContext.eventInf[0] & 7) { diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index bacb29395..097c90fe0 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -42,7 +42,7 @@ static ColliderQuadInit D_8088C1E0 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_8088C230[] = { - ICHAIN_F32(minVelocityY, -150, ICHAIN_STOP), + ICHAIN_F32(terminalVelocity, -150, ICHAIN_STOP), }; #endif diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c index c776dc696..2668c1d68 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -111,7 +111,7 @@ static DamageTable sDamageTable = { void EnBaguo_Init(Actor* thisx, GlobalContext* globalCtx) { EnBaguo* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 0.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &gNejironSkel, NULL, this->jointTable, this->morphTable, 3); this->actor.hintId = 0xB; this->maxDistanceFromHome = 240.0f; @@ -145,7 +145,7 @@ void EnBaguo_UndergroundIdle(EnBaguo* this, GlobalContext* globalCtx) { this->action = NEJIRON_ACTION_INACTIVE; if (this->actor.xzDistToPlayer < 200.0f && Player_GetMask(globalCtx) != PLAYER_MASK_STONE) { this->actor.draw = EnBaguo_DrawBody; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BAKUO_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_APPEAR); this->actor.world.rot.z = 0; this->actor.world.rot.x = this->actor.world.rot.z; this->actor.flags &= ~0x8000000; @@ -159,8 +159,8 @@ void EnBaguo_EmergeFromUnderground(EnBaguo* this, GlobalContext* globalCtx) { this->actor.world.rot.y += 0x1518; this->actor.shape.rot.y = this->actor.world.rot.y; if ((globalCtx->gameplayFrames % 8) == 0) { - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10, 8.0f, - 500, 10, 1); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, + 10, 8.0f, 500, 10, 1); } Math_ApproachF(&this->actor.shape.shadowScale, 50.0f, 0.3f, 5.0f); Math_ApproachF(&this->actor.shape.yOffset, 2700.0f, 100.0f, 500.0f); @@ -188,9 +188,9 @@ void EnBaguo_Idle(EnBaguo* this, GlobalContext* globalCtx) { if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) > 200.0f) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 30, 300, 1000); if ((globalCtx->gameplayFrames % 8) == 0) { - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, - this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BAKUO_VOICE); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, + this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_VOICE); } } } @@ -252,7 +252,7 @@ void EnBaguo_Roll(EnBaguo* this, GlobalContext* globalCtx) { this->actor.world.rot.z -= (s16)this->currentRotation.z; } } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG); } void EnBaguo_SetupRetreatUnderground(EnBaguo* this) { @@ -265,8 +265,8 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, GlobalContext* globalCtx) { this->actor.world.rot.y -= 0x1518; this->actor.shape.rot.y = this->actor.world.rot.y; if ((globalCtx->gameplayFrames % 8) == 0) { - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10, 8.0f, - 500, 10, 1); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, + 10, 8.0f, 500, 10, 1); } Math_ApproachF(&this->actor.shape.yOffset, -3000.0f, 100.0f, 500.0f); Math_ApproachZeroF(&this->actor.shape.shadowScale, 0.3f, 5.0f); @@ -274,7 +274,7 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, GlobalContext* globalCtx) { this->actor.shape.yOffset = -3000.0f; this->actor.draw = EnBaguo_DrawBody; Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BAKUO_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_APPEAR); this->actor.flags |= 0x8000000; this->actor.flags &= ~1; this->actionFunc = EnBaguo_UndergroundIdle; @@ -311,7 +311,7 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, GlobalContext* globalCtx) { if ((this->collider.base.acFlags & AC_HIT || i)) { this->collider.base.acFlags &= ~AC_HIT; if (i || this->actor.colChkInfo.damageEffect == NEJIRON_DMGEFF_KILL) { - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->action = NEJIRON_ACTION_EXPLODING; this->actor.speedXZ = 0.0f; this->actor.shape.shadowScale = 0.0f; @@ -329,8 +329,8 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, GlobalContext* globalCtx) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_POP); - Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BAKUO_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_DEAD); this->timer = 30; this->actor.flags |= 0x8000000; this->actor.flags &= ~1; @@ -347,7 +347,7 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, GlobalContext* globalCtx) { void EnBaguo_Update(Actor* thisx, GlobalContext* globalCtx) { EnBaguo* this = THIS; - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); EnBaguo_UpdateParticles(this, globalCtx); EnBaguo_CheckForDetonation(this, globalCtx); this->actionFunc(this, globalCtx); @@ -369,7 +369,7 @@ void EnBaguo_Update(Actor* thisx, GlobalContext* globalCtx) { this->blinkTimer = Rand_ZeroFloat(60.0f) + 20.0f; } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); if (this->action != NEJIRON_ACTION_INACTIVE) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c index 7323c95b3..fcbd60ed0 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c @@ -68,7 +68,7 @@ static u8 animModes[] = { 0, 0 }; void EnBaisen_Init(Actor* thisx, GlobalContext* globalCtx) { EnBaisen* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->paramCopy = this->actor.params; @@ -124,7 +124,7 @@ void func_80BE871C(EnBaisen* this) { } void func_80BE87B0(EnBaisen* this, GlobalContext* globalCtx) { - Actor* actorIterator = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* actorIterator = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actorIterator != NULL) { if (actorIterator->id == ACTOR_EN_HEISHI) { @@ -151,7 +151,7 @@ void func_80BE87FC(EnBaisen* this) { } void func_80BE887C(EnBaisen* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80BE895C(this, globalCtx); } else { if (this->paramCopy != 0) { @@ -176,7 +176,7 @@ void func_80BE895C(EnBaisen* this, GlobalContext* globalCtx) { if (this->unk2A4 != NULL) { this->unk290 = true; this->unk2AC = 1; - func_800B86C8(this->unk2A4, globalCtx, this->unk2A4); + Actor_ChangeFocus(this->unk2A4, globalCtx, this->unk2A4); } this->unk29C = 1; if (this->paramCopy == 0) { @@ -223,7 +223,7 @@ void func_80BE8AAC(EnBaisen* this, GlobalContext* globalCtx) { EnBaisen_ChangeAnimation(this, 0); } } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); this->textIdIndex++; if (this->textIdIndex < 6) { @@ -233,7 +233,7 @@ void func_80BE8AAC(EnBaisen* this, GlobalContext* globalCtx) { } else { this->unk2A4 = &this->actor; } - func_800B86C8(this->unk2A4, globalCtx, this->unk2A4); + Actor_ChangeFocus(this->unk2A4, globalCtx, this->unk2A4); } else { func_80BE87FC(this); } @@ -254,13 +254,13 @@ void EnBaisen_Update(Actor* thisx, GlobalContext* globalCtx) { return; } this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); Actor_SetScale(&this->actor, 0.01f); if (this->unk290) { func_80BE871C(this); } - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 0xBB8, 0); Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 0x3E8, 0); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index 43b7d3feb..5b31f7601 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -207,7 +207,7 @@ void EnBigpo_Init(Actor* thisx, GlobalContext* globalCtx2) { 255, 0); } - ActorShape_Init(&thisx->shape, 0.0f, func_800B3FC0, 45.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 45.0f); thisx->bgCheckFlags |= 0x400; this->savedHeight = thisx->home.pos.y + 100.0f; this->mainColor.r = 255; @@ -262,7 +262,7 @@ void EnBigpo_UpdateSpin(EnBigpo* this) { this->actor.shape.rot.y += this->rotVelocity; if ((oldYaw < 0) && (this->actor.shape.rot.y > 0)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_ROLL); // spinning sfx during spin attack + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); // spinning sfx during spin attack } } @@ -398,7 +398,7 @@ void EnBigpo_SpawnCutsceneStage5(EnBigpo* this) { Animation_PlayLoop(&this->skelAnime, &gBigpoAwakenStretchAnim); this->actor.draw = EnBigpo_DrawMainBigpo; Actor_SetScale(&this->actor, 0.014f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->actionFunc = EnBigpo_SpawnCutsceneStage6; } @@ -486,7 +486,7 @@ void EnBigpo_SetupWarpOut(EnBigpo* this) { this->idleTimer = 32; this->actor.flags &= ~0x1; // targetable OFF this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); this->actionFunc = EnBigpo_WarpingOut; } @@ -508,7 +508,7 @@ void EnBigpo_SetupWarpIn(EnBigpo* this, GlobalContext* globalCtx) { f32 distance = CLAMP_MIN(this->actor.xzDistToPlayer, 200.0f); s16 randomYaw = (Rand_Next() >> 0x14) + this->actor.yawTowardsPlayer; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); Animation_PlayLoop(&this->skelAnime, &gBigpoAwakenStretchAnim); this->rotVelocity = 0x2000; this->actor.world.pos.x = (Math_SinS(randomYaw) * distance) + player->actor.world.pos.x; @@ -648,7 +648,7 @@ void EnBigpo_SpinningDown(EnBigpo* this, GlobalContext* globalCtx) { */ void EnBigpo_HitStun(EnBigpo* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gBigpoShockAnim, -6.0f); - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 0x10); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x10); this->collider.base.acFlags &= ~AC_ON; func_800BE504(&this->actor, &this->collider); this->actionFunc = EnBigpo_CheckHealth; @@ -728,7 +728,7 @@ void EnBigpo_BurnAwayDeath(EnBigpo* this, GlobalContext* globalCtx) { func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); // burning sfx } if (this->idleTimer == 18) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); } } @@ -754,7 +754,7 @@ void EnBigpo_SetupLanternDrop(EnBigpo* this, GlobalContext* globalCtx) { void EnBigpo_LanternFalling(EnBigpo* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1 || this->actor.floorHeight == BGCHECK_Y_MIN) { if (this->switchFlags != 0xFF) { - Actor_SetSwitchFlag(globalCtx, this->switchFlags); + Flags_SetSwitch(globalCtx, this->switchFlags); } EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_BIGPO, 10, @@ -799,7 +799,7 @@ void EnBigpo_SpawnScoopSoul(EnBigpo* this) { this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; this->savedHeight = this->actor.world.pos.y; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); // misnamed? + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METAL_BOX_BOUND); // misnamed? this->actionFunc = EnBigpo_ScoopSoulAppearing; } @@ -813,7 +813,7 @@ void EnBigpo_ScoopSoulAppearing(EnBigpo* this, GlobalContext* globalCtx) { void EnBigpo_SetupScoopSoulIdle(EnBigpo* this) { this->savedHeight = this->actor.world.pos.y; - Actor_SetHeight(&this->actor, -10.0f); + Actor_SetFocus(&this->actor, -10.0f); this->idleTimer = 400; // 20 seconds this->actor.flags |= 0x1; // targetable ON this->actionFunc = EnBigpo_ScoopSoulIdle; @@ -825,10 +825,10 @@ void EnBigpo_ScoopSoulIdle(EnBigpo* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); } else if (this->idleTimer == 0) { // took too long, soul is leaving - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); EnBigpo_SetupScoopSoulLeaving(this); } else { - func_800B8A1C(&this->actor, globalCtx, GI_MAX, 35.0f, 60.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MAX, 35.0f, 60.0f); this->actor.world.pos.y = (sin_rad(this->idleTimer * (M_PI / 20)) * 5.0f) + this->savedHeight; } } @@ -1048,7 +1048,7 @@ void EnBigpo_FlameCircleCutscene(EnBigpo* this, GlobalContext* globalCtx) { this->idleTimer--; if (this->idleTimer == 0) { EnBigpo* parentPoh = (EnBigpo*)this->actor.parent; - Actor_SetSwitchFlag(globalCtx, this->switchFlags); + Flags_SetSwitch(globalCtx, this->switchFlags); Math_Vec3f_Copy(&parentPoh->fires[this->unk20C].pos, &this->actor.world.pos); Actor_MarkForDeath(&this->actor); if (this->unk20C == 0) { @@ -1126,13 +1126,13 @@ s32 EnBigpo_ApplyDamage(EnBigpo* this, GlobalContext* globalCtx) { if (Actor_ApplyDamage(&this->actor) == 0) { this->actor.flags &= ~0x1; // targetable OFF - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD); Enemy_StartFinishingBlow(globalCtx, &this->actor); if (this->actor.params == ENBIGPO_SUMMONED) { // dampe type func_801A2ED8(); } } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE); } // light arrows @@ -1167,23 +1167,23 @@ void EnBigpo_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk20C = 0; } if (this->unk20C == 40) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); EnBigpo_SetupWarpOut(this); } } this->actionFunc(this, globalCtx); if ((this->actionFunc != EnBigpo_SpawnCutsceneStage6) && (this->actionFunc != EnBigpo_SpawnCutsceneStage4)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } if (this->actionFunc == EnBigpo_LanternFalling) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); } if (this->actor.draw == EnBigpo_DrawScoopSoul) { - Actor_SetHeight(&this->actor, -10.0f); + Actor_SetFocus(&this->actor, -10.0f); } else { - Actor_SetHeight(&this->actor, 42.0f); + Actor_SetFocus(&this->actor, 42.0f); } EnBigpo_UpdateColor(this); diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index 0133b303a..9f55e3e0b 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -337,7 +337,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) { this->gekkoCollider.base.ocFlags1 &= ~OC1_NO_PUSH; this->actor.params = CLAMP(this->actor.params, 1, 4); - if (Actor_GetRoomCleared(globalCtx, globalCtx->roomCtx.currRoom.num)) { + if (Flags_GetClear(globalCtx, globalCtx->roomCtx.currRoom.num)) { Actor_MarkForDeath(&this->actor); if (!(gSaveContext.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { @@ -770,7 +770,7 @@ void EnBigslime_BreakIntoMinislime(EnBigslime* this, GlobalContext* globalCtx) { this->actor.bgCheckFlags &= ~1; this->formBigslimeTimer = 2; EnBigslime_AddIceShardEffect(this, globalCtx); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_SLIME_BREAK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_BREAK); EnBigslime_SetupJumpGekko(this); } @@ -921,7 +921,7 @@ void EnBigslime_GekkoThaw(EnBigslime* this, GlobalContext* globalCtx) { this->gekkoCollider.base.colType = COLTYPE_HIT6; this->gekkoCollider.info.elemType = ELEMTYPE_UNK1; this->unk_388 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f); this->actor.flags |= 0x200; } } @@ -1212,7 +1212,7 @@ void EnBigslime_SetTargetVtxToWideCone(EnBigslime* this) { } void EnBigslime_SetupSquishFlat(EnBigslime* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_SLIME_JUMP2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_JUMP2); this->squishFlatTimer = 20; this->actor.scale.x = 0.2f; this->actor.scale.z = 0.2f; @@ -1411,7 +1411,7 @@ void EnBigslime_SetupRise(EnBigslime* this) { Animation_PlayLoop(&this->skelAnime, &gGekkoSwimForwardAnim); EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_JUMP_ABOVE); EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_UTSUBO_APPEAR_TRG); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_SLIME_JUMP1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_JUMP1); this->riseCounter = 0; this->bigslimeCollider[0].base.atFlags &= ~AT_ON; this->actor.gravity = 0.0f; @@ -1514,7 +1514,7 @@ void EnBigslime_SetupCutsceneGrabPlayer(EnBigslime* this, GlobalContext* globalC this->subCamYawGrabPlayer += this->actor.world.rot.y; Animation_PlayLoop(&this->skelAnime, &gGekkoBoxingStanceAnim); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_SLIME_EAT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_EAT); this->actionFunc = EnBigslime_CutsceneGrabPlayer; } @@ -1623,7 +1623,7 @@ void EnBigslime_AttackPlayerInBigslime(EnBigslime* this, GlobalContext* globalCt } globalCtx->damagePlayer(globalCtx, -4); - func_800B8E58(&player->actor, player->ageProperties->unk_92 + 0x6805); + func_800B8E58(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S); this->gekkoRot.y += (s16)(Rand_S16Offset(0x4000, 0x4000) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); this->gekkoPosOffset.x = Math_SinS(this->gekkoRot.y) * -50.0f; this->gekkoPosOffset.z = Math_CosS(this->gekkoRot.y) * -50.0f; @@ -1700,7 +1700,7 @@ void EnBigslime_WindupThrowPlayer(EnBigslime* this, GlobalContext* globalCtx) { this->gekkoPosOffset.z = Math_CosS(this->gekkoRot.y) * -50.0f; } else { if (this->windupPunchTimer == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_SLIME_REVERSE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_REVERSE); EnBigslime_GekkoSfxInsideBigslime(this, NA_SE_EN_FROG_PUNCH1); } @@ -2283,7 +2283,7 @@ void EnBigslime_FormBigslime(EnBigslime* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; Animation_PlayLoop(&this->skelAnime, &gGekkoSwimForwardAnim); this->formBigslimeCutsceneTimer--; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_B_SLIME_COMBINE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_COMBINE); } else if (this->isAnimUpdate) { this->formBigslimeCutsceneTimer--; if (this->formBigslimeCutsceneTimer == 0) { @@ -2497,7 +2497,7 @@ void EnBigslime_Despawn(EnBigslime* this, GlobalContext* globalCtx) { } if (!this->isDespawned) { - Actor_SetRoomClearedTemp(globalCtx, globalCtx->roomCtx.currRoom.num); + Flags_SetClearTemp(globalCtx, globalCtx->roomCtx.currRoom.num); this->isDespawned = true; } @@ -2643,7 +2643,7 @@ void EnBigslime_ApplyDamageEffectGekko(EnBigslime* this, GlobalContext* globalCt EnBigslime_SetupCutscene(this); } else if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_ELECTRIC_STUN) { this->stunTimer = 40; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->gekkoDrawEffect = GEKKO_DRAW_EFFECT_ELECTRIC_STUN; this->unk_38C = 0.75f; this->unk_388 = 2.0f; @@ -2651,7 +2651,7 @@ void EnBigslime_ApplyDamageEffectGekko(EnBigslime* this, GlobalContext* globalCt } else if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_STUN || this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_DEKU_STUN) { this->stunTimer = 40; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); EnBigslime_SetupStunGekko(this); } else if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_ICE) { EnBigslime_GekkoFreeze(this); @@ -2721,7 +2721,7 @@ void EnBigslime_AddIceShardEffect(EnBigslime* this, GlobalContext* globalCtx) { } } - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); EnBigslime_InitShockwave(this, globalCtx); } @@ -2790,9 +2790,9 @@ void EnBigslime_UpdateBigslime(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != EnBigslime_FormBigslime) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } else { - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } if (this->actionFunc != EnBigslime_JumpGekko) { @@ -2830,9 +2830,9 @@ void EnBigslime_UpdateGekko(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != EnBigslime_FormBigslime) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } else { - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 40.0f, 80.0f, 0x1F); diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index 3b7220221..d1c876b6c 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -105,7 +105,7 @@ void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; } } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { globalCtx->msgCtx.unk11F22 = 0; globalCtx->msgCtx.unk11F10 = 0; func_809CD028(this, globalCtx); @@ -118,7 +118,7 @@ void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) { } else { this->moonsTear = (ObjMoonStone*)SubS_FindActor(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE); } - func_800B8500(&this->actor, globalCtx, 60.0f, 10.0f, 0); + func_800B8500(&this->actor, globalCtx, 60.0f, 10.0f, EXCH_ITEM_NONE); } } @@ -171,7 +171,8 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) { } else { this->textId = 0x5F1; } - func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0); + func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, + EXCH_ITEM_NONE); break; case PLAYER_FORM_HUMAN: this->textId = 0x5F7; @@ -204,7 +205,7 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) { } void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x444); func_809CCDE0(this, globalCtx); @@ -322,7 +323,7 @@ void func_809CD70C(EnBji01* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x444); func_809CCDE0(this, globalCtx); if (this->actor.shape.rot.y == this->actor.yawTowardsPlayer) { - func_800B86C8(&this->moonsTear->actor, globalCtx, &this->actor); /* Z-Target the Moon's Tear? */ + Actor_ChangeFocus(&this->moonsTear->actor, globalCtx, &this->actor); /* Z-Target the Moon's Tear? */ this->actionFunc = func_809CD77C; } } @@ -336,7 +337,7 @@ void func_809CD77C(EnBji01* this, GlobalContext* globalCtx) { void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) { EnBji01* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600578C, &D_06000FDC, this->jointTable, this->morphTable, BJI_LIMB_MAX); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -394,7 +395,7 @@ void EnBji01_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index d06c2a060..084439a4b 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -120,7 +120,7 @@ void EnBomjima_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 19.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f); this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable, this->morphTable, 21); @@ -216,21 +216,21 @@ void func_80BFE524(EnBomjima* this) { if ((this->unk_2EC == 5) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2EC == 18) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2EC == 15) && Animation_OnFrame(&this->skelAnime, 15.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); } if ((this->unk_2EC == 6) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); } } @@ -326,7 +326,7 @@ void func_80BFE67C(EnBomjima* this, GlobalContext* globalCtx) { } void func_80BFEA94(EnBomjima* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first; while (actor != NULL) { if (actor->id != ACTOR_EN_BOMBAL) { @@ -379,7 +379,7 @@ void func_80BFEB64(EnBomjima* this, GlobalContext* globalCtx) { this->actor.textId = Text_GetFaceReaction(globalCtx, 0x11); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2DC = this->actor.yawTowardsPlayer; func_80C00234(this); return; @@ -405,7 +405,7 @@ void func_80BFEB64(EnBomjima* this, GlobalContext* globalCtx) { this->unk_2DC = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2F0->actor.world.pos); if (Animation_OnFrame(&this->skelAnime, 19.0f)) { this->unk_2C0 = 5; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_SHOT_BREATH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_SHOT_BREATH); } if (this->unk_2C0 == 1) { @@ -498,7 +498,7 @@ void func_80BFF174(EnBomjima* this, GlobalContext* globalCtx) { this->actor.textId = Text_GetFaceReaction(globalCtx, 0x11); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2DC = this->actor.yawTowardsPlayer; func_80C00234(this); return; @@ -573,7 +573,7 @@ void func_80BFF430(EnBomjima* this, GlobalContext* globalCtx) { if (bombal != NULL) { bombal->unk_150 = 0.0f; bombal->unk_14C = this->unk_2F4; - func_800B86C8(&this->actor, globalCtx, &bombal->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &bombal->actor); gSaveContext.weekEventReg[83] &= (u8)~4; func_80BFE65C(this); func_801477B4(globalCtx); @@ -589,7 +589,7 @@ void func_80BFF4F4(EnBomjima* this) { } void func_80BFF52C(EnBomjima* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { func_801477B4(globalCtx); if (globalCtx->msgCtx.choiceIndex == 0) { Player* player = GET_PLAYER(globalCtx); @@ -632,7 +632,7 @@ void func_80BFF6CC(EnBomjima* this, GlobalContext* globalCtx) { f32 curFrame = this->skelAnime.curFrame; if (this->unk_2CC <= curFrame) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80BFE494(this, 1, 1.0f); this->actionFunc = func_80BFF754; @@ -761,7 +761,7 @@ void func_80BFF9B0(EnBomjima* this, GlobalContext* globalCtx) { } void func_80BFFB40(EnBomjima* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80BFE494(this, 15, 1.0f); D_80C009F0 = 100; @@ -868,7 +868,7 @@ void func_80BFFF54(EnBomjima* this, GlobalContext* globalCtx) { if (this->unk_2EC == 8) { if ((D_80C009F4 == 1) && Animation_OnFrame(&this->skelAnime, 7.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); D_80C009F4 = 2; } @@ -905,7 +905,7 @@ void func_80C00168(EnBomjima* this, GlobalContext* globalCtx) { this->actor.textId = Text_GetFaceReaction(globalCtx, 0x11); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2DC = this->actor.yawTowardsPlayer; func_80C00234(this); } else { @@ -945,7 +945,7 @@ void func_80C00284(EnBomjima* this, GlobalContext* globalCtx) { this->unk_28E = -6000; } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { this->collider.dim.radius = 10; this->collider.dim.height = 30; if ((this->unk_2A0 == 4) || (this->unk_2CA == 1) || ((this->unk_2CA == 3) && (this->unk_2C8 >= 2))) { @@ -1044,9 +1044,9 @@ void EnBomjima_Update(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.shape.rot.y = this->actor.world.rot.y; func_80BFE524(this); - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 5000, 0); Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 1000, 0); Math_SmoothStepToS(&this->unk_294, this->unk_29A, 1, 1000, 0); diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index 229803174..dc776fa59 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -76,7 +76,7 @@ void EnBomjimb_Init(Actor* thisx, GlobalContext* globalCtx) { EnBomjimb* this = THIS; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 19.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f); this->actor.gravity = -2.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable, this->morphTable, 21); @@ -181,20 +181,20 @@ void func_80C011CC(EnBomjimb* this) { if ((this->unk_2DC == 5) && (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2DC == 19) && (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK); } if ((this->unk_2DC == 18) && Animation_OnFrame(&this->skelAnime, 15.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); } if ((this->unk_2DC == 7) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMBERS_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND); } } @@ -447,7 +447,7 @@ void func_80C01CD0(EnBomjimb* this, GlobalContext* globalCtx) { } if ((this->unk_2C0 == 0) && (this->unk_2E4->bgCheckFlags & 1)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); this->unk_2C0 = 1; } @@ -501,7 +501,7 @@ void func_80C0201C(EnBomjimb* this, GlobalContext* globalCtx) { } } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2CA = 10; this->actionFunc = func_80C02A14; } else { @@ -691,7 +691,7 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) { if (gSaveContext.unk_FE6 > 4) { func_801A3098(0x922); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_SY_PIECE_OF_HEART); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART); } switch (this->unk_2C8) { @@ -747,7 +747,7 @@ void func_80C02A14(EnBomjimb* this, GlobalContext* globalCtx) { player->actor.freezeTimer = 3; if (this->unk_2E0 == 0) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); this->unk_2E0 = 1; } } @@ -757,7 +757,7 @@ void func_80C02A14(EnBomjimb* this, GlobalContext* globalCtx) { player->actor.freezeTimer = 3; } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); if ((this->unk_2CA == 8) && (gSaveContext.unk_FE6 >= 5)) { func_80C02CA4(this, globalCtx); @@ -776,7 +776,7 @@ void func_80C02BCC(EnBomjimb* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 5000, 0); if (this->unk_2C0 == 0) { player->actor.freezeTimer = 3; - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); this->unk_2C0 = 1; player->stateFlags1 &= ~0x10000000; @@ -829,11 +829,11 @@ void EnBomjimb_Update(Actor* thisx, GlobalContext* globalCtx2) { SkelAnime_Update(&this->skelAnime); this->actor.shape.rot.y = this->actor.world.rot.y; func_80C011CC(this); - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->unk_2CA == 0) { if ((this->unk_2E4 != NULL) && (this->unk_2E4->update != NULL)) { diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index ad688b9a0..aa7c425d2 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -9,7 +9,11 @@ typedef void (*EnBoxActionFunc)(struct EnBox*, GlobalContext*); typedef struct EnBox { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0xBC]; + /* 0x0144 */ char unk_144[0xAC]; + /* 0x01F0 */ char unk_1F0[0x01]; + /* 0x01F1 */ u8 unk_1F1; + /* 0x01F2 */ char unk_1F2[0x02]; + /* 0x01F4 */ char unk_1F4[0x0C]; /* 0x0200 */ EnBoxActionFunc actionFunc; /* 0x0204 */ char unk_204[0x20]; } EnBox; // size = 0x224 diff --git a/src/overlays/actors/ovl_En_Bu/z_en_bu.c b/src/overlays/actors/ovl_En_Bu/z_en_bu.c index 3c5653525..6dab7f307 100644 --- a/src/overlays/actors/ovl_En_Bu/z_en_bu.c +++ b/src/overlays/actors/ovl_En_Bu/z_en_bu.c @@ -44,7 +44,7 @@ void EnBu_DoNothing(EnBu* this, GlobalContext* globalCtx) { void EnBu_Update(Actor* thisx, GlobalContext* globalCtx) { EnBu* this = THIS; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Cha/z_en_cha.c b/src/overlays/actors/ovl_En_Cha/z_en_cha.c index d8f32613f..d5a2f0be0 100644 --- a/src/overlays/actors/ovl_En_Cha/z_en_cha.c +++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.c @@ -86,12 +86,12 @@ void EnCha_Ring(EnCha* this, GlobalContext* globalCtx) { void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) { if (gSaveContext.weekEventReg[60] & 4) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_DOOR_BELL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL); gSaveContext.weekEventReg[60] &= 0xFB; this->actor.home.rot.z = 0x7D0; } if (this->collider.base.acFlags & AC_HIT) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_DOOR_BELL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL); this->actor.home.rot.z = 0x7D0; if (!(gSaveContext.weekEventReg[51] & 4)) { gSaveContext.weekEventReg[51] |= 4; @@ -117,8 +117,8 @@ void EnCha_Update(Actor* thisx, GlobalContext* globalCtx) { void EnCha_Draw(Actor* thisx, GlobalContext* globalCtx) { EnCha* this = THIS; - func_800BDFC0(globalCtx, D_06000710); + Gfx_DrawDListOpa(globalCtx, D_06000710); Matrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, MTXMODE_APPLY); Matrix_InsertXRotation_s(this->actor.home.rot.x, MTXMODE_APPLY); - func_800BDFC0(globalCtx, D_06000958); + Gfx_DrawDListOpa(globalCtx, D_06000958); } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 04180ab47..d323c98d2 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -556,7 +556,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, GlobalContext* globalCtx) { } player->actor.speedXZ = 0.0f; - if (func_80152498(&globalCtx->msgCtx) == 0) { + if (Message_GetState(&globalCtx->msgCtx) == 0) { camera = Play_GetCamera(globalCtx, MAIN_CAM); camera->eye = this->eye; camera->eyeNext = this->eye; diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c index 9a70e1c7d..531e0b122 100644 --- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c +++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c @@ -73,11 +73,11 @@ void EnColMan_Init(Actor* thisx, GlobalContext* globalCtx) { case EN_COL_MAN_HEART_PIECE: case EN_COL_MAN_RECOVERY_HEART: default: - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 10.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f); func_80AFDD60(this); break; case EN_COL_MAN_FALLING_ROCK: - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 10.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f); func_80AFDF60(this); break; case EN_COL_MAN_CUTSCENE_BOMB: @@ -131,14 +131,14 @@ void func_80AFDE00(EnColMan* this, GlobalContext* globalCtx) { this->actor.draw = NULL; this->actionFunc = EnColMan_SetHeartPieceCollectedAndKill; } else if (!(gSaveContext.weekEventReg[56] & 2)) { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_PIECE, 40.0f, 40.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 40.0f, 40.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RECOVERY_HEART, 40.0f, 40.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RECOVERY_HEART, 40.0f, 40.0f); } } void EnColMan_SetHeartPieceCollectedAndKill(EnColMan* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { gSaveContext.weekEventReg[56] |= 2; Actor_MarkForDeath(&this->actor); } @@ -167,7 +167,7 @@ void func_80AFDFB4(EnColMan* this, GlobalContext* globalCtx) { this->actor.speedXZ = 2.0f + BREG(56) + Rand_ZeroFloat(2.0f); this->actor.velocity.y = 12.0f + BREG(57) + Rand_ZeroFloat(5.0f); this->hasSetRandomValues = true; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ANSATSUSYA_ROCK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ANSATSUSYA_ROCK); return; } @@ -210,7 +210,7 @@ void func_80AFE25C(EnColMan* this, GlobalContext* globalCtx) { } } - Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_MarkForDeath(&this->actor); } } @@ -221,7 +221,7 @@ void EnColMan_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, this->scale); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 30.0f, 30.0f, 0x1F); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 54eb091b7..9f997cc1e 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -108,7 +108,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnCow* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 72.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 72.0f); switch (EN_COW_TYPE(thisx)) { case EN_COW_TYPE_DEFAULT: @@ -207,7 +207,7 @@ void EnCow_UpdateAnimation(EnCow* this, GlobalContext* globalCtx) { } void EnCow_TalkEnd(EnCow* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { this->actor.flags &= ~0x10000; func_801477B4(globalCtx); this->actionFunc = EnCow_Idle; @@ -215,7 +215,7 @@ void EnCow_TalkEnd(EnCow* this, GlobalContext* globalCtx) { } void EnCow_GiveMilkEnd(EnCow* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actor.flags &= ~0x10000; this->actionFunc = EnCow_Idle; } @@ -226,21 +226,21 @@ void EnCow_GiveMilkWait(EnCow* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = EnCow_GiveMilkEnd; } else { - func_800B8A1C(&this->actor, globalCtx, GI_MILK, 10000.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MILK, 10000.0f, 100.0f); } } void EnCow_GiveMilk(EnCow* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { this->actor.flags &= ~0x10000; func_801477B4(globalCtx); this->actionFunc = EnCow_GiveMilkWait; - func_800B8A1C(&this->actor, globalCtx, GI_MILK, 10000.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MILK, 10000.0f, 100.0f); } } void EnCow_CheckForEmptyBottle(EnCow* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { if (func_80114E90()) { func_80151938(globalCtx, 0x32C9); // Text to give milk. this->actionFunc = EnCow_GiveMilk; @@ -252,7 +252,7 @@ void EnCow_CheckForEmptyBottle(EnCow* this, GlobalContext* globalCtx) { } void EnCow_Talk(EnCow* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->actor.textId == 0x32C8) { // Text to give milk after playing Epona's Song. this->actionFunc = EnCow_CheckForEmptyBottle; } else if (this->actor.textId == 0x32C9) { // Text to give milk. @@ -345,13 +345,13 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx2) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[0].base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[1].base); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime)) { if (this->skelAnime.animation == &D_060001CC) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_COW_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_COW_CRY); Animation_Change(&this->skelAnime, &D_06004264, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004264), ANIMMODE_ONCE, 1.0f); } else { diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index b84feb51a..0e83d1091 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -192,7 +192,7 @@ s32 func_80B3E69C(EnDai* this, GlobalContext* globalCtx) { if ((globalCtx->csCtx.state != 0) && (globalCtx->sceneNum == SCENE_12HAKUGINMAE) && (globalCtx->csCtx.unk_12 == 0) && !(gSaveContext.weekEventReg[30] & 1)) { if (!(this->unk_1CE & 0x10)) { - Actor_SetSwitchFlag(globalCtx, 20); + Flags_SetSwitch(globalCtx, 20); this->unk_1CE |= (0x80 | 0x10); this->unk_1CE &= ~(0x100 | 0x20); this->unk_1CC = 0xFF; @@ -216,7 +216,7 @@ s32 func_80B3E7C8(EnDai* this, GlobalContext* globalCtx) { s32 ret = false; if (this->unk_1CE & 7) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_8013AED4(&this->unk_1CE, 0, 7); this->actionFunc = func_80B3EF90; ret = true; @@ -304,7 +304,7 @@ s32 func_80B3E96C(EnDai* this, GlobalContext* globalCtx) { break; case 1: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SNOWSTORM_HARD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWSTORM_HARD); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_WEATHER_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0x1388, 0x708, 0x3E8, 0); func_80B3E5DC(this, 3); @@ -470,7 +470,7 @@ void func_80B3F044(EnDai* this, GlobalContext* globalCtx) { break; case 2: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROLL_AND_FALL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROLL_AND_FALL); break; case 3: @@ -493,27 +493,27 @@ void func_80B3F044(EnDai* this, GlobalContext* globalCtx) { case 2: if (globalCtx->csCtx.frames == 360) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIGOLON_SLEEP3 - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIGOLON_SLEEP3 - SFX_FLAG); } if (Animation_OnFrame(&this->skelAnime, 43.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_BOUND_1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_1); } this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); break; case 3: if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIGOLON_SLEEP1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIGOLON_SLEEP1); } this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); break; case 4: if (Animation_OnFrame(&this->skelAnime, 30.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIGOLON_SLEEP2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIGOLON_SLEEP2); } if (Animation_OnFrame(&this->skelAnime, 35.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_BOUND_0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_0); } this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); break; @@ -525,7 +525,7 @@ void func_80B3F044(EnDai* this, GlobalContext* globalCtx) { void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) { EnDai* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 0.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060130D0, NULL, this->jointTable, this->morphTable, 19); this->unk_A70 = -1; func_80B3E5DC(this, 0); diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 40eac8099..4971193a3 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -76,7 +76,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { EnDaiku* this = THIS; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.targetMode = 0; Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->unk_278 = ENDAIKU_GET_FF(&this->actor); @@ -195,7 +195,7 @@ void func_809438F8(EnDaiku* this, GlobalContext* globalCtx) { this->actor.textId = sTextIds[this->unk_28C]; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80943BC0(this); return; } @@ -255,7 +255,7 @@ void func_80943BDC(EnDaiku* this, GlobalContext* globalCtx) { } } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80943820(this); } @@ -286,8 +286,8 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_SetHeight(&this->actor, 65.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_SetFocus(&this->actor, 65.0f); + Actor_MoveWithGravity(&this->actor); Math_SmoothStepToS(&this->unk_260, this->unk_266, 1, 0xBB8, 0); Math_SmoothStepToS(&this->unk_25E, this->unk_264, 1, 0xBB8, 0); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index daa159788..6776086cc 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -95,7 +95,7 @@ void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) { s32 day = gSaveContext.day; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17); this->actor.targetMode = 0; Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -158,7 +158,7 @@ s32 func_80BE64C0(EnDaiku2* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&sp30, &this->actor.world.pos); Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); - bomb = (EnBom*)func_800BE0B8(globalCtx, &this->actor, -1, ACTORCAT_EXPLOSIVES, BREG(7) + 240.0f); + bomb = (EnBom*)Actor_FindNearby(globalCtx, &this->actor, -1, ACTORCAT_EXPLOSIVES, BREG(7) + 240.0f); Math_Vec3f_Copy(&this->actor.world.pos, &sp30); if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && !Flags_GetSwitch(globalCtx, this->unk_278) && (bomb != NULL) && (bomb->actor.id == ACTOR_EN_BOM)) { @@ -233,7 +233,7 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) { this->actor.textId = sTextIds[this->unk_28A]; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80BE6B40(this, globalCtx); return; } @@ -245,7 +245,7 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) { func_800B8614(&this->actor, globalCtx, 80.0f); if ((this->unk_276 == 8) && Animation_OnFrame(&this->skelAnime, 6.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROCK_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROCK_BROKEN); for (i = 0; i < 10; i++) { Math_Vec3f_Copy(&sp70, &this->actor.world.pos); @@ -304,7 +304,7 @@ void func_80BE6B40(EnDaiku2* this, GlobalContext* globalCtx) { void func_80BE6BC0(EnDaiku2* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0x0); - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { s32 day = gSaveContext.day - 1; func_801477B4(globalCtx); @@ -342,7 +342,7 @@ void func_80BE6D40(EnDaiku2* this, GlobalContext* globalCtx) { s32 pad[3]; s16 sp3A = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_268); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80BE6BC0; return; } @@ -376,7 +376,7 @@ void func_80BE6EF0(EnDaiku2* this, GlobalContext* globalCtx) { Vec3f sp40; s16 var; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80BE6BC0; return; } @@ -460,8 +460,8 @@ void EnDaiku2_Update(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actionFunc(this, globalCtx); this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_SetHeight(&this->actor, 65.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_SetFocus(&this->actor, 65.0f); + Actor_MoveWithGravity(&this->actor); Math_ApproachF(&this->unk_260, this->unk_264, 0.3f, 2.0f); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 69d2fc9d6..30b749c0d 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -131,7 +131,7 @@ void EnDekunuts_Init(Actor* thisx, GlobalContext* globalCtx) { EnDekunuts* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002468, &D_0600326C, this->jointTable, this->morphTable, 10); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -165,7 +165,7 @@ void func_808BD348(EnDekunuts* this) { this->unk_210 = 1.0f; this->collider.base.colType = COLTYPE_HIT3; this->unk_190 = 80; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_808BD3B4(EnDekunuts* this, GlobalContext* globalCtx) { @@ -173,7 +173,7 @@ void func_808BD3B4(EnDekunuts* this, GlobalContext* globalCtx) { this->unk_18E = 0; this->collider.base.colType = COLTYPE_HIT6; this->unk_210 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_21C, 8, 2, 0.2f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_21C, 8, 2, 0.2f, 0.2f); } } @@ -200,7 +200,7 @@ void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { this->collider.base.acFlags |= AC_ON; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); } this->collider.dim.height = (s32)((CLAMP(this->skelAnime.curFrame, 9.0f, 12.0f) - 9.0f) * 9.0f) + 5; @@ -333,7 +333,7 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) { if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_NUTSBALL, pos.x, pos.y, pos.z, this->actor.world.rot.x, this->actor.shape.rot.y, 0, params) != NULL) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_THROW); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_THROW); } } else if ((this->unk_190 >= 2) && Animation_OnFrame(&this->skelAnime, 12.0f)) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000168, -3.0f); @@ -346,7 +346,7 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) { void func_808BDC9C(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f); this->unk_190 = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->actionFunc = func_808BDD54; } @@ -354,7 +354,7 @@ void func_808BDCF0(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f); this->collider.base.acFlags &= ~AC_ON; this->unk_190 = 80; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->actionFunc = func_808BDD54; } @@ -382,7 +382,7 @@ void func_808BDE7C(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002DD4, -3.0f); this->collider.dim.height = 37; this->actor.colChkInfo.mass = 50; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->actor.world.rot.x = 0; this->actor.flags |= 0x20; this->collider.base.acFlags &= ~AC_ON; @@ -418,7 +418,7 @@ void func_808BDFB8(EnDekunuts* this, GlobalContext* globalCtx) { } if (this->unk_18C != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); this->unk_18C = 0; } else { this->unk_18C = 1; @@ -490,9 +490,9 @@ void func_808BE294(EnDekunuts* this, s32 arg1) { this->actor.world.rot.x = 0; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_808BE358; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_CUTBODY); - func_800BCB70(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&D_0600259C)); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CUTBODY); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&D_0600259C)); } void func_808BE358(EnDekunuts* this, GlobalContext* globalCtx) { @@ -534,7 +534,7 @@ void func_808BE484(EnDekunuts* this) { Animation_PlayOnce(&this->skelAnime, &D_06002BD4); this->actionFunc = func_808BE4D4; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD); } void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx) { @@ -578,7 +578,7 @@ void func_808BE6C4(EnDekunuts* this, GlobalContext* globalCtx) { void func_808BE73C(EnDekunuts* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if ((this->unk_18E != 10) || !(this->collider.info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) { func_808BD3B4(this, globalCtx); if ((this->actor.colChkInfo.mass == 50) || (this->actor.params != ENDEKUNUTS_GET_FF00_0)) { @@ -603,8 +603,8 @@ void func_808BE73C(EnDekunuts* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_190 = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_808BE3A8(this); return; } @@ -651,7 +651,7 @@ void EnDekunuts_Update(Actor* thisx, GlobalContext* globalCtx) { func_808BE73C(this, globalCtx); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 0x1D); Collider_UpdateCylinder(&this->actor, &this->collider); @@ -747,7 +747,7 @@ void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.colorFilterTimer != 0) { func_800AE5A0(globalCtx); } - func_800BDFC0(globalCtx, D_06001E50); + Gfx_DrawDListOpa(globalCtx, D_06001E50); func_800BE680(globalCtx, &this->actor, this->unk_21C, 8, this->unk_214, this->unk_218, this->unk_210, this->unk_18E); } diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index 2c5a330ab..907344cf5 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -302,37 +302,37 @@ void func_80989864(EnDg* this, GlobalContext* globalCtx) { sp38.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x; sp38.y = this->actor.world.pos.y; sp38.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z; - func_800BBDAC(globalCtx, &this->actor, &sp38, 10.0f, 0, 2.0f, 300, 0, 1); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &sp38, 10.0f, 0, 2.0f, 300, 0, 1); } } void func_80989974(EnDg* this) { if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); } } void func_809899C8(EnDg* this, f32 arg1) { if (Animation_OnFrame(&this->skelAnime, arg1)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); } } void func_80989A08(EnDg* this, f32 arg1) { if (Animation_OnFrame(&this->skelAnime, arg1)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); } } void func_80989A48(EnDg* this) { if (Animation_OnFrame(&this->skelAnime, 23.0f) || Animation_OnFrame(&this->skelAnime, 28.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_WHINE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_WHINE); } } void func_80989A9C(EnDg* this, f32 arg1) { if (Animation_OnFrame(&this->skelAnime, arg1)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); } } @@ -402,7 +402,7 @@ void func_80989E18(EnDg* this, GlobalContext* globalCtx) { } if (Actor_HasParent(&this->actor, globalCtx)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); this->unk_290 = 1; D_8098C2FC = D_8098C2A8[this->unk_286]; if (D_8098C2A0 == 0) { @@ -422,12 +422,12 @@ void func_80989E18(EnDg* this, GlobalContext* globalCtx) { this->actionFunc = func_8098BA64; } } else { - func_800B8BB0(&this->actor, globalCtx); + Actor_LiftActor(&this->actor, globalCtx); } } s32 func_80989FC8(GlobalContext* globalCtx) { - EnDg* enemy = (EnDg*)globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first; + EnDg* enemy = (EnDg*)globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first; f32 minDist = 9999.0f; f32 dist; @@ -470,7 +470,7 @@ void func_8098A064(EnDg* this, GlobalContext* globalCtx) { } else if ((this->actionFunc == func_8098B004) || (this->actionFunc == func_8098AB48)) { if (DECR(this->unk_292) == 0) { this->unk_292 = 10; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); } } } @@ -567,7 +567,7 @@ void func_8098A468(EnDg* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actor.gravity = -3.0f; func_80989674(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (player->transformation == PLAYER_FORM_HUMAN) { func_80989E18(this, globalCtx); } @@ -619,7 +619,7 @@ void func_8098A618(EnDg* this, GlobalContext* globalCtx) { } this->actor.world.rot.y = this->actor.shape.rot.y; Math_ApproachF(&this->actor.speedXZ, -1.5f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } func_80989974(this); @@ -655,12 +655,12 @@ void func_8098A70C(EnDg* this, GlobalContext* globalCtx) { this->actor.speedXZ = 7.0f; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80989974(this); if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_CRY); } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); } } @@ -707,7 +707,7 @@ void func_8098A938(EnDg* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80989974(this); func_80989A08(this, 5.0f); } @@ -715,7 +715,7 @@ void func_8098A938(EnDg* this, GlobalContext* globalCtx) { void func_8098AAAC(EnDg* this, GlobalContext* globalCtx) { this->unk_280 &= ~8; Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.1f, 0.5f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (DECR(this->unk_28E) == 0) { this->unk_28E = 20; this->actionFunc = func_8098A938; @@ -790,7 +790,7 @@ void func_8098AC34(EnDg* this, GlobalContext* globalCtx) { if (sp26 >= 0x18) { func_80989864(this, globalCtx); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } func_80989A9C(this, 10.0f); @@ -808,7 +808,7 @@ void func_8098AE58(EnDg* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); this->actor.world.rot.y = this->actor.shape.rot.y; Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } func_80989974(this); @@ -818,7 +818,7 @@ void func_8098AE58(EnDg* this, GlobalContext* globalCtx) { void func_8098AF44(EnDg* this, GlobalContext* globalCtx) { if (func_801A46F8() == 1) { this->unk_292 = 10; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_BARK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_BARK); this->actionFunc = func_8098B004; } } @@ -829,7 +829,7 @@ void func_8098AF98(EnDg* this, GlobalContext* globalCtx) { this->actionFunc = func_8098A468; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_809899C8(this, 3.0f); } @@ -859,7 +859,7 @@ void func_8098B004(EnDg* this, GlobalContext* globalCtx) { } func_8098A064(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80989974(this); if (!(this->unk_280 & 0x20)) { func_809899C8(this, 3.0f); @@ -881,7 +881,7 @@ void func_8098B198(EnDg* this, GlobalContext* globalCtx) { this->actor.world.rot.y = this->actor.shape.rot.y; Math_ApproachF(&this->actor.speedXZ, -1.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80989974(this); func_80989A9C(this, 4.0f); } @@ -901,11 +901,11 @@ void func_8098B28C(EnDg* this, GlobalContext* globalCtx) { this->actor.world.rot.y = this->actor.shape.rot.y; Math_ApproachF(&this->actor.speedXZ, -2.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } func_80989974(this); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); } void func_8098B390(EnDg* this, GlobalContext* globalCtx) { @@ -936,12 +936,12 @@ void func_8098B464(EnDg* this, GlobalContext* globalCtx) { this->actor.gravity = 0.0f; this->actor.velocity.y = -3.0f; this->unk_284 = 10; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_DROP_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER); this->actionFunc = func_8098B560; } Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_8098B560(EnDg* this, GlobalContext* globalCtx) { @@ -963,7 +963,7 @@ void func_8098B560(EnDg* this, GlobalContext* globalCtx) { if (DECR(this->unk_284) == 0) { if (!(this->unk_280 & 4)) { this->unk_280 |= 4; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); } this->unk_284 = 5; EffectSsGRipple_Spawn(globalCtx, &sp54, 100, 500, 30); @@ -999,7 +999,7 @@ void func_8098B560(EnDg* this, GlobalContext* globalCtx) { this->unk_280 &= ~4; this->unk_28C = 8; this->unk_282 = Rand_S16Offset(60, 60); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); func_80989140(&this->skelAnime, sAnimations, 2); Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); this->actionFunc = func_8098A468; @@ -1008,7 +1008,7 @@ void func_8098B560(EnDg* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.world.rot.y, sp46, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_8098B88C(EnDg* this, GlobalContext* globalCtx) { @@ -1040,7 +1040,7 @@ void func_8098B88C(EnDg* this, GlobalContext* globalCtx) { this->actor.velocity.y = 10.0f; this->actor.gravity = -3.0f; this->unk_282 = Rand_S16Offset(60, 60); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); func_80989140(&this->skelAnime, sAnimations, 2); this->actionFunc = func_8098A468; Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.2f, 1.0f); @@ -1048,7 +1048,7 @@ void func_8098B88C(EnDg* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_8098BA64(EnDg* this, GlobalContext* globalCtx) { @@ -1063,7 +1063,7 @@ void func_8098BA64(EnDg* this, GlobalContext* globalCtx) { this->unk_288 = -1; D_8098C2FC.unk_02 = this->unk_288; this->unk_28A = 100; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); this->unk_280 |= 0x10; this->actionFunc = func_8098BB10; } @@ -1075,7 +1075,7 @@ void func_8098BB10(EnDg* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { if (this->unk_280 & 0x10) { this->unk_280 &= ~0x10; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); } this->actor.speedXZ = 0.0f; @@ -1091,11 +1091,11 @@ void func_8098BB10(EnDg* this, GlobalContext* globalCtx) { this->actionFunc = func_8098A468; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_8098BBEC(EnDg* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_80989D38(this, globalCtx); this->actionFunc = func_8098BC54; @@ -1105,7 +1105,7 @@ void func_8098BBEC(EnDg* this, GlobalContext* globalCtx) { } void func_8098BC54(EnDg* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 2) { + if (Message_GetState(&globalCtx->msgCtx) == 2) { func_80989140(&this->skelAnime, sAnimations, 0); this->actionFunc = func_8098BA64; } @@ -1115,7 +1115,7 @@ void EnDg_Init(Actor* thisx, GlobalContext* globalCtx) { EnDg* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, NULL, this->jointTable, this->morphTable, 13); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c index f82295874..7c7b2811c 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -287,7 +287,7 @@ void EnDinofos_Init(Actor* thisx, GlobalContext* globalCtx) { ColliderJntSphElementDim* dim; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B42F8, 90.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f); Effect_Add(globalCtx, &this->unk_2A0, EFFECT_BLURE2, 0, 0, &D_8089E368); Collider_InitAndSetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphElement); @@ -353,7 +353,7 @@ s32 func_8089A968(EnDinofos* this) { void func_8089A9B0(EnDinofos* this, GlobalContext* globalCtx) { if (func_8089A968(this)) { if (this->actor.xzDistToPlayer < 100.0f) { - if (!func_800BC5EC(globalCtx, &this->actor) && + if (!Actor_OtherIsTargeted(globalCtx, &this->actor) && (((this->actionFunc != func_8089C56C) && (Rand_ZeroOne() > 0.35f)) || ((this->actionFunc == func_8089C56C) && (Rand_ZeroOne() > 0.8f)))) { func_8089C4F8(this); @@ -400,7 +400,7 @@ void func_8089AC70(EnDinofos* this) { this->unk_2B0 = 1.0f; this->unk_290 = 80; this->actor.flags &= ~0x400; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_8089ACEC(EnDinofos* this, GlobalContext* globalCtx) { @@ -408,7 +408,7 @@ void func_8089ACEC(EnDinofos* this, GlobalContext* globalCtx) { this->unk_28A = 0; this->colliderJntSph.base.colType = COLTYPE_HIT0; this->unk_2B0 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_2D4, 12, 2, 0.3f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2D4, 12, 2, 0.3f, 0.2f); this->actor.flags |= 0x400; } } @@ -436,7 +436,7 @@ s32 func_8089AE00(EnDinofos* this, GlobalContext* globalCtx) { temp_v1 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; if (ABS_ALT(temp_v1) < 0x3000) { func_8089D11C(this, temp_v1 + this->unk_28E); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WARAU); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); return true; } } @@ -446,7 +446,7 @@ s32 func_8089AE00(EnDinofos* this, GlobalContext* globalCtx) { temp_v1_2 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E; if (ABS_ALT(temp_v1_2) < 0x3000) { func_8089C024(this, 1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WARAU); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); return true; } } @@ -457,13 +457,13 @@ s32 func_8089AE00(EnDinofos* this, GlobalContext* globalCtx) { } if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0) && this->actor.isTargeted && - (Rand_ZeroOne() < 0.5f) && func_8089A968(this) && Actor_IsLinkFacingActor(&this->actor, 0x2000, globalCtx)) { + (Rand_ZeroOne() < 0.5f) && func_8089A968(this) && Player_IsFacingActor(&this->actor, 0x2000, globalCtx)) { if (Rand_ZeroOne() < 0.5f) { func_8089C024(this, 2); } else { func_8089C024(this, 3); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WARAU); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU); return true; } @@ -485,7 +485,7 @@ void func_8089B100(EnDinofos* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_06001CCC, 1.0f, Animation_GetLastFrame(&D_06001CCC), Animation_GetLastFrame(&D_06001CCC), 2, 0.0f); - func_800BE33C(&camera->eye, &camera->at, &this->unk_29A, 1); + func_800BE33C(&camera->eye, &camera->at, &this->unk_29A, true); Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &sp3C); this->unk_2BC.x = player->actor.world.pos.x + (0.4f * sp3C.x); this->unk_2BC.y = player->actor.world.pos.y + 5.0f; @@ -513,7 +513,7 @@ void func_8089B288(EnDinofos* this, GlobalContext* globalCtx) { void func_8089B320(EnDinofos* this) { this->actor.gravity = -2.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_CRY); this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y - 0x0E00) * 86.0f) + this->actor.world.pos.x; this->unk_2BC.y = this->actor.floorHeight + 6.0f; this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y - 0x0E00) * 86.0f) + this->actor.world.pos.z; @@ -553,7 +553,7 @@ void func_8089B4A4(EnDinofos* this) { this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.x; this->unk_2BC.y = this->actor.floorHeight + 11.0f; this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.z; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); this->unk_290 = 0; this->unk_292 = -1; this->actionFunc = func_8089B580; @@ -595,7 +595,7 @@ void func_8089B6E8(EnDinofos* this) { void func_8089B72C(EnDinofos* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_ATTACK); } if (SkelAnime_Update(&this->skelAnime)) { @@ -636,7 +636,7 @@ void func_8089B8B0(EnDinofos* this, GlobalContext* globalCtx) { if (this->actionFunc != func_8089B98C) { Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f); - if (func_800BC5EC(globalCtx, &this->actor)) { + if (Actor_OtherIsTargeted(globalCtx, &this->actor)) { phi_f0 = 170.0f; } else { phi_f0 = 70.0f; @@ -658,7 +658,7 @@ void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (!func_8089AE00(this, globalCtx)) { - if (func_800BC5EC(globalCtx, &this->actor)) { + if (Actor_OtherIsTargeted(globalCtx, &this->actor)) { phi_f0 = 170.0f; } else { phi_f0 = 70.0f; @@ -683,7 +683,7 @@ void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } } } @@ -782,7 +782,7 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) { } this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000); - if (func_800BC5EC(globalCtx, &this->actor)) { + if (Actor_OtherIsTargeted(globalCtx, &this->actor)) { sp2C = 100.0f; } @@ -804,7 +804,7 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } } } @@ -853,7 +853,7 @@ void func_8089C164(EnDinofos* this) { } this->actor.bgCheckFlags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_JUMP); this->actionFunc = func_8089C1F8; } @@ -868,7 +868,7 @@ void func_8089C244(EnDinofos* this) { this->actor.bgCheckFlags &= ~1; this->actor.speedXZ = 8.0f; this->actor.velocity.y = 16.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_JUMP); this->unk_290 = 0; this->unk_292 = -1; this->actionFunc = func_8089C2A8; @@ -905,7 +905,7 @@ void func_8089C398(EnDinofos* this) { this->actor.speedXZ = 0.0f; func_8089AD70(this); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); this->actionFunc = func_8089C44C; } @@ -923,7 +923,7 @@ void func_8089C44C(EnDinofos* this, GlobalContext* globalCtx) { void func_8089C4F8(EnDinofos* this) { Animation_PlayOnce(&this->skelAnime, &D_060025B4); this->colliderQuad.base.atFlags &= ~AT_BOUNCED; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_CRY); this->unk_290 = 0; this->unk_292 = -1; this->actor.speedXZ = 0.0f; @@ -945,7 +945,7 @@ void func_8089C56C(EnDinofos* this, GlobalContext* globalCtx) { } else if (Animation_OnFrame(&this->skelAnime, 13.0f)) { this->colliderQuad.base.atFlags &= ~AT_ON; } else if (Animation_OnFrame(&this->skelAnime, 11.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_ATTACK); } else if (this->skelAnime.curFrame < 7.0f) { func_8089AE00(this, globalCtx); } @@ -1010,9 +1010,9 @@ void func_8089C87C(EnDinofos* this, s32 arg1) { this->actor.velocity.y = 0.0f; } this->unk_28E = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_DAMAGE); this->colliderJntSph.base.acFlags &= ~AC_ON; - func_800BCB70(&this->actor, 0x4000, 255, 0, 18); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 18); this->actionFunc = func_8089C938; } @@ -1145,7 +1145,7 @@ void func_8089CF70(EnDinofos* this, GlobalContext* globalCtx) { void func_8089CFAC(EnDinofos* this) { Animation_PlayOnce(&this->skelAnime, &D_0600ABD0); this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_DEAD); this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8089D018; @@ -1173,7 +1173,7 @@ void func_8089D018(EnDinofos* this, GlobalContext* globalCtx) { this->actor.shape.shadowAlpha = this->unk_288; } else if (Animation_OnFrame(&this->skelAnime, 26.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } } @@ -1206,7 +1206,7 @@ void func_8089D1E0(EnDinofos* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } } @@ -1263,7 +1263,7 @@ s32 func_8089D60C(EnDinofos* this, GlobalContext* globalCtx) { if (this->colliderJntSph.base.acFlags & AC_HIT) { this->colliderJntSph.base.acFlags &= ~AC_HIT; - func_800BE2B8(&this->actor, &this->colliderJntSph); + Actor_SetDropFlagJntSph(&this->actor, &this->colliderJntSph); for (i = 0; i < ARRAY_COUNT(this->colliderJntSphElement); i++) { if (this->colliderJntSph.elements[i].info.bumperFlags & BUMP_HIT) { @@ -1317,19 +1317,19 @@ s32 func_8089D60C(EnDinofos* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_290 = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_8089C784(this); return true; } if (this->actor.colChkInfo.damageEffect == 5) { this->unk_290 = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); this->unk_2B4 = 0.55f; this->unk_2B0 = 2.0f; this->unk_28A = 31; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_8089C784(this); return true; } @@ -1369,7 +1369,7 @@ void EnDinofos_Update(Actor* thisx, GlobalContext* globalCtx2) { } this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, 30.0f, 60.0f, 0x5D); if (this->actionFunc != func_8089C7B8) { if ((this->actor.depthInWater > 0.0f) && (this->actor.depthInWater < 10.0f)) { diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 8a6c3a583..2dcf85e3d 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -265,7 +265,7 @@ void EnDnk_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); SkelAnime_Update(&this->skelAnime); func_80A515C4(this); - Actor_SetHeight(&this->actor, 34.0f); + Actor_SetFocus(&this->actor, 34.0f); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -436,11 +436,11 @@ void func_80A52074(EnDnk* this, GlobalContext* globalCtx) { break; case 438: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKNUTS_DANCE_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKNUTS_DANCE_BIG); break; case 493: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); break; } diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index 6b03849ae..2a352380c 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -137,8 +137,8 @@ void func_80A714B4(EnDno* this, GlobalContext* globalCtx) { do { actor = SubS_FindActor(globalCtx, actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG); if (actor != NULL) { - if ((s32)ENDNO_GET_F(actor) == ENDNO_GET_F_1) { - Actor_SetSwitchFlag(globalCtx, ENDNO_GET_7F0(actor)); + if (ENDNO_GET_F(actor) == ENDNO_GET_F_1) { + Flags_SetSwitch(globalCtx, ENDNO_GET_7F0(actor)); } actor = actor->next; } @@ -189,7 +189,7 @@ void func_80A71788(EnDno* this, GlobalContext* globalCtx) { do { actor = SubS_FindActor(globalCtx, actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG); if (actor != NULL) { - Actor_UnsetSwitchFlag(globalCtx, ENDNO_GET_7F0(actor)); + Flags_UnsetSwitch(globalCtx, ENDNO_GET_7F0(actor)); actor = actor->next; } } while (actor != NULL); @@ -212,7 +212,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) { if (actor == NULL) { Actor_ProcessInitChain(thisx, sInitChain); - ActorShape_Init(&thisx->shape, 0.0f, func_800B3FC0, 21.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 21.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E1F8, &D_06007CA4, this->jointTable, this->morphTable, 28); Collider_InitCylinder(globalCtx, &this->collider); @@ -339,7 +339,7 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x222); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { globalCtx->msgCtx.unk11F22 = 0; globalCtx->msgCtx.unk11F10 = 0; func_80A71E54(this, globalCtx); @@ -374,7 +374,7 @@ void func_80A71E54(EnDno* this, GlobalContext* globalCtx) { void func_80A71F18(EnDno* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->unk_466, 0, 0x16C); - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: if (!(this->unk_3B0 & 0x10) || Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xE38)) { @@ -528,7 +528,7 @@ void func_80A724B8(EnDno* this, GlobalContext* globalCtx) { func_80A71424(&this->unk_466, 0, this->actor.yawTowardsPlayer, this->actor.home.rot.y, 0x2000, 0x2D8); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80A725E0(this, globalCtx); } else if (this->actor.xzDistToPlayer < 60.0f) { func_800B8614(&this->actor, globalCtx, 60.0f); @@ -536,11 +536,11 @@ void func_80A724B8(EnDno* this, GlobalContext* globalCtx) { } void func_80A7256C(EnDno* this, GlobalContext* globalCtx) { - func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, -1); + func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, EXCH_ITEM_MINUS1); } void func_80A72598(EnDno* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80A725E0(this, globalCtx); } else { func_80A7256C(this, globalCtx); @@ -555,7 +555,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { s32 pad[2]; func_80A71424(&this->unk_466, 0, 0, 0, 0x2000, 0x16C); - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: switch (this->unk_328) { case 0: @@ -597,7 +597,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame <= 23.0f) { this->unk_452 = 3; if (Animation_OnFrame(&this->skelAnime, 23.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_OPEN_AMBRELLA); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OPEN_AMBRELLA); } } else if (this->skelAnime.curFrame <= 24.0f) { this->unk_452 = 4; @@ -633,7 +633,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) { } else { this->unk_458 = GI_MASK_SCENTS; } - func_800B8A1C(&this->actor, globalCtx, this->unk_458, 60.0f, 60.0f); + Actor_PickUp(&this->actor, globalCtx, this->unk_458, 60.0f, 60.0f); func_801477B4(globalCtx); func_80A72B84(this, globalCtx); } @@ -697,7 +697,7 @@ void func_80A72BA4(EnDno* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = func_80A72598; } else { - func_800B8A1C(&this->actor, globalCtx, this->unk_458, 60.0f, 60.0f); + Actor_PickUp(&this->actor, globalCtx, this->unk_458, 60.0f, 60.0f); } } @@ -709,9 +709,11 @@ void func_80A72C04(EnDno* this, GlobalContext* globalCtx) { func_8013DCE0(globalCtx, &this->unk_334, &this->actor, &this->unk_340, globalCtx->setupPathList, ENDNO_GET_7F(&this->actor), 1, 0, 1, 0); func_8013DF3C(globalCtx, &this->unk_340); + this->actor.world.rot.y = this->unk_340.unk_54.y; this->actor.world.rot.x = this->unk_340.unk_54.x; - Actor_SetSwitchFlag(globalCtx, ENDNO_GET_3F80(&this->actor)); + + Flags_SetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor)); this->actionFunc = func_80A730A0; } @@ -831,7 +833,7 @@ void func_80A73244(EnDno* this, GlobalContext* globalCtx) { this->actor.flags |= (8 | 1); this->unk_328 = 2; this->actor.speedXZ = 0.0f; - Actor_UnsetSwitchFlag(globalCtx, ENDNO_GET_3F80(&this->actor)); + Flags_UnsetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor)); gSaveContext.unk_3DD0[1] = 5; this->unk_44E = 0; this->actionFunc = func_80A732C8; @@ -856,14 +858,14 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOSE_AMBRELLA); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOSE_AMBRELLA); this->unk_452 = 4; } else if (Animation_OnFrame(&this->skelAnime, 5.0f)) { this->unk_452 = 3; } } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80A73408(EnDno* this, GlobalContext* globalCtx) { @@ -914,7 +916,7 @@ void EnDno_Update(Actor* thisx, GlobalContext* globalCtx) { } Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - Actor_SetHeight(&this->actor, 51.0f); + Actor_SetFocus(&this->actor, 51.0f); } void EnDno_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index f3753c978..98884c114 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -104,37 +104,37 @@ s32 func_80B3CA20(EnDnp* this) { if ((this->unk_340 == 2) || (this->unk_340 == 9)) { if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_TURN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_TURN); } } else if ((this->unk_340 == 24) || (this->unk_340 == 7)) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_TURN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_TURN); } } else if (this->unk_340 == 14) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET); } if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET2); } } else if (this->unk_340 == 8) { if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET); } if (Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_GREET2); } } else if ((this->unk_340 == 17) && (this->unk_340 == 18)) { if (Animation_OnFrame(&this->skelAnime, 7.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); } } else if (this->unk_340 == 21) { if (Animation_OnFrame(&this->skelAnime, 17.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); } } else if (this->unk_340 == 23) { if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKUHIME_WALK); } } @@ -212,7 +212,7 @@ s32 func_80B3CEC0(EnDnp* this, GlobalContext* globalCtx) { s32 func_80B3CF60(EnDnp* this, GlobalContext* globalCtx) { s32 ret = false; - if ((this->unk_322 & 7) && func_800B84D0(&this->actor, globalCtx)) { + if ((this->unk_322 & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_8013AED4(&this->unk_322, 0, 7); this->unk_322 |= 8; this->actionFunc = func_80B3D3F8; @@ -276,7 +276,7 @@ void func_80B3D11C(EnDnp* this, GlobalContext* globalCtx) { } if (this->unk_340 == 19) { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_DHVO04); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_DHVO04); } if (this->unk_340 == 24) { @@ -307,15 +307,15 @@ void func_80B3D2D4(EnDnp* this, GlobalContext* globalCtx) { void func_80B3D338(EnDnp* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if ((this->unk_32E != 0) && (func_80152498(&globalCtx->msgCtx) == 2)) { + if ((this->unk_32E != 0) && (Message_GetState(&globalCtx->msgCtx) == 2)) { Actor_MarkForDeath(&this->actor); } else if (this->unk_32E == 0) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_32E = 1; } else { this->actor.textId = 0x971; player->actor.textId = this->actor.textId; - func_800B8500(&this->actor, globalCtx, 9999.9f, 9999.9f, -1); + func_800B8500(&this->actor, globalCtx, 9999.9f, 9999.9f, EXCH_ITEM_MINUS1); } } } @@ -357,7 +357,7 @@ void func_80B3D558(EnDnp* this, GlobalContext* globalCtx) { void EnDnp_Init(Actor* thisx, GlobalContext* globalCtx) { EnDnp* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 16.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 16.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D60, NULL, this->jointTable, this->morphTable, 26); this->unk_340 = -1; func_80B3CC38(this, 15); @@ -413,15 +413,15 @@ void EnDnp_Update(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); func_80B3CD1C(this); func_80B3CEC0(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); sp2C = this->collider.dim.radius + 50; sp28 = this->collider.dim.height + 30; if ((this->unk_322 & 0x400) && !(gSaveContext.weekEventReg[23] & 0x20)) { - func_800B8A1C(&this->actor, globalCtx, GI_MAX, sp2C, sp28); + Actor_PickUp(&this->actor, globalCtx, GI_MAX, sp2C, sp28); } func_8013C964(&this->actor, globalCtx, sp2C, sp28, 0, this->unk_322 & 7); - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); func_80B3CC80(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index a52d7fa11..f1e500e0f 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -324,7 +324,7 @@ s32* func_80A52CF8(EnDnq* this, GlobalContext* globalCtx) { s32 func_80A52D44(EnDnq* this, GlobalContext* globalCtx) { s32 ret = false; - if ((this->unk_37C & 7) && func_800B84D0(&this->actor, globalCtx)) { + if ((this->unk_37C & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_8013AED4(&this->unk_37C, 0, 7); this->unk_380 = func_80A52CF8(this, globalCtx); this->actionFunc = func_80A52FB8; @@ -347,7 +347,7 @@ void func_80A52DC8(EnDnq* this, GlobalContext* globalCtx) { if (!(gSaveContext.weekEventReg[23] & 0x20)) { this->unk_390 = 70.0f; if (func_80114F2C(ITEM_DEKU_PRINCESS) && !func_801690CC(globalCtx) && - (func_80152498(&globalCtx->msgCtx) == 0) && (ActorCutscene_GetCurrentIndex() == -1)) { + (Message_GetState(&globalCtx->msgCtx) == 0) && (ActorCutscene_GetCurrentIndex() == -1)) { if ((DECR(this->unk_384) == 0) && (gSaveContext.weekEventReg[29] & 0x40)) { func_801518B0(globalCtx, 0x969, NULL); this->unk_384 = 200; @@ -404,7 +404,7 @@ void func_80A53038(EnDnq* this, GlobalContext* globalCtx) { } if ((this->unk_398 == 4) && Animation_OnFrame(&this->skelAnime, 2.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KINGNUTS_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KINGNUTS_DAMAGE); } if (((this->unk_398 == 3) || (this->unk_398 == 6)) && @@ -461,7 +461,7 @@ void EnDnq_Update(Actor* thisx, GlobalContext* globalCtx) { func_8013C964(&this->actor, globalCtx, this->unk_390, fabsf(this->actor.playerHeightRel) + 1.0f, 0, this->unk_37C & 7); this->actor.xzDistToPlayer = this->unk_394; - Actor_SetHeight(&this->actor, 46.0f); + Actor_SetFocus(&this->actor, 46.0f); func_80A52604(this, globalCtx); } } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 97db5bcb6..b6e75ef3c 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -85,7 +85,7 @@ void func_8092C5C0(EnDns* this) { if (((this->unk_2F8 == 2) || (this->unk_2F8 == 3) || (this->unk_2F8 == 6) || (this->unk_2F8 == 7)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 3.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); } } @@ -220,7 +220,7 @@ s32 func_8092CAD0(EnDns* this, GlobalContext* globalCtx) { s32 ret = false; if (this->unk_2C6 & 7) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_8013AED4(&this->unk_2C6, 0, 7); this->unk_2C6 &= ~0x10; if (ENDNS_GET_4000(&this->actor)) { @@ -292,7 +292,7 @@ s32 func_8092CCEC(EnDns* this, GlobalContext* globalCtx) { this->unk_2D8 = (Rand_ZeroOne() * 182.0f) + 182.0f; this->unk_2D8 = (sp2E > 0) ? this->unk_2D8 : -this->unk_2D8; this->unk_2D0 = 0x28; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; return 1; } @@ -308,7 +308,7 @@ s32 func_8092CE38(EnDns* this) { this->unk_2C6 &= ~0x200; this->skelAnime.curFrame = 0.0f; if (this->unk_2D2 == 2) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_JUMP); } this->unk_2D2++; if (this->unk_2D2 >= 3) { @@ -321,7 +321,7 @@ s32 func_8092CE38(EnDns* this) { this->actor.world.rot.y = BINANG_ROT180(this->actor.world.rot.y); this->unk_2E4 = 0.0f; this->actor.shape.rot.y = this->actor.world.rot.y; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_JUMP); } else if (this->skelAnime.curFrame < 13.0f) { frame = this->skelAnime.curFrame; this->actor.shape.rot.y = this->actor.world.rot.y; @@ -332,7 +332,7 @@ s32 func_8092CE38(EnDns* this) { } else { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); } if (this->skelAnime.curFrame > 7.0f) { @@ -426,7 +426,7 @@ void func_8092D330(EnDns* this, GlobalContext* globalCtx) { sp30.x = Math_SinS(this->unk_2D4) * this->unk_2EC; sp30.z = Math_CosS(this->unk_2D4) * this->unk_2EC; Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 3, 0x2AA8); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } if ((this->unk_2C6 & 0x100) && (DECR(this->unk_2D0) == 0)) { this->unk_2C6 &= ~0x100; @@ -538,7 +538,7 @@ void EnDns_Update(Actor* thisx, GlobalContext* globalCtx) { func_8092C86C(this, globalCtx); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); func_8013C964(&this->actor, globalCtx, 80.0f, 40.0f, 0, this->unk_2C6 & 7); - Actor_SetHeight(&this->actor, 34.0f); + Actor_SetFocus(&this->actor, 34.0f); func_8092C6FC(this, globalCtx); func_8092C5C0(this); } diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index fe92a5b1f..bf7955ec7 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -303,7 +303,7 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_330.g = 10; this->unk_330.a = 200; Math_Vec3f_Copy(&this->unk_314, &D_801C5DB0); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 48.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 48.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); Collider_InitAndSetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit2, this->collider2Elements); @@ -429,7 +429,7 @@ void func_80876CAC(EnDodongo* this) { this->unk_33C = 1.0f; this->timer = 80; this->actor.flags &= ~0x400; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 80); } void func_80876D28(EnDodongo* this, GlobalContext* globalCtx) { @@ -439,7 +439,8 @@ void func_80876D28(EnDodongo* this, GlobalContext* globalCtx) { this->unk_300 = 0; this->collider1.base.colType = COLTYPE_HIT0; this->unk_33C = 0.0f; - func_800BF7CC(globalCtx, &this->actor, &this->unk_348[0], 9, 2, this->unk_334 * 0.3f, this->unk_334 * 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, &this->unk_348[0], 9, 2, this->unk_334 * 0.3f, + this->unk_334 * 0.2f); this->actor.flags |= 0x400; } } @@ -522,13 +523,13 @@ s32 func_8087721C(EnDodongo* this) { s32 func_80877278(EnDodongo* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; Vec3f sp44; // Bugfix from OoT while (explosive != NULL) { if (!explosive->params && (explosive->parent == NULL) && (explosive->update != NULL) && - (explosive != player->unk_388) && + (explosive != player->interactRangeActor) && (((explosive->id == ACTOR_EN_BOM) && (((EnBom*)explosive)->timer > 0)) || ((explosive->id == ACTOR_EN_BOMBF) && (((EnBombf*)explosive)->timer > 0)))) { Math_Vec3f_Diff(&explosive->world.pos, &this->unk_308, &sp44); @@ -577,13 +578,13 @@ void func_80877500(EnDodongo* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 19.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_WALK); sp30.x = this->collider1Elements[2].dim.worldSphere.center.x; sp30.y = this->collider1Elements[2].dim.worldSphere.center.y; sp30.z = this->collider1Elements[2].dim.worldSphere.center.z; func_80876930(this, globalCtx, &sp30); } else if (Animation_OnFrame(&this->skelAnime, 39.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_WALK); sp30.x = this->collider1Elements[1].dim.worldSphere.center.x; sp30.y = this->collider1Elements[1].dim.worldSphere.center.y; sp30.z = this->collider1Elements[1].dim.worldSphere.center.z; @@ -649,7 +650,7 @@ void func_8087784C(EnDodongo* this, GlobalContext* globalCtx) { f32 temp_f12; if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_CRY); } if (func_8087721C(this)) { @@ -713,7 +714,7 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) { Vec3f sp84; Vec3f sp78; s16 i; - Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; Vec3f sp64; s32 pad; s16 sp5E; @@ -736,7 +737,7 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 28.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_EAT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_EAT); if (this->actor.child != NULL) { Actor_MarkForDeath(this->actor.child); this->actor.child = NULL; @@ -759,14 +760,14 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) { this->unk_334 * 10.0f, 10); } - Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); if (this->actor.colChkInfo.health <= 4) { this->actor.colChkInfo.health = 0; Enemy_StartFinishingBlow(globalCtx, &this->actor); } else { this->actor.colChkInfo.health -= 4; } - func_800BCB70(&this->actor, 0x4000, 0x78, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0x78, 0, 8); } } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { this->timer--; @@ -818,7 +819,7 @@ void func_80878354(EnDodongo* this) { sp18 = &D_06003B14; } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_TAIL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_TAIL); Animation_PlayOnceSetSpeed(&this->skelAnime, sp18, 2.0f); this->timer = 0; this->collider1.base.atFlags |= AT_ON; @@ -879,11 +880,11 @@ void func_808785B0(EnDodongo* this, GlobalContext* globalCtx) { void func_8087864C(EnDodongo* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06001A44, -4.0f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DAMAGE); this->timer = 0; this->unk_304 = 0; this->actor.speedXZ = 0.0f; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->actionFunc = func_808786C8; } @@ -901,10 +902,10 @@ void func_80878724(EnDodongo* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060013C4, -8.0f); this->timer = 0; this->unk_304 = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DEAD); this->actor.flags &= ~1; this->actor.speedXZ = 0.0f; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->actionFunc = func_808787B0; } @@ -916,7 +917,7 @@ void func_808787B0(EnDodongo* this, GlobalContext* globalCtx) { func_80876DC4(this, globalCtx); } } else if (this->actor.colorFilterTimer == 0) { - func_800BCB70(&this->actor, 0x4000, 0x78, 0, 4); + Actor_SetColorFilter(&this->actor, 0x4000, 0x78, 0, 4); } if (SkelAnime_Update(&this->skelAnime)) { @@ -929,7 +930,7 @@ void func_808787B0(EnDodongo* this, GlobalContext* globalCtx) { this->timer = 8; } } else if (Animation_OnFrame(&this->skelAnime, 52.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } if (this->timer != 0) { @@ -974,7 +975,7 @@ void EnDodongo_UpdateDamage(EnDodongo* this, GlobalContext* globalCtx) { } else if (this->collider1.base.acFlags & AC_HIT) { this->collider2.base.acFlags &= ~AC_HIT; this->collider1.base.acFlags &= ~AC_HIT; - func_800BE2B8(&this->actor, &this->collider1); + Actor_SetDropFlagJntSph(&this->actor, &this->collider1); for (i = 0; i < ARRAY_COUNT(this->collider1Elements); i++) { if (this->collider1.elements[i].info.bumperFlags & BUMP_HIT) { @@ -1000,13 +1001,13 @@ void EnDodongo_UpdateDamage(EnDodongo* this, GlobalContext* globalCtx) { } } else if (this->actor.colChkInfo.damageEffect == 1) { this->timer = 40; - func_800BCB70(&this->actor, 0, 0xFF, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80878594(this); } else if (this->actor.colChkInfo.damageEffect == 5) { this->timer = 40; - func_800BCB70(&this->actor, 0, 0xFF, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_300 = 30; this->unk_340 = 0.75f; this->unk_33C = 2.0f; @@ -1029,10 +1030,10 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx2) { EnDodongo_UpdateDamage(this, globalCtx); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); if (this->actor.bgCheckFlags & 2) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index a67805e57..564b52fcb 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -82,9 +82,9 @@ void EnDyExtra_Update(Actor* thisx, GlobalContext* globalCtx) { EnDyExtra* this = THIS; DECR(this->unk14C); - Audio_PlayActorSound2(&this->actor, NA_SE_PL_SPIRAL_HEAL_BEAM - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_SPIRAL_HEAL_BEAM - SFX_FLAG); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 112892a38..d614223e7 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -297,7 +297,7 @@ void func_8088CC48(EnElf* this, GlobalContext* globalCtx) { func_8088CBAC(this, globalCtx); this->unk_25C = 0; this->disappearTimer = 240; - if ((this->fairyFlags & 0x400) && Actor_GetCollectibleFlag(globalCtx, this->unk_260)) { + if ((this->fairyFlags & 0x400) && Flags_GetCollectible(globalCtx, this->unk_260)) { Actor_MarkForDeath(&this->actor); } } @@ -386,7 +386,7 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx2) { case 7: this->fairyFlags |= 0x200; - thisx->shape.shadowDraw = func_800B4088; + thisx->shape.shadowDraw = ActorShadow_DrawWhiteCircle; this->fairyFlags |= 0x100; colorConfig = -1; this->fairyFlags |= 0x800; @@ -519,14 +519,14 @@ void func_8088D660(EnElf* this, Vec3f* targetPos, f32 arg2) { func_8088D5A0(this, targetPos, arg2); Math_StepToF(&this->actor.velocity.x, xVelTarget, 1.5f); Math_StepToF(&this->actor.velocity.z, zVelTarget, 1.5f); - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); } void func_8088D7F8(EnElf* this, Vec3f* targetPos) { func_8088D5A0(this, targetPos, 0.2f); this->actor.velocity.x = 0.0f; this->actor.velocity.z = 0.0f; - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.world.pos.x = targetPos->x + this->unk_224.x; this->actor.world.pos.z = targetPos->z + this->unk_224.z; } @@ -535,7 +535,7 @@ void func_8088D864(EnElf* this, Vec3f* targetPos) { func_8088D5A0(this, targetPos, 0.2f); this->actor.velocity.z = 0.0f; this->actor.velocity.x = 0.0f; - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.world.pos.x = targetPos->x + this->unk_224.x; this->actor.world.pos.z = targetPos->z + this->unk_224.z; } @@ -590,7 +590,7 @@ void func_8088D9BC(EnElf* this, GlobalContext* globalCtx) { } this->actor.world.rot.y = this->unk_258; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_8088DB4C(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { @@ -616,7 +616,7 @@ void func_8088DB4C(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { Math_StepToF(&this->actor.velocity.x, xVelTarget, 5.0f); Math_StepToF(&this->actor.velocity.z, zVelTarget, 5.0f); - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); } s32 func_8088DCA4(EnElf* this) { @@ -656,13 +656,13 @@ void func_8088DD34(EnElf* this, GlobalContext* globalCtx) { func_8088D9BC(this, globalCtx); if (Actor_HasParent(&this->actor, globalCtx)) { if (this->fairyFlags & 0x400) { - Actor_SetCollectibleFlag(globalCtx, this->unk_260); + Flags_SetCollectible(globalCtx, this->unk_260); } Actor_MarkForDeath(&this->actor); return; } - if (func_801233E4(globalCtx)) { + if (Player_InCsMode(&globalCtx->state)) { if ((this->fairyFlags & 0x4000) && (this->fairyFlags & 0x100) && func_8088DCA4(this)) { return; } @@ -686,7 +686,7 @@ void func_8088DD34(EnElf* this, GlobalContext* globalCtx) { this->unk_246 = 0; EnElf_SetupAction(this, func_8088E0F0); if (this->fairyFlags & 0x400) { - Actor_SetCollectibleFlag(globalCtx, this->unk_260); + Flags_SetCollectible(globalCtx, this->unk_260); } return; } @@ -700,7 +700,7 @@ void func_8088DD34(EnElf* this, GlobalContext* globalCtx) { } if (this->fairyFlags & 0x2000) { - func_800B8A1C(&this->actor, globalCtx, 0xBA, 80.0f, 60.0f); + Actor_PickUp(&this->actor, globalCtx, 0xBA, 80.0f, 60.0f); } } @@ -768,7 +768,7 @@ void func_8088E0F0(EnElf* this, GlobalContext* globalCtx) { this->unk_258 = Math_FAtan2F(this->actor.velocity.z, this->actor.velocity.x); func_8088F5F4(this, globalCtx, 32); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } void func_8088E304(EnElf* this, GlobalContext* globalCtx) { @@ -802,7 +802,7 @@ void func_8088E304(EnElf* this, GlobalContext* globalCtx) { func_8088D7F8(this, &player->bodyPartsPos[0]); this->unk_258 = Math_FAtan2F(this->actor.velocity.z, this->actor.velocity.x); func_8088F5F4(this, globalCtx, 0x20); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } void func_8088E484(EnElf* this, GlobalContext* globalCtx) { @@ -827,7 +827,7 @@ void func_8088E484(EnElf* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, (1.0f - (SQ(this->unk_250) * SQ(1.0f / 9.0f))) * 0.008f); this->unk_258 = Math_FAtan2F(this->actor.velocity.z, this->actor.velocity.x); func_8088F5F4(this, globalCtx, 32); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } void func_8088E5A8(EnElf* this, GlobalContext* globalCtx) { @@ -907,12 +907,12 @@ void func_8088E850(EnElf* this, GlobalContext* globalCtx) { (globalCtx->csCtx.unk_12 == 0) && ((globalCtx->csCtx.frames == 0x95) || (globalCtx->csCtx.frames == 0x17D) || (globalCtx->csCtx.frames == 0x24F))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } if ((globalCtx->sceneNum == SCENE_SECOM) && (gSaveContext.sceneSetupIndex == 0) && (globalCtx->csCtx.unk_12 == 4) && (globalCtx->csCtx.frames == 0x5F)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } } else { this->actor.shape.rot.x = 0; @@ -967,7 +967,7 @@ void func_8088E850(EnElf* this, GlobalContext* globalCtx) { break; default: - arrowPointedActor = globalCtx->actorCtx.targetContext.unk38; + arrowPointedActor = globalCtx->actorCtx.targetContext.arrowPointedActor; if ((player->stateFlags1 & 0x40) && (player->targetActor != NULL)) { Math_Vec3f_Copy(&nextPos, &player->targetActor->focus.pos); } else { @@ -995,7 +995,7 @@ void func_8088E850(EnElf* this, GlobalContext* globalCtx) { if (distFromLinksHead > 100.0f) { this->fairyFlags |= 2; if (this->unk_269 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } this->unk_25C = 100; } @@ -1036,7 +1036,7 @@ void func_8088EF18(Color_RGBAf* dest, Color_RGBAf* newColor, Color_RGBAf* curCol } void func_8088EFA4(EnElf* this, GlobalContext* globalCtx) { - Actor* arrayPointerActor = globalCtx->actorCtx.targetContext.unk38; + Actor* arrayPointerActor = globalCtx->actorCtx.targetContext.arrowPointedActor; Player* player = GET_PLAYER(globalCtx); f32 transitionRate; @@ -1065,7 +1065,7 @@ void func_8088EFA4(EnElf* this, GlobalContext* globalCtx) { this->unk_268 = 0; this->unk_238 = 1.0f; if (!this->unk_269) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } } else if (this->unk_268 == 0) { if ((arrayPointerActor == NULL) || @@ -1074,13 +1074,13 @@ void func_8088EFA4(EnElf* this, GlobalContext* globalCtx) { } } else if (this->unk_238 != 0.0f) { if (Math_StepToF(&this->unk_238, 0.0f, 0.25f)) { - this->innerColor = globalCtx->actorCtx.targetContext.unk18; - this->outerColor = globalCtx->actorCtx.targetContext.unk28; + this->innerColor = globalCtx->actorCtx.targetContext.fairyInner; + this->outerColor = globalCtx->actorCtx.targetContext.fairyOuter; } else { transitionRate = 0.25f / this->unk_238; - func_8088EF18(&this->innerColor, &globalCtx->actorCtx.targetContext.unk18, &this->innerColor, + func_8088EF18(&this->innerColor, &globalCtx->actorCtx.targetContext.fairyInner, &this->innerColor, transitionRate); - func_8088EF18(&this->outerColor, &globalCtx->actorCtx.targetContext.unk28, &this->outerColor, + func_8088EF18(&this->outerColor, &globalCtx->actorCtx.targetContext.fairyOuter, &this->outerColor, transitionRate); } } @@ -1094,7 +1094,7 @@ void func_8088EFA4(EnElf* this, GlobalContext* globalCtx) { u16 targetSfxId = this->unk_269 == 0 ? NA_SE_PL_WALK_GROUND - SFX_FLAG : NA_SE_PL_WALK_GROUND - SFX_FLAG; if (!temp) { - Audio_PlayActorSound2(&this->actor, targetSfxId); + Actor_PlaySfxAtPos(&this->actor, targetSfxId); } this->fairyFlags |= 1; } @@ -1133,7 +1133,7 @@ void func_8088F214(EnElf* this, GlobalContext* globalCtx) { sp34 = 1; func_800B9010(&this->actor, NA_SE_EV_BELL_ANGER - SFX_FLAG); } else { - arrowPointedActor = globalCtx->actorCtx.targetContext.unk38; + arrowPointedActor = globalCtx->actorCtx.targetContext.arrowPointedActor; if (player->stateFlags1 & 0x400) { sp34 = 10; this->unk_25C = 100; @@ -1150,7 +1150,7 @@ void func_8088F214(EnElf* this, GlobalContext* globalCtx) { sp34 = 0; } else if (!(player->stateFlags1 & 0x40)) { if (this->unk_269 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_NAVY_VANISH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); } sp34 = 5; } else { @@ -1199,7 +1199,7 @@ void func_8088F214(EnElf* this, GlobalContext* globalCtx) { if (!(player->stateFlags2 & 0x100000)) { sp34 = 5; if (this->unk_269 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_NAVY_VANISH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH); } } break; @@ -1209,7 +1209,7 @@ void func_8088F214(EnElf* this, GlobalContext* globalCtx) { sp34 = 9; this->unk_25C = 0x2A; if (this->unk_269 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_DASH_NORMAL); } } else if (player->stateFlags1 & 0x40) { player->stateFlags2 |= 0x100000; @@ -1358,7 +1358,7 @@ void func_8088FE64(Actor* thisx, GlobalContext* globalCtx2) { func_8088FA38(this, globalCtx); - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: if (func_80147624(globalCtx)) { if (globalCtx->msgCtx.unk11F04 == 0x202) { @@ -1467,7 +1467,7 @@ void func_8089010C(Actor* thisx, GlobalContext* globalCtx) { thisx->flags |= 0x10000; } - if (func_800B84D0(thisx, globalCtx)) { + if (Actor_ProcessTalkRequest(thisx, &globalCtx->state)) { func_8019FDC8(&D_801DB4A4, NA_SE_VO_NA_LISTEN, 0x20); thisx->focus.pos = thisx->world.pos; @@ -1488,7 +1488,7 @@ void func_8089010C(Actor* thisx, GlobalContext* globalCtx) { } if (this->elfMsg->home.rot.x == -0x961) { this->unk_234 = this->elfMsg; - func_800B86C8(thisx, globalCtx, this->elfMsg); + Actor_ChangeFocus(thisx, globalCtx, this->elfMsg); } } else { thisx->cutscene = -1; diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c index cd574fb31..0bf4b18ed 100644 --- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c +++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c @@ -62,7 +62,7 @@ void EnElfbub_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 16.0f, func_800B3FC0, 0.2f); + ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawCircle, 0.2f); this->actor.hintId = 0x16; Actor_SetScale(&this->actor, 1.25f); @@ -143,7 +143,7 @@ void EnElfbub_Update(Actor* thisx, GlobalContext* globalCtx) { EnElfbub* this = THIS; Collider_UpdateCylinder(&this->actor, &this->collider); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->actor.shape.yOffset); + Actor_SetFocus(&this->actor, this->actor.shape.yOffset); } void EnElfbub_Draw(Actor* thisx, GlobalContext* globalCtx2) { diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c index e0970a76e..65863f546 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -87,7 +87,7 @@ void EnElforg_Init(Actor* thisx, GlobalContext* globalCtx) { } break; case STRAY_FAIRY_TYPE_COLLECTIBLE: - if (Actor_GetCollectibleFlag(globalCtx, STRAY_FAIRY_FLAG(&this->actor))) { + if (Flags_GetCollectible(globalCtx, STRAY_FAIRY_FLAG(&this->actor))) { Actor_MarkForDeath(&this->actor); return; } @@ -226,7 +226,7 @@ void EnElforg_MoveToTargetFairyFountain(EnElforg* this, Vec3f* homePos) { targetAngle += angleAdjustment; Math_SmoothStepToS(&this->actor.world.rot.y, targetAngle, 2, 4000, 1000); EnElforg_ApproachTargetSpeedXZ(this); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } /** @@ -249,7 +249,7 @@ void EnElforg_MoveToTarget(EnElforg* this, Vec3f* targetPos) { Math_SmoothStepToS(&this->actor.world.rot.y, targetAngle, 10, 0x200, 0x80); } EnElforg_ApproachTargetSpeedXZ(this); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80ACCBB8(EnElforg* this, GlobalContext* globalCtx) { @@ -403,7 +403,7 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, GlobalContext* globalCtx) EnElforg_CirclePlayer(this, globalCtx); player->actor.freezeTimer = 100; player->stateFlags1 |= 0x20000000; - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { player->actor.freezeTimer = 0; player->stateFlags1 &= ~0x20000000; Actor_MarkForDeath(&this->actor); @@ -437,19 +437,19 @@ void EnElforg_FreeFloating(EnElforg* this, GlobalContext* globalCtx) { } scaledYDistance = this->actor.playerHeightRel - (this->actor.shape.yOffset * this->actor.scale.y); - if (!func_801233E4(globalCtx)) { + if (!Player_InCsMode(&globalCtx->state)) { if ((this->actor.xzDistToPlayer < 30.0f) && (scaledYDistance < 12.0f) && (scaledYDistance > -68.0f)) { EnElforg_SetupFairyCollected(this, globalCtx); func_80115908(globalCtx, 48); switch (STRAY_FAIRY_TYPE(&this->actor)) { case STRAY_FAIRY_TYPE_COLLECTIBLE: - Actor_SetCollectibleFlag(globalCtx, STRAY_FAIRY_FLAG(&this->actor)); + Flags_SetCollectible(globalCtx, STRAY_FAIRY_FLAG(&this->actor)); break; case STRAY_FAIRY_TYPE_CHEST: - Actor_SetChestFlag(globalCtx, STRAY_FAIRY_FLAG(&this->actor)); + Flags_SetTreasure(globalCtx, STRAY_FAIRY_FLAG(&this->actor)); break; default: - Actor_SetSwitchFlag(globalCtx, STRAY_FAIRY_FLAG(&this->actor)); + Flags_SetSwitch(globalCtx, STRAY_FAIRY_FLAG(&this->actor)); break; } @@ -493,7 +493,7 @@ void EnElforg_FreeFloating(EnElforg* this, GlobalContext* globalCtx) { Actor* EnElforg_GetHoldingEnemy(EnElforg* this, GlobalContext* globalCtx) { Actor* enemy; - for (enemy = globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first; enemy != NULL; enemy = enemy->next) { + for (enemy = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first; enemy != NULL; enemy = enemy->next) { if ((enemy->home.pos.x == this->actor.home.pos.x) && (enemy->home.pos.y == this->actor.home.pos.y) && (enemy->home.pos.z == this->actor.home.pos.z)) { return enemy; @@ -509,7 +509,7 @@ void EnElforg_TrappedByEnemy(EnElforg* this, GlobalContext* globalCtx) { EnElforg_InitializeParams(this); this->actionFunc = EnElforg_FreeFloating; this->actor.draw = EnElforg_Draw; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); } else { // The enemy is still alive, so have the Stray Fairy // track the enemy in case it's moving around. @@ -542,7 +542,7 @@ void EnElforg_HiddenByCollider(EnElforg* this, GlobalContext* globalCtx) { this->actor.draw = EnElforg_Draw; this->actor.world.pos.y += 40.0f; this->actor.home.pos.y += 40.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHIBI_FAIRY_SAVED); } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index f196fa54b..58bf7e1fe 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -109,7 +109,7 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&D_06002420, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - ActorShape_Init(&this->dyna.actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, &this->colElement); @@ -172,7 +172,7 @@ void EnEncount2_Popped(EnEncount2* this, GlobalContext* globalCtx) { EnEncount2_InitParticles(this, &curPos, 10); } - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_MUJURA_BALLOON_BROKEN); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_MUJURA_BALLOON_BROKEN); this->deathTimer = 30; this->actionFunc = EnEncount2_Die; } @@ -180,7 +180,7 @@ void EnEncount2_Popped(EnEncount2* this, GlobalContext* globalCtx) { void EnEncount2_Die(EnEncount2* this, GlobalContext* globalCtx) { if (this->deathTimer == 0) { if (this->switchFlag >= 0) { - Actor_SetSwitchFlag(globalCtx, this->switchFlag); + Flags_SetSwitch(globalCtx, this->switchFlag); } Actor_MarkForDeath(&this->dyna.actor); } @@ -193,10 +193,10 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) { DECR(this->deathTimer); this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; - Actor_SetHeight(&this->dyna.actor, 30.0f); + Actor_SetFocus(&this->dyna.actor, 30.0f); Actor_SetScale(&this->dyna.actor, this->scale); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->dyna.actor); + Actor_MoveWithGravity(&this->dyna.actor); EnEncount2_UpdateParticles(this, globalCtx); if (!this->isPopped) { @@ -209,8 +209,8 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnEncount2_Draw(Actor* thisx, GlobalContext* globalCtx) { EnEncount2* this = THIS; if (this->isPopped != true) { - func_800BDFC0(globalCtx, D_06000A00); - func_800BDFC0(globalCtx, D_06000D78); + Gfx_DrawDListOpa(globalCtx, D_06000A00); + Gfx_DrawDListOpa(globalCtx, D_06000D78); } EnEncount2_DrawParticles(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c index e94c19f25..f483b3289 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c +++ b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c @@ -49,7 +49,7 @@ void EnEndingHero_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 6; this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B0CC, &D_06000BE0, this->jointTable, this->morphTable, 15); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C1E748(this); } @@ -76,7 +76,7 @@ void EnEndingHero_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c index 045bf8deb..8df6a328d 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c +++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c @@ -41,7 +41,7 @@ void EnEndingHero2_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 6; this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C232E8(this); } @@ -61,7 +61,7 @@ void EnEndingHero2_Update(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero2* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c index 2f9c8391f..b89196d58 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c +++ b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c @@ -41,7 +41,7 @@ void EnEndingHero3_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 6; this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C23518(this); } @@ -61,7 +61,7 @@ void EnEndingHero3_Update(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero3* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c index fd5eae624..5f2ad6222 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c +++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c @@ -41,7 +41,7 @@ void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 6; this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D640, &D_06002A84, this->jointTable, this->morphTable, 17); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C23748(this); } @@ -61,7 +61,7 @@ void EnEndingHero4_Update(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero4* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c index 77fc67308..3a8f317f5 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c +++ b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c @@ -47,7 +47,7 @@ void EnEndingHero5_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 6; this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); this->unk25C = this->actor.params; func_80C23980(this); } @@ -68,7 +68,7 @@ void EnEndingHero5_Update(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero5* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c index d692d4f11..7af087433 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c +++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c @@ -78,7 +78,7 @@ void EnEndingHero6_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; SkelAnime_InitFlex(globalCtx, &this->skelAnime, sSkeletons[this->npcIndex], sAnimations[this->npcIndex], this->jointTable, this->morphTable, sLimbCounts[this->npcIndex]); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); EnEndingHero6_SetupIdle(this); } @@ -119,7 +119,7 @@ void EnEndingHero6_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index 155493dbd..0474bc132 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -176,7 +176,7 @@ void EnFall_Destroy(Actor* thisx, GlobalContext* globalCtx) { * Finds the Termina Field moon so the Moon's Tear can spawn in the correct place. */ Actor* EnFall_MoonsTear_GetTerminaFieldMoon(GlobalContext* globalCtx) { - Actor* itemAction = globalCtx->actorCtx.actorList[ACTORCAT_ITEMACTION].first; + Actor* itemAction = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; while (itemAction != NULL) { if (itemAction->id == ACTOR_EN_FALL && EN_FALL_TYPE(itemAction) == EN_FALL_TYPE_TERMINA_FIELD_MOON) { @@ -349,7 +349,7 @@ void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCont switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0) { case 3: if (this->eyeGlowIntensity == 0.0f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MOON_EYE_FLASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_EYE_FLASH); } this->eyeGlowIntensity += 0.033333335f; if (this->eyeGlowIntensity > 1.0f) { @@ -380,13 +380,13 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo case 0: switch (globalCtx->csCtx.frames) { case 1060: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_MOON_SCREAM1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1); break; case 1089: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MOON_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY); break; case 1303: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SLIP_MOON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON); break; } if (globalCtx->csCtx.frames >= 1145) { @@ -396,13 +396,13 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo case 1: switch (globalCtx->csCtx.frames) { case 561: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_MOON_SCREAM1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1); break; case 590: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MOON_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY); break; case 737: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SLIP_MOON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON); break; } if (globalCtx->csCtx.frames >= 650) { @@ -480,7 +480,7 @@ void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) { if (this->actor.draw != NULL) { if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ) <= 0.0f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_BOUND_1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_1); gSaveContext.weekEventReg[0x4A] |= 0x80; gSaveContext.weekEventReg[0x4A] |= 0x20; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TEST, this->actor.world.pos.x, @@ -659,7 +659,7 @@ void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) { if (func_800EE29C(globalCtx, 0x1C2) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0 == 5) { if (!(this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS)) { - Audio_PlayActorSound2(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); } this->flags |= EN_FALL_FLAG_FIRE_RING_APPEARS; } diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index f91ee7a31..612331054 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -184,7 +184,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) { switch (EnFg_GetDamageEffect(this)) { case FG_DMGEFFECT_DEKUSTICK: this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_1); this->skelAnime.playSpeed = 0.0f; this->actor.shape.shadowDraw = NULL; this->actor.scale.x *= 1.5f; @@ -210,7 +210,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) { break; case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0); if (1) {} this->actor.params = FG_BLACK; this->skelAnime.playSpeed = 0.0f; @@ -226,14 +226,14 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) { break; default: if (DECR(this->timer) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_JUMP); EnFg_UpdateAnimation(&this->skelAnime, 3); this->actor.velocity.y = 10.0f; this->timer = Rand_S16Offset(30, 30); this->actionFunc = EnFg_Jump; } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) { @@ -261,7 +261,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) { break; case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0); EnFg_UpdateAnimation(&this->skelAnime, 0); this->actor.params = FG_BLACK; this->skelAnime.playSpeed = 0.0f; @@ -286,7 +286,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) { this->actionFunc = EnFg_Idle; this->actor.velocity.y = 0.0f; } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } } @@ -313,14 +313,14 @@ void EnFg_Knockback(EnFg* this, GlobalContext* globalCtx) { EnFg_AddDust(&this->dustEffect[0], &this->actor.world.pos); } this->actor.shape.rot.x += 0x1000; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } void EnFg_Init(Actor* thisx, GlobalContext* globalCtx) { EnFg* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 10.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, NULL, this->jointTable, this->morphTable, 24); EnFg_UpdateAnimation(&this->skelAnime, 0); Collider_InitCylinder(globalCtx, &this->collider); diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 32d5d5e81..5c5952cc6 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -127,7 +127,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { EnFirefly* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28); Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -173,7 +173,7 @@ void EnFirefly_SpawnIceEffects(EnFirefly* this, GlobalContext* globalCtx) { if (this->unk_18F == 0xA) { this->unk_18F = 0; this->unk_2E8.x = 0.0f; - func_800BF7CC(globalCtx, &this->actor, &this->unk_2F8, 3, 2, 0.2f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, &this->unk_2F8, 3, 2, 0.2f, 0.2f); } } @@ -223,7 +223,7 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, GlobalContext* globalCtx) { } s32 EnFirefly_SeekTorch(EnFirefly* this, GlobalContext* globalCtx) { - ObjSyokudai* findTorch = (ObjSyokudai*)globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; + ObjSyokudai* findTorch = (ObjSyokudai*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first; ObjSyokudai* closestTorch = NULL; f32 currentMinDist = 35000.0f; f32 currentDist; @@ -332,13 +332,13 @@ void EnFirefly_SetupFall(EnFirefly* this, GlobalContext* globalCtx) { this->timer = 40; this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &D_0600017C, 0.0f, 6.0f, 6.0f, 2, 0.0f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_DEAD); this->actor.flags |= 0x10; if (this->isInvisible) { - func_800BCB70(&this->actor, 0x4000, 255, 0x2000, 40); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0x2000, 40); } else { - func_800BCB70(&this->actor, 0x4000, 255, 0, 40); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); } if (this->actor.colChkInfo.damageEffect == 3) { @@ -431,7 +431,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 8) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2800)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2800)) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { this->skelAnime.playSpeed = 0.0f; this->skelAnime.curFrame = 4.0f; @@ -534,9 +534,9 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_SetupStunned(EnFirefly* this) { if (this->isInvisible) { - func_800BCB70(&this->actor, 0, 255, 0x2000, this->timer); + Actor_SetColorFilter(&this->actor, 0, 255, 0x2000, this->timer); } else { - func_800BCB70(&this->actor, 0, 255, 0, this->timer); + Actor_SetColorFilter(&this->actor, 0, 255, 0, this->timer); } if (this->actionFunc != EnFirefly_Stunned) { @@ -545,7 +545,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) { } this->auraType = KEESE_AURA_NONE; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = EnFirefly_Stunned; } @@ -633,7 +633,7 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_UpdateDamage(EnFirefly* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if (this->actor.colChkInfo.damageEffect == 1) { this->timer = 40; @@ -666,7 +666,7 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_ATTACK); if (this->currentType != KEESE_NORMAL) { EnFirefly_Extinguish(this); @@ -682,13 +682,13 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { if (!(this->actor.flags & 0x8000)) { if ((this->actor.colChkInfo.health == 0) || (this->actionFunc == EnFirefly_Stunned)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } else { if (this->actionFunc != EnFirefly_Rebound) { this->actor.world.rot.x = 0x1554 - this->actor.shape.rot.x; } - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } } @@ -706,7 +706,7 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_FLY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_FLY); } } diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 8368dbc7d..24d8efb58 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -147,7 +147,7 @@ Actor* func_8091D944(EnFish* this, GlobalContext* globalCtx) { f32 distSq; Actor* retActor = NULL; f32 minDistSq = FLT_MAX; - Actor* foundActor = globalCtx->actorCtx.actorList[ACTORCAT_ITEMACTION].first; + Actor* foundActor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; while (foundActor != NULL) { if ((foundActor->id == ACTOR_EN_FISH) && (foundActor->params == ENFISH_2) && @@ -215,7 +215,7 @@ void EnFish_Init(Actor* thisx, GlobalContext* globalCtx) { if (sp36 == ENFISH_0) { this->actor.flags |= 0x10; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 8.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f); func_8091E810(this); } else if (sp36 == ENFISH_1) { func_8091F344(this); @@ -262,7 +262,7 @@ void func_8091DEE4(EnFish* this) { static s16 D_8091FACC[] = { 85, 60, 45 }; this->actor.gravity = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->unk_240 = Rand_S16Offset(5, D_8091FACC[this->unk_278]); this->unk_248 = 0; this->unk_26E = 400; @@ -302,7 +302,7 @@ void func_8091E070(EnFish* this) { s16 phi_a1; this->actor.gravity = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; if ((Rand_Next() & 3) == 0) { if (((Rand_Next() & 7) == 0) && (this->unk_278 != 0)) { @@ -359,7 +359,7 @@ void func_8091E128(Actor* thisx, GlobalContext* globalCtx) { void func_8091E2E0(EnFish* this) { this->actor.gravity = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->unk_240 = Rand_S16Offset(10, 40); this->unk_248 = 0; this->unk_26E = 400; @@ -433,7 +433,7 @@ void func_8091E34C(Actor* thisx, GlobalContext* globalCtx2) { void func_8091E5EC(EnFish* this) { this->actor.gravity = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->unk_26E = 400; this->unk_272 = 400; this->unk_268 = 0; @@ -490,7 +490,7 @@ void func_8091E810(EnFish* this) { this->unk_270 = 0; this->unk_26A = 0; this->actor.gravity = -1.0f; - this->actor.minVelocityY = -10.0f; + this->actor.terminalVelocity = -10.0f; this->actor.shape.yOffset = 0.0f; func_8091D6C4(this); this->unk_248 = 5; @@ -511,7 +511,7 @@ void func_8091E880(Actor* thisx, GlobalContext* globalCtx) { this->unk_240 = 400; func_8091E9A4(this); } else if (this->actor.bgCheckFlags & 0x20) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); func_8091D840(thisx, globalCtx, 10, 15.0f); if (func_8091DA14(this, globalCtx)) { func_8091EF30(this); @@ -530,7 +530,7 @@ void func_8091E9A4(EnFish* this) { f32 temp_f0; this->actor.gravity = -1.0f; - this->actor.minVelocityY = -10.0f; + this->actor.terminalVelocity = -10.0f; temp_f0 = Rand_ZeroOne(); if (temp_f0 < 0.1f) { @@ -554,7 +554,7 @@ void func_8091E9A4(EnFish* this) { this->unk_248 = 5; this->unk_24C = 0.0f; if (sp24 && (this->actor.draw != NULL)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FISH_LEAP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FISH_LEAP); } } @@ -603,7 +603,7 @@ void func_8091EAF0(Actor* thisx, GlobalContext* globalCtx) { void func_8091ECF4(EnFish* this) { this->actor.home.pos = this->actor.world.pos; this->actor.gravity = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->actor.shape.yOffset = 0.0f; this->actor.flags |= 0x10; this->unk_240 = 200; @@ -661,7 +661,7 @@ void func_8091ED70(Actor* thisx, GlobalContext* globalCtx) { void func_8091EF30(EnFish* this) { this->actor.gravity = -2.0f; - this->actor.minVelocityY = -10.0f; + this->actor.terminalVelocity = -10.0f; this->actor.shape.yOffset = 0.0f; if (this->actor.velocity.y < -1.0f) { this->actor.velocity.y = -1.0f; @@ -766,7 +766,7 @@ void func_8091EFE8(Actor* thisx, GlobalContext* globalCtx) { void func_8091F344(EnFish* this) { this->actor.gravity = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->unk_240 = Rand_S16Offset(5, 35); this->unk_248 = 1; this->unk_268 = 0; @@ -851,7 +851,7 @@ void func_8091F5A4(Actor* thisx, GlobalContext* globalCtx) { } SkelAnime_Update(&this->skelAnime); func_8091D7C4(this); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->unk_248 != 0) { u32 temp = (globalCtx->sceneNum ^ SCENE_LABO) != 0; phi_f0 = BREG(1) + 10.0f; @@ -872,7 +872,7 @@ void func_8091F5A4(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, this->actor.shape.yOffset * 0.01f); + Actor_SetFocus(&this->actor, this->actor.shape.yOffset * 0.01f); if (Actor_HasParent(&this->actor, globalCtx)) { this->actor.parent = NULL; @@ -882,7 +882,7 @@ void func_8091F5A4(Actor* thisx, GlobalContext* globalCtx) { func_8091D904(this); } } else if (func_8091DDF4(this, globalCtx)) { - func_800B8A1C(&this->actor, globalCtx, 0xBA, 80.0f, 25.0f); + Actor_PickUp(&this->actor, globalCtx, 0xBA, 80.0f, 25.0f); } } } @@ -901,7 +901,7 @@ void func_8091F830(Actor* thisx, GlobalContext* globalCtx) { if ((this->unkFunc == NULL) || (this->unkFunc(&this->actor, globalCtx), (this->actor.update != NULL))) { func_8091D7C4(this); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->unk_242 == 20) { this->actor.draw = EnFish_Draw; diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index cd553b537..dcb634f42 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -160,7 +160,7 @@ void EnFish2_Init(Actor* thisx, GlobalContext* globalCtx) { D_80B2B2F0++; if (this->actor.params == 0) { - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006190, &D_060013AC, this->jointTable, this->morphTable, 24); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -328,10 +328,10 @@ void func_80B28B5C(EnFish2* this) { } void func_80B28C14(EnFish2* this, GlobalContext* globalCtx) { - Actor* itemAction = globalCtx->actorCtx.actorList[ACTORCAT_ITEMACTION].first; + Actor* itemAction = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; WaterBox* waterbox; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80B29128(this); return; } @@ -438,7 +438,7 @@ void func_80B29128(EnFish2* this) { } void func_80B2913C(EnFish2* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80B28B5C(this); } @@ -533,7 +533,7 @@ void func_80B2951C(EnFish2* this) { Actor_MarkForDeath(this->unk_350); this->unk_350 = NULL; D_80B2B2F4 = &this->actor; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_EAT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_M_EAT); this->actionFunc = func_80B295A4; } @@ -642,7 +642,7 @@ void func_80B297FC(EnFish2* this, GlobalContext* globalCtx) { } this->unk_2B6 = 4; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FISH_GROW_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FISH_GROW_UP); this->unk_2C4++; } break; @@ -747,7 +747,7 @@ void func_80B297FC(EnFish2* this, GlobalContext* globalCtx) { } void func_80B29E5C(EnFish2* this, GlobalContext* globalCtx) { - Actor* prop = globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; + Actor* prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first; while (prop != NULL) { if (prop->id != ACTOR_EN_FISH2) { @@ -893,7 +893,7 @@ void func_80B2A498(EnFish2* this, GlobalContext* globalCtx) { if (temp_v0 != NULL) { temp_v0->speedXZ = 4.0f; temp_v0->velocity.y = 15.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_PIECE_OF_HEART); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART); gSaveContext.weekEventReg[81] &= (u8)~0x10; gSaveContext.weekEventReg[81] &= (u8)~0x20; gSaveContext.weekEventReg[81] &= (u8)~0x40; @@ -958,7 +958,7 @@ void EnFish2_Update(Actor* thisx, GlobalContext* globalCtx2) { } this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 0); + Actor_SetFocus(&this->actor, 0); if (this->actor.params != 1) { WaterBox* sp6C; @@ -990,7 +990,7 @@ void EnFish2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_2F4.z += (Math_CosS(this->actor.world.rot.y) * 25.0f) - this->unk_330; this->unk_33C = 25.0f - ((this->unk_330 - 0.01f) * 1000.0f); Actor_SetScale(&this->actor, this->unk_330); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0, 15.0f, 10.0f, 7); if (this->actor.params != 2) { diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index daa6607bd..a1fedd7a9 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -1126,8 +1126,8 @@ void EnFishing_UpdateEffects(FishingEffect* effect, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x40B3, NULL); } - if ((effect->unk_2C >= 100) && (func_80152498(&globalCtx->msgCtx) == 5)) { - if (func_80147624(globalCtx) || !func_80152498(&globalCtx->msgCtx)) { + if ((effect->unk_2C >= 100) && (Message_GetState(&globalCtx->msgCtx) == 5)) { + if (func_80147624(globalCtx) || !Message_GetState(&globalCtx->msgCtx)) { func_801477B4(globalCtx); func_801159EC(-50); effect->unk_2C = -1; @@ -2807,7 +2807,7 @@ void func_80903C60(EnFishing* this, u8 arg1) { } } - Audio_PlayActorSound2(&this->actor, sfxId); + Actor_PlaySfxAtPos(&this->actor, sfxId); } void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) { @@ -2835,7 +2835,7 @@ void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) { if (this->unk_1CC == 0) { this->actor.flags |= 1; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { D_8090CCF8 = D_809171CC; this->unk_1CB = 1; } else { @@ -2845,7 +2845,7 @@ void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) { this->unk_1CC--; this->actor.flags &= ~1; } - } else if (func_800B867C(&this->actor, globalCtx)) { + } else if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->unk_1CB = 0; this->unk_1CC = 20; } @@ -3079,7 +3079,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { this->unk_172[1] = 50; } - if (!func_80152498(&globalCtx->msgCtx)) { + if (!Message_GetState(&globalCtx->msgCtx)) { if ((gSaveContext.time >= 0xC000) && (gSaveContext.time <= 0xC01B)) { this->unk_150 = 7; this->unk_172[3] = Rand_ZeroFloat(150.0f) + 200.0f; @@ -3225,7 +3225,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { EnFishing_SpawnRipple(&this->actor.projectedPos, globalCtx->specialEffects, &spB8, 30.0f, 400.0f, 150, 90); - Audio_PlayActorSound2(&this->actor, NA_SE_PL_CATCH_BOOMERANG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_CATCH_BOOMERANG); break; } } @@ -3499,7 +3499,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { this->unk_18C = 2000.0f; } else if (sp124 < 10.0f) { if (sLurePos.y > (WATER_SURFACE_Y(globalCtx) - 10.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_JUMP_OUT_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_JUMP_OUT_WATER); play_sound(NA_SE_PL_CATCH_BOOMERANG); } @@ -3875,7 +3875,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_172[0] <= 50) { switch (this->unk_1CD) { case 0: - if ((func_80152498(&globalCtx->msgCtx) == 4) || !func_80152498(&globalCtx->msgCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) || !Message_GetState(&globalCtx->msgCtx)) { if (func_80147624(globalCtx)) { func_801477B4(globalCtx); if (globalCtx->msgCtx.choiceIndex == 0) { @@ -3906,7 +3906,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { } break; case 1: - if ((func_80152498(&globalCtx->msgCtx) == 4) || !func_80152498(&globalCtx->msgCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) || !Message_GetState(&globalCtx->msgCtx)) { if (func_80147624(globalCtx)) { func_801477B4(globalCtx); if (globalCtx->msgCtx.choiceIndex != 0) { @@ -4034,10 +4034,10 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { Math_ApproachS(&this->unk_166, spF6, 3, 0xBB8); } - Actor_SetVelocityXYRotation(&this->actor); + Actor_UpdateVelocityWithoutGravity(&this->actor); } - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.world.pos.y += (this->unk_17C * 1.5f); @@ -4129,7 +4129,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) { this->actor.velocity.x = this->actor.world.pos.x * -0.003f; this->actor.velocity.z = this->actor.world.pos.z * -0.003f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FISH_LEAP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FISH_LEAP); func_809036BC(this, globalCtx); if (Rand_ZeroOne() < 0.5f) { @@ -4324,7 +4324,7 @@ void EnFishing_UpdatePondProps(GlobalContext* globalCtx) { if (prop->type == FS_PROP_REED) { EnFishing_HandleReedContact(prop, &player->actor.world.pos); - actor = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actor != NULL) { if (!((actor->id == ACTOR_EN_FISHING) && (actor->params >= 100))) { actor = actor->next; @@ -4338,7 +4338,7 @@ void EnFishing_UpdatePondProps(GlobalContext* globalCtx) { } else if (prop->type == FS_PROP_LILY_PAD) { EnFishing_HandleLilyPadContact(prop, &player->actor.world.pos, 0); - actor = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actor != NULL) { if (!((actor->id == ACTOR_EN_FISHING) && (actor->params >= 100))) { actor = actor->next; @@ -4719,7 +4719,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { this->actor.textId = 0x4097; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (D_809171FC == 0) { this->unk_154 = 1; if (sLinkAge != 1) { @@ -4736,7 +4736,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { break; case 1: - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { func_801477B4(globalCtx); switch (globalCtx->msgCtx.choiceIndex) { @@ -4764,7 +4764,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { break; case 2: - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80151938(globalCtx, 0x407F); this->unk_154 = 4; @@ -4772,17 +4772,17 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { break; case 3: - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); this->unk_154 = 0; } - if (func_80152498(&globalCtx->msgCtx) == 6) { + if (Message_GetState(&globalCtx->msgCtx) == 6) { this->unk_154 = 0; } break; case 4: - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { func_801477B4(globalCtx); switch (globalCtx->msgCtx.choiceIndex) { @@ -4799,7 +4799,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { break; case 5: - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); globalCtx->interfaceCtx.unk_27E = 1; @@ -4816,7 +4816,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { case 10: if (D_8090CD0C != 0) { - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { func_801477B4(globalCtx); switch (globalCtx->msgCtx.choiceIndex) { @@ -4832,7 +4832,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { } } } else { - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { func_801477B4(globalCtx); switch (globalCtx->msgCtx.choiceIndex) { @@ -4904,7 +4904,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { break; case 11: - if (((func_80152498(&globalCtx->msgCtx) == 5) || !func_80152498(&globalCtx->msgCtx)) && + if (((Message_GetState(&globalCtx->msgCtx) == 5) || !Message_GetState(&globalCtx->msgCtx)) && func_80147624(globalCtx)) { s32 getItemId; @@ -4975,20 +4975,20 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { } this->actor.parent = NULL; - func_800B8A1C(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f); + Actor_PickUp(&this->actor, globalCtx, getItemId, 2000.0f, 1000.0f); this->unk_154 = 23; } break; case 20: - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); this->unk_154 = 0; } break; case 21: - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { func_801477B4(globalCtx); switch (globalCtx->msgCtx.choiceIndex) { @@ -5008,7 +5008,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { break; case 22: - if (!func_80152498(&globalCtx->msgCtx)) { + if (!Message_GetState(&globalCtx->msgCtx)) { this->unk_154 = 0; if (D_8090CD0C != 0) { D_8090CD08 = 1; @@ -5024,13 +5024,13 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { this->unk_154 = 24; } else { - func_800B8A1C(&this->actor, globalCtx, GI_SCALE_GOLD, 2000.0f, 1000.0f); + Actor_PickUp(&this->actor, globalCtx, GI_SCALE_GOLD, 2000.0f, 1000.0f); } break; case 24: D_8090CCF4 = false; - if ((func_80152498(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { if (D_809171D0 == 0) { this->unk_154 = 0; } else { @@ -5083,13 +5083,13 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { SkelAnime_Update(&this->skelAnime); - if ((D_8090CD04 != 0) || func_80152498(&globalCtx->msgCtx)) { + if ((D_8090CD04 != 0) || Message_GetState(&globalCtx->msgCtx)) { this->actor.flags &= ~1; } else { this->actor.flags |= 0x21; } - if ((this->actor.xzDistToPlayer < 120.0f) || func_80152498(&globalCtx->msgCtx)) { + if ((this->actor.xzDistToPlayer < 120.0f) || Message_GetState(&globalCtx->msgCtx)) { headRotTarget = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; } else { headRotTarget = 0; @@ -5333,7 +5333,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { player->actor.world.pos.z = 1360.0f; player->actor.speedXZ = 0.0f; - if (!func_80152498(&globalCtx->msgCtx)) { + if (!Message_GetState(&globalCtx->msgCtx)) { camera = Play_GetCamera(globalCtx, MAIN_CAM); camera->eye = sCameraEye; @@ -5426,7 +5426,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { } if (D_8090CD50 == 0) { - if ((func_80152498(&globalCtx->msgCtx) == 4) || !func_80152498(&globalCtx->msgCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) || !Message_GetState(&globalCtx->msgCtx)) { if (func_80147624(globalCtx)) { Camera* camera = Play_GetCamera(globalCtx, MAIN_CAM); @@ -5518,7 +5518,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) { D_809171CB--; } - if ((D_809171CB == 1) && !func_80152498(&globalCtx->msgCtx) && ((D_8090CD00 & 0xFFF) == 0xFFF)) { + if ((D_809171CB == 1) && !Message_GetState(&globalCtx->msgCtx) && ((D_8090CD00 & 0xFFF) == 0xFFF)) { D_809171CB = 200; if (Rand_ZeroOne() < 0.5f) { diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index f8b88f50a..d7ccc8b15 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -165,7 +165,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx2) { s32 params; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -236,7 +236,7 @@ void func_808D0930(EnFloormas* this, GlobalContext* globalCtx) { func_808D19D4((EnFloormas*)this->actor.child); func_808D19D4((EnFloormas*)this->actor.parent); func_808D19D4(this); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KUSAMUSHI_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_HIDE); } else { Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); func_808D1ED4(this, globalCtx); @@ -251,7 +251,7 @@ void func_808D09CC(EnFloormas* this) { this->collider.base.colType = COLTYPE_HIT3; this->unk_18E = 80; this->actor.flags &= ~(0x400 | 0x200); - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_808D0A48(EnFloormas* this, GlobalContext* globalCtx) { @@ -259,8 +259,8 @@ void func_808D0A48(EnFloormas* this, GlobalContext* globalCtx) { this->unk_18C = 0; this->collider.base.colType = COLTYPE_HIT0; this->unk_2C4 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_2D0, ARRAY_COUNT(this->unk_2D0), 2, - this->actor.scale.x * 30.000002f, this->actor.scale.x * 20.0f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2D0, ARRAY_COUNT(this->unk_2D0), 2, + this->actor.scale.x * 30.000002f, this->actor.scale.x * 20.0f); if (this->actor.scale.x > 0.009f) { this->actor.flags |= 0x400; } else { @@ -277,10 +277,10 @@ void func_808D0B08(EnFloormas* this) { void func_808D0B50(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - if ((this->actor.xzDistToPlayer < 400.0f) && !Actor_IsActorFacingLink(&this->actor, 0x4000)) { + if ((this->actor.xzDistToPlayer < 400.0f) && !Actor_IsFacingPlayer(&this->actor, 0x4000)) { this->unk_190 = this->actor.yawTowardsPlayer; func_808D108C(this); - } else if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsActorFacingLink(&this->actor, 0x2000)) { + } else if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsFacingPlayer(&this->actor, 0x2000)) { func_808D1380(this, globalCtx); } else { func_808D0C14(this); @@ -328,15 +328,15 @@ void func_808D0D70(EnFloormas* this, GlobalContext* globalCtx) { if ((temp_v0 != 0) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); } - if ((this->actor.xzDistToPlayer < 320.0f) && Actor_IsActorFacingLink(&this->actor, 0x4000)) { + if ((this->actor.xzDistToPlayer < 320.0f) && Actor_IsFacingPlayer(&this->actor, 0x4000)) { func_808D0F50(this); } else if (this->actor.bgCheckFlags & 8) { this->unk_190 = this->actor.wallYaw; func_808D108C(this); - } else if ((this->actor.xzDistToPlayer < 400.0f) && !Actor_IsActorFacingLink(&this->actor, 0x4000)) { + } else if ((this->actor.xzDistToPlayer < 400.0f) && !Actor_IsFacingPlayer(&this->actor, 0x4000)) { this->unk_190 = this->actor.yawTowardsPlayer; func_808D108C(this); } else if (this->unk_18E == 0) { @@ -367,11 +367,11 @@ void func_808D0F80(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); } Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); - if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsActorFacingLink(&this->actor, 0x2000) && + if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsFacingPlayer(&this->actor, 0x2000) && !(this->actor.bgCheckFlags & 8)) { func_808D1380(this, globalCtx); } else if (this->actor.xzDistToPlayer > 400.0f) { @@ -412,9 +412,9 @@ void func_808D11BC(EnFloormas* this, GlobalContext* globalCtx) { if (((this->skelAnime.playSpeed > 0.0f) && Animation_OnFrame(&this->skelAnime, 21.0f)) || ((this->skelAnime.playSpeed < 0.0f) && Animation_OnFrame(&this->skelAnime, 6.0f))) { if (this->actor.scale.x > 0.009f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_WALK); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } } @@ -433,8 +433,8 @@ void func_808D1380(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; func_808D08D0(this); - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, 1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 300, 100, 1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK); this->actionFunc = func_808D1458; } @@ -522,9 +522,9 @@ void func_808D17EC(EnFloormas* this, GlobalContext* globalCtx) { if (this->actor.velocity.y < -4.0f) { if (this->actor.scale.x > 0.009f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_LAND); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); } } } @@ -600,7 +600,7 @@ void func_808D1B44(EnFloormas* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); } if (this->actor.bgCheckFlags & 2) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); } } @@ -617,7 +617,7 @@ void func_808D1C1C(EnFloormas* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } if (this->unk_194 == 0) { @@ -644,7 +644,7 @@ void func_808D1D6C(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } flags = this->actor.bgCheckFlags & 8; @@ -712,7 +712,7 @@ void func_808D2040(EnFloormas* this, GlobalContext* globalCtx) { } else if (this->actor.bgCheckFlags & 2) { this->unk_18E = 50; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); } else if ((this->actor.playerHeightRel < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && (&player->actor == this->collider.base.oc)) { @@ -774,10 +774,10 @@ void func_808D22C8(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = -3.0f; func_808D1740(this); } else if ((this->unk_190 % 20) == 0) { - func_800B8E58(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92); + func_800B8E58(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92); globalCtx->damagePlayer(globalCtx, -4); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_STICK - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_STICK - SFX_FLAG); } void func_808D2484(EnFloormas* this) { @@ -814,7 +814,7 @@ void func_808D24F0(EnFloormas* this, GlobalContext* globalCtx) { this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & 2) { this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); func_808D1740(this); } @@ -874,7 +874,7 @@ void func_808D2764(EnFloormas* this, GlobalContext* globalCtx) { this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (((temp_f2 == 0.007f) || (temp_f2 == 0.004f)) && (temp_f2 != this->actor.scale.x)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_EXPAND); } this->collider.dim.radius = sCylinderInit.dim.radius * 100.0f * this->actor.scale.x; @@ -935,7 +935,7 @@ void func_808D2AF4(EnFloormas* this, GlobalContext* globalCtx) { void func_808D2B18(EnFloormas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); func_800BE504(&this->actor, &this->collider); - func_800BCB70(&this->actor, 0x4000, 255, 0, 20); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); this->actor.speedXZ = 5.0f; this->actor.velocity.y = 5.5f; if (this->actor.params == ENFLOORMAS_GET_7FFF_40) { @@ -966,9 +966,9 @@ void func_808D2C08(EnFloormas* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 13.0f)) { if (this->actor.scale.x > 0.009f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } } @@ -1017,7 +1017,7 @@ void func_808D2DC0(EnFloormas* this, GlobalContext* globalCtx) { void func_808D2E34(EnFloormas* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if ((this->unk_18C != 10) || !(this->collider.info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) { if (this->actor.colChkInfo.damageEffect == 0xE) { func_808D0908(this); @@ -1033,14 +1033,14 @@ void func_808D2E34(EnFloormas* this, GlobalContext* globalCtx) { if (this->collider.base.colType != COLTYPE_HARD) { if (!Actor_ApplyDamage(&this->actor)) { if (this->actor.scale.x > 0.009f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_DEAD); } Enemy_StartFinishingBlow(globalCtx, &this->actor); this->actor.flags &= ~1; } else if (this->actor.colChkInfo.damage != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_DAMAGE); } func_808D0A48(this, globalCtx); @@ -1055,13 +1055,13 @@ void func_808D2E34(EnFloormas* this, GlobalContext* globalCtx) { func_808D2D6C(this); } else if (this->actor.colChkInfo.damageEffect == 1) { this->unk_18E = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_808D2D6C(this); } else if (this->actor.colChkInfo.damageEffect == 5) { this->unk_18E = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_2C8 = 0.55f; this->unk_2C4 = 2.0f; this->unk_18C = 31; @@ -1110,7 +1110,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->actionFunc != func_808D22C8) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D); @@ -1131,7 +1131,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, this->actor.scale.x * 2500.0f); + Actor_SetFocus(&this->actor, this->actor.scale.x * 2500.0f); if (this->collider.base.colType == COLTYPE_HARD) { if (this->unk_190 != 0) { this->unk_190--; diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index bf159f7de..7e43657c0 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -196,9 +196,9 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_HandleSetupResumeInteraction(EnFsn* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx) && this->cutsceneState == 0) { - func_800B84D0(&this->actor, globalCtx); - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx) && this->cutsceneState == 0) { + Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); if (ENFSN_IS_SHOP(&this->actor)) { this->actor.textId = 0; } @@ -376,7 +376,7 @@ void EnFsn_EndInteraction(EnFsn* this, GlobalContext* globalCtx) { ActorCutscene_Stop(this->cutscene); this->cutsceneState = 0; } - func_800B84D0(&this->actor, globalCtx); + Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; Interface_ChangeAlpha(50); @@ -415,7 +415,7 @@ void EnFsn_UpdateCursorPos(EnFsn* this, GlobalContext* globalCtx) { f32 xOffset = 0.0f; f32 yOffset = 17.0f; - func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &sp2E, &sp2C); + Actor_GetScreenPos(globalCtx, &this->items[this->cursorIdx]->actor, &sp2E, &sp2C); this->cursorPos.x = sp2E + xOffset; this->cursorPos.y = sp2C + yOffset; this->cursorPos.z = 1.2f; @@ -722,7 +722,7 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { this->actionFunc = EnFsn_Haggle; } else { dummy2:; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->cutsceneState == 0) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); @@ -754,7 +754,7 @@ void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) { func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); } else { if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } if (this->flags & ENFSN_CALM_DOWN) { this->flags &= ~ENFSN_CALM_DOWN; @@ -771,7 +771,7 @@ void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) { func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); } else { if (Animation_OnFrame(&this->skelAnime, 28.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } return; } @@ -806,7 +806,7 @@ void EnFsn_BeginInteraction(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_StartBuying(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); EnFsn_HandleLookToShopkeeperBuyingCutscene(this); @@ -827,7 +827,7 @@ void EnFsn_StartBuying(EnFsn* this, GlobalContext* globalCtx) { this->actionFunc = EnFsn_DeterminePrice; break; case 0x29CF: - player->unk_A87 = PLAYER_AP_NONE; + player->exchangeItemId = EXCH_ITEM_NONE; this->actionFunc = EnFsn_SetupDeterminePrice; break; } @@ -835,7 +835,7 @@ void EnFsn_StartBuying(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (talkState == 5) { if (func_80147624(globalCtx)) { @@ -895,7 +895,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_SetupDeterminePrice(EnFsn* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.textId = 0xFF; func_801518B0(globalCtx, this->actor.textId, &this->actor); this->actionFunc = EnFsn_DeterminePrice; @@ -907,7 +907,7 @@ void EnFsn_DeterminePrice(EnFsn* this, GlobalContext* globalCtx) { s32 itemActionParam; u8 buttonItem; - if (func_80152498(&globalCtx->msgCtx) == 16) { + if (Message_GetState(&globalCtx->msgCtx) == 16) { itemActionParam = func_80123810(globalCtx); if (itemActionParam > PLAYER_AP_NONE) { if (player->heldItemButton == 0) { @@ -918,8 +918,7 @@ void EnFsn_DeterminePrice(EnFsn* this, GlobalContext* globalCtx) { this->price = (buttonItem < ITEM_MOON_TEAR) ? gItemPrices[buttonItem] : 0; if (this->price > 0) { player->actor.textId = 0x29EF; - // player->unk_A87 should be set to itemActionParam? - player->unk_A87 = buttonItem; + player->exchangeItemId = buttonItem; this->actionFunc = EnFsn_MakeOffer; } else { player->actor.textId = 0x29CF; @@ -941,7 +940,7 @@ void EnFsn_DeterminePrice(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_MakeOffer(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); if (talkState == 4 && func_80147624(globalCtx)) { @@ -975,7 +974,7 @@ void EnFsn_MakeOffer(EnFsn* this, GlobalContext* globalCtx) { break; case 1: func_8019F230(); - player->unk_A87 = PLAYER_AP_NONE; + player->exchangeItemId = EXCH_ITEM_NONE; this->actionFunc = EnFsn_SetupDeterminePrice; break; } @@ -994,9 +993,9 @@ void EnFsn_GiveItem(EnFsn* this, GlobalContext* globalCtx) { } this->actionFunc = EnFsn_SetupResumeInteraction; } else if (this->isSelling == true) { - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); } else { - func_800B8A1C(&this->actor, globalCtx, this->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->getItemId, 300.0f, 300.0f); } } @@ -1011,7 +1010,7 @@ void EnFsn_SetupResumeInteraction(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_ResumeInteraction(EnFsn* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (ENFSN_IS_SHOP(&this->actor)) { if (!this->isSelling) { this->cutscene = this->lookToShopkeeperBuyingCutscene; @@ -1031,7 +1030,7 @@ void EnFsn_ResumeInteraction(EnFsn* this, GlobalContext* globalCtx) { this->actionFunc = EnFsn_ConverseBackroom; } } else { - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } @@ -1083,7 +1082,7 @@ void EnFsn_LookToShelf(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_BrowseShelf(EnFsn* this, GlobalContext* globalCtx) { - u8 talkstate = func_80152498(&globalCtx->msgCtx); + u8 talkstate = Message_GetState(&globalCtx->msgCtx); s32 pad; u8 prevCursorIdx = this->cursorIdx; @@ -1147,7 +1146,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) { func_8019F208(); item = this->items[this->cursorIdx]; item->buyFanfareFunc(globalCtx, item); - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; Interface_ChangeAlpha(50); @@ -1178,7 +1177,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_SetupEndInteraction(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if ((talkState == 5 || talkState == 6) && func_80147624(globalCtx)) { if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { @@ -1195,7 +1194,7 @@ void EnFsn_SetupEndInteraction(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_SelectItem(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (EnFsn_TakeItemOffShelf(this) && talkState == 4) { func_8011552C(globalCtx, 6); @@ -1214,14 +1213,14 @@ void EnFsn_SelectItem(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_PlayerCannotBuy(EnFsn* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { this->actionFunc = this->tmpActionFunc; func_80151938(globalCtx, this->items[this->cursorIdx]->actor.textId); } } void EnFsn_AskCanBuyMore(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (this->cutsceneState == 0) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -1267,7 +1266,7 @@ void EnFsn_AskCanBuyMore(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (this->cutsceneState == 0) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -1314,7 +1313,7 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, GlobalContext* globalCtx) } void EnFsn_FaceShopkeeperSelling(EnFsn* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); u8 cursorIdx; if (talkState == 4) { @@ -1339,13 +1338,13 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_SetupEndInteractionImmediately(EnFsn* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { EnFsn_EndInteraction(this, globalCtx); } } void EnFsn_IdleBackroom(EnFsn* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->textId = 0; EnFsn_HandleConversationBackroom(this, globalCtx); this->actionFunc = EnFsn_ConverseBackroom; @@ -1355,7 +1354,7 @@ void EnFsn_IdleBackroom(EnFsn* this, GlobalContext* globalCtx) { } void EnFsn_ConverseBackroom(EnFsn* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { if (this->flags & ENFSN_END_CONVERSATION) { this->flags &= ~ENFSN_END_CONVERSATION; globalCtx->msgCtx.unk11F22 = 0x43; @@ -1398,7 +1397,7 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) { EnFsn* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->jointTable, this->morphTable, 19); if (ENFSN_IS_SHOP(&this->actor)) { this->actor.shape.rot.y = BINANG_ROT180(this->actor.shape.rot.y); @@ -1432,7 +1431,7 @@ void EnFsn_Update(Actor* thisx, GlobalContext* globalCtx) { EnFsn* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_800E9250(globalCtx, &this->actor, &this->headRot, &this->unk27A, this->actor.focus.pos); func_8013D9C8(globalCtx, this->limbRotYTable, this->limbRotZTable, 19); EnFsn_Blink(this); diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 7dcf097d7..c7eebb281 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -188,7 +188,7 @@ void func_809619D0(EnFu* this, GlobalContext* globalCtx) { void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnFu* this = THIS; - Actor* fuKaiten = globalCtx->actorCtx.actorList[ACTORCAT_BG].first; + Actor* fuKaiten = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first; while (fuKaiten != NULL) { if (fuKaiten->id == ACTOR_BG_FU_KAITEN) { @@ -199,7 +199,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { } if (fuKaiten != NULL) { - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B2B0, &D_06001F74, this->jointTable, this->morphTable, 21); Collider_InitCylinder(globalCtx, &this->collider); @@ -257,7 +257,7 @@ s32 func_80961D10(EnFu* this) { } void func_80961D7C(GlobalContext* globalCtx) { - Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { if ((explosive->id == ACTOR_EN_BOM) && (explosive->bgCheckFlags & 1)) { @@ -277,7 +277,7 @@ void func_80961D7C(GlobalContext* globalCtx) { } void func_80961E88(GlobalContext* globalCtx) { - Actor* explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { Actor_MarkForDeath(explosive); @@ -286,7 +286,7 @@ void func_80961E88(GlobalContext* globalCtx) { } void func_80961EC8(GlobalContext* globalCtx) { - Actor* fuMato = globalCtx->actorCtx.actorList[ACTORCAT_BG].first; + Actor* fuMato = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first; while (fuMato != NULL) { if (fuMato->id == ACTOR_EN_FU_MATO) { @@ -297,7 +297,7 @@ void func_80961EC8(GlobalContext* globalCtx) { } void func_80961F00(GlobalContext* globalCtx) { - Actor* fuKago = globalCtx->actorCtx.actorList[ACTORCAT_BG].first; + Actor* fuKago = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first; while (fuKago != NULL) { if (fuKago->id == ACTOR_EN_FU_KAGO) { @@ -377,7 +377,7 @@ void func_8096209C(EnFu* this, GlobalContext* globalCtx) { } void func_809622FC(EnFu* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80962340; } @@ -388,7 +388,7 @@ void func_80962340(EnFu* this, GlobalContext* globalCtx) { this->actor.flags |= 0x10000; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->unk_54A == 2) { if (this->unk_552 == 0x287D) { if (gSaveContext.playerForm == PLAYER_FORM_DEKU) { @@ -542,7 +542,7 @@ void func_80962660(EnFu* this, GlobalContext* globalCtx) { func_801477B4(globalCtx); player->stateFlags1 |= 0x20; this->unk_53C = 0; - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); func_801A2BB8(NA_BGM_MINI_GAME_2); if (this->unk_542 == 0) { if (this->unk_546 == 1) { @@ -583,7 +583,7 @@ void func_809628BC(EnFu* this) { } void func_809628D0(EnFu* this, GlobalContext* globalCtx) { - u8 sp27 = func_80152498(&globalCtx->msgCtx); + u8 sp27 = Message_GetState(&globalCtx->msgCtx); switch (sp27) { case 0: @@ -846,8 +846,8 @@ void func_80963350(EnFu* this, GlobalContext* globalCtx) { static s32 D_80964C24 = 0; BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child; - if ((this->unk_54A == 0) && (((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) || - ((func_80152498(&globalCtx->msgCtx) == 2) && (globalCtx->msgCtx.unk12023 == 1)))) { + if ((this->unk_54A == 0) && (((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) || + ((Message_GetState(&globalCtx->msgCtx) == 2) && (globalCtx->msgCtx.unk12023 == 1)))) { func_801477B4(globalCtx); this->unk_54A = 2; D_80964C24 = 1; @@ -884,9 +884,9 @@ void func_80963560(EnFu* this, GlobalContext* globalCtx) { this->actor.parent = NULL; func_80963610(this); } else if ((this->unk_552 == 0x2880) && !(gSaveContext.weekEventReg[22] & 0x80)) { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f); } this->actor.child->freezeTimer = 10; } @@ -899,7 +899,7 @@ void func_80963610(EnFu* this) { void func_80963630(EnFu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20) && (CURRENT_DAY == 3) && (gSaveContext.playerForm == PLAYER_FORM_HUMAN)) { if (gSaveContext.weekEventReg[22] & 0x40) { @@ -940,7 +940,7 @@ void func_80963630(EnFu* this, GlobalContext* globalCtx) { player->stateFlags1 &= ~0x20; } else { this->actor.child->freezeTimer = 10; - func_800B85E0(&this->actor, globalCtx, 500.0f, -1); + func_800B85E0(&this->actor, globalCtx, 500.0f, EXCH_ITEM_MINUS1); } } @@ -962,7 +962,7 @@ s32 func_80963810(GlobalContext* globalCtx, Vec3f pos) { } globalCtx->actorCtx.unk268 = 1; - func_800B6F20(globalCtx, globalCtx->actorCtx.pad26C, phi_f0, sp22); + func_800B6F20(globalCtx, &globalCtx->actorCtx.unk_26C, phi_f0, sp22); if (sp28 < 80.0f) { return true; @@ -1181,7 +1181,7 @@ void func_80963FF8(EnFu* this, GlobalContext* globalCtx) { if (player->stateFlags1 & 0x100000) { globalCtx->actorCtx.unk268 = 1; - globalCtx->actorCtx.unk278 = 0x8000; + globalCtx->actorCtx.unk_26C.press.button = 0x8000; } else { globalCtx->actorCtx.unk268 = 1; } @@ -1219,7 +1219,7 @@ void func_80964190(EnFu* this, GlobalContext* globalCtx) { case 0x2842: case 0x2844: case 0x2848: - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); break; case 0x2840: @@ -1245,21 +1245,21 @@ void func_80964190(EnFu* this, GlobalContext* globalCtx) { case 0x286B: case 0x286D: case 0x2871: - func_800BDC5C(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); break; case 0x2860: - func_800BDC5C(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); break; case 0x285F: - func_800BDC5C(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); break; case 0x287E: case 0x2880: case 0x2883: - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); break; } } @@ -1340,7 +1340,7 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); func_809642E0(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_8096209C(this, globalCtx); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index e07abfbe9..1efcd42e7 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -359,7 +359,8 @@ void func_80932C98(EnFz* this, GlobalContext* globalCtx) { Vec3f sp3C; if (this->unk_BCD != 0) { - if ((this->actor.bgCheckFlags & 8) || !func_800BC4EC(&this->actor, globalCtx, 60.0f, this->actor.world.rot.y)) { + if ((this->actor.bgCheckFlags & 8) || + !Actor_TestFloorInDirection(&this->actor, globalCtx, 60.0f, this->actor.world.rot.y)) { this->actor.bgCheckFlags &= ~0x8; this->unk_BCD = 0; this->unk_BBC = 0.0f; @@ -374,8 +375,8 @@ void func_80932C98(EnFz* this, GlobalContext* globalCtx) { if ((parent->update == NULL) || (parent->colChkInfo.health <= 0)) { this->actor.colChkInfo.health = 0; this->unk_BC4 = 5; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FREEZAD_DEAD); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -387,8 +388,8 @@ void func_80932C98(EnFz* this, GlobalContext* globalCtx) { if ((this->actor.colChkInfo.health != 0) && (this->unk_BC4 == 1)) { this->actor.colChkInfo.health = 0; this->unk_BC4 = 5; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FREEZAD_DEAD); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -419,9 +420,9 @@ void func_80932C98(EnFz* this, GlobalContext* globalCtx) { case 15: Actor_ApplyDamage(&this->actor); - func_800BCB70(&this->actor, 0x4000, 0xFF, 0x2000, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); if (this->actor.colChkInfo.health != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -429,8 +430,8 @@ void func_80932C98(EnFz* this, GlobalContext* globalCtx) { this->unk_BCF++; break; } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FREEZAD_DEAD); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); sp3C.x = this->actor.world.pos.x; sp3C.y = this->actor.world.pos.y; sp3C.z = this->actor.world.pos.z; @@ -439,7 +440,7 @@ void func_80932C98(EnFz* this, GlobalContext* globalCtx) { break; case 2: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FREEZAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FREEZAD_DEAD); func_80933790(this); break; } @@ -803,7 +804,7 @@ void EnFz_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_BD9--; } - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80932C98(this, globalCtx); this->actionFunc(this, globalCtx); @@ -821,7 +822,7 @@ void EnFz_Update(Actor* thisx, GlobalContext* globalCtx) { } Math_StepToF(&this->actor.speedXZ, this->unk_BBC, 0.2f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->unk_BCC != 0) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); } diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index 15a1db429..90880e261 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -377,7 +377,7 @@ void func_80B0FEBC(EnGb2* this, GlobalContext* globalCtx) { this->unk_288 = 10; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, this->unk_26E, &this->actor); this->actionFunc = func_80B0FFA8; } else if ((this->actor.xzDistToPlayer < 300.0f) || this->actor.isTargeted) { @@ -386,7 +386,7 @@ void func_80B0FEBC(EnGb2* this, GlobalContext* globalCtx) { } void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) { - u8 temp_v0 = func_80152498(&globalCtx->msgCtx); + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 5) { if (func_80147624(globalCtx)) { @@ -537,7 +537,7 @@ void func_80B10344(EnGb2* this, GlobalContext* globalCtx) { } void func_80B10584(EnGb2* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, this->unk_26E, &this->actor); this->actor.flags &= ~0x10000; this->actionFunc = func_80B10634; @@ -548,7 +548,7 @@ void func_80B10584(EnGb2* this, GlobalContext* globalCtx) { } void func_80B10634(EnGb2* this, GlobalContext* globalCtx) { - u8 temp_v0 = func_80152498(&globalCtx->msgCtx); + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); if (temp_v0 == 5) { if (func_80147624(globalCtx)) { @@ -632,12 +632,12 @@ void func_80B10924(EnGb2* this, GlobalContext* globalCtx) { } this->actionFunc = func_80B109DC; } else { - func_800B8A1C(&this->actor, globalCtx, sp24, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, sp24, 300.0f, 300.0f); } } void func_80B109DC(EnGb2* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, this->unk_26E, &this->actor); this->actionFunc = func_80B10634; } else { @@ -663,7 +663,7 @@ void func_80B10A48(EnGb2* this, GlobalContext* globalCtx) { case ENGB2_7_2: ActorCutscene_Stop(this->unk_282[this->unk_290]); if (this->unk_26E == 0x14FB) { - Actor_SetSwitchFlag(globalCtx, ENGB2_GET_7F8(&this->actor)); + Flags_SetSwitch(globalCtx, ENGB2_GET_7F8(&this->actor)); Actor_MarkForDeath(&this->actor); } else { this->actor.draw = NULL; @@ -688,7 +688,7 @@ void func_80B10B5C(EnGb2* this, GlobalContext* globalCtx) { if (func_80B0FA48(this, globalCtx)) { this->unk_26C &= ~0x20; - if (func_800B84D0(&this->actor, globalCtx) && (this->unk_26C & 0x40)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_26C & 0x40)) { if ((this->unk_26E == 0x14EE) || (this->unk_26E == 0x14F4)) { this->unk_26C |= 2; } @@ -702,7 +702,7 @@ void func_80B10B5C(EnGb2* this, GlobalContext* globalCtx) { } } else { this->unk_26C &= ~0x40; - if (func_800B84D0(&this->actor, globalCtx) && (this->unk_26C & 0x20)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_26C & 0x20)) { this->actor.flags &= ~0x10000; func_801518B0(globalCtx, this->unk_26E, &this->actor); if (this->unk_26E == 0x14EB) { @@ -730,7 +730,7 @@ void func_80B10DAC(EnGb2* this, GlobalContext* globalCtx) { if (this->unk_290 != 2) { this->actionFunc = func_80B10E98; } else { - Actor_SetSwitchFlag(globalCtx, ENGB2_GET_7F8(&this->actor)); + Flags_SetSwitch(globalCtx, ENGB2_GET_7F8(&this->actor)); this->actionFunc = func_80B10868; } } else { @@ -746,7 +746,7 @@ void func_80B10DAC(EnGb2* this, GlobalContext* globalCtx) { } void func_80B10E98(EnGb2* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { if (this->unk_26C & 2) { this->unk_26C &= ~2; globalCtx->msgCtx.unk11F22 = 0x43; @@ -779,7 +779,7 @@ void func_80B10E98(EnGb2* this, GlobalContext* globalCtx) { } void func_80B11048(EnGb2* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_801518B0(globalCtx, this->unk_26E, &this->actor); this->actionFunc = func_80B10DAC; @@ -790,7 +790,7 @@ void func_80B11048(EnGb2* this, GlobalContext* globalCtx) { } void func_80B110F8(EnGb2* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { if (this->unk_26C & 2) { globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; @@ -840,8 +840,8 @@ void func_80B11268(EnGb2* this, GlobalContext* globalCtx) { if (globalCtx->roomCtx.currRoom.num == 1) { this->unk_290 = 0; this->unk_282[0] = this->actor.cutscene; - if (Actor_GetRoomCleared(globalCtx, 2) && Actor_GetRoomCleared(globalCtx, 3) && - Actor_GetRoomCleared(globalCtx, 4) && Actor_GetRoomCleared(globalCtx, 5)) { + if (Flags_GetClear(globalCtx, 2) && Flags_GetClear(globalCtx, 3) && Flags_GetClear(globalCtx, 4) && + Flags_GetClear(globalCtx, 5)) { this->unk_28A = 0xFF; this->unk_26C &= ~0x100; this->actor.flags |= 1; @@ -878,7 +878,7 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ps_Skel_007230, &object_ps_Anim_00049C, this->jointTable, this->morphTable, 12); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); Actor_SetScale(&this->actor, 0.01f); @@ -934,8 +934,8 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - if (Actor_GetRoomCleared(globalCtx, 2) && Actor_GetRoomCleared(globalCtx, 3) && - Actor_GetRoomCleared(globalCtx, 4) && Actor_GetRoomCleared(globalCtx, 5)) { + if (Flags_GetClear(globalCtx, 2) && Flags_GetClear(globalCtx, 3) && Flags_GetClear(globalCtx, 4) && + Flags_GetClear(globalCtx, 5)) { Actor_MarkForDeath(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index e31d3d50a..4209efe3f 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -268,7 +268,7 @@ u8 func_80BB1B14(EnGeg* this, GlobalContext* globalCtx) { } } - explosive = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (explosive != NULL) { if ((explosive->id == ACTOR_EN_BOM) && func_80BB18FC(this, explosive)) { @@ -381,7 +381,7 @@ s32 func_80BB2088(EnGeg* this, GlobalContext* globalCtx) { return true; } - if (Actor_IsActorFacingLinkAndWithinRange(&this->actor, 300.0f, 0x7FF8) && + if (Actor_IsFacingAndNearPlayer(&this->actor, 300.0f, 0x7FF8) && ((this->unk_4AC == 5) || ((this->unk_4AC == 13) && (this->unk_496 == 0xD69)))) { this->unk_230 |= 2; func_80BB1D64(this, globalCtx); @@ -418,7 +418,7 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) { if (sp27 != 0) { this->unk_230 &= ~8; - if (func_800B84D0(&this->actor, globalCtx) && (this->unk_230 & 4)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_230 & 4)) { if (sp27 == 1) { this->unk_496 = 0xD66; this->unk_49A = this->unk_49C[3]; @@ -443,7 +443,7 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) { } else { this->unk_230 &= ~4; if (gSaveContext.weekEventReg[35] & 0x40) { - if (func_800B84D0(&this->actor, globalCtx) && (this->unk_230 & 8)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_230 & 8)) { this->unk_496 = 0xD62; func_801518B0(globalCtx, this->unk_496, &this->actor); this->unk_230 &= ~8; @@ -452,7 +452,7 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) { func_800B8614(&this->actor, globalCtx, 300.0f); this->unk_230 |= 8; } - } else if (func_800B84D0(&this->actor, globalCtx) && (this->unk_230 & 8)) { + } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_230 & 8)) { gSaveContext.weekEventReg[35] |= 0x40; this->unk_496 = 0xD5E; this->unk_49A = this->unk_49C[0]; @@ -532,7 +532,7 @@ void func_80BB2520(EnGeg* this, GlobalContext* globalCtx) { } void func_80BB26EC(EnGeg* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (this->unk_496) { case 0xD5E: this->unk_49A = this->unk_49C[1]; @@ -554,7 +554,7 @@ void func_80BB26EC(EnGeg* this, GlobalContext* globalCtx) { } void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (this->unk_496) { case 0xD63: globalCtx->msgCtx.unk11F22 = 0x43; @@ -596,7 +596,7 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) { } void func_80BB2944(EnGeg* this, GlobalContext* globalCtx) { - u8 sp27 = func_80152498(&globalCtx->msgCtx); + u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 curFrame = this->skelAnime.curFrame; s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animationSeg); @@ -619,7 +619,7 @@ void func_80BB2944(EnGeg* this, GlobalContext* globalCtx) { } void func_80BB2A54(EnGeg* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { if (this->unk_496 == 0xD65) { ActorCutscene_Stop(this->unk_498); this->unk_230 &= ~0x10; @@ -705,7 +705,7 @@ void func_80BB2E00(EnGeg* this, GlobalContext* globalCtx) { func_80BB2020(this, globalCtx); this->actionFunc = func_80BB30B4; } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_STAND_IMT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_STAND_IMT); } } else if (this->unk_4AC == 4) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { @@ -718,7 +718,7 @@ void func_80BB2E00(EnGeg* this, GlobalContext* globalCtx) { this->actionFunc = func_80BB3318; } } else if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); } } } @@ -737,7 +737,7 @@ void func_80BB2F7C(EnGeg* this, GlobalContext* globalCtx) { this->actionFunc = func_80BB2E00; } else { this->actor.speedXZ = 5.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } if (this->actor.bgCheckFlags & 1) { @@ -745,7 +745,7 @@ void func_80BB2F7C(EnGeg* this, GlobalContext* globalCtx) { func_800B9010(&this->actor, NA_SE_EN_GOLON_SIRLOIN_ROLL - SFX_FLAG); } else { this->unk_230 |= 0x80; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } } } @@ -753,7 +753,7 @@ void func_80BB2F7C(EnGeg* this, GlobalContext* globalCtx) { void func_80BB30B4(EnGeg* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (player->transformation == PLAYER_FORM_GORON) { this->unk_496 = 0xD6A; } else if (Player_GetMask(globalCtx) == PLAYER_MASK_DON_GERO) { @@ -793,12 +793,12 @@ void func_80BB31B8(EnGeg* this, GlobalContext* globalCtx) { } this->actionFunc = func_80BB32AC; } else { - func_800B8A1C(&this->actor, globalCtx, getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, getItemId, 300.0f, 300.0f); } } void func_80BB32AC(EnGeg* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, this->unk_496, &this->actor); this->actionFunc = func_80BB27D4; } else { @@ -831,7 +831,7 @@ void func_80BB3318(EnGeg* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); } else { Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } func_800B9010(&this->actor, NA_SE_EN_GOLON_SIRLOIN_ROLL - SFX_FLAG); @@ -855,7 +855,7 @@ void EnGeg_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 0.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, &object_oF1d_map_Anim_012DE0, this->jointTable, this->morphTable, 18); diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index 68ccef9fc..85f1798e3 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -107,7 +107,7 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.draw = NULL; this->alpha = 0; this->actor.velocity.y = -10.0f; - this->actor.minVelocityY = -10.0f; + this->actor.terminalVelocity = -10.0f; this->actor.gravity = -5.0f; switch (type) { case GIANT_TYPE_CANYON_TERMINA_FIELD: @@ -143,7 +143,7 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_GetLastFrame(&gGiantRaisedArmsStartAnim), 2, 0.0f); this->actor.draw = EnGiant_Draw; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->actor.gravity = 0.0f; } @@ -154,7 +154,7 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_GetLastFrame(&gGiantStruggleStartAnim), 0, 0.0f); this->actor.draw = EnGiant_Draw; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->actor.gravity = 0.0f; if (EnGiant_IsImprisoned(this)) { Actor_MarkForDeath(&this->actor); @@ -318,10 +318,10 @@ void EnGiant_PlaySound(EnGiant* this) { if (this->actor.draw != NULL && this->alpha > 0) { if (this->animationId == GIANT_ANIMATION_WALKING_LOOP && (Animation_OnFrame(&this->skelAnime, 40.0f) || Animation_OnFrame(&this->skelAnime, 100.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_KYOJIN_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_WALK); } if (this->animationId == GIANT_ANIMATION_FALLING_OVER && Animation_OnFrame(&this->skelAnime, 40.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_KYOJIN_VOICE_FAIL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KYOJIN_VOICE_FAIL); } if (this->sfxId != 0xFFFF && ((this->animationId == GIANT_ANIMATION_BIG_CALL_START && this->skelAnime.curFrame >= 18.0f) || @@ -391,7 +391,7 @@ void EnGiant_Update(Actor* thisx, GlobalContext* globalCtx) { s32 blinkTimerTemp; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->blinkTimer == 0) { diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index 6946f58ec..a58710030 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -78,7 +78,7 @@ void EnGinkoMan_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnGinkoMan_SetupIdle(EnGinkoMan* this) { this->actor.flags |= 1; // targetable - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); this->actionFunc = EnGinkoMan_Idle; } @@ -86,13 +86,13 @@ void EnGinkoMan_Idle(EnGinkoMan* this, GlobalContext* globalCtx) { s32 yaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; EnGinkoMan_SwitchAnimation(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { // Listen for dialogue start? + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) { - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x44C, &this->actor); this->curTextId = 0x44C; // would you like to make an account } else { - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) { func_801518B0(globalCtx, 0x467, &this->actor); this->curTextId = 0x467; // "What's this? You need somethin' on a day like this? @@ -115,7 +115,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { switch (this->curTextId) { case 0x44C: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue) - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); if (gSaveContext.weekEventReg[10] & 8) { func_801518B0(globalCtx, 0x44E, &this->actor); this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees" @@ -130,7 +130,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees" break; case 0x44F: // "...So, what'll it be? Deposit Rupees Don't deposit Rupees" - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x450, &this->actor); this->curTextId = 0x450; // "How much? How much? [rupee prompt] break; @@ -141,14 +141,14 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { if (this->isNewAccount == true) { this->isNewAccount = false; if (this->curTextId != 0x453) { // "That's it? That ain't nothing at all, big spender! - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); } func_801518B0(globalCtx, 0x461, &this->actor); this->curTextId = 0x461; // So, little guy, what's your name? } else { if (this->curTextId == 0x453) { // "That's it? That ain't nothing at all, big spender! - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); } globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF; @@ -178,17 +178,17 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x45D, &this->actor); this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?! } else if (this->previousBankValue < (s16)(gSaveContext.roomInf[127][0] & 0xFFFF)) { - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); func_801518B0(globalCtx, 0x45E, &this->actor); this->curTextId = 0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..." } else { - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x460, &this->actor); this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!" } } else { - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x460, &this->actor); this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!" } @@ -218,7 +218,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { EnGinkoMan_SetupStamp(this); // stamp player break; case 0x465: // "There! Now I'll know you when I see you!" - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF; func_801518B0(globalCtx, 0x45A, &this->actor); this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!" @@ -275,7 +275,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { break; case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the // math! - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); case 0x475: // "What's this? Look, little guy, you can't hold this many rupees! You got that?" case 0x47C: // "Is that so? Think it over, little guy! So what are you gonna do?" case 0x47D: // duplicate of 48 @@ -342,7 +342,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) { if (gSaveContext.rupees < globalCtx->msgCtx.bankRupeesSelected) { play_sound(NA_SE_SY_ERROR); - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); func_801518B0(globalCtx, 0x459, &this->actor); this->curTextId = 0x459; // HEY you dont have that much } else { @@ -354,7 +354,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) func_801518B0(globalCtx, 0x454, &this->actor); this->curTextId = 0x454; // Seriously? that's a lot. A lot! } else { - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); func_801518B0(globalCtx, 0x453, &this->actor); this->curTextId = 0x453; // That's it? That aint nothing at all } @@ -372,7 +372,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) } } else { // GINKOMAN_CHOICE_NO func_8019F230(); - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) { func_801518B0(globalCtx, 0x456, &this->actor); this->curTextId = 0x456; // Is that so? think about it @@ -405,7 +405,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx) if ((s32)((gSaveContext.roomInf[127][0] & 0xFFFF)) < ((s32)(globalCtx->msgCtx.bankRupeesSelected + this->serviceFee))) { play_sound(NA_SE_SY_ERROR); - func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING); func_801518B0(globalCtx, 0x476, &this->actor); this->curTextId = 0x476; // you dont have enough deposited to withdrawl } else if (CUR_CAPACITY(UPG_WALLET) < (globalCtx->msgCtx.bankRupeesSelected + gSaveContext.rupees)) { @@ -447,7 +447,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, GlobalContext* globalCtx) { switch (this->curTextId) { case 0x450: // "How much? How much?" [rupee prompt] Set the amount with [Control Stick] and if (globalCtx->msgCtx.bankRupeesSelected == 0) { - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); func_801518B0(globalCtx, 0x457, &this->actor); this->curTextId = 0x457; // Zero Rupees? Cruel joke! } else { @@ -477,7 +477,7 @@ void EnGinkoMan_SetupDialogue(EnGinkoMan* this) { } void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { // get dialogue state? + switch (Message_GetState(&globalCtx->msgCtx)) { case 2: EnGinkoMan_SetupIdle(this); break; @@ -502,7 +502,7 @@ void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx) { } if ((this->skelAnime.animation == &D_060008C0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT); } } @@ -517,16 +517,16 @@ void EnGinkoMan_BankAward(EnGinkoMan* this, GlobalContext* globalCtx) { EnGinkoMan_SetupBankAward2(this); } else if (this->curTextId == 0x45B) { // "Whats this, you already saved up 200?" if (!(gSaveContext.weekEventReg[10] & 8)) { - func_800B8A1C(&this->actor, globalCtx, GI_WALLET_ADULT + CUR_UPG_VALUE(UPG_WALLET), 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_WALLET_ADULT + CUR_UPG_VALUE(UPG_WALLET), 500.0f, 100.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f); } } else if (this->curTextId == 0x45C) { // "Whats this, you already saved up 5000?" - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f); } else if (!(gSaveContext.weekEventReg[59] & 8)) { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f); } } @@ -537,7 +537,7 @@ void EnGinkoMan_SetupBankAward2(EnGinkoMan* this) { // separate function to handle bank rewards... if the bank has a parent actor? might be unused void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (!(gSaveContext.weekEventReg[10] & 8) && (this->curTextId == 0x45B)) { // "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take // it!" @@ -545,44 +545,44 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x47A, &this->actor); this->curTextId = 0x47A; // "See! Doesn't it hold more than your old one? } else { - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); func_801518B0(globalCtx, 0x47B, &this->actor); this->curTextId = 0x47B; // "Is that so? Think it over, little guy! So what are you gonna do?" } EnGinkoMan_SetupDialogue(this); } else if (this->curTextId == 0x45D) { // saved up 5000 rupees for HP - if ((func_80152498(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { if (!(gSaveContext.weekEventReg[59] & 8)) { gSaveContext.weekEventReg[59] |= 8; } EnGinkoMan_SetupIdle(this); } } else { - func_800B85E0(&this->actor, globalCtx, 500.0f, -1); + func_800B85E0(&this->actor, globalCtx, 500.0f, EXCH_ITEM_MINUS1); } } void EnGinkoMan_SetupStamp(EnGinkoMan* this) { - func_800BDC5C(&this->skelAnime, animations, GINKO_REACHING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_REACHING); this->actionFunc = EnGinkoMan_Stamp; } void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) { if ((this->curTextId == 0x464) // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt." && (Animation_OnFrame(&this->skelAnime, 10.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO); // "stamp" + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); // "stamp" } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { switch (this->curTextId) { case 0x464: // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt." - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); func_801518B0(globalCtx, 0x465, &this->actor); this->curTextId = 0x465; // "There! Now I'll know you when I see you!" break; case 0x469: // "Excuse me, but let me take a look at you..." - func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING); globalCtx->msgCtx.bankRupees = (gSaveContext.roomInf[127][0] & 0xFFFF); if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) { func_801518B0(globalCtx, 0x46C, &this->actor); @@ -603,12 +603,12 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) { if (this->animTimer == 0) { if (this->skelAnime.animation != &D_06004A7C) { this->animTimer = 40; - func_800BDC5C(&this->skelAnime, animations, GINKO_ADVERTISING); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_ADVERTISING); } } } else if ((this->animTimer == 0) && (this->skelAnime.animation != &D_06000AC4)) { this->animTimer = 40; - func_800BDC5C(&this->skelAnime, animations, GINKO_AMAZED); + Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_AMAZED); } DECR(this->animTimer); diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index ad39a682a..91ae3270f 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -579,7 +579,7 @@ void EnGirlA_Update2(EnGirlA* this, GlobalContext* globalCtx) { this->actor.shape.shadowScale = 4.0f; EnGirlA_TrySetMaskItemDescription(this, globalCtx); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 5.0f); + Actor_SetFocus(&this->actor, 5.0f); this->actor.shape.rot.x = 0; if (this->isSelected) { this->rotY += 0x1F4; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index b6b8bc8ad..aee390e8d 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -429,7 +429,7 @@ s32 func_8094E69C(EnGm* this, GlobalContext* globalCtx) { switch (this->unk_3E0) { case 0: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); func_8094E054(this, globalCtx, 2); this->unk_3E2 = 0; this->unk_3E0++; @@ -481,7 +481,7 @@ s32 func_8094E69C(EnGm* this, GlobalContext* globalCtx) { break; case 8: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); ActorCutscene_Stop(sp4A); this->unk_3E2 = 0; this->unk_3E0++; @@ -566,7 +566,7 @@ s32 func_8094EB1C(EnGm* this, GlobalContext* globalCtx) { ret = true; break; } - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); func_8094E054(this, globalCtx, 2); this->unk_3E2 = 0; this->unk_3E0++; @@ -586,7 +586,7 @@ s32 func_8094EB1C(EnGm* this, GlobalContext* globalCtx) { break; case 2: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); this->unk_3E2 = 0; this->unk_3E0++; @@ -661,7 +661,7 @@ s32 func_8094EE84(EnGm* this, GlobalContext* globalCtx) { s32 ret = false; if (this->unk_3A4 & 7) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_8013AED4(&this->unk_3A4, 0, 7); this->unk_3E0 = 0; this->unk_3E4 = NULL; @@ -786,7 +786,7 @@ void func_8094F2E8(EnGm* this) { void func_8094F3D0(EnGm* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - s32 sp28 = func_80152498(&globalCtx->msgCtx); + s32 sp28 = Message_GetState(&globalCtx->msgCtx); s32 var = globalCtx->msgCtx.unk11F04; if ((&this->actor == player->targetActor) && ((var < 0xFF) || (var > 0x200)) && (sp28 == 3) && @@ -892,7 +892,7 @@ s32 func_8094F53C(EnGm* this, GlobalContext* globalCtx) { } if ((this->unk_3E8 == 6) && !(globalCtx->actorCtx.unk5 & 0x20) && Animation_OnFrame(&this->skelAnime, 20.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } return false; @@ -1260,7 +1260,7 @@ s32 func_809503F8(EnGm* this, GlobalContext* globalCtx) { if (this->unk_3E8 == 9) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; func_8013AED4(&this->unk_3A4, 3, 7); func_8094E054(this, globalCtx, 0); } else { @@ -1292,7 +1292,7 @@ s32 func_80950490(EnGm* this, GlobalContext* globalCtx) { switch (this->unk_3E8) { case 9: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; func_8013AED4(&this->unk_3A4, 3, 7); this->unk_3C8 = 4; this->unk_3CA = 4; @@ -1351,7 +1351,7 @@ s32 func_80950690(EnGm* this, GlobalContext* globalCtx) { case 7: this->unk_3D0 += 992; if (DECR(this->unk_3B8) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_GO_SLEEP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_GO_SLEEP); this->unk_3B8 = 30; } break; @@ -1389,7 +1389,7 @@ s32 func_80950804(EnGm* this, GlobalContext* globalCtx) { Lib_Vec3f_TranslateAndRotateY(&this->unk_278, this->actor.world.rot.y, &sp38, &this->actor.world.pos); this->unk_3BA += this->unk_3C4; if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK); } } @@ -1443,7 +1443,7 @@ s32 func_8095097C(EnGm* this, GlobalContext* globalCtx) { this->unk_250 = sp50; this->unk_238 = sp58; } else if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PIRATE_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK); } return false; } @@ -1513,7 +1513,7 @@ void func_80950CDC(EnGm* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; sp20.unk0 = 0; } else { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.flags |= 1; } this->unk_258 = sp20.unk0; @@ -1569,7 +1569,7 @@ void func_80950F2C(EnGm* this, GlobalContext* globalCtx) { sp2C = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x20E)]->unk0; if (this->unk_259 != (sp2C & 0xFF)) { if (sp2C == 3) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIR_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL); } this->unk_259 = sp2C; func_8094E054(this, globalCtx, sp50[sp2C]); @@ -1597,7 +1597,7 @@ void EnGm_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 22.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060078B0, NULL, this->jointTable, this->morphTable, 20); this->unk_3E8 = -1; func_8094E054(this, globalCtx, 0); @@ -1641,7 +1641,7 @@ void EnGm_Update(Actor* thisx, GlobalContext* globalCtx) { func_8094F2E8(this); func_8013C964(&this->actor, globalCtx, this->unk_3B4, 30.0f, 0, this->unk_3A4 & 7); if ((this->unk_258 != 3) && (this->unk_258 != 5) && (this->unk_258 != 8)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); } func_8094E1DC(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 0f7bb8fb7..15e0b7622 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -645,7 +645,7 @@ void func_80A126BC(EnGo* this, GlobalContext* globalCtx) { } s32 func_80A12774(EnGo* this, GlobalContext* globalCtx) { - if (!(this->unk_390 & 7) || !func_800B84D0(&this->actor, globalCtx)) { + if (!(this->unk_390 & 7) || !Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { return false; } @@ -747,19 +747,19 @@ s32 func_80A12B78(EnGo* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state == 0) { if (this->unk_3DC == 4) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_CIRCLE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE); } if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); } } else if ((this->unk_3DC == 2) || (this->unk_3DC == 3)) { if (Animation_OnFrame(&this->skelAnime, 2.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_CIRCLE_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE_OFF); } if (Animation_OnFrame(&this->skelAnime, 24.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_STAND_IMT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_STAND_IMT); } } } @@ -1154,7 +1154,7 @@ s32 func_80A13B1C(EnGo* this, GlobalContext* globalCtx) { case 3: this->unk_3C2++; if (this->unk_3C2 >= 10) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_JUMP); this->actor.velocity.y = 10.0f; this->actor.gravity = -1.0f; this->unk_3C4++; @@ -1163,7 +1163,7 @@ s32 func_80A13B1C(EnGo* this, GlobalContext* globalCtx) { case 4: if (func_80A13564(this, 10.0f, 0.004f, 6)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_LAND_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_LAND_BIG); func_80A13728(this, globalCtx); this->unk_3C4++; this->unk_3C2 = 0; @@ -1207,7 +1207,7 @@ s32 func_80A13B1C(EnGo* this, GlobalContext* globalCtx) { break; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); return ret; } @@ -1231,7 +1231,7 @@ s32 func_80A13E80(EnGo* this, GlobalContext* globalCtx) { case 2: if (Animation_OnFrame(&this->skelAnime, 16.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_HAND_HIT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_HAND_HIT); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -1443,7 +1443,7 @@ void func_80A14798(EnGo* this, GlobalContext* globalCtx) { if ((this->unk_288 < 0) || func_8013D8DC(this->unk_288, globalCtx) || (this->unk_289 < 0) || func_8013D8DC(this->unk_289, globalCtx)) { - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable, this->morphTable, 18); @@ -1498,7 +1498,7 @@ void func_80A149B0(EnGo* this, GlobalContext* globalCtx) { s16 sp26 = this->actor.world.rot.y; if ((ENGO_GET_F(&this->actor) == ENGO_F_2) && (gSaveContext.entranceIndex == 0xD010)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_CHEER - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_CHEER - SFX_FLAG); } else if (ENGO_GET_F(&this->actor) != ENGO_F_8) { if (func_80A1222C(this, globalCtx)) { func_8013AED4(&this->unk_390, 0, 7); @@ -1565,7 +1565,7 @@ void func_80A14B30(EnGo* this, GlobalContext* globalCtx) { } else { sfxId = NA_SE_EN_GOLON_SNORE2; } - Audio_PlayActorSound2(&this->actor, sfxId); + Actor_PlaySfxAtPos(&this->actor, sfxId); } this->unk_3AE += 0x400; this->actor.shape.yOffset = (this->actor.scale.y / this->unk_3A4) * 14.0f; @@ -1603,7 +1603,7 @@ void func_80A14EB0(EnGo* this, GlobalContext* globalCtx) { EnGo* sp24 = (EnGo*)this->actor.child; if ((s32)(this->unk_39C * 3.0f) != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); Math_ApproachF(&this->unk_39C, 0.0f, 0.02f, 1.0f); this->unk_3A0 = (this->unk_39C / 0.9f) * 100.0f; func_80A139E4(this); @@ -1679,7 +1679,7 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) { case 6: if ((s32)(this->unk_39C * 3.0f) != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); Math_ApproachF(&this->unk_39C, 0.0f, 0.02f, 1.0f); this->unk_3A0 = (this->unk_39C / 0.9f) * 100.0f; func_80A139E4(this); @@ -1694,42 +1694,42 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) { case 55: case 100: case 130: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_COLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD); break; case 185: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WAKE_UP); break; case 250: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_EYE_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_EYE_BIG); break; case 465: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_IWAIGORON_SOLO); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IWAIGORON_SOLO); break; case 490: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); break; } } else if (sp36 == 0x81) { switch (globalCtx->csCtx.frames) { case 360: case 390: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_COLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD); break; case 430: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WAKE_UP); break; case 450: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_EYE_BIG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_EYE_BIG); break; case 480: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); break; } } @@ -1746,7 +1746,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) { Vec3f sp44; if ((this->unk_390 & 0x1000) && (this->actor.colChkInfo.damageEffect == 0xF)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); this->actor.flags &= ~0x10; this->actor.flags |= 0x2000000; @@ -1755,7 +1755,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) { this->actor.shape.rot.x = 0; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_COLD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD); if (gSaveContext.day == 3) { func_80A141D4(this, globalCtx); @@ -1766,7 +1766,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) { } } else if (this->unk_284 != NULL) { if (this->unk_390 & 0x800) { - func_800B8E58(&GET_PLAYER(globalCtx)->actor, NA_SE_PL_BODY_HIT); + func_800B8E58(GET_PLAYER(globalCtx), NA_SE_PL_BODY_HIT); func_800B8D50(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); } @@ -1785,7 +1785,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.bgCheckFlags & 1) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); func_800AE930(&globalCtx->colCtx, Effect_GetByIndex(this->unk_3E8), &this->actor.world.pos, 18.0f, this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); } else { @@ -1794,7 +1794,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) { this->actor.speedXZ = 4.0f; this->actor.shape.rot.x += (s16)(this->actor.speedXZ * 546.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 3a74a8a5f..dc8e0bfa5 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -119,7 +119,7 @@ static Vec3f D_80942E60 = { 0.0f, 1.0f, 0.0f }; static Vec3f D_80942E6C = { 0.0f, 0.0f, 1.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32_DIV1000(gravity, -900, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(minVelocityY, -26000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -900, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(terminalVelocity, -26000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 160, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 350, ICHAIN_STOP), }; @@ -371,7 +371,7 @@ s32 func_8093F34C(EnGoroiwa* this) { f32 z; Math_StepToF(&this->actor.speedXZ, D_80942DFC[this->unk_1E4], 0.3f); - Actor_SetVelocityYRotationAndGravity(&this->actor); + Actor_UpdateVelocityWithGravity(&this->actor); temp_v0 = &this->unk_1D0[this->unk_1D8]; this->actor.velocity.y *= 0.97f; x = temp_v0->x; @@ -495,7 +495,7 @@ s32 func_8093F6F8(EnGoroiwa* this, GlobalContext* globalCtx) { func_8093EF54(globalCtx, &sp48, &D_80942E30[ENGOROIWA_GET_C000(&this->actor)], &D_80942E3C[ENGOROIWA_GET_C000(&this->actor)], this->actor.scale.x); } - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BIGBALL_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGBALL_BOUND); } } } @@ -1001,7 +1001,7 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 595.0f, func_800B3FC0, 9.4f); + ActorShape_Init(&this->actor.shape, 595.0f, ActorShadow_DrawCircle, 9.4f); this->actor.shape.shadowAlpha = 200; func_8093EB58(this, globalCtx); @@ -1190,7 +1190,7 @@ void func_80941A10(EnGoroiwa* this, GlobalContext* globalCtx) { func_80941DB4(this); } - func_800B8E58(&player->actor, NA_SE_PL_BODY_HIT); + func_800B8E58(player, NA_SE_PL_BODY_HIT); if ((sp34 == 1) || (sp34 == 2)) { this->unk_1CC = 50; @@ -1230,7 +1230,7 @@ void func_80941A10(EnGoroiwa* this, GlobalContext* globalCtx) { } if (this->actor.bgCheckFlags & 1) { - Audio_PlayActorSound2(&this->actor, D_80942E9C[this->unk_1E4][this->actor.home.rot.x & 1]); + Actor_PlaySfxAtPos(&this->actor, D_80942E9C[this->unk_1E4][this->actor.home.rot.x & 1]); } } } @@ -1239,7 +1239,7 @@ void func_80941DB4(EnGoroiwa* this) { this->actionFunc = func_80941E28; func_8093EAB0(this, 6); this->actor.gravity = -0.86f; - this->actor.minVelocityY = -15.0f; + this->actor.terminalVelocity = -15.0f; this->actor.speedXZ *= 0.15f; this->actor.velocity.y = 5.0f; this->unk_1C4 = 1.0f; @@ -1288,7 +1288,7 @@ void func_80941FA4(EnGoroiwa* this, GlobalContext* globalCtx) { if (func_8094156C(this, globalCtx) == 0) { if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { func_800B8D50(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); - func_800B8E58(&player->actor, NA_SE_PL_BODY_HIT); + func_800B8E58(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { this->unk_1CC = 50; } @@ -1316,7 +1316,7 @@ void func_809420F0(EnGoroiwa* this, GlobalContext* globalCtx) { if (func_8094156C(this, globalCtx) == 0) { if ((this->collider.base.atFlags & AT_HIT) && !(player->stateFlags3 & 0x80000)) { func_800B8D50(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); - func_800B8E58(&player->actor, NA_SE_PL_BODY_HIT); + func_800B8E58(player, NA_SE_PL_BODY_HIT); if (((this->actor.home.rot.z & 3) == 1) || ((this->actor.home.rot.z & 3) == 2)) { this->unk_1CC = 50; } @@ -1592,7 +1592,7 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) { Matrix_SetStateRotationAndTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, &sp80); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - func_800BDFC0(globalCtx, phi_fp); + Gfx_DrawDListOpa(globalCtx, phi_fp); if ((ptr->unk_28 != 0) && (ptr->unk_2C > 0)) { OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1629,6 +1629,6 @@ void EnGoroiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc == func_8094220C) { func_80942B1C(this, globalCtx); } else if (this->actionFunc != func_80942604) { - func_800BDFC0(globalCtx, D_80942EB4[params]); + Gfx_DrawDListOpa(globalCtx, D_80942EB4[params]); } } diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index b5199982f..615d22859 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -5,6 +5,7 @@ */ #include "z_en_gs.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x02000019 @@ -35,7 +36,6 @@ s32 func_809995A4(EnGs* this, GlobalContext* globalCtx); void func_80999A8C(EnGs* this, GlobalContext* globalCtx); void func_80999AC0(EnGs* this); -extern Gfx gGameplayKeepDrawFlameDL[]; extern Gfx D_06000950[]; extern Gfx D_060009D0[]; extern Gfx D_06000A60[]; @@ -184,7 +184,7 @@ void func_80997D14(EnGs* this, GlobalContext* globalCtx) { void func_80997D38(EnGs* this, GlobalContext* globalCtx) { static f32 D_8099A408[] = { 40.0f, 60.0f, 40.0f, 40.0f }; - if (!func_80152498(&globalCtx->msgCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 0) { if (this->actor.xzDistToPlayer <= D_8099A408[this->actor.params]) { func_8013E8F8(&this->actor, globalCtx, D_8099A408[this->actor.params], D_8099A408[this->actor.params], 0, 0x2000, 0x2000); @@ -207,7 +207,7 @@ void func_80997DEC(EnGs* this, GlobalContext* globalCtx) { } void func_80997E4C(EnGs* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: func_801518B0(globalCtx, this->unk_210, &this->actor); break; @@ -284,8 +284,8 @@ void func_8099807C(EnGs* this, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx, this->unk_196)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 2); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); - Actor_SetSwitchFlag(globalCtx, this->unk_196); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); + Flags_SetSwitch(globalCtx, this->unk_196); } break; @@ -293,8 +293,8 @@ void func_8099807C(EnGs* this, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx, this->unk_196)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, 7); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); - Actor_SetSwitchFlag(globalCtx, this->unk_196); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); + Flags_SetSwitch(globalCtx, this->unk_196); } break; @@ -414,7 +414,7 @@ void func_809985B8(EnGs* this, GlobalContext* globalCtx) { void func_80998704(EnGs* this, GlobalContext* globalCtx) { this->unk_19D = 0; this->unk_19A &= ~(0x100 | 0x4); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_G_STONE_CHANGE_COLOR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_G_STONE_CHANGE_COLOR); this->actionFunc = func_8099874C; } @@ -503,7 +503,7 @@ void func_8099874C(EnGs* this, GlobalContext* globalCtx) { } void func_809989B4(EnGs* this, GlobalContext* globalCtx) { - func_800B8A1C(&this->actor, globalCtx, this->unk_20C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, this->unk_20C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_809989F4; } @@ -512,7 +512,7 @@ void func_809989F4(EnGs* this, GlobalContext* globalCtx) { this->actor.parent = NULL; func_80997D14(this, globalCtx); } else { - func_800B8A1C(&this->actor, globalCtx, this->unk_20C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, this->unk_20C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); } } @@ -521,7 +521,7 @@ s32 func_80998A48(EnGs* this, GlobalContext* globalCtx) { if (this->unk_19D == 0) { this->unk_216 = 200; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_1D4 = 0; this->unk_19A |= 1; @@ -536,9 +536,9 @@ s32 func_80998A48(EnGs* this, GlobalContext* globalCtx) { } else if (this->unk_19D == 1) { if (func_80998334(this, globalCtx, &this->unk_1DC, &this->unk_1E0, &this->unk_1D4, 0.8f, 0.007f, 0.001f, 7, 0) == 0.0f) { - if ((this->actor.params != ENGS_0) && !func_801690CC(globalCtx) && !func_80152498(&globalCtx->msgCtx)) { + if ((this->actor.params != ENGS_0) && !func_801690CC(globalCtx) && !Message_GetState(&globalCtx->msgCtx)) { this->unk_216 = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FAIVE_LUPY_COUNT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIVE_LUPY_COUNT); func_801518B0(globalCtx, 0x20D2, NULL); } this->unk_19A &= ~1; @@ -553,7 +553,7 @@ s32 func_80998BBC(EnGs* this, GlobalContext* globalCtx) { if (this->unk_19D == 0) { this->unk_216 = 200; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_1DC = 0.3f; this->unk_1E0 = 0.0f; @@ -584,7 +584,7 @@ s32 func_80998D44(EnGs* this, GlobalContext* globalCtx) { this->unk_216 = 200; this->unk_1DC = this->unk_1B0[0].y - 1.0f; this->unk_1E0 = -0.8f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_G_STONE_CRUSH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_G_STONE_CRUSH); this->unk_19A |= 1; this->unk_21C = 40; this->unk_21E = 11; @@ -615,7 +615,7 @@ s32 func_80998D44(EnGs* this, GlobalContext* globalCtx) { this->unk_21C = 10; this->unk_21E = 10; this->unk_1DC = 0.5f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_19D += 1; } } else if ((this->unk_19D == 4) && (func_80998334(this, globalCtx, &this->unk_1DC, &this->unk_1E0, &this->unk_1D4, @@ -664,7 +664,7 @@ s32 func_80998F9C(EnGs* this, GlobalContext* globalCtx) { this->unk_1E0 = 1.5f; this->unk_1E4 = this->unk_1B0[1].y - 1.0f; this->unk_1E8 = -0.3f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_STONE_GROW_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_STONE_GROW_UP); this->unk_19D = 3; } } @@ -714,7 +714,7 @@ s32 func_80998F9C(EnGs* this, GlobalContext* globalCtx) { this->unk_1E8 = 0.0f; this->unk_1F0 = 0.0f; this->unk_1EC = 0.5f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_21C = 20; this->unk_21E = 2; this->unk_19D = 6; @@ -737,7 +737,7 @@ s32 func_80998F9C(EnGs* this, GlobalContext* globalCtx) { } if ((u16)this->unk_19E[0].y < sp3A) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_STONE_ROLLING); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_STONE_ROLLING); } return sp4C; @@ -852,7 +852,7 @@ s32 func_809995A4(EnGs* this, GlobalContext* globalCtx) { sp54.x = this->actor.world.pos.x; sp54.y = this->actor.world.pos.y; sp54.z = this->actor.world.pos.z; - Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); EffectSsBomb2_SpawnLayered(globalCtx, &sp54, &bomb2Velocity, &bomb2Accel, 100, 20); this->unk_1D4 = 10; this->unk_19A |= 8; @@ -862,7 +862,7 @@ s32 func_809995A4(EnGs* this, GlobalContext* globalCtx) { func_800B9010(&this->actor, NA_SE_EV_STONE_LAUNCH - SFX_FLAG); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Math_SmoothStepToF(&this->unk_1DC, this->unk_1E0, 0.5f, 364.0f, 0.0f); this->unk_19E[1].y += (s16)this->unk_1DC; @@ -934,9 +934,9 @@ void func_80999BC8(Actor* thisx, GlobalContext* globalCtx2) { } if (this->actor.params == ENGS_1) { - Actor_SetHeight(&this->actor, 34.5f); + Actor_SetFocus(&this->actor, 34.5f); } else { - Actor_SetHeight(&this->actor, 23.0f); + Actor_SetFocus(&this->actor, 23.0f); } if (this->unk_21A > 0) { @@ -1007,12 +1007,12 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnGs* this = THIS; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { globalCtx->msgCtx.unk11F22 = 0; globalCtx->msgCtx.unk11F10 = 0; this->collider.base.acFlags &= ~AC_HIT; func_80997DEC(this, globalCtx); - } else if (func_800B8718(&this->actor, globalCtx)) { + } else if (func_800B8718(&this->actor, &globalCtx->state)) { this->unk_19A |= 0x200; this->collider.base.acFlags &= ~AC_HIT; if (this->actor.cutscene != -1) { @@ -1026,7 +1026,7 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actor.flags & 0x40) || (this->unk_19A & 0x100) || (this->unk_19A & 0x200)) { func_80999BC8(&this->actor, globalCtx); - func_800B8898(globalCtx, &this->actor, &sp2E, &sp2C); + Actor_GetScreenPos(globalCtx, &this->actor, &sp2E, &sp2C); if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > 320) || (sp2C < 0) || (sp2C > 240)) { this->unk_216 = 0; diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index 14a2ac839..b93a1befe 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -79,7 +79,7 @@ void EnGuruguru_Init(Actor* thisx, GlobalContext* globalCtx) { EnGuruguru* this = THIS; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 19.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16); this->actor.targetMode = 0; if (this->actor.params != 2) { @@ -170,7 +170,7 @@ void func_80BC6F14(EnGuruguru* this, GlobalContext* globalCtx) { yawTemp = this->actor.yawTowardsPlayer - this->actor.world.rot.y; yaw = ABS_ALT(yawTemp); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80BC701C(this, globalCtx); } else if (yaw <= 0x2890) { func_800B8614(&this->actor, globalCtx, 60.0f); @@ -197,7 +197,7 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); } else if (this->unusedTimer == 0) { this->unusedTimer = 6; - if (func_80152498(&globalCtx->msgCtx) != 5) { + if (Message_GetState(&globalCtx->msgCtx) != 5) { if (this->unk266 == 0) { if (this->headZRotTarget != 0) { this->headZRotTarget = 0; @@ -213,7 +213,7 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) { } } } - if ((func_80152498(&globalCtx->msgCtx) == 5) && (func_80147624(globalCtx))) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && (func_80147624(globalCtx))) { func_801477B4(globalCtx); this->headZRotTarget = 0; if ((this->textIdIndex == 13) || (this->textIdIndex == 14)) { @@ -301,21 +301,21 @@ void func_80BC7440(EnGuruguru* this, GlobalContext* globalCtx) { this->textIdIndex++; this->actor.textId = textIDs[this->textIdIndex]; func_801A3B48(1); - func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, -1); + func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, EXCH_ITEM_MINUS1); this->unk268 = 0; gSaveContext.weekEventReg[38] |= 0x40; this->actionFunc = func_80BC7520; } else { - func_800B8A1C(&this->actor, globalCtx, GI_MASK_BREMEN, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MASK_BREMEN, 300.0f, 300.0f); } } void func_80BC7520(EnGuruguru* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80BC7068; } else { - func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, -1); + func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, EXCH_ITEM_MINUS1); } } @@ -365,8 +365,8 @@ void EnGuruguru_Update(Actor* thisx, GlobalContext* globalCtx) { } } Actor_SetScale(&this->actor, 0.01f); - Actor_SetHeight(&this->actor, 50.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_SetFocus(&this->actor, 50.0f); + Actor_MoveWithGravity(&this->actor); Math_SmoothStepToS(&this->headXRot, this->headXRotTarget, 1, 3000, 0); Math_SmoothStepToS(&this->headZRot, this->headZRotTarget, 1, 1000, 0); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c index 0a0dccef7..416ab1140 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -72,14 +72,14 @@ extern Gfx D_06011178[]; void EnHakurock_Init(Actor* thisx, GlobalContext* globalCtx) { EnHakurock* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 52.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 52.0f); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (this->actor.params == EN_HAKUROCK_TYPE_BOULDER) { this->actor.gravity = -1.5f; } else { this->collider.base.ocFlags1 &= ~OC1_NO_PUSH; - this->actor.minVelocityY = -100.0f; + this->actor.terminalVelocity = -100.0f; this->actor.gravity = -7.0f; } func_80B21FFC(this); @@ -212,7 +212,7 @@ void func_80B221E8(EnHakurock* this, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_HIT || ((this->counter == 0) && (this->collider.base.ocFlags1 & OC1_HIT)) || ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROCK_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROCK_BROKEN); func_80B21EA4(this, 0); func_80B21FFC(this); } @@ -247,7 +247,7 @@ void func_80B2242C(EnHakurock* this, GlobalContext* globalCtx) { func_80B21FFC(this); } else if ((this->actor.bgCheckFlags & 1)) { func_80B21EA4(this, 2); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_OBJECT_STICK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OBJECT_STICK); func_80B224C0(this); } } @@ -322,7 +322,7 @@ void EnHakurock_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); rockParams = this->actor.params; if ((rockParams == EN_HAKUROCK_TYPE_BOULDER) || (rockParams == EN_HAKUROCK_TYPE_UNK_2)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, this->collider.dim.radius, 0.0f, 0x85); if (this->actor.floorHeight == BGCHECK_Y_MIN) { func_80B21FFC(this); diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index d7eec060d..c02ab0eaf 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -155,7 +155,7 @@ void EnHg_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80BCF354(EnHg* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BCF398; } @@ -167,13 +167,13 @@ void func_80BCF398(EnHg* this, GlobalContext* globalCtx) { } if ((gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.unk_12 == 0) && (globalCtx->csCtx.frames == 20 || globalCtx->csCtx.frames == 60)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE); } } } void func_80BCF468(EnHg* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80BCF4AC; } @@ -182,10 +182,10 @@ void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) { s32 pad; this->actor.speedXZ = 1.6f; - if (!(player->stateFlags2 & 0x08000000) && !func_80152498(&globalCtx->msgCtx)) { + if (!(player->stateFlags2 & 0x08000000) && !Message_GetState(&globalCtx->msgCtx)) { if (((this->skelAnime.curFrame > 9.0f) && (this->skelAnime.curFrame < 16.0f)) || ((this->skelAnime.curFrame > 44.0f) && (this->skelAnime.curFrame < 51.0f))) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3E8, 0x14); this->actor.world.rot.y = this->actor.shape.rot.y; } @@ -197,7 +197,7 @@ void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) { } void func_80BCF5F0(EnHg* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BCF634; } @@ -210,7 +210,7 @@ void func_80BCF634(EnHg* this, GlobalContext* globalCtx) { } void func_80BCF68C(EnHg* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80BCF6D0; } @@ -221,8 +221,8 @@ void func_80BCF6D0(EnHg* this, GlobalContext* globalCtx) { } void func_80BCF710(EnHg* this, GlobalContext* globalCtx) { - if (!func_80152498(&globalCtx->msgCtx)) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x24F, &this->actor); } else { func_800B8614(&this->actor, globalCtx, 80.0f); @@ -284,17 +284,17 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) { case 1: this->currentAnimation = 0; - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); break; case 2: this->cutscenes[2] = 0; this->currentAnimation = 3; - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); break; case 3: this->cutscenes[2] = 0; this->currentAnimation = 5; - func_800BDC5C(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); break; case 4: this->cutscenes[2] = 0; @@ -302,11 +302,11 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) { if ((this->unk218 == 1) || (this->unk218 == 3)) { func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS); } - func_800BDC5C(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); break; case 5: this->currentAnimation = 1; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); break; case 6: gSaveContext.weekEventReg[0x4B] |= 0x20; @@ -318,11 +318,11 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) { switch (this->currentAnimation) { case 3: this->currentAnimation = 4; - func_800BDC5C(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); break; case 5: this->currentAnimation = 6; - func_800BDC5C(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); break; } } diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 65f5e4d55..ff418b579 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -108,7 +108,7 @@ void EnHoll_SetupAction(EnHoll* this) { void EnHoll_SetPlayerSide(GlobalContext* globalCtx, EnHoll* this, Vec3f* transformedPlayerPos) { Player* player = GET_PLAYER(globalCtx); - Actor_CalcOffsetOrientedToDrawRotation(&this->actor, transformedPlayerPos, &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->actor, transformedPlayerPos, &player->actor.world.pos); this->playerSide = (transformedPlayerPos->z < 0.0f) ? EN_HOLL_BEHIND : EN_HOLL_BEFORE; } @@ -223,8 +223,8 @@ void EnHoll_TransparentIdle(EnHoll* this, GlobalContext* globalCtx) { f32 enHollTop; f32 playerDistFromCentralPlane; - Actor_CalcOffsetOrientedToDrawRotation(&this->actor, &transformedPlayerPos, - useViewEye ? &globalCtx->view.eye : &player->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->actor, &transformedPlayerPos, + useViewEye ? &globalCtx->view.eye : &player->actor.world.pos); enHollTop = (globalCtx->sceneNum == SCENE_PIRATE) ? EN_HOLL_TOP_PIRATE : EN_HOLL_TOP_DEFAULT; if ((transformedPlayerPos.y > EN_HOLL_BOTTOM_DEFAULT) && (transformedPlayerPos.y < enHollTop) && diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 7efae12fc..787fd8b57 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -7,9 +7,11 @@ struct EnHorse; typedef struct EnHorse { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x00C]; + /* 0x144 */ char unk_144[0xC]; /* 0x150 */ s32 unk_150; - /* 0x154 */ char unk_154[0x440]; + /* 0x154 */ char unk_154[0x98]; + /* 0x1EC */ UNK_TYPE4 unk_1EC; + /* 0x1F0 */ char unk_1F0[0x3A4]; } EnHorse; // size = 0x594 extern const ActorInit En_Horse_InitVars; diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 0b9932e25..627aec919 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -215,12 +215,13 @@ s32 func_808F3178(EnIn* this, GlobalContext* globalCtx) { this->unk260 = tmp = func_8013DB90(globalCtx, &this->unk248, -6.0f); if (this->unk260 != 0 && prevUnk260 == 0 && tmp) { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_CONCRETE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_CONCRETE); } this->unk261 = tmp = func_8013DB90(globalCtx, &this->unk254, -6.0f); if (this->unk261 != 0 && prevUnk261 == 0 && tmp) { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_CONCRETE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_CONCRETE); } + return 0; } @@ -258,7 +259,7 @@ s32 func_808F3334(EnIn* this, GlobalContext* globalCtx) { if (this->colliderJntSph.base.atFlags & AT_BOUNCED) { return 0; } - Audio_PlayActorSound2(&player->actor, 0x83E); + Actor_PlaySfxAtPos(&player->actor, 0x83E); func_800B8D98(globalCtx, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 6.0f); } return 1; @@ -356,7 +357,7 @@ void func_808F374C(EnIn* this, GlobalContext* globalCtx) { } } if (this->skelAnime.animation == &D_060198A8 && Animation_OnFrame(&this->skelAnime, 20.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_IN_CRY_0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_CRY_0); } if (SkelAnime_Update(&this->skelAnime)) { this->unk486 = this->unk488 %= 8; @@ -381,7 +382,7 @@ void func_808F395C(EnIn* this, GlobalContext* globalCtx) { if (this->unk4B0 == 0) { this->actionFunc = func_808F5A94; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; this->actionFunc = func_808F5A34; this->unk48C = 1; @@ -418,19 +419,19 @@ void func_808F39DC(EnIn* this, GlobalContext* globalCtx) { this->actor.textId = textId; this->actionFunc = func_808F395C; if (this->unk4B0 == 2) { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_IN_LOST); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_LOST); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_IN_JOY0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_JOY0); } } void func_808F3AD4(EnIn* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; this->unk48C = 1; this->actionFunc = func_808F5A94; } else { - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); } } @@ -444,17 +445,17 @@ void func_808F3B40(EnIn* this, GlobalContext* globalCtx) { textId = gSaveContext.day != 3 ? 0x3481 : 0x34A4; this->actor.textId = textId; } else { - func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); } } void func_808F3BD4(EnIn* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; this->unk48C = 1; this->actionFunc = func_808F5A94; } else { - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); } } @@ -468,17 +469,17 @@ void func_808F3C40(EnIn* this, GlobalContext* globalCtx) { textId = gSaveContext.day != 3 ? 0x346A : 0x3492; this->actor.textId = textId; } else { - func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); } } void func_808F3CD4(EnIn* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; this->unk48C = 1; this->actionFunc = func_808F5A94; } else { - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); } } @@ -492,7 +493,7 @@ void func_808F3D40(EnIn* this, GlobalContext* globalCtx) { this->actor.textId = textId; this->actor.flags |= 0x10000; } else { - func_800B8A1C(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f); } } @@ -606,7 +607,7 @@ void func_808F4054(GlobalContext* globalCtx, EnIn* this, s32 arg2, u16 textId) { } void func_808F4108(EnIn* this, GlobalContext* globalCtx, u16 textId) { - func_800B86C8(&this->actor, globalCtx, &this->unk4A4->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->unk4A4->actor); this->actor.textId = 0; this->unk4A4->actor.textId = textId; this->unk4A4->unk48C = 2; @@ -792,7 +793,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) { if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) { if (func_80114E90()) { this->actionFunc = func_808F3C40; - func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); func_801159EC(-globalCtx->msgCtx.unk1206C); ret = true; } else { @@ -938,7 +939,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) { func_808F35D8(this, globalCtx); if (func_80114E90()) { this->actionFunc = func_808F3B40; - func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); ret = true; } else { func_800E8EA0(globalCtx, &this->actor, 0x347F); @@ -962,7 +963,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) { break; case 0x347C: this->actionFunc = func_808F3D40; - func_800B8A1C(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f); func_808F35D8(this, globalCtx); ret = true; break; @@ -1044,7 +1045,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) { if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) { if (func_80114E90()) { this->actionFunc = func_808F3C40; - func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); func_801159EC(-globalCtx->msgCtx.unk1206C); ret = true; } else { @@ -1127,7 +1128,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) { break; case 0x349F: this->actionFunc = func_808F3D40; - func_800B8A1C(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f); func_808F35D8(this, globalCtx); ret = true; break; @@ -1142,7 +1143,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) { func_808F35D8(this, globalCtx); if (func_80114E90()) { this->actionFunc = func_808F3B40; - func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f); ret = true; } else { func_800E8EA0(globalCtx, &this->actor, 0x34A2); @@ -1222,7 +1223,7 @@ s32 func_808F5674(GlobalContext* globalCtx, EnIn* this, s32 arg2) { s32 pad; s32 ret = false; - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 2: func_808F4054(globalCtx, this, arg2, this->actor.textId); ret = true; @@ -1257,7 +1258,7 @@ s32 func_808F5728(GlobalContext* globalCtx, EnIn* this, s32 arg2, s32* arg3) { *arg3 = 1; return 0; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { *arg3 = 1; return 1; } @@ -1379,9 +1380,9 @@ void func_808F5C98(EnIn* this, GlobalContext* globalCtx) { } if (this->unk4A8 == 2) { if (this->unk4B0 == 2) { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_IN_LOST); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_LOST); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_IN_JOY0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_JOY0); } this->unk4A8 = 3; } else if (this->unk4A8 < 3) { @@ -1400,7 +1401,7 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) { s16 type; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014EA8, NULL, this->jointTable, this->morphTable, 20); func_808F30B0(&this->skelAnime, 0); Collider_InitCylinder(globalCtx, &this->colliderCylinder); @@ -1519,7 +1520,7 @@ void func_808F6334(EnIn* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s32 newUnk4C8; - newUnk4C8 = func_80152498(&globalCtx->msgCtx); + newUnk4C8 = Message_GetState(&globalCtx->msgCtx); this->unk4C4 += this->unk4C0 != 0.0f ? 40.0f : -40.0f; this->unk4C4 = CLAMP(this->unk4C4, 0.0f, 80.0f); diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index 94a360df8..37b6aace5 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -561,7 +561,7 @@ static InitChainEntry sInitChainRomani[] = { static InitChainEntry D_80B4EC68[] = { ICHAIN_F32(uncullZoneForward, 20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), + ICHAIN_F32(terminalVelocity, -100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; static InitChainEntry sInitChainDog[] = { @@ -1131,7 +1131,7 @@ void func_80B44A90(EnInvadepoh* this, GlobalContext* globalCtx) { this->actor.velocity.y *= 0.8f; this->actor.speedXZ *= 0.8f; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 40.0f, 0.0f, 5); } @@ -1207,7 +1207,7 @@ s32 func_80B44C80(EnInvadepoh* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(((sp60.z + temp_f0_2) * 0.9f) + sp6C.z, ((sp60.x + temp_f0_3) * 0.9f) + sp6C.x), 4, 0xFA0, 0x64); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (func_80B440B8(this, 50.0f, 15.0f)) { phi_v0 = 4; } else { @@ -1220,7 +1220,7 @@ s32 func_80B44C80(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B44E90(EnInvadepoh* this, GlobalContext* globalCtx) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 15.0f, 0.0f, 5); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x1F40, 0x64); } @@ -1377,7 +1377,7 @@ void EnInvadepoh_SetSysMatrix(Vec3f* vec) { s32 func_80B45550(EnInvadepoh* this, GlobalContext* globalCtx, f32 range, s32 arg3) { s32 pad; - Actor* actorIterator = globalCtx->actorCtx.actorList[ACTORCAT_DOOR].first; + Actor* actorIterator = globalCtx->actorCtx.actorLists[ACTORCAT_DOOR].first; s32 retVal = false; while (actorIterator != NULL) { @@ -1412,7 +1412,7 @@ s32 func_80B456A8(GlobalContext* globalCtx, Vec3f* vec) { Vec3f multDest; f32 wDest; - func_800B4EDC(globalCtx, vec, &multDest, &wDest); + Actor_GetProjectedPos(globalCtx, vec, &multDest, &wDest); if (((multDest.z > 1.0f) && (fabsf(multDest.x * wDest) < 1.0f)) && (fabsf(multDest.y * wDest) < 1.0f)) { s32 wX = (multDest.x * wDest * 160.0f) + 160.0f; s32 wY = (multDest.y * wDest * -120.0f) + 120.0f; @@ -1720,7 +1720,7 @@ void EnInvadepoh_InitAlien(EnInvadepoh* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, D_80B4EC24); Collider_InitCylinder(globalCtx, &this->collider); - ActorShape_Init(&this->actor.shape, 6800.0f, func_800B4088, 150.0f); + ActorShape_Init(&this->actor.shape, 6800.0f, ActorShadow_DrawWhiteCircle, 150.0f); this->actor.shape.shadowAlpha = 140; this->actor.flags = 0x80001010; if (INVADEPOH_TYPE(this) == TYPE_ALIEN1) { @@ -1768,7 +1768,7 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, GlobalContext* globalCtx) { func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_NPC); Collider_InitCylinder(globalCtx, &this->collider); if (temp != 4) { - ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 18.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 18.0f); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitRomaniAndCremia); this->actor.colChkInfo.mass = MASS_IMMOVABLE; } @@ -1842,7 +1842,7 @@ void EnInvadepoh_InitDog(EnInvadepoh* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitDog); this->actor.colChkInfo.mass = 0x50; - ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); this->bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_DOG); if (this->bankIndex < 0) { Actor_MarkForDeath(&this->actor); @@ -1858,7 +1858,7 @@ void EnInvadepoh_InitCremia(EnInvadepoh* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitRomaniAndCremia); this->actor.colChkInfo.mass = MASS_HEAVY; - ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 18.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 18.0f); this->bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MA2); if (this->bankIndex < 0) { Actor_MarkForDeath(&this->actor); @@ -2231,7 +2231,7 @@ void func_80B47830(EnInvadepoh* this) { this->collider.base.acFlags &= ~1; this->collider.base.ocFlags1 |= 1; Animation_PlayLoop(&this->skelAnime, &D_060006C8); - func_800BCB70(&this->actor, 0x4000, 255, 0, 16); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); this->alienAlpha = 255; this->actor.draw = func_80B4DB14; this->drawAlien = true; @@ -2323,7 +2323,7 @@ void func_80B47BAC(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B45080(); this->actor.update = func_80B47D30; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004E50, &D_06001D80, this->jointTable, this->morphTable, @@ -2406,7 +2406,7 @@ void func_80B47FA8(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, thisx); + Actor_SetObjectDependency(globalCtx, thisx); this->actor.update = func_80B48060; this->actor.draw = func_80B4E158; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable, 6); @@ -2449,7 +2449,7 @@ void func_80B481C4(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); this->actor.update = func_80B4827C; this->actor.draw = func_80B4E1B0; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004C30, NULL, this->jointTable, this->morphTable, 6); @@ -2562,7 +2562,7 @@ void func_80B48620(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); this->actor.update = func_80B4873C; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06009E58, this->jointTable, this->morphTable, @@ -2619,7 +2619,7 @@ void func_80B48848(EnInvadepoh* this, GlobalContext* globalCtx) { func_80B43E6C(this, 6, this->behaviorInfo.unk4C, 0x46); if (((this->actor.flags & 0x40) == 0x40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->actionTimer > 0) { this->actionTimer--; @@ -2754,7 +2754,7 @@ void func_80B48E4C(EnInvadepoh* this, GlobalContext* globalCtx) { diff = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y); temp_v1 = diff * 0.7f; substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { func_80B48948(this); } } @@ -2764,7 +2764,7 @@ void func_80B48FB0(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); this->actor.update = func_80B490F0; this->actor.draw = func_80B4E324; @@ -2784,7 +2784,7 @@ void func_80B490F0(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnInvadepoh* this = THIS; s32 sp2C = (this->actor.flags & 0x40) == 0x40; - s32 isTalking = func_800B84D0(&this->actor, globalCtx); + s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); if (isTalking) { func_80151BB4(globalCtx, 5); @@ -2815,7 +2815,7 @@ void func_80B49228(EnInvadepoh* this, GlobalContext* globalCtx) { s32 pad; f32 temp_f0; - Actor_SetVelocityYRotationAndGravity(&this->actor); + Actor_UpdateVelocityWithGravity(&this->actor); this->actor.velocity.y *= 0.97f; temp_f0 = Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + D_80B4E934.y + 300.0f, 0.7f, fabsf(this->actor.velocity.y), 1.0f); @@ -2844,7 +2844,7 @@ void func_80B4934C(EnInvadepoh* this, GlobalContext* globalCtx) { this->actor.gravity = -2.0f; } this->actor.velocity.y *= 0.96f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_800B9010(&this->actor, NA_SE_EV_UFO_APPEAR - SFX_FLAG); this->actionTimer--; if (this->actionTimer <= 0) { @@ -2931,7 +2931,7 @@ void func_80B49670(EnInvadepoh* this, GlobalContext* globalCtx) { this->actor.gravity = 2.0f; } this->actor.velocity.y *= 0.97f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (D_80B4E940 == 3) { func_80B499BC(this); } @@ -2961,7 +2961,7 @@ void func_80B497EC(EnInvadepoh* this, GlobalContext* globalCtx) { this->actor.gravity = 2.0f; } this->actor.velocity.y *= 0.97f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->actionTimer > 0) { this->actionTimer--; } else { @@ -2981,7 +2981,7 @@ void func_80B49904(EnInvadepoh* this) { void func_80B4994C(EnInvadepoh* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 150.0f, 4.0f); this->actor.velocity.y *= 0.95f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->actionTimer > 0) { this->actionTimer--; } else { @@ -3013,7 +3013,7 @@ void func_80B49A00(EnInvadepoh* this, GlobalContext* globalCtx) { } else { this->actor.gravity = 2.0f; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->actionTimer > 0) { this->actionTimer--; @@ -3072,7 +3072,7 @@ void func_80B49C38(EnInvadepoh* this, GlobalContext* globalCtx) { if (((this->actor.flags & 0x40) == 0x40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->clockTime >= 0.9999f) { Actor_MarkForDeath(&this->actor); @@ -3102,7 +3102,7 @@ void func_80B49DFC(EnInvadepoh* this, GlobalContext* globalCtx) { temp_v1 = diff; temp_v1 *= 0.7f; substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { if (this->actor.textId == 0x332D) { gSaveContext.weekEventReg[54] |= 0x10; this->actor.textId = 0x332E; @@ -3119,7 +3119,7 @@ void func_80B49F88(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { sp38 = gSaveContext.time; this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, 23); @@ -3167,7 +3167,7 @@ void func_80B4A1B8(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnInvadepoh* this = THIS; s32 sp2C = (this->actor.flags & 0x40) == 0x40; - s32 isTalking = func_800B84D0(&this->actor, globalCtx); + s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); if (isTalking) { func_80151BB4(globalCtx, 5); @@ -3298,7 +3298,7 @@ void func_80B4A67C(EnInvadepoh* this, GlobalContext* globalCtx) { } if (((this->actor.flags & 0x40) == 0x40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->pathIndex == this->endPoint) { func_80B4A2C0(this); @@ -3329,7 +3329,7 @@ void func_80B4A81C(EnInvadepoh* this, GlobalContext* globalCtx) { temp_v1 *= 0.7f; substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { if (this->actor.textId == 0x332D) { gSaveContext.weekEventReg[54] |= 0x10; this->actor.textId = 0x332E; @@ -3350,7 +3350,7 @@ void func_80B4A9C8(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { sp38 = gSaveContext.time; this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, 23); @@ -3396,7 +3396,7 @@ void func_80B4ABDC(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnInvadepoh* this = THIS; s32 sp2C = (this->actor.flags & 0x40) == 0x40; - s32 isTalking = func_800B84D0(&this->actor, globalCtx); + s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); if (isTalking) { func_80151BB4(globalCtx, 5); @@ -3432,7 +3432,7 @@ void func_80B4AD3C(EnInvadepoh* this) { } void func_80B4AD60(EnInvadepoh* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnInvadepoh_SetTextID(this, globalCtx, 0x3331); func_80B4ADB8(this); } else { @@ -3445,7 +3445,7 @@ void func_80B4ADB8(EnInvadepoh* this) { } void func_80B4ADCC(EnInvadepoh* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { if (this->textId == 0x3331) { if (gSaveContext.weekEventReg[22] & 2) { EnInvadepoh_SetTextID(this, globalCtx, 0x3334); @@ -3482,7 +3482,7 @@ void func_80B4AEDC(EnInvadepoh* this, GlobalContext* globalCtx) { gSaveContext.weekEventReg[22] |= 2; func_80B4AF80(this); } else { - func_800B8A1C(&this->actor, globalCtx, GI_MILK_BOTTLE, 2000.0f, 2000.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MILK_BOTTLE, 2000.0f, 2000.0f); } } @@ -3491,14 +3491,14 @@ void func_80B4AF80(EnInvadepoh* this) { } void func_80B4AF94(EnInvadepoh* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnInvadepoh_SetTextID(this, globalCtx, 0x3334); func_80151BB4(globalCtx, 0x1E); func_80151BB4(globalCtx, 0x1D); func_80151BB4(globalCtx, 5); func_80B4ADB8(this); } else { - func_800B85E0(&this->actor, globalCtx, 2000.0f, -1); + func_800B85E0(&this->actor, globalCtx, 2000.0f, EXCH_ITEM_MINUS1); } } @@ -3511,7 +3511,7 @@ void func_80B4B048(EnInvadepoh* this, GlobalContext* globalCtx) { if (globalCtx->msgCtx.unk120B1 == 0) { if (globalCtx->msgCtx.unk11F22 == 0) { D_80B4E998 = 1; - } else if ((func_80152498(&globalCtx->msgCtx) == 6) || (func_80152498(&globalCtx->msgCtx) == 5)) { + } else if ((Message_GetState(&globalCtx->msgCtx) == 6) || (Message_GetState(&globalCtx->msgCtx) == 5)) { D_80B4E998 = 1; } } @@ -3524,7 +3524,7 @@ void func_80B4B0C4(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); this->actor.update = func_80B4B218; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, @@ -3571,7 +3571,7 @@ void func_80B4B3DC(EnInvadepoh* this) { s32 pad; if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_MONKEY_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONKEY_WALK); } } @@ -3634,7 +3634,7 @@ void func_80B4B564(EnInvadepoh* this, GlobalContext* globalCtx) { this->actionTimer--; } else if (this->unk3BC >= 0) { if ((D_80B50348 == 0) && (Rand_ZeroOne() < 0.4f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_GROAN); } func_80B4B724(this); } else { @@ -3655,7 +3655,7 @@ void func_80B4B768(EnInvadepoh* this, GlobalContext* globalCtx) { 0x64); func_80B44E90(this, globalCtx); if (Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 19.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK); } if (this->animPlayFlag) { func_80B4B510(this); @@ -3681,7 +3681,7 @@ void func_80B4B8BC(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, &D_060021C8, this->jointTable, this->morphTable, 13); func_80B45C04(&this->behaviorInfo, 0, 0, 0, 0, &gZeroVec3s, 3000, 0.1f, 0.0f, 0.0f); @@ -3832,7 +3832,7 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) { if (((this->actor.flags & 0x40) == 0x40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (gSaveContext.time > CLOCK_TIME(20, 15)) { Actor_MarkForDeath(&this->actor); @@ -3868,7 +3868,7 @@ void func_80B4C058(EnInvadepoh* this, GlobalContext* globalCtx) { substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { func_80B4BBE0(this); } } @@ -3914,7 +3914,7 @@ void func_80B4C3A0(Actor* thisx, GlobalContext* globalCtx) { s32 currentTime = gSaveContext.time; this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44FEC(); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06015C28, &D_06016720, this->jointTable, this->morphTable, 22); @@ -3958,7 +3958,7 @@ void func_80B4C5C0(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnInvadepoh* this = THIS; s32 sp2C = (this->actor.flags & 0x40) == 0x40; - s32 isTalking = func_800B84D0(&this->actor, globalCtx); + s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); if (isTalking) { func_80151BB4(globalCtx, 6); @@ -4053,7 +4053,7 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) { if (((this->actor.flags & 0x40) == 0x40) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } if (this->clockTime >= 0.9999f) { @@ -4090,7 +4090,7 @@ void func_80B4CB0C(EnInvadepoh* this, GlobalContext* globalCtx) { temp_v1 = diff; temp_v1 *= 0.7f; substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { func_80B4C6C8(this); } } @@ -4135,7 +4135,7 @@ void func_80B4CE54(Actor* thisx, GlobalContext* globalCtx) { sp38 = gSaveContext.time; this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, 23); @@ -4174,7 +4174,7 @@ void func_80B4D054(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnInvadepoh* this = THIS; s32 sp2C = (this->actor.flags & 0x40) == 0x40; - s32 isTalking = func_800B84D0(&this->actor, globalCtx); + s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); if (isTalking) { func_80151BB4(globalCtx, 5); @@ -4323,7 +4323,7 @@ void func_80B4D670(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { invadepohType = this->actor.params & 7; this->actor.objBankIndex = this->bankIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); func_80B45080(); this->actor.update = func_80B4D760; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004E50, &D_06001674, this->jointTable, this->morphTable, diff --git a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c index 603420f76..ff1f9b6ca 100644 --- a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c +++ b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c @@ -68,7 +68,7 @@ static InitChainEntry D_80C1AAB0[] = { ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -100, ICHAIN_CONTINUE), + ICHAIN_F32(terminalVelocity, -100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 800, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c index f459fbf53..360927533 100644 --- a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c +++ b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c @@ -78,7 +78,7 @@ void func_80C2590C(EnInvisibleRuppe* this, GlobalContext* globalCtx) { } if (this->unk_190 >= 0) { - Actor_SetSwitchFlag(globalCtx, this->unk_190); + Flags_SetSwitch(globalCtx, this->unk_190); } this->actionFunc = func_80C259E8; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index e1ce0892f..abc5474d8 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -124,14 +124,14 @@ static Vec3f D_8095F778 = { 0.0f, 1.0f, 0.0f }; static InitChainEntry sInitChain[][5] = { { ICHAIN_F32_DIV1000(gravity, -1200, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP), }, { ICHAIN_F32_DIV1000(gravity, -2500, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 250, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP), @@ -333,8 +333,8 @@ void func_8095DFF0(EnIshi* this, GlobalContext* globalCtx) { void func_8095E14C(EnIshi* this) { this->actor.velocity.y += this->actor.gravity; - if (this->actor.velocity.y < this->actor.minVelocityY) { - this->actor.velocity.y = this->actor.minVelocityY; + if (this->actor.velocity.y < this->actor.terminalVelocity) { + this->actor.velocity.y = this->actor.terminalVelocity; } } @@ -403,7 +403,7 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (sp34 == 1) { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowScale = 2.3f; } else { this->actor.shape.shadowScale = 2.4f; @@ -471,7 +471,7 @@ void func_8095E660(EnIshi* this, GlobalContext* globalCtx) { if (ENISHI_GET_2(&this->actor)) { func_8095E204(this, globalCtx); } - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; return; } @@ -508,9 +508,9 @@ void func_8095E660(EnIshi* this, GlobalContext* globalCtx) { if ((this->actor.xzDistToPlayer < 90.0f) && (sp30 == 0)) { if (sp38 == 1) { - func_800B8A1C(&this->actor, globalCtx, 0, 80.0f, 20.0f); + Actor_PickUp(&this->actor, globalCtx, 0, 80.0f, 20.0f); } else { - func_800B8A1C(&this->actor, globalCtx, 0, 50.0f, 10.0f); + Actor_PickUp(&this->actor, globalCtx, 0, 50.0f, 10.0f); } } } @@ -530,12 +530,12 @@ void func_8095E95C(EnIshi* this, GlobalContext* globalCtx) { if (Actor_HasNoParent(&this->actor, globalCtx)) { this->actor.room = globalCtx->roomCtx.currRoom.num; if (ENISHI_GET_1(&this->actor) == 1) { - Actor_SetSwitchFlag(globalCtx, ENISHI_GET_FE00(&this->actor)); + Flags_SetSwitch(globalCtx, ENISHI_GET_FE00(&this->actor)); } func_8095EA70(this); func_8095E14C(this); func_8095E180(&this->actor.velocity, D_8095F6C8[ENISHI_GET_1(&this->actor)]); - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); } else { sp30.x = this->actor.world.pos.x; @@ -623,7 +623,7 @@ void func_8095EBDC(EnIshi* this, GlobalContext* globalCtx) { EffectSsGRipple_Spawn(globalCtx, &sp58, 500, 900, 4); } - this->actor.minVelocityY = -6.0f; + this->actor.terminalVelocity = -6.0f; this->actor.velocity.x *= 0.12f; this->actor.velocity.y *= 0.4f; this->actor.velocity.z *= 0.12f; @@ -639,7 +639,7 @@ void func_8095EBDC(EnIshi* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f); func_8095E14C(this); func_8095E180(&this->actor.velocity, D_8095F6C8[sp70]); - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); this->actor.shape.rot.x += D_8095F690; this->actor.shape.rot.y += D_8095F694; Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); @@ -693,7 +693,7 @@ void func_8095F210(EnIshi* this, GlobalContext* globalCtx) { s32 sp28; if ((this->actor.projectedPos.z <= 1200.0f) || ((this->unk_197 & 1) && (this->actor.projectedPos.z < 1300.0f))) { - func_800BDFC0(globalCtx, gameplay_field_keep_DL_0066B0); + Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0066B0); return; } @@ -751,5 +751,5 @@ void func_8095F61C(Actor* thisx, GlobalContext* globalCtx) { } void func_8095F654(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, object_ishi_DL_0009B0); + Gfx_DrawDListOpa(globalCtx, object_ishi_DL_0009B0); } diff --git a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c index 7390d9f7c..c1b5d1327 100644 --- a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c +++ b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c @@ -94,7 +94,7 @@ s32 EnJcMato_CheckForHit(EnJcMato* this, GlobalContext* globalCtx) { this->collider.dim.worldSphere.center.z = this->pos.z; if ((this->collider.base.acFlags & AC_HIT) && !this->hitFlag && (this->actor.colChkInfo.damageEffect == 0xF)) { this->collider.base.acFlags &= ~AC_HIT; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); globalCtx->interfaceCtx.unk_25C = 1; this->hitFlag = 1; return 1; @@ -128,7 +128,7 @@ void EnJcMato_Idle(EnJcMato* this, GlobalContext* globalCtx) { void EnJcMato_Init(Actor* thisx, GlobalContext* globalCtx) { EnJcMato* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); Collider_InitSphere(globalCtx, &this->collider); Collider_SetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit); this->collider.dim.worldSphere.radius = 0xF; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index be3fe843d..60857e860 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -190,7 +190,7 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) { this->songSummonDist = 80.0f; EnKakasi_SetupIdleUnderground(this); } else { - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->unkFunc = EnKakasi_8096F88C; if (gSaveContext.weekEventReg[83] & 0x1) { EnKakasi_InitTimeSkipDialogue(this); @@ -221,24 +221,24 @@ void EnKakasi_8096F88C(GlobalContext* globalCtx, EnKakasi* this) { void EnKakasi_CheckAnimationSfx(EnKakasi* this) { if (this->animIndex == ENKAKASI_ANIM_SIDEWAYS_SHAKING || this->animIndex == ENKAKASI_ANIM_ARMS_CROSSED_STILL) { if (Animation_OnFrame(&this->skelanime, 1.0f) || Animation_OnFrame(&this->skelanime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_KAKASHI_SWING); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KAKASHI_SWING); } } if (this->animIndex == ENKAKASI_ANIM_HOPPING_REGULAR || this->animIndex == ENKAKASI_ANIM_SLOWROLL) { if (Animation_OnFrame(&this->skelanime, 4.0f) || Animation_OnFrame(&this->skelanime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_KAKASHI_SWING); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KAKASHI_SWING); } if (Animation_OnFrame(&this->skelanime, 1.0f) || Animation_OnFrame(&this->skelanime, 9.0f) || Animation_OnFrame(&this->skelanime, 16.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_IT_KAKASHI_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_KAKASHI_JUMP); } if (Animation_OnFrame(&this->skelanime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_KAKASHI_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KAKASHI_ROLL); } } if (this->animIndex == ENKAKASI_ANIM_SPIN_REACH_OFFER || this->animIndex == ENKAKASI_ANIM_TWIRL) { if (Animation_OnFrame(&this->skelanime, 1.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_KAKASH_LONGI_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_KAKASH_LONGI_ROLL); } } } @@ -323,7 +323,7 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, GlobalContext* globalCtx) { this->actor.flags |= 0x10000; } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { player->stateFlags1 &= ~0x20; this->unkState196 = 2; this->actor.flags &= ~0x10000; @@ -347,18 +347,18 @@ void EnKakasi_IdleStanding(EnKakasi* this, GlobalContext* globalCtx) { // first talk to scarecrow dialogue this->actor.textId = 0x1644; - if (func_800B8718(&this->actor, globalCtx) != 0) { + if (func_800B8718(&this->actor, &globalCtx->state)) { this->skelanime.playSpeed = 1.0f; EnKakasi_SetupSongTeach(this, globalCtx); return; } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->skelanime.playSpeed = 1.0f; EnKakasi_SetupDialogue(this); return; } if (globalCtx->actorCtx.unk5 & 0x4) { - func_800B8898(globalCtx, &this->actor, &passedValue1, &passedValue2); + Actor_GetScreenPos(globalCtx, &this->actor, &passedValue1, &passedValue2); if (this->actor.projectedPos.z > -20.0f && passedValue1 > 0 && passedValue1 < 0x140 && passedValue2 > 0 && passedValue2 < 0xF0 && this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) { // faster shaking @@ -424,7 +424,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) { this->unkState1A8 = 0; } - if (this->unkMsgState1AC == func_80152498(&globalCtx->msgCtx) && func_80147624(globalCtx) != 0) { + if (this->unkMsgState1AC == Message_GetState(&globalCtx->msgCtx) && func_80147624(globalCtx) != 0) { func_801477B4(globalCtx); if (this->unkMsgState1AC == 5) { // bad song input @@ -569,7 +569,7 @@ void EnKakasi_SetupSongTeach(EnKakasi* this, GlobalContext* globalCtx) { * before actually teaching */ void EnKakasi_OcarinaRemark(EnKakasi* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx) != 0) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx) != 0) { func_80152434(globalCtx, 0x35); this->unkState1A8 = 0; if (ActorCutscene_GetCurrentIndex() == 0x7C) { @@ -631,7 +631,7 @@ void EnKakasi_TeachingSong(EnKakasi* this, GlobalContext* globalCtx) { this->unk190 = 0; this->unkCounter1A4 = 0; ActorCutscene_Stop(this->actorCutscenes[0]); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_YASE_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YASE_DEAD); if (this) {} this->unkState196 = 2; this->cutsceneCamId = MAIN_CAM; @@ -743,7 +743,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, GlobalContext* globalCtx) { func_8096FAAC(this, globalCtx); - if (this->unkState1A8 != 0 && func_80152498(&globalCtx->msgCtx) == this->unkMsgState1AC && + if (this->unkState1A8 != 0 && Message_GetState(&globalCtx->msgCtx) == this->unkMsgState1AC && func_80147624(globalCtx) != 0) { func_801477B4(globalCtx); @@ -1014,9 +1014,9 @@ void EnKakasi_DiggingAway(EnKakasi* this, GlobalContext* globalCtx) { Audio_PlaySoundAtPosition(globalCtx, &tempWorldPos, 0x32, NA_SE_EV_BOMB_DROP_WATER); } else { - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 5, - 4.0f, 200, 10, 1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, + this->actor.shape.shadowScale - 20.0f, 5, 4.0f, 200, 10, 1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); } } @@ -1065,7 +1065,7 @@ void EnKakasi_SetupRiseOutOfGround(EnKakasi* this, GlobalContext* globalCtx) { } else { ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[cutsceneIndex], &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actor.draw = EnKakasi_Draw; this->unkState196 = 6; this->actionFunc = EnKakasi_RisingOutOfGround; @@ -1080,9 +1080,9 @@ void EnKakasi_RisingOutOfGround(EnKakasi* this, GlobalContext* globalCtx) { } if (this->actor.shape.yOffset < -10.0f) { if ((globalCtx->gameplayFrames % 8) == 0) { - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10, - 8.0f, 500, 10, 1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, + this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); } Math_ApproachF(&this->actor.shape.yOffset, 0.0f, 0.5f, 200.0f); } else { @@ -1100,7 +1100,7 @@ void EnKakasi_SetupIdleRisen(EnKakasi* this) { void EnKakasi_IdleRisen(EnKakasi* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 1000, 0); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = EnKakasi_RisenDialogue; } else { func_800B8614(&this->actor, globalCtx, 70.0f); @@ -1110,7 +1110,7 @@ void EnKakasi_IdleRisen(EnKakasi* this, GlobalContext* globalCtx) { void EnKakasi_RisenDialogue(EnKakasi* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 1000, 0); - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx) != 0) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx) != 0) { func_801477B4(globalCtx); EnKakasi_SetupIdleRisen(this); } @@ -1140,11 +1140,11 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) { } } } else { - Actor_SetHeight(&this->actor, this->unkHeight); + Actor_SetFocus(&this->actor, this->unkHeight); } this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 0x1C); if (this->actor.draw != NULL) { Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c index 71482f79f..7aae7b7dd 100644 --- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c +++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c @@ -129,7 +129,7 @@ void EnKame_Init(Actor* thisx, GlobalContext* globalCtx) { this->morphTable1, 13); SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &object_tl_Skel_001A50, &object_tl_Anim_000B30, this->jointTable2, this->morphTable2, 4); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 55.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 55.0f); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -170,7 +170,7 @@ void func_80AD6F9C(EnKame* this) { this->collider.base.colType = COLTYPE_HIT3; this->unk_2A2 = 80; this->actor.flags &= ~0x400; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_80AD7018(EnKame* this, GlobalContext* globalCtx) { @@ -178,7 +178,7 @@ void func_80AD7018(EnKame* this, GlobalContext* globalCtx) { this->unk_29D = 0; this->collider.base.colType = COLTYPE_HIT6; this->unk_2B0 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_2C8, 10, 2, 0.3f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2C8, 10, 2, 0.3f, 0.2f); this->actor.flags |= 0x400; } } @@ -193,7 +193,7 @@ void func_80AD70EC(EnKame* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (Animation_OnFrame(&this->skelAnime1, 10.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_VOICE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_VOICE); this->unk_2A0 = 40; } @@ -237,7 +237,7 @@ void func_80AD7254(EnKame* this, GlobalContext* globalCtx) { if (this->unk_29E == 0) { func_80AD70A0(this); } else if (Animation_OnFrame(&this->skelAnime1, 0.0f) || Animation_OnFrame(&this->skelAnime1, 15.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_WALK); } } @@ -248,7 +248,7 @@ void func_80AD73A8(EnKame* this) { this->unk_2A8 = 1.0f; this->actor.speedXZ = 0.0f; if (this->unk_2A0 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_VOICE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_VOICE); } this->actionFunc = func_80AD7424; } @@ -313,7 +313,7 @@ void func_80AD76CC(EnKame* this) { func_80AD7568(this); this->unk_29E = 15; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_ON); this->unk_2BC.y = this->actor.home.pos.y - 100.0f; } else { this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); @@ -383,7 +383,7 @@ void func_80AD7948(EnKame* this, GlobalContext* globalCtx) { if (Math_ScaledStepToS(&this->unk_2A6, this->unk_29E, (s32)(this->unk_2A6 * 0.09f) + 45)) { if (this->unk_29E == 0) { if (this->unk_2AC >= 1.0f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_CUTTER_OFF); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_OFF); } this->unk_2AC -= 0.1f; this->collider.base.atFlags &= ~AT_ON; @@ -440,7 +440,7 @@ void func_80AD7C54(EnKame* this) { this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT); this->actor.flags &= ~0x10; this->actor.shape.rot.z = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_REVERSE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_REVERSE); this->actionFunc = func_80AD7D40; } @@ -472,7 +472,7 @@ void func_80AD7E0C(EnKame* this, GlobalContext* globalCtx) { Animation_PlayOnce(&this->skelAnime1, &object_tl_Anim_0027D8); } else { Animation_PlayOnce(&this->skelAnime1, &object_tl_Anim_002F88); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_ROAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_ROAR); } } } else { @@ -482,13 +482,13 @@ void func_80AD7E0C(EnKame* this, GlobalContext* globalCtx) { void func_80AD7EC0(EnKame* this) { Animation_MorphToPlayOnce(&this->skelAnime1, &object_tl_Anim_002510, -3.0f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_WAKEUP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_WAKEUP); this->actionFunc = func_80AD7F10; } void func_80AD7F10(EnKame* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime1)) { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; func_80AD71B4(this); } else if (this->skelAnime1.curFrame >= 10.0f) { this->actor.shape.shadowDraw = NULL; @@ -526,8 +526,8 @@ void func_80AD8060(EnKame* this) { s16 sp36 = Animation_GetLastFrame(&object_tl_Anim_0008B4); Animation_Change(&this->skelAnime1, &object_tl_Anim_0008B4, 1.0f, 0.0f, sp36, 2, -3.0f); - func_800BCB70(&this->actor, 0x4000, 255, 0, sp36); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_DAMAGE); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, sp36); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_DAMAGE); this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_80AD810C; } @@ -540,7 +540,7 @@ void func_80AD810C(EnKame* this, GlobalContext* globalCtx) { void func_80AD8148(EnKame* this, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelAnime1, &object_tl_Anim_000AF4); - func_800BCB70(&this->actor, 0x4000, 255, 0, 20); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); this->collider.base.acFlags &= ~AC_ON; this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~(AC_HARD | AC_HIT); @@ -557,7 +557,7 @@ void func_80AD8148(EnKame* this, GlobalContext* globalCtx) { this->actor.bgCheckFlags &= ~0x1; this->actor.flags &= ~0x1; this->actor.flags |= 0x10; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PAMET_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_DEAD); this->unk_29E = 0; this->actionFunc = func_80AD825C; } @@ -565,13 +565,13 @@ void func_80AD8148(EnKame* this, GlobalContext* globalCtx) { void func_80AD825C(EnKame* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime1); if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y < 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_HIPLOOP_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HIPLOOP_LAND); func_80AD8364(this); } else { if (this->unk_29E == 1) { this->actor.colorFilterTimer = 100; } else if (this->actor.colorFilterTimer == 0) { - func_800BCB70(&this->actor, 0xC000, 255, 0, 100); + Actor_SetColorFilter(&this->actor, 0xC000, 255, 0, 100); } this->actor.shape.rot.x += Rand_S16Offset(0x700, 0x1400); this->actor.shape.rot.y += (s16)Rand_ZeroFloat(5120.0f); @@ -615,7 +615,7 @@ void func_80AD84C0(EnKame* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if ((this->unk_29D == 10) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) { return; } @@ -641,16 +641,16 @@ void func_80AD84C0(EnKame* this, GlobalContext* globalCtx) { } else if (!(this->collider.base.acFlags & AC_HARD)) { if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2A2 = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_2B4 = 0.6f; this->unk_2B0 = 2.0f; this->unk_29D = 30; func_80AD7FA4(this); } else if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2A2 = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80AD7FA4(this); } else if (this->actor.colChkInfo.damageEffect == 3) { func_80AD6F9C(this); @@ -713,11 +713,11 @@ void EnKame_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 60.0f, 40.0f, 0x1F); if (this->actor.shape.shadowDraw != NULL) { - Actor_SetHeight(&this->actor, 25.0f); + Actor_SetFocus(&this->actor, 25.0f); Collider_UpdateCylinder(&this->actor, &this->collider); } @@ -810,8 +810,8 @@ void EnKame_Draw(Actor* thisx, GlobalContext* globalCtx) { this->unk_29D); if (this->actor.shape.shadowDraw == NULL) { - func_800B3FC0(&this->actor, NULL, globalCtx); - Actor_SetHeight(&this->actor, 25.0f); + ActorShadow_DrawCircle(&this->actor, NULL, globalCtx); + Actor_SetFocus(&this->actor, 25.0f); Collider_UpdateCylinder(&this->actor, &this->collider); Math_Vec3f_Copy(&this->actor.world.pos, &sp40); } diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index db4363228..4d0e7f9fe 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -74,9 +74,9 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2E2 = -1; this->zubora = EnKgy_FindZubora(globalCtx); this->iceBlock = EnKgy_FindIceBlock(globalCtx); - Actor_UnsetSwitchFlag(globalCtx, ENKGY_GET_FE00(&this->actor) + 1); + Flags_UnsetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor) + 1); if (Flags_GetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor)) || (gSaveContext.weekEventReg[33] & 0x80)) { - Actor_SetSwitchFlag(globalCtx, ENKGY_GET_FE00(&this->actor) + 1); + Flags_SetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor) + 1); globalCtx->envCtx.unk_C3 = 1; gSaveContext.weekEventReg[21] |= 1; if (!func_80B40D64(globalCtx)) { @@ -143,7 +143,7 @@ void func_80B40BC0(EnKgy* this, s16 arg1) { } EnKbt* EnKgy_FindZubora(GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actor != NULL) { if (actor->id == ACTOR_EN_KBT) { @@ -155,7 +155,7 @@ EnKbt* EnKgy_FindZubora(GlobalContext* globalCtx) { } ObjIcePoly* EnKgy_FindIceBlock(GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_ITEMACTION].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; while (actor != NULL) { if (actor->id == ACTOR_OBJ_ICE_POLY) { @@ -258,7 +258,7 @@ void func_80B40EE8(EnKgy* this, GlobalContext* globalCtx) { f32 sp34; f32 temp_f0; - func_800B4EDC(globalCtx, &this->unk_2B4, &sp38, &sp34); + Actor_GetProjectedPos(globalCtx, &this->unk_2B4, &sp38, &sp34); temp_f0 = sp38.x * sp34; if (this->unk_2E6 > 0) { this->unk_2E6--; @@ -458,7 +458,7 @@ void func_80B4163C(EnKgy* this, GlobalContext* globalCtx) { this->lightInfo.params.point.y = this->unk_2C0.y; this->lightInfo.params.point.z = this->unk_2C0.z; this->unk_300 = 200; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SWORD_FORGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SWORD_FORGE); break; } @@ -470,7 +470,7 @@ void func_80B4163C(EnKgy* this, GlobalContext* globalCtx) { void func_80B417B8(EnKgy* this, GlobalContext* globalCtx) { func_80B4163C(this, globalCtx); - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80B413C8(this); this->actor.flags &= ~0x100; @@ -494,7 +494,7 @@ void func_80B41858(EnKgy* this, GlobalContext* globalCtx) { void func_80B418C4(EnKgy* this, GlobalContext* globalCtx) { func_80B4163C(this, globalCtx); if ((this->unk_2E4 <= 0) && !(this->unk_29C & 2) && (func_80B40E54(this) == 0) && - (func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx) && + (Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx) && ((globalCtx->msgCtx.unk11F04 == 0xC4E) || (globalCtx->msgCtx.unk11F04 == 0xC4F))) { func_801477B4(globalCtx); this->actor.textId = 0xC4F; @@ -511,7 +511,7 @@ void func_80B419B0(EnKgy* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); func_80B4163C(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx) || (&this->actor == player->targetActor)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) || (&this->actor == player->targetActor)) { func_80B411DC(this, globalCtx, 4); func_80B40E18(this, this->actor.textId); if (this->actor.textId == 0xC37) { @@ -537,7 +537,7 @@ void func_80B41ACC(EnKgy* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); SkelAnime_Update(&this->skelAnime); - if (func_80152498(&globalCtx->msgCtx) == 0x10) { + if (Message_GetState(&globalCtx->msgCtx) == 0x10) { itemActionParam = func_80123810(globalCtx); if (itemActionParam != PLAYER_AP_NONE) { this->actionFunc = func_80B41E18; @@ -586,7 +586,7 @@ void func_80B41C30(EnKgy* this, GlobalContext* globalCtx) { void func_80B41C54(EnKgy* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actionFunc = func_80B41C30; this->actor.flags &= ~0x100; } @@ -595,13 +595,13 @@ void func_80B41C54(EnKgy* this, GlobalContext* globalCtx) { void func_80B41CBC(EnKgy* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_80B40E18(this, this->actor.textId); this->actionFunc = func_80B41E18; func_80B411DC(this, globalCtx, 4); } else { - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1); } } @@ -610,9 +610,9 @@ void func_80B41D64(EnKgy* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { this->actionFunc = func_80B41CBC; this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1); } else { - func_800B8A1C(&this->actor, globalCtx, this->unk_2EA, 2000.0f, 1000.0f); + Actor_PickUp(&this->actor, globalCtx, this->unk_2EA, 2000.0f, 1000.0f); } func_80B40EE8(this, globalCtx); } @@ -627,7 +627,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) { } if ((this->unk_2E4 <= 0) && !(this->unk_29C & 2) && func_80B40E54(this) == 0) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: if (func_80147624(globalCtx)) { temp = globalCtx->msgCtx.unk11F04; @@ -759,7 +759,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) { case 0xC46: case 0xC55: func_80123D50(globalCtx, GET_PLAYER(globalCtx), ITEM_BOTTLE, PLAYER_AP_BOTTLE); - player->unk_A87 = PLAYER_AP_NONE; + player->exchangeItemId = EXCH_ITEM_NONE; this->unk_29C &= ~0x8; globalCtx->msgCtx.unk11F10 = 0; func_80B41368(this, globalCtx, 4); @@ -774,7 +774,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) { case 0xC47: func_80B40BC0(this, 1); if (this->unk_29C & 8) { - player->unk_A87 = PLAYER_AP_NONE; + player->exchangeItemId = EXCH_ITEM_NONE; this->unk_29C &= ~8; } func_80B40EBC(this, globalCtx, temp); @@ -813,7 +813,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) { func_801477B4(globalCtx); this->actionFunc = func_80B41D64; func_80B413C8(this); - func_800B8A1C(&this->actor, globalCtx, this->unk_2EA, 2000.0f, 1000.0f); + Actor_PickUp(&this->actor, globalCtx, this->unk_2EA, 2000.0f, 1000.0f); break; case 0xC51: @@ -846,7 +846,7 @@ void func_80B42508(EnKgy* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.focus.pos = this->unk_2A8; - if (func_800B84D0(&this->actor, globalCtx) || (&this->actor == player->targetActor)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) || (&this->actor == player->targetActor)) { this->actionFunc = func_80B41E18; func_80B411DC(this, globalCtx, 4); func_80B40E18(this, this->actor.textId); @@ -856,7 +856,7 @@ void func_80B42508(EnKgy* this, GlobalContext* globalCtx) { void func_80B425A0(EnKgy* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.focus.pos = this->unk_2A8; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B41E18; func_80B40BC0(this, 1); func_80B411DC(this, globalCtx, 0); @@ -869,7 +869,7 @@ void func_80B425A0(EnKgy* this, GlobalContext* globalCtx) { void func_80B42660(EnKgy* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.focus.pos = this->unk_2A8; - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); func_80B413C8(this); this->actor.flags &= ~0x100; @@ -885,7 +885,7 @@ void func_80B42714(EnKgy* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.focus.pos = this->unk_2A8; - if (func_800B84D0(&this->actor, globalCtx) || (&this->actor == player->targetActor)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) || (&this->actor == player->targetActor)) { func_80B411DC(this, globalCtx, 4); func_80B40E18(this, this->actor.textId); if (this->actor.textId == 0xC37) { @@ -910,7 +910,7 @@ void func_80B427C8(EnKgy* this, GlobalContext* globalCtx) { } if ((this->unk_2E4 <= 0) && !(this->unk_29C & 2) && (func_80B40E54(this) == 0) && - (func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + (Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { temp_a2 = globalCtx->msgCtx.unk11F04; switch (temp_a2) { @@ -951,7 +951,7 @@ void func_80B4296C(EnKgy* this, GlobalContext* globalCtx) { } this->actor.focus.pos = this->unk_2A8; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B427C8; if (this->unk_2D2 == 4) { func_80B40BC0(this, 7); @@ -963,7 +963,7 @@ void func_80B4296C(EnKgy* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; } else { this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, 0); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_NONE); } } @@ -982,7 +982,7 @@ void func_80B42A8C(EnKgy* this, GlobalContext* globalCtx) { } if ((this->unk_2E4 <= 0) && !(this->unk_29C & 2) && (func_80B40E54(this) == 0) && - (func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + (Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { temp_a2 = globalCtx->msgCtx.unk11F04; switch (temp_a2) { case 0xC1D: @@ -1063,7 +1063,7 @@ void func_80B42D28(EnKgy* this, GlobalContext* globalCtx) { } this->actor.focus.pos = this->unk_2A8; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B42A8C; if (this->actor.textId == 0xC2D) { func_80B40BC0(this, 1); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 3a2f74983..194b99b7a 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -49,7 +49,7 @@ static CollisionCheckInfoInit D_8093670C = { 0, 12, 30, MASS_IMMOVABLE }; static InitChainEntry D_80936754[] = { ICHAIN_VEC3F_DIV1000(scale, 400, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3200, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -17000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -17000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 200, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index df691b0df..8fd3a4075 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -845,7 +845,7 @@ void func_80A5D178(EnKusa2* this) { } static InitChainEntry sInitChain[] = { - ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(minVelocityY, -17000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(terminalVelocity, -17000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 400, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1200, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP), }; @@ -960,7 +960,7 @@ void func_80A5D7C4(EnKusa2* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_PL_PULL_UP_PLANT); - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowAlpha = 60; this->actor.room = -1; func_80A5BD94(this); @@ -970,14 +970,14 @@ void func_80A5D7C4(EnKusa2* this, GlobalContext* globalCtx) { if (!func_80A5BFD8(this, globalCtx)) { if ((this->unk_1C0 != NULL) && (this->unk_1C0->unk_1BE != 0)) { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; if (this2->unk_1C0 != NULL) { sp2A = Actor_YawBetweenActors(&this->unk_1C0->actor, &this->actor); this->actor.home.rot.y = Rand_S16Offset(-1500, 3000) + sp2A; } this->unk_1C8 = Rand_S16Offset(72, 16); this->actor.velocity.y = 8.8f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); func_80A5DC70(this); } @@ -986,7 +986,7 @@ void func_80A5D7C4(EnKusa2* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.xzDistToPlayer < 100.0f) { - func_800B8BB0(&this->actor, globalCtx); + Actor_LiftActor(&this->actor, globalCtx); } } } @@ -1035,7 +1035,7 @@ void func_80A5D9C8(EnKusa2* this, GlobalContext* globalCtx) { this->actor.home.rot.y = this->actor.world.rot.y; this->actor.velocity.y = 12.5f; this->actor.speedXZ += 3.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A5BAFC(this, globalCtx); func_80A5CD0C(this); this->unk_1C8 = 30; @@ -1051,7 +1051,7 @@ void func_80A5D9C8(EnKusa2* this, GlobalContext* globalCtx) { this->unk_1D0--; if (this->unk_1D0 <= 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); this->unk_1D0 = ((u32)Rand_Next() >> 0x1D) + 14; } @@ -1078,7 +1078,7 @@ void func_80A5DC98(EnKusa2* this, GlobalContext* globalCtx) { this->actor.scale.z = this->actor.scale.x; Math_StepToF(&this->actor.gravity, -7.0f, 1.8f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A5BAFC(this, globalCtx); func_80A5BF38(this, 4); func_80A5BF84(this, globalCtx); @@ -1086,7 +1086,7 @@ void func_80A5DC98(EnKusa2* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { func_80A5CD0C(this); func_80A5BB40(this, globalCtx, 1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK); func_80A5DE18(this); } else if (this->actor.bgCheckFlags & 0x20) { func_80A5BDB0(this, globalCtx); @@ -1118,14 +1118,14 @@ void func_80A5DEB4(EnKusa2* this, GlobalContext* globalCtx) { if (this->unk_1D0 > 0) { this->unk_1D0--; if (this->unk_1D0 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } } if (this->unk_1D1 > 0) { this->unk_1D1--; if (this->unk_1D1 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } } @@ -1139,7 +1139,7 @@ void func_80A5DEB4(EnKusa2* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); this->actor.world.rot.y = (s32)(Math_SinS(this->unk_1C4) * 3000.0f) + this->actor.home.rot.y; this->actor.shape.rot.y = this->actor.world.rot.y; @@ -1204,7 +1204,7 @@ void func_80A5E210(EnKusa2* this, GlobalContext* globalCtx) { } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A5BAFC(this, globalCtx); if (this->actor.velocity.y > 0.01f) { @@ -1244,7 +1244,7 @@ void func_80A5E210(EnKusa2* this, GlobalContext* globalCtx) { } void func_80A5E418(EnKusa2* this) { - this->actor.minVelocityY = -4.0f; + this->actor.terminalVelocity = -4.0f; this->actor.velocity.x *= 0.1f; this->actor.velocity.y *= 0.25f; this->actor.velocity.z *= 0.1f; @@ -1259,7 +1259,7 @@ void func_80A5E4BC(EnKusa2* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.scale.y, 0.4f, 0.032f); Math_StepToF(&this->actor.scale.x, 0.4f, 0.032f); this->actor.scale.z = this->actor.scale.x; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A5BAFC(this, globalCtx); func_80A5BF60(this, 6); this->actor.shape.rot.x -= 0x5DC; @@ -1354,7 +1354,7 @@ void EnKusa2_Draw(Actor* thisx, GlobalContext* globalCtx) { (this->actor.projectedPos.z < 400.0f)) { func_80A5B954(&D_80A60908[this->unk_1CE], 0.0015f); } - func_800BDFC0(globalCtx, D_050078A0); + Gfx_DrawDListOpa(globalCtx, D_050078A0); } else if (this->actor.projectedPos.z < 1300.0f) { func_80A5E80C(globalCtx, (1300.0f - this->actor.projectedPos.z) * 2.55f); } @@ -1368,14 +1368,14 @@ void func_80A5E9B4(Actor* thisx, GlobalContext* globalCtx) { sp18.z = thisx->shape.rot.z + D_80A5EAFC.z; Matrix_SetStateRotationAndTranslation(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, &sp18); Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); - func_800BDFC0(globalCtx, D_050078A0); + Gfx_DrawDListOpa(globalCtx, D_050078A0); } void func_80A5EA48(Actor* thisx, GlobalContext* globalCtx) { EnKusa2* this = THIS; if (this->unk_1CF == 0xFF) { - func_800BDFC0(globalCtx, D_050078A0); + Gfx_DrawDListOpa(globalCtx, D_050078A0); } else { func_80A5E80C(globalCtx, this->unk_1CF); } diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 92908ac6d..0901fd9b2 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -200,7 +200,7 @@ void EnMa4_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa4* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, NULL, this->jointTable, this->morphTable, MA1_LIMB_MAX); @@ -287,7 +287,7 @@ void EnMa4_RunInCircles(EnMa4* this, GlobalContext* globalCtx) { } if (sCurrentAnim == 13 && Animation_OnFrame(&this->skelAnime, 37.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROMANI_BOW_FLICK); } sp34.x = this->pathPoints[this->pathIndex].x; @@ -317,10 +317,10 @@ void EnMa4_RunInCircles(EnMa4* this, GlobalContext* globalCtx) { } Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->skelAnime.animation == &D_06007328) { // Walking animation if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 4.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } } } @@ -363,7 +363,7 @@ void EnMa4_Wait(EnMa4* this, GlobalContext* globalCtx) { } } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { EnMa4_StartDialogue(this, globalCtx); EnMa4_SetupDialogueHandler(this); } else if (this->type != MA4_TYPE_ALIENS_WON || ABS_ALT(yaw) < 0x4000) { @@ -648,7 +648,7 @@ void EnMa4_SetupDialogueHandler(EnMa4* this) { void EnMa4_DialogueHandler(EnMa4* this, GlobalContext* globalCtx) { s32 temp_v0; - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { default: break; @@ -692,7 +692,7 @@ void EnMa4_BeginHorsebackGame(EnMa4* this, GlobalContext* globalCtx) { } void EnMa4_HorsebackGameCheckPlayerInteractions(EnMa4* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { // "You're feeling confident" func_801518B0(globalCtx, 0x336E, &this->actor); this->actionFunc = EnMa4_HorsebackGameTalking; @@ -702,7 +702,7 @@ void EnMa4_HorsebackGameCheckPlayerInteractions(EnMa4* this, GlobalContext* glob } void EnMa4_HorsebackGameTalking(EnMa4* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actionFunc = EnMa4_HorsebackGameWait; } } @@ -760,7 +760,7 @@ void EnMa4_HorsebackGameEnd(EnMa4* this, GlobalContext* globalCtx) { if (player->stateFlags1 & 0x100000) { globalCtx->actorCtx.unk268 = 1; - globalCtx->actorCtx.unk278 = 0x8000; + globalCtx->actorCtx.unk_26C.press.button = BTN_A; } else { globalCtx->actorCtx.unk268 = 1; } @@ -850,7 +850,7 @@ void EnMa4_EponasSongCs(EnMa4* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); player->stateFlags1 |= 0x20; - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); D_80AC0260 = 99; this->hasBow = true; EnMa4_SetupEndEponasSongCs(this); @@ -865,14 +865,14 @@ void EnMa4_EndEponasSongCs(EnMa4* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); this->actor.flags |= 0x10000; - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) { player->stateFlags1 &= ~0x20; func_801518B0(globalCtx, 0x334C, &this->actor); this->textId = 0x334C; this->actor.flags &= ~0x10000; EnMa4_SetupDialogueHandler(this); } else { - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); } } diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 6b55a48a7..92a56a419 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -188,7 +188,7 @@ void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06015C28, NULL, this->jointTable, this->morphTable, MA2_LIMB_MAX); EnMaYto_InitAnimation(this, globalCtx); @@ -321,7 +321,7 @@ void EnMaYto_ChooseAction(EnMaYto* this, GlobalContext* globalCtx) { } s32 EnMaYto_SearchRomani(EnMaYto* this, GlobalContext* globalCtx) { - Actor* npcActor = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* npcActor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (npcActor != NULL) { if (npcActor->id == ACTOR_EN_MA_YTS) { @@ -425,7 +425,7 @@ void EnMaYto_DefaultWait(EnMaYto* this, GlobalContext* globalCtx) { EnMaYto_ChangeAnim(this, 11); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnMaYto_DefaultStartDialogue(this, globalCtx); EnMaYto_SetupDefaultDialogueHandler(this); } else if (ABS_ALT(direction) < 0x1555) { @@ -440,7 +440,7 @@ void EnMaYto_SetupDefaultDialogueHandler(EnMaYto* this) { } void EnMaYto_DefaultDialogueHandler(EnMaYto* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: EnMaYto_DefaultHandlePlayerChoice(this, globalCtx); break; @@ -535,14 +535,14 @@ void EnMaYto_SetupDinnerWait(EnMaYto* this) { void EnMaYto_DinnerWait(EnMaYto* this, GlobalContext* globalCtx) { s16 direction = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnMaYto_DinnerStartDialogue(this, globalCtx); EnMaYto_SetupDinnerDialogueHandler(this); } else { Actor* child = this->actor.child; - if (child != NULL && func_800B84D0(child, globalCtx)) { - func_800B86C8(&this->actor, globalCtx, &this->actor); + if (child != NULL && Actor_ProcessTalkRequest(child, &globalCtx->state)) { + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); EnMaYto_DinnerStartDialogue(this, globalCtx); EnMaYto_SetupDinnerDialogueHandler(this); } else if (ABS_ALT(direction) < 0x4000) { @@ -572,7 +572,7 @@ void EnMaYto_SetupDinnerDialogueHandler(EnMaYto* this) { } void EnMaYto_DinnerDialogueHandler(EnMaYto* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: EnMaYto_DinnerHandlePlayerChoice(this, globalCtx); break; @@ -635,7 +635,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { break; case 0x339B: - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); func_80B90E50(this, 0); EnMaYto_SetRomaniFaceExpression(this, 3, 3); func_801518B0(globalCtx, 0x339C, &this->actor); @@ -644,7 +644,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x339C: this->unk31E = 1; - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); EnMaYto_SetFaceExpression(this, 0, 2); func_801518B0(globalCtx, 0x339D, &this->actor); this->textId = 0x339D; @@ -652,7 +652,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x339D: func_80B90E50(this, 1); - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); EnMaYto_SetRomaniFaceExpression(this, 0, 1); func_801518B0(globalCtx, 0x339E, &this->actor); this->textId = 0x339E; @@ -673,7 +673,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x33A1: func_80B90E50(this, 1); - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); EnMaYto_SetRomaniFaceExpression(this, 0, 2); func_801518B0(globalCtx, 0x33A2, &this->actor); this->textId = 0x33A2; @@ -681,7 +681,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x33A2: this->unk31E = 1; - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); EnMaYto_SetFaceExpression(this, 4, 3); func_801518B0(globalCtx, 0x33A3, &this->actor); this->textId = 0x33A3; @@ -730,14 +730,14 @@ void EnMaYto_BarnWait(EnMaYto* this, GlobalContext* globalCtx) { s16 direction = this->actor.shape.rot.y + 0x471C; direction -= this->actor.yawTowardsPlayer; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnMaYto_BarnStartDialogue(this, globalCtx); EnMaYto_SetupBarnDialogueHandler(this); } else { Actor* child = this->actor.child; - if (child != NULL && func_800B84D0(child, globalCtx)) { - func_800B86C8(&this->actor, globalCtx, &this->actor); + if (child != NULL && Actor_ProcessTalkRequest(child, &globalCtx->state)) { + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); EnMaYto_BarnStartDialogue(this, globalCtx); EnMaYto_SetupBarnDialogueHandler(this); } else if (!(gSaveContext.weekEventReg[0x16] & 1) || ABS_ALT(direction) < 0x2000) { @@ -762,7 +762,7 @@ void EnMaYto_SetupBarnDialogueHandler(EnMaYto* this) { } void EnMaYto_BarnDialogueHandler(EnMaYto* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 5: EnMaYto_BarnChooseNextDialogue(this, globalCtx); break; @@ -788,14 +788,14 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { switch (this->textId) { case 0x33A9: func_80B90E50(this, 0); - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); EnMaYto_SetRomaniFaceExpression(this, 0, 3); func_801518B0(globalCtx, 0x33AA, &this->actor); this->textId = 0x33AA; break; case 0x33AA: - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); this->unk31E = 1; func_801518B0(globalCtx, 0x33AB, &this->actor); this->textId = 0x33AB; @@ -803,7 +803,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x33AB: func_80B90E50(this, 1); - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); EnMaYto_SetRomaniFaceExpression(this, 0, 1); func_801518B0(globalCtx, 0x33AC, &this->actor); this->textId = 0x33AC; @@ -811,7 +811,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x33AC: this->unk31E = 0; - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); func_801518B0(globalCtx, 0x33AD, &this->actor); this->textId = 0x33AD; func_80151BB4(globalCtx, 6); @@ -820,7 +820,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x33AE: func_80B90E50(this, 1); - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); EnMaYto_SetRomaniFaceExpression(this, 4, 2); func_801518B0(globalCtx, 0x33AF, &this->actor); this->textId = 0x33AF; @@ -828,7 +828,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { case 0x33AF: this->unk31E = 1; - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); EnMaYto_SetFaceExpression(this, 4, 2); func_801518B0(globalCtx, 0x33B0, &this->actor); this->textId = 0x33B0; @@ -846,7 +846,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { break; case 0x33C6: - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); this->unk31E = 0; EnMaYto_SetFaceExpression(this, 0, 1); func_801518B0(globalCtx, 0x33C7, &this->actor); @@ -854,7 +854,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { break; case 0x33C7: - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); this->unk31E = 1; EnMaYto_SetFaceExpression(this, 0, 1); func_801518B0(globalCtx, 0x33C8, &this->actor); @@ -862,7 +862,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { break; case 0x33C8: - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); func_80B90E50(this, 1); EnMaYto_SetRomaniFaceExpression(this, 0, 2); func_801518B0(globalCtx, 0x33C9, &this->actor); @@ -870,7 +870,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { break; case 0x33C9: - func_800B86C8(&this->actor, globalCtx, &this->actor); + Actor_ChangeFocus(&this->actor, globalCtx, &this->actor); this->unk31E = 1; EnMaYto_SetFaceExpression(this, 3, 1); func_801518B0(globalCtx, 0x33CA, &this->actor); @@ -884,7 +884,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) { break; case 0x33CB: - func_800B86C8(&this->actor, globalCtx, this->actor.child); + Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child); func_80B90E50(this, 1); EnMaYto_SetRomaniFaceExpression(this, 3, 3); func_801518B0(globalCtx, 0x33CC, &this->actor); @@ -912,7 +912,7 @@ void EnMaYto_SetupAfterMilkRunInit(EnMaYto* this) { void EnMaYto_AfterMilkRunInit(EnMaYto* this, GlobalContext* globalCtx) { this->actor.flags |= 0x10000; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; if (gSaveContext.weekEventReg[0x34] & 1) { // if (ProtectedCremia) @@ -942,7 +942,7 @@ void EnMaYto_SetupAfterMilkRunDialogueHandler(EnMaYto* this) { } void EnMaYto_AfterMilkRunDialogueHandler(EnMaYto* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: case 1: case 2: @@ -986,10 +986,10 @@ void EnMaYto_PostMilkRunGiveReward(EnMaYto* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnMaYto_SetupPostMilkRunExplainReward(this); } else if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_HUGE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_HUGE, 500.0f, 100.0f); this->unk310 = 2; } else { - func_800B8A1C(&this->actor, globalCtx, GI_MASK_ROMANI, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MASK_ROMANI, 500.0f, 100.0f); this->unk310 = 1; } } @@ -999,7 +999,7 @@ void EnMaYto_SetupPostMilkRunExplainReward(EnMaYto* this) { } void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->unk310 == 1) { // Romani's mask explanation EnMaYto_SetFaceExpression(this, 0, 1); @@ -1024,7 +1024,7 @@ void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, GlobalContext* globalCtx) { EnMaYto_SetupPostMilkRunWaitDialogueEnd(this); } } else { - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); } } @@ -1095,14 +1095,14 @@ void EnMaYto_SetupPostMilkRunWaitDialogueEnd(EnMaYto* this) { } void EnMaYto_PostMilkRunWaitDialogueEnd(EnMaYto* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 || func_80152498(&globalCtx->msgCtx) == 5) { - if (func_80147624(globalCtx) && func_80152498(&globalCtx->msgCtx) == 5) { + if (Message_GetState(&globalCtx->msgCtx) == 6 || Message_GetState(&globalCtx->msgCtx) == 5) { + if (func_80147624(globalCtx) && Message_GetState(&globalCtx->msgCtx) == 5) { func_800B7298(globalCtx, &this->actor, 7); func_801477B4(globalCtx); } } - if (func_80152498(&globalCtx->msgCtx) == 0 && globalCtx->msgCtx.unk120B1 == 0) { + if (Message_GetState(&globalCtx->msgCtx) == 0 && globalCtx->msgCtx.unk120B1 == 0) { EnMaYto_SetupPostMilkRunEnd(this); } } diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index 266ba90e9..1ed32213a 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -245,7 +245,8 @@ void EnMaYts_Init(Actor* thisx, GlobalContext* globalCtx) { if (!EnMaYts_CheckValidSpawn(this, globalCtx)) { Actor_MarkForDeath(&this->actor); } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 18.0f); + + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, NULL, this->jointTable, this->morphTable, MA1_LIMB_MAX); EnMaYts_InitAnimation(this, globalCtx); @@ -317,7 +318,7 @@ void EnMaYts_SetupStartDialogue(EnMaYts* this) { void EnMaYts_StartDialogue(EnMaYts* this, GlobalContext* globalCtx) { s16 sp26 = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; - if (func_800B84D0(&this->actor, globalCtx)) { // if (Actor_IsTalking) + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (!(gSaveContext.playerForm == PLAYER_FORM_HUMAN)) { if (!(gSaveContext.weekEventReg[0x41] & 0x80)) { // Saying to non-human Link: "Cremia went to town." @@ -374,7 +375,7 @@ void EnMaYts_SetupDialogueHandler(EnMaYts* this) { } void EnMaYts_DialogueHandler(EnMaYts* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 5: // End message block EnMaYts_ChooseNextDialogue(this, globalCtx); break; diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index 4b5585086..9892af79b 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -91,7 +91,7 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) { int i; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 15.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, &D_06001534, this->jointTable, this->morphTable, 24); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -164,7 +164,7 @@ void EnMinifrog_Destroy(Actor* thisx, GlobalContext* globalCtx) { } EnMinifrog* EnMinifrog_GetFrog(GlobalContext* globalCtx) { - EnMinifrog* frog = (EnMinifrog*)globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + EnMinifrog* frog = (EnMinifrog*)globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (frog != NULL) { if ((frog->actor.id != ACTOR_EN_MINIFROG) || (frog->actor.params & 0xF)) { @@ -200,7 +200,7 @@ void EnMinifrog_Jump(EnMinifrog* this) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { this->actor.bgCheckFlags &= ~1; this->actor.velocity.y = 6.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_JUMP); this->jumpState = MINIFROG_STATE_AIR; } break; @@ -262,7 +262,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) { EnMinifrog_TurnToPlayer(this); EnMinifrog_Jump(this); - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { EnMinifrog_SetJumpState(this); switch (globalCtx->msgCtx.unk11F04) { @@ -329,12 +329,12 @@ void EnMinifrog_Idle(EnMinifrog* this, GlobalContext* globalCtx) { EnMinifrog_TurnToPlayer(this); EnMinifrog_Jump(this); EnMinifrog_JumpTimer(this); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = EnMinifrog_ReturnFrogCutscene; if (this->actor.cutscene != -1) { this->flags |= 1; } - } else if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && + } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && (Player_GetMask(globalCtx) == PLAYER_MASK_DON_GERO)) { func_800B8614(&this->actor, globalCtx, 110.0f); } @@ -473,11 +473,11 @@ void EnMinifrog_BeginChoirCutscene(EnMinifrog* this, GlobalContext* globalCtx) { void EnMinifrog_EndChoir(EnMinifrog* this, GlobalContext* globalCtx) { EnMinifrog_TurnToPlayer(this); EnMinifrog_Jump(this); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0xD7E, &this->actor); // "Let us do it again sometime." this->actionFunc = EnMinifrog_YellowFrogDialog; } else { - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1); } } @@ -488,16 +488,16 @@ void EnMinifrog_GetFrogHP(EnMinifrog* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = EnMinifrog_EndChoir; this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, 0); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_NONE); } else { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f); } } void EnMinifrog_YellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx) { EnMinifrog_TurnToPlayer(this); EnMinifrog_Jump(this); - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: if (func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { @@ -565,7 +565,7 @@ void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx EnMinifrog_TurnToPlayer(this); EnMinifrog_Jump(this); EnMinifrog_JumpTimer(this); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = EnMinifrog_YellowFrogDialog; if (!(gSaveContext.weekEventReg[34] & 1)) { // Not spoken with MINIFROG_YELLOW func_801518B0(globalCtx, 0xD76, @@ -575,8 +575,7 @@ void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx func_801518B0(globalCtx, 0xD7F, &this->actor); // "Well, if it isn't the great Don Gero." } } else if ((this->actor.xzDistToPlayer < 150.0f) && - (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) || - ((this->actor.flags & 0x10000) == 0x10000)) && + (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) || ((this->actor.flags & 0x10000) == 0x10000)) && Player_GetMask(globalCtx) == PLAYER_MASK_DON_GERO) { func_800B8614(&this->actor, globalCtx, 160.0f); } @@ -587,7 +586,7 @@ void EnMinifrog_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, 12.0f, 0.0f, 0x1D); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c index bb7fd235e..b2b8dd5ba 100644 --- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c +++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c @@ -202,7 +202,7 @@ void EnMinislime_AddIceShardEffect(EnMinislime* this) { } this->frozenAlpha = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_BROKEN); } void EnMinislime_AddIceSmokeEffect(EnMinislime* this, GlobalContext* globalCtx) { @@ -391,7 +391,7 @@ void EnMinislime_SetupGrowAndShrink(EnMinislime* this) { this->actor.scale.x = 0.19f; this->actor.scale.y = 0.044999998f; this->actor.scale.z = 0.19f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_SLIME_JUMP2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SLIME_JUMP2); this->actionFunc = EnMinislime_GrowAndShrink; } @@ -453,7 +453,7 @@ void EnMinislime_Idle(EnMinislime* this, GlobalContext* globalCtx) { void EnMinislime_SetupBounce(EnMinislime* this) { this->actor.speedXZ = 0.0f; this->bounceTimer = (this->actionFunc == EnMinislime_GrowAndShrink) ? 1 : 4; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_SLIME_JUMP1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SLIME_JUMP1); this->actionFunc = EnMinislime_Bounce; } @@ -736,9 +736,9 @@ void EnMinislime_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actionFunc != EnMinislime_Disappear) && (this->actionFunc != EnMinislime_Despawn)) { if (this->actionFunc == EnMinislime_MoveToBigslime) { - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } EnMinislime_CheckBackgroundCollision(this); diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c index 1bedf7901..019e7a848 100644 --- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c +++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c @@ -85,7 +85,7 @@ static DamageTable D_80A4F754 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_80A4F774[] = { ICHAIN_F32_DIV1000(gravity, -500, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -5, ICHAIN_CONTINUE), + ICHAIN_F32(terminalVelocity, -5, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 3000, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 00bf38f8a..58de48dbd 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -79,7 +79,7 @@ void EnMm_Init(Actor* thisx, GlobalContext* globalCtx) { return; } Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 50.0f, func_800B3FC0, 1.2f); + ActorShape_Init(&this->actor.shape, 50.0f, ActorShadow_DrawCircle, 1.2f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); if (this->actor.parent != NULL) { @@ -123,7 +123,7 @@ void func_80965DB4(EnMm* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { func_80965BBC(this); - Audio_PlayActorSound2(&this->actor, NA_SE_PL_PULL_UP_ROCK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_PULL_UP_ROCK); } else { if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) { this->actor.velocity.y = 0.0f; @@ -134,7 +134,7 @@ void func_80965DB4(EnMm* this, GlobalContext* globalCtx) { this->actor.world.rot.y += BINANG_SUB(0x8000, (s16)(angle * 2)); this->actor.speedXZ *= 0.5f; CollisionCheck_SpawnShieldParticles(globalCtx, &this->actor.world.pos); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); } if (!(this->actor.bgCheckFlags & 1)) { @@ -168,13 +168,13 @@ void func_80965DB4(EnMm* this, GlobalContext* globalCtx) { this->actor.bgCheckFlags &= ~1; } - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); } else { - func_800B8A1C(&this->actor, globalCtx, GI_NONE, 50.0f, 30.0f); + Actor_PickUp(&this->actor, globalCtx, GI_NONE, 50.0f, 30.0f); } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } Collider_UpdateCylinder(&this->actor, &this->collider); @@ -200,7 +200,7 @@ void EnMm_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_ResetCylinderAC(globalCtx, &this->collider.base); this->actionFunc(this, globalCtx); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 10.0f, 20.0f, 31); - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); } void EnMm_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 4bc8d8378..94507b001 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -46,7 +46,7 @@ void EnMm2_Destroy(Actor* thisx, GlobalContext* globalCtx) { * Action function whilst Link is reading the letter. */ void EnMm2_Reading(EnMm2* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (talkState != 2) { if (talkState == 5 && func_80147624(globalCtx)) { @@ -63,10 +63,10 @@ void EnMm2_Reading(EnMm2* this, GlobalContext* globalCtx) { * so (and facing the letter). */ void EnMm2_WaitForRead(EnMm2* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x277B, &this->actor); this->actionFunc = EnMm2_Reading; - } else if ((this->actor.xzDistToPlayer < 60.0f) && (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx))) { + } else if ((this->actor.xzDistToPlayer < 60.0f) && (Player_IsFacingActor(&this->actor, 0x3000, globalCtx))) { func_800B8614(&this->actor, globalCtx, 110.0f); } } diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index efc0ea175..77b3d70dd 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -66,7 +66,7 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.015f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; // Eating Magic Beans all day will do that to you this->actionFunc = EnMs_Wait; @@ -90,7 +90,7 @@ void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { this->actor.textId = 0x932; // "[...] So you liked my Magic Beans [...]" } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = EnMs_Talk; } else if ((this->actor.xzDistToPlayer < 90.0f) && (ABS_ALT(yawDiff) < 0x2000)) { func_800B8614(&this->actor, globalCtx, 90.0f); @@ -98,7 +98,7 @@ void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { } void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 6: if (func_80147624(globalCtx) != 0) { this->actionFunc = EnMs_Wait; @@ -108,8 +108,8 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) { case 5: if (func_80147624(globalCtx) != 0) { func_801477B4(globalCtx); - func_800B8A1C(&this->actor, globalCtx, GI_MAGIC_BEANS, this->actor.xzDistToPlayer, - this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, GI_MAGIC_BEANS, this->actor.xzDistToPlayer, + this->actor.playerHeightRel); this->actionFunc = EnMs_Sell; } break; @@ -127,7 +127,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) { func_80151938(globalCtx, 0x937); // "[...] You can't carry anymore." } else { func_8019F208(); - func_800B8A1C(&this->actor, globalCtx, GI_MAGIC_BEANS, 90.0f, 10.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MAGIC_BEANS, 90.0f, 10.0f); func_801159EC(-10); this->actionFunc = EnMs_Sell; } @@ -152,12 +152,12 @@ void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) { func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0); this->actionFunc = EnMs_TalkAfterPurchase; } else { - func_800B8A1C(&this->actor, globalCtx, GI_MAGIC_BEANS, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, GI_MAGIC_BEANS, this->actor.xzDistToPlayer, this->actor.playerHeightRel); } } void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80151938(globalCtx, 0x936); // "You can plant 'em whenever you want [...]" this->actionFunc = EnMs_Talk; } else { @@ -169,7 +169,7 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnMs* this = THIS; - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); this->actor.targetArrowOffset = 500.0f; Actor_SetScale(&this->actor, 0.015f); SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index 70945999f..ab94425ea 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -138,7 +138,7 @@ s32 func_80A68860(EnMushi2* this, GlobalContext* globalCtx) { } s32 func_80A68910(EnMushi2* this, GlobalContext* globalCtx) { - Actor* bean = globalCtx->actorCtx.actorList[ACTORCAT_ITEMACTION].first; + Actor* bean = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; f32 minDistSq = SQ(100.0f); s32 ret = false; f32 temp_f0; @@ -206,7 +206,7 @@ void func_80A68BC8(EnMushi2* this) { if (this->unk_36C > 0) { this->unk_36C--; } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MUSI_WALK); this->unk_36C = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.12f); if (this->unk_36C < 2) { @@ -280,7 +280,7 @@ void func_80A68ED8(EnMushi2* this) { this->actor.velocity.x = this->actor.speedXZ * this->unk_328.x; this->actor.velocity.y = this->actor.speedXZ * this->unk_328.y; this->actor.velocity.z = this->actor.speedXZ * this->unk_328.z; - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); } void func_80A68F24(EnMushi2* this) { @@ -789,7 +789,7 @@ void EnMushi2_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80A6A300(EnMushi2* this) { this->unk_368 = 100; this->actor.gravity = -0.25f; - this->actor.minVelocityY = -3.5f; + this->actor.terminalVelocity = -3.5f; this->unk_370 = Rand_S16Offset(-1000, 2000); this->skelAnime.playSpeed = 1.5f; this->actionFunc = func_80A6A36C; @@ -801,7 +801,7 @@ void func_80A6A36C(EnMushi2* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); this->actor.velocity.y -= this->actor.velocity.y * D_80A6BA14[ENMUSHI2_GET_3(&this->actor)]; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A69424(this, globalCtx); this->actor.shape.rot.y += this->unk_370; this->actor.world.rot.y = this->actor.shape.rot.y; @@ -822,7 +822,7 @@ void func_80A6A36C(EnMushi2* this, GlobalContext* globalCtx) { } else if (this->actor.bgCheckFlags & 0x20) { func_80A6AAA4(this); } else if (this->actor.bgCheckFlags & 1) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_WALK); func_80A68F24(this); func_80A691EC(this, this->actor.floorPoly, -1.0f); func_80A69388(this); @@ -949,7 +949,7 @@ void func_80A6A9E4(EnMushi2* this, GlobalContext* globalCtx) { void func_80A6AAA4(EnMushi2* this) { this->actor.velocity.y = -1.2f; - this->actor.minVelocityY = -1.2f; + this->actor.terminalVelocity = -1.2f; this->actor.gravity = -0.5f; this->unk_368 = Rand_S16Offset(120, 50); this->unk_36E = 0; @@ -967,7 +967,7 @@ void func_80A6AB08(EnMushi2* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A69424(this, globalCtx); Math_StepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.depthInWater, 2.8f); this->skelAnime.playSpeed = this->unk_368 * 0.018f; @@ -1013,7 +1013,7 @@ void func_80A6AE14(EnMushi2* this) { this->unk_30C &= ~1; this->unk_368 = 100; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = -0.8f; + this->actor.terminalVelocity = -0.8f; this->actor.gravity = -0.04f; func_80A68B6C(this); this->actionFunc = func_80A6AE7C; @@ -1029,7 +1029,7 @@ void func_80A6AE7C(EnMushi2* this, GlobalContext* globalCtx) { this->actor.world.rot.y += (s16)((Rand_ZeroOne() - 0.5f) * 2000.0f); this->actor.gravity = -0.04f - (Rand_ZeroOne() * 0.02f); this->actor.velocity.y *= 0.95f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A69424(this, globalCtx); temp_f2 = this->actor.scale.x - (1.0f / 20000.0f); Actor_SetScale(&this->actor, CLAMP_MIN(temp_f2, 0.001f)); @@ -1048,7 +1048,7 @@ void func_80A6B078(EnMushi2* this) { this->unk_30C &= ~1; this->unk_368 = 50; this->skelAnime.playSpeed = 1.9f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); func_80A68B6C(this); this->actionFunc = func_80A6B0D8; } @@ -1224,7 +1224,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((this->unk_30C & 1) && func_80A68DD4(this, globalCtx)) { - func_800B8A1C(&this->actor, globalCtx, GI_MAX, 60.0f, 30.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MAX, 60.0f, 30.0f); } } } diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c index 131fbebcc..00c3ed0c9 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -64,7 +64,7 @@ void EnMuto_Init(Actor* thisx, GlobalContext* globalCtx) { EnMuto* this = THIS; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17); this->isInMayorsRoom = this->actor.params; @@ -148,7 +148,7 @@ void EnMuto_Idle(EnMuto* this, GlobalContext* globalCtx) { this->actor.textId = 0x2363; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnMuto_SetupDialogue(this, globalCtx); return; } @@ -186,7 +186,7 @@ void EnMuto_SetupDialogue(EnMuto* this, GlobalContext* globalCtx) { if (this->targetActor != NULL) { this->shouldSetHeadRotation = true; this->cutsceneState = 1; - func_800B86C8(this->targetActor, globalCtx, this->targetActor); + Actor_ChangeFocus(this->targetActor, globalCtx, this->targetActor); } this->isInDialogue = true; @@ -196,7 +196,7 @@ void EnMuto_SetupDialogue(EnMuto* this, GlobalContext* globalCtx) { void EnMuto_InDialogue(EnMuto* this, GlobalContext* globalCtx) { if (!this->isInMayorsRoom) { this->yawTowardsTarget = this->actor.yawTowardsPlayer; - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { func_801477B4(globalCtx); if (this->actor.textId == 0x62C) { @@ -263,8 +263,8 @@ void EnMuto_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_SetScale(&this->actor, 0.01f); this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_SetHeight(&this->actor, 60.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_SetFocus(&this->actor, 60.0f); + Actor_MoveWithGravity(&this->actor); Math_SmoothStepToS(&this->headRot.y, this->headRotTarget.y, 1, 0xBB8, 0); Math_SmoothStepToS(&this->headRot.x, this->headRotTarget.x, 1, 0x3E8, 0); diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index c65d794bb..41730f4d4 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -124,7 +124,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x1; // targetable ON - ActorShape_Init(&thisx->shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, ENNIW_LIMBCOUNT); @@ -147,7 +147,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { } if (this->niwType == ENNIW_TYPE_UNK2) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->sfxTimer1 = 30; this->unkTimer250 = 30; this->actor.flags &= ~0x1; // targetable OFF @@ -342,7 +342,7 @@ void EnNiw_Idle(EnNiw* this, GlobalContext* globalCtx) { if (this->niwType == ENNIW_TYPE_REGULAR) { if (Actor_HasParent(&this->actor, globalCtx)) { // picked up - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->sfxTimer1 = 30; this->unkTimer250 = 30; this->actor.flags &= ~0x1; // targetable OFF @@ -351,7 +351,7 @@ void EnNiw_Idle(EnNiw* this, GlobalContext* globalCtx) { this->actionFunc = EnNiw_Held; return; } else { - func_800B8BB0(&this->actor, globalCtx); + Actor_LiftActor(&this->actor, globalCtx); } } else { this->unkTimer252 = 10; @@ -493,7 +493,7 @@ void EnNiw_Thrown(EnNiw* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { // picked up again before could run off - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->sfxTimer1 = 30; this->unk2EC = 0; this->unkTimer250 = 30; @@ -503,7 +503,7 @@ void EnNiw_Thrown(EnNiw* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; } else { if (this->unkTimer252 > 5) { - func_800B8BB0(&this->actor, globalCtx); + Actor_LiftActor(&this->actor, globalCtx); } func_80891320(this, globalCtx, 2); } @@ -603,7 +603,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, GlobalContext* globalCtx) { this->unk264[1] = 0.0f; this->unk264[2] = 0.0f; this->unkTimer24C = 10; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow } if (this->unkTimer252 == 0) { this->unkTimer252 = 10; @@ -685,7 +685,7 @@ void EnNiw_CheckRage(EnNiw* this, GlobalContext* globalCtx) { this->unkTimer260 = 10; this->sfxTimer1 = 30; this->unk29E = 1; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->unkTimer254 = 100; this->unk2EC = 0; EnNiw_SetupRunAway(this); @@ -722,7 +722,7 @@ void EnNiw_CheckRage(EnNiw* this, GlobalContext* globalCtx) { this->unkTimer260 = 10; this->sfxTimer1 = 30; this->unk29E = 1; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow this->unkTimer254 = 100; this->unk2EC = 0; EnNiw_SetupRunAway(this); @@ -805,8 +805,8 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.rot = this->actor.world.rot; this->actor.shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->unk308); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_SetFocus(&this->actor, this->unk308); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1F); @@ -878,16 +878,16 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { EnNiw_CheckRage(this, globalCtx); if ((this->flutterSfxTimer == 0) && (this->unknownState28E == 4)) { this->flutterSfxTimer = 7; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_CHICKEN_FLUTTER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CHICKEN_FLUTTER); } if (this->sfxTimer1 == 0) { if (this->unknownState28E != 0) { this->sfxTimer1 = 30; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_A); // attack cluck + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_A); // attack cluck } else { this->sfxTimer1 = 300; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHICKEN_CRY_N); // cluck + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_N); // cluck } } diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c index dc93bf7cd..d10690104 100644 --- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c +++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c @@ -77,7 +77,7 @@ void func_80C08828(EnNnh* this) { } void func_80C0883C(EnNnh* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x228U, &this->actor); func_80C088A4(this); return; @@ -90,7 +90,7 @@ void func_80C088A4(EnNnh* this) { } void func_80C088B8(EnNnh* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { func_80C08828(this); } } diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 10f9a1783..1af1ec8b8 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -53,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { EnNutsball* this = THIS; - ActorShape_Init(&this->actor.shape, 400.0f, (ActorShadowFunc)func_800B3FC0, 13.0f); + ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.shape.rot.y = 0; this->actor.speedXZ = 10.0f; @@ -133,7 +133,7 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); Math_Vec3f_Copy(&worldPos, &this->actor.world.pos); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 5.0f, 10.0f, 0x7); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index be2c4b570..9a1a07640 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -256,7 +256,7 @@ void EnOssan_UpdateCursorPos(GlobalContext* globalCtx, EnOssan* this) { s16 x; s16 y; - func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); + Actor_GetScreenPos(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); this->cursorPos.x = x; this->cursorPos.y = y; } @@ -264,7 +264,7 @@ void EnOssan_UpdateCursorPos(GlobalContext* globalCtx, EnOssan* this) { void EnOssan_EndInteraction(GlobalContext* globalCtx, EnOssan* this) { Player* player = GET_PLAYER(globalCtx); - func_800B84D0(&this->actor, globalCtx); + Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; Interface_ChangeAlpha(50); @@ -330,7 +330,7 @@ void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); func_8013D9C8(globalCtx, this->limbRotTableY, this->limbRotTableZ, 19); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { player->stateFlags2 |= 0x20000000; EnOssan_SetupAction(this, EnOssan_BeginInteraction); if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { @@ -523,7 +523,7 @@ u8 EnOssan_CursorLeft(EnOssan* this, u8 cursorIdx, u8 shelfSlotMax) { void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { ActorAnimationEntryS* animations = sAnimations[this->actor.params]; - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; Player* player = GET_PLAYER(globalCtx); @@ -551,7 +551,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) { func_8013BC6C(&this->skelAnime, animations, 9); } if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO); } } @@ -581,7 +581,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx } void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; Player* player = GET_PLAYER(globalCtx); u8 cursorIdx; @@ -630,7 +630,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) { void EnOssan_TalkToShopkeeper(EnOssan* this, GlobalContext* globalCtx) { ActorAnimationEntryS* animations = sAnimations[this->actor.params]; - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) { this->animationIdx = 1; func_8013BC6C(&this->skelAnime, animations, 1); @@ -804,7 +804,7 @@ s32 EnOssan_HasPlayerSelectedItem(GlobalContext* globalCtx, EnOssan* this, Input } void EnOssan_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; u8 prevCursorIndex = this->cursorIdx; u8 cursorIdx; @@ -862,7 +862,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx) { } void EnOssan_BrowseRightShelf(EnOssan* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; u8 prevCursorIndex = this->cursorIdx; u8 cursorIdx; @@ -946,7 +946,7 @@ void EnOssan_LookToShopkeeperFromShelf(EnOssan* this, GlobalContext* globalCtx) void EnOssan_SetupBuyItemWithFanfare(GlobalContext* globalCtx, EnOssan* this) { Player* player = GET_PLAYER(globalCtx); - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; player->stateFlags2 &= ~0x20000000; @@ -1014,7 +1014,7 @@ void EnOssan_HandleCanBuyItem(GlobalContext* globalCtx, EnOssan* this) { } void EnOssan_SelectItem(EnOssan* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (EnOssan_TakeItemOffShelf(this) && talkState == 4) { func_8011552C(globalCtx, 6); @@ -1034,7 +1034,7 @@ void EnOssan_SelectItem(EnOssan* this, GlobalContext* globalCtx) { } void EnOssan_CannotBuy(EnOssan* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { this->actionFunc = this->tmpActionFunc; func_80151938(globalCtx, this->items[this->cursorIdx]->actor.textId); } @@ -1043,7 +1043,7 @@ void EnOssan_CannotBuy(EnOssan* this, GlobalContext* globalCtx) { void EnOssan_CanBuy(EnOssan* this, GlobalContext* globalCtx) { EnGirlA* item; - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { this->shopItemSelectedTween = 0.0f; EnOssan_ResetItemPosition(this); item = this->items[this->cursorIdx]; @@ -1058,12 +1058,12 @@ void EnOssan_BuyItemWithFanfare(EnOssan* this, GlobalContext* globalCtx) { this->actor.parent = NULL; EnOssan_SetupAction(this, EnOssan_SetupItemPurchased); } else { - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); } } void EnOssan_SetupItemPurchased(EnOssan* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; EnOssan_SetupAction(this, EnOssan_ItemPurchased); @@ -1074,12 +1074,12 @@ void EnOssan_SetupItemPurchased(EnOssan* this, GlobalContext* globalCtx) { this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); } - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } void EnOssan_ContinueShopping(EnOssan* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); EnGirlA* item; @@ -1097,7 +1097,7 @@ void EnOssan_ContinueShopping(EnOssan* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x20000000; func_801518B0(globalCtx, this->textId, &this->actor); EnOssan_SetupStartShopping(globalCtx, this, true); - func_800B85E0(&this->actor, globalCtx, 100.0f, -1); + func_800B85E0(&this->actor, globalCtx, 100.0f, EXCH_ITEM_MINUS1); break; case 1: default: @@ -1115,7 +1115,7 @@ void EnOssan_ContinueShopping(EnOssan* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x20000000; func_801518B0(globalCtx, this->textId, &this->actor); EnOssan_SetupStartShopping(globalCtx, this, true); - func_800B85E0(&this->actor, globalCtx, 100.0f, -1); + func_800B85E0(&this->actor, globalCtx, 100.0f, EXCH_ITEM_MINUS1); } } @@ -1136,10 +1136,10 @@ void EnOssan_ItemPurchased(EnOssan* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); } } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80151938(globalCtx, 0x642); } else { - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } @@ -1429,9 +1429,9 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) { this->actor.flags &= ~0x10; this->actor.objBankIndex = this->objIndex; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); shopItems = sShops[this->actor.params]; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); sInitFuncs[this->actor.params](this, globalCtx); this->textId = sWelcomeHumanTextIds[this->actor.params]; EnOssan_GetCutscenes(this, globalCtx); @@ -1518,7 +1518,7 @@ void EnOssan_Update(Actor* thisx, GlobalContext* globalCtx) { EnOssan_UpdateCursorAnim(this); func_800E9250(globalCtx, &this->actor, &this->headRot, &this->unk2CC, this->actor.focus.pos); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 90.0f); + Actor_SetFocus(&this->actor, 90.0f); SkelAnime_Update(&this->skelAnime); } else { this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index 65fd93e86..24acaa6a1 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -155,7 +155,7 @@ void EnOt_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004800, &D_060008D8, this->jointTable, this->morphTable, 19); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Animation_Change(&this->skelAnime, sAnimations[0].animationSeg, 1.0f, @@ -338,7 +338,7 @@ void func_80B5BED4(EnOt* this, GlobalContext* globalCtx) { 0x38E); this->actor.speedXZ = 3.5f; this->actor.world.pos.y = this->unk_360->actor.world.pos.y; - Actor_SetVelocityAndMoveXYRotationReverse(&this->actor); + Actor_MoveWithoutGravityReverse(&this->actor); } void func_80B5BF60(EnOt* this, GlobalContext* globalCtx) { @@ -377,7 +377,7 @@ void func_80B5BFB8(EnOt* this, GlobalContext* globalCtx) { func_80B5C684(this->unk_360, globalCtx); func_80B5C684(this, globalCtx); } else { - Actor_SetVelocityAndMoveXYRotationReverse(&this->actor); + Actor_MoveWithoutGravityReverse(&this->actor); } } @@ -388,7 +388,7 @@ void func_80B5C154(EnOt* this, GlobalContext* globalCtx) { this->unk_38C = GI_HEART_PIECE; gSaveContext.weekEventReg[32] |= 1; } - func_800B8A1C(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); this->actionFunc = func_80B5C1CC; } @@ -398,7 +398,7 @@ void func_80B5C1CC(EnOt* this, GlobalContext* globalCtx) { func_80B5C244(this, globalCtx); func_80B5C244(this->unk_360, globalCtx); } else { - func_800B8A1C(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); + Actor_PickUp(&this->actor, globalCtx, this->unk_38C, this->actor.xzDistToPlayer, this->actor.playerHeightRel); } } @@ -536,7 +536,7 @@ void func_80B5C6DC(EnOt* this, GlobalContext* globalCtx) { if ((gSaveContext.weekEventReg[84] & 0x10) && (this->unk_33C == 1)) { this->actor.textId = 0; this->unk_384 = 1; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_3A0 = BINANG_ADD(sp3E, 0x4000); this->unk_360->unk_3A0 = this->unk_3A0; func_80B5C9A8(this, globalCtx); @@ -561,7 +561,7 @@ void func_80B5C910(EnOt* this, GlobalContext* globalCtx) { void func_80B5C950(EnOt* this, GlobalContext* globalCtx) { if (this->unk_32C & 8) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); gSaveContext.weekEventReg[25] |= 4; func_80B5CAD0(this, globalCtx); } @@ -582,7 +582,7 @@ void func_80B5C9D0(EnOt* this, GlobalContext* globalCtx) { this->actor.world.rot.x = this->actor.world.rot.x; this->actor.world.rot.y = this->actor.world.rot.y; this->actor.world.rot.z = this->actor.world.rot.z; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_OUT_BOTTLE); this->actionFunc = func_80B5CA30; } @@ -617,7 +617,7 @@ void func_80B5CBA0(EnOt* this, GlobalContext* globalCtx) { } void func_80B5CBEC(EnOt* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_80B5CC88(this, globalCtx); } else { @@ -649,7 +649,7 @@ void func_80B5CD40(EnOt* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s32 temp; - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: temp = Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), 3, 0xE38, 0x38E); @@ -691,7 +691,7 @@ void func_80B5CEC8(EnOt* this, GlobalContext* globalCtx) { s32 pad; this->actor.textId = 0; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80B5D114(this, globalCtx); return; } @@ -745,7 +745,7 @@ void func_80B5D160(EnOt* this, GlobalContext* globalCtx) { u16 phi_a1; s32 temp; - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: temp = Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -900,7 +900,7 @@ void func_80B5D648(EnOt* this, GlobalContext* globalCtx) { func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx); this->actor.flags |= 0x8000000; this->actor.flags &= ~(0x8 | 0x1); - Actor_SetSwitchFlag(globalCtx, ENOT_GET_3F80(&this->actor)); + Flags_SetSwitch(globalCtx, ENOT_GET_3F80(&this->actor)); this->actionFunc = func_80B5D750; } @@ -939,7 +939,7 @@ void EnOt_Update(Actor* thisx, GlobalContext* globalCtx) { EnOt* this = THIS; if ((this->animIdx == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SEAHORSE_SWIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SEAHORSE_SWIM); } this->actionFunc(this, globalCtx); @@ -963,7 +963,7 @@ void EnOt_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.prevPos.y = this->actor.floorHeight + 50.0f; } - Actor_SetHeight(&this->actor, 12.0f); + Actor_SetFocus(&this->actor, 12.0f); SkelAnime_Update(&this->skelAnime); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -981,7 +981,7 @@ void func_80B5DAEC(Actor* thisx, GlobalContext* globalCtx) { EnOt* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 12.0f); + Actor_SetFocus(&this->actor, 12.0f); SkelAnime_Update(&this->skelAnime); func_80B5BB38(&this->unk_747, &this->unk_744, 0.7f); if (this->unk_32C & 0x400) { diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index ab5e2520a..5bf520f91 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -138,14 +138,14 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime1, &D_0600C5F8, &D_06001ADC, this->jointTable1, this->morphTable1, 21); SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &D_060105C0, &D_0600CDB0, this->jointTable2, this->morphTable2, 16); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->actor.minVelocityY = -10.0f; + this->actor.terminalVelocity = -10.0f; this->actor.targetArrowOffset = 500.0f; EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f); @@ -233,27 +233,27 @@ void func_8095A920(EnOwl* this, GlobalContext* globalCtx) { } s32 func_8095A978(EnOwl* this, GlobalContext* globalCtx, u16 textId, f32 targetDist, f32 arg4) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { return true; } this->actor.textId = textId; if (this->actor.xzDistToPlayer < targetDist) { this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, targetDist, arg4, 0); + func_800B8500(&this->actor, globalCtx, targetDist, arg4, EXCH_ITEM_NONE); } return false; } s32 func_8095A9FC(EnOwl* this, GlobalContext* globalCtx, u16 textId) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { return true; } this->actor.textId = textId; if (this->actor.xzDistToPlayer < 120.0f) { - func_800B8500(&this->actor, globalCtx, 350.0f, 1000.0f, 0); + func_800B8500(&this->actor, globalCtx, 350.0f, 1000.0f, EXCH_ITEM_NONE); } return false; @@ -269,7 +269,7 @@ void func_8095AAD0(EnOwl* this, GlobalContext* globalCtx) { s32 switchFlag = ENOWL_GET_SWITCHFLAG(&this->actor); if (switchFlag < 0x7F) { - Actor_SetSwitchFlag(globalCtx, switchFlag); + Flags_SetSwitch(globalCtx, switchFlag); } func_8095AA70(this); @@ -302,7 +302,7 @@ void func_8095ABA8(EnOwl* this) { } void func_8095ABF0(EnOwl* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { Audio_QueueSeqCmd(0x110000FF); func_8095AAD0(this, globalCtx); this->actor.flags &= ~0x10000; @@ -311,7 +311,7 @@ void func_8095ABF0(EnOwl* this, GlobalContext* globalCtx) { // Unused? void func_8095AC50(EnOwl* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { Audio_QueueSeqCmd(0x110000FF); if ((this->unk_3DA % 64) == 0) { func_8095AAD0(this, globalCtx); @@ -335,7 +335,7 @@ void func_8095ACEC(EnOwl* this) { } void func_8095AD54(EnOwl* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 4) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { case OWL_REPEAT: func_80151938(globalCtx, 0x7D1); @@ -351,14 +351,14 @@ void func_8095AD54(EnOwl* this, GlobalContext* globalCtx) { } void func_8095AE00(EnOwl* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_80151938(globalCtx, 0x7D2); this->actionFunc = func_8095AD54; } } void func_8095AE60(EnOwl* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_80151938(globalCtx, 0x7D1); this->actionFunc = func_8095AE00; } @@ -373,7 +373,7 @@ void func_8095AEC0(EnOwl* this, GlobalContext* globalCtx) { } void func_8095AF2C(EnOwl* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 5: if (func_80147624(globalCtx)) { if (globalCtx->msgCtx.unk11F04 == 0xBFE) { @@ -430,7 +430,7 @@ void func_8095B158(EnOwl* this) { if (Animation_OnFrame(&this->skelAnime1, 2.0f) || Animation_OnFrame(&this->skelAnime1, 9.0f) || Animation_OnFrame(&this->skelAnime1, 23.0f) || Animation_OnFrame(&this->skelAnime1, 40.0f) || Animation_OnFrame(&this->skelAnime1, 58.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_OWL_FLUTTER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OWL_FLUTTER); } } @@ -509,14 +509,14 @@ void func_8095B480(EnOwl* this, GlobalContext* globalCtx) { void func_8095B574(EnOwl* this, GlobalContext* globalCtx) { func_8095A920(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_8095BA84; func_801A3098(NA_BGM_OWL); this->actionFlags |= 0x40; this->unk_406 = 2; } else if (this->actor.xzDistToPlayer < 200.0f) { this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 200.0f, 400.0f, 0); + func_800B8500(&this->actor, globalCtx, 200.0f, 400.0f, EXCH_ITEM_NONE); } else { this->actor.flags &= ~0x10000; } @@ -615,7 +615,7 @@ void func_8095B9FC(EnOwl* this, GlobalContext* globalCtx) { void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) { func_8095A920(this, globalCtx); - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: if (func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { @@ -719,18 +719,18 @@ void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) { void func_8095BE0C(EnOwl* this, GlobalContext* globalCtx) { func_8095A920(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_8095BA84; func_801A3098(NA_BGM_OWL); this->unk_406 = 1; this->actionFlags |= 0x40; } else if (this->actor.textId == 0xBF0) { if (this->actor.isTargeted) { - func_800B8500(&this->actor, globalCtx, 200.0f, 200.0f, 0); + func_800B8500(&this->actor, globalCtx, 200.0f, 200.0f, EXCH_ITEM_NONE); } } else if (this->actor.xzDistToPlayer < 200.0f) { this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 200.0f, 200.0f, 0); + func_800B8500(&this->actor, globalCtx, 200.0f, 200.0f, EXCH_ITEM_NONE); } else { this->actor.flags &= ~0x10000; } @@ -891,7 +891,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { s16 sp36; if (this->actor.draw != NULL) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } if (this->unk_414 != NULL) { @@ -905,7 +905,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.update != NULL) { if ((this->skelAnime1.animation == &D_06001ADC) && Animation_OnFrame(&this->skelAnime1, 4.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_OWL_FLUTTER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OWL_FLUTTER); } if (this->actionFlags & 2) { diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c index 14ad82b2d..525606bc3 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -151,7 +151,7 @@ void EnPamera_Init(Actor* thisx, GlobalContext* globalCtx) { EnPamera* this = THIS; Vec3f sp44; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 15.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008448, &D_060005BC, this->jointTable, this->morphTable, PAMERA_LIMB_MAX); Collider_InitCylinder(globalCtx, &this->collider); @@ -196,7 +196,7 @@ void EnPamera_Init(Actor* thisx, GlobalContext* globalCtx) { } s32 func_80BD84F0(EnPamera* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_DOOR].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_DOOR].first; while (actor != NULL) { if ((actor->id == ACTOR_EN_DOOR) && (Math_Vec3f_DistXZ(&this->actor.world.pos, &actor->world.pos) < 200.0f)) { @@ -249,7 +249,7 @@ void EnPamera_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80BD8700(EnPamera* this) { this->hideInisdeTimer = 0; this->actor.flags &= ~1; - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80BD8758; } @@ -259,7 +259,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) { ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[0], &this->actor); func_800E02AC(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->cutscenes[0])), &this->actor); this->actor.speedXZ = 1.5f; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, globalCtx); @@ -268,7 +268,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscenes[0]); } else { this->actor.speedXZ = 1.5f; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actor.shape.rot.y = this->actor.home.rot.y; this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, globalCtx); @@ -290,7 +290,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) { void func_80BD8908(EnPamera* this) { this->actor.draw = EnPamera_Draw; this->actor.flags |= 1; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80BD8964; } @@ -303,14 +303,14 @@ void func_80BD8964(EnPamera* this, GlobalContext* globalCtx) { if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) { this->actor.speedXZ = 1.5f; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); gSaveContext.weekEventReg[59] |= 1; func_80BD8B50(this); } } void func_80BD8A38(EnPamera* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80BD8A7C; } @@ -357,14 +357,14 @@ void func_80BD8B70(EnPamera* this, GlobalContext* globalCtx) { void func_80BD8CCC(EnPamera* this) { this->hideInisdeTimer = 0; this->actor.speedXZ = 0.0f; - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); this->actionFunc = func_80BD8D1C; } void func_80BD8D1C(EnPamera* this, GlobalContext* globalCtx) { if (this->hideInisdeTimer++ > 200) { this->actor.speedXZ = 1.5f; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); func_80BD8D80(this); } } @@ -400,14 +400,14 @@ void func_80BD8DB0(EnPamera* this, GlobalContext* globalCtx) { void EnPamera_LookDownWell(EnPamera* this) { func_80BD93CC(this, 1, 1); - func_800BDC5C(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); this->actionFunc = func_80BD8F60; } void func_80BD8F60(EnPamera* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); this->actor.speedXZ = 3.0f; func_80BD93CC(this, 0, 0); func_80BD8D80(this); @@ -424,7 +424,7 @@ void func_80BD8FF0(EnPamera* this) { pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos); this->actor.shape.rot.y = pameraYaw; this->actor.world.rot.y = pameraYaw; - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); this->actionFunc = func_80BD909C; } @@ -454,7 +454,7 @@ void func_80BD90AC(EnPamera* this, GlobalContext* globalCtx) { } s32 func_80BD9234(EnPamera* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVES].first; while (actor != NULL) { if ((actor->id == ACTOR_EN_BOM) && (Math_Vec3f_DistXZ(&this->actor.world.pos, &actor->world.pos) < 500.0f) && @@ -512,11 +512,11 @@ void func_80BD93F4(EnPamera* this, GlobalContext* globalCtx) { (this->actionFunc == func_80BD8964) || (this->actionFunc == func_80BD8A7C)) { if (this->skelAnime.animation == &D_06008AE0) { if (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } } else if ((this->skelAnime.animation == &D_06008E38) && (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } } } @@ -609,7 +609,7 @@ void func_80BD9938(EnPamera* this) { } void func_80BD994C(EnPamera* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) { if (1) {} func_80BD93CC(this, 0, 1); @@ -642,7 +642,7 @@ void func_80BD9A9C(EnPamera* this) { } void EnPamera_HandleDialogue(EnPamera* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: case 1: case 2: @@ -760,7 +760,7 @@ void func_80BD9E78(EnPamera* this, GlobalContext* globalCtx) { } void func_80BD9E88(EnPamera* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->unk_31E = 0; this->setupFunc = func_80BD9ED0; } @@ -769,7 +769,7 @@ void func_80BD9ED0(EnPamera* this, GlobalContext* globalCtx) { } void func_80BD9EE0(EnPamera* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); func_80BD93CC(this, 1, 0); this->unk_31E = 1; this->setupFunc = func_80BD9F3C; @@ -781,19 +781,19 @@ void func_80BD9F3C(EnPamera* this, GlobalContext* globalCtx) { Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 14.0f) || Animation_OnFrame(&this->skelAnime, 18.0f) || Animation_OnFrame(&this->skelAnime, 22.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - func_800BDC5C(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); } } } void func_80BDA038(EnPamera* this) { func_80BD93CC(this, 0, 1); - func_800BDC5C(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); this->unk_31E = 0; this->setupFunc = func_80BDA090; } @@ -803,7 +803,7 @@ void func_80BDA090(EnPamera* this, GlobalContext* globalCtx) { void func_80BDA0A0(EnPamera* this) { func_80BD93CC(this, 0, 1); - func_800BDC5C(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); this->unk_31E = 1; this->setupFunc = func_80BDA0FC; } @@ -813,7 +813,7 @@ void func_80BDA0FC(EnPamera* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - func_800BDC5C(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); } } } @@ -821,7 +821,7 @@ void func_80BDA0FC(EnPamera* this, GlobalContext* globalCtx) { void func_80BDA170(EnPamera* this) { this->unk_31E = 1; func_80BD93CC(this, 0, 1); - func_800BDC5C(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); this->setupFunc = func_80BDA1C8; } @@ -829,12 +829,12 @@ void func_80BDA1C8(EnPamera* this, GlobalContext* globalCtx) { if (this->unk_31E == 1) { if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 14.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; func_80BD93CC(this, 0, 0); - func_800BDC5C(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); } } } @@ -842,7 +842,7 @@ void func_80BDA1C8(EnPamera* this, GlobalContext* globalCtx) { void func_80BDA288(EnPamera* this) { this->unk_31E = 1; func_80BD93CC(this, 0, 0); - func_800BDC5C(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); this->setupFunc = func_80BDA2E0; } @@ -850,7 +850,7 @@ void func_80BDA2E0(EnPamera* this, GlobalContext* globalCtx) { if (this->unk_31E == 1) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_31E = 0; - func_800BDC5C(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); } } } diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index cb796119a..c85f1ac49 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -184,13 +184,13 @@ void EnPametfrog_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 55.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 55.0f); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGekkoSkel, &gGekkoBoxingStanceAnim, this->jointTable, this->morphTable, GEKKO_LIMB_MAX); Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colElement); this->params = CLAMP(this->actor.params, 1, 4); - if (Actor_GetRoomCleared(globalCtx, globalCtx->roomCtx.currRoom.num)) { + if (Flags_GetClear(globalCtx, globalCtx->roomCtx.currRoom.num)) { Actor_MarkForDeath(&this->actor); if (!(gSaveContext.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { @@ -246,7 +246,7 @@ void EnPametfrog_Thaw(EnPametfrog* this, GlobalContext* globalCtx) { this->collider.base.colType = COLTYPE_HIT6; this->collider.elements->info.elemType = ELEMTYPE_UNK1; this->unk_2C4 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f); } } @@ -378,10 +378,10 @@ void EnPametfrog_PlaceSnapper(EnPametfrog* this, GlobalContext* globalCtx) { void EnPametfrog_JumpOnGround(EnPametfrog* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_JUMP); } else if (Animation_OnFrame(&this->skelAnime, 11.0f)) { EnPametfrog_JumpWaterEffects(this, globalCtx); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_WALK_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALK_WATER); } } @@ -404,8 +404,8 @@ void EnPametfrog_ApplyMagicArrowEffects(EnPametfrog* this, GlobalContext* global void EnPametfrog_ApplyElectricStun(EnPametfrog* this) { this->freezeTimer = 40; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); - func_800BCB70(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); this->drawEffect = GEKKO_DRAW_EFFECT_ELECTRIC_STUN; this->unk_2C8 = 0.75f; this->unk_2C4 = 2.0f; @@ -413,8 +413,8 @@ void EnPametfrog_ApplyElectricStun(EnPametfrog* this) { void EnPametfrog_ApplyStun(EnPametfrog* this) { this->freezeTimer = 40; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); - func_800BCB70(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); } void EnPametfrog_SetupRearOnSnapper(EnPametfrog* this) { @@ -511,7 +511,7 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx eye.y = this->actor.focus.pos.y + 100.0f; eye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z; Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &eye); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE); this->actionFunc = EnPametfrog_FallOffSnapper; } @@ -538,7 +538,7 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) { this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->actor.bgCheckFlags &= ~8; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_VOICE2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_VOICE2); this->actionFunc = EnPametfrog_JumpToWall; } @@ -581,7 +581,7 @@ void EnPametfrog_SetupWallCrawl(EnPametfrog* this) { this->skelAnime.playSpeed = 1.0f; } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_RUNAWAY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_RUNAWAY); this->actor.speedXZ = 8.0f; this->timer = Rand_S16Offset(35, 15); this->actionFunc = EnPametfrog_WallCrawl; @@ -639,11 +639,11 @@ void EnPametfrog_WallCrawl(EnPametfrog* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 15.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_BOMCHU_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BOMCHU_WALK); } if (((globalCtx->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_REAL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_REAL); } if ((this->timer == 0) || @@ -671,7 +671,7 @@ void EnPametfrog_SetupWallPause(EnPametfrog* this) { this->wallRotation = (Rand_ZeroOne() < 0.5f ? -1 : 1) * (0x1000 + randFloat) * (M_PI / (15 * 0x8000)); } this->timer = 15; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_RUNAWAY2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_RUNAWAY2); this->actionFunc = EnPametfrog_WallPause; } @@ -689,7 +689,7 @@ void EnPametfrog_WallPause(EnPametfrog* this, GlobalContext* globalCtx) { Math3D_CrossProduct(&this->unk_2DC, &this->unk_2D0, &this->unk_2E8); func_8086A238(this); if (((globalCtx->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_REAL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_REAL); } if (this->timer == 0) { @@ -768,7 +768,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) { this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.params = GEKKO_JUMP_ON_SNAPPER; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_GREET); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET); this->actionFunc = EnPametfrog_JumpOnSnapper; } @@ -819,12 +819,12 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_ON; this->timer = 10; if (this->actor.colChkInfo.health == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DEAD); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE); } - func_800BCB70(&this->actor, 0x4000, 255, 0, 16); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos); this->actor.world.pos.x += 30.0f * Math_SinS(yaw); this->actor.world.pos.z += 30.0f * Math_CosS(yaw); @@ -878,7 +878,7 @@ void EnPametfrog_SetupFallOnGround(EnPametfrog* this, GlobalContext* globalCtx) this->timer = 5; EnPametfrog_Thaw(this, globalCtx); EnPametfrog_JumpWaterEffects(this, globalCtx); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_WALK_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WALK_WATER); this->actionFunc = EnPametfrog_FallOnGround; } @@ -965,7 +965,7 @@ void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, GlobalContext* globalCtx) { this->collider.base.ocFlags1 &= ~OC1_ON; func_800B0DE0(globalCtx, &vec1, &gZeroVec3f, &gZeroVec3f, &primColor, &envColor, 800, 50); Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_NPC_APPEAR); - Actor_SetRoomClearedTemp(globalCtx, globalCtx->roomCtx.currRoom.num); + Flags_SetClearTemp(globalCtx, globalCtx->roomCtx.currRoom.num); for (i = 0; i < 25; i++) { vel.x = randPlusMinusPoint5Scaled(5.0f); @@ -1063,7 +1063,7 @@ void EnPametfrog_JumpToLink(EnPametfrog* this, GlobalContext* globalCtx) { } if ((this->collider.base.ocFlags1 & OC1_HIT) && (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) && - Actor_IsActorFacingLink(&this->actor, 0x3000) && + Actor_IsFacingPlayer(&this->actor, 0x3000) && (this->skelAnime.curFrame <= 2.0f || this->skelAnime.curFrame >= 11.0f)) { EnPametfrog_SetupMeleeAttack(this); } @@ -1102,9 +1102,9 @@ void EnPametfrog_MeleeAttack(EnPametfrog* this, GlobalContext* globalCtx) { ((this->skelAnime.animation == &gGekkoWindupPunchAnim) && Animation_OnFrame(&this->skelAnime, 27.0f))) { this->collider.base.atFlags |= AT_ON; if (this->skelAnime.animation == &gGekkoKickAnim) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_KICK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_KICK); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_PUNCH1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_PUNCH1); } } else { this->collider.base.atFlags &= ~AT_ON; @@ -1117,8 +1117,8 @@ void EnPametfrog_SetupDamage(EnPametfrog* this) { this->collider.base.atFlags &= ~AT_ON; this->collider.base.acFlags &= ~AC_ON; this->actor.speedXZ = 10.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_DAMAGE); - func_800BCB70(&this->actor, 0x4000, 255, 0, 20); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); func_800BE5CC(&this->actor, &this->collider, 0); this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y); this->actionFunc = EnPametfrog_Damage; @@ -1171,7 +1171,7 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, GlobalContext* globalCtx) { s16 yawDiff; Animation_MorphToPlayOnce(&this->skelAnime, &gGekkoCallAnim, 3.0f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_FROG_GREET); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET); this->actor.flags &= ~1; this->actor.colChkInfo.health = 6; this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); @@ -1281,7 +1281,7 @@ void EnPametfrog_ApplyDamageEffect(EnPametfrog* this, GlobalContext* globalCtx) } else if (this->actor.colChkInfo.damageEffect == GEKKO_DMGEFF_ICE) { EnPametfrog_Freeze(this); this->freezeTimer = 80; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 0x50); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 0x50); EnPametfrog_SetupStun(this); } else { EnPametfrog_Thaw(this, globalCtx); @@ -1336,11 +1336,11 @@ void EnPametfrog_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if ((this->actionFunc != EnPametfrog_JumpOnSnapper) && (this->actionFunc != EnPametfrog_RearOnSnapperRise)) { if (this->actor.gravity < -0.1f) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); arg3 = this->actionFunc == EnPametfrog_FallInAir ? 3.0f : 15.0f; Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, arg3, 3.0f, 0x1F); } else if (this->freezeTimer == 0) { - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); this->actor.floorHeight = this->actor.world.pos.y; } } diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.h b/src/overlays/actors/ovl_En_Part/z_en_part.h index be5c5b503..fa3dd410f 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.h +++ b/src/overlays/actors/ovl_En_Part/z_en_part.h @@ -7,7 +7,8 @@ struct EnPart; typedef struct EnPart { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x10]; + /* 0x144 */ char unk_144[0xC]; + /* 0x150 */ Gfx* unk_150; } EnPart; // size = 0x154 extern const ActorInit En_Part_InitVars; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 1ab37117c..11a15bdc2 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -179,7 +179,7 @@ void EnPeehat_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_Init(globalCtx, &this->skelAnime, &object_ph_Skel_001C80, &object_ph_Anim_0009C4, this->jointTable, this->morphTable, 24); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 27.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 27.0f); this->unk_2B0 = 0; Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos); this->actor.floorHeight = this->actor.world.pos.y; @@ -233,7 +233,7 @@ void func_80897170(EnPeehat* this) { this->unk_2C8 = 1.0f; this->colliderSphere.base.colType = COLTYPE_HIT3; this->unk_2B0 = 80; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_808971DC(EnPeehat* this, GlobalContext* globalCtx) { @@ -241,7 +241,7 @@ void func_808971DC(EnPeehat* this, GlobalContext* globalCtx) { this->unk_2AE = 0; this->colliderSphere.base.colType = COLTYPE_HIT6; this->unk_2C8 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_2EC, ARRAY_COUNT(this->unk_2EC), 2, 0.5f, 0.35f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2EC, ARRAY_COUNT(this->unk_2EC), 2, 0.5f, 0.35f); } } @@ -283,7 +283,7 @@ void func_80897390(EnPeehat* this, GlobalContext* globalCtx) { } this->unk_2B0 = 8; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_DAMAGE); } void func_80897498(EnPeehat* this) { @@ -327,7 +327,7 @@ void func_80897648(EnPeehat* this) { Animation_GetLastFrame(&object_ph_Anim_0009C4), 2, 0.0f); } this->unk_2B0 = 16; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_UP); this->actionFunc = func_808976DC; } @@ -474,7 +474,7 @@ void func_80897D48(EnPeehat* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { func_80897498(this); this->actor.world.pos.y = this->actor.floorHeight; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_LAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_LAND); } else if (this->actor.floorHeight < this->actor.world.pos.y) { Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight, 0.3f, 3.5f, 0.25f); if ((this->actor.world.pos.y - this->actor.floorHeight) < 60.0f) { @@ -622,11 +622,11 @@ void func_80898454(EnPeehat* this, GlobalContext* globalCtx) { void func_808984E0(EnPeehat* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_ph_Anim_000844, -4.0f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIHAT_DAMAGE); this->unk_2B2 = 4000; this->unk_2B0 = 14; this->actor.speedXZ = 10.0f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 14); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 14); this->colliderSphere.base.acFlags &= ~AC_ON; this->unk_2C4 = 0.0f; if (this->actor.colChkInfo.health == 0) { @@ -691,21 +691,21 @@ void func_8089874C(EnPeehat* this, GlobalContext* globalCtx) { } this->colliderTris.base.atFlags &= ~(AT_HIT | AT_ON); - func_800BE258(&this->actor, &this->colliderSphere.info); + Actor_SetDropFlag(&this->actor, &this->colliderSphere.info); func_808971DC(this, globalCtx); if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2B0 = 40; - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_2CC = 1.1f; this->unk_2C8 = 2.0f; this->unk_2AE = 32; func_80898414(this); } else if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2B0 = 40; - func_800BCB70(&this->actor, 0, 200, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 200, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80898414(this); } else if (this->actor.colChkInfo.damageEffect == 3) { func_80897170(this); @@ -746,7 +746,7 @@ void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx2) { if (thisx->params == 0) { func_8089874C(this, globalCtx); } - Actor_SetVelocityAndMoveYRotationAndGravity(thisx); + Actor_MoveWithGravity(thisx); Actor_UpdateBgCheckInfo(globalCtx, thisx, 25.0f, 30.0f, 30.0f, 5); this->actionFunc(this, globalCtx); @@ -763,7 +763,7 @@ void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_ScaledStepToS(&thisx->shape.rot.x, 0, 300); } } else { - Actor_SetHeight(thisx, 0.0f); + Actor_SetFocus(thisx, 0.0f); } Collider_UpdateCylinder(thisx, &this->colliderCylinder); diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 28ed05d9d..df73227a2 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -710,7 +710,7 @@ UNK_TYPE* func_80AF8540(EnPm* this, GlobalContext* globalCtx) { s32 func_80AF86F0(EnPm* this, GlobalContext* globalCtx) { s32 ret = false; - if ((this->unk_356 & 7) && func_800B84D0(&this->actor, globalCtx)) { + if ((this->unk_356 & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_8013AED4(&this->unk_356, 0, 7); this->unk_398 = 0; this->unk_378 = 0; @@ -845,7 +845,7 @@ void func_80AF8BA8(s32 arg0) { void func_80AF8C68(EnPm* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - s32 sp28 = func_80152498(&globalCtx->msgCtx); + s32 sp28 = Message_GetState(&globalCtx->msgCtx); u16 temp_a0 = globalCtx->msgCtx.unk11F04; if ((player->targetActor == &this->actor) && ((temp_a0 < 255) || (temp_a0 > 512)) && (sp28 == 3) && @@ -1024,8 +1024,8 @@ s32 func_80AF91E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar this->unk_356 &= ~8; this->unk_356 &= ~0x10; if (this->unk_258 == 27) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROOM_CARTAIN); - Actor_UnsetSwitchFlag(globalCtx, 0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROOM_CARTAIN); + Flags_UnsetSwitch(globalCtx, 0); } switch (arg2->unk0) { @@ -1089,8 +1089,8 @@ s32 func_80AF94AC(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar Math_Vec3f_Copy(&this->actor.world.pos, &sp40); Math_Vec3f_Copy(&this->actor.prevPos, &sp40); if (arg2->unk0 == 24) { - Actor_UnsetSwitchFlag(globalCtx, 0); - Actor_UnsetSwitchFlag(globalCtx, 1); + Flags_UnsetSwitch(globalCtx, 0); + Flags_UnsetSwitch(globalCtx, 1); this->unk_394 = 0; this->unk_368 = 60.0f; func_80AF7E98(this, 9); @@ -1144,8 +1144,8 @@ s32 func_80AF95E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar switch (arg2->unk0) { case 27: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROOM_CARTAIN); - Actor_SetSwitchFlag(globalCtx, 0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROOM_CARTAIN); + Flags_SetSwitch(globalCtx, 0); this->unk_36C = 20; func_8013AED4(&this->unk_356, 3, 7); func_80AF7E98(this, 3); @@ -1430,7 +1430,7 @@ s32 func_80AF9D04(EnPm* this, GlobalContext* globalCtx) { Lib_Vec3f_TranslateAndRotateY(&this->unk_26C, this->actor.world.rot.y, &sp38, &this->actor.world.pos); this->unk_36E += this->unk_374; if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_POSTMAN_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK); } } return false; @@ -1485,7 +1485,7 @@ s32 func_80AF9E7C(EnPm* this, GlobalContext* globalCtx) { this->unk_238 = sp58; } else if ((this->unk_258 != 91) && (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 8.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_POSTMAN_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK); } if ((this->unk_356 & 0x10) && (this->unk_258 == 90)) { @@ -1533,7 +1533,7 @@ s32 func_80AFA170(EnPm* this, GlobalContext* globalCtx) { } if ((this->unk_384 == 11) && Animation_OnFrame(&this->skelAnime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_POSTMACHINE_HIT_OPEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMACHINE_HIT_OPEN); } if (this->unk_258 == 19) { @@ -1569,7 +1569,7 @@ s32 func_80AFA334(EnPm* this, GlobalContext* globalCtx) { case 27: if (DECR(this->unk_36C) == 0) { - Actor_SetSwitchFlag(globalCtx, 1); + Flags_SetSwitch(globalCtx, 1); } break; @@ -1578,7 +1578,7 @@ s32 func_80AFA334(EnPm* this, GlobalContext* globalCtx) { case 21: case 22: if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_VO_NP_SLEEP_OUT); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_NP_SLEEP_OUT); } break; @@ -1714,7 +1714,7 @@ void func_80AFA4D0(EnPm* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; sp2C.unk0 = 0; } else { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.flags |= 1; } @@ -1755,10 +1755,10 @@ void func_80AFA5FC(EnPm* this, GlobalContext* globalCtx) { } void func_80AFA724(EnPm* this, GlobalContext* globalCtx) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); if (Animation_OnFrame(&this->skelAnime, 3.0f) || Animation_OnFrame(&this->skelAnime, 8.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_POSTMAN_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POSTMAN_WALK); } } @@ -1802,7 +1802,7 @@ void EnPm_Update(Actor* thisx, GlobalContext* globalCtx) { func_80AF7E6C(this); func_80AF8AC8(this); func_8013C964(&this->actor, globalCtx, this->unk_368, 30.0f, this->unk_394, this->unk_356 & 7); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); func_80AF7F68(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c index c578e3d37..fe96f5a37 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c @@ -112,7 +112,7 @@ void EnPoFusen_Init(Actor* thisx, GlobalContext* globalCtx) { if (0) {} this->collider.dim.worldSphere.radius = 40; SkelAnime_InitFlex(globalCtx, &this->anime, &D_060024F0, &D_06000040, this->jointTable, this->morphTable, 10); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); if (EnPoFusen_CheckParent(this, globalCtx) == 0) { @@ -150,7 +150,7 @@ void EnPoFusen_Destroy(Actor* thisx, GlobalContext* globalCtx) { u16 EnPoFusen_CheckParent(EnPoFusen* this, GlobalContext* globalCtx) { struct Actor* actorPtr; - actorPtr = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + actorPtr = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; if (GET_IS_FUSE_TYPE_PARAM(this)) { return 1; } @@ -243,7 +243,7 @@ void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) { void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* globalCtx) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 255, 255, 200, CLEAR_TAG_POP); - Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_MarkForDeath(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 6f267771b..a2e299290 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -158,7 +158,7 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { EnPoSisters* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060065C8, &D_060014CC, this->jointTable, this->morphTable, 12); this->unk_226 = 255; this->unk_227 = 255; @@ -303,7 +303,7 @@ void func_80B1AAE8(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (DECR(this->unk_192) == 0) { this->unk_192 = Rand_S16Offset(100, 50); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); } } @@ -407,7 +407,7 @@ void func_80B1B020(EnPoSisters* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += ((s32)((this->skelAnime.endFrame + 1.0f) * 3.0f) - this->unk_192) * 0x180; if ((this->unk_192 == 18) || (this->unk_192 == 7)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); } else if (this->unk_192 == 0) { func_80B1B0E0(this); } @@ -445,13 +445,13 @@ void func_80B1B168(EnPoSisters* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_HARD; func_80B1AC40(this); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); func_80B1BE4C(this, globalCtx); } } } if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_ROLL); } } @@ -473,7 +473,7 @@ void func_80B1B2F0(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_18C != 0) { func_80B1AC40(this); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); func_80B1BE4C(this, globalCtx); } } @@ -490,7 +490,7 @@ void func_80B1B3A8(EnPoSisters* this) { } this->unk_191 &= ~(0x8 | 0x2 | 0x1); - func_800BCB70(&this->actor, 0x4000, 255, 0, 16); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); this->actionFunc = func_80B1B444; } @@ -557,8 +557,8 @@ void func_80B1B70C(EnPoSisters* this) { this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_191 &= ~(0x4 | 0x1); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); this->actionFunc = func_80B1B7BC; } @@ -588,7 +588,7 @@ void func_80B1B860(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_192 = 15; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->unk_191 &= ~0x1; this->actionFunc = func_80B1B940; } @@ -666,7 +666,7 @@ void func_80B1BA90(EnPoSisters* this, GlobalContext* globalCtx) { } if (this->unk_192 == 16) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); } } @@ -826,7 +826,7 @@ void func_80B1C0A4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80B1C2E8(EnPoSisters* this) { Animation_PlayOnce(&this->skelAnime, &D_0600119C); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->unk_229 = 0; this->unk_191 = 0x20; this->actionFunc = func_80B1C340; @@ -855,11 +855,11 @@ void func_80B1C408(EnPoSisters* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if (this->unk_18D != 0) { ((EnPoSisters*)this->actor.parent)->unk_194--; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH2); func_80B1BE4C(this, globalCtx); if (Rand_ZeroOne() < 0.2f) { sp3C.x = this->actor.world.pos.x; @@ -879,10 +879,10 @@ void func_80B1C408(EnPoSisters* this, GlobalContext* globalCtx) { } } else { if (Actor_ApplyDamage(&this->actor)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE); } else { Enemy_StartFinishingBlow(globalCtx, &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_SISTER_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_SISTER_DEAD); } if (this->actor.colChkInfo.damageEffect == 4) { @@ -921,7 +921,7 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { func_80B1A894(this, globalCtx); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->unk_191 & 0x10) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5); @@ -934,7 +934,7 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actor.shape.shadowAlpha = this->unk_229; - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); if (this->unk_2F0 > 0.0f) { Math_StepToF(&this->unk_2F0, 0.0f, 0.05f); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index f9dc6ddf4..aedd9efc1 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -162,7 +162,7 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); Collider_InitAndSetJntSph(globalCtx, &this->colliderSph, &this->actor, &sJntSphInit, this->colliderSphElements); this->colliderSph.elements[0].dim.worldSphere.radius = 0; this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; @@ -312,7 +312,7 @@ void func_80B2CD64(EnPoh* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer > 280.0f) { func_80B2CB60(this); } else if ((this->unk_18E == 0) && (this->actor.xzDistToPlayer < 140.0f) && - !Actor_IsLinkFacingActor(&this->actor, 0x2AAA, globalCtx)) { + !Player_IsFacingActor(&this->actor, 0x2AAA, globalCtx)) { func_80B2CEC8(this); } @@ -325,14 +325,14 @@ void func_80B2CEC8(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, &D_060001A8, -6.0f); this->unk_18E = 12; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = func_80B2CF28; } void func_80B2CF28(EnPoh* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_KANTERA); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_KANTERA); if (this->unk_18E != 0) { this->unk_18E--; } @@ -355,7 +355,7 @@ void func_80B2CFF8(EnPoh* this) { func_800BE504(&this->actor, &this->colliderCylinder); this->colliderCylinder.base.acFlags &= ~AC_ON; this->actor.speedXZ = 5.0f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 16); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); this->actionFunc = func_80B2D07C; } @@ -388,7 +388,7 @@ void func_80B2D140(EnPoh* this, GlobalContext* globalCtx) { } if ((this->skelAnime.playSpeed < 0.5f) && (this->actor.xzDistToPlayer < 280.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->skelAnime.playSpeed = 1.0f; } } @@ -447,7 +447,7 @@ void func_80B2D300(EnPoh* this, GlobalContext* globalCtx) { } if (this->unk_18E == 18) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_DISAPPEAR); } } @@ -493,8 +493,8 @@ void func_80B2D76C(EnPoh* this) { this->unk_192 = 0x2000; this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); this->colliderCylinder.base.acFlags &= ~AC_ON; this->actionFunc = func_80B2D7D4; } @@ -523,8 +523,8 @@ void func_80B2D924(EnPoh* this) { this->unk_18C = 0; this->unk_192 = 0x2000; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); this->colliderCylinder.base.acFlags &= ~AC_ON; this->actionFunc = func_80B2D980; } @@ -596,7 +596,7 @@ void func_80B2DD2C(EnPoh* this, GlobalContext* globalCtx) { func_80B2E0B0(this); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); } @@ -638,7 +638,7 @@ void func_80B2E0B0(EnPoh* this) { this->actor.home.pos.y = this->actor.world.pos.y; this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METAL_BOX_BOUND); this->actionFunc = func_80B2E180; } @@ -652,7 +652,7 @@ void func_80B2E180(EnPoh* this, GlobalContext* globalCtx) { void func_80B2E1D8(EnPoh* this) { this->actor.home.pos.y = this->actor.world.pos.y; - Actor_SetHeight(&this->actor, -10.0f); + Actor_SetFocus(&this->actor, -10.0f); this->unk_18E = 200; this->unk_18D = 32; this->actor.flags |= 1; @@ -672,7 +672,7 @@ void func_80B2E230(EnPoh* this, GlobalContext* globalCtx) { return; } - func_800B8A1C(&this->actor, globalCtx, GI_MAX, 35.0f, 60.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MAX, 35.0f, 60.0f); this->actor.world.pos.y = (Math_SinS(this->unk_18D * 0x800) * 5.0f) + this->actor.home.pos.y; if (this->unk_18D) { this->unk_18D--; @@ -682,14 +682,14 @@ void func_80B2E230(EnPoh* this, GlobalContext* globalCtx) { this->unk_18D = 32; } - Actor_SetHeight(&this->actor, -10.0f); + Actor_SetFocus(&this->actor, -10.0f); Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 100, 0, 150, this->unk_197 * (40.0f / 51.0f)); } void func_80B2E3B0(EnPoh* this) { func_801A7328(&this->actor.projectedPos, NA_SE_EN_PO_BIG_CRY - SFX_FLAG); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = func_80B2E3F8; } @@ -705,9 +705,9 @@ void func_80B2E438(EnPoh* this, GlobalContext* globalCtx) { this->colliderCylinder.base.acFlags &= ~AC_HIT; if (!Actor_ApplyDamage(&this->actor)) { Enemy_StartFinishingBlow(globalCtx, &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD); } else if (this->actor.colChkInfo.damage != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE); } if (this->actor.colChkInfo.damageEffect != 14) { @@ -817,7 +817,7 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx2) { func_80B2E438(this, globalCtx); func_80B2E55C(this); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if ((this->actionFunc == func_80B2CF28) && (this->unk_18E < 10)) { this->actor.flags |= 0x1000000; CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base); @@ -830,7 +830,7 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx2) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base); - Actor_SetHeight(&this->actor, 42.0f); + Actor_SetFocus(&this->actor, 42.0f); if ((this->actionFunc != func_80B2D07C) && (this->actionFunc != func_80B2D628)) { if (this->actionFunc == func_80B2DB44) { diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index 280c898ce..d287414b3 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -237,7 +237,7 @@ s32 func_80B70B04(EnRailSkb* this, Vec3f pos) { } void func_80B70D24(EnRailSkb* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first; while (actor != NULL) { if ((actor->id == ACTOR_OBJ_HAKAISI) && func_80B70B04(this, actor->world.pos)) { @@ -263,7 +263,7 @@ void EnRailSkb_Init(Actor* thisx, GlobalContext* globalCtx) { EnRailSkb* this = THIS; func_80B708C0(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_0064E0, this->jointTable, this->morphTable, 20); Collider_InitJntSph(globalCtx, &this->collider); @@ -306,7 +306,7 @@ void EnRailSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80B70FA0(EnRailSkb* this) { this->unk_3F2 = 0; if (this->actionFunc != func_80B716A8) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); } this->actionFunc = func_80B70FF8; } @@ -328,7 +328,7 @@ void func_80B70FF8(EnRailSkb* this, GlobalContext* globalCtx) { } void func_80B710AC(EnRailSkb* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80B710E4; } @@ -339,7 +339,7 @@ void func_80B710E4(EnRailSkb* this, GlobalContext* globalCtx) { } void func_80B71114(EnRailSkb* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_80B7114C; } @@ -349,9 +349,9 @@ void func_80B7114C(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_2F0 = 0.0f; this->unk_2EC = 0.0f; if (this->actor.colChkInfo.health != 0) { - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); - func_800BDC5C(&this->skelAnime, sAnimations, 3); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); } else { @@ -373,9 +373,9 @@ void func_80B7123C(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_2F0 = 0.0f; this->unk_2EC = 0.0f; if (this->actor.colChkInfo.health != 0) { - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); - func_800BDC5C(&this->skelAnime, sAnimations, 3); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_402 |= 1; func_80B712FC(this); } else { @@ -399,8 +399,8 @@ void func_80B71314(EnRailSkb* this, GlobalContext* globalCtx) { } void func_80B71354(EnRailSkb* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80B713A4; } @@ -409,7 +409,7 @@ void func_80B713A4(EnRailSkb* this, GlobalContext* globalCtx) { if ((this->actor.xzDistToPlayer > 65.0f) || (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN)) { func_80B70FA0(this); } else { - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); } } @@ -446,11 +446,11 @@ void func_80B7151C(EnRailSkb* this) { this->actor.colChkInfo.health = 2; this->unk_402 = 0; this->actor.flags |= 1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); this->actor.draw = EnRailSkb_Draw; this->actor.shape.shadowAlpha = 0; this->actor.shape.rot.y = this->actor.world.rot.y; - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actionFunc = func_80B715AC; } @@ -473,13 +473,13 @@ void func_80B715AC(EnRailSkb* this, GlobalContext* globalCtx) { void func_80B71650(EnRailSkb* this) { this->unk_3FE = 0; if (this->actionFunc != func_80B70FF8) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); } this->actionFunc = func_80B716A8; } void func_80B716A8(EnRailSkb* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_3FE = 1; func_80B71D8C(this, globalCtx, func_80B723F8); if (!func_80B7285C(this)) { @@ -490,7 +490,7 @@ void func_80B716A8(EnRailSkb* this, GlobalContext* globalCtx) { func_801518B0(globalCtx, 0x13F5, &this->actor); this->unk_400 = 0x13F5; } - func_800BDC5C(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); func_80B717C8(this); } else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, globalCtx, 100.0f); @@ -506,7 +506,7 @@ void func_80B717C8(EnRailSkb* this) { void func_80B717E0(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_3FA = 0; - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: case 1: case 2: @@ -552,7 +552,7 @@ void func_80B718C4(EnRailSkb* this, GlobalContext* globalCtx) { } void func_80B71910(EnRailSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80B71954; } @@ -565,12 +565,12 @@ void func_80B71954(EnRailSkb* this, GlobalContext* globalCtx) { if (sp30 < 80.0f) { func_80B71A08(this); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80B71A08(EnRailSkb* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); this->actionFunc = func_80B71A58; } @@ -578,8 +578,8 @@ void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) { s16 sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->actor.world.pos); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); if (this->unk_2E8 < this->unk_22C->actor.colChkInfo.health) { this->unk_22C->actor.colChkInfo.health--; } else { @@ -602,7 +602,7 @@ void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) { void func_80B71B6C(EnRailSkb* this) { this->unk_3F2 = 10; - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->actionFunc = func_80B71BB8; } @@ -620,7 +620,7 @@ void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) { Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C->actor.world.pos), 1, 0x71C, 0xB6); if ((this->actor.bgCheckFlags & 1) && (this->unk_22C->actor.colChkInfo.health == 0)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } else { this->actor.velocity.y += this->actor.gravity; this->actor.world.pos.y += this->actor.velocity.y; @@ -634,8 +634,8 @@ void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) { } if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); - func_800BDC5C(&this->skelAnime, sAnimations, 9); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); this->actor.velocity.y = 10.0f; for (i = 0; i < 4; i++) { @@ -645,7 +645,7 @@ void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) { } void func_80B71D8C(EnRailSkb* this, GlobalContext* globalCtx, EnRailSkbUnkFunc unkFunc) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first; while (actor != NULL) { if (actor->id == ACTOR_EN_RAIL_SKB) { @@ -668,7 +668,7 @@ void func_80B71DF0(EnRailSkb* this) { this->unk_3F0 = 0; } - func_800BDC5C(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); this->actionFunc = func_80B71EA8; } @@ -767,7 +767,7 @@ void func_80B72190(EnRailSkb* this, GlobalContext* globalCtx) { if ((this->actionFunc != func_80B714D8) && (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK); } if (this->actor.parent == NULL) { @@ -811,7 +811,7 @@ void func_80B72190(EnRailSkb* this, GlobalContext* globalCtx) { } else { this->unk_2E0 = 0; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } @@ -978,12 +978,12 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_403 = 30; this->unk_2EC = 1.0f; this->unk_2F0 = 0.0f; - func_800BCB70(&this->actor, 0, 120, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); func_80B710AC(this); break; case 1: - func_800BCB70(&this->actor, 0, 120, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); func_80B710AC(this); break; @@ -992,16 +992,16 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_403 = 0; this->unk_2EC = 1.0f; this->unk_2F0 = 0.0f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); this->unk_402 |= 1; func_80B712FC(this); break; case 3: if (this->actor.colChkInfo.health != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3F0 = 80; } else { this->unk_3F0 = 3; @@ -1009,7 +1009,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_403 = 11; this->unk_2EC = 1.0f; this->unk_2F0 = 0.5f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); func_80B71114(this); break; @@ -1018,9 +1018,9 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { this->unk_403 = 20; this->unk_2EC = 1.0f; this->unk_2F0 = 0.5f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); func_80B71228(this); break; @@ -1035,9 +1035,9 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) { } case 13: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); func_80B712FC(this); break; @@ -1112,10 +1112,10 @@ void EnRailSkb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList Collider_UpdateSpheres(limbIndex, &this->collider); if ((limbIndex == 11) && (this->unk_402 & 1) && !(this->unk_402 & 2)) { - func_800BBCEC(&this->actor, globalCtx, 1, dList); + Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList); this->unk_402 |= 2; } else if ((this->unk_402 & 0x40) && ((limbIndex != 11) || !(this->unk_402 & 1)) && (limbIndex != 12)) { - func_800BBCEC(&this->actor, globalCtx, 1, dList); + Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList); } if (this->unk_3F0 != 0) { diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index de64df7df..16b8d4fe6 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -212,14 +212,14 @@ void EnRailgibud_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_402 = gSaveContext.time; this->unk_404 = 0; this->unk_3F8 = 0; - this->unk_400 = 0; + this->textId = 0; this->unk_3FA = 0; if (this->actor.parent == NULL) { this->unk_3EC = 1; this->unk_3EE = 1; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 28.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, 26); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -239,7 +239,7 @@ void EnRailgibud_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80BA57A8(EnRailgibud* this) { this->actor.speedXZ = 0.6f; - func_800BDC5C(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); this->actionFunc = func_80BA57F8; } @@ -283,11 +283,11 @@ void func_80BA57F8(EnRailgibud* this, GlobalContext* globalCtx) { } else { this->unk_298 = 0; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BA59F0(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); this->actionFunc = func_80BA5A34; } @@ -300,14 +300,14 @@ void func_80BA5A34(EnRailgibud* this, GlobalContext* globalCtx) { player->actor.freezeTimer = 60; func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(globalCtx, &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); func_80BA5AF0(this); } func_80BA6B9C(this, globalCtx); } void func_80BA5AF0(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); this->actor.speedXZ = 0.4f; if (this->actionFunc == func_80BA5A34) { this->unk_3F2 = 80; @@ -325,7 +325,7 @@ void func_80BA5B64(EnRailgibud* this, GlobalContext* globalCtx) { this->actor.world.rot = this->actor.shape.rot; Math_SmoothStepToS(&this->unk_3E2, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->unk_3E8, 0, 1, 0x64, 0); - if (func_80BA6D10(this, globalCtx) && Actor_IsActorFacingLink(&this->actor, 0x38E3)) { + if (func_80BA6D10(this, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) { if ((this->unk_3F4 == 0) && (this->actor.xzDistToPlayer <= 45.0f)) { player->actor.freezeTimer = 0; if ((gSaveContext.playerForm == PLAYER_FORM_GORON) || (gSaveContext.playerForm == PLAYER_FORM_DEKU)) { @@ -339,7 +339,7 @@ void func_80BA5B64(EnRailgibud* this, GlobalContext* globalCtx) { this->unk_3F2 = 60; func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(globalCtx, &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); } else { this->unk_3F2--; } @@ -355,14 +355,14 @@ void func_80BA5B64(EnRailgibud* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((globalCtx->gameplayFrames & 95) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } void func_80BA5DBC(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); this->actor.flags &= ~1; this->unk_3F2 = 0; this->unk_3F0 = 0; @@ -380,9 +380,9 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { sp34 = func_80BA7088(this, globalCtx); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (sp34 == 1)) { this->unk_3F0 = 1; - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); } else if (!(player->stateFlags2 & 0x80)) { - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actor.flags |= 1; this->unk_3F0 = 2; this->unk_3F2 = 0; @@ -395,7 +395,7 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { sp32 = player->ageProperties->unk_92 + 0x6805; globalCtx->damagePlayer(globalCtx, -8); - func_800B8E58(&player->actor, sp32); + func_800B8E58(player, sp32); func_8013ECE0(this->actor.xzDistToPlayer, 240, 1, 12); this->unk_3F2 = 0; } else { @@ -403,7 +403,7 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) { @@ -411,7 +411,7 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->unk_AE8 = 100; } - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actor.flags |= 1; this->unk_3F0 = 2; this->unk_3F2 = 0; @@ -431,8 +431,8 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6054(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 7); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actor.speedXZ = -2.0f; this->actionFunc = func_80BA60B0; } @@ -453,7 +453,7 @@ void func_80BA60B0(EnRailgibud* this, GlobalContext* globalCtx) { void func_80BA6158(EnRailgibud* this) { this->unk_3F2 = 0; - func_800BDC5C(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); this->actionFunc = func_80BA61A0; } @@ -470,7 +470,7 @@ void func_80BA61A0(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6284(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); this->actor.speedXZ = 0.4f; this->actionFunc = func_80BA62D4; } @@ -495,15 +495,15 @@ void func_80BA62D4(EnRailgibud* this, GlobalContext* globalCtx) { } if (func_80BA6D10(this, globalCtx)) { if ((gSaveContext.playerForm != PLAYER_FORM_GORON) && (gSaveContext.playerForm != PLAYER_FORM_DEKU) && - Actor_IsActorFacingLink(&this->actor, 0x38E3)) { + Actor_IsFacingPlayer(&this->actor, 0x38E3)) { func_80BA5AF0(this); } } } void func_80BA6440(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 7); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->unk_3F2 = 0; this->unk_3F4 = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -532,9 +532,9 @@ void func_80BA6584(EnRailgibud* this) { this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_3F2 = 10; if (this->unk_3F6 != 0) { - func_800BCB70(&this->actor, 0, 0xC8, 0, 0x28); + Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28); } else { - func_800BCB70(&this->actor, 0, 0xC8, 0, 0x28); + Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28); } this->actionFunc = func_80BA6604; } @@ -554,9 +554,9 @@ void func_80BA6604(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA6664(EnRailgibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->unk_3F2 = 0; this->actionFunc = func_80BA66C8; } @@ -699,7 +699,7 @@ void func_80BA6DF8(EnRailgibud* this, GlobalContext* globalCtx) { switch (this->actor.colChkInfo.damageEffect) { case 15: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (player->unk_ADC != 0) { this->unk_405 = player->unk_ADD; } @@ -720,7 +720,7 @@ void func_80BA6DF8(EnRailgibud* this, GlobalContext* globalCtx) { break; case 2: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (this->actor.colChkInfo.health == 0) { func_80BA6664(this); } else { @@ -732,7 +732,7 @@ void func_80BA6DF8(EnRailgibud* this, GlobalContext* globalCtx) { break; case 4: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (this->actor.colChkInfo.health == 0) { func_80BA6664(this); } else { @@ -790,7 +790,7 @@ s32 func_80BA7088(EnRailgibud* this, GlobalContext* globalCtx) { void func_80BA71E4(EnRailgibud* this, GlobalContext* globalCtx) { if ((this->actionFunc == func_80BA5B64) || (this->actionFunc == func_80BA62D4) || (this->actionFunc == func_80BA64AC)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } @@ -854,28 +854,28 @@ void func_80BA7434(EnRailgibud* this, GlobalContext* globalCtx) { } void func_80BA7578(EnRailgibud* this, GlobalContext* globalCtx) { - if ((this->unk_400 == 0) && (this->unk_3F8 == 0)) { - if (func_800B84D0(&this->actor, globalCtx)) { + if ((this->textId == 0) && (this->unk_3F8 == 0)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_3FA = 1; func_801518B0(globalCtx, 0x13B2, &this->actor); - this->unk_400 = 0x13B2; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + this->textId = 0x13B2; + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); this->actor.speedXZ = 0.0f; } else if (((this->actor.flags & 9) == 9) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, globalCtx, 100.0f); } } else { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 5: if (func_80147624(globalCtx)) { func_801518B0(globalCtx, 0x13B3, &this->actor); - this->unk_400 = 0x13B3; + this->textId = 0x13B3; } break; case 6: if (func_80147624(globalCtx)) { - this->unk_400 = 0; + this->textId = 0; this->unk_3FA = 0; this->actor.speedXZ = 0.6f; } @@ -995,7 +995,7 @@ void func_80BA7B6C(EnRailgibud* this, GlobalContext* globalCtx) { this->unk_3FE = 99; this->actor.flags |= 0x100000; this->actor.flags |= 0x10; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 28.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, 26); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -1067,37 +1067,37 @@ s32 func_80BA7DC8(EnRailgibud* this, GlobalContext* globalCtx) { switch (globalCtx->csCtx.npcActions[sp2C]->unk0) { case 1: this->unk_3F0 = 9; - func_800BDC5C(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); break; case 2: this->unk_3F0 = 15; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_WEAKENED2); - func_800BDC5C(&this->skelAnime, sAnimations, 15); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 15); break; case 3: this->unk_3F0 = 17; - func_800BDC5C(&this->skelAnime, sAnimations, 17); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 17); break; case 4: this->unk_3F0 = 18; - func_800BDC5C(&this->skelAnime, sAnimations, 18); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 18); break; case 5: this->unk_3F0 = 10; - func_800BDC5C(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10); break; } } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_3F0 == 15) { this->unk_3F0 = 16; - func_800BDC5C(&this->skelAnime, sAnimations, 16); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 16); } else if (this->unk_3F0 == 18) { this->unk_3F0 = 19; - func_800BDC5C(&this->skelAnime, sAnimations, 19); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 19); func_80BA7D14(this); } } @@ -1115,9 +1115,9 @@ s32 func_80BA7DC8(EnRailgibud* this, GlobalContext* globalCtx) { case 5: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (globalCtx->csCtx.frames < 280) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_WEAKENED1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED1); } } break; diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h index 35cb83cd2..546a885b5 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h @@ -41,7 +41,7 @@ typedef struct EnRailgibud { /* 0x03FA */ s16 unk_3FA; /* 0x03FC */ u16 unk_3FC; /* 0x03FE */ u16 unk_3FE; - /* 0x0400 */ u16 unk_400; + /* 0x0400 */ u16 textId; /* 0x0402 */ s16 unk_402; /* 0x0404 */ u8 unk_404; /* 0x0405 */ s8 unk_405; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index be62210ea..766d03070 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -244,7 +244,7 @@ void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_808D4190(GlobalContext* globalCtx, EnRd* this, s32 arg2) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first; while (actor != NULL) { if ((actor->id != ACTOR_EN_RD) || (this == (EnRd*)actor) || (actor->params < ENRD_GET_0)) { @@ -338,7 +338,7 @@ void func_808D43AC(EnRd* this, GlobalContext* globalCtx) { } if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -381,7 +381,7 @@ void func_808D4660(EnRd* this, GlobalContext* globalCtx) { } if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -424,14 +424,14 @@ void func_808D4868(EnRd* this, GlobalContext* globalCtx) { } if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } void func_808D49E4(EnRd* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } this->unk_3E4++; @@ -483,7 +483,7 @@ void func_808D4B20(EnRd* this, GlobalContext* globalCtx) { } if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -499,7 +499,7 @@ void func_808D4B20(EnRd* this, GlobalContext* globalCtx) { void func_808D4CA8(EnRd* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } this->actor.world.rot.y -= this->unk_3E4; @@ -537,7 +537,7 @@ void func_808D4E60(EnRd* this, GlobalContext* globalCtx) { } } else { if (this->actor.world.pos.y == this->actor.home.pos.y) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) { @@ -587,7 +587,7 @@ void func_808D506C(EnRd* this, GlobalContext* globalCtx) { func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); } this->unk_3ED = 60; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); } } else { func_808D53C0(this, globalCtx); @@ -599,7 +599,7 @@ void func_808D506C(EnRd* this, GlobalContext* globalCtx) { } if (!this->unk_3EE && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 45.0f) && - Actor_IsActorFacingLink(&this->actor, 0x38E3)) { + Actor_IsFacingPlayer(&this->actor, 0x38E3)) { player->actor.freezeTimer = 0; if ((player->transformation == PLAYER_FORM_GORON) || (player->transformation == PLAYER_FORM_DEKU)) { if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) < 150.0f) { @@ -620,9 +620,9 @@ void func_808D506C(EnRd* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -670,9 +670,9 @@ void func_808D5440(EnRd* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -715,9 +715,9 @@ void func_808D56E4(EnRd* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } else if ((globalCtx->gameplayFrames & 0x5F) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } @@ -786,7 +786,7 @@ void func_808D58CC(EnRd* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 6000, 0); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } this->unk_3EA--; @@ -794,7 +794,7 @@ void func_808D58CC(EnRd* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); func_8013ECE0(this->actor.xzDistToPlayer, 240, 1, 12); this->unk_3EA = 20; - func_800B8E58(&player->actor, player->ageProperties->unk_92 + 0x6805); + func_800B8E58(player, player->ageProperties->unk_92 + 0x6805); } break; @@ -833,7 +833,7 @@ void func_808D5CCC(EnRd* this, GlobalContext* globalCtx) { func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(globalCtx, &this->actor); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); func_808D4FE0(this, globalCtx); } } @@ -842,7 +842,7 @@ void func_808D5D88(EnRd* this) { this->unk_3EF = 8; Animation_MorphToPlayOnce(&this->skelAnime, &D_06009900, -6.0f); this->actor.speedXZ = -2.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->unk_3EF = 8; this->actionFunc = func_808D5DF4; } @@ -919,7 +919,7 @@ void func_808D616C(EnRd* this) { } this->actor.flags |= 1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->unk_3EF = 11; this->actionFunc = func_808D6200; } @@ -954,7 +954,7 @@ void func_808D6310(EnRd* this) { this->unk_3D6 = 300; this->actor.flags &= ~1; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->actionFunc = func_808D6388; } @@ -969,7 +969,7 @@ void func_808D6388(EnRd* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { if (this->unk_3D6 == 0) { if (!Flags_GetSwitch(globalCtx, this->unk_3DC & 0x7F)) { - Actor_SetSwitchFlag(globalCtx, this->unk_3DC & 0x7F); + Flags_SetSwitch(globalCtx, this->unk_3DC & 0x7F); } if (this->unk_3DE != 0) { @@ -985,7 +985,7 @@ void func_808D6388(EnRd* this, GlobalContext* globalCtx) { this->unk_3D6--; } } else if (Animation_OnFrame(&this->skelAnime, 33.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } } @@ -997,12 +997,12 @@ void func_808D64D0(EnRd* this) { if (gSaveContext.unk_3F58 != 0) { this->unk_3E9 = 1; this->unk_3E0 = 600; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); - func_800BCB70(&this->actor, 0x8000, 0x80C8, 0, 255); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT); + Actor_SetColorFilter(&this->actor, 0x8000, 0x80C8, 0, 255); } else if (this->unk_3F0 == 1) { - func_800BCB70(&this->actor, 0, 0xC8, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 40); } else if (this->unk_3F0 == 12) { - func_800BCB70(&this->actor, 0, 0xC8, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 40); } this->actionFunc = func_808D65BC; } @@ -1016,7 +1016,7 @@ void func_808D65BC(EnRd* this, GlobalContext* globalCtx) { if (this->unk_3E0 != 0) { this->unk_3E0--; if (this->unk_3E0 >= 255) { - func_800BCB70(&this->actor, 0x8000, 0x80C8, 0, 255); + Actor_SetColorFilter(&this->actor, 0x8000, 0x80C8, 0, 255); } if (this->unk_3E0 == 0) { @@ -1074,7 +1074,7 @@ void func_808D6814(EnRd* this, GlobalContext* globalCtx) { return; } - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if (player->unk_ADC != 0) { this->unk_3F1 = player->unk_ADD; @@ -1096,7 +1096,7 @@ void func_808D6814(EnRd* this, GlobalContext* globalCtx) { return; case 2: - func_800BCB70(&this->actor, 0x4000, 255, 0, 40); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->unk_3E6 = 180; this->unk_3E8 = 0; this->unk_3E9 = 0; @@ -1105,7 +1105,7 @@ void func_808D6814(EnRd* this, GlobalContext* globalCtx) { break; case 4: - func_800BCB70(&this->actor, 0x4000, 255, 0, 40); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->unk_3E6 = 60; this->unk_3E8 = 20; this->unk_3E9 = 0; @@ -1114,13 +1114,13 @@ void func_808D6814(EnRd* this, GlobalContext* globalCtx) { break; case 15: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); this->unk_3E9 = 0; this->unk_3E0 = 0; break; case 14: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); this->unk_3E9 = 0; this->unk_3E0 = 0; this->actor.colChkInfo.health = 0; @@ -1183,7 +1183,7 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if ((this->unk_3EF != 10) && (this->actor.speedXZ != 0.0f)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } if ((this->actor.shape.rot.x == 0) && (this->unk_3EF != 10) && (this->actor.speedXZ != 0.0f)) { diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c index 07f3ca850..baa7aadad 100644 --- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c +++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c @@ -108,9 +108,9 @@ void EnRecepgirl_Wait(EnRecepgirl* this, GlobalContext* globalCtx) { } } - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { EnRecepgirl_SetupTalk(this); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2000)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2000)) { func_800B8614(&this->actor, globalCtx, 60.0f); if (Player_GetMask(globalCtx) == PLAYER_MASK_KAFEIS_MASK) { this->actor.textId = 0x2367; // "... doesn't Kafei want to break off his engagement ... ?" @@ -148,13 +148,13 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) { } } - temp_v0_2 = func_80152498(&globalCtx->msgCtx); + temp_v0_2 = Message_GetState(&globalCtx->msgCtx); if (temp_v0_2 == 2) { this->actor.textId = 0x2ADC; // hear directions again? EnRecepgirl_SetupWait(this); } else if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) { if (this->actor.textId == 0x2AD9) { // "Welcome..." - Actor_SetSwitchFlag(globalCtx, this->actor.params); + Flags_SetSwitch(globalCtx, this->actor.params); Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f); if (gSaveContext.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index f01235327..c52c7c178 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -148,7 +148,7 @@ void EnRr_Init(Actor* thisx, GlobalContext* globalCtx) { } Collider_UpdateCylinder(&this->actor, &this->collider2); - Actor_SetHeight(&this->actor, this->actor.scale.y * 2000.0f); + Actor_SetFocus(&this->actor, this->actor.scale.y * 2000.0f); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if ((this->actor.params == ENRR_2) || (this->actor.params == ENRR_3)) { @@ -197,7 +197,7 @@ void func_808FA11C(EnRr* this) { this->unk_224 = 1.2750001f; this->unk_21C = 1.0f; this->actor.flags &= ~0x400; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_808FA19C(EnRr* this, GlobalContext* globalCtx) { @@ -207,15 +207,15 @@ void func_808FA19C(EnRr* this, GlobalContext* globalCtx) { this->collider1.base.colType = COLTYPE_HIT0; this->collider1.info.elemType = ELEMTYPE_UNK1; this->unk_21C = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_234, 20, 2, this->actor.scale.y * 23.333334f, - this->actor.scale.y * 20.000002f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_234, 20, 2, this->actor.scale.y * 23.333334f, + this->actor.scale.y * 20.000002f); this->actor.flags |= 0x400; } } void func_808FA238(EnRr* this, f32 arg1) { this->actor.speedXZ = arg1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_WALK); } void func_808FA260(EnRr* this) { @@ -236,7 +236,7 @@ void func_808FA260(EnRr* this) { this->actionFunc = func_808FB088; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_UNARI); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_UNARI); } void func_808FA344(EnRr* this) { @@ -286,7 +286,7 @@ void func_808FA3F8(EnRr* this, Player* player) { } this->actionFunc = func_808FB1C0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_SUISEN_DRINK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SUISEN_DRINK); } void func_808FA4F4(EnRr* this, GlobalContext* globalCtx) { @@ -313,7 +313,7 @@ void func_808FA4F4(EnRr* this, GlobalContext* globalCtx) { sp34 = false; } - if (sp34 && (func_80152498(&globalCtx->msgCtx) == 0)) { + if (sp34 && (Message_GetState(&globalCtx->msgCtx) == 0)) { func_801518B0(globalCtx, 0xF6, NULL); } @@ -331,7 +331,7 @@ void func_808FA4F4(EnRr* this, GlobalContext* globalCtx) { player->actor.world.pos.z += sp30 * Math_CosS(this->actor.shape.rot.y); func_800B8D50(globalCtx, &this->actor, sp30, this->actor.shape.rot.y, sp2C, sp38); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_SUISEN_THROW); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SUISEN_THROW); } } @@ -344,7 +344,7 @@ void func_808FA6B8(EnRr* this) { } else { this->unk_1EC = 40; } - func_800BCB70(&this->actor, 0x4000, 255, 0, this->unk_1EC); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, this->unk_1EC); this->unk_1E6 = 20; this->unk_1F6 = 2500; @@ -360,7 +360,7 @@ void func_808FA6B8(EnRr* this) { } this->actionFunc = func_808FB398; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_DAMAGE); } void func_808FA7AC(EnRr* this) { @@ -405,7 +405,7 @@ void func_808FA910(EnRr* this) { this->unk_1E4 = 0; this->unk_214 = 0.0f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 40); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->unk_210 = 0.0f; for (i = 0; i < ARRAY_COUNT(this->unk_324); i++) { @@ -415,7 +415,7 @@ void func_808FA910(EnRr* this) { } this->actionFunc = func_808FB42C; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_DEAD); this->actor.flags &= ~1; } @@ -465,7 +465,7 @@ s32 func_808FAA94(EnRr* this, GlobalContext* globalCtx) { return false; } - func_800BE258(&this->actor, &sp2C->info); + Actor_SetDropFlag(&this->actor, &sp2C->info); func_808FA4F4(this, globalCtx); func_808FA19C(this, globalCtx); @@ -481,8 +481,8 @@ s32 func_808FAA94(EnRr* this, GlobalContext* globalCtx) { func_808FA910(this); } } else if (this->actor.colChkInfo.damageEffect == 1) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); - func_800BCB70(&this->actor, 0, 255, 0, 80); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 80); this->unk_1EE = 80; func_808FA9CC(this); } else if (this->actor.colChkInfo.damageEffect == 3) { @@ -630,7 +630,7 @@ void func_808FB1C0(EnRr* this, GlobalContext* globalCtx) { func_8013ECE0(this->actor.xyzDistToPlayerSq, 120, 2, 120); if (!(this->unk_1E4 & 7)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEMO_EYE); } player->unk_AE8 = 0; @@ -786,7 +786,7 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_1F0--; } - Actor_SetHeight(&this->actor, this->actor.scale.y * 2000.0f); + Actor_SetFocus(&this->actor, this->actor.scale.y * 2000.0f); func_808FAE50(this, globalCtx); if (!func_808FAA94(this, globalCtx)) { @@ -801,7 +801,7 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, this->collider1.dim.radius, 0.0f, 0x5D); func_808FB794(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c index 3adecaad3..78af19c64 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c @@ -37,7 +37,7 @@ extern Gfx D_06005458[]; static ActorAnimationEntry animations[] = { { &D_0600788C, 1.0f, 0.0f, 0.0f, 0x00, 0.0f } }; void func_80C25D40(EnRsn* this) { - func_800BDC5C(&this->skelAnime, animations, 0); + Actor_ChangeAnimation(&this->skelAnime, animations, 0); this->actionFunc = func_80C25D84; } @@ -47,7 +47,7 @@ void func_80C25D84(EnRsn* this, GlobalContext* globalCtx) { void EnRsn_Init(Actor* thisx, GlobalContext* globalCtx) { EnRsn* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009220, &D_06009120, NULL, NULL, 0); this->actor.flags &= ~1; func_80C25D40(this); @@ -63,7 +63,7 @@ void EnRsn_Update(Actor* thisx, GlobalContext* globalCtx) { EnRsn* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); SkelAnime_Update(&this->skelAnime); func_800E9250(globalCtx, &this->actor, &this->unk1D8, &this->unk1DE, this->actor.focus.pos); } diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index a255b0b80..cebb90123 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -225,7 +225,7 @@ void EnRuppecrow_ShatterIce(EnRuppecrow* this, GlobalContext* globalCtx) { if (this->currentEffect == ENRUPPECROW_EFFECT_ICE) { this->currentEffect = ENRUPPECROW_EFFECT_NONE; this->unk_2C8 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->limbPos, ENRUPPECROW_LIMB_POS_COUNT, 0x2, 0.2f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->limbPos, ENRUPPECROW_LIMB_POS_COUNT, 0x2, 0.2f, 0.2f); } } @@ -282,7 +282,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= 0x10; @@ -293,7 +293,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= 0x10; @@ -305,7 +305,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= 0x10; @@ -316,7 +316,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) { this->rupees[rupeeIndex] = rupee; this->rupees[rupeeIndex]->actor.gravity = -5.0f; this->rupees[rupeeIndex]->actor.velocity.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_RUPY_FALL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL); rupee = this->rupees[rupeeIndex]; rupee->unk152 = 60; this->rupees[rupeeIndex]->actor.flags |= 0x10; @@ -449,7 +449,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { scale = this->actor.scale.x * 100.0f; this->actor.world.pos.y += 20.0f * scale; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_DEAD); this->unk_2CC = 0.5f; if (this->actor.colChkInfo.damageEffect == 0x3) { @@ -464,7 +464,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { this->unk_2C8 = 5.0f; } - func_800BCB70(&this->actor, 0x4000, 0xFF, 0x0, 0x28); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x0, 0x28); if (this->actor.flags & 0x8000) { this->actor.speedXZ = 0.0f; } @@ -477,7 +477,7 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) { void EnRuppecrow_UpdateDamage(EnRuppecrow* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - func_800BE258(&this->actor, this->collider.elements); + Actor_SetDropFlag(&this->actor, &this->collider.elements->info); if (this->actor.colChkInfo.damageEffect != 0x1) { this->actor.colChkInfo.health = 0; @@ -494,7 +494,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, GlobalContext* globalCtx) { EnRuppecrow_UpdatePosition(this, globalCtx); if (this->actor.xzDistToPlayer < 1000.0f && EnRuppecrow_CheckPlayedMatchingSong(globalCtx)) { // If Link is in front, the guay will turn around and go the other way - if (Actor_IsActorFacingLink(&this->actor, 0x4000)) { + if (Actor_IsFacingPlayer(&this->actor, 0x4000)) { this->isGoingCounterClockwise |= 1; if (this->currentPoint > 0) { this->currentPoint--; @@ -513,12 +513,12 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.1f, 0.1f); } - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); this->yOffset += 0x1000; this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; if ((globalCtx->state.frames % 43) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); } } @@ -533,7 +533,7 @@ void EnRuppecrow_HandleSongCutscene(EnRuppecrow* this, GlobalContext* globalCtx) ActorCutscene_SetIntentToPlay(this->actor.cutscene); } - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, GlobalContext* globalCtx) { @@ -551,19 +551,19 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, GlobalContext* global this->actionFunc = EnRuppecrow_FlyToDespawn; this->skelAnime.playSpeed = 1.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } else { if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { EnRuppecrow_UpdateSpeed(this, globalCtx); Math_ApproachF(&this->actor.speedXZ, this->speedModifier, 0.2f, 0.5f); } - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); this->yOffset += 0x1000; this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; if ((globalCtx->state.frames % 43) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); } } } @@ -582,10 +582,10 @@ void EnRuppecrow_FlyToDespawn(EnRuppecrow* this, GlobalContext* globalCtx) { this->yOffset += 0x800; this->actor.shape.yOffset = Math_SinS(this->yOffset) * 500.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if ((globalCtx->state.frames % 43) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_CRY); } } } @@ -619,7 +619,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, GlobalContext* globalCtx) { } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void EnRuppecrow_Init(Actor* thisx, GlobalContext* globalCtx2) { @@ -629,7 +629,7 @@ void EnRuppecrow_Init(Actor* thisx, GlobalContext* globalCtx2) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_crow_Skel_0010C0, &object_crow_Anim_0000F0, this->joinTable, this->morphTable, ENRUPPECROW_LIMB_COUNT); - ActorShape_Init(&this->actor.shape, 2000.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderElement); diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index c355f9934..78f36abfd 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -158,7 +158,7 @@ void EnSb_SetupOpen(EnSb* this) { Animation_Change(&this->skelAnime, &D_06000194, 1.0f, 0, Animation_GetLastFrame(&D_06000194), 2, 0.0f); this->state = SHELLBLADE_OPEN; this->actionFunc = EnSb_Open; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } void EnSb_SetupWaitOpen(EnSb* this) { @@ -174,7 +174,7 @@ void EnSb_SetupLunge(EnSb* this) { Animation_Change(&this->skelAnime, &D_06000124, playbackSpeed, 0.0f, frameCount, 2, 0); this->state = SHELLBLADE_LUNGE; this->actionFunc = EnSb_Lunge; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } void EnSb_SetupBounce(EnSb* this) { @@ -271,7 +271,7 @@ void EnSb_Lunge(EnSb* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); if (this->actor.velocity.y <= -0.1f || this->actor.bgCheckFlags & 2) { if (!(this->actor.depthInWater > 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } this->actor.bgCheckFlags &= ~2; EnSb_SetupBounce(this); @@ -332,7 +332,7 @@ void EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { hitPlayer = 0; if (this->vulnerableTimer != 0) { Actor_ApplyDamage(&this->actor); - func_800BCB70(&this->actor, 0x4000, 0xFF, 0x2000, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 80); hitPlayer = 1; } } @@ -371,8 +371,8 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) { Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80); Actor_MarkForDeath(&this->actor); } else { - Actor_SetHeight(&this->actor, 20.0f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_SetFocus(&this->actor, 20.0f); + Actor_MoveWithGravity(&this->actor); this->actionFunc(this, globalCtx); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 25.0f, 20.0f, 5); EnSb_UpdateDamage(this, globalCtx); @@ -394,7 +394,7 @@ void EnSb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec if (this->isDrawn != false) { if (limbIndex < 7) { phi_a2 = (this->actor.depthInWater > 0) ? 4 : 1; - func_800BBCEC(thisx, globalCtx, phi_a2, dList); + Actor_SpawnBodyParts(thisx, globalCtx, phi_a2, dList); } if (limbIndex == 6) { this->isDrawn = false; diff --git a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c index b90ab3db9..e71a241e7 100644 --- a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c +++ b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c @@ -35,7 +35,7 @@ void func_80BFCFA0(EnScopecoin* this, GlobalContext* globalCtx) { } void func_80BFCFB8(EnScopecoin* this, GlobalContext* globalCtx) { - if (Actor_GetCollectibleFlag(globalCtx, (this->actor.params & 0x7F0) >> 4)) { + if (Flags_GetCollectible(globalCtx, (this->actor.params & 0x7F0) >> 4)) { Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_RUPEE_RED); Actor_MarkForDeath(&this->actor); } @@ -45,7 +45,7 @@ void EnScopecoin_Init(Actor* thisx, GlobalContext* globalCtx) { EnScopecoin* this = THIS; Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 10.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 10.0f); this->unk148 = (this->actor.params & 0xF); if (this->unk148 < 0 || this->unk148 >= 8) { this->unk148 = 0; @@ -53,7 +53,7 @@ void EnScopecoin_Init(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->actorCtx.unk5 & 2) { if (this->unk148 == 2 || this->unk148 == 6) { - if (Actor_GetCollectibleFlag(globalCtx, (this->actor.params & 0x7F0) >> 4)) { + if (Flags_GetCollectible(globalCtx, (this->actor.params & 0x7F0) >> 4)) { Actor_MarkForDeath(&this->actor); return; } @@ -63,7 +63,7 @@ void EnScopecoin_Init(Actor* thisx, GlobalContext* globalCtx) { return; } if (this->unk148 == 2 || this->unk148 == 6) { - if (Actor_GetCollectibleFlag(globalCtx, (this->actor.params & 0x7F0) >> 4)) { + if (Flags_GetCollectible(globalCtx, (this->actor.params & 0x7F0) >> 4)) { Actor_MarkForDeath(&this->actor); } else { this->actor.draw = NULL; diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index dd5db5c86..e07b6895c 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -219,7 +219,7 @@ void func_80ADAFC0(EnSellnuts* this) { } Actor* func_80ADB040(GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actor != NULL) { if ((actor->id == ACTOR_EN_SELLNUTS) && !ENSELLNUTS_GET_1(actor)) { @@ -304,7 +304,7 @@ void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); if (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f) ? true : false) && ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADB4F4; this->unk_34C = 3; this->collider.dim.height = 64; @@ -313,12 +313,12 @@ void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) { if ((this->unk_34C == 4) || (this->unk_34C == 18)) { this->unk_34C = 17; this->collider.dim.height = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); func_8013BC6C(&this->skelAnime, D_80ADD990, 17); } else if (this->unk_34C == 2) { this->unk_34C = 16; this->collider.dim.height = 32; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); func_8013BC6C(&this->skelAnime, D_80ADD990, 16); } else if (this->unk_34C == 17) { if (DECR(this->unk_34E) == 0) { @@ -350,8 +350,8 @@ void func_80ADB544(EnSellnuts* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { - if (func_800B8708(globalCtx) == 0x2A) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + if (Player_GetExchangeItemId(globalCtx) == EXCH_ITEM_2A) { player->actor.textId = D_80ADD928[this->unk_33A]; this->unk_340 = player->actor.textId; this->actionFunc = func_80ADBAB8; @@ -392,7 +392,7 @@ void func_80ADB544(EnSellnuts* this, GlobalContext* globalCtx) { } else if (((this->actor.xzDistToPlayer < 80.0f) && (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false)) || this->actor.isTargeted) { - func_800B85E0(&this->actor, globalCtx, 80.0f, 0x2A); + func_800B85E0(&this->actor, globalCtx, 80.0f, EXCH_ITEM_2A); if (player->transformation == PLAYER_FORM_DEKU) { if (gSaveContext.day == 3) { this->unk_33A = 2; @@ -426,16 +426,16 @@ void func_80ADB544(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADB924(EnSellnuts* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - u8 temp_v0 = func_80152498(&globalCtx->msgCtx); - s32 itemActionParam; + u8 msgState = Message_GetState(&globalCtx->msgCtx); + s32 item; - if (temp_v0 == 0x10) { - itemActionParam = func_80123810(globalCtx); - if (itemActionParam > PLAYER_AP_NONE) { - if (itemActionParam == PLAYER_AP_MOON_TEAR) { + if (msgState == 0x10) { + item = func_80123810(globalCtx); + if (item > EXCH_ITEM_NONE) { + if (item == EXCH_ITEM_2A) { player->actor.textId = D_80ADD928[this->unk_33A]; this->unk_340 = player->actor.textId; - player->unk_A87 = itemActionParam; + player->exchangeItemId = item; this->actionFunc = func_80ADBAB8; } else { player->actor.textId = D_80ADD920[this->unk_33A]; @@ -443,12 +443,12 @@ void func_80ADB924(EnSellnuts* this, GlobalContext* globalCtx) { this->actionFunc = func_80ADB0D8; } func_801477B4(globalCtx); - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (item < EXCH_ITEM_NONE) { this->unk_340 = D_80ADD920[this->unk_33A]; func_80151938(globalCtx, this->unk_340); this->actionFunc = func_80ADB0D8; } - } else if ((temp_v0 == 5) && func_80147624(globalCtx)) { + } else if ((msgState == 5) && func_80147624(globalCtx)) { if (this->unk_340 == D_80ADD910[this->unk_33A]) { this->unk_340 = D_80ADD938[this->unk_33A]; func_80151938(globalCtx, this->unk_340); @@ -462,7 +462,7 @@ void func_80ADB924(EnSellnuts* this, GlobalContext* globalCtx) { } void func_80ADBAB8(EnSellnuts* this, GlobalContext* globalCtx) { - u8 sp27 = func_80152498(&globalCtx->msgCtx); + u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 currentFrame = this->skelAnime.curFrame; s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); @@ -492,30 +492,30 @@ void func_80ADBBEC(EnSellnuts* this, GlobalContext* globalCtx) { gSaveContext.weekEventReg[17] |= 0x80; this->actionFunc = func_80ADBCE4; } else { - func_800B8A1C(&this->actor, globalCtx, GI_DEED_LAND, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, GI_DEED_LAND, 300.0f, 300.0f); } } void func_80ADBC60(EnSellnuts* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, this->unk_340, &this->actor); this->actionFunc = func_80ADB0D8; } else { - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); this->unk_340 = D_80ADD930[this->unk_33A]; } } void func_80ADBCE4(EnSellnuts* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); this->unk_340 = D_80ADD930[this->unk_33A]; this->actionFunc = func_80ADBC60; } } void func_80ADBD64(EnSellnuts* this, GlobalContext* globalCtx) { - u8 sp27 = func_80152498(&globalCtx->msgCtx); + u8 sp27 = Message_GetState(&globalCtx->msgCtx); s16 currentFrame = this->skelAnime.curFrame; s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg); @@ -557,7 +557,7 @@ void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_350 = 4; this->unk_34C = 19; func_8013BC6C(&this->skelAnime, D_80ADD990, 19); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->unk_338 &= ~1; this->unk_338 |= 8; this->unk_32C = this->actor.world.pos.y; @@ -566,7 +566,7 @@ void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) { } void func_80ADBFA0(EnSellnuts* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; if (this->unk_34C == 0) { @@ -626,7 +626,7 @@ void func_80ADC118(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_34C = 9; this->unk_360 = 0.3f; func_8013BC6C(&this->skelAnime, D_80ADD990, 9); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = func_80ADC034; } } @@ -680,7 +680,7 @@ void func_80ADC37C(EnSellnuts* this, GlobalContext* globalCtx) { } Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); if (this->unk_366 == 2) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); @@ -706,7 +706,7 @@ void func_80ADC580(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADC5A4(EnSellnuts* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { player->linearVelocity = 0.0f; this->actor.flags &= ~0x10000; func_801518B0(globalCtx, this->unk_340, &this->actor); @@ -729,7 +729,7 @@ void func_80ADC5A4(EnSellnuts* this, GlobalContext* globalCtx) { void func_80ADC6D0(EnSellnuts* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; if (player->transformation == PLAYER_FORM_DEKU) { @@ -747,7 +747,7 @@ void func_80ADC6D0(EnSellnuts* this, GlobalContext* globalCtx) { } void func_80ADC7B4(EnSellnuts* this, GlobalContext* globalCtx) { - s32 temp = func_80152498(&globalCtx->msgCtx); + s32 temp = Message_GetState(&globalCtx->msgCtx); if (this->unk_366 == 0) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -812,7 +812,7 @@ void func_80ADC8C4(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_334++; } Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.2f, 1.0f); - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } } @@ -832,7 +832,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) { this->unk_34C = 19; this->actor.velocity.y = 0.0f; func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); } return; } @@ -893,7 +893,7 @@ void func_80ADCD3C(EnSellnuts* this, GlobalContext* globalCtx) { this->collider.dim.height = 64; this->unk_34C = 3; this->unk_350 = 4; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C); this->actionFunc = func_80ADCC04; } else if (D_80ADD940 != 0) { @@ -965,7 +965,7 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600AC70, &D_06005488, this->jointTable, this->morphTable, 28); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); this->path = func_8013D648(globalCtx, ENSELLNUTS_GET_FC00(&this->actor), 0x3F); this->cutscene = this->actor.cutscene; Actor_SetScale(&this->actor, 0.01f); @@ -1053,10 +1053,10 @@ void EnSellnuts_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_33A = 0; } - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); Actor_SetScale(&this->actor, 0.01f); SkelAnime_Update(&this->skelAnime); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); this->actionFunc(this, globalCtx); if (this->unk_338 & 8) { func_800B9010(&this->actor, NA_SE_EN_AKINDO_FLY - SFX_FLAG); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 0f8a95f96..333717941 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -215,7 +215,7 @@ void EnSkb_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &sDamageTable; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 0.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); this->unk_3E0 = 0; this->unk_3E2 = 0; Actor_SetScale(&this->actor, 0.01f); @@ -279,7 +279,7 @@ void EnSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80994DA8(EnSkb* this, GlobalContext* globalCtx) { - if (Actor_IsActorFacingLink(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f) && + if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN)) { func_80995C24(this); } else { @@ -288,9 +288,9 @@ void func_80994DA8(EnSkb* this, GlobalContext* globalCtx) { } void func_80994E2C(EnSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1); this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR); this->unk_3D0 = 0; this->unk_3DE = 0; this->actionFunc = func_80994E94; @@ -317,7 +317,7 @@ void func_80994E94(EnSkb* this, GlobalContext* globalCtx) { } void func_80994F7C(EnSkb* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_3E2 = 1; if (this->unk_3E0 == 1) { func_801518B0(globalCtx, 0x13F8, &this->actor); @@ -327,7 +327,7 @@ void func_80994F7C(EnSkb* this, GlobalContext* globalCtx) { } this->actionFunc = func_80995190; this->actor.speedXZ = 0.0f; - } else if (Actor_IsActorFacingLink(&this->actor, 0x2AAA) && !(this->collider.base.acFlags & AC_HIT)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && !(this->collider.base.acFlags & AC_HIT)) { func_800B8614(&this->actor, globalCtx, 100.0f); } } @@ -338,12 +338,12 @@ void func_8099504C(EnSkb* this) { } void func_80995068(EnSkb* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_3E2 = 1; if (this->unk_3E0 == 1) { func_801518B0(globalCtx, 0x13F8, &this->actor); if (this->unk_3DE == 2) { - func_800BDC5C(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); } } else { func_801518B0(globalCtx, 0x13F6, &this->actor); @@ -363,7 +363,7 @@ void func_80995068(EnSkb* this, GlobalContext* globalCtx) { } void func_80995190(EnSkb* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: case 1: case 2: @@ -375,7 +375,7 @@ void func_80995190(EnSkb* this, GlobalContext* globalCtx) { if (func_80147624(globalCtx)) { func_801518B0(globalCtx, 0x13F7, &this->actor); if (this->unk_3DE == 2) { - func_800BDC5C(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); } } break; @@ -413,7 +413,7 @@ void func_80995244(EnSkb* this, GlobalContext* globalCtx) { } void func_809952D8(EnSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 5); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 9; this->actionFunc = func_8099533C; @@ -427,7 +427,7 @@ void func_8099533C(EnSkb* this, GlobalContext* globalCtx) { this->actor.flags &= ~(0x4 | 0x1); this->actor.flags |= (0x8 | 0x1); func_80994F7C(this, globalCtx); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f)) { this->actor.hintId = 0x55; this->actor.colChkInfo.mass = MASS_HEAVY; func_8099571C(this); @@ -435,7 +435,7 @@ void func_8099533C(EnSkb* this, GlobalContext* globalCtx) { } void func_809953E8(EnSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 6); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 10; this->actionFunc = func_8099544C; @@ -449,7 +449,7 @@ void func_8099544C(EnSkb* this, GlobalContext* globalCtx) { this->actor.flags &= ~(0x4 | 0x1); this->actor.flags |= (0x8 | 0x1); func_80994F7C(this, globalCtx); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f)) { this->actor.hintId = 0x55; this->actor.colChkInfo.mass = MASS_HEAVY; func_8099571C(this); @@ -457,7 +457,7 @@ void func_8099544C(EnSkb* this, GlobalContext* globalCtx) { } void func_809954F8(EnSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 7); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_3DE = 11; this->actionFunc = func_8099556C; @@ -486,7 +486,7 @@ void func_8099556C(EnSkb* this, GlobalContext* globalCtx) { this->actor.flags &= ~(0x4 | 0x1); this->actor.flags |= (0x8 | 0x1); func_80994F7C(this, globalCtx); - } else if (Actor_IsActorFacingLink(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f) && + } else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f) && (this->skelAnime.curFrame > 24.0f) && (this->skelAnime.curFrame < 28.0f)) { this->actor.hintId = 0x55; this->actor.colChkInfo.mass = MASS_HEAVY; @@ -496,18 +496,18 @@ void func_8099556C(EnSkb* this, GlobalContext* globalCtx) { } void func_8099571C(EnSkb* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_3DC = 0; this->actor.shape.shadowScale = 0.0f; if (this->unk_3DE == 9) { - func_800BDC5C(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); this->actor.speedXZ = 2.4f; this->actor.gravity = -1.0f; this->actor.velocity.y = 3.0f; } else if (this->unk_3DE == 0xA) { - func_800BDC5C(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); } else if (this->unk_3DE == 0xB) { - func_800BDC5C(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); this->actor.speedXZ = 3.2f; this->actor.gravity = -1.0f; this->actor.velocity.y = 2.0f; @@ -540,7 +540,7 @@ void func_809958F4(EnSkb* this) { this->unk_3E4 = 0; this->actor.flags &= ~1; this->actor.speedXZ = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->unk_3DE = 1; this->actionFunc = func_8099599C; } @@ -560,7 +560,7 @@ void func_8099599C(EnSkb* this, GlobalContext* globalCtx) { } void func_80995A30(EnSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); this->actor.speedXZ = 1.6f; this->unk_3DA = 0; this->unk_3DE = 2; @@ -573,7 +573,7 @@ void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) { this->actor.flags |= (0x8 | 0x1); this->actor.hintId = 0xFF; this->actor.colChkInfo.mass = MASS_HEAVY; - func_800BDC5C(&this->skelAnime, sAnimations, 12); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); func_8099504C(this); return; } @@ -585,18 +585,18 @@ void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_3DA, 1, 0x2EE, 0); this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { - Audio_PlayActorSound2(&this->actor, 0x3830); + Actor_PlaySfxAtPos(&this->actor, 0x3830); } if ((this->actor.xzDistToPlayer > 800.0f) || func_80996594(this, globalCtx)) { func_809958F4(this); - } else if (Actor_IsActorFacingLink(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) { func_80995C24(this); } } void func_80995C24(EnSkb* this) { - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); this->collider.base.atFlags &= ~AT_BOUNCED; this->actor.speedXZ = 0.0f; this->unk_3DE = 3; @@ -605,7 +605,7 @@ void func_80995C24(EnSkb* this) { void func_80995C84(EnSkb* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 3.0f) && (this->unk_3E4 == 0)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); this->unk_3E4 = 1; } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { this->unk_3E4 = 0; @@ -637,7 +637,7 @@ void func_80995E08(EnSkb* this) { if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = 0.0f; } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_3E4 = 0; this->unk_3DE = 5; this->actionFunc = func_80995E64; @@ -681,22 +681,22 @@ void func_80995E64(EnSkb* this, GlobalContext* globalCtx) { void func_80995F98(EnSkb* this) { if ((this->unk_3DE == 9) || (this->unk_3DE == 0xA)) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - func_800BDC5C(&this->skelAnime, sAnimations, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); this->actor.gravity = -1.0f; this->actor.speedXZ = 1.0f; } else if (this->unk_3DE == 0xB) { - func_800BDC5C(&this->skelAnime, sAnimations, 9); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9); this->actor.speedXZ = 3.2f; this->actor.velocity.y = 2.0f; this->actor.gravity = -1.0f; } else { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -4.0f; } } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3DE = 6; this->actionFunc = func_809960AC; } @@ -727,7 +727,7 @@ void func_809960AC(EnSkb* this, GlobalContext* globalCtx) { } void func_809961E4(EnSkb* this, GlobalContext* globalCtx) { - func_800BDC5C(&this->skelAnime, sAnimations, 4); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); this->unk_3D8 |= 0x40; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -748,7 +748,7 @@ void func_80996284(EnSkb* this, GlobalContext* globalCtx) { } void func_809962D4(EnSkb* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->actionFunc = func_8099630C; } @@ -758,8 +758,8 @@ void func_8099630C(EnSkb* this, GlobalContext* globalCtx) { this->unk_230 = 0.0f; this->unk_22C = 0.0f; if (this->actor.colChkInfo.health != 0) { - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -780,8 +780,8 @@ void func_809963D8(EnSkb* this, GlobalContext* globalCtx) { this->unk_230 = 0.0f; this->unk_22C = 0.0f; if (this->actor.colChkInfo.health != 0) { - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); this->unk_3D8 |= 1; func_80995F98(this); } else { @@ -912,12 +912,12 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { this->unk_3D2 = 40; this->unk_22C = 1.0f; this->unk_230 = 0.0f; - func_800BCB70(&this->actor, 0, 0x78, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 40); func_80995E08(this); break; case 1: - func_800BCB70(&this->actor, 0, 0x78, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 40); func_80995E08(this); break; @@ -926,14 +926,14 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { this->unk_3E6 = 0; this->unk_22C = 1.0f; this->unk_230 = 0.0f; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); this->unk_3D8 |= 1; func_80995F98(this); break; case 3: if (this->actor.colChkInfo.health != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); this->unk_3D2 = 0x50; } else { this->unk_3D2 = 3; @@ -941,7 +941,7 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { this->unk_3E6 = 0xB; this->unk_22C = 1.0f; this->unk_230 = 0.5f; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); func_809962D4(this); break; @@ -950,9 +950,9 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { this->unk_3E6 = 0x14; this->unk_22C = 1.0f; this->unk_230 = 0.5f; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_DAMAGE); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); func_809963C4(this); break; @@ -967,8 +967,8 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) { } case 13: - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); - func_800BDC5C(&this->skelAnime, sAnimations, 3); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); func_80995F98(this); break; } @@ -1054,7 +1054,7 @@ void EnSkb_Update(Actor* thisx, GlobalContext* globalCtx) { func_8099672C(this, globalCtx); if ((this->actionFunc != func_8099630C) && (this->actionFunc != func_809963D8) && (this->actionFunc != func_80995E64)) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); @@ -1099,12 +1099,12 @@ void EnSkb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Collider_UpdateSpheres(limbIndex, &this->collider); if ((this->unk_3D8 & 1) && !(this->unk_3D8 & 2)) { if (limbIndex == 11) { - func_800BBCEC(&this->actor, globalCtx, 1, dList); + Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList); this->unk_3D8 |= 2; } } else if ((this->unk_3D8 & 0x40) && !(this->unk_3D8 & 0x80) && ((limbIndex != 11) || !(this->unk_3D8 & 1)) && (limbIndex != 12)) { - func_800BBCEC(&this->actor, globalCtx, 1, dList); + Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList); } if (this->unk_3D2 != 0) { diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index 140fc2c71..4d0b5f094 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -436,7 +436,7 @@ void EnSob1_UpdateCursorPos(GlobalContext* globalCtx, EnSob1* this) { f32 xOffset = 0.0f; f32 yOffset = 17.0f; - func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); + Actor_GetScreenPos(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); this->cursorPos.x = x + xOffset; this->cursorPos.y = y + yOffset; this->cursorPos.z = 1.2f; @@ -449,7 +449,7 @@ void EnSob1_EndInteraction(GlobalContext* globalCtx, EnSob1* this) { ActorCutscene_Stop(this->cutscene); this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; } - func_800B84D0(&this->actor, globalCtx); + Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; Interface_ChangeAlpha(50); @@ -516,7 +516,7 @@ void EnSob1_SetupLookToShopkeeperFromShelf(GlobalContext* globalCtx, EnSob1* thi } void EnSob1_EndingInteraction(EnSob1* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { EnSob1_EndInteraction(globalCtx, this); } } @@ -534,7 +534,7 @@ void EnSob1_Idle(EnSob1* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); this->headRotTarget = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); @@ -610,7 +610,7 @@ u8 EnSob1_SetCursorIndexFromNeutral(EnSob1* this, u8 shelfOffset) { } void EnSob1_Hello(EnSob1* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -650,7 +650,7 @@ s32 EnSob1_FacingShopkeeperDialogResult(EnSob1* this, GlobalContext* globalCtx) void EnSob1_FaceShopkeeper(EnSob1* this, GlobalContext* globalCtx) { s32 pad[2]; - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); u8 cursorIdx; if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { @@ -690,7 +690,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, GlobalContext* globalCtx) { } void EnSob1_TalkingToShopkeeper(EnSob1* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { EnSob1_StartShopping(globalCtx, this); } } @@ -737,7 +737,7 @@ void EnSob1_EndWalk(EnSob1* this, GlobalContext* globalCtx) { EnSob1_SetupAction(this, EnSob1_SetupIdle); } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void EnSob1_SetupIdle(EnSob1* this, GlobalContext* globalCtx) { @@ -777,7 +777,7 @@ void EnSob1_Walk(EnSob1* this, GlobalContext* globalCtx) { } } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); EnSob1_Walking(this, globalCtx); } @@ -792,7 +792,7 @@ void EnSob1_Walking(EnSob1* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); } } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); @@ -832,10 +832,10 @@ void EnSob1_ItemPurchased(EnSob1* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); } } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80151938(globalCtx, 0x647); } else { - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } @@ -910,7 +910,7 @@ s32 EnSob1_HasPlayerSelectedItem(GlobalContext* globalCtx, EnSob1* this, Input* } void EnSob1_BrowseShelf(EnSob1* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; u8 prevCursorIdx = this->cursorIdx; u8 cursorIdx; @@ -940,7 +940,7 @@ void EnSob1_BrowseShelf(EnSob1* this, GlobalContext* globalCtx) { void EnSob1_SetupBuyItemWithFanfare(GlobalContext* globalCtx, EnSob1* this) { Player* player = GET_PLAYER(globalCtx); - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; player->stateFlags2 &= ~0x20000000; @@ -1029,7 +1029,7 @@ void EnSob1_HandleCanBuyItem(GlobalContext* globalCtx, EnSob1* this) { } void EnSob1_SelectItem(EnSob1* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (EnSob1_TakeItemOffShelf(this) && talkState == 4) { func_8011552C(globalCtx, 6); @@ -1049,7 +1049,7 @@ void EnSob1_SelectItem(EnSob1* this, GlobalContext* globalCtx) { } void EnSob1_CannotBuy(EnSob1* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5) { + if (Message_GetState(&globalCtx->msgCtx) == 5) { if (func_80147624(globalCtx)) { this->actionFunc = this->tmpActionFunc; func_80151938(globalCtx, this->items[this->cursorIdx]->actor.textId); @@ -1060,7 +1060,7 @@ void EnSob1_CannotBuy(EnSob1* this, GlobalContext* globalCtx) { void EnSob1_CanBuy(EnSob1* this, GlobalContext* globalCtx) { EnGirlA* item; - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { this->shopItemSelectedTween = 0.0f; EnSob1_ResetItemPosition(this); item = this->items[this->cursorIdx]; @@ -1075,12 +1075,12 @@ void EnSob1_BuyItemWithFanfare(EnSob1* this, GlobalContext* globalCtx) { this->actor.parent = NULL; EnSob1_SetupAction(this, EnSob1_SetupItemPurchased); } else { - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); } } void EnSob1_SetupItemPurchased(EnSob1* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; EnSob1_SetupAction(this, EnSob1_ItemPurchased); @@ -1091,7 +1091,7 @@ void EnSob1_SetupItemPurchased(EnSob1* this, GlobalContext* globalCtx) { this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); } - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } @@ -1099,7 +1099,7 @@ void EnSob1_ContinueShopping(EnSob1* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); EnGirlA* item; - if ((func_80152498(&globalCtx->msgCtx) == 5) && (func_80147624(globalCtx))) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && (func_80147624(globalCtx))) { EnSob1_ResetItemPosition(this); item = this->items[this->cursorIdx]; item->restockFunc(globalCtx, item); @@ -1107,7 +1107,7 @@ void EnSob1_ContinueShopping(EnSob1* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x20000000; func_801518B0(globalCtx, this->welcomeTextId, &this->actor); EnSob1_SetupStartShopping(globalCtx, this, true); - func_800B85E0(&this->actor, globalCtx, 200.0f, -1); + func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1); } } @@ -1368,7 +1368,7 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) { if (EnSob1_AreObjectsLoaded(this, globalCtx)) { this->actor.flags &= ~0x10; this->actor.objBankIndex = this->objIndices[0]; - Actor_SetObjectSegment(globalCtx, &this->actor); + Actor_SetObjectDependency(globalCtx, &this->actor); posOffset = &sPosOffset[this->shopType]; this->actor.world.pos.x += posOffset->x; this->actor.world.pos.y += posOffset->y; @@ -1381,7 +1381,7 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) { this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; EnSob1_GetCutscenes(this); this->cutscene = this->lookFowardCutscene; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); sInitFuncs[this->shopType](this, globalCtx); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.cylRadius = 50; @@ -1473,7 +1473,7 @@ void EnSob1_Update(Actor* thisx, GlobalContext* globalCtx) { EnSob1_UpdateCursorAnim(this); Math_StepToS(&this->headRot, this->headRotTarget, 0x190); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 90.0f); + Actor_SetFocus(&this->actor, 90.0f); changeObjectFunc = this->changeObjectFunc; if (changeObjectFunc != NULL) { changeObjectFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 01c803995..26fdf6f08 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -227,7 +227,7 @@ void EnSsh_SetWaitAnimation(EnSsh* this) { } void EnSsh_SetReturnAnimation(EnSsh* this) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_UP); EnSsh_SetAnimation(this, SSH_ANIM_UP); } @@ -281,7 +281,7 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 arg1, f32 arg2) { s32 EnSsh_Damaged(EnSsh* this) { if ((this->stunTimer == 120) && (this->stateFlags & SSH_STATE_STUNNED)) { - func_800BCB70(&this->actor, 0, 200, 0, this->stunTimer); + Actor_SetColorFilter(&this->actor, 0, 200, 0, this->stunTimer); } if (DECR(this->stunTimer) != 0) { @@ -296,8 +296,8 @@ s32 EnSsh_Damaged(EnSsh* this) { this->spinTimer = 30; } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_ROLL); - Audio_PlayActorSound2(&this->actor, NA_SE_VO_ST_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_ATTACK); return true; } @@ -476,8 +476,8 @@ s32 EnSsh_CheckHitPlayer(EnSsh* this, GlobalContext* globalCtx) { this->spinTimer = this->hitTimer; } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_ROLL); - Audio_PlayActorSound2(&this->actor, NA_SE_VO_ST_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_ATTACK); globalCtx->damagePlayer(globalCtx, -8); @@ -531,8 +531,8 @@ s32 EnSsh_CheckHitBack(EnSsh* this, GlobalContext* globalCtx) { } if (this->stunTimer == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); - Audio_PlayActorSound2(&this->actor, NA_SE_VO_ST_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_DAMAGE); } EnSsh_SetStunned(this); @@ -552,8 +552,8 @@ s32 EnSsh_CollisionCheck(EnSsh* this, GlobalContext* globalCtx) { if (globalCtx->actorCtx.unk2 != 0) { this->invincibilityTimer = 8; if (this->stunTimer == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); - Audio_PlayActorSound2(&this->actor, NA_SE_VO_ST_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_ST_DAMAGE); } EnSsh_SetStunned(this); this->stateFlags |= SSH_STATE_STUNNED; @@ -631,7 +631,7 @@ void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnSsh* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &object_ssh_Skel_006470, NULL, this->jointTable, this->morphtable, 30); Animation_Change(&this->skelAnime, &object_ssh_Anim_001494, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, 0.0f); this->blureIdx = EnSsh_CreateBlureEffect(globalCtx); @@ -683,7 +683,7 @@ void EnSsh_Wait(EnSsh* this, GlobalContext* globalCtx) { void EnSsh_Talk(EnSsh* this, GlobalContext* globalCtx) { EnSsh_Bob(this, globalCtx); - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x904: case 0x905: @@ -717,7 +717,7 @@ void func_809756D0(EnSsh* this, GlobalContext* globalCtx) { } void EnSsh_Idle(EnSsh* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = EnSsh_Talk; func_809756D0(this, globalCtx); return; @@ -738,14 +738,14 @@ void EnSsh_Idle(EnSsh* this, GlobalContext* globalCtx) { } if (DECR(this->sfxTimer) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_LAUGH); this->sfxTimer = 64; } EnSsh_Bob(this, globalCtx); if ((this->unkTimer == 0) && (this->animTimer == 0) && (this->actor.xzDistToPlayer < 100.0f) && - Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx)) { + Player_IsFacingActor(&this->actor, 0x3000, globalCtx)) { func_800B8614(&this->actor, globalCtx, 100.0f); } } @@ -779,7 +779,7 @@ void EnSsh_Drop(EnSsh* this, GlobalContext* globalCtx) { EnSsh_SetLandAnimation(this); EnSsh_SetupAction(this, EnSsh_Land); } else if (DECR(this->sfxTimer) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_DOWN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_DOWN); this->sfxTimer = 3; } } @@ -847,7 +847,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) { EnSsh_Damaged(this); } else { SkelAnime_Update(&this->skelAnime); - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); } @@ -864,7 +864,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) { } EnSsh_SetColliders(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } s32 EnSsh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 9798a9e6d..4d6520bb3 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -334,7 +334,7 @@ void func_808A5AF8(EnSt* this, GlobalContext* globalCtx) { sp54.z += this->unk_358[i].z; Math_Vec3f_Copy(&this->unk_358[i], &sp54); } - func_800BF7CC(globalCtx, &this->actor, this->unk_358, 12, 3, 0.1f, 0.3f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_358, 12, 3, 0.1f, 0.3f); } s16 func_808A5BEC(EnSt* this) { @@ -345,7 +345,7 @@ s16 func_808A5BEC(EnSt* this) { } else { ret = this->actor.yawTowardsPlayer; if (DECR(this->unk_30E) == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_ROLL); this->unk_18C ^= 2; this->unk_310 = 8; if (this->unk_18C & 1) { @@ -453,7 +453,7 @@ void func_808A60E0(EnSt* this) { if (sp1C == 1.0f) { func_8013BC6C(&this->skelAnime, sAnimations, idx); - Audio_PlayActorSound2(&this->actor, sfxId); + Actor_PlaySfxAtPos(&this->actor, sfxId); } this->unk_2D4 = (1.0f - sp1C) * sp20 * this->unk_2C8; @@ -584,23 +584,23 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) { } else if (func_808A61F4(this)) { switch (this->actor.colChkInfo.damageEffect) { case 1: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_312 = 40; - func_800BCB70(&this->actor, 0, 200, 0, this->unk_312); + Actor_SetColorFilter(&this->actor, 0, 200, 0, this->unk_312); break; case 5: this->unk_18E = 30; this->unk_312 = 40; func_808A576C(this); - func_800BCB70(&this->actor, 0, 200, 0, this->unk_312); + Actor_SetColorFilter(&this->actor, 0, 200, 0, this->unk_312); break; default: - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_DAMAGE); this->unk_314 = 20; this->unk_312 = 0; - func_800BCB70(&this->actor, 0x4000, 200, 0, this->unk_314); + Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_314); func_8013BC6C(&this->skelAnime, sAnimations, 1); this->unk_18C |= 8; this->actionFunc = func_808A6D84; @@ -609,7 +609,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) { } } else { if (ENST_GET_3F(&this->actor) != ENST_3F_63) { - Actor_SetSwitchFlag(globalCtx, ENST_GET_3F(&this->actor)); + Flags_SetSwitch(globalCtx, ENST_GET_3F(&this->actor)); } Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALTU_DEAD); Enemy_StartFinishingBlow(globalCtx, &this->actor); @@ -649,7 +649,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) { } this->unk_314 = 20; this->unk_312 = 0; - func_800BCB70(&this->actor, 0x4000, 200, 0, this->unk_314); + Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_314); ret = true; } this->unk_310 = 0; @@ -660,7 +660,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) { if ((this->unk_316 == 0) && (this->unk_314 == 0) && (this->unk_312 == 0) && !(this->collider1.base.atFlags & AT_BOUNCED) && (this->actor.colChkInfo.health != 0)) { globalCtx->damagePlayer(globalCtx, -8); - Audio_PlayActorSound2(&sp3C->actor, NA_SE_PL_BODY_HIT); + Actor_PlaySfxAtPos(&sp3C->actor, NA_SE_PL_BODY_HIT); func_800B8D98(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); this->unk_316 = 10; this->unk_18C |= 1; @@ -685,7 +685,7 @@ void func_808A6A78(EnSt* this, GlobalContext* globalCtx) { s32 pad[2]; if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_2C0)) { - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 8.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30); func_8013BC6C(&this->skelAnime, sAnimations, 0); @@ -716,7 +716,7 @@ void func_808A6C04(EnSt* this, GlobalContext* globalCtx) { this->unk_30C += 0xE00; Math_ApproachF(&this->unk_2C4, 1.0f, 0.1f, 0.3f); this->actor.velocity.y = this->unk_2D4 + this->unk_2CC; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if ((this->unk_18C & 8) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { func_8013BC6C(&this->skelAnime, sAnimations, 3); @@ -737,7 +737,7 @@ void func_808A6C04(EnSt* this, GlobalContext* globalCtx) { void func_808A6D84(EnSt* this, GlobalContext* globalCtx) { func_808A60E0(this); this->actor.velocity.y = this->unk_2D4 + this->unk_2CC; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (func_808A6064(this)) { if (this->unk_2C8 < 0.0f) { func_808A6468(this, globalCtx); @@ -782,7 +782,7 @@ void func_808A6E24(EnSt* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; if ((s32)this->unk_2D0 != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } else { this->actor.velocity.y = 0.0f; this->actionFunc = func_808A701C; @@ -799,7 +799,7 @@ void func_808A6E24(EnSt* this, GlobalContext* globalCtx) { } this->actor.shape.rot.x = this->actor.world.rot.x; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } @@ -891,7 +891,7 @@ void EnSt_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); func_808A6220(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index 7e4bbcc2d..55fae4cad 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -173,7 +173,7 @@ void EnSuttari_UpdateCollider(EnSuttari* this, GlobalContext* globalCtx) { } Actor* EnSuttari_GetActorById(GlobalContext* globalCtx, s16 actorId) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actor != NULL) { if (actor->id == actorId) { @@ -229,13 +229,13 @@ void func_80BAA9B4(EnSuttari* this) { case 0x145B: if ((this->animationIdx != 8) && (curFrame == frameCount)) { this->animationIdx = 8; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } break; default: if ((this->animationIdx != 1) && (curFrame == frameCount)) { this->animationIdx = 1; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } } } @@ -244,7 +244,7 @@ void func_80BAAA94(EnSuttari* this) { switch (this->textId) { case 0x29E5: this->animationIdx = 1; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); break; case 0x29E9: this->enFsn->flags |= ENFSN_ANGRY; @@ -257,11 +257,11 @@ void func_80BAAA94(EnSuttari* this) { break; case 0x29EC: this->animationIdx = 7; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); break; case 0x29ED: this->animationIdx = 1; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); break; } } @@ -387,10 +387,10 @@ void func_80BAAF1C(EnSuttari* this) { if (this->animationIdx == 5) { this->animationIdx = 3; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } else if ((this->animationIdx == 3) && (curFrame == frameCount)) { this->animationIdx = 6; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); this->flags1 &= ~0x100; } } @@ -469,7 +469,7 @@ void func_80BAB374(EnSuttari* this, GlobalContext* globalCtx) { sp38.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x; sp38.y = this->actor.world.pos.y; sp38.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z; - func_800BBDAC(globalCtx, &this->actor, &sp38, 10.0f, 0, 2.0f, 0, 0, 0); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &sp38, 10.0f, 0, 2.0f, 0, 0, 0); } } @@ -823,7 +823,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { case 15: if ((this->animationIdx == 1) && (curFrame == frameCount)) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } if (!(gSaveContext.weekEventReg[0x53] & 4) && !(this->flags1 & 0x1000)) { if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { @@ -856,7 +856,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { this->enFsn->flags &= ~ENFSN_HAGGLE; if (this->animationIdx != 2) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } func_80BAC220(this, globalCtx); break; @@ -887,7 +887,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { if (!(gSaveContext.weekEventReg[0x21] & 8)) { if (this->animationIdx == 2 || this->animationIdx == 1) { this->animationIdx = 5; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } this->flags1 |= 0x10; if (this->flags2 & 2) { @@ -915,7 +915,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { this->flags1 |= 1; if (gSaveContext.day == 1 || gSaveContext.day == 2) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); this->flags1 |= 0x80; this->actionFunc = func_80BACA14; return; @@ -923,7 +923,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { !(gSaveContext.weekEventReg[0x3D] & 8) && !(gSaveContext.weekEventReg[0x21] & 8) && (gSaveContext.weekEventReg[0x33] & 8)) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); this->actionFunc = func_80BACEE0; return; } @@ -939,7 +939,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { this->flags1 |= 0x80; this->flags1 |= 8; this->animationIdx = 1; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); this->actionFunc = func_80BAD004; return; } else if (globalCtx->sceneNum == SCENE_ICHIBA) { @@ -948,7 +948,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { return; } this->animationIdx = 0; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); this->flags1 |= 2; this->actionFunc = func_80BAD5F8; return; @@ -958,7 +958,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { return; } this->animationIdx = 0; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); this->cutscenes[0] = this->actor.cutscene; this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); this->flags1 |= 4; @@ -978,7 +978,7 @@ void func_80BACA14(EnSuttari* this, GlobalContext* globalCtx) { if (this->animationIdx == 1 || this->animationIdx == 8) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } func_80BABA90(this, 0, 0); func_80BAB434(this); @@ -988,7 +988,7 @@ void func_80BACA14(EnSuttari* this, GlobalContext* globalCtx) { this->actionFunc = func_80BACBB0; } } else if ((player->transformation == PLAYER_FORM_HUMAN) && CUR_EQUIP_VALUE_VOID(EQUIP_SWORD) != 0) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk3F2 = this->unk2DC.y; func_80BAAB78(this, globalCtx); this->actionFunc = func_80BADA9C; @@ -997,7 +997,7 @@ void func_80BACA14(EnSuttari* this, GlobalContext* globalCtx) { } } Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 0.1f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BACBB0(EnSuttari* this, GlobalContext* globalCtx) { @@ -1023,7 +1023,7 @@ void func_80BACBB0(EnSuttari* this, GlobalContext* globalCtx) { this->actionFunc = func_80BACD2C; this->actor.speedXZ = 0.0f; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (!(this->actor.bgCheckFlags & 1)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; @@ -1045,7 +1045,7 @@ void func_80BACD2C(EnSuttari* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 0x3E8, 1); this->actor.shape.rot.y = this->actor.world.rot.y; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (!(this->actor.bgCheckFlags & 1)) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; @@ -1057,7 +1057,7 @@ void func_80BACE4C(EnSuttari* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer > 100.0f) { this->actionFunc = func_80BACBB0; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->actor.world.pos.y != this->actor.floorHeight) { this->actor.world.pos = this->actor.prevPos; this->actor.world.rot.y = -this->actor.world.rot.y; @@ -1087,7 +1087,7 @@ void func_80BACEE0(EnSuttari* this, GlobalContext* globalCtx) { } else if (Player_GetMask(globalCtx) != PLAYER_MASK_STONE) { func_80BAB1A0(this, globalCtx); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BAD004(EnSuttari* this, GlobalContext* globalCtx) { @@ -1104,17 +1104,17 @@ void func_80BAD004(EnSuttari* this, GlobalContext* globalCtx) { } this->unk428 = unkStruct.unk0; func_80BAC2FC(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x2A3A, &this->actor); this->actionFunc = func_80BAD130; } else if ((this->actor.xzDistToPlayer < 200.0f) || this->actor.isTargeted) { func_800B863C(&this->actor, globalCtx); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BAD130(EnSuttari* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if ((talkState == 5 || talkState == 6) && func_80147624(globalCtx)) { globalCtx->msgCtx.unk11F22 = 0x43; @@ -1147,7 +1147,7 @@ void func_80BAD230(EnSuttari* this, GlobalContext* globalCtx) { } void func_80BAD2B4(EnSuttari* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { if (this->textId == 0x2A30) { ActorCutscene_Stop(this->cutscenes[0]); ActorCutscene_SetIntentToPlay(this->cutscenes[1]); @@ -1164,7 +1164,7 @@ void func_80BAD2B4(EnSuttari* this, GlobalContext* globalCtx) { } void func_80BAD380(EnSuttari* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); if ((player->stateFlags1 & 0x40) && (globalCtx->msgCtx.unk11F04 != 0x2A31)) { @@ -1206,7 +1206,7 @@ void func_80BAD380(EnSuttari* this, GlobalContext* globalCtx) { } else { this->unk3F2 = this->unk2DC.y; Math_ApproachF(&this->actor.speedXZ, 4.0f, 0.2f, 0.5f); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80BAB374(this, globalCtx); } } @@ -1220,7 +1220,7 @@ void func_80BAD5F8(EnSuttari* this, GlobalContext* globalCtx) { if ((curFrame == frameCount) && (this->animationIdx == 0) && (this->flags1 & 0x20)) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } this->unk42A = REG(15) + *unk_14; if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) || @@ -1238,14 +1238,14 @@ void func_80BAD5F8(EnSuttari* this, GlobalContext* globalCtx) { } func_80BAB434(this); if ((this->flags1 & 0x20) && (this->unk430 == 0) && (unkStruct.unk0 != 7)) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x2A02, &this->actor); this->actionFunc = func_80BAD130; } else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) { func_800B863C(&this->actor, globalCtx); } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) { @@ -1259,7 +1259,7 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) { } else { if ((this->flags1 & 0x2000) && (this->animationIdx == 1) && (curFrame == frameCount)) { this->animationIdx = 2; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } this->unk42A = REG(15) + *unk_14; if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) || @@ -1276,19 +1276,19 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) { return; } if ((this->flags1 & 0x20) && (unkStruct.unk0 != 9)) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x2A02, &this->actor); this->actionFunc = func_80BAD130; } else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) { func_800B863C(&this->actor, globalCtx); } } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } void func_80BADA08(EnSuttari* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_80BAAB78(this, globalCtx); gSaveContext.weekEventReg[0x51] |= 4; @@ -1299,7 +1299,7 @@ void func_80BADA08(EnSuttari* this, GlobalContext* globalCtx) { } void func_80BADA9C(EnSuttari* this, GlobalContext* globalCtx) { - u8 talkstate = func_80152498(&globalCtx->msgCtx); + u8 talkstate = Message_GetState(&globalCtx->msgCtx); s16 curFrame = this->skelAnime.curFrame; s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation); @@ -1308,7 +1308,7 @@ void func_80BADA9C(EnSuttari* this, GlobalContext* globalCtx) { func_80BAA9B4(this); } else if ((this->animationIdx == 7) && (curFrame == frameCount)) { this->animationIdx = 1; - func_800BDC5C(&this->skelAnime, sAnimations, this->animationIdx); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx); } if (talkstate == 5) { if (func_80147624(globalCtx)) { @@ -1372,7 +1372,7 @@ void func_80BADDB4(EnSuttari* this, GlobalContext* globalCtx) { if (gSaveContext.weekEventReg[0x33] & 0x10) { this->actionFunc = func_80BADE14; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BADE14(EnSuttari* this, GlobalContext* globalCtx) { @@ -1383,13 +1383,13 @@ void func_80BADE14(EnSuttari* this, GlobalContext* globalCtx) { this->unk3F2 = this->unk2DC.y; Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void func_80BADE8C(EnSuttari* this, GlobalContext* globalCtx) { this->unk3F2 = this->unk2DC.y; Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; func_801518B0(globalCtx, 0x2A3A, &this->actor); this->actionFunc = func_80BAD130; @@ -1408,7 +1408,7 @@ void func_80BADF3C(EnSuttari* this, GlobalContext* globalCtx) { if (DECR(this->unk3F6) == 0) { Math_ApproachF(&this->actor.speedXZ, 6.0f, 0.2f, 0.5f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } void EnSuttari_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -1456,11 +1456,11 @@ void EnSuttari_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk428 != 0) { if (this->animationIdx == 2 || this->animationIdx == 6) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 16.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } } else if (this->animationIdx == 0 || this->animationIdx == 5) { if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PAMERA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 204d251d1..d7d547afd 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -248,7 +248,7 @@ void func_808D8ED0(EnSw* this, GlobalContext* globalCtx) { sp54.z += this->unk_380[i].z; Math_Vec3f_Copy(&this->unk_380[i], &sp54); } - func_800BF7CC(globalCtx, &this->actor, this->unk_380, ARRAY_COUNT(this->unk_380), 3, 0.1f, 0.3f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_380, ARRAY_COUNT(this->unk_380), 3, 0.1f, 0.3f); } void func_808D8FC4(EnSw* this, GlobalContext* globalCtx) { @@ -458,7 +458,7 @@ void func_808D94D0(EnSw* this, GlobalContext* globalCtx, s32 arg2, s32 arg3, s16 } if (arg2 == 1) { - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } } #else @@ -498,10 +498,10 @@ void func_808D9894(EnSw* this, Vec3f* vec) { s32 func_808D9968(EnSw* this, GlobalContext* globalCtx) { s32 ret = false; - u8 param = ENSW_GET_3FC(&this->actor); + s32 param = ENSW_GET_3FC(&this->actor) & 0xFF; if (ENSW_GET_3(&this->actor)) { - if ((param != 0x3F) && Actor_GetChestFlag(globalCtx, param)) { + if ((param != 0x3F) && Flags_GetTreasure(globalCtx, param)) { ret = true; } } @@ -536,9 +536,9 @@ s32 func_808D9A70(EnSw* this, GlobalContext* globalCtx) { } else { if (this->unk_456 != 0) { if (!ENSW_GET_3(&this->actor)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_ROLL); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); } this->unk_456--; this->skelAnime.curFrame = 0.0f; @@ -587,7 +587,7 @@ s32 func_808D9C18(EnSw* this) { this->actor.world.rot.y = Math_Vec3f_Yaw(&sp3C, &sp30); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTURA_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_APPEAR); if (ENSW_GET_3(&this->actor) == 1) { Actor_SetScale(&this->actor, 0.0f); @@ -729,19 +729,19 @@ s32 func_808DA08C(EnSw* this, GlobalContext* globalCtx) { } this->unk_458 = 20; this->unk_45A = 0; - func_800BCB70(&this->actor, 0x4000, 200, 0, this->unk_458); + Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_458); ret = true; } else if (this->actor.colChkInfo.damageEffect == 1) { if (this->unk_45A == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_45A = 40; - func_800BCB70(&this->actor, 0, 200, 0, this->unk_45A); + Actor_SetColorFilter(&this->actor, 0, 200, 0, this->unk_45A); } } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTU_DAMAGE); this->unk_458 = 20; this->unk_45A = 0; - func_800BCB70(&this->actor, 0x4000, 200, 0, this->unk_458); + Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_458); } } return ret; @@ -751,7 +751,7 @@ void func_808DA350(EnSw* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if ((player->stateFlags1 & 0x200000) && (this->actor.xyzDistToPlayerSq < 8000.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_LAUGH); Math_Vec3f_Copy(&this->unk_374, &player->actor.world.pos); this->unk_410 &= ~0x20; this->unk_414 = 0.0f; @@ -776,7 +776,7 @@ void func_808DA3F4(EnSw* this, GlobalContext* globalCtx) { temp_v0 = Math_FAtan2F(sp38.z, sp38.x); if (ABS_ALT(temp_v0) < temp_s1) { this->skelAnime.curFrame = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); this->unk_414 = 0.0f; if (this->unk_410 & 0x20) { this->actionFunc = func_808DA6FC; @@ -787,7 +787,7 @@ void func_808DA3F4(EnSw* this, GlobalContext* globalCtx) { } temp_s1 *= (temp_v0 < 0) ? -1 : 1; } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_ROLL); this->skelAnime.curFrame = 0.0f; } func_808D94D0(this, globalCtx, 0, 0, temp_s1); @@ -813,7 +813,7 @@ void func_808DA578(EnSw* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&this->unk_374, &this->actor.home.pos); this->actionFunc = func_808DA3F4; } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); this->skelAnime.curFrame = 0.0f; } @@ -849,7 +849,7 @@ void func_808DA6FC(EnSw* this, GlobalContext* globalCtx) { func_808D94D0(this, globalCtx, 0, 0, Math_FAtan2F(sp38.z, sp38.x)); } } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); this->skelAnime.curFrame = 0.0f; } @@ -912,7 +912,7 @@ void func_808DA89C(EnSw* this, GlobalContext* globalCtx) { this->unk_448 = temp_f2; this->actor.speedXZ = 0.0f; if ((s32)temp_f2 != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); } else { this->actionFunc = func_808DAEB4; this->actor.velocity.y = 0.0f; @@ -924,7 +924,7 @@ void func_808DA89C(EnSw* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.shape.yOffset, 400.0f, 0.3f, 1000.0f); } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); } @@ -948,7 +948,7 @@ void func_808DAA60(EnSw* this, GlobalContext* globalCtx) { temp_v0 = Math_FAtan2F(sp34.z, sp34.x); if (ABS_ALT(temp_v0) < sp40) { this->skelAnime.curFrame = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); Math_Vec3s_ToVec3f(&this->unk_374, &sp44[this->unk_4A0]); this->actionFunc = func_808DACF4; this->unk_414 = 0.0f; @@ -958,7 +958,7 @@ void func_808DAA60(EnSw* this, GlobalContext* globalCtx) { } } else { if (this->unk_456 != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); this->unk_456--; this->skelAnime.curFrame = 0.0f; } else { @@ -1001,7 +1001,7 @@ void func_808DACF4(EnSw* this, GlobalContext* globalCtx) { func_808D94D0(this, globalCtx, 0, 0, Math_FAtan2F(sp38.z, sp38.x)); } } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_DASH); this->skelAnime.curFrame = 0.0f; } @@ -1108,9 +1108,9 @@ void func_808DB100(EnSw* this, GlobalContext* globalCtx) { if ((DECR(this->unk_454) == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if (this->unk_456 != 0) { if (!ENSW_GET_3(&this->actor)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALWALL_ROLL); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL); } this->unk_456--; this->skelAnime.curFrame = 0.0f; @@ -1145,7 +1145,7 @@ void func_808DB2E0(EnSw* this, GlobalContext* globalCtx) { this->actor.velocity.z *= 0.5f; if ((s32)temp_f2 != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTURA_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND); } else { func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 5); Math_Vec3f_Copy(&this->actor.velocity, &gZeroVec3f); @@ -1161,7 +1161,7 @@ void func_808DB2E0(EnSw* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.scale.x, 0.02f, 0.4f, 1.0f); Actor_SetScale(&this->actor, this->actor.scale.x); this->actor.velocity.y += this->actor.gravity; - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4); } @@ -1266,7 +1266,7 @@ void EnSw_Update(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); } - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); func_808D8FC4(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 513762805..6defe10cb 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -193,7 +193,7 @@ s32 func_809C6720(GlobalContext* globalCtx, Vec3f arg1) { } globalCtx->actorCtx.unk268 = 1; - func_800B6F20(globalCtx, globalCtx->actorCtx.pad26C, phi_f0, sp22); + func_800B6F20(globalCtx, &globalCtx->actorCtx.unk_26C, phi_f0, sp22); if (sp28 < 5.0f) { return true; @@ -213,10 +213,10 @@ void func_809C6810(EnSyatekiMan* this, GlobalContext* globalCtx) { void func_809C6848(EnSyatekiMan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { u16 sp22; - func_800BDC5C(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); sp22 = Text_GetFaceReaction(globalCtx, 0x31); if (sp22 != 0) { func_801518B0(globalCtx, sp22, &this->actor); @@ -381,7 +381,7 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) { player->stateFlags1 |= 0x20; } - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 2: this->actionFunc = func_809C6848; this->unk_26A = 0; @@ -419,7 +419,7 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) { if (this->skelAnime.animation == &D_0600D2F8) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_800BDC5C(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); } } } @@ -427,7 +427,7 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) { void func_809C6F98(EnSyatekiMan* this, GlobalContext* globalCtx) { switch (gSaveContext.playerForm) { case PLAYER_FORM_HUMAN: - Actor_SetAllChestFlag(globalCtx, Actor_GetAllChestFlag(globalCtx) + 1); + Flags_SetAllTreasure(globalCtx, Flags_GetAllTreasure(globalCtx) + 1); if (CURRENT_DAY != 3) { if (!(this->unk_282 & 1)) { this->unk_282 |= 1; @@ -510,7 +510,7 @@ void func_809C6F98(EnSyatekiMan* this, GlobalContext* globalCtx) { } void func_809C72D8(EnSyatekiMan* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { u16 sp26 = Text_GetFaceReaction(globalCtx, 0x30); if (sp26 != 0) { @@ -715,7 +715,7 @@ void func_809C7990(EnSyatekiMan* this, GlobalContext* globalCtx) { player->stateFlags1 |= 0x20; } - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 2: this->actionFunc = func_809C72D8; this->unk_26A = 0; @@ -763,13 +763,13 @@ void func_809C7A90(EnSyatekiMan* this, GlobalContext* globalCtx) { this->actionFunc = func_809C7C14; } else { if ((CUR_UPG_VALUE(UPG_QUIVER) < 3) && !(gSaveContext.weekEventReg[59] & 0x10)) { - func_800B8A1C(&this->actor, globalCtx, GI_QUIVER_30 + CUR_UPG_VALUE(UPG_QUIVER), 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_QUIVER_30 + CUR_UPG_VALUE(UPG_QUIVER), 500.0f, 100.0f); } else if (this->unk_280 < 0x884) { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_RED, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_RED, 500.0f, 100.0f); } else if (!(gSaveContext.weekEventReg[32] & 2)) { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f); } player->actor.shape.rot.y = -0x8000; @@ -782,7 +782,7 @@ void func_809C7A90(EnSyatekiMan* this, GlobalContext* globalCtx) { void func_809C7C14(EnSyatekiMan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if ((CURRENT_DAY == 3) && (gSaveContext.time > CLOCK_TIME(12, 00))) { func_801518B0(globalCtx, 0xA36, &this->actor); this->unk_284 = 0xA36; @@ -796,7 +796,7 @@ void func_809C7C14(EnSyatekiMan* this, GlobalContext* globalCtx) { this->unk_26A = 0; this->actionFunc = func_809C6E30; } else { - func_800B85E0(&this->actor, globalCtx, 500.0f, -1); + func_800B85E0(&this->actor, globalCtx, 500.0f, EXCH_ITEM_MINUS1); } } @@ -820,14 +820,14 @@ void func_809C7D14(EnSyatekiMan* this, GlobalContext* globalCtx) { } else { if (this->unk_284 == 0x407) { if ((CUR_UPG_VALUE(UPG_QUIVER) < 3) && !(gSaveContext.weekEventReg[59] & 0x20)) { - func_800B8A1C(&this->actor, globalCtx, GI_QUIVER_30 + CUR_UPG_VALUE(UPG_QUIVER), 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_QUIVER_30 + CUR_UPG_VALUE(UPG_QUIVER), 500.0f, 100.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f); } } else if (!(gSaveContext.weekEventReg[32] & 4)) { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_HUGE, 500.0f, 100.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_HUGE, 500.0f, 100.0f); } player->actor.shape.rot.y = -0x8000; @@ -841,7 +841,7 @@ void func_809C7EB4(EnSyatekiMan* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); if (CURRENT_DAY != 3) { - if ((func_80152498(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { player->stateFlags1 &= ~0x20; this->unk_280 = 0; this->unk_26A = 0; @@ -849,7 +849,7 @@ void func_809C7EB4(EnSyatekiMan* this, GlobalContext* globalCtx) { gSaveContext.weekEventReg[63] &= (u8)~2; this->actionFunc = func_809C6810; } - } else if (func_800B84D0(&this->actor, globalCtx)) { + } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, 0x408, &this->actor); this->unk_284 = 0x408; player->stateFlags1 &= ~0x20; @@ -858,7 +858,7 @@ void func_809C7EB4(EnSyatekiMan* this, GlobalContext* globalCtx) { this->unk_26A = 0; this->actionFunc = func_809C7990; } else { - func_800B85E0(&this->actor, globalCtx, 500.0f, -1); + func_800B85E0(&this->actor, globalCtx, 500.0f, EXCH_ITEM_MINUS1); } } @@ -895,7 +895,7 @@ void func_809C80C0(EnSyatekiMan* this, GlobalContext* globalCtx) { this->unk_27E = 0; this->unk_280 = 0; player->stateFlags1 &= ~0x20; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); this->unk_272 = 0x1F; this->unk_274 = 0; this->unk_276 = 0; @@ -917,7 +917,7 @@ void func_809C81D0(EnSyatekiMan* this, GlobalContext* globalCtx) { if (((this->unk_272 == 0) || (this->unk_26C > 140)) && (D_809C949C == 0) && (this->unk_27C < 4)) { D_809C949C = 1; this->unk_26C = 0; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); this->unk_274 = D_809C91C8[this->unk_27E]; if (this->unk_27E == 3) { this->unk_27E = 0; @@ -1037,7 +1037,7 @@ void func_809C8610(EnSyatekiMan* this, GlobalContext* globalCtx) { gSaveContext.unk_3E88[1] += 100; globalCtx->interfaceCtx.unk_25C += 10; this->unk_280 += 10; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); D_809C94A0 = 0; } else { D_809C94A0++; @@ -1144,7 +1144,7 @@ void func_809C898C(EnSyatekiMan* this, GlobalContext* globalCtx) { if ((D_809C94A8 == (sp30 % 50)) && (this->unk_26C >= 70)) { if (this->unk_27E < 15) { this->unk_190 = D_809C94D0[this->unk_27E++]; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_FOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_FOUND); this->unk_26C = 0; } } @@ -1171,7 +1171,7 @@ void func_809C8BF0(EnSyatekiMan* this, GlobalContext* globalCtx) { if (this->unk_26A == 1) { this->unk_190 = 0; if ((this->unk_270 <= 0) && (globalCtx->interfaceCtx.unk_286 == 0)) { - Actor_SetAllChestFlag(globalCtx, this->unk_280); + Flags_SetAllTreasure(globalCtx, this->unk_280); this->unk_270 = 15; if (((s32)(gSaveContext.roomInf[127][6] & 0xFFFF) < this->unk_280) || (this->unk_280 == 50)) { if ((s32)(gSaveContext.roomInf[127][6] & 0xFFFF) < this->unk_280) { @@ -1239,7 +1239,7 @@ void EnSyatekiMan_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); func_809C8DE8(this); this->actor.focus.pos.y = 70.0f; - Actor_SetHeight(&this->actor, 70.0f); + Actor_SetFocus(&this->actor, 70.0f); if (this->unk_26A != 1) { SkelAnime_Update(&this->skelAnime); func_800E9250(globalCtx, &this->actor, &this->unk_258, &this->unk_25E, this->actor.focus.pos); diff --git a/src/overlays/actors/ovl_En_Talk/z_en_talk.c b/src/overlays/actors/ovl_En_Talk/z_en_talk.c index d85e293dc..fcfa36a4d 100644 --- a/src/overlays/actors/ovl_En_Talk/z_en_talk.c +++ b/src/overlays/actors/ovl_En_Talk/z_en_talk.c @@ -45,18 +45,18 @@ void EnTalk_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80BDE058(EnTalk* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actionFunc = func_80BDE090; } } void func_80BDE090(EnTalk* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80BDE058; return; } - if ((this->actor.xzDistToPlayer < 40.0f && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx)) || + if ((this->actor.xzDistToPlayer < 40.0f && Player_IsFacingActor(&this->actor, 0x3000, globalCtx)) || this->actor.isTargeted) { func_800B8614(&this->actor, globalCtx, 120.0f); } diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index 5b9e6079b..931715a53 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -213,7 +213,7 @@ void EnTalkGibud_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 0; this->actor.hintId = 0x2D; this->actor.textId = 0; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 28.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_0053E8, &object_rd_Anim_00ABE0, this->jointTable, this->morphTable, EN_TALK_GIBUD_LIMB_MAX); Collider_InitCylinder(globalCtx, &this->collider); @@ -260,7 +260,7 @@ void EnTalkGibud_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnTalkGibud_SetupIdle(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); this->actionFunc = EnTalkGibud_Idle; } @@ -277,7 +277,7 @@ void EnTalkGibud_Idle(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupAttemptPlayerStun(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); this->actionFunc = EnTalkGibud_AttemptPlayerStun; } @@ -290,14 +290,14 @@ void EnTalkGibud_AttemptPlayerStun(EnTalkGibud* this, GlobalContext* globalCtx) player->actor.freezeTimer = 60; func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(globalCtx, &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); EnTalkGibud_SetupWalkToPlayer(this); } EnTalkGibud_TurnTowardsPlayer(this, globalCtx); } void EnTalkGibud_SetupWalkToPlayer(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); this->actor.speedXZ = 0.4f; if (this->actionFunc == EnTalkGibud_AttemptPlayerStun) { this->playerStunWaitTimer = 80; @@ -315,7 +315,7 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx) { this->actor.world.rot = this->actor.shape.rot; Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0); Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0); - if (EnTalkGibud_PlayerInRangeWithCorrectState(this, globalCtx) && Actor_IsActorFacingLink(&this->actor, 0x38E3)) { + if (EnTalkGibud_PlayerInRangeWithCorrectState(this, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) { if (this->grabWaitTimer == 0 && this->actor.xzDistToPlayer <= 45.0f) { player->actor.freezeTimer = 0; if (gSaveContext.playerForm == PLAYER_FORM_GORON || gSaveContext.playerForm == PLAYER_FORM_DEKU) { @@ -331,7 +331,7 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx) { this->playerStunWaitTimer = 60; func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); func_80123E90(globalCtx, &this->actor); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); } else { this->playerStunWaitTimer--; } @@ -346,14 +346,14 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK); } else if (!(globalCtx->gameplayFrames & 0x5F)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY); } } void EnTalkGibud_SetupGrab(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START); this->grabDamageTimer = 0; this->actor.flags &= ~1; this->grabState = EN_TALK_GIBUD_GRAB_START; @@ -375,7 +375,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { inPositionToAttack = EnTalkGibud_MoveToIdealGrabPositionAndRotation(this, globalCtx); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && inPositionToAttack == true) { this->grabState = EN_TALK_GIBUD_GRAB_ATTACK; - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK); } break; @@ -385,7 +385,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { damageSfxId = player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S; globalCtx->damagePlayer(globalCtx, -8); - func_800B8E58(playerActor, damageSfxId); + func_800B8E58(player, damageSfxId); func_8013ECE0(this->actor.xzDistToPlayer, 240, 1, 12); this->grabDamageTimer = 0; } else { @@ -393,7 +393,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK); } if (!(player->stateFlags2 & 0x80) || player->unk_B62 != 0) { @@ -401,7 +401,7 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->unk_AE8 = 100; } - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END); this->actor.flags |= 1; this->grabState = EN_TALK_GIBUD_GRAB_RELEASE; this->grabDamageTimer = 0; @@ -421,8 +421,8 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupGrabFail(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->actionFunc = EnTalkGibud_GrabFail; this->actor.speedXZ = -2.0f; } @@ -442,7 +442,7 @@ void EnTalkGibud_GrabFail(EnTalkGibud* this, GlobalContext* globalCtx) { void EnTalkGibud_SetupTurnAwayAndShakeHead(EnTalkGibud* this) { this->headShakeTimer = 0; - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); this->actionFunc = EnTalkGibud_TurnAwayAndShakeHead; } @@ -460,7 +460,7 @@ void EnTalkGibud_TurnAwayAndShakeHead(EnTalkGibud* this, GlobalContext* globalCt } void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK); this->actor.speedXZ = 0.4f; this->actionFunc = EnTalkGibud_WalkToHome; } @@ -485,7 +485,7 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, GlobalContext* globalCtx) { } if (EnTalkGibud_PlayerInRangeWithCorrectState(this, globalCtx)) { if (gSaveContext.playerForm != PLAYER_FORM_GORON && gSaveContext.playerForm != PLAYER_FORM_DEKU && - Actor_IsActorFacingLink(&this->actor, 0x38E3)) { + Actor_IsFacingPlayer(&this->actor, 0x38E3)) { EnTalkGibud_SetupWalkToPlayer(this); } } @@ -496,9 +496,9 @@ void EnTalkGibud_SetupStunned(EnTalkGibud* this) { this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; if (this->effectTimer != 0) { - func_800BCB70(&this->actor, 0, 0xC8, 0, 0x28); + Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28); } else { - func_800BCB70(&this->actor, 0, 0xC8, 0, 0x28); + Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28); } this->actionFunc = EnTalkGibud_Stunned; } @@ -517,8 +517,8 @@ void EnTalkGibud_Stunned(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupDamage(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->stunTimer = 0; this->grabWaitTimer = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -550,9 +550,9 @@ void EnTalkGibud_Damage(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupDead(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH); this->actor.flags &= ~1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD); this->deathTimer = 0; this->actionFunc = EnTalkGibud_Dead; } @@ -577,7 +577,7 @@ void EnTalkGibud_SetupRevive(EnTalkGibud* this) { Animation_Change(&this->skelAnime, &object_rd_Anim_009298, -1.0f, Animation_GetLastFrame(&object_rd_Anim_009298), 0.0f, 2, -8.0f); this->actor.flags |= 1; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_REVERSE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_REVERSE); this->deathTimer = 0; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnTalkGibud_Revive; @@ -714,7 +714,7 @@ void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, GlobalContext* globalCtx) void EnTalkGibud_SetupPassiveIdle(EnTalkGibud* this) { this->isTalking = false; if (this->actionFunc != EnTalkGibud_Talk) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); } this->actionFunc = EnTalkGibud_PassiveIdle; } @@ -724,11 +724,11 @@ void EnTalkGibud_SetupPassiveIdle(EnTalkGibud* this) { * Gibdo will not attempt to attack the player and can be spoken to. */ void EnTalkGibud_PassiveIdle(EnTalkGibud* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->isTalking = true; func_801518B0(globalCtx, 0x1388, &this->actor); this->textId = 0x1388; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM); EnTalkGibud_SetupTalk(this); } else if (this->actor.xzDistToPlayer < 100.0f && !(this->collider.base.acFlags & AC_HIT)) { func_800E9250(globalCtx, &this->actor, &this->headRotation, &this->upperBodyRotation, this->actor.focus.pos); @@ -748,7 +748,7 @@ void EnTalkGibud_Talk(EnTalkGibud* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); EnTalkGibudRequestedItem* requestedItem; - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: case 1: case 2: @@ -792,7 +792,7 @@ void EnTalkGibud_Talk(EnTalkGibud* this, GlobalContext* globalCtx) { } void EnTalkGibud_SetupDisappear(EnTalkGibud* this) { - func_800BDC5C(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE); this->actor.flags &= ~1; this->disappearanceTimer = 40; this->actionFunc = EnTalkGibud_Disappear; @@ -822,7 +822,7 @@ void EnTalkGibud_Disappear(EnTalkGibud* this, GlobalContext* globalCtx) { this->disappearanceTimer--; } else { if (this->switchFlag != -1) { - Actor_SetSwitchFlag(globalCtx, this->switchFlag); + Flags_SetSwitch(globalCtx, this->switchFlag); } player->stateFlags1 &= ~0x20; player->stateFlags1 &= ~0x20000000; @@ -950,7 +950,7 @@ void EnTalkGibud_PlayAnimation(EnTalkGibud* this, GlobalContext* globalCtx) { void EnTalkGibud_MoveWithGravity(EnTalkGibud* this, GlobalContext* globalCtx) { if (this->actionFunc == EnTalkGibud_WalkToPlayer || this->actionFunc == EnTalkGibud_WalkToHome || this->actionFunc == EnTalkGibud_Damage) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } @@ -963,7 +963,7 @@ void EnTalkGibud_CheckDamageEffect(EnTalkGibud* this, GlobalContext* globalCtx) switch (this->actor.colChkInfo.damageEffect) { case EN_TALK_GIBUD_DMGEFF_DAMAGE: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (player->unk_ADC != 0) { this->unk_3F7 = player->unk_ADD; } @@ -984,7 +984,7 @@ void EnTalkGibud_CheckDamageEffect(EnTalkGibud* this, GlobalContext* globalCtx) break; case EN_TALK_GIBUD_DMGEFF_FIRE_ARROW: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (this->actor.colChkInfo.health == 0) { EnTalkGibud_SetupDead(this); } else { @@ -996,7 +996,7 @@ void EnTalkGibud_CheckDamageEffect(EnTalkGibud* this, GlobalContext* globalCtx) break; case EN_TALK_GIBUD_DMGEFF_LIGHT_ARROW: - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (this->actor.colChkInfo.health == 0) { EnTalkGibud_SetupDead(this); } else { diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index 313a0a1fd..c735f4ca2 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -199,7 +199,7 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&this->targetPos, &player->actor.world.pos); if (!(this->timer & 0xF)) { if (Rand_ZeroOne() < 0.5f && this->actor.xzDistToPlayer <= 200.0f) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIRANHA_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_ATTACK); } } @@ -260,7 +260,7 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { Math_ApproachS(&this->rotationStep, this->targetRotationStep, 1, 0x100); Math_ApproachF(&this->actor.speedXZ, this->targetSpeedXZ, 1.0f, this->speedMaxStep); - Actor_SetVelocityAndMoveXYRotationReverse(&this->actor); + Actor_MoveWithoutGravityReverse(&this->actor); } else { switch (this->isBeached) { case false: @@ -315,7 +315,7 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { } break; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } this->currentRotationAngle += this->nextRotationAngle; @@ -341,11 +341,11 @@ void EnTanron3_SetupDie(EnTanron3* this, GlobalContext* globalCtx) { this->actor.world.rot.y = Math_FAtan2F(zDistance, xDistance); this->workTimer[TANRON3_WORK_TIMER_DIE] = 6; this->actor.speedXZ = 10.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KONB_MINI_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_MINI_DEAD); } void EnTanron3_Die(EnTanron3* this, GlobalContext* globalCtx) { - Actor_SetVelocityAndMoveXYRotationReverse(&this->actor); + Actor_MoveWithoutGravityReverse(&this->actor); if (this->workTimer[TANRON3_WORK_TIMER_DIE] == 0) { EnTanron3_SpawnBubbles(this, globalCtx); Actor_MarkForDeath(&this->actor); @@ -407,7 +407,7 @@ void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx) { splashPos.y = this->waterSurfaceYPos + 10.0f; splashPos.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(globalCtx, &splashPos, NULL, NULL, 1, 500); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_OUT_OF_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER); } } diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c index 2c855d36a..c34d2e5b5 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c @@ -69,7 +69,7 @@ void EnTanron6_Init(Actor* thisx, GlobalContext* globalCtx) { EnTanron6* this = THIS; this->actor.colChkInfo.mass = 10; - ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 19.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 19.0f); this->actor.colChkInfo.health = 1; this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.targetMode = 6; @@ -90,7 +90,7 @@ void EnTanron6_Update(Actor* thisx, GlobalContext* globalCtx) { EnTanron6* this = THIS; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 40.0f, 40.0f, 0x1D); } diff --git a/src/overlays/actors/ovl_En_Test5/z_en_test5.c b/src/overlays/actors/ovl_En_Test5/z_en_test5.c index f1ec4e817..0360af927 100644 --- a/src/overlays/actors/ovl_En_Test5/z_en_test5.c +++ b/src/overlays/actors/ovl_En_Test5/z_en_test5.c @@ -66,15 +66,15 @@ void EnTest5_HandleBottleAction(EnTest5* this, GlobalContext* globalCtx) { player = GET_PLAYER(globalCtx); - if (player->unk_388 == NULL || player->unk_384 != GI_MAX) { + if (player->interactRangeActor == NULL || player->getItemId != GI_MAX) { Math_Vec3f_DistXYZAndStoreDiff(&this->minPos, &player->actor.world.pos, &playerPosRelativeToWater); // Make sure that the player is within the bounds of the water and deep enough to grab some if (playerPosRelativeToWater.x >= 0.0f && playerPosRelativeToWater.x <= this->xLength && playerPosRelativeToWater.z >= 0.0f && playerPosRelativeToWater.z <= this->zLength && fabsf(playerPosRelativeToWater.y) < 100.0f && player->actor.depthInWater > 12.0f) { - func_800B8A1C(&this->actor, globalCtx, GI_MAX, this->actor.xzDistToPlayer, - fabsf(this->actor.playerHeightRel)); + Actor_PickUp(&this->actor, globalCtx, GI_MAX, this->actor.xzDistToPlayer, + fabsf(this->actor.playerHeightRel)); } } } diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c index f2ae5333c..b28c8b1cc 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -174,7 +174,7 @@ void EnThiefbird_Init(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 1500.0f, func_800B3FC0, 35.0f); + ActorShape_Init(&this->actor.shape, 1500.0f, ActorShadow_DrawCircle, 35.0f); if (this->actor.params == 1) { D_80C1392C = 1; Math_Vec3f_Copy(&D_80C13920, &this->actor.world.pos); @@ -251,7 +251,7 @@ s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) { if (isItemFound) { func_801149A0(itemId2, slotId); this->unk_3E8 = D_060033B0; - if (!func_80152498(&globalCtx->msgCtx)) { + if (!Message_GetState(&globalCtx->msgCtx)) { func_801518B0(globalCtx, 0xF4, NULL); } itemId1 = ITEM_BOTTLE; @@ -275,7 +275,7 @@ s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) { this->unk_3E8 = D_80C13680[phi_a3 - 1]; } - if (!func_80152498(&globalCtx->msgCtx)) { + if (!Message_GetState(&globalCtx->msgCtx)) { func_801518B0(globalCtx, 0xF5, NULL); } } else { @@ -459,14 +459,14 @@ void func_80C11454(EnThiefbird* this) { this->unk_3DC = 0.75f; this->unk_3D4 = 1.0f; this->actor.flags &= ~0x200; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); } void func_80C114C0(EnThiefbird* this, GlobalContext* globalCtx) { if (this->unk_18C == 10) { this->unk_18C = 0; this->unk_3D4 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_350, 11, 2, 0.2f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_350, 11, 2, 0.2f, 0.2f); this->actor.flags |= 0x200; } } @@ -503,7 +503,7 @@ void func_80C11590(EnThiefbird* this, GlobalContext* globalCtx) { } else { this->unk_192 -= Rand_S16Offset(4096, 4096); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); } if ((this->actor.depthInWater > -40.0f) || (this->actor.bgCheckFlags & 1)) { @@ -548,7 +548,7 @@ void func_80C1193C(EnThiefbird* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 1.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_FLUTTER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER); } if (this->unk_18E != 0) { @@ -560,7 +560,7 @@ void func_80C1193C(EnThiefbird* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.x, pitch, 4, 0x800, 0x80); if (this->actor.bgCheckFlags & 8) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 6, 0x1000, 0x100); - } else if (Actor_IsActorFacingLink(&this->actor, 0x3C00) || (this->actor.xzDistToPlayer > 120.0f)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x3C00) || (this->actor.xzDistToPlayer > 120.0f)) { s16 rot = BINANG_ROT180(this->actor.yawTowardsPlayer - player->actor.shape.rot.y); if (rot > 0x4000) { @@ -578,7 +578,7 @@ void func_80C1193C(EnThiefbird* this, GlobalContext* globalCtx) { (this->actor.depthInWater > -40.0f)) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE); if (!(this->collider.base.atFlags & AT_BOUNCED)) { if ((D_80C1392C != 0) && CUR_UPG_VALUE(UPG_QUIVER) && (!((gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18) || @@ -608,8 +608,8 @@ void func_80C11C60(EnThiefbird* this) { this->actor.shape.rot.x = 0; this->unk_18E = 40; this->actor.velocity.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_THIEFBIRD_DEAD); - func_800BCB70(&this->actor, 0x4000, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_DEAD); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= 0x10; this->unk_192 = 0x1C00; @@ -684,14 +684,14 @@ void func_80C11F6C(EnThiefbird* this, GlobalContext* globalCtx) { } if (this->actor.colChkInfo.damageEffect == 5) { - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); } else if (this->actor.colChkInfo.damageEffect == 1) { - func_800BCB70(&this->actor, 0, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); } else { - func_800BCB70(&this->actor, 0x4000, 255, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_THIEFBIRD_DAMAGE); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_DAMAGE); } this->collider.base.acFlags &= ~AC_ON; @@ -931,7 +931,7 @@ void func_80C12B1C(EnThiefbird* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; this->collider.base.atFlags &= ~AT_HIT; - func_800BE258(&this->actor, this->collider.elements); + Actor_SetDropFlag(&this->actor, &this->collider.elements->info); func_80C114C0(this, globalCtx); this->unk_194 = 0; @@ -1016,9 +1016,9 @@ void EnThiefbird_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.world.rot.x = -this->actor.shape.rot.x; if (this->actor.colChkInfo.health != 0) { - Actor_SetVelocityAndMoveXYRotation(&this->actor); + Actor_MoveWithoutGravity(&this->actor); } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, 25.0f, 50.0f, 7); @@ -1044,7 +1044,7 @@ void EnThiefbird_Update(Actor* thisx, GlobalContext* globalCtx2) { func_80C12D00(this); if (((this->skelAnime.animation == &D_06000604) && Animation_OnFrame(&this->skelAnime, 13.0f)) || ((this->skelAnime.animation == &D_06000278) && Animation_OnFrame(&this->skelAnime, 1.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_FLUTTER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER); } } diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index bcf8547ef..041a68818 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -140,7 +140,7 @@ static Vec3f D_80896B44 = { 0.0f, 0.45f, 0.0f }; static InitChainEntry sInitChain[] = { ICHAIN_S8(hintId, 70, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -40, ICHAIN_CONTINUE), + ICHAIN_F32(terminalVelocity, -40, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; @@ -154,8 +154,8 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003A20, &D_060012E4, this->jointTable, this->morphTable, 25); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 60.0f); - Actor_SetHeight(&this->actor, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 60.0f); + Actor_SetFocus(&this->actor, 20.0f); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit); this->collider.dim.worldSphere.radius = sSphereInit.dim.modelSphere.radius; @@ -271,7 +271,7 @@ void func_80893BCC(EnTite* this, GlobalContext* globalCtx) { } } } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } } @@ -282,7 +282,7 @@ void func_80893DD4(EnTite* this) { this->unk_2C8 = 0.5f; this->unk_2CC = 0.75f; this->unk_2C4 = 1.0f; - func_800BCB70(&this->actor, 0x4000, 255, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80); this->actor.flags &= ~0x200; } @@ -291,7 +291,7 @@ void func_80893E54(EnTite* this, GlobalContext* globalCtx) { this->unk_2BB = 0; this->collider.base.colType = COLTYPE_HIT6; this->unk_2C4 = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_2D0, 9, 2, 0.2f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2D0, 9, 2, 0.2f, 0.2f); this->actor.flags |= 0x200; } } @@ -335,10 +335,10 @@ void func_80894024(EnTite* this, GlobalContext* globalCtx) { void func_8089408C(EnTite* this, GlobalContext* globalCtx) { Animation_PlayOnce(&this->skelAnime, &D_060004F8); if (!func_80893ADC(this)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); } else { this->actor.world.pos.y += this->actor.depthInWater; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); } if (this->actor.shape.yOffset < 0.0f) { @@ -361,7 +361,7 @@ void func_8089408C(EnTite* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.shape.rot.y; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.flags |= 1; this->actor.velocity.y = 10.0f; } else { @@ -389,7 +389,7 @@ void func_808942B4(EnTite* this, GlobalContext* globalCtx) { func_8089452C(this, globalCtx); } else { this->actor.velocity.y = 0.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); func_80894414(this); } } @@ -412,7 +412,7 @@ void func_80894454(EnTite* this, GlobalContext* globalCtx) { if ((Player_GetMask(globalCtx) == PLAYER_MASK_STONE) || (this->actor.xzDistToPlayer > 450.0f) || (this->actor.playerHeightRel > 80.0f)) { func_80893ED4(this); - } else if (!Actor_IsActorFacingLink(&this->actor, 0x2328)) { + } else if (!Actor_IsFacingPlayer(&this->actor, 0x2328)) { func_808945EC(this); } else { func_80893A9C(this, globalCtx); @@ -430,7 +430,7 @@ void func_8089452C(EnTite* this, GlobalContext* globalCtx) { sp2C.y += this->actor.depthInWater; this->actor.velocity.y *= 0.75f; EffectSsGRipple_Spawn(globalCtx, &sp2C, 0, 500, 0); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_LAND_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER); this->actionFunc = func_808945B4; } @@ -466,9 +466,9 @@ void func_80894638(EnTite* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { if (func_80893ADC(this)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_WALK_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK_WATER); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK); } } @@ -476,7 +476,7 @@ void func_80894638(EnTite* this, GlobalContext* globalCtx) { (this->actor.playerHeightRel > 80.0f)) { func_80893ED4(this); } else if (((this->actor.bgCheckFlags & 1) || (func_80893ADC(this) && (this->actor.depthInWater < 10.0f))) && - Actor_IsActorFacingLink(&this->actor, 0xE38)) { + Actor_IsFacingPlayer(&this->actor, 0xE38)) { if ((this->actor.xzDistToPlayer <= 180.0f) && (this->actor.playerHeightRel <= 80.0f)) { func_80893A9C(this, globalCtx); } else { @@ -495,9 +495,9 @@ void func_8089484C(EnTite* this) { this->actor.speedXZ = 4.0f; if (func_80893ADC(this)) { this->actor.world.pos.y += this->actor.depthInWater; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); } this->actionFunc = func_80894910; } @@ -508,7 +508,7 @@ void func_80894910(EnTite* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 0x40) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_LAND_WATER); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER); if (func_80893ADC(this)) { Math_Vec3f_Copy(&sp34, &this->actor.world.pos); @@ -569,7 +569,7 @@ void func_80894BC8(EnTite* this, GlobalContext* globalCtx) { } if (this->actor.bgCheckFlags & 0x40) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, globalCtx); } @@ -582,7 +582,7 @@ void func_80894BC8(EnTite* this, GlobalContext* globalCtx) { (ABS_ALT(this->actor.shape.rot.x) < 4000) && (ABS_ALT(this->actor.shape.rot.z) < 4000))) { func_80893ED4(this); } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.playerHeightRel <= 80.0f) && - Actor_IsActorFacingLink(&this->actor, 0x1770)) { + Actor_IsFacingPlayer(&this->actor, 0x1770)) { func_80893A9C(this, globalCtx); } else { func_8089484C(this); @@ -611,7 +611,7 @@ void func_80894E0C(EnTite* this, GlobalContext* globalCtx) { } if (this->actor.bgCheckFlags & 0x40) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } else { func_80893BCC(this, globalCtx); } @@ -627,7 +627,7 @@ void func_80894E0C(EnTite* this, GlobalContext* globalCtx) { (ABS_ALT(this->actor.shape.rot.x) < 4000) && (ABS_ALT(this->actor.shape.rot.z) < 4000))) { func_80893ED4(this); } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.playerHeightRel <= 80.0f) && - Actor_IsActorFacingLink(&this->actor, 0x1770)) { + Actor_IsFacingPlayer(&this->actor, 0x1770)) { func_80893A9C(this, globalCtx); } else { func_8089484C(this); @@ -691,7 +691,7 @@ void func_808951B8(EnTite* this, GlobalContext* globalCtx) { void func_808952EC(EnTite* this) { Animation_PlayLoopSetSpeed(&this->skelAnime, &D_06000A14, 1.5f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); this->collider.base.acFlags &= ~AC_ON; func_80893A18(this); this->unk_2B9 = 1; @@ -718,8 +718,8 @@ void func_80895424(EnTite* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { this->collider.base.acFlags |= AC_ON; if (this->actor.bgCheckFlags & 2) { - func_800BBDAC(globalCtx, &this->actor, &this->actor.world.pos, 20.0f, 11, 4.0f, 0, 0, 0); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 20.0f, 11, 4.0f, 0, 0, 0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK); } if (this->unk_2BC == 0) { @@ -735,7 +735,7 @@ void func_80895424(EnTite* this, GlobalContext* globalCtx) { void func_808955E4(EnTite* this) { this->unk_2B9 = 0; this->actor.velocity.y = 13.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); this->actor.bgCheckFlags &= ~1; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = func_80895640; @@ -801,7 +801,7 @@ void func_80895738(EnTite* this, GlobalContext* globalCtx) { if ((Player_GetMask(globalCtx) == PLAYER_MASK_STONE) || (this->actor.xzDistToPlayer > 450.0f) || (this->actor.playerHeightRel > 80.0f)) { func_80893ED4(this); - } else if (!Actor_IsActorFacingLink(&this->actor, 0x2328)) { + } else if (!Actor_IsFacingPlayer(&this->actor, 0x2328)) { func_808945EC(this); } else { func_80893A9C(this, globalCtx); @@ -839,7 +839,7 @@ void func_80895AC0(EnTite* this, GlobalContext* globalCtx) { if (Rand_ZeroOne() < 0.25f) { func_8089595C(this, globalCtx); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK); } if ((this->unk_2BC == 1) || (this->unk_2BC == -1)) { @@ -885,7 +885,7 @@ void func_80895D08(EnTite* this, GlobalContext* globalCtx) { if (Rand_ZeroOne() < 0.5f) { func_8089595C(this, globalCtx); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_WALK); } if ((this->actor.xzDistToPlayer < 240.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_STONE)) { func_8089408C(this, globalCtx); @@ -899,7 +899,7 @@ void func_80895D08(EnTite* this, GlobalContext* globalCtx) { void func_80895DE8(EnTite* this) { this->collider.base.acFlags &= ~AC_ON; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 0.0f; this->actionFunc = func_80895E28; @@ -950,7 +950,7 @@ void func_80895FF8(EnTite* this, GlobalContext* globalCtx) { return; } - func_800BE258(&this->actor, &this->collider.info); + Actor_SetDropFlag(&this->actor, &this->collider.info); if ((this->unk_2BB != 10) || !(this->collider.info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) { func_80893E54(this, globalCtx); @@ -966,8 +966,8 @@ void func_80895FF8(EnTite* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect != 0xF) { if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2BC = 40; - func_800BCB70(&this->actor, 0, 200, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 200, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); this->unk_2BB = 32; this->unk_2C8 = 0.5f; this->unk_2C4 = 2.0f; @@ -977,8 +977,8 @@ void func_80895FF8(EnTite* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2BC = 40; - func_800BCB70(&this->actor, 0, 200, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 200, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_80894DD0(this); return; } @@ -1006,12 +1006,12 @@ void func_80895FF8(EnTite* this, GlobalContext* globalCtx) { this->collider.info.bumper.hitPos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS); } - func_800BCB70(&this->actor, 0x4000, 255, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); if (this->actor.colChkInfo.health == 0) { func_80895020(this, globalCtx); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_DAMAGE); if (this->unk_2B9 == 0) { func_80894B2C(this); @@ -1028,7 +1028,7 @@ void func_80895FF8(EnTite* this, GlobalContext* globalCtx) { this->actor.flags |= 1; if (this->actor.shape.yOffset < 0.0f) { this->actor.shape.yOffset = 0.0f; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } if (this->unk_2B9 != 0) { func_808955E4(this); @@ -1067,7 +1067,7 @@ void EnTite_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != func_808951B8) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 25.0f, 40.0f, 20.0f, this->unk_2C0); func_808963B4(this, globalCtx); if (this->actor.bgCheckFlags & 1) { @@ -1085,7 +1085,7 @@ void EnTite_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, this->actor.scale.y * 2000.0f); + Actor_SetFocus(&this->actor, this->actor.scale.y * 2000.0f); this->collider.dim.worldSphere.center.x = this->actor.world.pos.x; this->collider.dim.worldSphere.center.y = (s32)this->actor.world.pos.y + 15; this->collider.dim.worldSphere.center.z = this->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 1792736d7..102286a25 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -235,7 +235,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B9E8, NULL, this->jointTable, this->morphTable, 18); Animation_Change(&this->skelAnime, &D_060030A4, 1.0f, 0.0f, Animation_GetLastFrame(&D_060030A4.common), 0, 0.0f); this->unk_318 = 0; @@ -299,7 +299,7 @@ void func_80AECA3C(EnTk* this, GlobalContext* globalCtx) { } void func_80AECA90(EnTk* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { globalCtx->msgCtx.unk11F22 = 0; globalCtx->msgCtx.unk11F10 = 0; func_80AEDE10(this, globalCtx); @@ -326,7 +326,7 @@ void func_80AECB6C(EnTk* this, GlobalContext* globalCtx) { struct_80133038_arg2 sp34; this->actor.textId = 0; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { globalCtx->msgCtx.unk11F22 = 0; globalCtx->msgCtx.unk11F10 = 0; func_80AED4F8(this, globalCtx); @@ -480,7 +480,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) { if ((sp4C4 != NULL) && (this->unk_2CA & 0x400)) { Vec3f sp5C; - Actor_CalcOffsetOrientedToDrawRotation(&this->actor, &sp5C, &sp4C4->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&this->actor, &sp5C, &sp4C4->actor.world.pos); sp4C4->unk_1A7 = 2; if (sp5C.z < -20.0f) { this->unk_2CA &= ~0x400; @@ -562,7 +562,7 @@ void func_80AED610(EnTk* this, GlobalContext* globalCtx) { func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); } - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x1555, 0x71C)) { if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) { @@ -696,7 +696,7 @@ void func_80AED940(EnTk* this, GlobalContext* globalCtx) { } while (actor != NULL); } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_2CA &= ~0x80; this->actor.flags &= ~0x10000; globalCtx->msgCtx.unk11F22 = 0; @@ -801,7 +801,7 @@ void func_80AEDF5C(EnTk* this, GlobalContext* globalCtx) { func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4); } - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: switch (this->unk_2E6) { case 0x1404: @@ -964,7 +964,7 @@ void func_80AEE4D0(EnTk* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 33.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_DIG_UP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIG_UP); } if (!(this->unk_2CA & 0x20)) { @@ -1197,7 +1197,7 @@ void func_80AEED38(EnTk* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = this->actor.world.rot.y; } - if (!func_80152498(&globalCtx->msgCtx) && !func_801690CC(globalCtx) && (this->unk_2C6-- <= 0)) { + if (!Message_GetState(&globalCtx->msgCtx) && !func_801690CC(globalCtx) && (this->unk_2C6-- <= 0)) { func_801518B0(globalCtx, 0x140C, NULL); this->unk_2CA |= 0x4000; this->unk_2C6 = 200; @@ -1270,12 +1270,12 @@ void func_80AEF2D8(Actor* thisx, GlobalContext* globalCtx) { if ((this->actor.draw != NULL) && ((this->unk_2D4 == 0) || (this->unk_2D4 == 1)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 24.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WALK); } this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 4); func_80AEC460(this); } @@ -1292,7 +1292,7 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { if (((this->unk_2D4 == 0) || (this->unk_2D4 == 1)) && (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 24.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_WALK); } this->unk_2CA &= ~1; @@ -1315,7 +1315,7 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); if ((this->unk_2B0 == 0) && @@ -1331,7 +1331,7 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(this->actor.bgCheckFlags & 1)) { func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG); } else if (this->actor.bgCheckFlags & 2) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_HUMAN_BOUND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HUMAN_BOUND); } } } diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index ba6945b84..9f0ce13f8 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -88,7 +88,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actor.gravity = -1.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 70.0f, 0x05); if (this->framesUntilNextState == 0) { @@ -140,7 +140,7 @@ void EnTorch2_UpdateDeath(Actor* thisx, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); } else { this->actor.gravity = -1.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } @@ -154,11 +154,11 @@ void EnTorch2_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->alpha == 0xFF) { Scene_SetRenderModeXlu(globalCtx, 0, 0x01); gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255); - func_800BDFC0(globalCtx, gfx); + Gfx_DrawDListOpa(globalCtx, gfx); } else { Scene_SetRenderModeXlu(globalCtx, 1, 0x02); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->alpha); - func_800BE03C(globalCtx, gfx); + Gfx_DrawDListXlu(globalCtx, gfx); } CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index 0acdc0485..f92ef5afd 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -203,7 +203,7 @@ void EnToto_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->actor.bgCheckFlags |= 0x400; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A978, ((globalCtx->sceneNum == 0x12) ? &D_06003AA8 : &D_0600C880), this->jointTable, this->morphTable, @@ -227,7 +227,7 @@ void func_80BA383C(EnToto* this, GlobalContext* globalCtx) { } Animation_PlayOnce(&this->skelAnime, D_80BA5078[this->unk2B4]); } - func_800BBB74(&this->unk260, 0x14, 0x50, 3); + func_800BBB74(this->unk260, 0x14, 0x50, 3); } void func_80BA3930(EnToto* this, GlobalContext* globalCtx) { @@ -253,12 +253,12 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); func_80BA383C(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx) != 0) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80BA36C0(this, globalCtx, 1); if (globalCtx->sceneNum != 0x12) { - Actor_SetSwitchFlag(globalCtx, this->actor.params & 0x7F); + Flags_SetSwitch(globalCtx, this->actor.params & 0x7F); } else if (player->transformation == PLAYER_FORM_DEKU) { - Actor_SetSwitchFlag(globalCtx, this->actor.home.rot.x); + Flags_SetSwitch(globalCtx, this->actor.home.rot.x); } this->unk2B6 = 0; return; @@ -269,7 +269,7 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) { if (this->unk2B6 != 0) { this->text = D_80BA5044; this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 9999.9f, 9999.9f, 0); + func_800B8500(&this->actor, globalCtx, 9999.9f, 9999.9f, EXCH_ITEM_NONE); } else { this->actor.flags &= ~0x10000; func_800B8614(&this->actor, globalCtx, 50.0f); @@ -315,7 +315,7 @@ void func_80BA3C88(EnToto* this) { void func_80BA3CC4(EnToto* this, GlobalContext* globalCtx) { func_80BA383C(this, globalCtx); func_80BA3C88(this); - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { func_80BA36C0(this, globalCtx, this->text->unk1); } else { func_80BA4C44(this, globalCtx); @@ -327,7 +327,7 @@ void func_80BA3D38(EnToto* this, GlobalContext* globalCtx) { this->text = ENTOTO_WEEK_EVENT_FLAGS ? D_80BA50BC : D_80BA5088; func_80BA4C0C(this, globalCtx); globalCtx->actorCtx.unk5 |= 0x20; - this->unk260 = 0; + this->unk260[0] = 0; } void func_80BA3DBC(EnToto* this, GlobalContext* globalCtx) { @@ -419,21 +419,21 @@ s32 func_80BA407C(EnToto* this, GlobalContext* globalCtx) { } s32 func_80BA40D4(EnToto* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { return 1; } return 0; } s32 func_80BA4128(EnToto* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 2) { + if (Message_GetState(&globalCtx->msgCtx) == 2) { return 1; } return 0; } s32 func_80BA415C(EnToto* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 4 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 4 && func_80147624(globalCtx)) { if (globalCtx->msgCtx.choiceIndex != 0) { func_8019F230(); } else { @@ -655,14 +655,14 @@ s32 func_80BA4B24(EnToto* this, GlobalContext* globalCtx) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060028B8, -4.0f); if (player->transformation == PLAYER_FORM_ZORA) { if (!Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) { - Actor_SetSwitchFlag(globalCtx, this->actor.params & 0x7F); + Flags_SetSwitch(globalCtx, this->actor.params & 0x7F); return 1; } else { return 3; } } else { if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 7) & 0x7F)) { - Actor_SetSwitchFlag(globalCtx, (this->actor.params >> 7) & 0x7F); + Flags_SetSwitch(globalCtx, (this->actor.params >> 7) & 0x7F); return 4; } else { return 7; @@ -712,7 +712,7 @@ void func_80BA4CB4(EnToto* this, GlobalContext* globalCtx) { } } if (this->unk2B5 == 4 && !Actor_HasParent(&this->actor, globalCtx)) { - func_800B8A1C(&this->actor, globalCtx, GI_MASK_CIRCUS_LEADER, 9999.9f, 9999.9f); + Actor_PickUp(&this->actor, globalCtx, GI_MASK_CIRCUS_LEADER, 9999.9f, 9999.9f); } } @@ -730,7 +730,7 @@ void EnToto_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } void EnToto_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -741,7 +741,7 @@ void EnToto_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp4C[this->unk260])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp4C[this->unk260[0]])); Scene_SetRenderModeXlu(globalCtx, 0, 1); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, NULL, &this->actor); diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.h b/src/overlays/actors/ovl_En_Toto/z_en_toto.h index aa9628426..cdfe3294e 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.h +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.h @@ -26,7 +26,7 @@ typedef struct EnToto { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ Vec3s jointTable[18]; /* 0x1F4 */ Vec3s morphTable[18]; - /* 0x260 */ s16 unk260; + /* 0x260 */ s16 unk260[2]; /* 0x264 */ ColliderCylinder collider; /* 0x2B0 */ u8 actionFuncIndex; /* 0x2B1 */ u8 unk2B1; diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index e6cd134b5..98bcf100b 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -159,7 +159,7 @@ void EnTrt_UpdateCursorPos(GlobalContext* globalCtx, EnTrt* this) { f32 xOffset = 0.0f; f32 yOffset = 17.0f; - func_800B8898(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); + Actor_GetScreenPos(globalCtx, &this->items[this->cursorIdx]->actor, &x, &y); this->cursorPos.x = x + xOffset; this->cursorPos.y = y + yOffset; this->cursorPos.z = 1.2f; @@ -213,7 +213,7 @@ void EnTrt_EndInteraction(GlobalContext* globalCtx, EnTrt* this) { ActorCutscene_Stop(this->cutscene); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } - func_800B84D0(&this->actor, globalCtx); + Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; Interface_ChangeAlpha(50); @@ -312,7 +312,7 @@ u8 EnTrt_SetCursorIndexFromNeutral(EnTrt* this, u8 shelfOffset) { } void EnTrt_Hello(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -331,7 +331,7 @@ void EnTrt_Hello(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_GetMushroom(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); this->tmpGetMushroomCutscene = this->getMushroomCutscene; @@ -375,12 +375,12 @@ void EnTrt_PayForMushroom(EnTrt* this, GlobalContext* globalCtx) { func_80123D50(globalCtx, GET_PLAYER(globalCtx), ITEM_BOTTLE, PLAYER_AP_BOTTLE); this->actionFunc = EnTrt_SetupItemGiven; } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_RED, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_RED, 300.0f, 300.0f); } } void EnTrt_Goodbye(EnTrt* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { switch (this->textId) { case 0x886: this->textId = 0x887; @@ -395,7 +395,7 @@ void EnTrt_Goodbye(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_SetupTryToGiveRedPotion(EnTrt* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { if (this->textId == 0x88F) { if (func_80114E90() || !(gSaveContext.weekEventReg[0xC] & 0x10)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { @@ -450,9 +450,9 @@ void EnTrt_GiveRedPotionForKoume(EnTrt* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x20000000; this->actionFunc = EnTrt_GivenRedPotionForKoume; } else if (gSaveContext.weekEventReg[0xC] & 0x10) { - func_800B8A1C(&this->actor, globalCtx, GI_POTION_RED, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, GI_POTION_RED, 300.0f, 300.0f); } else { - func_800B8A1C(&this->actor, globalCtx, GI_BOTTLE_POTION_RED, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, GI_BOTTLE_POTION_RED, 300.0f, 300.0f); } } @@ -460,7 +460,7 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, GlobalContext* globalCtx) { //! @bug: player is set to NULL not PLAYER Player* player = NULL; - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); @@ -476,13 +476,13 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); } } - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); this->actionFunc = EnTrt_ItemGiven; } } void EnTrt_EndConversation(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (talkState == 5) { if (func_80147624(globalCtx)) { @@ -510,7 +510,7 @@ s32 EnTrt_FacingShopkeeperDialogResult(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_FaceShopkeeper(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); u8 cursorIdx; if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { @@ -617,7 +617,7 @@ s32 EnTrt_HasPlayerSelectedItem(GlobalContext* globalCtx, EnTrt* this, Input* in } void EnTrt_BrowseShelf(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); s32 pad; u8 prevCursorIdx = this->cursorIdx; u8 cursorIdx; @@ -646,7 +646,7 @@ void EnTrt_BrowseShelf(EnTrt* this, GlobalContext* globalCtx) { void EnTrt_SetupBuyItemWithFanfare(GlobalContext* globalCtx, EnTrt* this) { Player* player = GET_PLAYER(globalCtx); - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); globalCtx->msgCtx.unk11F22 = 0x43; globalCtx->msgCtx.unk12023 = 4; player->stateFlags2 &= ~0x20000000; @@ -712,7 +712,7 @@ void EnTrt_HandleCanBuyItem(GlobalContext* globalCtx, EnTrt* this) { void EnTrt_SelectItem(EnTrt* this, GlobalContext* globalCtx) { EnGirlA* item = this->items[this->cursorIdx]; - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (EnTrt_TakeItemOffShelf(this)) { if (talkState == 4) { @@ -774,7 +774,7 @@ void EnTrt_IdleSleeping(EnTrt* this, GlobalContext* globalCtx) { if (Player_GetMask(globalCtx) == PLAYER_MASK_SCENTS) { this->textId = 0x890; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (player->transformation == PLAYER_FORM_HUMAN) { this->flags |= ENTRT_MET; } @@ -818,7 +818,7 @@ void EnTrt_IdleAwake(EnTrt* this, GlobalContext* globalCtx) { } else { this->textId = 0x850; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { ActorCutscene_Stop(0x7C); @@ -869,7 +869,7 @@ void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) { this->blinkFunc = EnTrt_OpenEyesThenSetToBlink; this->timer = 10; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOTAKE_SURPRISED2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_SURPRISED2); } } else { this->blinkFunc = EnTrt_OpenEyesThenSetToBlink; @@ -923,7 +923,7 @@ void EnTrt_Surprised(EnTrt* this, GlobalContext* globalCtx) { EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 4); this->animationIdx = 4; this->blinkFunc = EnTrt_OpenEyes2; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOTAKE_SURPRISED); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_SURPRISED); this->timer = 30; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } @@ -937,7 +937,7 @@ void EnTrt_Surprised(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); this->blinkFunc = EnTrt_Blink; if (talkState == 6 && func_80147624(globalCtx)) { @@ -958,7 +958,7 @@ void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, GlobalContext* globalCt } void EnTrt_TryToGiveRedPotion(EnTrt* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { if (this->textId == 0x83C) { if (func_80114E90()) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { @@ -999,7 +999,7 @@ void EnTrt_ItemGiven(EnTrt* this, GlobalContext* globalCtx) { ActorCutscene_SetIntentToPlay(this->cutscene); } } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { switch (this->textId) { case 0x889: this->textId = 0x88A; @@ -1020,21 +1020,21 @@ void EnTrt_ItemGiven(EnTrt* this, GlobalContext* globalCtx) { } func_80151938(globalCtx, this->textId); } else { - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } void EnTrt_SetupEndInteraction(EnTrt* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { EnTrt_EndInteraction(globalCtx, this); } } void EnTrt_ShopkeeperGone(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_801518B0(globalCtx, this->textId, &this->actor); } else { if ((player->actor.world.pos.x >= -50.0f && player->actor.world.pos.x <= 50.0f) && @@ -1055,7 +1055,7 @@ void EnTrt_ShopkeeperGone(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_CannotBuy(EnTrt* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { this->actionFunc = this->tmpActionFunc; func_80151938(globalCtx, EnTrt_GetItemTextId(this)); } @@ -1064,7 +1064,7 @@ void EnTrt_CannotBuy(EnTrt* this, GlobalContext* globalCtx) { void EnTrt_CanBuy(EnTrt* this, GlobalContext* globalCtx) { EnGirlA* item; - if (func_80152498(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) { this->shopItemSelectedTween = 0.0f; EnTrt_ResetItemPosition(this); item = this->items[this->cursorIdx]; @@ -1079,12 +1079,12 @@ void EnTrt_BuyItemWithFanfare(EnTrt* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = EnTrt_SetupItemGiven; } else { - func_800B8A1C(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); + Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f); } } void EnTrt_SetupItemGiven(EnTrt* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { this->actionFunc = EnTrt_ItemGiven; if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { if (ActorCutscene_GetCurrentIndex() == 0x7C) { @@ -1093,12 +1093,12 @@ void EnTrt_SetupItemGiven(EnTrt* this, GlobalContext* globalCtx) { this->cutscene = this->lookToShopkeeperCutscene; ActorCutscene_SetIntentToPlay(this->cutscene); } - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); } } void EnTrt_ContinueShopping(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); EnGirlA* item; @@ -1116,7 +1116,7 @@ void EnTrt_ContinueShopping(EnTrt* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x20000000; func_801518B0(globalCtx, this->textId, &this->actor); EnTrt_SetupStartShopping(globalCtx, this, true); - func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1); break; case 1: default: @@ -1368,9 +1368,9 @@ void EnTrt_OpenEyesThenSetToBlink(EnTrt* this) { } void EnTrt_TalkToShopkeeper(EnTrt* this, GlobalContext* globalCtx) { - u8 talkState = talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = talkState = Message_GetState(&globalCtx->msgCtx); Player* player = GET_PLAYER(globalCtx); - s32 itemActionParam; + s32 itemGiven; if (talkState == 5) { if (func_80147624(globalCtx)) { @@ -1381,16 +1381,16 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, GlobalContext* globalCtx) { } } } else if (talkState == 16) { - itemActionParam = func_80123810(globalCtx); - if (itemActionParam > PLAYER_AP_NONE) { - if (itemActionParam == PLAYER_AP_BOTTLE_MUSHROOM) { + itemGiven = func_80123810(globalCtx); + if (itemGiven > EXCH_ITEM_NONE) { + if (itemGiven == EXCH_ITEM_1E) { if (gSaveContext.weekEventReg[0x35] & 8) { player->actor.textId = 0x888; } else { player->actor.textId = 0x883; } this->textId = player->actor.textId; - player->unk_A87 = itemActionParam; + player->exchangeItemId = itemGiven; this->actionFunc = EnTrt_GetMushroom; } else { if (this->flags & ENTRT_GIVEN_MUSHROOM) { @@ -1402,7 +1402,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, GlobalContext* globalCtx) { this->actionFunc = EnTrt_Goodbye; } func_801477B4(globalCtx); - } else if (itemActionParam < PLAYER_AP_NONE) { + } else if (itemGiven < EXCH_ITEM_NONE) { if (this->flags & ENTRT_GIVEN_MUSHROOM) { this->textId = 0x88B; } else { @@ -1466,7 +1466,7 @@ void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) { EnTrt_GetCutscenes(this, globalCtx); this->cutscene = this->lookForwardCutscene; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); EnTrt_InitShopkeeper(this, globalCtx); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.cylRadius = 50; @@ -1690,7 +1690,7 @@ void EnTrt_Update(Actor* thisx, GlobalContext* globalCtx) { EnTrt_UpdateCursorAnim(this); EnTrt_UpdateHeadYawAndPitch(this, globalCtx); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 90.0f); + Actor_SetFocus(&this->actor, 90.0f); SkelAnime_Update(&this->skelAnime); EnTrt_UpdateCollider(this, globalCtx); } diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index cbb31ebc3..74037ce2f 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -661,16 +661,16 @@ s32 func_80A872AC(EnTru* this, GlobalContext* globalCtx) { s32 ret = false; if (this->unk_34E & 7) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (player->transformation == PLAYER_FORM_HUMAN) { this->unk_34E &= ~0x80; } this->unk_34E &= ~(0x4000 | 0x2000); - if ((player->unk_A87 == 35) || (player->unk_A87 == 36)) { + if ((player->exchangeItemId == 35) || (player->exchangeItemId == 36)) { this->unk_34E |= 0x2000; - this->unk_38C = player->unk_A87; - } else if (player->unk_A87 != 0) { + this->unk_38C = player->exchangeItemId; + } else if (player->exchangeItemId != 0) { this->unk_34E |= 0x4000; } @@ -730,7 +730,7 @@ s32 func_80A87400(EnTru* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.world.rot.y, phi_a1, 4, 3640); this->actor.shape.rot.y = this->actor.world.rot.y; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if ((s32)(this->actor.floorHeight + 80.0f) >= (s32)this->actor.world.pos.y) { func_80A86770(this); } @@ -801,7 +801,7 @@ s32 func_80A8777C(Actor* thisx, GlobalContext* globalCtx) { s32 temp_v0; s32 ret = 0; - temp_v0 = func_80152498(&globalCtx->msgCtx); + temp_v0 = Message_GetState(&globalCtx->msgCtx); switch (temp_v0) { default: @@ -894,9 +894,9 @@ s32 func_80A87880(Actor* thisx, GlobalContext* globalCtx) { this->unk_34E &= ~0x400; func_80123D50(globalCtx, player, 18, 21); } - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOUME_DRINK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_DRINK); } else if (Animation_OnFrame(&this->skelAnime, 90.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOUME_REGAIN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_REGAIN); } if ((this->skelAnime.curFrame > 90.0f) && (this->skelAnime.curFrame < 95.0f)) { @@ -940,7 +940,7 @@ s32 func_80A87B48(Actor* thisx, GlobalContext* globalCtx) { this->unk_372 = 10; this->unk_364++; } else if (Animation_OnFrame(&this->skelAnime, 22.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOUME_MAGIC); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_MAGIC); func_80A85AA4(this->unk_394, &this->unk_1F8, 1.0f, 0.1f, 40.0f); } break; @@ -952,8 +952,8 @@ s32 func_80A87B48(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.shadowDraw = NULL; this->unk_34E |= (0x200 | 0x8); this->unk_34E &= ~0x800; - if (player->unk_A87 != 0) { - player->unk_A87 = 0; + if (player->exchangeItemId != 0) { + player->exchangeItemId = 0; } func_80A86924(this, 12); } @@ -996,8 +996,8 @@ s32 func_80A87DC0(Actor* thisx, GlobalContext* globalCtx) { case 2: func_801A75E8(NA_SE_EN_KOUME_MAGIC); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOUME_AWAY); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_KOUME_LAUGH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_AWAY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOUME_LAUGH); func_80A86924(this, 13); this->skelAnime.baseTransl.y = 0; this->skelAnime.moveFlags = 2; @@ -1111,7 +1111,7 @@ void EnTru_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_tru_Skel_01AA60, NULL, this->jointTable, this->morphTable, 27); Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit); diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 667f9a841..b09eb87ae 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -5,6 +5,7 @@ */ #include "z_en_tubo_trap.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #define FLAGS 0x00000000 @@ -63,7 +64,7 @@ void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.shape.rot.z = 0; this->actor.world.rot.z = 0; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 1.8f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 1.8f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actionFunc = EnTuboTrap_Idle; @@ -245,7 +246,7 @@ void EnTuboTrap_Idle(EnTuboTrap* this, GlobalContext* globalCtx) { this->targetHeight += transformationHeight; } this->originPos = this->actor.world.pos; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_POT_MOVE_START); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_POT_MOVE_START); this->actionFunc = EnTuboTrap_Levitate; } } @@ -272,7 +273,7 @@ void EnTuboTrap_FlyAtPlayer(EnTuboTrap* this, GlobalContext* globalCtx) { // But in MM, certain sfxIds got reordered and devs forgot to update: // In MM, NA_SE_EN_MIZUBABA2_ATTACK is the old value 0x3837 // In MM, NA_SE_EN_TUBOOCK_FLY is the new value 0x3AE0 - Audio_PlayActorSound2(&this->actor, NA_SE_EN_MIZUBABA2_ATTACK - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA2_ATTACK - SFX_FLAG); if ((SQ(dX) + SQ(dY) + SQ(dZ) > SQ(240.0f))) { Math_ApproachF(&this->actor.gravity, -3.0f, 0.2f, 0.5f); @@ -287,17 +288,17 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { s32 padding; this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 12.0f, 10.0f, 20.0f, 0x1F); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); if (this->actor.projectedPos.z < 811.0f) { if (this->actor.projectedPos.z > 300.0f) { this->actor.shape.shadowAlpha = (u8)((811 - (s32)this->actor.projectedPos.z) >> 1); - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else if (this->actor.projectedPos.z > -10.0f) { this->actor.shape.shadowAlpha = 255; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else { this->actor.shape.shadowDraw = NULL; } @@ -311,6 +312,5 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnTuboTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { - // Gfx_DrawDListOpa with a display list - func_800BDFC0(globalCtx, D_05017EA0); + Gfx_DrawDListOpa(globalCtx, gameplay_dangeon_keep_DL_017EA0); } diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c index 2031127f7..595984190 100644 --- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c +++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c @@ -96,7 +96,7 @@ void func_80A66278(EnWarpUzu* this, GlobalContext* globalCtx) { do { player = GET_PLAYER(globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { func_80A66384(this, globalCtx); } else { phi_a0 = ABS((s16)(Actor_YawBetweenActors(&this->actor, &player->actor) - this->actor.shape.rot.y)); @@ -133,5 +133,5 @@ void EnWarpUzu_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnWarpUzu_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000EC0); + Gfx_DrawDListOpa(globalCtx, D_06000EC0); } diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index 05d86f3cd..843294728 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -386,7 +386,7 @@ void func_80A59C04(Actor* thisx, GlobalContext* globalCtx2) { f32 temp_f0_2; Player* player = GET_PLAYER(globalCtx); Vec3f sp90; - Actor* rotaryRoom = globalCtx->actorCtx.actorList[ACTORCAT_BG].first; + Actor* rotaryRoom = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first; CollisionPoly* sp88; EnWaterEffectStruct* ptr = &this->unk_144[0]; u8 phi_s5; @@ -471,7 +471,7 @@ void func_80A59C04(Actor* thisx, GlobalContext* globalCtx2) { player->flameTimers[j] = Rand_S16Offset(0, 200); } player->isBurning = true; - func_800B8E58(&player->actor, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE); + func_800B8E58(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE); } } diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 931d283e4..e1786b78c 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -283,7 +283,7 @@ void EnWf_Init(Actor* thisx, GlobalContext* globalCtx) { s32 temp_s0; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 70.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 70.0f); this->actor.shape.shadowAlpha = 150; Collider_InitAndSetJntSph(globalCtx, &this->collider1, &this->actor, &sJntSphInit, this->collider1Elements); Collider_InitAndSetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit1); @@ -325,7 +325,7 @@ void EnWf_Init(Actor* thisx, GlobalContext* globalCtx) { } } - if (Actor_GetRoomCleared(globalCtx, this->actor.room)) { + if (Flags_GetClear(globalCtx, this->actor.room)) { Actor_MarkForDeath(&this->actor); return; } @@ -384,7 +384,7 @@ void func_809907D4(EnWf* this) { this->collider3.base.colType = COLTYPE_HIT3; this->unk_2A0 = 80; this->actor.flags &= ~0x400; - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 80); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 80); } void func_80990854(EnWf* this, GlobalContext* globalCtx) { @@ -393,7 +393,7 @@ void func_80990854(EnWf* this, GlobalContext* globalCtx) { this->collider2.base.colType = COLTYPE_HIT5; this->collider3.base.colType = COLTYPE_HIT5; this->unk_2AC = 0.0f; - func_800BF7CC(globalCtx, &this->actor, this->unk_2B8, 10, 2, 0.3f, 0.2f); + Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2B8, 10, 2, 0.3f, 0.2f); this->actor.flags |= 0x400; } } @@ -463,13 +463,13 @@ s32 func_80990948(GlobalContext* globalCtx, EnWf* this, s16 arg2) { } if (arg2 != 0) { - if (!Actor_IsActorFacingLink(&this->actor, 7000)) { + if (!Actor_IsFacingPlayer(&this->actor, 7000)) { func_80992A74(this, globalCtx); return true; } sp2E = player->actor.shape.rot.y - this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 80.0f) && !func_800BC5EC(globalCtx, &this->actor)) { + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(globalCtx, &this->actor)) { if (((globalCtx->gameplayFrames % 8) != 0) || (ABS_ALT(sp2E) < 0x38E0)) { func_80991C04(this); return true; @@ -518,7 +518,7 @@ void func_80990C6C(EnWf* this, GlobalContext* globalCtx, s32 arg2) { void func_80990E4C(EnWf* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->actor.bgCheckFlags & 1)) { func_80990C6C(this, globalCtx, 2); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_WALK); } } @@ -534,7 +534,7 @@ s32 func_80990EAC(EnWf* this) { void func_80990ED4(EnWf* this) { this->actor.child = NULL; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); func_80991438(this); } @@ -578,7 +578,7 @@ void func_80991040(EnWf* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.shape.shadowScale, 70.0f, 14.0f); this->unk_2A0--; if (this->unk_2A0 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); } } else if (SkelAnime_Update(&this->skelAnime)) { this->actor.scale.y = this->actor.scale.x; @@ -639,7 +639,7 @@ void func_80991280(EnWf* this, GlobalContext* globalCtx) { } else { this->unk_2A0--; if (this->unk_2A0 == 0) { - if (Actor_IsActorFacingLink(&this->actor, 0x1555)) { + if (Actor_IsFacingPlayer(&this->actor, 0x1555)) { if (Rand_ZeroOne() > 0.3f) { func_80991438(this); } else { @@ -650,7 +650,7 @@ void func_80991280(EnWf* this, GlobalContext* globalCtx) { } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } } @@ -674,7 +674,7 @@ void func_8099149C(EnWf* this, GlobalContext* globalCtx) { if (!func_8099408C(globalCtx, this)) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 500); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800BC5EC(globalCtx, &this->actor)) { + if (Actor_OtherIsTargeted(globalCtx, &this->actor)) { sp2C = 150.0f; } else { sp2C = 0.0f; @@ -693,17 +693,17 @@ void func_8099149C(EnWf* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (!func_80990948(globalCtx, this, 0)) { - if (!Actor_IsActorFacingLink(&this->actor, 0x11C7)) { + if (!Actor_IsFacingPlayer(&this->actor, 0x11C7)) { if (Rand_ZeroOne() > 0.5f) { func_80991948(this); } else { func_80991200(this); } } else if (this->actor.xzDistToPlayer < (90.0f + sp2C)) { - if (!func_800BC5EC(globalCtx, &this->actor) && + if (!Actor_OtherIsTargeted(globalCtx, &this->actor) && ((Rand_ZeroOne() > 0.03f) || ((this->actor.xzDistToPlayer <= 80.0f) && (sp28 < 0x38E0)))) { func_80991C04(this); - } else if (func_800BC5EC(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + } else if (Actor_OtherIsTargeted(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { func_8099223C(this); } else { func_80991948(this); @@ -711,7 +711,7 @@ void func_8099149C(EnWf* this, GlobalContext* globalCtx) { } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } func_80990E4C(this, globalCtx); @@ -757,7 +757,7 @@ void func_8099177C(EnWf* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = -phi_f2; SkelAnime_Update(&this->skelAnime); - if (Actor_IsActorFacingLink(&this->actor, 0x1555)) { + if (Actor_IsFacingPlayer(&this->actor, 0x1555)) { if (Rand_ZeroOne() > 0.8f) { func_80991948(this); } else { @@ -765,7 +765,7 @@ void func_8099177C(EnWf* this, GlobalContext* globalCtx) { } } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } } @@ -804,16 +804,16 @@ void func_809919F4(EnWf* this, GlobalContext* globalCtx) { func_80990E4C(this, globalCtx); if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } - if ((Math_CosS(sp26 - this->actor.shape.rot.y) < -0.85f) && !func_800BC5EC(globalCtx, &this->actor) && + if ((Math_CosS(sp26 - this->actor.shape.rot.y) < -0.85f) && !Actor_OtherIsTargeted(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 80.0f)) { func_80991C04(this); } else { this->unk_2A0--; if (this->unk_2A0 == 0) { - if (func_800BC5EC(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + if (Actor_OtherIsTargeted(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { func_8099223C(this); } else { func_80991200(this); @@ -848,7 +848,7 @@ void func_80991C80(EnWf* this, GlobalContext* globalCtx) { if (((this->skelAnime.curFrame >= 9.0f) && (this->skelAnime.curFrame < 13.0f)) || ((this->skelAnime.curFrame >= 17.0f) && (this->skelAnime.curFrame < 20.0f))) { if (!(this->collider1.base.atFlags & AT_ON)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_ATTACK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_ATTACK); } this->collider1.base.atFlags |= AT_ON; } else { @@ -856,14 +856,14 @@ void func_80991C80(EnWf* this, GlobalContext* globalCtx) { } sp2C = Animation_OnFrame(&this->skelAnime, 15.0f); - if (((sp2C != 0) && !func_800BC5B8(globalCtx, &this->actor) && - (!Actor_IsActorFacingLink(&this->actor, 0x2000) || (this->actor.xzDistToPlayer >= 100.0f))) || + if (((sp2C != 0) && !Actor_IsTargeted(globalCtx, &this->actor) && + (!Actor_IsFacingPlayer(&this->actor, 0x2000) || (this->actor.xzDistToPlayer >= 100.0f))) || SkelAnime_Update(&this->skelAnime)) { if ((sp2C == 0) && (this->unk_2A0 != 0)) { this->actor.shape.rot.y += (s16)(0xCCC * (1.5f + ((this->unk_2A0 - 4) * 0.4f))); func_80990C6C(this, globalCtx, 1); this->unk_2A0--; - } else if (!Actor_IsActorFacingLink(&this->actor, 0x1554) && (sp2C == 0)) { + } else if (!Actor_IsFacingPlayer(&this->actor, 0x1554) && (sp2C == 0)) { func_80991200(this); this->unk_2A0 = (s32)Rand_ZeroFloat(5.0f) + 5; if (sp30 >= 0x32C9) { @@ -910,7 +910,7 @@ void func_80992068(EnWf* this, GlobalContext* globalCtx) { sp28 = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y)); if (SkelAnime_Update(&this->skelAnime)) { - if (!Actor_IsActorFacingLink(&this->actor, 0x1554)) { + if (!Actor_IsFacingPlayer(&this->actor, 0x1554)) { func_80991200(this); this->unk_2A0 = (s32)Rand_ZeroFloat(5.0f) + 5; if (sp28 > 0x32C8) { @@ -944,13 +944,13 @@ void func_8099223C(EnWf* this) { this->actor.speedXZ = -6.0f; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); this->actionFunc = func_809922B4; } void func_809922B4(EnWf* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - if (!func_800BC5EC(globalCtx, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + if (!Actor_OtherIsTargeted(globalCtx, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { func_80991438(this); } else if ((globalCtx->gameplayFrames % 2) != 0) { @@ -960,7 +960,7 @@ void func_809922B4(EnWf* this, GlobalContext* globalCtx) { } } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } @@ -995,7 +995,7 @@ void func_8099245C(EnWf* this) { } this->unk_298 = 0; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_DAMAGE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DAMAGE); this->actionFunc = func_809924EC; } @@ -1021,7 +1021,7 @@ void func_809924EC(EnWf* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 8) && (ABS_ALT(sp26) < 0x2EE0) && (this->actor.xzDistToPlayer < 120.0f)) { func_809926D0(this); } else if (!func_8099408C(globalCtx, this)) { - if ((this->actor.xzDistToPlayer <= 80.0f) && !func_800BC5EC(globalCtx, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(globalCtx, &this->actor) && ((globalCtx->gameplayFrames % 8) != 0)) { func_80991C04(this); } else if (Rand_ZeroOne() > 0.5f) { @@ -1041,7 +1041,7 @@ void func_809926D0(EnWf* this) { this->unk_2A0 = 0; this->actor.speedXZ = 6.5f; this->actor.velocity.y = 15.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_80992784; } @@ -1055,7 +1055,7 @@ void func_80992784(EnWf* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; - if (!func_800BC5EC(globalCtx, &this->actor)) { + if (!Actor_OtherIsTargeted(globalCtx, &this->actor)) { func_80991C04(this); } else { func_80991200(this); @@ -1085,10 +1085,10 @@ void func_809928CC(EnWf* this, GlobalContext* globalCtx) { } else { func_8099223C(this); } - } else if (Actor_IsActorFacingLink(&this->actor, 0x4000) && (this->actor.xzDistToPlayer < 60.0f) && + } else if (Actor_IsFacingPlayer(&this->actor, 0x4000) && (this->actor.xzDistToPlayer < 60.0f) && (fabsf(this->actor.playerHeightRel) < 50.0f)) { sp2A = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!func_800BC5EC(globalCtx, &this->actor) && + if (!Actor_OtherIsTargeted(globalCtx, &this->actor) && (((globalCtx->gameplayFrames % 2) != 0) || (ABS_ALT(sp2A) < 0x38E0))) { func_80991C04(this); } else { @@ -1148,7 +1148,7 @@ void func_80992B8C(EnWf* this, GlobalContext* globalCtx) { this->unk_2A0 = (s32)Rand_ZeroFloat(3.0f) + 1; } else { this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 80.0f) && !func_800BC5EC(globalCtx, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(globalCtx, &this->actor) && (((globalCtx->gameplayFrames % 4) == 0) || (sp28 < 0x38E0))) { func_80991C04(this); } else { @@ -1160,7 +1160,7 @@ void func_80992B8C(EnWf* this, GlobalContext* globalCtx) { func_80990E4C(this, globalCtx); if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } } @@ -1174,7 +1174,7 @@ void func_80992D6C(EnWf* this) { } this->actor.flags &= ~1; this->unk_2A0 = 25; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_DEAD); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD); this->actionFunc = func_80992E0C; } @@ -1285,13 +1285,13 @@ void func_80993194(EnWf* this, GlobalContext* globalCtx) { } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } void func_80993350(EnWf* this) { Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); this->actionFunc = func_809933A0; } @@ -1325,7 +1325,7 @@ void func_809933A0(EnWf* this, GlobalContext* globalCtx) { func_80990ED4(this); } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } @@ -1378,7 +1378,7 @@ void func_8099357C(EnWf* this, GlobalContext* globalCtx) { } if (this->unk_2A2 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_CRY); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_CRY); } } @@ -1407,15 +1407,15 @@ void func_8099386C(EnWf* this, GlobalContext* globalCtx) { if ((this->collider2.base.acFlags & AC_HIT) || (this->collider3.base.acFlags & AC_HIT)) { if ((!(this->collider2.base.acFlags & AC_HIT) && (this->collider3.base.acFlags & AC_HIT)) || - !Actor_IsActorFacingLink(&this->actor, 0x4A38)) { + !Actor_IsFacingPlayer(&this->actor, 0x4A38)) { this->actor.colChkInfo.damage *= 4; } if (this->collider2.base.acFlags & AC_HIT) { - func_800BE258(&this->actor, &this->collider2.info); + Actor_SetDropFlag(&this->actor, &this->collider2.info); collider = &this->collider2; } else { - func_800BE258(&this->actor, &this->collider3.info); + Actor_SetDropFlag(&this->actor, &this->collider3.info); collider = &this->collider3; } @@ -1435,16 +1435,16 @@ void func_8099386C(EnWf* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect == 1) { this->unk_2A0 = 40; - func_800BCB70(&this->actor, 0, 0x78, 0, 40); - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_SetColorFilter(&this->actor, 0, 0x78, 0, 40); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_809923B0(this); } else if (this->actor.colChkInfo.damageEffect == 5) { this->unk_2A0 = 40; - func_800BCB70(&this->actor, 0, 0xFF, 0, 40); + Actor_SetColorFilter(&this->actor, 0, 0xFF, 0, 40); this->unk_296 = 30; this->unk_2B0 = 0.75f; this->unk_2AC = 2.0f; - Audio_PlayActorSound2(&this->actor, NA_SE_EN_COMMON_FREEZE); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); func_809923B0(this); } else if (this->actor.colChkInfo.damageEffect == 3) { func_809907D4(this); @@ -1467,7 +1467,7 @@ void func_8099386C(EnWf* this, GlobalContext* globalCtx) { CLEAR_TAG_LARGE_LIGHT_RAYS); } - func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 8); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8); if (this->actor.colChkInfo.health == 0) { func_80992D6C(this); } else { @@ -1495,7 +1495,7 @@ void EnWf_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 32.0f, 30.0f, 60.0f, 0x1D); func_80993738(this, globalCtx); @@ -1528,7 +1528,7 @@ void EnWf_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, 25.0f); + Actor_SetFocus(&this->actor, 25.0f); if (this->unk_2AC > 0.0f) { if (this->unk_296 != 10) { diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index 4853331bb..4dd2db5a5 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -238,13 +238,13 @@ void func_80A49A44(EnWizFire* this, GlobalContext* globalCtx) { phi_s0 += BINANG_ADD((s32)randPlusMinusPoint5Scaled(0x1000), 0x3333); } - Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); this->unk_16A = Rand_S16Offset(70, 30); if (this->unk_16A != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WIZ_EXP - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_EXP - SFX_FLAG); } } else if (this->unk_16A != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); } Math_Vec3f_Copy(&this->actor.velocity, &gZeroVec3f); this->unk_168 = 0; @@ -267,7 +267,7 @@ void func_80A49A44(EnWizFire* this, GlobalContext* globalCtx) { } if (func_8012405C(globalCtx) && (this->collider.base.atFlags & AT_BOUNCED)) { - Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_MG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SHIELD_REFLECT_MG); this->collider.base.atFlags &= ~(AT_TYPE_ENEMY | AT_BOUNCED | AT_HIT); this->collider.base.atFlags |= AT_TYPE_PLAYER; this->collider.info.toucher.dmgFlags = 0x20; @@ -323,7 +323,7 @@ void func_80A49FD8(EnWizFire* this, GlobalContext* globalCtx) { } if (this->unk_168 != 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } } @@ -361,7 +361,7 @@ void func_80A4A11C(EnWizFire* this, GlobalContext* globalCtx) { this->collider.dim.height = 30; this->collider.dim.yShift = 15; func_80A4BC74(this, &sp34, &sp40); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); return; } @@ -386,7 +386,7 @@ void func_80A4A11C(EnWizFire* this, GlobalContext* globalCtx) { } } this->actor.world.pos.y = this->actor.floorHeight + 10.0f; - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); return; } @@ -394,7 +394,7 @@ void func_80A4A11C(EnWizFire* this, GlobalContext* globalCtx) { if (this->unk_166 == 1) { Math_ApproachZeroF(&this->unk_1F0, 0.046f, 0.001f); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); if (this->unk_164 == 0) { if ((this->actor.parent != NULL) && (this->actor.parent->id == ACTOR_EN_WIZ) && (this->unk_1F0 < 0.05f)) { @@ -523,7 +523,7 @@ void EnWizFire_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actionFunc(this, globalCtx); this->actor.shape.yOffset = 10.0f; - Actor_ApplyMovement(&this->actor); + Actor_UpdatePos(&this->actor); this->unk_178[0] = this->actor.world.pos; @@ -597,7 +597,7 @@ void EnWizFire_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; if (this->unk_162 == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EN_WIZ_LAUGH2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WIZ_LAUGH2); if (player->invincibilityTimer > 0) { player->invincibilityTimer += 40; if (this->unk_166 != 0) { diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index a8a10008b..3306fc786 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -156,7 +156,7 @@ void func_80B93310(Actor* thisx, Lights* mapper, GlobalContext* globalCtx) { this->actor.world.pos.y = sp34.y; } this->actor.scale.z *= sp2C * (1 / 12.0f); - func_800B3FC0(&this->actor, mapper, globalCtx); + ActorShadow_DrawCircle(&this->actor, mapper, globalCtx); this->actor.scale.z = this->actor.scale.x; Math_Vec3f_Copy(&this->actor.world.pos, &sp34); } @@ -212,7 +212,7 @@ void EnZog_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - this->actor.minVelocityY = -4.0f; + this->actor.terminalVelocity = -4.0f; this->actor.gravity = -1.0f; this->actor.uncullZoneScale = 3000.0f; this->actor.shape.yOffset = 1000.0f; @@ -466,7 +466,7 @@ s32 func_80B93EA0(EnZog* this, GlobalContext* globalCtx) { switch (this->unk_306) { case 2: if (globalCtx->csCtx.frames == 60) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_JUMP_SAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_JUMP_SAND); } break; @@ -607,12 +607,12 @@ void func_80B943EC(EnZog* this, GlobalContext* globalCtx) { } } else if ((player->stateFlags2 & 0x8000000) && (this->actor.xzDistToPlayer < 120.0f)) { this->unk_30A |= 0x10; - Audio_PlayActorSound2(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); + Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } void func_80B94470(EnZog* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 5) { + if (Message_GetState(&globalCtx->msgCtx) == 5) { if (func_80147624(globalCtx) && (globalCtx->msgCtx.unk11F04 == 0x103C)) { func_801477B4(globalCtx); this->actionFunc = func_80B9451C; @@ -625,7 +625,7 @@ void func_80B94470(EnZog* this, GlobalContext* globalCtx) { } void func_80B9451C(EnZog* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_300 = 2; this->actionFunc = func_80B94470; } else if ((globalCtx->msgCtx.unk1202A == 3) && (this->actor.xzDistToPlayer < 120.0f)) { @@ -662,7 +662,7 @@ void func_80B946B4(EnZog* this, GlobalContext* globalCtx) { } void func_80B946FC(EnZog* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: if (func_80147624(globalCtx)) { switch (globalCtx->msgCtx.choiceIndex) { @@ -713,7 +713,7 @@ void func_80B946FC(EnZog* this, GlobalContext* globalCtx) { } void func_80B948A8(EnZog* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->unk_300 = 2; this->actionFunc = func_80B946FC; } else if ((globalCtx->msgCtx.unk1202A == 3) && (this->actor.xzDistToPlayer < 120.0f)) { @@ -780,15 +780,15 @@ void func_80B94A00(EnZog* this, GlobalContext* globalCtx) { if ((this->unk_304 == 4) && (Animation_OnFrame(&this->skelAnime, 136.0f) || Animation_OnFrame(&this->skelAnime, 155.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_WATER0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_WATER0); } if ((this->unk_304 == 5) && (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 37.0f))) { if (this->actor.depthInWater > 0.0f) { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_WATER0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_WATER0); } else { - Audio_PlayActorSound2(&this->actor, NA_SE_PL_WALK_SAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_SAND); } } } @@ -800,7 +800,7 @@ void func_80B94C5C(EnZog* this, GlobalContext* globalCtx) { this->actor.shape.yOffset -= 20.0f; } this->actor.velocity.y = -1.0f; - this->actor.minVelocityY = -1.0f; + this->actor.terminalVelocity = -1.0f; } if ((this->unk_2FC == 1) && (this->unk_302 == 0)) { @@ -827,7 +827,7 @@ void func_80B94D0C(EnZog* this, GlobalContext* globalCtx) { this->unk_31E = 0; } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { this->unk_320 = 5; switch (globalCtx->msgCtx.unk11F04) { case 0x1004: @@ -875,21 +875,21 @@ void func_80B94E34(EnZog* this, GlobalContext* globalCtx) { if ((player->actor.speedXZ > 3.0f) && (this->unk_324 == 0)) { this->unk_324 = 25; - func_800B8E58(&player->actor, player->ageProperties->unk_92 + 0x6818); + func_800B8E58(player, player->ageProperties->unk_92 + NA_SE_VO_LI_PUSH); } } this->actor.speedXZ *= 0.3f; } if (ABS_ALT(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0x5000) { - func_800B8A1C(&this->actor, globalCtx, 0, 60.0f, 40.0f); + Actor_PickUp(&this->actor, globalCtx, 0, 60.0f, 40.0f); } if (this->unk_324 > 0) { this->unk_324--; } - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B94D0C; this->actor.speedXZ = 0.0f; this->unk_300 = 2; @@ -899,7 +899,7 @@ void func_80B94E34(EnZog* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->unk_2FE = 1; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = 0.0f; + this->actor.terminalVelocity = 0.0f; this->actor.gravity = 0.0f; this->unk_31C = 1; this->unk_31E = 0; @@ -918,7 +918,7 @@ void func_80B95128(EnZog* this, GlobalContext* globalCtx) { func_80B93D2C(this, globalCtx); func_80B93BE0(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B94D0C; this->unk_300 = 2; this->actor.speedXZ = 0.0f; @@ -954,7 +954,7 @@ void EnZog_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnZog* this = THIS; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5); if (func_800EE29C(globalCtx, 0x1D7) && (ENZOG_GET_F(&this->actor) != ENZOG_F_2)) { this->actionFunc = func_80B9461C; @@ -965,7 +965,7 @@ void EnZog_Update(Actor* thisx, GlobalContext* globalCtx) { if (((this->unk_304 == 6) && Animation_OnFrame(&this->skelAnime, 43.0f)) || ((this->unk_304 == 17) && Animation_OnFrame(&this->skelAnime, 14.0f))) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_LAND_SAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_LAND_SAND); } if (this->unk_30A & 1) { diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index fe2b2cbef..c179517cd 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -97,7 +97,7 @@ void EnZot_Init(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; s32 i; - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80B97100; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D208, &D_06004248, this->jointTable, this->morphTable, 20); @@ -110,7 +110,7 @@ void EnZot_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.world.rot.z = this->actor.shape.rot.z = 0; this->actor.targetMode = 6; - this->actor.minVelocityY = -4.0f; + this->actor.terminalVelocity = -4.0f; this->actor.gravity = -4.0f; switch (ENZOT_GET_1F(thisx)) { @@ -288,7 +288,7 @@ void func_80B96D4C(EnZot* this) { } s32 func_80B96DF0(EnZot* this, GlobalContext* globalCtx) { - if (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && Actor_IsActorFacingLink(&this->actor, 0x3000) && + if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x3000) && (this->actor.xzDistToPlayer < 100.0f)) { return true; } @@ -391,7 +391,7 @@ void func_80B97110(EnZot* this, GlobalContext* globalCtx) { } void func_80B97194(EnZot* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x125C: case 0x125F: @@ -410,11 +410,11 @@ void func_80B97194(EnZot* this, GlobalContext* globalCtx) { } void func_80B97240(EnZot* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B97194; func_80B97110(this, globalCtx); - } else if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && - Actor_IsActorFacingLink(&this->actor, 0x3000)) { + } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && + Actor_IsFacingPlayer(&this->actor, 0x3000)) { func_800B8614(&this->actor, globalCtx, 120.0f); } } @@ -460,7 +460,7 @@ void func_80B973BC(EnZot* this, GlobalContext* globalCtx) { func_80B96D4C(this); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x800, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x126E: case 0x1270: @@ -525,10 +525,10 @@ void func_80B973BC(EnZot* this, GlobalContext* globalCtx) { void func_80B975F8(EnZot* this, GlobalContext* globalCtx) { func_80B96D4C(this); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B973BC; } else { - func_800B8500(&this->actor, globalCtx, 10000.0f, 1000.0f, 0); + func_800B8500(&this->actor, globalCtx, 10000.0f, 1000.0f, EXCH_ITEM_NONE); } } @@ -537,7 +537,7 @@ void func_80B9765C(EnZot* this, GlobalContext* globalCtx) { do { } while (0); } func_80B96D4C(this); - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { u16 temp = globalCtx->msgCtx.unk11F04; u32 temp2; @@ -558,7 +558,7 @@ void func_80B97708(EnZot* this, GlobalContext* globalCtx) { func_80B96D4C(this); Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x400, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B9765C; func_80B972E8(this, globalCtx); return; @@ -670,7 +670,7 @@ void func_80B979DC(EnZot* this, GlobalContext* globalCtx) { } void func_80B97A44(EnZot* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x1279: case 0x127C: @@ -708,7 +708,7 @@ void func_80B97A44(EnZot* this, GlobalContext* globalCtx) { void func_80B97B5C(EnZot* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x400, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B97A44; func_80B9787C(this, globalCtx); } else if (func_80B96DF0(this, globalCtx)) { @@ -730,17 +730,17 @@ void func_80B97BF8(EnZot* this, GlobalContext* globalCtx) { void func_80B97C40(EnZot* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x800, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { func_801477B4(globalCtx); this->actionFunc = func_80B97CC8; } } void func_80B97CC8(EnZot* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B97C40; func_801518B0(globalCtx, 0x128B, &this->actor); - } else if (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { + } else if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { func_800B8614(&this->actor, globalCtx, 120.0f); } } @@ -755,7 +755,7 @@ void func_80B97D6C(EnZot* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_ZORA_WALK); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_WALK); } } @@ -779,7 +779,7 @@ void func_80B97E4C(EnZot* this, GlobalContext* globalCtx) { this->actor.world.rot.y = this->actor.shape.rot.y; } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x128C: this->unk_2F2 &= ~4; @@ -812,7 +812,7 @@ void func_80B97E4C(EnZot* this, GlobalContext* globalCtx) { void func_80B97FD0(EnZot* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x800, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B97E4C; func_80B97BF8(this, globalCtx); } else if (gSaveContext.weekEventReg[38] & 8) { @@ -821,7 +821,7 @@ void func_80B97FD0(EnZot* this, GlobalContext* globalCtx) { this->actionFunc = func_80B97E0C; func_80B96BEC(this, 6, 2); } - } else if (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { + } else if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { func_800B8614(&this->actor, globalCtx, 120.0f); } } @@ -916,7 +916,7 @@ void func_80B98348(EnZot* this, GlobalContext* globalCtx) { if (ENZOT_GET_1F(&this->actor) == 7) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x800, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - } else if (Actor_IsActorFacingLink(&this->actor, 0x3000)) { + } else if (Actor_IsFacingPlayer(&this->actor, 0x3000)) { this->unk_2F2 &= ~8; } else { this->unk_2F2 |= 8; @@ -935,7 +935,7 @@ void func_80B98348(EnZot* this, GlobalContext* globalCtx) { void func_80B9849C(EnZot* this, GlobalContext* globalCtx) { func_80B98348(this, globalCtx); - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->unk_2D4 == 2) { func_801518B0(globalCtx, 0x12AD, &this->actor); } else { @@ -943,7 +943,7 @@ void func_80B9849C(EnZot* this, GlobalContext* globalCtx) { } this->actionFunc = func_80B98728; } else { - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1); } } @@ -953,9 +953,9 @@ void func_80B9854C(EnZot* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = func_80B9849C; this->actor.flags |= 0x10000; - func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1); } else { - func_800B8A1C(&this->actor, globalCtx, this->unk_2D4, 10000.0f, 50.0f); + Actor_PickUp(&this->actor, globalCtx, this->unk_2D4, 10000.0f, 50.0f); } } @@ -964,7 +964,7 @@ void func_80B985EC(EnZot* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); func_80B98348(this, globalCtx); - if (func_80152498(&globalCtx->msgCtx) == 0x10) { + if (Message_GetState(&globalCtx->msgCtx) == 0x10) { itemActionParam = func_80123810(globalCtx); if (itemActionParam > PLAYER_AP_NONE) { func_801477B4(globalCtx); @@ -989,7 +989,7 @@ void func_80B985EC(EnZot* this, GlobalContext* globalCtx) { void func_80B98728(EnZot* this, GlobalContext* globalCtx) { func_80B98348(this, globalCtx); - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 4: if (func_80147624(globalCtx) && (globalCtx->msgCtx.unk11F04 == 0x1293)) { switch (globalCtx->msgCtx.choiceIndex) { @@ -1074,11 +1074,11 @@ void func_80B98728(EnZot* this, GlobalContext* globalCtx) { void func_80B98998(EnZot* this, GlobalContext* globalCtx) { this->unk_2F2 &= ~8; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B98728; func_80B98178(this, globalCtx); - } else if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && - Actor_IsActorFacingLink(&this->actor, 0x7000)) { + } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && + Actor_IsFacingPlayer(&this->actor, 0x7000)) { func_800B8614(&this->actor, globalCtx, 120.0f); } } @@ -1103,7 +1103,7 @@ void func_80B98A4C(EnZot* this, GlobalContext* globalCtx) { } void func_80B98AD0(EnZot* this, GlobalContext* globalCtx) { - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x12B1: case 0x12B4: @@ -1135,7 +1135,7 @@ void func_80B98AD0(EnZot* this, GlobalContext* globalCtx) { } void func_80B98BF4(EnZot* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags &= ~0x10000; if (gSaveContext.weekEventReg[41] & 0x20) { func_801518B0(globalCtx, 0x12B7, &this->actor); @@ -1150,17 +1150,17 @@ void func_80B98BF4(EnZot* this, GlobalContext* globalCtx) { } void func_80B98CA8(EnZot* this, GlobalContext* globalCtx) { - if (func_800B8718(&this->actor, globalCtx)) { + if (func_800B8718(&this->actor, &globalCtx->state)) { globalCtx->msgCtx.unk1202A = 4; func_8019B544(0xFFFF); this->actionFunc = func_80B98BF4; this->actor.flags |= 0x10000; func_800B8614(&this->actor, globalCtx, 120.0f); - } else if (func_800B84D0(&this->actor, globalCtx)) { + } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B98AD0; func_80B98A4C(this, globalCtx); } else { - if ((this->actor.xzDistToPlayer < 100.0f) && Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx)) { + if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx)) { func_800B8614(&this->actor, globalCtx, 120.0f); } @@ -1215,7 +1215,7 @@ void func_80B98F30(EnZot* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = func_80B990A4; } else { - func_800B8A1C(&this->actor, globalCtx, GI_RUPEE_BLUE, 10000.0f, 50.0f); + Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 10000.0f, 50.0f); } } @@ -1225,7 +1225,7 @@ void func_80B98F94(EnZot* this, GlobalContext* globalCtx) { this->actor.world.rot.y = this->actor.shape.rot.y; } - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { switch (globalCtx->msgCtx.unk11F04) { case 0x12BB: this->unk_2F2 &= ~4; @@ -1253,10 +1253,10 @@ void func_80B98F94(EnZot* this, GlobalContext* globalCtx) { void func_80B990A4(EnZot* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x400, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B98F94; func_80B98E10(this, globalCtx); - } else if (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { + } else if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { func_800B8614(&this->actor, globalCtx, 120.0f); } } @@ -1286,7 +1286,7 @@ void func_80B991E4(EnZot* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x800, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; - if ((func_80152498(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { u16 temp = globalCtx->msgCtx.unk11F04; u32 temp2; @@ -1302,13 +1302,13 @@ void func_80B991E4(EnZot* this, GlobalContext* globalCtx) { } void func_80B992C0(EnZot* this, GlobalContext* globalCtx) { - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actionFunc = func_80B991E4; func_80B99160(this, globalCtx); this->actor.speedXZ = 0.0f; func_80B96BEC(this, 0, 0); } else { - if (Actor_IsLinkFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { + if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) { func_800B8614(&this->actor, globalCtx, 120.0f); } this->actor.speedXZ = 1.5f; @@ -1323,7 +1323,7 @@ void EnZot_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnZot* this = THIS; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 15.0f, 30.0f, 5); diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 2bac5660d..519d87e7f 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -42,7 +42,7 @@ extern Gfx D_06001470[]; void ItemBHeart_Init(Actor* thisx, GlobalContext* globalCtx) { ItemBHeart* this = THIS; - if (Actor_GetCollectibleFlag(globalCtx, 0x1F)) { + if (Flags_GetCollectible(globalCtx, 0x1F)) { Actor_MarkForDeath(&this->actor); return; } @@ -69,10 +69,10 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(this->unk_168 < 0.5f)) { if (Actor_HasParent(&this->actor, globalCtx)) { - Actor_SetCollectibleFlag(globalCtx, 0x1F); + Flags_SetCollectible(globalCtx, 0x1F); Actor_MarkForDeath(&this->actor); } else { - func_800B8A1C(&this->actor, globalCtx, GI_HEART_CONTAINER, 30.0f, 80.0f); + Actor_PickUp(&this->actor, globalCtx, GI_HEART_CONTAINER, 30.0f, 80.0f); } } } @@ -90,7 +90,7 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); - blueWarpActor = globalCtx->actorCtx.actorList[ACTORCAT_ITEMACTION].first; + blueWarpActor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; while (blueWarpActor != NULL) { if ((blueWarpActor->id == ACTOR_DOOR_WARP1) && (blueWarpActor->projectedPos.z > this->actor.projectedPos.z)) { diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index d30a74878..a006270f3 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -40,7 +40,7 @@ void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ItemInbox_Idle(ItemInbox* this, GlobalContext* globalCtx) { - if (Actor_GetChestFlag(globalCtx, (this->actor.params >> 8) & 0x1F)) { + if (Flags_GetTreasure(globalCtx, (this->actor.params >> 8) & 0x1F)) { Actor_MarkForDeath(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c index acef9d1ab..385ca2cc2 100644 --- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c +++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c @@ -58,7 +58,7 @@ static ColliderCylinderInit sCylinderInit = { static InitChainEntry sInitChain[] = { ICHAIN_VEC3S(shape.rot, 0, ICHAIN_CONTINUE), ICHAIN_VEC3S(world.rot, 0, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, -900, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(minVelocityY, -4000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -900, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(terminalVelocity, -4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 300, ICHAIN_STOP), }; @@ -150,7 +150,7 @@ void ObjAqua_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.z = 0.0009f; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 60.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 60.0f); if (1) {}; this->actor.shape.shadowAlpha = 140; this->alpha = 255; @@ -180,7 +180,7 @@ void func_80ACBC8C(ObjAqua* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { func_80ACB7F4(this, globalCtx); func_80ACBA10(this); - Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOTTLE_WATERING); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOTTLE_WATERING); func_80ACBD34(this); } else { func_80ACB6A0(this, globalCtx); @@ -254,7 +254,7 @@ void ObjAqua_Update(Actor* thisx, GlobalContext* globalCtx) { Math_Vec3f_StepTo(&this->actor.scale, &D_80ACC320, 0.0004f); } this->actor.velocity.y *= 0.9f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 12.0f, 4.0f, 0.0f, 5); if (this->actionFunc != func_80ACBDFC) { Collider_UpdateCylinder(&this->actor, &this->collider); diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c index 55b8f301f..651adf6d2 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -198,11 +198,11 @@ s32 func_80A357A8(ObjBell* this, GlobalContext* globalCtx) { this->unk_20E = 10; switch (this->dyna.actor.colChkInfo.damageEffect) { case 15: - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BIGBELL); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGBELL); func_80A35510(this, 1); break; case 14: - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BIGBELL); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BIGBELL); func_80A35510(this, 2); break; default: diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c index 0d5a2c1b9..a0d6301f3 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c @@ -182,5 +182,5 @@ void ObjBoyo_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjBoyo* this = THIS; AnimatedMat_Draw(globalCtx, this->unk_190); - func_800BDFC0(globalCtx, D_06000300); + Gfx_DrawDListOpa(globalCtx, D_06000300); } diff --git a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c index 60da4d5b5..a75bc0a3b 100644 --- a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c +++ b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c @@ -34,9 +34,9 @@ s32 ObjDowsing_GetFlag(ObjDowsing* this, GlobalContext* globalCtx) { s32 flag = DOWSING_GET_FLAG(&this->actor); if (type == DOWSING_COLLECTIBLE) { - return Actor_GetCollectibleFlag(globalCtx, flag); + return Flags_GetCollectible(globalCtx, flag); } else if (type == DOWSING_CHEST) { - return Actor_GetChestFlag(globalCtx, flag); + return Flags_GetTreasure(globalCtx, flag); } else if (type == DOWSING_SWITCH) { return Flags_GetSwitch(globalCtx, flag); } else { diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c index 7ae7399ca..cb6aabaff 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c @@ -65,10 +65,10 @@ void ObjEnding_Draw(Actor* thisx, GlobalContext* globalCtx) { } dl1 = this->modelInfo->dLists[0]; if (dl1 != NULL) { - func_800BDFC0(globalCtx, dl1); + Gfx_DrawDListOpa(globalCtx, dl1); } dl2 = this->modelInfo->dLists[1]; if (dl2 != NULL) { - func_800BE03C(globalCtx, dl2); + Gfx_DrawDListXlu(globalCtx, dl2); } } diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c index 56f9b9f7a..ca6ea9f6f 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -250,7 +250,7 @@ void ObjEtcetera_Setup(ObjEtcetera* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) { this->dyna.actor.objBankIndex = this->objIndex; - Actor_SetObjectSegment(globalCtx, &this->dyna.actor); + Actor_SetObjectDependency(globalCtx, &this->dyna.actor); DynaPolyActor_Init(&this->dyna, 1); thisCollisionHeader = collisionHeaders[type]; if (thisCollisionHeader != 0) { diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index 793f7cbe0..bd91aaaf0 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -92,7 +92,7 @@ static u8 D_80A1D404 = true; static Vec3f D_80A1D408 = { 0.0f, 20.0f, 0.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1600, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP), }; @@ -370,7 +370,7 @@ void func_80A1C328(ObjFlowerpot* this, GlobalContext* globalCtx) { void func_80A1C554(ObjFlowerpot* this) { if ((this->actor.projectedPos.z < 455.0f) && (this->actor.projectedPos.z > -10.0f)) { - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowScale = 1.9f; if (this->actor.projectedPos.z < 255.0f) { this->actor.shape.shadowAlpha = 200; @@ -448,7 +448,10 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) { if (func_800A817C(ENOBJFLOWERPOT_GET_3F(&this->actor))) { func_80A1B914(this, globalCtx); } - func_800B8E58(&this->actor, NA_SE_PL_PULL_UP_POT); + + //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be + //! player->currentMask, but in this case is garbage in the collider + func_800B8E58((Player*)this, NA_SE_PL_PULL_UP_POT); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { if (!(this->unk_1EA & 2)) { func_80A1B914(this, globalCtx); @@ -482,7 +485,7 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) { } if (this->unk_1EA & 1) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A1C5E8(this, globalCtx); if (this->actor.bgCheckFlags & 1) { if (this->actor.colChkInfo.mass == MASS_IMMOVABLE) { @@ -512,7 +515,7 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) { s16 temp_v0_3 = this->actor.yawTowardsPlayer - GET_PLAYER(globalCtx)->actor.world.rot.y; if (ABS_ALT(temp_v0_3) >= 0x5556) { - func_800B8A1C(&this->actor, globalCtx, 0, 36.0f, 30.0f); + Actor_PickUp(&this->actor, globalCtx, 0, 36.0f, 30.0f); } } } @@ -533,10 +536,10 @@ void func_80A1CC0C(ObjFlowerpot* this, GlobalContext* globalCtx) { this->actor.room = globalCtx->roomCtx.currRoom.num; if (fabsf(this->actor.speedXZ) < 0.1f) { func_80A1C818(this); - func_800B8E58(&GET_PLAYER(globalCtx)->actor, NA_SE_PL_PUT_DOWN_POT); + func_800B8E58(GET_PLAYER(globalCtx), NA_SE_PL_PUT_DOWN_POT); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_80A1CD10(this); } func_80A1C5E8(this, globalCtx); @@ -622,7 +625,7 @@ void func_80A1CEF4(ObjFlowerpot* this2, GlobalContext* globalCtx) { return; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (!(this->unk_1EA & 2)) { D_80A1D3F8 += (s16)(this->actor.shape.rot.x * -0.06f); diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index 4cfc3fcf7..49a5a7dbe 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -75,7 +75,7 @@ void func_80B3C39C(ObjGhaka* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s16 distDiff = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; - if (func_800B84D0(&this->dyna.actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state)) { func_80B3C29C(this); } else if (this->dyna.actor.xzDistToPlayer < 100.0f || this->dyna.actor.isTargeted) { if (distDiff <= -0x5556 || distDiff >= 0x5556) { @@ -97,7 +97,7 @@ void func_80B3C39C(ObjGhaka* this, GlobalContext* globalCtx) { } void func_80B3C4E0(ObjGhaka* this, GlobalContext* globalCtx) { - u8 talkState = func_80152498(&globalCtx->msgCtx); + u8 talkState = Message_GetState(&globalCtx->msgCtx); if (talkState == 5) { if (func_80147624(globalCtx)) { diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c index af5ebd44a..4d717fabd 100644 --- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c +++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c @@ -37,7 +37,7 @@ static ColliderCylinderInit D_809ABBD0 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_809ABC4C[] = { ICHAIN_F32_DIV1000(gravity, -3200, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -17000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -17000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 400, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index b82932eaa..d7e0d6633 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -49,5 +49,5 @@ void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000500); + Gfx_DrawDListOpa(globalCtx, D_06000500); } diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c index 0b32504fa..c11fa4903 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c @@ -49,7 +49,7 @@ static s32 unused = 0; static s32 unused2 = 0; void ObjHgdoor_SetChild(ObjHgdoor* this, GlobalContext* globalCtx) { - Actor* actorIterator = globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; + Actor* actorIterator = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first; while (actorIterator) { if ((actorIterator->id == ACTOR_OBJ_HGDOOR) && (&this->dyna.actor != actorIterator)) { @@ -61,7 +61,7 @@ void ObjHgdoor_SetChild(ObjHgdoor* this, GlobalContext* globalCtx) { } void ObjHgdoor_SetParent(ObjHgdoor* this, GlobalContext* globalCtx) { - Actor* actorIterator = globalCtx->actorCtx.actorList[ACTORCAT_PROP].first; + Actor* actorIterator = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first; while (actorIterator) { if (actorIterator->id == ACTOR_EN_HG) { @@ -142,7 +142,7 @@ void func_80BD4358(ObjHgdoor* this, GlobalContext* globalCtx) { this->unk166 = globalCtx->csCtx.npcActions[actionIndex]->unk0; switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) { case 1: - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY); if ((this->dyna.actor.parent != NULL) && (this->dyna.actor.parent->id == ACTOR_EN_HG)) { this->dyna.actor.parent->colChkInfo.health = 1; } diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c index d7001bed0..cf84a1bd7 100644 --- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c +++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c @@ -146,5 +146,5 @@ void ObjHsStump_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjHsStump_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_060003B8); + Gfx_DrawDListOpa(globalCtx, D_060003B8); } diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c index 532de8b3b..2c204e7ba 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c @@ -403,7 +403,7 @@ void func_80A54CEC(ObjHugebombiwa* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); - Actor_SetSwitchFlag(globalCtx, ENHUGEBOMBIWA_GET_7F(&this->actor)); + Flags_SetSwitch(globalCtx, ENHUGEBOMBIWA_GET_7F(&this->actor)); if (!(ENHUGEBOMBIWA_GET_100(&this->actor)) && ((globalCtx->sceneNum == SCENE_17SETUGEN) || (globalCtx->sceneNum == SCENE_17SETUGEN2))) { gSaveContext.weekEventReg[19] |= 2; @@ -689,7 +689,7 @@ void func_80A55B34(Actor* thisx, GlobalContext* globalCtx) { EnHugebombiwaStruct* ptr; if ((this->actionFunc == func_80A54C04) || (this->actionFunc == func_80A54CEC)) { - func_800BDFC0(globalCtx, object_bombiwa_DL_001820); + Gfx_DrawDListOpa(globalCtx, object_bombiwa_DL_001820); return; } diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index f623ca4f8..0c4f8f63e 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -193,8 +193,8 @@ void func_80A2339C(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, f32 arg3, s3 void func_80A23690(ObjIceblock* this) { this->dyna.actor.velocity.y += this->dyna.actor.gravity; - if (this->dyna.actor.velocity.y < this->dyna.actor.minVelocityY) { - this->dyna.actor.velocity.y = this->dyna.actor.minVelocityY; + if (this->dyna.actor.velocity.y < this->dyna.actor.terminalVelocity) { + this->dyna.actor.velocity.y = this->dyna.actor.terminalVelocity; } this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; } @@ -893,9 +893,12 @@ void func_80A25440(ObjIceblock* this) { } static InitChainEntry sInitChain[] = { - ICHAIN_F32_DIV1000(speedXZ, 16000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1800, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -26000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 150, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(speedXZ, 16000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -1800, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -26000, ICHAIN_CONTINUE), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 150, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 200, ICHAIN_STOP), }; @@ -1093,13 +1096,13 @@ void func_80A25BBC(ObjIceblock* this, GlobalContext* globalCtx) { func_80A23690(this); if (func_80A23F90(this, globalCtx)) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } if (func_80A24954(this, globalCtx)) { func_80A2491C(this); if (this->unk_2B0 == 3) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_DIVE_INTO_WATER_L); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DIVE_INTO_WATER_L); } } } @@ -1172,7 +1175,7 @@ void func_80A25E50(ObjIceblock* this, GlobalContext* globalCtx) { func_80A25BA0(this); } else if (sp38) { if (func_80A24118(this, globalCtx, 59.9f, &sp28)) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } func_80A2541C(this, globalCtx); func_80A25CF4(this); @@ -1201,7 +1204,7 @@ void func_80A25FD4(ObjIceblock* this, GlobalContext* globalCtx) { if (sp2C == -1) { sp30 = false; } else if (!(this->unk_1B0 & 2) && (this->unk_26E[sp2C] >= 11) && !func_80A24118(this, globalCtx, 2.0f, &sp20) && - !func_801233E4(globalCtx)) { + !Player_InCsMode(&globalCtx->state)) { func_80A23370(this, sp2C); func_80A260E8(this); sp30 = false; @@ -1259,7 +1262,7 @@ void func_80A26144(ObjIceblock* this, GlobalContext* globalCtx) { func_80A23B88(this); func_80A25BA0(this); } else if (sp28) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); func_80A23B88(this); func_80A25FA0(this); } else { @@ -1495,7 +1498,7 @@ void ObjIceblock_Update(Actor* thisx, GlobalContext* globalCtx) { } func_80A25440(this); - Actor_SetHeight(&this->dyna.actor, this->dyna.actor.shape.yOffset * this->dyna.actor.scale.y); + Actor_SetFocus(&this->dyna.actor, this->dyna.actor.shape.yOffset * this->dyna.actor.scale.y); this->unk_1B0 &= ~0x2; if (parent) {} @@ -1505,10 +1508,10 @@ void func_80A26B64(ObjIceblock* this, GlobalContext* globalCtx) { } void func_80A26B74(ObjIceblock* this, GlobalContext* globalCtx) { - func_800BE03C(globalCtx, object_ice_block_DL_0001A0); + Gfx_DrawDListXlu(globalCtx, object_ice_block_DL_0001A0); if (OBJICEBLOCK_GET_1(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) { AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_0009D0)); - func_800BE03C(globalCtx, object_ice_block_DL_0007F0); + Gfx_DrawDListXlu(globalCtx, object_ice_block_DL_0007F0); } } diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c index 8a5c99a79..433465986 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c @@ -35,7 +35,7 @@ void ObjJgGakki_Init(Actor* thisx, GlobalContext* globalCtx2) { ObjJgGakki* this = THIS; f32 frameCount = Animation_GetLastFrame(&D_0601B1E8); - ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0601B210, NULL, NULL, NULL, 0); if (((globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7)) && diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c index 65a39be35..6782e15eb 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c @@ -57,5 +57,5 @@ void ObjKepnKoya_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjKepnKoya_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06003478); + Gfx_DrawDListOpa(globalCtx, D_06003478); } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index bda43e48d..8558127c8 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -76,7 +76,7 @@ static Gfx* sDisplayLists[] = { gameplay_dangeon_keep_DL_007890, gSmallCrateDL } static InitChainEntry sInitChain[] = { ICHAIN_F32_DIV1000(gravity, -1500, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -18000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -18000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 60, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 60, ICHAIN_STOP), }; @@ -96,7 +96,7 @@ void ObjKibako_SpawnCollectible(ObjKibako* this, GlobalContext* globalCtx) { void ObjKibako_SetShadow(ObjKibako* this) { if ((this->actor.projectedPos.z < 370.0f) && (this->actor.projectedPos.z > -10.0f)) { - this->actor.shape.shadowDraw = func_800B4024; + this->actor.shape.shadowDraw = ActorShadow_DrawSquare; this->actor.shape.shadowScale = 1.4f; this->actor.shape.shadowAlpha = (this->actor.projectedPos.z < 200.0f) ? 100 : (400 - ((s32)this->actor.projectedPos.z)) >> 1; @@ -120,8 +120,8 @@ void func_80926318(ObjKibako* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer < 100.0f) { angle = this->actor.yawTowardsPlayer - GET_PLAYER(globalCtx)->actor.world.rot.y; - if (ABS_ALT(angle) >= 0x5556) { - func_800B8A1C(&this->actor, globalCtx, GI_NONE, 36.0f, 30.0f); + if (ABS_ALT(angle) > 0x5555) { + Actor_PickUp(&this->actor, globalCtx, GI_NONE, 36.0f, 30.0f); } } } @@ -251,7 +251,7 @@ void func_80926B40(ObjKibako* this) { } void func_80926B54(ObjKibako* this, GlobalContext* globalCtx) { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 18.0f, 15.0f, 0.0f, 0x45); if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.draw = ObjKibako_Draw; @@ -275,7 +275,10 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { if (func_800A817C(KIBAKO_COLLECTIBLE_ID(&this->actor))) { ObjKibako_SpawnCollectible(this, globalCtx); } - func_800B8E58(&this->actor, NA_SE_PL_PULL_UP_WOODBOX); + + //! @bug: This function should only pass Player*: it uses *(this + 0x153), which is meant to be + //! player->currentMask, but in this case is garbage in the collider + func_800B8E58((Player*)this, NA_SE_PL_PULL_UP_WOODBOX); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 19.0f)) { ObjKibako_WaterBreak(this, globalCtx); ObjKibako_SpawnCollectible(this, globalCtx); @@ -288,7 +291,7 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); Actor_MarkForDeath(&this->actor); } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); func_809262BC(this); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 18.0f, 15.0f, 0.0f, 0x45); @@ -340,9 +343,9 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) { if (fabsf(this->actor.speedXZ) < 0.1f) { ObjKibako_SetupIdle(this); this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); } else { - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); ObjKibako_SetupThrown(this); this->actor.flags &= ~0x4000000; } @@ -397,7 +400,7 @@ void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) { if (this->actor.velocity.y < -0.05f) { this->actor.gravity = -2.3f; } - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Math_StepToS(&D_80927384, D_80927380, 0xA0); Math_StepToS(&D_8092738C, D_80927388, 0xA0); this->actor.shape.rot.x = (s16)(this->actor.shape.rot.x + D_80927384); @@ -418,5 +421,5 @@ void ObjKibako_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjKibako_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, sDisplayLists[KIBAKO_BANK_INDEX(thisx)]); + Gfx_DrawDListOpa(globalCtx, sDisplayLists[KIBAKO_BANK_INDEX(thisx)]); } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index 6bb1bbdb6..478dd0cf7 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -65,7 +65,7 @@ s32 ObjKibako2_ContainsSkulltula(ObjKibako2* this, GlobalContext* globalCtx) { if ((u16)actorSpawnParam & 3) { flag = ((actorSpawnParam & 0x3FC) >> 2) & 0xFF; } - return !(flag >= 0 && Actor_GetChestFlag(globalCtx, flag)); + return !(flag >= 0 && Flags_GetTreasure(globalCtx, flag)); } void ObjKibako2_Break(ObjKibako2* this, GlobalContext* globalCtx) { @@ -233,7 +233,7 @@ void ObjKibako2_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->skulltulaNoiseTimer >= 0) { if (this->skulltulaNoiseTimer == 0) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EN_STALGOLD_ROLL); if (Rand_ZeroOne() < 0.1f) { this->skulltulaNoiseTimer = Rand_S16Offset(40, 80); } else { @@ -247,5 +247,5 @@ void ObjKibako2_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjKibako2_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, gLargeCrateDL); + Gfx_DrawDListOpa(globalCtx, gLargeCrateDL); } diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index c6fd52f13..481cc22f6 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -31,7 +31,7 @@ const ActorInit Obj_Lift_InitVars = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_8093DD84[] = { ICHAIN_F32_DIV1000(gravity, -600, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -15000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -15000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 350, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 350, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c index 9f4b8c2b0..185361c41 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c @@ -148,7 +148,7 @@ void func_80AF3B8C(ObjLightblock* this) { void func_80AF3BA0(ObjLightblock* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - Actor_SetSwitchFlag(globalCtx, LIGHTBLOCK_DESTROYED(&this->dyna.actor)); + Flags_SetSwitch(globalCtx, LIGHTBLOCK_DESTROYED(&this->dyna.actor)); func_80AF3910(this, globalCtx); func_80AF3C18(this); } else { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index eab5d8f1c..3d8b8d307 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -106,9 +106,9 @@ void ObjLightswitch_UpdateSwitchFlags(ObjLightswitch* this, GlobalContext* globa if (this) {} if (set) { - Actor_SetSwitchFlag(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)); + Flags_SetSwitch(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)); } else { - Actor_UnsetSwitchFlag(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)); + Flags_UnsetSwitch(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)); } } @@ -159,7 +159,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { isSwitchActivated = Flags_GetSwitch(globalCtx, GET_LIGHTSWITCH_SWITCHFLAG(this)); isTriggered = false; Actor_ProcessInitChain(&this->actor, sInitChain); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); if (isSwitchActivated) { if (GET_LIGHTSWITCH_TYPE(this) == LIGHTSWITCH_TYPE_FAKE) { @@ -237,7 +237,7 @@ void ObjLightSwitch_SetupAsleep(ObjLightswitch* this) { void ObjLightSwitch_Asleep(ObjLightswitch* this, GlobalContext* globalCtx) { if (this->colorShiftTimer == 0) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SUN_MARK_FLASH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SUN_MARK_FLASH); } this->colorShiftTimer++; @@ -250,7 +250,7 @@ void ObjLightSwitch_Asleep(ObjLightswitch* this, GlobalContext* globalCtx) { ObjLightSwitch_SetupEnabled(this); } else if (this->colorShiftTimer == 15) { this->faceState = LIGHTSWITCH_FACE_WAKING; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FOOT_SWITCH); } } @@ -308,7 +308,7 @@ void ObjLightSwitch_Disabled(ObjLightswitch* this, GlobalContext* globalCtx) { ObjLightswitch_SetupIdle(this); } else if (this->colorShiftTimer == 15) { this->faceState = LIGHTSWITCH_FACE_ASLEEP; - Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FOOT_SWITCH); } } diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index e864e86b4..c7f49d683 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -43,15 +43,15 @@ void ObjMakeoshihiki_SetSwitchFlags(ObjMakeoshihiki* this, GlobalContext* global switchFlag1 = OBJMAKEOSHIHIKI_GET_SWITCHFLAG_1(this); if (pathIndex & 2) { - Actor_SetSwitchFlag(globalCtx, switchFlag2); + Flags_SetSwitch(globalCtx, switchFlag2); } else { - Actor_UnsetSwitchFlag(globalCtx, switchFlag2); + Flags_UnsetSwitch(globalCtx, switchFlag2); } if (pathIndex & 1) { - Actor_SetSwitchFlag(globalCtx, switchFlag1); + Flags_SetSwitch(globalCtx, switchFlag1); } else { - Actor_UnsetSwitchFlag(globalCtx, switchFlag1); + Flags_UnsetSwitch(globalCtx, switchFlag1); } } diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c index 5af876303..9a614c47d 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c @@ -100,6 +100,6 @@ void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjMilkBin* this = THIS; if (!(this->disableDraw & 1)) { - func_800BDFC0(globalCtx, D_060004B0); + Gfx_DrawDListOpa(globalCtx, D_060004B0); } } diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c index 153a4a914..6bacc6164 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c @@ -78,7 +78,7 @@ void func_80C06640(ObjMoonStone* this, GlobalContext* globalCtx) { s16 sp1A = this->actor.yawTowardsPlayer - 0x8000; sp1A -= player->actor.shape.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.colChkInfo.health = 1; func_801518B0(globalCtx, 0x5E3U, &this->actor); func_80C066F8(this); @@ -95,7 +95,7 @@ void func_80C066F8(ObjMoonStone* this) { } void func_80C0670C(ObjMoonStone* this, GlobalContext* globalCtx) { - if (func_800B867C(&this->actor, globalCtx) != 0) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actor.colChkInfo.health = 0; func_80C0662C(this); } @@ -122,7 +122,7 @@ void func_80C06768(ObjMoonStone* this, GlobalContext* globalCtx) { this->actor.draw = NULL; func_80C0685C(this); } else if (this->actor.xzDistToPlayer < 25.0f) { - func_800B8A1C(&this->actor, globalCtx, GI_MOON_TEAR, 100.0f, 30.0f); + Actor_PickUp(&this->actor, globalCtx, GI_MOON_TEAR, 100.0f, 30.0f); } } } @@ -132,7 +132,7 @@ void func_80C0685C(ObjMoonStone* this) { } void func_80C06870(ObjMoonStone* this, GlobalContext* globalCtx) { - if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { + if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) { gSaveContext.weekEventReg[74] |= 0x40; Actor_MarkForDeath(&this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c index 0e510d6b3..04fe44991 100644 --- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c +++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c @@ -63,7 +63,7 @@ void func_80C06B5C(ObjMuPict* this) { void func_80C06B70(ObjMuPict* this, GlobalContext* globalCtx) { s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; - if (func_800B84D0(&this->actor, globalCtx)) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { if (this->actor.cutscene < 0) { func_80C06DC8(this, globalCtx); func_80C06CC4(this); @@ -98,7 +98,7 @@ void func_80C06CC4(ObjMuPict* this) { } void func_80C06CD8(ObjMuPict* this, GlobalContext* globalCtx) { - switch (func_80152498(&globalCtx->msgCtx)) { + switch (Message_GetState(&globalCtx->msgCtx)) { case 0: case 1: case 2: @@ -122,7 +122,7 @@ void func_80C06CD8(ObjMuPict* this, GlobalContext* globalCtx) { } void func_80C06D90(ObjMuPict* this, GlobalContext* globalCtx) { - Actor* actorPtr = globalCtx->actorCtx.actorList[ACTORCAT_NPC].first; + Actor* actorPtr = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first; while (actorPtr != NULL) { if (actorPtr->id == ACTOR_EN_HGO) { diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c index 041e86982..45bb9ffca 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c @@ -226,7 +226,7 @@ void ObjRaillift_Update(Actor* thisx, GlobalContext* globalCtx) { f32 step; this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->dyna.actor, 10.0f); + Actor_SetFocus(&this->dyna.actor, 10.0f); if (this->cutsceneTimer > 0) { this->cutsceneTimer--; if (this->cutsceneTimer == 0) { @@ -283,12 +283,12 @@ void ObjRaillift_Draw(Actor* thisx, GlobalContext* globalCtx) { The non-colorful platforms are the ones found in Woodfall Temple */ void ObjRaillift_DrawDekuFlowerPlatform(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_06000208); + Gfx_DrawDListOpa(globalCtx, D_06000208); } /* The colorful platforms are the ones found in Deku Palace */ void ObjRaillift_DrawDekuFlowerPlatformColorful(Actor* thisx, GlobalContext* globalCtx) { - func_800BDFC0(globalCtx, D_060071B8); + Gfx_DrawDListOpa(globalCtx, D_060071B8); } diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 01e13e95c..d7f15477a 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -60,7 +60,7 @@ void func_80973CD8(ObjRoomtimer* this, GlobalContext* globalCtx) { } void func_80973D3C(ObjRoomtimer* this, GlobalContext* globalCtx) { - if (Actor_GetRoomClearedTemp(globalCtx, this->actor.room)) { + if (Flags_GetClearTemp(globalCtx, this->actor.room)) { if (this->actor.params != 0x1FF) { gSaveContext.unk_3DD0[4] = 5; } @@ -75,8 +75,8 @@ void func_80973D3C(ObjRoomtimer* this, GlobalContext* globalCtx) { void func_80973DE0(ObjRoomtimer* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - Actor_SetRoomCleared(globalCtx, this->actor.room); - Actor_SetSwitchFlag(globalCtx, this->switchFlag); + Flags_SetClear(globalCtx, this->actor.room); + Flags_SetSwitch(globalCtx, this->switchFlag); if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c index 677ab56b9..7bd1dfc1e 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c @@ -31,7 +31,7 @@ const ActorInit Obj_Skateblock_InitVars = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_80A22AE0[] = { ICHAIN_F32_DIV1000(gravity, -1700, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 150, ICHAIN_CONTINUE), diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c index 088e881ed..9eb0ae99f 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c @@ -444,10 +444,10 @@ void func_80B03FF8(ObjSnowball* this, GlobalContext* globalCtx) { sp18->unk_04(this, globalCtx); } - Audio_PlayActorSound2(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWBALL_BROKEN); if (rotY == 5) { - Actor_SetSwitchFlag(globalCtx, OBJSNOWBALL_GET_3F(&this->actor)); + Flags_SetSwitch(globalCtx, OBJSNOWBALL_GET_3F(&this->actor)); } } @@ -484,7 +484,7 @@ void ObjSnowball_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.textId = 0x238; this->actor.flags |= 1; this->actor.targetArrowOffset = 1400.0f / 3.0f; - Actor_SetHeight(&this->actor, 24.0f); + Actor_SetFocus(&this->actor, 24.0f); this->actor.targetMode = 3; } @@ -575,7 +575,7 @@ void func_80B04350(ObjSnowball* this, GlobalContext* globalCtx) { } else { this->unk_209 = 10; } - Audio_PlayActorSound2(&this->actor, NA_SE_IT_REFLECTION_SNOW); + Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_REFLECTION_SNOW); } } @@ -760,11 +760,11 @@ void ObjSnowball_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.home.rot.y == 1) { if (this->unk_211 != 0) { - if (func_800B867C(&this->actor, globalCtx)) { + if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actor.flags &= ~0x10; this->unk_211 = 0; } - } else if (func_800B84D0(&this->actor, globalCtx)) { + } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { this->actor.flags |= 0x10; this->unk_211 = 1; } else if (this->actor.isTargeted) { @@ -781,10 +781,10 @@ void ObjSnowball_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actor.floorPoly != NULL) && (this->actor.projectedPos.z < 920.0f)) { if (this->actor.projectedPos.z > 400.0f) { this->actor.shape.shadowAlpha = (920 - (s32)this->actor.projectedPos.z) >> 2; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else if (this->actor.projectedPos.z > -30.0f) { this->actor.shape.shadowAlpha = 130; - this->actor.shape.shadowDraw = func_800B3FC0; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else { this->actor.shape.shadowDraw = NULL; } @@ -796,7 +796,7 @@ void ObjSnowball_Update(Actor* thisx, GlobalContext* globalCtx) { void ObjSnowball_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjSnowball* this = THIS; - func_800BDFC0(globalCtx, object_goroiwa_DL_008B90); + Gfx_DrawDListOpa(globalCtx, object_goroiwa_DL_008B90); } void func_80B04D34(Actor* thisx, GlobalContext* globalCtx) { @@ -817,7 +817,7 @@ void func_80B04D34(Actor* thisx, GlobalContext* globalCtx) { Matrix_SetStateRotationAndTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, &sp80); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - func_800BDFC0(globalCtx, object_goroiwa_DL_0082D0); + Gfx_DrawDListOpa(globalCtx, object_goroiwa_DL_0082D0); if ((ptr->unk_28 != NULL) && (ptr->unk_2C > 0)) { OPEN_DISPS(globalCtx->state.gfxCtx); @@ -834,7 +834,7 @@ void func_80B04D34(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_076BC0); + gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c index ea554c4cf..d21acc8b5 100644 --- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c +++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c @@ -45,7 +45,7 @@ static ColliderJntSphInit D_80B3A904 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_80B3A93C[] = { ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_CONTINUE), diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index b88dc23fa..5454c9be3 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -116,7 +116,7 @@ void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { sNumLitTorchesInGroup = 0; } this->flameTexScroll = (u32)(Rand_ZeroOne() * OBJ_SYOKUDAI_SNUFF_DEFAULT); - Actor_SetHeight(thisx, 60.0f); + Actor_SetFocus(thisx, 60.0f); } void ObjSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -146,7 +146,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { if (ActorCutscene_GetCanPlayNext(thisx->cutscene) != 0) { ActorCutscene_StartAndSetUnkLinkFields(thisx->cutscene, thisx); if (this->pendingAction >= OBJ_SYOKUDAI_PENDING_ACTION_CUTSCENE_AND_SWITCH) { - Actor_SetSwitchFlag(globalCtx, switchFlag); + Flags_SetSwitch(globalCtx, switchFlag); } } else { ActorCutscene_SetIntentToPlay(thisx->cutscene); @@ -162,7 +162,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { this->snuffTimer = OBJ_SYOKUDAI_SNUFF_OUT; if (type == OBJ_SYOKUDAI_TYPE_FLAME_CAUSES_SWITCH) { - Actor_UnsetSwitchFlag(globalCtx, switchFlag); + Flags_UnsetSwitch(globalCtx, switchFlag); if (groupSize != 0) { this->snuffTimer = OBJ_SYOKUDAI_SNUFF_GROUP_BY_WATER; } @@ -242,7 +242,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (thisx->cutscene >= 0) { this->pendingAction = OBJ_SYOKUDAI_PENDING_ACTION_CUTSCENE_AND_SWITCH; } else { - Actor_SetSwitchFlag(globalCtx, switchFlag); + Flags_SetSwitch(globalCtx, switchFlag); this->snuffTimer = OBJ_SYOKUDAI_SNUFF_NEVER; } } else { @@ -253,8 +253,8 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { OBJ_SYOKUDAI_SNUFF_TIMER_INITIAL(groupSize) + OBJ_SYOKUDAI_SNUFF_TIMER_JUST_LIT_BONUS; } } - func_801A5CFC(NA_SE_EV_FLAME_IGNITION, &thisx->projectedPos, 4, &D_801DB4B0, &D_801DB4B0, - &D_801DB4B8); + Audio_PlaySfxGeneral(NA_SE_EV_FLAME_IGNITION, &thisx->projectedPos, 4, &D_801DB4B0, &D_801DB4B0, + &D_801DB4B8); } } } diff --git a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c index 7bb44cc94..bf535300b 100644 --- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c +++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c @@ -41,7 +41,7 @@ static ColliderCylinderInit D_809A4CB0 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_809A4D14[] = { - ICHAIN_F32_DIV1000(minVelocityY, 0, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, 0, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 150, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 150, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c index f7710909f..50f879aec 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c @@ -153,7 +153,7 @@ s32 ObjTokeiStep_OpenProcess(ObjTokeiStep* this, GlobalContext* globalCtx) { if (hasPrevBounced && (panel->numBounces < 3) && (panel->startFallingTimer <= 0)) { finalPosY = sPanelXOffsets[i] + this->dyna.actor.world.pos.y; if (!panel->hasSoundPlayed) { - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CLOCK_TOWER_STAIR_MOVE); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CLOCK_TOWER_STAIR_MOVE); panel->hasSoundPlayed = true; } panel->posChangeY += -2.5f; @@ -266,7 +266,7 @@ void ObjTokeiStep_Update(Actor* thisx, GlobalContext* globalCtx) { void ObjTokeiStep_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjTokeiStep* this = THIS; - func_800BDFC0(globalCtx, gClocktowerPanelDL); + Gfx_DrawDListOpa(globalCtx, gClocktowerPanelDL); } void ObjTokeiStep_DrawOpen(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index 729464350..70a144238 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -261,7 +261,7 @@ void ObjTokeidai_RotateOnMinuteChange(ObjTokeidai* this, s32 playSfx) { if (currentMinute != this->clockMinute) { if (this->outerRingOrGearRotationTimer == 8 && playSfx) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND); } if (this->outerRingOrGearRotationTimer > 8) { @@ -297,7 +297,7 @@ void ObjTokeidai_TowerGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) } else { this->actor.shape.rot.x += 0x50; this->actor.shape.rot.z += 0x50; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); } } @@ -307,7 +307,7 @@ void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCt this->actionFunc = ObjTokeidai_TowerGear_Collapse; this->actor.speedXZ = this->actor.scale.y * 5.0f; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = this->actor.scale.y * -50.0f; + this->actor.terminalVelocity = this->actor.scale.y * -50.0f; this->actor.gravity = this->actor.scale.y * -5.0f; } } @@ -323,7 +323,7 @@ void ObjTokeidai_TowerClock_Fall(ObjTokeidai* this, GlobalContext* globalCtx) { this->fallingClockFaceRotationalVelocity -= 5; } this->actor.world.pos.z += 4.0f; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); if (this->actor.world.pos.y < 0.0f) { this->actionFunc = ObjTokeidai_DoNothing; } @@ -357,7 +357,7 @@ void ObjTokeidai_TowerClock_SlideOff(ObjTokeidai* this, GlobalContext* globalCtx } else { thisx->shape.rot.x += this->fallingClockFaceRotationalVelocity; this->actionFunc = ObjTokeidai_TowerClock_Fall; - thisx->minVelocityY = -7.5f; + thisx->terminalVelocity = -7.5f; thisx->gravity = -0.75f; thisx->velocity.y = -2.0f; } @@ -382,7 +382,7 @@ void ObjTokeidai_Counterweight_Collapse(ObjTokeidai* this, GlobalContext* global this->actionFunc = ObjTokeidai_DoNothing; } else { this->xRotation += 0x64; - Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor); + Actor_MoveWithGravity(&this->actor); } } @@ -391,7 +391,7 @@ void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, GlobalContext* glob this->actionFunc = ObjTokeidai_Counterweight_Collapse; this->xRotation = 0; this->actor.velocity.y = 0.0f; - this->actor.minVelocityY = this->actor.scale.y * -50.0f; + this->actor.terminalVelocity = this->actor.scale.y * -50.0f; this->actor.gravity = this->actor.scale.y * -5.0f; } } @@ -478,13 +478,13 @@ void ObjTokeidai_TowerOpening_DropCounterweight(ObjTokeidai* this, GlobalContext this->xRotation = 0x4000; switch (this->boundCount) { case 0: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_0); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_0); break; case 1: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_1); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_1); break; case 2: - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_2); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_2); break; } this->boundCount++; @@ -524,7 +524,7 @@ void ObjTokeidai_TowerOpening_FinishRaise(ObjTokeidai* this, GlobalContext* glob type = OBJ_TOKEIDAI_TYPE(&this->actor); if ((type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN) || (type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_FALL); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_FALL); } this->yTranslation = 3400; this->actionFunc = ObjTokeidai_TowerOpening_DropCounterweight; @@ -548,7 +548,7 @@ void ObjTokeidai_TowerOpening_RaiseTower(ObjTokeidai* this, GlobalContext* globa type = OBJ_TOKEIDAI_TYPE(&this->actor); if ((type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN) || (type == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD)) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_STOP); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_STOP); } this->yTranslation = 3400; this->actionFunc = ObjTokeidai_TowerOpening_FinishRaise; diff --git a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c index 0ffa73331..7b756a10f 100644 --- a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c +++ b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c @@ -144,7 +144,7 @@ void ObTree_SetupSway(ObjTree* this) { this->timer = 0; this->swayAmplitude = 546.0f; this->swayVelocity = 35 * 0x10000 / 360; - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TREE_SWING); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_TREE_SWING); this->actionFunc = ObTree_Sway; } diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 5eac816e2..e91c3387f 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -43,7 +43,7 @@ static ColliderCylinderInit D_809295B0 = { // static InitChainEntry sInitChain[] = { static InitChainEntry D_809295DC[] = { ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(minVelocityY, -20000, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c index 427400f99..ea27c1ad9 100644 --- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c +++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c @@ -51,5 +51,5 @@ void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjVisiblock_Draw(Actor* thisx, GlobalContext* globalCtx) { - func_800BE03C(globalCtx, D_06000140); + Gfx_DrawDListXlu(globalCtx, D_06000140); } diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c index 6e66c9cab..1563ea2fa 100644 --- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c +++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c @@ -71,7 +71,7 @@ void ObjWarpstone_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - Actor_SetHeight(&this->dyna.actor, 40.0f); + Actor_SetFocus(&this->dyna.actor, 40.0f); if (!OBJ_WARPSTONE_IS_ACTIVATED(OBJ_WARPSTONE_GET_ID(this))) { ObjWarpstone_SetupAction(this, ObjWarpstone_ClosedIdle); @@ -102,7 +102,7 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, GlobalContext* globalC if (this->dyna.actor.cutscene < 0 || ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); ObjWarpstone_SetupAction(this, ObjWarpstone_PlayOpeningCutscene); - Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_OWL_WARP_SWITCH_ON); + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_OWL_WARP_SWITCH_ON); } else { ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); } @@ -138,9 +138,9 @@ void ObjWarpstone_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (this->isTalking) { - if (func_800B867C(&this->dyna.actor, globalCtx) != 0) { + if (Actor_TextboxIsClosing(&this->dyna.actor, globalCtx)) { this->isTalking = false; - } else if ((func_80152498(&globalCtx->msgCtx) == 4) && (func_80147624(globalCtx))) { + } else if ((Message_GetState(&globalCtx->msgCtx) == 4) && (func_80147624(globalCtx))) { if (globalCtx->msgCtx.choiceIndex != 0) { func_8019F208(); globalCtx->msgCtx.unk11F22 = 0x4D; @@ -151,11 +151,12 @@ void ObjWarpstone_Update(Actor* thisx, GlobalContext* globalCtx) { func_801477B4(globalCtx); } } - } else if (func_800B84D0(&this->dyna.actor, globalCtx)) { + } else if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state)) { this->isTalking = true; } else if (!this->actionFunc(this, globalCtx)) { func_800B863C(&this->dyna.actor, globalCtx); } + Collider_ResetCylinderAC(globalCtx, &this->collider.base); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -166,7 +167,7 @@ void ObjWarpstone_Draw(Actor* thisx, GlobalContext* globalCtx2) { ObjWarpstone* this = THIS; GlobalContext* globalCtx = globalCtx2; - func_800BDFC0(globalCtx, sOwlStatueDLs[this->modelIndex]); + Gfx_DrawDListOpa(globalCtx, sOwlStatueDLs[this->modelIndex]); if (this->dyna.actor.home.rot.x != 0) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c index 2d8689d4f..3d34f1bf4 100644 --- a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c +++ b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c @@ -69,8 +69,8 @@ void ObjYado_Draw(Actor* thisx, GlobalContext* globalCtx) { } AnimatedMat_Draw(globalCtx, D_80C16470); - func_800BDFC0(globalCtx, D_06000430); - func_800BE03C(globalCtx, D_06000320); + Gfx_DrawDListOpa(globalCtx, D_06000430); + Gfx_DrawDListXlu(globalCtx, D_06000320); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index a98b8e24a..9b36a7e14 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -74,7 +74,7 @@ void Title_Draw(GameState* thisx) { eye.y = 4002.5417f; eye.z = 1119.0837f; - func_800B7FE0(&object, &eye, &lightDir, this->gameState.gfxCtx); + Hilite_DrawOpa(&object, &eye, &lightDir, this->gameState.gfxCtx); gSPSetLights1(POLY_OPA_DISP++, sTitleLights); diff --git a/tools/actorfixer.py b/tools/actorfixer.py index 979106fb3..28b982bc5 100755 --- a/tools/actorfixer.py +++ b/tools/actorfixer.py @@ -51,6 +51,33 @@ animdict = { "func_8012404c": "Player_RemoveMask", "Actor_SpawnWithParentAndCutscene": "Actor_SpawnAsChildAndCutscene", "Actor_SpawnWithParent": "Actor_SpawnAsChild", + "Actor_IsLinkFacingActor": "Player_IsFacingActor", + "Actor_IsActorFacingLink": "Actor_IsFacingPlayer", + "Actor_IsActorFacingLinkAndWithinRange": "Actor_IsFacingAndNearPlayer", + "Actor_IsActorFacingActorAndWithinRange": "Actor_ActorAIsFacingAndNearActorB", + "Actor_IsActorFacingActor": "Actor_ActorAIsFacingActorB", + "Actor_IsActorFacedByActor": "Actor_ActorBIsFacingActorA", + "func_800B84D0": "Actor_ProcessTalkRequest", + "func_8017D668": "Math3D_PointDistToLine2D", + "func_800BDFC0": "Gfx_DrawDListOpa", + "func_800BE03C": "Gfx_DrawDListXlu", + "func_800B6FC8": "Player_GetHeight", + "Actor_InitCurrPosition": "Actor_SetWorldToHome", + "Actor_SetHeight": "Actor_SetFocus", + "Actor_SetRotationFromDrawRotation": "Actor_SetWorldRotToShape", + "Actor_InitDrawRotation": "Actor_SetShapeRotToWorld", + "Actor_CalcOffsetOrientedToDrawRotation": "Actor_OffsetOfPointInActorCoords", + "Actor_ApplyMovement": "Actor_UpdatePos", + "Actor_SetVelocityYRotationAndGravity": "Actor_UpdateVelocityWithGravity", + "Actor_SetVelocityAndMoveYRotationAndGravity": "Actor_MoveWithGravity", + "Actor_SetVelocityXYRotation": "Actor_UpdateVelocityWithoutGravity", + "Actor_SetVelocityAndMoveXYRotation": "Actor_MoveWithoutGravity", + "Actor_SetVelocityXYRotationReverse": "Actor_UpdateVelocityWithoutGravityReverse", + "Actor_SetVelocityAndMoveXYRotationReverse": "Actor_MoveWithoutGravityReverse", + "func_800B6C04": "Actor_SetSpeeds", + "func_800B81E0": "Actor_GetFocus", + "func_800B8214": "Actor_GetWorld", + "func_800B8248": "Actor_GetWorldPosShapeRot", "func_800BE22C": "Actor_ApplyDamage", "func_800F0568": "Audio_PlaySoundAtPosition", "func_8016970C": "Play_CameraSetAtEye", @@ -144,6 +171,53 @@ animdict = { "SkelAnime_CopyVec3s": "SkelAnime_CopyFrameTable", "SysMatrix_StatePop": "Matrix_StatePop", "SysMatrix_GetCurrentState": "Matrix_GetCurrentState", + "Actor_SetObjectSegment": "Actor_SetObjectDependency", + "func_800B3FC0": "ActorShadow_DrawCircle", + "func_800B4024": "ActorShadow_DrawSquare", + "func_800B4088": "ActorShadow_DrawWhiteCircle", + "func_800B40B8": "ActorShadow_DrawHorse", + "func_800B40E0": "ActorShadow_DrawFoot", + "func_800B42F8": "ActorShadow_DrawFeet", + "func_800B4A98": "Actor_SetFeetPos", + "Actor_SetSwitchFlag": "Flags_SetSwitch", + "Actor_UnsetSwitchFlag": "Flags_UnsetSwitch", + "Actor_GetChestFlag": "Flags_GetTreasure", + "Actor_SetChestFlag": "Flags_SetTreasure", + "Actor_SetAllChestFlag": "Flags_SetAllTreasure", + "Actor_GetAllChestFlag": "Flags_GetAllTreasure", + "Actor_GetRoomCleared(": "Flags_GetClear(", + "Actor_SetRoomCleared(": "Flags_SetClear(", + "Actor_UnsetRoomCleared(": "Flags_UnsetClear(", + "Actor_GetRoomClearedTemp(": "Flags_GetClearTemp(", + "Actor_SetRoomClearedTemp(": "Flags_SetClearTemp(", + "Actor_UnsetRoomClearedTemp(": "Flags_UnsetTempClear(", + "Actor_GetCollectibleFlag": "Flags_GetCollectible", + "Actor_SetCollectibleFlag": "Flags_SetCollectible", + "func_800B8A1C": "Actor_PickUp", + "func_800B8B84": "Actor_PickUpNearby", + "func_800B8BB0": "Actor_LiftActor", + "func_800B8BD0": "Actor_PickUpFar", + "func_801A5CFC": "Audio_PlaySfxGeneral", + "func_800BBDAC": "Actor_SpawnFloorDustRing", + "func_800B8708": "Player_GetExchangeItemId", + "func_801233E4": "Player_InCsMode", + "func_800BC4EC": "Actor_TestFloorInDirection", + "func_800BC5B8": "Actor_IsTargeted", + "func_800BC5EC": "Actor_OtherIsTargeted", + "func_800BCB70": "Actor_SetColorFilter", + "func_800BE0B8": "Actor_FindNearby", + "func_800BE258": "Actor_SetDropFlag", + "func_800BE2B8": "Actor_SetDropFlagJntSph", + "Actor_TitleCardCreate": "TitleCard_InitBossName", + "func_800B867C": "Actor_TextboxIsClosing", + "func_800BDC5C": "Actor_ChangeAnimation", + "func_80152498": "Message_GetState", + "func_800B8898": "Actor_GetScreenPos", + "Audio_PlayActorSound2": "Actor_PlaySfxAtPos", + "func_800BF7CC": "Actor_SpawnIceEffects", + "Actor_IsFacingPlayerAndWithinRange": "Actor_IsFacingAndNearPlayer", + "func_800BC8B8": "Actor_DrawDoorLock", + "func_800B86C8": "Actor_ChangeFocus", "zelda_malloc(": "ZeldaArena_Malloc(", "zelda_mallocR(": "ZeldaArena_MallocR(", "zelda_realloc": "ZeldaArena_Realloc", @@ -308,7 +382,8 @@ animdict = { "func_800A81F0": "EffectBlure_AddVertex", "func_800A8514": "EffectBlure_AddSpace", "Effect_GetParams": "Effect_GetByIndex", - + + # Structs members "skelAnime.unk03": "skelAnime.taper", "skelAnime.animCurrentSeg": "skelAnime.animation", "skelAnime.initialFrame": "skelAnime.startFrame", @@ -325,16 +400,30 @@ animdict = { "skelAnime.prevFrameRot": "skelAnime.prevRot", "skelAnime.prevFramePos": "skelAnime.prevTransl", "skelAnime.unk3E": "skelAnime.baseTransl", - "actor.yDistToWater": "actor.depthInWater", + "actor.minVelocityY": "actor.terminalVelocity", + "actor.yDistToWater" : "actor.depthInWater", "actor.yDistToPlayer": "actor.playerHeightRel", - "globalCtx->mf_187FC": "globalCtx->billboardMtxF", - "globalCtx->projectionMatrix": "globalCtx->viewProjectionMtxF", + "globalCtx->mf_187FC" : "globalCtx->billboardMtxF", + "globalCtx->projectionMatrix" : "globalCtx->viewProjectionMtxF", + "player->unk_A87": "player->exchangeItemId", + "player->leftHandActor": "player->heldActor", + "player->unk_384": "player->getItemId", + "player->unk_386": "player->getItemDirection", + "player->unk_388": "player->interactRangeActor", + "player->unk_38C": "player->mountSide", + "player->unk_394": "player->csMode", + "player->unk_A87": "player->exchangeItemId", + "globalCtx->actorCtx.actorList[": "globalCtx->actorCtx.actorLists[", + # Variables "D_0407D590": "gGameplayKeepDrawFlameDL", "D_801D15B0": "gZeroVec3f", "D_801D15BC": "gZeroVec3s", "D_801D1DE0": "gIdentityMtx", "D_801D1E20": "gIdentityMtxF", + + "ICHAIN_F32_DIV1000(minVelocityY,": "ICHAIN_F32_DIV1000(terminalVelocity,", + "ICHAIN_F32(minVelocityY,": "ICHAIN_F32(terminalVelocity,", } def replace_anim(file): diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 5b0e2aff8..ee8d115bb 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -659,42 +659,42 @@ 0x800B3AD0:("Actor_PrintLists",), 0x800B3BA4:("ActorShape_Init",), 0x800B3BC8:("ActorShadow_Draw",), - 0x800B3FC0:("func_800B3FC0",), - 0x800B4024:("func_800B4024",), - 0x800B4088:("func_800B4088",), - 0x800B40B8:("func_800B40B8",), - 0x800B40E0:("func_800B40E0",), - 0x800B42F8:("func_800B42F8",), - 0x800B4A98:("func_800B4A98",), + 0x800B3FC0:("ActorShadow_DrawCircle",), + 0x800B4024:("ActorShadow_DrawSquare",), + 0x800B4088:("ActorShadow_DrawWhiteCircle",), + 0x800B40B8:("ActorShadow_DrawHorse",), + 0x800B40E0:("ActorShadow_DrawFoot",), + 0x800B42F8:("ActorShadow_DrawFeet",), + 0x800B4A98:("Actor_SetFeetPos",), 0x800B4AEC:("func_800B4AEC",), 0x800B4B50:("func_800B4B50",), - 0x800B4EDC:("func_800B4EDC",), - 0x800B4F40:("func_800B4F40",), + 0x800B4EDC:("Actor_GetProjectedPos",), + 0x800B4F40:("Target_SetPos",), 0x800B4F78:("func_800B4F78",), - 0x800B5040:("func_800B5040",), + 0x800B5040:("Target_SetColors",), 0x800B51A4:("Actor_TargetContextInit",), - 0x800B5208:("func_800B5208",), + 0x800B5208:("Actor_DrawZTarget",), 0x800B5814:("func_800B5814",), 0x800B5BB0:("Flags_GetSwitch",), - 0x800B5BF4:("Actor_SetSwitchFlag",), - 0x800B5C34:("Actor_UnsetSwitchFlag",), - 0x800B5C78:("Actor_GetChestFlag",), - 0x800B5C90:("Actor_SetChestFlag",), - 0x800B5CAC:("Actor_SetAllChestFlag",), - 0x800B5CB8:("Actor_GetAllChestFlag",), - 0x800B5CC4:("Actor_GetRoomCleared",), - 0x800B5CDC:("Actor_SetRoomCleared",), - 0x800B5CF8:("Actor_UnsetRoomCleared",), - 0x800B5D18:("Actor_GetRoomClearedTemp",), - 0x800B5D30:("Actor_SetRoomClearedTemp",), - 0x800B5D4C:("Actor_UnsetRoomClearedTemp",), - 0x800B5D6C:("Actor_GetCollectibleFlag",), - 0x800B5DB0:("Actor_SetCollectibleFlag",), - 0x800B5DF0:("Actor_TitleCardContextInit",), - 0x800B5E0C:("Actor_TitleCardCreate",), - 0x800B5E50:("Actor_Nop800B5E50",), - 0x800B5E68:("Actor_TitleCardUpdate",), - 0x800B5F24:("Actor_TitleCardDraw",), + 0x800B5BF4:("Flags_SetSwitch",), + 0x800B5C34:("Flags_UnsetSwitch",), + 0x800B5C78:("Flags_GetTreasure",), + 0x800B5C90:("Flags_SetTreasure",), + 0x800B5CAC:("Flags_SetAllTreasure",), + 0x800B5CB8:("Flags_GetAllTreasure",), + 0x800B5CC4:("Flags_GetClear",), + 0x800B5CDC:("Flags_SetClear",), + 0x800B5CF8:("Flags_UnsetClear",), + 0x800B5D18:("Flags_GetClearTemp",), + 0x800B5D30:("Flags_SetClearTemp",), + 0x800B5D4C:("Flags_UnsetClearTemp",), + 0x800B5D6C:("Flags_GetCollectible",), + 0x800B5DB0:("Flags_SetCollectible",), + 0x800B5DF0:("TitleCard_ContextInit",), + 0x800B5E0C:("TitleCard_InitBossName",), + 0x800B5E50:("TitleCard_InitPlaceName",), + 0x800B5E68:("TitleCard_Update",), + 0x800B5F24:("TitleCard_Draw",), 0x800B6434:("func_800B6434",), 0x800B6468:("func_800B6468",), 0x800B6474:("func_800B6474",), @@ -704,24 +704,24 @@ 0x800B6608:("func_800B6608",), 0x800B6680:("func_800B6680",), 0x800B670C:("Actor_MarkForDeath",), - 0x800B672C:("Actor_InitCurrPosition",), - 0x800B675C:("Actor_SetHeight",), - 0x800B67A0:("Actor_SetRotationFromDrawRotation",), - 0x800B67C0:("Actor_InitDrawRotation",), + 0x800B672C:("Actor_SetWorldToHome",), + 0x800B675C:("Actor_SetFocus",), + 0x800B67A0:("Actor_SetWorldRotToShape",), + 0x800B67C0:("Actor_SetShapeRotToWorld",), 0x800B67E0:("Actor_SetScale",), - 0x800B67FC:("Actor_SetObjectSegment",), - 0x800B6834:("Actor_InitToDefaultValues",), - 0x800B6948:("Actor_FiniActor",), + 0x800B67FC:("Actor_SetObjectDependency",), + 0x800B6834:("Actor_Init",), + 0x800B6948:("Actor_Destroy",), 0x800B6988:("Actor_SetMovementScale",), - 0x800B69AC:("Actor_ApplyMovement",), - 0x800B6A10:("Actor_SetVelocityYRotationAndGravity",), - 0x800B6A88:("Actor_SetVelocityAndMoveYRotationAndGravity",), - 0x800B6AB4:("Actor_SetVelocityXYRotation",), - 0x800B6B24:("Actor_SetVelocityAndMoveXYRotation",), - 0x800B6B50:("Actor_SetVelocityXYRotationReverse",), - 0x800B6BD8:("Actor_SetVelocityAndMoveXYRotationReverse",), - 0x800B6C04:("func_800B6C04",), - 0x800B6C58:("func_800B6C58",), + 0x800B69AC:("Actor_UpdatePos",), + 0x800B6A10:("Actor_UpdateVelocityWithGravity",), + 0x800B6A88:("Actor_MoveWithGravity",), + 0x800B6AB4:("Actor_UpdateVelocityWithoutGravity",), + 0x800B6B24:("Actor_MoveWithoutGravity",), + 0x800B6B50:("Actor_UpdateVelocityWithoutGravityReverse",), + 0x800B6BD8:("Actor_MoveWithoutGravityReverse",), + 0x800B6C04:("Actor_SetSpeeds",), + 0x800B6C58:("Actor_UpdatePosFromSkelAnime",), 0x800B6CD4:("Actor_YawBetweenActors",), 0x800B6D00:("Actor_YawBetweenActorsTop",), 0x800B6D2C:("Actor_YawToPoint",), @@ -732,76 +732,76 @@ 0x800B6DF8:("Actor_DistanceToPoint",), 0x800B6E1C:("Actor_XZDistanceBetweenActors",), 0x800B6E48:("Actor_XZDistanceToPoint",), - 0x800B6E6C:("Actor_CalcOffsetOrientedToDrawRotation",), - 0x800B6F0C:("Actor_YDistance",), + 0x800B6E6C:("Actor_OffsetOfPointInActorCoords",), + 0x800B6F0C:("Actor_HeightDiff",), 0x800B6F20:("func_800B6F20",), - 0x800B6FC8:("func_800B6FC8",), - 0x800B7090:("func_800B7090",), + 0x800B6FC8:("Player_GetHeight",), + 0x800B7090:("Player_GetRunSpeedLimit",), 0x800B7118:("func_800B7118",), 0x800B7128:("func_800B7128",), 0x800B715C:("func_800B715C",), - 0x800B7170:("func_800B7170",), - 0x800B71DC:("func_800B71DC",), + 0x800B7170:("Actor_SetCameraHorseSetting",), + 0x800B71DC:("Actor_MountHorse",), 0x800B7200:("func_800B7200",), 0x800B722C:("func_800B722C",), 0x800B724C:("func_800B724C",), 0x800B7298:("func_800B7298",), 0x800B72E0:("func_800B72E0",), 0x800B72F8:("func_800B72F8",), - 0x800B7320:("Actor_IsLinkFacingActor",), - 0x800B7378:("Actor_IsActorFacedByActor",), - 0x800B73E0:("Actor_IsActorFacingLink",), - 0x800B742C:("Actor_IsActorFacingActor",), - 0x800B748C:("Actor_IsActorFacingLinkAndWithinRange",), - 0x800B750C:("Actor_IsActorFacingActorAndWithinRange",), + 0x800B7320:("Player_IsFacingActor",), + 0x800B7378:("Actor_ActorBIsFacingActorA",), + 0x800B73E0:("Actor_IsFacingPlayer",), + 0x800B742C:("Actor_ActorAIsFacingActorB",), + 0x800B748C:("Actor_IsFacingAndNearPlayer",), + 0x800B750C:("Actor_ActorAIsFacingAndNearActorB",), 0x800B75A0:("func_800B75A0",), 0x800B761C:("func_800B761C",), 0x800B7678:("func_800B7678",), 0x800B78B8:("Actor_UpdateBgCheckInfo",), - 0x800B7E04:("func_800B7E04",), - 0x800B7FE0:("func_800B7FE0",), - 0x800B8018:("func_800B8018",), + 0x800B7E04:("Hilite_Draw",), + 0x800B7FE0:("Hilite_DrawOpa",), + 0x800B8018:("Hilite_DrawXlu",), 0x800B8050:("func_800B8050",), 0x800B8118:("func_800B8118",), - 0x800B81E0:("func_800B81E0",), - 0x800B8214:("func_800B8214",), - 0x800B8248:("func_800B8248",), + 0x800B81E0:("Actor_GetFocus",), + 0x800B8214:("Actor_GetWorld",), + 0x800B8248:("Actor_GetWorldPosShapeRot",), 0x800B82EC:("func_800B82EC",), 0x800B83BC:("func_800B83BC",), 0x800B83F8:("func_800B83F8",), - 0x800B84D0:("func_800B84D0",), + 0x800B84D0:("Actor_ProcessTalkRequest",), 0x800B8500:("func_800B8500",), 0x800B85E0:("func_800B85E0",), 0x800B8614:("func_800B8614",), 0x800B863C:("func_800B863C",), - 0x800B867C:("func_800B867C",), - 0x800B86C8:("func_800B86C8",), - 0x800B8708:("func_800B8708",), + 0x800B867C:("Actor_TextboxIsClosing",), + 0x800B86C8:("Actor_ChangeFocus",), + 0x800B8708:("Player_GetExchangeItemId",), 0x800B8718:("func_800B8718",), 0x800B874C:("func_800B874C",), 0x800B8804:("func_800B8804",), 0x800B882C:("func_800B882C",), 0x800B886C:("func_800B886C",), - 0x800B8898:("func_800B8898",), + 0x800B8898:("Actor_GetScreenPos",), 0x800B8934:("func_800B8934",), 0x800B89F8:("Actor_HasParent",), - 0x800B8A1C:("func_800B8A1C",), - 0x800B8B84:("func_800B8B84",), - 0x800B8BB0:("func_800B8BB0",), - 0x800B8BD0:("func_800B8BD0",), + 0x800B8A1C:("Actor_PickUp",), + 0x800B8B84:("Actor_PickUpNearby",), + 0x800B8BB0:("Actor_LiftActor",), + 0x800B8BD0:("Actor_PickUpFar",), 0x800B8BFC:("Actor_HasNoParent",), 0x800B8C20:("func_800B8C20",), 0x800B8C50:("func_800B8C50",), - 0x800B8C78:("func_800B8C78",), - 0x800B8C9C:("func_800B8C9C",), - 0x800B8CEC:("func_800B8CEC",), + 0x800B8C78:("Actor_HasRider",), + 0x800B8C9C:("Actor_SetRideActor",), + 0x800B8CEC:("Actor_HasNoRider",), 0x800B8D10:("func_800B8D10",), 0x800B8D50:("func_800B8D50",), 0x800B8D98:("func_800B8D98",), 0x800B8DD4:("func_800B8DD4",), 0x800B8E1C:("func_800B8E1C",), 0x800B8E58:("func_800B8E58",), - 0x800B8EC8:("Audio_PlayActorSound2",), + 0x800B8EC8:("Actor_PlaySfxAtPos",), 0x800B8EF4:("func_800B8EF4",), 0x800B8F98:("func_800B8F98",), 0x800B8FC0:("func_800B8FC0",), @@ -813,11 +813,11 @@ 0x800B90AC:("func_800B90AC",), 0x800B90F4:("func_800B90F4",), 0x800B9120:("func_800B9120",), - 0x800B9170:("Actor_Init",), - 0x800B9334:("func_800B9334",), + 0x800B9170:("Actor_InitContext",), + 0x800B9334:("Actor_SpawnSetupActors",), 0x800B948C:("Actor_UpdateActor",), 0x800B9780:("Actor_UpdateAll",), - 0x800B9A04:("Actor_DrawActor",), + 0x800B9A04:("Actor_Draw",), 0x800B9D1C:("func_800B9D1C",), 0x800B9E3C:("Actor_DrawAllSetup",), 0x800B9E4C:("Actor_RecordUndrawnActor",), @@ -829,17 +829,17 @@ 0x800BA6FC:("func_800BA6FC",), 0x800BA798:("func_800BA798",), 0x800BA8B8:("func_800BA8B8",), - 0x800BA9B4:("func_800BA9B4",), - 0x800BAAB4:("Actor_InsertIntoTypeList",), - 0x800BAB24:("Actor_RemoveFromTypeList",), + 0x800BA9B4:("Actor_CleanupContext",), + 0x800BAAB4:("Actor_AddToCategory",), + 0x800BAB24:("Actor_RemoveFromCategory",), 0x800BABFC:("Actor_FreeOverlay",), 0x800BAC60:("Actor_Spawn",), 0x800BACD4:("Actor_LoadOverlay",), 0x800BAE14:("Actor_SpawnAsChildAndCutscene",), 0x800BB0C0:("Actor_SpawnAsChild",), 0x800BB140:("Actor_SpawnTransitionActors",), - 0x800BB2D0:("func_800BB2D0",), - 0x800BB498:("func_800BB498",), + 0x800BB2D0:("Actor_SpawnEntry",), + 0x800BB498:("Actor_Delete",), 0x800BB59C:("func_800BB59C",), 0x800BB604:("func_800BB604",), 0x800BB8EC:("func_800BB8EC",), @@ -847,24 +847,24 @@ 0x800BBAC0:("func_800BBAC0",), 0x800BBB74:("func_800BBB74",), 0x800BBC20:("func_800BBC20",), - 0x800BBCEC:("func_800BBCEC",), - 0x800BBDAC:("func_800BBDAC",), + 0x800BBCEC:("Actor_SpawnBodyParts",), + 0x800BBDAC:("Actor_SpawnFloorDustRing",), 0x800BBFB0:("func_800BBFB0",), 0x800BC154:("func_800BC154",), 0x800BC188:("func_800BC188",), 0x800BC1B4:("func_800BC1B4",), 0x800BC270:("func_800BC270",), 0x800BC444:("func_800BC444",), - 0x800BC4EC:("func_800BC4EC",), - 0x800BC5B8:("func_800BC5B8",), - 0x800BC5EC:("func_800BC5EC",), + 0x800BC4EC:("Actor_TestFloorInDirection",), + 0x800BC5B8:("Actor_IsTargeted",), + 0x800BC5EC:("Actor_OtherIsTargeted",), 0x800BC620:("func_800BC620",), 0x800BC770:("func_800BC770",), 0x800BC7D8:("func_800BC7D8",), 0x800BC848:("func_800BC848",), - 0x800BC8B8:("func_800BC8B8",), - 0x800BCB50:("func_800BCB50",), - 0x800BCB70:("func_800BCB70",), + 0x800BC8B8:("Actor_DrawDoorLock",), + 0x800BCB50:("Actor_SpawnShieldParticlesMetal",), + 0x800BCB70:("Actor_SetColorFilter",), 0x800BCBF4:("func_800BCBF4",), 0x800BCC68:("func_800BCC68",), 0x800BCCDC:("func_800BCCDC",), @@ -877,16 +877,16 @@ 0x800BD9E0:("func_800BD9E0",), 0x800BDAA0:("func_800BDAA0",), 0x800BDB6C:("func_800BDB6C",), - 0x800BDC5C:("func_800BDC5C",), + 0x800BDC5C:("Actor_ChangeAnimation",), 0x800BDCF4:("func_800BDCF4",), 0x800BDFB0:("Actor_Noop",), - 0x800BDFC0:("func_800BDFC0",), - 0x800BE03C:("func_800BE03C",), - 0x800BE0B8:("func_800BE0B8",), + 0x800BDFC0:("Gfx_DrawDListOpa",), + 0x800BE03C:("Gfx_DrawDListXlu",), + 0x800BE0B8:("Actor_FindNearby",), 0x800BE184:("func_800BE184",), 0x800BE22C:("Actor_ApplyDamage",), - 0x800BE258:("func_800BE258",), - 0x800BE2B8:("func_800BE2B8",), + 0x800BE258:("Actor_SetDropFlag",), + 0x800BE2B8:("Actor_SetDropFlagJntSph",), 0x800BE33C:("func_800BE33C",), 0x800BE3D0:("func_800BE3D0",), 0x800BE504:("func_800BE504",), @@ -894,7 +894,7 @@ 0x800BE5CC:("func_800BE5CC",), 0x800BE63C:("func_800BE63C",), 0x800BE680:("func_800BE680",), - 0x800BF7CC:("func_800BF7CC",), + 0x800BF7CC:("Actor_SpawnIceEffects",), 0x800BF9A0:("ActorOverlayTable_FaultPrint",), 0x800BFA78:("ActorOverlayTable_FaultAddrConv",), 0x800BFAE8:("ActorOverlayTable_Init",), @@ -1268,7 +1268,7 @@ 0x800DE9B0:("Camera_Update",), 0x800DF498:("func_800DF498",), 0x800DF4D0:("Camera_SetMode",), - 0x800DF840:("func_800DF840",), + 0x800DF840:("Camera_ChangeMode",), 0x800DF86C:("func_800DF86C",), 0x800DF8EC:("func_800DF8EC",), 0x800DFAC8:("func_800DFAC8",), @@ -2191,7 +2191,7 @@ 0x8012301C:("func_8012301C",), 0x80123140:("func_80123140",), 0x80123358:("func_80123358",), - 0x801233E4:("func_801233E4",), + 0x801233E4:("Player_InCsMode",), 0x80123420:("func_80123420",), 0x80123434:("func_80123434",), 0x80123448:("func_80123448",), @@ -2229,7 +2229,7 @@ 0x801241E0:("func_801241E0",), 0x8012420C:("func_8012420C",), 0x8012422C:("func_8012422C",), - 0x80124258:("func_80124258",), + 0x80124258:("Player_GetExplosiveHeld",), 0x80124278:("func_80124278",), 0x801242B4:("func_801242B4",), 0x801242DC:("func_801242DC",), @@ -2860,7 +2860,7 @@ 0x80151DA4:("func_80151DA4",), 0x80152434:("func_80152434",), 0x80152464:("func_80152464",), - 0x80152498:("func_80152498",), + 0x80152498:("Message_GetState",), 0x8015268C:("func_8015268C",), 0x80152C64:("func_80152C64",), 0x80152CAC:("func_80152CAC",), @@ -3324,7 +3324,7 @@ 0x8017D404:("func_8017D404",), 0x8017D568:("Math3D_TriSetCoords",), 0x8017D618:("Math3D_IsPointInSphere",), - 0x8017D668:("func_8017D668",), + 0x8017D668:("Math3D_PointDistToLine2D",), 0x8017D7C0:("func_8017D7C0",), 0x8017D814:("func_8017D814",), 0x8017D91C:("func_8017D91C",), @@ -4033,7 +4033,7 @@ 0x801A5BD0:("func_801A5BD0",), 0x801A5C28:("func_801A5C28",), 0x801A5C8C:("func_801A5C8C",), - 0x801A5CFC:("func_801A5CFC",), + 0x801A5CFC:("Audio_PlaySfxGeneral",), 0x801A5DDC:("func_801A5DDC",), 0x801A5F7C:("func_801A5F7C",), 0x801A6430:("func_801A6430",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 4f1345a86..60e39862c 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -427,22 +427,20 @@ 0x801AEC74:("sCurrentBit","u32","",0x4), 0x801AEC78:("sTimer","s32","",0x4), 0x801AEC80:("D_801AEC80","Color_RGBA8","",0x4), - 0x801AEC84:("D_801AEC84","s801AEC84","[13]",0x68), + 0x801AEC84:("sTatlColorList","TatlColor","[13]",0x68), 0x801AECEC:("actorMovementScale","f32","",0x4), - 0x801AECF0:("D_801AECF0","f32","",0x4), - 0x801AECF4:("D_801AECF4","f32","",0x4), - 0x801AED48:("D_801AED48","UNK_TYPE1","",0x1), + 0x801AECF0:("gTargetRanges","f32","[]",0x58), + 0x801AED48:("D_801AED48","s16","[8]",0x10), 0x801AED58:("D_801AED58","UNK_TYPE4","",0x4), 0x801AED88:("actorDefaultHitColor","Color_RGBA8","",0x4), 0x801AED8C:("D_801AED8C","UNK_TYPE1","",0x1), - 0x801AED98:("D_801AED98","UNK_TYPE4","",0x4), + 0x801AED98:("D_801AED98","Vec3f","",0xC), 0x801AEDA4:("D_801AEDA4","UNK_TYPE4","",0x4), 0x801AEDB0:("D_801AEDB0","UNK_TYPE1","",0x1), 0x801AEDD4:("D_801AEDD4","UNK_TYPE4","",0x4), 0x801AEE28:("D_801AEE28","UNK_TYPE4","",0x4), 0x801AEE30:("D_801AEE30","UNK_TYPE4","",0x4), - 0x801AEE38:("D_801AEE38","UNK_TYPE4","",0x4), - 0x801AEE4C:("D_801AEE4C","UNK_TYPE2","",0x2), + 0x801AEE38:("D_801AEE38","struct_801AEE38","[14]",0x150), 0x801AEF88:("D_801AEF88","UNK_TYPE1","",0x1), 0x801AEFA0:("D_801AEFA0","UNK_TYPE1","",0x1), 0x801AEFA8:("D_801AEFA8","UNK_TYPE1","",0x1), @@ -3888,7 +3886,7 @@ 0x801E3FB0:("sEffectContext","EffectContext","",0x98E0), 0x801ED890:("D_801ED890","UNK_TYPE1","",0x1), 0x801ED894:("D_801ED894","UNK_TYPE1","",0x1), - 0x801ED8A0:("D_801ED8A0","UNK_TYPE1","",0x1), + 0x801ED8A0:("sActorFaultClient","UNK_TYPE1","",0x1), 0x801ED8B0:("D_801ED8B0","UNK_TYPE1","",0x1), 0x801ED8B4:("D_801ED8B4","UNK_TYPE1","",0x1), 0x801ED8B8:("D_801ED8B8","UNK_TYPE1","",0x1), @@ -3896,7 +3894,7 @@ 0x801ED8C0:("D_801ED8C0","UNK_TYPE1","",0x1), 0x801ED8C4:("D_801ED8C4","UNK_TYPE1","",0x1), 0x801ED8C8:("D_801ED8C8","f32","",0x4), - 0x801ED8CC:("D_801ED8CC","f32","",0x4), + 0x801ED8CC:("sBgmEnemyDistSq","f32","",0x4), 0x801ED8D0:("D_801ED8D0","f32","",0x4), 0x801ED8D4:("D_801ED8D4","UNK_TYPE1","",0x1), 0x801ED8D8:("D_801ED8D8","UNK_TYPE1","",0x1), diff --git a/tools/m2ctx.py b/tools/m2ctx.py index 16087885b..c2e50d59f 100755 --- a/tools/m2ctx.py +++ b/tools/m2ctx.py @@ -41,7 +41,7 @@ def custom_replacements(output): actorList.append(actorListText.replace("first;", f"{actorCats[x]};") + "\n") if x == 2: actorList[x] = actorList[x].replace("Actor*", "Player*") - elif "ActorListEntry actorList[12];" in line: + elif "ActorListEntry actorLists[ACTORCAT_MAX];" in line: output[i] = "struct {\n" + "".join(actorList) + "};" ######################################################## diff --git a/tools/permuter_settings.toml b/tools/permuter_settings.toml index f5805056b..eb2f1ac4b 100644 --- a/tools/permuter_settings.toml +++ b/tools/permuter_settings.toml @@ -13,6 +13,7 @@ SQ = "int" CLAMP = "int" CLOCK_TIME = "int" CURRENT_DAY = "int" +NULL = "int" [decompme.compilers] "tools/ido_recomp/linux/7.1/cc" = "ido7.1" diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 1cfe15819..bfc0f86b8 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -173,42 +173,42 @@ asm/non_matchings/code/z_DLF/Overlay_FreeGameState.s,Overlay_FreeGameState,0x800 asm/non_matchings/code/z_actor/Actor_PrintLists.s,Actor_PrintLists,0x800B3AD0,0x35 asm/non_matchings/code/z_actor/ActorShape_Init.s,ActorShape_Init,0x800B3BA4,0x9 asm/non_matchings/code/z_actor/ActorShadow_Draw.s,ActorShadow_Draw,0x800B3BC8,0xFE -asm/non_matchings/code/z_actor/func_800B3FC0.s,func_800B3FC0,0x800B3FC0,0x19 -asm/non_matchings/code/z_actor/func_800B4024.s,func_800B4024,0x800B4024,0x19 -asm/non_matchings/code/z_actor/func_800B4088.s,func_800B4088,0x800B4088,0xC -asm/non_matchings/code/z_actor/func_800B40B8.s,func_800B40B8,0x800B40B8,0xA -asm/non_matchings/code/z_actor/func_800B40E0.s,func_800B40E0,0x800B40E0,0x86 -asm/non_matchings/code/z_actor/func_800B42F8.s,func_800B42F8,0x800B42F8,0x1E8 -asm/non_matchings/code/z_actor/func_800B4A98.s,func_800B4A98,0x800B4A98,0x15 +asm/non_matchings/code/z_actor/ActorShadow_DrawCircle.s,ActorShadow_DrawCircle,0x800B3FC0,0x19 +asm/non_matchings/code/z_actor/ActorShadow_DrawSquare.s,ActorShadow_DrawSquare,0x800B4024,0x19 +asm/non_matchings/code/z_actor/ActorShadow_DrawWhiteCircle.s,ActorShadow_DrawWhiteCircle,0x800B4088,0xC +asm/non_matchings/code/z_actor/ActorShadow_DrawHorse.s,ActorShadow_DrawHorse,0x800B40B8,0xA +asm/non_matchings/code/z_actor/ActorShadow_DrawFoot.s,ActorShadow_DrawFoot,0x800B40E0,0x86 +asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s,ActorShadow_DrawFeet,0x800B42F8,0x1E8 +asm/non_matchings/code/z_actor/Actor_SetFeetPos.s,Actor_SetFeetPos,0x800B4A98,0x15 asm/non_matchings/code/z_actor/func_800B4AEC.s,func_800B4AEC,0x800B4AEC,0x19 asm/non_matchings/code/z_actor/func_800B4B50.s,func_800B4B50,0x800B4B50,0xE3 -asm/non_matchings/code/z_actor/func_800B4EDC.s,func_800B4EDC,0x800B4EDC,0x19 -asm/non_matchings/code/z_actor/func_800B4F40.s,func_800B4F40,0x800B4F40,0xE +asm/non_matchings/code/z_actor/Actor_GetProjectedPos.s,Actor_GetProjectedPos,0x800B4EDC,0x19 +asm/non_matchings/code/z_actor/Target_SetPos.s,Target_SetPos,0x800B4F40,0xE asm/non_matchings/code/z_actor/func_800B4F78.s,func_800B4F78,0x800B4F78,0x32 -asm/non_matchings/code/z_actor/func_800B5040.s,func_800B5040,0x800B5040,0x59 +asm/non_matchings/code/z_actor/Target_SetColors.s,Target_SetColors,0x800B5040,0x59 asm/non_matchings/code/z_actor/Actor_TargetContextInit.s,Actor_TargetContextInit,0x800B51A4,0x19 -asm/non_matchings/code/z_actor/func_800B5208.s,func_800B5208,0x800B5208,0x183 +asm/non_matchings/code/z_actor/Actor_DrawZTarget.s,Actor_DrawZTarget,0x800B5208,0x183 asm/non_matchings/code/z_actor/func_800B5814.s,func_800B5814,0x800B5814,0xE7 asm/non_matchings/code/z_actor/Flags_GetSwitch.s,Flags_GetSwitch,0x800B5BB0,0x11 -asm/non_matchings/code/z_actor/Actor_SetSwitchFlag.s,Actor_SetSwitchFlag,0x800B5BF4,0x10 -asm/non_matchings/code/z_actor/Actor_UnsetSwitchFlag.s,Actor_UnsetSwitchFlag,0x800B5C34,0x11 -asm/non_matchings/code/z_actor/Actor_GetChestFlag.s,Actor_GetChestFlag,0x800B5C78,0x6 -asm/non_matchings/code/z_actor/Actor_SetChestFlag.s,Actor_SetChestFlag,0x800B5C90,0x7 -asm/non_matchings/code/z_actor/Actor_SetAllChestFlag.s,Actor_SetAllChestFlag,0x800B5CAC,0x3 -asm/non_matchings/code/z_actor/Actor_GetAllChestFlag.s,Actor_GetAllChestFlag,0x800B5CB8,0x3 -asm/non_matchings/code/z_actor/Actor_GetRoomCleared.s,Actor_GetRoomCleared,0x800B5CC4,0x6 -asm/non_matchings/code/z_actor/Actor_SetRoomCleared.s,Actor_SetRoomCleared,0x800B5CDC,0x7 -asm/non_matchings/code/z_actor/Actor_UnsetRoomCleared.s,Actor_UnsetRoomCleared,0x800B5CF8,0x8 -asm/non_matchings/code/z_actor/Actor_GetRoomClearedTemp.s,Actor_GetRoomClearedTemp,0x800B5D18,0x6 -asm/non_matchings/code/z_actor/Actor_SetRoomClearedTemp.s,Actor_SetRoomClearedTemp,0x800B5D30,0x7 -asm/non_matchings/code/z_actor/Actor_UnsetRoomClearedTemp.s,Actor_UnsetRoomClearedTemp,0x800B5D4C,0x8 -asm/non_matchings/code/z_actor/Actor_GetCollectibleFlag.s,Actor_GetCollectibleFlag,0x800B5D6C,0x11 -asm/non_matchings/code/z_actor/Actor_SetCollectibleFlag.s,Actor_SetCollectibleFlag,0x800B5DB0,0x10 -asm/non_matchings/code/z_actor/Actor_TitleCardContextInit.s,Actor_TitleCardContextInit,0x800B5DF0,0x7 -asm/non_matchings/code/z_actor/Actor_TitleCardCreate.s,Actor_TitleCardCreate,0x800B5E0C,0x11 -asm/non_matchings/code/z_actor/Actor_Nop800B5E50.s,Actor_Nop800B5E50,0x800B5E50,0x6 -asm/non_matchings/code/z_actor/Actor_TitleCardUpdate.s,Actor_TitleCardUpdate,0x800B5E68,0x2F -asm/non_matchings/code/z_actor/Actor_TitleCardDraw.s,Actor_TitleCardDraw,0x800B5F24,0x144 +asm/non_matchings/code/z_actor/Flags_SetSwitch.s,Flags_SetSwitch,0x800B5BF4,0x10 +asm/non_matchings/code/z_actor/Flags_UnsetSwitch.s,Flags_UnsetSwitch,0x800B5C34,0x11 +asm/non_matchings/code/z_actor/Flags_GetTreasure.s,Flags_GetTreasure,0x800B5C78,0x6 +asm/non_matchings/code/z_actor/Flags_SetTreasure.s,Flags_SetTreasure,0x800B5C90,0x7 +asm/non_matchings/code/z_actor/Flags_SetAllTreasure.s,Flags_SetAllTreasure,0x800B5CAC,0x3 +asm/non_matchings/code/z_actor/Flags_GetAllTreasure.s,Flags_GetAllTreasure,0x800B5CB8,0x3 +asm/non_matchings/code/z_actor/Flags_GetClear.s,Flags_GetClear,0x800B5CC4,0x6 +asm/non_matchings/code/z_actor/Flags_SetClear.s,Flags_SetClear,0x800B5CDC,0x7 +asm/non_matchings/code/z_actor/Flags_UnsetClear.s,Flags_UnsetClear,0x800B5CF8,0x8 +asm/non_matchings/code/z_actor/Flags_GetClearTemp.s,Flags_GetClearTemp,0x800B5D18,0x6 +asm/non_matchings/code/z_actor/Flags_SetClearTemp.s,Flags_SetClearTemp,0x800B5D30,0x7 +asm/non_matchings/code/z_actor/Flags_UnsetClearTemp.s,Flags_UnsetClearTemp,0x800B5D4C,0x8 +asm/non_matchings/code/z_actor/Flags_GetCollectible.s,Flags_GetCollectible,0x800B5D6C,0x11 +asm/non_matchings/code/z_actor/Flags_SetCollectible.s,Flags_SetCollectible,0x800B5DB0,0x10 +asm/non_matchings/code/z_actor/TitleCard_ContextInit.s,TitleCard_ContextInit,0x800B5DF0,0x7 +asm/non_matchings/code/z_actor/TitleCard_InitBossName.s,TitleCard_InitBossName,0x800B5E0C,0x11 +asm/non_matchings/code/z_actor/TitleCard_InitPlaceName.s,TitleCard_InitPlaceName,0x800B5E50,0x6 +asm/non_matchings/code/z_actor/TitleCard_Update.s,TitleCard_Update,0x800B5E68,0x2F +asm/non_matchings/code/z_actor/TitleCard_Draw.s,TitleCard_Draw,0x800B5F24,0x144 asm/non_matchings/code/z_actor/func_800B6434.s,func_800B6434,0x800B6434,0xD asm/non_matchings/code/z_actor/func_800B6468.s,func_800B6468,0x800B6468,0x3 asm/non_matchings/code/z_actor/func_800B6474.s,func_800B6474,0x800B6474,0x6 @@ -218,24 +218,24 @@ asm/non_matchings/code/z_actor/func_800B6584.s,func_800B6584,0x800B6584,0x21 asm/non_matchings/code/z_actor/func_800B6608.s,func_800B6608,0x800B6608,0x1E asm/non_matchings/code/z_actor/func_800B6680.s,func_800B6680,0x800B6680,0x23 asm/non_matchings/code/z_actor/Actor_MarkForDeath.s,Actor_MarkForDeath,0x800B670C,0x8 -asm/non_matchings/code/z_actor/Actor_InitCurrPosition.s,Actor_InitCurrPosition,0x800B672C,0xC -asm/non_matchings/code/z_actor/Actor_SetHeight.s,Actor_SetHeight,0x800B675C,0x11 -asm/non_matchings/code/z_actor/Actor_SetRotationFromDrawRotation.s,Actor_SetRotationFromDrawRotation,0x800B67A0,0x8 -asm/non_matchings/code/z_actor/Actor_InitDrawRotation.s,Actor_InitDrawRotation,0x800B67C0,0x8 +asm/non_matchings/code/z_actor/Actor_SetWorldToHome.s,Actor_SetWorldToHome,0x800B672C,0xC +asm/non_matchings/code/z_actor/Actor_SetFocus.s,Actor_SetFocus,0x800B675C,0x11 +asm/non_matchings/code/z_actor/Actor_SetWorldRotToShape.s,Actor_SetWorldRotToShape,0x800B67A0,0x8 +asm/non_matchings/code/z_actor/Actor_SetShapeRotToWorld.s,Actor_SetShapeRotToWorld,0x800B67C0,0x8 asm/non_matchings/code/z_actor/Actor_SetScale.s,Actor_SetScale,0x800B67E0,0x7 -asm/non_matchings/code/z_actor/Actor_SetObjectSegment.s,Actor_SetObjectSegment,0x800B67FC,0xE -asm/non_matchings/code/z_actor/Actor_InitToDefaultValues.s,Actor_InitToDefaultValues,0x800B6834,0x45 -asm/non_matchings/code/z_actor/Actor_FiniActor.s,Actor_FiniActor,0x800B6948,0x10 +asm/non_matchings/code/z_actor/Actor_SetObjectDependency.s,Actor_SetObjectDependency,0x800B67FC,0xE +asm/non_matchings/code/z_actor/Actor_Init.s,Actor_Init,0x800B6834,0x45 +asm/non_matchings/code/z_actor/Actor_Destroy.s,Actor_Destroy,0x800B6948,0x10 asm/non_matchings/code/z_actor/Actor_SetMovementScale.s,Actor_SetMovementScale,0x800B6988,0x9 -asm/non_matchings/code/z_actor/Actor_ApplyMovement.s,Actor_ApplyMovement,0x800B69AC,0x19 -asm/non_matchings/code/z_actor/Actor_SetVelocityYRotationAndGravity.s,Actor_SetVelocityYRotationAndGravity,0x800B6A10,0x1E -asm/non_matchings/code/z_actor/Actor_SetVelocityAndMoveYRotationAndGravity.s,Actor_SetVelocityAndMoveYRotationAndGravity,0x800B6A88,0xB -asm/non_matchings/code/z_actor/Actor_SetVelocityXYRotation.s,Actor_SetVelocityXYRotation,0x800B6AB4,0x1C -asm/non_matchings/code/z_actor/Actor_SetVelocityAndMoveXYRotation.s,Actor_SetVelocityAndMoveXYRotation,0x800B6B24,0xB -asm/non_matchings/code/z_actor/Actor_SetVelocityXYRotationReverse.s,Actor_SetVelocityXYRotationReverse,0x800B6B50,0x22 -asm/non_matchings/code/z_actor/Actor_SetVelocityAndMoveXYRotationReverse.s,Actor_SetVelocityAndMoveXYRotationReverse,0x800B6BD8,0xB -asm/non_matchings/code/z_actor/func_800B6C04.s,func_800B6C04,0x800B6C04,0x15 -asm/non_matchings/code/z_actor/func_800B6C58.s,func_800B6C58,0x800B6C58,0x1F +asm/non_matchings/code/z_actor/Actor_UpdatePos.s,Actor_UpdatePos,0x800B69AC,0x19 +asm/non_matchings/code/z_actor/Actor_UpdateVelocityWithGravity.s,Actor_UpdateVelocityWithGravity,0x800B6A10,0x1E +asm/non_matchings/code/z_actor/Actor_MoveWithGravity.s,Actor_MoveWithGravity,0x800B6A88,0xB +asm/non_matchings/code/z_actor/Actor_UpdateVelocityWithoutGravity.s,Actor_UpdateVelocityWithoutGravity,0x800B6AB4,0x1C +asm/non_matchings/code/z_actor/Actor_MoveWithoutGravity.s,Actor_MoveWithoutGravity,0x800B6B24,0xB +asm/non_matchings/code/z_actor/Actor_UpdateVelocityWithoutGravityReverse.s,Actor_UpdateVelocityWithoutGravityReverse,0x800B6B50,0x22 +asm/non_matchings/code/z_actor/Actor_MoveWithoutGravityReverse.s,Actor_MoveWithoutGravityReverse,0x800B6BD8,0xB +asm/non_matchings/code/z_actor/Actor_SetSpeeds.s,Actor_SetSpeeds,0x800B6C04,0x15 +asm/non_matchings/code/z_actor/Actor_UpdatePosFromSkelAnime.s,Actor_UpdatePosFromSkelAnime,0x800B6C58,0x1F asm/non_matchings/code/z_actor/Actor_YawBetweenActors.s,Actor_YawBetweenActors,0x800B6CD4,0xB asm/non_matchings/code/z_actor/Actor_YawBetweenActorsTop.s,Actor_YawBetweenActorsTop,0x800B6D00,0xB asm/non_matchings/code/z_actor/Actor_YawToPoint.s,Actor_YawToPoint,0x800B6D2C,0x9 @@ -246,76 +246,76 @@ asm/non_matchings/code/z_actor/Actor_DistanceBetweenActors.s,Actor_DistanceBetwe asm/non_matchings/code/z_actor/Actor_DistanceToPoint.s,Actor_DistanceToPoint,0x800B6DF8,0x9 asm/non_matchings/code/z_actor/Actor_XZDistanceBetweenActors.s,Actor_XZDistanceBetweenActors,0x800B6E1C,0xB asm/non_matchings/code/z_actor/Actor_XZDistanceToPoint.s,Actor_XZDistanceToPoint,0x800B6E48,0x9 -asm/non_matchings/code/z_actor/Actor_CalcOffsetOrientedToDrawRotation.s,Actor_CalcOffsetOrientedToDrawRotation,0x800B6E6C,0x28 -asm/non_matchings/code/z_actor/Actor_YDistance.s,Actor_YDistance,0x800B6F0C,0x5 +asm/non_matchings/code/z_actor/Actor_OffsetOfPointInActorCoords.s,Actor_OffsetOfPointInActorCoords,0x800B6E6C,0x28 +asm/non_matchings/code/z_actor/Actor_HeightDiff.s,Actor_HeightDiff,0x800B6F0C,0x5 asm/non_matchings/code/z_actor/func_800B6F20.s,func_800B6F20,0x800B6F20,0x2A -asm/non_matchings/code/z_actor/func_800B6FC8.s,func_800B6FC8,0x800B6FC8,0x32 -asm/non_matchings/code/z_actor/func_800B7090.s,func_800B7090,0x800B7090,0x22 +asm/non_matchings/code/z_actor/Player_GetHeight.s,Player_GetHeight,0x800B6FC8,0x32 +asm/non_matchings/code/z_actor/Player_GetRunSpeedLimit.s,Player_GetRunSpeedLimit,0x800B7090,0x22 asm/non_matchings/code/z_actor/func_800B7118.s,func_800B7118,0x800B7118,0x4 asm/non_matchings/code/z_actor/func_800B7128.s,func_800B7128,0x800B7128,0xD asm/non_matchings/code/z_actor/func_800B715C.s,func_800B715C,0x800B715C,0x5 -asm/non_matchings/code/z_actor/func_800B7170.s,func_800B7170,0x800B7170,0x1B -asm/non_matchings/code/z_actor/func_800B71DC.s,func_800B71DC,0x800B71DC,0x9 +asm/non_matchings/code/z_actor/Actor_SetCameraHorseSetting.s,Actor_SetCameraHorseSetting,0x800B7170,0x1B +asm/non_matchings/code/z_actor/Actor_MountHorse.s,Actor_MountHorse,0x800B71DC,0x9 asm/non_matchings/code/z_actor/func_800B7200.s,func_800B7200,0x800B7200,0xB asm/non_matchings/code/z_actor/func_800B722C.s,func_800B722C,0x800B722C,0x8 asm/non_matchings/code/z_actor/func_800B724C.s,func_800B724C,0x800B724C,0x13 asm/non_matchings/code/z_actor/func_800B7298.s,func_800B7298,0x800B7298,0x12 asm/non_matchings/code/z_actor/func_800B72E0.s,func_800B72E0,0x800B72E0,0x6 asm/non_matchings/code/z_actor/func_800B72F8.s,func_800B72F8,0x800B72F8,0xA -asm/non_matchings/code/z_actor/Actor_IsLinkFacingActor.s,Actor_IsLinkFacingActor,0x800B7320,0x16 -asm/non_matchings/code/z_actor/Actor_IsActorFacedByActor.s,Actor_IsActorFacedByActor,0x800B7378,0x1A -asm/non_matchings/code/z_actor/Actor_IsActorFacingLink.s,Actor_IsActorFacingLink,0x800B73E0,0x13 -asm/non_matchings/code/z_actor/Actor_IsActorFacingActor.s,Actor_IsActorFacingActor,0x800B742C,0x18 -asm/non_matchings/code/z_actor/Actor_IsActorFacingLinkAndWithinRange.s,Actor_IsActorFacingLinkAndWithinRange,0x800B748C,0x20 -asm/non_matchings/code/z_actor/Actor_IsActorFacingActorAndWithinRange.s,Actor_IsActorFacingActorAndWithinRange,0x800B750C,0x25 +asm/non_matchings/code/z_actor/Player_IsFacingActor.s,Player_IsFacingActor,0x800B7320,0x16 +asm/non_matchings/code/z_actor/Actor_ActorBIsFacingActorA.s,Actor_ActorBIsFacingActorA,0x800B7378,0x1A +asm/non_matchings/code/z_actor/Actor_IsFacingPlayer.s,Actor_IsFacingPlayer,0x800B73E0,0x13 +asm/non_matchings/code/z_actor/Actor_ActorAIsFacingActorB.s,Actor_ActorAIsFacingActorB,0x800B742C,0x18 +asm/non_matchings/code/z_actor/Actor_IsFacingAndNearPlayer.s,Actor_IsFacingAndNearPlayer,0x800B748C,0x20 +asm/non_matchings/code/z_actor/Actor_ActorAIsFacingAndNearActorB.s,Actor_ActorAIsFacingAndNearActorB,0x800B750C,0x25 asm/non_matchings/code/z_actor/func_800B75A0.s,func_800B75A0,0x800B75A0,0x1F asm/non_matchings/code/z_actor/func_800B761C.s,func_800B761C,0x800B761C,0x17 asm/non_matchings/code/z_actor/func_800B7678.s,func_800B7678,0x800B7678,0x90 asm/non_matchings/code/z_actor/Actor_UpdateBgCheckInfo.s,Actor_UpdateBgCheckInfo,0x800B78B8,0x153 -asm/non_matchings/code/z_actor/func_800B7E04.s,func_800B7E04,0x800B7E04,0x77 -asm/non_matchings/code/z_actor/func_800B7FE0.s,func_800B7FE0,0x800B7FE0,0xE -asm/non_matchings/code/z_actor/func_800B8018.s,func_800B8018,0x800B8018,0xE +asm/non_matchings/code/z_actor/Hilite_Draw.s,Hilite_Draw,0x800B7E04,0x77 +asm/non_matchings/code/z_actor/Hilite_DrawOpa.s,Hilite_DrawOpa,0x800B7FE0,0xE +asm/non_matchings/code/z_actor/Hilite_DrawXlu.s,Hilite_DrawXlu,0x800B8018,0xE asm/non_matchings/code/z_actor/func_800B8050.s,func_800B8050,0x800B8050,0x32 asm/non_matchings/code/z_actor/func_800B8118.s,func_800B8118,0x800B8118,0x32 -asm/non_matchings/code/z_actor/func_800B81E0.s,func_800B81E0,0x800B81E0,0xD -asm/non_matchings/code/z_actor/func_800B8214.s,func_800B8214,0x800B8214,0xD -asm/non_matchings/code/z_actor/func_800B8248.s,func_800B8248,0x800B8248,0x29 +asm/non_matchings/code/z_actor/Actor_GetFocus.s,Actor_GetFocus,0x800B81E0,0xD +asm/non_matchings/code/z_actor/Actor_GetWorld.s,Actor_GetWorld,0x800B8214,0xD +asm/non_matchings/code/z_actor/Actor_GetWorldPosShapeRot.s,Actor_GetWorldPosShapeRot,0x800B8248,0x29 asm/non_matchings/code/z_actor/func_800B82EC.s,func_800B82EC,0x800B82EC,0x34 asm/non_matchings/code/z_actor/func_800B83BC.s,func_800B83BC,0x800B83BC,0xF asm/non_matchings/code/z_actor/func_800B83F8.s,func_800B83F8,0x800B83F8,0x36 -asm/non_matchings/code/z_actor/func_800B84D0.s,func_800B84D0,0x800B84D0,0xC +asm/non_matchings/code/z_actor/Actor_ProcessTalkRequest.s,Actor_ProcessTalkRequest,0x800B84D0,0xC asm/non_matchings/code/z_actor/func_800B8500.s,func_800B8500,0x800B8500,0x38 asm/non_matchings/code/z_actor/func_800B85E0.s,func_800B85E0,0x800B85E0,0xD asm/non_matchings/code/z_actor/func_800B8614.s,func_800B8614,0x800B8614,0xA asm/non_matchings/code/z_actor/func_800B863C.s,func_800B863C,0x800B863C,0x10 -asm/non_matchings/code/z_actor/func_800B867C.s,func_800B867C,0x800B867C,0x13 -asm/non_matchings/code/z_actor/func_800B86C8.s,func_800B86C8,0x800B86C8,0x10 -asm/non_matchings/code/z_actor/func_800B8708.s,func_800B8708,0x800B8708,0x4 +asm/non_matchings/code/z_actor/Actor_TextboxIsClosing.s,Actor_TextboxIsClosing,0x800B867C,0x13 +asm/non_matchings/code/z_actor/Actor_ChangeFocus.s,Actor_ChangeFocus,0x800B86C8,0x10 +asm/non_matchings/code/z_actor/Player_GetExchangeItemId.s,Player_GetExchangeItemId,0x800B8708,0x4 asm/non_matchings/code/z_actor/func_800B8718.s,func_800B8718,0x800B8718,0xD asm/non_matchings/code/z_actor/func_800B874C.s,func_800B874C,0x800B874C,0x2E asm/non_matchings/code/z_actor/func_800B8804.s,func_800B8804,0x800B8804,0xA asm/non_matchings/code/z_actor/func_800B882C.s,func_800B882C,0x800B882C,0x10 asm/non_matchings/code/z_actor/func_800B886C.s,func_800B886C,0x800B886C,0xB -asm/non_matchings/code/z_actor/func_800B8898.s,func_800B8898,0x800B8898,0x27 +asm/non_matchings/code/z_actor/Actor_GetScreenPos.s,Actor_GetScreenPos,0x800B8898,0x27 asm/non_matchings/code/z_actor/func_800B8934.s,func_800B8934,0x800B8934,0x31 asm/non_matchings/code/z_actor/Actor_HasParent.s,Actor_HasParent,0x800B89F8,0x9 -asm/non_matchings/code/z_actor/func_800B8A1C.s,func_800B8A1C,0x800B8A1C,0x5A -asm/non_matchings/code/z_actor/func_800B8B84.s,func_800B8B84,0x800B8B84,0xB -asm/non_matchings/code/z_actor/func_800B8BB0.s,func_800B8BB0,0x800B8BB0,0x8 -asm/non_matchings/code/z_actor/func_800B8BD0.s,func_800B8BD0,0x800B8BD0,0xB +asm/non_matchings/code/z_actor/Actor_PickUp.s,Actor_PickUp,0x800B8A1C,0x5A +asm/non_matchings/code/z_actor/Actor_PickUpNearby.s,Actor_PickUpNearby,0x800B8B84,0xB +asm/non_matchings/code/z_actor/Actor_LiftActor.s,Actor_LiftActor,0x800B8BB0,0x8 +asm/non_matchings/code/z_actor/Actor_PickUpFar.s,Actor_PickUpFar,0x800B8BD0,0xB asm/non_matchings/code/z_actor/Actor_HasNoParent.s,Actor_HasNoParent,0x800B8BFC,0x9 asm/non_matchings/code/z_actor/func_800B8C20.s,func_800B8C20,0x800B8C20,0xC asm/non_matchings/code/z_actor/func_800B8C50.s,func_800B8C50,0x800B8C50,0xA -asm/non_matchings/code/z_actor/func_800B8C78.s,func_800B8C78,0x800B8C78,0x9 -asm/non_matchings/code/z_actor/func_800B8C9C.s,func_800B8C9C,0x800B8C9C,0x14 -asm/non_matchings/code/z_actor/func_800B8CEC.s,func_800B8CEC,0x800B8CEC,0x9 +asm/non_matchings/code/z_actor/Actor_HasRider.s,Actor_HasRider,0x800B8C78,0x9 +asm/non_matchings/code/z_actor/Actor_SetRideActor.s,Actor_SetRideActor,0x800B8C9C,0x14 +asm/non_matchings/code/z_actor/Actor_HasNoRider.s,Actor_HasNoRider,0x800B8CEC,0x9 asm/non_matchings/code/z_actor/func_800B8D10.s,func_800B8D10,0x800B8D10,0x10 asm/non_matchings/code/z_actor/func_800B8D50.s,func_800B8D50,0x800B8D50,0x12 asm/non_matchings/code/z_actor/func_800B8D98.s,func_800B8D98,0x800B8D98,0xF asm/non_matchings/code/z_actor/func_800B8DD4.s,func_800B8DD4,0x800B8DD4,0x12 asm/non_matchings/code/z_actor/func_800B8E1C.s,func_800B8E1C,0x800B8E1C,0xF asm/non_matchings/code/z_actor/func_800B8E58.s,func_800B8E58,0x800B8E58,0x1C -asm/non_matchings/code/z_actor/Audio_PlayActorSound2.s,Audio_PlayActorSound2,0x800B8EC8,0xB +asm/non_matchings/code/z_actor/Actor_PlaySfxAtPos.s,Actor_PlaySfxAtPos,0x800B8EC8,0xB asm/non_matchings/code/z_actor/func_800B8EF4.s,func_800B8EF4,0x800B8EF4,0x29 asm/non_matchings/code/z_actor/func_800B8F98.s,func_800B8F98,0x800B8F98,0xA asm/non_matchings/code/z_actor/func_800B8FC0.s,func_800B8FC0,0x800B8FC0,0xA @@ -327,11 +327,11 @@ asm/non_matchings/code/z_actor/func_800B9098.s,func_800B9098,0x800B9098,0x5 asm/non_matchings/code/z_actor/func_800B90AC.s,func_800B90AC,0x800B90AC,0x12 asm/non_matchings/code/z_actor/func_800B90F4.s,func_800B90F4,0x800B90F4,0xB asm/non_matchings/code/z_actor/func_800B9120.s,func_800B9120,0x800B9120,0x14 -asm/non_matchings/code/z_actor/Actor_Init.s,Actor_Init,0x800B9170,0x71 -asm/non_matchings/code/z_actor/func_800B9334.s,func_800B9334,0x800B9334,0x56 +asm/non_matchings/code/z_actor/Actor_InitContext.s,Actor_InitContext,0x800B9170,0x71 +asm/non_matchings/code/z_actor/Actor_SpawnSetupActors.s,Actor_SpawnSetupActors,0x800B9334,0x56 asm/non_matchings/code/z_actor/Actor_UpdateActor.s,Actor_UpdateActor,0x800B948C,0xBD asm/non_matchings/code/z_actor/Actor_UpdateAll.s,Actor_UpdateAll,0x800B9780,0xA1 -asm/non_matchings/code/z_actor/Actor_DrawActor.s,Actor_DrawActor,0x800B9A04,0xC6 +asm/non_matchings/code/z_actor/Actor_Draw.s,Actor_Draw,0x800B9A04,0xC6 asm/non_matchings/code/z_actor/func_800B9D1C.s,func_800B9D1C,0x800B9D1C,0x48 asm/non_matchings/code/z_actor/Actor_DrawAllSetup.s,Actor_DrawAllSetup,0x800B9E3C,0x4 asm/non_matchings/code/z_actor/Actor_RecordUndrawnActor.s,Actor_RecordUndrawnActor,0x800B9E4C,0xE @@ -343,17 +343,17 @@ asm/non_matchings/code/z_actor/Actor_DrawAll.s,Actor_DrawAll,0x800BA42C,0xB4 asm/non_matchings/code/z_actor/func_800BA6FC.s,func_800BA6FC,0x800BA6FC,0x27 asm/non_matchings/code/z_actor/func_800BA798.s,func_800BA798,0x800BA798,0x48 asm/non_matchings/code/z_actor/func_800BA8B8.s,func_800BA8B8,0x800BA8B8,0x3F -asm/non_matchings/code/z_actor/func_800BA9B4.s,func_800BA9B4,0x800BA9B4,0x40 -asm/non_matchings/code/z_actor/Actor_InsertIntoTypeList.s,Actor_InsertIntoTypeList,0x800BAAB4,0x1C -asm/non_matchings/code/z_actor/Actor_RemoveFromTypeList.s,Actor_RemoveFromTypeList,0x800BAB24,0x36 +asm/non_matchings/code/z_actor/Actor_CleanupContext.s,Actor_CleanupContext,0x800BA9B4,0x40 +asm/non_matchings/code/z_actor/Actor_AddToCategory.s,Actor_AddToCategory,0x800BAAB4,0x1C +asm/non_matchings/code/z_actor/Actor_RemoveFromCategory.s,Actor_RemoveFromCategory,0x800BAB24,0x36 asm/non_matchings/code/z_actor/Actor_FreeOverlay.s,Actor_FreeOverlay,0x800BABFC,0x19 asm/non_matchings/code/z_actor/Actor_Spawn.s,Actor_Spawn,0x800BAC60,0x1D asm/non_matchings/code/z_actor/Actor_LoadOverlay.s,Actor_LoadOverlay,0x800BACD4,0x50 asm/non_matchings/code/z_actor/Actor_SpawnAsChildAndCutscene.s,Actor_SpawnAsChildAndCutscene,0x800BAE14,0xAB asm/non_matchings/code/z_actor/Actor_SpawnAsChild.s,Actor_SpawnAsChild,0x800BB0C0,0x20 asm/non_matchings/code/z_actor/Actor_SpawnTransitionActors.s,Actor_SpawnTransitionActors,0x800BB140,0x64 -asm/non_matchings/code/z_actor/func_800BB2D0.s,func_800BB2D0,0x800BB2D0,0x72 -asm/non_matchings/code/z_actor/func_800BB498.s,func_800BB498,0x800BB498,0x41 +asm/non_matchings/code/z_actor/Actor_SpawnEntry.s,Actor_SpawnEntry,0x800BB2D0,0x72 +asm/non_matchings/code/z_actor/Actor_Delete.s,Actor_Delete,0x800BB498,0x41 asm/non_matchings/code/z_actor/func_800BB59C.s,func_800BB59C,0x800BB59C,0x1A asm/non_matchings/code/z_actor/func_800BB604.s,func_800BB604,0x800BB604,0xBA asm/non_matchings/code/z_actor/func_800BB8EC.s,func_800BB8EC,0x800BB8EC,0x67 @@ -361,24 +361,24 @@ asm/non_matchings/code/z_actor/Enemy_StartFinishingBlow.s,Enemy_StartFinishingBl asm/non_matchings/code/z_actor/func_800BBAC0.s,func_800BBAC0,0x800BBAC0,0x2D asm/non_matchings/code/z_actor/func_800BBB74.s,func_800BBB74,0x800BBB74,0x2B asm/non_matchings/code/z_actor/func_800BBC20.s,func_800BBC20,0x800BBC20,0x33 -asm/non_matchings/code/z_actor/func_800BBCEC.s,func_800BBCEC,0x800BBCEC,0x30 -asm/non_matchings/code/z_actor/func_800BBDAC.s,func_800BBDAC,0x800BBDAC,0x81 +asm/non_matchings/code/z_actor/Actor_SpawnBodyParts.s,Actor_SpawnBodyParts,0x800BBCEC,0x30 +asm/non_matchings/code/z_actor/Actor_SpawnFloorDustRing.s,Actor_SpawnFloorDustRing,0x800BBDAC,0x81 asm/non_matchings/code/z_actor/func_800BBFB0.s,func_800BBFB0,0x800BBFB0,0x69 asm/non_matchings/code/z_actor/func_800BC154.s,func_800BC154,0x800BC154,0xD asm/non_matchings/code/z_actor/func_800BC188.s,func_800BC188,0x800BC188,0xB asm/non_matchings/code/z_actor/func_800BC1B4.s,func_800BC1B4,0x800BC1B4,0x2F asm/non_matchings/code/z_actor/func_800BC270.s,func_800BC270,0x800BC270,0x75 asm/non_matchings/code/z_actor/func_800BC444.s,func_800BC444,0x800BC444,0x2A -asm/non_matchings/code/z_actor/func_800BC4EC.s,func_800BC4EC,0x800BC4EC,0x33 -asm/non_matchings/code/z_actor/func_800BC5B8.s,func_800BC5B8,0x800BC5B8,0xD -asm/non_matchings/code/z_actor/func_800BC5EC.s,func_800BC5EC,0x800BC5EC,0xD +asm/non_matchings/code/z_actor/Actor_TestFloorInDirection.s,Actor_TestFloorInDirection,0x800BC4EC,0x33 +asm/non_matchings/code/z_actor/Actor_IsTargeted.s,Actor_IsTargeted,0x800BC5B8,0xD +asm/non_matchings/code/z_actor/Actor_OtherIsTargeted.s,Actor_OtherIsTargeted,0x800BC5EC,0xD asm/non_matchings/code/z_actor/func_800BC620.s,func_800BC620,0x800BC620,0x54 asm/non_matchings/code/z_actor/func_800BC770.s,func_800BC770,0x800BC770,0x1A asm/non_matchings/code/z_actor/func_800BC7D8.s,func_800BC7D8,0x800BC7D8,0x1C asm/non_matchings/code/z_actor/func_800BC848.s,func_800BC848,0x800BC848,0x1C -asm/non_matchings/code/z_actor/func_800BC8B8.s,func_800BC8B8,0x800BC8B8,0xA6 -asm/non_matchings/code/z_actor/func_800BCB50.s,func_800BCB50,0x800BCB50,0x8 -asm/non_matchings/code/z_actor/func_800BCB70.s,func_800BCB70,0x800BCB70,0x21 +asm/non_matchings/code/z_actor/Actor_DrawDoorLock.s,Actor_DrawDoorLock,0x800BC8B8,0xA6 +asm/non_matchings/code/z_actor/Actor_SpawnShieldParticlesMetal.s,Actor_SpawnShieldParticlesMetal,0x800BCB50,0x8 +asm/non_matchings/code/z_actor/Actor_SetColorFilter.s,Actor_SetColorFilter,0x800BCB70,0x21 asm/non_matchings/code/z_actor/func_800BCBF4.s,func_800BCBF4,0x800BCBF4,0x1D asm/non_matchings/code/z_actor/func_800BCC68.s,func_800BCC68,0x800BCC68,0x1D asm/non_matchings/code/z_actor/func_800BCCDC.s,func_800BCCDC,0x800BCCDC,0x176 @@ -391,16 +391,16 @@ asm/non_matchings/code/z_actor/func_800BD9A0.s,func_800BD9A0,0x800BD9A0,0x10 asm/non_matchings/code/z_actor/func_800BD9E0.s,func_800BD9E0,0x800BD9E0,0x30 asm/non_matchings/code/z_actor/func_800BDAA0.s,func_800BDAA0,0x800BDAA0,0x33 asm/non_matchings/code/z_actor/func_800BDB6C.s,func_800BDB6C,0x800BDB6C,0x3C -asm/non_matchings/code/z_actor/func_800BDC5C.s,func_800BDC5C,0x800BDC5C,0x26 +asm/non_matchings/code/z_actor/Actor_ChangeAnimation.s,Actor_ChangeAnimation,0x800BDC5C,0x26 asm/non_matchings/code/z_actor/func_800BDCF4.s,func_800BDCF4,0x800BDCF4,0xAF asm/non_matchings/code/z_actor/Actor_Noop.s,Actor_Noop,0x800BDFB0,0x4 -asm/non_matchings/code/z_actor/func_800BDFC0.s,func_800BDFC0,0x800BDFC0,0x1F -asm/non_matchings/code/z_actor/func_800BE03C.s,func_800BE03C,0x800BE03C,0x1F -asm/non_matchings/code/z_actor/func_800BE0B8.s,func_800BE0B8,0x800BE0B8,0x33 +asm/non_matchings/code/z_actor/Gfx_DrawDListOpa.s,Gfx_DrawDListOpa,0x800BDFC0,0x1F +asm/non_matchings/code/z_actor/Gfx_DrawDListXlu.s,Gfx_DrawDListXlu,0x800BE03C,0x1F +asm/non_matchings/code/z_actor/Actor_FindNearby.s,Actor_FindNearby,0x800BE0B8,0x33 asm/non_matchings/code/z_actor/func_800BE184.s,func_800BE184,0x800BE184,0x2A asm/non_matchings/code/z_actor/Actor_ApplyDamage.s,Actor_ApplyDamage,0x800BE22C,0xB -asm/non_matchings/code/z_actor/func_800BE258.s,func_800BE258,0x800BE258,0x18 -asm/non_matchings/code/z_actor/func_800BE2B8.s,func_800BE2B8,0x800BE2B8,0x21 +asm/non_matchings/code/z_actor/Actor_SetDropFlag.s,Actor_SetDropFlag,0x800BE258,0x18 +asm/non_matchings/code/z_actor/Actor_SetDropFlagJntSph.s,Actor_SetDropFlagJntSph,0x800BE2B8,0x21 asm/non_matchings/code/z_actor/func_800BE33C.s,func_800BE33C,0x800BE33C,0x25 asm/non_matchings/code/z_actor/func_800BE3D0.s,func_800BE3D0,0x800BE3D0,0x4D asm/non_matchings/code/z_actor/func_800BE504.s,func_800BE504,0x800BE504,0x19 @@ -408,7 +408,7 @@ asm/non_matchings/code/z_actor/func_800BE568.s,func_800BE568,0x800BE568,0x19 asm/non_matchings/code/z_actor/func_800BE5CC.s,func_800BE5CC,0x800BE5CC,0x1C asm/non_matchings/code/z_actor/func_800BE63C.s,func_800BE63C,0x800BE63C,0x11 asm/non_matchings/code/z_actor/func_800BE680.s,func_800BE680,0x800BE680,0x453 -asm/non_matchings/code/z_actor/func_800BF7CC.s,func_800BF7CC,0x800BF7CC,0x75 +asm/non_matchings/code/z_actor/Actor_SpawnIceEffects.s,Actor_SpawnIceEffects,0x800BF7CC,0x75 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultPrint.s,ActorOverlayTable_FaultPrint,0x800BF9A0,0x36 asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_FaultAddrConv.s,ActorOverlayTable_FaultAddrConv,0x800BFA78,0x1C asm/non_matchings/code/z_actor_dlftbls/ActorOverlayTable_Init.s,ActorOverlayTable_Init,0x800BFAE8,0x16 @@ -782,7 +782,7 @@ asm/non_matchings/code/z_camera/func_800DE954.s,func_800DE954,0x800DE954,0x17 asm/non_matchings/code/z_camera/Camera_Update.s,Camera_Update,0x800DE9B0,0x2BA asm/non_matchings/code/z_camera/func_800DF498.s,func_800DF498,0x800DF498,0xE asm/non_matchings/code/z_camera/Camera_SetMode.s,Camera_SetMode,0x800DF4D0,0xDC -asm/non_matchings/code/z_camera/func_800DF840.s,func_800DF840,0x800DF840,0xB +asm/non_matchings/code/z_camera/Camera_ChangeMode.s,Camera_ChangeMode,0x800DF840,0xB asm/non_matchings/code/z_camera/func_800DF86C.s,func_800DF86C,0x800DF86C,0x20 asm/non_matchings/code/z_camera/func_800DF8EC.s,func_800DF8EC,0x800DF8EC,0x77 asm/non_matchings/code/z_camera/func_800DFAC8.s,func_800DFAC8,0x800DFAC8,0x13 @@ -1705,7 +1705,7 @@ asm/non_matchings/code/z_player_lib/func_8012300C.s,func_8012300C,0x8012300C,0x4 asm/non_matchings/code/z_player_lib/func_8012301C.s,func_8012301C,0x8012301C,0x49 asm/non_matchings/code/z_player_lib/func_80123140.s,func_80123140,0x80123140,0x86 asm/non_matchings/code/z_player_lib/func_80123358.s,func_80123358,0x80123358,0x23 -asm/non_matchings/code/z_player_lib/func_801233E4.s,func_801233E4,0x801233E4,0xF +asm/non_matchings/code/z_player_lib/Player_InCsMode.s,Player_InCsMode,0x801233E4,0xF asm/non_matchings/code/z_player_lib/func_80123420.s,func_80123420,0x80123420,0x5 asm/non_matchings/code/z_player_lib/func_80123434.s,func_80123434,0x80123434,0x5 asm/non_matchings/code/z_player_lib/func_80123448.s,func_80123448,0x80123448,0x1A @@ -1743,7 +1743,7 @@ asm/non_matchings/code/z_player_lib/func_801241B4.s,func_801241B4,0x801241B4,0xB asm/non_matchings/code/z_player_lib/func_801241E0.s,func_801241E0,0x801241E0,0xB asm/non_matchings/code/z_player_lib/func_8012420C.s,func_8012420C,0x8012420C,0x8 asm/non_matchings/code/z_player_lib/func_8012422C.s,func_8012422C,0x8012422C,0xB -asm/non_matchings/code/z_player_lib/func_80124258.s,func_80124258,0x80124258,0x8 +asm/non_matchings/code/z_player_lib/Player_GetExplosiveHeld.s,Player_GetExplosiveHeld,0x80124258,0x8 asm/non_matchings/code/z_player_lib/func_80124278.s,func_80124278,0x80124278,0xF asm/non_matchings/code/z_player_lib/func_801242B4.s,func_801242B4,0x801242B4,0xA asm/non_matchings/code/z_player_lib/func_801242DC.s,func_801242DC,0x801242DC,0x51 @@ -2374,7 +2374,7 @@ asm/non_matchings/code/z_message/func_80151C9C.s,func_80151C9C,0x80151C9C,0x42 asm/non_matchings/code/z_message/func_80151DA4.s,func_80151DA4,0x80151DA4,0x1A4 asm/non_matchings/code/z_message/func_80152434.s,func_80152434,0x80152434,0xC asm/non_matchings/code/z_message/func_80152464.s,func_80152464,0x80152464,0xD -asm/non_matchings/code/z_message/func_80152498.s,func_80152498,0x80152498,0x7D +asm/non_matchings/code/z_message/Message_GetState.s,Message_GetState,0x80152498,0x7D asm/non_matchings/code/z_message/func_8015268C.s,func_8015268C,0x8015268C,0x176 asm/non_matchings/code/z_message/func_80152C64.s,func_80152C64,0x80152C64,0x12 asm/non_matchings/code/z_message/func_80152CAC.s,func_80152CAC,0x80152CAC,0x85 @@ -2838,7 +2838,7 @@ asm/non_matchings/code/sys_math3d/func_8017D2FC.s,func_8017D2FC,0x8017D2FC,0x42 asm/non_matchings/code/sys_math3d/func_8017D404.s,func_8017D404,0x8017D404,0x59 asm/non_matchings/code/sys_math3d/Math3D_TriSetCoords.s,Math3D_TriSetCoords,0x8017D568,0x2C asm/non_matchings/code/sys_math3d/Math3D_IsPointInSphere.s,Math3D_IsPointInSphere,0x8017D618,0x14 -asm/non_matchings/code/sys_math3d/func_8017D668.s,func_8017D668,0x8017D668,0x56 +asm/non_matchings/code/sys_math3d/Math3D_PointDistToLine2D.s,Math3D_PointDistToLine2D,0x8017D668,0x56 asm/non_matchings/code/sys_math3d/func_8017D7C0.s,func_8017D7C0,0x8017D7C0,0x15 asm/non_matchings/code/sys_math3d/func_8017D814.s,func_8017D814,0x8017D814,0x42 asm/non_matchings/code/sys_math3d/func_8017D91C.s,func_8017D91C,0x8017D91C,0x42 @@ -3551,7 +3551,7 @@ asm/non_matchings/code/code_801A51F0/func_801A5A1C.s,func_801A5A1C,0x801A5A1C,0x asm/non_matchings/code/code_801A5BD0/func_801A5BD0.s,func_801A5BD0,0x801A5BD0,0x16 asm/non_matchings/code/code_801A5BD0/func_801A5C28.s,func_801A5C28,0x801A5C28,0x19 asm/non_matchings/code/code_801A5BD0/func_801A5C8C.s,func_801A5C8C,0x801A5C8C,0x1C -asm/non_matchings/code/code_801A5BD0/func_801A5CFC.s,func_801A5CFC,0x801A5CFC,0x38 +asm/non_matchings/code/code_801A5BD0/Audio_PlaySfxGeneral.s,Audio_PlaySfxGeneral,0x801A5CFC,0x38 asm/non_matchings/code/code_801A5BD0/func_801A5DDC.s,func_801A5DDC,0x801A5DDC,0x68 asm/non_matchings/code/code_801A5BD0/func_801A5F7C.s,func_801A5F7C,0x801A5F7C,0x12D asm/non_matchings/code/code_801A5BD0/func_801A6430.s,func_801A6430,0x801A6430,0x66 diff --git a/undefined_syms.txt b/undefined_syms.txt index 5fe1bfcac..9cca916c0 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -403,7 +403,6 @@ D_0401A590 = 0x0401A590; D_0401A620 = 0x0401A620; D_0401ACF0 = 0x0401ACF0; D_0401ED00 = 0x0401ED00; -D_0401F0F0 = 0x0401F0F0; D_0401F740 = 0x0401F740; D_0401F7C0 = 0x0401F7C0; D_0401F8C0 = 0x0401F8C0; @@ -521,14 +520,11 @@ D_04073F00 = 0x04073F00; D_04074330 = 0x04074330; D_04075400 = 0x04075400; D_04075A40 = 0x04075A40; -D_04075B30 = 0x04075B30; D_04076BC0 = 0x04076BC0; -D_04077480 = 0x04077480; D_04079B10 = 0x04079B10; D_0407AB10 = 0x0407AB10; D_0407AB58 = 0x0407AB58; D_0407AB70 = 0x0407AB70; -D_0407AE00 = 0x0407AE00; D_0407AFB0 = 0x0407AFB0; D_0407D590 = 0x0407D590; D_0407D650 = 0x0407D650; @@ -549,6 +545,10 @@ D_0408F3E0 = 0x0408F3E0; D_0408F7E0 = 0x0408F7E0; D_04091BE0 = 0x04091BE0; D_04091CE0 = 0x04091CE0; +D_04091DE0 = 0x04091DE0; +D_04091FE0 = 0x04091FE0; +D_040921E0 = 0x040921E0; +D_040923E0 = 0x040923E0; // segment 0x05