From e61e67ea9bb49554bf5c2907dfbe5b2c3fb59bd2 Mon Sep 17 00:00:00 2001 From: pixel-stuck Date: Tue, 15 Jun 2021 04:05:16 -0400 Subject: [PATCH] [WIP] Work on npc.c (#295) * formatting * format + misc work * lots of work on npc.c * PR comments, asm delet + other misc fixes * missed one * temporarily remove cleanup step for testing * test fix for splat * test * o2 * o0 * fix Yay0decompress.c bug * debug logging * stuff * stuff2 * restore stuff * more PR comments and some general cleanup * NPC flags + improve match + misc Co-authored-by: Ethan Roseman --- Jenkinsfile | 10 +- include/common_structs.h | 44 +- include/enums.h | 6 +- include/functions.h | 20 +- include/map.h | 3 +- include/variables.h | 2 +- src/102C80.c | 3 +- src/104940_len_dc0.c | 4 +- src/105700_len_2130.c | 2 +- src/109660_len_1270.c | 3 +- src/121f0_len_1290.c | 3 +- src/1AC760.c | 6 +- src/1b40_len_20b0.c | 3 +- src/1f580_len_1940.c | 4 +- src/23680.c | 5 +- src/28910_len_5090.c | 4 +- src/2e230_len_2190.c | 13 +- src/325AD0.c | 2 +- src/415D90.c | 20 +- src/43F0.c | 17 +- src/4ac90_len_3910.c | 13 +- src/7bb60_len_41b0.c | 16 +- src/C50A0.c | 2 +- src/DF950.c | 6 +- src/a5dd0_len_114e0.c | 14 +- src/battle/area_dig/6DE4A0.c | 2 +- src/battle/item/food/lib.c | 2 +- src/common/BattleAreaAngleStuff.inc.c | 2 +- src/entity.c | 2 +- src/evt/map_api.c | 6 +- src/evt/msg_api.c | 6 +- src/evt/npc_api.c | 8 +- src/npc.c | 1341 +++++++++++++++-- src/npc.h | 128 +- src/os/3f6d0_len_320.c | 2 +- src/pause/pause_items.c | 2 +- src/sprite.c | 23 +- src/world/action/16.c | 3 +- src/world/area_arn/arn_02/events.c | 25 +- src/world/area_arn/arn_02/header.c | 3 +- src/world/area_arn/arn_03/events.c | 47 +- src/world/area_arn/arn_03/header.c | 3 +- src/world/area_arn/arn_04/events.c | 56 +- src/world/area_arn/arn_04/header.c | 3 +- src/world/area_arn/arn_05/events.c | 37 +- src/world/area_arn/arn_05/header.c | 3 +- src/world/area_arn/arn_07/BECDF0.c | 5 +- src/world/area_arn/arn_07/events.c | 27 +- src/world/area_arn/arn_07/header.c | 3 +- src/world/area_arn/arn_08/BF47A0.c | 6 +- src/world/area_arn/arn_08/events.c | 10 +- src/world/area_arn/arn_08/header.c | 3 +- src/world/area_arn/arn_09/events.c | 2 +- src/world/area_arn/arn_09/header.c | 3 +- src/world/area_arn/arn_10/events.c | 2 +- src/world/area_arn/arn_10/header.c | 3 +- src/world/area_arn/arn_11/header.c | 3 +- src/world/area_arn/arn_12/events.c | 2 +- src/world/area_arn/arn_12/header.c | 3 +- src/world/area_arn/arn_13/events.c | 2 +- src/world/area_arn/arn_13/header.c | 3 +- src/world/area_dgb/dgb_00/BFA0A0.c | 8 +- src/world/area_dgb/dgb_00/BFA100.c | 5 +- src/world/area_dgb/dgb_01/BFD9A0.c | 68 +- src/world/area_dgb/dgb_02/C2EBA0.c | 77 +- src/world/area_dgb/dgb_03/C31730.c | 95 +- src/world/area_dgb/dgb_04/C36530.c | 73 +- src/world/area_dgb/dgb_05/C3AA10.c | 81 +- src/world/area_dgb/dgb_06/C3D080.c | 9 +- src/world/area_dgb/dgb_07/C3DBF0.c | 77 +- src/world/area_dgb/dgb_08/C3FDB0.c | 84 +- src/world/area_dgb/dgb_09/C46BE0.c | 127 +- src/world/area_dgb/dgb_10/C4C390.c | 15 +- src/world/area_dgb/dgb_11/C4D3E0.c | 3 +- src/world/area_dgb/dgb_12/C4DEF0.c | 3 +- src/world/area_dgb/dgb_13/C4E960.c | 3 +- src/world/area_dgb/dgb_14/C4F030.c | 3 +- src/world/area_dgb/dgb_15/C4F510.c | 24 +- src/world/area_dgb/dgb_16/C52540.c | 85 +- src/world/area_dgb/dgb_17/C55A60.c | 3 +- src/world/area_dgb/dgb_18/C55F40.c | 21 +- src/world/area_dro/dro_01/95B7E0.c | 183 ++- src/world/area_dro/dro_02/9694C0.c | 116 +- src/world/area_flo/flo_00/C9DF20.c | 2 +- src/world/area_flo/flo_00/C9DF60.c | 87 +- src/world/area_flo/flo_00/C9EE30.c | 12 +- src/world/area_flo/flo_03/CA72E0.c | 46 +- src/world/area_flo/flo_07/CAC5D0.c | 45 +- src/world/area_flo/flo_08/CAED40.c | 12 +- src/world/area_flo/flo_08/CAFAC0.c | 68 +- src/world/area_flo/flo_09/CB50E0.c | 7 +- src/world/area_flo/flo_09/CB5320.c | 23 +- src/world/area_flo/flo_10/CB9280.c | 32 +- src/world/area_flo/flo_10/CB96B0.c | 32 +- src/world/area_flo/flo_11/CBDCD0.c | 21 +- src/world/area_flo/flo_12/CC0E70.c | 33 +- src/world/area_flo/flo_13/CC3850.c | 141 +- src/world/area_flo/flo_13/CC6DE0.c | 2 +- src/world/area_flo/flo_14/CCB310.c | 29 +- src/world/area_flo/flo_14/CCBE20.c | 25 +- src/world/area_flo/flo_14/CCD670.c | 2 +- src/world/area_flo/flo_15/CD06C0.c | 15 +- src/world/area_flo/flo_16/CD1F10.c | 17 +- src/world/area_flo/flo_16/CD2C80.c | 27 +- src/world/area_flo/flo_16/CD4770.c | 4 +- src/world/area_flo/flo_17/CD7320.c | 2 +- src/world/area_flo/flo_17/CD7350.c | 88 +- src/world/area_flo/flo_18/CDC6A0.c | 89 +- src/world/area_flo/flo_19/CE36F0.c | 18 +- src/world/area_flo/flo_21/CE6700.c | 18 +- src/world/area_flo/flo_22/CEC240.c | 6 +- src/world/area_flo/flo_23/CEE260.c | 2 +- src/world/area_flo/flo_23/CEE2A0.c | 50 +- src/world/area_flo/flo_25/CF2BD0.c | 2 +- src/world/area_flo/flo_25/CF2C10.c | 52 +- src/world/area_kmr/kmr_03/8C8140.c | 6 +- src/world/area_kmr/kmr_12/events.c | 2 +- src/world/area_kpa/kpa_12/A54CA0.c | 2 +- src/world/area_kpa/kpa_13/A56270.c | 2 +- src/world/area_kpa/kpa_14/A57830.c | 2 +- src/world/common/CamSetFOV.inc.c | 2 +- src/world/common/DeadUnkNpcAIFunc14.inc.c | 2 +- src/world/common/DoesPlayerNeedSleep.inc.c | 2 +- src/world/common/GetFloorCollider.inc.c | 2 +- src/world/common/NpcJumpFunc2.inc.c | 2 +- src/world/common/UnkFunc10.inc.c | 10 +- src/world/common/UnkFunc11.inc.c | 2 +- src/world/common/UnkFunc12.inc.c | 2 +- src/world/common/UnkFunc15.inc.c | 2 +- src/world/common/UnkFunc15_copy.inc.c | 2 +- src/world/common/UnkFunc16.inc.c | 2 +- src/world/common/UnkFunc16_copy.inc.c | 2 +- src/world/common/UnkFunc17.inc.c | 2 +- src/world/common/UnkFunc18.inc.c | 4 +- src/world/common/UnkFunc19.inc.c | 2 +- src/world/common/UnkFunc20.inc.c | 9 +- src/world/common/UnkFunc21.inc.c | 2 +- src/world/common/UnkFunc22.inc.c | 4 +- src/world/common/UnkFunc23.inc.c | 4 +- src/world/common/UnkFunc24.inc.c | 2 +- src/world/common/UnkFunc26.inc.c | 4 +- src/world/common/UnkFunc27.inc.c | 4 +- src/world/common/UnkFunc31.inc.c | 6 +- src/world/common/UnkFunc32.inc.c | 2 +- src/world/common/UnkFunc35.inc.c | 2 +- src/world/common/UnkFunc36.inc.c | 2 +- src/world/common/UnkFunc39.inc.c | 2 +- src/world/common/UnkFunc4.inc.c | 3 +- src/world/common/UnkFunc40.inc.c | 2 +- src/world/common/UnkFunc42.inc.c | 2 +- src/world/common/UnkFunc43.inc.c | 2 +- src/world/common/UnkFunc44.inc.c | 4 +- src/world/common/UnkFunc45.inc.c | 2 +- src/world/common/UnkFunc5.inc.c | 2 +- src/world/common/UnkFunc6.inc.c | 2 +- src/world/common/UnkFunc7.inc.c | 4 +- src/world/common/UnkFunc8.inc.c | 2 +- src/world/common/UnkFunc9.inc.c | 5 +- src/world/common/UnkNpcAIFunc1.inc.c | 2 +- src/world/common/UnkNpcAIFunc11.inc.c | 2 +- src/world/common/UnkNpcAIFunc12.inc.c | 2 +- src/world/common/UnkNpcAIFunc13.inc.c | 2 +- src/world/common/UnkNpcAIFunc13_2.inc.c | 2 +- src/world/common/UnkNpcAIFunc14.inc.c | 2 +- src/world/common/UnkNpcAIFunc16.inc.c | 2 +- src/world/common/UnkNpcAIFunc17.inc.c | 2 +- src/world/common/UnkNpcAIFunc18.inc.c | 2 +- src/world/common/UnkNpcAIFunc19.inc.c | 2 +- src/world/common/UnkNpcAIFunc1_copy.inc.c | 2 +- src/world/common/UnkNpcAIFunc2.inc.c | 2 +- src/world/common/UnkNpcAIFunc21.inc.c | 2 +- src/world/common/UnkNpcAIFunc22.inc.c | 2 +- src/world/common/UnkNpcAIFunc6.inc.c | 2 +- src/world/common/UnkNpcAIFunc7.inc.c | 2 +- src/world/common/UnkNpcAIFunc8.inc.c | 2 +- src/world/common/UnkNpcAIFunc9.inc.c | 2 +- src/world/common/foliage.inc.c | 274 ++-- src/world/common/reflection.inc.c | 11 +- .../common/set_script_owner_npc_anim.inc.c | 2 +- .../set_script_owner_npc_col_height.inc.c | 3 +- src/world/partner/goombario.c | 2 +- src/world/script_api/7E0E80.c | 2 +- src/world/world.c | 15 +- tools/splat/Makefile | 2 +- tools/splat/split.py | 4 +- tools/splat/util/n64/Yay0decompress.c | 3 +- tools/splat_ext/PaperMarioNpcSprites.py | 12 +- tools/update_symbol_addrs.py | 2 - ver/us/asm/nonmatchings/npc/bind_enemy_ai.s | 31 - ver/us/asm/nonmatchings/npc/bind_enemy_aux.s | 31 - .../nonmatchings/npc/bind_enemy_interact.s | 31 - ver/us/asm/nonmatchings/npc/bind_npc_ai.s | 61 - ver/us/asm/nonmatchings/npc/bind_npc_aux.s | 61 - .../asm/nonmatchings/npc/bind_npc_interact.s | 61 - ver/us/asm/nonmatchings/npc/func_8003B184.s | 9 - ver/us/asm/nonmatchings/npc/func_8003B198.s | 8 - ver/us/asm/nonmatchings/npc/func_8003B1B0.s | 113 -- ver/us/asm/nonmatchings/npc/func_8003B3D0.s | 15 - ver/us/asm/nonmatchings/npc/func_8003B3F8.s | 15 - ver/us/asm/nonmatchings/npc/func_8003B420.s | 16 - ver/us/asm/nonmatchings/npc/func_8003B500.s | 52 - ver/us/asm/nonmatchings/npc/func_8003C3D8.s | 24 - ver/us/asm/nonmatchings/npc/func_8003C428.s | 11 - ver/us/asm/nonmatchings/npc/func_8003C53C.s | 76 - ver/us/asm/nonmatchings/npc/func_8003C61C.s | 20 - ver/us/asm/nonmatchings/npc/func_8003C78C.s | 11 - ver/us/asm/nonmatchings/npc/func_8003C7A8.s | 75 - ver/us/asm/nonmatchings/npc/func_8003C8B4.s | 59 - ver/us/asm/nonmatchings/npc/func_8003C984.s | 13 - ver/us/asm/nonmatchings/npc/func_8003C9A8.s | 117 -- ver/us/asm/nonmatchings/npc/func_8003CB20.s | 13 - ver/us/asm/nonmatchings/npc/func_8003CB44.s | 89 -- ver/us/asm/nonmatchings/npc/func_8003CC8C.s | 13 - ver/us/asm/nonmatchings/npc/func_8003CCB0.s | 203 --- ver/us/asm/nonmatchings/npc/func_8003CFA8.s | 7 - ver/us/asm/nonmatchings/npc/func_8003D2F8.s | 56 - ver/us/asm/nonmatchings/npc/func_8003D624.s | 19 - ver/us/asm/nonmatchings/npc/func_8003D788.s | 182 --- ver/us/asm/nonmatchings/npc/get_enemy.s | 43 - ver/us/asm/nonmatchings/npc/get_npc_safe.s | 30 - ver/us/asm/nonmatchings/npc/get_npc_unsafe.s | 32 - ver/us/asm/nonmatchings/npc/kill_encounter.s | 38 - ver/us/asm/nonmatchings/npc/npc_create.s | 190 --- .../nonmatchings/npc/npc_do_world_collision.s | 348 ----- ver/us/asm/nonmatchings/npc/npc_free.s | 79 - .../asm/nonmatchings/npc/npc_free_by_index.s | 85 -- ver/us/asm/nonmatchings/npc/npc_list_clear.s | 35 - ver/us/asm/nonmatchings/npc/npc_list_render.s | 175 --- .../nonmatchings/npc/npc_update_decorations.s | 75 - ver/us/symbol_addrs.txt | 2 +- ver/us/undefined_syms_auto.txt | 2 +- 231 files changed, 3016 insertions(+), 4283 deletions(-) delete mode 100644 ver/us/asm/nonmatchings/npc/bind_enemy_ai.s delete mode 100644 ver/us/asm/nonmatchings/npc/bind_enemy_aux.s delete mode 100644 ver/us/asm/nonmatchings/npc/bind_enemy_interact.s delete mode 100644 ver/us/asm/nonmatchings/npc/bind_npc_ai.s delete mode 100644 ver/us/asm/nonmatchings/npc/bind_npc_aux.s delete mode 100644 ver/us/asm/nonmatchings/npc/bind_npc_interact.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B184.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B198.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B1B0.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B3D0.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B3F8.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B420.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003B500.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C3D8.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C428.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C53C.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C61C.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C78C.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C7A8.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C8B4.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C984.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003C9A8.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003CB20.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003CB44.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003CC8C.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003CCB0.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003CFA8.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003D2F8.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003D624.s delete mode 100644 ver/us/asm/nonmatchings/npc/func_8003D788.s delete mode 100644 ver/us/asm/nonmatchings/npc/get_enemy.s delete mode 100644 ver/us/asm/nonmatchings/npc/get_npc_safe.s delete mode 100644 ver/us/asm/nonmatchings/npc/get_npc_unsafe.s delete mode 100644 ver/us/asm/nonmatchings/npc/kill_encounter.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_create.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_do_world_collision.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_free.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_free_by_index.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_list_clear.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_list_render.s delete mode 100644 ver/us/asm/nonmatchings/npc/npc_update_decorations.s diff --git a/Jenkinsfile b/Jenkinsfile index a5fc927fd6..5704c7ca20 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,9 +49,9 @@ pipeline { } } } - post { - always { - cleanWs() - } - } + post { + always { + cleanWs() + } + } } diff --git a/include/common_structs.h b/include/common_structs.h index 17bc442bf3..915228ef7f 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -102,7 +102,7 @@ typedef struct BlurBuffer { /* 0xA4 */ f32 z[20]; } BlurBuffer; // size = 0xF4 -typedef s32 Palette16[16]; // size = 0x40 +typedef s16 Palette16[16]; // size = 0x20 typedef struct Npc { /* 0x000 */ s32 flags; @@ -115,8 +115,11 @@ typedef struct Npc { /* 0x01C */ f32 jumpVelocity; /* 0x020 */ struct BlurBuffer* blurBuf; ///< Null unless flag 0x100000 is set. /* 0x024 */ s32 spriteInstanceID; - /* 0x028 */ u32 currentAnim; - /* 0x02C */ char unk_2C[4]; + /* 0x028 */ union { + /* */ u16 h; + /* */ u32 w; + /* */ } currentAnim; + /* 0x02C */ s32 unk_2C; /* 0x030 */ f32 animationSpeed; /* 0x034 */ f32 renderYaw; /* 0x038 */ Vec3f pos; @@ -128,41 +131,50 @@ typedef struct Npc { /* 0x078 */ s32 shadowIndex; /* 0x07C */ f32 shadowScale; /* 0x080 */ s32 unk_80; - /* 0x084 */ u16 unk_84; - /* 0x086 */ u16 unk_86; + /* 0x084 */ s16 unk_84; + /* 0x086 */ s16 unk_86; /* 0x088 */ s16 isFacingAway; /* 0x08A */ s16 yawCamOffset; /* 0x08C */ s16 turnAroundYawAdjustment; /* 0x08E */ s16 duration; // TODO: name less vaguely /* 0x090 */ Vec3s homePos; - /* 0x096 */ char unk_96[12]; + /* 0x096 */ s16 unk_96; + /* 0x098 */ s16 unk_98; + /* 0x09A */ s16 unk_9A; + /* 0x09C */ s16 unk_9C; + /* 0x09E */ s16 unk_9E; + /* 0x0A0 */ s16 unk_A0; /* 0x0A2 */ u16 unk_A2; /* 0x0A4 */ s8 npcID; /* 0x0A5 */ char unk_A5; /* 0x0A6 */ s16 collisionRadius; /* 0x0A8 */ s16 collisionHeight; - /* 0x0AA */ u8 renderMode; + /* 0x0AA */ s8 renderMode; /* 0x0AB */ s8 unk_AB; /* 0x0AC */ u8 alpha; /* 0x0AD */ u8 alpha2; ///< Multiplied with Npc::alpha - /* 0x0AE */ char unk_AD[2]; + /* 0x0AE */ char unk_AE[2]; /* 0x0B0 */ s32** extraAnimList; /* 0x0B4 */ s8 unk_B4; // some kind of rendering type, 0..4 inclusive - /* 0x0B5 */ char unk_B5[13]; + /* 0x0B5 */ s8 unk_B5; + /* 0x0B6 */ s8 unk_B6; + /* 0x0B7 */ s8 unk_B7; + /* 0x0B8 */ char unk_B8[8]; + /* 0x0C0 */ s8 unk_C0; /* 0x0C1 */ s8 paletteCount; /* 0x0C2 */ char unk_C2[2]; - /* 0x0C4 */ UNK_PTR spritePaletteList; + /* 0x0C4 */ s32* spritePaletteList; /* 0x0C8 */ Palette16 localPaletteData[16]; /* 0x2C8 */ Palette16* localPalettes[16]; - /* 0x308 */ char unk_308[0x50]; + /* 0x308 */ char unk_308[16]; /* 0x318 */ f32 screenSpaceOffset2D[2]; /* 0x320 */ f32 verticalStretch; /* 0x324 */ struct EffectInstance* decorations[2]; /* 0x32C */ s8 decorationType[2]; - /* 0x32E */ s8 changedDecoration; - /* 0x32F */ char unk_32F; + /* 0x32E */ s8 changedDecoration[2]; /* 0x330 */ s8 decorationInitialised[2]; - /* 0x332 */ char unk_332[14]; + /* 0x332 */ s16 decorationUnk[2]; + /* 0x336 */ char unk_336[10]; } Npc; // size = 0x340 typedef Npc* NpcList[MAX_NPCS]; @@ -1950,7 +1962,9 @@ typedef struct EffectInstanceData { /* 0x28 */ char unk_28[0x4]; /* 0x2C */ s32 unk_2C; /* 0x30 */ f32 unk_30; - /* 0x34 */ char unk_34[0x4C]; + /* 0x34 */ char unk_34[0x30]; + /* 0x64 */ f32 unk_64; + /* 0x68 */ char unk_68[0x18]; } EffectInstanceData; // size = 0x80 typedef struct Temp8010F250 { diff --git a/include/enums.h b/include/enums.h index ecae984819..50c2612efe 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1533,11 +1533,13 @@ enum Areas { enum NpcFlags { NPC_FLAG_PASSIVE = 0x00000001, ///< Collision does not trigger battle + NPC_FLAG_2 = 0x00000002, NPC_FLAG_4 = 0x00000004, NPC_FLAG_ENABLE_HIT_SCRIPT = 0x00000008, NPC_FLAG_HAS_SHADOW = 0x00000010, ///< Set by default and by enable_npc_shadow NPC_FLAG_NO_AI = 0x00000020, ///< Disable movement AI and collision (idle animation plays) NPC_FLAG_80 = 0x00000080, // TODO + NPC_FLAG_40 = 0x00000040, NPC_FLAG_100 = 0x00000100, // TODO NPC_FLAG_GRAVITY = 0x00000200, ///< Enables gravity. Does nothing if NPC_FLAG_NO_Y_MOVEMENT is set. NPC_FLAG_LOCK_ANIMS = 0x00000400, ///< Do not allow scripts to change animation @@ -1559,8 +1561,8 @@ enum NpcFlags { /// - Perform only one lateral collision test during motion /// - Allow falling below Y=-2000 (by default, NPC_FLAG_NO_Y_MOVEMENT is set when an NPC falls out-of-bounds) NPC_FLAG_PARTICLE = 0x04000000, - - NPC_FLAG_40000000 = 0x40000000, + NPC_FLAG_8000000 = 0x08000000, + NPC_FLAG_NO_ANIMS_LOADED = 0x40000000, ///< Npc has no animations loaded NPC_FLAG_80000000 = 0x80000000, }; diff --git a/include/functions.h b/include/functions.h index 98c15befcf..d7e394c421 100644 --- a/include/functions.h +++ b/include/functions.h @@ -115,7 +115,7 @@ void func_8006FEF0(s32, f32, f32, f32, f32); void func_80070190(s32, f32, f32, f32, s32, f32, s32, s32); void func_80070F70(s32 var1, f32 var2, f32 var3, f32 var4, f32 var5, f32 var6, f32 var7, s32 var8, s32* unk); void func_80071090(s32, f32, f32, f32, s32); -Effect* func_80071750(s32, f32, f32, f32, f32, s32); +EffectInstance* func_80071750(s32, f32, f32, f32, f32, s32); Effect* func_800720B0(s32, f32, f32, f32, f32, s32); void func_80072950(s32, f32, f32, f32, f32, s32 time); Effect* func_800715D0(s32, f32, f32, f32); @@ -171,7 +171,7 @@ void intro_logos_set_fade_alpha(s16 alpha); void set_game_mode(s16 idx); -void fx_walk_normal(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); +void fx_walk_normal(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); void fx_emote(s32, Npc*, f32, f32, f32, f32, f32, s32, s32*); f32 func_800E0088(f32, f32); @@ -187,8 +187,11 @@ PlayerData* get_player_data(void); s32 pause_interp_vertical_scroll(s32 deltaBefore); void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy); +s32 func_800DC778(s32, f32*, f32*, f32*, f32*, f32, f32); s32 func_800DCB7C(s32, f32*, f32*, f32*, f32*); +s32 func_800DDAE4(s32, f32*, f32*, f32*, f32, f32, f32, f32); s32 func_800DDC44(s32, f32*, f32*, f32*, f32, f32, f32, f32); +s32 func_800DDD94(s32, f32*, f32*, f32*, f32, f32, f32, f32); Npc* get_npc_by_index(s32 listIndex); @@ -309,7 +312,7 @@ void func_80070130(s32 arg0, f32 arg1, f32 arg2, f32 arg3); void func_800701F0(s32 arg0, f32 arg1, f32 arg2, f32 arg3); void add_xz_vec3f(Vec3f* vector, f32 speed, f32 angleDeg); void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg); -void fx_walk_large(s32, f32, f32, f32, s32); +void fx_walk_large(s32, f32, f32, f32, f32); void func_80138D88(s32, s32, s32, s32, f32); s32 func_80071030(s32 a0, f32 a1, f32 a2, f32 a3, s32 a4); @@ -355,7 +358,16 @@ void sfx_play_sound_with_params(s32 arg0, u8 arg1, u8 arg2, s16 arg3); void* func_800729B0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); void* func_800726B0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); void func_8004A784(Npc* npc, f32 arg1, f32* arg2, s32* arg3, s32* arg4, s32* arg5); -void base_UnkNpcAIFunc1(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory); +void base_UnkNpcAIFunc1(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +s32* func_802DEA40(u16 arg0); +void render_sprite(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void func_802DE3D8(s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f* arg4); +void guRotateAnglesF(float mf[4][4], f32 x, f32 y, f32 z); +s32 spr_update_sprite(s32 arg0, s32 arg1, f32 arg2); +s32 func_800DC778(s32, f32*, f32*, f32*, f32*, f32, f32); +void sin_cos_rad(f32 rad, f32* outSinTheta, f32* outCosTheta); +void func_8006FB90(f32 arg0, f32 arg1, f32 arg2, f32 arg3); +void func_8006FBF0(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); #endif diff --git a/include/map.h b/include/map.h index 882358dca4..4e6d238b1a 100644 --- a/include/map.h +++ b/include/map.h @@ -282,7 +282,8 @@ typedef struct Enemy { /* 0x58 */ ScriptID hitScriptID; /* 0x5C */ ScriptID auxScriptID; /* 0x60 */ ScriptID defeatScriptID; - /* 0x64 */ char unk_64[8]; + /* 0x64 */ UNK_PTR unk_64; + /* 0x68 */ char unk_68[4]; /* 0x6C */ s32 varTable[16]; /* 0xAC */ char unk_AC[4]; /* 0xB0 */ s32 unk_B0; diff --git a/include/variables.h b/include/variables.h index 6e20f49036..c9bd971a44 100644 --- a/include/variables.h +++ b/include/variables.h @@ -212,7 +212,7 @@ extern s32 gStatsMenuIconIDs[12]; extern s32 gGameState; -extern s16 D_8009A604; +extern s16 gNpcCount; extern s32 D_8009A64C; extern s32* D_8009A658; extern s32 gOverrideFlags; diff --git a/src/102C80.c b/src/102C80.c index 27d925e118..3aff5e2770 100644 --- a/src/102C80.c +++ b/src/102C80.c @@ -7,7 +7,8 @@ void func_802E1400(Entity* entity) { struct802E1400* temp = entity->dataBuf; if (entity->collisionFlags & 1) { - if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND) || (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) { + if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND) + || (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) { exec_entity_updatecmd(entity); temp->unk_22 = 8; } diff --git a/src/104940_len_dc0.c b/src/104940_len_dc0.c index 5b8c2fb2a5..471421f85b 100644 --- a/src/104940_len_dc0.c +++ b/src/104940_len_dc0.c @@ -149,8 +149,8 @@ void func_802E38D8(Entity* entity) { if ((temp->unk_04 == 0) || (temp->unk_06 == 0)) { temp->unk_03 = 1; set_entity_commandlist(get_entity_by_index(create_entity(&D_802EA07C, entity->position.x, entity->position.y, - entity->position.z, - entity->rotation.y, 0x80000000)), &D_802E9E54); + entity->position.z, + entity->rotation.y, 0x80000000)), &D_802E9E54); entity->flags |= 0x20000020; } } diff --git a/src/105700_len_2130.c b/src/105700_len_2130.c index f58cb10f34..128b2b41ca 100644 --- a/src/105700_len_2130.c +++ b/src/105700_len_2130.c @@ -99,7 +99,7 @@ void func_802E421C(Entity* entity) { } entityIndex = create_entity(entityData, entity->position.x, entity->position.y, entity->position.z, entity->rotation.y, - 0x80000000); + 0x80000000); entityTemp = get_entity_by_index(entityIndex); entityTemp->flags |= 1; diff --git a/src/109660_len_1270.c b/src/109660_len_1270.c index 70f3f77290..d2c4c7b2cd 100644 --- a/src/109660_len_1270.c +++ b/src/109660_len_1270.c @@ -53,7 +53,8 @@ s32 func_802E8858(Entity* entity) { s32 phi_a0 = FALSE; if (entity->collisionFlags & 1) { - if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND) || (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) { + if ((playerStatus->actionState == ACTION_STATE_GROUND_POUND) + || (playerStatus->actionState == ACTION_STATE_ULTRA_POUND)) { set_action_state(ACTION_STATE_FALLING); phi_a0 = TRUE; } diff --git a/src/121f0_len_1290.c b/src/121f0_len_1290.c index 0c7d8aee74..e140ac8ecb 100644 --- a/src/121f0_len_1290.c +++ b/src/121f0_len_1290.c @@ -12,7 +12,8 @@ s32 D_800779D0 = 0xF7F7F700; s32 D_800779D4 = 0; s32 D_800779D8[] = { 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000, 0x00000045, 0x52524F52, 0xF7F7F700, 0x00000000, 0x00000000, 0x00000000, 0x00000045, 0x52524F52, - 0xF7F7F700, 0x00000000, 0x00000000, }; + 0xF7F7F700, 0x00000000, 0x00000000, + }; s32 D_80077A24 = 0x01010101; s32 D_80077A28 = 0; diff --git a/src/1AC760.c b/src/1AC760.c index ad128dd8ac..1c13a007be 100644 --- a/src/1AC760.c +++ b/src/1AC760.c @@ -95,8 +95,10 @@ s32 dispatch_damage_event_partner(s32 damageAmount, s32 event, s32 stopMotion) { set_goal_pos_to_part(walkMovement, 0x100, 0); } - show_damage_popup(walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z, battleStatus->lastAttackDamage, 1); - func_802666E4(partner, walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z, battleStatus->lastAttackDamage); + show_damage_popup(walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z, + battleStatus->lastAttackDamage, 1); + func_802666E4(partner, walkMovement->goalPos.x, walkMovement->goalPos.y, walkMovement->goalPos.z, + battleStatus->lastAttackDamage); if (battleStatus->lastAttackDamage > 0) { func_80267018(partner, 1); diff --git a/src/1b40_len_20b0.c b/src/1b40_len_20b0.c index be8c462a21..ac4ebacf32 100644 --- a/src/1b40_len_20b0.c +++ b/src/1b40_len_20b0.c @@ -152,7 +152,8 @@ void gfx_task_background(void) { gSPEndDisplayList(gMasterGfxPos++); // TODO these << 3 >> 3 shouldn't be necessary. There's almost definitely something we're missing here... - ASSERT((s32)((u32)((gMasterGfxPos - gDisplayContext->backgroundGfx) << 3) >> 3) < ARRAY_COUNT(gDisplayContext->backgroundGfx)) + ASSERT((s32)((u32)((gMasterGfxPos - gDisplayContext->backgroundGfx) << 3) >> 3) < ARRAY_COUNT( + gDisplayContext->backgroundGfx)) nuGfxTaskStart(&gDisplayContext->backgroundGfx[0], (u32)(gMasterGfxPos - gDisplayContext->backgroundGfx) * 8, NU_GFX_UCODE_F3DEX2, NU_SC_NOSWAPBUFFER); diff --git a/src/1f580_len_1940.c b/src/1f580_len_1940.c index b515bfa0d3..9c3dc47bb3 100644 --- a/src/1f580_len_1940.c +++ b/src/1f580_len_1940.c @@ -87,7 +87,7 @@ ApiStatus DoNpcDefeat(ScriptInstance* script, s32 isInitialCall) { ScriptInstance* newScript; kill_script(script); - npc->currentAnim = owner->animList[6]; + npc->currentAnim.w = owner->animList[6]; newScript = start_script(&SCRIPT_NpcDefeat, 10, 0); owner->defeatScript = newScript; owner->defeatScriptID = newScript->id; @@ -528,7 +528,7 @@ ApiStatus func_80045900(ScriptInstance* script, s32 isInitialCall) { s32 unk; if (!(enemy->unk_B0 & 0x10)) { - npc->currentAnim = *enemy->animList; + npc->currentAnim.w = *enemy->animList; } if (!(enemy->unk_B0 & 0x8)) { diff --git a/src/23680.c b/src/23680.c index 240bb64205..245d6adcec 100644 --- a/src/23680.c +++ b/src/23680.c @@ -166,7 +166,7 @@ void func_80049E3C(ScriptInstance* script) { Npc* npc = get_npc_unsafe(enemy->npcID); func_800494C0(npc, 0x3E1, 0); - npc->currentAnim = enemy->animList[4]; + npc->currentAnim.w = enemy->animList[4]; npc->jumpVelocity = 10.0f; npc->jumpScale = 2.5f; npc->moveToPos.y = npc->pos.y; @@ -205,7 +205,8 @@ void func_8004A3E8(ScriptInstance* script, s32 arg1) { npc->duration--; if (npc->duration == 0) { - npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z)); + npc->yaw = clamp_angle(atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z)); script->functionTemp[0].s = 0; } } diff --git a/src/28910_len_5090.c b/src/28910_len_5090.c index 414f593792..7e33916b4c 100644 --- a/src/28910_len_5090.c +++ b/src/28910_len_5090.c @@ -187,7 +187,7 @@ void snd_update_bgm_fade(BGMPlayer* player) { func_8004E444(player); } -void func_8004E444(BGMPlayer *arg0) { +void func_8004E444(BGMPlayer* arg0) { u16 mult = (arg0->fadeInfo.currentVolume.u16 * arg0->unk_3C) >> 15; s32 i; @@ -450,7 +450,7 @@ INCLUDE_ASM(s32, "28910_len_5090", func_8005068C); INCLUDE_ASM(s32, "28910_len_5090", func_800506C8, s32 arg0, s32 arg1); -void func_80050770(BGMPlayer *player, f32 arg1) { +void func_80050770(BGMPlayer* player, f32 arg1) { if (arg1 > 2.0) { arg1 = 2.0f; } else if (arg1 < 0.25) { diff --git a/src/2e230_len_2190.c b/src/2e230_len_2190.c index a781df1fe2..e2ffd1ac3d 100644 --- a/src/2e230_len_2190.c +++ b/src/2e230_len_2190.c @@ -462,7 +462,7 @@ void snd_get_sequence_player_and_track(u32 playerIndex, s32** outCurrentTrackDat } void snd_get_sequence_player(u32 playerIndex, BGMPlayer** outPlayer) { - switch (playerIndex) { + switch (playerIndex) { case 0: *outPlayer = D_8009A664; break; @@ -546,10 +546,12 @@ InstrumentGroup* snd_get_BK_instruments(s32 bankGroup, u32 bankIndex) { INCLUDE_ASM(s32, "2e230_len_2190", snd_load_BK_to_bank, s32 bkFileOffset, SoundBank* bank, s32 bankIndex, s32 arg3); -void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, s32 instrumentCount, u8 arg4); +void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, s32 instrumentCount, + u8 arg4); // float weirdness #ifdef NON_MATCHING -void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank *bank, Instruments instruments, u32 instrumentCount, u8 arg4) { +void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank* bank, Instruments instruments, u32 instrumentCount, + u8 arg4) { SoundBank* sb = bank; Instrument* defaultInstrument = D_8009A5C0->defaultInstrument; f32 freq = D_8009A5C0->actualFrequency; @@ -582,7 +584,8 @@ void snd_swizzle_BK_instruments(s32 bkFileOffset, SoundBank *bank, Instruments i } } #else -INCLUDE_ASM(void, "2e230_len_2190", snd_swizzle_BK_instruments, s32 bkFileOffset, SoundBank* bank, InstrumentGroup instruments, s32 instrumentCount, u8 arg4); +INCLUDE_ASM(void, "2e230_len_2190", snd_swizzle_BK_instruments, s32 bkFileOffset, SoundBank* bank, + InstrumentGroup instruments, s32 instrumentCount, u8 arg4); #endif @@ -610,7 +613,7 @@ INCLUDE_ASM(void, "2e230_len_2190", snd_read_rom, s32 arg0, s32* arg1, s32 arg2) INCLUDE_ASM(s32, "2e230_len_2190", snd_memset); -void snd_bcopy(s8* src, s8 *dest, s32 size) { +void snd_bcopy(s8* src, s8* dest, s32 size) { if (size > 0) { while (size-- != 0) { *dest++ = *src++; diff --git a/src/325AD0.c b/src/325AD0.c index 70f46fa3dc..a4432b5184 100644 --- a/src/325AD0.c +++ b/src/325AD0.c @@ -6,7 +6,7 @@ extern u32 D_E0200734[]; u32 func_E0200000(s32 arg0) { s32 temp_v0 = D_E0200690 * 4; - D_E0200690 = (u32) ((temp_v0 + 2) * (temp_v0 + 3)) / 4; + D_E0200690 = (u32)((temp_v0 + 2) * (temp_v0 + 3)) / 4; return D_E0200690 % (arg0 + 1); } diff --git a/src/415D90.c b/src/415D90.c index da53e352ae..8ac51aa13b 100644 --- a/src/415D90.c +++ b/src/415D90.c @@ -402,34 +402,34 @@ s32 can_switch_to_player(void) { s32 ret = player->koStatus == 0xD; if (debuff == 9) { - ret = FALSE; + ret = FALSE; } if (debuff == 10) { - ret = FALSE; + ret = FALSE; } if (debuff == 6) { - ret = TRUE; + ret = TRUE; } if (debuff == 3) { - ret = TRUE; + ret = TRUE; } if (debuff == 4) { - ret = TRUE; + ret = TRUE; } if (debuff == 5) { - ret = TRUE; + ret = TRUE; } if (debuff == 7) { - ret = TRUE; + ret = TRUE; } if (debuff == 8) { - ret = TRUE; + ret = TRUE; } if (player->stoneStatus == 0xC) { - ret = TRUE; + ret = TRUE; } if (battleStatus->outtaSightActive) { - ret = TRUE; + ret = TRUE; } return !ret; } diff --git a/src/43F0.c b/src/43F0.c index 833f449ed7..70ed9aaf9d 100644 --- a/src/43F0.c +++ b/src/43F0.c @@ -60,7 +60,7 @@ f32 length2D(f32 x, f32 y) { HeapNode* _heap_create(s32* addr, u32 size) { if (size < 32) { - return (HeapNode*) -1; + return (HeapNode*)-1; } else { HeapNode* heapNode = ALIGN16((s32)addr); @@ -123,7 +123,7 @@ typedef struct { u32 func_8006DDC0(s64 arg0, s64 arg1); u64 func_8006D800(s64 arg0, s64 arg1); -char *int_to_string(s32 arg01, char *arg1, s32 arg2) { +char* int_to_string(s32 arg01, char* arg1, s32 arg2) { Unk_struct_43F0 unk_struct; s32 phi_s4 = 0x26; s32 phi_fp = 0; @@ -136,7 +136,7 @@ char *int_to_string(s32 arg01, char *arg1, s32 arg2) { unk_struct.unk_39 = 0; while (TRUE) { - u8 (*new_var)[]; + u8(*new_var)[]; unk_struct.unk_00[phi_s4] = (*(new_var = &D_800743E0))[func_8006DDC0(arg0, arg2)]; arg0 = func_8006D800(arg0, arg2); @@ -156,7 +156,7 @@ char *int_to_string(s32 arg01, char *arg1, s32 arg2) { return arg1; } #else -INCLUDE_ASM(char*, "43F0", int_to_string, s32 arg01, char *arg1, s32 arg2); +INCLUDE_ASM(char*, "43F0", int_to_string, s32 arg01, char* arg1, s32 arg2); #endif // should maybe be called bzero @@ -483,9 +483,11 @@ f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration) { case EASING_QUARTIC_IN: return start + (QUART(elapsed) * (end - start) / QUART(duration)); case EASING_COS_SLOW_OVERSHOOT: - return end - (((end - start) * cos_rad(((f32)elapsed / duration) * PI_D * 4.0) * (duration - elapsed) * (duration - elapsed)) / SQ((f32)duration)); + return end - (((end - start) * cos_rad(((f32)elapsed / duration) * PI_D * 4.0) * (duration - elapsed) * + (duration - elapsed)) / SQ((f32)duration)); case EASING_COS_FAST_OVERSHOOT: - return end - (((end - start) * cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 15.0) * (duration - elapsed) * (duration - elapsed)) / SQ((f32)duration)); + return end - (((end - start) * cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 15.0) * (duration - elapsed) * + (duration - elapsed)) / SQ((f32)duration)); case EASING_QUADRATIC_OUT: val1s = duration - elapsed; return (start + (end - start)) - ((SQ(val1s) * (end - start))) / SQ(duration); @@ -496,7 +498,8 @@ f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration) { val1s = duration - elapsed; return (start + (end - start)) - ((QUART(val1s) * (end - start))) / QUART(duration); case EASING_COS_BOUNCE: - temp_f4 = cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 40.0) * (duration - elapsed) * (duration - elapsed) / SQ((f32)duration); + temp_f4 = cos_rad((((f32)SQ(elapsed) / duration) * PI_D * 4.0) / 40.0) * (duration - elapsed) * + (duration - elapsed) / SQ((f32)duration); if (temp_f4 < 0.0f) { temp_f4 = -temp_f4; } diff --git a/src/4ac90_len_3910.c b/src/4ac90_len_3910.c index cd08995f22..91cb14b00e 100644 --- a/src/4ac90_len_3910.c +++ b/src/4ac90_len_3910.c @@ -14,13 +14,13 @@ INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FA10); INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FA70); -INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_large, s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4); +INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_large, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4); -INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_normal, s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); +INCLUDE_ASM(void, "4ac90_len_3910", fx_walk_normal, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); -INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FB90); +INCLUDE_ASM(void, "4ac90_len_3910", func_8006FB90, f32 arg0, f32 arg1, f32 arg2, f32 arg3); -INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FBF0); +INCLUDE_ASM(void, "4ac90_len_3910", func_8006FBF0, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); INCLUDE_ASM(s32, "4ac90_len_3910", func_8006FC50); @@ -128,7 +128,8 @@ INCLUDE_ASM(s32, "4ac90_len_3910", func_80070EB0); INCLUDE_ASM(s32, "4ac90_len_3910", func_80070F10); -INCLUDE_ASM(void, "4ac90_len_3910", func_80070F70, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, s32 arg7, s32* arg8); +INCLUDE_ASM(void, "4ac90_len_3910", func_80070F70, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, + s32 arg7, s32* arg8); INCLUDE_ASM(s32, "4ac90_len_3910", func_80070FD0); @@ -170,7 +171,7 @@ INCLUDE_ASM(void, "4ac90_len_3910", func_80071690, s32 arg0, f32 arg1, f32 arg2, INCLUDE_ASM(Effect*, "4ac90_len_3910", func_800716F0, s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5); -INCLUDE_ASM(Effect*, "4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5); +INCLUDE_ASM(EffectInstance*, "4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5); INCLUDE_ASM(s32, "4ac90_len_3910", func_800717B0); diff --git a/src/7bb60_len_41b0.c b/src/7bb60_len_41b0.c index 143c0a02b1..a2573b3ce4 100644 --- a/src/7bb60_len_41b0.c +++ b/src/7bb60_len_41b0.c @@ -21,7 +21,7 @@ s32 func_800E26C4(void) { actionState == ACTION_STATE_RUN || actionState == ACTION_STATE_USE_TWEESTER || actionState == ACTION_STATE_SPIN - ) { + ) { return 1; } @@ -86,8 +86,8 @@ INCLUDE_ASM(s32, "7bb60_len_41b0", func_800E2F60); // } // } void gravity_use_fall_params(void) { - PlayerStatus *playerStatus; - f32 *floats = D_800F7B60; + PlayerStatus* playerStatus; + f32* floats = D_800F7B60; do {} while (0); playerStatus = &gPlayerStatus; if (playerStatus->flags & 0x40000) { @@ -380,10 +380,10 @@ void set_action_state(s32 actionState) { if (actionState < ACTION_STATE_TALK) if (actionState >= 0) { #endif - playerStatus->prevActionState = playerStatus->actionState; - playerStatus->actionState = actionState; - playerStatus->flags |= 0x80000000; - } + playerStatus->prevActionState = playerStatus->actionState; + playerStatus->actionState = actionState; + playerStatus->flags |= 0x80000000; + } return; } @@ -538,7 +538,7 @@ void func_800E636C(s32 arg0) { s32 listIndex = D_8010C96C; if (listIndex >= 0) { - get_npc_by_index(listIndex)->currentAnim = arg0; + get_npc_by_index(listIndex)->currentAnim.w = arg0; } } diff --git a/src/C50A0.c b/src/C50A0.c index 02d8fa6c53..a540537a24 100644 --- a/src/C50A0.c +++ b/src/C50A0.c @@ -21,7 +21,7 @@ INCLUDE_ASM(s32, "C50A0", func_8012FE78); INCLUDE_ASM(s32, "C50A0", func_801309F0); -s32 next_sequence_step(ItemEntity *itemEntity) { +s32 next_sequence_step(ItemEntity* itemEntity) { s32* currentState = itemEntity->currentState; switch (*currentState++) { diff --git a/src/DF950.c b/src/DF950.c index beb93fc7e6..426cbbd3b6 100644 --- a/src/DF950.c +++ b/src/DF950.c @@ -68,7 +68,8 @@ s32 D_8014F6B4[] = { 0x000001C1, 0x000001C2, 0x000001C3, 0x000001C4, 0x000001C5, extern s32 D_80159AD4; -INCLUDE_ASM(void, "DF950", sfx_compute_spatialized_sound_params_2, f32 posX, f32 posY, f32 posZ, s16* volume, s16* pan, u32 sourceFlags); +INCLUDE_ASM(void, "DF950", sfx_compute_spatialized_sound_params_2, f32 posX, f32 posY, f32 posZ, s16* volume, s16* pan, + u32 sourceFlags); void sfx_reset_door_sounds(void) { gCurrentDoorSoundsSet = 0; @@ -129,7 +130,8 @@ void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID) { INCLUDE_ASM(s32, "DF950", sfx_play_sound_at_position, s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ); -INCLUDE_ASM(void, "DF950", sfx_get_spatialized_sound_params, f32 arg0, f32 arg1, f32 arg2, s16* arg3, s16* arg4, s32 arg5); +INCLUDE_ASM(void, "DF950", sfx_get_spatialized_sound_params, f32 arg0, f32 arg1, f32 arg2, s16* arg3, s16* arg4, + s32 arg5); INCLUDE_ASM(s32, "DF950", sfx_compute_spatialized_sound_params_0); diff --git a/src/a5dd0_len_114e0.c b/src/a5dd0_len_114e0.c index abd1f89749..eb6643d9cc 100644 --- a/src/a5dd0_len_114e0.c +++ b/src/a5dd0_len_114e0.c @@ -315,7 +315,7 @@ void update_entity_inverse_rotation_matrix(Entity* entity); void delete_entity(s32 entityIndex); void delete_entity_and_unload_data(s32 entityIndex); void func_8011085C(s32 shadowIndex); -s32 entity_get_collision_flags(Entity *entity); +s32 entity_get_collision_flags(Entity* entity); void func_801117DC(StaticEntityData* data); void func_80112344(Entity* entity); @@ -514,7 +514,7 @@ void render_entities(void) { gPlayerStatusPtr->position.z, entity->position.x, entity->position.z) > 200.0f - ) { + ) { continue; } @@ -658,8 +658,8 @@ ShadowList* get_shadow_list(void) { return ret; } -s32 func_80110678(Npc *npc) { - if (npc->currentAnim != 0) { +s32 func_80110678(Npc* npc) { + if (npc->currentAnim.w != 0) { npc->flags |= 0x1000000; return 1; } @@ -732,7 +732,7 @@ void func_8011085C(s32 shadowIndex) { (*gCurrentShadowListPtr)[shadowIndex] = NULL; } -s32 entity_get_collision_flags(Entity *entity) { +s32 entity_get_collision_flags(Entity* entity) { u32 listIndex = entity->listIndex; s32 ret = 0; u32 flag; @@ -804,13 +804,13 @@ s32 is_player_action_state(ActionState actionState) { return actionState == gPlayerActionState; } -void func_80110BCC(Entity *entity) { +void func_80110BCC(Entity* entity) { if (!(entity->flags & 8)) { set_entity_model_render_command_list(entity->virtualModelIndex); } } -void func_80110BF8(Entity *entity) { +void func_80110BF8(Entity* entity) { entity->unk_07 = 0; entity->flags &= ~0x00010000; } diff --git a/src/battle/area_dig/6DE4A0.c b/src/battle/area_dig/6DE4A0.c index 7f2d39de6e..89a0e0d3f7 100644 --- a/src/battle/area_dig/6DE4A0.c +++ b/src/battle/area_dig/6DE4A0.c @@ -30,7 +30,7 @@ ApiStatus func_80218770_6DE530(ScriptInstance* script, s32 isInitialCall) { SelectableTarget* selectableTarget; battleStatus->moveCategory = 6; - do {} while(0); + do {} while (0); battleStatus->selectedItemID = 0; battleStatus->selectedMoveID = 0x98; battleStatus->currentTargetListFlags = D_8008FC44; diff --git a/src/battle/item/food/lib.c b/src/battle/item/food/lib.c index 652f1f91b5..8337cc91f5 100644 --- a/src/battle/item/food/lib.c +++ b/src/battle/item/food/lib.c @@ -135,7 +135,7 @@ ApiStatus N(func_802A15A0_733670)(ScriptInstance* script, s32 isInitialCall) { } temp = 0; - if((script->varTable[11] < 0) || (script->varTable[11] <= 0 && script->varTable[12] < 0)) { + if ((script->varTable[11] < 0) || (script->varTable[11] <= 0 && script->varTable[12] < 0)) { temp = 1; } diff --git a/src/common/BattleAreaAngleStuff.inc.c b/src/common/BattleAreaAngleStuff.inc.c index 28184c0260..4dd515c249 100644 --- a/src/common/BattleAreaAngleStuff.inc.c +++ b/src/common/BattleAreaAngleStuff.inc.c @@ -41,7 +41,7 @@ u32 N(BattleAreaAngleStuff1)(f32 x, f32 y) { } ApiStatus N(BattleAreaAngleStuff2)(ScriptInstance* script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; s32 var1 = get_variable(script, *args++); s32 var2 = get_variable(script, *args++); s32 var3 = get_variable(script, *args++); diff --git a/src/entity.c b/src/entity.c index a408045bb2..7bddf378dd 100644 --- a/src/entity.c +++ b/src/entity.c @@ -147,7 +147,7 @@ void exec_entity_model_commandlist(s32 idx) { entityModel = (*gCurrentEntityModelList)[idx]; if (entityModel != NULL && (entityModel->flags)) { if (!(entityModel->flags & 0x20)) { - if(!(entityModel->flags & 0x20000)) { + if (!(entityModel->flags & 0x20000)) { entityModel->flags &= ~0x100; entityModel->nextFrameTime -= entityModel->timeScale; if (entityModel->nextFrameTime <= 0.0f) { diff --git a/src/evt/map_api.c b/src/evt/map_api.c index a93d6a2769..3a339f57f1 100644 --- a/src/evt/map_api.c +++ b/src/evt/map_api.c @@ -256,8 +256,8 @@ ApiStatus func_802C94A0(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus SetModelFlags(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus SetModelFlags(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; s32 modelIndex; s32 a1; s32 enable; @@ -412,7 +412,7 @@ void set_zone_enabled(s32 zoneID, s32 enabled) { } } -ApiStatus SetZoneEnabled(ScriptInstance *script, s32 isInitialCall) { +ApiStatus SetZoneEnabled(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 idx = get_variable(script, *args++); s32 enabled = get_variable(script, *args++); diff --git a/src/evt/msg_api.c b/src/evt/msg_api.c index 9b98780aac..f0121b90d6 100644 --- a/src/evt/msg_api.c +++ b/src/evt/msg_api.c @@ -20,7 +20,7 @@ ApiStatus SpeakToNpc(ScriptInstance* script, s32 isInitialCall) { INCLUDE_ASM(ApiStatus, "evt/msg_api", _show_message, ScriptInstance* script, s32 isInitialCall, s32 arg2); -ApiStatus ShowMessageAtScreenPos(ScriptInstance *script, s32 isInitialCall) { +ApiStatus ShowMessageAtScreenPos(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; if (isInitialCall) { @@ -46,7 +46,7 @@ ApiStatus ShowMessageAtScreenPos(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE1; } -ApiStatus ShowMessageAtWorldPos(ScriptInstance *script, s32 isInitialCall) { +ApiStatus ShowMessageAtWorldPos(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; PrintContext** currentPrintContext; s32* currentCameraID = &gCurrentCameraID; @@ -112,7 +112,7 @@ ApiStatus SwitchMessage(ScriptInstance* script, s32 isInitialCall) { } } -ApiStatus ShowChoice(ScriptInstance *script, s32 isInitialCall) { +ApiStatus ShowChoice(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; PrintContext** temp802DB268; diff --git a/src/evt/npc_api.c b/src/evt/npc_api.c index 9cfb9f39d9..8a384500e2 100644 --- a/src/evt/npc_api.c +++ b/src/evt/npc_api.c @@ -15,11 +15,11 @@ void set_npc_animation(Npc* npc, u32 arg1) { PlayerData* playerData = &gPlayerData; if (arg1 - 0x101 < 9) { - npc->currentAnim = gPartnerAnimations[playerData->currentPartner].anims[arg1 - 0x101]; + npc->currentAnim.w = gPartnerAnimations[playerData->currentPartner].anims[arg1 - 0x101]; } else if ((arg1 - 0x201) < 0x10) { - npc->currentAnim = get_enemy(npc->npcID)->animList[arg1 - 0x201]; + npc->currentAnim.w = get_enemy(npc->npcID)->animList[arg1 - 0x201]; } else { - npc->currentAnim = arg1; + npc->currentAnim.w = arg1; } } @@ -189,7 +189,7 @@ ApiStatus GetNpcAnimation(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } - set_variable(script, outVar, npc->currentAnim); + set_variable(script, outVar, npc->currentAnim.w); return ApiStatus_DONE2; } diff --git a/src/npc.c b/src/npc.c index 357cda5a06..9d8624432b 100644 --- a/src/npc.c +++ b/src/npc.c @@ -2,7 +2,16 @@ #include "map.h" #include "npc.h" -s32 spr_update_sprite(s32 arg0, s32 arg1, f32 arg2); +extern s16 D_8010C97A; +extern s32 D_8010C978; + +extern f32 D_80077C10; +extern s16 D_80077C14; + +extern f32 D_80077C18; +extern s16 D_80077C1C; +extern s16 D_80077C1E; +extern s32 D_80077C20; void npc_callback_no_op(void) { } @@ -15,7 +24,22 @@ void npc_mtx_ident_mirror_y(Matrix4f mtx) { mtx[3][3] = 1.0f; } -INCLUDE_ASM(void, "npc", npc_list_clear, void); +void npc_list_clear(void) { + s32 i; + + if (!gGameStatusPtr->isBattle) { + gCurrentNpcListPtr = &gWorldNpcList; + } else { + gCurrentNpcListPtr = &gBattleNpcList; + } + + for (i = 0; i < MAX_NPCS; i++) { + (*gCurrentNpcListPtr)[i] = NULL; + } + + gNpcCount = 0; + D_800A0B94 = 1; +} void npc_list_update_current(void) { if (!gGameStatusPtr->isBattle) { @@ -24,7 +48,7 @@ void npc_list_update_current(void) { gCurrentNpcListPtr = &gBattleNpcList; } - D_8009A604 = 0; + gNpcCount = 0; D_800A0B94 = 1; } @@ -37,13 +61,113 @@ void npc_iter_no_op(void) { } } -INCLUDE_ASM(void, "npc", npc_create, NpcBlueprint* blueprint, NpcAnimID animList[], s32 skipLoadingAnims); +s32 npc_create(NpcBlueprint* blueprint, NpcAnimID** animList, s32 skipLoadingAnims) { + Npc* npc; + s32 i; + s32 j; + + for (i = 0; i < MAX_NPCS; i++) { + if ((*gCurrentNpcListPtr)[i] == NULL) { + break; + } + } + ASSERT(i < MAX_NPCS); + + (*gCurrentNpcListPtr)[i] = npc = heap_malloc(sizeof(Npc)); + gNpcCount++; + ASSERT(npc != NULL); + + npc->flags = blueprint->flags | (NPC_FLAG_400000 | NPC_FLAG_DIRTY_SHADOW | NPC_FLAG_HAS_SHADOW | NPC_FLAG_PASSIVE); + if (skipLoadingAnims) { + npc->flags |= NPC_FLAG_NO_ANIMS_LOADED; + } + + npc->collisionRadius = 32; + npc->collisionHeight = 64; + npc->renderMode = 13; + npc->blurBuf = NULL; + npc->yaw = 0.0f; + npc->jumpVelocity = 0.0f; + npc->pos.x = 0.0f; + npc->pos.y = 0.0f; + npc->pos.z = 0.0f; + npc->colliderPos.x = 0.0f; + npc->colliderPos.y = 0.0f; + npc->colliderPos.z = 0.0f; + npc->rotationVerticalPivotOffset = 0.0f; + npc->rotation.x = 0.0f; + npc->rotation.y = 0.0f; + npc->rotation.z = 0.0f; + npc->homePos.x = 0.0f; + npc->homePos.y = 0.0f; + npc->homePos.z = 0.0f; + npc->unk_96 = 0; // TODO: fix + npc->unk_AB = 0; + npc->alpha = 255; + npc->alpha2 = 255; + npc->jumpScale = 1.0f; + npc->moveSpeed = 4.0f; + npc->scale.x = 1.0f; + npc->scale.y = 1.0f; + npc->scale.z = 1.0f; + npc->currentAnim.w = blueprint->initialAnim; + npc->animationSpeed = 1.0f; + npc->renderYaw = 0.0f; + npc->unk_98 = 0; + npc->unk_A2 = 0; + npc->unk_80 = 0x20000; + npc->isFacingAway = 0; + npc->yawCamOffset = 0; + npc->turnAroundYawAdjustment = 0; + npc->unk_84 = -1; + npc->unk_86 = -1; + npc->unk_B4 = 0; + npc->unk_B5 = 0; + npc->screenSpaceOffset2D[0] = 0.0f; + npc->screenSpaceOffset2D[1] = 0.0f; + npc->verticalStretch = 1.0f; + + for (j = 0; j < ARRAY_COUNT(npc->decorations); j++) { + npc->decorations[j] = 0; + npc->decorationType[j] = 0; + } + + npc->onUpdate = blueprint->onUpdate; + if (npc->onUpdate == NULL) { + npc->onUpdate = &npc_callback_no_op; + } + + npc->onRender = blueprint->onRender; + if (npc->onRender == NULL) { + npc->onRender = &npc_callback_no_op; + } + if (!skipLoadingAnims) { + npc->extraAnimList = animList; + if (!(npc->flags & NPC_FLAG_1000000)) { + if (!(npc->flags & NPC_FLAG_PARTICLE)) { + npc->spriteInstanceID = func_802DE0EC(npc->currentAnim.w, animList); + } else { + npc->spriteInstanceID = func_802DE0EC(npc->currentAnim.w | 0x80000000, animList); + } + } else { + npc->flags |= NPC_FLAG_2; + } + } + + npc->shadowIndex = create_shadow_type(0, npc->pos.x, npc->pos.y, npc->pos.z); + npc->shadowScale = 1.0f; + + if (gGameStatusPtr->isBattle) { + i |= 0x800; + } + return i; +} void npc_create_basic(NpcBlueprint* blueprint) { npc_create(blueprint, NULL, FALSE); } -void npc_create_standard(NpcBlueprint* blueprint, NpcAnimID animList[]) { +void npc_create_standard(NpcBlueprint* blueprint, NpcAnimID** animList) { npc_create(blueprint, animList, FALSE); } @@ -51,15 +175,179 @@ void npc_create_partner(NpcBlueprint* blueprint) { npc_create(blueprint, NULL, TRUE); } -INCLUDE_ASM(void, "npc", npc_free_by_index, s32 listIndex); +void npc_free_by_index(s32 listIndex) { + Npc* npc; + s32 i; -INCLUDE_ASM(void, "npc", npc_free, Npc* npc); + listIndex &= ~0x800; + + npc = (*gCurrentNpcListPtr)[listIndex]; + if (npc != NULL) { + if (npc->flags) { + if (npc->blurBuf != NULL) { + heap_free(npc->blurBuf); + npc->blurBuf = NULL; + } + + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000) && func_802DE5E8(npc->spriteInstanceID)) { + PANIC(); + } + } + func_80112328(npc->shadowIndex); + + for (i = 0; i < 2; i++) { + func_8003C428(npc, i); + } + + if (npc->flags & NPC_FLAG_MOTION_BLUR) { + disable_npc_blur(npc); + } + + heap_free((*gCurrentNpcListPtr)[listIndex]); + (*gCurrentNpcListPtr)[listIndex] = NULL; + gNpcCount--; + } + } +} + +void npc_free(Npc* npc) { + s32 i; + + if (npc->blurBuf != NULL) { + heap_free(npc->blurBuf); + npc->blurBuf = NULL; + } + + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000) && func_802DE5E8(npc->spriteInstanceID) != 0) { + PANIC(); + } + } + func_80112328(npc->shadowIndex); + + for (i = 0; i < 2; i++) { + func_8003C428(npc, i); + } + + if (npc->flags & NPC_FLAG_MOTION_BLUR) { + disable_npc_blur(npc); + } + + heap_free(npc); + + for (i = 0; i < MAX_NPCS; i++) { + if ((*gCurrentNpcListPtr)[i] == npc) { + break; + } + } + + (*gCurrentNpcListPtr)[i] = NULL; + gNpcCount--; +} Npc* get_npc_by_index(s32 listIndex) { return (*gCurrentNpcListPtr)[listIndex & ~0x800]; } -INCLUDE_ASM(void, "npc", npc_do_world_collision, Npc* npc); +void npc_do_world_collision(Npc* npc) { + f32 temp_f0; + s32 phi_v0; + f32 temp_x; + f32 temp_y; + f32 temp_z; + + if (npc->flags & 0x40) { + npc->flags |= NPC_FLAG_8000000; + } else if ((npc->pos.x != npc->colliderPos.x) || (npc->pos.y != npc->colliderPos.y) + || (npc->pos.z != npc->colliderPos.z) || npc->flags & NPC_FLAG_8000000) { + npc->flags &= ~NPC_FLAG_8000000; + temp_f0 = clamp_angle(npc->yaw); + temp_x = npc->pos.x; + temp_y = npc->pos.y; + temp_z = npc->pos.z; + + if (!(npc->flags & NPC_FLAG_PARTICLE)) { + phi_v0 = func_800DDC44(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, npc->collisionRadius); + } else { + phi_v0 = func_800DDD94(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, npc->collisionRadius); + } + + if (phi_v0) { + npc->flags |= (NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_4000); + npc->unk_86 = D_8010C97A; + npc->pos.x = temp_x; + npc->pos.z = temp_z; + } else { + npc->flags &= ~(NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_4000); + } + + temp_f0 = clamp_angle(npc->yaw + 45.0f); + temp_x = npc->pos.x; + temp_y = npc->pos.y; + temp_z = npc->pos.z; + + if (!(npc->flags & NPC_FLAG_PARTICLE)) { + phi_v0 = func_800DDC44(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, npc->collisionRadius); + } else { + phi_v0 = func_800DDAE4(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, npc->collisionRadius); + } + + if (phi_v0) { + npc->flags |= NPC_FLAG_NO_PROJECT_SHADOW; + npc->pos.x = temp_x; + npc->pos.z = temp_z; + } else { + npc->flags &= ~NPC_FLAG_NO_PROJECT_SHADOW; + } + + temp_f0 = clamp_angle(npc->yaw - 45.0f); + temp_x = npc->pos.x; + temp_y = npc->pos.y; + temp_z = npc->pos.z; + if (!(npc->flags & NPC_FLAG_PARTICLE)) { + phi_v0 = func_800DDC44(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, npc->collisionRadius); + } else { + phi_v0 = func_800DDAE4(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, npc->collisionRadius); + } + + if (phi_v0 != 0) { + npc->flags |= NPC_FLAG_NO_PROJECT_SHADOW; + npc->pos.x = temp_x; + npc->pos.z = temp_z; + } else { + npc->flags &= ~NPC_FLAG_NO_PROJECT_SHADOW; + } + + if (npc->flags & NPC_FLAG_PARTICLE) { + temp_f0 = clamp_angle(npc->yaw + 45.0f + 180.0f); + temp_x = npc->pos.x; + temp_y = npc->pos.y; + temp_z = npc->pos.z; + if (func_800DDC44(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, + npc->collisionRadius) != 0) { + npc->flags |= NPC_FLAG_NO_PROJECT_SHADOW; + npc->pos.x = temp_x; + npc->pos.z = temp_z; + } else { + npc->flags &= ~NPC_FLAG_NO_PROJECT_SHADOW; + } + + temp_f0 = clamp_angle((npc->yaw - 45.0f) + 180.0f); + temp_x = npc->pos.x; + temp_y = npc->pos.y; + temp_z = npc->pos.z; + if (func_800DDC44(npc->unk_80, &temp_x, &temp_y, &temp_z, 0, temp_f0, npc->collisionHeight, + npc->collisionRadius) != 0) { + npc->flags |= NPC_FLAG_NO_PROJECT_SHADOW; + npc->pos.x = temp_x; + npc->pos.z = temp_z; + return; + } + npc->flags &= ~NPC_FLAG_NO_PROJECT_SHADOW; + } + } +} INCLUDE_ASM(void, "npc", npc_do_other_npc_collision, Npc* npc); @@ -71,11 +359,181 @@ INCLUDE_ASM(s32, "npc", func_800397E8); INCLUDE_ASM(void, "npc", npc_list_update, void); -INCLUDE_ASM(s32, "npc", func_80039DA4); +INCLUDE_ASM(f32, "npc", func_80039DA4); +#ifdef NON_MATCHING +// float regalloc +void npc_appendGfx(Npc* npc) { + Matrix4f subroutine_arg6; + Matrix4f subroutine_arg16; + f32 temp_f22 = func_80039DA4(); + + guTranslateF(subroutine_arg6, npc->pos.x, npc->pos.y + npc->unk_AB, npc->pos.z); + if (npc->flags & NPC_FLAG_80) { + npc_mtx_ident_mirror_y(subroutine_arg16); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (npc->rotationVerticalPivotOffset != 0.0f) { + guTranslateF(subroutine_arg16, 0.0f, npc->rotationVerticalPivotOffset, 0.0f); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (npc->rotation.y != 0.0f) { + guRotateF(subroutine_arg16, npc->rotation.y, 0.0f, 1.0f, 0.0f); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (npc->rotation.x != 0.0f) { + guRotateF(subroutine_arg16, npc->rotation.x, 1.0f, 0.0f, 0.0f); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (npc->rotation.z != 0.0f) { + guRotateF(subroutine_arg16, npc->rotation.z, 0.0f, 0.0f, 1.0f); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (npc->rotationVerticalPivotOffset != 0.0f) { + guTranslateF(subroutine_arg16, 0.0f, -npc->rotationVerticalPivotOffset, 0.0f); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if ((npc->screenSpaceOffset2D[0] != 0.0f) || (npc->screenSpaceOffset2D[1] != 0.0f)) { + guTranslateF(subroutine_arg6, npc->screenSpaceOffset2D[0], npc->screenSpaceOffset2D[1], 0.0f); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if ((npc->scale.x * (5.0 / 7) != 1.0f) || ((npc->scale.y * npc->verticalStretch) * (5.0 / 7) != 1.0f) + || (npc->scale.z * (5.0 / 7) != 1.0f)) { + guScaleF(subroutine_arg16, npc->scale.x * (5.0 / 7), (npc->scale.y * npc->verticalStretch) * (5.0 / 7), + npc->scale.z * (5.0 / 7)); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_100000) && (npc->currentAnim.w != 0) && (npc->spriteInstanceID >= 0)) { + func_8003B47C(npc, temp_f22, subroutine_arg6); + npc->unk_2C = func_802DE5C8(npc->spriteInstanceID); + } + } else { + func_8003B47C(npc, temp_f22, subroutine_arg6); + npc->unk_2C = func_802DDEC4(1); + } + + if (npc->flags & NPC_FLAG_REFLECT_WALL) { + guTranslateF(subroutine_arg6, npc->pos.x, npc->pos.y + npc->unk_AB, -npc->pos.z); + if (npc->flags & NPC_FLAG_80) { + npc_mtx_ident_mirror_y(subroutine_arg16); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + if ((npc->rotation.y != 0.0f) || (npc->rotation.x != 0.0f) || (npc->rotation.z != 0.0f)) { + guRotateAnglesF(subroutine_arg16, npc->rotation.x, npc->rotation.y, npc->rotation.z); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if ((npc->scale.x * (5.0 / 7) != 1.0f) || ((npc->scale.y * npc->verticalStretch) * (5.0 / 7) != 1.0f) + || (npc->scale.z * (5.0 / 7) != 1.0f)) { + guScaleF(subroutine_arg16, npc->scale.x * (5.0 / 7), (npc->scale.y * npc->verticalStretch) * (5.0 / 7), + npc->scale.z * (5.0 / 7)); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000) && (npc->currentAnim.w != 0)) { + func_802DE3D8(npc->spriteInstanceID, temp_f22, 0, 0, subroutine_arg6); + } + } else { + render_sprite(0x40000001, temp_f22, 0, 0, subroutine_arg6); + } + } + + if (npc->flags & NPC_FLAG_REFLECT_FLOOR) { + guTranslateF(subroutine_arg6, npc->pos.x, -(npc->pos.y + npc->unk_AB), npc->pos.z); + npc_mtx_ident_mirror_y(subroutine_arg16); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + + if (npc->rotation.y != 0.0f || npc->rotation.x != 0.0f || npc->rotation.z != 0.0f) { + guRotateAnglesF(subroutine_arg16, npc->rotation.x, npc->rotation.y, npc->rotation.z); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if ((npc->scale.x * (5.0 / 7) != 1.0f) || ((npc->scale.y * npc->verticalStretch) * (5.0 / 7) != 1.0f) + || (npc->scale.z * (5.0 / 7) != 1.0f)) { + guScaleF(subroutine_arg16, npc->scale.x * (5.0 / 7), (npc->scale.y * npc->verticalStretch) * (5.0 / 7), + npc->scale.z * (5.0 / 7)); + guMtxCatF(subroutine_arg16, subroutine_arg6, subroutine_arg6); + } + + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000) && (npc->currentAnim.w != 0)) { + func_802DE3D8(npc->spriteInstanceID, temp_f22, 0, 0, subroutine_arg6); + } + } else { + render_sprite(0x40000001, temp_f22, 0, 0, subroutine_arg6); + } + } + npc->onRender(npc); +} +#else INCLUDE_ASM(void, "npc", npc_appendGfx, Npc* npc); +#endif -INCLUDE_ASM(void, "npc", npc_list_render, void); +void npc_list_render(void) { + f32 temp_f20; + Npc* npc; + f32 phi_f20; + s32 i; + RenderTask renderTask; + RenderTask* task = &renderTask; // WTF? + f32 x; + f32 y; + f32 z; + f32 s; + Camera* cam = &gCameras[gCurrentCamID]; + + for (i = 0; i < MAX_NPCS; i++) { + + Npc* npc = (*gCurrentNpcListPtr)[i]; + if (npc != NULL) { + if (npc->flags && !(npc->flags & (NPC_FLAG_80000000 | NPC_FLAG_1000000 | NPC_FLAG_4 | NPC_FLAG_2))) { + transform_point(&cam->perspectiveMatrix, npc->pos.x, npc->pos.y, npc->pos.z, 1.0f, &x, &y, &z, &s); + if (!(s < 0.01) || !(s > -0.01)) { + phi_f20 = ((z * 5000.0f) / s) + 5000.0f; + if (phi_f20 < 0.0f) { + phi_f20 = 0.0f; + } else if (phi_f20 > 10000.0f) { + phi_f20 = 10000.0f; + } + + task->distance = -phi_f20; + task->appendGfxArg = npc; + task->appendGfx = &npc_appendGfx; + task->renderMode = npc->renderMode; + if (npc->flags & NPC_FLAG_NO_DROPS) { + u8 r, g, b, a; + get_background_color_blend(&r, &g, &b, &a); + npc->alpha2 = 0xFF - a; + } else { + npc->alpha2 = 0xFF; + } + + if (npc->alpha2 != 0) { + queue_render_task(task); + } + + if ((npc->flags & NPC_FLAG_MOTION_BLUR) != 0) { + task->distance = -phi_f20; + task->appendGfx = &appendGfx_npc_blur; + task->appendGfxArg = npc; + task->renderMode = 0x11; + queue_render_task(task); + } + } + } + } + } +} void npc_move_heading(Npc* npc, f32 speed, f32 yaw) { f32 angle = (yaw * TAU) / 360.0f; @@ -86,34 +544,60 @@ void npc_move_heading(Npc* npc, f32 speed, f32 yaw) { npc->pos.z += -speed * cos; } -INCLUDE_ASM(Npc*, "npc", get_npc_unsafe, NpcID npcID); +Npc* get_npc_unsafe(NpcID npcID) { + s32 i; + Npc* npc; -INCLUDE_ASM(Npc*, "npc", get_npc_safe, NpcID npcID); + for (i = 0; i < MAX_NPCS; i++) { + npc = (*gCurrentNpcListPtr)[i]; + if (npc != NULL && npc->flags != 0 && npc->npcID == npcID) { + break; + } + } + ASSERT(i < MAX_NPCS); + + return npc; +} + +Npc* get_npc_safe(NpcID npcID) { + s32 i; + Npc* npc; + + for (i = 0; i < MAX_NPCS; i++) { + npc = (*gCurrentNpcListPtr)[i]; + if (npc != NULL && npc->flags != 0 && npc->npcID == npcID) { + break; + } + } + if (i >= MAX_NPCS) { + return NULL; + } + + return npc; +} void enable_npc_shadow(Npc* npc) { Shadow* shadow; - if (!(npc->flags & 0x10)) { + if (!(npc->flags & NPC_FLAG_HAS_SHADOW)) { shadow = get_shadow_by_index(npc->shadowIndex); shadow->flags &= ~1; - npc->flags = npc->flags | 0x10010; + npc->flags = npc->flags | (NPC_FLAG_DIRTY_SHADOW | NPC_FLAG_HAS_SHADOW); } } void disable_npc_shadow(Npc* npc) { Shadow* shadow; - if (npc->flags & 0x10) { + if (npc->flags & NPC_FLAG_HAS_SHADOW) { shadow = get_shadow_by_index(npc->shadowIndex); shadow->flags |= 1; - npc->flags &= ~0x10; - npc->flags &= ~0x10000; + npc->flags &= ~NPC_FLAG_HAS_SHADOW; + npc->flags &= ~NPC_FLAG_DIRTY_SHADOW; } } void set_npc_sprite(Npc* npc, s32 anim, s32** extraAnimList) { - s32 flagsTemp; - ASSERT((npc->flags & NPC_FLAG_1000000) || func_802DE5E8(npc->spriteInstanceID) == 0); npc->extraAnimList = extraAnimList; @@ -123,22 +607,22 @@ void set_npc_sprite(Npc* npc, s32 anim, s32** extraAnimList) { ASSERT(npc->spriteInstanceID >= 0); } - flagsTemp = npc->flags; - npc->currentAnim = anim; - if (!(flagsTemp & 0x40000000)) { - if (!(flagsTemp & NPC_FLAG_1000000)) { + npc->currentAnim.w = anim; + + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000)) { spr_update_sprite(npc->spriteInstanceID, anim, npc->animationSpeed); } } } void enable_npc_blur(Npc* npc) { - if (!(npc->flags & 0x100000)) { + if (!(npc->flags & NPC_FLAG_MOTION_BLUR)) { BlurBuffer* blurBuf; s32 i; - npc->flags |= 0x100000; + npc->flags |= NPC_FLAG_MOTION_BLUR; blurBuf = heap_malloc(sizeof(BlurBuffer)); npc->blurBuf = blurBuf; @@ -155,8 +639,8 @@ void enable_npc_blur(Npc* npc) { } void disable_npc_blur(Npc* npc) { - if (npc->flags & 0x100000) { - npc->flags &= ~0x100000; + if (npc->flags & NPC_FLAG_MOTION_BLUR) { + npc->flags &= ~NPC_FLAG_MOTION_BLUR; heap_free(npc->blurBuf); npc->blurBuf = NULL; @@ -181,14 +665,54 @@ void update_npc_blur(Npc* npc) { INCLUDE_ASM(void, "npc", appendGfx_npc_blur, Npc* npc); -INCLUDE_ASM(s32, "npc", func_8003B184); +void func_8003B184(void) { + D_800A0B94 = 1; +} -INCLUDE_ASM(s32, "npc", func_8003B198); +void func_8003B198(void) { + D_800A0B94 = 0; +} void func_8003B1A8(void) { } -INCLUDE_ASM(s32, "npc", func_8003B1B0); +void func_8003B1B0(void) { + s32 i; + s32 j; + + for (i = 0; i < MAX_NPCS; i++) { + Npc* npc = (*gCurrentNpcListPtr)[i]; + if (npc != NULL) { + if (npc->flags && !(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000)) { + if (!(npc->flags & NPC_FLAG_PARTICLE)) { + npc->spriteInstanceID = func_802DE0EC(npc->currentAnim.w, npc->extraAnimList); + } else { + npc->spriteInstanceID = func_802DE0EC(npc->currentAnim.w | 0x80000000, npc->extraAnimList); + } + } + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000) && (npc->unk_B4 != 0)) { + npc->spritePaletteList = func_802DEA40(npc->currentAnim.h); + npc->paletteCount = 0; + while (npc->spritePaletteList[npc->paletteCount] != -1) { + npc->paletteCount++; + } + npc->unk_C0 = func_802DEA6C(npc->currentAnim.h); + } + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + if (!(npc->flags & NPC_FLAG_1000000)) { + for (j = 0; j < 2; j++) { + func_8003C61C(npc, j); + } + func_8003D3BC(npc); + } + } + } + } + } + } +} void set_npc_yaw(Npc* npc, f32 yaw) { npc->yaw = yaw; @@ -202,19 +726,81 @@ void set_npc_yaw(Npc* npc, f32 yaw) { } } -INCLUDE_ASM(s32, "npc", func_8003B3D0); +void func_8003B3D0(Npc* npc, s32 arg1) { + if (npc->unk_B4 != arg1) { + npc->unk_B5 = npc->unk_B4; + npc->unk_B4 = arg1; + npc->unk_B7 = 0; + npc->unk_B6 = 1; + } +} -INCLUDE_ASM(s32, "npc", func_8003B3F8); +void func_8003B3F8(Npc* npc, s32 arg1) { + if (npc->unk_B4 != arg1) { + npc->unk_B5 = npc->unk_B4; + npc->unk_B4 = arg1; + npc->unk_B7 = 0; + npc->unk_B6 = -1; + } +} -INCLUDE_ASM(s32, "npc", func_8003B420); +void func_8003B420(Npc* npc) { + if (npc->unk_B5 == 0) { + npc->unk_B4 = 0; + return; + } + npc->unk_B4 = npc->unk_B5; + npc->unk_B5 = 0; + npc->unk_B7 = 0; + npc->unk_B6 = 1; +} INCLUDE_ASM(s32, "npc", func_8003B44C); INCLUDE_ASM(s32, "npc", func_8003B464); -INCLUDE_ASM(s32, "npc", func_8003B47C); +#ifdef NON_MATCHING +// Rodata issues. +void func_8003B47C(Npc* npc, s32 arg1, s32 arg2) { -INCLUDE_ASM(s32, "npc", func_8003B500); + switch (npc->unk_B4) { + case 0: + func_8003B500(npc, arg1, arg2); + break; + case 1: + func_8003B5B4(npc, arg1, arg2); + break; + case 2: + func_8003BA60(npc, arg1, 0, arg2); + break; + case 3: + func_8003BA60(npc, arg1, 1, arg2); + break; + case 4: + func_8003BED8(npc, arg1, arg2); + break; + } +} +#else +INCLUDE_ASM(void, "npc", func_8003B47C, Npc* npc, s32 arg1, s32 arg2); +#endif + +void func_8003B500(Npc* npc, s32 arg1, s32 arg2) { + + if (npc->unk_B6 != 0) { + npc->screenSpaceOffset2D[0] = 0.0f; + npc->screenSpaceOffset2D[1] = 0.0f; + npc->unk_B6 = 0; + npc->verticalStretch = 1.0f; + } + if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { + s32 temp_a2 = (npc->alpha * npc->alpha2 / 255); + s32 temp = temp_a2 < 255; // TODO: better match? + func_802DE3D8(npc->spriteInstanceID | (temp) << 31, arg1, temp_a2, NULL, arg2); + } else { + render_sprite(0x40000001, arg1, 0, 0, arg2); + } +} INCLUDE_ASM(s32, "npc", func_8003B5B4); @@ -224,49 +810,257 @@ INCLUDE_ASM(s32, "npc", func_8003BA60); INCLUDE_ASM(s32, "npc", func_8003BED8); -INCLUDE_ASM(s32, "npc", func_8003C3D8); - -INCLUDE_ASM(s32, "npc", func_8003C428); - -INCLUDE_ASM(s32, "npc", npc_update_decorations); - -INCLUDE_ASM(s32, "npc", func_8003C53C); - -INCLUDE_ASM(s32, "npc", func_8003C61C); - -void func_8003C658(void) { +void func_8003C3D8(Npc* npc, s32 idx, s8 decorationType) { + func_8003C53C(npc, idx); + npc->decorationType[idx] = decorationType; + npc->changedDecoration[idx] = 1; + npc->decorationInitialised[idx] = 0; } -void func_8003C660(void) { +void func_8003C428(Npc* npc, s32 idx) { + func_8003C53C(npc, idx); } -INCLUDE_ASM(s32, "npc", func_8003C668); +s32 npc_update_decorations(Npc* npc) { + s32 i; -INCLUDE_ASM(s32, "npc", func_8003C78C); - -INCLUDE_ASM(s32, "npc", func_8003C7A8); - -void func_8003C8AC(void) { + for (i = 0; i < 2; i++) { + switch (npc->decorationType[i]) { + case 0: + func_8003C658(npc, i); + break; + case 1: + func_8003C668(npc, i); + break; + case 2: + func_8003C7A8(npc, i); + break; + case 3: + func_8003C8B4(npc, i); + break; + case 4: + func_8003C9A8(npc, i); + break; + case 5: + func_8003CB44(npc, i); + break; + case 6: + func_8003CCB0(npc, i); + break; + } + } } -INCLUDE_ASM(s32, "npc", func_8003C8B4); - -INCLUDE_ASM(s32, "npc", func_8003C984); - -INCLUDE_ASM(s32, "npc", func_8003C9A8); - -INCLUDE_ASM(s32, "npc", func_8003CB20); - -INCLUDE_ASM(s32, "npc", func_8003CB44); - -INCLUDE_ASM(s32, "npc", func_8003CC8C); - -INCLUDE_ASM(s32, "npc", func_8003CCB0); - -void func_8003CFA0(void) { +void func_8003C53C(Npc* npc, s32 idx) { + switch (npc->decorationType[idx]) { + case 0: + func_8003C660(npc, idx); + break; + case 1: + func_8003C78C(npc, idx); + break; + case 2: + func_8003C8AC(npc, idx); + break; + case 3: + func_8003C984(npc, idx); + break; + case 4: + func_8003CB20(npc, idx); + break; + case 5: + func_8003CC8C(npc, idx); + break; + case 6: + func_8003CFA0(npc, idx); + break; + } + npc->decorationType[idx] = 0; } -INCLUDE_ASM(s32, "npc", func_8003CFA8); +void func_8003C61C(Npc* npc, s32 idx) { + switch (npc->decorationType[idx]) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + case 6: + func_8003CFA8(npc, idx); + break; + } +} + +void func_8003C658(Npc* npc, s32 idx) { +} + +void func_8003C660(Npc* npc, s32 idx) { +} + +void fx_sweat(s32, f32, f32, f32, f32, f32, s32); + +void func_80070A30(s32, f32, f32, f32, f32, s32, EffectInstanceData**); +void func_80070EB0(s32, f32, f32, f32, f32, EffectInstanceData**); + +void func_8003C668(Npc* npc, s32 idx) { + EffectInstanceData* instanceData; + + switch (npc->decorationInitialised[idx]) { + case 0: + func_80070EB0(2, npc->pos.x, npc->pos.y, npc->pos.z, 1.0f, &npc->decorations[idx]); + npc->decorationInitialised[idx] = 1; + break; + case 1: + break; + default: + return; + } + + instanceData = npc->decorations[idx]->data; + instanceData->pos.x = npc->pos.x; + instanceData->pos.y = npc->pos.y; + instanceData->pos.z = npc->pos.z; + instanceData->scale.x = (npc->scale.x * npc->collisionRadius) * 0.01; + instanceData->scale.y = (npc->scale.y * npc->collisionHeight) * 0.01; + instanceData->unk_64 = npc->renderYaw; +} + +void func_8003C78C(Npc* npc, s32 idx) { + npc->decorations[idx]->data->unk_2C = 5; +} + +void func_8003C7A8(Npc* npc, s32 idx) { + switch (npc->decorationInitialised[idx]) { + case 0: + if (npc->yawCamOffset > 90) { + fx_sweat(0, npc->pos.x, npc->pos.y + npc->collisionHeight, npc->pos.z, 5.0f, 45.0f, 0x14); + } else { + fx_sweat(0, npc->pos.x, npc->pos.y + npc->collisionHeight, npc->pos.z, 5.0f, -45.0f, 0x14); + } + npc->decorationUnk[idx] = 10; + npc->decorationInitialised[idx] = 1; + break; + case 1: + if (npc->decorationUnk[idx] != 0) { + npc->decorationUnk[idx]--; + } else { + npc->decorationInitialised[idx] = 0; + } + break; + } +} + +void func_8003C8AC(Npc* npc, s32 idx) { +} + +void func_8003C8B4(Npc* npc, s32 idx) { + EffectInstanceData* instanceData; + + switch (npc->decorationInitialised[idx]) { + case 0: + func_80070A30(0, npc->pos.x, npc->pos.y + npc->collisionHeight, npc->pos.z, 20.0f, 3, &npc->decorations[idx]); + npc->decorationInitialised[idx] = 1; + return; + case 1: + break; + default: + return; + + } + + instanceData = npc->decorations[idx]->data; + instanceData->pos.x = npc->pos.x; + instanceData->pos.y = npc->pos.y + npc->collisionHeight; + instanceData->pos.z = npc->pos.z; +} + +void func_8003C984(Npc* npc, s32 idx) { + remove_effect(npc->decorations[idx]); +} + +void func_8003C9A8(Npc* npc, s32 idx) { + EffectInstanceData* instanceData; + + switch (npc->decorationInitialised[idx]) { + case 0: + npc->decorations[idx] = func_80071750(2, npc->pos.x, npc->pos.y + npc->collisionHeight * 0.5, npc->pos.z, + npc->scale.x * 0.8 + 0.2f, -1); + npc->decorationInitialised[idx] = 1; + break; + case 1: + instanceData = npc->decorations[idx]->data; + instanceData->pos.x = npc->pos.x; + instanceData->pos.y = npc->pos.y + npc->collisionHeight * 0.5 * npc->scale.x; + instanceData->pos.z = npc->pos.z; + instanceData->unk_30 = npc->scale.x * 0.8 + 0.2f; + break; + } +} + +void func_8003CB20(Npc* npc, s32 idx) { + remove_effect(npc->decorations[idx]); +} + +void func_8003CB44(Npc* npc, s32 idx) { + EffectInstanceData* instanceData; + + switch (npc->decorationInitialised[idx]) { + case 0: + npc->decorations[idx] = func_80071750(2, npc->pos.x, npc->pos.y + npc->collisionHeight * 0.5, npc->pos.z - 5.0f, 1.0f, + 0); + npc->decorationInitialised[idx] = 1; + break; + case 1: + instanceData = npc->decorations[idx]->data; + instanceData->pos.x = npc->pos.x; + instanceData->pos.y = npc->pos.y + npc->collisionHeight * 0.5; + instanceData->pos.z = npc->pos.z - 5.0f; + instanceData->unk_30 = 1.0f; + break; + } +} + +void func_8003CC8C(Npc* npc, s32 idx) { + remove_effect(npc->decorations[idx]); +} + +void func_8003CCB0(Npc* npc, s32 idx) { + u8 sp50[20]; + u8 sp38[20]; + u8 sp20[20]; + s32 i; + s32 temp3; + + if (!npc->decorationInitialised[idx]) { + func_802DE894(npc->spriteInstanceID, 17, 20, 0, 0, 255, 0); + npc->decorationInitialised[idx] = TRUE; + } + if (npc->decorationInitialised[idx] == TRUE) { + npc->decorationUnk[idx] += 7; + if (npc->decorationUnk[idx] >= 360) { + npc->decorationUnk[idx] = npc->decorationUnk[idx] % 360; + } + + for (i = 0; i < 20; i++) { + sp50[i] = (cosine(npc->decorationUnk[idx] + i * 25) + 1.0) * 80.0f; + sp38[i] = (cosine(npc->decorationUnk[idx] + i * 25 + 45) + 1.0) * 80.0f; + sp20[i] = (cosine(npc->decorationUnk[idx] + i * 25 + 90) + 1.0) * 80.0f; + } + + for (temp3 = 255, i = 0; i < 20; i++) { + func_802DE894(npc->spriteInstanceID, 12, i, (sp50[i] << 24) | (sp38[i] << 16) | (sp20[i] << 8) | temp3, 0, 255, 0); + } + } +} + +void func_8003CFA0(Npc* npc, s32 idx) { +} + +void func_8003CFA8(Npc* npc, s32 idx) { + npc->decorationInitialised[idx] = 0; +} Npc* npc_find_near(f32 x, f32 y, f32 z, f32 radius) { Npc* closestNpc = NULL; @@ -322,17 +1116,192 @@ Npc* npc_find_near_simple(f32 x, f32 y, f32 z, f32 radius) { INCLUDE_ASM(s32, "npc", func_8003D1D4); -INCLUDE_ASM(s32, "npc", func_8003D2F8); +s32 func_8003D2F8(Npc* npc) { + f32 x; + f32 y; + f32 z; + f32 yaw; -INCLUDE_ASM(s32, "npc", func_8003D3BC); + if (npc->flags & NPC_FLAG_PARTICLE) { + y = get_shadow_by_index(npc->shadowIndex)->position.y + 13.0f; + } else { + y = npc->pos.y + 13.0f; + } -INCLUDE_ASM(s32, "npc", func_8003D624); + yaw = 16.0f; + x = npc->pos.x; + z = npc->pos.z; -INCLUDE_ASM(s32, "npc", func_8003D660); + if (func_800DCB7C(0x38000, &x, &y, &z, &yaw)) { + if (yaw <= 16.0f) { + return D_8010C978; + } + } + return 0; +} -INCLUDE_ASM(s32, "npc", func_8003D788); +#ifdef NON_MATCHING +// Rodata issue. Most likely the last function in the TU with a jumptable. +void func_8003D3BC(Npc* npc) { + s32 temp_s4 = npc->unk_98; + s32 temp_s0 = npc->unk_9A; + s32 temp_s5 = npc->unk_9C; + s32 temp_s2 = npc->unk_9E; + s32 temp_s6 = npc->unk_A0; + s32 temp_s3 = npc->unk_A2; -INCLUDE_ASM(s32, "npc", func_8003DA38); + func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0); + + switch (temp_s4) { + case 0: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, temp_s3); + break; + case 2: + case 3: + npc->renderMode = 13; + case 1: + func_802DE894(npc->spriteInstanceID, temp_s4, 0, 0, 0, 0, temp_s3); + break; + case 4: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 4, temp_s0, temp_s5, temp_s2, 0, temp_s3); + break; + case 6: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 6, temp_s0, temp_s5, temp_s2, 255, temp_s3); + break; + case 7: + npc->renderMode = 22; + func_802DE894(npc->spriteInstanceID, 7, 255, 255, 255, temp_s0, temp_s3); + break; + case 8: + npc->renderMode = 22; + func_802DE894(npc->spriteInstanceID, 8, temp_s0, temp_s5, temp_s2, temp_s6, temp_s3); + break; + case 9: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 9, temp_s0, temp_s5, temp_s2, 255, temp_s3); + break; + case 10: + npc->renderMode = 22; + func_802DE894(npc->spriteInstanceID, 10, temp_s0, temp_s5, temp_s2, temp_s6, temp_s3); + break; + case 5: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 5, temp_s0, temp_s5, temp_s2, 0, temp_s3); + break; + case 13: + npc->renderMode = 22; + func_802DE894(npc->spriteInstanceID, 13, temp_s0, temp_s5, temp_s2, temp_s6, temp_s3); + break; + case 14: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 14, temp_s0, temp_s5, temp_s2, 255, temp_s3); + break; + case 15: + npc->renderMode = 13; + func_802DE894(npc->spriteInstanceID, 15, temp_s0, 255, 0, 255, temp_s3); + break; + case 16: + npc->renderMode = 22; + func_802DE894(npc->spriteInstanceID, 15, temp_s0, temp_s5, 0, temp_s5, temp_s3); + break; + default: + break; + } +} +#else +INCLUDE_ASM(void, "npc", func_8003D3BC, Npc* npc); +#endif + +void func_8003D624(Npc* npc, s16 arg1, s16 arg2, s16 arg3, s32 arg4, s32 arg5, s32 arg6) { + npc->unk_98 = arg1; + npc->unk_9A = arg2; + npc->unk_9C = arg3; + npc->unk_9E = arg4; + npc->unk_A0 = arg5; + npc->unk_A2 = arg6; + func_8003D3BC(npc); +} + +#ifdef NON_MATCHING +// Rodata padding issue. Most likely belongs to a separate TU than the function above with the switch. +void func_8003D660(Npc* npc, s32 arg1) { + Temp8010EBB0* temp = &D_8010EBB0; + + if ((npc->flags & (NPC_FLAG_400000 | NPC_FLAG_2)) == NPC_FLAG_400000) { + if (npc->moveSpeed != 0.0f) { + switch (get_collider_type_by_id((u16)npc->unk_84) & 0xFF) { + case 6: + func_8003DA38(npc, arg1); + return; + case 7: + func_8003DC38(npc, arg1); + return; + case 8: + if ((temp->unk_00 == 0) || (temp->unk_03 != 8)) { + func_8003DFA0(npc, arg1); + return; + } + break; + case 9: + func_8003E0D4(npc, arg1); + return; + case 1: + func_8003E1D0(npc, arg1); + return; + case 2: + case 3: + case 4: + case 5: + default: + func_8003D788(npc, arg1); + return; + } + } + } +} +#else +INCLUDE_ASM(void, "npc", func_8003D660, Npc* npc, s32 arg1); +#endif + +void func_8003D788(Npc* npc, s32 arg1) { + s32 phi_a2; + f32 subroutine_argA; + f32 subroutine_argB; + + phi_a2 = 0; + if (gGameStatusPtr->areaID == 5) { + phi_a2 = gGameStatusPtr->mapID == 2; + } + if (arg1 == 2) { + f32 x = npc->pos.x; + f32 y = npc->pos.y + 0.0f; + f32 z = npc->pos.z; + if (phi_a2 == 0) { + fx_walk_large(0, x, y, z, D_80077C10); + D_80077C10 = clamp_angle(D_80077C10 + 35.0f); + return; + } + func_80072350(3, x, y, z, 13.0f, 10.0f, 1.0f, 5, 30); + } else if (arg1 != 0) { + if (D_80077C14++ >= 4) { + D_80077C14 = 0; + if (phi_a2 == 0) { + sin_cos_rad((clamp_angle(-npc->yaw) * TAU) / 360.0f, &subroutine_argA, &subroutine_argB); + fx_walk_normal(0, npc->pos.x + (npc->collisionRadius * subroutine_argA * 0.2f), npc->pos.y + 1.5f, + npc->pos.z + (npc->collisionRadius * subroutine_argB * 0.2f), subroutine_argA, subroutine_argB); + } else { + sin_cos_rad((clamp_angle(npc->yaw) * TAU) / 360.0f, &subroutine_argA, &subroutine_argB); + func_80072350(3, npc->pos.x + (npc->collisionRadius * subroutine_argA), npc->pos.y + 1.5f, + npc->pos.z + (npc->collisionRadius * subroutine_argB), 5.0f, 10.0f, 1.0f, 5, 30); + } + } + } +} + +INCLUDE_ASM(void, "npc", func_8003DA38, Npc* npc, s32 arg1); INCLUDE_ASM(s32, "npc", func_8003DC38); @@ -531,22 +1500,224 @@ void make_npcs(s8 flags, s8 mapID, s32* npcGroupList) { } } -INCLUDE_ASM(s32, "npc", kill_encounter); +s32 kill_encounter(Enemy* enemy) { + Encounter* encounter = gCurrentEncounter.encounterList[enemy->encounterIndex]; + s32 i; -INCLUDE_ASM(s32, "npc", kill_enemy); + for (i = 0; i < encounter->count; i++) { + Enemy* currentEnemy = encounter->enemy[i]; + if (currentEnemy != NULL) { + kill_enemy(currentEnemy); + encounter->enemy[i] = NULL; + } + } +} -INCLUDE_ASM(s32, "npc", bind_enemy_ai); +#ifdef NON_MATCHING +// regalloc. s2/s3 switched +void kill_enemy(Enemy* enemy) { + EncounterStatus* encounterStatus = &gCurrentEncounter; + Encounter* encounter = encounterStatus->encounterList[enemy->encounterIndex]; + s32 i; + s32 j; -INCLUDE_ASM(s32, "npc", bind_enemy_aux); + for (i = 0; i < encounter->count; i++) { + Enemy* currentEnemy = encounter->enemy[i]; + if (currentEnemy == enemy) { + break; + } + } -INCLUDE_ASM(s32, "npc", bind_enemy_interact); + if (enemy->initScript != NULL) { + kill_script_by_ID(enemy->initScriptID); + } + if (enemy->interactScript != NULL) { + kill_script_by_ID(enemy->interactScriptID); + } + if (enemy->aiScript != NULL) { + kill_script_by_ID(enemy->aiScriptID); + } + if (enemy->hitScript != NULL) { + kill_script_by_ID(enemy->hitScriptID); + } + if (enemy->auxScript != NULL) { + kill_script_by_ID(enemy->auxScriptID); + } + if (enemy->defeatScript != NULL) { + kill_script_by_ID(enemy->defeatScriptID); + } -INCLUDE_ASM(s32, "npc", bind_npc_ai); + enemy->interactBytecode = NULL; + enemy->aiBytecode = NULL; + enemy->hitBytecode = NULL; + enemy->auxBytecode = NULL; + enemy->defeatBytecode = NULL; -INCLUDE_ASM(s32, "npc", bind_npc_aux); + npc_free(get_npc_unsafe(enemy->npcID)); -INCLUDE_ASM(s32, "npc", bind_npc_interact); + if (enemy->unk_64 != NULL) { + heap_free(enemy->unk_64); + } -INCLUDE_ASM(Enemy*, "npc", get_enemy, NpcID npcId); + for (j = 0; j < ARRAY_COUNT(encounter->enemy); j++) { + if (encounter->enemy[j] == enemy) { + encounter->enemy[j] = NULL; + } + } -INCLUDE_ASM(s32, "npc", get_enemy_safe); + if (!(enemy->flags & 4)) { + if (!(enemy->flags & 8) || (enemy == encounterStatus->currentEnemy)) { + if (!(enemy->flags & 1)) { + if (!(enemy->flags & 0x10)) { + COPY_set_defeated((s8)encounterStatus->mapID, encounter->encounterID + i); + } + } + } + } + heap_free(enemy); +} +#else +INCLUDE_ASM(void, "npc", kill_enemy); +#endif + +s32 bind_enemy_ai(Enemy* enemy, Script* aiScriptBytecode) { + ScriptInstance* aiScript; + s32 id; + + if (enemy->aiScript != NULL) { + kill_script_by_ID(enemy->aiScript->id); + } + enemy->aiBytecode = aiScriptBytecode; + aiScript = enemy->aiScript = start_script(aiScriptBytecode, 0xA, 0); + id = enemy->aiScriptID = aiScript->id; + aiScript->owner1.enemy = enemy; + return id; +} + +s32 bind_enemy_aux(Enemy* enemy, Script* auxScriptBytecode) { + ScriptInstance* auxScript; + s32 id; + + if (enemy->auxScript != NULL) { + kill_script_by_ID(enemy->auxScript->id); + } + enemy->auxBytecode = auxScriptBytecode; + auxScript = enemy->auxScript = start_script(auxScriptBytecode, 0xA, 0); + id = enemy->auxScriptID = auxScript->id; + auxScript->owner1.enemy = enemy; + return id; +} + +s32 bind_enemy_interact(Enemy* enemy, Script* interactScriptBytecode) { + ScriptInstance* interactScript; + s32 id; + + if (enemy->interactScript != NULL) { + kill_script_by_ID(enemy->interactScript->id); + } + enemy->interactBytecode = interactScriptBytecode; + interactScript = enemy->interactScript = start_script(interactScriptBytecode, 0xA, 0); + id = enemy->interactScriptID = interactScript->id; + interactScript->owner1.enemy = enemy; + return id; +} + +void bind_npc_ai(s32 npcID, Script* npcAiBytecode) { + EncounterStatus* currentEncounterStatus = &gCurrentEncounter; + s32 i; + s32 j; + + for (i = 0; i < currentEncounterStatus->numEncounters; i++) { + Encounter* currentEncounter = currentEncounterStatus->encounterList[i]; + if (currentEncounter != NULL) { + for (j = 0; j < currentEncounter->count; j++) { + Enemy* currentEnemy = currentEncounter->enemy[j]; + if ((currentEnemy != NULL) && (currentEnemy->npcID == npcID)) { + bind_enemy_ai(currentEnemy, npcAiBytecode); + break; + } + } + } + } +} + +void bind_npc_aux(s32 npcID, Script* npcAuxBytecode) { + EncounterStatus* currentEncounterStatus = &gCurrentEncounter; + s32 i; + s32 j; + + for (i = 0; i < currentEncounterStatus->numEncounters; i++) { + Encounter* currentEncounter = currentEncounterStatus->encounterList[i]; + if (currentEncounter != NULL) { + for (j = 0; j < currentEncounter->count; j++) { + Enemy* currentEnemy = currentEncounter->enemy[j]; + if ((currentEnemy != NULL) && (currentEnemy->npcID == npcID)) { + bind_enemy_aux(currentEnemy, npcAuxBytecode); + break; + } + } + } + } +} + +void bind_npc_interact(s32 npcID, Script* npcInteractBytecode) { + EncounterStatus* currentEncounterStatus = &gCurrentEncounter; + s32 i; + s32 j; + + for (i = 0; i < currentEncounterStatus->numEncounters; i++) { + Encounter* currentEncounter = currentEncounterStatus->encounterList[i]; + if (currentEncounter != NULL) { + for (j = 0; j < currentEncounter->count; j++) { + Enemy* currentEnemy = currentEncounter->enemy[j]; + if ((currentEnemy != NULL) && (currentEnemy->npcID == npcID)) { + bind_enemy_interact(currentEnemy, npcInteractBytecode); + break; + } + } + } + } +} + +Enemy* get_enemy(s32 npcID) { + EncounterStatus* currentEncounterStatus = &gCurrentEncounter; + s32 i; + s32 j; + + for (i = 0; i < currentEncounterStatus->numEncounters; i++) { + Encounter* currentEncounter = currentEncounterStatus->encounterList[i]; + if (currentEncounter != NULL) { + for (j = 0; j < currentEncounter->count; j++) { + Enemy* currentEnemy = currentEncounter->enemy[j]; + if ((currentEnemy != NULL) && (currentEnemy->npcID == npcID)) { + return currentEnemy; + } + } + } + } + PANIC(); +} + +#ifdef NON_MATCHING +// Matching, but having a TU padding issue +Enemy* get_enemy_safe(s32 npcID) { + EncounterStatus* currentEncounterStatus = &gCurrentEncounter; + s32 i; + s32 j; + + for (i = 0; i < currentEncounterStatus->numEncounters; i++) { + Encounter* currentEncounter = currentEncounterStatus->encounterList[i]; + if (currentEncounter != NULL) { + for (j = 0; j < currentEncounter->count; j++) { + Enemy* currentEnemy = currentEncounter->enemy[j]; + if ((currentEnemy != NULL) && (currentEnemy->npcID == npcID)) { + return currentEnemy; + } + } + } + } + return NULL; +} +#else +INCLUDE_ASM(Enemy*, "npc", get_enemy_safe, s32 npcID); +#endif diff --git a/src/npc.h b/src/npc.h index 9a0a1d2008..40dfec494a 100644 --- a/src/npc.h +++ b/src/npc.h @@ -20,11 +20,11 @@ void npc_list_update_current(void); /// Presumably did something once upon a time but got commented out. void npc_iter_no_op(void); -void npc_create(NpcBlueprint* blueprint, NpcAnimID animList[], s32 skipLoadingAnims); +s32 npc_create(NpcBlueprint* blueprint, NpcAnimID** animList, s32 skipLoadingAnims); void npc_create_basic(NpcBlueprint* blueprint); -void npc_create_standard(NpcBlueprint* blueprint, NpcAnimID animList[]); +void npc_create_standard(NpcBlueprint* blueprint, NpcAnimID** animList); void npc_create_partner(NpcBlueprint* blueprint); @@ -48,7 +48,7 @@ s32 func_800397E8(); /// Updates all NPCs. void npc_list_update(void); -s32 func_80039DA4(); +f32 func_80039DA4(); void npc_appendGfx(Npc* npc); @@ -70,29 +70,29 @@ void update_npc_blur(Npc* npc); void appendGfx_npc_blur(Npc* npc); -s32 func_8003B184(); +void func_8003B184(void); -s32 func_8003B198(); +void func_8003B198(void); void func_8003B1A8(void); -s32 func_8003B1B0(); +void func_8003B1B0(void); void set_npc_yaw(Npc* npc, f32 yaw); -s32 func_8003B3D0(); +void func_8003B3D0(Npc* npc, s32 arg1); -s32 func_8003B3F8(); +void func_8003B3F8(Npc* npc, s32 arg1); -s32 func_8003B420(); +void func_8003B420(Npc* npc); s32 func_8003B44C(); s32 func_8003B464(); -s32 func_8003B47C(); +void func_8003B47C(Npc* npc, s32 arg1, s32 arg2); -s32 func_8003B500(); +void func_8003B500(Npc* npc, s32 arg1, s32 arg2); s32 func_8003B5B4(); @@ -102,45 +102,45 @@ s32 func_8003BA60(); s32 func_8003BED8(); -s32 func_8003C3D8(); +void func_8003C3D8(Npc* npc, s32 idx, s8 decorationType); -s32 func_8003C428(); +void func_8003C428(Npc* npc, s32 idx); -s32 func_8003C444(); +s32 npc_update_decorations(Npc* npc); -s32 func_8003C53C(); +void func_8003C53C(Npc* npc, s32 idx); -s32 func_8003C61C(); +void func_8003C61C(Npc* npc, s32 idx); -void func_8003C658(void); +void func_8003C658(Npc* npc, s32 idx); -void func_8003C660(void); +void func_8003C660(Npc* npc, s32 idx); -s32 func_8003C668(); +void func_8003C668(Npc* npc, s32 idx); -s32 func_8003C78C(); +void func_8003C78C(Npc* npc, s32 idx); -s32 func_8003C7A8(); +void func_8003C7A8(Npc* npc, s32 idx); -void func_8003C8AC(void); +void func_8003C8AC(Npc* npc, s32 idx); -s32 func_8003C8B4(); +void func_8003C8B4(Npc* npc, s32 idx); -s32 func_8003C984(); +void func_8003C984(Npc* npc, s32 idx); -s32 func_8003C9A8(); +void func_8003C9A8(Npc* npc, s32 idx); -s32 func_8003CB20(); +void func_8003CB20(Npc* npc, s32 idx); -s32 func_8003CB44(); +void func_8003CB44(Npc* npc, s32 idx); -s32 func_8003CC8C(); +void func_8003CC8C(Npc* npc, s32 idx); -s32 func_8003CCB0(); +void func_8003CCB0(Npc* npc, s32 idx); -void func_8003CFA0(void); +void func_8003CFA0(Npc* npc, s32 idx); -s32 func_8003CFA8(); +void func_8003CFA8(Npc* npc, s32 idx); /// Finds the closest NPC to a given point within a radius. Ignores Y position. /// @@ -168,19 +168,19 @@ Npc* npc_find_near(f32 x, f32 y, f32 z, f32 radius); /// @returns NULL if there are no NPCs within radius Npc* npc_find_near_simple(f32 x, f32 y, f32 z, f32 radius); -s32 func_8003D1D4(); +//s32 func_8003D1D4(); -s32 func_8003D2F8(); +s32 func_8003D2F8(Npc* npc); -s32 func_8003D3BC(); +void func_8003D3BC(Npc* npc); -s32 func_8003D624(); +void func_8003D624(Npc* npc, s16 arg1, s16 arg2, s16 arg3, s32 arg4, s32 arg5, s32 arg6); -s32 func_8003D660(); +void func_8003D660(Npc* npc, s32 arg1); -s32 func_8003D788(); +void func_8003D788(Npc* npc, s32 arg1); -s32 func_8003DA38(); +void func_8003DA38(Npc* npc, s32 arg1); s32 func_8003DC38(); @@ -211,24 +211,58 @@ void npc_dyn_entity_draw_no_op(void); void make_npcs(s8 flags, s8 mapID, s32* npcGroupList); -s32 kill_encounter(); +s32 kill_encounter(Enemy* enemy); -s32 kill_enemy(); +void kill_enemy(Enemy* enemy); -s32 bind_enemy_ai(); +/// Binds the specified ai script to the specified enemy +/// +/// @param enemy pointer to the enemy to bind the script to +/// @param aiScriptBytecode pointer to the script to be bound. +s32 bind_enemy_ai(Enemy* enemy, Script* aiScriptBytecode); -s32 bind_enemy_aux(); +/// Binds the specified auxillary script to the specified enemy +/// +/// @param enemy pointer to the enemy to bind the script to +/// @param auxScriptBytecode pointer to the script to be bound. +s32 bind_enemy_aux(Enemy* enemy, Script* auxScriptBytecode); -s32 bind_enemy_interact(); +/// Binds the specified interact script to the specified enemy +/// +/// @param enemy pointer to the enemy to bind the script to +/// @param interactScriptBytecode pointer to the script to be bound. +s32 bind_enemy_interact(Enemy* enemy, Script* interactScriptBytecode); -s32 bind_npc_ai(); +/// Binds the specified ai script to the npc matching the specified npcId +/// +/// @param npcID ID of the desired npc +/// @param npcAiBytecode pointer to the script to be bound. +void bind_npc_ai(s32 npcID, Script* npcAiBytecode); -s32 bind_npc_aux(); +/// Binds the specified auxillary script to the npc matching the specified npcId +/// +/// @param npcID ID of the desired npc +/// @param npcAuxBytecode pointer to the script to be bound. +void bind_npc_aux(s32 npcID, Script* npcAuxBytecode); -s32 bind_npc_interact(); +/// Binds the specified interact script to the npc matching the specified npcId +/// +/// @param npcID ID of the desired npc +/// @param npcInteractBytecode pointer to the script to be bound. +void bind_npc_interact(s32 npcID, Script* npcInteractBytecode); +/// Looks for an enemy matching the specified npcID. +/// +/// @param npcID ID of the npc bound to the desired enemy. +/// +/// @returns pointer to Enemy struct, if one is found. If one is not found, a panic occurs. Enemy* get_enemy(NpcID npcID); -s32 get_enemy_safe(); +/// Same as get_enemy(), with the exception of always returning a value if an enemy is not found. +/// +/// @param npcID ID of the npc bound to the desired enemy. +/// +/// @returns pointer to Enemy struct, if one is found. Otherwise, NULL. +Enemy* get_enemy_safe(s32 npcID); #endif diff --git a/src/os/3f6d0_len_320.c b/src/os/3f6d0_len_320.c index b40f1e3921..b56272f5be 100644 --- a/src/os/3f6d0_len_320.c +++ b/src/os/3f6d0_len_320.c @@ -2,6 +2,6 @@ f32 D_80093DD0 = M_DTOR; -INCLUDE_ASM(s32, "os/3f6d0_len_320", guRotateAnglesF); +INCLUDE_ASM(void, "os/3f6d0_len_320", guRotateAnglesF, float mf[4][4], f32 x, f32 y, f32 z); INCLUDE_ASM(s32, "os/3f6d0_len_320", guRotateAngles); diff --git a/src/pause/pause_items.c b/src/pause/pause_items.c index 24b661e25b..6f82697fb5 100644 --- a/src/pause/pause_items.c +++ b/src/pause/pause_items.c @@ -156,7 +156,7 @@ void pause_items_init(s8* arg0) { setup_pause_menu_tab(&D_8024F5C0, 1); *arg0 = 1; - } +} INCLUDE_ASM(s32, "pause/pause_items", pause_items_handle_input); diff --git a/src/sprite.c b/src/sprite.c index f457de98b3..1ba43a8793 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -53,14 +53,16 @@ Vtx spr_defaultQuad[] = { }; Vp D_802DF3D0 = {{ - { 640, 480, 511, 0 }, - { 640, 480, 511, 0 }, -}}; + { 640, 480, 511, 0 }, + { 640, 480, 511, 0 }, + } +}; Vp D_802DF3E0 = {{ - { 640, 480, 511, 0 }, - { 640, 480, 512, 0 }, -}}; + { 640, 480, 511, 0 }, + { 640, 480, 512, 0 }, + } +}; Gfx D_802DF3F0[] = { gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING), @@ -232,7 +234,8 @@ void spr_init_sprites(s32 playerSpriteSet) { } flags = (&spr_playerSpriteSets[playerSpriteSet])->initiallyLoaded; - func_802DED60((&spr_playerSpriteSets[playerSpriteSet])->cacheSize, (&spr_playerSpriteSets[playerSpriteSet])->rasterSize); + func_802DED60((&spr_playerSpriteSets[playerSpriteSet])->cacheSize, + (&spr_playerSpriteSets[playerSpriteSet])->rasterSize); for (i = 1; i < 0xE; i++) { if ((flags >> i) & 1) { @@ -277,7 +280,7 @@ s32 func_802DDA84(void) { INCLUDE_ASM(void, "sprite", func_802DDA8C, s32 arg0, s32 arg1, f32 arg2); -INCLUDE_ASM(s32, "sprite", render_sprite); +INCLUDE_ASM(void, "sprite", render_sprite, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); INCLUDE_ASM(s32, "sprite", func_802DDEC4); @@ -293,7 +296,7 @@ INCLUDE_ASM(s32, "sprite", func_802DE0EC); INCLUDE_ASM(s32, "sprite", spr_update_sprite, s32 arg0, s32 arg1, f32 arg2); -INCLUDE_ASM(s32, "sprite", func_802DE3D8); +INCLUDE_ASM(void, "sprite", func_802DE3D8, s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f* arg4); INCLUDE_ASM(s32, "sprite", func_802DE5C8); @@ -309,6 +312,6 @@ INCLUDE_ASM(s32, "sprite", func_802DE8DC); INCLUDE_ASM(s32, "sprite", func_802DE9D8); -INCLUDE_ASM(s32, "sprite", func_802DEA40); +INCLUDE_ASM(s32*, "sprite", func_802DEA40, u16 arg0); INCLUDE_ASM(s32, "sprite", func_802DEA6C); diff --git a/src/world/action/16.c b/src/world/action/16.c index b9a7395f23..0da0df834c 100644 --- a/src/world/action/16.c +++ b/src/world/action/16.c @@ -33,7 +33,8 @@ void func_802B6000_E287F0(void) { gPlayerStatus.gravityIntegrator[3] = -0.0987f; gPlayerStatus.flags |= 8; - D_802B6240 = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, gPlayerStatus.lastGoodPosition.x, gPlayerStatus.lastGoodPosition.z); + D_802B6240 = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, gPlayerStatus.lastGoodPosition.x, + gPlayerStatus.lastGoodPosition.z); gPlayerStatus.currentSpeed = func_800E0088(gPlayerStatus.lastGoodPosition.x, gPlayerStatus.lastGoodPosition.z) / 18.0f; } diff --git a/src/world/area_arn/arn_02/events.c b/src/world/area_arn/arn_02/events.c index 44239877d6..4f09d1f8a6 100644 --- a/src/world/area_arn/arn_02/events.c +++ b/src/world/area_arn/arn_02/events.c @@ -167,7 +167,7 @@ StaticNpc N(npcGroup_802418AC) = { .yaw = 90, .dropFlags = 0x80, .itemDropChance = 20, - { ITEM_DRIED_SHROOM, 10, 0 }, + { ITEM_DRIED_SHROOM, 10, 0 }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), .maxCoinBonus = 2, @@ -202,7 +202,7 @@ NpcGroupList N(npcGroupList_80241A9C) = { s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); f32 phi_f20; s32 ret = FALSE; @@ -217,8 +217,8 @@ s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, E } if (fabsf(get_clamped_angle_diff(phi_f20, - atan2(npc->pos.x, npc->pos.z, - gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) { + atan2(npc->pos.x, npc->pos.z, + gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) { ret = FALSE; } if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) { @@ -234,13 +234,13 @@ s32 N(func_80240000_BDD1B0)(ScriptInstance* script, NpcAISettings* aiSettings, E void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (script->functionTemp[1].s <= 0) { script->functionTemp[1].s = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); npc->duration = 12; @@ -263,7 +263,7 @@ void N(func_802401D4_BDD384)(ScriptInstance* script, NpcAISettings* aiSettings, void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); if (npc->duration % 3 == 0) { @@ -277,7 +277,8 @@ void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->unk_10.z = npc->pos.z; enemy->unk_07 = 1; npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9; + npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9; if (npc->duration < 15) { npc->duration = 15; } @@ -289,11 +290,11 @@ void N(func_80240694_BDD844)(ScriptInstance* script, NpcAISettings* aiSettings, void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -311,9 +312,9 @@ void N(func_80240984_BDDB34)(ScriptInstance* script, NpcAISettings* aiSettings, #include "world/common/UnkDurationCheck.inc.c" -s32 N(func_80240C90_BDDE40)(ScriptInstance *script, s32 isInitialCall) { +s32 N(func_80240C90_BDDE40)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++); EnemyTerritoryThing territory; diff --git a/src/world/area_arn/arn_02/header.c b/src/world/area_arn/arn_02/header.c index cd8f2db5ed..50443b8630 100644 --- a/src/world/area_arn/arn_02/header.c +++ b/src/world/area_arn/arn_02/header.c @@ -21,8 +21,7 @@ Script N(80241040) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_03/events.c b/src/world/area_arn/arn_03/events.c index 5008970e88..6b3a281ba7 100644 --- a/src/world/area_arn/arn_03/events.c +++ b/src/world/area_arn/arn_03/events.c @@ -154,10 +154,12 @@ Script N(interact_80241EB0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(2) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0073)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0073)); SI_AREA_FLAG(2) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0074)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0074)); SI_AREA_FLAG(2) = 0; } } @@ -256,7 +258,8 @@ Script N(init_802424E0) = SCRIPT({ Script N(interact_8024254C) = SCRIPT({ if (SI_MAP_VAR(0) != 0) { if (SI_MAP_VAR(0) >= SI_MAP_VAR(1)) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0081)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0081)); SI_VAR(0) = 118; SI_VAR(1) = 1; await N(80241C6C); @@ -266,17 +269,20 @@ Script N(interact_8024254C) = SCRIPT({ SI_SAVE_FLAG(1020) = 0; return; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0080)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0080)); return; } } match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(3) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0079)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0079)); SI_AREA_FLAG(3) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007A)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x007A)); SI_AREA_FLAG(3) = 0; } } @@ -296,7 +302,8 @@ Script N(interact_8024254C) = SCRIPT({ if (SI_SAVE_FLAG(1015) == 0) { if (SI_SAVE_VAR(348) == 18) { await N(80241E68); - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x007F)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x007F)); EndSpeech(-1, 9765124, 9765121, 0); SI_MAP_VAR(0) = 0; SI_MAP_VAR(1) = 450; @@ -344,7 +351,7 @@ Script N(802429D4) = SCRIPT({ } spawn { MakeLerp(0, 255, 40, 0); - 10: +10: UpdateLerp(); func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0); sleep 1; @@ -365,7 +372,7 @@ Script N(80242B0C) = SCRIPT({ } spawn { MakeLerp(255, 0, 40, 0); - 10: +10: UpdateLerp(); func_802CFD30(0x4, 7, SI_VAR(0), 0, 0, 0); sleep 1; @@ -408,10 +415,12 @@ Script N(interact_80242DC4) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(4) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0082)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0082)); SI_AREA_FLAG(4) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0083)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0083)); SI_AREA_FLAG(4) = 0; } } @@ -472,10 +481,12 @@ Script N(interact_802431C8) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(5) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008C)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x008C)); SI_AREA_FLAG(5) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x008D)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x008D)); SI_AREA_FLAG(5) = 0; } } @@ -850,7 +861,7 @@ Script N(makeEntities) = SCRIPT({ void N(func_80240000_BDED90)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -872,7 +883,7 @@ void N(func_80240000_BDED90)(ScriptInstance* script, NpcAISettings* aiSettings, } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -970,7 +981,7 @@ void N(func_8024067C_BDF40C)(ScriptInstance* script, NpcAISettings* aiSettings, if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1012,7 +1023,7 @@ ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -1123,7 +1134,7 @@ void N(func_80241068_BDFDF8)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { script->functionTemp[0].s = 4; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } } } diff --git a/src/world/area_arn/arn_03/header.c b/src/world/area_arn/arn_03/header.c index 116050e9bb..fcfbab89b2 100644 --- a/src/world/area_arn/arn_03/header.c +++ b/src/world/area_arn/arn_03/header.c @@ -20,8 +20,7 @@ Script N(80241780) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_04/events.c b/src/world/area_arn/arn_04/events.c index 97ee7afa4f..5f80545486 100644 --- a/src/world/area_arn/arn_04/events.c +++ b/src/world/area_arn/arn_04/events.c @@ -57,8 +57,8 @@ NpcSettings N(npcSettings_802436B0) = { }; f32 N(D_802436DC_BE6E8C)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_802436F4) = { @@ -127,7 +127,7 @@ StaticNpc N(npcGroup_80243840) = { .yaw = 90, .dropFlags = 0x80, .itemDropChance = 20, - { ITEM_DRIED_SHROOM, 10, 0 }, + { ITEM_DRIED_SHROOM, 10, 0 }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), .maxCoinBonus = 2, @@ -161,7 +161,7 @@ StaticNpc N(npcGroup_80243A30) = { .yaw = 90, .dropFlags = 0x80, .itemDropChance = 20, - { ITEM_DRIED_SHROOM, 10, 0 }, + { ITEM_DRIED_SHROOM, 10, 0 }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), .maxCoinBonus = 2, @@ -277,7 +277,7 @@ Script N(makeEntities) = SCRIPT({ void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -299,7 +299,7 @@ void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings, } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -397,7 +397,7 @@ void N(func_8024067C_BE3E2C)(ScriptInstance* script, NpcAISettings* aiSettings, if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -439,7 +439,7 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -508,14 +508,14 @@ void N(func_80240E90_BE4640)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -637,9 +637,9 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -667,7 +667,8 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_arn/arn_04/events", arn_04_func_80241040_BE47F0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_arn/arn_04/events", arn_04_func_80241040_BE47F0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1_copy.inc.c" @@ -754,9 +755,9 @@ ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; } -s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, EnemyTerritoryThing* territory) { +s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); f32 phi_f20; s32 ret = FALSE; @@ -771,8 +772,8 @@ s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, E } if (fabsf(get_clamped_angle_diff(phi_f20, - atan2(npc->pos.x, npc->pos.z, - gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) { + atan2(npc->pos.x, npc->pos.z, + gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 75.0) { ret = FALSE; } if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) { @@ -788,13 +789,13 @@ s32 N(func_80242388_BE5B38)(ScriptInstance* script, NpcAISettings *aiSettings, E void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (script->functionTemp[1].s <= 0) { script->functionTemp[1].s = aiSettings->unk_14; if (func_800490B4(territory, enemy, aiSettings->alertRadius * 0.85, aiSettings->unk_10.f, 0)) { - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); npc->duration = 12; @@ -817,7 +818,7 @@ void N(func_8024255C_BE5D0C)(ScriptInstance* script, NpcAISettings* aiSettings, void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); if (npc->duration % 3 == 0) { @@ -831,7 +832,8 @@ void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, enemy->unk_10.z = npc->pos.z; enemy->unk_07 = 1; npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9; + npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9; if (npc->duration < 15) { npc->duration = 15; } @@ -843,11 +845,11 @@ void N(func_80242A1C_BE61CC)(ScriptInstance* script, NpcAISettings* aiSettings, void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -867,7 +869,7 @@ void N(func_80242D0C_BE64BC)(ScriptInstance* script, NpcAISettings* aiSettings, ApiStatus N(func_80243018_BE67C8)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; NpcAISettings* aiSettings = (NpcAISettings*)get_variable(script, *args++); EnemyTerritoryThing territory; diff --git a/src/world/area_arn/arn_04/header.c b/src/world/area_arn/arn_04/header.c index 91f0b1c1cd..ed8cbc03b6 100644 --- a/src/world/area_arn/arn_04/header.c +++ b/src/world/area_arn/arn_04/header.c @@ -21,8 +21,7 @@ Script N(802433D0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_05/events.c b/src/world/area_arn/arn_05/events.c index 287d7d4ef1..c4e021d0d6 100644 --- a/src/world/area_arn/arn_05/events.c +++ b/src/world/area_arn/arn_05/events.c @@ -103,10 +103,12 @@ Script N(interact_80241794) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(6) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0092)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0092)); SI_AREA_FLAG(6) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0093)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0093)); SI_AREA_FLAG(6) = 0; } } @@ -133,10 +135,12 @@ Script N(interact_80241924) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(7) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x0099)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x0099)); SI_AREA_FLAG(7) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x009A)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x009A)); SI_AREA_FLAG(7) = 0; } } @@ -170,13 +174,16 @@ Script N(interact_80241AB4) = SCRIPT({ >= STORY_CH5_STAR_SPRIT_DEPARTED { if (SI_SAVE_FLAG(1014) == 1) { if (SI_AREA_FLAG(9) == 1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AE)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_5), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00AE)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B0)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00B0)); } } else { SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7)); - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AA)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_7), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00AA)); SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_9)); ContinueSpeech(-1, NPC_ANIM(boo, Palette_01, Anim_9), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00AB)); SetNpcAnimation(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_A)); @@ -224,10 +231,12 @@ Script N(interact_80241E28) = SCRIPT({ match STORY_PROGRESS { < STORY_CH3_TUBBA_CHASED_MARIO_IN_FOYER { if (SI_AREA_FLAG(8) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B3)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00B3)); SI_AREA_FLAG(8) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00B4)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00B4)); SI_AREA_FLAG(8) = 0; } } @@ -994,7 +1003,7 @@ Script N(makeEntities) = SCRIPT({ void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -1016,7 +1025,7 @@ void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings, } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1040,7 +1049,7 @@ void N(func_8024067C_BE825C)(ScriptInstance* script, NpcAISettings* aiSettings, if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1082,7 +1091,7 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -1194,7 +1203,7 @@ void N(func_80241068_BE8C48)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { script->functionTemp[0].s = 4; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } } } diff --git a/src/world/area_arn/arn_05/header.c b/src/world/area_arn/arn_05/header.c index 6e7c2ca971..4d53f84db1 100644 --- a/src/world/area_arn/arn_05/header.c +++ b/src/world/area_arn/arn_05/header.c @@ -24,8 +24,7 @@ Script N(80241360) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_07/BECDF0.c b/src/world/area_arn/arn_07/BECDF0.c index 4760cc3b64..a4f4c3a378 100644 --- a/src/world/area_arn/arn_07/BECDF0.c +++ b/src/world/area_arn/arn_07/BECDF0.c @@ -148,7 +148,7 @@ ApiStatus N(func_802401AC_BECF9C)(ScriptInstance* script, s32 isInitialCall) { ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); if (!(dist3D(playerStatus->position.x, playerStatus->position.y + 20.0f, playerStatus->position.z, - ptr->unk_00, ptr->unk_04, ptr->unk_08) > 30.0f)) { + ptr->unk_00, ptr->unk_04, ptr->unk_08) > 30.0f)) { ptr->unk_4E = 3; } break; @@ -568,8 +568,7 @@ Script N(main) = SCRIPT({ } == STORY_CH3_BEGAN_PEACH_MISSION { MakeNpcs(0, N(npcGroupList_802478E8)); - } - else { + } else { MakeNpcs(0, N(npcGroupList_802478B8)); } } diff --git a/src/world/area_arn/arn_07/events.c b/src/world/area_arn/arn_07/events.c index 07d432ec12..f529346b4f 100644 --- a/src/world/area_arn/arn_07/events.c +++ b/src/world/area_arn/arn_07/events.c @@ -86,8 +86,8 @@ Script N(makeEntities) = SCRIPT({ }); f32 N(D_80243BC0_BF09B0)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_80243BD8) = { @@ -316,9 +316,11 @@ Script N(80243FE8) = SCRIPT({ SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00CE)); ShowChoice(1966093); if (SI_VAR(0) == 0) { - ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00CF)); + ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, + MESSAGE_ID(0x0E, 0x00CF)); } else { - ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, MESSAGE_ID(0x0E, 0x00D0)); + ContinueSpeech(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_B), NPC_ANIM(world_bow, Palette_00, Anim_B), 0, + MESSAGE_ID(0x0E, 0x00D0)); } SpeakToPlayer(SI_VAR(5), NPC_ANIM(world_bow, Palette_00, Anim_4), NPC_ANIM(world_bow, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00D1)); UseSettingsFrom(0, 175, 0, 0); @@ -1167,14 +1169,14 @@ void N(func_80240950_BED740)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -1295,9 +1297,9 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -1325,7 +1327,8 @@ void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_arn/arn_07/events", arn_07_func_80240B00_BED8F0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_arn/arn_07/events", arn_07_func_80240B00_BED8F0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" diff --git a/src/world/area_arn/arn_07/header.c b/src/world/area_arn/arn_07/header.c index 00106d072b..cea49c2ef0 100644 --- a/src/world/area_arn/arn_07/header.c +++ b/src/world/area_arn/arn_07/header.c @@ -32,8 +32,7 @@ Script N(80241F10) = SCRIPT({ } == STORY_CH3_BEGAN_PEACH_MISSION { SetMusicTrack(0, SONG_STAR_SPIRIT_THEME, 1, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); PlayAmbientSounds(AMBIENT_WIND); } diff --git a/src/world/area_arn/arn_08/BF47A0.c b/src/world/area_arn/arn_08/BF47A0.c index b665606a47..5cbac98f1c 100644 --- a/src/world/area_arn/arn_08/BF47A0.c +++ b/src/world/area_arn/arn_08/BF47A0.c @@ -1,6 +1,6 @@ #include "arn_08.h" -ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_BF47A0)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; f32 temp_f20; s32 colliderID; @@ -13,11 +13,11 @@ ApiStatus N(func_80240000_BF47A0)(ScriptInstance *script, s32 isInitialCall) { temp_f20 = func_800E34D8(); playerStatus->position.y = func_800E3514(temp_f20, &colliderID); script->functionTemp[0].s += fabsf(temp_f20); - do {} while(0); + do {} while (0); return (script->functionTemp[0].s > 50) * ApiStatus_DONE2; } -ApiStatus N(func_8024008C_BF482C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024008C_BF482C)(ScriptInstance* script, s32 isInitialCall) { if (gPlayerStatus.position.y < -10.0f) { return ApiStatus_DONE2; } diff --git a/src/world/area_arn/arn_08/events.c b/src/world/area_arn/arn_08/events.c index 50aa91e610..d464756bc8 100644 --- a/src/world/area_arn/arn_08/events.c +++ b/src/world/area_arn/arn_08/events.c @@ -158,7 +158,7 @@ Script N(80240BA0) = SCRIPT({ PlaySound(0x8000004B); spawn { SI_VAR(0) = 0; - 10: +10: RotateModel(9, SI_VAR(0), 0, 0, 1); RotateModel(15, SI_VAR(0), 0, 0, 1); RotateModel(11, SI_VAR(0), 0, 0, 1); @@ -417,17 +417,17 @@ Script N(makeEntities) = SCRIPT({ } }); -ApiStatus N(func_802400C0_BF4860)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802400C0_BF4860)(ScriptInstance* script, s32 isInitialCall) { gPlayerData.bootsLevel = 1; return ApiStatus_DONE2; } -ApiStatus N(func_802400D4_BF4874)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802400D4_BF4874)(ScriptInstance* script, s32 isInitialCall) { func_800EF300(); return ApiStatus_DONE2; } -ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802400F4_BF4894)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; if (isInitialCall) { @@ -447,7 +447,7 @@ ApiStatus N(func_802400F4_BF4894)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_8024019C_BF493C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024019C_BF493C)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; s32* dataPtr = &N(D_80241188_BF5928); diff --git a/src/world/area_arn/arn_08/header.c b/src/world/area_arn/arn_08/header.c index b7a50d3771..e789b1527b 100644 --- a/src/world/area_arn/arn_08/header.c +++ b/src/world/area_arn/arn_08/header.c @@ -21,8 +21,7 @@ Script N(80240300) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_09/events.c b/src/world/area_arn/arn_09/events.c index 78b6c67255..99d39a4342 100644 --- a/src/world/area_arn/arn_09/events.c +++ b/src/world/area_arn/arn_09/events.c @@ -176,7 +176,7 @@ NpcGroupList N(npcGroupList_80240974) = { {}, }; -ApiStatus N(func_80240000_BF6060)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_BF6060)(ScriptInstance* script, s32 isInitialCall) { Entity* entity = get_entity_by_index(0); if (entity == NULL) { diff --git a/src/world/area_arn/arn_09/header.c b/src/world/area_arn/arn_09/header.c index c8e2dfe58a..54c64fcde0 100644 --- a/src/world/area_arn/arn_09/header.c +++ b/src/world/area_arn/arn_09/header.c @@ -20,8 +20,7 @@ Script N(802400A0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_10/events.c b/src/world/area_arn/arn_10/events.c index a6167540eb..2daa83463f 100644 --- a/src/world/area_arn/arn_10/events.c +++ b/src/world/area_arn/arn_10/events.c @@ -197,7 +197,7 @@ StaticNpc N(npcGroup_802409C8) = { .yaw = 270, .dropFlags = 0x80, .itemDropChance = 20, - { ITEM_DRIED_SHROOM, 10, 0 }, + { ITEM_DRIED_SHROOM, 10, 0 }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), .maxCoinBonus = 2, diff --git a/src/world/area_arn/arn_10/header.c b/src/world/area_arn/arn_10/header.c index 88ad684fc4..08ab250569 100644 --- a/src/world/area_arn/arn_10/header.c +++ b/src/world/area_arn/arn_10/header.c @@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_11/header.c b/src/world/area_arn/arn_11/header.c index 8060e6b2f6..69c72ab984 100644 --- a/src/world/area_arn/arn_11/header.c +++ b/src/world/area_arn/arn_11/header.c @@ -19,8 +19,7 @@ Script N(80240050) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_12/events.c b/src/world/area_arn/arn_12/events.c index f728e06821..bebc9d0c40 100644 --- a/src/world/area_arn/arn_12/events.c +++ b/src/world/area_arn/arn_12/events.c @@ -197,7 +197,7 @@ StaticNpc N(npcGroup_802409CC) = { .yaw = 270, .dropFlags = 0x80, .itemDropChance = 20, - { ITEM_DRIED_SHROOM, 10, 0 }, + { ITEM_DRIED_SHROOM, 10, 0 }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), .maxCoinBonus = 2, diff --git a/src/world/area_arn/arn_12/header.c b/src/world/area_arn/arn_12/header.c index 19162c62b9..7270c17a34 100644 --- a/src/world/area_arn/arn_12/header.c +++ b/src/world/area_arn/arn_12/header.c @@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_arn/arn_13/events.c b/src/world/area_arn/arn_13/events.c index 468ccece1c..13484803f2 100644 --- a/src/world/area_arn/arn_13/events.c +++ b/src/world/area_arn/arn_13/events.c @@ -198,7 +198,7 @@ StaticNpc N(npcGroup_802409DC) = { .yaw = 270, .dropFlags = 0x80, .itemDropChance = 20, - { ITEM_DRIED_SHROOM, 10, 0 }, + { ITEM_DRIED_SHROOM, 10, 0 }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(2), .maxCoinBonus = 2, diff --git a/src/world/area_arn/arn_13/header.c b/src/world/area_arn/arn_13/header.c index f509592d2c..4f08d021ce 100644 --- a/src/world/area_arn/arn_13/header.c +++ b/src/world/area_arn/arn_13/header.c @@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_BLUBBA_THEME, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } diff --git a/src/world/area_dgb/dgb_00/BFA0A0.c b/src/world/area_dgb/dgb_00/BFA0A0.c index 192c4e79db..cddb5bce08 100644 --- a/src/world/area_dgb/dgb_00/BFA0A0.c +++ b/src/world/area_dgb/dgb_00/BFA0A0.c @@ -1,7 +1,7 @@ #include "dgb_00.h" #include "message_ids.h" -ApiStatus N(func_80240000_BFA0A0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_BFA0A0)(ScriptInstance* script, s32 isInitialCall) { sprintf(&D_800D9230, "arn_20_shape"); sprintf(&D_800D91E0, "arn_20_hit"); sprintf(&D_800B0CF0, "arn_tex"); @@ -28,8 +28,7 @@ Script N(80240110) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_GUSTY_GULCH, 0, 8); } } @@ -66,8 +65,7 @@ Script N(802402D0) = SCRIPT({ < STORY_CH3_DEFEATED_TUBBA_BLUBBA { spawn N(80240F50); await N(80241AA0); - } - else { + } else { bind N(exitDoubleDoor_8024021C) to TRIGGER_WALL_PRESS_A 18; } } diff --git a/src/world/area_dgb/dgb_00/BFA100.c b/src/world/area_dgb/dgb_00/BFA100.c index 6e79e67e16..1615442bc1 100644 --- a/src/world/area_dgb/dgb_00/BFA100.c +++ b/src/world/area_dgb/dgb_00/BFA100.c @@ -162,7 +162,7 @@ Script N(80240DDC) = SCRIPT({ RandInt(5, SI_VAR(10)); SI_VAR(10) += 2; SI_VAR(11) = 0; - 10: +10: SI_VAR(3) = SI_VAR(0); SI_VAR(3) += 1; SetNpcPos(NPC_BOO0, SI_VAR(3), SI_VAR(1), SI_VAR(2)); @@ -700,8 +700,7 @@ Script N(80242B84) = SCRIPT({ } == 9 { SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00DA)); - } - else { + } else { SpeakToPlayer(NPC_PARTNER, 0x108, 0x106, 5, MESSAGE_ID(0x0E, 0x00D6)); } } diff --git a/src/world/area_dgb/dgb_01/BFD9A0.c b/src/world/area_dgb/dgb_01/BFD9A0.c index 29f9151bcc..f12dfdcade 100644 --- a/src/world/area_dgb/dgb_01/BFD9A0.c +++ b/src/world/area_dgb/dgb_01/BFD9A0.c @@ -27,8 +27,7 @@ Script N(802434A0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -417,8 +416,7 @@ Script N(802449C4) = SCRIPT({ < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetGroupEnabled(112, 0); ModifyColliderFlags(0, 40, 0x7FFFFE00); - } - else { + } else { SetGroupEnabled(210, 0); ModifyColliderFlags(0, 50, 0x7FFFFE00); } @@ -465,8 +463,8 @@ Script N(makeEntities) = SCRIPT({ }); f32 N(D_80244CD0_C02550)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; Script N(80244CE8) = SCRIPT({ @@ -493,14 +491,14 @@ void N(func_80240120_BFD9A0)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -622,9 +620,9 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -652,7 +650,8 @@ void N(func_802402D0_BFDB50)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_dgb/dgb_01/BFD9A0", dgb_01_func_802402D0_BFDB50, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_dgb/dgb_01/BFD9A0", dgb_01_func_802402D0_BFDB50, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -679,7 +678,7 @@ void N(func_80240D74_BFE5F4)(ScriptInstance* script, NpcAISettings* aiSettings, #include "world/common/UnkFunc5.inc.c" -ApiStatus N(func_8024142C_BFECAC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024142C_BFECAC)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -739,7 +738,7 @@ ApiStatus N(func_8024142C_BFECAC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_80241618_BFEE98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241618_BFEE98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 temp_f0; @@ -749,7 +748,7 @@ void N(func_80241618_BFEE98)(ScriptInstance *script, NpcAISettings *aiSettings, if (npc->duration <= 0) { npc->flags &= ~0x00200000; npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->moveSpeed = aiSettings->chaseSpeed; phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20); @@ -766,13 +765,14 @@ void N(func_80241618_BFEE98)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241770_BFEFF0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241770_BFEFF0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; script->functionTemp[0].s = 14; } else { @@ -788,7 +788,7 @@ void N(func_80241770_BFEFF0)(ScriptInstance *script, NpcAISettings *aiSettings, } -void N(func_80241874_BFF0F4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241874_BFF0F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); s32 i; @@ -811,7 +811,7 @@ void N(func_80241874_BFF0F4)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[0].s = 15; } -void N(func_80241954_BFF1D4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241954_BFF1D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -855,7 +855,7 @@ void N(func_80241954_BFF1D4)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241BF0_BFF470)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241BF0_BFF470)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -865,12 +865,12 @@ void N(func_80241BF0_BFF470)(ScriptInstance *script, NpcAISettings *aiSettings, sfx_stop_sound(0x80000011); enemy->varTable[0] &= ~0x1000; } - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; script->functionTemp[0].s = 17; } -void N(func_80241CA8_BFF528)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241CA8_BFF528)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -893,7 +893,7 @@ void N(func_80241CA8_BFF528)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241E28_BFF6A8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241E28_BFF6A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -903,7 +903,7 @@ void N(func_80241E28_BFF6A8)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241E70_BFF6F0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241E70_BFF6F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -920,7 +920,7 @@ void N(func_80241E70_BFF6F0)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241EF0_BFF770)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241EF0_BFF770)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -932,7 +932,7 @@ void N(func_80241EF0_BFF770)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[1].s = 0x1E; } -void N(func_80241F98_BFF818)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241F98_BFF818)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX = npc->pos.x; @@ -976,7 +976,7 @@ void N(func_80241F98_BFF818)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_802422B0_BFFB30)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1255,7 +1255,7 @@ const char N(dgb_00_name_hack)[] = "dgb_00"; ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -1277,7 +1277,7 @@ ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1302,7 +1302,7 @@ ApiStatus N(func_80242BA8_C00428)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1324,7 +1324,7 @@ ApiStatus N(func_80242BA8_C00428)(ScriptInstance* script, NpcAISettings* aiSetti #include "world/common/UnkFunc16.inc.c" -ApiStatus N(func_802430C0_C00940)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1345,7 +1345,7 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; diff --git a/src/world/area_dgb/dgb_02/C2EBA0.c b/src/world/area_dgb/dgb_02/C2EBA0.c index 16b798f9aa..9c09b823a0 100644 --- a/src/world/area_dgb/dgb_02/C2EBA0.c +++ b/src/world/area_dgb/dgb_02/C2EBA0.c @@ -33,8 +33,7 @@ Script N(802414B0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -280,7 +279,7 @@ StaticNpc N(npcGroup_80241E08)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -349,7 +348,7 @@ StaticNpc N(npcGroup_802421E8)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -421,9 +420,9 @@ NpcGroupList N(npcGroupList_802425C8) = { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240208_C2EDA8)(ScriptInstance *script) { +s32 N(func_80240208_C2EDA8)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -439,7 +438,8 @@ s32 N(func_80240208_C2EDA8)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -460,9 +460,9 @@ s32 N(func_80240208_C2EDA8)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -480,7 +480,7 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -545,26 +545,26 @@ ApiStatus N(func_8024061C_C2F1BC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_802408D0_C2F470)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802408D0_C2F470)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->duration > 0) { npc->duration--; } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 1; } } -void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240958_C2F4F8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); PlayerData* playerData = get_player_data(); s32 phi_s2 = FALSE; s32 var; @@ -598,7 +598,7 @@ void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings, if (phi_s2) { func_800494C0(npc, 0xB000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); @@ -611,16 +611,16 @@ void N(func_80240958_C2F4F8)(ScriptInstance *script, NpcAISettings *aiSettings, } else if (npc->duration == 57) { func_800494C0(npc, 0xB000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; } } -void N(func_80240C10_C2F7B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240C10_C2F7B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { @@ -630,19 +630,19 @@ void N(func_80240C10_C2F7B0)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80240C74_C2F814)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240C74_C2F814)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = (rand_int(1000) % 2) + 2; script->functionTemp[0].s = 4; } -void N(func_80240D1C_C2F8BC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240D1C_C2F8BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { @@ -673,11 +673,11 @@ void N(func_80240D1C_C2F8BC)(ScriptInstance *script, NpcAISettings *aiSettings, void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -687,16 +687,17 @@ void N(func_80240E54_C2F9F4)(ScriptInstance* script, NpcAISettings* aiSettings, } } -void N(func_80240F00_C2FAA0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240F00_C2FAA0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[0]; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; script->functionTemp[0].s = 3; @@ -709,9 +710,9 @@ void N(func_80240F00_C2FAA0)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241078_C2FC18)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241078_C2FC18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -722,9 +723,9 @@ void N(func_80241078_C2FC18)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802410D4_C2FC74)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -742,7 +743,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; enemy->varTable[0] = 0; if (!enemy->territory->wander.isFlying) { @@ -753,7 +754,7 @@ ApiStatus N(func_802410D4_C2FC74)(ScriptInstance *script, s32 isInitialCall) { if (enemy->unk_B0 & 4) { script->functionTemp[0].s = 99; script->functionTemp[1].s = 40; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } diff --git a/src/world/area_dgb/dgb_03/C31730.c b/src/world/area_dgb/dgb_03/C31730.c index 69c8ba49e3..d4b18d1918 100644 --- a/src/world/area_dgb/dgb_03/C31730.c +++ b/src/world/area_dgb/dgb_03/C31730.c @@ -37,8 +37,7 @@ Script N(80242870) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -536,7 +535,7 @@ StaticNpc N(npcGroup_80243DE8)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -604,7 +603,7 @@ StaticNpc N(npcGroup_802441C8)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -673,7 +672,7 @@ StaticNpc N(npcGroup_802445A8)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -746,9 +745,9 @@ NpcGroupList N(npcGroupList_80244988) = { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240458_C31938)(ScriptInstance *script) { +s32 N(func_80240458_C31938)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -764,7 +763,8 @@ s32 N(func_80240458_C31938)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -785,9 +785,9 @@ s32 N(func_80240458_C31938)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -ApiStatus N(func_8024086C_C31D4C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -805,7 +805,7 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -872,7 +872,7 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance *script, s32 isInitialCall) { ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -894,7 +894,7 @@ ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -919,7 +919,7 @@ ApiStatus N(func_8024119C_C3267C)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -941,7 +941,7 @@ ApiStatus N(func_8024119C_C3267C)(ScriptInstance* script, NpcAISettings* aiSetti #include "world/common/UnkFunc16.inc.c" -ApiStatus N(func_802416B4_C32B94)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -962,7 +962,7 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -1026,9 +1026,9 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_802419B0_C32E90)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -1046,7 +1046,7 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -1114,26 +1114,26 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_80241C7C_C3315C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241C7C_C3315C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->duration > 0) { npc->duration--; } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 1; } } -void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241D04_C331E4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); PlayerData* playerData = get_player_data(); s32 phi_s2 = FALSE; s32 var; @@ -1167,7 +1167,7 @@ void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings, if (phi_s2) { func_800494C0(npc, 0xB000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); @@ -1180,16 +1180,16 @@ void N(func_80241D04_C331E4)(ScriptInstance *script, NpcAISettings *aiSettings, } else if (npc->duration == 57) { func_800494C0(npc, 0xB000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; } } -void N(func_80241FBC_C3349C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241FBC_C3349C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { @@ -1199,19 +1199,19 @@ void N(func_80241FBC_C3349C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80242020_C33500)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242020_C33500)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = (rand_int(1000) % 2) + 2; script->functionTemp[0].s = 4; } -void N(func_802420C8_C335A8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802420C8_C335A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { @@ -1242,11 +1242,11 @@ void N(func_802420C8_C335A8)(ScriptInstance *script, NpcAISettings *aiSettings, void N(func_80242200_C336E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1256,16 +1256,17 @@ void N(func_80242200_C336E0)(ScriptInstance* script, NpcAISettings* aiSettings, } } -void N(func_802422AC_C3378C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802422AC_C3378C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[0]; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; script->functionTemp[0].s = 3; @@ -1278,9 +1279,9 @@ void N(func_802422AC_C3378C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80242424_C33904)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242424_C33904)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -1291,9 +1292,9 @@ void N(func_80242424_C33904)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_80242480_C33960)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242480_C33960)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -1311,7 +1312,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; enemy->varTable[0] = 0; if (!enemy->territory->wander.isFlying) { @@ -1322,7 +1323,7 @@ ApiStatus N(func_80242480_C33960)(ScriptInstance *script, s32 isInitialCall) { if (enemy->unk_B0 & 4) { script->functionTemp[0].s = 99; script->functionTemp[1].s = 40; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } diff --git a/src/world/area_dgb/dgb_04/C36530.c b/src/world/area_dgb/dgb_04/C36530.c index 9134f8426e..d26186792c 100644 --- a/src/world/area_dgb/dgb_04/C36530.c +++ b/src/world/area_dgb/dgb_04/C36530.c @@ -29,8 +29,7 @@ Script N(80243170) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -108,8 +107,8 @@ static s32 N(pad_3558)[] = { }; f32 N(D_80243560_C39A90)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; Script N(80243578) = SCRIPT({ @@ -402,14 +401,14 @@ void N(func_80240000_C36530)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -531,9 +530,9 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -561,7 +560,8 @@ void N(func_802401B0_C366E0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_dgb/dgb_04/C36530", dgb_04_func_802401B0_C366E0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_dgb/dgb_04/C36530", dgb_04_func_802401B0_C366E0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -588,7 +588,7 @@ void N(func_80240C54_C37184)(ScriptInstance* script, NpcAISettings* aiSettings, #include "world/common/UnkFunc5.inc.c" -ApiStatus N(func_8024130C_C3783C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024130C_C3783C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -647,7 +647,7 @@ ApiStatus N(func_8024130C_C3783C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_802414F8_C37A28)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802414F8_C37A28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 temp_f0; @@ -657,7 +657,7 @@ void N(func_802414F8_C37A28)(ScriptInstance *script, NpcAISettings *aiSettings, if (npc->duration <= 0) { npc->flags &= ~0x00200000; npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->moveSpeed = aiSettings->chaseSpeed; phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20); @@ -674,13 +674,14 @@ void N(func_802414F8_C37A28)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241650_C37B80)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241650_C37B80)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; script->functionTemp[0].s = 14; } else { @@ -696,7 +697,7 @@ void N(func_80241650_C37B80)(ScriptInstance *script, NpcAISettings *aiSettings, } -void N(func_80241754_C37C84)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241754_C37C84)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -710,7 +711,7 @@ void N(func_80241754_C37C84)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[0].s = 15; } -void N(func_802417F8_C37D28)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802417F8_C37D28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -754,7 +755,7 @@ void N(func_802417F8_C37D28)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241A94_C37FC4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241A94_C37FC4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -764,12 +765,12 @@ void N(func_80241A94_C37FC4)(ScriptInstance *script, NpcAISettings *aiSettings, sfx_stop_sound(0x80000011); enemy->varTable[0] &= ~0x1000; } - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; script->functionTemp[0].s = 17; } -void N(func_80241B4C_C3807C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241B4C_C3807C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -792,7 +793,7 @@ void N(func_80241B4C_C3807C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241CCC_C381FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241CCC_C381FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -802,7 +803,7 @@ void N(func_80241CCC_C381FC)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241D14_C38244)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241D14_C38244)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -819,7 +820,7 @@ void N(func_80241D14_C38244)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241D94_C382C4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241D94_C382C4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -831,7 +832,7 @@ void N(func_80241D94_C382C4)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[1].s = 0x1E; } -void N(func_80241E3C_C3836C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241E3C_C3836C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX = npc->pos.x; @@ -875,7 +876,7 @@ void N(func_80241E3C_C3836C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_80242154_C38684)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -955,7 +956,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkFunc17.inc.c" -ApiStatus N(func_8024240C_C3893C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024240C_C3893C)(ScriptInstance* script, s32 isInitialCall) { func_802E5690(get_variable(script, *script->ptrReadPos)); return ApiStatus_DONE2; } @@ -985,7 +986,7 @@ typedef struct { } N(UnkStruct); -ApiStatus N(func_8024259C_C38ACC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; N(UnkStruct)* ptr; s32 i; @@ -1057,7 +1058,8 @@ ApiStatus N(func_8024259C_C38ACC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } #else -INCLUDE_ASM(ApiStatus, "world/area_dgb/dgb_04/C36530", dgb_04_func_8024259C_C38ACC, ScriptInstance *script, s32 isInitialCall) +INCLUDE_ASM(ApiStatus, "world/area_dgb/dgb_04/C36530", dgb_04_func_8024259C_C38ACC, ScriptInstance* script, + s32 isInitialCall) #endif ApiStatus N(func_802427EC_C38D1C)(ScriptInstance* script, s32 isInitialCall) { @@ -1092,8 +1094,8 @@ typedef struct { s32 unk_64; } N(UserData); -ApiStatus N(func_802429D0_C38F00)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus N(func_802429D0_C38F00)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_safe(-4); f32 sinTheta, cosTheta; s32 i; @@ -1111,7 +1113,8 @@ ApiStatus N(func_802429D0_C38F00)(ScriptInstance *script, s32 isInitialCall) { scriptPtr->unk_5C = get_entity_by_index(get_variable(script, *args)); for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); + userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, + scriptPtr->unk_5C->position.z, 1.0f, -1); save = 0.0f; userDataPtr->unk_2C[i] = save; userDataPtr->unk_20[i] = save; @@ -1219,8 +1222,8 @@ ApiStatus N(func_802429D0_C38F00)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -s32 N(func_80242F08_C39438)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +s32 N(func_80242F08_C39438)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; s32 ret = 0; if (isInitialCall) { diff --git a/src/world/area_dgb/dgb_05/C3AA10.c b/src/world/area_dgb/dgb_05/C3AA10.c index 414871aa95..2ca958fa06 100644 --- a/src/world/area_dgb/dgb_05/C3AA10.c +++ b/src/world/area_dgb/dgb_05/C3AA10.c @@ -30,8 +30,7 @@ Script N(802414E0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -202,7 +201,7 @@ StaticNpc N(npcGroup_80241B4C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -270,7 +269,7 @@ StaticNpc N(npcGroup_80241F2C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -334,14 +333,14 @@ NpcGroupList N(npcGroupList_8024230C) = { {}, }; -ApiStatus N(func_80240000_C3AA10)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_C3AA10)(ScriptInstance* script, s32 isInitialCall) { if (gPlayerStatus.position.y >= -210.0f) { return ApiStatus_BLOCK; } return ApiStatus_DONE2; } -ApiStatus N(func_80240030_C3AA40)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240030_C3AA40)(ScriptInstance* script, s32 isInitialCall) { if (gPlayerStatus.position.y > -270.0f) { return ApiStatus_BLOCK; } @@ -356,9 +355,9 @@ ApiStatus N(func_80240030_C3AA40)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240268_C3AC78)(ScriptInstance *script) { +s32 N(func_80240268_C3AC78)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -374,7 +373,8 @@ s32 N(func_80240268_C3AC78)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -395,26 +395,26 @@ s32 N(func_80240268_C3AC78)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -void N(func_8024067C_C3B08C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_8024067C_C3B08C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->duration > 0) { npc->duration--; } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 1; } } -void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240704_C3B114)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); PlayerData* playerData = get_player_data(); s32 phi_s2 = FALSE; s32 var; @@ -448,7 +448,7 @@ void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings, if (phi_s2) { func_800494C0(npc, 0xB000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); @@ -461,16 +461,16 @@ void N(func_80240704_C3B114)(ScriptInstance *script, NpcAISettings *aiSettings, } else if (npc->duration == 57) { func_800494C0(npc, 0xB000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; } } -void N(func_802409BC_C3B3CC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802409BC_C3B3CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { @@ -480,19 +480,19 @@ void N(func_802409BC_C3B3CC)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80240A20_C3B430)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240A20_C3B430)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = (rand_int(1000) % 2) + 2; script->functionTemp[0].s = 4; } -void N(func_80240AC8_C3B4D8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240AC8_C3B4D8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { @@ -523,11 +523,11 @@ void N(func_80240AC8_C3B4D8)(ScriptInstance *script, NpcAISettings *aiSettings, void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -537,16 +537,17 @@ void N(func_80240C00_C3B610)(ScriptInstance* script, NpcAISettings* aiSettings, } } -void N(func_80240CAC_C3B6BC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240CAC_C3B6BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[0]; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; script->functionTemp[0].s = 3; @@ -559,9 +560,9 @@ void N(func_80240CAC_C3B6BC)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80240E24_C3B834)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240E24_C3B834)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -572,9 +573,9 @@ void N(func_80240E24_C3B834)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240E80_C3B890)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -592,7 +593,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; enemy->varTable[0] = 0; if (!enemy->territory->wander.isFlying) { @@ -603,7 +604,7 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) { if (enemy->unk_B0 & 4) { script->functionTemp[0].s = 99; script->functionTemp[1].s = 40; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } @@ -676,9 +677,9 @@ ApiStatus N(func_80240E80_C3B890)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -696,7 +697,7 @@ ApiStatus N(func_802411D0_C3BBE0)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; diff --git a/src/world/area_dgb/dgb_06/C3D080.c b/src/world/area_dgb/dgb_06/C3D080.c index 76588b61d5..8b6182d7e0 100644 --- a/src/world/area_dgb/dgb_06/C3D080.c +++ b/src/world/area_dgb/dgb_06/C3D080.c @@ -25,8 +25,7 @@ Script N(80240320) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -139,10 +138,12 @@ NpcSettings N(npcSettings_80240840) = { Script N(interact_8024086C) = SCRIPT({ if (SI_AREA_FLAG(4) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F0)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00F0)); SI_AREA_FLAG(4) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F1)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(boo, Palette_01, Anim_4), NPC_ANIM(boo, Palette_01, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00F1)); SI_AREA_FLAG(4) = 0; } }); diff --git a/src/world/area_dgb/dgb_07/C3DBF0.c b/src/world/area_dgb/dgb_07/C3DBF0.c index 43f9c6b59f..fc3d2fc0b0 100644 --- a/src/world/area_dgb/dgb_07/C3DBF0.c +++ b/src/world/area_dgb/dgb_07/C3DBF0.c @@ -29,8 +29,7 @@ Script N(80241490) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -189,7 +188,7 @@ StaticNpc N(npcGroup_80241A7C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -265,9 +264,9 @@ static const s32 N(pad_1E74)[] = { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240208_C3DDF8)(ScriptInstance *script) { +s32 N(func_80240208_C3DDF8)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -283,7 +282,8 @@ s32 N(func_80240208_C3DDF8)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -304,26 +304,26 @@ s32 N(func_80240208_C3DDF8)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -void N(func_8024061C_C3E20C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_8024061C_C3E20C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->duration > 0) { npc->duration--; } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 1; } } -void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802406A4_C3E294)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); PlayerData* playerData = get_player_data(); s32 phi_s2 = FALSE; s32 var; @@ -357,7 +357,7 @@ void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings, if (phi_s2) { func_800494C0(npc, 0xB000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); @@ -370,16 +370,16 @@ void N(func_802406A4_C3E294)(ScriptInstance *script, NpcAISettings *aiSettings, } else if (npc->duration == 57) { func_800494C0(npc, 0xB000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; } } -void N(func_8024095C_C3E54C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_8024095C_C3E54C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { @@ -389,19 +389,19 @@ void N(func_8024095C_C3E54C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_802409C0_C3E5B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802409C0_C3E5B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = (rand_int(1000) % 2) + 2; script->functionTemp[0].s = 4; } -void N(func_80240A68_C3E658)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240A68_C3E658)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { @@ -432,11 +432,11 @@ void N(func_80240A68_C3E658)(ScriptInstance *script, NpcAISettings *aiSettings, void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -446,16 +446,17 @@ void N(func_80240BA0_C3E790)(ScriptInstance* script, NpcAISettings* aiSettings, } } -void N(func_80240C4C_C3E83C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240C4C_C3E83C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[0]; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; script->functionTemp[0].s = 3; @@ -468,9 +469,9 @@ void N(func_80240C4C_C3E83C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80240DC4_C3E9B4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240DC4_C3E9B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -481,9 +482,9 @@ void N(func_80240DC4_C3E9B4)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240E20_C3EA10)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -501,7 +502,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; enemy->varTable[0] = 0; if (!enemy->territory->wander.isFlying) { @@ -512,7 +513,7 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) { if (enemy->unk_B0 & 4) { script->functionTemp[0].s = 99; script->functionTemp[1].s = 40; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } @@ -585,9 +586,9 @@ ApiStatus N(func_80240E20_C3EA10)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241170_C3ED60)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -605,7 +606,7 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -626,7 +627,7 @@ ApiStatus N(func_80241170_C3ED60)(ScriptInstance *script, s32 isInitialCall) { switch (script->functionTemp[0].s) { case 0: - func_800495A0(script, npcAISettings, territoryPtr); + func_800495A0(script, npcAISettings, territoryPtr); case 1: func_800496B8(script, npcAISettings, territoryPtr); break; diff --git a/src/world/area_dgb/dgb_08/C3FDB0.c b/src/world/area_dgb/dgb_08/C3FDB0.c index fabd4af5cd..0e862cc6ef 100644 --- a/src/world/area_dgb/dgb_08/C3FDB0.c +++ b/src/world/area_dgb/dgb_08/C3FDB0.c @@ -39,8 +39,7 @@ Script N(80243CF0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -255,8 +254,8 @@ NpcSettings N(npcSettings_80244434) = { }; f32 N(D_80244460_C44210)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; Script N(80244478) = SCRIPT({ @@ -534,7 +533,7 @@ StaticNpc N(npcGroup_80245290)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -603,7 +602,7 @@ StaticNpc N(npcGroup_80245670)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -672,7 +671,7 @@ StaticNpc N(npcGroup_80245A50)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -956,7 +955,7 @@ Script N(802469E0) = SCRIPT({ ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -978,7 +977,7 @@ ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1003,7 +1002,7 @@ ApiStatus N(func_8024067C_C4042C)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -1025,7 +1024,7 @@ ApiStatus N(func_8024067C_C4042C)(ScriptInstance* script, NpcAISettings* aiSetti #include "world/common/UnkFunc16.inc.c" -ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1046,7 +1045,7 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -1118,9 +1117,9 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80241098_C40E48)(ScriptInstance *script) { +s32 N(func_80241098_C40E48)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -1136,7 +1135,8 @@ s32 N(func_80241098_C40E48)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -1157,9 +1157,9 @@ s32 N(func_80241098_C40E48)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -ApiStatus N(func_802414AC_C4125C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -1177,7 +1177,7 @@ ApiStatus N(func_802414AC_C4125C)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -1248,14 +1248,14 @@ void N(func_80241760_C41510)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -1377,9 +1377,9 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -1407,7 +1407,8 @@ void N(func_80241910_C416C0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_dgb/dgb_08/C3FDB0", dgb_08_func_80241910_C416C0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_dgb/dgb_08/C3FDB0", dgb_08_func_80241910_C416C0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1_copy.inc.c" @@ -1494,7 +1495,7 @@ ApiStatus N(func_80242A6C_C4281C)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_80242C58_C42A08)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242C58_C42A08)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 temp_f0; @@ -1504,7 +1505,7 @@ void N(func_80242C58_C42A08)(ScriptInstance *script, NpcAISettings *aiSettings, if (npc->duration <= 0) { npc->flags &= ~0x00200000; npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->moveSpeed = aiSettings->chaseSpeed; phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20); @@ -1521,13 +1522,14 @@ void N(func_80242C58_C42A08)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80242DB0_C42B60)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242DB0_C42B60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; script->functionTemp[0].s = 14; } else { @@ -1543,7 +1545,7 @@ void N(func_80242DB0_C42B60)(ScriptInstance *script, NpcAISettings *aiSettings, } -void N(func_80242EB4_C42C64)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242EB4_C42C64)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); s32 i; @@ -1565,7 +1567,7 @@ void N(func_80242EB4_C42C64)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[0].s = 15; } -void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242F94_C42D44)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -1611,7 +1613,7 @@ void N(func_80242F94_C42D44)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80243230_C42FE0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80243230_C42FE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1621,12 +1623,12 @@ void N(func_80243230_C42FE0)(ScriptInstance *script, NpcAISettings *aiSettings, sfx_stop_sound(0x80000011); enemy->varTable[0] &= ~0x1000; } - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; script->functionTemp[0].s = 17; } -void N(func_802432E8_C43098)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802432E8_C43098)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -1649,7 +1651,7 @@ void N(func_802432E8_C43098)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80243468_C43218)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80243468_C43218)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1659,7 +1661,7 @@ void N(func_80243468_C43218)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_802434B0_C43260)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802434B0_C43260)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1676,7 +1678,7 @@ void N(func_802434B0_C43260)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80243530_C432E0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80243530_C432E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1688,7 +1690,7 @@ void N(func_80243530_C432E0)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[1].s = 0x1E; } -void N(func_802435D8_C43388)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802435D8_C43388)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX = npc->pos.x; @@ -1732,7 +1734,7 @@ void N(func_802435D8_C43388)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_802438F0_C436A0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1836,7 +1838,7 @@ ApiStatus N(func_80243C10_C439C0)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80243C50_C43A00)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80243C50_C43A00)(ScriptInstance* script, s32 isInitialCall) { func_800494C0(get_npc_unsafe(script->owner1.enemy->npcID), 0x32F, 0); return ApiStatus_DONE2; } diff --git a/src/world/area_dgb/dgb_09/C46BE0.c b/src/world/area_dgb/dgb_09/C46BE0.c index ede66b3254..0e39d37e4d 100644 --- a/src/world/area_dgb/dgb_09/C46BE0.c +++ b/src/world/area_dgb/dgb_09/C46BE0.c @@ -35,8 +35,7 @@ Script N(80243880) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -299,8 +298,8 @@ NpcSettings N(npcSettings_8024432C) = { }; f32 N(D_80244358_C4AF38)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; Script N(80244370) = SCRIPT({ @@ -422,7 +421,7 @@ StaticNpc N(npcGroup_80244920)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -500,7 +499,7 @@ StaticNpc N(npcGroup_80244D6C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -604,9 +603,9 @@ NpcGroupList N(npcGroupList_8024533C) = { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240208_C46DE8)(ScriptInstance *script) { +s32 N(func_80240208_C46DE8)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -622,7 +621,8 @@ s32 N(func_80240208_C46DE8)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -643,9 +643,9 @@ s32 N(func_80240208_C46DE8)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -ApiStatus N(func_8024061C_C471FC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024061C_C471FC)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -663,7 +663,7 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -728,26 +728,26 @@ ApiStatus N(func_8024061C_C471FC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_802408D0_C474B0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802408D0_C474B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->duration > 0) { npc->duration--; } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 1; } } -void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240958_C47538)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); PlayerData* playerData = get_player_data(); s32 phi_s2 = FALSE; s32 var; @@ -781,7 +781,7 @@ void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings, if (phi_s2) { func_800494C0(npc, 0xB000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); @@ -794,16 +794,16 @@ void N(func_80240958_C47538)(ScriptInstance *script, NpcAISettings *aiSettings, } else if (npc->duration == 57) { func_800494C0(npc, 0xB000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; } } -void N(func_80240C10_C477F0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240C10_C477F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { @@ -813,19 +813,19 @@ void N(func_80240C10_C477F0)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80240C74_C47854)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240C74_C47854)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = (rand_int(1000) % 2) + 2; script->functionTemp[0].s = 4; } -void N(func_80240D1C_C478FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240D1C_C478FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { @@ -856,11 +856,11 @@ void N(func_80240D1C_C478FC)(ScriptInstance *script, NpcAISettings *aiSettings, void N(func_80240E54_C47A34)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -870,16 +870,17 @@ void N(func_80240E54_C47A34)(ScriptInstance* script, NpcAISettings* aiSettings, } } -void N(func_80240F00_C47AE0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240F00_C47AE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[0]; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; script->functionTemp[0].s = 3; @@ -892,9 +893,9 @@ void N(func_80240F00_C47AE0)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241078_C47C58)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241078_C47C58)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -905,9 +906,9 @@ void N(func_80241078_C47C58)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_802410D4_C47CB4)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -925,7 +926,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; enemy->varTable[0] = 0; if (!enemy->territory->wander.isFlying) { @@ -936,7 +937,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance *script, s32 isInitialCall) { if (enemy->unk_B0 & 4) { script->functionTemp[0].s = 99; script->functionTemp[1].s = 40; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } @@ -1015,14 +1016,14 @@ void N(func_80241424_C48004)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -1144,9 +1145,9 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -1174,7 +1175,8 @@ void N(func_802415D4_C481B4)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_dgb/dgb_09/C46BE0", dgb_09_func_802415D4_C481B4, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_dgb/dgb_09/C46BE0", dgb_09_func_802415D4_C481B4, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -1261,7 +1263,7 @@ ApiStatus N(func_80242730_C49310)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_BLOCK; } -void N(func_8024291C_C494FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_8024291C_C494FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 temp_f0; @@ -1271,7 +1273,7 @@ void N(func_8024291C_C494FC)(ScriptInstance *script, NpcAISettings *aiSettings, if (npc->duration <= 0) { npc->flags &= ~0x00200000; npc->duration = aiSettings->unk_20 / 2 + rand_int(aiSettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->moveSpeed = aiSettings->chaseSpeed; phi_f20 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); temp_f0 = get_clamped_angle_diff(npc->yaw, phi_f20); @@ -1288,13 +1290,14 @@ void N(func_8024291C_C494FC)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80242A74_C49654)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242A74_C49654)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; script->functionTemp[0].s = 14; } else { @@ -1310,7 +1313,7 @@ void N(func_80242A74_C49654)(ScriptInstance *script, NpcAISettings *aiSettings, } -void N(func_80242B78_C49758)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242B78_C49758)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1324,7 +1327,7 @@ void N(func_80242B78_C49758)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[0].s = 15; } -void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242C1C_C497FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -1370,7 +1373,7 @@ void N(func_80242C1C_C497FC)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80242EB8_C49A98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242EB8_C49A98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1380,12 +1383,12 @@ void N(func_80242EB8_C49A98)(ScriptInstance *script, NpcAISettings *aiSettings, sfx_stop_sound(0x80000011); enemy->varTable[0] &= ~0x1000; } - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->duration = 20; script->functionTemp[0].s = 17; } -void N(func_80242F70_C49B50)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242F70_C49B50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ, posW; @@ -1408,7 +1411,7 @@ void N(func_80242F70_C49B50)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_802430F0_C49CD0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802430F0_C49CD0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1418,7 +1421,7 @@ void N(func_802430F0_C49CD0)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80243138_C49D18)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80243138_C49D18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1435,7 +1438,7 @@ void N(func_80243138_C49D18)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_802431B8_C49D98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802431B8_C49D98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1447,7 +1450,7 @@ void N(func_802431B8_C49D98)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[1].s = 0x1E; } -void N(func_80243260_C49E40)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80243260_C49E40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX = npc->pos.x; @@ -1491,7 +1494,7 @@ void N(func_80243260_C49E40)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_80243578_C4A158)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; diff --git a/src/world/area_dgb/dgb_10/C4C390.c b/src/world/area_dgb/dgb_10/C4C390.c index 9d81e739fb..f9df5e4d4e 100644 --- a/src/world/area_dgb/dgb_10/C4C390.c +++ b/src/world/area_dgb/dgb_10/C4C390.c @@ -20,8 +20,7 @@ Script N(80240250) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -292,9 +291,9 @@ Script N(makeEntities) = SCRIPT({ } }); -ApiStatus N(func_80240000_C4C390)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_C4C390)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - s32 *array = script->array; + s32* array = script->array; f32 distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[3]); script->varTable[0] = 1; @@ -308,10 +307,10 @@ ApiStatus N(func_80240000_C4C390)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802400A0_C4C430)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802400A0_C4C430)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; f32 distance; - s32 *array = script->array; + s32* array = script->array; distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[4]); script->varTable[0] = 0; @@ -325,7 +324,7 @@ ApiStatus N(func_802400A0_C4C430)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; s32 var; @@ -345,7 +344,7 @@ ApiStatus N(func_8024013C_C4C4CC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802401C0_C4C550)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802401C0_C4C550)(ScriptInstance* script, s32 isInitialCall) { if (gPlayerStatus.position.y > -60.0f) { return ApiStatus_BLOCK; } diff --git a/src/world/area_dgb/dgb_11/C4D3E0.c b/src/world/area_dgb/dgb_11/C4D3E0.c index f4300f3fb4..a66573d46d 100644 --- a/src/world/area_dgb/dgb_11/C4D3E0.c +++ b/src/world/area_dgb/dgb_11/C4D3E0.c @@ -24,8 +24,7 @@ Script N(802400D0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } diff --git a/src/world/area_dgb/dgb_12/C4DEF0.c b/src/world/area_dgb/dgb_12/C4DEF0.c index 748d488d56..e01ea20052 100644 --- a/src/world/area_dgb/dgb_12/C4DEF0.c +++ b/src/world/area_dgb/dgb_12/C4DEF0.c @@ -19,8 +19,7 @@ Script N(80240310) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } diff --git a/src/world/area_dgb/dgb_13/C4E960.c b/src/world/area_dgb/dgb_13/C4E960.c index 4f8eb9e1ef..8c24780437 100644 --- a/src/world/area_dgb/dgb_13/C4E960.c +++ b/src/world/area_dgb/dgb_13/C4E960.c @@ -19,8 +19,7 @@ Script N(80240050) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } diff --git a/src/world/area_dgb/dgb_14/C4F030.c b/src/world/area_dgb/dgb_14/C4F030.c index 7d4069f97a..c171caea11 100644 --- a/src/world/area_dgb/dgb_14/C4F030.c +++ b/src/world/area_dgb/dgb_14/C4F030.c @@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } diff --git a/src/world/area_dgb/dgb_15/C4F510.c b/src/world/area_dgb/dgb_15/C4F510.c index 8fec5053a3..42c659bfbc 100644 --- a/src/world/area_dgb/dgb_15/C4F510.c +++ b/src/world/area_dgb/dgb_15/C4F510.c @@ -32,8 +32,7 @@ Script N(802418E0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -452,9 +451,9 @@ Script N(makeEntities) = SCRIPT({ #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240208_C4F718)(ScriptInstance *script) { +s32 N(func_80240208_C4F718)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -470,7 +469,8 @@ s32 N(func_80240208_C4F718)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -491,9 +491,9 @@ s32 N(func_80240208_C4F718)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -511,7 +511,7 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -578,7 +578,7 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance *script, s32 isInitialCall) { ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -600,7 +600,7 @@ ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -625,7 +625,7 @@ ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -668,7 +668,7 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; diff --git a/src/world/area_dgb/dgb_16/C52540.c b/src/world/area_dgb/dgb_16/C52540.c index a0f1c5e581..b5fe5f8de9 100644 --- a/src/world/area_dgb/dgb_16/C52540.c +++ b/src/world/area_dgb/dgb_16/C52540.c @@ -38,8 +38,7 @@ Script N(80241480) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -205,7 +204,7 @@ StaticNpc N(npcGroup_80241A4C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -274,7 +273,7 @@ StaticNpc N(npcGroup_80241E2C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -342,7 +341,7 @@ StaticNpc N(npcGroup_8024220C)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -410,7 +409,7 @@ StaticNpc N(npcGroup_802425EC)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -478,7 +477,7 @@ StaticNpc N(npcGroup_802429CC)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -546,7 +545,7 @@ StaticNpc N(npcGroup_80242DAC)[] = { .dropFlags = 0x80, .itemDropChance = 5, .itemDrops = { - { ITEM_SUPER_SHROOM, 10, 0 }, + { ITEM_SUPER_SHROOM, 10, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(3), .flowerDrops = STANDARD_FLOWER_DROPS(2), @@ -622,9 +621,9 @@ NpcGroupList N(npcGroupList_8024318C) = { #include "world/common/UnkNpcAIFunc5.inc.c" -s32 N(func_80240208_C52748)(ScriptInstance *script) { +s32 N(func_80240208_C52748)(ScriptInstance* script) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Camera* camera = CAM(gCurrentCamID); Enemy* enemy2 = get_enemy(enemy->npcID + 1); f32 phi_f20; @@ -640,7 +639,8 @@ s32 N(func_80240208_C52748)(ScriptInstance *script) { phi_f20 = 270.0f; } - if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { + if (fabsf(get_clamped_angle_diff(phi_f20, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z))) > enemy2->varTable[3]) { ret = FALSE; } @@ -661,26 +661,26 @@ s32 N(func_80240208_C52748)(ScriptInstance *script) { #include "world/common/UnkFunc7.inc.c" -void N(func_8024061C_C52B5C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_8024061C_C52B5C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->duration > 0) { npc->duration--; } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 1; } } -void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802406A4_C52BE4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); PlayerData* playerData = get_player_data(); s32 phi_s2 = FALSE; s32 var; @@ -714,7 +714,7 @@ void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings, if (phi_s2) { func_800494C0(npc, 0xB000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; npc->duration = 10; fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); func_800494C0(npc, 0x2F4, 0x200000); @@ -727,16 +727,16 @@ void N(func_802406A4_C52BE4)(ScriptInstance *script, NpcAISettings *aiSettings, } else if (npc->duration == 57) { func_800494C0(npc, 0xB000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->currentAnim.w = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; } } -void N(func_8024095C_C52E9C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_8024095C_C52E9C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { @@ -746,19 +746,19 @@ void N(func_8024095C_C52E9C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_802409C0_C52F00)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802409C0_C52F00)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = (rand_int(1000) % 2) + 2; script->functionTemp[0].s = 4; } -void N(func_80240A68_C52FA8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240A68_C52FA8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { @@ -789,11 +789,11 @@ void N(func_80240A68_C52FA8)(ScriptInstance *script, NpcAISettings *aiSettings, void N(func_80240BA0_C530E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -803,16 +803,17 @@ void N(func_80240BA0_C530E0)(ScriptInstance* script, NpcAISettings* aiSettings, } } -void N(func_80240C4C_C5318C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240C4C_C5318C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[0]; + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { + npc->currentAnim.w = enemy->animList[0]; npc->duration = 15; enemy->varTable[7] = 50; script->functionTemp[0].s = 3; @@ -825,9 +826,9 @@ void N(func_80240C4C_C5318C)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80240DC4_C53304)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240DC4_C53304)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -838,9 +839,9 @@ void N(func_80240DC4_C53304)(ScriptInstance *script, NpcAISettings *aiSettings, } } -ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240E20_C53360)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -858,7 +859,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->flags &= ~0x800; enemy->varTable[0] = 0; if (!enemy->territory->wander.isFlying) { @@ -869,7 +870,7 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) { if (enemy->unk_B0 & 4) { script->functionTemp[0].s = 99; script->functionTemp[1].s = 40; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } enemy->unk_B0 &= ~4; } @@ -942,9 +943,9 @@ ApiStatus N(func_80240E20_C53360)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80241170_C536B0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241170_C536B0)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -962,7 +963,7 @@ ApiStatus N(func_80241170_C536B0)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; diff --git a/src/world/area_dgb/dgb_17/C55A60.c b/src/world/area_dgb/dgb_17/C55A60.c index f710f8de6c..71527a0768 100644 --- a/src/world/area_dgb/dgb_17/C55A60.c +++ b/src/world/area_dgb/dgb_17/C55A60.c @@ -20,8 +20,7 @@ Script N(80240060) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } diff --git a/src/world/area_dgb/dgb_18/C55F40.c b/src/world/area_dgb/dgb_18/C55F40.c index 9f86cf92e6..5e5a74ca4b 100644 --- a/src/world/area_dgb/dgb_18/C55F40.c +++ b/src/world/area_dgb/dgb_18/C55F40.c @@ -31,8 +31,7 @@ Script N(802412C0) = SCRIPT({ } < STORY_CH3_DEFEATED_TUBBA_BLUBBA { SetMusicTrack(0, SONG_TUBBA_ESCAPE, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_TUBBAS_MANOR, 0, 8); } } @@ -471,9 +470,11 @@ Script N(idle_80242A24) = SCRIPT({ SpeakToPlayer(NPC_SELF, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 5, MESSAGE_ID(0x0E, 0x00F7)); ShowChoice(1966093); if (SI_VAR(0) == 0) { - ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F8)); + ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00F8)); } else { - ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, 0x00F9)); + ContinueSpeech(-1, NPC_ANIM(yakkey, Palette_00, Anim_2), NPC_ANIM(yakkey, Palette_00, Anim_1), 0, MESSAGE_ID(0x0E, + 0x00F9)); } GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); SetCamSpeed(0, 4.0); @@ -684,7 +685,7 @@ Script N(makeEntities) = SCRIPT({ ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -706,7 +707,7 @@ ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -731,7 +732,7 @@ ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -774,7 +775,7 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -839,9 +840,9 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/UnkFunc1.inc.c" -ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240EBC_C56DFC)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - Npc *npc = get_npc_unsafe(0); + Npc* npc = get_npc_unsafe(0); f32 posX, posZ; if (isInitialCall) { diff --git a/src/world/area_dro/dro_01/95B7E0.c b/src/world/area_dro/dro_01/95B7E0.c index e9781608cd..38e65fbd71 100644 --- a/src/world/area_dro/dro_01/95B7E0.c +++ b/src/world/area_dro/dro_01/95B7E0.c @@ -426,8 +426,7 @@ Script N(enterWalk_80244C14) = SCRIPT({ == 10 { spawn 0x80285C50; spawn N(80244A28); - } - else { + } else { SI_VAR(0) = N(80244A28); spawn EnterWalk; } @@ -449,8 +448,7 @@ Script N(main) = SCRIPT({ match STORY_PROGRESS { -53..6 { MakeNpcs(0, N(npcGroupList_8024B47C)); - } - else { + } else { MakeNpcs(0, N(npcGroupList_8024B464)); } } @@ -1340,11 +1338,11 @@ Script N(80247D90) = SCRIPT({ SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 5, SI_VAR(8)); EnablePartnerAI(); SI_VAR(12) = 1; - } - else { + } else { DisablePartnerAI(0); sleep 1; - SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), 5, SI_VAR(9)); + SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_parakarry, Palette_00, Anim_6), NPC_ANIM(world_parakarry, Palette_00, Anim_1), + 5, SI_VAR(9)); if (SI_VAR(10) != 0) { SpeakToPlayer(SI_VAR(2), SI_VAR(3), SI_VAR(4), 0, SI_VAR(10)); } @@ -1374,7 +1372,8 @@ Script N(80248090) = SCRIPT({ Script N(interact_802480E0) = SCRIPT({ if (STORY_PROGRESS >= STORY_CH2_STAR_SPRIT_DEPARTED) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_00, Anim_5), NPC_ANIM(mouser, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0062)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_00, Anim_5), NPC_ANIM(mouser, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, + 0x0062)); return; } match SI_AREA_VAR(0) { @@ -1422,9 +1421,9 @@ Script N(interact_8024821C) = SCRIPT({ } < 39 { SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_03, Anim_4), NPC_ANIM(dryite, Palette_03, Anim_1), 0, MESSAGE_ID(0x0D, 0x0066)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_03, Anim_4), NPC_ANIM(dryite, Palette_03, Anim_1), 0, MESSAGE_ID(0x0D, 0x0067)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_03, Anim_4), NPC_ANIM(dryite, Palette_03, Anim_1), 0, MESSAGE_ID(0x0D, + 0x0067)); } } }); @@ -1515,7 +1514,8 @@ Script N(interact_80248864) = SCRIPT({ if (SI_SAVE_FLAG(761) == 1) { N(func_802431B4_95E3B4)(); if (SI_VAR(0) == 1) { - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x007B)); + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x007B)); return; } } @@ -1523,14 +1523,20 @@ Script N(interact_80248864) = SCRIPT({ match STORY_PROGRESS { < STORY_CH2_STAR_SPRIT_DEPARTED { if (SI_AREA_FLAG(1) == 0) { - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006C)); - SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006D)); - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006E)); + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x006C)); + SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x006D)); + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x006E)); SI_AREA_FLAG(1) = 1; } else { - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x006F)); - SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0070)); - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0071)); + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x006F)); + SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0070)); + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0071)); SI_AREA_FLAG(1) = 0; } } @@ -1538,11 +1544,13 @@ Script N(interact_80248864) = SCRIPT({ SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0072)); SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0073)); SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0074)); - } - else { - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0075)); - SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0076)); - SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, MESSAGE_ID(0x0D, 0x0077)); + } else { + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0075)); + SpeakToPlayer(NPC_DRYITE3, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0076)); + SpeakToPlayer(NPC_DRYITE2, NPC_ANIM(dryite, Palette_00, Anim_4), NPC_ANIM(dryite, Palette_00, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0077)); } } }); @@ -1601,16 +1609,19 @@ Script N(interact_80248D54) = SCRIPT({ if (SI_SAVE_FLAG(754) == 1) { FindKeyItem(ITEM_MELODY, SI_VAR(0)); if (SI_VAR(0) != -1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0084)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0084)); return; } else { if (SI_SAVE_FLAG(755) == 0) { if (STORY_PROGRESS < STORY_CH7_BEGAN_PEACH_MISSION) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0085)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0085)); SetPlayerAnimation(ANIM_NOD_YES); sleep 30; SetPlayerAnimation(ANIM_10002); - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0086)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0086)); SI_SAVE_FLAG(755) = 1; return; } @@ -1620,28 +1631,33 @@ Script N(interact_80248D54) = SCRIPT({ match STORY_PROGRESS { < STORY_CH2_STAR_SPRIT_DEPARTED { if (SI_AREA_FLAG(2) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007C)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x007C)); SI_AREA_FLAG(2) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007D)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x007D)); SI_AREA_FLAG(2) = 0; } } < STORY_CH5_STAR_SPRIT_DEPARTED { if (SI_AREA_FLAG(2) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007E)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x007E)); SI_AREA_FLAG(2) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x007F)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x007F)); SI_AREA_FLAG(2) = 0; } - } - else { + } else { if (SI_AREA_FLAG(2) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0080)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0080)); SI_AREA_FLAG(2) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0081)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0081)); SI_AREA_FLAG(2) = 0; } } @@ -1653,11 +1669,13 @@ Script N(interact_80248D54) = SCRIPT({ == 0 {} == -1 {} else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0082)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0082)); SetNpcAnimation(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_3)); sleep 60; SetNpcAnimation(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_1)); - SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0083)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(artist_toad, Palette_01, Anim_2), NPC_ANIM(artist_toad, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x0083)); SI_VAR(0) = 104; SI_VAR(1) = 1; await N(802451BC); @@ -1739,8 +1757,7 @@ Script N(idle_8024918C) = SCRIPT({ await N(8024C4C8); EnableNpcBlur(-1, 0); STORY_PROGRESS = STORY_CH2_SHADY_MOUSE_ENTERED_SHOP; - } - else { + } else { SetNpcAnimation(NPC_SELF, NPC_ANIM(mouser, Palette_01, Anim_1)); SetNpcPos(NPC_SELF, 20, 0, -375); } @@ -1750,7 +1767,8 @@ Script N(idle_8024918C) = SCRIPT({ Script N(interact_80249750) = SCRIPT({ if (SI_AREA_VAR(4) == 4) { if (SI_AREA_VAR(5) == 1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0088)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, + 0x0088)); await N(80248090); if (SI_VAR(12) != 0) { return; @@ -1787,23 +1805,28 @@ Script N(interact_802498E8) = SCRIPT({ FindKeyItem(ITEM_FOURTH_DEGREE_CARD, SI_VAR(4)); FindKeyItem(ITEM_DIPLOMA, SI_VAR(5)); if (SI_VAR(1) != -1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009A)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, + 0x009A)); return; } if (SI_VAR(2) != -1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009B)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, + 0x009B)); return; } if (SI_VAR(3) != -1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009C)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, + 0x009C)); return; } if (SI_VAR(4) != -1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009D)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, + 0x009D)); return; } if (SI_VAR(5) != -1) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x009E)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, + 0x009E)); return; } SpeakToPlayer(NPC_SELF, NPC_ANIM(dryite, Palette_01, Anim_4), NPC_ANIM(dryite, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x0099)); @@ -2331,7 +2354,8 @@ Script N(8024B7B0) = SCRIPT({ N(func_80243578_95E778)(); func_802D2C14(1); await N(8024B614); - SpeakToPlayer(NPC_MOUSER1, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, MESSAGE_ID(0x0D, 0x008D)); + SpeakToPlayer(NPC_MOUSER1, NPC_ANIM(mouser, Palette_01, Anim_5), NPC_ANIM(mouser, Palette_01, Anim_1), 0, + MESSAGE_ID(0x0D, 0x008D)); SI_VAR(0) = 119; SI_VAR(1) = 1; await N(8024B5B4); @@ -2376,8 +2400,7 @@ Script N(8024B894) = SCRIPT({ } == 167 { SI_AREA_VAR(4) = 3; - } - else { + } else { SI_AREA_VAR(4) = 0; } } @@ -2848,7 +2871,7 @@ Script N(makeEntities) = SCRIPT({ ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -2870,7 +2893,7 @@ ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -2895,7 +2918,7 @@ ApiStatus N(func_80240C5C_95BE5C)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -2938,7 +2961,7 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; @@ -3024,7 +3047,7 @@ ApiStatus N(func_80241470_95C670)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/Set80151310.inc.c" // Ok good luck. -ApiStatus N(func_802415AC_95C7AC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802415AC_95C7AC)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemyID; u16 phi_s0 = get_variable(script, SI_SAVE_FLAG(1768)); u16 phi_s7 = get_variable(script, SI_SAVE_FLAG(1769)); @@ -3083,7 +3106,7 @@ ApiStatus N(func_802415AC_95C7AC)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkFunc31.inc.c" -ApiStatus N(func_80241B5C_95CD5C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241B5C_95CD5C)(ScriptInstance* script, s32 isInitialCall) { u16 quizzesAnswered = gPlayerData.quizzesAnswered; if (quizzesAnswered < 999) { @@ -3100,13 +3123,16 @@ ApiStatus N(func_80241B5C_95CD5C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241BE0_95CDE0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241BE0_95CDE0)(ScriptInstance* script, s32 isInitialCall) { EffectInstanceDataThing* effectPtr; if (isInitialCall) { - N(D_8024DFE0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3))); - N(D_8024DFE4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3))); - N(D_8024DFE8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)), 1.0f, 0); + N(D_8024DFE0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), + get_variable(script, SI_ARRAY(3))); + N(D_8024DFE4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), + get_variable(script, SI_ARRAY(3))); + N(D_8024DFE8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), + get_variable(script, SI_ARRAY(3)), 1.0f, 0); effectPtr = N(D_8024DFE0)->unk_0C; effectPtr->unk_18 = 0; @@ -3131,7 +3157,7 @@ ApiStatus N(func_80241BE0_95CDE0)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80241DF8_95CFF8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241DF8_95CFF8)(ScriptInstance* script, s32 isInitialCall) { EffectInstanceDataThing* effectPtr; if (isInitialCall) { @@ -3156,12 +3182,12 @@ ApiStatus N(func_80241DF8_95CFF8)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80241EAC_95D0AC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241EAC_95D0AC)(ScriptInstance* script, s32 isInitialCall) { N(D_8024DFE0)->unk_0C->unk_34 = get_variable(script, *script->ptrReadPos); return ApiStatus_DONE2; } -ApiStatus N(func_80241EE0_95D0E0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241EE0_95D0E0)(ScriptInstance* script, s32 isInitialCall) { s32 var = get_variable(script, *script->ptrReadPos); EffectInstanceDataThing* effectPtr = N(D_8024DFE0)->unk_0C; @@ -3183,17 +3209,17 @@ ApiStatus N(func_80241EE0_95D0E0)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241F60_95D160)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241F60_95D160)(ScriptInstance* script, s32 isInitialCall) { N(D_8024DFE8)->unk_0C->unk_1C = 0; return ApiStatus_DONE2; } -ApiStatus N(func_80241F78_95D178)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241F78_95D178)(ScriptInstance* script, s32 isInitialCall) { N(D_8024DFE8)->unk_0C->unk_1C = 1; return ApiStatus_DONE2; } -ApiStatus N(func_80241F94_95D194)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241F94_95D194)(ScriptInstance* script, s32 isInitialCall) { N(D_8024DFE8)->unk_0C->unk_1C = 2; return ApiStatus_DONE2; } @@ -3220,7 +3246,7 @@ void N(func_80242468_95D668)(void) { } } -ApiStatus N(func_802424D4_95D6D4)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802424D4_95D6D4)(ScriptInstance* script, s32 isInitialCall) { N(D_8024DFC0) = create_dynamic_entity_frontUI(NULL, N(func_80242468_95D668)); return ApiStatus_DONE2; } @@ -3276,7 +3302,7 @@ ApiStatus N(func_802427BC_95D9BC)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80242858_95DA58)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242858_95DA58)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; N(Unk_Struct_2)* temp_s1 = get_variable(script, *script->ptrReadPos); N(Unk_Struct_1)* ptr; @@ -3401,20 +3427,20 @@ ApiStatus N(func_80242858_95DA58)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkYawFunc.inc.c" -ApiStatus N(func_80243014_95E214)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); +ApiStatus N(func_80243014_95E214)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_unsafe(script->varTable[2]); - N(D_8024E1B4) = npc->currentAnim; - npc->currentAnim = script->varTable[4]; + N(D_8024E1B4) = npc->currentAnim.w; + npc->currentAnim.w = script->varTable[4]; return ApiStatus_DONE2; } -ApiStatus N(func_80243058_95E258)(ScriptInstance *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = N(D_8024E1B4); +ApiStatus N(func_80243058_95E258)(ScriptInstance* script, s32 isInitialCall) { + get_npc_unsafe(script->varTable[2])->currentAnim.w = N(D_8024E1B4); return ApiStatus_DONE2; } -ApiStatus N(func_80243084_95E284)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80243084_95E284)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; playerData->unk_328 = playerData->frameCounter; @@ -3429,7 +3455,8 @@ void N(func_802430C8_95E2C8)(N(Unk_Struct_1)* ptr, s32 arg1) { switch (arg1) { case 2: if (ptr->unk_1C >= 6) { - if (fabsf(get_clamped_angle_diff(atan2(125.0f, -42.0f, 152.0f, -61.0f), atan2(125.0f, -42.0f, playerStatus->position.x, playerStatus->position.z))) < 30.0f) { + if (fabsf(get_clamped_angle_diff(atan2(125.0f, -42.0f, 152.0f, -61.0f), atan2(125.0f, -42.0f, playerStatus->position.x, + playerStatus->position.z))) < 30.0f) { start_script(N(80248504), 1, 0); ptr->unk_20 = 4; } @@ -3444,7 +3471,7 @@ void N(func_802430C8_95E2C8)(N(Unk_Struct_1)* ptr, s32 arg1) { } } -ApiStatus N(func_802431B4_95E3B4)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802431B4_95E3B4)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; s32 val = (playerData->frameCounter - playerData->unk_328) / 3600; @@ -3457,9 +3484,9 @@ ApiStatus N(func_802431B4_95E3B4)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802431FC_95E3FC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802431FC_95E3FC)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - Npc *npc = get_npc_safe(script->owner2.npcID); + Npc* npc = get_npc_safe(script->owner2.npcID); s32 rand; f32 temp_f22; f32 temp_f24; @@ -3480,9 +3507,9 @@ ApiStatus N(func_802431FC_95E3FC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80243350_95E550)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80243350_95E550)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - Bytecode *args = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; f32 var1 = get_variable(script, *args++); f32 var2 = get_variable(script, *args++); f32 var3 = get_variable(script, *args++); diff --git a/src/world/area_dro/dro_02/9694C0.c b/src/world/area_dro/dro_02/9694C0.c index a6b6fe93df..540890958e 100644 --- a/src/world/area_dro/dro_02/9694C0.c +++ b/src/world/area_dro/dro_02/9694C0.c @@ -182,8 +182,7 @@ Script N(main) = SCRIPT({ match SI_VAR(0) { 2, 3 { await N(80243D10); - } - else { + } else { SI_VAR(0) = N(80243C9C); spawn EnterWalk; } @@ -192,7 +191,7 @@ Script N(main) = SCRIPT({ spawn { SetTexPanner(162, 1); SI_VAR(0) = 0; - 123: +123: SI_VAR(0) += 420; if (SI_VAR(0) > 65536) { SI_VAR(0) += -65536; @@ -2043,7 +2042,7 @@ Script N(interact_8024ADE4) = SCRIPT({ await N(8024D494); spawn { MakeLerp(0, 255, 60, 0); - 0: +0: UpdateLerp(); N(UnkFunc32)(3, SI_VAR(0)); sleep 1; @@ -2058,7 +2057,7 @@ Script N(interact_8024ADE4) = SCRIPT({ N(Call800EB168)(SI_VAR(10)); sleep 45; MakeLerp(255, 0, 30, 0); - 1: +1: UpdateLerp(); N(UnkFunc32)(0, SI_VAR(0)); sleep 1; @@ -2170,8 +2169,7 @@ Script N(8024B5A0) = SCRIPT({ SpeakToPlayer(NPC_PARTNER, 0x40006, 0x40001, 5, SI_VAR(8)); EnablePartnerAI(); SI_VAR(12) = 1; - } - else { + } else { DisablePartnerAI(0); sleep 1; SpeakToPlayer(NPC_PARTNER, 0x40006, 0x40001, 5, SI_VAR(9)); @@ -2223,8 +2221,7 @@ Script N(interact_8024B8F0) = SCRIPT({ } } } - } - else { + } else { SpeakToPlayer(NPC_SELF, 0xB80004, 0xB80001, 0, MESSAGE_ID(0x0D, 0x00B3)); } } @@ -2248,8 +2245,7 @@ Script N(interact_8024BA9C) = SCRIPT({ } < STORY_CH5_STAR_SPRIT_DEPARTED { SpeakToPlayer(NPC_SELF, 0x930204, 0x930201, 0, MESSAGE_ID(0x0D, 0x0093)); - } - else { + } else { SpeakToPlayer(NPC_SELF, 0x930204, 0x930201, 0, MESSAGE_ID(0x0D, 0x0094)); } } @@ -2276,8 +2272,7 @@ Script N(interact_8024BBD0) = SCRIPT({ } < STORY_CH5_STAR_SPRIT_DEPARTED { SpeakToPlayer(NPC_SELF, 0x930004, 0x930001, 0, MESSAGE_ID(0x0D, 0x00A3)); - } - else { + } else { SpeakToPlayer(NPC_SELF, 0x930004, 0x930001, 0, MESSAGE_ID(0x0D, 0x00A4)); } } @@ -2314,8 +2309,7 @@ Script N(interact_8024BD4C) = SCRIPT({ SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00A8)); SI_AREA_FLAG(4) = 0; } - } - else { + } else { if (SI_AREA_FLAG(4) == 0) { SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00A9)); SI_AREA_FLAG(4) = 1; @@ -2344,8 +2338,7 @@ Script N(interact_8024BF34) = SCRIPT({ } < STORY_CH5_STAR_SPRIT_DEPARTED { SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00AD)); - } - else { + } else { SpeakToPlayer(NPC_SELF, 0x940005, 0x940001, 0, MESSAGE_ID(0x0D, 0x00AE)); } } @@ -2439,7 +2432,7 @@ Script N(interact_8024C4EC) = SCRIPT({ < STORY_CH2_BOUGHT_SECRET_ITEMS { SI_VAR(11) = 0; SpeakToPlayer(NPC_DISGUISED_MOUSTAFA, 0xBC0004, 0xBC0001, 0, MESSAGE_ID(0x0D, 0x00B4)); - 0: +0: ShowChoice(MESSAGE_ID(0x1E, 0x0019)); if (SI_VAR(0) == 1) { ContinueSpeech(2, 0xBC0004, 0xBC0001, 0, MESSAGE_ID(0x0D, 0x00B6)); @@ -2448,7 +2441,7 @@ Script N(interact_8024C4EC) = SCRIPT({ } else { EndSpeech(2, 12320772, 12320769, 0); } - 1: +1: SI_VAR(0) = 0; SI_VAR(1) = 2; await N(80248A50); @@ -2618,8 +2611,7 @@ Script N(init_8024D04C) = SCRIPT({ InterpNpcYaw(NPC_SELF, 270, 0); SetNpcFlagBits(NPC_SELF, ((NPC_FLAG_200000)), TRUE); SetNpcAnimation(NPC_SELF, 0xBC0005); - } - else { + } else { BindNpcIdle(NPC_SELF, N(idle_8024C450)); BindNpcInteract(NPC_SELF, N(interact_8024C4EC)); } @@ -3124,7 +3116,7 @@ ApiStatus N(func_80240300_9694C0)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/Set80151310.inc.c" -ApiStatus N(func_8024043C_9695FC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024043C_9695FC)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemyID; u16 phi_s0 = get_variable(script, SI_SAVE_FLAG(1768)); u16 phi_s7 = get_variable(script, SI_SAVE_FLAG(1769)); @@ -3183,7 +3175,7 @@ ApiStatus N(func_8024043C_9695FC)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkFunc31.inc.c" -ApiStatus N(func_802409EC_969BAC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802409EC_969BAC)(ScriptInstance* script, s32 isInitialCall) { u16 quizzesAnswered = gPlayerData.quizzesAnswered; if (quizzesAnswered < 999) { @@ -3200,13 +3192,16 @@ ApiStatus N(func_802409EC_969BAC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240A70_969C30)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240A70_969C30)(ScriptInstance* script, s32 isInitialCall) { EffectInstanceDataThing* effectPtr; if (isInitialCall) { - N(D_8024EFC0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3))); - N(D_8024EFC4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3))); - N(D_8024EFC8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), get_variable(script, SI_ARRAY(3)), 1.0f, 0); + N(D_8024EFC0) = func_800715D0(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), + get_variable(script, SI_ARRAY(3))); + N(D_8024EFC4) = func_80071810(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), + get_variable(script, SI_ARRAY(3))); + N(D_8024EFC8) = func_80072890(0, get_variable(script, SI_ARRAY(1)), get_variable(script, SI_ARRAY(2)), + get_variable(script, SI_ARRAY(3)), 1.0f, 0); effectPtr = N(D_8024EFC0)->unk_0C; effectPtr->unk_18 = 0; @@ -3231,7 +3226,7 @@ ApiStatus N(func_80240A70_969C30)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80240C88_969E48)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240C88_969E48)(ScriptInstance* script, s32 isInitialCall) { EffectInstanceDataThing* effectPtr; if (isInitialCall) { @@ -3256,12 +3251,12 @@ ApiStatus N(func_80240C88_969E48)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80240D3C_969EFC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240D3C_969EFC)(ScriptInstance* script, s32 isInitialCall) { ((N(temp)*)N(D_8024EFC0))->unk_0C->unk_34 = get_variable(script, *script->ptrReadPos); return ApiStatus_DONE2; } -ApiStatus N(func_80240D70_969F30)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240D70_969F30)(ScriptInstance* script, s32 isInitialCall) { s32 var = get_variable(script, *script->ptrReadPos); EffectInstanceDataThing* effectPtr = N(D_8024EFC0)->unk_0C; @@ -3283,17 +3278,17 @@ ApiStatus N(func_80240D70_969F30)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240DF0_969FB0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240DF0_969FB0)(ScriptInstance* script, s32 isInitialCall) { ((N(temp)*)N(D_8024EFC8))->unk_0C->unk_1C = 0; return ApiStatus_DONE2; } -ApiStatus N(func_80240E08_969FC8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240E08_969FC8)(ScriptInstance* script, s32 isInitialCall) { ((N(temp)*)N(D_8024EFC8))->unk_0C->unk_1C = 1; return ApiStatus_DONE2; } -ApiStatus N(func_80240E24_969FE4)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240E24_969FE4)(ScriptInstance* script, s32 isInitialCall) { ((N(temp)*)N(D_8024EFC8))->unk_0C->unk_1C = 2; return ApiStatus_DONE2; } @@ -3320,12 +3315,12 @@ void N(func_802412F8_96A4B8)(void) { } } -ApiStatus N(func_80241364_96A524)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241364_96A524)(ScriptInstance* script, s32 isInitialCall) { gPauseMenuCursorPosY = create_dynamic_entity_frontUI(NULL, N(func_802412F8_96A4B8)); return ApiStatus_DONE2; } -ApiStatus N(func_80241394_96A554)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241394_96A554)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; Bytecode* args = script->ptrReadPos; s32 var1 = get_variable(script, *args++); @@ -3361,7 +3356,7 @@ ApiStatus N(func_80241394_96A554)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802414C0_96A680)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802414C0_96A680)(ScriptInstance* script, s32 isInitialCall) { s32 i; if (isInitialCall) { @@ -3387,7 +3382,7 @@ ApiStatus N(func_802414C0_96A680)(ScriptInstance *script, s32 isInitialCall) { return (script->functionTemp[0].s == 255) * ApiStatus_DONE2; } -ApiStatus N(func_802415CC_96A78C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802415CC_96A78C)(ScriptInstance* script, s32 isInitialCall) { s32 i; if (isInitialCall) { @@ -3418,7 +3413,7 @@ ApiStatus N(func_802415CC_96A78C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_802416FC_96A8BC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802416FC_96A8BC)(ScriptInstance* script, s32 isInitialCall) { s32 ret; N(D_8024EFCC) = script; @@ -3440,7 +3435,7 @@ ApiStatus N(func_802416FC_96A8BC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241874_96AA34)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241874_96AA34)(ScriptInstance* script, s32 isInitialCall) { func_8013A854(get_variable(script, SI_ARRAY(0))); func_8013A854(get_variable(script, SI_ARRAY(1))); func_8013A854(get_variable(script, SI_ARRAY(2))); @@ -3487,19 +3482,22 @@ s32 func_8024190C_96AACC(D_8024F010_Struct* ptr, Matrix4f matrix) { gDPSetTextureLUT(gMasterGfxPos++, G_TT_RGBA16); gDPLoadTLUT_pal16(gMasterGfxPos++, 0, 0xFFFFFFFF); gDPTileSync(gMasterGfxPos++); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPLoadSync(gMasterGfxPos++); gDPLoadTLUTCmd(gMasterGfxPos++, G_TX_LOADTILE, 15); gDPPipeSync(gMasterGfxPos++); gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, subroutine_arg2E, subroutine_arg2C); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 0, subroutine_arg2E, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 0, subroutine_arg2E, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, + 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); gDPLoadSync(gMasterGfxPos++); gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, subroutine_arg2E, subroutine_arg2F); gDPPipeSync(gMasterGfxPos++); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 0, subroutine_arg2E, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 0, subroutine_arg2E, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, subroutine_arg2E, subroutine_arg2F); guTranslateF(&subroutine_arg6, ptr->unk_20 - (subroutine_arg2E / 2) - 30, 0.0f, 0.0f); @@ -3552,7 +3550,8 @@ s32 func_8024190C_96AACC(D_8024F010_Struct* ptr, Matrix4f matrix) { gMatrixListPos++; func_802DE044(&subroutine_arg2C, ptr->unk_18, ptr->unk_1C); - func_8013AF70(get_variable(N(D_8024EFCC), SI_ARRAY(3)), subroutine_arg2C, subroutine_arg2D, subroutine_arg2E, subroutine_arg2F, -(subroutine_arg2E / 2), subroutine_arg2F / 2, 0xFF, &subroutine_arg26, 0x10, &subroutine_arg6); + func_8013AF70(get_variable(N(D_8024EFCC), SI_ARRAY(3)), subroutine_arg2C, subroutine_arg2D, subroutine_arg2E, + subroutine_arg2F, -(subroutine_arg2E / 2), subroutine_arg2F / 2, 0xFF, &subroutine_arg26, 0x10, &subroutine_arg6); gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); } @@ -3562,14 +3561,15 @@ s32 func_8024190C_96AACC(D_8024F010_Struct* ptr, Matrix4f matrix) { INCLUDE_ASM(u32, "world/area_dro/dro_02/9694C0", dro_02_func_8024190C_96AACC, D_8024F010_Struct* ptr, Matrix4f matrix); #endif -void N(func_80242214_96B3D4)(s32 arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4) { +void N(func_80242214_96B3D4)(s32 arg0, f32* arg1, f32* arg2, f32* arg3, f32* arg4) { s32* CC_ptr = &N(D_8024EFCC); D_8024F010_Struct* F010_ptr; Matrix4f sp20; Matrix4f sp60; Matrix4f spA0; - guPositionF(&spA0, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(*CC_ptr, SI_ARRAY(4)), get_variable(*CC_ptr, SI_ARRAY(5)), get_variable(*CC_ptr, SI_ARRAY(6))); + guPositionF(&spA0, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(*CC_ptr, SI_ARRAY(4)), + get_variable(*CC_ptr, SI_ARRAY(5)), get_variable(*CC_ptr, SI_ARRAY(6))); F010_ptr = ({ D_8024F010_Struct* a = &N(D_8024F010); &a[arg0]; }); guTranslateF(&sp60, F010_ptr->unk_04, F010_ptr->unk_08, F010_ptr->unk_0C); @@ -3586,7 +3586,7 @@ void N(func_80242214_96B3D4)(s32 arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg // Too much work, maybe try again later #ifdef NON_MATCHING -void func_8024240C_96B5CC(ScriptInstance *script, s32 isInitialCall) { +void func_8024240C_96B5CC(ScriptInstance* script, s32 isInitialCall) { N(temp)** effect; N(temp)** effect2; N(temp)** effect3; @@ -3896,14 +3896,16 @@ void func_8024240C_96B5CC(ScriptInstance *script, s32 isInitialCall) { } } #else -INCLUDE_ASM(void, "world/area_dro/dro_02/9694C0", dro_02_func_8024240C_96B5CC, ScriptInstance *script, s32 isInitialCall); +INCLUDE_ASM(void, "world/area_dro/dro_02/9694C0", dro_02_func_8024240C_96B5CC, ScriptInstance* script, + s32 isInitialCall); #endif -void N(func_80242EAC_96C06C)(ScriptInstance *script, s32 isInitialCall) { +void N(func_80242EAC_96C06C)(ScriptInstance* script, s32 isInitialCall) { Matrix4f sp20; u32 temp_s1; - guPositionF(&sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(N(D_8024EFCC), SI_ARRAY(4)), get_variable(N(D_8024EFCC), SI_ARRAY(5)), get_variable(N(D_8024EFCC), SI_ARRAY(6))); + guPositionF(&sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 0.71428573f, get_variable(N(D_8024EFCC), + SI_ARRAY(4)), get_variable(N(D_8024EFCC), SI_ARRAY(5)), get_variable(N(D_8024EFCC), SI_ARRAY(6))); temp_s1 = func_8024190C_96AACC(&N(D_8024F010)[0], &sp20); func_8024190C_96AACC(&N(D_8024F010)[1], &sp20); @@ -3916,12 +3918,12 @@ void N(func_80242EAC_96C06C)(ScriptInstance *script, s32 isInitialCall) { } } -ApiStatus N(func_8024303C_96C1FC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024303C_96C1FC)(ScriptInstance* script, s32 isInitialCall) { sfx_play_sound_with_params(0x202A, 0, 0x18, 0); return ApiStatus_DONE2; } -ApiStatus N(func_80243068_96C228)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80243068_96C228)(ScriptInstance* script, s32 isInitialCall) { sfx_play_sound_with_params(0x202B, 0, 0x68, 0); return ApiStatus_DONE2; } @@ -4016,15 +4018,15 @@ ApiStatus N(func_802433E8_96C5A8)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/UnkYawFunc.inc.c" -ApiStatus N(func_802439FC_96CBBC)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->varTable[2]); +ApiStatus N(func_802439FC_96CBBC)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_unsafe(script->varTable[2]); - N(D_8024F3B8) = npc->currentAnim; - npc->currentAnim = script->varTable[4]; + N(D_8024F3B8) = npc->currentAnim.w; + npc->currentAnim.w = script->varTable[4]; return ApiStatus_DONE2; } -ApiStatus N(func_80243A40_96CC00)(ScriptInstance *script, s32 isInitialCall) { - get_npc_unsafe(script->varTable[2])->currentAnim = N(D_8024F3B8); +ApiStatus N(func_80243A40_96CC00)(ScriptInstance* script, s32 isInitialCall) { + get_npc_unsafe(script->varTable[2])->currentAnim.w = N(D_8024F3B8); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_00/C9DF20.c b/src/world/area_flo/flo_00/C9DF20.c index 0822bb1457..1e38df4bb2 100644 --- a/src/world/area_flo/flo_00/C9DF20.c +++ b/src/world/area_flo/flo_00/C9DF20.c @@ -3,7 +3,7 @@ // Same as SpawnSunEffect, but doesn't touch float regs like SpawnSunEffect does void func_80072950(); -ApiStatus N(func_80240000_C9DF20)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_C9DF20)(ScriptInstance* script, s32 isInitialCall) { func_80072950(0, 0, 0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_00/C9DF60.c b/src/world/area_flo/flo_00/C9DF60.c index 5707774ad9..fb6a23588b 100644 --- a/src/world/area_flo/flo_00/C9DF60.c +++ b/src/world/area_flo/flo_00/C9DF60.c @@ -68,13 +68,11 @@ Script N(802414D0) = SCRIPT({ } == 11 { FadeInMusic(0, 49, 0, 3000, 0, 127); - } - else { + } else { match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -330,7 +328,7 @@ Script N(main) = SCRIPT({ spawn { EnableTexPanning(35, 1); SI_VAR(0) = 0; - 0: +0: RandInt(300, SI_VAR(1)); SI_VAR(1) += 100; RandInt(1, SI_VAR(2)); @@ -540,8 +538,7 @@ Script N(80242FCC) = SCRIPT({ } < STORY_CH6_BEGAN_PEACH_MISSION { SwitchMessage(MESSAGE_ID(0x11, 0x0012)); - } - else { + } else { SwitchMessage(MESSAGE_ID(0x11, 0x0013)); } } @@ -627,9 +624,9 @@ Script N(interact_8024352C) = SCRIPT({ SI_AREA_FLAG(18) = 0; } } - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_00, Anim_9), NPC_ANIM(bubulb, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, 0x001C)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_00, Anim_9), NPC_ANIM(bubulb, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, + 0x001C)); } } }); @@ -659,9 +656,9 @@ Script N(interact_802436C0) = SCRIPT({ SI_AREA_FLAG(19) = 0; } } - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_01, Anim_3), NPC_ANIM(bubulb, Palette_01, Anim_2), 0, MESSAGE_ID(0x11, 0x0023)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_01, Anim_3), NPC_ANIM(bubulb, Palette_01, Anim_2), 0, MESSAGE_ID(0x11, + 0x0023)); } } }); @@ -691,9 +688,9 @@ Script N(interact_80243854) = SCRIPT({ SI_AREA_FLAG(20) = 0; } } - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_02, Anim_9), NPC_ANIM(bubulb, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, 0x002A)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_02, Anim_9), NPC_ANIM(bubulb, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, + 0x002A)); } } }); @@ -723,9 +720,9 @@ Script N(interact_802439E8) = SCRIPT({ SI_AREA_FLAG(21) = 0; } } - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_03, Anim_9), NPC_ANIM(bubulb, Palette_03, Anim_8), 0, MESSAGE_ID(0x11, 0x0031)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(bubulb, Palette_03, Anim_9), NPC_ANIM(bubulb, Palette_03, Anim_8), 0, MESSAGE_ID(0x11, + 0x0031)); } } }); @@ -825,9 +822,9 @@ Script N(interact_80243C4C) = SCRIPT({ EndSpeech(-1, NPC_ANIM(tolielup, Palette_00, Anim_3), NPC_ANIM(tolielup, Palette_00, Anim_3), 0); } } - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(tolielup, Palette_00, Anim_2), NPC_ANIM(tolielup, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x003A)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(tolielup, Palette_00, Anim_2), NPC_ANIM(tolielup, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x003A)); EndSpeech(-1, NPC_ANIM(tolielup, Palette_00, Anim_3), NPC_ANIM(tolielup, Palette_00, Anim_3), 0); } } @@ -1003,19 +1000,23 @@ Script N(init_80244BF4) = SCRIPT({ Script N(interact_80244C98) = SCRIPT({ if (STORY_PROGRESS <= STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE) { - SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032)); + SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0032)); } else { GetCurrentPartnerID(SI_VAR(0)); if (SI_VAR(0) == 8) { - SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032)); + SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0032)); sleep 10; DisablePartnerAI(0); - SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, Anim_3), 5, MESSAGE_ID(0x11, 0x0033)); + SpeakToPlayer(NPC_PARTNER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, + Anim_3), 5, MESSAGE_ID(0x11, 0x0033)); SetNpcAnimation(NPC_PARTNER, NPC_ANIM(world_lakilester, Palette_00, Anim_1)); EndSpeech(-4, NPC_ANIM(world_lakilester, Palette_00, Anim_9), NPC_ANIM(world_lakilester, Palette_00, Anim_1), 5); EnablePartnerAI(); } else { - SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0034)); + SpeakToPlayer(NPC_LAKILULU, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0034)); } } }); @@ -1307,7 +1308,7 @@ NpcSettings N(npcSettings_80245E5C) = { f32 N(D_80245E88_CA3DA8)[] = { 266.0f, 20.0f, 322.0f, 310.0f, - 30.0f, 312.0f, 346.0f, 90.0f, + 30.0f, 312.0f, 346.0f, 90.0f, 300.0f, 400.0f, 200.0f, 287.0f, }; @@ -1691,7 +1692,7 @@ Script N(802477EC) = SCRIPT({ sleep 1; } } - 10: +10: if (SI_MAP_VAR(10) == 0) { sleep 1; goto 10; @@ -1802,8 +1803,7 @@ Script N(80247FAC) = SCRIPT({ SetCamPosB(0, 0, -300); PanToTarget(0, 0, 1); WaitForCam(0, 1.0); - } - else { + } else { } } if (SI_VAR(15) > 550) { @@ -1869,7 +1869,7 @@ Script N(802485A8) = SCRIPT({ if (SI_SAVE_FLAG(1371) == 0) { group 0; func_802D5830(1); - 10: +10: func_802D6420(); SI_VAR(2) = SI_VAR(0); match SI_VAR(2) { @@ -1887,14 +1887,12 @@ Script N(802485A8) = SCRIPT({ SI_MAP_VAR(11) = SI_VAR(0); SetPlayerAnimation(ANIM_STAND_STILL); sleep 20; - } - else { + } else { match SI_AREA_FLAG(17) { == 0 { ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0008), 0, 10, -200); SI_AREA_FLAG(17) = 1; - } - else { + } else { ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0009), 0, 10, -200); } } @@ -1910,7 +1908,7 @@ Script N(802485A8) = SCRIPT({ if (SI_SAVE_FLAG(1372) == 0) { group 0; func_802D5830(1); - 20: +20: func_802D6420(); SI_VAR(2) = SI_VAR(0); match SI_VAR(2) { @@ -1930,14 +1928,12 @@ Script N(802485A8) = SCRIPT({ SI_MAP_VAR(11) = SI_VAR(0); SetPlayerAnimation(ANIM_STAND_STILL); sleep 20; - } - else { + } else { match SI_AREA_FLAG(17) { == 0 { ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0008), 0, 10, -200); SI_AREA_FLAG(17) = 1; - } - else { + } else { ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x0009), 0, 10, -200); } } @@ -2065,8 +2061,7 @@ Script N(80248F48) = SCRIPT({ spawn N(80247588); SI_VAR(0) = 1; spawn N(802476F4); - } - else { + } else { SI_VAR(0) = -700; spawn N(80246850); spawn N(80247488); @@ -2092,7 +2087,7 @@ Script N(makeEntities) = SCRIPT({ ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 ret; f32 max; f32 posX; @@ -2114,7 +2109,7 @@ ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, NpcAISettings* aiSetti } } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -2139,7 +2134,7 @@ ApiStatus N(func_802406BC_C9E5DC)(ScriptInstance* script, NpcAISettings* aiSetti if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) { script->functionTemp[2].s = 0; } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -2182,7 +2177,7 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) { if (isInitialCall || enemy->unk_B0 & 4) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->patrol.isFlying) { npc->flags = (npc->flags | 0x200) & ~8; diff --git a/src/world/area_flo/flo_00/C9EE30.c b/src/world/area_flo/flo_00/C9EE30.c index cde0f32829..1c94a1f788 100644 --- a/src/world/area_flo/flo_00/C9EE30.c +++ b/src/world/area_flo/flo_00/C9EE30.c @@ -1,6 +1,6 @@ #include "flo_00.h" -ApiStatus N(func_80240F10_C9EE30)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240F10_C9EE30)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 var1 = *args++; s32 var2 = *args++; @@ -11,7 +11,7 @@ ApiStatus N(func_80240F10_C9EE30)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240F80_C9EEA0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240F80_C9EEA0)(ScriptInstance* script, s32 isInitialCall) { f32 var1 = get_variable(NULL, script->varTable[2]); f32 dist = dist2D(-83.0f, 87.0f, script->varTable[9], script->varTable[11]); f32 clamped = clamp_angle(atan2(-83.0f, 87.0f, script->varTable[9], script->varTable[11]) - var1); @@ -25,8 +25,8 @@ ApiStatus N(func_80240F80_C9EEA0)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802410B4_C9EFD4)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_by_index(0); +ApiStatus N(func_802410B4_C9EFD4)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_by_index(0); f32 temp_f20 = get_variable(NULL, script->varTable[2]); f32 dist = dist2D(-83.0f, 87.0f, script->varTable[12], script->varTable[14]); f32 clamped = clamp_angle(atan2(-83.0f, 87.0f, script->varTable[12], script->varTable[14]) - temp_f20); @@ -44,12 +44,12 @@ ApiStatus N(func_802410B4_C9EFD4)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/SyncStatusMenu.inc.c" -ApiStatus N(func_8024139C_C9F2BC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024139C_C9F2BC)(ScriptInstance* script, s32 isInitialCall) { increment_status_menu_disabled(); return ApiStatus_DONE2; } -ApiStatus N(func_802413BC_C9F2DC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802413BC_C9F2DC)(ScriptInstance* script, s32 isInitialCall) { decrement_status_menu_disabled(); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_03/CA72E0.c b/src/world/area_flo/flo_03/CA72E0.c index a8a2128ddc..b6b615f86a 100644 --- a/src/world/area_flo/flo_03/CA72E0.c +++ b/src/world/area_flo/flo_03/CA72E0.c @@ -42,8 +42,7 @@ Script N(802406A0) = SCRIPT({ } < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -353,12 +352,14 @@ Script N(interact_802412BC) = SCRIPT({ } == STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES { if (SI_SAVE_FLAG(1411) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_7), NPC_ANIM(petunia, Palette_00, Anim_6), 0, MESSAGE_ID(0x11, 0x0058)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_7), NPC_ANIM(petunia, Palette_00, Anim_6), 0, + MESSAGE_ID(0x11, 0x0058)); SetNpcAnimation(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_6)); } else { SI_VAR(4) = (int) 3.5; await N(8024122C); - SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_8), NPC_ANIM(petunia, Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x0059)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_8), NPC_ANIM(petunia, Palette_00, Anim_3), 0, + MESSAGE_ID(0x11, 0x0059)); EndSpeech(-1, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0); SetNpcAnimation(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_4)); sleep 20; @@ -368,7 +369,8 @@ Script N(interact_802412BC) = SCRIPT({ await N(80240F0C); AddKeyItem(ITEM_MAGICAL_BEAN); sleep 20; - SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005A)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x005A)); EndSpeech(-1, NPC_ANIM(petunia, Palette_00, Anim_7), NPC_ANIM(petunia, Palette_00, Anim_6), 0); STORY_PROGRESS = STORY_CH6_GOT_MAGICAL_BEAN; } @@ -378,13 +380,14 @@ Script N(interact_802412BC) = SCRIPT({ } < STORY_CH6_RETURNED_TO_TOAD_TOWN { SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005C)); - } - else { + } else { if (SI_AREA_VAR(1) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005D)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x005D)); SI_AREA_VAR(1) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x005E)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(petunia, Palette_00, Anim_2), NPC_ANIM(petunia, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x005E)); } } } @@ -407,8 +410,7 @@ Script N(init_80241E10) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_ASKED_TO_DEFEAT_MONTY_MOLES { SetNpcPos(NPC_DAYZEE, 0, -1000, 0); - } - else { + } else { if (SI_SAVE_FLAG(1366) == 0) { SetEnemyFlagBits(1, 1, 0); BindNpcIdle(NPC_SELF, N(npcAI_8024119C)); @@ -816,8 +818,7 @@ Script N(init_8024338C) = SCRIPT({ } else { SetNpcPos(NPC_MONTY_MOLE0, 0, -1000, 0); } - } - else { + } else { SetNpcPos(NPC_MONTY_MOLE0, 0, -1000, 0); } } @@ -840,8 +841,7 @@ Script N(init_802434CC) = SCRIPT({ } else { SetNpcPos(NPC_MONTY_MOLE1, 0, -1000, 0); } - } - else { + } else { SetNpcPos(NPC_MONTY_MOLE1, 0, -1000, 0); } } @@ -864,8 +864,7 @@ Script N(init_8024360C) = SCRIPT({ } else { SetNpcPos(NPC_MONTY_MOLE2, 0, -1000, 0); } - } - else { + } else { SetNpcPos(NPC_MONTY_MOLE2, 0, -1000, 0); } } @@ -888,8 +887,7 @@ Script N(init_8024374C) = SCRIPT({ } else { SetNpcPos(NPC_MONTY_MOLE3, 0, -1000, 0); } - } - else { + } else { SetNpcPos(NPC_MONTY_MOLE3, 0, -1000, 0); } } @@ -1106,9 +1104,9 @@ ApiStatus N(func_80240040_CA72E0)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/GetItemName.inc.c" -ApiStatus N(func_80240158_CA73F8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240158_CA73F8)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 clamp = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.position.x, gPlayerStatus.position.z) + 180.0f); f32 sp10 = -210.0f; @@ -1143,18 +1141,18 @@ ApiStatus N(func_80240158_CA73F8)(ScriptInstance *script, s32 isInitialCall) { add_vec2D_polar(&sp10, &sp14, 46.0f, clamp); } } - npc->currentAnim = enemy->animList[2]; + npc->currentAnim.w = enemy->animList[2]; npc->yaw = atan2(npc->pos.x, npc->pos.z, sp10, sp14); npc_move_heading(npc, 2.0f, npc->yaw); } else if (temp_f4 > 0.2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, sp10, sp14); npc->pos.x = sp10; npc->pos.z = sp14; - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; } else { npc->pos.x = sp10; npc->pos.z = sp14; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; } return ApiStatus_BLOCK; } diff --git a/src/world/area_flo/flo_07/CAC5D0.c b/src/world/area_flo/flo_07/CAC5D0.c index 0a49770728..1007de16f0 100644 --- a/src/world/area_flo/flo_07/CAC5D0.c +++ b/src/world/area_flo/flo_07/CAC5D0.c @@ -27,8 +27,7 @@ Script N(802407A0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -295,10 +294,12 @@ Script N(interact_80242044) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_GOT_MAGICAL_BEAN { if (SI_AREA_FLAG(5) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0070)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0070)); SI_AREA_FLAG(5) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0071)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0071)); } } < STORY_CH6_GOT_FERTILE_SOIL { @@ -325,29 +326,35 @@ Script N(interact_80242044) = SCRIPT({ await N(80241DBC); ResetCam(0, 4.0); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0072)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0072)); } } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0072)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0072)); } } < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { if (SI_SAVE_FLAG(1374) == 0) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0072)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0072)); } else { if (STORY_PROGRESS < STORY_CH6_GOT_WATER_STONE) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0073)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0073)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0074)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0074)); } - ContinueSpeech(-1, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0075)); + ContinueSpeech(-1, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0075)); } } < STORY_CH6_RETURNED_TO_TOAD_TOWN { SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0076)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0077)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0077)); } } await N(80240890); @@ -372,12 +379,14 @@ Script N(802424F4) = SCRIPT({ DisablePlayerInput(TRUE); sleep 10; if (SI_AREA_VAR(3) < 5) { - SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x006E)); + SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x006E)); GetPlayerPos(SI_VAR(1), SI_VAR(2), SI_VAR(3)); PlayerMoveTo(410, SI_VAR(3), 10); SI_AREA_VAR(3) += 1; } else { - SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x006F)); + SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_2), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x006F)); SI_AREA_VAR(3) = 0; } DisablePlayerInput(FALSE); @@ -391,7 +400,8 @@ Script N(tree1_Callback) = SCRIPT({ if (STORY_PROGRESS < STORY_CH6_GOT_CRYSTAL_BERRY) { NpcFacePlayer(NPC_POSIE, 1); sleep 10; - SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0067)); + SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0067)); if (STORY_PROGRESS == STORY_CH6_GOT_FERTILE_SOIL) { if (SI_SAVE_FLAG(1379) == 1) { UseSettingsFrom(0, -250, 0, 0); @@ -406,7 +416,8 @@ Script N(tree1_Callback) = SCRIPT({ if (SI_SAVE_FLAG(1374) == 0) { NpcFacePlayer(NPC_POSIE, 1); sleep 10; - SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0067)); + SpeakToPlayer(NPC_POSIE, NPC_ANIM(posie, Palette_00, Anim_4), NPC_ANIM(posie, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0067)); } else { SI_AREA_VAR(2) += 1; match SI_AREA_VAR(2) { diff --git a/src/world/area_flo/flo_08/CAED40.c b/src/world/area_flo/flo_08/CAED40.c index 25af5e53dd..83b0b7489e 100644 --- a/src/world/area_flo/flo_08/CAED40.c +++ b/src/world/area_flo/flo_08/CAED40.c @@ -36,7 +36,7 @@ typedef struct { s16 unk_32C; } N(UnkStruct); -ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; N(UnkStruct)* ptr; s32 i; @@ -108,7 +108,8 @@ ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } #else -INCLUDE_ASM(ApiStatus, "world/area_flo/flo_08/CAED40", flo_08_func_802401CC_CAEF0C, ScriptInstance *script, s32 isInitialCall); +INCLUDE_ASM(ApiStatus, "world/area_flo/flo_08/CAED40", flo_08_func_802401CC_CAEF0C, ScriptInstance* script, + s32 isInitialCall); #endif ApiStatus N(func_8024041C_CAF15C)(ScriptInstance* script, s32 isInitialCall) { @@ -141,8 +142,8 @@ typedef struct { s32 unk_64; } N(UserData); -ApiStatus N(func_80240600_CAF340)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus N(func_80240600_CAF340)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_safe(-4); f32 sinTheta, cosTheta; s32 i; @@ -160,7 +161,8 @@ ApiStatus N(func_80240600_CAF340)(ScriptInstance *script, s32 isInitialCall) { scriptPtr->unk_5C = get_entity_by_index(get_variable(script, *args)); for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); + userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, + scriptPtr->unk_5C->position.z, 1.0f, -1); save = 0.0f; userDataPtr->unk_2C[i] = save; userDataPtr->unk_20[i] = save; diff --git a/src/world/area_flo/flo_08/CAFAC0.c b/src/world/area_flo/flo_08/CAFAC0.c index ed4d2f9315..91fa00071c 100644 --- a/src/world/area_flo/flo_08/CAFAC0.c +++ b/src/world/area_flo/flo_08/CAFAC0.c @@ -39,8 +39,7 @@ Script N(80241F40) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -268,7 +267,7 @@ Script N(main) = SCRIPT({ spawn { SI_VAR(0) = 0; SI_VAR(1) = 0; - 0: +0: SI_VAR(0) += 140; if (SI_VAR(0) > 65536) { SI_VAR(0) += -65536; @@ -431,7 +430,8 @@ Script N(interact_80243214) = SCRIPT({ SetCamSpeed(0, 4.0); PanToTarget(0, 0, 1); WaitForCam(0, 1.0); - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_2), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0042)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_2), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, + MESSAGE_ID(0x11, 0x0042)); SetPlayerAnimation(ANIM_THINKING); N(func_80241BCC_CB090C)(); SI_VAR(0) = 0x80246430; @@ -441,8 +441,7 @@ Script N(interact_80243214) = SCRIPT({ <= 0 { SetPlayerAnimation(ANIM_STAND_STILL); SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_2), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0043)); - } - else { + } else { SI_VAR(8) = SI_VAR(0); N(func_80241B5C_CB089C)(SI_VAR(0)); MakeItemEntity(SI_VAR(8), -695, 20, -29, 1, 0); @@ -487,9 +486,9 @@ Script N(interact_80243214) = SCRIPT({ == 158 { SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_4), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0045)); SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_1)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_4), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, MESSAGE_ID(0x11, 0x0044)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_4), NPC_ANIM(gate_flower, Palette_02, Anim_1), 0, + MESSAGE_ID(0x11, 0x0044)); SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_6)); PlaySoundAtNpc(NPC_SELF, 0x2096, 0); MakeItemEntity(SI_VAR(8), 125, 20, 0, 1, 0); @@ -549,9 +548,11 @@ Script N(interact_80243214) = SCRIPT({ sleep 10; } else { if (STORY_PROGRESS < STORY_CH6_STAR_SPIRIT_RESCUED) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, 0x0047)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0, + MESSAGE_ID(0x11, 0x0047)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0, MESSAGE_ID(0x11, 0x0048)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_02, Anim_9), NPC_ANIM(gate_flower, Palette_02, Anim_8), 0, + MESSAGE_ID(0x11, 0x0048)); } } DisablePlayerInput(FALSE); @@ -938,7 +939,7 @@ static s32 N(pad_4F3C) = { 0x00000000, }; -void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) { +void N(func_80240D80_CAFAC0)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -961,11 +962,12 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting f32 subroutine_arg10; npc->duration = npcAISettings->unk_20 / 2 + rand_int(npcAISettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[3]; + npc->currentAnim.w = enemy->animList[3]; npc->moveSpeed = npcAISettings->chaseSpeed; phi_s3 = FALSE; - temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f); + temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) + 180.0f); temp_f0 = get_clamped_angle_diff(npc->yaw, temp_f20); if (npcAISettings->unk_1C.s < fabsf(temp_f0)) { temp_f20 = npc->yaw; @@ -982,19 +984,22 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting subroutine_arg9 = npc->pos.y; subroutine_argA = npc->pos.z; - temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f); + temp_f20 = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) + 180.0f); phi_f22 = 0.0f; phi_f24 = 0.0f; phi_f26 = 0.0f; - if (func_800DDCEC(npc->unk_80, &subroutine_arg8, &subroutine_arg9, &subroutine_argA, npc->moveSpeed * 4.5, temp_f20, npc->collisionHeight, npc->collisionRadius) != 0) { + if (func_800DDCEC(npc->unk_80, &subroutine_arg8, &subroutine_arg9, &subroutine_argA, npc->moveSpeed * 4.5, temp_f20, + npc->collisionHeight, npc->collisionRadius) != 0) { phi_f22 = dist2D(npc->pos.x, npc->pos.z, subroutine_arg8, subroutine_argA); subroutine_argB = npc->pos.x; subroutine_argC = npc->pos.y; subroutine_argD = npc->pos.z; - if (func_800DDCEC(npc->unk_80, &subroutine_argB, &subroutine_argC, &subroutine_argD, npc->moveSpeed * 4.5, clamp_angle(temp_f20 + 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) { + if (func_800DDCEC(npc->unk_80, &subroutine_argB, &subroutine_argC, &subroutine_argD, npc->moveSpeed * 4.5, + clamp_angle(temp_f20 + 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) { phi_f24 = dist2D(npc->pos.x, npc->pos.z, subroutine_argB, subroutine_argD); } @@ -1002,7 +1007,8 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting subroutine_argF = npc->pos.y; subroutine_arg10 = npc->pos.z; - if (func_800DDCEC(npc->unk_80, &subroutine_argE, &subroutine_argF, &subroutine_arg10, npc->moveSpeed * 4.5, clamp_angle(temp_f20 - 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) { + if (func_800DDCEC(npc->unk_80, &subroutine_argE, &subroutine_argF, &subroutine_arg10, npc->moveSpeed * 4.5, + clamp_angle(temp_f20 - 35.0f), npc->collisionHeight, npc->collisionRadius) != 0) { phi_f26 = dist2D(npc->pos.x, npc->pos.z, subroutine_argE, subroutine_arg10); } @@ -1042,23 +1048,23 @@ void N(func_80240D80_CAFAC0)(ScriptInstance *script, NpcAISettings *npcAISetting } if (phi_s3) { npc->duration = 0xA; - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; } script->functionTemp[0].s = 0xD; } -void N(func_80241364_CB00A4)(ScriptInstance *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) { +void N(func_80241364_CB00A4)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, npcAISettings->chaseRadius, npcAISettings->unk_28.f, 1) == 0) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; script->functionTemp[0].s = 14; } else { - if (npc->currentAnim != enemy->animList[8]) { + if (npc->currentAnim.w != enemy->animList[8]) { if (npc->moveSpeed < 4.0) { func_8003D660(npc, 0); } else { @@ -1075,9 +1081,9 @@ void N(func_80241364_CB00A4)(ScriptInstance *script, NpcAISettings *npcAISetting } } -void N(func_802414C8_CB0208)(ScriptInstance *script, NpcAISettings *npcAISettings, EnemyTerritoryThing *territory) { +void N(func_802414C8_CB0208)(ScriptInstance* script, NpcAISettings* npcAISettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration--; if (npc->duration == 0) { @@ -1085,9 +1091,9 @@ void N(func_802414C8_CB0208)(ScriptInstance *script, NpcAISettings *npcAISetting } } -ApiStatus N(func_8024150C_CB024C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024150C_CB024C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; @@ -1105,7 +1111,7 @@ ApiStatus N(func_8024150C_CB024C)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->unk_B0 & 4)) { script->functionTemp[0].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; if (!enemy->territory->wander.isFlying) { npc->flags = (npc->flags | 0x200) & ~0x8; @@ -1197,7 +1203,7 @@ ApiStatus N(func_802419FC_CB073C)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241A98_CB07D8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241A98_CB07D8)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 itemIdx = get_variable(script, *args++); s32 var1 = get_variable(script, *args++); @@ -1212,7 +1218,7 @@ ApiStatus N(func_80241A98_CB07D8)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241B5C_CB089C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241B5C_CB089C)(ScriptInstance* script, s32 isInitialCall) { s32 itemId = get_variable(script, *script->ptrReadPos); StaticItem* item = &gItemTable[itemId]; @@ -1227,7 +1233,7 @@ ApiStatus N(func_80241B5C_CB089C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241BCC_CB090C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241BCC_CB090C)(ScriptInstance* script, s32 isInitialCall) { s32 i; for (i = 0; i <= 90; i++) { diff --git a/src/world/area_flo/flo_09/CB50E0.c b/src/world/area_flo/flo_09/CB50E0.c index 583c662a57..e05da359f1 100644 --- a/src/world/area_flo/flo_09/CB50E0.c +++ b/src/world/area_flo/flo_09/CB50E0.c @@ -27,8 +27,7 @@ Script N(80241880) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -423,8 +422,8 @@ NpcSettings N(npcSettings_80243600) = { }; f32 N(D_8024362C_CB862C)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_80243644) = { diff --git a/src/world/area_flo/flo_09/CB5320.c b/src/world/area_flo/flo_09/CB5320.c index 9ac9ea7700..32a8412248 100644 --- a/src/world/area_flo/flo_09/CB5320.c +++ b/src/world/area_flo/flo_09/CB5320.c @@ -6,14 +6,14 @@ void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -25,7 +25,7 @@ void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings, } #ifdef NON_MATCHING -void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 temp_f24; @@ -139,9 +139,9 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -169,7 +169,8 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, } } #else -INCLUDE_ASM(ApiStatus, "world/area_flo/flo_09/CB5320", flo_09_func_802404D0_CB54D0, ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory); +INCLUDE_ASM(ApiStatus, "world/area_flo/flo_09/CB5320", flo_09_func_802404D0_CB54D0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -196,10 +197,10 @@ void N(func_80240F74_CB5F74)(ScriptInstance* script, NpcAISettings* aiSettings, #include "world/common/UnkFunc5.inc.c" -ApiStatus N(func_8024162C_CB662C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024162C_CB662C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Bytecode* args = script->ptrReadPos; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); EnemyTerritoryThing territory; EnemyTerritoryThing* territoryPtr = &territory; NpcAISettings* npcAISettings = (NpcAISettings*)get_variable(script, *args++); diff --git a/src/world/area_flo/flo_10/CB9280.c b/src/world/area_flo/flo_10/CB9280.c index fe59489f3e..5f383424c9 100644 --- a/src/world/area_flo/flo_10/CB9280.c +++ b/src/world/area_flo/flo_10/CB9280.c @@ -28,8 +28,7 @@ Script N(802414E0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -149,8 +148,7 @@ Script N(main) = SCRIPT({ == 2 { spawn N(802427EC); spawn N(80241988); - } - else { + } else { ModifyColliderFlags(0, 1, 0x7FFFFE00); SI_VAR(0) = N(80241988); spawn EnterWalk; @@ -594,8 +592,7 @@ Script N(8024339C) = SCRIPT({ func_802D5830(0); sleep 10; SpeakToPlayer(NPC_LILY, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, 0x0081)); - } - else { + } else { GetPlayerPos(SI_VAR(3), SI_VAR(4), SI_VAR(5)); PlayerMoveTo(-17, -17, 20); func_802CF56C(2); @@ -637,7 +634,7 @@ Script N(80243628) = SCRIPT({ SI_VAR(1) -= SI_VAR(6); SI_VAR(4) += SI_VAR(6); match SI_VAR(3) { - SI_VAR(1)..SI_VAR(4) { + SI_VAR(1)..SI_VAR(4) { spawn { if (SI_VAR(3) < SI_VAR(0)) { SI_VAR(0) -= 40; @@ -682,21 +679,25 @@ Script N(interact_802437C8) = SCRIPT({ PanToTarget(0, 0, 1); WaitForCam(0, 1.0); sleep 10; - SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11, 0x0079)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11, + 0x0079)); NpcFacePlayer(NPC_SELF, 1); SetNpcAnimation(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_1)); PlaySoundAtNpc(NPC_SELF, SOUND_UNKNOWN_262, 0); ShowEmote(-1, EMOTE_EXCLAMATION, 0, 15, 1, 0, 0, 0, 0); sleep 15; - SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_1), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x007A)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_1), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x007A)); EndSpeech(-1, NPC_ANIM(lily, Palette_00, Anim_5), NPC_ANIM(lily, Palette_00, Anim_1), 0); GetPlayerTargetYaw(SI_VAR(0)); InterpNpcYaw(NPC_SELF, SI_VAR(0), 1); sleep 20; - SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, 0x007B)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, + 0x007B)); NpcFacePlayer(NPC_SELF, 1); sleep 20; - SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x007C)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x007C)); ShowChoice(MESSAGE_ID(0x1E, 0x0011)); sleep 10; match SI_VAR(0) { @@ -711,7 +712,8 @@ Script N(interact_802437C8) = SCRIPT({ SI_SAVE_FLAG(1375) = 1; SetEnemyFlagBits(-1, 4194304, 0); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11, 0x007F)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_4), NPC_ANIM(lily, Palette_00, Anim_8), 5, MESSAGE_ID(0x11, + 0x007F)); } } < 49 { @@ -725,9 +727,9 @@ Script N(interact_802437C8) = SCRIPT({ } < 60 { SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_3), NPC_ANIM(lily, Palette_00, Anim_7), 0, MESSAGE_ID(0x11, 0x0086)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0087)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(lily, Palette_00, Anim_2), NPC_ANIM(lily, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x0087)); } } ResetCam(0, 4.0); diff --git a/src/world/area_flo/flo_10/CB96B0.c b/src/world/area_flo/flo_10/CB96B0.c index 83f5788a5a..daed381dfb 100644 --- a/src/world/area_flo/flo_10/CB96B0.c +++ b/src/world/area_flo/flo_10/CB96B0.c @@ -83,21 +83,23 @@ void N(func_802404B0_CB96B0)(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 255, phi_a2); gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(subroutine_arg6)); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); gDPLoadSync(gMasterGfxPos++); gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, phi_s6 * 4, phi_s5 * 4, (phi_s4 - 1) * 4, (phi_s5 - 1) * 4); gDPPipeSync(gMasterGfxPos++); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, phi_s4 - phi_s6, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, phi_s4 - phi_s6, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, phi_s6 * 4, phi_s5 * 4, (phi_s4 - 1) * 4, (phi_s5 - 1) * 4); gSPTextureRectangle(gMasterGfxPos++, - (phi_s4 - 1) * 4, (phi_s5 - 1) * 4, phi_s6 * 4, phi_s5 * 4, - G_TX_RENDERTILE, - phi_s6, phi_s5, - 0x0400, (sin_deg(N(D_80244070_CBD270) + (i * 30)) * 500.0f) - 0x1F4); + (phi_s4 - 1) * 4, (phi_s5 - 1) * 4, phi_s6 * 4, phi_s5 * 4, + G_TX_RENDERTILE, + phi_s6, phi_s5, + 0x0400, (sin_deg(N(D_80244070_CBD270) + (i * 30)) * 500.0f) - 0x1F4); } } @@ -113,14 +115,19 @@ void N(func_802404B0_CB96B0)(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { gDPSetPrimColor(gMasterGfxPos++, 0, 0, 255, 255, 255, phi_a2); gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(subroutine_arg6)); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_LOADTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); gDPLoadSync(gMasterGfxPos++); - gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, phi_s6 * 4, (temp_s2_2 - subroutine_arg5) * 4, (phi_s4 - 1) * 4, (temp_s2_2 - 1) * 4); + gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, phi_s6 * 4, (temp_s2_2 - subroutine_arg5) * 4, (phi_s4 - 1) * 4, + (temp_s2_2 - 1) * 4); gDPPipeSync(gMasterGfxPos++); - gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); - gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, (phi_s4 - 1) * 4, (temp_s2_2 - subroutine_arg5) * 4, phi_s6 * 4, (temp_s2_2 - subroutine_arg5) * 4); - gSPTextureRectangle(gMasterGfxPos++, phi_s6 * 4, arg1 + (i * 6), phi_s4 * 4, ((arg1 + (i * 6)) + subroutine_arg5) * 4, G_TX_RENDERTILE, phi_s6, temp_s2_2, 0x0400, -0x0400); + gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, (phi_s4 - phi_s6) / 6, G_TX_RENDERTILE, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 9, G_TX_NOLOD); + gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, (phi_s4 - 1) * 4, (temp_s2_2 - subroutine_arg5) * 4, phi_s6 * 4, + (temp_s2_2 - subroutine_arg5) * 4); + gSPTextureRectangle(gMasterGfxPos++, phi_s6 * 4, arg1 + (i * 6), phi_s4 * 4, ((arg1 + (i * 6)) + subroutine_arg5) * 4, + G_TX_RENDERTILE, phi_s6, temp_s2_2, 0x0400, -0x0400); } } } @@ -283,7 +290,8 @@ void N(func_80240A98_CB9C98)(void) { temp_f22 += camera->viewportStartY; gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE); - gDPSetRenderMode(gMasterGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); + gDPSetRenderMode(gMasterGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, + Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); gDPSetColorImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(nuGfxZBuffer)); gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, 0, 0, 0, 0, 0, 0, 0, PRIMITIVE, 0, 0, 0, 0); gDPSetPrimColor(gMasterGfxPos++, 0, 0, 248, 240, 240, 0); diff --git a/src/world/area_flo/flo_11/CBDCD0.c b/src/world/area_flo/flo_11/CBDCD0.c index 7513f18479..a19d706645 100644 --- a/src/world/area_flo/flo_11/CBDCD0.c +++ b/src/world/area_flo/flo_11/CBDCD0.c @@ -30,8 +30,7 @@ Script N(802403E0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -704,7 +703,7 @@ Script N(defeat_80242AC4) = SCRIPT({ GetBattleOutcome(SI_VAR(0)); match SI_VAR(0) { == 0 { - 0: +0: if (SI_MAP_VAR(0) == 0) { sleep 1; goto 0; @@ -755,10 +754,10 @@ StaticNpc N(npcGroup_80242CF4)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), @@ -792,10 +791,10 @@ StaticNpc N(npcGroup_80242CF4)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), diff --git a/src/world/area_flo/flo_12/CC0E70.c b/src/world/area_flo/flo_12/CC0E70.c index 9b01a28b2a..ddf611e5ad 100644 --- a/src/world/area_flo/flo_12/CC0E70.c +++ b/src/world/area_flo/flo_12/CC0E70.c @@ -30,8 +30,7 @@ Script N(80240750) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -301,16 +300,20 @@ Script N(interact_80241C8C) = SCRIPT({ == 0 { if (SI_SAVE_FLAG(1375) == 1) { spawn N(80241BE4); - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11, 0x0090)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11, + 0x0090)); SetPlayerAnimation(0x60005); - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0091)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, + 0x0091)); SetPlayerAnimation(ANIM_PRAY); sleep 40; SetPlayerAnimation(ANIM_10002); - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0092)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, + 0x0092)); SI_SAVE_FLAG(1379) = 1; } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11, 0x0090)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_4), 5, MESSAGE_ID(0x11, + 0x0090)); } } == 1 { @@ -335,9 +338,9 @@ Script N(interact_80241C8C) = SCRIPT({ match SI_VAR(0) { <= 0 { SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0093)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0095)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, + 0x0095)); RemoveItemEntity(SI_VAR(7)); MakeItemEntity(ITEM_CRYSTAL_BERRY, -33, 14, 19, 1, 1380); SI_VAR(0) = 87; @@ -345,7 +348,8 @@ Script N(interact_80241C8C) = SCRIPT({ await N(802417F0); AddKeyItem(ITEM_WATER_STONE); sleep 10; - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0096)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, + 0x0096)); SI_AREA_FLAG(22) = 1; STORY_PROGRESS = STORY_CH6_GOT_WATER_STONE; } @@ -363,9 +367,9 @@ Script N(interact_80241C8C) = SCRIPT({ } < 60 { SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0098)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, 0x0099)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_4), NPC_ANIM(rosie, Palette_00, Anim_2), 5, MESSAGE_ID(0x11, + 0x0099)); } } ResetCam(0, 4.0); @@ -393,8 +397,7 @@ Script N(init_802423D0) = SCRIPT({ SetNpcAnimation(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_2)); MakeItemEntity(ITEM_WATER_STONE, -33, 14, 19, 1, 1380); SI_VAR(10) = SI_VAR(0); - } - else { + } else { SetNpcFlagBits(NPC_ROSIE1, ((NPC_FLAG_100)), FALSE); SetNpcAnimation(NPC_SELF, NPC_ANIM(rosie, Palette_00, Anim_2)); MakeItemEntity(ITEM_CRYSTAL_BERRY, -33, 14, 19, 1, 1380); diff --git a/src/world/area_flo/flo_13/CC3850.c b/src/world/area_flo/flo_13/CC3850.c index 8535b56683..b95334f150 100644 --- a/src/world/area_flo/flo_13/CC3850.c +++ b/src/world/area_flo/flo_13/CC3850.c @@ -41,8 +41,7 @@ Script N(802436D0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -57,8 +56,7 @@ Script N(802436D0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_SUN_TOWER_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_SUN_TOWER_SUNNY, 0, 8); } } @@ -216,8 +214,8 @@ NpcSettings N(npcSettings_80244100) = { }; f32 N(D_8024412C_CC793C)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_80244144) = { @@ -301,21 +299,21 @@ NpcSettings N(npcSettings_8024437C) = { }; Vec3f N(vectorList_802443A8)[] = { - { -250.0, 130.0, 100.0 }, { -150.0, 90.0, 70.0 }, - { 50.0, 70.0, 10.0 }, { 200.0, 35.0, 30.0 }, - { 30.0, 10.0, 45.0 }, + { -250.0, 130.0, 100.0 }, { -150.0, 90.0, 70.0 }, + { 50.0, 70.0, 10.0 }, { 200.0, 35.0, 30.0 }, + { 30.0, 10.0, 45.0 }, }; Vec3f N(vectorList_802443E4)[] = { - { -285.0, 130.0, 45.0 }, { -185.0, 90.0, 25.0 }, - { 15.0, 70.0, 10.0 }, { 165.0, 35.0, 30.0 }, - { -5.0, 10.0, 45.0 }, + { -285.0, 130.0, 45.0 }, { -185.0, 90.0, 25.0 }, + { 15.0, 70.0, 10.0 }, { 165.0, 35.0, 30.0 }, + { -5.0, 10.0, 45.0 }, }; Vec3f N(vectorList_80244420)[] = { - { 10.0, 0.0, 45.0 }, { -90.0, 20.0, 45.0 }, - { -190.0, 60.0, 45.0 }, { -290.0, 140.0, 45.0 }, - { -390.0, 300.0, 45.0 }, + { 10.0, 0.0, 45.0 }, { -90.0, 20.0, 45.0 }, + { -190.0, 60.0, 45.0 }, { -290.0, 140.0, 45.0 }, + { -390.0, 300.0, 45.0 }, }; Script N(8024445C) = SCRIPT({ @@ -649,7 +647,8 @@ Script N(80245444) = SCRIPT({ sleep 10; goto 10; } else { - ContinueSpeech(1, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x00A9)); + ContinueSpeech(1, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, + 0x00A9)); SetNpcAnimation(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_1)); SetPlayerAnimation(ANIM_NOD_YES); sleep 10; @@ -662,7 +661,8 @@ Script N(80245444) = SCRIPT({ SetCamSpeed(0, 90.0); PanToTarget(0, 0, 1); WaitForCam(0, 1.0); - SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AA)); + SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, + Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AA)); SetNpcAnimation(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_1)); EndSpeech(0, NPC_ANIM(world_lakilester, Palette_00, Anim_9), NPC_ANIM(world_lakilester, Palette_00, Anim_1), 0); GetPlayerPos(SI_VAR(0), SI_VAR(1), SI_VAR(2)); @@ -673,7 +673,8 @@ Script N(80245444) = SCRIPT({ PanToTarget(0, 0, 1); WaitForCam(0, 1.0); sleep 10; - SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AB)); + SpeakToPlayer(NPC_WORLD_LAKILESTER, NPC_ANIM(world_lakilester, Palette_00, Anim_B), NPC_ANIM(world_lakilester, + Palette_00, Anim_3), 0, MESSAGE_ID(0x11, 0x00AB)); sleep 10; ShowChoice(MESSAGE_ID(0x1E, 0x0021)); match SI_VAR(0) { @@ -748,13 +749,16 @@ Script N(defeat_80246038) = SCRIPT({ Script N(interact_802461C0) = SCRIPT({ if (STORY_PROGRESS <= STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE) { - SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032)); + SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0032)); } else { GetCurrentPartnerID(SI_VAR(0)); if (SI_VAR(0) != 8) { - SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0034)); + SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0034)); } else { - SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0032)); + SpeakToPlayer(NPC_LAKILULU0, NPC_ANIM(lakilulu, Palette_00, Anim_4), NPC_ANIM(lakilulu, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0032)); } } }); @@ -1188,14 +1192,14 @@ void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -1207,7 +1211,7 @@ void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings, } #ifdef NON_MATCHING -void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 temp_f24; @@ -1321,9 +1325,9 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -1351,7 +1355,8 @@ void N(func_802404D0_CB54D0)(ScriptInstance *script, NpcAISettings *aiSettings, } } #else -INCLUDE_ASM(void, "world/area_flo/flo_13/CC3850", flo_13_func_80240374_CC3B84, ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory); +INCLUDE_ASM(void, "world/area_flo/flo_13/CC3850", flo_13_func_80240374_CC3B84, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -1450,7 +1455,7 @@ s32 N(func_802416BC_CC4ECC)(void) { return -1; } -void N(func_80241704_CC4F14)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241704_CC4F14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 x, y, z, w; @@ -1498,7 +1503,9 @@ void N(func_80241704_CC4F14)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[1].s--; } - if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ) != 0) { + if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, + enemy->territory->wander.point.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSizeX, + enemy->territory->wander.wanderSizeZ) != 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } @@ -1534,7 +1541,7 @@ void N(func_80241704_CC4F14)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241B68_CC5378)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241B68_CC5378)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 x, y, z, w; @@ -1579,7 +1586,7 @@ void N(func_80241B68_CC5378)(ScriptInstance *script, NpcAISettings *aiSettings, // enemy2 is being copied to a0 #ifdef NON_MATCHING -ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1636,7 +1643,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) { enemy2->varTable[10] = 1; enemy2->varTable[11] = enemy->npcID; npc->duration = 15; - npc->currentAnim = 0x490014; + npc->currentAnim.w = 0x490014; script->functionTemp[0].s = 30; } } @@ -1666,7 +1673,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) { case 31: npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = 0x490015; + npc->currentAnim.w = 0x490015; get_enemy(enemy->varTable[4])->varTable[10] = 3; npc->duration = 10; script->functionTemp[0].s = 32; @@ -1690,7 +1697,8 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) { if (((u32)script->functionTemp[0].s - 30) < 2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, npc->pos.x, npc->pos.z); - if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, territoryPtr->sizeX, territoryPtr->sizeZ)) { + if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, + territoryPtr->sizeX, territoryPtr->sizeZ)) { if ((dist > 30.0) && (npc->turnAroundYawAdjustment == 0)) { temp_f4 = dist - 20.0; if (temp_f4 < 0.0) { @@ -1708,23 +1716,25 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } #else -INCLUDE_ASM(ApiStatus, "world/area_flo/flo_13/CC3850", flo_13_func_80241DB8_CC55C8, ScriptInstance *script, s32 isInitialCall); +INCLUDE_ASM(ApiStatus, "world/area_flo/flo_13/CC3850", flo_13_func_80241DB8_CC55C8, ScriptInstance* script, + s32 isInitialCall); #endif #include "world/common/set_script_owner_npc_anim.inc.c" -void N(func_80242314_CC5B24)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242314_CC5B24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if ((npc->duration <= 0) || (--npc->duration <= 0)) { if (npc->turnAroundYawAdjustment == 0) { - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->moveSpeed = aiSettings->chaseSpeed; if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) { npc->collisionHeight = enemy->varTable[6] / 2; } - npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; + npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; if (npc->duration < enemy->varTable[3]) { npc->duration = enemy->varTable[3]; } @@ -1738,7 +1748,7 @@ void N(func_80242314_CC5B24)(ScriptInstance *script, NpcAISettings *aiSettings, #include "world/common/set_script_owner_npc_col_height.inc.c" -ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1767,7 +1777,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { script->functionTemp[0].s = 0; npc->duration = 0; enemy->unk_07 = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; npc->collisionHeight = enemy->varTable[6]; enemy->varTable[9] = 0; @@ -1790,8 +1800,8 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { if (enemy->varTable[9] > 0) { enemy->varTable[9]--; if (enemy->varTable[9] == 0) { - if ((npc->currentAnim + 0xFFAAFFD2) < 2) { - npc->currentAnim = 0x55000C; + if ((npc->currentAnim.w + 0xFFAAFFD2) < 2) { + npc->currentAnim.w = 0x55000C; } } else { return ApiStatus_BLOCK; @@ -1814,11 +1824,11 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { if (enemy->varTable[8] != 0) { enemy->varTable[8] = 0; enemy->unk_B5 = 0; - npc->currentAnim = 0x55002F; + npc->currentAnim.w = 0x55002F; } else { enemy->varTable[8] = 1; enemy->unk_B5 = 1; - npc->currentAnim = 0x55002E; + npc->currentAnim.w = 0x55002E; } enemy->varTable[9] = 7; return ApiStatus_BLOCK; @@ -1857,7 +1867,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { enemy->unk_B5 = 0; } if (enemy->varTable[8] != 0) { - switch (npc->currentAnim + 0xFFAAFFFC) { + switch (npc->currentAnim.w + 0xFFAAFFFC) { case 0: case 8: case 10: @@ -1865,7 +1875,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { case 14: case 18: case 20: - npc->currentAnim++; + npc->currentAnim.w++; break; } } @@ -1874,7 +1884,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1903,7 +1913,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->varTable[10] == 100)) { script->functionTemp[0].s = 100; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; enemy->flags |= 0x200000; npc->flags = (npc->flags & ~0x200) | 8; @@ -1919,14 +1929,14 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { npc->collisionHeight = enemy->varTable[6]; enemy->unk_B0 &= ~4; if (npc->flags & 0x800) { - npc->currentAnim = 0x4A0018; + npc->currentAnim.w = 0x4A0018; npc->moveSpeed = 0.0f; npc->jumpVelocity = 0.0f; npc->jumpScale = 1.0f; script->functionTemp[0].s = 102; } else { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = 0; script->functionTemp[0].s = 200; } @@ -1994,7 +2004,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { npc->flags &= ~2; npc->flags &= ~0x200; npc->renderYaw = 0.0f; - npc->currentAnim = 0x4A0018; + npc->currentAnim.w = 0x4A0018; script->functionTemp[0].s = 101; case 101: @@ -2014,7 +2024,8 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { x2 = npc->pos.x; y2 = npc->pos.y; z2 = npc->pos.z; - if (func_800DDC44(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionRadius) == 0) { + if (func_800DDC44(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight, + npc->collisionRadius) == 0) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); } else { npc->moveSpeed = 0.0f; @@ -2050,7 +2061,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags | 0x40000) & ~0x800; npc->jumpVelocity = 0.0f; npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - npc->currentAnim = 0x4A001A; + npc->currentAnim.w = 0x4A001A; npc->duration = 3; script->functionTemp[0].s = 103; break; @@ -2064,7 +2075,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { npc->duration--; if (npc->duration <= 0) { npc->flags &= 0xFFFBFFFF; - npc->currentAnim = 0x4A0001; + npc->currentAnim.w = 0x4A0001; script->functionTemp[0].s = 0; } break; @@ -2095,8 +2106,8 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance *script, s32 isInitialCall) { #include "world/common/UnkFunc42.inc.c" -ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(1); +ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_unsafe(1); s16 param1; s16 param2; @@ -2108,18 +2119,18 @@ ApiStatus N(func_802433C0_CC6BD0)(ScriptInstance *script, s32 isInitialCall) { if (script->functionTemp[0].s == (script->functionTemp[0].s / 5) * 5) { sfx_get_spatialized_sound_params(npc->pos.x, npc->pos.y, npc->pos.z, - ¶m1, ¶m2, 0x200002); + ¶m1, ¶m2, 0x200002); sfx_play_sound_with_params(0x295, param1, param2, - update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, script->functionTemp[1].s)); + update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, script->functionTemp[1].s)); } script->functionTemp[0].s++; return (script->functionTemp[1].s < script->functionTemp[0].s) * ApiStatus_DONE2; } -ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(0); +ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_unsafe(0); s16 param1; s16 param2; @@ -2129,10 +2140,10 @@ ApiStatus N(func_802434D4_CC6CE4)(ScriptInstance *script, s32 isInitialCall) { if (script->functionTemp[0].s == (script->functionTemp[0].s / 5) * 5) { sfx_get_spatialized_sound_params(npc->pos.x, npc->pos.y, npc->pos.z, - ¶m1, ¶m2, 0x200002); + ¶m1, ¶m2, 0x200002); sfx_play_sound_with_params(0x295, param1, param2, - update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, 0x50)); + update_lerp(0, 500.0f, 0.0f, script->functionTemp[0].s, 0x50)); } script->functionTemp[0].s++; diff --git a/src/world/area_flo/flo_13/CC6DE0.c b/src/world/area_flo/flo_13/CC6DE0.c index c45012f82d..4bc33c6f7b 100644 --- a/src/world/area_flo/flo_13/CC6DE0.c +++ b/src/world/area_flo/flo_13/CC6DE0.c @@ -13,7 +13,7 @@ static s8 N(D_80247B00)[0x200]; static s8 N(D_80247D00)[0x3D90]; static N(Unk_bss_struct) N(D_8024BA90); -ApiStatus N(func_802435D0_CC6DE0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802435D0_CC6DE0)(ScriptInstance* script, s32 isInitialCall) { s32 var; void* temp_s0 = load_asset_by_name("party_pokopi", &var); diff --git a/src/world/area_flo/flo_14/CCB310.c b/src/world/area_flo/flo_14/CCB310.c index 7a6377aa52..ddf521b8b5 100644 --- a/src/world/area_flo/flo_14/CCB310.c +++ b/src/world/area_flo/flo_14/CCB310.c @@ -18,8 +18,7 @@ Script N(802423F0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -267,13 +266,13 @@ Script N(802432E8) = SCRIPT({ }); Vec3f N(vectorList_80243384)[] = { - { 531.0, 75.0, 81.0 }, { 481.0, 80.0, 81.0 }, - { 431.0, 75.0, 81.0 }, { 381.0, 70.0, 81.0 }, - { 331.0, 75.0, 81.0 }, { 281.0, 80.0, 81.0 }, - { 231.0, 75.0, 81.0 }, { 181.0, 70.0, 81.0 }, - { 131.0, 75.0, 81.0 }, { 81.0, 80.0, 81.0 }, - { 31.0, 75.0, 81.0 }, { -19.0, 70.0, 81.0 }, - { -69.0, 75.0, 81.0 }, + { 531.0, 75.0, 81.0 }, { 481.0, 80.0, 81.0 }, + { 431.0, 75.0, 81.0 }, { 381.0, 70.0, 81.0 }, + { 331.0, 75.0, 81.0 }, { 281.0, 80.0, 81.0 }, + { 231.0, 75.0, 81.0 }, { 181.0, 70.0, 81.0 }, + { 131.0, 75.0, 81.0 }, { 81.0, 80.0, 81.0 }, + { 31.0, 75.0, 81.0 }, { -19.0, 70.0, 81.0 }, + { -69.0, 75.0, 81.0 }, }; Script N(80243420) = SCRIPT({ @@ -557,14 +556,14 @@ Script N(80243E78) = SCRIPT({ void func_80072950(); -ApiStatus N(func_8024030C_CCB61C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024030C_CCB61C)(ScriptInstance* script, s32 isInitialCall) { func_80072950(0, 0, 0, 0, 0, 0); return ApiStatus_DONE2; } #include "world/common/UnkFunc43.inc.c" -ApiStatus N(func_802403D4_CCB6E4)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802403D4_CCB6E4)(ScriptInstance* script, s32 isInitialCall) { if (gPlayerData.currentPartner == PARTNER_NONE) { script->varTable[14] = 0; return ApiStatus_DONE2; @@ -575,14 +574,14 @@ ApiStatus N(func_802403D4_CCB6E4)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_8024042C_CCB73C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024042C_CCB73C)(ScriptInstance* script, s32 isInitialCall) { Npc* npc = get_npc_unsafe(-4); npc->flags = get_variable(NULL, SI_MAP_VAR(0)); return ApiStatus_DONE2; } -ApiStatus N(func_8024046C_CCB77C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_8024046C_CCB77C)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; script->functionTemp[0].s = get_variable(script, *args++); @@ -595,8 +594,8 @@ ApiStatus N(func_8024046C_CCB77C)(ScriptInstance *script, s32 isInitialCall) { // graphics macros #ifdef NON_MATCHING s32 func_8011C2EC(s32); -void func_8011C2B0(s32, s32*,s32*, s32*); -void guMtxF2L(Matrix4f, Mtx *m); +void func_8011C2B0(s32, s32*, s32*, s32*); +void guMtxF2L(Matrix4f, Mtx* m); void guMtxIdentF(Matrix4f); void N(func_80240504_CCB814)(void) { diff --git a/src/world/area_flo/flo_14/CCBE20.c b/src/world/area_flo/flo_14/CCBE20.c index ff27a28d12..0e2bdfaa76 100644 --- a/src/world/area_flo/flo_14/CCBE20.c +++ b/src/world/area_flo/flo_14/CCBE20.c @@ -10,8 +10,8 @@ enum { static s32 N(D_802453B0_EF79C0)[91]; f32 N(D_802444C0_CCF7D0)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_802444D8) = { @@ -137,7 +137,7 @@ Script N(interact_80244790) = SCRIPT({ sleep 40; InterpPlayerYaw(315, 0); } - 10: +10: if (SI_AREA_FLAG(37) == 0) { sleep 1; goto 10; @@ -281,7 +281,7 @@ Script N(80244F70) = SCRIPT({ ModifyColliderFlags(1, SI_VAR(9), 0x7FFFFE00); } } - 50: +50: if (SI_VAR(7) >= 90) { SI_VAR(8) = -1; SI_VAR(7) = 90; @@ -315,14 +315,14 @@ void N(func_80240B10_CCBE20)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -449,9 +449,9 @@ void N(func_80240CC0_CCBFD0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -479,7 +479,8 @@ void N(func_80240CC0_CCBFD0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_flo/flo_14/CCBE20", flo_14_func_80240CC0_CCBFD0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_flo/flo_14/CCBE20", flo_14_func_80240CC0_CCBFD0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" diff --git a/src/world/area_flo/flo_14/CCD670.c b/src/world/area_flo/flo_14/CCD670.c index a8d0b4e84c..1f587ee384 100644 --- a/src/world/area_flo/flo_14/CCD670.c +++ b/src/world/area_flo/flo_14/CCD670.c @@ -1,6 +1,6 @@ #include "flo_14.h" -ApiStatus N(func_80242360_CCD670)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242360_CCD670)(ScriptInstance* script, s32 isInitialCall) { CollisionStatus* collisionStatus = &gCollisionStatus; set_variable(script, *script->ptrReadPos, collisionStatus->floorBelow); diff --git a/src/world/area_flo/flo_15/CD06C0.c b/src/world/area_flo/flo_15/CD06C0.c index ea476cb698..398a955d61 100644 --- a/src/world/area_flo/flo_15/CD06C0.c +++ b/src/world/area_flo/flo_15/CD06C0.c @@ -28,8 +28,7 @@ Script N(80240060) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_SUN_TOWER_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_SUN_TOWER_SUNNY, 0, 8); } } @@ -220,14 +219,16 @@ Script N(interact_80240B28) = SCRIPT({ } < STORY_CH6_STAR_SPIRIT_RESCUED { if (SI_SAVE_FLAG(1410) == 0) { - SpeakToPlayer(NPC_SUN0, NPC_ANIM(sun, Palette_00, Anim_7), NPC_ANIM(sun, Palette_00, Anim_1), 517, MESSAGE_ID(0x11, 0x009D)); + SpeakToPlayer(NPC_SUN0, NPC_ANIM(sun, Palette_00, Anim_7), NPC_ANIM(sun, Palette_00, Anim_1), 517, MESSAGE_ID(0x11, + 0x009D)); SI_SAVE_FLAG(1410) = 1; } else { - SpeakToPlayer(NPC_SUN0, NPC_ANIM(sun, Palette_00, Anim_7), NPC_ANIM(sun, Palette_00, Anim_1), 517, MESSAGE_ID(0x11, 0x009E)); + SpeakToPlayer(NPC_SUN0, NPC_ANIM(sun, Palette_00, Anim_7), NPC_ANIM(sun, Palette_00, Anim_1), 517, MESSAGE_ID(0x11, + 0x009E)); } - } - else { - SpeakToPlayer(NPC_SUN0, NPC_ANIM(sun, Palette_00, Anim_7), NPC_ANIM(sun, Palette_00, Anim_1), 517, MESSAGE_ID(0x11, 0x009F)); + } else { + SpeakToPlayer(NPC_SUN0, NPC_ANIM(sun, Palette_00, Anim_7), NPC_ANIM(sun, Palette_00, Anim_1), 517, MESSAGE_ID(0x11, + 0x009F)); } } SI_AREA_FLAG(38) = 1; diff --git a/src/world/area_flo/flo_16/CD1F10.c b/src/world/area_flo/flo_16/CD1F10.c index 50652997b9..823e8556d0 100644 --- a/src/world/area_flo/flo_16/CD1F10.c +++ b/src/world/area_flo/flo_16/CD1F10.c @@ -22,8 +22,7 @@ Script N(802429D0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -69,7 +68,7 @@ Script N(main) = SCRIPT({ spawn { SI_VAR(0) = 0; SI_VAR(1) = 0; - 0: +0: SI_VAR(0) += 140; if (SI_VAR(0) > 65536) { SI_VAR(0) += -65536; @@ -444,7 +443,7 @@ typedef struct { s16 unk_32C; } N(UnkStruct); -ApiStatus N(func_802402AC_CD20DC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802402AC_CD20DC)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; N(UnkStruct)* ptr; s32 i; @@ -516,7 +515,8 @@ ApiStatus N(func_802402AC_CD20DC)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } #else -INCLUDE_ASM(ApiStatus, "world/area_flo/flo_16/CD1F10", flo_16_func_802402AC_CD20DC, ScriptInstance *script, s32 isInitialCall); +INCLUDE_ASM(ApiStatus, "world/area_flo/flo_16/CD1F10", flo_16_func_802402AC_CD20DC, ScriptInstance* script, + s32 isInitialCall); #endif ApiStatus N(func_802404FC_CD232C)(ScriptInstance* script, s32 isInitialCall) { @@ -549,8 +549,8 @@ typedef struct { s32 unk_64; } N(UserData); -ApiStatus N(func_802406E0_CD2510)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus N(func_802406E0_CD2510)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_safe(-4); f32 sinTheta, cosTheta; s32 i; @@ -568,7 +568,8 @@ ApiStatus N(func_802406E0_CD2510)(ScriptInstance *script, s32 isInitialCall) { scriptPtr->unk_5C = get_entity_by_index(get_variable(script, *args)); for (i = 0, userDataPtr = scriptPtr; i < 3; i++) { - userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, scriptPtr->unk_5C->position.z, 1.0f, -1); + userDataPtr->unk_08[i] = func_800716F0(0, scriptPtr->unk_5C->position.x, scriptPtr->unk_5C->position.y + 12.5f, + scriptPtr->unk_5C->position.z, 1.0f, -1); save = 0.0f; userDataPtr->unk_2C[i] = save; userDataPtr->unk_20[i] = save; diff --git a/src/world/area_flo/flo_16/CD2C80.c b/src/world/area_flo/flo_16/CD2C80.c index 2b3a97e059..7f0c24f5e3 100644 --- a/src/world/area_flo/flo_16/CD2C80.c +++ b/src/world/area_flo/flo_16/CD2C80.c @@ -7,8 +7,8 @@ enum { }; f32 N(D_80244010_CD5E40)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_80244028) = { @@ -347,14 +347,14 @@ void N(func_80240E50_CD2C80)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -476,9 +476,9 @@ void N(func_80241000_CD2E30)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -506,7 +506,8 @@ void N(func_80241000_CD2E30)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_flo/flo_16/CD2C80", flo_16_func_80241000_CD2E30, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_flo/flo_16/CD2C80", flo_16_func_80241000_CD2E30, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -595,7 +596,7 @@ ApiStatus N(func_8024215C_CD3F8C)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/UnkNpcAIFunc13.inc.c" -void N(func_80242478_CD42A8)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80242478_CD42A8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 x, y, z, w; @@ -605,7 +606,7 @@ void N(func_80242478_CD42A8)(ScriptInstance *script, NpcAISettings *aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) == 0) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = 30; script->functionTemp[0].s = 20; enemy->varTable[9] = 30; @@ -642,7 +643,7 @@ void N(func_80242478_CD42A8)(ScriptInstance *script, NpcAISettings *aiSettings, #include "world/common/UnkFunc45.inc.c" -ApiStatus N(func_80242754_CD4584)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242754_CD4584)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/area_flo/flo_16/CD4770.c b/src/world/area_flo/flo_16/CD4770.c index 23df9422f7..ef5df3b25a 100644 --- a/src/world/area_flo/flo_16/CD4770.c +++ b/src/world/area_flo/flo_16/CD4770.c @@ -1,8 +1,8 @@ #include "flo_16.h" -ApiStatus N(func_80242940_CD4770)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242940_CD4770)(ScriptInstance* script, s32 isInitialCall) { script->varTable[0] = 0; - do {} while(0); + do {} while (0); if ((gPlayerActionState == ACTION_STATE_GROUND_POUND) || (gPlayerActionState == ACTION_STATE_ULTRA_POUND)) { script->varTable[0] = 1; } diff --git a/src/world/area_flo/flo_17/CD7320.c b/src/world/area_flo/flo_17/CD7320.c index 361646c00a..34d6e48f32 100644 --- a/src/world/area_flo/flo_17/CD7320.c +++ b/src/world/area_flo/flo_17/CD7320.c @@ -1,6 +1,6 @@ #include "flo_17.h" -ApiStatus N(func_80240040_CD7320)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240040_CD7320)(ScriptInstance* script, s32 isInitialCall) { CollisionStatus* collisionStatus = &gCollisionStatus; set_variable(script, *script->ptrReadPos, collisionStatus->floorBelow); diff --git a/src/world/area_flo/flo_17/CD7350.c b/src/world/area_flo/flo_17/CD7350.c index 222317bbc2..08e414b560 100644 --- a/src/world/area_flo/flo_17/CD7350.c +++ b/src/world/area_flo/flo_17/CD7350.c @@ -29,8 +29,7 @@ Script N(80243280) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -191,7 +190,7 @@ Script N(main) = SCRIPT({ spawn { SI_VAR(0) = 0; SI_VAR(1) = 0; - 0: +0: SI_VAR(0) += 140; if (SI_VAR(0) > 65536) { SI_VAR(0) += -65536; @@ -256,7 +255,7 @@ Script N(80243FD0) = SCRIPT({ ModifyColliderFlags(1, SI_VAR(9), 0x7FFFFE00); } } - 50: +50: if (SI_VAR(7) >= 90) { SI_VAR(8) = -1; SI_VAR(7) = 90; @@ -300,8 +299,8 @@ NpcSettings N(npcSettings_802443D8) = { }; f32 N(D_8024440C_CDB6EC)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_80244424) = { @@ -616,14 +615,14 @@ void N(func_80240070_CD7350)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -745,9 +744,9 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -775,7 +774,8 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_flo/flo_17/CD7350", flo_17_func_80240220_CD7500, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_flo/flo_17/CD7350", flo_17_func_80240220_CD7500, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -874,7 +874,7 @@ s32 N(func_80241568_CD8848)(void) { return -1; } -void N(func_802415B0_CD8890)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802415B0_CD8890)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 x, y, z, w; @@ -922,7 +922,9 @@ void N(func_802415B0_CD8890)(ScriptInstance *script, NpcAISettings *aiSettings, script->functionTemp[1].s--; } - if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ) != 0) { + if (is_point_within_region(enemy->territory->wander.wanderShape, enemy->territory->wander.point.x, + enemy->territory->wander.point.z, npc->pos.x, npc->pos.z, enemy->territory->wander.wanderSizeX, + enemy->territory->wander.wanderSizeZ) != 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } @@ -958,7 +960,7 @@ void N(func_802415B0_CD8890)(ScriptInstance *script, NpcAISettings *aiSettings, } } -void N(func_80241A14_CD8CF4)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241A14_CD8CF4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 x, y, z, w; @@ -1003,7 +1005,7 @@ void N(func_80241A14_CD8CF4)(ScriptInstance *script, NpcAISettings *aiSettings, // enemy2 is being copied to a0 #ifdef NON_MATCHING -ApiStatus N(func_80241C64_CD8F44)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Bytecode* args = script->ptrReadPos; Npc* npc = get_npc_unsafe(enemy->npcID); @@ -1060,7 +1062,7 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance *script, s32 isInitialCall) { enemy2->varTable[10] = 1; enemy2->varTable[11] = enemy->npcID; npc->duration = 15; - npc->currentAnim = 0x490014; + npc->currentAnim.w = 0x490014; script->functionTemp[0].s = 30; } } @@ -1090,7 +1092,7 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance *script, s32 isInitialCall) { case 31: npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = 0x490015; + npc->currentAnim.w = 0x490015; get_enemy(enemy->varTable[4])->varTable[10] = 3; npc->duration = 10; script->functionTemp[0].s = 32; @@ -1114,7 +1116,8 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance *script, s32 isInitialCall) { if (((u32)script->functionTemp[0].s - 30) < 2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, npc->pos.x, npc->pos.z); - if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, territoryPtr->sizeX, territoryPtr->sizeZ)) { + if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, + territoryPtr->sizeX, territoryPtr->sizeZ)) { if ((dist > 30.0) && (npc->turnAroundYawAdjustment == 0)) { temp_f4 = dist - 20.0; if (temp_f4 < 0.0) { @@ -1132,23 +1135,25 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } #else -INCLUDE_ASM(ApiStatus, "world/area_flo/flo_17/CD7350", flo_17_func_80241C64_CD8F44, ScriptInstance *script, s32 isInitialCall); +INCLUDE_ASM(ApiStatus, "world/area_flo/flo_17/CD7350", flo_17_func_80241C64_CD8F44, ScriptInstance* script, + s32 isInitialCall); #endif #include "world/common/set_script_owner_npc_anim.inc.c" -void N(func_802421C0_CD94A0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_802421C0_CD94A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if ((npc->duration <= 0) || (--npc->duration <= 0)) { if (npc->turnAroundYawAdjustment == 0) { - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->moveSpeed = aiSettings->chaseSpeed; if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) { npc->collisionHeight = enemy->varTable[6] / 2; } - npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; + npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; if (npc->duration < enemy->varTable[3]) { npc->duration = enemy->varTable[3]; } @@ -1162,7 +1167,7 @@ void N(func_802421C0_CD94A0)(ScriptInstance *script, NpcAISettings *aiSettings, #include "world/common/set_script_owner_npc_col_height.inc.c" -ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802424D8_CD97B8)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1191,7 +1196,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { script->functionTemp[0].s = 0; npc->duration = 0; enemy->unk_07 = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; npc->collisionHeight = enemy->varTable[6]; enemy->varTable[9] = 0; @@ -1214,8 +1219,8 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { if (enemy->varTable[9] > 0) { enemy->varTable[9]--; if (enemy->varTable[9] == 0) { - if ((npc->currentAnim + 0xFFAAFFD2) < 2) { - npc->currentAnim = 0x55000C; + if ((npc->currentAnim.w + 0xFFAAFFD2) < 2) { + npc->currentAnim.w = 0x55000C; } } else { return ApiStatus_BLOCK; @@ -1238,11 +1243,11 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { if (enemy->varTable[8] != 0) { enemy->varTable[8] = 0; enemy->unk_B5 = 0; - npc->currentAnim = 0x55002F; + npc->currentAnim.w = 0x55002F; } else { enemy->varTable[8] = 1; enemy->unk_B5 = 1; - npc->currentAnim = 0x55002E; + npc->currentAnim.w = 0x55002E; } enemy->varTable[9] = 7; return ApiStatus_BLOCK; @@ -1281,7 +1286,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { enemy->unk_B5 = 0; } if (enemy->varTable[8] != 0) { - switch (npc->currentAnim + 0xFFAAFFFC) { + switch (npc->currentAnim.w + 0xFFAAFFFC) { case 0: case 8: case 10: @@ -1289,7 +1294,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { case 14: case 18: case 20: - npc->currentAnim++; + npc->currentAnim.w++; break; } } @@ -1298,7 +1303,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -1327,7 +1332,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { if (isInitialCall || (enemy->varTable[10] == 100)) { script->functionTemp[0].s = 100; npc->duration = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; enemy->flags |= 0x200000; npc->flags = (npc->flags & ~0x200) | 8; @@ -1343,14 +1348,14 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { npc->collisionHeight = enemy->varTable[6]; enemy->unk_B0 &= ~4; if (npc->flags & 0x800) { - npc->currentAnim = 0x4A0018; + npc->currentAnim.w = 0x4A0018; npc->moveSpeed = 0.0f; npc->jumpVelocity = 0.0f; npc->jumpScale = 1.0f; script->functionTemp[0].s = 102; } else { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = 0; script->functionTemp[0].s = 200; } @@ -1418,7 +1423,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { npc->flags &= ~2; npc->flags &= ~0x200; npc->renderYaw = 0.0f; - npc->currentAnim = 0x4A0018; + npc->currentAnim.w = 0x4A0018; script->functionTemp[0].s = 101; case 101: @@ -1438,7 +1443,8 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { x2 = npc->pos.x; y2 = npc->pos.y; z2 = npc->pos.z; - if (func_800DDC44(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionRadius) == 0) { + if (func_800DDC44(npc->unk_80, &x2, &y2, &z2, npc->moveSpeed, npc->yaw, npc->collisionHeight, + npc->collisionRadius) == 0) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); } else { npc->moveSpeed = 0.0f; @@ -1474,7 +1480,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { npc->flags = (npc->flags | 0x40000) & ~0x800; npc->jumpVelocity = 0.0f; npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - npc->currentAnim = 0x4A001A; + npc->currentAnim.w = 0x4A001A; npc->duration = 3; script->functionTemp[0].s = 103; break; @@ -1488,7 +1494,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance *script, s32 isInitialCall) { npc->duration--; if (npc->duration <= 0) { npc->flags &= 0xFFFBFFFF; - npc->currentAnim = 0x4A0001; + npc->currentAnim.w = 0x4A0001; script->functionTemp[0].s = 0; } break; diff --git a/src/world/area_flo/flo_18/CDC6A0.c b/src/world/area_flo/flo_18/CDC6A0.c index 0aa4f58edb..fbeddb9814 100644 --- a/src/world/area_flo/flo_18/CDC6A0.c +++ b/src/world/area_flo/flo_18/CDC6A0.c @@ -31,8 +31,7 @@ Script N(80240830) = SCRIPT({ < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_PUFF_PUFF_MACHINE, 0, 8); PlaySoundAtCollider(20, 0x80000025, 0); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -890,7 +889,7 @@ Script N(802436BC) = SCRIPT({ EnableTexPanning(41, 1); spawn { SI_VAR(14) = 1.0; - 0: +0: if (SI_SAVE_VAR(253) >= 3) { SI_VAR(14) *= 0.953125; } @@ -951,27 +950,27 @@ NpcSettings N(npcSettings_80243F3C) = { }; Vec3f N(vectorList_80243F68)[] = { - { -55.0, 15.0, 35.0 }, { -155.0, 35.0, 35.0 }, - { -255.0, 75.0, 35.0 }, { -355.0, 155.0, 35.0 }, - { -455.0, 315.0, 35.0 }, + { -55.0, 15.0, 35.0 }, { -155.0, 35.0, 35.0 }, + { -255.0, 75.0, 35.0 }, { -355.0, 155.0, 35.0 }, + { -455.0, 315.0, 35.0 }, }; Vec3f N(vectorList_80243FA4)[] = { - { -20.0, 15.0, 30.0 }, { -120.0, 35.0, 30.0 }, - { -220.0, 75.0, 30.0 }, { -320.0, 155.0, 30.0 }, - { -420.0, 315.0, 30.0 }, + { -20.0, 15.0, 30.0 }, { -120.0, 35.0, 30.0 }, + { -220.0, 75.0, 30.0 }, { -320.0, 155.0, 30.0 }, + { -420.0, 315.0, 30.0 }, }; Vec3f N(vectorList_80243FE0)[] = { - { 65.0, 15.0, 30.0 }, { -35.0, 35.0, 30.0 }, - { -135.0, 75.0, 30.0 }, { -235.0, 155.0, 30.0 }, - { -335.0, 315.0, 30.0 }, + { 65.0, 15.0, 30.0 }, { -35.0, 35.0, 30.0 }, + { -135.0, 75.0, 30.0 }, { -235.0, 155.0, 30.0 }, + { -335.0, 315.0, 30.0 }, }; Vec3f N(vectorList_8024401C)[] = { - { 120.0, 15.0, 30.0 }, { 20.0, 35.0, 30.0 }, - { -80.0, 75.0, 30.0 }, { -180.0, 155.0, 30.0 }, - { -280.0, 315.0, 30.0 }, + { 120.0, 15.0, 30.0 }, { 20.0, 35.0, 30.0 }, + { -80.0, 75.0, 30.0 }, { -180.0, 155.0, 30.0 }, + { -280.0, 315.0, 30.0 }, }; Script N(80244058) = SCRIPT({ @@ -1388,18 +1387,22 @@ Script N(interact_802457D4) = SCRIPT({ == 0 { GetSelfNpcID(SI_VAR(0)); if (SI_VAR(0) == 3) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 5, MESSAGE_ID(0x11, 0x00B6)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 5, + MESSAGE_ID(0x11, 0x00B6)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, 0x00BC)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, + 0x00BC)); } SI_AREA_VAR(6) += 1; } == 1 { GetSelfNpcID(SI_VAR(0)); if (SI_VAR(0) == 3) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 5, MESSAGE_ID(0x11, 0x00B7)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 5, + MESSAGE_ID(0x11, 0x00B7)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, 0x00BD)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, + 0x00BD)); } SI_AREA_VAR(6) += 1; } @@ -1407,12 +1410,14 @@ Script N(interact_802457D4) = SCRIPT({ AdjustCam(0, 8.0, 0, 300, 19.0, -9.0); GetSelfNpcID(SI_VAR(0)); if (SI_VAR(0) == 3) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 5, MESSAGE_ID(0x11, 0x00B8)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 5, + MESSAGE_ID(0x11, 0x00B8)); NpcFacePlayer(NPC_SELF, 0); sleep 15; EndSpeech(-1, NPC_ANIM(magikoopa, Palette_02, Anim_2), NPC_ANIM(magikoopa, Palette_02, Anim_1), 0); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, 0x00BE)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 5, MESSAGE_ID(0x11, + 0x00BE)); NpcFacePlayer(NPC_SELF, 0); sleep 15; EndSpeech(-1, NPC_ANIM(lakitu, Palette_00, Anim_16), NPC_ANIM(lakitu, Palette_00, Anim_1), 0); @@ -1484,10 +1489,10 @@ StaticNpc N(npcGroup_80245CEC)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), @@ -1522,10 +1527,10 @@ StaticNpc N(npcGroup_80245CEC)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), @@ -1560,10 +1565,10 @@ StaticNpc N(npcGroup_80245CEC)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), @@ -1598,10 +1603,10 @@ StaticNpc N(npcGroup_80245CEC)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), @@ -1636,10 +1641,10 @@ StaticNpc N(npcGroup_80245CEC)[] = { .dropFlags = 0x80, .itemDropChance = 25, .itemDrops = { - { ITEM_SUPER_SHROOM, 2, 0 }, - { ITEM_MAPLE_SYRUP, 2, 0 }, - { ITEM_THUNDER_RAGE, 2, 0 }, - { ITEM_STOP_WATCH, 2, 0 }, + { ITEM_SUPER_SHROOM, 2, 0 }, + { ITEM_MAPLE_SYRUP, 2, 0 }, + { ITEM_THUNDER_RAGE, 2, 0 }, + { ITEM_STOP_WATCH, 2, 0 }, }, .heartDrops = STANDARD_HEART_DROPS(2), .flowerDrops = STANDARD_FLOWER_DROPS(3), @@ -1702,7 +1707,7 @@ typedef struct N(temp) { N(unk_effect)* unk_0C; } N(temp); -ApiStatus N(func_80240340_CDC9E0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240340_CDC9E0)(ScriptInstance* script, s32 isInitialCall) { N(temp)* ptr = script->varTable[15]; ptr->unk_0C->unk_30 = 69; diff --git a/src/world/area_flo/flo_19/CE36F0.c b/src/world/area_flo/flo_19/CE36F0.c index 687eacd187..189b3d0de8 100644 --- a/src/world/area_flo/flo_19/CE36F0.c +++ b/src/world/area_flo/flo_19/CE36F0.c @@ -287,7 +287,7 @@ Script N(80241780) = SCRIPT({ bind N(80241734) to TRIGGER_FLOOR_TOUCH 10; spawn { SI_VAR(15) = 0; - 0: +0: N(func_80240340_CE3A30)(SI_VAR(15), SI_VAR(0), 0.96875, 1.03125, 15, 0, 0); N(func_80240340_CE3A30)(SI_VAR(15), SI_VAR(1), 1.03125, 0.96875, 15, 0, 0); ScaleModel(70, SI_VAR(1), SI_VAR(0), 1); @@ -440,7 +440,7 @@ Script N(80241CC4) = SCRIPT({ SI_VAR(3) = (float) SI_VAR(0); N(func_80240540_CE3C30)(); N(func_80240660_CE3D50)(); - 11: +11: sleep 1; if (SI_AREA_FLAG(45) == 1) { goto 11; @@ -543,14 +543,14 @@ Script N(802423F8) = SCRIPT({ if (SI_VAR(15) == 300) { SI_MAP_VAR(10) = 1; } - 11: +11: sleep 1; if (SI_AREA_FLAG(45) == 1) { goto 11; } } } - 10: +10: if (SI_MAP_VAR(10) == 0) { sleep 1; goto 10; @@ -674,7 +674,7 @@ ApiStatus N(func_80240340_CE3A30)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802404D0_CE3BC0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802404D0_CE3BC0)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 var1 = *args++; s32 var2 = *args++; @@ -685,7 +685,7 @@ ApiStatus N(func_802404D0_CE3BC0)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240540_CE3C30)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240540_CE3C30)(ScriptInstance* script, s32 isInitialCall) { f32 temp_f20 = get_variable(NULL, script->varTable[2]); f32 dist = dist2D(0.0f, 0.0f, script->varTable[9], script->varTable[11]); f32 temp_f22 = clamp_angle(atan2(0.0f, 0.0f, script->varTable[9], script->varTable[11]) - temp_f20); @@ -699,8 +699,8 @@ ApiStatus N(func_80240540_CE3C30)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240660_CE3D50)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_by_index(0); +ApiStatus N(func_80240660_CE3D50)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_by_index(0); f32 temp_f20 = get_variable(NULL, script->varTable[2]); f32 dist = dist2D(0.0f, 0.0f, script->varTable[12], script->varTable[14]); f32 clamped = clamp_angle(atan2(0.0f, 0.0f, script->varTable[12], script->varTable[14]) - temp_f20); @@ -714,7 +714,7 @@ ApiStatus N(func_80240660_CE3D50)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240784_CE3E74)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240784_CE3E74)(ScriptInstance* script, s32 isInitialCall) { set_transition_stencil_zoom_1(1, script->varTable[0]); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_21/CE6700.c b/src/world/area_flo/flo_21/CE6700.c index 367968b325..18df450919 100644 --- a/src/world/area_flo/flo_21/CE6700.c +++ b/src/world/area_flo/flo_21/CE6700.c @@ -135,7 +135,7 @@ ApiStatus N(func_8024004C_CE674C)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_802401AC_CE68AC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_802401AC_CE68AC)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; N(Unk_effect_struct)* ptr = (N(Unk_effect_struct)*)script->varTable[0]; @@ -213,7 +213,7 @@ ApiStatus N(func_802401AC_CE68AC)(ScriptInstance *script, s32 isInitialCall) { ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); if (!(dist3D(playerStatus->position.x, playerStatus->position.y + 20.0f, playerStatus->position.z, - ptr->unk_00, ptr->unk_04, ptr->unk_08) > 30.0f)) { + ptr->unk_00, ptr->unk_04, ptr->unk_08) > 30.0f)) { ptr->unk_4E = 3; } break; @@ -305,8 +305,7 @@ Script N(80240E3C) = SCRIPT({ } == STORY_CH6_DEFEATED_HUFF_N_PUFF { SI_VAR(0) = 1; - } - else { + } else { return; } } @@ -439,7 +438,7 @@ Script N(802415E0) = SCRIPT({ Script N(80241600) = SCRIPT({ spawn { SI_VAR(15) = 0; - 0: +0: N(UnkFloatFunc)(SI_VAR(15), SI_VAR(0), 0.96875, 1.03125, 15, 0, 0); N(UnkFloatFunc)(SI_VAR(15), SI_VAR(1), 1.03125, 0.96875, 15, 0, 0); ScaleModel(88, SI_VAR(1), SI_VAR(0), 1); @@ -496,8 +495,8 @@ NpcSettings N(npcSettings_80241870) = { }; Vec3f N(vectorList_8024189C)[] = { - { 600.0, 104.0, 0.0 }, { 575.0, 204.0, 0.0 }, - { 550.0, 104.0, 0.0 }, + { 600.0, 104.0, 0.0 }, { 575.0, 204.0, 0.0 }, + { 550.0, 104.0, 0.0 }, }; Script N(802418C0) = SCRIPT({ @@ -532,7 +531,7 @@ Script N(80241920) = SCRIPT({ spawn { SetPlayerAnimation(ANIM_80017); LoadPath(30, N(vectorList_8024189C), 3, 0); - 0: +0: GetNextPathPos(); SetPlayerPos(SI_VAR(1), SI_VAR(2), SI_VAR(3)); sleep 1; @@ -656,8 +655,7 @@ Script N(80242290) = SCRIPT({ == 1 { SI_VAR(3) = 5; SI_VAR(2) = 1; - } - else { + } else { return; } } diff --git a/src/world/area_flo/flo_22/CEC240.c b/src/world/area_flo/flo_22/CEC240.c index db68e93ad4..739b63916c 100644 --- a/src/world/area_flo/flo_22/CEC240.c +++ b/src/world/area_flo/flo_22/CEC240.c @@ -24,8 +24,7 @@ Script N(802402E0) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -325,8 +324,7 @@ Script N(80241028) = SCRIPT({ } else { ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x00DE), 35, 35, 0); } - } - else { + } else { await N(80240E84); RemoveItemAt(SI_VAR(1)); ShowMessageAtWorldPos(MESSAGE_ID(0x11, 0x00DC), 35, 35, 0); diff --git a/src/world/area_flo/flo_23/CEE260.c b/src/world/area_flo/flo_23/CEE260.c index c1d1f0b955..8f315dcd35 100644 --- a/src/world/area_flo/flo_23/CEE260.c +++ b/src/world/area_flo/flo_23/CEE260.c @@ -2,7 +2,7 @@ void func_80072950(); -ApiStatus N(func_80240000_CEE260)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_CEE260)(ScriptInstance* script, s32 isInitialCall) { func_80072950(0, 0, 0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_23/CEE2A0.c b/src/world/area_flo/flo_23/CEE2A0.c index 12de3929b6..ad08204ce7 100644 --- a/src/world/area_flo/flo_23/CEE2A0.c +++ b/src/world/area_flo/flo_23/CEE2A0.c @@ -31,8 +31,7 @@ Script N(80240D30) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -201,7 +200,8 @@ Script N(interact_80241564) = SCRIPT({ SetCamSpeed(0, 4.0); PanToTarget(0, 0, 1); WaitForCam(0, 1.0); - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_2), NPC_ANIM(gate_flower, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x0049)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_2), NPC_ANIM(gate_flower, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x0049)); SetPlayerAnimation(ANIM_THINKING); N(func_80240C9C_CEEEFC)(); SI_VAR(0) = N(D_80242850); @@ -211,8 +211,7 @@ Script N(interact_80241564) = SCRIPT({ <= 0 { SetPlayerAnimation(ANIM_STAND_STILL); SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_2), NPC_ANIM(gate_flower, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x004A)); - } - else { + } else { SI_VAR(8) = SI_VAR(0); N(func_80240C2C_CEEE8C)(SI_VAR(0)); MakeItemEntity(SI_VAR(8), 385, 20, -34, 1, 0); @@ -257,9 +256,9 @@ Script N(interact_80241564) = SCRIPT({ == 160 { SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_4), NPC_ANIM(gate_flower, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x004C)); SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_1)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_4), NPC_ANIM(gate_flower, Palette_00, Anim_1), 0, MESSAGE_ID(0x11, 0x004B)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_4), NPC_ANIM(gate_flower, Palette_00, Anim_1), 0, + MESSAGE_ID(0x11, 0x004B)); SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_6)); PlaySoundAtNpc(NPC_SELF, 0x2096, 0); MakeItemEntity(SI_VAR(8), 375, 20, 0, 1, 0); @@ -319,9 +318,11 @@ Script N(interact_80241564) = SCRIPT({ sleep 10; } else { if (STORY_PROGRESS < STORY_CH6_STAR_SPIRIT_RESCUED) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_9), NPC_ANIM(gate_flower, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, 0x004E)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_9), NPC_ANIM(gate_flower, Palette_00, Anim_8), 0, + MESSAGE_ID(0x11, 0x004E)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_9), NPC_ANIM(gate_flower, Palette_00, Anim_8), 0, MESSAGE_ID(0x11, 0x004F)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_00, Anim_9), NPC_ANIM(gate_flower, Palette_00, Anim_8), 0, + MESSAGE_ID(0x11, 0x004F)); } } DisablePlayerInput(FALSE); @@ -504,18 +505,19 @@ ApiStatus N(func_802402F8_CEE558)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/set_script_owner_npc_anim.inc.c" -void N(func_80240410_CEE670)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80240410_CEE670)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); if ((npc->duration <= 0) || (--npc->duration <= 0)) { if (npc->turnAroundYawAdjustment == 0) { - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; npc->moveSpeed = aiSettings->chaseSpeed; if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) { npc->collisionHeight = enemy->varTable[6] / 2; } - npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; + npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, + gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; if (npc->duration < enemy->varTable[3]) { npc->duration = enemy->varTable[3]; } @@ -529,7 +531,7 @@ void N(func_80240410_CEE670)(ScriptInstance *script, NpcAISettings *aiSettings, #include "world/common/set_script_owner_npc_col_height.inc.c" -ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240728_CEE988)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); Bytecode* args = script->ptrReadPos; @@ -558,7 +560,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { script->functionTemp[0].s = 0; npc->duration = 0; enemy->unk_07 = 0; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->flags &= ~0x800; npc->collisionHeight = enemy->varTable[6]; enemy->varTable[9] = 0; @@ -581,8 +583,8 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { if (enemy->varTable[9] > 0) { enemy->varTable[9]--; if (enemy->varTable[9] == 0) { - if ((npc->currentAnim + 0xFFAAFFD2) < 2) { - npc->currentAnim = 0x55000C; + if ((npc->currentAnim.w + 0xFFAAFFD2) < 2) { + npc->currentAnim.w = 0x55000C; } } else { return ApiStatus_BLOCK; @@ -605,11 +607,11 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { if (enemy->varTable[8] != 0) { enemy->varTable[8] = 0; enemy->unk_B5 = 0; - npc->currentAnim = 0x55002F; + npc->currentAnim.w = 0x55002F; } else { enemy->varTable[8] = 1; enemy->unk_B5 = 1; - npc->currentAnim = 0x55002E; + npc->currentAnim.w = 0x55002E; } enemy->varTable[9] = 7; return ApiStatus_BLOCK; @@ -648,7 +650,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { enemy->unk_B5 = 0; } if (enemy->varTable[8] != 0) { - switch (npc->currentAnim + 0xFFAAFFFC) { + switch (npc->currentAnim.w + 0xFFAAFFFC) { case 0: case 8: case 10: @@ -656,7 +658,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { case 14: case 18: case 20: - npc->currentAnim++; + npc->currentAnim.w++; break; } } @@ -665,7 +667,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_BLOCK; } -ApiStatus N(func_80240B68_CEEDC8)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240B68_CEEDC8)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 itemIdx = get_variable(script, *args++); s32 var1 = get_variable(script, *args++); @@ -680,7 +682,7 @@ ApiStatus N(func_80240B68_CEEDC8)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240C2C_CEEE8C)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240C2C_CEEE8C)(ScriptInstance* script, s32 isInitialCall) { s32 itemId = get_variable(script, *script->ptrReadPos); StaticItem* item = &gItemTable[itemId]; @@ -695,7 +697,7 @@ ApiStatus N(func_80240C2C_CEEE8C)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80240C9C_CEEEFC)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240C9C_CEEEFC)(ScriptInstance* script, s32 isInitialCall) { s32 i; for (i = 0; i <= 90; i++) { diff --git a/src/world/area_flo/flo_25/CF2BD0.c b/src/world/area_flo/flo_25/CF2BD0.c index 5f2034a912..546a68a947 100644 --- a/src/world/area_flo/flo_25/CF2BD0.c +++ b/src/world/area_flo/flo_25/CF2BD0.c @@ -2,7 +2,7 @@ void func_80072950(); -ApiStatus N(func_80240000_CF2BD0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240000_CF2BD0)(ScriptInstance* script, s32 isInitialCall) { func_80072950(0, 0, 0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_25/CF2C10.c b/src/world/area_flo/flo_25/CF2C10.c index 558ff4aeb4..6ba00f24a2 100644 --- a/src/world/area_flo/flo_25/CF2C10.c +++ b/src/world/area_flo/flo_25/CF2C10.c @@ -32,8 +32,7 @@ Script N(80242330) = SCRIPT({ match STORY_PROGRESS { < STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE { SetMusicTrack(0, SONG_FLOWER_FIELDS_CLOUDY, 0, 8); - } - else { + } else { SetMusicTrack(0, SONG_FLOWER_FIELDS_SUNNY, 0, 8); } } @@ -121,8 +120,8 @@ NpcSettings N(npcSettings_802428F0) = { }; f32 N(D_8024291C_CF54EC)[] = { - 4.5f, 3.5f, 2.6f, 2.0f, - 1.5f, 20.0f, + 4.5f, 3.5f, 2.6f, 2.0f, + 1.5f, 20.0f, }; NpcAISettings N(npcAISettings_80242934) = { @@ -237,7 +236,8 @@ Script N(interact_80242C58) = SCRIPT({ SetCamSpeed(0, 4.0); PanToTarget(0, 0, 1); WaitForCam(0, 1.0); - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_2), NPC_ANIM(gate_flower, Palette_01, Anim_1), 0, MESSAGE_ID(0x11, 0x003B)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_2), NPC_ANIM(gate_flower, Palette_01, Anim_1), 0, + MESSAGE_ID(0x11, 0x003B)); SetPlayerAnimation(ANIM_THINKING); N(func_80241FB4_CF4B84)(); SI_VAR(0) = 0x80245110; @@ -247,8 +247,7 @@ Script N(interact_80242C58) = SCRIPT({ <= 0 { SetPlayerAnimation(ANIM_STAND_STILL); SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_2), NPC_ANIM(gate_flower, Palette_01, Anim_1), 0, MESSAGE_ID(0x11, 0x003C)); - } - else { + } else { SI_VAR(8) = SI_VAR(0); N(func_80241F44_CF4B14)(SI_VAR(0)); MakeItemEntity(SI_VAR(8), 505, 20, -24, 1, 0); @@ -293,9 +292,9 @@ Script N(interact_80242C58) = SCRIPT({ == 158 { SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_4), NPC_ANIM(gate_flower, Palette_01, Anim_1), 0, MESSAGE_ID(0x11, 0x003E)); SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_1)); - } - else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_4), NPC_ANIM(gate_flower, Palette_01, Anim_1), 0, MESSAGE_ID(0x11, 0x003D)); + } else { + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_4), NPC_ANIM(gate_flower, Palette_01, Anim_1), 0, + MESSAGE_ID(0x11, 0x003D)); SetNpcAnimation(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_6)); PlaySoundAtNpc(NPC_SELF, 0x2096, 0); MakeItemEntity(SI_VAR(8), -125, 20, 0, 1, 0); @@ -355,9 +354,11 @@ Script N(interact_80242C58) = SCRIPT({ sleep 10; } else { if (STORY_PROGRESS < STORY_CH6_STAR_SPIRIT_RESCUED) { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_9), NPC_ANIM(gate_flower, Palette_01, Anim_8), 0, MESSAGE_ID(0x11, 0x0040)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_9), NPC_ANIM(gate_flower, Palette_01, Anim_8), 0, + MESSAGE_ID(0x11, 0x0040)); } else { - SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_9), NPC_ANIM(gate_flower, Palette_01, Anim_8), 0, MESSAGE_ID(0x11, 0x0041)); + SpeakToPlayer(NPC_SELF, NPC_ANIM(gate_flower, Palette_01, Anim_9), NPC_ANIM(gate_flower, Palette_01, Anim_8), 0, + MESSAGE_ID(0x11, 0x0041)); } } DisablePlayerInput(FALSE); @@ -509,14 +510,14 @@ void N(func_80240040_CF2C10)(ScriptInstance* script, NpcAISettings* aiSettings, npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1); if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -638,9 +639,9 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, } if (is_point_within_region(enemy->territory->wander.wanderShape, - enemy->territory->wander.point.x, enemy->territory->wander.point.z, - npc->pos.x, npc->pos.z, - enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { + enemy->territory->wander.point.x, enemy->territory->wander.point.z, + npc->pos.x, npc->pos.z, + enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) { posW = dist2D(enemy->territory->wander.point.x, enemy->territory->wander.point.z, npc->pos.x, npc->pos.z); if (npc->moveSpeed < posW) { npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z); @@ -668,7 +669,8 @@ void N(func_80241040_BE47F0)(ScriptInstance* script, NpcAISettings* aiSettings, } } #else -INCLUDE_ASM(void, "world/area_flo/flo_25/CF2C10", flo_25_func_802401F0_CF2DC0, ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory); +INCLUDE_ASM(void, "world/area_flo/flo_25/CF2C10", flo_25_func_802401F0_CF2DC0, ScriptInstance* script, + NpcAISettings* aiSettings, EnemyTerritoryThing* territory); #endif #include "world/common/UnkNpcAIFunc1.inc.c" @@ -757,7 +759,7 @@ ApiStatus N(func_8024134C_CF3F1C)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/UnkNpcAIFunc13.inc.c" -void N(func_80241668_CF4238)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(func_80241668_CF4238)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); f32 x, y, z, w; @@ -767,7 +769,7 @@ void N(func_80241668_CF4238)(ScriptInstance *script, NpcAISettings *aiSettings, if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1) == 0) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = 30; script->functionTemp[0].s = 20; enemy->varTable[9] = 30; @@ -911,7 +913,7 @@ ApiStatus N(func_80241DE4_CF49B4)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241E80_CF4A50)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241E80_CF4A50)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 itemIdx = get_variable(script, *args++); s32 var1 = get_variable(script, *args++); @@ -926,7 +928,7 @@ ApiStatus N(func_80241E80_CF4A50)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241F44_CF4B14)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241F44_CF4B14)(ScriptInstance* script, s32 isInitialCall) { s32 itemId = get_variable(script, *script->ptrReadPos); StaticItem* item = &gItemTable[itemId]; @@ -941,7 +943,7 @@ ApiStatus N(func_80241F44_CF4B14)(ScriptInstance *script, s32 isInitialCall) { return ApiStatus_DONE2; } -ApiStatus N(func_80241FB4_CF4B84)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80241FB4_CF4B84)(ScriptInstance* script, s32 isInitialCall) { s32 i; for (i = 0; i <= 90; i++) { diff --git a/src/world/area_kmr/kmr_03/8C8140.c b/src/world/area_kmr/kmr_03/8C8140.c index 83c3b66a63..6420930ecc 100644 --- a/src/world/area_kmr/kmr_03/8C8140.c +++ b/src/world/area_kmr/kmr_03/8C8140.c @@ -61,7 +61,7 @@ NpcSettings N(npcSettings_80240950) = { Script N(8024097C) = SCRIPT({ 1: if (SI_AREA_FLAG(8) == 1) { - 100: +100: AwaitPlayerLeave(294, 123, 170); EnableNpcAI(0, 0); DisablePlayerInput(TRUE); @@ -91,7 +91,7 @@ Script N(npcAI_80240B50) = SCRIPT({ 1: match STORY_PROGRESS { == STORY_CH0_FELL_OFF_CLIFF { - 89: +89: N(UnkPositionFunc)(-118, 86, -70, -15); sleep 1; if (SI_VAR(0) == 0) { @@ -280,4 +280,4 @@ Script N(makeEntities) = SCRIPT({ MakeEntity(0x802EAB04, 300, 0, 150, 0, ITEM_PULSE_STONE, MAKE_ENTITY_END); AssignPanelFlag(SI_SAVE_FLAG(88)); MakeEntity(0x802EA7E0, 130, 60, 0, 0, MAKE_ENTITY_END); -}); \ No newline at end of file +}); diff --git a/src/world/area_kmr/kmr_12/events.c b/src/world/area_kmr/kmr_12/events.c index 2933709e4f..e617b2a8c3 100644 --- a/src/world/area_kmr/kmr_12/events.c +++ b/src/world/area_kmr/kmr_12/events.c @@ -128,7 +128,7 @@ Script N(GoombaIdle) = SCRIPT({ InterpNpcYaw(NPC_SELF, 90, 0); SetNpcFlagBits(NPC_SELF, 0x240000, FALSE); SetSelfEnemyFlagBits(NPC_FLAG_NO_AI, FALSE); - SetSelfEnemyFlagBits(NPC_FLAG_40000000, TRUE); + SetSelfEnemyFlagBits(NPC_FLAG_NO_ANIMS_LOADED, TRUE); // We're done jumping off; the player can read the sign again bind N(ReadWestSign) to TRIGGER_WALL_PRESS_A 10; diff --git a/src/world/area_kpa/kpa_12/A54CA0.c b/src/world/area_kpa/kpa_12/A54CA0.c index 30a6560147..1b350197b3 100644 --- a/src/world/area_kpa/kpa_12/A54CA0.c +++ b/src/world/area_kpa/kpa_12/A54CA0.c @@ -1,6 +1,6 @@ #include "kpa_12.h" -ApiStatus N(func_80240350_A54CA0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240350_A54CA0)(ScriptInstance* script, s32 isInitialCall) { CollisionStatus* collisionStatus = &gCollisionStatus; set_variable(script, *script->ptrReadPos, collisionStatus->floorBelow); diff --git a/src/world/area_kpa/kpa_13/A56270.c b/src/world/area_kpa/kpa_13/A56270.c index c63b97b232..2c8a79fb82 100644 --- a/src/world/area_kpa/kpa_13/A56270.c +++ b/src/world/area_kpa/kpa_13/A56270.c @@ -1,6 +1,6 @@ #include "kpa_13.h" -ApiStatus N(func_80240350_A56270)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240350_A56270)(ScriptInstance* script, s32 isInitialCall) { CollisionStatus* collisionStatus = &gCollisionStatus; set_variable(script, *script->ptrReadPos, collisionStatus->floorBelow); diff --git a/src/world/area_kpa/kpa_14/A57830.c b/src/world/area_kpa/kpa_14/A57830.c index 5129f4b900..dd304a9a58 100644 --- a/src/world/area_kpa/kpa_14/A57830.c +++ b/src/world/area_kpa/kpa_14/A57830.c @@ -31,7 +31,7 @@ ApiStatus N(func_80240380_A57830)(ScriptInstance* script, s32 isInitialCall) { #include "world/common/GetEntityPosition.inc.c" -ApiStatus N(func_80240710_A57BC0)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(func_80240710_A57BC0)(ScriptInstance* script, s32 isInitialCall) { CollisionStatus* collisionStatus = &gCollisionStatus; set_variable(script, *script->ptrReadPos, collisionStatus->floorBelow); diff --git a/src/world/common/CamSetFOV.inc.c b/src/world/common/CamSetFOV.inc.c index 1d2cc6aa2a..7b82c39b5b 100644 --- a/src/world/common/CamSetFOV.inc.c +++ b/src/world/common/CamSetFOV.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(CamSetFOV)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(CamSetFOV)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 camIdx = get_variable(script, *args++); diff --git a/src/world/common/DeadUnkNpcAIFunc14.inc.c b/src/world/common/DeadUnkNpcAIFunc14.inc.c index 88c42a027f..90f3c3a71f 100644 --- a/src/world/common/DeadUnkNpcAIFunc14.inc.c +++ b/src/world/common/DeadUnkNpcAIFunc14.inc.c @@ -9,7 +9,7 @@ void N(DeadUnkNpcAIFunc14)(ScriptInstance* script, NpcAISettings* aiSettings) { f32 vt6 = enemy->varTable[6]; f32 jumpScale = vt6 / 100.0; - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->jumpVelocity = jumpVelocity; npc->jumpScale = jumpScale; npc->moveSpeed = aiSettings->chaseSpeed; diff --git a/src/world/common/DoesPlayerNeedSleep.inc.c b/src/world/common/DoesPlayerNeedSleep.inc.c index bf586a27df..d1c4365b24 100644 --- a/src/world/common/DoesPlayerNeedSleep.inc.c +++ b/src/world/common/DoesPlayerNeedSleep.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(DoesPlayerNeedSleep)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(DoesPlayerNeedSleep)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; script->varTable[1] = FALSE; diff --git a/src/world/common/GetFloorCollider.inc.c b/src/world/common/GetFloorCollider.inc.c index d44e8dbfa4..b5832b4049 100644 --- a/src/world/common/GetFloorCollider.inc.c +++ b/src/world/common/GetFloorCollider.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(GetFloorCollider)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(GetFloorCollider)(ScriptInstance* script, s32 isInitialCall) { CollisionStatus* collisionStatus = &gCollisionStatus; set_variable(script, *script->ptrReadPos, collisionStatus->currentFloor); diff --git a/src/world/common/NpcJumpFunc2.inc.c b/src/world/common/NpcJumpFunc2.inc.c index ffd9ef85d5..cee9cd2fbb 100644 --- a/src/world/common/NpcJumpFunc2.inc.c +++ b/src/world/common/NpcJumpFunc2.inc.c @@ -5,7 +5,7 @@ void N(NpcJumpFunc2)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTer Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->currentAnim = enemy->animList[4]; + npc->currentAnim.w = enemy->animList[4]; npc->jumpVelocity = 10.0f; npc->jumpScale = 2.0f; npc->moveToPos.y = npc->pos.y; diff --git a/src/world/common/UnkFunc10.inc.c b/src/world/common/UnkFunc10.inc.c index b3a7fe7c2e..2a4a49b419 100644 --- a/src/world/common/UnkFunc10.inc.c +++ b/src/world/common/UnkFunc10.inc.c @@ -3,7 +3,7 @@ void N(UnkFunc10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); f32 posX, posY, posZ; s32 phi_s1; @@ -12,9 +12,9 @@ void N(UnkFunc10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit phi_s1 = 0; if (is_point_within_region(enemy->territory->wander.detectShape, - enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, - npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, - enemy->territory->wander.detectSizeZ)) { + enemy->territory->wander.detect.x, enemy->territory->wander.detect.z, + npc->pos.x, npc->pos.z, enemy->territory->wander.detectSizeX, + enemy->territory->wander.detectSizeZ)) { phi_s1 = 1; } @@ -23,7 +23,7 @@ void N(UnkFunc10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit posZ = npc->pos.z; if (func_800DDC44(npc->unk_80, &posX, &posY, &posZ, - 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { + 1.0f, npc->yaw, npc->collisionHeight, npc->collisionRadius)) { phi_s1 = 1; } diff --git a/src/world/common/UnkFunc11.inc.c b/src/world/common/UnkFunc11.inc.c index 0df2114e5a..e8a151e033 100644 --- a/src/world/common/UnkFunc11.inc.c +++ b/src/world/common/UnkFunc11.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc11)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc11)(ScriptInstance* script, s32 isInitialCall) { s32 var = get_variable(script, *script->ptrReadPos); PlayerStatus* playerStatus = &gPlayerStatus; CollisionStatus* collisionStatus = &gCollisionStatus; diff --git a/src/world/common/UnkFunc12.inc.c b/src/world/common/UnkFunc12.inc.c index 2d589ad086..e15e6772c1 100644 --- a/src/world/common/UnkFunc12.inc.c +++ b/src/world/common/UnkFunc12.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc12)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc12)(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; f32 posX, posY, posZ, posW; diff --git a/src/world/common/UnkFunc15.inc.c b/src/world/common/UnkFunc15.inc.c index 2209389c33..103732d810 100644 --- a/src/world/common/UnkFunc15.inc.c +++ b/src/world/common/UnkFunc15.inc.c @@ -8,7 +8,7 @@ ApiStatus N(UnkFunc15)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; script->functionTemp[0].s = 14; } else { diff --git a/src/world/common/UnkFunc15_copy.inc.c b/src/world/common/UnkFunc15_copy.inc.c index 286d8c55b5..79e5e9a595 100644 --- a/src/world/common/UnkFunc15_copy.inc.c +++ b/src/world/common/UnkFunc15_copy.inc.c @@ -8,7 +8,7 @@ ApiStatus N(UnkFunc15_copy)(ScriptInstance* script, NpcAISettings* aiSettings, E if (!func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; script->functionTemp[0].s = 14; } else { diff --git a/src/world/common/UnkFunc16.inc.c b/src/world/common/UnkFunc16.inc.c index 3db5cbb967..5cde3379e3 100644 --- a/src/world/common/UnkFunc16.inc.c +++ b/src/world/common/UnkFunc16.inc.c @@ -14,7 +14,7 @@ void N(UnkFunc16)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrit } npc->moveSpeed = aiSettings->moveSpeed; - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; script->functionTemp[0].s = 1; } diff --git a/src/world/common/UnkFunc16_copy.inc.c b/src/world/common/UnkFunc16_copy.inc.c index e408a081c8..55e227e9b8 100644 --- a/src/world/common/UnkFunc16_copy.inc.c +++ b/src/world/common/UnkFunc16_copy.inc.c @@ -14,7 +14,7 @@ void N(UnkFunc16_copy)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT } npc->moveSpeed = aiSettings->moveSpeed; - npc->currentAnim = enemy->animList[1]; + npc->currentAnim.w = enemy->animList[1]; script->functionTemp[1].s = 0; script->functionTemp[0].s = 1; } diff --git a/src/world/common/UnkFunc17.inc.c b/src/world/common/UnkFunc17.inc.c index c31b63223a..7ff83e5735 100644 --- a/src/world/common/UnkFunc17.inc.c +++ b/src/world/common/UnkFunc17.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc17)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc17)(ScriptInstance* script, s32 isInitialCall) { gOverrideFlags &= ~0x40; return ApiStatus_DONE2; } diff --git a/src/world/common/UnkFunc18.inc.c b/src/world/common/UnkFunc18.inc.c index 4cef324297..a4af5633d5 100644 --- a/src/world/common/UnkFunc18.inc.c +++ b/src/world/common/UnkFunc18.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc18)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc18)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; Bytecode* args = script->ptrReadPos; s32 partnerIdx = get_variable(script, *args++); @@ -25,7 +25,7 @@ s32 N(UnkFunc37)(s32 idx, s16 arg1) { return -1; } -ApiStatus N(UnkFunc38)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc38)(ScriptInstance* script, s32 isInitialCall) { PlayerData* playerData = &gPlayerData; s32 i; s16 var = script->varTable[12] >= 0; diff --git a/src/world/common/UnkFunc19.inc.c b/src/world/common/UnkFunc19.inc.c index 2a45a27d6c..aeb060495b 100644 --- a/src/world/common/UnkFunc19.inc.c +++ b/src/world/common/UnkFunc19.inc.c @@ -3,7 +3,7 @@ extern s32 D_8008EF20[11][4]; -ApiStatus N(UnkFunc19)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc19)(ScriptInstance* script, s32 isInitialCall) { set_message_string(D_8008EF20[gPlayerData.currentPartner][0], 0); return ApiStatus_DONE2; diff --git a/src/world/common/UnkFunc20.inc.c b/src/world/common/UnkFunc20.inc.c index 74072f5d8c..e5cc2554bb 100644 --- a/src/world/common/UnkFunc20.inc.c +++ b/src/world/common/UnkFunc20.inc.c @@ -1,14 +1,15 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc20)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus N(UnkFunc20)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; s32 entityIdx = get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIdx); s32 si_var = *args++; - Effect* effect = func_80071750(0, entity->position.x, entity->position.y + 12.5f, entity->position.z, 0.7f, 0); + EffectInstance* effectInst = func_80071750(0, entity->position.x, entity->position.y + 12.5f, entity->position.z, 0.7f, + 0); - set_variable(script, si_var, (s32) effect); + set_variable(script, si_var, (s32) effectInst); return ApiStatus_DONE2; } diff --git a/src/world/common/UnkFunc21.inc.c b/src/world/common/UnkFunc21.inc.c index 9bce23dce5..3f9946d1db 100644 --- a/src/world/common/UnkFunc21.inc.c +++ b/src/world/common/UnkFunc21.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc21)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc21)(ScriptInstance* script, s32 isInitialCall) { Entity* entity = get_entity_by_index(get_variable(script, *script->ptrReadPos)); func_80070BB0(4, entity->position.x, entity->position.y + 12.5f, entity->position.z, 1.0f, 0x4B); diff --git a/src/world/common/UnkFunc22.inc.c b/src/world/common/UnkFunc22.inc.c index 6e169ed7a1..4d43ddd2b4 100644 --- a/src/world/common/UnkFunc22.inc.c +++ b/src/world/common/UnkFunc22.inc.c @@ -1,8 +1,8 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc22)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_safe(-4); +ApiStatus N(UnkFunc22)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_safe(-4); func_80070BB0(9, npc->pos.x, npc->pos.y + 12.5f, npc->pos.z, 1.0f, 0x1E); diff --git a/src/world/common/UnkFunc23.inc.c b/src/world/common/UnkFunc23.inc.c index 7f23603fc8..d008338692 100644 --- a/src/world/common/UnkFunc23.inc.c +++ b/src/world/common/UnkFunc23.inc.c @@ -1,8 +1,8 @@ #include "common.h" #include "map.h" -s32 N(UnkFunc23)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +s32 N(UnkFunc23)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; s32 ret = 0; if (isInitialCall) { diff --git a/src/world/common/UnkFunc24.inc.c b/src/world/common/UnkFunc24.inc.c index adbdeb2737..99d6450dd7 100644 --- a/src/world/common/UnkFunc24.inc.c +++ b/src/world/common/UnkFunc24.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc24)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc24)(ScriptInstance* script, s32 isInitialCall) { script->varTable[0] = 0; if ((D_8010EBB0.unk_00 != 0) && (D_8010EBB0.unk_03 == 3)) { script->varTable[0] = 1; diff --git a/src/world/common/UnkFunc26.inc.c b/src/world/common/UnkFunc26.inc.c index 9fd9cc02d7..e60eff76ed 100644 --- a/src/world/common/UnkFunc26.inc.c +++ b/src/world/common/UnkFunc26.inc.c @@ -4,8 +4,8 @@ void func_8011BEB4(u8 var2, u8 var3, u8 var4, u8 var5, u8 var6, u8 var7, u8 var8, s32 var9, s32 var10); void func_8011BF98(u8 var2, u8 var3, u8 var4, u8 var5, u8 var6, u8 var7); -ApiStatus N(UnkFunc26)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus N(UnkFunc26)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; s32 var1 = get_variable(script, *args++); s32 var2 = get_variable(script, *args++); s32 var3 = get_variable(script, *args++); diff --git a/src/world/common/UnkFunc27.inc.c b/src/world/common/UnkFunc27.inc.c index 2c90739757..ac71c76d9d 100644 --- a/src/world/common/UnkFunc27.inc.c +++ b/src/world/common/UnkFunc27.inc.c @@ -3,8 +3,8 @@ void func_8011B950(u16, s32, s32, s32); -ApiStatus N(UnkFunc27)(ScriptInstance *script, s32 isInitialCall) { - Bytecode *args = script->ptrReadPos; +ApiStatus N(UnkFunc27)(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; s32 testS2 = get_variable(script, *args++); s32 testS0 = get_variable(script, *args++); s32 testS1 = get_variable(script, *args++); diff --git a/src/world/common/UnkFunc31.inc.c b/src/world/common/UnkFunc31.inc.c index 098bb1f704..ed055ddc3a 100644 --- a/src/world/common/UnkFunc31.inc.c +++ b/src/world/common/UnkFunc31.inc.c @@ -3,8 +3,8 @@ s32 N(UnkFunc28)(Npc* npc); -ApiStatus N(UnkFunc31)(ScriptInstance *script, s32 isInitialCall) { - Npc *npc = get_npc_unsafe(script->owner2.npcID); +ApiStatus N(UnkFunc31)(ScriptInstance* script, s32 isInitialCall) { + Npc* npc = get_npc_unsafe(script->owner2.npcID); npc->onRender = N(UnkFunc28); npc->blurBuf = heap_malloc(8); @@ -62,7 +62,7 @@ ApiStatus N(UnkAlphaFunc)(ScriptInstance* script, s32 isInitialCall) { return (script->functionTemp[0].s == 255) * ApiStatus_DONE2; } -ApiStatus N(UnkFunc29)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc29)(ScriptInstance* script, s32 isInitialCall) { s32 i; if (isInitialCall) { diff --git a/src/world/common/UnkFunc32.inc.c b/src/world/common/UnkFunc32.inc.c index cbbd5e1d72..4a13c11734 100644 --- a/src/world/common/UnkFunc32.inc.c +++ b/src/world/common/UnkFunc32.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc32)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc32)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 var1 = get_variable(script, *args++); s32 var2 = get_variable(script, *args++); diff --git a/src/world/common/UnkFunc35.inc.c b/src/world/common/UnkFunc35.inc.c index 84caa8798d..7da92f6a91 100644 --- a/src/world/common/UnkFunc35.inc.c +++ b/src/world/common/UnkFunc35.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc35)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc35)(ScriptInstance* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 var1 = get_variable(script, *args++); s32 var2 = get_variable(script, *args++); diff --git a/src/world/common/UnkFunc36.inc.c b/src/world/common/UnkFunc36.inc.c index c296cee27d..69ffde37f3 100644 --- a/src/world/common/UnkFunc36.inc.c +++ b/src/world/common/UnkFunc36.inc.c @@ -1,6 +1,6 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc36)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc36)(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } diff --git a/src/world/common/UnkFunc39.inc.c b/src/world/common/UnkFunc39.inc.c index 85047c419f..5446b490c5 100644 --- a/src/world/common/UnkFunc39.inc.c +++ b/src/world/common/UnkFunc39.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc39)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc39)(ScriptInstance* script, s32 isInitialCall) { Effect* effect = get_variable(script, *script->ptrReadPos); effect->flags |= 0x10; diff --git a/src/world/common/UnkFunc4.inc.c b/src/world/common/UnkFunc4.inc.c index 1e2ae1f8fd..0f2d8917ce 100644 --- a/src/world/common/UnkFunc4.inc.c +++ b/src/world/common/UnkFunc4.inc.c @@ -38,7 +38,8 @@ void N(UnkFunc4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito } if (enemy->varTable[9] <= 0) { - if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { + if ((gPlayerStatusPtr->position.y < ((npc->pos.y + npc->collisionHeight) + 10.0)) + && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 1)) { fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; func_800494C0(npc, 0x2F4, 0x200000); diff --git a/src/world/common/UnkFunc40.inc.c b/src/world/common/UnkFunc40.inc.c index c000c1b3a1..df11b725e1 100644 --- a/src/world/common/UnkFunc40.inc.c +++ b/src/world/common/UnkFunc40.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc40)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc40)(ScriptInstance* script, s32 isInitialCall) { script->varTable[0] = 0; if ((D_8010EBB0.unk_00 != 0) && (D_8010EBB0.unk_03 == 3)) { script->varTable[0] = 1; diff --git a/src/world/common/UnkFunc42.inc.c b/src/world/common/UnkFunc42.inc.c index 44db5698e0..f726491ff3 100644 --- a/src/world/common/UnkFunc42.inc.c +++ b/src/world/common/UnkFunc42.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc42)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc42)(ScriptInstance* script, s32 isInitialCall) { script->varTable[10] = atan2(script->varTable[0], script->varTable[2], script->varTable[3], script->varTable[5]); return ApiStatus_DONE2; } diff --git a/src/world/common/UnkFunc43.inc.c b/src/world/common/UnkFunc43.inc.c index 49f2869cc5..7ac850a1d6 100644 --- a/src/world/common/UnkFunc43.inc.c +++ b/src/world/common/UnkFunc43.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc43)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc43)(ScriptInstance* script, s32 isInitialCall) { f32 var1 = script->varTable[0] - script->varTable[3]; f32 var2 = script->varTable[1] - script->varTable[4]; f32 var3 = script->varTable[2] - script->varTable[5]; diff --git a/src/world/common/UnkFunc44.inc.c b/src/world/common/UnkFunc44.inc.c index 35ecebcfd7..44e6f25793 100644 --- a/src/world/common/UnkFunc44.inc.c +++ b/src/world/common/UnkFunc44.inc.c @@ -1,9 +1,9 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc44)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc44)(ScriptInstance* script, s32 isInitialCall) { script->varTable[0] = 0; - do {} while(0); + do {} while (0); if (gPlayerActionState == ACTION_STATE_GROUND_POUND) { script->varTable[0] = 1; } else if (gPlayerActionState == ACTION_STATE_ULTRA_POUND) { diff --git a/src/world/common/UnkFunc45.inc.c b/src/world/common/UnkFunc45.inc.c index aa2f728fa6..a8168923fa 100644 --- a/src/world/common/UnkFunc45.inc.c +++ b/src/world/common/UnkFunc45.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkFunc45)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) { +void N(UnkFunc45)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/common/UnkFunc5.inc.c b/src/world/common/UnkFunc5.inc.c index 3bbfa2a3ae..9b15750cf1 100644 --- a/src/world/common/UnkFunc5.inc.c +++ b/src/world/common/UnkFunc5.inc.c @@ -1,7 +1,7 @@ #include "common.h" #include "map.h" -void N(UnkFunc5)(Npc *npc, Enemy *enemy, ScriptInstance *script, NpcAISettings *aiSettings) { +void N(UnkFunc5)(Npc* npc, Enemy* enemy, ScriptInstance* script, NpcAISettings* aiSettings) { f32 posX, posY, posZ, posW; s32 temp_a1; s32 temp_v1; diff --git a/src/world/common/UnkFunc6.inc.c b/src/world/common/UnkFunc6.inc.c index f1f0bb8e8b..f7994efb7d 100644 --- a/src/world/common/UnkFunc6.inc.c +++ b/src/world/common/UnkFunc6.inc.c @@ -21,7 +21,7 @@ void N(UnkFunc6)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerrito if (npc->jumpVelocity >= 0.0) { npc->pos.y += npc->jumpVelocity; - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; enemy->unk_07 = 0; if (!(npc->flags & 8)) { posX = npc->pos.x; diff --git a/src/world/common/UnkFunc7.inc.c b/src/world/common/UnkFunc7.inc.c index ea1af22732..7f24c889b0 100644 --- a/src/world/common/UnkFunc7.inc.c +++ b/src/world/common/UnkFunc7.inc.c @@ -1,9 +1,9 @@ #include "common.h" #include "map.h" -ApiStatus N(UnkFunc7)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(UnkFunc7)(ScriptInstance* script, s32 isInitialCall) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); Enemy* enemy2; Npc* npc2; f32 posX, posZ; diff --git a/src/world/common/UnkFunc8.inc.c b/src/world/common/UnkFunc8.inc.c index 8d7a074cd3..7ba2ae121f 100644 --- a/src/world/common/UnkFunc8.inc.c +++ b/src/world/common/UnkFunc8.inc.c @@ -3,7 +3,7 @@ void N(UnkFunc8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); s32 var; if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { diff --git a/src/world/common/UnkFunc9.inc.c b/src/world/common/UnkFunc9.inc.c index 89ab3deada..11ff6adf82 100644 --- a/src/world/common/UnkFunc9.inc.c +++ b/src/world/common/UnkFunc9.inc.c @@ -3,12 +3,13 @@ void N(UnkFunc9)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; - Npc *npc = get_npc_unsafe(enemy->npcID); + Npc* npc = get_npc_unsafe(enemy->npcID); if (func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 12; - } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z) <= npc->moveSpeed) { + } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, + enemy->territory->wander.point.z) <= npc->moveSpeed) { npc->duration = 10; script->functionTemp[0].s = 50; } else if (npc->turnAroundYawAdjustment == 0) { diff --git a/src/world/common/UnkNpcAIFunc1.inc.c b/src/world/common/UnkNpcAIFunc1.inc.c index cb1ca277d6..19f28682bf 100644 --- a/src/world/common/UnkNpcAIFunc1.inc.c +++ b/src/world/common/UnkNpcAIFunc1.inc.c @@ -7,6 +7,6 @@ void N(UnkNpcAIFunc1)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTe npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = *enemy->animList; + npc->currentAnim.w = *enemy->animList; script->functionTemp[0].s = 3; } diff --git a/src/world/common/UnkNpcAIFunc11.inc.c b/src/world/common/UnkNpcAIFunc11.inc.c index e1ed1d7416..82eaa888f8 100644 --- a/src/world/common/UnkNpcAIFunc11.inc.c +++ b/src/world/common/UnkNpcAIFunc11.inc.c @@ -9,7 +9,7 @@ void N(UnkNpcAIFunc11)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT s32 something; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &something); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = 25; script->functionTemp[0].s = 14; } else { diff --git a/src/world/common/UnkNpcAIFunc12.inc.c b/src/world/common/UnkNpcAIFunc12.inc.c index 32f5a6abba..47df63690b 100644 --- a/src/world/common/UnkNpcAIFunc12.inc.c +++ b/src/world/common/UnkNpcAIFunc12.inc.c @@ -27,7 +27,7 @@ void N(UnkNpcAIFunc12)(ScriptInstance* script, NpcAISettings* aiSettings, s32 ar if ((npc->duration <= 0) || (--npc->duration <= 0) || (temp != 0)) { enemy->unk_07 = 0; - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 0; script->functionTemp[0].s = 15; } diff --git a/src/world/common/UnkNpcAIFunc13.inc.c b/src/world/common/UnkNpcAIFunc13.inc.c index 778a0b9dfd..3fd6424751 100644 --- a/src/world/common/UnkNpcAIFunc13.inc.c +++ b/src/world/common/UnkNpcAIFunc13.inc.c @@ -8,7 +8,7 @@ void N(UnkNpcAIFunc13)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT f32 angleDiff; npc->duration = (aiSettings->unk_20 / 2) + rand_int(aiSettings->unk_20 / 2 + 1); - npc->currentAnim = enemy->animList[3]; + npc->currentAnim.w = enemy->animList[3]; npc->moveSpeed = aiSettings->chaseSpeed; tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); diff --git a/src/world/common/UnkNpcAIFunc13_2.inc.c b/src/world/common/UnkNpcAIFunc13_2.inc.c index 9b817d8a8a..8bae9e51f7 100644 --- a/src/world/common/UnkNpcAIFunc13_2.inc.c +++ b/src/world/common/UnkNpcAIFunc13_2.inc.c @@ -8,7 +8,7 @@ void N(UnkNpcAIFunc13_2)(ScriptInstance* script, NpcAISettings* aiSettings, s32 f32 angleDiff; npc->duration = (aiSettings->unk_14 / 2) + rand_int(aiSettings->unk_14 / 2 + 1); - npc->currentAnim = enemy->animList[3]; + npc->currentAnim.w = enemy->animList[3]; npc->moveSpeed = aiSettings->alertRadius; tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); diff --git a/src/world/common/UnkNpcAIFunc14.inc.c b/src/world/common/UnkNpcAIFunc14.inc.c index 439788c699..429b7eed01 100644 --- a/src/world/common/UnkNpcAIFunc14.inc.c +++ b/src/world/common/UnkNpcAIFunc14.inc.c @@ -9,7 +9,7 @@ void N(UnkNpcAIFunc14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT f32 vt6 = enemy->varTable[6]; f32 jumpScale = vt6 / 100.0; - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->jumpVelocity = jumpVelocity; npc->jumpScale = jumpScale; npc->moveSpeed = aiSettings->chaseSpeed; diff --git a/src/world/common/UnkNpcAIFunc16.inc.c b/src/world/common/UnkNpcAIFunc16.inc.c index 29deeefff1..e3ee36d79e 100644 --- a/src/world/common/UnkNpcAIFunc16.inc.c +++ b/src/world/common/UnkNpcAIFunc16.inc.c @@ -6,6 +6,6 @@ void N(UnkNpcAIFunc16)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration = enemy->varTable[10]; - npc->currentAnim = enemy->animList[13]; + npc->currentAnim.w = enemy->animList[13]; script->functionTemp[0].s = 21; } diff --git a/src/world/common/UnkNpcAIFunc17.inc.c b/src/world/common/UnkNpcAIFunc17.inc.c index 68ffad1335..daadb0b47a 100644 --- a/src/world/common/UnkNpcAIFunc17.inc.c +++ b/src/world/common/UnkNpcAIFunc17.inc.c @@ -8,7 +8,7 @@ void N(UnkNpcAIFunc17)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->duration--; if (npc->duration <= 0) { npc->duration = 8; - npc->currentAnim = enemy->animList[14]; + npc->currentAnim.w = enemy->animList[14]; script->functionTemp[0].s = 52; } } diff --git a/src/world/common/UnkNpcAIFunc18.inc.c b/src/world/common/UnkNpcAIFunc18.inc.c index 73f49130cc..50cb08fd94 100644 --- a/src/world/common/UnkNpcAIFunc18.inc.c +++ b/src/world/common/UnkNpcAIFunc18.inc.c @@ -10,6 +10,6 @@ void N(UnkNpcAIFunc18)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT npc->collisionRadius = 24; script->functionTemp[1].s = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; script->functionTemp[0].s = 1; } diff --git a/src/world/common/UnkNpcAIFunc19.inc.c b/src/world/common/UnkNpcAIFunc19.inc.c index 7d54a4cf86..665eedfe59 100644 --- a/src/world/common/UnkNpcAIFunc19.inc.c +++ b/src/world/common/UnkNpcAIFunc19.inc.c @@ -11,7 +11,7 @@ void N(UnkNpcAIFunc19)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT if (npc->turnAroundYawAdjustment == 0 && npc->duration <= 0) { npc->duration = 8; - npc->currentAnim = enemy->animList[11]; + npc->currentAnim.w = enemy->animList[11]; script->functionTemp[0].s = 51; } } diff --git a/src/world/common/UnkNpcAIFunc1_copy.inc.c b/src/world/common/UnkNpcAIFunc1_copy.inc.c index 32761f89ec..b3ff4a684a 100644 --- a/src/world/common/UnkNpcAIFunc1_copy.inc.c +++ b/src/world/common/UnkNpcAIFunc1_copy.inc.c @@ -7,6 +7,6 @@ void N(UnkNpcAIFunc1_copy)(ScriptInstance* script, NpcAISettings* aiSettings, En npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = *enemy->animList; + npc->currentAnim.w = *enemy->animList; script->functionTemp[0].s = 3; } diff --git a/src/world/common/UnkNpcAIFunc2.inc.c b/src/world/common/UnkNpcAIFunc2.inc.c index 069479e9c8..881f81853c 100644 --- a/src/world/common/UnkNpcAIFunc2.inc.c +++ b/src/world/common/UnkNpcAIFunc2.inc.c @@ -8,6 +8,6 @@ void N(UnkNpcAIFunc2)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTe npc->duration = 0; npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; script->functionTemp[0].s = 11; } diff --git a/src/world/common/UnkNpcAIFunc21.inc.c b/src/world/common/UnkNpcAIFunc21.inc.c index 6b84181f7b..1e78812208 100644 --- a/src/world/common/UnkNpcAIFunc21.inc.c +++ b/src/world/common/UnkNpcAIFunc21.inc.c @@ -9,7 +9,7 @@ void N(UnkNpcAIFunc21)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT if (npc->duration <= 0) { npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); enable_npc_shadow(npc); - npc->currentAnim = enemy->animList[10]; + npc->currentAnim.w = enemy->animList[10]; npc->duration = 8; script->functionTemp[0].s = 3; } diff --git a/src/world/common/UnkNpcAIFunc22.inc.c b/src/world/common/UnkNpcAIFunc22.inc.c index e093171299..62e3838d03 100644 --- a/src/world/common/UnkNpcAIFunc22.inc.c +++ b/src/world/common/UnkNpcAIFunc22.inc.c @@ -6,7 +6,7 @@ void N(UnkNpcAIFunc22)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyT Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; script->functionTemp[1].s = rand_int(1000) % 2 + 2; script->functionTemp[0].s = 5; } diff --git a/src/world/common/UnkNpcAIFunc6.inc.c b/src/world/common/UnkNpcAIFunc6.inc.c index 9f97ae50bf..d523eec792 100644 --- a/src/world/common/UnkNpcAIFunc6.inc.c +++ b/src/world/common/UnkNpcAIFunc6.inc.c @@ -9,7 +9,7 @@ void N(UnkNpcAIFunc6)(ScriptInstance* script) { if (npc->turnAroundYawAdjustment == 0) { enemy->varTable[0] = 2; npc->duration = enemy->varTable[1]; - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; script->functionTemp[0].s = 31; } } diff --git a/src/world/common/UnkNpcAIFunc7.inc.c b/src/world/common/UnkNpcAIFunc7.inc.c index f1ea24e327..d174ff6d22 100644 --- a/src/world/common/UnkNpcAIFunc7.inc.c +++ b/src/world/common/UnkNpcAIFunc7.inc.c @@ -9,7 +9,7 @@ void N(UnkNpcAIFunc7)(ScriptInstance* script) { if (npc->duration <= 0) { enemy->varTable[0] = 3; npc->duration = enemy->varTable[2]; - npc->currentAnim = enemy->animList[9]; + npc->currentAnim.w = enemy->animList[9]; script->functionTemp[0].s = 32; } } diff --git a/src/world/common/UnkNpcAIFunc8.inc.c b/src/world/common/UnkNpcAIFunc8.inc.c index 64afb2d6a0..f0ded025d1 100644 --- a/src/world/common/UnkNpcAIFunc8.inc.c +++ b/src/world/common/UnkNpcAIFunc8.inc.c @@ -8,7 +8,7 @@ void N(UnkNpcAIFunc8)(ScriptInstance* script) { npc->duration--; if (npc->duration <= 0) { enemy->varTable[0] = 4; - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = enemy->varTable[3]; if (enemy->varTable[3] >= 8) { s32 something; diff --git a/src/world/common/UnkNpcAIFunc9.inc.c b/src/world/common/UnkNpcAIFunc9.inc.c index 47bfd61c99..0b0a2216b1 100644 --- a/src/world/common/UnkNpcAIFunc9.inc.c +++ b/src/world/common/UnkNpcAIFunc9.inc.c @@ -9,7 +9,7 @@ void N(UnkNpcAIFunc9)(ScriptInstance* script) { npc->yaw = atan2(npc->pos.x, npc->pos.z, npc2->pos.x, npc2->pos.z); if (enemy2->varTable[0] == 0) { - npc->currentAnim = enemy->animList[0]; + npc->currentAnim.w = enemy->animList[0]; npc->duration = enemy->varTable[2]; script->functionTemp[0].s = 33; } diff --git a/src/world/common/foliage.inc.c b/src/world/common/foliage.inc.c index c5d51b36a7..2979be116a 100644 --- a/src/world/common/foliage.inc.c +++ b/src/world/common/foliage.inc.c @@ -83,60 +83,60 @@ Script N(searchBush) = { SI_CMD(ScriptOpcode_BUFFER_READ_4, SI_VAR(1), SI_VAR(2), SI_VAR(3), SI_VAR(4)), SI_CMD(ScriptOpcode_CALL, GetPlayerPos, SI_VAR(5), SI_VAR(15), SI_VAR(7)), SI_CMD(ScriptOpcode_SPAWN_THREAD), - SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 0), - SI_CMD(ScriptOpcode_IF_NE, SI_VAR(1), 0), - SI_CMD(ScriptOpcode_LOOP, 5), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), 1, SI_VAR(15), 0), - SI_CMD(ScriptOpcode_IF_EQ, SI_FLAG(0), 0), - SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 1), - SI_CMD(ScriptOpcode_CALL, PlaySoundAtModel, SI_VAR(3), 339, 0), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), -1, SI_VAR(15), 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_VAR(3), 0, 0, 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 0), + SI_CMD(ScriptOpcode_IF_NE, SI_VAR(1), 0), + SI_CMD(ScriptOpcode_LOOP, 5), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), 1, SI_VAR(15), 0), + SI_CMD(ScriptOpcode_IF_EQ, SI_FLAG(0), 0), + SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 1), + SI_CMD(ScriptOpcode_CALL, PlaySoundAtModel, SI_VAR(3), 339, 0), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), -1, SI_VAR(15), 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_VAR(3), 0, 0, 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_END_SPAWN_THREAD), SI_CMD(ScriptOpcode_SPAWN_THREAD), - SI_CMD(ScriptOpcode_IF_NE, SI_VAR(2), 0), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), - SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(5), SI_VAR(6), SI_VAR(7)), - SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(8), SI_VAR(9), SI_VAR(10)), - SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(10), 0), - SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(4), SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9)), - SI_CMD(ScriptOpcode_ELSE), - SI_CMD(ScriptOpcode_CALL, GetValueByRef, SI_VAR(10), SI_VAR(11)), - SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(11), 0), - SI_CMD(ScriptOpcode_CALL, SetValueByRef, SI_VAR(10), 1), - SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(4), SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9)), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_IF_NE, SI_VAR(2), 0), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(5), SI_VAR(6), SI_VAR(7)), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(8), SI_VAR(9), SI_VAR(10)), + SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(10), 0), + SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(4), SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9)), + SI_CMD(ScriptOpcode_ELSE), + SI_CMD(ScriptOpcode_CALL, GetValueByRef, SI_VAR(10), SI_VAR(11)), + SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(11), 0), + SI_CMD(ScriptOpcode_CALL, SetValueByRef, SI_VAR(10), 1), + SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(4), SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9)), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_END_SPAWN_THREAD), SI_CMD(ScriptOpcode_SLEEP_FRAMES, 15), SI_CMD(ScriptOpcode_IF_NE, SI_VAR(4), 0), - SI_CMD(ScriptOpcode_AWAIT_SCRIPT, 0xFE363C84), + SI_CMD(ScriptOpcode_AWAIT_SCRIPT, 0xFE363C84), SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_RETURN), SI_CMD(ScriptOpcode_END) @@ -151,102 +151,102 @@ Script N(shakeTree) = { SI_CMD(ScriptOpcode_CALL, PlaySound, 357), SI_CMD(ScriptOpcode_CALL, PlaySound, 358), SI_CMD(ScriptOpcode_SPAWN_THREAD), - SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 0), - SI_CMD(ScriptOpcode_IF_NE, SI_VAR(1), 0), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_LOOP, 5), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), SI_FIXED(0.2001953125), SI_VAR(15), 0), - SI_CMD(ScriptOpcode_IF_EQ, SI_FLAG(0), 0), - SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 1), - SI_CMD(ScriptOpcode_CALL, PlaySoundAtModel, SI_VAR(3), 358, 0), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), SI_FIXED(-0.19921875), SI_VAR(15), 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_VAR(3), 0, 0, 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 0), + SI_CMD(ScriptOpcode_IF_NE, SI_VAR(1), 0), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_LOOP, 5), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), SI_FIXED(0.2001953125), SI_VAR(15), 0), + SI_CMD(ScriptOpcode_IF_EQ, SI_FLAG(0), 0), + SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 1), + SI_CMD(ScriptOpcode_CALL, PlaySoundAtModel, SI_VAR(3), 358, 0), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(3), SI_FIXED(0.1005859375), SI_FIXED(-0.19921875), SI_VAR(15), 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(1)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(2)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_VAR(3), 0, 0, 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_END_SPAWN_THREAD), SI_CMD(ScriptOpcode_SPAWN_THREAD), - SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 0), - SI_CMD(ScriptOpcode_IF_NE, SI_VAR(2), 0), - SI_CMD(ScriptOpcode_LOOP, 5), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), - SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(4), SI_FIXED(0.1005859375), SI_FIXED(0.2001953125), SI_VAR(15), 0), - SI_CMD(ScriptOpcode_IF_EQ, SI_FLAG(0), 0), - SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 1), - SI_CMD(ScriptOpcode_CALL, PlaySoundAtModel, SI_VAR(4), 357, 0), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), - SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(4), SI_FIXED(0.1005859375), SI_FIXED(-0.19921875), SI_VAR(15), 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), - SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_VAR(4), 0, 0, 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), - SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 0), + SI_CMD(ScriptOpcode_IF_NE, SI_VAR(2), 0), + SI_CMD(ScriptOpcode_LOOP, 5), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), + SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(4), SI_FIXED(0.1005859375), SI_FIXED(0.2001953125), SI_VAR(15), 0), + SI_CMD(ScriptOpcode_IF_EQ, SI_FLAG(0), 0), + SI_CMD(ScriptOpcode_SET, SI_FLAG(0), 1), + SI_CMD(ScriptOpcode_CALL, PlaySoundAtModel, SI_VAR(4), 357, 0), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), + SI_CMD(ScriptOpcode_CALL, N(TransformFoliage), SI_VAR(4), SI_FIXED(0.1005859375), SI_FIXED(-0.19921875), SI_VAR(15), 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(2)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(3)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(3)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), + SI_CMD(ScriptOpcode_CALL, TranslateModel, SI_VAR(4), 0, 0, 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_SLEEP_FRAMES, 1), + SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_END_SPAWN_THREAD), SI_CMD(ScriptOpcode_SPAWN_THREAD), - SI_CMD(ScriptOpcode_IF_NE, SI_VAR(3), 0), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(3)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(4)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(5)), - SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(6), SI_VAR(7), SI_VAR(8)), - SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(9), SI_VAR(10), SI_VAR(11)), - SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(11), 0), - SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9), SI_VAR(10)), - SI_CMD(ScriptOpcode_ELSE), - SI_CMD(ScriptOpcode_CALL, GetValueByRef, SI_VAR(11), SI_VAR(12)), - SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(12), 0), - SI_CMD(ScriptOpcode_CALL, SetValueByRef, SI_VAR(11), 1), - SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9), SI_VAR(10)), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_IF), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_IF_NE, SI_VAR(3), 0), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(3)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(4)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(4)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(5)), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(6), SI_VAR(7), SI_VAR(8)), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(9), SI_VAR(10), SI_VAR(11)), + SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(11), 0), + SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9), SI_VAR(10)), + SI_CMD(ScriptOpcode_ELSE), + SI_CMD(ScriptOpcode_CALL, GetValueByRef, SI_VAR(11), SI_VAR(12)), + SI_CMD(ScriptOpcode_IF_EQ, SI_VAR(12), 0), + SI_CMD(ScriptOpcode_CALL, SetValueByRef, SI_VAR(11), 1), + SI_CMD(ScriptOpcode_CALL, DropItemEntity, SI_VAR(5), SI_VAR(6), SI_VAR(7), SI_VAR(8), SI_VAR(9), SI_VAR(10)), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_END_SPAWN_THREAD), SI_CMD(ScriptOpcode_SPAWN_THREAD), - SI_CMD(ScriptOpcode_IF_NE, SI_VAR(4), 0), - SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(4)), - SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(5)), - SI_CMD(ScriptOpcode_LOOP, SI_VAR(5)), - SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(6), SI_VAR(7), SI_VAR(8)), - SI_CMD(ScriptOpcode_CALL, PlayEffect, 20, 0, SI_VAR(6), SI_VAR(7), SI_VAR(8), 100, 0, 0, 0, 0, 0, 0, 0, 0), - SI_CMD(ScriptOpcode_END_LOOP), - SI_CMD(ScriptOpcode_END_IF), + SI_CMD(ScriptOpcode_IF_NE, SI_VAR(4), 0), + SI_CMD(ScriptOpcode_USE_BUFFER, SI_VAR(4)), + SI_CMD(ScriptOpcode_BUFFER_READ_1, SI_VAR(5)), + SI_CMD(ScriptOpcode_LOOP, SI_VAR(5)), + SI_CMD(ScriptOpcode_BUFFER_READ_3, SI_VAR(6), SI_VAR(7), SI_VAR(8)), + SI_CMD(ScriptOpcode_CALL, PlayEffect, 20, 0, SI_VAR(6), SI_VAR(7), SI_VAR(8), 100, 0, 0, 0, 0, 0, 0, 0, 0), + SI_CMD(ScriptOpcode_END_LOOP), + SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_END_SPAWN_THREAD), SI_CMD(ScriptOpcode_IF_NE, SI_VAR(5), 0), - SI_CMD(ScriptOpcode_AWAIT_SCRIPT, 0xFE363C85), + SI_CMD(ScriptOpcode_AWAIT_SCRIPT, 0xFE363C85), SI_CMD(ScriptOpcode_END_IF), SI_CMD(ScriptOpcode_SLEEP_FRAMES, 15), SI_CMD(ScriptOpcode_RETURN), diff --git a/src/world/common/reflection.inc.c b/src/world/common/reflection.inc.c index dafaf47191..e82fc815b1 100644 --- a/src/world/common/reflection.inc.c +++ b/src/world/common/reflection.inc.c @@ -111,7 +111,7 @@ void N(reflection_setup_wall)(void) { renderTaskPtr->renderMode = renderMode; renderTaskPtr->appendGfxArg = playerStatus; - renderTaskPtr->appendGfx = (void (*)(void *)) N(reflection_render_wall); + renderTaskPtr->appendGfx = (void (*)(void*)) N(reflection_render_wall); renderTaskPtr->distance = -screenZ; queue_render_task(renderTaskPtr); } @@ -189,12 +189,13 @@ void N(reflection_setup_floor)(void) { renderTaskPtr->renderMode = renderMode; renderTaskPtr->appendGfxArg = playerStatus; renderTaskPtr->distance = -screenZ; - renderTaskPtr->appendGfx = (void (*)(void *)) (!(playerStatus->flags & 0x20000) ? N(reflection_render_floor) : N(reflection_render_floor_fancy)); + renderTaskPtr->appendGfx = (void (*)(void*))(!(playerStatus->flags & 0x20000) ? N(reflection_render_floor) : N( + reflection_render_floor_fancy)); queue_render_task(renderTaskPtr); } } -void N(reflection_render_floor)(PlayerStatus *playerStatus) { +void N(reflection_render_floor)(PlayerStatus* playerStatus) { f32 yaw = -CAM(gCurrentCamID)->currentYaw; Matrix4f main; Matrix4f translation; @@ -223,7 +224,7 @@ void N(reflection_render_floor)(PlayerStatus *playerStatus) { render_sprite(flags, 0, 0, NULL, main); } -void N(reflection_render_floor_fancy)(PlayerStatus *playerStatus) { +void N(reflection_render_floor_fancy)(PlayerStatus* playerStatus) { Matrix4f main; Matrix4f translation; Matrix4f rotation; @@ -315,7 +316,7 @@ void N(reflection_render_floor_fancy)(PlayerStatus *playerStatus) { /// int var0 = reflection type /// bool var1 = enable wall reflection -ApiStatus N(ReflectPartner)(ScriptInstance *script, s32 isInitialCall) { +ApiStatus N(ReflectPartner)(ScriptInstance* script, s32 isInitialCall) { Npc* partner; if (script->varTable[1] == FALSE) { diff --git a/src/world/common/set_script_owner_npc_anim.inc.c b/src/world/common/set_script_owner_npc_anim.inc.c index d876d49c02..4fc1fec4f2 100644 --- a/src/world/common/set_script_owner_npc_anim.inc.c +++ b/src/world/common/set_script_owner_npc_anim.inc.c @@ -5,7 +5,7 @@ void N(set_script_owner_npc_anim)(ScriptInstance* script, NpcAISettings* aiSetti Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->currentAnim = enemy->animList[8]; + npc->currentAnim.w = enemy->animList[8]; npc->duration = enemy->varTable[2]; npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); script->functionTemp[0].s = 13; diff --git a/src/world/common/set_script_owner_npc_col_height.inc.c b/src/world/common/set_script_owner_npc_col_height.inc.c index f09ac00672..b79f45cba1 100644 --- a/src/world/common/set_script_owner_npc_col_height.inc.c +++ b/src/world/common/set_script_owner_npc_col_height.inc.c @@ -1,7 +1,8 @@ #include "common.h" #include "map.h" -void N(set_script_owner_npc_col_height)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) { +void N(set_script_owner_npc_col_height)(ScriptInstance* script, NpcAISettings* aiSettings, + EnemyTerritoryThing* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); diff --git a/src/world/partner/goombario.c b/src/world/partner/goombario.c index ada70794d7..583959a594 100644 --- a/src/world/partner/goombario.c +++ b/src/world/partner/goombario.c @@ -35,7 +35,7 @@ s32 world_goombario_can_pause(Npc* partner) { if ((partner->flags & 0x1800) != 0x1000) { return new_var = 0; - do { } while(new_var); // why though + do { } while (new_var); // why though } return TRUE; diff --git a/src/world/script_api/7E0E80.c b/src/world/script_api/7E0E80.c index 8485b0f7eb..13c9955fba 100644 --- a/src/world/script_api/7E0E80.c +++ b/src/world/script_api/7E0E80.c @@ -39,7 +39,7 @@ s32 shop_owner_begin_speech(s32 messageIndex) { s32 shop_owner_buy_dialog(s32 messageIndex, s32 itemName, s32 coinCost, s32 bpCost) { Shop* shop = gGameStatusPtr->mapShop; s32 shopStringID = shop->owner->shopStringIDs[messageIndex]; - ScriptInstance *script; + ScriptInstance* script; s32 phi_a0; set_message_string(itemName, 0); diff --git a/src/world/world.c b/src/world/world.c index 7fb48cf7c7..72f140640b 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -158,7 +158,7 @@ void load_map_by_IDs(s16 areaID, s16 mapID, s16 loadType) { if (temp800A41E8->modelTreeRoot != NULL) { load_data_for_models(temp800A41E8->modelTreeRoot, thing, decompressedSize); - } + } } if (temp800A41E8->background != NULL) { @@ -229,10 +229,11 @@ void* load_asset_by_name(char* assetName, s32* decompressedSize) { dma_copy(ASSET_TABLE_FIRST_ENTRY, ASSET_TABLE_FIRST_ENTRY + firstHeader.offset, assetTableBuffer); while (strcmp(curAsset->name, assetName) != 0) { curAsset++; - } + } *decompressedSize = curAsset->decompressedLength; ret = general_heap_malloc(curAsset->compressedLength); - dma_copy(ASSET_TABLE_FIRST_ENTRY + curAsset->offset, ASSET_TABLE_FIRST_ENTRY + curAsset->offset + curAsset->compressedLength, ret); + dma_copy(ASSET_TABLE_FIRST_ENTRY + curAsset->offset, + ASSET_TABLE_FIRST_ENTRY + curAsset->offset + curAsset->compressedLength, ret); heap_free(assetTableBuffer); return ret; } @@ -249,7 +250,7 @@ s32 get_asset_offset(char* assetName, s32* compressedSize) { dma_copy(ASSET_TABLE_FIRST_ENTRY, ASSET_TABLE_FIRST_ENTRY + firstHeader.offset, assetTableBuffer); while (strcmp(curAsset->name, assetName) != 0) { curAsset++; - } + } *compressedSize = curAsset->compressedLength; ret = ASSET_TABLE_FIRST_ENTRY + curAsset->offset; heap_free(assetTableBuffer); @@ -276,11 +277,13 @@ s32 get_asset_offset(char* assetName, s32* compressedSize) { // these, along with all the *_maps, almost certainly belong in the next file s16 D_8008FF70[] = { 4, 6, 5, 4, 7, 6, 0, 3, 4, 3, 7, 4, 3, 2, 7, 2, 6, 7, 2, 1, 6, 1, 5, 6, 1, 0, 5, 0, 4, 5, 0, 1, 2, - 0, 2, 3}; + 0, 2, 3 + }; f32 D_8008FFB8[] = { 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, - 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f }; + 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f + }; /// Toad Town Map mac_maps[] = { diff --git a/tools/splat/Makefile b/tools/splat/Makefile index 603f567fad..0519a89ecf 100644 --- a/tools/splat/Makefile +++ b/tools/splat/Makefile @@ -5,7 +5,7 @@ default: all all: Yay0decompress Yay0decompress: - gcc $(UTIL_DIR)/n64/Yay0decompress.c -fPIC -shared -O3 -o $(UTIL_DIR)/n64/Yay0decompress + gcc $(UTIL_DIR)/n64/Yay0decompress.c -fPIC -shared -O3 -o $(UTIL_DIR)/n64/Yay0decompress -Wall -Wextra clean: rm -f $(UTIL_DIR)/n64/Yay0decompress diff --git a/tools/splat/split.py b/tools/splat/split.py index bc028cac99..a2f33d7fd3 100755 --- a/tools/splat/split.py +++ b/tools/splat/split.py @@ -44,7 +44,7 @@ def initialize_segments(config_segments: Union[dict, list]) -> List[Segment]: seg_type = Segment.parse_segment_type(seg_yaml) segment_class = Segment.get_class_for_type(seg_type) - + this_start = Segment.parse_segment_start(seg_yaml) next_start = Segment.parse_segment_start(config_segments[i + 1]) @@ -134,7 +134,7 @@ def main(config_path, base_dir, target_path, modes, verbose, use_cache=True): try: with options.get_cache_path().open("rb") as f3: cache = pickle.load(f3) - + if verbose: log.write(f"Loaded cache ({len(cache.keys())} items)") except Exception: diff --git a/tools/splat/util/n64/Yay0decompress.c b/tools/splat/util/n64/Yay0decompress.c index ec20f142bd..250f3476bf 100644 --- a/tools/splat/util/n64/Yay0decompress.c +++ b/tools/splat/util/n64/Yay0decompress.c @@ -36,7 +36,8 @@ void decompress(Yay0Header* hdr, uint8_t* srcPtr, uint8_t* dstPtr, bool isBigEnd written += copy = (op >> 12) ? (2 + (op >> 12)) : (18 + *data++); while (copy--) { - *dstPtr++ = dstPtr[-(op & 0xfff) - 1]; + *dstPtr = dstPtr[-(op & 0xfff) - 1]; + dstPtr++; } } } diff --git a/tools/splat_ext/PaperMarioNpcSprites.py b/tools/splat_ext/PaperMarioNpcSprites.py index c7ddc7fc5e..6f146829d2 100644 --- a/tools/splat_ext/PaperMarioNpcSprites.py +++ b/tools/splat_ext/PaperMarioNpcSprites.py @@ -1,5 +1,6 @@ from segtypes.n64.segment import N64Segment from pathlib import Path +import struct from util.n64 import Yay0decompress from util.iter import iter_in_groups from util.color import unpack_color @@ -58,15 +59,10 @@ class Sprite: l = [] pos = 0 - while True: - offset = int.from_bytes(data[pos:pos+4], byteorder="big", signed=True) - - if offset == -1: + for offset in struct.iter_unpack(">i", data): + if offset[0] == -1: break - - l.append(offset) - - pos += 4 + l.append(offset[0]) return l diff --git a/tools/update_symbol_addrs.py b/tools/update_symbol_addrs.py index e60c8cabb4..8d974aae79 100755 --- a/tools/update_symbol_addrs.py +++ b/tools/update_symbol_addrs.py @@ -23,8 +23,6 @@ elf_symbols = [] ignores = set() -verbose = False - def read_ignores(): with open(ignores_path) as f: lines = f.readlines() diff --git a/ver/us/asm/nonmatchings/npc/bind_enemy_ai.s b/ver/us/asm/nonmatchings/npc/bind_enemy_ai.s deleted file mode 100644 index 0d9a1c53b2..0000000000 --- a/ver/us/asm/nonmatchings/npc/bind_enemy_ai.s +++ /dev/null @@ -1,31 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel bind_enemy_ai -/* 19D4C 8003E94C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 19D50 8003E950 AFB00010 */ sw $s0, 0x10($sp) -/* 19D54 8003E954 0080802D */ daddu $s0, $a0, $zero -/* 19D58 8003E958 AFBF0018 */ sw $ra, 0x18($sp) -/* 19D5C 8003E95C AFB10014 */ sw $s1, 0x14($sp) -/* 19D60 8003E960 8E02003C */ lw $v0, 0x3c($s0) -/* 19D64 8003E964 10400004 */ beqz $v0, .L8003E978 -/* 19D68 8003E968 00A0882D */ daddu $s1, $a1, $zero -/* 19D6C 8003E96C 8C440144 */ lw $a0, 0x144($v0) -/* 19D70 8003E970 0C0B102B */ jal kill_script_by_ID -/* 19D74 8003E974 00000000 */ nop -.L8003E978: -/* 19D78 8003E978 0220202D */ daddu $a0, $s1, $zero -/* 19D7C 8003E97C 2405000A */ addiu $a1, $zero, 0xa -/* 19D80 8003E980 0000302D */ daddu $a2, $zero, $zero -/* 19D84 8003E984 0C0B0CF8 */ jal start_script -/* 19D88 8003E988 AE040024 */ sw $a0, 0x24($s0) -/* 19D8C 8003E98C 0040182D */ daddu $v1, $v0, $zero -/* 19D90 8003E990 AE03003C */ sw $v1, 0x3c($s0) -/* 19D94 8003E994 8C620144 */ lw $v0, 0x144($v1) -/* 19D98 8003E998 AE020054 */ sw $v0, 0x54($s0) -/* 19D9C 8003E99C AC700148 */ sw $s0, 0x148($v1) -/* 19DA0 8003E9A0 8FBF0018 */ lw $ra, 0x18($sp) -/* 19DA4 8003E9A4 8FB10014 */ lw $s1, 0x14($sp) -/* 19DA8 8003E9A8 8FB00010 */ lw $s0, 0x10($sp) -/* 19DAC 8003E9AC 03E00008 */ jr $ra -/* 19DB0 8003E9B0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/bind_enemy_aux.s b/ver/us/asm/nonmatchings/npc/bind_enemy_aux.s deleted file mode 100644 index d7a790872b..0000000000 --- a/ver/us/asm/nonmatchings/npc/bind_enemy_aux.s +++ /dev/null @@ -1,31 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel bind_enemy_aux -/* 19DB4 8003E9B4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 19DB8 8003E9B8 AFB00010 */ sw $s0, 0x10($sp) -/* 19DBC 8003E9BC 0080802D */ daddu $s0, $a0, $zero -/* 19DC0 8003E9C0 AFBF0018 */ sw $ra, 0x18($sp) -/* 19DC4 8003E9C4 AFB10014 */ sw $s1, 0x14($sp) -/* 19DC8 8003E9C8 8E020044 */ lw $v0, 0x44($s0) -/* 19DCC 8003E9CC 10400004 */ beqz $v0, .L8003E9E0 -/* 19DD0 8003E9D0 00A0882D */ daddu $s1, $a1, $zero -/* 19DD4 8003E9D4 8C440144 */ lw $a0, 0x144($v0) -/* 19DD8 8003E9D8 0C0B102B */ jal kill_script_by_ID -/* 19DDC 8003E9DC 00000000 */ nop -.L8003E9E0: -/* 19DE0 8003E9E0 0220202D */ daddu $a0, $s1, $zero -/* 19DE4 8003E9E4 2405000A */ addiu $a1, $zero, 0xa -/* 19DE8 8003E9E8 0000302D */ daddu $a2, $zero, $zero -/* 19DEC 8003E9EC 0C0B0CF8 */ jal start_script -/* 19DF0 8003E9F0 AE04002C */ sw $a0, 0x2c($s0) -/* 19DF4 8003E9F4 0040182D */ daddu $v1, $v0, $zero -/* 19DF8 8003E9F8 AE030044 */ sw $v1, 0x44($s0) -/* 19DFC 8003E9FC 8C620144 */ lw $v0, 0x144($v1) -/* 19E00 8003EA00 AE02005C */ sw $v0, 0x5c($s0) -/* 19E04 8003EA04 AC700148 */ sw $s0, 0x148($v1) -/* 19E08 8003EA08 8FBF0018 */ lw $ra, 0x18($sp) -/* 19E0C 8003EA0C 8FB10014 */ lw $s1, 0x14($sp) -/* 19E10 8003EA10 8FB00010 */ lw $s0, 0x10($sp) -/* 19E14 8003EA14 03E00008 */ jr $ra -/* 19E18 8003EA18 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/bind_enemy_interact.s b/ver/us/asm/nonmatchings/npc/bind_enemy_interact.s deleted file mode 100644 index 3c6819fae7..0000000000 --- a/ver/us/asm/nonmatchings/npc/bind_enemy_interact.s +++ /dev/null @@ -1,31 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel bind_enemy_interact -/* 19E1C 8003EA1C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 19E20 8003EA20 AFB00010 */ sw $s0, 0x10($sp) -/* 19E24 8003EA24 0080802D */ daddu $s0, $a0, $zero -/* 19E28 8003EA28 AFBF0018 */ sw $ra, 0x18($sp) -/* 19E2C 8003EA2C AFB10014 */ sw $s1, 0x14($sp) -/* 19E30 8003EA30 8E020038 */ lw $v0, 0x38($s0) -/* 19E34 8003EA34 10400004 */ beqz $v0, .L8003EA48 -/* 19E38 8003EA38 00A0882D */ daddu $s1, $a1, $zero -/* 19E3C 8003EA3C 8C440144 */ lw $a0, 0x144($v0) -/* 19E40 8003EA40 0C0B102B */ jal kill_script_by_ID -/* 19E44 8003EA44 00000000 */ nop -.L8003EA48: -/* 19E48 8003EA48 0220202D */ daddu $a0, $s1, $zero -/* 19E4C 8003EA4C 2405000A */ addiu $a1, $zero, 0xa -/* 19E50 8003EA50 0000302D */ daddu $a2, $zero, $zero -/* 19E54 8003EA54 0C0B0CF8 */ jal start_script -/* 19E58 8003EA58 AE040020 */ sw $a0, 0x20($s0) -/* 19E5C 8003EA5C 0040182D */ daddu $v1, $v0, $zero -/* 19E60 8003EA60 AE030038 */ sw $v1, 0x38($s0) -/* 19E64 8003EA64 8C620144 */ lw $v0, 0x144($v1) -/* 19E68 8003EA68 AE020050 */ sw $v0, 0x50($s0) -/* 19E6C 8003EA6C AC700148 */ sw $s0, 0x148($v1) -/* 19E70 8003EA70 8FBF0018 */ lw $ra, 0x18($sp) -/* 19E74 8003EA74 8FB10014 */ lw $s1, 0x14($sp) -/* 19E78 8003EA78 8FB00010 */ lw $s0, 0x10($sp) -/* 19E7C 8003EA7C 03E00008 */ jr $ra -/* 19E80 8003EA80 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/bind_npc_ai.s b/ver/us/asm/nonmatchings/npc/bind_npc_ai.s deleted file mode 100644 index 205662f1f7..0000000000 --- a/ver/us/asm/nonmatchings/npc/bind_npc_ai.s +++ /dev/null @@ -1,61 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel bind_npc_ai -/* 19E84 8003EA84 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 19E88 8003EA88 AFB3001C */ sw $s3, 0x1c($sp) -/* 19E8C 8003EA8C 0080982D */ daddu $s3, $a0, $zero -/* 19E90 8003EA90 AFB40020 */ sw $s4, 0x20($sp) -/* 19E94 8003EA94 00A0A02D */ daddu $s4, $a1, $zero -/* 19E98 8003EA98 AFB20018 */ sw $s2, 0x18($sp) -/* 19E9C 8003EA9C 3C12800B */ lui $s2, %hi(gCurrentEncounter) -/* 19EA0 8003EAA0 26520F10 */ addiu $s2, $s2, %lo(gCurrentEncounter) -/* 19EA4 8003EAA4 AFBF0024 */ sw $ra, 0x24($sp) -/* 19EA8 8003EAA8 AFB10014 */ sw $s1, 0x14($sp) -/* 19EAC 8003EAAC AFB00010 */ sw $s0, 0x10($sp) -/* 19EB0 8003EAB0 8242001C */ lb $v0, 0x1c($s2) -/* 19EB4 8003EAB4 1840001E */ blez $v0, .L8003EB30 -/* 19EB8 8003EAB8 0000802D */ daddu $s0, $zero, $zero -/* 19EBC 8003EABC 0240882D */ daddu $s1, $s2, $zero -.L8003EAC0: -/* 19EC0 8003EAC0 8E260028 */ lw $a2, 0x28($s1) -/* 19EC4 8003EAC4 50C00015 */ beql $a2, $zero, .L8003EB1C -/* 19EC8 8003EAC8 26310004 */ addiu $s1, $s1, 4 -/* 19ECC 8003EACC 8CC20000 */ lw $v0, ($a2) -/* 19ED0 8003EAD0 18400011 */ blez $v0, .L8003EB18 -/* 19ED4 8003EAD4 0000282D */ daddu $a1, $zero, $zero -/* 19ED8 8003EAD8 00C0182D */ daddu $v1, $a2, $zero -.L8003EADC: -/* 19EDC 8003EADC 8C640004 */ lw $a0, 4($v1) -/* 19EE0 8003EAE0 10800008 */ beqz $a0, .L8003EB04 -/* 19EE4 8003EAE4 00000000 */ nop -/* 19EE8 8003EAE8 84820008 */ lh $v0, 8($a0) -/* 19EEC 8003EAEC 14530005 */ bne $v0, $s3, .L8003EB04 -/* 19EF0 8003EAF0 00000000 */ nop -/* 19EF4 8003EAF4 0C00FA53 */ jal bind_enemy_ai -/* 19EF8 8003EAF8 0280282D */ daddu $a1, $s4, $zero -/* 19EFC 8003EAFC 0800FAC7 */ j .L8003EB1C -/* 19F00 8003EB00 26310004 */ addiu $s1, $s1, 4 -.L8003EB04: -/* 19F04 8003EB04 8CC20000 */ lw $v0, ($a2) -/* 19F08 8003EB08 24A50001 */ addiu $a1, $a1, 1 -/* 19F0C 8003EB0C 00A2102A */ slt $v0, $a1, $v0 -/* 19F10 8003EB10 1440FFF2 */ bnez $v0, .L8003EADC -/* 19F14 8003EB14 24630004 */ addiu $v1, $v1, 4 -.L8003EB18: -/* 19F18 8003EB18 26310004 */ addiu $s1, $s1, 4 -.L8003EB1C: -/* 19F1C 8003EB1C 8242001C */ lb $v0, 0x1c($s2) -/* 19F20 8003EB20 26100001 */ addiu $s0, $s0, 1 -/* 19F24 8003EB24 0202102A */ slt $v0, $s0, $v0 -/* 19F28 8003EB28 1440FFE5 */ bnez $v0, .L8003EAC0 -/* 19F2C 8003EB2C 00000000 */ nop -.L8003EB30: -/* 19F30 8003EB30 8FBF0024 */ lw $ra, 0x24($sp) -/* 19F34 8003EB34 8FB40020 */ lw $s4, 0x20($sp) -/* 19F38 8003EB38 8FB3001C */ lw $s3, 0x1c($sp) -/* 19F3C 8003EB3C 8FB20018 */ lw $s2, 0x18($sp) -/* 19F40 8003EB40 8FB10014 */ lw $s1, 0x14($sp) -/* 19F44 8003EB44 8FB00010 */ lw $s0, 0x10($sp) -/* 19F48 8003EB48 03E00008 */ jr $ra -/* 19F4C 8003EB4C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/bind_npc_aux.s b/ver/us/asm/nonmatchings/npc/bind_npc_aux.s deleted file mode 100644 index 0245a915c6..0000000000 --- a/ver/us/asm/nonmatchings/npc/bind_npc_aux.s +++ /dev/null @@ -1,61 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel bind_npc_aux -/* 19F50 8003EB50 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 19F54 8003EB54 AFB3001C */ sw $s3, 0x1c($sp) -/* 19F58 8003EB58 0080982D */ daddu $s3, $a0, $zero -/* 19F5C 8003EB5C AFB40020 */ sw $s4, 0x20($sp) -/* 19F60 8003EB60 00A0A02D */ daddu $s4, $a1, $zero -/* 19F64 8003EB64 AFB20018 */ sw $s2, 0x18($sp) -/* 19F68 8003EB68 3C12800B */ lui $s2, %hi(gCurrentEncounter) -/* 19F6C 8003EB6C 26520F10 */ addiu $s2, $s2, %lo(gCurrentEncounter) -/* 19F70 8003EB70 AFBF0024 */ sw $ra, 0x24($sp) -/* 19F74 8003EB74 AFB10014 */ sw $s1, 0x14($sp) -/* 19F78 8003EB78 AFB00010 */ sw $s0, 0x10($sp) -/* 19F7C 8003EB7C 8242001C */ lb $v0, 0x1c($s2) -/* 19F80 8003EB80 1840001E */ blez $v0, .L8003EBFC -/* 19F84 8003EB84 0000802D */ daddu $s0, $zero, $zero -/* 19F88 8003EB88 0240882D */ daddu $s1, $s2, $zero -.L8003EB8C: -/* 19F8C 8003EB8C 8E260028 */ lw $a2, 0x28($s1) -/* 19F90 8003EB90 50C00015 */ beql $a2, $zero, .L8003EBE8 -/* 19F94 8003EB94 26310004 */ addiu $s1, $s1, 4 -/* 19F98 8003EB98 8CC20000 */ lw $v0, ($a2) -/* 19F9C 8003EB9C 18400011 */ blez $v0, .L8003EBE4 -/* 19FA0 8003EBA0 0000282D */ daddu $a1, $zero, $zero -/* 19FA4 8003EBA4 00C0182D */ daddu $v1, $a2, $zero -.L8003EBA8: -/* 19FA8 8003EBA8 8C640004 */ lw $a0, 4($v1) -/* 19FAC 8003EBAC 10800008 */ beqz $a0, .L8003EBD0 -/* 19FB0 8003EBB0 00000000 */ nop -/* 19FB4 8003EBB4 84820008 */ lh $v0, 8($a0) -/* 19FB8 8003EBB8 14530005 */ bne $v0, $s3, .L8003EBD0 -/* 19FBC 8003EBBC 00000000 */ nop -/* 19FC0 8003EBC0 0C00FA6D */ jal bind_enemy_aux -/* 19FC4 8003EBC4 0280282D */ daddu $a1, $s4, $zero -/* 19FC8 8003EBC8 0800FAFA */ j .L8003EBE8 -/* 19FCC 8003EBCC 26310004 */ addiu $s1, $s1, 4 -.L8003EBD0: -/* 19FD0 8003EBD0 8CC20000 */ lw $v0, ($a2) -/* 19FD4 8003EBD4 24A50001 */ addiu $a1, $a1, 1 -/* 19FD8 8003EBD8 00A2102A */ slt $v0, $a1, $v0 -/* 19FDC 8003EBDC 1440FFF2 */ bnez $v0, .L8003EBA8 -/* 19FE0 8003EBE0 24630004 */ addiu $v1, $v1, 4 -.L8003EBE4: -/* 19FE4 8003EBE4 26310004 */ addiu $s1, $s1, 4 -.L8003EBE8: -/* 19FE8 8003EBE8 8242001C */ lb $v0, 0x1c($s2) -/* 19FEC 8003EBEC 26100001 */ addiu $s0, $s0, 1 -/* 19FF0 8003EBF0 0202102A */ slt $v0, $s0, $v0 -/* 19FF4 8003EBF4 1440FFE5 */ bnez $v0, .L8003EB8C -/* 19FF8 8003EBF8 00000000 */ nop -.L8003EBFC: -/* 19FFC 8003EBFC 8FBF0024 */ lw $ra, 0x24($sp) -/* 1A000 8003EC00 8FB40020 */ lw $s4, 0x20($sp) -/* 1A004 8003EC04 8FB3001C */ lw $s3, 0x1c($sp) -/* 1A008 8003EC08 8FB20018 */ lw $s2, 0x18($sp) -/* 1A00C 8003EC0C 8FB10014 */ lw $s1, 0x14($sp) -/* 1A010 8003EC10 8FB00010 */ lw $s0, 0x10($sp) -/* 1A014 8003EC14 03E00008 */ jr $ra -/* 1A018 8003EC18 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/bind_npc_interact.s b/ver/us/asm/nonmatchings/npc/bind_npc_interact.s deleted file mode 100644 index e113468b00..0000000000 --- a/ver/us/asm/nonmatchings/npc/bind_npc_interact.s +++ /dev/null @@ -1,61 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel bind_npc_interact -/* 1A01C 8003EC1C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 1A020 8003EC20 AFB3001C */ sw $s3, 0x1c($sp) -/* 1A024 8003EC24 0080982D */ daddu $s3, $a0, $zero -/* 1A028 8003EC28 AFB40020 */ sw $s4, 0x20($sp) -/* 1A02C 8003EC2C 00A0A02D */ daddu $s4, $a1, $zero -/* 1A030 8003EC30 AFB20018 */ sw $s2, 0x18($sp) -/* 1A034 8003EC34 3C12800B */ lui $s2, %hi(gCurrentEncounter) -/* 1A038 8003EC38 26520F10 */ addiu $s2, $s2, %lo(gCurrentEncounter) -/* 1A03C 8003EC3C AFBF0024 */ sw $ra, 0x24($sp) -/* 1A040 8003EC40 AFB10014 */ sw $s1, 0x14($sp) -/* 1A044 8003EC44 AFB00010 */ sw $s0, 0x10($sp) -/* 1A048 8003EC48 8242001C */ lb $v0, 0x1c($s2) -/* 1A04C 8003EC4C 1840001E */ blez $v0, .L8003ECC8 -/* 1A050 8003EC50 0000802D */ daddu $s0, $zero, $zero -/* 1A054 8003EC54 0240882D */ daddu $s1, $s2, $zero -.L8003EC58: -/* 1A058 8003EC58 8E260028 */ lw $a2, 0x28($s1) -/* 1A05C 8003EC5C 50C00015 */ beql $a2, $zero, .L8003ECB4 -/* 1A060 8003EC60 26310004 */ addiu $s1, $s1, 4 -/* 1A064 8003EC64 8CC20000 */ lw $v0, ($a2) -/* 1A068 8003EC68 18400011 */ blez $v0, .L8003ECB0 -/* 1A06C 8003EC6C 0000282D */ daddu $a1, $zero, $zero -/* 1A070 8003EC70 00C0182D */ daddu $v1, $a2, $zero -.L8003EC74: -/* 1A074 8003EC74 8C640004 */ lw $a0, 4($v1) -/* 1A078 8003EC78 10800008 */ beqz $a0, .L8003EC9C -/* 1A07C 8003EC7C 00000000 */ nop -/* 1A080 8003EC80 84820008 */ lh $v0, 8($a0) -/* 1A084 8003EC84 14530005 */ bne $v0, $s3, .L8003EC9C -/* 1A088 8003EC88 00000000 */ nop -/* 1A08C 8003EC8C 0C00FA87 */ jal bind_enemy_interact -/* 1A090 8003EC90 0280282D */ daddu $a1, $s4, $zero -/* 1A094 8003EC94 0800FB2D */ j .L8003ECB4 -/* 1A098 8003EC98 26310004 */ addiu $s1, $s1, 4 -.L8003EC9C: -/* 1A09C 8003EC9C 8CC20000 */ lw $v0, ($a2) -/* 1A0A0 8003ECA0 24A50001 */ addiu $a1, $a1, 1 -/* 1A0A4 8003ECA4 00A2102A */ slt $v0, $a1, $v0 -/* 1A0A8 8003ECA8 1440FFF2 */ bnez $v0, .L8003EC74 -/* 1A0AC 8003ECAC 24630004 */ addiu $v1, $v1, 4 -.L8003ECB0: -/* 1A0B0 8003ECB0 26310004 */ addiu $s1, $s1, 4 -.L8003ECB4: -/* 1A0B4 8003ECB4 8242001C */ lb $v0, 0x1c($s2) -/* 1A0B8 8003ECB8 26100001 */ addiu $s0, $s0, 1 -/* 1A0BC 8003ECBC 0202102A */ slt $v0, $s0, $v0 -/* 1A0C0 8003ECC0 1440FFE5 */ bnez $v0, .L8003EC58 -/* 1A0C4 8003ECC4 00000000 */ nop -.L8003ECC8: -/* 1A0C8 8003ECC8 8FBF0024 */ lw $ra, 0x24($sp) -/* 1A0CC 8003ECCC 8FB40020 */ lw $s4, 0x20($sp) -/* 1A0D0 8003ECD0 8FB3001C */ lw $s3, 0x1c($sp) -/* 1A0D4 8003ECD4 8FB20018 */ lw $s2, 0x18($sp) -/* 1A0D8 8003ECD8 8FB10014 */ lw $s1, 0x14($sp) -/* 1A0DC 8003ECDC 8FB00010 */ lw $s0, 0x10($sp) -/* 1A0E0 8003ECE0 03E00008 */ jr $ra -/* 1A0E4 8003ECE4 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/func_8003B184.s b/ver/us/asm/nonmatchings/npc/func_8003B184.s deleted file mode 100644 index ad802aebc8..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B184.s +++ /dev/null @@ -1,9 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B184 -/* 16584 8003B184 24020001 */ addiu $v0, $zero, 1 -/* 16588 8003B188 3C01800A */ lui $at, %hi(D_800A0B94) -/* 1658C 8003B18C A0220B94 */ sb $v0, %lo(D_800A0B94)($at) -/* 16590 8003B190 03E00008 */ jr $ra -/* 16594 8003B194 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/npc/func_8003B198.s b/ver/us/asm/nonmatchings/npc/func_8003B198.s deleted file mode 100644 index b6f8473bbb..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B198.s +++ /dev/null @@ -1,8 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B198 -/* 16598 8003B198 3C01800A */ lui $at, %hi(D_800A0B94) -/* 1659C 8003B19C A0200B94 */ sb $zero, %lo(D_800A0B94)($at) -/* 165A0 8003B1A0 03E00008 */ jr $ra -/* 165A4 8003B1A4 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/npc/func_8003B1B0.s b/ver/us/asm/nonmatchings/npc/func_8003B1B0.s deleted file mode 100644 index 249550b0ea..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B1B0.s +++ /dev/null @@ -1,113 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B1B0 -/* 165B0 8003B1B0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 165B4 8003B1B4 AFB20018 */ sw $s2, 0x18($sp) -/* 165B8 8003B1B8 0000902D */ daddu $s2, $zero, $zero -/* 165BC 8003B1BC AFB40020 */ sw $s4, 0x20($sp) -/* 165C0 8003B1C0 3C144000 */ lui $s4, 0x4000 -/* 165C4 8003B1C4 AFB3001C */ sw $s3, 0x1c($sp) -/* 165C8 8003B1C8 3C130100 */ lui $s3, 0x100 -/* 165CC 8003B1CC AFBF0024 */ sw $ra, 0x24($sp) -/* 165D0 8003B1D0 AFB10014 */ sw $s1, 0x14($sp) -/* 165D4 8003B1D4 AFB00010 */ sw $s0, 0x10($sp) -.L8003B1D8: -/* 165D8 8003B1D8 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr) -/* 165DC 8003B1DC 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1) -/* 165E0 8003B1E0 00121080 */ sll $v0, $s2, 2 -/* 165E4 8003B1E4 00431021 */ addu $v0, $v0, $v1 -/* 165E8 8003B1E8 8C510000 */ lw $s1, ($v0) -/* 165EC 8003B1EC 52200049 */ beql $s1, $zero, .L8003B314 -/* 165F0 8003B1F0 26520001 */ addiu $s2, $s2, 1 -/* 165F4 8003B1F4 8E230000 */ lw $v1, ($s1) -/* 165F8 8003B1F8 50600046 */ beql $v1, $zero, .L8003B314 -/* 165FC 8003B1FC 26520001 */ addiu $s2, $s2, 1 -/* 16600 8003B200 00741024 */ and $v0, $v1, $s4 -/* 16604 8003B204 54400043 */ bnel $v0, $zero, .L8003B314 -/* 16608 8003B208 26520001 */ addiu $s2, $s2, 1 -/* 1660C 8003B20C 00731024 */ and $v0, $v1, $s3 -/* 16610 8003B210 14400010 */ bnez $v0, .L8003B254 -/* 16614 8003B214 00741024 */ and $v0, $v1, $s4 -/* 16618 8003B218 3C020400 */ lui $v0, 0x400 -/* 1661C 8003B21C 00621024 */ and $v0, $v1, $v0 -/* 16620 8003B220 14400004 */ bnez $v0, .L8003B234 -/* 16624 8003B224 3C048000 */ lui $a0, 0x8000 -/* 16628 8003B228 8E240028 */ lw $a0, 0x28($s1) -/* 1662C 8003B22C 0800EC90 */ j .L8003B240 -/* 16630 8003B230 8E2500B0 */ lw $a1, 0xb0($s1) -.L8003B234: -/* 16634 8003B234 8E220028 */ lw $v0, 0x28($s1) -/* 16638 8003B238 8E2500B0 */ lw $a1, 0xb0($s1) -/* 1663C 8003B23C 00442025 */ or $a0, $v0, $a0 -.L8003B240: -/* 16640 8003B240 0C0B783B */ jal func_802DE0EC -/* 16644 8003B244 00000000 */ nop -/* 16648 8003B248 AE220024 */ sw $v0, 0x24($s1) -/* 1664C 8003B24C 8E230000 */ lw $v1, ($s1) -/* 16650 8003B250 00741024 */ and $v0, $v1, $s4 -.L8003B254: -/* 16654 8003B254 5440002F */ bnel $v0, $zero, .L8003B314 -/* 16658 8003B258 26520001 */ addiu $s2, $s2, 1 -/* 1665C 8003B25C 00731024 */ and $v0, $v1, $s3 -/* 16660 8003B260 1440001A */ bnez $v0, .L8003B2CC -/* 16664 8003B264 00000000 */ nop -/* 16668 8003B268 822200B4 */ lb $v0, 0xb4($s1) -/* 1666C 8003B26C 10400017 */ beqz $v0, .L8003B2CC -/* 16670 8003B270 00000000 */ nop -/* 16674 8003B274 0C0B7A90 */ jal func_802DEA40 -/* 16678 8003B278 96240028 */ lhu $a0, 0x28($s1) -/* 1667C 8003B27C AE2200C4 */ sw $v0, 0xc4($s1) -/* 16680 8003B280 0040202D */ daddu $a0, $v0, $zero -/* 16684 8003B284 A22000C1 */ sb $zero, 0xc1($s1) -/* 16688 8003B288 8C830000 */ lw $v1, ($a0) -/* 1668C 8003B28C 2402FFFF */ addiu $v0, $zero, -1 -/* 16690 8003B290 1062000B */ beq $v1, $v0, .L8003B2C0 -/* 16694 8003B294 0080182D */ daddu $v1, $a0, $zero -/* 16698 8003B298 0040202D */ daddu $a0, $v0, $zero -.L8003B29C: -/* 1669C 8003B29C 922200C1 */ lbu $v0, 0xc1($s1) -/* 166A0 8003B2A0 24420001 */ addiu $v0, $v0, 1 -/* 166A4 8003B2A4 A22200C1 */ sb $v0, 0xc1($s1) -/* 166A8 8003B2A8 00021600 */ sll $v0, $v0, 0x18 -/* 166AC 8003B2AC 00021583 */ sra $v0, $v0, 0x16 -/* 166B0 8003B2B0 00431021 */ addu $v0, $v0, $v1 -/* 166B4 8003B2B4 8C420000 */ lw $v0, ($v0) -/* 166B8 8003B2B8 1444FFF8 */ bne $v0, $a0, .L8003B29C -/* 166BC 8003B2BC 00000000 */ nop -.L8003B2C0: -/* 166C0 8003B2C0 0C0B7A9B */ jal func_802DEA6C -/* 166C4 8003B2C4 96240028 */ lhu $a0, 0x28($s1) -/* 166C8 8003B2C8 A22200C0 */ sb $v0, 0xc0($s1) -.L8003B2CC: -/* 166CC 8003B2CC 8E230000 */ lw $v1, ($s1) -/* 166D0 8003B2D0 00741024 */ and $v0, $v1, $s4 -/* 166D4 8003B2D4 5440000F */ bnel $v0, $zero, .L8003B314 -/* 166D8 8003B2D8 26520001 */ addiu $s2, $s2, 1 -/* 166DC 8003B2DC 00731024 */ and $v0, $v1, $s3 -/* 166E0 8003B2E0 5440000C */ bnel $v0, $zero, .L8003B314 -/* 166E4 8003B2E4 26520001 */ addiu $s2, $s2, 1 -/* 166E8 8003B2E8 0000802D */ daddu $s0, $zero, $zero -/* 166EC 8003B2EC 0220202D */ daddu $a0, $s1, $zero -.L8003B2F0: -/* 166F0 8003B2F0 0C00F187 */ jal func_8003C61C -/* 166F4 8003B2F4 0200282D */ daddu $a1, $s0, $zero -/* 166F8 8003B2F8 26100001 */ addiu $s0, $s0, 1 -/* 166FC 8003B2FC 2A020002 */ slti $v0, $s0, 2 -/* 16700 8003B300 1440FFFB */ bnez $v0, .L8003B2F0 -/* 16704 8003B304 0220202D */ daddu $a0, $s1, $zero -/* 16708 8003B308 0C00F4EF */ jal func_8003D3BC -/* 1670C 8003B30C 0220202D */ daddu $a0, $s1, $zero -/* 16710 8003B310 26520001 */ addiu $s2, $s2, 1 -.L8003B314: -/* 16714 8003B314 2A420040 */ slti $v0, $s2, 0x40 -/* 16718 8003B318 1440FFAF */ bnez $v0, .L8003B1D8 -/* 1671C 8003B31C 00000000 */ nop -/* 16720 8003B320 8FBF0024 */ lw $ra, 0x24($sp) -/* 16724 8003B324 8FB40020 */ lw $s4, 0x20($sp) -/* 16728 8003B328 8FB3001C */ lw $s3, 0x1c($sp) -/* 1672C 8003B32C 8FB20018 */ lw $s2, 0x18($sp) -/* 16730 8003B330 8FB10014 */ lw $s1, 0x14($sp) -/* 16734 8003B334 8FB00010 */ lw $s0, 0x10($sp) -/* 16738 8003B338 03E00008 */ jr $ra -/* 1673C 8003B33C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/func_8003B3D0.s b/ver/us/asm/nonmatchings/npc/func_8003B3D0.s deleted file mode 100644 index 148b934269..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B3D0.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B3D0 -/* 167D0 8003B3D0 808200B4 */ lb $v0, 0xb4($a0) -/* 167D4 8003B3D4 908300B4 */ lbu $v1, 0xb4($a0) -/* 167D8 8003B3D8 10450005 */ beq $v0, $a1, .L8003B3F0 -/* 167DC 8003B3DC 24020001 */ addiu $v0, $zero, 1 -/* 167E0 8003B3E0 A08300B5 */ sb $v1, 0xb5($a0) -/* 167E4 8003B3E4 A08500B4 */ sb $a1, 0xb4($a0) -/* 167E8 8003B3E8 A08000B7 */ sb $zero, 0xb7($a0) -/* 167EC 8003B3EC A08200B6 */ sb $v0, 0xb6($a0) -.L8003B3F0: -/* 167F0 8003B3F0 03E00008 */ jr $ra -/* 167F4 8003B3F4 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/npc/func_8003B3F8.s b/ver/us/asm/nonmatchings/npc/func_8003B3F8.s deleted file mode 100644 index dd688b7879..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B3F8.s +++ /dev/null @@ -1,15 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B3F8 -/* 167F8 8003B3F8 808200B4 */ lb $v0, 0xb4($a0) -/* 167FC 8003B3FC 908300B4 */ lbu $v1, 0xb4($a0) -/* 16800 8003B400 10450005 */ beq $v0, $a1, .L8003B418 -/* 16804 8003B404 2402FFFF */ addiu $v0, $zero, -1 -/* 16808 8003B408 A08300B5 */ sb $v1, 0xb5($a0) -/* 1680C 8003B40C A08500B4 */ sb $a1, 0xb4($a0) -/* 16810 8003B410 A08000B7 */ sb $zero, 0xb7($a0) -/* 16814 8003B414 A08200B6 */ sb $v0, 0xb6($a0) -.L8003B418: -/* 16818 8003B418 03E00008 */ jr $ra -/* 1681C 8003B41C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/npc/func_8003B420.s b/ver/us/asm/nonmatchings/npc/func_8003B420.s deleted file mode 100644 index 5e2a4ca684..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B420.s +++ /dev/null @@ -1,16 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B420 -/* 16820 8003B420 808200B5 */ lb $v0, 0xb5($a0) -/* 16824 8003B424 908300B5 */ lbu $v1, 0xb5($a0) -/* 16828 8003B428 14400003 */ bnez $v0, .L8003B438 -/* 1682C 8003B42C 24020001 */ addiu $v0, $zero, 1 -/* 16830 8003B430 03E00008 */ jr $ra -/* 16834 8003B434 A08000B4 */ sb $zero, 0xb4($a0) -.L8003B438: -/* 16838 8003B438 A08300B4 */ sb $v1, 0xb4($a0) -/* 1683C 8003B43C A08000B5 */ sb $zero, 0xb5($a0) -/* 16840 8003B440 A08000B7 */ sb $zero, 0xb7($a0) -/* 16844 8003B444 03E00008 */ jr $ra -/* 16848 8003B448 A08200B6 */ sb $v0, 0xb6($a0) diff --git a/ver/us/asm/nonmatchings/npc/func_8003B500.s b/ver/us/asm/nonmatchings/npc/func_8003B500.s deleted file mode 100644 index 5ad690e60b..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003B500.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003B500 -/* 16900 8003B500 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 16904 8003B504 AFBF0018 */ sw $ra, 0x18($sp) -/* 16908 8003B508 808200B6 */ lb $v0, 0xb6($a0) -/* 1690C 8003B50C 10400007 */ beqz $v0, .L8003B52C -/* 16910 8003B510 00000000 */ nop -/* 16914 8003B514 3C013F80 */ lui $at, 0x3f80 -/* 16918 8003B518 44810000 */ mtc1 $at, $f0 -/* 1691C 8003B51C AC800318 */ sw $zero, 0x318($a0) -/* 16920 8003B520 AC80031C */ sw $zero, 0x31c($a0) -/* 16924 8003B524 A08000B6 */ sb $zero, 0xb6($a0) -/* 16928 8003B528 E4800320 */ swc1 $f0, 0x320($a0) -.L8003B52C: -/* 1692C 8003B52C 8C820000 */ lw $v0, ($a0) -/* 16930 8003B530 3C034000 */ lui $v1, 0x4000 -/* 16934 8003B534 00431024 */ and $v0, $v0, $v1 -/* 16938 8003B538 54400016 */ bnel $v0, $zero, .L8003B594 -/* 1693C 8003B53C AFA60010 */ sw $a2, 0x10($sp) -/* 16940 8003B540 908300AC */ lbu $v1, 0xac($a0) -/* 16944 8003B544 908200AD */ lbu $v0, 0xad($a0) -/* 16948 8003B548 00620018 */ mult $v1, $v0 -/* 1694C 8003B54C 00001812 */ mflo $v1 -/* 16950 8003B550 3C028080 */ lui $v0, 0x8080 -/* 16954 8003B554 34428081 */ ori $v0, $v0, 0x8081 -/* 16958 8003B558 00620018 */ mult $v1, $v0 -/* 1695C 8003B55C 8C820024 */ lw $v0, 0x24($a0) -/* 16960 8003B560 0000382D */ daddu $a3, $zero, $zero -/* 16964 8003B564 AFA60010 */ sw $a2, 0x10($sp) -/* 16968 8003B568 00004810 */ mfhi $t1 -/* 1696C 8003B56C 01233021 */ addu $a2, $t1, $v1 -/* 16970 8003B570 000631C3 */ sra $a2, $a2, 7 -/* 16974 8003B574 00031FC3 */ sra $v1, $v1, 0x1f -/* 16978 8003B578 00C33023 */ subu $a2, $a2, $v1 -/* 1697C 8003B57C 28C400FF */ slti $a0, $a2, 0xff -/* 16980 8003B580 000427C0 */ sll $a0, $a0, 0x1f -/* 16984 8003B584 0C0B78F6 */ jal func_802DE3D8 -/* 16988 8003B588 00442025 */ or $a0, $v0, $a0 -/* 1698C 8003B58C 0800ED6A */ j .L8003B5A8 -/* 16990 8003B590 00000000 */ nop -.L8003B594: -/* 16994 8003B594 3C044000 */ lui $a0, 0x4000 -/* 16998 8003B598 34840001 */ ori $a0, $a0, 1 -/* 1699C 8003B59C 0000302D */ daddu $a2, $zero, $zero -/* 169A0 8003B5A0 0C0B7710 */ jal render_sprite -/* 169A4 8003B5A4 00C0382D */ daddu $a3, $a2, $zero -.L8003B5A8: -/* 169A8 8003B5A8 8FBF0018 */ lw $ra, 0x18($sp) -/* 169AC 8003B5AC 03E00008 */ jr $ra -/* 169B0 8003B5B0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C3D8.s b/ver/us/asm/nonmatchings/npc/func_8003C3D8.s deleted file mode 100644 index 5c8371d420..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C3D8.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C3D8 -/* 177D8 8003C3D8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 177DC 8003C3DC AFB00010 */ sw $s0, 0x10($sp) -/* 177E0 8003C3E0 0080802D */ daddu $s0, $a0, $zero -/* 177E4 8003C3E4 AFB10014 */ sw $s1, 0x14($sp) -/* 177E8 8003C3E8 00A0882D */ daddu $s1, $a1, $zero -/* 177EC 8003C3EC AFB20018 */ sw $s2, 0x18($sp) -/* 177F0 8003C3F0 AFBF001C */ sw $ra, 0x1c($sp) -/* 177F4 8003C3F4 0C00F14F */ jal func_8003C53C -/* 177F8 8003C3F8 00C0902D */ daddu $s2, $a2, $zero -/* 177FC 8003C3FC 02118021 */ addu $s0, $s0, $s1 -/* 17800 8003C400 24020001 */ addiu $v0, $zero, 1 -/* 17804 8003C404 A212032C */ sb $s2, 0x32c($s0) -/* 17808 8003C408 A202032E */ sb $v0, 0x32e($s0) -/* 1780C 8003C40C A2000330 */ sb $zero, 0x330($s0) -/* 17810 8003C410 8FBF001C */ lw $ra, 0x1c($sp) -/* 17814 8003C414 8FB20018 */ lw $s2, 0x18($sp) -/* 17818 8003C418 8FB10014 */ lw $s1, 0x14($sp) -/* 1781C 8003C41C 8FB00010 */ lw $s0, 0x10($sp) -/* 17820 8003C420 03E00008 */ jr $ra -/* 17824 8003C424 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C428.s b/ver/us/asm/nonmatchings/npc/func_8003C428.s deleted file mode 100644 index d02657e2ba..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C428.s +++ /dev/null @@ -1,11 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C428 -/* 17828 8003C428 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 1782C 8003C42C AFBF0010 */ sw $ra, 0x10($sp) -/* 17830 8003C430 0C00F14F */ jal func_8003C53C -/* 17834 8003C434 00000000 */ nop -/* 17838 8003C438 8FBF0010 */ lw $ra, 0x10($sp) -/* 1783C 8003C43C 03E00008 */ jr $ra -/* 17840 8003C440 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C53C.s b/ver/us/asm/nonmatchings/npc/func_8003C53C.s deleted file mode 100644 index 2e8cdbc4fb..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C53C.s +++ /dev/null @@ -1,76 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -glabel jtbl_80098500 -.word L8003C57C_1797C, L8003C590_17990, L8003C5A4_179A4, L8003C5B8_179B8, L8003C5CC_179CC, L8003C5E0_179E0, L8003C5F4_179F4, 0 - -.section .text - -glabel func_8003C53C -/* 1793C 8003C53C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 17940 8003C540 AFB00010 */ sw $s0, 0x10($sp) -/* 17944 8003C544 0080802D */ daddu $s0, $a0, $zero -/* 17948 8003C548 AFB10014 */ sw $s1, 0x14($sp) -/* 1794C 8003C54C 00A0882D */ daddu $s1, $a1, $zero -/* 17950 8003C550 02111021 */ addu $v0, $s0, $s1 -/* 17954 8003C554 AFBF0018 */ sw $ra, 0x18($sp) -/* 17958 8003C558 8043032C */ lb $v1, 0x32c($v0) -/* 1795C 8003C55C 2C620007 */ sltiu $v0, $v1, 7 -/* 17960 8003C560 10400027 */ beqz $v0, .L8003C600 -/* 17964 8003C564 00031080 */ sll $v0, $v1, 2 -/* 17968 8003C568 3C01800A */ lui $at, %hi(jtbl_80098500) -/* 1796C 8003C56C 00220821 */ addu $at, $at, $v0 -/* 17970 8003C570 8C228500 */ lw $v0, %lo(jtbl_80098500)($at) -/* 17974 8003C574 00400008 */ jr $v0 -/* 17978 8003C578 00000000 */ nop -glabel L8003C57C_1797C -/* 1797C 8003C57C 0200202D */ daddu $a0, $s0, $zero -/* 17980 8003C580 0C00F198 */ jal func_8003C660 -/* 17984 8003C584 0220282D */ daddu $a1, $s1, $zero -/* 17988 8003C588 0800F181 */ j .L8003C604 -/* 1798C 8003C58C 02111021 */ addu $v0, $s0, $s1 -glabel L8003C590_17990 -/* 17990 8003C590 0200202D */ daddu $a0, $s0, $zero -/* 17994 8003C594 0C00F1E3 */ jal func_8003C78C -/* 17998 8003C598 0220282D */ daddu $a1, $s1, $zero -/* 1799C 8003C59C 0800F181 */ j .L8003C604 -/* 179A0 8003C5A0 02111021 */ addu $v0, $s0, $s1 -glabel L8003C5A4_179A4 -/* 179A4 8003C5A4 0200202D */ daddu $a0, $s0, $zero -/* 179A8 8003C5A8 0C00F22B */ jal func_8003C8AC -/* 179AC 8003C5AC 0220282D */ daddu $a1, $s1, $zero -/* 179B0 8003C5B0 0800F181 */ j .L8003C604 -/* 179B4 8003C5B4 02111021 */ addu $v0, $s0, $s1 -glabel L8003C5B8_179B8 -/* 179B8 8003C5B8 0200202D */ daddu $a0, $s0, $zero -/* 179BC 8003C5BC 0C00F261 */ jal func_8003C984 -/* 179C0 8003C5C0 0220282D */ daddu $a1, $s1, $zero -/* 179C4 8003C5C4 0800F181 */ j .L8003C604 -/* 179C8 8003C5C8 02111021 */ addu $v0, $s0, $s1 -glabel L8003C5CC_179CC -/* 179CC 8003C5CC 0200202D */ daddu $a0, $s0, $zero -/* 179D0 8003C5D0 0C00F2C8 */ jal func_8003CB20 -/* 179D4 8003C5D4 0220282D */ daddu $a1, $s1, $zero -/* 179D8 8003C5D8 0800F181 */ j .L8003C604 -/* 179DC 8003C5DC 02111021 */ addu $v0, $s0, $s1 -glabel L8003C5E0_179E0 -/* 179E0 8003C5E0 0200202D */ daddu $a0, $s0, $zero -/* 179E4 8003C5E4 0C00F323 */ jal func_8003CC8C -/* 179E8 8003C5E8 0220282D */ daddu $a1, $s1, $zero -/* 179EC 8003C5EC 0800F181 */ j .L8003C604 -/* 179F0 8003C5F0 02111021 */ addu $v0, $s0, $s1 -glabel L8003C5F4_179F4 -/* 179F4 8003C5F4 0200202D */ daddu $a0, $s0, $zero -/* 179F8 8003C5F8 0C00F3E8 */ jal func_8003CFA0 -/* 179FC 8003C5FC 0220282D */ daddu $a1, $s1, $zero -.L8003C600: -/* 17A00 8003C600 02111021 */ addu $v0, $s0, $s1 -.L8003C604: -/* 17A04 8003C604 A040032C */ sb $zero, 0x32c($v0) -/* 17A08 8003C608 8FBF0018 */ lw $ra, 0x18($sp) -/* 17A0C 8003C60C 8FB10014 */ lw $s1, 0x14($sp) -/* 17A10 8003C610 8FB00010 */ lw $s0, 0x10($sp) -/* 17A14 8003C614 03E00008 */ jr $ra -/* 17A18 8003C618 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C61C.s b/ver/us/asm/nonmatchings/npc/func_8003C61C.s deleted file mode 100644 index 86d9007db3..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C61C.s +++ /dev/null @@ -1,20 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C61C -/* 17A1C 8003C61C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 17A20 8003C620 00851021 */ addu $v0, $a0, $a1 -/* 17A24 8003C624 AFBF0010 */ sw $ra, 0x10($sp) -/* 17A28 8003C628 8043032C */ lb $v1, 0x32c($v0) -/* 17A2C 8003C62C 04600007 */ bltz $v1, .L8003C64C -/* 17A30 8003C630 28620006 */ slti $v0, $v1, 6 -/* 17A34 8003C634 14400005 */ bnez $v0, .L8003C64C -/* 17A38 8003C638 24020006 */ addiu $v0, $zero, 6 -/* 17A3C 8003C63C 14620003 */ bne $v1, $v0, .L8003C64C -/* 17A40 8003C640 00000000 */ nop -/* 17A44 8003C644 0C00F3EA */ jal func_8003CFA8 -/* 17A48 8003C648 00000000 */ nop -.L8003C64C: -/* 17A4C 8003C64C 8FBF0010 */ lw $ra, 0x10($sp) -/* 17A50 8003C650 03E00008 */ jr $ra -/* 17A54 8003C654 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C78C.s b/ver/us/asm/nonmatchings/npc/func_8003C78C.s deleted file mode 100644 index d9cd7fae49..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C78C.s +++ /dev/null @@ -1,11 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C78C -/* 17B8C 8003C78C 00052880 */ sll $a1, $a1, 2 -/* 17B90 8003C790 00852021 */ addu $a0, $a0, $a1 -/* 17B94 8003C794 8C820324 */ lw $v0, 0x324($a0) -/* 17B98 8003C798 8C43000C */ lw $v1, 0xc($v0) -/* 17B9C 8003C79C 24020005 */ addiu $v0, $zero, 5 -/* 17BA0 8003C7A0 03E00008 */ jr $ra -/* 17BA4 8003C7A4 AC62002C */ sw $v0, 0x2c($v1) diff --git a/ver/us/asm/nonmatchings/npc/func_8003C7A8.s b/ver/us/asm/nonmatchings/npc/func_8003C7A8.s deleted file mode 100644 index 999ac52c4e..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C7A8.s +++ /dev/null @@ -1,75 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C7A8 -/* 17BA8 8003C7A8 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* 17BAC 8003C7AC AFB00020 */ sw $s0, 0x20($sp) -/* 17BB0 8003C7B0 0080802D */ daddu $s0, $a0, $zero -/* 17BB4 8003C7B4 AFB10024 */ sw $s1, 0x24($sp) -/* 17BB8 8003C7B8 00A0882D */ daddu $s1, $a1, $zero -/* 17BBC 8003C7BC 02112021 */ addu $a0, $s0, $s1 -/* 17BC0 8003C7C0 AFBF0028 */ sw $ra, 0x28($sp) -/* 17BC4 8003C7C4 80830330 */ lb $v1, 0x330($a0) -/* 17BC8 8003C7C8 10600005 */ beqz $v1, .L8003C7E0 -/* 17BCC 8003C7CC 24020001 */ addiu $v0, $zero, 1 -/* 17BD0 8003C7D0 10620029 */ beq $v1, $v0, .L8003C878 -/* 17BD4 8003C7D4 00111040 */ sll $v0, $s1, 1 -/* 17BD8 8003C7D8 0800F226 */ j .L8003C898 -/* 17BDC 8003C7DC 00000000 */ nop -.L8003C7E0: -/* 17BE0 8003C7E0 8602008A */ lh $v0, 0x8a($s0) -/* 17BE4 8003C7E4 2842005B */ slti $v0, $v0, 0x5b -/* 17BE8 8003C7E8 14400009 */ bnez $v0, .L8003C810 -/* 17BEC 8003C7EC 24020014 */ addiu $v0, $zero, 0x14 -/* 17BF0 8003C7F0 860300A8 */ lh $v1, 0xa8($s0) -/* 17BF4 8003C7F4 C606003C */ lwc1 $f6, 0x3c($s0) -/* 17BF8 8003C7F8 3C0140A0 */ lui $at, 0x40a0 -/* 17BFC 8003C7FC 44811000 */ mtc1 $at, $f2 -/* 17C00 8003C800 3C014234 */ lui $at, 0x4234 -/* 17C04 8003C804 44812000 */ mtc1 $at, $f4 -/* 17C08 8003C808 0800F20B */ j .L8003C82C -/* 17C0C 8003C80C AFA20018 */ sw $v0, 0x18($sp) -.L8003C810: -/* 17C10 8003C810 860300A8 */ lh $v1, 0xa8($s0) -/* 17C14 8003C814 C606003C */ lwc1 $f6, 0x3c($s0) -/* 17C18 8003C818 3C0140A0 */ lui $at, 0x40a0 -/* 17C1C 8003C81C 44811000 */ mtc1 $at, $f2 -/* 17C20 8003C820 3C01C234 */ lui $at, 0xc234 -/* 17C24 8003C824 44812000 */ mtc1 $at, $f4 -/* 17C28 8003C828 AFA20018 */ sw $v0, 0x18($sp) -.L8003C82C: -/* 17C2C 8003C82C 44830000 */ mtc1 $v1, $f0 -/* 17C30 8003C830 00000000 */ nop -/* 17C34 8003C834 46800020 */ cvt.s.w $f0, $f0 -/* 17C38 8003C838 46003180 */ add.s $f6, $f6, $f0 -/* 17C3C 8003C83C E7A20010 */ swc1 $f2, 0x10($sp) -/* 17C40 8003C840 E7A40014 */ swc1 $f4, 0x14($sp) -/* 17C44 8003C844 8E050038 */ lw $a1, 0x38($s0) -/* 17C48 8003C848 8E070040 */ lw $a3, 0x40($s0) -/* 17C4C 8003C84C 44063000 */ mfc1 $a2, $f6 -/* 17C50 8003C850 0C01C1E4 */ jal fx_sweat -/* 17C54 8003C854 0000202D */ daddu $a0, $zero, $zero -/* 17C58 8003C858 00111040 */ sll $v0, $s1, 1 -/* 17C5C 8003C85C 02021021 */ addu $v0, $s0, $v0 -/* 17C60 8003C860 2403000A */ addiu $v1, $zero, 0xa -/* 17C64 8003C864 A4430332 */ sh $v1, 0x332($v0) -/* 17C68 8003C868 02111821 */ addu $v1, $s0, $s1 -/* 17C6C 8003C86C 24020001 */ addiu $v0, $zero, 1 -/* 17C70 8003C870 0800F226 */ j .L8003C898 -/* 17C74 8003C874 A0620330 */ sb $v0, 0x330($v1) -.L8003C878: -/* 17C78 8003C878 02021821 */ addu $v1, $s0, $v0 -/* 17C7C 8003C87C 84620332 */ lh $v0, 0x332($v1) -/* 17C80 8003C880 94650332 */ lhu $a1, 0x332($v1) -/* 17C84 8003C884 10400003 */ beqz $v0, .L8003C894 -/* 17C88 8003C888 24A2FFFF */ addiu $v0, $a1, -1 -/* 17C8C 8003C88C 0800F226 */ j .L8003C898 -/* 17C90 8003C890 A4620332 */ sh $v0, 0x332($v1) -.L8003C894: -/* 17C94 8003C894 A0800330 */ sb $zero, 0x330($a0) -.L8003C898: -/* 17C98 8003C898 8FBF0028 */ lw $ra, 0x28($sp) -/* 17C9C 8003C89C 8FB10024 */ lw $s1, 0x24($sp) -/* 17CA0 8003C8A0 8FB00020 */ lw $s0, 0x20($sp) -/* 17CA4 8003C8A4 03E00008 */ jr $ra -/* 17CA8 8003C8A8 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C8B4.s b/ver/us/asm/nonmatchings/npc/func_8003C8B4.s deleted file mode 100644 index 0e43ef10a3..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C8B4.s +++ /dev/null @@ -1,59 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C8B4 -/* 17CB4 8003C8B4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 17CB8 8003C8B8 AFB00020 */ sw $s0, 0x20($sp) -/* 17CBC 8003C8BC 00858021 */ addu $s0, $a0, $a1 -/* 17CC0 8003C8C0 AFBF0024 */ sw $ra, 0x24($sp) -/* 17CC4 8003C8C4 82030330 */ lb $v1, 0x330($s0) -/* 17CC8 8003C8C8 10600005 */ beqz $v1, .L8003C8E0 -/* 17CCC 8003C8CC 24020001 */ addiu $v0, $zero, 1 -/* 17CD0 8003C8D0 1062001A */ beq $v1, $v0, .L8003C93C -/* 17CD4 8003C8D4 00051080 */ sll $v0, $a1, 2 -/* 17CD8 8003C8D8 0800F25D */ j .L8003C974 -/* 17CDC 8003C8DC 00000000 */ nop -.L8003C8E0: -/* 17CE0 8003C8E0 848300A8 */ lh $v1, 0xa8($a0) -/* 17CE4 8003C8E4 C482003C */ lwc1 $f2, 0x3c($a0) -/* 17CE8 8003C8E8 24020003 */ addiu $v0, $zero, 3 -/* 17CEC 8003C8EC AFA20014 */ sw $v0, 0x14($sp) -/* 17CF0 8003C8F0 00051080 */ sll $v0, $a1, 2 -/* 17CF4 8003C8F4 24420324 */ addiu $v0, $v0, 0x324 -/* 17CF8 8003C8F8 3C0141A0 */ lui $at, 0x41a0 -/* 17CFC 8003C8FC 44810000 */ mtc1 $at, $f0 -/* 17D00 8003C900 00821021 */ addu $v0, $a0, $v0 -/* 17D04 8003C904 AFA20018 */ sw $v0, 0x18($sp) -/* 17D08 8003C908 E7A00010 */ swc1 $f0, 0x10($sp) -/* 17D0C 8003C90C 44830000 */ mtc1 $v1, $f0 -/* 17D10 8003C910 00000000 */ nop -/* 17D14 8003C914 46800020 */ cvt.s.w $f0, $f0 -/* 17D18 8003C918 46001080 */ add.s $f2, $f2, $f0 -/* 17D1C 8003C91C 8C850038 */ lw $a1, 0x38($a0) -/* 17D20 8003C920 8C870040 */ lw $a3, 0x40($a0) -/* 17D24 8003C924 44061000 */ mfc1 $a2, $f2 -/* 17D28 8003C928 0C01C28C */ jal func_80070A30 -/* 17D2C 8003C92C 0000202D */ daddu $a0, $zero, $zero -/* 17D30 8003C930 24020001 */ addiu $v0, $zero, 1 -/* 17D34 8003C934 0800F25D */ j .L8003C974 -/* 17D38 8003C938 A2020330 */ sb $v0, 0x330($s0) -.L8003C93C: -/* 17D3C 8003C93C 00821021 */ addu $v0, $a0, $v0 -/* 17D40 8003C940 8C420324 */ lw $v0, 0x324($v0) -/* 17D44 8003C944 C4800038 */ lwc1 $f0, 0x38($a0) -/* 17D48 8003C948 8C43000C */ lw $v1, 0xc($v0) -/* 17D4C 8003C94C E4600004 */ swc1 $f0, 4($v1) -/* 17D50 8003C950 848200A8 */ lh $v0, 0xa8($a0) -/* 17D54 8003C954 C480003C */ lwc1 $f0, 0x3c($a0) -/* 17D58 8003C958 44821000 */ mtc1 $v0, $f2 -/* 17D5C 8003C95C 00000000 */ nop -/* 17D60 8003C960 468010A0 */ cvt.s.w $f2, $f2 -/* 17D64 8003C964 46020000 */ add.s $f0, $f0, $f2 -/* 17D68 8003C968 E4600008 */ swc1 $f0, 8($v1) -/* 17D6C 8003C96C C4800040 */ lwc1 $f0, 0x40($a0) -/* 17D70 8003C970 E460000C */ swc1 $f0, 0xc($v1) -.L8003C974: -/* 17D74 8003C974 8FBF0024 */ lw $ra, 0x24($sp) -/* 17D78 8003C978 8FB00020 */ lw $s0, 0x20($sp) -/* 17D7C 8003C97C 03E00008 */ jr $ra -/* 17D80 8003C980 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C984.s b/ver/us/asm/nonmatchings/npc/func_8003C984.s deleted file mode 100644 index 816525c95d..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C984.s +++ /dev/null @@ -1,13 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003C984 -/* 17D84 8003C984 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 17D88 8003C988 00052880 */ sll $a1, $a1, 2 -/* 17D8C 8003C98C 00852021 */ addu $a0, $a0, $a1 -/* 17D90 8003C990 AFBF0010 */ sw $ra, 0x10($sp) -/* 17D94 8003C994 0C016914 */ jal remove_effect -/* 17D98 8003C998 8C840324 */ lw $a0, 0x324($a0) -/* 17D9C 8003C99C 8FBF0010 */ lw $ra, 0x10($sp) -/* 17DA0 8003C9A0 03E00008 */ jr $ra -/* 17DA4 8003C9A4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/npc/func_8003C9A8.s b/ver/us/asm/nonmatchings/npc/func_8003C9A8.s deleted file mode 100644 index 0a5a058f24..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003C9A8.s +++ /dev/null @@ -1,117 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -glabel D_80098528 -.double 0.8 - -glabel D_80098530 -.double 0.20000000298023224 - -glabel D_80098538 -.double 0.8 - -glabel D_80098540 -.double 0.20000000298023224 - -.section .text - -glabel func_8003C9A8 -/* 17DA8 8003C9A8 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 17DAC 8003C9AC AFB00018 */ sw $s0, 0x18($sp) -/* 17DB0 8003C9B0 0080802D */ daddu $s0, $a0, $zero -/* 17DB4 8003C9B4 AFB1001C */ sw $s1, 0x1c($sp) -/* 17DB8 8003C9B8 00A0882D */ daddu $s1, $a1, $zero -/* 17DBC 8003C9BC AFB20020 */ sw $s2, 0x20($sp) -/* 17DC0 8003C9C0 02119021 */ addu $s2, $s0, $s1 -/* 17DC4 8003C9C4 AFBF0024 */ sw $ra, 0x24($sp) -/* 17DC8 8003C9C8 82430330 */ lb $v1, 0x330($s2) -/* 17DCC 8003C9CC 10600005 */ beqz $v1, .L8003C9E4 -/* 17DD0 8003C9D0 24020001 */ addiu $v0, $zero, 1 -/* 17DD4 8003C9D4 10620028 */ beq $v1, $v0, .L8003CA78 -/* 17DD8 8003C9D8 00111080 */ sll $v0, $s1, 2 -/* 17DDC 8003C9DC 0800F2C2 */ j .L8003CB08 -/* 17DE0 8003C9E0 00000000 */ nop -.L8003C9E4: -/* 17DE4 8003C9E4 860200A8 */ lh $v0, 0xa8($s0) -/* 17DE8 8003C9E8 3C013FE0 */ lui $at, 0x3fe0 -/* 17DEC 8003C9EC 44810800 */ mtc1 $at, $f1 -/* 17DF0 8003C9F0 44800000 */ mtc1 $zero, $f0 -/* 17DF4 8003C9F4 44822000 */ mtc1 $v0, $f4 -/* 17DF8 8003C9F8 00000000 */ nop -/* 17DFC 8003C9FC 46802121 */ cvt.d.w $f4, $f4 -/* 17E00 8003CA00 46202102 */ mul.d $f4, $f4, $f0 -/* 17E04 8003CA04 00000000 */ nop -/* 17E08 8003CA08 C6000054 */ lwc1 $f0, 0x54($s0) -/* 17E0C 8003CA0C 3C01800A */ lui $at, %hi(D_80098528) -/* 17E10 8003CA10 D4228528 */ ldc1 $f2, %lo(D_80098528)($at) -/* 17E14 8003CA14 46000021 */ cvt.d.s $f0, $f0 -/* 17E18 8003CA18 46220002 */ mul.d $f0, $f0, $f2 -/* 17E1C 8003CA1C 00000000 */ nop -/* 17E20 8003CA20 3C01800A */ lui $at, %hi(D_80098530) -/* 17E24 8003CA24 D4228530 */ ldc1 $f2, %lo(D_80098530)($at) -/* 17E28 8003CA28 46220000 */ add.d $f0, $f0, $f2 -/* 17E2C 8003CA2C C602003C */ lwc1 $f2, 0x3c($s0) -/* 17E30 8003CA30 2402FFFF */ addiu $v0, $zero, -1 -/* 17E34 8003CA34 AFA20014 */ sw $v0, 0x14($sp) -/* 17E38 8003CA38 460010A1 */ cvt.d.s $f2, $f2 -/* 17E3C 8003CA3C 46241080 */ add.d $f2, $f2, $f4 -/* 17E40 8003CA40 46200020 */ cvt.s.d $f0, $f0 -/* 17E44 8003CA44 E7A00010 */ swc1 $f0, 0x10($sp) -/* 17E48 8003CA48 8E050038 */ lw $a1, 0x38($s0) -/* 17E4C 8003CA4C 8E070040 */ lw $a3, 0x40($s0) -/* 17E50 8003CA50 462010A0 */ cvt.s.d $f2, $f2 -/* 17E54 8003CA54 44061000 */ mfc1 $a2, $f2 -/* 17E58 8003CA58 0C01C5D4 */ jal func_80071750 -/* 17E5C 8003CA5C 24040002 */ addiu $a0, $zero, 2 -/* 17E60 8003CA60 00111880 */ sll $v1, $s1, 2 -/* 17E64 8003CA64 02031821 */ addu $v1, $s0, $v1 -/* 17E68 8003CA68 AC620324 */ sw $v0, 0x324($v1) -/* 17E6C 8003CA6C 24020001 */ addiu $v0, $zero, 1 -/* 17E70 8003CA70 0800F2C2 */ j .L8003CB08 -/* 17E74 8003CA74 A2420330 */ sb $v0, 0x330($s2) -.L8003CA78: -/* 17E78 8003CA78 02021021 */ addu $v0, $s0, $v0 -/* 17E7C 8003CA7C 8C420324 */ lw $v0, 0x324($v0) -/* 17E80 8003CA80 C6000038 */ lwc1 $f0, 0x38($s0) -/* 17E84 8003CA84 8C43000C */ lw $v1, 0xc($v0) -/* 17E88 8003CA88 E4600004 */ swc1 $f0, 4($v1) -/* 17E8C 8003CA8C 860200A8 */ lh $v0, 0xa8($s0) -/* 17E90 8003CA90 3C013FE0 */ lui $at, 0x3fe0 -/* 17E94 8003CA94 44810800 */ mtc1 $at, $f1 -/* 17E98 8003CA98 44800000 */ mtc1 $zero, $f0 -/* 17E9C 8003CA9C 44821000 */ mtc1 $v0, $f2 -/* 17EA0 8003CAA0 00000000 */ nop -/* 17EA4 8003CAA4 468010A1 */ cvt.d.w $f2, $f2 -/* 17EA8 8003CAA8 46201082 */ mul.d $f2, $f2, $f0 -/* 17EAC 8003CAAC 00000000 */ nop -/* 17EB0 8003CAB0 C6000054 */ lwc1 $f0, 0x54($s0) -/* 17EB4 8003CAB4 46000021 */ cvt.d.s $f0, $f0 -/* 17EB8 8003CAB8 46201082 */ mul.d $f2, $f2, $f0 -/* 17EBC 8003CABC 00000000 */ nop -/* 17EC0 8003CAC0 C600003C */ lwc1 $f0, 0x3c($s0) -/* 17EC4 8003CAC4 46000021 */ cvt.d.s $f0, $f0 -/* 17EC8 8003CAC8 46220000 */ add.d $f0, $f0, $f2 -/* 17ECC 8003CACC 46200020 */ cvt.s.d $f0, $f0 -/* 17ED0 8003CAD0 E4600008 */ swc1 $f0, 8($v1) -/* 17ED4 8003CAD4 C6000040 */ lwc1 $f0, 0x40($s0) -/* 17ED8 8003CAD8 E460000C */ swc1 $f0, 0xc($v1) -/* 17EDC 8003CADC C6000054 */ lwc1 $f0, 0x54($s0) -/* 17EE0 8003CAE0 3C01800A */ lui $at, %hi(D_80098538) -/* 17EE4 8003CAE4 D4228538 */ ldc1 $f2, %lo(D_80098538)($at) -/* 17EE8 8003CAE8 46000021 */ cvt.d.s $f0, $f0 -/* 17EEC 8003CAEC 46220002 */ mul.d $f0, $f0, $f2 -/* 17EF0 8003CAF0 00000000 */ nop -/* 17EF4 8003CAF4 3C01800A */ lui $at, %hi(D_80098540) -/* 17EF8 8003CAF8 D4228540 */ ldc1 $f2, %lo(D_80098540)($at) -/* 17EFC 8003CAFC 46220000 */ add.d $f0, $f0, $f2 -/* 17F00 8003CB00 46200020 */ cvt.s.d $f0, $f0 -/* 17F04 8003CB04 E4600030 */ swc1 $f0, 0x30($v1) -.L8003CB08: -/* 17F08 8003CB08 8FBF0024 */ lw $ra, 0x24($sp) -/* 17F0C 8003CB0C 8FB20020 */ lw $s2, 0x20($sp) -/* 17F10 8003CB10 8FB1001C */ lw $s1, 0x1c($sp) -/* 17F14 8003CB14 8FB00018 */ lw $s0, 0x18($sp) -/* 17F18 8003CB18 03E00008 */ jr $ra -/* 17F1C 8003CB1C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/func_8003CB20.s b/ver/us/asm/nonmatchings/npc/func_8003CB20.s deleted file mode 100644 index 2ca69836e9..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003CB20.s +++ /dev/null @@ -1,13 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003CB20 -/* 17F20 8003CB20 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 17F24 8003CB24 00052880 */ sll $a1, $a1, 2 -/* 17F28 8003CB28 00852021 */ addu $a0, $a0, $a1 -/* 17F2C 8003CB2C AFBF0010 */ sw $ra, 0x10($sp) -/* 17F30 8003CB30 0C016914 */ jal remove_effect -/* 17F34 8003CB34 8C840324 */ lw $a0, 0x324($a0) -/* 17F38 8003CB38 8FBF0010 */ lw $ra, 0x10($sp) -/* 17F3C 8003CB3C 03E00008 */ jr $ra -/* 17F40 8003CB40 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/npc/func_8003CB44.s b/ver/us/asm/nonmatchings/npc/func_8003CB44.s deleted file mode 100644 index 4ac28d0fec..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003CB44.s +++ /dev/null @@ -1,89 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003CB44 -/* 17F44 8003CB44 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 17F48 8003CB48 AFB00018 */ sw $s0, 0x18($sp) -/* 17F4C 8003CB4C 0080802D */ daddu $s0, $a0, $zero -/* 17F50 8003CB50 AFB1001C */ sw $s1, 0x1c($sp) -/* 17F54 8003CB54 00A0882D */ daddu $s1, $a1, $zero -/* 17F58 8003CB58 AFB20020 */ sw $s2, 0x20($sp) -/* 17F5C 8003CB5C 02119021 */ addu $s2, $s0, $s1 -/* 17F60 8003CB60 AFBF0024 */ sw $ra, 0x24($sp) -/* 17F64 8003CB64 82430330 */ lb $v1, 0x330($s2) -/* 17F68 8003CB68 10600005 */ beqz $v1, .L8003CB80 -/* 17F6C 8003CB6C 24020001 */ addiu $v0, $zero, 1 -/* 17F70 8003CB70 10620023 */ beq $v1, $v0, .L8003CC00 -/* 17F74 8003CB74 00111080 */ sll $v0, $s1, 2 -/* 17F78 8003CB78 0800F31D */ j .L8003CC74 -/* 17F7C 8003CB7C 00000000 */ nop -.L8003CB80: -/* 17F80 8003CB80 860200A8 */ lh $v0, 0xa8($s0) -/* 17F84 8003CB84 3C013FE0 */ lui $at, 0x3fe0 -/* 17F88 8003CB88 44810800 */ mtc1 $at, $f1 -/* 17F8C 8003CB8C 44800000 */ mtc1 $zero, $f0 -/* 17F90 8003CB90 44821000 */ mtc1 $v0, $f2 -/* 17F94 8003CB94 00000000 */ nop -/* 17F98 8003CB98 468010A1 */ cvt.d.w $f2, $f2 -/* 17F9C 8003CB9C 46201082 */ mul.d $f2, $f2, $f0 -/* 17FA0 8003CBA0 00000000 */ nop -/* 17FA4 8003CBA4 C6060040 */ lwc1 $f6, 0x40($s0) -/* 17FA8 8003CBA8 3C013F80 */ lui $at, 0x3f80 -/* 17FAC 8003CBAC 44812000 */ mtc1 $at, $f4 -/* 17FB0 8003CBB0 C600003C */ lwc1 $f0, 0x3c($s0) -/* 17FB4 8003CBB4 AFA00014 */ sw $zero, 0x14($sp) -/* 17FB8 8003CBB8 E7A40010 */ swc1 $f4, 0x10($sp) -/* 17FBC 8003CBBC 46000021 */ cvt.d.s $f0, $f0 -/* 17FC0 8003CBC0 46220000 */ add.d $f0, $f0, $f2 -/* 17FC4 8003CBC4 3C0140A0 */ lui $at, 0x40a0 -/* 17FC8 8003CBC8 44811000 */ mtc1 $at, $f2 -/* 17FCC 8003CBCC 8E050038 */ lw $a1, 0x38($s0) -/* 17FD0 8003CBD0 46023181 */ sub.s $f6, $f6, $f2 -/* 17FD4 8003CBD4 46200020 */ cvt.s.d $f0, $f0 -/* 17FD8 8003CBD8 44060000 */ mfc1 $a2, $f0 -/* 17FDC 8003CBDC 44073000 */ mfc1 $a3, $f6 -/* 17FE0 8003CBE0 0C01C5D4 */ jal func_80071750 -/* 17FE4 8003CBE4 24040002 */ addiu $a0, $zero, 2 -/* 17FE8 8003CBE8 00111880 */ sll $v1, $s1, 2 -/* 17FEC 8003CBEC 02031821 */ addu $v1, $s0, $v1 -/* 17FF0 8003CBF0 AC620324 */ sw $v0, 0x324($v1) -/* 17FF4 8003CBF4 24020001 */ addiu $v0, $zero, 1 -/* 17FF8 8003CBF8 0800F31D */ j .L8003CC74 -/* 17FFC 8003CBFC A2420330 */ sb $v0, 0x330($s2) -.L8003CC00: -/* 18000 8003CC00 02021021 */ addu $v0, $s0, $v0 -/* 18004 8003CC04 8C420324 */ lw $v0, 0x324($v0) -/* 18008 8003CC08 C6000038 */ lwc1 $f0, 0x38($s0) -/* 1800C 8003CC0C 8C43000C */ lw $v1, 0xc($v0) -/* 18010 8003CC10 E4600004 */ swc1 $f0, 4($v1) -/* 18014 8003CC14 860200A8 */ lh $v0, 0xa8($s0) -/* 18018 8003CC18 3C013FE0 */ lui $at, 0x3fe0 -/* 1801C 8003CC1C 44810800 */ mtc1 $at, $f1 -/* 18020 8003CC20 44800000 */ mtc1 $zero, $f0 -/* 18024 8003CC24 44821000 */ mtc1 $v0, $f2 -/* 18028 8003CC28 00000000 */ nop -/* 1802C 8003CC2C 468010A1 */ cvt.d.w $f2, $f2 -/* 18030 8003CC30 46201082 */ mul.d $f2, $f2, $f0 -/* 18034 8003CC34 00000000 */ nop -/* 18038 8003CC38 C600003C */ lwc1 $f0, 0x3c($s0) -/* 1803C 8003CC3C 46000021 */ cvt.d.s $f0, $f0 -/* 18040 8003CC40 46220000 */ add.d $f0, $f0, $f2 -/* 18044 8003CC44 46200020 */ cvt.s.d $f0, $f0 -/* 18048 8003CC48 E4600008 */ swc1 $f0, 8($v1) -/* 1804C 8003CC4C C6020040 */ lwc1 $f2, 0x40($s0) -/* 18050 8003CC50 3C0140A0 */ lui $at, 0x40a0 -/* 18054 8003CC54 44810000 */ mtc1 $at, $f0 -/* 18058 8003CC58 00000000 */ nop -/* 1805C 8003CC5C 46001081 */ sub.s $f2, $f2, $f0 -/* 18060 8003CC60 3C013F80 */ lui $at, 0x3f80 -/* 18064 8003CC64 44810000 */ mtc1 $at, $f0 -/* 18068 8003CC68 00000000 */ nop -/* 1806C 8003CC6C E4600030 */ swc1 $f0, 0x30($v1) -/* 18070 8003CC70 E462000C */ swc1 $f2, 0xc($v1) -.L8003CC74: -/* 18074 8003CC74 8FBF0024 */ lw $ra, 0x24($sp) -/* 18078 8003CC78 8FB20020 */ lw $s2, 0x20($sp) -/* 1807C 8003CC7C 8FB1001C */ lw $s1, 0x1c($sp) -/* 18080 8003CC80 8FB00018 */ lw $s0, 0x18($sp) -/* 18084 8003CC84 03E00008 */ jr $ra -/* 18088 8003CC88 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/func_8003CC8C.s b/ver/us/asm/nonmatchings/npc/func_8003CC8C.s deleted file mode 100644 index 770f26679a..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003CC8C.s +++ /dev/null @@ -1,13 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003CC8C -/* 1808C 8003CC8C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 18090 8003CC90 00052880 */ sll $a1, $a1, 2 -/* 18094 8003CC94 00852021 */ addu $a0, $a0, $a1 -/* 18098 8003CC98 AFBF0010 */ sw $ra, 0x10($sp) -/* 1809C 8003CC9C 0C016914 */ jal remove_effect -/* 180A0 8003CCA0 8C840324 */ lw $a0, 0x324($a0) -/* 180A4 8003CCA4 8FBF0010 */ lw $ra, 0x10($sp) -/* 180A8 8003CCA8 03E00008 */ jr $ra -/* 180AC 8003CCAC 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/npc/func_8003CCB0.s b/ver/us/asm/nonmatchings/npc/func_8003CCB0.s deleted file mode 100644 index d5a9ed6eac..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003CCB0.s +++ /dev/null @@ -1,203 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003CCB0 -/* 180B0 8003CCB0 27BDFF60 */ addiu $sp, $sp, -0xa0 -/* 180B4 8003CCB4 AFB60080 */ sw $s6, 0x80($sp) -/* 180B8 8003CCB8 0080B02D */ daddu $s6, $a0, $zero -/* 180BC 8003CCBC AFB1006C */ sw $s1, 0x6c($sp) -/* 180C0 8003CCC0 00A0882D */ daddu $s1, $a1, $zero -/* 180C4 8003CCC4 AFB00068 */ sw $s0, 0x68($sp) -/* 180C8 8003CCC8 02D18021 */ addu $s0, $s6, $s1 -/* 180CC 8003CCCC AFBF0084 */ sw $ra, 0x84($sp) -/* 180D0 8003CCD0 AFB5007C */ sw $s5, 0x7c($sp) -/* 180D4 8003CCD4 AFB40078 */ sw $s4, 0x78($sp) -/* 180D8 8003CCD8 AFB30074 */ sw $s3, 0x74($sp) -/* 180DC 8003CCDC AFB20070 */ sw $s2, 0x70($sp) -/* 180E0 8003CCE0 F7B80098 */ sdc1 $f24, 0x98($sp) -/* 180E4 8003CCE4 F7B60090 */ sdc1 $f22, 0x90($sp) -/* 180E8 8003CCE8 F7B40088 */ sdc1 $f20, 0x88($sp) -/* 180EC 8003CCEC 82020330 */ lb $v0, 0x330($s0) -/* 180F0 8003CCF0 1440000B */ bnez $v0, .L8003CD20 -/* 180F4 8003CCF4 24050011 */ addiu $a1, $zero, 0x11 -/* 180F8 8003CCF8 24060014 */ addiu $a2, $zero, 0x14 -/* 180FC 8003CCFC 240200FF */ addiu $v0, $zero, 0xff -/* 18100 8003CD00 AFA00010 */ sw $zero, 0x10($sp) -/* 18104 8003CD04 AFA20014 */ sw $v0, 0x14($sp) -/* 18108 8003CD08 AFA00018 */ sw $zero, 0x18($sp) -/* 1810C 8003CD0C 8EC40024 */ lw $a0, 0x24($s6) -/* 18110 8003CD10 0C0B7A25 */ jal func_802DE894 -/* 18114 8003CD14 0000382D */ daddu $a3, $zero, $zero -/* 18118 8003CD18 24020001 */ addiu $v0, $zero, 1 -/* 1811C 8003CD1C A2020330 */ sb $v0, 0x330($s0) -.L8003CD20: -/* 18120 8003CD20 82030330 */ lb $v1, 0x330($s0) -/* 18124 8003CD24 24020001 */ addiu $v0, $zero, 1 -/* 18128 8003CD28 14620090 */ bne $v1, $v0, .L8003CF6C -/* 1812C 8003CD2C 00511004 */ sllv $v0, $s1, $v0 -/* 18130 8003CD30 02C22821 */ addu $a1, $s6, $v0 -/* 18134 8003CD34 94A20332 */ lhu $v0, 0x332($a1) -/* 18138 8003CD38 24420007 */ addiu $v0, $v0, 7 -/* 1813C 8003CD3C 00021C00 */ sll $v1, $v0, 0x10 -/* 18140 8003CD40 00032403 */ sra $a0, $v1, 0x10 -/* 18144 8003CD44 A4A20332 */ sh $v0, 0x332($a1) -/* 18148 8003CD48 28820168 */ slti $v0, $a0, 0x168 -/* 1814C 8003CD4C 14400010 */ bnez $v0, .L8003CD90 -/* 18150 8003CD50 0000802D */ daddu $s0, $zero, $zero -/* 18154 8003CD54 3C02B60B */ lui $v0, 0xb60b -/* 18158 8003CD58 344260B7 */ ori $v0, $v0, 0x60b7 -/* 1815C 8003CD5C 00820018 */ mult $a0, $v0 -/* 18160 8003CD60 00031FC3 */ sra $v1, $v1, 0x1f -/* 18164 8003CD64 00004010 */ mfhi $t0 -/* 18168 8003CD68 01041021 */ addu $v0, $t0, $a0 -/* 1816C 8003CD6C 00021203 */ sra $v0, $v0, 8 -/* 18170 8003CD70 00431023 */ subu $v0, $v0, $v1 -/* 18174 8003CD74 00021840 */ sll $v1, $v0, 1 -/* 18178 8003CD78 00621821 */ addu $v1, $v1, $v0 -/* 1817C 8003CD7C 00031100 */ sll $v0, $v1, 4 -/* 18180 8003CD80 00431023 */ subu $v0, $v0, $v1 -/* 18184 8003CD84 000210C0 */ sll $v0, $v0, 3 -/* 18188 8003CD88 00821023 */ subu $v0, $a0, $v0 -/* 1818C 8003CD8C A4A20332 */ sh $v0, 0x332($a1) -.L8003CD90: -/* 18190 8003CD90 00A0902D */ daddu $s2, $a1, $zero -/* 18194 8003CD94 3C138000 */ lui $s3, 0x8000 -/* 18198 8003CD98 0200882D */ daddu $s1, $s0, $zero -/* 1819C 8003CD9C 3C013FF0 */ lui $at, 0x3ff0 -/* 181A0 8003CDA0 4481C800 */ mtc1 $at, $f25 -/* 181A4 8003CDA4 4480C000 */ mtc1 $zero, $f24 -/* 181A8 8003CDA8 3C014054 */ lui $at, 0x4054 -/* 181AC 8003CDAC 4481B800 */ mtc1 $at, $f23 -/* 181B0 8003CDB0 4480B000 */ mtc1 $zero, $f22 -/* 181B4 8003CDB4 3C0141E0 */ lui $at, 0x41e0 -/* 181B8 8003CDB8 4481A800 */ mtc1 $at, $f21 -/* 181BC 8003CDBC 4480A000 */ mtc1 $zero, $f20 -.L8003CDC0: -/* 181C0 8003CDC0 96440332 */ lhu $a0, 0x332($s2) -/* 181C4 8003CDC4 00912021 */ addu $a0, $a0, $s1 -/* 181C8 8003CDC8 00042400 */ sll $a0, $a0, 0x10 -/* 181CC 8003CDCC 0C00A4F5 */ jal cosine -/* 181D0 8003CDD0 00042403 */ sra $a0, $a0, 0x10 -/* 181D4 8003CDD4 46000021 */ cvt.d.s $f0, $f0 -/* 181D8 8003CDD8 46380000 */ add.d $f0, $f0, $f24 -/* 181DC 8003CDDC 46360002 */ mul.d $f0, $f0, $f22 -/* 181E0 8003CDE0 00000000 */ nop -/* 181E4 8003CDE4 27A20020 */ addiu $v0, $sp, 0x20 -/* 181E8 8003CDE8 4620A03E */ c.le.d $f20, $f0 -/* 181EC 8003CDEC 00000000 */ nop -/* 181F0 8003CDF0 45010005 */ bc1t .L8003CE08 -/* 181F4 8003CDF4 00501021 */ addu $v0, $v0, $s0 -/* 181F8 8003CDF8 4620008D */ trunc.w.d $f2, $f0 -/* 181FC 8003CDFC 44031000 */ mfc1 $v1, $f2 -/* 18200 8003CE00 0800F388 */ j .L8003CE20 -/* 18204 8003CE04 A0430000 */ sb $v1, ($v0) -.L8003CE08: -/* 18208 8003CE08 46340001 */ sub.d $f0, $f0, $f20 -/* 1820C 8003CE0C 4620008D */ trunc.w.d $f2, $f0 -/* 18210 8003CE10 44031000 */ mfc1 $v1, $f2 -/* 18214 8003CE14 00000000 */ nop -/* 18218 8003CE18 00731825 */ or $v1, $v1, $s3 -/* 1821C 8003CE1C A0430000 */ sb $v1, ($v0) -.L8003CE20: -/* 18220 8003CE20 96440332 */ lhu $a0, 0x332($s2) -/* 18224 8003CE24 00912021 */ addu $a0, $a0, $s1 -/* 18228 8003CE28 2484002D */ addiu $a0, $a0, 0x2d -/* 1822C 8003CE2C 00042400 */ sll $a0, $a0, 0x10 -/* 18230 8003CE30 0C00A4F5 */ jal cosine -/* 18234 8003CE34 00042403 */ sra $a0, $a0, 0x10 -/* 18238 8003CE38 46000021 */ cvt.d.s $f0, $f0 -/* 1823C 8003CE3C 46380000 */ add.d $f0, $f0, $f24 -/* 18240 8003CE40 46360002 */ mul.d $f0, $f0, $f22 -/* 18244 8003CE44 00000000 */ nop -/* 18248 8003CE48 27A20038 */ addiu $v0, $sp, 0x38 -/* 1824C 8003CE4C 4620A03E */ c.le.d $f20, $f0 -/* 18250 8003CE50 00000000 */ nop -/* 18254 8003CE54 45010005 */ bc1t .L8003CE6C -/* 18258 8003CE58 00501021 */ addu $v0, $v0, $s0 -/* 1825C 8003CE5C 4620008D */ trunc.w.d $f2, $f0 -/* 18260 8003CE60 44031000 */ mfc1 $v1, $f2 -/* 18264 8003CE64 0800F3A1 */ j .L8003CE84 -/* 18268 8003CE68 A0430000 */ sb $v1, ($v0) -.L8003CE6C: -/* 1826C 8003CE6C 46340001 */ sub.d $f0, $f0, $f20 -/* 18270 8003CE70 4620008D */ trunc.w.d $f2, $f0 -/* 18274 8003CE74 44031000 */ mfc1 $v1, $f2 -/* 18278 8003CE78 00000000 */ nop -/* 1827C 8003CE7C 00731825 */ or $v1, $v1, $s3 -/* 18280 8003CE80 A0430000 */ sb $v1, ($v0) -.L8003CE84: -/* 18284 8003CE84 96440332 */ lhu $a0, 0x332($s2) -/* 18288 8003CE88 00912021 */ addu $a0, $a0, $s1 -/* 1828C 8003CE8C 2484005A */ addiu $a0, $a0, 0x5a -/* 18290 8003CE90 00042400 */ sll $a0, $a0, 0x10 -/* 18294 8003CE94 0C00A4F5 */ jal cosine -/* 18298 8003CE98 00042403 */ sra $a0, $a0, 0x10 -/* 1829C 8003CE9C 46000021 */ cvt.d.s $f0, $f0 -/* 182A0 8003CEA0 46380000 */ add.d $f0, $f0, $f24 -/* 182A4 8003CEA4 46360002 */ mul.d $f0, $f0, $f22 -/* 182A8 8003CEA8 00000000 */ nop -/* 182AC 8003CEAC 27A20050 */ addiu $v0, $sp, 0x50 -/* 182B0 8003CEB0 4620A03E */ c.le.d $f20, $f0 -/* 182B4 8003CEB4 00000000 */ nop -/* 182B8 8003CEB8 45010005 */ bc1t .L8003CED0 -/* 182BC 8003CEBC 00501021 */ addu $v0, $v0, $s0 -/* 182C0 8003CEC0 4620008D */ trunc.w.d $f2, $f0 -/* 182C4 8003CEC4 44031000 */ mfc1 $v1, $f2 -/* 182C8 8003CEC8 0800F3BA */ j .L8003CEE8 -/* 182CC 8003CECC A0430000 */ sb $v1, ($v0) -.L8003CED0: -/* 182D0 8003CED0 46340001 */ sub.d $f0, $f0, $f20 -/* 182D4 8003CED4 4620008D */ trunc.w.d $f2, $f0 -/* 182D8 8003CED8 44031000 */ mfc1 $v1, $f2 -/* 182DC 8003CEDC 00000000 */ nop -/* 182E0 8003CEE0 00731825 */ or $v1, $v1, $s3 -/* 182E4 8003CEE4 A0430000 */ sb $v1, ($v0) -.L8003CEE8: -/* 182E8 8003CEE8 26100001 */ addiu $s0, $s0, 1 -/* 182EC 8003CEEC 2A020014 */ slti $v0, $s0, 0x14 -/* 182F0 8003CEF0 1440FFB3 */ bnez $v0, .L8003CDC0 -/* 182F4 8003CEF4 26310019 */ addiu $s1, $s1, 0x19 -/* 182F8 8003CEF8 241500FF */ addiu $s5, $zero, 0xff -/* 182FC 8003CEFC 0000802D */ daddu $s0, $zero, $zero -/* 18300 8003CF00 27B30020 */ addiu $s3, $sp, 0x20 -/* 18304 8003CF04 27B20038 */ addiu $s2, $sp, 0x38 -/* 18308 8003CF08 27B10050 */ addiu $s1, $sp, 0x50 -/* 1830C 8003CF0C 02A0A02D */ daddu $s4, $s5, $zero -/* 18310 8003CF10 2405000C */ addiu $a1, $zero, 0xc -.L8003CF14: -/* 18314 8003CF14 0200302D */ daddu $a2, $s0, $zero -/* 18318 8003CF18 02701021 */ addu $v0, $s3, $s0 -/* 1831C 8003CF1C 02501821 */ addu $v1, $s2, $s0 -/* 18320 8003CF20 02302021 */ addu $a0, $s1, $s0 -/* 18324 8003CF24 90470000 */ lbu $a3, ($v0) -/* 18328 8003CF28 90620000 */ lbu $v0, ($v1) -/* 1832C 8003CF2C 90830000 */ lbu $v1, ($a0) -/* 18330 8003CF30 26100001 */ addiu $s0, $s0, 1 -/* 18334 8003CF34 AFA00010 */ sw $zero, 0x10($sp) -/* 18338 8003CF38 AFB40014 */ sw $s4, 0x14($sp) -/* 1833C 8003CF3C AFA00018 */ sw $zero, 0x18($sp) -/* 18340 8003CF40 8EC40024 */ lw $a0, 0x24($s6) -/* 18344 8003CF44 00073E00 */ sll $a3, $a3, 0x18 -/* 18348 8003CF48 00021400 */ sll $v0, $v0, 0x10 -/* 1834C 8003CF4C 00E23825 */ or $a3, $a3, $v0 -/* 18350 8003CF50 00031A00 */ sll $v1, $v1, 8 -/* 18354 8003CF54 00E33825 */ or $a3, $a3, $v1 -/* 18358 8003CF58 0C0B7A25 */ jal func_802DE894 -/* 1835C 8003CF5C 00F53825 */ or $a3, $a3, $s5 -/* 18360 8003CF60 2A020014 */ slti $v0, $s0, 0x14 -/* 18364 8003CF64 1440FFEB */ bnez $v0, .L8003CF14 -/* 18368 8003CF68 2405000C */ addiu $a1, $zero, 0xc -.L8003CF6C: -/* 1836C 8003CF6C 8FBF0084 */ lw $ra, 0x84($sp) -/* 18370 8003CF70 8FB60080 */ lw $s6, 0x80($sp) -/* 18374 8003CF74 8FB5007C */ lw $s5, 0x7c($sp) -/* 18378 8003CF78 8FB40078 */ lw $s4, 0x78($sp) -/* 1837C 8003CF7C 8FB30074 */ lw $s3, 0x74($sp) -/* 18380 8003CF80 8FB20070 */ lw $s2, 0x70($sp) -/* 18384 8003CF84 8FB1006C */ lw $s1, 0x6c($sp) -/* 18388 8003CF88 8FB00068 */ lw $s0, 0x68($sp) -/* 1838C 8003CF8C D7B80098 */ ldc1 $f24, 0x98($sp) -/* 18390 8003CF90 D7B60090 */ ldc1 $f22, 0x90($sp) -/* 18394 8003CF94 D7B40088 */ ldc1 $f20, 0x88($sp) -/* 18398 8003CF98 03E00008 */ jr $ra -/* 1839C 8003CF9C 27BD00A0 */ addiu $sp, $sp, 0xa0 diff --git a/ver/us/asm/nonmatchings/npc/func_8003CFA8.s b/ver/us/asm/nonmatchings/npc/func_8003CFA8.s deleted file mode 100644 index 0de37b646d..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003CFA8.s +++ /dev/null @@ -1,7 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003CFA8 -/* 183A8 8003CFA8 00852021 */ addu $a0, $a0, $a1 -/* 183AC 8003CFAC 03E00008 */ jr $ra -/* 183B0 8003CFB0 A0800330 */ sb $zero, 0x330($a0) diff --git a/ver/us/asm/nonmatchings/npc/func_8003D2F8.s b/ver/us/asm/nonmatchings/npc/func_8003D2F8.s deleted file mode 100644 index e1fe5001e2..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003D2F8.s +++ /dev/null @@ -1,56 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003D2F8 -/* 186F8 8003D2F8 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 186FC 8003D2FC AFB00028 */ sw $s0, 0x28($sp) -/* 18700 8003D300 0080802D */ daddu $s0, $a0, $zero -/* 18704 8003D304 AFBF002C */ sw $ra, 0x2c($sp) -/* 18708 8003D308 F7B40030 */ sdc1 $f20, 0x30($sp) -/* 1870C 8003D30C 8E020000 */ lw $v0, ($s0) -/* 18710 8003D310 3C030400 */ lui $v1, 0x400 -/* 18714 8003D314 00431024 */ and $v0, $v0, $v1 -/* 18718 8003D318 10400005 */ beqz $v0, .L8003D330 -/* 1871C 8003D31C 00000000 */ nop -/* 18720 8003D320 0C044181 */ jal get_shadow_by_index -/* 18724 8003D324 8E040078 */ lw $a0, 0x78($s0) -/* 18728 8003D328 0800F4CD */ j .L8003D334 -/* 1872C 8003D32C C4400014 */ lwc1 $f0, 0x14($v0) -.L8003D330: -/* 18730 8003D330 C600003C */ lwc1 $f0, 0x3c($s0) -.L8003D334: -/* 18734 8003D334 3C014150 */ lui $at, 0x4150 -/* 18738 8003D338 44811000 */ mtc1 $at, $f2 -/* 1873C 8003D33C 00000000 */ nop -/* 18740 8003D340 46020000 */ add.s $f0, $f0, $f2 -/* 18744 8003D344 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 18748 8003D348 3C040003 */ lui $a0, 3 -/* 1874C 8003D34C 34848000 */ ori $a0, $a0, 0x8000 -/* 18750 8003D350 27A20024 */ addiu $v0, $sp, 0x24 -/* 18754 8003D354 27A50018 */ addiu $a1, $sp, 0x18 -/* 18758 8003D358 27A6001C */ addiu $a2, $sp, 0x1c -/* 1875C 8003D35C 3C014180 */ lui $at, 0x4180 -/* 18760 8003D360 4481A000 */ mtc1 $at, $f20 -/* 18764 8003D364 C6000038 */ lwc1 $f0, 0x38($s0) -/* 18768 8003D368 C6020040 */ lwc1 $f2, 0x40($s0) -/* 1876C 8003D36C 27A70020 */ addiu $a3, $sp, 0x20 -/* 18770 8003D370 E7B40024 */ swc1 $f20, 0x24($sp) -/* 18774 8003D374 E7A00018 */ swc1 $f0, 0x18($sp) -/* 18778 8003D378 E7A20020 */ swc1 $f2, 0x20($sp) -/* 1877C 8003D37C 0C0372DF */ jal func_800DCB7C -/* 18780 8003D380 AFA20010 */ sw $v0, 0x10($sp) -/* 18784 8003D384 10400008 */ beqz $v0, .L8003D3A8 -/* 18788 8003D388 0000102D */ daddu $v0, $zero, $zero -/* 1878C 8003D38C C7A00024 */ lwc1 $f0, 0x24($sp) -/* 18790 8003D390 4614003E */ c.le.s $f0, $f20 -/* 18794 8003D394 00000000 */ nop -/* 18798 8003D398 45000003 */ bc1f .L8003D3A8 -/* 1879C 8003D39C 00000000 */ nop -/* 187A0 8003D3A0 3C028011 */ lui $v0, %hi(D_8010C978) -/* 187A4 8003D3A4 8C42C978 */ lw $v0, %lo(D_8010C978)($v0) -.L8003D3A8: -/* 187A8 8003D3A8 8FBF002C */ lw $ra, 0x2c($sp) -/* 187AC 8003D3AC 8FB00028 */ lw $s0, 0x28($sp) -/* 187B0 8003D3B0 D7B40030 */ ldc1 $f20, 0x30($sp) -/* 187B4 8003D3B4 03E00008 */ jr $ra -/* 187B8 8003D3B8 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/ver/us/asm/nonmatchings/npc/func_8003D624.s b/ver/us/asm/nonmatchings/npc/func_8003D624.s deleted file mode 100644 index 7ab9d2cea7..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003D624.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003D624 -/* 18A24 8003D624 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 18A28 8003D628 8FA20028 */ lw $v0, 0x28($sp) -/* 18A2C 8003D62C 8FA3002C */ lw $v1, 0x2c($sp) -/* 18A30 8003D630 8FA80030 */ lw $t0, 0x30($sp) -/* 18A34 8003D634 AFBF0010 */ sw $ra, 0x10($sp) -/* 18A38 8003D638 A4850098 */ sh $a1, 0x98($a0) -/* 18A3C 8003D63C A486009A */ sh $a2, 0x9a($a0) -/* 18A40 8003D640 A487009C */ sh $a3, 0x9c($a0) -/* 18A44 8003D644 A482009E */ sh $v0, 0x9e($a0) -/* 18A48 8003D648 A48300A0 */ sh $v1, 0xa0($a0) -/* 18A4C 8003D64C 0C00F4EF */ jal func_8003D3BC -/* 18A50 8003D650 A48800A2 */ sh $t0, 0xa2($a0) -/* 18A54 8003D654 8FBF0010 */ lw $ra, 0x10($sp) -/* 18A58 8003D658 03E00008 */ jr $ra -/* 18A5C 8003D65C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/npc/func_8003D788.s b/ver/us/asm/nonmatchings/npc/func_8003D788.s deleted file mode 100644 index e1ba6c840c..0000000000 --- a/ver/us/asm/nonmatchings/npc/func_8003D788.s +++ /dev/null @@ -1,182 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8003D788 -/* 18B88 8003D788 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* 18B8C 8003D78C AFB00030 */ sw $s0, 0x30($sp) -/* 18B90 8003D790 0080802D */ daddu $s0, $a0, $zero -/* 18B94 8003D794 3C038007 */ lui $v1, %hi(gGameStatusPtr) -/* 18B98 8003D798 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) -/* 18B9C 8003D79C AFBF0038 */ sw $ra, 0x38($sp) -/* 18BA0 8003D7A0 AFB10034 */ sw $s1, 0x34($sp) -/* 18BA4 8003D7A4 84620086 */ lh $v0, 0x86($v1) -/* 18BA8 8003D7A8 24110005 */ addiu $s1, $zero, 5 -/* 18BAC 8003D7AC 14510004 */ bne $v0, $s1, .L8003D7C0 -/* 18BB0 8003D7B0 0000302D */ daddu $a2, $zero, $zero -/* 18BB4 8003D7B4 8462008C */ lh $v0, 0x8c($v1) -/* 18BB8 8003D7B8 38420002 */ xori $v0, $v0, 2 -/* 18BBC 8003D7BC 2C460001 */ sltiu $a2, $v0, 1 -.L8003D7C0: -/* 18BC0 8003D7C0 24020002 */ addiu $v0, $zero, 2 -/* 18BC4 8003D7C4 14A20026 */ bne $a1, $v0, .L8003D860 -/* 18BC8 8003D7C8 00000000 */ nop -/* 18BCC 8003D7CC C602003C */ lwc1 $f2, 0x3c($s0) -/* 18BD0 8003D7D0 44800000 */ mtc1 $zero, $f0 -/* 18BD4 8003D7D4 C6040040 */ lwc1 $f4, 0x40($s0) -/* 18BD8 8003D7D8 46001080 */ add.s $f2, $f2, $f0 -/* 18BDC 8003D7DC C6000038 */ lwc1 $f0, 0x38($s0) -/* 18BE0 8003D7E0 14C00011 */ bnez $a2, .L8003D828 -/* 18BE4 8003D7E4 24040003 */ addiu $a0, $zero, 3 -/* 18BE8 8003D7E8 3C108007 */ lui $s0, %hi(D_80077C10) -/* 18BEC 8003D7EC 26107C10 */ addiu $s0, $s0, %lo(D_80077C10) -/* 18BF0 8003D7F0 44050000 */ mfc1 $a1, $f0 -/* 18BF4 8003D7F4 44061000 */ mfc1 $a2, $f2 -/* 18BF8 8003D7F8 44072000 */ mfc1 $a3, $f4 -/* 18BFC 8003D7FC C6000000 */ lwc1 $f0, ($s0) -/* 18C00 8003D800 0000202D */ daddu $a0, $zero, $zero -/* 18C04 8003D804 0C01BEB4 */ jal fx_walk_large -/* 18C08 8003D808 E7A00010 */ swc1 $f0, 0x10($sp) -/* 18C0C 8003D80C C6000000 */ lwc1 $f0, ($s0) -/* 18C10 8003D810 3C01420C */ lui $at, 0x420c -/* 18C14 8003D814 44816000 */ mtc1 $at, $f12 -/* 18C18 8003D818 0C00A6C9 */ jal clamp_angle -/* 18C1C 8003D81C 460C0300 */ add.s $f12, $f0, $f12 -/* 18C20 8003D820 0800F689 */ j .L8003DA24 -/* 18C24 8003D824 E6000000 */ swc1 $f0, ($s0) -.L8003D828: -/* 18C28 8003D828 44050000 */ mfc1 $a1, $f0 -/* 18C2C 8003D82C 44061000 */ mfc1 $a2, $f2 -/* 18C30 8003D830 44072000 */ mfc1 $a3, $f4 -/* 18C34 8003D834 3C014150 */ lui $at, 0x4150 -/* 18C38 8003D838 44810000 */ mtc1 $at, $f0 -/* 18C3C 8003D83C 3C014120 */ lui $at, 0x4120 -/* 18C40 8003D840 44811000 */ mtc1 $at, $f2 -/* 18C44 8003D844 3C013F80 */ lui $at, 0x3f80 -/* 18C48 8003D848 44812000 */ mtc1 $at, $f4 -/* 18C4C 8003D84C 2402001E */ addiu $v0, $zero, 0x1e -/* 18C50 8003D850 AFB1001C */ sw $s1, 0x1c($sp) -/* 18C54 8003D854 AFA20020 */ sw $v0, 0x20($sp) -/* 18C58 8003D858 0800F686 */ j .L8003DA18 -/* 18C5C 8003D85C E7A00010 */ swc1 $f0, 0x10($sp) -.L8003D860: -/* 18C60 8003D860 10A00070 */ beqz $a1, .L8003DA24 -/* 18C64 8003D864 00000000 */ nop -/* 18C68 8003D868 3C048007 */ lui $a0, %hi(D_80077C14) -/* 18C6C 8003D86C 24847C14 */ addiu $a0, $a0, %lo(D_80077C14) -/* 18C70 8003D870 94820000 */ lhu $v0, ($a0) -/* 18C74 8003D874 24430001 */ addiu $v1, $v0, 1 -/* 18C78 8003D878 00021400 */ sll $v0, $v0, 0x10 -/* 18C7C 8003D87C 00021403 */ sra $v0, $v0, 0x10 -/* 18C80 8003D880 28420004 */ slti $v0, $v0, 4 -/* 18C84 8003D884 14400067 */ bnez $v0, .L8003DA24 -/* 18C88 8003D888 A4830000 */ sh $v1, ($a0) -/* 18C8C 8003D88C 14C00034 */ bnez $a2, .L8003D960 -/* 18C90 8003D890 A4800000 */ sh $zero, ($a0) -/* 18C94 8003D894 C60C000C */ lwc1 $f12, 0xc($s0) -/* 18C98 8003D898 0C00A6C9 */ jal clamp_angle -/* 18C9C 8003D89C 46006307 */ neg.s $f12, $f12 -/* 18CA0 8003D8A0 3C0140C9 */ lui $at, 0x40c9 -/* 18CA4 8003D8A4 34210FD0 */ ori $at, $at, 0xfd0 -/* 18CA8 8003D8A8 44811000 */ mtc1 $at, $f2 -/* 18CAC 8003D8AC 00000000 */ nop -/* 18CB0 8003D8B0 46020002 */ mul.s $f0, $f0, $f2 -/* 18CB4 8003D8B4 00000000 */ nop -/* 18CB8 8003D8B8 27A50028 */ addiu $a1, $sp, 0x28 -/* 18CBC 8003D8BC 3C0143B4 */ lui $at, 0x43b4 -/* 18CC0 8003D8C0 44816000 */ mtc1 $at, $f12 -/* 18CC4 8003D8C4 27A6002C */ addiu $a2, $sp, 0x2c -/* 18CC8 8003D8C8 0C00A82D */ jal sin_cos_rad -/* 18CCC 8003D8CC 460C0303 */ div.s $f12, $f0, $f12 -/* 18CD0 8003D8D0 860200A6 */ lh $v0, 0xa6($s0) -/* 18CD4 8003D8D4 C7AA0028 */ lwc1 $f10, 0x28($sp) -/* 18CD8 8003D8D8 44821000 */ mtc1 $v0, $f2 -/* 18CDC 8003D8DC 00000000 */ nop -/* 18CE0 8003D8E0 468010A0 */ cvt.s.w $f2, $f2 -/* 18CE4 8003D8E4 460A1182 */ mul.s $f6, $f2, $f10 -/* 18CE8 8003D8E8 00000000 */ nop -/* 18CEC 8003D8EC C7A8002C */ lwc1 $f8, 0x2c($sp) -/* 18CF0 8003D8F0 46081082 */ mul.s $f2, $f2, $f8 -/* 18CF4 8003D8F4 00000000 */ nop -/* 18CF8 8003D8F8 3C013E4C */ lui $at, 0x3e4c -/* 18CFC 8003D8FC 3421CCCD */ ori $at, $at, 0xcccd -/* 18D00 8003D900 44810000 */ mtc1 $at, $f0 -/* 18D04 8003D904 00000000 */ nop -/* 18D08 8003D908 46003182 */ mul.s $f6, $f6, $f0 -/* 18D0C 8003D90C 00000000 */ nop -/* 18D10 8003D910 46001082 */ mul.s $f2, $f2, $f0 -/* 18D14 8003D914 00000000 */ nop -/* 18D18 8003D918 C604003C */ lwc1 $f4, 0x3c($s0) -/* 18D1C 8003D91C 3C013FC0 */ lui $at, 0x3fc0 -/* 18D20 8003D920 44810000 */ mtc1 $at, $f0 -/* 18D24 8003D924 00000000 */ nop -/* 18D28 8003D928 46002100 */ add.s $f4, $f4, $f0 -/* 18D2C 8003D92C C6000038 */ lwc1 $f0, 0x38($s0) -/* 18D30 8003D930 46060000 */ add.s $f0, $f0, $f6 -/* 18D34 8003D934 44050000 */ mfc1 $a1, $f0 -/* 18D38 8003D938 C6000040 */ lwc1 $f0, 0x40($s0) -/* 18D3C 8003D93C 46020000 */ add.s $f0, $f0, $f2 -/* 18D40 8003D940 44062000 */ mfc1 $a2, $f4 -/* 18D44 8003D944 44070000 */ mfc1 $a3, $f0 -/* 18D48 8003D948 0000202D */ daddu $a0, $zero, $zero -/* 18D4C 8003D94C E7AA0010 */ swc1 $f10, 0x10($sp) -/* 18D50 8003D950 0C01BECC */ jal fx_walk_normal -/* 18D54 8003D954 E7A80014 */ swc1 $f8, 0x14($sp) -/* 18D58 8003D958 0800F689 */ j .L8003DA24 -/* 18D5C 8003D95C 00000000 */ nop -.L8003D960: -/* 18D60 8003D960 0C00A6C9 */ jal clamp_angle -/* 18D64 8003D964 C60C000C */ lwc1 $f12, 0xc($s0) -/* 18D68 8003D968 3C0140C9 */ lui $at, 0x40c9 -/* 18D6C 8003D96C 34210FD0 */ ori $at, $at, 0xfd0 -/* 18D70 8003D970 44811000 */ mtc1 $at, $f2 -/* 18D74 8003D974 00000000 */ nop -/* 18D78 8003D978 46020002 */ mul.s $f0, $f0, $f2 -/* 18D7C 8003D97C 00000000 */ nop -/* 18D80 8003D980 27A50028 */ addiu $a1, $sp, 0x28 -/* 18D84 8003D984 3C0143B4 */ lui $at, 0x43b4 -/* 18D88 8003D988 44816000 */ mtc1 $at, $f12 -/* 18D8C 8003D98C 27A6002C */ addiu $a2, $sp, 0x2c -/* 18D90 8003D990 0C00A82D */ jal sin_cos_rad -/* 18D94 8003D994 460C0303 */ div.s $f12, $f0, $f12 -/* 18D98 8003D998 C602003C */ lwc1 $f2, 0x3c($s0) -/* 18D9C 8003D99C 3C013FC0 */ lui $at, 0x3fc0 -/* 18DA0 8003D9A0 44810000 */ mtc1 $at, $f0 -/* 18DA4 8003D9A4 860200A6 */ lh $v0, 0xa6($s0) -/* 18DA8 8003D9A8 46001080 */ add.s $f2, $f2, $f0 -/* 18DAC 8003D9AC C7A40028 */ lwc1 $f4, 0x28($sp) -/* 18DB0 8003D9B0 44820000 */ mtc1 $v0, $f0 -/* 18DB4 8003D9B4 00000000 */ nop -/* 18DB8 8003D9B8 46800020 */ cvt.s.w $f0, $f0 -/* 18DBC 8003D9BC 46040102 */ mul.s $f4, $f0, $f4 -/* 18DC0 8003D9C0 00000000 */ nop -/* 18DC4 8003D9C4 44061000 */ mfc1 $a2, $f2 -/* 18DC8 8003D9C8 C7A2002C */ lwc1 $f2, 0x2c($sp) -/* 18DCC 8003D9CC 46020002 */ mul.s $f0, $f0, $f2 -/* 18DD0 8003D9D0 00000000 */ nop -/* 18DD4 8003D9D4 24040003 */ addiu $a0, $zero, 3 -/* 18DD8 8003D9D8 C6060038 */ lwc1 $f6, 0x38($s0) -/* 18DDC 8003D9DC C6080040 */ lwc1 $f8, 0x40($s0) -/* 18DE0 8003D9E0 3C0140A0 */ lui $at, 0x40a0 -/* 18DE4 8003D9E4 44811000 */ mtc1 $at, $f2 -/* 18DE8 8003D9E8 46043180 */ add.s $f6, $f6, $f4 -/* 18DEC 8003D9EC E7A20010 */ swc1 $f2, 0x10($sp) -/* 18DF0 8003D9F0 3C014120 */ lui $at, 0x4120 -/* 18DF4 8003D9F4 44811000 */ mtc1 $at, $f2 -/* 18DF8 8003D9F8 46004200 */ add.s $f8, $f8, $f0 -/* 18DFC 8003D9FC 3C013F80 */ lui $at, 0x3f80 -/* 18E00 8003DA00 44812000 */ mtc1 $at, $f4 -/* 18E04 8003DA04 44053000 */ mfc1 $a1, $f6 -/* 18E08 8003DA08 44074000 */ mfc1 $a3, $f8 -/* 18E0C 8003DA0C 2402001E */ addiu $v0, $zero, 0x1e -/* 18E10 8003DA10 AFB1001C */ sw $s1, 0x1c($sp) -/* 18E14 8003DA14 AFA20020 */ sw $v0, 0x20($sp) -.L8003DA18: -/* 18E18 8003DA18 E7A20014 */ swc1 $f2, 0x14($sp) -/* 18E1C 8003DA1C 0C01C8D4 */ jal func_80072350 -/* 18E20 8003DA20 E7A40018 */ swc1 $f4, 0x18($sp) -.L8003DA24: -/* 18E24 8003DA24 8FBF0038 */ lw $ra, 0x38($sp) -/* 18E28 8003DA28 8FB10034 */ lw $s1, 0x34($sp) -/* 18E2C 8003DA2C 8FB00030 */ lw $s0, 0x30($sp) -/* 18E30 8003DA30 03E00008 */ jr $ra -/* 18E34 8003DA34 27BD0040 */ addiu $sp, $sp, 0x40 diff --git a/ver/us/asm/nonmatchings/npc/get_enemy.s b/ver/us/asm/nonmatchings/npc/get_enemy.s deleted file mode 100644 index 866f25030c..0000000000 --- a/ver/us/asm/nonmatchings/npc/get_enemy.s +++ /dev/null @@ -1,43 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_enemy -/* 1A0E8 8003ECE8 3C03800B */ lui $v1, %hi(gCurrentEncounter) -/* 1A0EC 8003ECEC 24630F10 */ addiu $v1, $v1, %lo(gCurrentEncounter) -/* 1A0F0 8003ECF0 8062001C */ lb $v0, 0x1c($v1) -/* 1A0F4 8003ECF4 18400018 */ blez $v0, .L8003ED58 -/* 1A0F8 8003ECF8 0000382D */ daddu $a3, $zero, $zero -/* 1A0FC 8003ECFC 0040502D */ daddu $t2, $v0, $zero -/* 1A100 8003ED00 0060482D */ daddu $t1, $v1, $zero -.L8003ED04: -/* 1A104 8003ED04 8D220028 */ lw $v0, 0x28($t1) -/* 1A108 8003ED08 50400010 */ beql $v0, $zero, .L8003ED4C -/* 1A10C 8003ED0C 24E70001 */ addiu $a3, $a3, 1 -/* 1A110 8003ED10 8C430000 */ lw $v1, ($v0) -/* 1A114 8003ED14 1860000C */ blez $v1, .L8003ED48 -/* 1A118 8003ED18 0000302D */ daddu $a2, $zero, $zero -/* 1A11C 8003ED1C 0060402D */ daddu $t0, $v1, $zero -/* 1A120 8003ED20 0040282D */ daddu $a1, $v0, $zero -.L8003ED24: -/* 1A124 8003ED24 8CA30004 */ lw $v1, 4($a1) -/* 1A128 8003ED28 10600004 */ beqz $v1, .L8003ED3C -/* 1A12C 8003ED2C 24C60001 */ addiu $a2, $a2, 1 -/* 1A130 8003ED30 84620008 */ lh $v0, 8($v1) -/* 1A134 8003ED34 1044000A */ beq $v0, $a0, .L8003ED60 -/* 1A138 8003ED38 00000000 */ nop -.L8003ED3C: -/* 1A13C 8003ED3C 00C8102A */ slt $v0, $a2, $t0 -/* 1A140 8003ED40 1440FFF8 */ bnez $v0, .L8003ED24 -/* 1A144 8003ED44 24A50004 */ addiu $a1, $a1, 4 -.L8003ED48: -/* 1A148 8003ED48 24E70001 */ addiu $a3, $a3, 1 -.L8003ED4C: -/* 1A14C 8003ED4C 00EA102A */ slt $v0, $a3, $t2 -/* 1A150 8003ED50 1440FFEC */ bnez $v0, .L8003ED04 -/* 1A154 8003ED54 25290004 */ addiu $t1, $t1, 4 -.L8003ED58: -/* 1A158 8003ED58 0800FB56 */ j .L8003ED58 -/* 1A15C 8003ED5C 00000000 */ nop -.L8003ED60: -/* 1A160 8003ED60 03E00008 */ jr $ra -/* 1A164 8003ED64 0060102D */ daddu $v0, $v1, $zero diff --git a/ver/us/asm/nonmatchings/npc/get_npc_safe.s b/ver/us/asm/nonmatchings/npc/get_npc_safe.s deleted file mode 100644 index 7e9d97e72d..0000000000 --- a/ver/us/asm/nonmatchings/npc/get_npc_safe.s +++ /dev/null @@ -1,30 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_npc_safe -/* 15F48 8003AB48 0000182D */ daddu $v1, $zero, $zero -/* 15F4C 8003AB4C 3C06800A */ lui $a2, %hi(gCurrentNpcListPtr) -/* 15F50 8003AB50 8CC60B90 */ lw $a2, %lo(gCurrentNpcListPtr)($a2) -.L8003AB54: -/* 15F54 8003AB54 8CC50000 */ lw $a1, ($a2) -/* 15F58 8003AB58 50A00008 */ beql $a1, $zero, .L8003AB7C -/* 15F5C 8003AB5C 24630001 */ addiu $v1, $v1, 1 -/* 15F60 8003AB60 8CA20000 */ lw $v0, ($a1) -/* 15F64 8003AB64 50400005 */ beql $v0, $zero, .L8003AB7C -/* 15F68 8003AB68 24630001 */ addiu $v1, $v1, 1 -/* 15F6C 8003AB6C 80A200A4 */ lb $v0, 0xa4($a1) -/* 15F70 8003AB70 50440006 */ beql $v0, $a0, .L8003AB8C -/* 15F74 8003AB74 28630040 */ slti $v1, $v1, 0x40 -/* 15F78 8003AB78 24630001 */ addiu $v1, $v1, 1 -.L8003AB7C: -/* 15F7C 8003AB7C 28620040 */ slti $v0, $v1, 0x40 -/* 15F80 8003AB80 1440FFF4 */ bnez $v0, .L8003AB54 -/* 15F84 8003AB84 24C60004 */ addiu $a2, $a2, 4 -/* 15F88 8003AB88 28630040 */ slti $v1, $v1, 0x40 -.L8003AB8C: -/* 15F8C 8003AB8C 10600002 */ beqz $v1, .L8003AB98 -/* 15F90 8003AB90 0000102D */ daddu $v0, $zero, $zero -/* 15F94 8003AB94 00A0102D */ daddu $v0, $a1, $zero -.L8003AB98: -/* 15F98 8003AB98 03E00008 */ jr $ra -/* 15F9C 8003AB9C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/npc/get_npc_unsafe.s b/ver/us/asm/nonmatchings/npc/get_npc_unsafe.s deleted file mode 100644 index cf24742887..0000000000 --- a/ver/us/asm/nonmatchings/npc/get_npc_unsafe.s +++ /dev/null @@ -1,32 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_npc_unsafe -/* 15EEC 8003AAEC 0000282D */ daddu $a1, $zero, $zero -/* 15EF0 8003AAF0 3C06800A */ lui $a2, %hi(gCurrentNpcListPtr) -/* 15EF4 8003AAF4 8CC60B90 */ lw $a2, %lo(gCurrentNpcListPtr)($a2) -.L8003AAF8: -/* 15EF8 8003AAF8 8CC30000 */ lw $v1, ($a2) -/* 15EFC 8003AAFC 50600008 */ beql $v1, $zero, .L8003AB20 -/* 15F00 8003AB00 24A50001 */ addiu $a1, $a1, 1 -/* 15F04 8003AB04 8C620000 */ lw $v0, ($v1) -/* 15F08 8003AB08 50400005 */ beql $v0, $zero, .L8003AB20 -/* 15F0C 8003AB0C 24A50001 */ addiu $a1, $a1, 1 -/* 15F10 8003AB10 806200A4 */ lb $v0, 0xa4($v1) -/* 15F14 8003AB14 10440006 */ beq $v0, $a0, .L8003AB30 -/* 15F18 8003AB18 28A20040 */ slti $v0, $a1, 0x40 -/* 15F1C 8003AB1C 24A50001 */ addiu $a1, $a1, 1 -.L8003AB20: -/* 15F20 8003AB20 28A20040 */ slti $v0, $a1, 0x40 -/* 15F24 8003AB24 1440FFF4 */ bnez $v0, .L8003AAF8 -/* 15F28 8003AB28 24C60004 */ addiu $a2, $a2, 4 -/* 15F2C 8003AB2C 28A20040 */ slti $v0, $a1, 0x40 -.L8003AB30: -/* 15F30 8003AB30 14400003 */ bnez $v0, .L8003AB40 -/* 15F34 8003AB34 00000000 */ nop -.L8003AB38: -/* 15F38 8003AB38 0800EACE */ j .L8003AB38 -/* 15F3C 8003AB3C 00000000 */ nop -.L8003AB40: -/* 15F40 8003AB40 03E00008 */ jr $ra -/* 15F44 8003AB44 0060102D */ daddu $v0, $v1, $zero diff --git a/ver/us/asm/nonmatchings/npc/kill_encounter.s b/ver/us/asm/nonmatchings/npc/kill_encounter.s deleted file mode 100644 index e77c713b0b..0000000000 --- a/ver/us/asm/nonmatchings/npc/kill_encounter.s +++ /dev/null @@ -1,38 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel kill_encounter -/* 19B30 8003E730 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 19B34 8003E734 AFBF001C */ sw $ra, 0x1c($sp) -/* 19B38 8003E738 AFB20018 */ sw $s2, 0x18($sp) -/* 19B3C 8003E73C AFB10014 */ sw $s1, 0x14($sp) -/* 19B40 8003E740 AFB00010 */ sw $s0, 0x10($sp) -/* 19B44 8003E744 80820004 */ lb $v0, 4($a0) -/* 19B48 8003E748 00021080 */ sll $v0, $v0, 2 -/* 19B4C 8003E74C 3C12800B */ lui $s2, %hi(gCurrentEncounter+0x28) -/* 19B50 8003E750 02429021 */ addu $s2, $s2, $v0 -/* 19B54 8003E754 8E520F38 */ lw $s2, %lo(gCurrentEncounter+0x28)($s2) -/* 19B58 8003E758 8E420000 */ lw $v0, ($s2) -/* 19B5C 8003E75C 1840000D */ blez $v0, .L8003E794 -/* 19B60 8003E760 0000882D */ daddu $s1, $zero, $zero -/* 19B64 8003E764 0240802D */ daddu $s0, $s2, $zero -.L8003E768: -/* 19B68 8003E768 8E040004 */ lw $a0, 4($s0) -/* 19B6C 8003E76C 10800004 */ beqz $a0, .L8003E780 -/* 19B70 8003E770 00000000 */ nop -/* 19B74 8003E774 0C00F9EB */ jal kill_enemy -/* 19B78 8003E778 00000000 */ nop -/* 19B7C 8003E77C AE000004 */ sw $zero, 4($s0) -.L8003E780: -/* 19B80 8003E780 8E420000 */ lw $v0, ($s2) -/* 19B84 8003E784 26310001 */ addiu $s1, $s1, 1 -/* 19B88 8003E788 0222102A */ slt $v0, $s1, $v0 -/* 19B8C 8003E78C 1440FFF6 */ bnez $v0, .L8003E768 -/* 19B90 8003E790 26100004 */ addiu $s0, $s0, 4 -.L8003E794: -/* 19B94 8003E794 8FBF001C */ lw $ra, 0x1c($sp) -/* 19B98 8003E798 8FB20018 */ lw $s2, 0x18($sp) -/* 19B9C 8003E79C 8FB10014 */ lw $s1, 0x14($sp) -/* 19BA0 8003E7A0 8FB00010 */ lw $s0, 0x10($sp) -/* 19BA4 8003E7A4 03E00008 */ jr $ra -/* 19BA8 8003E7A8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/npc_create.s b/ver/us/asm/nonmatchings/npc/npc_create.s deleted file mode 100644 index 2543a6d6dd..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_create.s +++ /dev/null @@ -1,190 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel npc_create -/* 13998 80038598 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr) -/* 1399C 8003859C 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1) -/* 139A0 800385A0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 139A4 800385A4 AFB20018 */ sw $s2, 0x18($sp) -/* 139A8 800385A8 0080902D */ daddu $s2, $a0, $zero -/* 139AC 800385AC AFB3001C */ sw $s3, 0x1c($sp) -/* 139B0 800385B0 00A0982D */ daddu $s3, $a1, $zero -/* 139B4 800385B4 AFB40020 */ sw $s4, 0x20($sp) -/* 139B8 800385B8 00C0A02D */ daddu $s4, $a2, $zero -/* 139BC 800385BC AFB10014 */ sw $s1, 0x14($sp) -/* 139C0 800385C0 0000882D */ daddu $s1, $zero, $zero -/* 139C4 800385C4 AFBF0024 */ sw $ra, 0x24($sp) -/* 139C8 800385C8 AFB00010 */ sw $s0, 0x10($sp) -.L800385CC: -/* 139CC 800385CC 8C620000 */ lw $v0, ($v1) -/* 139D0 800385D0 10400006 */ beqz $v0, .L800385EC -/* 139D4 800385D4 2A220040 */ slti $v0, $s1, 0x40 -/* 139D8 800385D8 26310001 */ addiu $s1, $s1, 1 -/* 139DC 800385DC 2A220040 */ slti $v0, $s1, 0x40 -/* 139E0 800385E0 1440FFFA */ bnez $v0, .L800385CC -/* 139E4 800385E4 24630004 */ addiu $v1, $v1, 4 -/* 139E8 800385E8 2A220040 */ slti $v0, $s1, 0x40 -.L800385EC: -/* 139EC 800385EC 14400003 */ bnez $v0, .L800385FC -/* 139F0 800385F0 00000000 */ nop -.L800385F4: -/* 139F4 800385F4 0800E17D */ j .L800385F4 -/* 139F8 800385F8 00000000 */ nop -.L800385FC: -/* 139FC 800385FC 0C00AB39 */ jal heap_malloc -/* 13A00 80038600 24040340 */ addiu $a0, $zero, 0x340 -/* 13A04 80038604 00112080 */ sll $a0, $s1, 2 -/* 13A08 80038608 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr) -/* 13A0C 8003860C 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1) -/* 13A10 80038610 3C05800A */ lui $a1, %hi(D_8009A604) -/* 13A14 80038614 24A5A604 */ addiu $a1, $a1, %lo(D_8009A604) -/* 13A18 80038618 00832021 */ addu $a0, $a0, $v1 -/* 13A1C 8003861C 94A30000 */ lhu $v1, ($a1) -/* 13A20 80038620 0040802D */ daddu $s0, $v0, $zero -/* 13A24 80038624 AC900000 */ sw $s0, ($a0) -/* 13A28 80038628 24630001 */ addiu $v1, $v1, 1 -/* 13A2C 8003862C 16000003 */ bnez $s0, .L8003863C -/* 13A30 80038630 A4A30000 */ sh $v1, ($a1) -.L80038634: -/* 13A34 80038634 0800E18D */ j .L80038634 -/* 13A38 80038638 00000000 */ nop -.L8003863C: -/* 13A3C 8003863C 3C030041 */ lui $v1, 0x41 -/* 13A40 80038640 8E420000 */ lw $v0, ($s2) -/* 13A44 80038644 34630011 */ ori $v1, $v1, 0x11 -/* 13A48 80038648 00431825 */ or $v1, $v0, $v1 -/* 13A4C 8003864C 12800004 */ beqz $s4, .L80038660 -/* 13A50 80038650 AE030000 */ sw $v1, ($s0) -/* 13A54 80038654 3C024000 */ lui $v0, 0x4000 -/* 13A58 80038658 00621025 */ or $v0, $v1, $v0 -/* 13A5C 8003865C AE020000 */ sw $v0, ($s0) -.L80038660: -/* 13A60 80038660 0000202D */ daddu $a0, $zero, $zero -/* 13A64 80038664 3C013F80 */ lui $at, 0x3f80 -/* 13A68 80038668 44810000 */ mtc1 $at, $f0 -/* 13A6C 8003866C 3C014080 */ lui $at, 0x4080 -/* 13A70 80038670 44811000 */ mtc1 $at, $f2 -/* 13A74 80038674 24020020 */ addiu $v0, $zero, 0x20 -/* 13A78 80038678 A60200A6 */ sh $v0, 0xa6($s0) -/* 13A7C 8003867C 24020040 */ addiu $v0, $zero, 0x40 -/* 13A80 80038680 A60200A8 */ sh $v0, 0xa8($s0) -/* 13A84 80038684 2402000D */ addiu $v0, $zero, 0xd -/* 13A88 80038688 A20200AA */ sb $v0, 0xaa($s0) -/* 13A8C 8003868C 240200FF */ addiu $v0, $zero, 0xff -/* 13A90 80038690 AE000020 */ sw $zero, 0x20($s0) -/* 13A94 80038694 AE00000C */ sw $zero, 0xc($s0) -/* 13A98 80038698 AE00001C */ sw $zero, 0x1c($s0) -/* 13A9C 8003869C AE000038 */ sw $zero, 0x38($s0) -/* 13AA0 800386A0 AE00003C */ sw $zero, 0x3c($s0) -/* 13AA4 800386A4 AE000040 */ sw $zero, 0x40($s0) -/* 13AA8 800386A8 AE00006C */ sw $zero, 0x6c($s0) -/* 13AAC 800386AC AE000070 */ sw $zero, 0x70($s0) -/* 13AB0 800386B0 AE000074 */ sw $zero, 0x74($s0) -/* 13AB4 800386B4 AE000050 */ sw $zero, 0x50($s0) -/* 13AB8 800386B8 AE000044 */ sw $zero, 0x44($s0) -/* 13ABC 800386BC AE000048 */ sw $zero, 0x48($s0) -/* 13AC0 800386C0 AE00004C */ sw $zero, 0x4c($s0) -/* 13AC4 800386C4 A6000090 */ sh $zero, 0x90($s0) -/* 13AC8 800386C8 A6000092 */ sh $zero, 0x92($s0) -/* 13ACC 800386CC A6000094 */ sh $zero, 0x94($s0) -/* 13AD0 800386D0 A6000096 */ sh $zero, 0x96($s0) -/* 13AD4 800386D4 A20000AB */ sb $zero, 0xab($s0) -/* 13AD8 800386D8 A20200AC */ sb $v0, 0xac($s0) -/* 13ADC 800386DC A20200AD */ sb $v0, 0xad($s0) -/* 13AE0 800386E0 E6000014 */ swc1 $f0, 0x14($s0) -/* 13AE4 800386E4 E6020018 */ swc1 $f2, 0x18($s0) -/* 13AE8 800386E8 E6000054 */ swc1 $f0, 0x54($s0) -/* 13AEC 800386EC E6000058 */ swc1 $f0, 0x58($s0) -/* 13AF0 800386F0 E600005C */ swc1 $f0, 0x5c($s0) -/* 13AF4 800386F4 8E420004 */ lw $v0, 4($s2) -/* 13AF8 800386F8 0200182D */ daddu $v1, $s0, $zero -/* 13AFC 800386FC E6000030 */ swc1 $f0, 0x30($s0) -/* 13B00 80038700 AE000034 */ sw $zero, 0x34($s0) -/* 13B04 80038704 A6000098 */ sh $zero, 0x98($s0) -/* 13B08 80038708 AE020028 */ sw $v0, 0x28($s0) -/* 13B0C 8003870C 3C020002 */ lui $v0, 2 -/* 13B10 80038710 A60000A2 */ sh $zero, 0xa2($s0) -/* 13B14 80038714 AE020080 */ sw $v0, 0x80($s0) -/* 13B18 80038718 2402FFFF */ addiu $v0, $zero, -1 -/* 13B1C 8003871C A6000088 */ sh $zero, 0x88($s0) -/* 13B20 80038720 A600008A */ sh $zero, 0x8a($s0) -/* 13B24 80038724 A600008C */ sh $zero, 0x8c($s0) -/* 13B28 80038728 A6020084 */ sh $v0, 0x84($s0) -/* 13B2C 8003872C A6020086 */ sh $v0, 0x86($s0) -/* 13B30 80038730 A20000B4 */ sb $zero, 0xb4($s0) -/* 13B34 80038734 A20000B5 */ sb $zero, 0xb5($s0) -/* 13B38 80038738 AE000318 */ sw $zero, 0x318($s0) -/* 13B3C 8003873C AE00031C */ sw $zero, 0x31c($s0) -/* 13B40 80038740 E6000320 */ swc1 $f0, 0x320($s0) -.L80038744: -/* 13B44 80038744 AC600324 */ sw $zero, 0x324($v1) -/* 13B48 80038748 02041021 */ addu $v0, $s0, $a0 -/* 13B4C 8003874C 24840001 */ addiu $a0, $a0, 1 -/* 13B50 80038750 A040032C */ sb $zero, 0x32c($v0) -/* 13B54 80038754 28820002 */ slti $v0, $a0, 2 -/* 13B58 80038758 1440FFFA */ bnez $v0, .L80038744 -/* 13B5C 8003875C 24630004 */ addiu $v1, $v1, 4 -/* 13B60 80038760 8E420008 */ lw $v0, 8($s2) -/* 13B64 80038764 14400004 */ bnez $v0, .L80038778 -/* 13B68 80038768 AE020004 */ sw $v0, 4($s0) -/* 13B6C 8003876C 3C028004 */ lui $v0, %hi(npc_callback_no_op) -/* 13B70 80038770 24428470 */ addiu $v0, $v0, %lo(npc_callback_no_op) -/* 13B74 80038774 AE020004 */ sw $v0, 4($s0) -.L80038778: -/* 13B78 80038778 8E42000C */ lw $v0, 0xc($s2) -/* 13B7C 8003877C 14400004 */ bnez $v0, .L80038790 -/* 13B80 80038780 AE020008 */ sw $v0, 8($s0) -/* 13B84 80038784 3C028004 */ lui $v0, %hi(npc_callback_no_op) -/* 13B88 80038788 24428470 */ addiu $v0, $v0, %lo(npc_callback_no_op) -/* 13B8C 8003878C AE020008 */ sw $v0, 8($s0) -.L80038790: -/* 13B90 80038790 16800015 */ bnez $s4, .L800387E8 -/* 13B94 80038794 3C020100 */ lui $v0, 0x100 -/* 13B98 80038798 8E030000 */ lw $v1, ($s0) -/* 13B9C 8003879C 00621024 */ and $v0, $v1, $v0 -/* 13BA0 800387A0 1440000F */ bnez $v0, .L800387E0 -/* 13BA4 800387A4 AE1300B0 */ sw $s3, 0xb0($s0) -/* 13BA8 800387A8 3C020400 */ lui $v0, 0x400 -/* 13BAC 800387AC 00621024 */ and $v0, $v1, $v0 -/* 13BB0 800387B0 14400004 */ bnez $v0, .L800387C4 -/* 13BB4 800387B4 0260282D */ daddu $a1, $s3, $zero -/* 13BB8 800387B8 8E040028 */ lw $a0, 0x28($s0) -/* 13BBC 800387BC 0800E1F4 */ j .L800387D0 -/* 13BC0 800387C0 00000000 */ nop -.L800387C4: -/* 13BC4 800387C4 8E020028 */ lw $v0, 0x28($s0) -/* 13BC8 800387C8 3C048000 */ lui $a0, 0x8000 -/* 13BCC 800387CC 00442025 */ or $a0, $v0, $a0 -.L800387D0: -/* 13BD0 800387D0 0C0B783B */ jal func_802DE0EC -/* 13BD4 800387D4 00000000 */ nop -/* 13BD8 800387D8 0800E1FA */ j .L800387E8 -/* 13BDC 800387DC AE020024 */ sw $v0, 0x24($s0) -.L800387E0: -/* 13BE0 800387E0 34620002 */ ori $v0, $v1, 2 -/* 13BE4 800387E4 AE020000 */ sw $v0, ($s0) -.L800387E8: -/* 13BE8 800387E8 8E050038 */ lw $a1, 0x38($s0) -/* 13BEC 800387EC 8E06003C */ lw $a2, 0x3c($s0) -/* 13BF0 800387F0 8E070040 */ lw $a3, 0x40($s0) -/* 13BF4 800387F4 0C044898 */ jal create_shadow_type -/* 13BF8 800387F8 0000202D */ daddu $a0, $zero, $zero -/* 13BFC 800387FC 3C013F80 */ lui $at, 0x3f80 -/* 13C00 80038800 44810000 */ mtc1 $at, $f0 -/* 13C04 80038804 3C038007 */ lui $v1, %hi(gGameStatusPtr) -/* 13C08 80038808 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) -/* 13C0C 8003880C AE020078 */ sw $v0, 0x78($s0) -/* 13C10 80038810 E600007C */ swc1 $f0, 0x7c($s0) -/* 13C14 80038814 80620070 */ lb $v0, 0x70($v1) -/* 13C18 80038818 54400001 */ bnel $v0, $zero, .L80038820 -/* 13C1C 8003881C 36310800 */ ori $s1, $s1, 0x800 -.L80038820: -/* 13C20 80038820 0220102D */ daddu $v0, $s1, $zero -/* 13C24 80038824 8FBF0024 */ lw $ra, 0x24($sp) -/* 13C28 80038828 8FB40020 */ lw $s4, 0x20($sp) -/* 13C2C 8003882C 8FB3001C */ lw $s3, 0x1c($sp) -/* 13C30 80038830 8FB20018 */ lw $s2, 0x18($sp) -/* 13C34 80038834 8FB10014 */ lw $s1, 0x14($sp) -/* 13C38 80038838 8FB00010 */ lw $s0, 0x10($sp) -/* 13C3C 8003883C 03E00008 */ jr $ra -/* 13C40 80038840 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/ver/us/asm/nonmatchings/npc/npc_do_world_collision.s b/ver/us/asm/nonmatchings/npc/npc_do_world_collision.s deleted file mode 100644 index 58ff9a4834..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_do_world_collision.s +++ /dev/null @@ -1,348 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel npc_do_world_collision -/* 13EFC 80038AFC 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 13F00 80038B00 AFB00030 */ sw $s0, 0x30($sp) -/* 13F04 80038B04 0080802D */ daddu $s0, $a0, $zero -/* 13F08 80038B08 AFBF0034 */ sw $ra, 0x34($sp) -/* 13F0C 80038B0C 8E030000 */ lw $v1, ($s0) -/* 13F10 80038B10 30620040 */ andi $v0, $v1, 0x40 -/* 13F14 80038B14 10400003 */ beqz $v0, .L80038B24 -/* 13F18 80038B18 3C020800 */ lui $v0, 0x800 -/* 13F1C 80038B1C 0800E3FE */ j .L80038FF8 -/* 13F20 80038B20 00621025 */ or $v0, $v1, $v0 -.L80038B24: -/* 13F24 80038B24 C6020038 */ lwc1 $f2, 0x38($s0) -/* 13F28 80038B28 C600006C */ lwc1 $f0, 0x6c($s0) -/* 13F2C 80038B2C 46001032 */ c.eq.s $f2, $f0 -/* 13F30 80038B30 00000000 */ nop -/* 13F34 80038B34 45020011 */ bc1fl .L80038B7C -/* 13F38 80038B38 3C03F7FF */ lui $v1, 0xf7ff -/* 13F3C 80038B3C C602003C */ lwc1 $f2, 0x3c($s0) -/* 13F40 80038B40 C6000070 */ lwc1 $f0, 0x70($s0) -/* 13F44 80038B44 46001032 */ c.eq.s $f2, $f0 -/* 13F48 80038B48 00000000 */ nop -/* 13F4C 80038B4C 4502000B */ bc1fl .L80038B7C -/* 13F50 80038B50 3C03F7FF */ lui $v1, 0xf7ff -/* 13F54 80038B54 C6020040 */ lwc1 $f2, 0x40($s0) -/* 13F58 80038B58 C6000074 */ lwc1 $f0, 0x74($s0) -/* 13F5C 80038B5C 46001032 */ c.eq.s $f2, $f0 -/* 13F60 80038B60 00000000 */ nop -/* 13F64 80038B64 45000004 */ bc1f .L80038B78 -/* 13F68 80038B68 3C020800 */ lui $v0, 0x800 -/* 13F6C 80038B6C 00621024 */ and $v0, $v1, $v0 -/* 13F70 80038B70 10400122 */ beqz $v0, .L80038FFC -/* 13F74 80038B74 00000000 */ nop -.L80038B78: -/* 13F78 80038B78 3C03F7FF */ lui $v1, 0xf7ff -.L80038B7C: -/* 13F7C 80038B7C 3463FFFF */ ori $v1, $v1, 0xffff -/* 13F80 80038B80 8E020000 */ lw $v0, ($s0) -/* 13F84 80038B84 C60C000C */ lwc1 $f12, 0xc($s0) -/* 13F88 80038B88 00431024 */ and $v0, $v0, $v1 -/* 13F8C 80038B8C 0C00A6C9 */ jal clamp_angle -/* 13F90 80038B90 AE020000 */ sw $v0, ($s0) -/* 13F94 80038B94 C6020038 */ lwc1 $f2, 0x38($s0) -/* 13F98 80038B98 C604003C */ lwc1 $f4, 0x3c($s0) -/* 13F9C 80038B9C C6060040 */ lwc1 $f6, 0x40($s0) -/* 13FA0 80038BA0 E7A20020 */ swc1 $f2, 0x20($sp) -/* 13FA4 80038BA4 E7A40024 */ swc1 $f4, 0x24($sp) -/* 13FA8 80038BA8 E7A60028 */ swc1 $f6, 0x28($sp) -/* 13FAC 80038BAC 8E020000 */ lw $v0, ($s0) -/* 13FB0 80038BB0 3C030400 */ lui $v1, 0x400 -/* 13FB4 80038BB4 00431024 */ and $v0, $v0, $v1 -/* 13FB8 80038BB8 14400013 */ bnez $v0, .L80038C08 -/* 13FBC 80038BBC AFA00010 */ sw $zero, 0x10($sp) -/* 13FC0 80038BC0 E7A00014 */ swc1 $f0, 0x14($sp) -/* 13FC4 80038BC4 860200A8 */ lh $v0, 0xa8($s0) -/* 13FC8 80038BC8 27A50020 */ addiu $a1, $sp, 0x20 -/* 13FCC 80038BCC 44820000 */ mtc1 $v0, $f0 -/* 13FD0 80038BD0 00000000 */ nop -/* 13FD4 80038BD4 46800020 */ cvt.s.w $f0, $f0 -/* 13FD8 80038BD8 E7A00018 */ swc1 $f0, 0x18($sp) -/* 13FDC 80038BDC 860200A6 */ lh $v0, 0xa6($s0) -/* 13FE0 80038BE0 27A60024 */ addiu $a2, $sp, 0x24 -/* 13FE4 80038BE4 44820000 */ mtc1 $v0, $f0 -/* 13FE8 80038BE8 00000000 */ nop -/* 13FEC 80038BEC 46800020 */ cvt.s.w $f0, $f0 -/* 13FF0 80038BF0 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 13FF4 80038BF4 8E040080 */ lw $a0, 0x80($s0) -/* 13FF8 80038BF8 0C037711 */ jal func_800DDC44 -/* 13FFC 80038BFC 27A70028 */ addiu $a3, $sp, 0x28 -/* 14000 80038C00 0800E312 */ j .L80038C48 -/* 14004 80038C04 00000000 */ nop -.L80038C08: -/* 14008 80038C08 E7A00014 */ swc1 $f0, 0x14($sp) -/* 1400C 80038C0C 860200A8 */ lh $v0, 0xa8($s0) -/* 14010 80038C10 27A50020 */ addiu $a1, $sp, 0x20 -/* 14014 80038C14 44820000 */ mtc1 $v0, $f0 -/* 14018 80038C18 00000000 */ nop -/* 1401C 80038C1C 46800020 */ cvt.s.w $f0, $f0 -/* 14020 80038C20 E7A00018 */ swc1 $f0, 0x18($sp) -/* 14024 80038C24 860200A6 */ lh $v0, 0xa6($s0) -/* 14028 80038C28 27A60024 */ addiu $a2, $sp, 0x24 -/* 1402C 80038C2C 44820000 */ mtc1 $v0, $f0 -/* 14030 80038C30 00000000 */ nop -/* 14034 80038C34 46800020 */ cvt.s.w $f0, $f0 -/* 14038 80038C38 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 1403C 80038C3C 8E040080 */ lw $a0, 0x80($s0) -/* 14040 80038C40 0C037765 */ jal func_800DDD94 -/* 14044 80038C44 27A70028 */ addiu $a3, $sp, 0x28 -.L80038C48: -/* 14048 80038C48 1040000C */ beqz $v0, .L80038C7C -/* 1404C 80038C4C 24039FFF */ addiu $v1, $zero, -0x6001 -/* 14050 80038C50 8E020000 */ lw $v0, ($s0) -/* 14054 80038C54 3C038011 */ lui $v1, %hi(D_8010C97A) -/* 14058 80038C58 9463C97A */ lhu $v1, %lo(D_8010C97A)($v1) -/* 1405C 80038C5C C7A00020 */ lwc1 $f0, 0x20($sp) -/* 14060 80038C60 C7A20028 */ lwc1 $f2, 0x28($sp) -/* 14064 80038C64 34426000 */ ori $v0, $v0, 0x6000 -/* 14068 80038C68 AE020000 */ sw $v0, ($s0) -/* 1406C 80038C6C A6030086 */ sh $v1, 0x86($s0) -/* 14070 80038C70 E6000038 */ swc1 $f0, 0x38($s0) -/* 14074 80038C74 0800E322 */ j .L80038C88 -/* 14078 80038C78 E6020040 */ swc1 $f2, 0x40($s0) -.L80038C7C: -/* 1407C 80038C7C 8E020000 */ lw $v0, ($s0) -/* 14080 80038C80 00431024 */ and $v0, $v0, $v1 -/* 14084 80038C84 AE020000 */ sw $v0, ($s0) -.L80038C88: -/* 14088 80038C88 C600000C */ lwc1 $f0, 0xc($s0) -/* 1408C 80038C8C 3C014234 */ lui $at, 0x4234 -/* 14090 80038C90 44816000 */ mtc1 $at, $f12 -/* 14094 80038C94 0C00A6C9 */ jal clamp_angle -/* 14098 80038C98 460C0300 */ add.s $f12, $f0, $f12 -/* 1409C 80038C9C C6020038 */ lwc1 $f2, 0x38($s0) -/* 140A0 80038CA0 C604003C */ lwc1 $f4, 0x3c($s0) -/* 140A4 80038CA4 C6060040 */ lwc1 $f6, 0x40($s0) -/* 140A8 80038CA8 E7A20020 */ swc1 $f2, 0x20($sp) -/* 140AC 80038CAC E7A40024 */ swc1 $f4, 0x24($sp) -/* 140B0 80038CB0 E7A60028 */ swc1 $f6, 0x28($sp) -/* 140B4 80038CB4 8E020000 */ lw $v0, ($s0) -/* 140B8 80038CB8 3C030400 */ lui $v1, 0x400 -/* 140BC 80038CBC 00431024 */ and $v0, $v0, $v1 -/* 140C0 80038CC0 14400013 */ bnez $v0, .L80038D10 -/* 140C4 80038CC4 AFA00010 */ sw $zero, 0x10($sp) -/* 140C8 80038CC8 E7A00014 */ swc1 $f0, 0x14($sp) -/* 140CC 80038CCC 860200A8 */ lh $v0, 0xa8($s0) -/* 140D0 80038CD0 27A50020 */ addiu $a1, $sp, 0x20 -/* 140D4 80038CD4 44820000 */ mtc1 $v0, $f0 -/* 140D8 80038CD8 00000000 */ nop -/* 140DC 80038CDC 46800020 */ cvt.s.w $f0, $f0 -/* 140E0 80038CE0 E7A00018 */ swc1 $f0, 0x18($sp) -/* 140E4 80038CE4 860200A6 */ lh $v0, 0xa6($s0) -/* 140E8 80038CE8 27A60024 */ addiu $a2, $sp, 0x24 -/* 140EC 80038CEC 44820000 */ mtc1 $v0, $f0 -/* 140F0 80038CF0 00000000 */ nop -/* 140F4 80038CF4 46800020 */ cvt.s.w $f0, $f0 -/* 140F8 80038CF8 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 140FC 80038CFC 8E040080 */ lw $a0, 0x80($s0) -/* 14100 80038D00 0C037711 */ jal func_800DDC44 -/* 14104 80038D04 27A70028 */ addiu $a3, $sp, 0x28 -/* 14108 80038D08 0800E354 */ j .L80038D50 -/* 1410C 80038D0C 00000000 */ nop -.L80038D10: -/* 14110 80038D10 E7A00014 */ swc1 $f0, 0x14($sp) -/* 14114 80038D14 860200A8 */ lh $v0, 0xa8($s0) -/* 14118 80038D18 27A50020 */ addiu $a1, $sp, 0x20 -/* 1411C 80038D1C 44820000 */ mtc1 $v0, $f0 -/* 14120 80038D20 00000000 */ nop -/* 14124 80038D24 46800020 */ cvt.s.w $f0, $f0 -/* 14128 80038D28 E7A00018 */ swc1 $f0, 0x18($sp) -/* 1412C 80038D2C 860200A6 */ lh $v0, 0xa6($s0) -/* 14130 80038D30 27A60024 */ addiu $a2, $sp, 0x24 -/* 14134 80038D34 44820000 */ mtc1 $v0, $f0 -/* 14138 80038D38 00000000 */ nop -/* 1413C 80038D3C 46800020 */ cvt.s.w $f0, $f0 -/* 14140 80038D40 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 14144 80038D44 8E040080 */ lw $a0, 0x80($s0) -/* 14148 80038D48 0C0376B9 */ jal func_800DDAE4 -/* 1414C 80038D4C 27A70028 */ addiu $a3, $sp, 0x28 -.L80038D50: -/* 14150 80038D50 10400009 */ beqz $v0, .L80038D78 -/* 14154 80038D54 2403DFFF */ addiu $v1, $zero, -0x2001 -/* 14158 80038D58 8E020000 */ lw $v0, ($s0) -/* 1415C 80038D5C C7A00020 */ lwc1 $f0, 0x20($sp) -/* 14160 80038D60 C7A20028 */ lwc1 $f2, 0x28($sp) -/* 14164 80038D64 34422000 */ ori $v0, $v0, 0x2000 -/* 14168 80038D68 AE020000 */ sw $v0, ($s0) -/* 1416C 80038D6C E6000038 */ swc1 $f0, 0x38($s0) -/* 14170 80038D70 0800E361 */ j .L80038D84 -/* 14174 80038D74 E6020040 */ swc1 $f2, 0x40($s0) -.L80038D78: -/* 14178 80038D78 8E020000 */ lw $v0, ($s0) -/* 1417C 80038D7C 00431024 */ and $v0, $v0, $v1 -/* 14180 80038D80 AE020000 */ sw $v0, ($s0) -.L80038D84: -/* 14184 80038D84 C600000C */ lwc1 $f0, 0xc($s0) -/* 14188 80038D88 3C014234 */ lui $at, 0x4234 -/* 1418C 80038D8C 44816000 */ mtc1 $at, $f12 -/* 14190 80038D90 0C00A6C9 */ jal clamp_angle -/* 14194 80038D94 460C0301 */ sub.s $f12, $f0, $f12 -/* 14198 80038D98 C6020038 */ lwc1 $f2, 0x38($s0) -/* 1419C 80038D9C C604003C */ lwc1 $f4, 0x3c($s0) -/* 141A0 80038DA0 C6060040 */ lwc1 $f6, 0x40($s0) -/* 141A4 80038DA4 E7A20020 */ swc1 $f2, 0x20($sp) -/* 141A8 80038DA8 E7A40024 */ swc1 $f4, 0x24($sp) -/* 141AC 80038DAC E7A60028 */ swc1 $f6, 0x28($sp) -/* 141B0 80038DB0 8E020000 */ lw $v0, ($s0) -/* 141B4 80038DB4 3C030400 */ lui $v1, 0x400 -/* 141B8 80038DB8 00431024 */ and $v0, $v0, $v1 -/* 141BC 80038DBC 14400013 */ bnez $v0, .L80038E0C -/* 141C0 80038DC0 AFA00010 */ sw $zero, 0x10($sp) -/* 141C4 80038DC4 E7A00014 */ swc1 $f0, 0x14($sp) -/* 141C8 80038DC8 860200A8 */ lh $v0, 0xa8($s0) -/* 141CC 80038DCC 27A50020 */ addiu $a1, $sp, 0x20 -/* 141D0 80038DD0 44820000 */ mtc1 $v0, $f0 -/* 141D4 80038DD4 00000000 */ nop -/* 141D8 80038DD8 46800020 */ cvt.s.w $f0, $f0 -/* 141DC 80038DDC E7A00018 */ swc1 $f0, 0x18($sp) -/* 141E0 80038DE0 860200A6 */ lh $v0, 0xa6($s0) -/* 141E4 80038DE4 27A60024 */ addiu $a2, $sp, 0x24 -/* 141E8 80038DE8 44820000 */ mtc1 $v0, $f0 -/* 141EC 80038DEC 00000000 */ nop -/* 141F0 80038DF0 46800020 */ cvt.s.w $f0, $f0 -/* 141F4 80038DF4 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 141F8 80038DF8 8E040080 */ lw $a0, 0x80($s0) -/* 141FC 80038DFC 0C037711 */ jal func_800DDC44 -/* 14200 80038E00 27A70028 */ addiu $a3, $sp, 0x28 -/* 14204 80038E04 0800E393 */ j .L80038E4C -/* 14208 80038E08 00000000 */ nop -.L80038E0C: -/* 1420C 80038E0C E7A00014 */ swc1 $f0, 0x14($sp) -/* 14210 80038E10 860200A8 */ lh $v0, 0xa8($s0) -/* 14214 80038E14 27A50020 */ addiu $a1, $sp, 0x20 -/* 14218 80038E18 44820000 */ mtc1 $v0, $f0 -/* 1421C 80038E1C 00000000 */ nop -/* 14220 80038E20 46800020 */ cvt.s.w $f0, $f0 -/* 14224 80038E24 E7A00018 */ swc1 $f0, 0x18($sp) -/* 14228 80038E28 860200A6 */ lh $v0, 0xa6($s0) -/* 1422C 80038E2C 27A60024 */ addiu $a2, $sp, 0x24 -/* 14230 80038E30 44820000 */ mtc1 $v0, $f0 -/* 14234 80038E34 00000000 */ nop -/* 14238 80038E38 46800020 */ cvt.s.w $f0, $f0 -/* 1423C 80038E3C E7A0001C */ swc1 $f0, 0x1c($sp) -/* 14240 80038E40 8E040080 */ lw $a0, 0x80($s0) -/* 14244 80038E44 0C0376B9 */ jal func_800DDAE4 -/* 14248 80038E48 27A70028 */ addiu $a3, $sp, 0x28 -.L80038E4C: -/* 1424C 80038E4C 10400009 */ beqz $v0, .L80038E74 -/* 14250 80038E50 2403DFFF */ addiu $v1, $zero, -0x2001 -/* 14254 80038E54 8E020000 */ lw $v0, ($s0) -/* 14258 80038E58 C7A00020 */ lwc1 $f0, 0x20($sp) -/* 1425C 80038E5C C7A20028 */ lwc1 $f2, 0x28($sp) -/* 14260 80038E60 34422000 */ ori $v0, $v0, 0x2000 -/* 14264 80038E64 AE020000 */ sw $v0, ($s0) -/* 14268 80038E68 E6000038 */ swc1 $f0, 0x38($s0) -/* 1426C 80038E6C 0800E3A0 */ j .L80038E80 -/* 14270 80038E70 E6020040 */ swc1 $f2, 0x40($s0) -.L80038E74: -/* 14274 80038E74 8E020000 */ lw $v0, ($s0) -/* 14278 80038E78 00431024 */ and $v0, $v0, $v1 -/* 1427C 80038E7C AE020000 */ sw $v0, ($s0) -.L80038E80: -/* 14280 80038E80 8E020000 */ lw $v0, ($s0) -/* 14284 80038E84 3C030400 */ lui $v1, 0x400 -/* 14288 80038E88 00431024 */ and $v0, $v0, $v1 -/* 1428C 80038E8C 1040005B */ beqz $v0, .L80038FFC -/* 14290 80038E90 00000000 */ nop -/* 14294 80038E94 C60C000C */ lwc1 $f12, 0xc($s0) -/* 14298 80038E98 3C014234 */ lui $at, 0x4234 -/* 1429C 80038E9C 44810000 */ mtc1 $at, $f0 -/* 142A0 80038EA0 00000000 */ nop -/* 142A4 80038EA4 46006300 */ add.s $f12, $f12, $f0 -/* 142A8 80038EA8 3C014334 */ lui $at, 0x4334 -/* 142AC 80038EAC 44810000 */ mtc1 $at, $f0 -/* 142B0 80038EB0 0C00A6C9 */ jal clamp_angle -/* 142B4 80038EB4 46006300 */ add.s $f12, $f12, $f0 -/* 142B8 80038EB8 C6020038 */ lwc1 $f2, 0x38($s0) -/* 142BC 80038EBC C604003C */ lwc1 $f4, 0x3c($s0) -/* 142C0 80038EC0 C6060040 */ lwc1 $f6, 0x40($s0) -/* 142C4 80038EC4 E7A20020 */ swc1 $f2, 0x20($sp) -/* 142C8 80038EC8 E7A40024 */ swc1 $f4, 0x24($sp) -/* 142CC 80038ECC E7A60028 */ swc1 $f6, 0x28($sp) -/* 142D0 80038ED0 AFA00010 */ sw $zero, 0x10($sp) -/* 142D4 80038ED4 E7A00014 */ swc1 $f0, 0x14($sp) -/* 142D8 80038ED8 860200A8 */ lh $v0, 0xa8($s0) -/* 142DC 80038EDC 27A50020 */ addiu $a1, $sp, 0x20 -/* 142E0 80038EE0 44820000 */ mtc1 $v0, $f0 -/* 142E4 80038EE4 00000000 */ nop -/* 142E8 80038EE8 46800020 */ cvt.s.w $f0, $f0 -/* 142EC 80038EEC E7A00018 */ swc1 $f0, 0x18($sp) -/* 142F0 80038EF0 860200A6 */ lh $v0, 0xa6($s0) -/* 142F4 80038EF4 27A60024 */ addiu $a2, $sp, 0x24 -/* 142F8 80038EF8 44820000 */ mtc1 $v0, $f0 -/* 142FC 80038EFC 00000000 */ nop -/* 14300 80038F00 46800020 */ cvt.s.w $f0, $f0 -/* 14304 80038F04 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 14308 80038F08 8E040080 */ lw $a0, 0x80($s0) -/* 1430C 80038F0C 0C037711 */ jal func_800DDC44 -/* 14310 80038F10 27A70028 */ addiu $a3, $sp, 0x28 -/* 14314 80038F14 10400009 */ beqz $v0, .L80038F3C -/* 14318 80038F18 2403DFFF */ addiu $v1, $zero, -0x2001 -/* 1431C 80038F1C 8E020000 */ lw $v0, ($s0) -/* 14320 80038F20 C7A00020 */ lwc1 $f0, 0x20($sp) -/* 14324 80038F24 C7A20028 */ lwc1 $f2, 0x28($sp) -/* 14328 80038F28 34422000 */ ori $v0, $v0, 0x2000 -/* 1432C 80038F2C AE020000 */ sw $v0, ($s0) -/* 14330 80038F30 E6000038 */ swc1 $f0, 0x38($s0) -/* 14334 80038F34 0800E3D2 */ j .L80038F48 -/* 14338 80038F38 E6020040 */ swc1 $f2, 0x40($s0) -.L80038F3C: -/* 1433C 80038F3C 8E020000 */ lw $v0, ($s0) -/* 14340 80038F40 00431024 */ and $v0, $v0, $v1 -/* 14344 80038F44 AE020000 */ sw $v0, ($s0) -.L80038F48: -/* 14348 80038F48 C60C000C */ lwc1 $f12, 0xc($s0) -/* 1434C 80038F4C 3C014234 */ lui $at, 0x4234 -/* 14350 80038F50 44810000 */ mtc1 $at, $f0 -/* 14354 80038F54 00000000 */ nop -/* 14358 80038F58 46006301 */ sub.s $f12, $f12, $f0 -/* 1435C 80038F5C 3C014334 */ lui $at, 0x4334 -/* 14360 80038F60 44810000 */ mtc1 $at, $f0 -/* 14364 80038F64 0C00A6C9 */ jal clamp_angle -/* 14368 80038F68 46006300 */ add.s $f12, $f12, $f0 -/* 1436C 80038F6C C6020038 */ lwc1 $f2, 0x38($s0) -/* 14370 80038F70 C604003C */ lwc1 $f4, 0x3c($s0) -/* 14374 80038F74 C6060040 */ lwc1 $f6, 0x40($s0) -/* 14378 80038F78 E7A20020 */ swc1 $f2, 0x20($sp) -/* 1437C 80038F7C E7A40024 */ swc1 $f4, 0x24($sp) -/* 14380 80038F80 E7A60028 */ swc1 $f6, 0x28($sp) -/* 14384 80038F84 AFA00010 */ sw $zero, 0x10($sp) -/* 14388 80038F88 E7A00014 */ swc1 $f0, 0x14($sp) -/* 1438C 80038F8C 860200A8 */ lh $v0, 0xa8($s0) -/* 14390 80038F90 27A50020 */ addiu $a1, $sp, 0x20 -/* 14394 80038F94 44820000 */ mtc1 $v0, $f0 -/* 14398 80038F98 00000000 */ nop -/* 1439C 80038F9C 46800020 */ cvt.s.w $f0, $f0 -/* 143A0 80038FA0 E7A00018 */ swc1 $f0, 0x18($sp) -/* 143A4 80038FA4 860200A6 */ lh $v0, 0xa6($s0) -/* 143A8 80038FA8 27A60024 */ addiu $a2, $sp, 0x24 -/* 143AC 80038FAC 44820000 */ mtc1 $v0, $f0 -/* 143B0 80038FB0 00000000 */ nop -/* 143B4 80038FB4 46800020 */ cvt.s.w $f0, $f0 -/* 143B8 80038FB8 E7A0001C */ swc1 $f0, 0x1c($sp) -/* 143BC 80038FBC 8E040080 */ lw $a0, 0x80($s0) -/* 143C0 80038FC0 0C037711 */ jal func_800DDC44 -/* 143C4 80038FC4 27A70028 */ addiu $a3, $sp, 0x28 -/* 143C8 80038FC8 10400009 */ beqz $v0, .L80038FF0 -/* 143CC 80038FCC 2403DFFF */ addiu $v1, $zero, -0x2001 -/* 143D0 80038FD0 8E020000 */ lw $v0, ($s0) -/* 143D4 80038FD4 C7A00020 */ lwc1 $f0, 0x20($sp) -/* 143D8 80038FD8 C7A20028 */ lwc1 $f2, 0x28($sp) -/* 143DC 80038FDC 34422000 */ ori $v0, $v0, 0x2000 -/* 143E0 80038FE0 AE020000 */ sw $v0, ($s0) -/* 143E4 80038FE4 E6000038 */ swc1 $f0, 0x38($s0) -/* 143E8 80038FE8 0800E3FF */ j .L80038FFC -/* 143EC 80038FEC E6020040 */ swc1 $f2, 0x40($s0) -.L80038FF0: -/* 143F0 80038FF0 8E020000 */ lw $v0, ($s0) -/* 143F4 80038FF4 00431024 */ and $v0, $v0, $v1 -.L80038FF8: -/* 143F8 80038FF8 AE020000 */ sw $v0, ($s0) -.L80038FFC: -/* 143FC 80038FFC 8FBF0034 */ lw $ra, 0x34($sp) -/* 14400 80039000 8FB00030 */ lw $s0, 0x30($sp) -/* 14404 80039004 03E00008 */ jr $ra -/* 14408 80039008 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/ver/us/asm/nonmatchings/npc/npc_free.s b/ver/us/asm/nonmatchings/npc/npc_free.s deleted file mode 100644 index e0895bdd38..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_free.s +++ /dev/null @@ -1,79 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel npc_free -/* 13DCC 800389CC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 13DD0 800389D0 AFB10014 */ sw $s1, 0x14($sp) -/* 13DD4 800389D4 0080882D */ daddu $s1, $a0, $zero -/* 13DD8 800389D8 AFBF0018 */ sw $ra, 0x18($sp) -/* 13DDC 800389DC AFB00010 */ sw $s0, 0x10($sp) -/* 13DE0 800389E0 8E240020 */ lw $a0, 0x20($s1) -/* 13DE4 800389E4 10800004 */ beqz $a0, .L800389F8 -/* 13DE8 800389E8 00000000 */ nop -/* 13DEC 800389EC 0C00AB4B */ jal heap_free -/* 13DF0 800389F0 00000000 */ nop -/* 13DF4 800389F4 AE200020 */ sw $zero, 0x20($s1) -.L800389F8: -/* 13DF8 800389F8 8E230000 */ lw $v1, ($s1) -/* 13DFC 800389FC 3C024000 */ lui $v0, 0x4000 -/* 13E00 80038A00 00621024 */ and $v0, $v1, $v0 -/* 13E04 80038A04 1440000A */ bnez $v0, .L80038A30 -/* 13E08 80038A08 3C020100 */ lui $v0, 0x100 -/* 13E0C 80038A0C 00621024 */ and $v0, $v1, $v0 -/* 13E10 80038A10 14400007 */ bnez $v0, .L80038A30 -/* 13E14 80038A14 00000000 */ nop -/* 13E18 80038A18 0C0B797A */ jal func_802DE5E8 -/* 13E1C 80038A1C 8E240024 */ lw $a0, 0x24($s1) -/* 13E20 80038A20 10400003 */ beqz $v0, .L80038A30 -/* 13E24 80038A24 00000000 */ nop -.L80038A28: -/* 13E28 80038A28 0800E28A */ j .L80038A28 -/* 13E2C 80038A2C 00000000 */ nop -.L80038A30: -/* 13E30 80038A30 8E240078 */ lw $a0, 0x78($s1) -/* 13E34 80038A34 0C0448CA */ jal func_80112328 -/* 13E38 80038A38 0000802D */ daddu $s0, $zero, $zero -/* 13E3C 80038A3C 0220202D */ daddu $a0, $s1, $zero -.L80038A40: -/* 13E40 80038A40 0C00F10A */ jal func_8003C428 -/* 13E44 80038A44 0200282D */ daddu $a1, $s0, $zero -/* 13E48 80038A48 26100001 */ addiu $s0, $s0, 1 -/* 13E4C 80038A4C 2A020002 */ slti $v0, $s0, 2 -/* 13E50 80038A50 1440FFFB */ bnez $v0, .L80038A40 -/* 13E54 80038A54 0220202D */ daddu $a0, $s1, $zero -/* 13E58 80038A58 8E220000 */ lw $v0, ($s1) -/* 13E5C 80038A5C 3C030010 */ lui $v1, 0x10 -/* 13E60 80038A60 00431024 */ and $v0, $v0, $v1 -/* 13E64 80038A64 10400003 */ beqz $v0, .L80038A74 -/* 13E68 80038A68 00000000 */ nop -/* 13E6C 80038A6C 0C00EB6B */ jal disable_npc_blur -/* 13E70 80038A70 0220202D */ daddu $a0, $s1, $zero -.L80038A74: -/* 13E74 80038A74 0C00AB4B */ jal heap_free -/* 13E78 80038A78 0220202D */ daddu $a0, $s1, $zero -/* 13E7C 80038A7C 3C05800A */ lui $a1, %hi(gCurrentNpcListPtr) -/* 13E80 80038A80 8CA50B90 */ lw $a1, %lo(gCurrentNpcListPtr)($a1) -/* 13E84 80038A84 0000802D */ daddu $s0, $zero, $zero -/* 13E88 80038A88 00A0182D */ daddu $v1, $a1, $zero -.L80038A8C: -/* 13E8C 80038A8C 8C620000 */ lw $v0, ($v1) -/* 13E90 80038A90 10510006 */ beq $v0, $s1, .L80038AAC -/* 13E94 80038A94 00101080 */ sll $v0, $s0, 2 -/* 13E98 80038A98 26100001 */ addiu $s0, $s0, 1 -/* 13E9C 80038A9C 2A020040 */ slti $v0, $s0, 0x40 -/* 13EA0 80038AA0 1440FFFA */ bnez $v0, .L80038A8C -/* 13EA4 80038AA4 24630004 */ addiu $v1, $v1, 4 -/* 13EA8 80038AA8 00101080 */ sll $v0, $s0, 2 -.L80038AAC: -/* 13EAC 80038AAC 3C04800A */ lui $a0, %hi(D_8009A604) -/* 13EB0 80038AB0 2484A604 */ addiu $a0, $a0, %lo(D_8009A604) -/* 13EB4 80038AB4 94830000 */ lhu $v1, ($a0) -/* 13EB8 80038AB8 00451021 */ addu $v0, $v0, $a1 -/* 13EBC 80038ABC AC400000 */ sw $zero, ($v0) -/* 13EC0 80038AC0 2463FFFF */ addiu $v1, $v1, -1 -/* 13EC4 80038AC4 A4830000 */ sh $v1, ($a0) -/* 13EC8 80038AC8 8FBF0018 */ lw $ra, 0x18($sp) -/* 13ECC 80038ACC 8FB10014 */ lw $s1, 0x14($sp) -/* 13ED0 80038AD0 8FB00010 */ lw $s0, 0x10($sp) -/* 13ED4 80038AD4 03E00008 */ jr $ra -/* 13ED8 80038AD8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/npc_free_by_index.s b/ver/us/asm/nonmatchings/npc/npc_free_by_index.s deleted file mode 100644 index 0497a99581..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_free_by_index.s +++ /dev/null @@ -1,85 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel npc_free_by_index -/* 13CA0 800388A0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 13CA4 800388A4 2402F7FF */ addiu $v0, $zero, -0x801 -/* 13CA8 800388A8 AFB20018 */ sw $s2, 0x18($sp) -/* 13CAC 800388AC 00829024 */ and $s2, $a0, $v0 -/* 13CB0 800388B0 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr) -/* 13CB4 800388B4 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1) -/* 13CB8 800388B8 00121080 */ sll $v0, $s2, 2 -/* 13CBC 800388BC AFBF001C */ sw $ra, 0x1c($sp) -/* 13CC0 800388C0 AFB10014 */ sw $s1, 0x14($sp) -/* 13CC4 800388C4 AFB00010 */ sw $s0, 0x10($sp) -/* 13CC8 800388C8 00431021 */ addu $v0, $v0, $v1 -/* 13CCC 800388CC 8C500000 */ lw $s0, ($v0) -/* 13CD0 800388D0 12000038 */ beqz $s0, .L800389B4 -/* 13CD4 800388D4 00000000 */ nop -/* 13CD8 800388D8 8E020000 */ lw $v0, ($s0) -/* 13CDC 800388DC 10400035 */ beqz $v0, .L800389B4 -/* 13CE0 800388E0 00000000 */ nop -/* 13CE4 800388E4 8E040020 */ lw $a0, 0x20($s0) -/* 13CE8 800388E8 10800004 */ beqz $a0, .L800388FC -/* 13CEC 800388EC 00000000 */ nop -/* 13CF0 800388F0 0C00AB4B */ jal heap_free -/* 13CF4 800388F4 00000000 */ nop -/* 13CF8 800388F8 AE000020 */ sw $zero, 0x20($s0) -.L800388FC: -/* 13CFC 800388FC 8E030000 */ lw $v1, ($s0) -/* 13D00 80038900 3C024000 */ lui $v0, 0x4000 -/* 13D04 80038904 00621024 */ and $v0, $v1, $v0 -/* 13D08 80038908 1440000A */ bnez $v0, .L80038934 -/* 13D0C 8003890C 3C020100 */ lui $v0, 0x100 -/* 13D10 80038910 00621024 */ and $v0, $v1, $v0 -/* 13D14 80038914 14400007 */ bnez $v0, .L80038934 -/* 13D18 80038918 00000000 */ nop -/* 13D1C 8003891C 0C0B797A */ jal func_802DE5E8 -/* 13D20 80038920 8E040024 */ lw $a0, 0x24($s0) -/* 13D24 80038924 10400003 */ beqz $v0, .L80038934 -/* 13D28 80038928 00000000 */ nop -.L8003892C: -/* 13D2C 8003892C 0800E24B */ j .L8003892C -/* 13D30 80038930 00000000 */ nop -.L80038934: -/* 13D34 80038934 8E040078 */ lw $a0, 0x78($s0) -/* 13D38 80038938 0C0448CA */ jal func_80112328 -/* 13D3C 8003893C 0000882D */ daddu $s1, $zero, $zero -/* 13D40 80038940 0200202D */ daddu $a0, $s0, $zero -.L80038944: -/* 13D44 80038944 0C00F10A */ jal func_8003C428 -/* 13D48 80038948 0220282D */ daddu $a1, $s1, $zero -/* 13D4C 8003894C 26310001 */ addiu $s1, $s1, 1 -/* 13D50 80038950 2A220002 */ slti $v0, $s1, 2 -/* 13D54 80038954 1440FFFB */ bnez $v0, .L80038944 -/* 13D58 80038958 0200202D */ daddu $a0, $s0, $zero -/* 13D5C 8003895C 8E020000 */ lw $v0, ($s0) -/* 13D60 80038960 3C030010 */ lui $v1, 0x10 -/* 13D64 80038964 00431024 */ and $v0, $v0, $v1 -/* 13D68 80038968 10400003 */ beqz $v0, .L80038978 -/* 13D6C 8003896C 00000000 */ nop -/* 13D70 80038970 0C00EB6B */ jal disable_npc_blur -/* 13D74 80038974 0200202D */ daddu $a0, $s0, $zero -.L80038978: -/* 13D78 80038978 3C11800A */ lui $s1, %hi(gCurrentNpcListPtr) -/* 13D7C 8003897C 26310B90 */ addiu $s1, $s1, %lo(gCurrentNpcListPtr) -/* 13D80 80038980 8E220000 */ lw $v0, ($s1) -/* 13D84 80038984 00128080 */ sll $s0, $s2, 2 -/* 13D88 80038988 02021021 */ addu $v0, $s0, $v0 -/* 13D8C 8003898C 0C00AB4B */ jal heap_free -/* 13D90 80038990 8C440000 */ lw $a0, ($v0) -/* 13D94 80038994 3C04800A */ lui $a0, %hi(D_8009A604) -/* 13D98 80038998 2484A604 */ addiu $a0, $a0, %lo(D_8009A604) -/* 13D9C 8003899C 8E230000 */ lw $v1, ($s1) -/* 13DA0 800389A0 94820000 */ lhu $v0, ($a0) -/* 13DA4 800389A4 02038021 */ addu $s0, $s0, $v1 -/* 13DA8 800389A8 2442FFFF */ addiu $v0, $v0, -1 -/* 13DAC 800389AC AE000000 */ sw $zero, ($s0) -/* 13DB0 800389B0 A4820000 */ sh $v0, ($a0) -.L800389B4: -/* 13DB4 800389B4 8FBF001C */ lw $ra, 0x1c($sp) -/* 13DB8 800389B8 8FB20018 */ lw $s2, 0x18($sp) -/* 13DBC 800389BC 8FB10014 */ lw $s1, 0x14($sp) -/* 13DC0 800389C0 8FB00010 */ lw $s0, 0x10($sp) -/* 13DC4 800389C4 03E00008 */ jr $ra -/* 13DC8 800389C8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/npc/npc_list_clear.s b/ver/us/asm/nonmatchings/npc/npc_list_clear.s deleted file mode 100644 index f772b7d2d6..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_list_clear.s +++ /dev/null @@ -1,35 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel npc_list_clear -/* 138BC 800384BC 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* 138C0 800384C0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* 138C4 800384C4 80420070 */ lb $v0, 0x70($v0) -/* 138C8 800384C8 14400005 */ bnez $v0, .L800384E0 -/* 138CC 800384CC 00000000 */ nop -/* 138D0 800384D0 3C02800A */ lui $v0, %hi(gWorldNpcList) -/* 138D4 800384D4 24420990 */ addiu $v0, $v0, %lo(gWorldNpcList) -/* 138D8 800384D8 0800E13A */ j .L800384E8 -/* 138DC 800384DC 00000000 */ nop -.L800384E0: -/* 138E0 800384E0 3C02800A */ lui $v0, %hi(gBattleNpcList) -/* 138E4 800384E4 24420A90 */ addiu $v0, $v0, %lo(gBattleNpcList) -.L800384E8: -/* 138E8 800384E8 3C01800A */ lui $at, %hi(gCurrentNpcListPtr) -/* 138EC 800384EC AC220B90 */ sw $v0, %lo(gCurrentNpcListPtr)($at) -/* 138F0 800384F0 3C02800A */ lui $v0, %hi(gCurrentNpcListPtr) -/* 138F4 800384F4 8C420B90 */ lw $v0, %lo(gCurrentNpcListPtr)($v0) -/* 138F8 800384F8 2403003F */ addiu $v1, $zero, 0x3f -/* 138FC 800384FC 244200FC */ addiu $v0, $v0, 0xfc -.L80038500: -/* 13900 80038500 AC400000 */ sw $zero, ($v0) -/* 13904 80038504 2463FFFF */ addiu $v1, $v1, -1 -/* 13908 80038508 0461FFFD */ bgez $v1, .L80038500 -/* 1390C 8003850C 2442FFFC */ addiu $v0, $v0, -4 -/* 13910 80038510 24020001 */ addiu $v0, $zero, 1 -/* 13914 80038514 3C01800A */ lui $at, %hi(D_8009A604) -/* 13918 80038518 A420A604 */ sh $zero, %lo(D_8009A604)($at) -/* 1391C 8003851C 3C01800A */ lui $at, %hi(D_800A0B94) -/* 13920 80038520 A0220B94 */ sb $v0, %lo(D_800A0B94)($at) -/* 13924 80038524 03E00008 */ jr $ra -/* 13928 80038528 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/npc/npc_list_render.s b/ver/us/asm/nonmatchings/npc/npc_list_render.s deleted file mode 100644 index 5df228936d..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_list_render.s +++ /dev/null @@ -1,175 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -glabel D_800984B0 -.double 0.01 - -glabel D_800984B8 -.double -0.01 - -.section .text - -glabel npc_list_render -/* 15BF0 8003A7F0 27BDFF78 */ addiu $sp, $sp, -0x88 -/* 15BF4 8003A7F4 F7BA0080 */ sdc1 $f26, 0x80($sp) -/* 15BF8 8003A7F8 3C01459C */ lui $at, 0x459c -/* 15BFC 8003A7FC 34214000 */ ori $at, $at, 0x4000 -/* 15C00 8003A800 4481D000 */ mtc1 $at, $f26 -/* 15C04 8003A804 F7B80078 */ sdc1 $f24, 0x78($sp) -/* 15C08 8003A808 4480C000 */ mtc1 $zero, $f24 -/* 15C0C 8003A80C AFB10054 */ sw $s1, 0x54($sp) -/* 15C10 8003A810 27B10028 */ addiu $s1, $sp, 0x28 -/* 15C14 8003A814 AFB20058 */ sw $s2, 0x58($sp) -/* 15C18 8003A818 0000902D */ daddu $s2, $zero, $zero -/* 15C1C 8003A81C AFB3005C */ sw $s3, 0x5c($sp) -/* 15C20 8003A820 241300FF */ addiu $s3, $zero, 0xff -/* 15C24 8003A824 F7B60070 */ sdc1 $f22, 0x70($sp) -/* 15C28 8003A828 3C01461C */ lui $at, 0x461c -/* 15C2C 8003A82C 34214000 */ ori $at, $at, 0x4000 -/* 15C30 8003A830 4481B000 */ mtc1 $at, $f22 -/* 15C34 8003A834 3C03800A */ lui $v1, %hi(gCurrentCamID) -/* 15C38 8003A838 8463A634 */ lh $v1, %lo(gCurrentCamID)($v1) -/* 15C3C 8003A83C 3C04800B */ lui $a0, %hi(gCameras) -/* 15C40 8003A840 24841D80 */ addiu $a0, $a0, %lo(gCameras) -/* 15C44 8003A844 AFBF0064 */ sw $ra, 0x64($sp) -/* 15C48 8003A848 AFB40060 */ sw $s4, 0x60($sp) -/* 15C4C 8003A84C AFB00050 */ sw $s0, 0x50($sp) -/* 15C50 8003A850 F7B40068 */ sdc1 $f20, 0x68($sp) -/* 15C54 8003A854 00031080 */ sll $v0, $v1, 2 -/* 15C58 8003A858 00431021 */ addu $v0, $v0, $v1 -/* 15C5C 8003A85C 00021080 */ sll $v0, $v0, 2 -/* 15C60 8003A860 00431023 */ subu $v0, $v0, $v1 -/* 15C64 8003A864 000218C0 */ sll $v1, $v0, 3 -/* 15C68 8003A868 00431021 */ addu $v0, $v0, $v1 -/* 15C6C 8003A86C 000210C0 */ sll $v0, $v0, 3 -/* 15C70 8003A870 0044A021 */ addu $s4, $v0, $a0 -.L8003A874: -/* 15C74 8003A874 3C03800A */ lui $v1, %hi(gCurrentNpcListPtr) -/* 15C78 8003A878 8C630B90 */ lw $v1, %lo(gCurrentNpcListPtr)($v1) -/* 15C7C 8003A87C 00121080 */ sll $v0, $s2, 2 -/* 15C80 8003A880 00431021 */ addu $v0, $v0, $v1 -/* 15C84 8003A884 8C500000 */ lw $s0, ($v0) -/* 15C88 8003A888 52000063 */ beql $s0, $zero, .L8003AA18 -/* 15C8C 8003A88C 26520001 */ addiu $s2, $s2, 1 -/* 15C90 8003A890 8E030000 */ lw $v1, ($s0) -/* 15C94 8003A894 50600060 */ beql $v1, $zero, .L8003AA18 -/* 15C98 8003A898 26520001 */ addiu $s2, $s2, 1 -/* 15C9C 8003A89C 3C028100 */ lui $v0, 0x8100 -/* 15CA0 8003A8A0 34420006 */ ori $v0, $v0, 6 -/* 15CA4 8003A8A4 00621024 */ and $v0, $v1, $v0 -/* 15CA8 8003A8A8 5440005B */ bnel $v0, $zero, .L8003AA18 -/* 15CAC 8003A8AC 26520001 */ addiu $s2, $s2, 1 -/* 15CB0 8003A8B0 3C013F80 */ lui $at, 0x3f80 -/* 15CB4 8003A8B4 44810000 */ mtc1 $at, $f0 -/* 15CB8 8003A8B8 27A20038 */ addiu $v0, $sp, 0x38 -/* 15CBC 8003A8BC AFA20014 */ sw $v0, 0x14($sp) -/* 15CC0 8003A8C0 27A2003C */ addiu $v0, $sp, 0x3c -/* 15CC4 8003A8C4 AFA20018 */ sw $v0, 0x18($sp) -/* 15CC8 8003A8C8 27A20040 */ addiu $v0, $sp, 0x40 -/* 15CCC 8003A8CC AFA2001C */ sw $v0, 0x1c($sp) -/* 15CD0 8003A8D0 27A20044 */ addiu $v0, $sp, 0x44 -/* 15CD4 8003A8D4 AFA20020 */ sw $v0, 0x20($sp) -/* 15CD8 8003A8D8 E7A00010 */ swc1 $f0, 0x10($sp) -/* 15CDC 8003A8DC 8E050038 */ lw $a1, 0x38($s0) -/* 15CE0 8003A8E0 8E06003C */ lw $a2, 0x3c($s0) -/* 15CE4 8003A8E4 8E070040 */ lw $a3, 0x40($s0) -/* 15CE8 8003A8E8 0C00A588 */ jal transform_point -/* 15CEC 8003A8EC 268400D4 */ addiu $a0, $s4, 0xd4 -/* 15CF0 8003A8F0 C7A40044 */ lwc1 $f4, 0x44($sp) -/* 15CF4 8003A8F4 3C01800A */ lui $at, %hi(D_800984B0) -/* 15CF8 8003A8F8 D42084B0 */ ldc1 $f0, %lo(D_800984B0)($at) -/* 15CFC 8003A8FC 460020A1 */ cvt.d.s $f2, $f4 -/* 15D00 8003A900 4620103C */ c.lt.d $f2, $f0 -/* 15D04 8003A904 00000000 */ nop -/* 15D08 8003A908 45000007 */ bc1f .L8003A928 -/* 15D0C 8003A90C 00000000 */ nop -/* 15D10 8003A910 3C01800A */ lui $at, %hi(D_800984B8) -/* 15D14 8003A914 D42084B8 */ ldc1 $f0, %lo(D_800984B8)($at) -/* 15D18 8003A918 4622003C */ c.lt.d $f0, $f2 -/* 15D1C 8003A91C 00000000 */ nop -/* 15D20 8003A920 4503003D */ bc1tl .L8003AA18 -/* 15D24 8003A924 26520001 */ addiu $s2, $s2, 1 -.L8003A928: -/* 15D28 8003A928 C7A00040 */ lwc1 $f0, 0x40($sp) -/* 15D2C 8003A92C 461A0002 */ mul.s $f0, $f0, $f26 -/* 15D30 8003A930 00000000 */ nop -/* 15D34 8003A934 46040003 */ div.s $f0, $f0, $f4 -/* 15D38 8003A938 461A0500 */ add.s $f20, $f0, $f26 -/* 15D3C 8003A93C 4618A03C */ c.lt.s $f20, $f24 -/* 15D40 8003A940 00000000 */ nop -/* 15D44 8003A944 45000003 */ bc1f .L8003A954 -/* 15D48 8003A948 00000000 */ nop -/* 15D4C 8003A94C 0800EA59 */ j .L8003A964 -/* 15D50 8003A950 4600C506 */ mov.s $f20, $f24 -.L8003A954: -/* 15D54 8003A954 4614B03C */ c.lt.s $f22, $f20 -/* 15D58 8003A958 00000000 */ nop -/* 15D5C 8003A95C 45030001 */ bc1tl .L8003A964 -/* 15D60 8003A960 4600B506 */ mov.s $f20, $f22 -.L8003A964: -/* 15D64 8003A964 4600A007 */ neg.s $f0, $f20 -/* 15D68 8003A968 4600018D */ trunc.w.s $f6, $f0 -/* 15D6C 8003A96C E6260004 */ swc1 $f6, 4($s1) -/* 15D70 8003A970 3C028004 */ lui $v0, %hi(npc_appendGfx) -/* 15D74 8003A974 24429FD0 */ addiu $v0, $v0, %lo(npc_appendGfx) -/* 15D78 8003A978 AE300008 */ sw $s0, 8($s1) -/* 15D7C 8003A97C AE22000C */ sw $v0, 0xc($s1) -/* 15D80 8003A980 820200AA */ lb $v0, 0xaa($s0) -/* 15D84 8003A984 AE220000 */ sw $v0, ($s1) -/* 15D88 8003A988 8E020000 */ lw $v0, ($s0) -/* 15D8C 8003A98C 3C030080 */ lui $v1, 0x80 -/* 15D90 8003A990 00431024 */ and $v0, $v0, $v1 -/* 15D94 8003A994 10400009 */ beqz $v0, .L8003A9BC -/* 15D98 8003A998 27A40048 */ addiu $a0, $sp, 0x48 -/* 15D9C 8003A99C 27A50049 */ addiu $a1, $sp, 0x49 -/* 15DA0 8003A9A0 27A6004A */ addiu $a2, $sp, 0x4a -/* 15DA4 8003A9A4 0C046FA0 */ jal get_background_color_blend -/* 15DA8 8003A9A8 27A7004B */ addiu $a3, $sp, 0x4b -/* 15DAC 8003A9AC 93A2004B */ lbu $v0, 0x4b($sp) -/* 15DB0 8003A9B0 02621023 */ subu $v0, $s3, $v0 -/* 15DB4 8003A9B4 0800EA70 */ j .L8003A9C0 -/* 15DB8 8003A9B8 A20200AD */ sb $v0, 0xad($s0) -.L8003A9BC: -/* 15DBC 8003A9BC A21300AD */ sb $s3, 0xad($s0) -.L8003A9C0: -/* 15DC0 8003A9C0 920200AD */ lbu $v0, 0xad($s0) -/* 15DC4 8003A9C4 10400003 */ beqz $v0, .L8003A9D4 -/* 15DC8 8003A9C8 00000000 */ nop -/* 15DCC 8003A9CC 0C047644 */ jal queue_render_task -/* 15DD0 8003A9D0 0220202D */ daddu $a0, $s1, $zero -.L8003A9D4: -/* 15DD4 8003A9D4 8E020000 */ lw $v0, ($s0) -/* 15DD8 8003A9D8 3C030010 */ lui $v1, 0x10 -/* 15DDC 8003A9DC 00431024 */ and $v0, $v0, $v1 -/* 15DE0 8003A9E0 5040000D */ beql $v0, $zero, .L8003AA18 -/* 15DE4 8003A9E4 26520001 */ addiu $s2, $s2, 1 -/* 15DE8 8003A9E8 4600A007 */ neg.s $f0, $f20 -/* 15DEC 8003A9EC 4600018D */ trunc.w.s $f6, $f0 -/* 15DF0 8003A9F0 E6260004 */ swc1 $f6, 4($s1) -/* 15DF4 8003A9F4 0220202D */ daddu $a0, $s1, $zero -/* 15DF8 8003A9F8 3C028004 */ lui $v0, %hi(appendGfx_npc_blur) -/* 15DFC 8003A9FC 2442AE38 */ addiu $v0, $v0, %lo(appendGfx_npc_blur) -/* 15E00 8003AA00 AE22000C */ sw $v0, 0xc($s1) -/* 15E04 8003AA04 24020011 */ addiu $v0, $zero, 0x11 -/* 15E08 8003AA08 AE300008 */ sw $s0, 8($s1) -/* 15E0C 8003AA0C 0C047644 */ jal queue_render_task -/* 15E10 8003AA10 AE220000 */ sw $v0, ($s1) -/* 15E14 8003AA14 26520001 */ addiu $s2, $s2, 1 -.L8003AA18: -/* 15E18 8003AA18 2A420040 */ slti $v0, $s2, 0x40 -/* 15E1C 8003AA1C 1440FF95 */ bnez $v0, .L8003A874 -/* 15E20 8003AA20 00000000 */ nop -/* 15E24 8003AA24 8FBF0064 */ lw $ra, 0x64($sp) -/* 15E28 8003AA28 8FB40060 */ lw $s4, 0x60($sp) -/* 15E2C 8003AA2C 8FB3005C */ lw $s3, 0x5c($sp) -/* 15E30 8003AA30 8FB20058 */ lw $s2, 0x58($sp) -/* 15E34 8003AA34 8FB10054 */ lw $s1, 0x54($sp) -/* 15E38 8003AA38 8FB00050 */ lw $s0, 0x50($sp) -/* 15E3C 8003AA3C D7BA0080 */ ldc1 $f26, 0x80($sp) -/* 15E40 8003AA40 D7B80078 */ ldc1 $f24, 0x78($sp) -/* 15E44 8003AA44 D7B60070 */ ldc1 $f22, 0x70($sp) -/* 15E48 8003AA48 D7B40068 */ ldc1 $f20, 0x68($sp) -/* 15E4C 8003AA4C 03E00008 */ jr $ra -/* 15E50 8003AA50 27BD0088 */ addiu $sp, $sp, 0x88 diff --git a/ver/us/asm/nonmatchings/npc/npc_update_decorations.s b/ver/us/asm/nonmatchings/npc/npc_update_decorations.s deleted file mode 100644 index e35a486ae3..0000000000 --- a/ver/us/asm/nonmatchings/npc/npc_update_decorations.s +++ /dev/null @@ -1,75 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -glabel D_800984E0 -.word 0x8003C490, 0x8003C4A4, 0x8003C4B8, 0x8003C4CC, 0x8003C4E0, 0x8003C4F4, 0x8003C508, 0x00000000 - -.section .text - -glabel npc_update_decorations -/* 17844 8003C444 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 17848 8003C448 AFB10014 */ sw $s1, 0x14($sp) -/* 1784C 8003C44C 0080882D */ daddu $s1, $a0, $zero -/* 17850 8003C450 AFB00010 */ sw $s0, 0x10($sp) -/* 17854 8003C454 0000802D */ daddu $s0, $zero, $zero -/* 17858 8003C458 AFB20018 */ sw $s2, 0x18($sp) -/* 1785C 8003C45C 3C12800A */ lui $s2, %hi(D_800984E0) -/* 17860 8003C460 265284E0 */ addiu $s2, $s2, %lo(D_800984E0) -/* 17864 8003C464 AFBF001C */ sw $ra, 0x1c($sp) -/* 17868 8003C468 02301021 */ addu $v0, $s1, $s0 -.L8003C46C: -/* 1786C 8003C46C 8043032C */ lb $v1, 0x32c($v0) -/* 17870 8003C470 2C620007 */ sltiu $v0, $v1, 7 -/* 17874 8003C474 50400028 */ beql $v0, $zero, .L8003C518 -/* 17878 8003C478 26100001 */ addiu $s0, $s0, 1 -/* 1787C 8003C47C 00031080 */ sll $v0, $v1, 2 -/* 17880 8003C480 00521021 */ addu $v0, $v0, $s2 -/* 17884 8003C484 8C420000 */ lw $v0, ($v0) -/* 17888 8003C488 00400008 */ jr $v0 -/* 1788C 8003C48C 00000000 */ nop -/* 17890 8003C490 0220202D */ daddu $a0, $s1, $zero -/* 17894 8003C494 0C00F196 */ jal func_8003C658 -/* 17898 8003C498 0200282D */ daddu $a1, $s0, $zero -/* 1789C 8003C49C 0800F146 */ j .L8003C518 -/* 178A0 8003C4A0 26100001 */ addiu $s0, $s0, 1 -/* 178A4 8003C4A4 0220202D */ daddu $a0, $s1, $zero -/* 178A8 8003C4A8 0C00F19A */ jal func_8003C668 -/* 178AC 8003C4AC 0200282D */ daddu $a1, $s0, $zero -/* 178B0 8003C4B0 0800F146 */ j .L8003C518 -/* 178B4 8003C4B4 26100001 */ addiu $s0, $s0, 1 -/* 178B8 8003C4B8 0220202D */ daddu $a0, $s1, $zero -/* 178BC 8003C4BC 0C00F1EA */ jal func_8003C7A8 -/* 178C0 8003C4C0 0200282D */ daddu $a1, $s0, $zero -/* 178C4 8003C4C4 0800F146 */ j .L8003C518 -/* 178C8 8003C4C8 26100001 */ addiu $s0, $s0, 1 -/* 178CC 8003C4CC 0220202D */ daddu $a0, $s1, $zero -/* 178D0 8003C4D0 0C00F22D */ jal func_8003C8B4 -/* 178D4 8003C4D4 0200282D */ daddu $a1, $s0, $zero -/* 178D8 8003C4D8 0800F146 */ j .L8003C518 -/* 178DC 8003C4DC 26100001 */ addiu $s0, $s0, 1 -/* 178E0 8003C4E0 0220202D */ daddu $a0, $s1, $zero -/* 178E4 8003C4E4 0C00F26A */ jal func_8003C9A8 -/* 178E8 8003C4E8 0200282D */ daddu $a1, $s0, $zero -/* 178EC 8003C4EC 0800F146 */ j .L8003C518 -/* 178F0 8003C4F0 26100001 */ addiu $s0, $s0, 1 -/* 178F4 8003C4F4 0220202D */ daddu $a0, $s1, $zero -/* 178F8 8003C4F8 0C00F2D1 */ jal func_8003CB44 -/* 178FC 8003C4FC 0200282D */ daddu $a1, $s0, $zero -/* 17900 8003C500 0800F146 */ j .L8003C518 -/* 17904 8003C504 26100001 */ addiu $s0, $s0, 1 -/* 17908 8003C508 0220202D */ daddu $a0, $s1, $zero -/* 1790C 8003C50C 0C00F32C */ jal func_8003CCB0 -/* 17910 8003C510 0200282D */ daddu $a1, $s0, $zero -/* 17914 8003C514 26100001 */ addiu $s0, $s0, 1 -.L8003C518: -/* 17918 8003C518 2A020002 */ slti $v0, $s0, 2 -/* 1791C 8003C51C 5440FFD3 */ bnel $v0, $zero, .L8003C46C -/* 17920 8003C520 02301021 */ addu $v0, $s1, $s0 -/* 17924 8003C524 8FBF001C */ lw $ra, 0x1c($sp) -/* 17928 8003C528 8FB20018 */ lw $s2, 0x18($sp) -/* 1792C 8003C52C 8FB10014 */ lw $s1, 0x14($sp) -/* 17930 8003C530 8FB00010 */ lw $s0, 0x10($sp) -/* 17934 8003C534 03E00008 */ jr $ra -/* 17938 8003C538 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index ea1cb38a13..61bd602b69 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -18033,7 +18033,7 @@ D_8009A5F4 = 0x8009A5F4; // type:data nuGfxDisplay = 0x8009A5F8; // D_8009A5FC = 0x8009A5FC; // type:data gGameState = 0x8009A600; // -D_8009A604 = 0x8009A604; // type:data +gNpcCount = 0x8009A604; // type:data D_8009A606 = 0x8009A606; // type:data D_8009A608 = 0x8009A608; // type:data D_8009A60C = 0x8009A60C; // type:data diff --git a/ver/us/undefined_syms_auto.txt b/ver/us/undefined_syms_auto.txt index d5be12ae14..dff22393bd 100644 --- a/ver/us/undefined_syms_auto.txt +++ b/ver/us/undefined_syms_auto.txt @@ -29,7 +29,7 @@ D_8009A5F4 = 0x8009A5F4; nuGfxDisplay = 0x8009A5F8; D_8009A5FC = 0x8009A5FC; gGameState = 0x8009A600; -D_8009A604 = 0x8009A604; +gNpcCount = 0x8009A604; D_8009A606 = 0x8009A606; D_8009A608 = 0x8009A608; D_8009A60C = 0x8009A60C;