diff --git a/asm/non_matchings/code/z_play/Gameplay_Update.s b/asm/non_matchings/code/z_play/Gameplay_Update.s index 66651a4360..d98bf97397 100644 --- a/asm/non_matchings/code/z_play/Gameplay_Update.s +++ b/asm/non_matchings/code/z_play/Gameplay_Update.s @@ -1588,7 +1588,7 @@ glabel L800BE148 /* B35624 800BE484 34211E60 */ ori $at, (0x00011E60 & 0xFFFF) # ori $at, $at, 0x1e60 /* B35628 800BE488 02012821 */ addu $a1, $s0, $at /* B3562C 800BE48C AFA50038 */ sw $a1, 0x38($sp) -/* B35630 800BE490 0C0184E7 */ jal func_8006139C +/* B35630 800BE490 0C0184E7 */ jal CollisionCheck_AT /* B35634 800BE494 02002025 */ move $a0, $s0 /* B35638 800BE498 3C188016 */ lui $t8, %hi(gGameInfo) # $t8, 0x8016 /* B3563C 800BE49C 8F18FA90 */ lw $t8, %lo(gGameInfo)($t8) @@ -1620,7 +1620,7 @@ glabel L800BE148 /* B356A0 800BE500 24050001 */ li $a1, 1 .L800BE504: /* B356A4 800BE504 02002025 */ move $a0, $s0 -/* B356A8 800BE508 0C0188B9 */ jal func_800622E4 +/* B356A8 800BE508 0C0188B9 */ jal CollisionCheck_Damage /* B356AC 800BE50C 8FA50038 */ lw $a1, 0x38($sp) /* B356B0 800BE510 3C0B8016 */ lui $t3, %hi(gGameInfo) # $t3, 0x8016 /* B356B4 800BE514 8D6BFA90 */ lw $t3, %lo(gGameInfo)($t3) @@ -1636,7 +1636,7 @@ glabel L800BE148 /* B356DC 800BE53C 24050001 */ li $a1, 1 .L800BE540: /* B356E0 800BE540 02002025 */ move $a0, $s0 -/* B356E4 800BE544 0C017503 */ jal CollisionCheck_InitContext +/* B356E4 800BE544 0C017503 */ jal CollisionCheck_ClearContext /* B356E8 800BE548 8FA50038 */ lw $a1, 0x38($sp) /* B356EC 800BE54C 3C0D8016 */ lui $t5, %hi(gGameInfo) # $t5, 0x8016 /* B356F0 800BE550 8DADFA90 */ lw $t5, %lo(gGameInfo)($t5) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s b/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s index 41617cdf21..fdde2f2b1c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/func_808705D8.s @@ -80,7 +80,7 @@ glabel func_808705D8 /* 00AF4 808706D4 02002025 */ or $a0, $s0, $zero ## $a0 = 0000016C /* 00AF8 808706D8 27A5004C */ addiu $a1, $sp, 0x004C ## $a1 = FFFFFFAC /* 00AFC 808706DC 27A60058 */ addiu $a2, $sp, 0x0058 ## $a2 = FFFFFFB8 -/* 00B00 808706E0 0C0189CD */ jal func_80062734 +/* 00B00 808706E0 0C0189CD */ jal Collider_SetQuadVertices /* 00B04 808706E4 27A70064 */ addiu $a3, $sp, 0x0064 ## $a3 = FFFFFFC4 /* 00B08 808706E8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 00B0C 808706EC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s index dde017b3ba..362ee2883e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s @@ -133,7 +133,7 @@ glabel BgHakaZou_Init /* 001AC 8088276C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 001B0 80882770 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B4 80882774 0C0189B7 */ jal Collider_CylinderUpdate +/* 001B4 80882774 0C0189B7 */ jal Collider_UpdateCylinder /* 001B8 80882778 8FA50020 */ lw $a1, 0x0020($sp) /* 001BC 8088277C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s index 861bc885f7..0470a3272a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s @@ -132,7 +132,7 @@ glabel BgHidanHrock_Init /* 001CC 808892FC 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 001D0 80889300 02803025 */ or $a2, $s4, $zero ## $a2 = FFFFFFD4 /* 001D4 80889304 02A03825 */ or $a3, $s5, $zero ## $a3 = FFFFFFE0 -/* 001D8 80889308 0C0189E8 */ jal func_800627A0 +/* 001D8 80889308 0C0189E8 */ jal Collider_SetTrisVertices /* 001DC 8088930C AFB60010 */ sw $s6, 0x0010($sp) /* 001E0 80889310 26520001 */ addiu $s2, $s2, 0x0001 ## $s2 = 00000001 /* 001E4 80889314 1657FFC5 */ bne $s2, $s7, .L8088922C diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s index c825af4a91..d2727a0643 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Init.s @@ -93,7 +93,7 @@ glabel BgHidanSekizou_Init /* 00500 8088D3C0 AE22014C */ sw $v0, 0x014C($s1) ## 0000014C /* 00504 8088D3C4 24C6E268 */ addiu $a2, $a2, %lo(D_8088E268) ## $a2 = 8088E268 /* 00508 8088D3C8 26240098 */ addiu $a0, $s1, 0x0098 ## $a0 = 00000098 -/* 0050C 8088D3CC 0C0187B5 */ jal func_80061ED4 +/* 0050C 8088D3CC 0C0187B5 */ jal CollisionCheck_SetInfo /* 00510 8088D3D0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 00514 8088D3D4 8FBF002C */ lw $ra, 0x002C($sp) /* 00518 8088D3D8 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s index 2e8485e85a..8a1b3451e9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/BgHidanSekizou_Update.s @@ -46,7 +46,7 @@ glabel BgHidanSekizou_Update /* 00A98 8088D958 8FA50024 */ lw $a1, 0x0024($sp) /* 00A9C 8088D95C 8FA60020 */ lw $a2, 0x0020($sp) /* 00AA0 8088D960 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00AA4 8088D964 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00AA8 8088D968 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00AAC 8088D96C 0C00BE5D */ jal func_8002F974 @@ -78,7 +78,7 @@ glabel BgHidanSekizou_Update /* 00B04 8088D9C4 8FA50024 */ lw $a1, 0x0024($sp) /* 00B08 8088D9C8 8FA60020 */ lw $a2, 0x0020($sp) /* 00B0C 8088D9CC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00B10 8088D9D0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00B14 8088D9D4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00B18 8088D9D8 0C00BE5D */ jal func_8002F974 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s index 9ce206762f..dc52557477 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s @@ -21,7 +21,7 @@ glabel func_80890740 /* 00048 80890788 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 0004C 8089078C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00050 80890790 0C0189B7 */ jal Collider_CylinderUpdate +/* 00050 80890790 0C0189B7 */ jal Collider_UpdateCylinder /* 00054 80890794 8FA5002C */ lw $a1, 0x002C($sp) /* 00058 80890798 8FA40030 */ lw $a0, 0x0030($sp) @@ -59,7 +59,7 @@ glabel func_80890740 /* 000D0 80890810 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 000D4 80890814 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000D8 80890818 0C0189B7 */ jal Collider_CylinderUpdate +/* 000D8 80890818 0C0189B7 */ jal Collider_UpdateCylinder /* 000DC 8089081C 8FA50024 */ lw $a1, 0x0024($sp) /* 000E0 80890820 8FAD002C */ lw $t5, 0x002C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s index fdca12e33b..d83ba6e43d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_8089107C.s @@ -70,7 +70,7 @@ glabel func_8089107C /* 00A34 80891174 AFA50028 */ sw $a1, 0x0028($sp) /* 00A38 80891178 00E03025 */ or $a2, $a3, $zero ## $a2 = 00000168 /* 00A3C 8089117C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00A40 80891180 AFA70024 */ sw $a3, 0x0024($sp) /* 00A44 80891184 8FA50028 */ lw $a1, 0x0028($sp) /* 00A48 80891188 8FA4003C */ lw $a0, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s index 0201a22353..37769d2413 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_808911D4.s @@ -64,7 +64,7 @@ glabel func_808911D4 /* 00B64 808912A4 AFA5002C */ sw $a1, 0x002C($sp) /* 00B68 808912A8 26060168 */ addiu $a2, $s0, 0x0168 ## $a2 = 00000168 /* 00B6C 808912AC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00B70 808912B0 AFA30028 */ sw $v1, 0x0028($sp) /* 00B74 808912B4 8FA5002C */ lw $a1, 0x002C($sp) /* 00B78 808912B8 8FA40044 */ lw $a0, 0x0044($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s index 9fd98be316..ac6be37c72 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s @@ -28,7 +28,7 @@ glabel func_808988A0 /* 00060 80898900 A4D801A8 */ sh $t8, 0x01A8($a2) ## 000001A8 /* 00064 80898904 A4D901AA */ sh $t9, 0x01AA($a2) ## 000001AA .L80898908: -/* 00068 80898908 0C0189B7 */ jal Collider_CylinderUpdate +/* 00068 80898908 0C0189B7 */ jal Collider_UpdateCylinder /* 0006C 8089890C 8FA50018 */ lw $a1, 0x0018($sp) /* 00070 80898910 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s index 085f95bde1..10f08bd248 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Draw.s @@ -37,7 +37,7 @@ glabel BgSpot06Objects_Draw /* 01034 808AF7B4 24040001 */ addiu $a0, $zero, 0x0001 ## $a0 = 00000001 /* 01038 808AF7B8 55CF000D */ bnel $t6, $t7, .L808AF7F0 /* 0103C 808AF7BC 8FBF0014 */ lw $ra, 0x0014($sp) -/* 01040 808AF7C0 0C018A29 */ jal func_800628A4 +/* 01040 808AF7C0 0C018A29 */ jal Collider_UpdateSpheres /* 01044 808AF7C4 24C50170 */ addiu $a1, $a2, 0x0170 ## $a1 = 00000170 /* 01048 808AF7C8 10000009 */ beq $zero, $zero, .L808AF7F0 /* 0104C 808AF7CC 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s index 5880ef3a7c..57ac525832 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Update.s @@ -15,7 +15,7 @@ glabel BgSpot06Objects_Update /* 00D84 808AF504 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 00D88 808AF508 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00D8C 808AF50C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00D90 808AF510 00812821 */ addu $a1, $a0, $at .L808AF514: /* 00D94 808AF514 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s index ca529d7535..97b4ca31e3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s @@ -91,7 +91,7 @@ glabel BgYdanSp_Init /* 00150 808BF560 8FA40030 */ lw $a0, 0x0030($sp) /* 00154 808BF564 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 00158 808BF568 27A60054 */ addiu $a2, $sp, 0x0054 ## $a2 = FFFFFFD4 -/* 0015C 808BF56C 0C0189E8 */ jal func_800627A0 +/* 0015C 808BF56C 0C0189E8 */ jal Collider_SetTrisVertices /* 00160 808BF570 27A70060 */ addiu $a3, $sp, 0x0060 ## $a3 = FFFFFFE0 /* 00164 808BF574 C7B20054 */ lwc1 $f18, 0x0054($sp) /* 00168 808BF578 C7A40074 */ lwc1 $f4, 0x0074($sp) @@ -102,7 +102,7 @@ glabel BgYdanSp_Init /* 0017C 808BF58C 27A60054 */ addiu $a2, $sp, 0x0054 ## $a2 = FFFFFFD4 /* 00180 808BF590 27A7006C */ addiu $a3, $sp, 0x006C ## $a3 = FFFFFFEC /* 00184 808BF594 E7B20060 */ swc1 $f18, 0x0060($sp) -/* 00188 808BF598 0C0189E8 */ jal func_800627A0 +/* 00188 808BF598 0C0189E8 */ jal Collider_SetTrisVertices /* 0018C 808BF59C E7A40068 */ swc1 $f4, 0x0068($sp) /* 00190 808BF5A0 44803000 */ mtc1 $zero, $f6 ## $f6 = 0.00 /* 00194 808BF5A4 10000080 */ beq $zero, $zero, .L808BF7A8 @@ -207,7 +207,7 @@ glabel BgYdanSp_Init /* 002FC 808BF70C E7A20040 */ swc1 $f2, 0x0040($sp) /* 00300 808BF710 E7AC0044 */ swc1 $f12, 0x0044($sp) /* 00304 808BF714 E7AE0038 */ swc1 $f14, 0x0038($sp) -/* 00308 808BF718 0C0189E8 */ jal func_800627A0 +/* 00308 808BF718 0C0189E8 */ jal Collider_SetTrisVertices /* 0030C 808BF71C E7B0003C */ swc1 $f16, 0x003C($sp) /* 00310 808BF720 3C01808C */ lui $at, %hi(D_808C0984) ## $at = 808C0000 /* 00314 808BF724 C7AC0044 */ lwc1 $f12, 0x0044($sp) @@ -241,7 +241,7 @@ glabel BgYdanSp_Init /* 00384 808BF794 46122201 */ sub.s $f8, $f4, $f18 /* 00388 808BF798 460E3102 */ mul.s $f4, $f6, $f14 /* 0038C 808BF79C 46082480 */ add.s $f18, $f4, $f8 -/* 00390 808BF7A0 0C0189E8 */ jal func_800627A0 +/* 00390 808BF7A0 0C0189E8 */ jal Collider_SetTrisVertices /* 00394 808BF7A4 E7B20068 */ swc1 $f18, 0x0068($sp) .L808BF7A8: /* 00398 808BF7A8 8FA40084 */ lw $a0, 0x0084($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s index 297422f801..b606eef7fa 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s @@ -933,7 +933,7 @@ glabel BossDodongo_Update /* 035C8 808C4758 00818021 */ addu $s0, $a0, $at /* 035CC 808C475C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 035D0 808C4760 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 035D4 808C4764 AFA60034 */ sw $a2, 0x0034($sp) /* 035D8 808C4768 8E2F0190 */ lw $t7, 0x0190($s1) ## 00000190 /* 035DC 808C476C 3C03808C */ lui $v1, %hi(func_808C3704) ## $v1 = 808C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s index b9e2ecfbae..d15d1042b2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C4B90.s @@ -53,7 +53,7 @@ glabel func_808C4B90 /* 03AC0 808C4C50 8FA50028 */ lw $a1, 0x0028($sp) .L808C4C54: /* 03AC4 808C4C54 8FA4001C */ lw $a0, 0x001C($sp) -/* 03AC8 808C4C58 0C018A29 */ jal func_800628A4 +/* 03AC8 808C4C58 0C018A29 */ jal Collider_UpdateSpheres /* 03ACC 808C4C5C 24A50440 */ addiu $a1, $a1, 0x0440 ## $a1 = 00000440 /* 03AD0 808C4C60 8FBF0014 */ lw $ra, 0x0014($sp) /* 03AD4 808C4C64 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s index 5008b4e2f9..43e664e823 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C5354.s @@ -76,7 +76,7 @@ glabel func_808C5354 /* 042D8 808C5468 55620011 */ bnel $t3, $v0, .L808C54B0 /* 042DC 808C546C 8FBF001C */ lw $ra, 0x001C($sp) .L808C5470: -/* 042E0 808C5470 0C018D74 */ jal func_800635D0 +/* 042E0 808C5470 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 042E4 808C5474 8CA40000 */ lw $a0, 0x0000($a1) ## 00000000 /* 042E8 808C5478 1040000C */ beq $v0, $zero, .L808C54AC /* 042EC 808C547C A3A20027 */ sb $v0, 0x0027($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s index ecf0915c70..e3bd7684b9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808D08F8.s @@ -572,7 +572,7 @@ glabel func_808D08F8 .L808D1084: /* 062C4 808D1084 1A200003 */ blez $s1, .L808D1094 /* 062C8 808D1088 26240001 */ addiu $a0, $s1, 0x0001 ## $a0 = 00000001 -/* 062CC 808D108C 0C018A29 */ jal func_800628A4 +/* 062CC 808D108C 0C018A29 */ jal Collider_UpdateSpheres /* 062D0 808D1090 8FA5007C */ lw $a1, 0x007C($sp) .L808D1094: /* 062D4 808D1094 26310001 */ addiu $s1, $s1, 0x0001 ## $s1 = 00000001 @@ -680,7 +680,7 @@ glabel func_808D08F8 /* 06460 808D1220 24841E1C */ addiu $a0, $a0, %lo(D_808D1E1C) ## $a0 = 808D1E1C /* 06464 808D1224 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 06468 808D1228 0C018A29 */ jal func_800628A4 +/* 06468 808D1228 0C018A29 */ jal Collider_UpdateSpheres /* 0646C 808D122C 8FA5007C */ lw $a1, 0x007C($sp) /* 06470 808D1230 0C034221 */ jal Matrix_Pull /* 06474 808D1234 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s index 8b84ca3ca6..e925f1ac9c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/BossFd2_Update.s @@ -77,7 +77,7 @@ glabel BossFd2_Update /* 0285C 808D4ECC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02860 808D4ED0 8FA50028 */ lw $a1, 0x0028($sp) /* 02864 808D4ED4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02868 808D4ED8 8FA60024 */ lw $a2, 0x0024($sp) /* 0286C 808D4EDC 92180194 */ lbu $t8, 0x0194($s0) ## 00000194 /* 02870 808D4EE0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s index d04b572182..34ee0abe0d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D4790.s @@ -190,7 +190,7 @@ glabel func_808D4790 /* 02394 808D4A04 1000008F */ beq $zero, $zero, .L808D4C44 /* 02398 808D4A08 8FBF003C */ lw $ra, 0x003C($sp) .L808D4A0C: -/* 0239C 808D4A0C 0C018D74 */ jal func_800635D0 +/* 0239C 808D4A0C 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 023A0 808D4A10 8E040000 */ lw $a0, 0x0000($s0) ## 00000001 /* 023A4 808D4A14 14400009 */ bne $v0, $zero, .L808D4A3C /* 023A8 808D4A18 305100FF */ andi $s1, $v0, 0x00FF ## $s1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s index 24ac52bfca..ac6316735e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D5228.s @@ -35,7 +35,7 @@ glabel func_808D5228 .L808D52AC: /* 02C3C 808D52AC 8FA50028 */ lw $a1, 0x0028($sp) /* 02C40 808D52B0 8FA4001C */ lw $a0, 0x001C($sp) -/* 02C44 808D52B4 0C018A29 */ jal func_800628A4 +/* 02C44 808D52B4 0C018A29 */ jal Collider_UpdateSpheres /* 02C48 808D52B8 24A5141C */ addiu $a1, $a1, 0x141C ## $a1 = 0000141C /* 02C4C 808D52BC 8FBF0014 */ lw $ra, 0x0014($sp) /* 02C50 808D52C0 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s index d75e569966..3fd4f6ab3f 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Update.s @@ -300,7 +300,7 @@ glabel BossGanon_Update /* 0707C 808DD8EC 02202825 */ or $a1, $s1, $zero ## $a1 = 00000001 /* 07080 808DD8F0 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 /* 07084 808DD8F4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07088 808DD8F8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000610 /* 0708C 808DD8FC 86AA02D4 */ lh $t2, 0x02D4($s5) ## 000002D4 /* 07090 808DD900 02C02025 */ or $a0, $s6, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s index c73341b403..6651b8c379 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808DD20C.s @@ -94,7 +94,7 @@ glabel func_808DD20C /* 06AEC 808DD35C 2A41001E */ slti $at, $s2, 0x001E /* 06AF0 808DD360 1420FFE3 */ bne $at, $zero, .L808DD2F0 /* 06AF4 808DD364 00000000 */ nop -/* 06AF8 808DD368 0C018D74 */ jal func_800635D0 +/* 06AF8 808DD368 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 06AFC 808DD36C 8E640000 */ lw $a0, 0x0000($s3) ## 00000000 /* 06B00 808DD370 14400003 */ bne $v0, $zero, .L808DD380 /* 06B04 808DD374 304300FF */ andi $v1, $v0, 0x00FF ## $v1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s index 751cb07450..25de27aee7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s @@ -568,7 +568,7 @@ glabel L808E176C .L808E17B4: /* 0AF44 808E17B4 26300610 */ addiu $s0, $s1, 0x0610 ## $s0 = 00000610 /* 0AF48 808E17B8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000610 -/* 0AF4C 808E17BC 0C0189B7 */ jal Collider_CylinderUpdate +/* 0AF4C 808E17BC 0C0189B7 */ jal Collider_UpdateCylinder /* 0AF50 808E17C0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0AF54 808E17C4 862F01B8 */ lh $t7, 0x01B8($s1) ## 000001B8 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s index f422673edc..58ac37c053 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E2544.s @@ -585,7 +585,7 @@ glabel L808E29A8 /* 0C4BC 808E2D2C 26300610 */ addiu $s0, $s1, 0x0610 ## $s0 = 00000610 .L808E2D30: /* 0C4C0 808E2D30 02002825 */ or $a1, $s0, $zero ## $a1 = 00000610 -/* 0C4C4 808E2D34 0C0189B7 */ jal Collider_CylinderUpdate +/* 0C4C4 808E2D34 0C0189B7 */ jal Collider_UpdateCylinder /* 0C4C8 808E2D38 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0C4CC 808E2D3C 862A01B8 */ lh $t2, 0x01B8($s1) ## 000001B8 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s index 3ab0675942..380d64513f 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s @@ -471,7 +471,7 @@ glabel BossGanon2_Update /* 05E64 80902DA4 AFA60034 */ sw $a2, 0x0034($sp) /* 05E68 80902DA8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 05E6C 80902DAC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 05E70 80902DB0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 05E74 80902DB4 8E380190 */ lw $t8, 0x0190($s1) ## 00000190 /* 05E78 80902DB8 3C0B8090 */ lui $t3, %hi(func_8090120C) ## $t3 = 80900000 @@ -490,7 +490,7 @@ glabel BossGanon2_Update /* 05EA8 80902DE8 AFA60034 */ sw $a2, 0x0034($sp) /* 05EAC 80902DEC 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 05EB0 80902DF0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 05EB4 80902DF4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 05EB8 80902DF8 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 05EBC 80902DFC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s index d4102f115b..e11cfca9de 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_80905DA8.s @@ -131,7 +131,7 @@ glabel func_80905DA8 /* 09004 80905F44 0C01E221 */ jal func_80078884 /* 09008 80905F48 E7A6007C */ swc1 $f6, 0x007C($sp) /* 0900C 80905F4C 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 -/* 09010 80905F50 0C018B58 */ jal func_80062D60 +/* 09010 80905F50 0C018B58 */ jal CollisionCheck_SpawnShieldParticlesMetal /* 09014 80905F54 02602825 */ or $a1, $s3, $zero ## $a1 = FFFFFFD8 /* 09018 80905F58 E6140014 */ swc1 $f20, 0x0014($s0) ## 00010014 .L80905F5C: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s index 72bc2fe1d1..0837f26248 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/BossGanondrof_Update.s @@ -144,7 +144,7 @@ glabel BossGanondrof_Update /* 039E8 80914028 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 039EC 8091402C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 039F0 80914030 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 039F4 80914034 8FA6003C */ lw $a2, 0x003C($sp) /* 039F8 80914038 1000001A */ beq $zero, $zero, .L809140A4 /* 039FC 8091403C 8FAC0038 */ lw $t4, 0x0038($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s index 624354b897..2757e727ce 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80913C54.s @@ -81,7 +81,7 @@ glabel func_80913C54 /* 03718 80913D58 55000048 */ bnel $t0, $zero, .L80913E7C /* 0371C 80913D5C 8FBF001C */ lw $ra, 0x001C($sp) /* 03720 80913D60 A3A00022 */ sb $zero, 0x0022($sp) -/* 03724 80913D64 0C018D74 */ jal func_800635D0 +/* 03724 80913D64 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 03728 80913D68 AFA70028 */ sw $a3, 0x0028($sp) /* 0372C 80913D6C 93A50022 */ lbu $a1, 0x0022($sp) /* 03730 80913D70 8FA70028 */ lw $a3, 0x0028($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s index 1665c30fc4..f8a22e7280 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s @@ -101,7 +101,7 @@ glabel BossGoma_Update /* 04AE8 8091A4F8 8FA4003C */ lw $a0, 0x003C($sp) /* 04AEC 8091A4FC 8FA5002C */ lw $a1, 0x002C($sp) /* 04AF0 8091A500 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 04AF4 8091A504 8FA60028 */ lw $a2, 0x0028($sp) /* 04AF8 8091A508 8E020190 */ lw $v0, 0x0190($s0) ## 00000190 /* 04AFC 8091A50C 3C0F8092 */ lui $t7, %hi(func_80919150) ## $t7 = 80920000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s index 3fb9c3493e..1c6c8ba420 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919F8C.s @@ -51,7 +51,7 @@ glabel func_80919F8C /* 04630 8091A040 1462001F */ bne $v1, $v0, .L8091A0C0 /* 04634 8091A044 8FAE002C */ lw $t6, 0x002C($sp) /* 04638 8091A048 8DC40000 */ lw $a0, 0x0000($t6) ## 00000000 -/* 0463C 8091A04C 0C018D74 */ jal func_800635D0 +/* 0463C 8091A04C 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 04640 8091A050 AFA30024 */ sw $v1, 0x0024($sp) /* 04644 8091A054 1040001A */ beq $v0, $zero, .L8091A0C0 /* 04648 8091A058 8FA30024 */ lw $v1, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s index c585ebe972..2e3b648b4e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091A9E8.s @@ -137,7 +137,7 @@ glabel func_8091A9E8 .L8091ABC8: /* 051B8 8091ABC8 8FA300B8 */ lw $v1, 0x00B8($sp) /* 051BC 8091ABCC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 051C0 8091ABD0 0C018A29 */ jal func_800628A4 +/* 051C0 8091ABD0 0C018A29 */ jal Collider_UpdateSpheres /* 051C4 8091ABD4 246507BC */ addiu $a1, $v1, 0x07BC ## $a1 = 000007BC /* 051C8 8091ABD8 8FBF003C */ lw $ra, 0x003C($sp) /* 051CC 8091ABDC 8FB00038 */ lw $s0, 0x0038($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s index d56ff5abfb..292eebdc5b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Update.s @@ -560,7 +560,7 @@ glabel BossMo_Update /* 07C14 80923714 2651101C */ addiu $s1, $s2, 0x101C ## $s1 = 0000101C /* 07C18 80923718 02203025 */ or $a2, $s1, $zero ## $a2 = 0000101C /* 07C1C 8092371C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07C20 80923720 02002825 */ or $a1, $s0, $zero ## $a1 = 00000024 /* 07C24 80923724 8FA400BC */ lw $a0, 0x00BC($sp) /* 07C28 80923728 02002825 */ or $a1, $s0, $zero ## $a1 = 00000024 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s index 79e234d632..62f11a64f8 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80921280.s @@ -103,7 +103,7 @@ glabel func_80921280 /* 05864 80921364 862A0160 */ lh $t2, 0x0160($s1) ## 00000160 /* 05868 80921368 154000CC */ bne $t2, $zero, .L8092169C /* 0586C 8092136C 00000000 */ nop -/* 05870 80921370 0C018D74 */ jal func_800635D0 +/* 05870 80921370 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 05874 80921374 8E040000 */ lw $a0, 0x0000($s0) ## 00000000 /* 05878 80921378 10400057 */ beq $v0, $zero, .L809214D8 /* 0587C 8092137C A3A20063 */ sb $v0, 0x0063($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s index f875872ef4..c820f1ceda 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_80922D30.s @@ -108,7 +108,7 @@ glabel func_80922D30 /* 073A4 80922EA4 260614FC */ addiu $a2, $s0, 0x14FC ## $a2 = 000014FC /* 073A8 80922EA8 00C02825 */ or $a1, $a2, $zero ## $a1 = 000014FC /* 073AC 80922EAC AFA60020 */ sw $a2, 0x0020($sp) -/* 073B0 80922EB0 0C0189B7 */ jal Collider_CylinderUpdate +/* 073B0 80922EB0 0C0189B7 */ jal Collider_UpdateCylinder /* 073B4 80922EB4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 073B8 80922EB8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -143,7 +143,7 @@ glabel func_80922D30 /* 07420 80922F20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80922F24: /* 07424 80922F24 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07428 80922F28 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0742C 80922F2C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80922F30: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s index ca64aff3fe..f0efe98171 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s @@ -31,7 +31,7 @@ glabel BossSst_Init /* 00048 8092C618 3C068093 */ lui $a2, %hi(D_80937824) ## $a2 = 80930000 /* 0004C 8092C61C 24C67824 */ addiu $a2, $a2, %lo(D_80937824) ## $a2 = 80937824 /* 00050 8092C620 24A5782C */ addiu $a1, $a1, %lo(D_8093782C) ## $a1 = 8093782C -/* 00054 8092C624 0C0187B5 */ jal func_80061ED4 +/* 00054 8092C624 0C0187B5 */ jal CollisionCheck_SetInfo /* 00058 8092C628 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 0005C 8092C62C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00060 8092C630 0C00B2DD */ jal Flags_SetSwitch diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s index abfed3a9ce..2082f2a87a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s @@ -127,7 +127,7 @@ glabel BossSst_Update /* 07C10 809341E0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 07C14 809341E4 02212821 */ addu $a1, $s1, $at /* 07C18 809341E8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07C1C 809341EC 260603D4 */ addiu $a2, $s0, 0x03D4 ## $a2 = 000003D4 .L809341F0: /* 07C20 809341F0 920D06C4 */ lbu $t5, 0x06C4($s0) ## 000006C4 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s index fdd3801550..8cf00e7a7b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930934.s @@ -81,7 +81,7 @@ glabel func_80930934 /* 04478 80930A48 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0447C 80930A4C 260506B4 */ addiu $a1, $s0, 0x06B4 ## $a1 = 000006B4 /* 04480 80930A50 358D0001 */ ori $t5, $t4, 0x0001 ## $t5 = 00000001 -/* 04484 80930A54 0C0189B7 */ jal Collider_CylinderUpdate +/* 04484 80930A54 0C0189B7 */ jal Collider_UpdateCylinder /* 04488 80930A58 A20D06C4 */ sb $t5, 0x06C4($s0) ## 000006C4 /* 0448C 80930A5C 3C0E8093 */ lui $t6, %hi(D_80937818) ## $t6 = 80930000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s index e71239139f..8a9d95f49b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80934338.s @@ -109,7 +109,7 @@ glabel func_80934338 /* 07EEC 809344BC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 07EF0 809344C0 02212821 */ addu $a1, $s1, $at /* 07EF4 809344C4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 07EF8 809344C8 260603D4 */ addiu $a2, $s0, 0x03D4 ## $a2 = 000003D4 .L809344CC: /* 07EFC 809344CC 0C24CE7E */ jal func_809339F8 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s index 8a990d258c..c8406438da 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_809345F0.s @@ -7,7 +7,7 @@ glabel func_809345F0 /* 08034 80934604 AFBF0014 */ sw $ra, 0x0014($sp) /* 08038 80934608 AFA60020 */ sw $a2, 0x0020($sp) /* 0803C 8093460C AFA70024 */ sw $a3, 0x0024($sp) -/* 08040 80934610 0C018A29 */ jal func_800628A4 +/* 08040 80934610 0C018A29 */ jal Collider_UpdateSpheres /* 08044 80934614 24A503D4 */ addiu $a1, $a1, 0x03D4 ## $a1 = 000003D4 /* 08048 80934618 8FBF0014 */ lw $ra, 0x0014($sp) /* 0804C 8093461C 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s index c9203029a3..e12489cf2f 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80935238.s @@ -35,7 +35,7 @@ glabel func_80935238 .L809352BC: /* 08CEC 809352BC 8FA20038 */ lw $v0, 0x0038($sp) /* 08CF0 809352C0 8FA4002C */ lw $a0, 0x002C($sp) -/* 08CF4 809352C4 0C018A29 */ jal func_800628A4 +/* 08CF4 809352C4 0C018A29 */ jal Collider_UpdateSpheres /* 08CF8 809352C8 244503D4 */ addiu $a1, $v0, 0x03D4 ## $a1 = 000003D4 /* 08CFC 809352CC 8FBF0014 */ lw $ra, 0x0014($sp) /* 08D00 809352D0 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s index a9cc2f774e..bd991d09a2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/BossTw_Update.s @@ -207,7 +207,7 @@ glabel BossTw_Update /* 07CC4 80940994 3048FFFD */ andi $t0, $v0, 0xFFFD ## $t0 = 00000000 /* 07CC8 80940998 A22805BD */ sb $t0, 0x05BD($s1) ## 000005BD .L8094099C: -/* 07CCC 8094099C 0C0189B7 */ jal Collider_CylinderUpdate +/* 07CCC 8094099C 0C0189B7 */ jal Collider_UpdateCylinder /* 07CD0 809409A0 02002825 */ or $a1, $s0, $zero ## $a1 = 000005AC /* 07CD4 809409A4 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s index ae8c140e03..61531005a7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80940D48.s @@ -432,7 +432,7 @@ glabel func_80940D48 /* 08614 809412E4 A64E05F0 */ sh $t6, 0x05F0($s2) ## 000005F0 /* 08618 809412E8 264505AC */ addiu $a1, $s2, 0x05AC ## $a1 = 000005AC /* 0861C 809412EC AFA5004C */ sw $a1, 0x004C($sp) -/* 08620 809412F0 0C0189B7 */ jal Collider_CylinderUpdate +/* 08620 809412F0 0C0189B7 */ jal Collider_UpdateCylinder /* 08624 809412F4 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 08628 809412F8 8648015A */ lh $t0, 0x015A($s2) ## 0000015A @@ -482,7 +482,7 @@ glabel func_80940D48 /* 086CC 8094139C 8E5005E8 */ lw $s0, 0x05E8($s2) ## 000005E8 /* 086D0 809413A0 A24805BD */ sb $t0, 0x05BD($s2) ## 000005BD /* 086D4 809413A4 00008825 */ or $s1, $zero, $zero ## $s1 = 00000000 -/* 086D8 809413A8 0C018D74 */ jal func_800635D0 +/* 086D8 809413A8 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 086DC 809413AC 8E040000 */ lw $a0, 0x0000($s0) ## 00000001 /* 086E0 809413B0 14400003 */ bne $v0, $zero, .L809413C0 /* 086E4 809413B4 304600FF */ andi $a2, $v0, 0x00FF ## $a2 = 00000000 @@ -523,7 +523,7 @@ glabel func_80940D48 /* 08754 80941424 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 08758 80941428 02002825 */ or $a1, $s0, $zero ## $a1 = 00000001 /* 0875C 8094142C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 08760 80941430 8FA6004C */ lw $a2, 0x004C($sp) /* 08764 80941434 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 08768 80941438 24100002 */ addiu $s0, $zero, 0x0002 ## $s0 = 00000002 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s index 4c729cdedb..6e27a95db9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80946B00.s @@ -70,7 +70,7 @@ glabel func_80946B00 /* 0DF2C 80946BFC AE09003C */ sw $t1, 0x003C($s0) ## 0000003C /* 0DF30 80946C00 8CCA0008 */ lw $t2, 0x0008($a2) ## 00000008 /* 0DF34 80946C04 AE0A0040 */ sw $t2, 0x0040($s0) ## 00000040 -/* 0DF38 80946C08 0C0189B7 */ jal Collider_CylinderUpdate +/* 0DF38 80946C08 0C0189B7 */ jal Collider_UpdateCylinder /* 0DF3C 80946C0C AFA50024 */ sw $a1, 0x0024($sp) /* 0DF40 80946C10 920B0565 */ lbu $t3, 0x0565($s0) ## 00000565 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s index 6016e68832..c2ae831de1 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/BossVa_Draw.s @@ -294,7 +294,7 @@ glabel L80959578 /* 0A2E4 809595A4 AFAA0010 */ sw $t2, 0x0010($sp) /* 0A2E8 809595A8 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 0A2EC 809595AC 0C018A29 */ jal func_800628A4 +/* 0A2EC 809595AC 0C018A29 */ jal Collider_UpdateSpheres /* 0A2F0 809595B0 260502D8 */ addiu $a1, $s0, 0x02D8 ## $a1 = 000002D8 /* 0A2F4 809595B4 3C0B8096 */ lui $t3, %hi(D_809668D2) ## $t3 = 80960000 /* 0A2F8 809595B8 816B68D2 */ lb $t3, %lo(D_809668D2)($t3) @@ -375,7 +375,7 @@ glabel L80959578 /* 0A41C 809596DC 26040338 */ addiu $a0, $s0, 0x0338 ## $a0 = 00000338 /* 0A420 809596E0 8FA5004C */ lw $a1, 0x004C($sp) /* 0A424 809596E4 8FA60048 */ lw $a2, 0x0048($sp) -/* 0A428 809596E8 0C0189CD */ jal func_80062734 +/* 0A428 809596E8 0C0189CD */ jal Collider_SetQuadVertices /* 0A42C 809596EC AFAE0010 */ sw $t6, 0x0010($sp) /* 0A430 809596F0 0C034221 */ jal Matrix_Pull /* 0A434 809596F4 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s index 0d698484b9..2144ffc036 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951844.s @@ -169,7 +169,7 @@ glabel func_80951844 /* 027B8 80951A78 2605028C */ addiu $a1, $s0, 0x028C ## $a1 = 0000028C .L80951A7C: /* 027BC 80951A7C AFA50040 */ sw $a1, 0x0040($sp) -/* 027C0 80951A80 0C0189B7 */ jal Collider_CylinderUpdate +/* 027C0 80951A80 0C0189B7 */ jal Collider_UpdateCylinder /* 027C4 80951A84 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 027C8 80951A88 8FA4004C */ lw $a0, 0x004C($sp) @@ -178,7 +178,7 @@ glabel func_80951844 /* 027D4 80951A94 00812821 */ addu $a1, $a0, $at /* 027D8 80951A98 AFA5003C */ sw $a1, 0x003C($sp) /* 027DC 80951A9C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 027E0 80951AA0 8FA60040 */ lw $a2, 0x0040($sp) /* 027E4 80951AA4 8FA5003C */ lw $a1, 0x003C($sp) /* 027E8 80951AA8 8FA4004C */ lw $a0, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s index fc8c3b588d..36068f118d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80951C04.s @@ -313,7 +313,7 @@ glabel func_80951C04 /* 02D80 80952040 46109180 */ add.s $f6, $f18, $f16 /* 02D84 80952044 AE0D0040 */ sw $t5, 0x0040($s0) ## 00000040 /* 02D88 80952048 E606003C */ swc1 $f6, 0x003C($s0) ## 0000003C -/* 02D8C 8095204C 0C0189B7 */ jal Collider_CylinderUpdate +/* 02D8C 8095204C 0C0189B7 */ jal Collider_UpdateCylinder /* 02D90 80952050 AFA50040 */ sw $a1, 0x0040($sp) /* 02D94 80952054 8FA4005C */ lw $a0, 0x005C($sp) @@ -322,7 +322,7 @@ glabel func_80951C04 /* 02DA0 80952060 00812821 */ addu $a1, $a0, $at /* 02DA4 80952064 AFA5003C */ sw $a1, 0x003C($sp) /* 02DA8 80952068 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02DAC 8095206C 8FA60040 */ lw $a2, 0x0040($sp) /* 02DB0 80952070 92030114 */ lbu $v1, 0x0114($s0) ## 00000114 /* 02DB4 80952074 8FA4005C */ lw $a0, 0x005C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s index b218e7499a..f6c539d5fe 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8095213C.s @@ -427,7 +427,7 @@ glabel func_8095213C /* 03434 809526F4 2670028C */ addiu $s0, $s3, 0x028C ## $s0 = 0000028C .L809526F8: /* 03438 809526F8 02002825 */ or $a1, $s0, $zero ## $a1 = 0000028C -/* 0343C 809526FC 0C0189B7 */ jal Collider_CylinderUpdate +/* 0343C 809526FC 0C0189B7 */ jal Collider_UpdateCylinder /* 03440 80952700 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 03444 80952704 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -436,7 +436,7 @@ glabel func_8095213C /* 03450 80952710 02202825 */ or $a1, $s1, $zero ## $a1 = 8095C1D0 /* 03454 80952714 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 03458 80952718 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0345C 8095271C 02003025 */ or $a2, $s0, $zero ## $a2 = 0000028C /* 03460 80952720 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 03464 80952724 02202825 */ or $a1, $s1, $zero ## $a1 = 8095C1D0 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s index 2cca440846..b0be361ed2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s @@ -718,7 +718,7 @@ glabel func_80952858 /* 03F88 80953248 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 03F8C 8095324C 2605028C */ addiu $a1, $s0, 0x028C ## $a1 = 0000028C /* 03F90 80953250 AFA5003C */ sw $a1, 0x003C($sp) -/* 03F94 80953254 0C0189B7 */ jal Collider_CylinderUpdate +/* 03F94 80953254 0C0189B7 */ jal Collider_UpdateCylinder /* 03F98 80953258 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 03F9C 8095325C 8FA4005C */ lw $a0, 0x005C($sp) @@ -727,7 +727,7 @@ glabel func_80952858 /* 03FA8 80953268 00812821 */ addu $a1, $a0, $at /* 03FAC 8095326C AFA50038 */ sw $a1, 0x0038($sp) /* 03FB0 80953270 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 03FB4 80953274 8FA6003C */ lw $a2, 0x003C($sp) /* 03FB8 80953278 820B0196 */ lb $t3, 0x0196($s0) ## 00000196 /* 03FBC 8095327C 8FA4005C */ lw $a0, 0x005C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s index 1f76ab9c2d..4da2bb9058 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_809586E4.s @@ -35,7 +35,7 @@ glabel func_809586E4 /* 094A4 80958764 24C50038 */ addiu $a1, $a2, 0x0038 ## $a1 = 00000038 /* 094A8 80958768 8FA60040 */ lw $a2, 0x0040($sp) /* 094AC 8095876C 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 094B0 80958770 0C018A29 */ jal func_800628A4 +/* 094B0 80958770 0C018A29 */ jal Collider_UpdateSpheres /* 094B4 80958774 24C502D8 */ addiu $a1, $a2, 0x02D8 ## $a1 = 000002D8 /* 094B8 80958778 1000006B */ beq $zero, $zero, .L80958928 /* 094BC 8095877C 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s index 323fd3cc0a..a15a3212de 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80958B0C.s @@ -281,7 +281,7 @@ glabel func_80958B0C /* 09C7C 80958F3C 26040338 */ addiu $a0, $s0, 0x0338 ## $a0 = 00000338 /* 09C80 80958F40 8FA50034 */ lw $a1, 0x0034($sp) /* 09C84 80958F44 8FA60030 */ lw $a2, 0x0030($sp) -/* 09C88 80958F48 0C0189CD */ jal func_80062734 +/* 09C88 80958F48 0C0189CD */ jal Collider_SetQuadVertices /* 09C8C 80958F4C AFAB0010 */ sw $t3, 0x0010($sp) /* 09C90 80958F50 0C034221 */ jal Matrix_Pull /* 09C94 80958F54 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s index db52e93959..9a87f698c1 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097895C.s @@ -12,7 +12,7 @@ glabel func_8097895C /* 00050 80978980 8FA4001C */ lw $a0, 0x001C($sp) /* 00054 80978984 8FA50020 */ lw $a1, 0x0020($sp) /* 00058 80978988 8FA60018 */ lw $a2, 0x0018($sp) -/* 0005C 8097898C 0C017114 */ jal Collider_SetCylinder_Set3 +/* 0005C 8097898C 0C017114 */ jal Collider_SetCylinderType1 /* 00060 80978990 8FA70024 */ lw $a3, 0x0024($sp) /* 00064 80978994 8FBF0014 */ lw $ra, 0x0014($sp) /* 00068 80978998 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s index ced127babf..746b943215 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_8097BA48.s @@ -68,7 +68,7 @@ glabel func_8097BA48 .L8097BB3C: /* 0320C 8097BB3C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L8097BB40: -/* 03210 8097BB40 0C0189B7 */ jal Collider_CylinderUpdate +/* 03210 8097BB40 0C0189B7 */ jal Collider_UpdateCylinder /* 03214 8097BB44 02402825 */ or $a1, $s2, $zero ## $a1 = 00000184 /* 03218 8097BB48 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s index 7cabb0a268..bdb5fc0ab2 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Init.s @@ -54,11 +54,11 @@ glabel DemoKekkai_Init /* 000C8 8098D098 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 000CC 8098D09C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000D0 8098D0A0 0C0189B7 */ jal Collider_CylinderUpdate +/* 000D0 8098D0A0 0C0189B7 */ jal Collider_UpdateCylinder /* 000D4 8098D0A4 8FA50020 */ lw $a1, 0x0020($sp) /* 000D8 8098D0A8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 000DC 8098D0AC 0C0189B7 */ jal Collider_CylinderUpdate +/* 000DC 8098D0AC 0C0189B7 */ jal Collider_UpdateCylinder /* 000E0 8098D0B0 8FA50024 */ lw $a1, 0x0024($sp) /* 000E4 8098D0B4 8604001C */ lh $a0, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s index bea5bcbd42..530774a1bf 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/DemoKekkai_Update.s @@ -48,7 +48,7 @@ glabel DemoKekkai_Update /* 006B8 8098D688 8FA60030 */ lw $a2, 0x0030($sp) /* 006BC 8098D68C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 006C0 8098D690 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 006C4 8098D694 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 006C8 8098D698 26060198 */ addiu $a2, $s0, 0x0198 ## $a2 = 00000198 /* 006CC 8098D69C AFA60030 */ sw $a2, 0x0030($sp) @@ -59,7 +59,7 @@ glabel DemoKekkai_Update /* 006DC 8098D6AC 8FA60030 */ lw $a2, 0x0030($sp) /* 006E0 8098D6B0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 006E4 8098D6B4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 006E8 8098D6B8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 006EC 8098D6BC 8E1901F8 */ lw $t9, 0x01F8($s0) ## 000001F8 .L8098D6C0: diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s index 95667f0d8a..fb26e35f1e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098D87C.s @@ -43,7 +43,7 @@ glabel func_8098D87C /* 00910 8098D8E0 8FA60028 */ lw $a2, 0x0028($sp) /* 00914 8098D8E4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00918 8098D8E8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0091C 8098D8EC 8FA5002C */ lw $a1, 0x002C($sp) /* 00920 8098D8F0 921801A9 */ lbu $t8, 0x01A9($s0) ## 000001A9 /* 00924 8098D8F4 33190002 */ andi $t9, $t8, 0x0002 ## $t9 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s b/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s index 863005637f..91d86301b6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s +++ b/asm/non_matchings/overlays/actors/ovl_Door_Killer/func_809952B8.s @@ -5,7 +5,7 @@ glabel func_809952B8 /* 00674 809952C4 248601C8 */ addiu $a2, $a0, 0x01C8 ## $a2 = 000001C8 /* 00678 809952C8 00C02825 */ or $a1, $a2, $zero ## $a1 = 000001C8 /* 0067C 809952CC AFA6001C */ sw $a2, 0x001C($sp) -/* 00680 809952D0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00680 809952D0 0C0189B7 */ jal Collider_UpdateCylinder /* 00684 809952D4 AFA40020 */ sw $a0, 0x0020($sp) /* 00688 809952D8 8FA40024 */ lw $a0, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s index 59e320b6ea..7feb77f93f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s @@ -172,12 +172,12 @@ glabel EnAm_Update /* 01D34 809AFC54 26510274 */ addiu $s1, $s2, 0x0274 ## $s1 = 00000274 .L809AFC58: /* 01D38 809AFC58 02202825 */ or $a1, $s1, $zero ## $a1 = 00000274 -/* 01D3C 809AFC5C 0C0189B7 */ jal Collider_CylinderUpdate +/* 01D3C 809AFC5C 0C0189B7 */ jal Collider_UpdateCylinder /* 01D40 809AFC60 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01D44 809AFC64 265002C0 */ addiu $s0, $s2, 0x02C0 ## $s0 = 000002C0 /* 01D48 809AFC68 02002825 */ or $a1, $s0, $zero ## $a1 = 000002C0 -/* 01D4C 809AFC6C 0C0189B7 */ jal Collider_CylinderUpdate +/* 01D4C 809AFC6C 0C0189B7 */ jal Collider_UpdateCylinder /* 01D50 809AFC70 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01D54 809AFC74 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -186,7 +186,7 @@ glabel EnAm_Update /* 01D60 809AFC80 AFA5005C */ sw $a1, 0x005C($sp) /* 01D64 809AFC84 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 01D68 809AFC88 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01D6C 809AFC8C 02203025 */ or $a2, $s1, $zero ## $a2 = 00000274 /* 01D70 809AFC90 864A001C */ lh $t2, 0x001C($s2) ## 0000001C /* 01D74 809AFC94 3C01809B */ lui $at, %hi(D_809B0180) ## $at = 809B0000 @@ -254,7 +254,7 @@ glabel EnAm_Update /* 01E4C 809AFD6C 8FBF004C */ lw $ra, 0x004C($sp) .L809AFD70: /* 01E50 809AFD70 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01E54 809AFD74 02003025 */ or $a2, $s0, $zero ## $a2 = 000002C0 /* 01E58 809AFD78 8FBF004C */ lw $ra, 0x004C($sp) .L809AFD7C: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s index d60f94fa59..71de0a96fc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF7CC.s @@ -30,7 +30,7 @@ glabel func_809AF7CC /* 0191C 809AF83C 2604030C */ addiu $a0, $s0, 0x030C ## $a0 = 0000030C /* 01920 809AF840 8FA50034 */ lw $a1, 0x0034($sp) /* 01924 809AF844 8FA60038 */ lw $a2, 0x0038($sp) -/* 01928 809AF848 0C0189CD */ jal func_80062734 +/* 01928 809AF848 0C0189CD */ jal Collider_SetQuadVertices /* 0192C 809AF84C AFAE0010 */ sw $t6, 0x0010($sp) /* 01930 809AF850 8FBF0024 */ lw $ra, 0x0024($sp) /* 01934 809AF854 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s index 8101dcc6dd..a74687c6af 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF864.s @@ -83,7 +83,7 @@ glabel func_809AF864 /* 01A78 809AF998 ACB80008 */ sw $t8, 0x0008($a1) ## FFFFFFF8 /* 01A7C 809AF99C C7A40024 */ lwc1 $f4, 0x0024($sp) /* 01A80 809AF9A0 46062200 */ add.s $f8, $f4, $f6 -/* 01A84 809AF9A4 0C018B58 */ jal func_80062D60 +/* 01A84 809AF9A4 0C018B58 */ jal CollisionCheck_SpawnShieldParticlesMetal /* 01A88 809AF9A8 E7A80024 */ swc1 $f8, 0x0024($sp) /* 01A8C 809AF9AC 10000010 */ beq $zero, $zero, .L809AF9F0 /* 01A90 809AF9B0 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s index 4a5490bf61..a25c8a60ca 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s @@ -251,7 +251,7 @@ glabel EnAnubice_Update /* 00F6C 809B208C 8E05027C */ lw $a1, 0x027C($s0) ## 0000027C /* 00F70 809B2090 260502C8 */ addiu $a1, $s0, 0x02C8 ## $a1 = 000002C8 /* 00F74 809B2094 AFA50030 */ sw $a1, 0x0030($sp) -/* 00F78 809B2098 0C0189B7 */ jal Collider_CylinderUpdate +/* 00F78 809B2098 0C0189B7 */ jal Collider_UpdateCylinder /* 00F7C 809B209C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00F80 809B20A0 8FA40064 */ lw $a0, 0x0064($sp) @@ -260,7 +260,7 @@ glabel EnAnubice_Update /* 00F8C 809B20AC 00812821 */ addu $a1, $a0, $at /* 00F90 809B20B0 AFA50034 */ sw $a1, 0x0034($sp) /* 00F94 809B20B4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F98 809B20B8 8FA60030 */ lw $a2, 0x0030($sp) /* 00F9C 809B20BC 860D0262 */ lh $t5, 0x0262($s0) ## 00000262 /* 00FA0 809B20C0 8FA50034 */ lw $a1, 0x0034($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s index ad89c1e682..ef5d402462 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s @@ -100,7 +100,7 @@ glabel EnAnubiceFire_Update /* 008B8 809B2E58 44189000 */ mfc1 $t8, $f18 /* 008BC 809B2E5C 1120000E */ beq $t1, $zero, .L809B2E98 /* 008C0 809B2E60 A61801EC */ sh $t8, 0x01EC($s0) ## 000001EC -/* 008C4 809B2E64 0C0189B7 */ jal Collider_CylinderUpdate +/* 008C4 809B2E64 0C0189B7 */ jal Collider_UpdateCylinder /* 008C8 809B2E68 AFA50028 */ sw $a1, 0x0028($sp) /* 008CC 809B2E6C 8FA4004C */ lw $a0, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s index f8ec9eeb7b..465f1fc888 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Draw.s @@ -167,7 +167,7 @@ glabel EnBa_Draw /* 01B08 809B7E58 16350006 */ bne $s1, $s5, .L809B7E74 /* 01B0C 809B7E5C 26500320 */ addiu $s0, $s2, 0x0320 ## $s0 = 00000320 /* 01B10 809B7E60 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 01B14 809B7E64 0C018A29 */ jal func_800628A4 +/* 01B14 809B7E64 0C018A29 */ jal Collider_UpdateSpheres /* 01B18 809B7E68 02002825 */ or $a1, $s0, $zero ## $a1 = 00000320 /* 01B1C 809B7E6C 10000009 */ beq $zero, $zero, .L809B7E94 /* 01B20 809B7E70 00000000 */ nop @@ -178,7 +178,7 @@ glabel EnBa_Draw /* 01B30 809B7E80 0C0342A3 */ jal Matrix_Scale /* 01B34 809B7E84 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 /* 01B38 809B7E88 24040008 */ addiu $a0, $zero, 0x0008 ## $a0 = 00000008 -/* 01B3C 809B7E8C 0C018A29 */ jal func_800628A4 +/* 01B3C 809B7E8C 0C018A29 */ jal Collider_UpdateSpheres /* 01B40 809B7E90 02002825 */ or $a1, $s0, $zero ## $a1 = 00000320 .L809B7E94: /* 01B44 809B7E94 3C05809C */ lui $a1, %hi(D_809B8140) ## $a1 = 809C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s index a747f63b6e..fe6feaa0f5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s @@ -68,7 +68,7 @@ glabel EnBigokuta_Init /* 000E4 809BCD44 3C06809C */ lui $a2, %hi(D_809BF460) ## $a2 = 809C0000 /* 000E8 809BCD48 24C6F460 */ addiu $a2, $a2, %lo(D_809BF460) ## $a2 = 809BF460 /* 000EC 809BCD4C 24A5F468 */ addiu $a1, $a1, %lo(D_809BF468) ## $a1 = 809BF468 -/* 000F0 809BCD50 0C0187B5 */ jal func_80061ED4 +/* 000F0 809BCD50 0C0187B5 */ jal CollisionCheck_SetInfo /* 000F4 809BCD54 26440098 */ addiu $a0, $s2, 0x0098 ## $a0 = 00000098 /* 000F8 809BCD58 8649001C */ lh $t1, 0x001C($s2) ## 0000001C /* 000FC 809BCD5C 24100001 */ addiu $s0, $zero, 0x0001 ## $s0 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s index 62b3f6ac46..c4e05fb89f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s @@ -67,7 +67,7 @@ glabel EnBigokuta_Update /* 01E60 809BEAC0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01E64 809BEAC4 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 /* 01E68 809BEAC8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01E6C 809BEACC 02203025 */ or $a2, $s1, $zero ## $a2 = 000002EC /* 01E70 809BEAD0 2610004C */ addiu $s0, $s0, 0x004C ## $s0 = 00000098 /* 01E74 809BEAD4 1615FFFA */ bne $s0, $s5, .L809BEAC0 @@ -104,7 +104,7 @@ glabel EnBigokuta_Update /* 01EDC 809BEB3C 2686028C */ addiu $a2, $s4, 0x028C ## $a2 = 0000028C /* 01EE0 809BEB40 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01EE4 809BEB44 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01EE8 809BEB48 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 /* 01EEC 809BEB4C 10000005 */ beq $zero, $zero, .L809BEB64 /* 01EF0 809BEB50 3C0141C8 */ lui $at, 0x41C8 ## $at = 41C80000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s index b16da98f67..8322690fbb 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s @@ -47,7 +47,7 @@ glabel EnBili_Init /* 000A0 809BF940 3C06809C */ lui $a2, %hi(D_809C166C) ## $a2 = 809C0000 /* 000A4 809BF944 24C6166C */ addiu $a2, $a2, %lo(D_809C166C) ## $a2 = 809C166C /* 000A8 809BF948 24A51678 */ addiu $a1, $a1, %lo(D_809C1678) ## $a1 = 809C1678 -/* 000AC 809BF94C 0C0187BF */ jal func_80061EFC +/* 000AC 809BF94C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 000B0 809BF950 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 000B4 809BF954 8608001C */ lh $t0, 0x001C($s0) ## 0000001C /* 000B8 809BF958 2401FFFF */ addiu $at, $zero, 0xFFFF ## $at = FFFFFFFF diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s index 4cfcaf322f..bd235b7ea7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s @@ -90,7 +90,7 @@ glabel EnBili_Update /* 014D8 809C0D78 E7A80010 */ swc1 $f8, 0x0010($sp) /* 014DC 809C0D7C 260501D4 */ addiu $a1, $s0, 0x01D4 ## $a1 = 000001D4 /* 014E0 809C0D80 AFA50028 */ sw $a1, 0x0028($sp) -/* 014E4 809C0D84 0C0189B7 */ jal Collider_CylinderUpdate +/* 014E4 809C0D84 0C0189B7 */ jal Collider_UpdateCylinder /* 014E8 809C0D88 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 014EC 809C0D8C 920A01E4 */ lbu $t2, 0x01E4($s0) ## 000001E4 @@ -119,7 +119,7 @@ glabel EnBili_Update .L809C0DDC: /* 0153C 809C0DDC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01540 809C0DE0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01544 809C0DE4 8FA60028 */ lw $a2, 0x0028($sp) /* 01548 809C0DE8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0154C 809C0DEC 0C00B56E */ jal Actor_SetHeight diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s index 92deb175b6..46feee3d1f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s @@ -106,7 +106,7 @@ glabel EnBomChu_Update /* 00F30 809C6760 13380003 */ beq $t9, $t8, .L809C6770 /* 00F34 809C6764 8FA6002C */ lw $a2, 0x002C($sp) /* 00F38 809C6768 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F3C 809C676C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 .L809C6770: /* 00F40 809C6770 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s index 9c158ffe08..5ba28599ae 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s @@ -71,7 +71,7 @@ glabel EnBrob_Init /* 000D4 809CABE4 3C06809D */ lui $a2, %hi(D_809CBAAC) ## $a2 = 809D0000 /* 000D8 809CABE8 24C6BAAC */ addiu $a2, $a2, %lo(D_809CBAAC) ## $a2 = 809CBAAC /* 000DC 809CABEC 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 000E0 809CABF0 0C0187B5 */ jal func_80061ED4 +/* 000E0 809CABF0 0C0187B5 */ jal CollisionCheck_SetInfo /* 000E4 809CABF4 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 000E8 809CABF8 8619001C */ lh $t9, 0x001C($s0) ## 0000001C /* 000EC 809CABFC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s index d293c91dbd..8fd43d8a16 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Update.s @@ -173,12 +173,12 @@ glabel EnBrob_Update /* 00DC8 809CB8D8 AFA50034 */ sw $a1, 0x0034($sp) /* 00DCC 809CB8DC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00DD0 809CB8E0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00DD4 809CB8E4 26060228 */ addiu $a2, $s0, 0x0228 ## $a2 = 00000228 /* 00DD8 809CB8E8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00DDC 809CB8EC 8FA50034 */ lw $a1, 0x0034($sp) /* 00DE0 809CB8F0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00DE4 809CB8F4 8FA60030 */ lw $a2, 0x0030($sp) .L809CB8F8: /* 00DE8 809CB8F8 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s index 2b55bed368..5baf5e3251 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s @@ -584,7 +584,7 @@ glabel EnClearTag_Update /* 00E34 809D43E4 A63801D6 */ sh $t8, 0x01D6($s1) ## 000001D6 /* 00E38 809D43E8 A63901D8 */ sh $t9, 0x01D8($s1) ## 000001D8 /* 00E3C 809D43EC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000194 -/* 00E40 809D43F0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00E40 809D43F0 0C0189B7 */ jal Collider_UpdateCylinder /* 00E44 809D43F4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00E48 809D43F8 8FA400CC */ lw $a0, 0x00CC($sp) @@ -680,7 +680,7 @@ glabel EnClearTag_Update /* 00F8C 809D453C A63801D6 */ sh $t8, 0x01D6($s1) ## 000001D6 /* 00F90 809D4540 A63901D8 */ sh $t9, 0x01D8($s1) ## 000001D8 /* 00F94 809D4544 02002825 */ or $a1, $s0, $zero ## $a1 = 00000194 -/* 00F98 809D4548 0C0189B7 */ jal Collider_CylinderUpdate +/* 00F98 809D4548 0C0189B7 */ jal Collider_UpdateCylinder /* 00F9C 809D454C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00FA0 809D4550 8FA400CC */ lw $a0, 0x00CC($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s index 194b9d50af..a1b10a8571 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s @@ -49,7 +49,7 @@ glabel EnCs_Init /* 001C8 809E1A78 3C06809E */ lui $a2, %hi(D_809E28EC) ## $a2 = 809E0000 /* 001CC 809E1A7C 24C628EC */ addiu $a2, $a2, %lo(D_809E28EC) ## $a2 = 809E28EC /* 001D0 809E1A80 24A528F8 */ addiu $a1, $a1, %lo(D_809E28F8) ## $a1 = 809E28F8 -/* 001D4 809E1A84 0C0187BF */ jal func_80061EFC +/* 001D4 809E1A84 0C0187BF */ jal CollisionCheck_SetInfo2 /* 001D8 809E1A88 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 001DC 809E1A8C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 001E0 809E1A90 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s index ef0765d552..825c164cae 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Update.s @@ -62,7 +62,7 @@ glabel EnCs_Update .L809E24F8: /* 00C48 809E24F8 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00C4C 809E24FC AFA60024 */ sw $a2, 0x0024($sp) -/* 00C50 809E2500 0C0189B7 */ jal Collider_CylinderUpdate +/* 00C50 809E2500 0C0189B7 */ jal Collider_UpdateCylinder /* 00C54 809E2504 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00C58 809E2508 8FA40034 */ lw $a0, 0x0034($sp) @@ -70,7 +70,7 @@ glabel EnCs_Update /* 00C60 809E2510 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00C64 809E2514 8FA60024 */ lw $a2, 0x0024($sp) /* 00C68 809E2518 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00C6C 809E251C 00812821 */ addu $a1, $a0, $at /* 00C70 809E2520 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 00C74 809E2524 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s index 39e6be0370..ba400d28c4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s @@ -108,7 +108,7 @@ glabel EnDaikuKakariko_Init /* 00228 809E4548 3C06809E */ lui $a2, %hi(D_809E54DC) ## $a2 = 809E0000 /* 0022C 809E454C 24C654DC */ addiu $a2, $a2, %lo(D_809E54DC) ## $a2 = 809E54DC /* 00230 809E4550 24A554E8 */ addiu $a1, $a1, %lo(D_809E54E8) ## $a1 = 809E54E8 -/* 00234 809E4554 0C0187BF */ jal func_80061EFC +/* 00234 809E4554 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00238 809E4558 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 0023C 809E455C 3C03809E */ lui $v1, %hi(D_809E5508) ## $v1 = 809E0000 /* 00240 809E4560 24635508 */ addiu $v1, $v1, %lo(D_809E5508) ## $v1 = 809E5508 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s index 82792e9788..52444c1cfd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Update.s @@ -28,7 +28,7 @@ glabel EnDaikuKakariko_Update .L809E4FA0: /* 00C80 809E4FA0 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00C84 809E4FA4 AFA6002C */ sw $a2, 0x002C($sp) -/* 00C88 809E4FA8 0C0189B7 */ jal Collider_CylinderUpdate +/* 00C88 809E4FA8 0C0189B7 */ jal Collider_UpdateCylinder /* 00C8C 809E4FAC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00C90 809E4FB0 96080200 */ lhu $t0, 0x0200($s0) ## 00000200 @@ -48,7 +48,7 @@ glabel EnDaikuKakariko_Update /* 00CC4 809E4FE4 8FA40044 */ lw $a0, 0x0044($sp) /* 00CC8 809E4FE8 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00CCC 809E4FEC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00CD0 809E4FF0 00812821 */ addu $a1, $a0, $at /* 00CD4 809E4FF4 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 00CD8 809E4FF8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s index a6783ae65e..8e4ce007e2 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s @@ -92,7 +92,7 @@ glabel EnDekubaba_Init /* 00154 809E5924 3C01809F */ lui $at, %hi(D_809E9000+0x1B) ## $at = 809F0000 /* 00158 809E5928 A028901B */ sb $t0, %lo(D_809E9000+0x1B)($at) .L809E592C: -/* 0015C 809E592C 0C0187B5 */ jal func_80061ED4 +/* 0015C 809E592C 0C0187B5 */ jal CollisionCheck_SetInfo /* 00160 809E5930 24A59000 */ addiu $a1, $a1, %lo(D_809E9000) ## $a1 = 809E9000 /* 00164 809E5934 24090004 */ addiu $t1, $zero, 0x0004 ## $t1 = 00000004 /* 00168 809E5938 240A0008 */ addiu $t2, $zero, 0x0008 ## $t2 = 00000008 @@ -132,7 +132,7 @@ glabel EnDekubaba_Init /* 001E4 809E59B4 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 001E8 809E59B8 A0398FFB */ sb $t9, %lo(D_809E8FE0+0x1B)($at) .L809E59BC: -/* 001EC 809E59BC 0C0187B5 */ jal func_80061ED4 +/* 001EC 809E59BC 0C0187B5 */ jal CollisionCheck_SetInfo /* 001F0 809E59C0 24C68FD8 */ addiu $a2, $a2, %lo(D_809E8FD8) ## $a2 = 809E8FD8 /* 001F4 809E59C4 24080007 */ addiu $t0, $zero, 0x0007 ## $t0 = 00000007 /* 001F8 809E59C8 24090001 */ addiu $t1, $zero, 0x0001 ## $t1 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s index 1eaa28382f..83a07a16be 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s @@ -105,7 +105,7 @@ glabel EnDekubaba_Update /* 02D98 809E8568 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02D9C 809E856C 02212821 */ addu $a1, $s1, $at /* 02DA0 809E8570 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02DA4 809E8574 26060238 */ addiu $a2, $s0, 0x0238 ## $a2 = 00000238 .L809E8578: /* 02DA8 809E8578 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s index 47821fe53a..e859fdc542 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E86B8.s @@ -157,10 +157,10 @@ glabel func_809E86B8 /* 030EC 809E88BC AC4F0000 */ sw $t7, 0x0000($v0) ## 00000000 /* 030F0 809E88C0 8EB80000 */ lw $t8, 0x0000($s5) ## 809E902C /* 030F4 809E88C4 03C02825 */ or $a1, $s8, $zero ## $a1 = 00000238 -/* 030F8 809E88C8 0C018A29 */ jal func_800628A4 +/* 030F8 809E88C8 0C018A29 */ jal Collider_UpdateSpheres /* 030FC 809E88CC AC580004 */ sw $t8, 0x0004($v0) ## 00000004 /* 03100 809E88D0 02E02025 */ or $a0, $s7, $zero ## $a0 = 00000034 -/* 03104 809E88D4 0C018A29 */ jal func_800628A4 +/* 03104 809E88D4 0C018A29 */ jal Collider_UpdateSpheres /* 03108 809E88D8 03C02825 */ or $a1, $s8, $zero ## $a1 = 00000238 /* 0310C 809E88DC 16400015 */ bne $s2, $zero, .L809E8934 /* 03110 809E88E0 2A410002 */ slti $at, $s2, 0x0002 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s index cefec32a76..70bb6d5eae 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E89E4.s @@ -57,10 +57,10 @@ glabel func_809E89E4 /* 032B8 809E8A88 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 /* 032BC 809E8A8C 8FB00040 */ lw $s0, 0x0040($sp) /* 032C0 809E8A90 26100238 */ addiu $s0, $s0, 0x0238 ## $s0 = 00000238 -/* 032C4 809E8A94 0C018A29 */ jal func_800628A4 +/* 032C4 809E8A94 0C018A29 */ jal Collider_UpdateSpheres /* 032C8 809E8A98 02002825 */ or $a1, $s0, $zero ## $a1 = 00000238 /* 032CC 809E8A9C 24040038 */ addiu $a0, $zero, 0x0038 ## $a0 = 00000038 -/* 032D0 809E8AA0 0C018A29 */ jal func_800628A4 +/* 032D0 809E8AA0 0C018A29 */ jal Collider_UpdateSpheres /* 032D4 809E8AA4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000238 /* 032D8 809E8AA8 8FAB0044 */ lw $t3, 0x0044($sp) /* 032DC 809E8AAC 3C06809F */ lui $a2, %hi(D_809E90E0) ## $a2 = 809F0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s index 1b5746ae94..48305b615c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E8C0C.s @@ -8,7 +8,7 @@ glabel func_809E8C0C /* 03454 809E8C24 14A10004 */ bne $a1, $at, .L809E8C38 /* 03458 809E8C28 AFA70024 */ sw $a3, 0x0024($sp) /* 0345C 809E8C2C 8FA50028 */ lw $a1, 0x0028($sp) -/* 03460 809E8C30 0C018A29 */ jal func_800628A4 +/* 03460 809E8C30 0C018A29 */ jal Collider_UpdateSpheres /* 03464 809E8C34 24A50238 */ addiu $a1, $a1, 0x0238 ## $a1 = 00000238 .L809E8C38: /* 03468 809E8C38 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s index e8de6a162c..0bb5887b2f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s @@ -55,7 +55,7 @@ glabel EnDekunuts_Init /* 000BC 809E961C 3C06809F */ lui $a2, %hi(D_809EAB7C) ## $a2 = 809F0000 /* 000C0 809E9620 24C6AB7C */ addiu $a2, $a2, %lo(D_809EAB7C) ## $a2 = 809EAB7C /* 000C4 809E9624 24A5AB84 */ addiu $a1, $a1, %lo(D_809EAB84) ## $a1 = 809EAB84 -/* 000C8 809E9628 0C0187B5 */ jal func_80061ED4 +/* 000C8 809E9628 0C0187B5 */ jal CollisionCheck_SetInfo /* 000CC 809E962C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 000D0 809E9630 860A001C */ lh $t2, 0x001C($s0) ## 0000001C /* 000D4 809E9634 860D001C */ lh $t5, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s index e410fde47c..786434ab36 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s @@ -34,7 +34,7 @@ glabel EnDekunuts_Update /* 01348 809EA8A8 E7A80010 */ swc1 $f8, 0x0010($sp) /* 0134C 809EA8AC 260502C8 */ addiu $a1, $s0, 0x02C8 ## $a1 = 000002C8 /* 01350 809EA8B0 AFA50028 */ sw $a1, 0x0028($sp) -/* 01354 809EA8B4 0C0189B7 */ jal Collider_CylinderUpdate +/* 01354 809EA8B4 0C0189B7 */ jal Collider_UpdateCylinder /* 01358 809EA8B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0135C 809EA8BC 920902D9 */ lbu $t1, 0x02D9($s0) ## 000002D9 @@ -53,7 +53,7 @@ glabel EnDekunuts_Update /* 01388 809EA8E8 02212821 */ addu $a1, $s1, $at /* 0138C 809EA8EC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01390 809EA8F0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01394 809EA8F4 8FA60028 */ lw $a2, 0x0028($sp) /* 01398 809EA8F8 8E030190 */ lw $v1, 0x0190($s0) ## 00000190 /* 0139C 809EA8FC 3C0B809F */ lui $t3, %hi(func_809E9B98) ## $t3 = 809F0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s index 6dae03039f..cac9c1f512 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s @@ -134,7 +134,7 @@ glabel EnDivingGame_Update /* 01508 809EED78 2606034C */ addiu $a2, $s0, 0x034C ## $a2 = 0000034C /* 0150C 809EED7C 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000034C /* 01510 809EED80 AFA6002C */ sw $a2, 0x002C($sp) -/* 01514 809EED84 0C0189B7 */ jal Collider_CylinderUpdate +/* 01514 809EED84 0C0189B7 */ jal Collider_UpdateCylinder /* 01518 809EED88 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0151C 809EED8C 8FA4004C */ lw $a0, 0x004C($sp) @@ -142,7 +142,7 @@ glabel EnDivingGame_Update /* 01524 809EED94 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01528 809EED98 8FA6002C */ lw $a2, 0x002C($sp) /* 0152C 809EED9C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01530 809EEDA0 00812821 */ addu $a1, $a0, $at /* 01534 809EEDA4 8FBF0024 */ lw $ra, 0x0024($sp) /* 01538 809EEDA8 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s index b6c6f15a77..1c3c66f1fa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s @@ -135,7 +135,7 @@ glabel EnDntJiji_Update /* 012D8 809F2DB8 2606025C */ addiu $a2, $s0, 0x025C ## $a2 = 0000025C /* 012DC 809F2DBC 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000025C /* 012E0 809F2DC0 AFA60028 */ sw $a2, 0x0028($sp) -/* 012E4 809F2DC4 0C0189B7 */ jal Collider_CylinderUpdate +/* 012E4 809F2DC4 0C0189B7 */ jal Collider_UpdateCylinder /* 012E8 809F2DC8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 012EC 809F2DCC 9208023C */ lbu $t0, 0x023C($s0) ## 0000023C @@ -145,7 +145,7 @@ glabel EnDntJiji_Update /* 012FC 809F2DDC 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 01300 809F2DE0 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01304 809F2DE4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01308 809F2DE8 00812821 */ addu $a1, $a0, $at .L809F2DEC: /* 0130C 809F2DEC 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s index e5c4eb78d6..00129f8655 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s @@ -184,7 +184,7 @@ glabel L809F57B0 /* 025B4 809F5874 AFA4002C */ sw $a0, 0x002C($sp) /* 025B8 809F5878 26050228 */ addiu $a1, $s0, 0x0228 ## $a1 = 00000228 /* 025BC 809F587C 26060234 */ addiu $a2, $s0, 0x0234 ## $a2 = 00000234 -/* 025C0 809F5880 0C0189CD */ jal func_80062734 +/* 025C0 809F5880 0C0189CD */ jal Collider_SetQuadVertices /* 025C4 809F5884 26070240 */ addiu $a3, $s0, 0x0240 ## $a3 = 00000240 /* 025C8 809F5888 8FA4003C */ lw $a0, 0x003C($sp) /* 025CC 809F588C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -196,7 +196,7 @@ glabel L809F57B0 /* 025E0 809F58A0 1000000C */ beq $zero, $zero, .L809F58D4 /* 025E4 809F58A4 8FBF0024 */ lw $ra, 0x0024($sp) .L809F58A8: -/* 025E8 809F58A8 0C0189B7 */ jal Collider_CylinderUpdate +/* 025E8 809F58A8 0C0189B7 */ jal Collider_UpdateCylinder /* 025EC 809F58AC AFA6002C */ sw $a2, 0x002C($sp) /* 025F0 809F58B0 920B0218 */ lbu $t3, 0x0218($s0) ## 00000218 @@ -206,7 +206,7 @@ glabel L809F57B0 /* 02600 809F58C0 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 02604 809F58C4 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 02608 809F58C8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0260C 809F58CC 00812821 */ addu $a1, $a0, $at .L809F58D0: /* 02610 809F58D0 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s index e453b72c09..b8fb93d85f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s @@ -42,7 +42,7 @@ glabel EnDodojr_Init /* 0008C 809F644C 3C06809F */ lui $a2, %hi(D_809F7EDC) ## $a2 = 809F0000 /* 00090 809F6450 24C67EDC */ addiu $a2, $a2, %lo(D_809F7EDC) ## $a2 = 809F7EDC /* 00094 809F6454 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 00098 809F6458 0C0187BF */ jal func_80061EFC +/* 00098 809F6458 0C0187BF */ jal CollisionCheck_SetInfo2 /* 0009C 809F645C 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 000A0 809F6460 8E080004 */ lw $t0, 0x0004($s0) ## 00000004 /* 000A4 809F6464 2401FFFE */ addiu $at, $zero, 0xFFFE ## $at = FFFFFFFE diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s index d8cff6b09f..6073be6d22 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F72A4.s @@ -4,7 +4,7 @@ glabel func_809F72A4 /* 00EEC 809F72AC AFBF0014 */ sw $ra, 0x0014($sp) /* 00EF0 809F72B0 24850194 */ addiu $a1, $a0, 0x0194 ## $a1 = 00000194 /* 00EF4 809F72B4 AFA50024 */ sw $a1, 0x0024($sp) -/* 00EF8 809F72B8 0C0189B7 */ jal Collider_CylinderUpdate +/* 00EF8 809F72B8 0C0189B7 */ jal Collider_UpdateCylinder /* 00EFC 809F72BC AFA40028 */ sw $a0, 0x0028($sp) /* 00F00 809F72C0 8FA70028 */ lw $a3, 0x0028($sp) @@ -67,7 +67,7 @@ glabel func_809F72A4 /* 00FD0 809F7390 8FA4002C */ lw $a0, 0x002C($sp) .L809F7394: /* 00FD4 809F7394 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00FD8 809F7398 8FA60024 */ lw $a2, 0x0024($sp) .L809F739C: /* 00FDC 809F739C 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s index 75e923afa8..673130b119 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s @@ -39,7 +39,7 @@ glabel EnDu_Init /* 00600 809FE230 3C0680A0 */ lui $a2, %hi(D_809FF25C) ## $a2 = 80A00000 /* 00604 809FE234 24C6F25C */ addiu $a2, $a2, %lo(D_809FF25C) ## $a2 = 809FF25C /* 00608 809FE238 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 0060C 809FE23C 0C0187BF */ jal func_80061EFC +/* 0060C 809FE23C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00610 809FE240 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 00614 809FE244 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00618 809FE248 0C27F76D */ jal func_809FDDB4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s index c3aafbe926..235c083821 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s @@ -7,7 +7,7 @@ glabel EnDu_Update /* 01100 809FED30 AFBF0024 */ sw $ra, 0x0024($sp) /* 01104 809FED34 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 01108 809FED38 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 0110C 809FED3C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0110C 809FED3C 0C0189B7 */ jal Collider_UpdateCylinder /* 01110 809FED40 AFA6002C */ sw $a2, 0x002C($sp) /* 01114 809FED44 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnDu_Update /* 0111C 809FED4C 8FA6002C */ lw $a2, 0x002C($sp) /* 01120 809FED50 02212821 */ addu $a1, $s1, $at /* 01124 809FED54 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01128 809FED58 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0112C 809FED5C 8E0F0154 */ lw $t7, 0x0154($s0) ## 00000154 /* 01130 809FED60 3C0E0600 */ lui $t6, %hi(D_060041F4) ## $t6 = 06000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s index 5ff4a06462..a761370e90 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s @@ -46,7 +46,7 @@ glabel EnEiyer_Init /* 0009C 80A0003C 3C0680A0 */ lui $a2, %hi(D_80A0199C) ## $a2 = 80A00000 /* 000A0 80A00040 24C6199C */ addiu $a2, $a2, %lo(D_80A0199C) ## $a2 = 80A0199C /* 000A4 80A00044 24A519A4 */ addiu $a1, $a1, %lo(D_80A019A4) ## $a1 = 80A019A4 -/* 000A8 80A00048 0C0187B5 */ jal func_80061ED4 +/* 000A8 80A00048 0C0187B5 */ jal CollisionCheck_SetInfo /* 000AC 80A0004C 26240098 */ addiu $a0, $s1, 0x0098 ## $a0 = 00000098 /* 000B0 80A00050 8622001C */ lh $v0, 0x001C($s1) ## 0000001C /* 000B4 80A00054 28410003 */ slti $at, $v0, 0x0003 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s index 01cbe3ee3f..9b6d2a6c9b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s @@ -87,7 +87,7 @@ glabel EnEiyer_Update /* 01700 80A016A0 1483001F */ bne $a0, $v1, .L80A01720 /* 01704 80A016A4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80A016A8: -/* 01708 80A016A8 0C0189B7 */ jal Collider_CylinderUpdate +/* 01708 80A016A8 0C0189B7 */ jal Collider_UpdateCylinder /* 0170C 80A016AC AFA5002C */ sw $a1, 0x002C($sp) /* 01710 80A016B0 92090298 */ lbu $t1, 0x0298($s0) ## 00000298 @@ -121,7 +121,7 @@ glabel EnEiyer_Update /* 01770 80A01710 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01774 80A01714 00812821 */ addu $a1, $a0, $at /* 01778 80A01718 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0177C 80A0171C 8FA6002C */ lw $a2, 0x002C($sp) .L80A01720: /* 01780 80A01720 8E0F0004 */ lw $t7, 0x0004($s0) ## 00000004 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s b/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s index 3be6e59479..577cfd2160 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s @@ -883,7 +883,7 @@ glabel func_80A10220 /* 01BC4 80A10E24 8FBF0044 */ lw $ra, 0x0044($sp) .L80A10E28: /* 01BC8 80A10E28 260501B0 */ addiu $a1, $s0, 0x01B0 ## $a1 = 000001B0 -/* 01BCC 80A10E2C 0C0189B7 */ jal Collider_CylinderUpdate +/* 01BCC 80A10E2C 0C0189B7 */ jal Collider_UpdateCylinder /* 01BD0 80A10E30 AFA50050 */ sw $a1, 0x0050($sp) /* 01BD4 80A10E34 3C0480A1 */ lui $a0, %hi(D_80A118CC) ## $a0 = 80A10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s index aa58cc93bd..cc5e5dfc06 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s @@ -182,7 +182,7 @@ glabel EnFireRock_Update /* 00E5C 80A12A7C 1040000F */ beq $v0, $zero, .L80A12ABC /* 00E60 80A12A80 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00E64 80A12A84 26050194 */ addiu $a1, $s0, 0x0194 ## $a1 = 00000194 -/* 00E68 80A12A88 0C0189B7 */ jal Collider_CylinderUpdate +/* 00E68 80A12A88 0C0189B7 */ jal Collider_UpdateCylinder /* 00E6C 80A12A8C AFA5002C */ sw $a1, 0x002C($sp) /* 00E70 80A12A90 8FA4004C */ lw $a0, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s index 16d121f458..1f62d85d8d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Draw.s @@ -16,7 +16,7 @@ glabel EnFish_Draw /* 01D64 80A16FE4 AFA00010 */ sw $zero, 0x0010($sp) /* 01D68 80A16FE8 8FA20028 */ lw $v0, 0x0028($sp) /* 01D6C 80A16FEC 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 01D70 80A16FF0 0C018A29 */ jal func_800628A4 +/* 01D70 80A16FF0 0C018A29 */ jal Collider_UpdateSpheres /* 01D74 80A16FF4 2445014C */ addiu $a1, $v0, 0x014C ## $a1 = 0000014C /* 01D78 80A16FF8 8FBF0024 */ lw $ra, 0x0024($sp) /* 01D7C 80A16FFC 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s index a7d99ee3c2..f400e99350 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s @@ -65,7 +65,7 @@ glabel func_80A16C68 /* 01AB8 80A16D38 45000003 */ bc1f .L80A16D48 /* 01ABC 80A16D3C 00000000 */ nop /* 01AC0 80A16D40 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01AC4 80A16D44 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C .L80A16D48: /* 01AC8 80A16D48 3C0180A1 */ lui $at, %hi(D_80A171EC) ## $at = 80A10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s index fd1b51ea00..6ee28655c3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s @@ -23,7 +23,7 @@ glabel EnFz_Init /* 0004C 80A1FE0C 8FA50020 */ lw $a1, 0x0020($sp) /* 00050 80A1FE10 24E71B90 */ addiu $a3, $a3, %lo(D_80A21B90) ## $a3 = 80A21B90 /* 00054 80A1FE14 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00058 80A1FE18 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00058 80A1FE18 0C017114 */ jal Collider_SetCylinderType1 /* 0005C 80A1FE1C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00060 80A1FE20 2605019C */ addiu $a1, $s0, 0x019C ## $a1 = 0000019C /* 00064 80A1FE24 AFA50020 */ sw $a1, 0x0020($sp) @@ -34,7 +34,7 @@ glabel EnFz_Init /* 00074 80A1FE34 8FA50020 */ lw $a1, 0x0020($sp) /* 00078 80A1FE38 24E71BBC */ addiu $a3, $a3, %lo(D_80A21BBC) ## $a3 = 80A21BBC /* 0007C 80A1FE3C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00080 80A1FE40 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00080 80A1FE40 0C017114 */ jal Collider_SetCylinderType1 /* 00084 80A1FE44 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00088 80A1FE48 260501E8 */ addiu $a1, $s0, 0x01E8 ## $a1 = 000001E8 /* 0008C 80A1FE4C AFA50020 */ sw $a1, 0x0020($sp) @@ -45,7 +45,7 @@ glabel EnFz_Init /* 0009C 80A1FE5C 8FA50020 */ lw $a1, 0x0020($sp) /* 000A0 80A1FE60 24E71BE8 */ addiu $a3, $a3, %lo(D_80A21BE8) ## $a3 = 80A21BE8 /* 000A4 80A1FE64 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 000A8 80A1FE68 0C017114 */ jal Collider_SetCylinder_Set3 +/* 000A8 80A1FE68 0C017114 */ jal Collider_SetCylinderType1 /* 000AC 80A1FE6C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 000B0 80A1FE70 3C053C03 */ lui $a1, 0x3C03 ## $a1 = 3C030000 /* 000B4 80A1FE74 34A5126F */ ori $a1, $a1, 0x126F ## $a1 = 3C03126F diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s index 8bd30cae79..eb814d5808 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s @@ -40,12 +40,12 @@ glabel EnFz_Update /* 01384 80A21144 26050150 */ addiu $a1, $s0, 0x0150 ## $a1 = 00000150 /* 01388 80A21148 5520001E */ bnel $t1, $zero, .L80A211C4 /* 0138C 80A2114C 3C063E4C */ lui $a2, 0x3E4C ## $a2 = 3E4C0000 -/* 01390 80A21150 0C0189B7 */ jal Collider_CylinderUpdate +/* 01390 80A21150 0C0189B7 */ jal Collider_UpdateCylinder /* 01394 80A21154 AFA50030 */ sw $a1, 0x0030($sp) /* 01398 80A21158 2605019C */ addiu $a1, $s0, 0x019C ## $a1 = 0000019C /* 0139C 80A2115C AFA5002C */ sw $a1, 0x002C($sp) -/* 013A0 80A21160 0C0189B7 */ jal Collider_CylinderUpdate +/* 013A0 80A21160 0C0189B7 */ jal Collider_UpdateCylinder /* 013A4 80A21164 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 013A8 80A21168 920A0248 */ lbu $t2, 0x0248($s0) ## 00000248 @@ -72,7 +72,7 @@ glabel EnFz_Update /* 013F0 80A211B0 02212821 */ addu $a1, $s1, $at /* 013F4 80A211B4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 013F8 80A211B8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 013FC 80A211BC 8FA60030 */ lw $a2, 0x0030($sp) /* 01400 80A211C0 3C063E4C */ lui $a2, 0x3E4C ## $a2 = 3E4C0000 .L80A211C4: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s index 7d7ebcf413..a4e1aaf853 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20100.s @@ -122,7 +122,7 @@ glabel func_80A20100 /* 004DC 80A2029C 00000000 */ nop .L80A202A0: /* 004E0 80A202A0 8FA400BC */ lw $a0, 0x00BC($sp) -/* 004E4 80A202A4 0C018B35 */ jal func_80062CD4 +/* 004E4 80A202A4 0C018B35 */ jal CollisionCheck_SpawnShieldParticles /* 004E8 80A202A8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 004EC 80A202AC 8FBF007C */ lw $ra, 0x007C($sp) /* 004F0 80A202B0 D7B40028 */ ldc1 $f20, 0x0028($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s index abf0e829b4..1e49cbf8fb 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s @@ -61,7 +61,7 @@ glabel EnGb_Init /* 000F4 80A2F274 24E70690 */ addiu $a3, $a3, %lo(D_80A30690) ## $a3 = 80A30690 /* 000F8 80A2F278 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 000FC 80A2F27C 02002825 */ or $a1, $s0, $zero ## $a1 = 0000023C -/* 00100 80A2F280 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00100 80A2F280 0C017114 */ jal Collider_SetCylinderType1 /* 00104 80A2F284 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 /* 00108 80A2F288 3C1080A3 */ lui $s0, %hi(D_80A306BC) ## $s0 = 80A30000 /* 0010C 80A2F28C 3C1480A3 */ lui $s4, %hi(D_80A30740) ## $s4 = 80A30000 @@ -76,7 +76,7 @@ glabel EnGb_Init /* 00128 80A2F2A8 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 0012C 80A2F2AC 02202825 */ or $a1, $s1, $zero ## $a1 = 00000288 /* 00130 80A2F2B0 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 -/* 00134 80A2F2B4 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00134 80A2F2B4 0C017114 */ jal Collider_SetCylinderType1 /* 00138 80A2F2B8 02003825 */ or $a3, $s0, $zero ## $a3 = 80A306BC /* 0013C 80A2F2BC 2610002C */ addiu $s0, $s0, 0x002C ## $s0 = 80A306E8 /* 00140 80A2F2C0 0214082B */ sltu $at, $s0, $s4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s index da0a61102c..41bcc8095e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Update.s @@ -30,7 +30,7 @@ glabel EnGb_Update /* 00C60 80A2FDE0 02802825 */ or $a1, $s4, $zero ## $a1 = 00000000 /* 00C64 80A2FDE4 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 00C68 80A2FDE8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00C6C 80A2FDEC 2646023C */ addiu $a2, $s2, 0x023C ## $a2 = 0000023C /* 00C70 80A2FDF0 00008025 */ or $s0, $zero, $zero ## $s0 = 00000000 /* 00C74 80A2FDF4 26510288 */ addiu $s1, $s2, 0x0288 ## $s1 = 00000288 @@ -39,7 +39,7 @@ glabel EnGb_Update /* 00C7C 80A2FDFC 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 00C80 80A2FE00 02802825 */ or $a1, $s4, $zero ## $a1 = 00000000 /* 00C84 80A2FE04 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00C88 80A2FE08 02203025 */ or $a2, $s1, $zero ## $a2 = 00000288 /* 00C8C 80A2FE0C 2610004C */ addiu $s0, $s0, 0x004C ## $s0 = 0000004C /* 00C90 80A2FE10 1615FFFA */ bne $s0, $s5, .L80A2FDFC diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s index d72dad1da6..5b07a171af 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s @@ -7,7 +7,7 @@ glabel EnGe1_Update /* 01910 80A32280 AFBF0024 */ sw $ra, 0x0024($sp) /* 01914 80A32284 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 01918 80A32288 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 0191C 80A3228C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0191C 80A3228C 0C0189B7 */ jal Collider_UpdateCylinder /* 01920 80A32290 AFA6002C */ sw $a2, 0x002C($sp) /* 01924 80A32294 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnGe1_Update /* 0192C 80A3229C 8FA6002C */ lw $a2, 0x002C($sp) /* 01930 80A322A0 02212821 */ addu $a1, $s1, $at /* 01934 80A322A4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01938 80A322A8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0193C 80A322AC 0C00B638 */ jal Actor_MoveForward diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s index f05ba08d6b..3e2192d0dd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s @@ -6,7 +6,7 @@ glabel func_80A33BE8 /* 01028 80A33BF8 AFA5003C */ sw $a1, 0x003C($sp) /* 0102C 80A33BFC 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 01030 80A33C00 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 01034 80A33C04 0C0189B7 */ jal Collider_CylinderUpdate +/* 01034 80A33C04 0C0189B7 */ jal Collider_UpdateCylinder /* 01038 80A33C08 AFA6002C */ sw $a2, 0x002C($sp) /* 0103C 80A33C0C 8FA4003C */ lw $a0, 0x003C($sp) @@ -14,7 +14,7 @@ glabel func_80A33BE8 /* 01044 80A33C14 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 01048 80A33C18 8FA6002C */ lw $a2, 0x002C($sp) /* 0104C 80A33C1C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01050 80A33C20 00812821 */ addu $a1, $a0, $at /* 01054 80A33C24 3C014220 */ lui $at, 0x4220 ## $at = 42200000 /* 01058 80A33C28 44810000 */ mtc1 $at, $f0 ## $f0 = 40.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s index 88e446051d..cd31704b80 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s @@ -6,7 +6,7 @@ glabel func_80A3402C /* 0146C 80A3403C 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 /* 01470 80A34040 AFBF0024 */ sw $ra, 0x0024($sp) /* 01474 80A34044 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 01478 80A34048 0C0189B7 */ jal Collider_CylinderUpdate +/* 01478 80A34048 0C0189B7 */ jal Collider_UpdateCylinder /* 0147C 80A3404C AFA5002C */ sw $a1, 0x002C($sp) /* 01480 80A34050 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel func_80A3402C /* 0148C 80A3405C AFA50028 */ sw $a1, 0x0028($sp) /* 01490 80A34060 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01494 80A34064 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01498 80A34068 8FA6002C */ lw $a2, 0x002C($sp) /* 0149C 80A3406C 3C014220 */ lui $at, 0x4220 ## $at = 42200000 /* 014A0 80A34070 44810000 */ mtc1 $at, $f0 ## $f0 = 40.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s b/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s index b20c1c9c8e..e3c4558d20 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s @@ -6,7 +6,7 @@ glabel func_80A34C40 /* 00630 80A34C50 AFA5003C */ sw $a1, 0x003C($sp) /* 00634 80A34C54 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 00638 80A34C58 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 0063C 80A34C5C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0063C 80A34C5C 0C0189B7 */ jal Collider_UpdateCylinder /* 00640 80A34C60 AFA6002C */ sw $a2, 0x002C($sp) /* 00644 80A34C64 8FA4003C */ lw $a0, 0x003C($sp) @@ -14,7 +14,7 @@ glabel func_80A34C40 /* 0064C 80A34C6C 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00650 80A34C70 8FA6002C */ lw $a2, 0x002C($sp) /* 00654 80A34C74 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00658 80A34C78 00812821 */ addu $a1, $a0, $at /* 0065C 80A34C7C 3C014220 */ lui $at, 0x4220 ## $at = 42200000 /* 00660 80A34C80 44810000 */ mtc1 $at, $f0 ## $f0 = 40.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s index da774f83b5..bcbfe421ff 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s @@ -56,7 +56,7 @@ glabel EnGo_Init /* 01684 80A3FBF4 3C0680A4 */ lui $a2, %hi(D_80A41B2C) ## $a2 = 80A40000 /* 01688 80A3FBF8 24C61B2C */ addiu $a2, $a2, %lo(D_80A41B2C) ## $a2 = 80A41B2C /* 0168C 80A3FBFC 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 01690 80A3FC00 0C0187BF */ jal func_80061EFC +/* 01690 80A3FC00 0C0187BF */ jal CollisionCheck_SetInfo2 /* 01694 80A3FC04 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 01698 80A3FC08 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0169C 80A3FC0C 0C28FBA3 */ jal func_80A3EE8C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s index 586638a4ba..9c508092de 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s @@ -7,7 +7,7 @@ glabel EnGo_Update /* 028F0 80A40E60 AFBF0024 */ sw $ra, 0x0024($sp) /* 028F4 80A40E64 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 028F8 80A40E68 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 028FC 80A40E6C 0C0189B7 */ jal Collider_CylinderUpdate +/* 028FC 80A40E6C 0C0189B7 */ jal Collider_UpdateCylinder /* 02900 80A40E70 AFA6002C */ sw $a2, 0x002C($sp) /* 02904 80A40E74 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnGo_Update /* 0290C 80A40E7C 8FA6002C */ lw $a2, 0x002C($sp) /* 02910 80A40E80 02212821 */ addu $a1, $s1, $at /* 02914 80A40E84 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02918 80A40E88 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0291C 80A40E8C 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s index ab306a6b51..dc69f9528f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s @@ -76,7 +76,7 @@ glabel EnGo2_Init /* 03824 80A46554 3C0680A5 */ lui $a2, %hi(D_80A48140) ## $a2 = 80A50000 /* 03828 80A46558 24C68140 */ addiu $a2, $a2, %lo(D_80A48140) ## $a2 = 80A48140 /* 0382C 80A4655C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 03830 80A46560 0C0187BF */ jal func_80061EFC +/* 03830 80A46560 0C0187BF */ jal CollisionCheck_SetInfo2 /* 03834 80A46564 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 03838 80A46568 8619001C */ lh $t9, 0x001C($s0) ## 0000001C /* 0383C 80A4656C 3328001F */ andi $t0, $t9, 0x001F ## $t0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s index 7203eb892d..52b5896679 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A44940.s @@ -79,7 +79,7 @@ glabel func_80A44940 /* 01D3C 80A44A6C A4EF0206 */ sh $t7, 0x0206($a3) ## 00000206 /* 01D40 80A44A70 AFA60018 */ sw $a2, 0x0018($sp) /* 01D44 80A44A74 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01D48 80A44A78 AFA5001C */ sw $a1, 0x001C($sp) /* 01D4C 80A44A7C 8FA5001C */ lw $a1, 0x001C($sp) /* 01D50 80A44A80 8FA60018 */ lw $a2, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s index 57b4497fe9..2855be1267 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s @@ -142,12 +142,12 @@ glabel EnGoma_Update /* 01D8C 80A4AC4C 2605030C */ addiu $a1, $s0, 0x030C ## $a1 = 0000030C /* 01D90 80A4AC50 55000017 */ bnel $t0, $zero, .L80A4ACB0 /* 01D94 80A4AC54 8FBF0024 */ lw $ra, 0x0024($sp) -/* 01D98 80A4AC58 0C0189B7 */ jal Collider_CylinderUpdate +/* 01D98 80A4AC58 0C0189B7 */ jal Collider_UpdateCylinder /* 01D9C 80A4AC5C AFA5002C */ sw $a1, 0x002C($sp) /* 01DA0 80A4AC60 26050358 */ addiu $a1, $s0, 0x0358 ## $a1 = 00000358 /* 01DA4 80A4AC64 AFA50028 */ sw $a1, 0x0028($sp) -/* 01DA8 80A4AC68 0C0189B7 */ jal Collider_CylinderUpdate +/* 01DA8 80A4AC68 0C0189B7 */ jal Collider_UpdateCylinder /* 01DAC 80A4AC6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01DB0 80A4AC70 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -156,7 +156,7 @@ glabel EnGoma_Update /* 01DBC 80A4AC7C AFA50030 */ sw $a1, 0x0030($sp) /* 01DC0 80A4AC80 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01DC4 80A4AC84 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01DC8 80A4AC88 8FA6002C */ lw $a2, 0x002C($sp) /* 01DCC 80A4AC8C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01DD0 80A4AC90 8FA50030 */ lw $a1, 0x0030($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s index aa98e7d094..76e414e2ac 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A6AC.s @@ -99,7 +99,7 @@ glabel func_80A4A6AC /* 01948 80A4A808 1000002D */ beq $zero, $zero, .L80A4A8C0 /* 0194C 80A4A80C A60B02C2 */ sh $t3, 0x02C2($s0) ## 000002C2 .L80A4A810: -/* 01950 80A4A810 0C018D74 */ jal func_800635D0 +/* 01950 80A4A810 0C018D74 */ jal CollisionCheck_GetSwordDamage /* 01954 80A4A814 AFA6003C */ sw $a2, 0x003C($sp) /* 01958 80A4A818 8FA6003C */ lw $a2, 0x003C($sp) /* 0195C 80A4A81C 10400009 */ beq $v0, $zero, .L80A4A844 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s index a06cd3f8b7..b2143ce482 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s @@ -265,7 +265,7 @@ glabel EnHorse_Init /* 01148 80A5C438 3C0680A6 */ lui $a2, %hi(D_80A65F38) ## $a2 = 80A60000 /* 0114C 80A5C43C 24C65F38 */ addiu $a2, $a2, %lo(D_80A65F38) ## $a2 = 80A65F38 /* 01150 80A5C440 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 01154 80A5C444 0C0187B5 */ jal func_80061ED4 +/* 01154 80A5C444 0C0187B5 */ jal CollisionCheck_SetInfo /* 01158 80A5C448 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 0115C 80A5C44C 8FA8003C */ lw $t0, 0x003C($sp) /* 01160 80A5C450 3C01428C */ lui $at, 0x428C ## $at = 428C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s index 9becf35c10..a8210cfb2d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Update.s @@ -207,12 +207,12 @@ glabel EnHorse_Update .L80A64998: /* 096A8 80A64998 26050278 */ addiu $a1, $s0, 0x0278 ## $a1 = 00000278 /* 096AC 80A6499C AFA50030 */ sw $a1, 0x0030($sp) -/* 096B0 80A649A0 0C0189B7 */ jal Collider_CylinderUpdate +/* 096B0 80A649A0 0C0189B7 */ jal Collider_UpdateCylinder /* 096B4 80A649A4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 096B8 80A649A8 260502C4 */ addiu $a1, $s0, 0x02C4 ## $a1 = 000002C4 /* 096BC 80A649AC AFA50034 */ sw $a1, 0x0034($sp) -/* 096C0 80A649B0 0C0189B7 */ jal Collider_CylinderUpdate +/* 096C0 80A649B0 0C0189B7 */ jal Collider_UpdateCylinder /* 096C4 80A649B4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 096C8 80A649B8 0C01DE1C */ jal Math_SinS @@ -274,12 +274,12 @@ glabel EnHorse_Update /* 09794 80A64A84 8FA40074 */ lw $a0, 0x0074($sp) /* 09798 80A64A88 8FA50038 */ lw $a1, 0x0038($sp) /* 0979C 80A64A8C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 097A0 80A64A90 8FA60030 */ lw $a2, 0x0030($sp) /* 097A4 80A64A94 8FA40074 */ lw $a0, 0x0074($sp) /* 097A8 80A64A98 8FA50038 */ lw $a1, 0x0038($sp) /* 097AC 80A64A9C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 097B0 80A64AA0 8FA60034 */ lw $a2, 0x0034($sp) /* 097B4 80A64AA4 8FA3004C */ lw $v1, 0x004C($sp) /* 097B8 80A64AA8 8C6F067C */ lw $t7, 0x067C($v1) ## 0000067C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s index 312b1357d2..e8976d3e87 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A65108.s @@ -756,7 +756,7 @@ glabel func_80A65108 /* 0A8DC 80A65BCC 00812821 */ addu $a1, $a0, $at /* 0A8E0 80A65BD0 AFA50024 */ sw $a1, 0x0024($sp) /* 0A8E4 80A65BD4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0A8E8 80A65BD8 AFA60020 */ sw $a2, 0x0020($sp) /* 0A8EC 80A65BDC 8FA50024 */ lw $a1, 0x0024($sp) /* 0A8F0 80A65BE0 8FA60020 */ lw $a2, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s index 3739f19aaf..717f60ac46 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70734.s @@ -58,7 +58,7 @@ glabel func_80A70734 /* 01264 80A70814 A48E01E6 */ sh $t6, 0x01E6($a0) ## 000001E6 /* 01268 80A70818 8FA40024 */ lw $a0, 0x0024($sp) /* 0126C 80A7081C 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01270 80A70820 00812821 */ addu $a1, $a0, $at /* 01274 80A70824 8FBF0014 */ lw $ra, 0x0014($sp) /* 01278 80A70828 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s index dadfe13905..966ef43de5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s @@ -109,7 +109,7 @@ glabel func_80A70E34 /* 019C0 80A70F70 3C0680A7 */ lui $a2, %hi(D_80A71EEC) ## $a2 = 80A70000 /* 019C4 80A70F74 24C61EEC */ addiu $a2, $a2, %lo(D_80A71EEC) ## $a2 = 80A71EEC /* 019C8 80A70F78 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 019CC 80A70F7C 0C0187BF */ jal func_80061EFC +/* 019CC 80A70F7C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 019D0 80A70F80 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 019D4 80A70F84 860D001C */ lh $t5, 0x001C($s0) ## 0000001C /* 019D8 80A70F88 3C0680A7 */ lui $a2, %hi(D_80A722E3) ## $a2 = 80A70000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s b/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s index cf4317833b..f8a69671ce 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87C30.s @@ -43,7 +43,7 @@ glabel func_80A87C30 /* 004C8 80A87CC8 02212821 */ addu $a1, $s1, $at /* 004CC 80A87CCC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 004D0 80A87CD0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 004D4 80A87CD4 260602B0 */ addiu $a2, $s0, 0x02B0 ## $a2 = 000002B0 /* 004D8 80A87CD8 8FBF001C */ lw $ra, 0x001C($sp) /* 004DC 80A87CDC 8FB00014 */ lw $s0, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s index 7e8b4b6e44..4716c3a5c3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s @@ -82,7 +82,7 @@ glabel EnKo_Update /* 02A74 80A99824 26060198 */ addiu $a2, $s0, 0x0198 ## $a2 = 00000198 /* 02A78 80A99828 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000198 /* 02A7C 80A9982C AFA60028 */ sw $a2, 0x0028($sp) -/* 02A80 80A99830 0C0189B7 */ jal Collider_CylinderUpdate +/* 02A80 80A99830 0C0189B7 */ jal Collider_UpdateCylinder /* 02A84 80A99834 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 02A88 80A99838 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -90,7 +90,7 @@ glabel EnKo_Update /* 02A90 80A99840 8FA60028 */ lw $a2, 0x0028($sp) /* 02A94 80A99844 02212821 */ addu $a1, $s1, $at /* 02A98 80A99848 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02A9C 80A9984C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02AA0 80A99850 8FBF0024 */ lw $ra, 0x0024($sp) /* 02AA4 80A99854 8FB0001C */ lw $s0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s b/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s index c506d6978c..ab257c10b5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s @@ -93,7 +93,7 @@ glabel func_80A99048 /* 023E0 80A99190 3C0680AA */ lui $a2, %hi(D_80A9A12C) ## $a2 = 80AA0000 /* 023E4 80A99194 24C6A12C */ addiu $a2, $a2, %lo(D_80A9A12C) ## $a2 = 80A9A12C /* 023E8 80A99198 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 023EC 80A9919C 0C0187BF */ jal func_80061EFC +/* 023EC 80A9919C 0C0187BF */ jal CollisionCheck_SetInfo2 /* 023F0 80A991A0 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 023F4 80A991A4 860F001C */ lh $t7, 0x001C($s0) ## 0000001C /* 023F8 80A991A8 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 diff --git a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s index 7d8462841d..70a775c5d4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9F9B4.s @@ -56,7 +56,7 @@ glabel func_80A9F9B4 /* 00A78 80A9FA58 44089000 */ mfc1 $t0, $f18 /* 00A7C 80A9FA5C 00000000 */ nop /* 00A80 80A9FA60 A608018C */ sh $t0, 0x018C($s0) ## 0000018C -/* 00A84 80A9FA64 0C0189B7 */ jal Collider_CylinderUpdate +/* 00A84 80A9FA64 0C0189B7 */ jal Collider_UpdateCylinder /* 00A88 80A9FA68 AFA60028 */ sw $a2, 0x0028($sp) /* 00A8C 80A9FA6C 8FA40034 */ lw $a0, 0x0034($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s index 54b7bd7ecd..0f82559e65 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s @@ -11,7 +11,7 @@ glabel EnMk_Update /* 009E0 80AAD2E0 AFA50054 */ sw $a1, 0x0054($sp) /* 009E4 80AAD2E4 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 009E8 80AAD2E8 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 009EC 80AAD2EC 0C0189B7 */ jal Collider_CylinderUpdate +/* 009EC 80AAD2EC 0C0189B7 */ jal Collider_UpdateCylinder /* 009F0 80AAD2F0 AFA60034 */ sw $a2, 0x0034($sp) /* 009F4 80AAD2F4 8FA40054 */ lw $a0, 0x0054($sp) @@ -19,7 +19,7 @@ glabel EnMk_Update /* 009FC 80AAD2FC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00A00 80AAD300 8FA60034 */ lw $a2, 0x0034($sp) /* 00A04 80AAD304 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00A08 80AAD308 00812821 */ addu $a1, $a0, $at /* 00A0C 80AAD30C 0C00B638 */ jal Actor_MoveForward diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s index d867800cab..6f5c0b422e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s @@ -44,7 +44,7 @@ glabel EnMm_Init /* 001B8 80AAD928 3C0680AB */ lui $a2, %hi(D_80AAEB0C) ## $a2 = 80AB0000 /* 001BC 80AAD92C 24C6EB0C */ addiu $a2, $a2, %lo(D_80AAEB0C) ## $a2 = 80AAEB0C /* 001C0 80AAD930 24A5EB18 */ addiu $a1, $a1, %lo(D_80AAEB18) ## $a1 = 80AAEB18 -/* 001C4 80AAD934 0C0187BF */ jal func_80061EFC +/* 001C4 80AAD934 0C0187BF */ jal CollisionCheck_SetInfo2 /* 001C8 80AAD938 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 001CC 80AAD93C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 001D0 80AAD940 24190004 */ addiu $t9, $zero, 0x0004 ## $t9 = 00000004 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s index fb3ca3921e..1146a9b6dc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Update.s @@ -13,7 +13,7 @@ glabel EnMm_Update /* 00EFC 80AAE66C 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 00F00 80AAE670 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00F04 80AAE674 AFA60024 */ sw $a2, 0x0024($sp) -/* 00F08 80AAE678 0C0189B7 */ jal Collider_CylinderUpdate +/* 00F08 80AAE678 0C0189B7 */ jal Collider_UpdateCylinder /* 00F0C 80AAE67C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00F10 80AAE680 8FA40034 */ lw $a0, 0x0034($sp) @@ -21,7 +21,7 @@ glabel EnMm_Update /* 00F18 80AAE688 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00F1C 80AAE68C 8FA60024 */ lw $a2, 0x0024($sp) /* 00F20 80AAE690 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F24 80AAE694 00812821 */ addu $a1, $a0, $at /* 00F28 80AAE698 8FBF001C */ lw $ra, 0x001C($sp) /* 00F2C 80AAE69C 8FB00018 */ lw $s0, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s index a49422a2c9..756245f985 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s @@ -63,7 +63,7 @@ glabel EnMm2_Update /* 00A1C 80AAF86C 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 00A20 80AAF870 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 00A24 80AAF874 AFA60034 */ sw $a2, 0x0034($sp) -/* 00A28 80AAF878 0C0189B7 */ jal Collider_CylinderUpdate +/* 00A28 80AAF878 0C0189B7 */ jal Collider_UpdateCylinder /* 00A2C 80AAF87C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00A30 80AAF880 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -71,7 +71,7 @@ glabel EnMm2_Update /* 00A38 80AAF888 8FA60034 */ lw $a2, 0x0034($sp) /* 00A3C 80AAF88C 02212821 */ addu $a1, $s1, $at /* 00A40 80AAF890 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00A44 80AAF894 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00A48 80AAF898 0C00B638 */ jal Actor_MoveForward diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s index 1a2893b20e..9dcabfd189 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s @@ -36,7 +36,7 @@ glabel EnMu_Init /* 00288 80AB06A8 3C0680AB */ lui $a2, %hi(D_80AB0BFC) ## $a2 = 80AB0000 /* 0028C 80AB06AC 24C60BFC */ addiu $a2, $a2, %lo(D_80AB0BFC) ## $a2 = 80AB0BFC /* 00290 80AB06B0 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 00294 80AB06B4 0C0187BF */ jal func_80061EFC +/* 00294 80AB06B4 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00298 80AB06B8 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 0029C 80AB06BC 240E0006 */ addiu $t6, $zero, 0x0006 ## $t6 = 00000006 /* 002A0 80AB06C0 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s index 535b3cb6d2..6f9879194b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s @@ -30,7 +30,7 @@ glabel EnMu_Update /* 003AC 80AB07CC A48C01DE */ sh $t4, 0x01DE($a0) ## 000001DE /* 003B0 80AB07D0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 003B4 80AB07D4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 003B8 80AB07D8 00A12821 */ addu $a1, $a1, $at /* 003BC 80AB07DC 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s index fc10e076b5..b5bd3ddbc7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Draw.s @@ -31,7 +31,7 @@ glabel EnNy_Draw /* 011A0 80ABDD50 0C031AB1 */ jal Graph_OpenDisps /* 011A4 80ABDD54 00A08025 */ or $s0, $a1, $zero ## $s0 = 00000000 /* 011A8 80ABDD58 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 011AC 80ABDD5C 0C018A29 */ jal func_800628A4 +/* 011AC 80ABDD5C 0C018A29 */ jal Collider_UpdateSpheres /* 011B0 80ABDD60 26250150 */ addiu $a1, $s1, 0x0150 ## $a1 = 00000150 /* 011B4 80ABDD64 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 011B8 80ABDD68 8FA50094 */ lw $a1, 0x0094($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s index 0bac67c740..312d9831bc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s @@ -170,7 +170,7 @@ glabel EnNy_Update /* 00B44 80ABD6F4 02002025 */ or $a0, $s0, $zero ## $a0 = 0000000C /* 00B48 80ABD6F8 02202825 */ or $a1, $s1, $zero ## $a1 = 00000001 /* 00B4C 80ABD6FC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00B50 80ABD700 02603025 */ or $a2, $s3, $zero ## $a2 = 00000150 .L80ABD704: /* 00B54 80ABD704 8FBF003C */ lw $ra, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s index fa1527b7de..02c00b75b4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s @@ -64,7 +64,7 @@ glabel func_80ABDBF8 /* 01134 80ABDCE4 8FA50030 */ lw $a1, 0x0030($sp) /* 01138 80ABDCE8 8FA6002C */ lw $a2, 0x002C($sp) /* 0113C 80ABDCEC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01140 80ABDCF0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01144 80ABDCF4 0C00B638 */ jal Actor_MoveForward diff --git a/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s index 218d92d2a4..2fd7ce5413 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s @@ -25,15 +25,15 @@ glabel EnOwl_Update /* 02790 80ACC6B0 AFA50044 */ sw $a1, 0x0044($sp) /* 02794 80ACC6B4 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 02798 80ACC6B8 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 0279C 80ACC6BC 0C0189B7 */ jal Collider_CylinderUpdate - -/* 027A0 80ACC6C0 AFA6002C */ sw $a2, 0x002C($sp) -/* 027A4 80ACC6C4 8FA40044 */ lw $a0, 0x0044($sp) +/* 0279C 80ACC6BC 0C0189B7 */ jal Collider_UpdateCylinder + +/* 027A0 80ACC6C0 AFA6002C */ sw $a2, 0x002C($sp) +/* 027A4 80ACC6C4 8FA40044 */ lw $a0, 0x0044($sp) /* 027A8 80ACC6C8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 027AC 80ACC6CC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 027B0 80ACC6D0 8FA6002C */ lw $a2, 0x002C($sp) /* 027B4 80ACC6D4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 027B8 80ACC6D8 00812821 */ addu $a1, $a0, $at /* 027BC 80ACC6DC 3C014120 */ lui $at, 0x4120 ## $at = 41200000 /* 027C0 80ACC6E0 44810000 */ mtc1 $at, $f0 ## $f0 = 10.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s index 84ef7eae57..95d123955c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Draw.s @@ -54,7 +54,7 @@ glabel EnPeehat_Draw /* 03250 80AD26F0 260403AC */ addiu $a0, $s0, 0x03AC ## $a0 = 000003AC /* 03254 80AD26F4 8FA50038 */ lw $a1, 0x0038($sp) /* 03258 80AD26F8 8FA60034 */ lw $a2, 0x0034($sp) -/* 0325C 80AD26FC 0C0189CD */ jal func_80062734 +/* 0325C 80AD26FC 0C0189CD */ jal Collider_SetQuadVertices /* 03260 80AD2700 AFB80010 */ sw $t8, 0x0010($sp) /* 03264 80AD2704 8FBF0024 */ lw $ra, 0x0024($sp) .L80AD2708: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s index 4442b0742a..a0138112cc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s @@ -132,7 +132,7 @@ glabel EnPeehat_Update /* 02AEC 80AD1F8C 26720300 */ addiu $s2, $s3, 0x0300 ## $s2 = 00000300 .L80AD1F90: /* 02AF0 80AD1F90 02402825 */ or $a1, $s2, $zero ## $a1 = 00000300 -/* 02AF4 80AD1F94 0C0189B7 */ jal Collider_CylinderUpdate +/* 02AF4 80AD1F94 0C0189B7 */ jal Collider_UpdateCylinder /* 02AF8 80AD1F98 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 02AFC 80AD1F9C 926A00AF */ lbu $t2, 0x00AF($s3) ## 000000AF @@ -146,13 +146,13 @@ glabel EnPeehat_Update /* 02B1C 80AD1FBC 02818021 */ addu $s0, $s4, $at /* 02B20 80AD1FC0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02B24 80AD1FC4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02B28 80AD1FC8 02403025 */ or $a2, $s2, $zero ## $a2 = 00000300 /* 02B2C 80AD1FCC 2671034C */ addiu $s1, $s3, 0x034C ## $s1 = 0000034C /* 02B30 80AD1FD0 02203025 */ or $a2, $s1, $zero ## $a2 = 0000034C /* 02B34 80AD1FD4 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 02B38 80AD1FD8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02B3C 80AD1FDC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02B40 80AD1FE0 926C0114 */ lbu $t4, 0x0114($s3) ## 00000114 /* 02B44 80AD1FE4 51800006 */ beql $t4, $zero, .L80AD2000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s index 70b39ae24d..fe4db347e3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80AD2438.s @@ -71,7 +71,7 @@ glabel func_80AD2438 /* 03040 80AD24E0 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 /* 03044 80AD24E4 8FA50050 */ lw $a1, 0x0050($sp) /* 03048 80AD24E8 00002025 */ or $a0, $zero, $zero ## $a0 = 00000000 -/* 0304C 80AD24EC 0C018A29 */ jal func_800628A4 +/* 0304C 80AD24EC 0C018A29 */ jal Collider_UpdateSpheres /* 03050 80AD24F0 24A5034C */ addiu $a1, $a1, 0x034C ## $a1 = 0000034C /* 03054 80AD24F4 3C0143FA */ lui $at, 0x43FA ## $at = 43FA0000 /* 03058 80AD24F8 44816000 */ mtc1 $at, $f12 ## $f12 = 500.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s index db556ec351..a23cbfd469 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s @@ -50,7 +50,7 @@ glabel EnSa_Init /* 00CDC 80AF623C 3C0680AF */ lui $a2, %hi(D_80AF728C) ## $a2 = 80AF0000 /* 00CE0 80AF6240 24C6728C */ addiu $a2, $a2, %lo(D_80AF728C) ## $a2 = 80AF728C /* 00CE4 80AF6244 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 00CE8 80AF6248 0C0187BF */ jal func_80061EFC +/* 00CE8 80AF6248 0C0187BF */ jal CollisionCheck_SetInfo2 /* 00CEC 80AF624C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 00CF0 80AF6250 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00CF4 80AF6254 0C2BD77F */ jal func_80AF5DFC diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s index b8e3e9dff6..1cc9097976 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s @@ -7,7 +7,7 @@ glabel EnSa_Update /* 01694 80AF6BF4 AFBF0024 */ sw $ra, 0x0024($sp) /* 01698 80AF6BF8 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 0169C 80AF6BFC 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 -/* 016A0 80AF6C00 0C0189B7 */ jal Collider_CylinderUpdate +/* 016A0 80AF6C00 0C0189B7 */ jal Collider_UpdateCylinder /* 016A4 80AF6C04 AFA6002C */ sw $a2, 0x002C($sp) /* 016A8 80AF6C08 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -15,7 +15,7 @@ glabel EnSa_Update /* 016B0 80AF6C10 8FA6002C */ lw $a2, 0x002C($sp) /* 016B4 80AF6C14 02212821 */ addu $a1, $s1, $at /* 016B8 80AF6C18 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 016BC 80AF6C1C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 016C0 80AF6C20 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s index b67f771438..4df5bdfb7e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s @@ -76,7 +76,7 @@ glabel EnSkb_Update /* 01370 80AFDD10 8FA60028 */ lw $a2, 0x0028($sp) .L80AFDD14: /* 01374 80AFDD14 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01378 80AFDD18 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0137C 80AFDD1C 8FBF0024 */ lw $ra, 0x0024($sp) /* 01380 80AFDD20 8FB0001C */ lw $s0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s index 38dcd8165b..b46bcd2227 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFDF24.s @@ -7,7 +7,7 @@ glabel func_80AFDF24 /* 01598 80AFDF38 AFBF0024 */ sw $ra, 0x0024($sp) /* 0159C 80AFDF3C AFA60030 */ sw $a2, 0x0030($sp) /* 015A0 80AFDF40 AFA70034 */ sw $a3, 0x0034($sp) -/* 015A4 80AFDF44 0C018A29 */ jal func_800628A4 +/* 015A4 80AFDF44 0C018A29 */ jal Collider_UpdateSpheres /* 015A8 80AFDF48 24A502A4 */ addiu $a1, $a1, 0x02A4 ## $a1 = 000002A4 /* 015AC 80AFDF4C 8FA30038 */ lw $v1, 0x0038($sp) /* 015B0 80AFDF50 8FA5002C */ lw $a1, 0x002C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s index 0bd9ea7273..4e45bbbec4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s @@ -192,7 +192,7 @@ glabel EnSkj_Init /* 004B8 80AFE768 8FA50034 */ lw $a1, 0x0034($sp) /* 004BC 80AFE76C 24E71678 */ addiu $a3, $a3, %lo(D_80B01678) ## $a3 = 80B01678 /* 004C0 80AFE770 8FA40054 */ lw $a0, 0x0054($sp) -/* 004C4 80AFE774 0C017114 */ jal Collider_SetCylinder_Set3 +/* 004C4 80AFE774 0C017114 */ jal Collider_SetCylinderType1 /* 004C8 80AFE778 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 004CC 80AFE77C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) /* 004D0 80AFE780 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s index b2ee62f545..53f42ef5da 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s @@ -81,7 +81,7 @@ glabel EnSkj_Update /* 025EC 80B0089C A60D010E */ sh $t5, 0x010E($s0) ## 0000010E /* 025F0 80B008A0 26050278 */ addiu $a1, $s0, 0x0278 ## $a1 = 00000278 /* 025F4 80B008A4 AFA5002C */ sw $a1, 0x002C($sp) -/* 025F8 80B008A8 0C0189B7 */ jal Collider_CylinderUpdate +/* 025F8 80B008A8 0C0189B7 */ jal Collider_UpdateCylinder /* 025FC 80B008AC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 02600 80B008B0 920E02D3 */ lbu $t6, 0x02D3($s0) ## 000002D3 @@ -113,7 +113,7 @@ glabel EnSkj_Update /* 02658 80B00908 02212821 */ addu $a1, $s1, $at /* 0265C 80B0090C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02660 80B00910 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02664 80B00914 8FA6002C */ lw $a2, 0x002C($sp) /* 02668 80B00918 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s index e320f656ad..1eba587af6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s @@ -6,7 +6,7 @@ glabel func_80B07EE0 /* 009B0 80B07EF0 AFA5003C */ sw $a1, 0x003C($sp) /* 009B4 80B07EF4 2606014C */ addiu $a2, $s0, 0x014C ## $a2 = 0000014C /* 009B8 80B07EF8 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000014C -/* 009BC 80B07EFC 0C0189B7 */ jal Collider_CylinderUpdate +/* 009BC 80B07EFC 0C0189B7 */ jal Collider_UpdateCylinder /* 009C0 80B07F00 AFA60028 */ sw $a2, 0x0028($sp) /* 009C4 80B07F04 8FA4003C */ lw $a0, 0x003C($sp) @@ -14,7 +14,7 @@ glabel func_80B07EE0 /* 009CC 80B07F0C 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 009D0 80B07F10 8FA60028 */ lw $a2, 0x0028($sp) /* 009D4 80B07F14 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 009D8 80B07F18 00812821 */ addu $a1, $a0, $at /* 009DC 80B07F1C 0C00B638 */ jal Actor_MoveForward diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s index 6e20290762..c6c91b1459 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s @@ -115,7 +115,7 @@ glabel EnSw_Init /* 008E4 80B0C694 3C0680B1 */ lui $a2, %hi(D_80B0F074) ## $a2 = 80B10000 /* 008E8 80B0C698 24C6F074 */ addiu $a2, $a2, %lo(D_80B0F074) ## $a2 = 80B0F074 /* 008EC 80B0C69C 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 008F0 80B0C6A0 0C0187BF */ jal func_80061EFC +/* 008F0 80B0C6A0 0C0187BF */ jal CollisionCheck_SetInfo2 /* 008F4 80B0C6A4 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 008F8 80B0C6A8 860A001C */ lh $t2, 0x001C($s0) ## 0000001C /* 008FC 80B0C6AC 3C0180B1 */ lui $at, %hi(D_80B0F208) ## $at = 80B10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s index c91fd2d918..1008377d3c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0CBE8.s @@ -71,7 +71,7 @@ glabel func_80B0CBE8 /* 00F28 80B0CCD8 8FA60018 */ lw $a2, 0x0018($sp) .L80B0CCDC: /* 00F2C 80B0CCDC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00F30 80B0CCE0 8FA4002C */ lw $a0, 0x002C($sp) .L80B0CCE4: /* 00F34 80B0CCE4 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s index 8d1d8dbc56..926c8b74c4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0EAC4.s @@ -223,7 +223,7 @@ glabel L80B0ECB8 /* 02FB0 80B0ED60 016E7825 */ or $t7, $t3, $t6 ## $t7 = FB000000 /* 02FB4 80B0ED64 AC6F0004 */ sw $t7, 0x0004($v1) ## 00000004 .L80B0ED68: -/* 02FB8 80B0ED68 0C018A29 */ jal func_800628A4 +/* 02FB8 80B0ED68 0C018A29 */ jal Collider_UpdateSpheres /* 02FBC 80B0ED6C 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 /* 02FC0 80B0ED70 8FB80088 */ lw $t8, 0x0088($sp) /* 02FC4 80B0ED74 3C0680B1 */ lui $a2, %hi(D_80B0F1B0) ## $a2 = 80B10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s index 974d825c87..67f77d42d6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s @@ -207,7 +207,7 @@ glabel L808638F4 /* 04300 80863950 26050810 */ addiu $a1, $s0, 0x0810 ## $a1 = 00000810 .L80863954: /* 04304 80863954 AFA50034 */ sw $a1, 0x0034($sp) -/* 04308 80863958 0C0189B7 */ jal Collider_CylinderUpdate +/* 04308 80863958 0C0189B7 */ jal Collider_UpdateCylinder /* 0430C 8086395C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 04310 80863960 8E080028 */ lw $t0, 0x0028($s0) ## 00000028 @@ -232,7 +232,7 @@ glabel L808638F4 /* 04358 808639A8 00812821 */ addu $a1, $a0, $at /* 0435C 808639AC AFA50038 */ sw $a1, 0x0038($sp) /* 04360 808639B0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 04364 808639B4 8FA60034 */ lw $a2, 0x0034($sp) /* 04368 808639B8 920C07C8 */ lbu $t4, 0x07C8($s0) ## 000007C8 /* 0436C 808639BC 2981000A */ slti $at, $t4, 0x000A diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s index a706e40551..88fb41b2d6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s @@ -103,7 +103,7 @@ glabel func_80863CC4 /* 04730 80863D80 2604085C */ addiu $a0, $s0, 0x085C ## $a0 = 0000085C /* 04734 80863D84 8FA50048 */ lw $a1, 0x0048($sp) /* 04738 80863D88 8FA60044 */ lw $a2, 0x0044($sp) -/* 0473C 80863D8C 0C0189CD */ jal func_80062734 +/* 0473C 80863D8C 0C0189CD */ jal Collider_SetQuadVertices /* 04740 80863D90 AFA90010 */ sw $t1, 0x0010($sp) /* 04744 80863D94 3C048086 */ lui $a0, %hi(D_80864664) ## $a0 = 80860000 /* 04748 80863D98 24844664 */ addiu $a0, $a0, %lo(D_80864664) ## $a0 = 80864664 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s index 12dfb646d9..50e7b9365a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s @@ -36,7 +36,7 @@ glabel EnTg_Init /* 001CC 80B1852C 3C0680B2 */ lui $a2, %hi(D_80B1893C) ## $a2 = 80B20000 /* 001D0 80B18530 24C6893C */ addiu $a2, $a2, %lo(D_80B1893C) ## $a2 = 80B1893C /* 001D4 80B18534 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 001D8 80B18538 0C0187BF */ jal func_80061EFC +/* 001D8 80B18538 0C0187BF */ jal CollisionCheck_SetInfo2 /* 001DC 80B1853C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 001E0 80B18540 240E0006 */ addiu $t6, $zero, 0x0006 ## $t6 = 00000006 /* 001E4 80B18544 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s index f1df79430f..9fcad23c5e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s @@ -31,7 +31,7 @@ glabel EnTg_Update /* 002F8 80B18658 A48F01DE */ sh $t7, 0x01DE($a0) ## 000001DE /* 002FC 80B1865C 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 00300 80B18660 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00304 80B18664 00A12821 */ addu $a1, $a1, $at /* 00308 80B18668 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s index cdbbbab471..12dab7068a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s @@ -1684,10 +1684,10 @@ glabel EnTorch2_Update /* 01C48 80B1F5C8 0C028EF0 */ jal LinkAnimation_Update /* 01C4C 80B1F5CC 8FA40084 */ lw $a0, 0x0084($sp) /* 01C50 80B1F5D0 8FA40084 */ lw $a0, 0x0084($sp) -/* 01C54 80B1F5D4 0C017458 */ jal Collider_QuadSetAT +/* 01C54 80B1F5D4 0C017458 */ jal Collider_ResetQuadAT /* 01C58 80B1F5D8 8FA50030 */ lw $a1, 0x0030($sp) /* 01C5C 80B1F5DC 8FA40084 */ lw $a0, 0x0084($sp) -/* 01C60 80B1F5E0 0C017458 */ jal Collider_QuadSetAT +/* 01C60 80B1F5E0 0C017458 */ jal Collider_ResetQuadAT /* 01C64 80B1F5E4 8FA50038 */ lw $a1, 0x0038($sp) /* 01C68 80B1F5E8 3C0780B2 */ lui $a3, %hi(sStaggerTimer) ## $a3 = 80B20000 /* 01C6C 80B1F5EC 3C0680B2 */ lui $a2, %hi(sCounterState) ## $a2 = 80B20000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s index 9053c030e7..88304a4e1a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Draw.s @@ -189,7 +189,7 @@ glabel EnTp_Draw /* 01C64 80B22A44 54410004 */ bnel $v0, $at, .L80B22A58 /* 01C68 80B22A48 8FBF0014 */ lw $ra, 0x0014($sp) .L80B22A4C: -/* 01C6C 80B22A4C 0C018A29 */ jal func_800628A4 +/* 01C6C 80B22A4C 0C018A29 */ jal Collider_UpdateSpheres /* 01C70 80B22A50 24650174 */ addiu $a1, $v1, 0x0174 ## $a1 = 00000174 /* 01C74 80B22A54 8FBF0014 */ lw $ra, 0x0014($sp) .L80B22A58: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s index 976fa8ebae..0d7faa7089 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s @@ -956,7 +956,7 @@ glabel EnTrap_Update /* 01114 80B25774 260501A0 */ addiu $a1, $s0, 0x01A0 ## $a1 = 000001A0 .L80B25778: /* 01118 80B25778 AFA50048 */ sw $a1, 0x0048($sp) -/* 0111C 80B2577C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0111C 80B2577C 0C0189B7 */ jal Collider_UpdateCylinder /* 01120 80B25780 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01124 80B25784 8FA400AC */ lw $a0, 0x00AC($sp) @@ -965,7 +965,7 @@ glabel EnTrap_Update /* 01130 80B25790 00812821 */ addu $a1, $a0, $at /* 01134 80B25794 AFA5004C */ sw $a1, 0x004C($sp) /* 01138 80B25798 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0113C 80B2579C 8FA60048 */ lw $a2, 0x0048($sp) /* 01140 80B257A0 920D0114 */ lbu $t5, 0x0114($s0) ## 00000114 /* 01144 80B257A4 8FA5004C */ lw $a1, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s index ffa2221ddd..cd35e85269 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s @@ -68,7 +68,7 @@ glabel EnVali_Init /* 000F4 80B267A4 3C0680B3 */ lui $a2, %hi(D_80B2891C) ## $a2 = 80B30000 /* 000F8 80B267A8 24C6891C */ addiu $a2, $a2, %lo(D_80B2891C) ## $a2 = 80B2891C /* 000FC 80B267AC 24A58924 */ addiu $a1, $a1, %lo(D_80B28924) ## $a1 = 80B28924 -/* 00100 80B267B0 0C0187B5 */ jal func_80061ED4 +/* 00100 80B267B0 0C0187B5 */ jal CollisionCheck_SetInfo /* 00104 80B267B4 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 00108 80B267B8 0C2C9A1E */ jal func_80B26878 /* 0010C 80B267BC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s index 351384dec0..ea89c9f36d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s @@ -46,7 +46,7 @@ glabel EnVali_Update /* 014B4 80B27B64 11E20028 */ beq $t7, $v0, .L80B27C08 /* 014B8 80B27B68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 014BC 80B27B6C 260503FC */ addiu $a1, $s0, 0x03FC ## $a1 = 000003FC -/* 014C0 80B27B70 0C0189B7 */ jal Collider_CylinderUpdate +/* 014C0 80B27B70 0C0189B7 */ jal Collider_UpdateCylinder /* 014C4 80B27B74 AFA50020 */ sw $a1, 0x0020($sp) /* 014C8 80B27B78 8E080190 */ lw $t0, 0x0190($s0) ## 00000190 @@ -87,7 +87,7 @@ glabel EnVali_Update .L80B27BF0: /* 01540 80B27BF0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01544 80B27BF4 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 01548 80B27BF8 8FA60020 */ lw $a2, 0x0020($sp) /* 0154C 80B27BFC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01550 80B27C00 0C00B56E */ jal Actor_SetHeight diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s index 53e4cd06bd..05de902730 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/func_80B28280.s @@ -35,7 +35,7 @@ glabel func_80B28280 /* 01C50 80B28300 AFB80010 */ sw $t8, 0x0010($sp) /* 01C54 80B28304 260402FC */ addiu $a0, $s0, 0x02FC ## $a0 = 000002FC /* 01C58 80B28308 27A6003C */ addiu $a2, $sp, 0x003C ## $a2 = FFFFFFF4 -/* 01C5C 80B2830C 0C0189CD */ jal func_80062734 +/* 01C5C 80B2830C 0C0189CD */ jal Collider_SetQuadVertices /* 01C60 80B28310 2607033C */ addiu $a3, $s0, 0x033C ## $a3 = 0000033C /* 01C64 80B28314 10000007 */ beq $zero, $zero, .L80B28334 /* 01C68 80B28318 8FBF0024 */ lw $ra, 0x0024($sp) @@ -43,7 +43,7 @@ glabel func_80B28280 /* 01C6C 80B2831C 261903C8 */ addiu $t9, $s0, 0x03C8 ## $t9 = 000003C8 /* 01C70 80B28320 AFB90010 */ sw $t9, 0x0010($sp) /* 01C74 80B28324 27A6003C */ addiu $a2, $sp, 0x003C ## $a2 = FFFFFFF4 -/* 01C78 80B28328 0C0189CD */ jal func_80062734 +/* 01C78 80B28328 0C0189CD */ jal Collider_SetQuadVertices /* 01C7C 80B2832C 260703BC */ addiu $a3, $s0, 0x03BC ## $a3 = 000003BC .L80B28330: /* 01C80 80B28330 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s index 384f0a6156..48aff85e50 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s @@ -539,7 +539,7 @@ glabel EnVbBall_Update .L80B29D28: /* 00D88 80B29D28 26300168 */ addiu $s0, $s1, 0x0168 ## $s0 = 00000168 /* 00D8C 80B29D2C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000168 -/* 00D90 80B29D30 0C0189B7 */ jal Collider_CylinderUpdate +/* 00D90 80B29D30 0C0189B7 */ jal Collider_UpdateCylinder /* 00D94 80B29D34 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00D98 80B29D38 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s index bcc7b6a506..358b62ebd8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s @@ -45,7 +45,7 @@ glabel EnWeiyer_Init /* 00098 80B32328 3C0680B3 */ lui $a2, %hi(D_80B33ABC) ## $a2 = 80B30000 /* 0009C 80B3232C 24C63ABC */ addiu $a2, $a2, %lo(D_80B33ABC) ## $a2 = 80B33ABC /* 000A0 80B32330 24A53AC4 */ addiu $a1, $a1, %lo(D_80B33AC4) ## $a1 = 80B33AC4 -/* 000A4 80B32334 0C0187B5 */ jal func_80061ED4 +/* 000A4 80B32334 0C0187B5 */ jal CollisionCheck_SetInfo /* 000A8 80B32338 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 /* 000AC 80B3233C 3C1980B3 */ lui $t9, %hi(func_80B32804) ## $t9 = 80B30000 /* 000B0 80B32340 27392804 */ addiu $t9, $t9, %lo(func_80B32804) ## $t9 = 80B32804 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s index 6168e54ea7..e70bc20bdd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s @@ -67,7 +67,7 @@ glabel EnWeiyer_Update .L80B33854: /* 015C4 80B33854 26050284 */ addiu $a1, $s0, 0x0284 ## $a1 = 00000284 /* 015C8 80B33858 AFA50028 */ sw $a1, 0x0028($sp) -/* 015CC 80B3385C 0C0189B7 */ jal Collider_CylinderUpdate +/* 015CC 80B3385C 0C0189B7 */ jal Collider_UpdateCylinder /* 015D0 80B33860 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 015D4 80B33864 92190294 */ lbu $t9, 0x0294($s0) ## 00000294 @@ -96,7 +96,7 @@ glabel EnWeiyer_Update .L80B338B4: /* 01624 80B338B4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01628 80B338B8 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0162C 80B338BC 8FA60028 */ lw $a2, 0x0028($sp) /* 01630 80B338C0 8FBF0024 */ lw $ra, 0x0024($sp) /* 01634 80B338C4 8FB0001C */ lw $s0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s index ee5e2330d3..dbf3a07032 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s @@ -69,7 +69,7 @@ glabel EnWf_Update /* 03638 80B372E8 AFA60030 */ sw $a2, 0x0030($sp) /* 0363C 80B372EC AFA50034 */ sw $a1, 0x0034($sp) /* 03640 80B372F0 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 03644 80B372F4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 03648 80B372F8 8E0202D4 */ lw $v0, 0x02D4($s0) ## 000002D4 /* 0364C 80B372FC 28410006 */ slti $at, $v0, 0x0006 @@ -85,7 +85,7 @@ glabel EnWf_Update /* 03674 80B37324 5560000D */ bnel $t3, $zero, .L80B3735C /* 03678 80B37328 24010007 */ addiu $at, $zero, 0x0007 ## $at = 00000007 .L80B3732C: -/* 0367C 80B3732C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0367C 80B3732C 0C0189B7 */ jal Collider_UpdateCylinder /* 03680 80B37330 AFA5002C */ sw $a1, 0x002C($sp) /* 03684 80B37334 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s index d915c98057..4114b44f2a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37494.s @@ -47,7 +47,7 @@ glabel func_80B37494 /* 03800 80B374B0 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 03804 80B374B4 AFA70044 */ sw $a3, 0x0044($sp) /* 03808 80B374B8 AFA30030 */ sw $v1, 0x0030($sp) -/* 0380C 80B374BC 0C018A29 */ jal func_800628A4 +/* 0380C 80B374BC 0C018A29 */ jal Collider_UpdateSpheres /* 03810 80B374C0 24C50304 */ addiu $a1, $a2, 0x0304 ## $a1 = 00000304 /* 03814 80B374C4 8FAE003C */ lw $t6, 0x003C($sp) /* 03818 80B374C8 24010006 */ addiu $at, $zero, 0x0006 ## $at = 00000006 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s index ebb0ccba71..fd0b927448 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s @@ -13,7 +13,7 @@ glabel func_80B3C1E0 /* 00028 80B3C208 8FA50018 */ lw $a1, 0x0018($sp) /* 0002C 80B3C20C 8FA60020 */ lw $a2, 0x0020($sp) /* 00030 80B3C210 24E71D40 */ addiu $a3, $a3, %lo(D_80B41D40) ## $a3 = 80B41D40 -/* 00034 80B3C214 0C017114 */ jal Collider_SetCylinder_Set3 +/* 00034 80B3C214 0C017114 */ jal Collider_SetCylinderType1 /* 00038 80B3C218 8FA40024 */ lw $a0, 0x0024($sp) /* 0003C 80B3C21C 8FBF0014 */ lw $ra, 0x0014($sp) /* 00040 80B3C220 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s index 9b0a0bd60a..c2ffaefc87 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C22C.s @@ -4,7 +4,7 @@ glabel func_80B3C22C /* 00054 80B3C234 AFA50034 */ sw $a1, 0x0034($sp) /* 00058 80B3C238 248602C0 */ addiu $a2, $a0, 0x02C0 ## $a2 = 000002C0 /* 0005C 80B3C23C 00C02825 */ or $a1, $a2, $zero ## $a1 = 000002C0 -/* 00060 80B3C240 0C0189B7 */ jal Collider_CylinderUpdate +/* 00060 80B3C240 0C0189B7 */ jal Collider_UpdateCylinder /* 00064 80B3C244 AFA60018 */ sw $a2, 0x0018($sp) /* 00068 80B3C248 8FA40034 */ lw $a0, 0x0034($sp) @@ -12,7 +12,7 @@ glabel func_80B3C22C /* 00070 80B3C250 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 00074 80B3C254 8FA60018 */ lw $a2, 0x0018($sp) /* 00078 80B3C258 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0007C 80B3C25C 00812821 */ addu $a1, $a0, $at /* 00080 80B3C260 8FBF0014 */ lw $ra, 0x0014($sp) /* 00084 80B3C264 27BD0030 */ addiu $sp, $sp, 0x0030 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s index 6431f40997..0eafd0e3f1 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Update.s @@ -60,7 +60,7 @@ glabel EnYabusameMark_Update /* 0066C 80B4342C 460C8480 */ add.s $f18, $f16, $f12 /* 00670 80B43430 E612018C */ swc1 $f18, 0x018C($s0) ## 0000018C /* 00674 80B43434 AFA40050 */ sw $a0, 0x0050($sp) -/* 00678 80B43438 0C0189CD */ jal func_80062734 +/* 00678 80B43438 0C0189CD */ jal Collider_SetQuadVertices /* 0067C 80B4343C AFB80010 */ sw $t8, 0x0010($sp) /* 00680 80B43440 8FA40074 */ lw $a0, 0x0074($sp) /* 00684 80B43444 3C010001 */ lui $at, 0x0001 ## $at = 00010000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s index 447ca7f85a..29fc1caedd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s @@ -171,7 +171,7 @@ glabel EnZf_Update /* 05468 80B494B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0546C 80B494BC 15810024 */ bne $t4, $at, .L80B49550 /* 05470 80B494C0 26050418 */ addiu $a1, $s0, 0x0418 ## $a1 = 00000418 -/* 05474 80B494C4 0C0189B7 */ jal Collider_CylinderUpdate +/* 05474 80B494C4 0C0189B7 */ jal Collider_UpdateCylinder /* 05478 80B494C8 AFA50028 */ sw $a1, 0x0028($sp) /* 0547C 80B494CC C6060080 */ lwc1 $f6, 0x0080($s0) ## 00000080 @@ -188,7 +188,7 @@ glabel EnZf_Update /* 054A8 80B494F8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 /* 054AC 80B494FC 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 054B0 80B49500 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 054B4 80B49504 00812821 */ addu $a1, $a0, $at .L80B49508: /* 054B8 80B49508 8602001C */ lh $v0, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s index 78d3818b14..abf2455aed 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s @@ -81,7 +81,7 @@ glabel func_80B49688 /* 056C4 80B49714 26040464 */ addiu $a0, $s0, 0x0464 ## $a0 = 00000464 /* 056C8 80B49718 8FA50038 */ lw $a1, 0x0038($sp) /* 056CC 80B4971C 8FA60034 */ lw $a2, 0x0034($sp) -/* 056D0 80B49720 0C0189CD */ jal func_80062734 +/* 056D0 80B49720 0C0189CD */ jal Collider_SetQuadVertices /* 056D4 80B49724 AFAF0010 */ sw $t7, 0x0010($sp) /* 056D8 80B49728 3C0480B5 */ lui $a0, %hi(D_80B4A2A4) ## $a0 = 80B50000 /* 056DC 80B4972C 2484A2A4 */ addiu $a0, $a0, %lo(D_80B4A2A4) ## $a0 = 80B4A2A4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s index 7875223ca8..733fad59fd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s @@ -45,7 +45,7 @@ glabel EnZl4_Init /* 0069C 80B5BE4C 3C0680B6 */ lui $a2, %hi(D_80B5E7AC) ## $a2 = 80B60000 /* 006A0 80B5BE50 24C6E7AC */ addiu $a2, $a2, %lo(D_80B5E7AC) ## $a2 = 80B5E7AC /* 006A4 80B5BE54 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 006A8 80B5BE58 0C0187BF */ jal func_80061EFC +/* 006A8 80B5BE58 0C0187BF */ jal CollisionCheck_SetInfo2 /* 006AC 80B5BE5C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 006B0 80B5BE60 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 /* 006B4 80B5BE64 34A5D70A */ ori $a1, $a1, 0xD70A ## $a1 = 3C23D70A diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s index 57c2d8de6d..f7d1009e8d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s @@ -31,7 +31,7 @@ glabel EnZl4_Update /* 02B74 80B5E324 26060194 */ addiu $a2, $s0, 0x0194 ## $a2 = 00000194 /* 02B78 80B5E328 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000194 /* 02B7C 80B5E32C AFA6002C */ sw $a2, 0x002C($sp) -/* 02B80 80B5E330 0C0189B7 */ jal Collider_CylinderUpdate +/* 02B80 80B5E330 0C0189B7 */ jal Collider_UpdateCylinder /* 02B84 80B5E334 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 02B88 80B5E338 8FA4003C */ lw $a0, 0x003C($sp) @@ -39,7 +39,7 @@ glabel EnZl4_Update /* 02B90 80B5E340 34211E60 */ ori $at, $at, 0x1E60 ## $at = 00011E60 /* 02B94 80B5E344 8FA6002C */ lw $a2, 0x002C($sp) /* 02B98 80B5E348 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 02B9C 80B5E34C 00812821 */ addu $a1, $a0, $at /* 02BA0 80B5E350 8FBF0024 */ lw $ra, 0x0024($sp) /* 02BA4 80B5E354 8FB00020 */ lw $s0, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s index fa1d1d52ae..41bd205212 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B761B8.s @@ -186,7 +186,7 @@ glabel func_80B761B8 /* 0CA98 80B76438 8CC6E070 */ lw $a2, %lo(D_80B7E070)($a2) /* 0CA9C 80B7643C 02612821 */ addu $a1, $s3, $at /* 0CAA0 80B76440 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0CAA4 80B76444 24C60230 */ addiu $a2, $a2, 0x0230 ## $a2 = 80B80230 .L80B76448: /* 0CAA8 80B76448 8FBF003C */ lw $ra, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s index c1f30774df..105026d782 100644 --- a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s +++ b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86BC8.s @@ -50,7 +50,7 @@ glabel func_80B86BC8 /* 0034C 80B86C6C 10000009 */ beq $zero, $zero, .L80B86C94 /* 00350 80B86C70 E6100068 */ swc1 $f16, 0x0068($s0) ## 00000068 .L80B86C74: -/* 00354 80B86C74 0C0189B7 */ jal Collider_CylinderUpdate +/* 00354 80B86C74 0C0189B7 */ jal Collider_UpdateCylinder /* 00358 80B86C78 AFA6002C */ sw $a2, 0x002C($sp) /* 0035C 80B86C7C 8FA40034 */ lw $a0, 0x0034($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s index ab900484b2..c999e9807a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s @@ -31,7 +31,7 @@ glabel MagicFire_Init /* 00068 80B88DD8 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 0006C 80B88DDC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00070 80B88DE0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00070 80B88DE0 0C0189B7 */ jal Collider_UpdateCylinder /* 00074 80B88DE4 8FA50020 */ lw $a1, 0x0020($sp) /* 00078 80B88DE8 3C0E80B9 */ lui $t6, %hi(func_80B88E3C) ## $t6 = 80B90000 diff --git a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s index 9b88d9de8f..a3ae73fb3b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Update.s @@ -60,7 +60,7 @@ glabel MagicFire_Update .L80B88F78: /* 00208 80B88F78 AFA6002C */ sw $a2, 0x002C($sp) .L80B88F7C: -/* 0020C 80B88F7C 0C0189B7 */ jal Collider_CylinderUpdate +/* 0020C 80B88F7C 0C0189B7 */ jal Collider_UpdateCylinder /* 00210 80B88F80 AFA7004C */ sw $a3, 0x004C($sp) /* 00214 80B88F84 3C0180B9 */ lui $at, %hi(D_80B8AFFC) ## $at = 80B90000 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s index d146c87a66..fd64624af4 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s @@ -56,7 +56,7 @@ glabel ObjBean_Update /* 020E4 80B90B64 44093000 */ mfc1 $t1, $f6 /* 020E8 80B90B68 00000000 */ nop /* 020EC 80B90B6C A60901A8 */ sh $t1, 0x01A8($s0) ## 000001A8 -/* 020F0 80B90B70 0C0189B7 */ jal Collider_CylinderUpdate +/* 020F0 80B90B70 0C0189B7 */ jal Collider_UpdateCylinder /* 020F4 80B90B74 AFA60024 */ sw $a2, 0x0024($sp) /* 020F8 80B90B78 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -64,7 +64,7 @@ glabel ObjBean_Update /* 02100 80B90B80 8FA60024 */ lw $a2, 0x0024($sp) /* 02104 80B90B84 02212821 */ addu $a1, $s1, $at /* 02108 80B90B88 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 0210C 80B90B8C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02110 80B90B90 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B90B94: diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s index cae6a61ab4..fedf03f745 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s @@ -17,7 +17,7 @@ glabel func_80B8EA80 /* 00038 80B8EAB8 8FA50018 */ lw $a1, 0x0018($sp) /* 0003C 80B8EABC 8FA40020 */ lw $a0, 0x0020($sp) -/* 00040 80B8EAC0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00040 80B8EAC0 0C0189B7 */ jal Collider_UpdateCylinder /* 00044 80B8EAC4 8FA50018 */ lw $a1, 0x0018($sp) /* 00048 80B8EAC8 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s index d5c3835a55..6957a27ea3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/ObjTsubo_Init.s @@ -28,7 +28,7 @@ glabel ObjTsubo_Init /* 001BC 80BA0F1C 3C0680BA */ lui $a2, %hi(D_80BA1BC0) ## $a2 = 80BA0000 /* 001C0 80BA0F20 24C61BC0 */ addiu $a2, $a2, %lo(D_80BA1BC0) ## $a2 = 80BA1BC0 /* 001C4 80BA0F24 26040098 */ addiu $a0, $s0, 0x0098 ## $a0 = 00000098 -/* 001C8 80BA0F28 0C0187B5 */ jal func_80061ED4 +/* 001C8 80BA0F28 0C0187B5 */ jal CollisionCheck_SetInfo /* 001CC 80BA0F2C 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 001D0 80BA0F30 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 001D4 80BA0F34 0C2E837D */ jal func_80BA0DF4 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s index 11abceac74..bc3a61ac27 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0E98.s @@ -17,7 +17,7 @@ glabel func_80BA0E98 /* 00170 80BA0ED0 8FA50018 */ lw $a1, 0x0018($sp) /* 00174 80BA0ED4 8FA40020 */ lw $a0, 0x0020($sp) -/* 00178 80BA0ED8 0C0189B7 */ jal Collider_CylinderUpdate +/* 00178 80BA0ED8 0C0189B7 */ jal Collider_UpdateCylinder /* 0017C 80BA0EDC 8FA50018 */ lw $a1, 0x0018($sp) /* 00180 80BA0EE0 8FBF0014 */ lw $ra, 0x0014($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s index 586747c093..b606b3a715 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA15BC.s @@ -80,7 +80,7 @@ glabel func_80BA15BC /* 00978 80BA16D8 00000000 */ nop /* 0097C 80BA16DC 4502001A */ bc1fl .L80BA1748 /* 00980 80BA16E0 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 -/* 00984 80BA16E4 0C0189B7 */ jal Collider_CylinderUpdate +/* 00984 80BA16E4 0C0189B7 */ jal Collider_UpdateCylinder /* 00988 80BA16E8 AFA5002C */ sw $a1, 0x002C($sp) /* 0098C 80BA16EC 920B0161 */ lbu $t3, 0x0161($s0) ## 00000161 @@ -104,7 +104,7 @@ glabel func_80BA15BC /* 009D0 80BA1730 45020005 */ bc1fl .L80BA1748 /* 009D4 80BA1734 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 /* 009D8 80BA1738 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 009DC 80BA173C 8FA6002C */ lw $a2, 0x002C($sp) /* 009E0 80BA1740 C6000090 */ lwc1 $f0, 0x0090($s0) ## 00000090 /* 009E4 80BA1744 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s index ce14fe0335..8b26b36fc8 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s @@ -90,7 +90,7 @@ glabel func_80BA1958 /* 00D34 80BA1A94 E7A40010 */ swc1 $f4, 0x0010($sp) /* 00D38 80BA1A98 26050150 */ addiu $a1, $s0, 0x0150 ## $a1 = 00000150 /* 00D3C 80BA1A9C AFA5002C */ sw $a1, 0x002C($sp) -/* 00D40 80BA1AA0 0C0189B7 */ jal Collider_CylinderUpdate +/* 00D40 80BA1AA0 0C0189B7 */ jal Collider_UpdateCylinder /* 00D44 80BA1AA4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00D48 80BA1AA8 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -99,7 +99,7 @@ glabel func_80BA1958 /* 00D54 80BA1AB4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00D58 80BA1AB8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00D5C 80BA1ABC 0C017713 */ jal CollisionCheck_SetOC - ## CollisionCheck_setOT + ## CollisionCheck_setOC /* 00D60 80BA1AC0 8FA6002C */ lw $a2, 0x002C($sp) /* 00D64 80BA1AC4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00D68 80BA1AC8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 diff --git a/include/functions.h b/include/functions.h index f8c3ead76c..f449db303e 100644 --- a/include/functions.h +++ b/include/functions.h @@ -517,7 +517,7 @@ void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* ar void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1); u8 func_800355E4(GlobalContext* globalCtx, Collider* collider); u8 Actor_ApplyDamage(Actor* actor); -void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag); +void func_80035650(Actor* actor, ColliderInfo* colBody, s32 freezeFlag); void func_8003573C(Actor* actor, ColliderJntSph* colBody, s32 freezeFlag); void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3); void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); @@ -742,99 +742,59 @@ void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* d UNK_TYPE arg6); s16 func_8005B1A4(Camera* camera); DamageTable* DamageTable_Get(s32 index); -void func_8005B280(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); -void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); -s32 Collider_InitBase(GlobalContext* globalCtx, Collider* collider); -s32 Collider_DestroyBase(GlobalContext* globalCtx, Collider* collider); -s32 Collider_SetBase_Actor(GlobalContext* globalCtx, Collider* collider, ColliderInit_Actor* src); -s32 Collider_SetBase_Set3(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit_Set3* src); -s32 Collider_SetBase(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit* src); -void Collider_BaseSetAT(GlobalContext* globalCtx, Collider* collider); -void Collider_BaseSetAC(GlobalContext* globalCtx, Collider* collider); -void Collider_BaseSetOC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_InitTouch(GlobalContext* globalCtx, ColliderTouch* touch); -s32 Collider_DestroyTouch(GlobalContext* globalCtx, ColliderTouch* touch); -s32 Collider_SetTouch(GlobalContext* globalCtx, ColliderTouch* dest, ColliderTouch* src); -void Collider_BodySetAT_Unk(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_InitBump(GlobalContext* globalCtx, ColliderBump* bump); -s32 Collider_DestroyBump(GlobalContext* globalCtx, ColliderBump* bump); -s32 Collider_SetBump(GlobalContext* globalCtx, ColliderBump* bump, ColliderBumpInit* init); -s32 Collider_InitBody(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_DestroyBody(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_SetBody(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInit* bodyInit); -void Collider_BodySetAT(GlobalContext* globalCtx, ColliderBody* body); -void Collider_BodySetAC(GlobalContext* globalCtx, ColliderBody* body); -void Collider_BodySetOC(GlobalContext* globalCtx, ColliderBody* body); -s32 Collider_InitJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dim); -s32 Collider_DestroyJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* item); -s32 Collider_SetJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dest, ColliderJntSphItemDimInit* src); -s32 Collider_InitJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item); -s32 Collider_DestroyJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item); -s32 Collider_SetJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* dest, ColliderJntSphItemInit* src); -s32 Collider_JntSphItemSetAT(GlobalContext* globalCtx, ColliderJntSphItem* collider); -s32 Collider_JntSphItemSetAC(GlobalContext* globalCtx, ColliderJntSphItem* collider); -s32 Collider_JntSphItemSetOC(GlobalContext* globalCtx, ColliderJntSphItem* collider); +void DamageTable_Clear(DamageTable* table); +void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); +void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); s32 Collider_InitJntSph(GlobalContext* globalCtx, ColliderJntSph* collider); s32 Collider_FreeJntSph(GlobalContext* globalCtx, ColliderJntSph* collider); s32 Collider_DestroyJntSph(GlobalContext* globalCtx, ColliderJntSph* collider); -s32 Collider_SetJntSph_Set(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInit_Actor* src); -s32 Collider_SetJntSph_Set3(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit_Set3* src); -s32 Collider_SetJntSph_Set5(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src); +s32 Collider_SetJntSphToActor(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInitToActor* src); +s32 Collider_SetJntSphAllocType1(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, + ColliderJntSphInitType1* src); +s32 Collider_SetJntSphAlloc(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src); s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src, - ColliderJntSphItem* list); -s32 Collider_InitCylinderDim(GlobalContext* globalCtx, Cylinder16* dim); -s32 Collider_DestroyCylinderDim(GlobalContext* globalCtx, Cylinder16* dim); -s32 Collider_SetCylinderDim(GlobalContext* globalCtx, Cylinder16* dest, Cylinder16* src); + ColliderJntSphElement* elements); +s32 Collider_ResetJntSphAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetJntSphAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetJntSphOC(GlobalContext* globalCtx, Collider* collider); s32 Collider_InitCylinder(GlobalContext* globalCtx, ColliderCylinder* collider); s32 Collider_DestroyCylinder(GlobalContext* globalCtx, ColliderCylinder* collider); -s32 Collider_SetCylinder_Actor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInit_Actor* arg2); -s32 Collider_SetCylinder_Set3(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, - ColliderCylinderInit_Set3* src); +s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInitToActor* src); +s32 Collider_SetCylinderType1(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, + ColliderCylinderInitType1* src); s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src); -s32 Collider_CylinderSetAT(GlobalContext* globalCtx, Collider* collider); -s32 Collider_CylinderSetAC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_CylinderSetOC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_InitTrisItemDim(GlobalContext* globalCtx, TriNorm* dim); -s32 Collider_DestroyTrisItemDim(GlobalContext* globalCtx, TriNorm* dim); -s32 Collider_SetTrisItemDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisItemDimInit* src); -s32 Collider_InitTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider); -s32 Collider_DestroyTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider); -s32 Collider_SetTrisItem(GlobalContext* globalCtx, ColliderTrisItem* dest, ColliderTrisItemInit* src); -s32 Collider_TrisItemSetAT(GlobalContext* globalCtx, ColliderTrisItem* item); -s32 Collider_TrisItemSetAC(GlobalContext* globalCtx, ColliderTrisItem* item); -s32 Collider_TrisItemSetOC(GlobalContext* globalCtx, ColliderTrisItem* item); +s32 Collider_ResetCylinderAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetCylinderAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetCylinderOC(GlobalContext* globalCtx, Collider* collider); s32 Collider_InitTris(GlobalContext* globalCtx, ColliderTris* tris); s32 Collider_FreeTris(GlobalContext* globalCtx, ColliderTris* tris); s32 Collider_DestroyTris(GlobalContext* globalCtx, ColliderTris* tris); -s32 Collider_SetTris_Set3(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit_Set3* src); -s32 Collider_SetTris_Set5(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src); +s32 Collider_SetTrisAllocType1(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src); +s32 Collider_SetTrisAlloc(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src); s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src, - ColliderTrisItem* list); -s32 Collider_TrisSetAT(GlobalContext* globalCtx, Collider* collider); -s32 Collider_TrisSetAC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_TrisSetOC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_InitQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim); -s32 Collider_DestroyQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim); -s32 func_8005CEC4(GlobalContext* globalCtx, ColliderQuadDim* dim); -void func_8005CEDC(ColliderQuadDim* dim); -s32 Collider_SetQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dest, ColliderQuadDimInit* src); + ColliderTrisElement* elements); +s32 Collider_ResetTrisAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetTrisAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetTrisOC(GlobalContext* globalCtx, Collider* collider); s32 Collider_InitQuad(GlobalContext* globalCtx, ColliderQuad* collider); s32 Collider_DestroyQuad(GlobalContext* globalCtx, ColliderQuad* collider); -s32 Collider_SetQuad_Set3(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit_Set3* src); +s32 Collider_SetQuadType1(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src); s32 Collider_SetQuad(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src); -s32 Collider_QuadSetAT(GlobalContext* globalCtx, Collider* collider); -s32 Collider_QuadSetAC(GlobalContext* globalCtx, Collider* collider); -s32 Collider_QuadSetOC(GlobalContext* globalCtx, Collider* collider); -s32 func_8005D218(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* arg2); -s32 Collider_InitOcLine(GlobalContext* globalCtx, OcLine* line); -s32 Collider_DestroyOcLine(GlobalContext* globalCtx, OcLine* line); -void func_8005D3BC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +s32 Collider_ResetQuadAT(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetQuadAC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_ResetQuadOC(GlobalContext* globalCtx, Collider* collider); +s32 Collider_InitLine(GlobalContext* globalCtx, OcLine* line); +s32 Collider_DestroyLine(GlobalContext* globalCtx, OcLine* line); +s32 Collider_SetLinePoints(GlobalContext* globalCtx, OcLine* ocLine, Vec3f* a, Vec3f* b); +s32 Collider_SetLine(GlobalContext* globalCtx, OcLine* dest, OcLine* src); +s32 Collider_ResetLineOC(GlobalContext* globalCtx, OcLine* line); void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +void CollisionCheck_ClearContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); void CollisionCheck_EnableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); void CollisionCheck_DisableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -void func_8005D4DC(GlobalContext* globalCtx, Collider* collider); -void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +void Collider_Draw(GlobalContext* globalCtx, Collider* collider); +void CollisionCheck_DrawCollision(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider); s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider); @@ -842,49 +802,36 @@ s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* co s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider); s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index); s32 CollisionCheck_SetOCLine(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, OcLine* collider); -// ? func_8005DF2C(?); -// ? func_8005DF50(?); -// ? func_8005DF74(?); -void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos); -void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos); -// ? func_8005E2EC(?); -// ? func_8005E4F8(?); -// ? func_8005E604(?); -// ? func_8005E800(?); -// ? func_8005E81C(?); -// ? func_800611A0(?); -// ? func_80061274(?); -void func_8006139C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -// ? func_8006146C(?); -// ? func_800614A4(?); -// ? func_80061BF4(?); -// ? func_80061C18(?); +void CollisionCheck_BlueBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v); +void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); void CollisionCheck_OC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); -// ? func_80061E48(?); -void func_80061E8C(CollisionCheckInfo* info); -void func_80061EB0(CollisionCheckInfo* info, CollisionCheckInfoInit* init); -void func_80061ED4(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init); -void func_80061EFC(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init); -// ? func_80061F64(?); -// ? func_800622E4(?); -s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, - Vec3f* arg3, Actor** arg4, s32 arg5); -s32 func_800626B0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, Vec3f* arg3, - Actor** arg4, s32 arg5); -void Collider_CylinderUpdate(Actor* actor, ColliderCylinder* collider); -void func_80062718(ColliderCylinder* collider, Vec3s* pos); -void func_80062734(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); -void func_800627A0(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c); -void func_800628A4(s32 arg0, ColliderJntSph* collider); -void func_80062A28(GlobalContext*, Vec3f*); -void func_80062B80(GlobalContext*, Vec3f*); -void func_80062CD4(GlobalContext* globalCtx, Vec3f* v); -void func_80062D60(GlobalContext* globalCtx, Vec3f* v); -void func_80062DAC(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2); -void func_80062DF4(GlobalContext* globalCtx, Vec3f* v); -void func_80062E14(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2); -s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, Vec3f* itemProjPos, Vec3f* out1, - Vec3f* out2); +void CollisionCheck_InitInfo(CollisionCheckInfo* info); +void CollisionCheck_ResetDamage(CollisionCheckInfo* info); +void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init); +void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init); +void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init); +void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init); +void CollisionCheck_Damage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx); +s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b); +s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions); +void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider); +void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos); +void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); +void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c); +void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, + ColliderTrisElementDimInit* init); +void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider); +void CollisionCheck_SpawnRedBlood(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticles(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesMetal(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesMetalSound(GlobalContext* globalCtx, Vec3f* v, Vec3f* actorPos); +void CollisionCheck_SpawnShieldParticlesMetal2(GlobalContext* globalCtx, Vec3f* v); +void CollisionCheck_SpawnShieldParticlesWood(GlobalContext* globalCtx, Vec3f* b, Vec3f* actorPos); +s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, + Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2); +u8 CollisionCheck_GetSwordDamage(s32 dmgFlags); void SaveContext_Init(void); // ? func_800636C0(?); void func_8006375C(s32 arg0, s32 arg1, const char* text); @@ -934,6 +881,7 @@ void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skel // ? func_8006D0EC(?); // ? func_8006D684(?); void func_8006DC68(GlobalContext* globalCtx, Player* player); +void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2); u32 Jpeg_SendTask(JpegContext* ctx); void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y); u16 Jpeg_GetU16(u8* ptr); diff --git a/include/z64.h b/include/z64.h index e6a29b9f5d..19c98e68b6 100644 --- a/include/z64.h +++ b/include/z64.h @@ -667,15 +667,15 @@ typedef struct { } RoomContext; // size = 0x74 typedef struct { - /* 0x000 */ s16 colAtCount; + /* 0x000 */ s16 colATCount; /* 0x002 */ u16 sacFlags; - /* 0x004 */ Collider* colAt[COLLISION_CHECK_AT_MAX]; - /* 0x0CC */ s32 colAcCount; - /* 0x0D0 */ Collider* colAc[COLLISION_CHECK_AC_MAX]; - /* 0x1C0 */ s32 colOcCount; - /* 0x1C4 */ Collider* colOc[COLLISION_CHECK_OC_MAX]; - /* 0x28C */ s32 colOcLineCount; - /* 0x290 */ OcLine* colOcLine[COLLISION_CHECK_OC_LINE_MAX]; + /* 0x004 */ Collider* colAT[COLLISION_CHECK_AT_MAX]; + /* 0x0CC */ s32 colACCount; + /* 0x0D0 */ Collider* colAC[COLLISION_CHECK_AC_MAX]; + /* 0x1C0 */ s32 colOCCount; + /* 0x1C4 */ Collider* colOC[COLLISION_CHECK_OC_MAX]; + /* 0x28C */ s32 colLineCount; + /* 0x290 */ OcLine* colLine[COLLISION_CHECK_OC_LINE_MAX]; } CollisionCheckContext; // size = 0x29C typedef struct ListAlloc { diff --git a/include/z64actor.h b/include/z64actor.h index cf6d20e013..780118c9e5 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -9,6 +9,8 @@ #define ACTOR_NUMBER_MAX 200 #define INVISIBLE_ACTOR_MAX 20 #define AM_FIELD_SIZE 0x27A0 +#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions +#define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects. struct Actor; // From z64.h diff --git a/include/z64collision_check.h b/include/z64collision_check.h index af8178e6c1..6fb7e5c5ca 100644 --- a/include/z64collision_check.h +++ b/include/z64collision_check.h @@ -9,245 +9,382 @@ // From z64.h struct Actor; -typedef enum { - COLTYPE_UNK0, - COLTYPE_UNK1, - COLTYPE_UNK2, - COLTYPE_UNK3, - COLTYPE_UNK4, - COLTYPE_UNK5, - COLTYPE_UNK6, - COLTYPE_UNK7, - COLTYPE_UNK8, - COLTYPE_METAL_SHIELD, - COLTYPE_UNK10, - COLTYPE_WOODEN_SHIELD, - COLTYPE_UNK12, - COLTYPE_UNK13 -} ColliderType; - -typedef enum { - COLSHAPE_JNTSPH, - COLSHAPE_CYLINDER, - COLSHAPE_TRIS, - COLSHAPE_QUAD, - COLSHAPE_INVALID -} ColliderShape; - typedef struct { - /* 0x00 */ struct Actor* actor; - /* 0x04 */ struct Actor* at; - /* 0x08 */ struct Actor* ac; - /* 0x0C */ struct Actor* oc; - /* 0x10 */ u8 atFlags; // Compared to acFlags - /* 0x11 */ u8 acFlags; // Compared to atFlags - /* 0x12 */ u8 maskA; // Bitwise-and compared to maskB - /* 0x13 */ u8 maskB; // Bitwise-and compared to maskA - /* 0x14 */ u8 type; - /* 0x15 */ u8 shape; // ColliderShape + /* 0x00 */ struct Actor* actor; // Attached actor + /* 0x04 */ struct Actor* at; // Actor attached to what it collided with as an AT collider. + /* 0x08 */ struct Actor* ac; // Actor attached to what it collided with as an AC collider. + /* 0x0C */ struct Actor* oc; // Actor attached to what it collided with as an OC collider. + /* 0x10 */ u8 atFlags; // Information flags for AT collisions. + /* 0x11 */ u8 acFlags; // Information flags for AC collisions. + /* 0x12 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x13 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with. + /* 0x14 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. + /* 0x15 */ u8 shape; // JntSph, Cylinder, Tris, or Quad } Collider; // size = 0x18 typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 atFlags; - /* 0x02 */ u8 acFlags; - /* 0x03 */ u8 maskA; // Bitwise-And with maskB - /* 0x04 */ u8 maskB; // Bitwise-And with maskA - /* 0x05 */ u8 shape; // ColliderShape + /* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. + /* 0x01 */ u8 atFlags; // Information flags for AT collisions. + /* 0x02 */ u8 acFlags; // Information flags for OC collisions. + /* 0x03 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x04 */ u8 ocFlags2; // Flags related to which colliders it can OC collide with. + /* 0x05 */ u8 shape; // JntSph, Cylinder, Tris, or Quad } ColliderInit; // size = 0x06 typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 atFlags; - /* 0x02 */ u8 acFlags; - /* 0x03 */ u8 maskA; // Bitwise-And with maskB - /* 0x04 */ u8 shape; // Collider Type -} ColliderInit_Set3; // size = 0x05 + /* 0x00 */ u8 colType; // Determines hitmarks and sound effects during AC collisions. + /* 0x01 */ u8 atFlags; // Information flags for AT collisions. + /* 0x02 */ u8 acFlags; // Information flags for AC collisions. + /* 0x03 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x04 */ u8 shape; // JntSph, Cylinder, Tris, or Quad +} ColliderInitType1; // size = 0x05 typedef struct { /* 0x00 */ struct Actor* actor; - /* 0x04 */ u8 atFlags; // Compared to acFlags - /* 0x05 */ u8 acFlags; // Compared to atFlags - /* 0x06 */ u8 maskA; // Bitwise-and compared to maskB - /* 0x07 */ u8 shape; // ColliderShape -} ColliderInit_Actor; // size = 0x08 + /* 0x04 */ u8 atFlags; // Information flags for AT collisions. + /* 0x05 */ u8 acFlags; // Information flags for AC collisions. + /* 0x06 */ u8 ocFlags1; // Information flags for OC collisions. + /* 0x07 */ u8 shape; // JntSph, Cylinder, Tris, or Quad +} ColliderInitToActor; // size = 0x08 typedef struct { - /* 0x00 */ u32 flags; // Toucher Attack ID Flags - /* 0x04 */ u8 effect; + /* 0x00 */ u32 dmgFlags; // Toucher damage type flags. + /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 damage; // Damage or Stun Timer } ColliderTouch; // size = 0x08 typedef struct { - /* 0x00 */ u32 flags; // Collision Exclusion Mask + /* 0x00 */ u32 dmgFlags; // Bumper damage type flags. /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) /* 0x05 */ u8 defense; // Damage Resistance - /* 0x06 */ Vec3s unk_06; + /* 0x06 */ Vec3s hitPos; // Point of contact } ColliderBump; // size = 0x0C typedef struct { - /* 0x00 */ u32 flags; // Collision Exclusion Mask + /* 0x00 */ u32 dmgFlags; // Bumper exclusion mask /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) - /* 0x05 */ u8 defense; + /* 0x05 */ u8 defense; // Damage Resistance } ColliderBumpInit; // size = 0x08 -typedef struct ColliderBody { - /* 0x00 */ ColliderTouch toucher; - /* 0x08 */ ColliderBump bumper; - /* 0x14 */ u8 flags; // affects sfx reaction when attacked by Link - /* 0x15 */ u8 toucherFlags; - /* 0x16 */ u8 bumperFlags; - /* 0x17 */ u8 ocFlags; - /* 0x18 */ Collider* atHit; // object touching this object's AT collider - /* 0x1C */ Collider* acHit; // object touching this object's AC collider - /* 0x20 */ struct ColliderBody* atHitItem; // element that hit the AT collider - /* 0x24 */ struct ColliderBody* acHitItem; // element that hit the AC collider -} ColliderBody; // size = 0x28 +typedef struct ColliderInfo { + /* 0x00 */ ColliderTouch toucher; // Damage properties when acting as an AT collider + /* 0x08 */ ColliderBump bumper; // Damage properties when acting as an AC collider + /* 0x14 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown. + /* 0x15 */ u8 toucherFlags; // Information flags for AT collisions + /* 0x16 */ u8 bumperFlags; // Information flags for AC collisions + /* 0x17 */ u8 ocElemFlags; // Information flags for OC collisions + /* 0x18 */ Collider* atHit; // object touching this element's AT collider + /* 0x1C */ Collider* acHit; // object touching this element's AC collider + /* 0x20 */ struct ColliderInfo* atHitInfo; // element that hit the AT collider + /* 0x24 */ struct ColliderInfo* acHitInfo; // element that hit the AC collider +} ColliderInfo; // size = 0x28 typedef struct { - /* 0x00 */ u8 bodyFlags; - /* 0x04 */ ColliderTouch toucher; - /* 0x0C */ ColliderBumpInit bumper; - /* 0x14 */ u8 toucherFlags; // Attack Toucher Flags - /* 0x15 */ u8 bumperFlags; // Bumper Flags - /* 0x16 */ u8 bodyFlags2; -} ColliderBodyInit; // size = 0x18 + /* 0x00 */ u8 elemType; // Affects sfx reaction when attacked by Link and hookability. Full purpose unknown. + /* 0x04 */ ColliderTouch toucher; // Damage properties when acting as an AT collider + /* 0x0C */ ColliderBumpInit bumper; // Damage properties when acting as an AC collider + /* 0x14 */ u8 toucherFlags; // Information flags for AT collisions + /* 0x15 */ u8 bumperFlags; // Information flags for AC collisions + /* 0x16 */ u8 ocElemFlags; // Information flags for OC collisions +} ColliderInfoInit; // size = 0x18 typedef struct { /* 0x00 */ Sphere16 modelSphere; // model space sphere /* 0x08 */ Sphere16 worldSphere; // world space sphere /* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01 - /* 0x14 */ u8 joint; -} ColliderJntSphItemDim; // size = 0x18 + /* 0x14 */ u8 limb; // attached limb +} ColliderJntSphElementDim; // size = 0x18 typedef struct { - /* 0x00 */ u8 joint; - /* 0x02 */ Sphere16 modelSphere; - /* 0x0A */ s16 scale; -} ColliderJntSphItemDimInit; // size = 0x0C + /* 0x00 */ u8 limb; // attached limb + /* 0x02 */ Sphere16 modelSphere; // model space sphere + /* 0x0A */ s16 scale; // world space sphere = model * scale * 0.01 +} ColliderJntSphElementDimInit; // size = 0x0C typedef struct { - /* 0x00 */ ColliderBody body; - /* 0x28 */ ColliderJntSphItemDim dim; -} ColliderJntSphItem; // size = 0x40 + /* 0x00 */ ColliderInfo info; + /* 0x28 */ ColliderJntSphElementDim dim; +} ColliderJntSphElement; // size = 0x40 typedef struct { - /* 0x00 */ ColliderBodyInit body; - /* 0x18 */ ColliderJntSphItemDimInit dim; -} ColliderJntSphItemInit; // size = 0x24 + /* 0x00 */ ColliderInfoInit info; + /* 0x18 */ ColliderJntSphElementDimInit dim; +} ColliderJntSphElementInit; // size = 0x24 typedef struct { /* 0x00 */ Collider base; /* 0x18 */ s32 count; - /* 0x1C */ ColliderJntSphItem* list; + /* 0x1C */ ColliderJntSphElement* elements; } ColliderJntSph; // size = 0x20 typedef struct { /* 0x00 */ ColliderInit base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderJntSphItemInit* list; + /* 0x0C */ ColliderJntSphElementInit* elements; } ColliderJntSphInit; // size = 0x10 typedef struct { - /* 0x00 */ ColliderInit_Set3 base; + /* 0x00 */ ColliderInitType1 base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderJntSphItemInit* list; -} ColliderJntSphInit_Set3; // size = 0x10 + /* 0x0C */ ColliderJntSphElementInit* elements; +} ColliderJntSphInitType1; // size = 0x10 typedef struct { - /* 0x00 */ ColliderInit_Actor base; + /* 0x00 */ ColliderInitToActor base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderJntSphItemInit* list; -} ColliderJntSphInit_Actor; // size = 0x10 + /* 0x0C */ ColliderJntSphElementInit* elements; +} ColliderJntSphInitToActor; // size = 0x10 typedef struct { /* 0x00 */ Collider base; - /* 0x18 */ ColliderBody body; + /* 0x18 */ ColliderInfo info; /* 0x40 */ Cylinder16 dim; } ColliderCylinder; // size = 0x4C typedef struct { /* 0x00 */ ColliderInit base; - /* 0x08 */ ColliderBodyInit body; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ Cylinder16 dim; } ColliderCylinderInit; // size = 0x2C typedef struct { - /* 0x00 */ ColliderInit_Set3 base; - /* 0x08 */ ColliderBodyInit body; + /* 0x00 */ ColliderInitType1 base; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ Cylinder16 dim; -} ColliderCylinderInit_Set3; // size = 0x2C +} ColliderCylinderInitType1; // size = 0x2C typedef struct { - /* 0x00 */ ColliderInit_Actor base; - /* 0x08 */ ColliderBodyInit body; + /* 0x00 */ ColliderInitToActor base; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ Cylinder16 dim; -} ColliderCylinderInit_Actor; // size = 0x2C +} ColliderCylinderInitToActor; // size = 0x2C typedef struct { /* 0x00 */ Vec3f vtx[3]; -} ColliderTrisItemDimInit; // size = 0x24 +} ColliderTrisElementDimInit; // size = 0x24 typedef struct { - /* 0x00 */ ColliderBody body; + /* 0x00 */ ColliderInfo info; /* 0x28 */ TriNorm dim; -} ColliderTrisItem; // size = 0x5C +} ColliderTrisElement; // size = 0x5C typedef struct { - /* 0x00 */ ColliderBodyInit body; - /* 0x18 */ ColliderTrisItemDimInit dim; -} ColliderTrisItemInit; // size 0x3C + /* 0x00 */ ColliderInfoInit info; + /* 0x18 */ ColliderTrisElementDimInit dim; +} ColliderTrisElementInit; // size 0x3C typedef struct { /* 0x00 */ Collider base; /* 0x18 */ s32 count; - /* 0x1C */ ColliderTrisItem* list; + /* 0x1C */ ColliderTrisElement* elements; } ColliderTris; // size = 0x20 typedef struct { /* 0x00 */ ColliderInit base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderTrisItemInit* list; + /* 0x0C */ ColliderTrisElementInit* elements; } ColliderTrisInit; // size = 0x10 typedef struct { - /* 0x00 */ ColliderInit_Set3 base; + /* 0x00 */ ColliderInitType1 base; /* 0x08 */ s32 count; - /* 0x0C */ ColliderTrisItemInit* list; -} ColliderTrisInit_Set3; // size = 0x10 + /* 0x0C */ ColliderTrisElementInit* elements; +} ColliderTrisInitType1; // size = 0x10 typedef struct { /* 0x00 */ Vec3f quad[4]; /* 0x30 */ Vec3s dcMid; // midpoint of vectors d, c /* 0x36 */ Vec3s baMid; // midpoint of vectors b, a - /* 0x3C */ f32 unk_3C; + /* 0x3C */ f32 acDist; // distance to nearest AC collision this frame. } ColliderQuadDim; // size = 0x40 typedef struct { /* 0x00 */ Vec3f quad[4]; } ColliderQuadDimInit; // size = 0x30 +typedef struct { + /* 0x00 */ ColliderInfo info; + /* 0x24 */ ColliderQuadDim dim; +} ColliderQuadElement; // size = 0x68 + typedef struct { /* 0x00 */ Collider base; - /* 0x18 */ ColliderBody body; + /* 0x18 */ ColliderInfo info; /* 0x40 */ ColliderQuadDim dim; } ColliderQuad; // size = 0x80 typedef struct { /* 0x00 */ ColliderInit base; - /* 0x08 */ ColliderBodyInit body; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ ColliderQuadDimInit dim; } ColliderQuadInit; // size = 0x50 typedef struct { - /* 0x00 */ ColliderInit_Set3 base; - /* 0x08 */ ColliderBodyInit body; + /* 0x00 */ ColliderInitType1 base; + /* 0x08 */ ColliderInfoInit info; /* 0x20 */ ColliderQuadDimInit dim; -} ColliderQuadInit_Set3; // size = 0x50 +} ColliderQuadInitType1; // size = 0x50 typedef struct { /* 0x00 */ Linef line; - /* 0x18 */ u16 unk_18; + /* 0x18 */ u16 ocFlags; } OcLine; // size = 0x1C +typedef enum { + /* 0 */ COLTYPE_HIT0, // Blue blood, white hitmark + /* 1 */ COLTYPE_HIT1, // No blood, dust hitmark + /* 2 */ COLTYPE_HIT2, // Green blood, dust hitmark + /* 3 */ COLTYPE_HIT3, // No blood, white hitmark + /* 4 */ COLTYPE_HIT4, // Water burst, no hitmark + /* 5 */ COLTYPE_HIT5, // No blood, red hitmark + /* 6 */ COLTYPE_HIT6, // Green blood, white hitmark + /* 7 */ COLTYPE_HIT7, // Red blood, white hitmark + /* 8 */ COLTYPE_HIT8, // Blue blood, red hitmark + /* 9 */ COLTYPE_METAL, + /* 10 */ COLTYPE_NONE, + /* 11 */ COLTYPE_WOOD, + /* 12 */ COLTYPE_HARD, + /* 13 */ COLTYPE_TREE +} ColliderType; + +typedef enum { + /* 0 */ COLSHAPE_JNTSPH, + /* 1 */ COLSHAPE_CYLINDER, + /* 2 */ COLSHAPE_TRIS, + /* 3 */ COLSHAPE_QUAD, + /* 4 */ COLSHAPE_INVALID +} ColliderShape; + +/** + * Affects the sound Link's sword makes when hitting it, hookability, + * and possibly other things. It's definitely not flags, as all checks + * are == or !=. Will probably need more actors decomped to truly + * understand what this is. + */ +typedef enum { + /* 0 */ ELEMTYPE_UNK0, + /* 1 */ ELEMTYPE_UNK1, + /* 2 */ ELEMTYPE_UNK2, + /* 3 */ ELEMTYPE_UNK3, + /* 4 */ ELEMTYPE_UNK4, + /* 5 */ ELEMTYPE_UNK5, + /* 6 */ ELEMTYPE_UNK6, + /* 7 */ ELEMTYPE_UNK7 +} ElementType; + +#define AT_NONE 0 // No flags set. Cannot have AT collisions when set as AT +#define AT_ON (1 << 0) // Can have AT collisions when set as AT +#define AT_HIT (1 << 1) // Had an AT collision +#define AT_BOUNCED (1 << 2) // Had an AT collision with an AC_HARD collider +#define AT_TYPE_PLAYER (1 << 3) // Has player-aligned damage +#define AT_TYPE_ENEMY (1 << 4) // Has enemy-aligned damage +#define AT_TYPE_OTHER (1 << 5) // Has non-aligned damage +#define AT_SELF (1 << 6) // Can have AT collisions with colliders attached to the same actor +#define AT_TYPE_ALL (AT_TYPE_PLAYER | AT_TYPE_ENEMY | AT_TYPE_OTHER) // Has all three damage alignments + +#define AC_NONE 0 // No flags set. Cannot have AC collisions when set as AC +#define AC_ON (1 << 0) // Can have AC collisions when set as AC +#define AC_HIT (1 << 1) // Had an AC collision +#define AC_HARD (1 << 2) // Causes AT colliders to bounce off it +#define AC_TYPE_PLAYER AT_TYPE_PLAYER // Takes player-aligned damage +#define AC_TYPE_ENEMY AT_TYPE_ENEMY // Takes enemy-aligned damage +#define AC_TYPE_OTHER AT_TYPE_OTHER // Takes non-aligned damage +#define AC_NO_DAMAGE (1 << 6) // Collider does not take damage +#define AC_BOUNCED (1 << 7) // Caused an AT collider to bounce off it +#define AC_TYPE_ALL (AC_TYPE_PLAYER | AC_TYPE_ENEMY | AC_TYPE_OTHER) // Takes damage from all three alignments + +#define OC1_NONE 0 // No flags set. Cannot have OC collisions when set as OC +#define OC1_ON (1 << 0) // Can have OC collisions when set as OC +#define OC1_HIT (1 << 1) // Had an OC collision +#define OC1_NO_PUSH (1 << 2) // Does not push other colliders away during OC collisions +#define OC1_TYPE_PLAYER (1 << 3) // Can have OC collisions with OC type player +#define OC1_TYPE_1 (1 << 4) // Can have OC collisions with OC type 1 +#define OC1_TYPE_2 (1 << 5) // Can have OC collisions with OC type 2 +#define OC1_TYPE_ALL (OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2) // Can have collisions with all three OC types + +#define OC2_NONE 0 // No flags set. Has no OC type +#define OC2_HIT_PLAYER (1 << 0) // Had an OC collision with OC type player +#define OC2_UNK1 (1 << 1) // Prevents OC collisions with OC2_UNK2. Some horses and toki_sword have it. +#define OC2_UNK2 (1 << 2) // Prevents OC collisions with OC2_UNK1. Nothing has it. +#define OC2_TYPE_PLAYER OC1_TYPE_PLAYER // Has OC type player +#define OC2_TYPE_1 OC1_TYPE_1 // Has OC type 1 +#define OC2_TYPE_2 OC1_TYPE_2 // Has OC type 2 +#define OC2_FIRST_ONLY (1 << 6) // Skips AC checks on elements after the first collision. Only used by Ganon + +#define TOUCH_NONE 0 // No flags set. Cannot have AT collisions +#define TOUCH_ON (1 << 0) // Can have AT collisions +#define TOUCH_HIT (1 << 1) // Had an AT collision +#define TOUCH_NEAREST (1 << 2) // If a Quad, only collides with the closest bumper +#define TOUCH_SFX_NORMAL (0 << 3) // Hit sound effect based on AC collider's type +#define TOUCH_SFX_HARD (1 << 3) // Always uses hard deflection sound +#define TOUCH_SFX_WOOD (2 << 3) // Always uses wood deflection sound +#define TOUCH_SFX_NONE (3 << 3) // No hit sound effect +#define TOUCH_AT_HITMARK (1 << 5) // Draw hitmarks for every AT collision +#define TOUCH_DREW_HITMARK (1 << 6) // Already drew hitmark for this frame +#define TOUCH_UNK7 (1 << 7) // Unknown purpose. Used by some enemy quads + +#define BUMP_NONE 0 // No flags set. Cannot have AC collisions +#define BUMP_ON (1 << 0) // Can have AC collisions +#define BUMP_HIT (1 << 1) // Had an AC collision +#define BUMP_HOOKABLE (1 << 2) // Can be hooked if actor has hookability flags set. +#define BUMP_NO_AT_INFO (1 << 3) // Does not give its info to the AT collider that hit it. +#define BUMP_NO_DAMAGE (1 << 4) // Does not take damage. +#define BUMP_NO_SWORD_SFX (1 << 5) // Does not have a sound when hit by player-attached AT colliders. +#define BUMP_NO_HITMARK (1 << 6) // Skips hit effects. +#define BUMP_DRAW_HITMARK (1 << 7) // Draw hitmark for AC collision this frame. + +#define OCELEM_NONE 0 // No flags set. Cannot have OC collisions +#define OCELEM_ON (1 << 0) // Can have OC collisions +#define OCELEM_HIT (1 << 1) // Had an OC collision +#define OCELEM_UNK3 (1 << 3) // Unknown purpose. Used by Dead Hand element 0 and Dodongo element 5 + +#define OCLINE_NONE 0 // Did not have an OcLine collision +#define OCLINE_HIT (1 << 0) // Had an OcLine collision + +#define DMG_ENTRY(damage, effect) ((damage) | ((effect) << 4)) + +// These flags are not to be used in code until we figure out how we want to format them. They are only here for reference +#define DMG_DEKU_NUT (1 << 0x00) +#define DMG_DEKU_STICK (1 << 0x01) +#define DMG_SLINGSHOT (1 << 0x02) +#define DMG_EXPLOSIVE (1 << 0x03) +#define DMG_BOOMERANG (1 << 0x04) +#define DMG_ARROW_NORMAL (1 << 0x05) +#define DMG_HAMMER_SWING (1 << 0x06) +#define DMG_HOOKSHOT (1 << 0x07) +#define DMG_SLASH_KOKIRI (1 << 0x08) +#define DMG_SLASH_MASTER (1 << 0x09) +#define DMG_SLASH_GIANT (1 << 0x0A) +#define DMG_ARROW_FIRE (1 << 0x0B) +#define DMG_ARROW_ICE (1 << 0x0C) +#define DMG_ARROW_LIGHT (1 << 0x0D) +#define DMG_ARROW_UNK1 (1 << 0x0E) +#define DMG_ARROW_UNK2 (1 << 0x0F) +#define DMG_ARROW_UNK3 (1 << 0x10) +#define DMG_MAGIC_FIRE (1 << 0x11) +#define DMG_MAGIC_ICE (1 << 0x12) +#define DMG_MAGIC_LIGHT (1 << 0x13) +#define DMG_SHIELD (1 << 0x14) +#define DMG_MIR_RAY (1 << 0x15) +#define DMG_SPIN_KOKIRI (1 << 0x16) +#define DMG_SPIN_GIANT (1 << 0x17) +#define DMG_SPIN_MASTER (1 << 0x18) +#define DMG_JUMP_KOKIRI (1 << 0x19) +#define DMG_JUMP_GIANT (1 << 0x1A) +#define DMG_JUMP_MASTER (1 << 0x1B) +#define DMG_UNKNOWN_1 (1 << 0x1C) +#define DMG_UNBLOCKABLE (1 << 0x1D) +#define DMG_HAMMER_JUMP (1 << 0x1E) +#define DMG_UNKNOWN_2 (1 << 0x1F) + +#define DMG_SLASH (DMG_SLASH_KOKIRI | DMG_SLASH_MASTER | DMG_SLASH_GIANT) +#define DMG_SPIN_ATTACK (DMG_SPIN_KOKIRI | DMG_SPIN_MASTER | DMG_SPIN_GIANT) +#define DMG_JUMP_SLASH (DMG_JUMP_KOKIRI | DMG_JUMP_MASTER | DMG_JUMP_GIANT) +#define DMG_SWORD (DMG_SLASH | DMG_SPIN_ATTACK | DMG_JUMP_SLASH) +#define DMG_HAMMER (DMG_HAMMER_SWING | DMG_HAMMER_JUMP) +#define DMG_FIRE (DMG_ARROW_FIRE | DMG_MAGIC_FIRE) +#define DMG_ARROW (DMG_ARROW_NORMAL | DMG_ARROW_FIRE | DMG_ARROW_ICE | DMG_ARROW_LIGHT | DMG_UNK_ARROW_1 | DMG_UNK_ARROW_2 | DMG_UNK_ARROW_3) +#define DMG_RANGED (DMG_ARROW | DMG_HOOKSHOT | DMG_SLINGSHOT) +#define DMG_DEFAULT ~(DMG_SHIELD | DMG_MIR_RAY) + #endif diff --git a/src/code/z_actor.c b/src/code/z_actor.c index c5d2f3d4a6..40799d3529 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -820,7 +820,7 @@ void Actor_Init(Actor* actor, GlobalContext* globalCtx) { actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; - func_80061E48(&actor->colChkInfo); + CollisionCheck_InitInfo(&actor->colChkInfo); actor->floorPolySource = BGCHECK_SCENE; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { @@ -1432,17 +1432,21 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { } typedef struct { - f32 unk_0, unk_4; -} struct_80115FF8; // size = 0x8 + /* 0x0 */ f32 rangeSq; + /* 0x4 */ f32 leashScale; +} TargetRangeParams; // size = 0x8 -struct_80115FF8 D_80115FF8[] = { - { 4900.0f, 0.5f }, { 28900.0f, 0.6666667f }, { 78400.0f, 0.05f }, { 122500.0f, 0.6666667f }, - { 490000.0f, 0.6666667f }, { 1000000.0f, 0.6666667f }, { 10000.0f, 0.94905096f }, { 19600.0f, 0.85714287f }, - { 57600.0f, 0.41666666f }, { 78400.0f, 0.001f }, +#define TARGET_RANGE(range, leash) \ + { SQ(range), (f32)range / leash } + +TargetRangeParams D_80115FF8[] = { + TARGET_RANGE(70, 140), TARGET_RANGE(170, 255), TARGET_RANGE(280, 5600), TARGET_RANGE(350, 525), + TARGET_RANGE(700, 1050), TARGET_RANGE(1000, 1500), TARGET_RANGE(100, 105.36842), TARGET_RANGE(140, 163.33333), + TARGET_RANGE(240, 576), TARGET_RANGE(280, 280000), }; u32 func_8002F090(Actor* actor, f32 arg1) { - return arg1 < D_80115FF8[actor->unk_1F].unk_0; + return arg1 < D_80115FF8[actor->unk_1F].rangeSq; } s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { @@ -1464,7 +1468,7 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { dist = actor->xyzDistToLinkSq; } - return !func_8002F090(actor, D_80115FF8[actor->unk_1F].unk_4 * dist); + return !func_8002F090(actor, D_80115FF8[actor->unk_1F].leashScale * dist); } return 0; @@ -1722,7 +1726,7 @@ void func_8002F994(Actor* actor, s32 arg1) { s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* poly, s32 bgId, Vec3f* pos) { if (func_80041D4C(&globalCtx->colCtx, poly, bgId) == 8) { globalCtx->unk_11D30[0] = 1; - func_8005DFAC(globalCtx, NULL, pos); + CollisionCheck_BlueBlood(globalCtx, NULL, pos); Audio_PlayActorSound2(actor, NA_SE_IT_WALL_HIT_BUYO); return true; } @@ -2063,7 +2067,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { } else if ((unkFlag && !(actor->flags & unkFlag)) || (!unkFlag && unkCondition && (sp74 != actor) && (actor != player->naviActor) && (actor != player->heldActor) && (&player->actor != actor->parent))) { - func_80061E8C(&actor->colChkInfo); + CollisionCheck_ResetDamage(&actor->colChkInfo); actor = actor->next; } else if (actor->update == NULL) { if (!actor->isDrawn) { @@ -2100,7 +2104,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { func_8003F8EC(globalCtx, &globalCtx->colCtx.dyna, actor); } - func_80061E8C(&actor->colChkInfo); + CollisionCheck_ResetDamage(&actor->colChkInfo); actor = actor->next; } @@ -2440,7 +2444,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { } if ((HREG(64) != 1) || (HREG(76) != 0)) { - CollisionCheck_Draw(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_DrawCollision(globalCtx, &globalCtx->colChkCtx); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6563); @@ -2498,7 +2502,7 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) { } } - CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); actorCtx->flags.tempClear = 0; actorCtx->flags.tempSwch &= 0xFFFFFF; globalCtx->msgCtx.unk_E3F4 = 0; @@ -3198,8 +3202,8 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 } Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider) { - if ((collider->acFlags & 0x2) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) { - collider->acFlags &= ~0x2; + if ((collider->acFlags & AC_HIT) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) { + collider->acFlags &= ~AC_HIT; return collider->ac; } @@ -3267,8 +3271,9 @@ Actor* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) { spA8.y = itemActor->actor.posRot.pos.y + deltaY; spA8.z = itemActor->actor.posRot.pos.z + deltaZ; - if (func_80062ECC(refActor->colChkInfo.unk_10, refActor->colChkInfo.unk_12, 0.0f, &refActor->posRot.pos, - &itemActor->actor.posRot.pos, &spA8, &sp90, &sp84)) { + if (CollisionCheck_CylSideVsLineSeg(refActor->colChkInfo.unk_10, refActor->colChkInfo.unk_12, 0.0f, + &refActor->posRot.pos, &itemActor->actor.posRot.pos, &spA8, &sp90, + &sp84)) { return &itemActor->actor; } else { actor = actor->next; @@ -3555,7 +3560,7 @@ void Actor_DrawDoorLock(GlobalContext* globalCtx, s32 frame, s32 type) { } void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1) { - func_80062D60(globalCtx, arg1); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, arg1); } void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { @@ -3985,7 +3990,7 @@ void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1) { u8 func_800355E4(GlobalContext* globalCtx, Collider* collider) { Player* player = PLAYER; - if ((collider->acFlags & 0x08) && (player->swordState != 0) && (player->swordAnimation == 0x16)) { + if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->swordAnimation == 0x16)) { return 1; } else { return 0; @@ -4002,27 +4007,27 @@ u8 Actor_ApplyDamage(Actor* actor) { return actor->colChkInfo.health; } -void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) { - if (colBody->acHitItem == NULL) { +void func_80035650(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag) { + if (colInfo->acHitInfo == NULL) { actor->unk_116 = 0x00; - } else if (freezeFlag && (colBody->acHitItem->toucher.flags & 0x10060000)) { - actor->freezeTimer = colBody->acHitItem->toucher.damage; + } else if (freezeFlag && (colInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) { + actor->freezeTimer = colInfo->acHitInfo->toucher.damage; actor->unk_116 = 0x00; - } else if (colBody->acHitItem->toucher.flags & 0x0800) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x0800) { actor->unk_116 = 0x01; - } else if (colBody->acHitItem->toucher.flags & 0x1000) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x1000) { actor->unk_116 = 0x02; - } else if (colBody->acHitItem->toucher.flags & 0x4000) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x4000) { actor->unk_116 = 0x04; - } else if (colBody->acHitItem->toucher.flags & 0x8000) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x8000) { actor->unk_116 = 0x08; - } else if (colBody->acHitItem->toucher.flags & 0x10000) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x10000) { actor->unk_116 = 0x10; - } else if (colBody->acHitItem->toucher.flags & 0x2000) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x2000) { actor->unk_116 = 0x20; - } else if (colBody->acHitItem->toucher.flags & 0x80000) { + } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x80000) { if (freezeFlag) { - actor->freezeTimer = colBody->acHitItem->toucher.damage; + actor->freezeTimer = colInfo->acHitInfo->toucher.damage; } actor->unk_116 = 0x40; } else { @@ -4031,34 +4036,34 @@ void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) { } void func_8003573C(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) { - ColliderBody* curColBody; + ColliderInfo* curColInfo; s32 flag; s32 i; actor->unk_116 = 0x00; for (i = jntSph->count - 1; i >= 0; i--) { - curColBody = &jntSph->list[i].body; - if (curColBody->acHitItem == NULL) { + curColInfo = &jntSph->elements[i].info; + if (curColInfo->acHitInfo == NULL) { flag = 0x00; - } else if (freezeFlag && (curColBody->acHitItem->toucher.flags & 0x10060000)) { - actor->freezeTimer = curColBody->acHitItem->toucher.damage; + } else if (freezeFlag && (curColInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) { + actor->freezeTimer = curColInfo->acHitInfo->toucher.damage; flag = 0x00; - } else if (curColBody->acHitItem->toucher.flags & 0x0800) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x0800) { flag = 0x01; - } else if (curColBody->acHitItem->toucher.flags & 0x1000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x1000) { flag = 0x02; - } else if (curColBody->acHitItem->toucher.flags & 0x4000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x4000) { flag = 0x04; - } else if (curColBody->acHitItem->toucher.flags & 0x8000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x8000) { flag = 0x08; - } else if (curColBody->acHitItem->toucher.flags & 0x10000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x10000) { flag = 0x10; - } else if (curColBody->acHitItem->toucher.flags & 0x2000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x2000) { flag = 0x20; - } else if (curColBody->acHitItem->toucher.flags & 0x80000) { + } else if (curColInfo->acHitInfo->toucher.dmgFlags & 0x80000) { if (freezeFlag) { - actor->freezeTimer = curColBody->acHitItem->toucher.damage; + actor->freezeTimer = curColInfo->acHitInfo->toucher.damage; } flag = 0x40; } else { diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 2f6778f509..775db6cde8 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -4390,7 +4390,7 @@ void BgCheck_DrawDynaPolyList(GlobalContext* globalCtx, CollisionContext* colCtx vC.y += AREG(26) * ny; vC.z += AREG(26) * nz; } - func_8005B2AC(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); + Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); if (curNode->next == SS_NULL) { break; } @@ -4461,7 +4461,7 @@ void BgCheck_DrawStaticPoly(GlobalContext* globalCtx, CollisionContext* colCtx, vC.y += AREG(26) * ny; vC.z += AREG(26) * nz; } - func_8005B2AC(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); + Collider_DrawPoly(globalCtx->state.gfxCtx, &vA, &vB, &vC, r, g, b); } /** diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 4f56fdf806..22b5ff338a 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -3382,8 +3382,8 @@ s32 Camera_KeepOn3(Camera* camera) { Camera_Vec3fVecSphGeoAdd(&lineChkPointB, &anim->atTarget, &atToEyeAdj); if (!(keep3->flags & 0x80)) { while (i < angleCnt) { - if (!func_800626B0(camera->globalCtx, &camera->globalCtx->colChkCtx, &anim->atTarget, &lineChkPointB, - &colChkActors, 2) && + if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &anim->atTarget, + &lineChkPointB, &colChkActors, 2) && !Camera_BGCheck(camera, &anim->atTarget, &lineChkPointB)) { break; } @@ -3666,8 +3666,8 @@ s32 Camera_KeepOn4(Camera* camera) { if (!(keep4->unk_1C & 1)) { angleCnt = ARRAY_COUNT(D_8011D3B0); for (i = 0; i < angleCnt; i++) { - if (!func_800626B0(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50, &D_8015BD70, spCC, - sp9C) && + if (!CollisionCheck_LineOCCheck(camera->globalCtx, &camera->globalCtx->colChkCtx, &D_8015BD50, + &D_8015BD70, spCC, sp9C) && !Camera_BGCheck(camera, &D_8015BD50, &D_8015BD70)) { break; } diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c index 1b323dacfc..a99f6becbd 100644 --- a/src/code/z_collision_btltbls.c +++ b/src/code/z_collision_btltbls.c @@ -1,109 +1,825 @@ #include "global.h" -DamageTable D_8011DB20[] = { +static DamageTable sDamageTablePresets[] = { { { - 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 0 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 1 Used by En_Karebaba + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 2 Used by En_St, En_Ssh + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(3, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + // 3 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(1, 0x0), + /* Fire magic */ DMG_ENTRY(1, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x0), + /* Light magic */ DMG_ENTRY(1, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(2, 0x0), + /* Master jump */ DMG_ENTRY(2, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 4 Used by En_Dodojr + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x31, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 5 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x3), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(1, 0x0), + /* Master spin */ DMG_ENTRY(1, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 6 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(3, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(6, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(6, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(6, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 7 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(3, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(6, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(6, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(6, 0x0), + /* Ice arrow */ DMG_ENTRY(6, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 8 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(3, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 9 Used by En_Bubble + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x00, 0xE2, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 10 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xE), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(2, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 11 Used by En_Horse + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(9, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 12 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(4, 0x0), + /* Hammer swing */ DMG_ENTRY(4, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0x0), + /* Master sword */ DMG_ENTRY(4, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x02, 0x22, 0x01, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 13 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(2, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(1, 0x0), + /* Master spin */ DMG_ENTRY(1, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 14 Used by En_Sw + /* Deku nut */ DMG_ENTRY(1, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 15 Used by En_Fd + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, + // 16 Used by En_Fw + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(4, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(4, 0x0), + /* Master jump */ DMG_ENTRY(8, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 17 + /* Deku nut */ DMG_ENTRY(1, 0x0), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(1, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(1, 0x0), + /* Fire magic */ DMG_ENTRY(1, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x0), + /* Light magic */ DMG_ENTRY(1, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 18 + /* Deku nut */ DMG_ENTRY(1, 0x0), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(1, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(1, 0x0), + /* Hookshot */ DMG_ENTRY(1, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(1, 0x0), + /* Giant's Knife */ DMG_ENTRY(1, 0x0), + /* Fire arrow */ DMG_ENTRY(1, 0x0), + /* Ice arrow */ DMG_ENTRY(1, 0x0), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(1, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(1, 0x0), + /* Fire magic */ DMG_ENTRY(1, 0x0), + /* Ice magic */ DMG_ENTRY(1, 0x0), + /* Light magic */ DMG_ENTRY(1, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x00, 0x02, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00, - 0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 19 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(2, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(1, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0x2), + /* Ice magic */ DMG_ENTRY(2, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x01, 0xF2, 0xE0, 0x01, 0xD2, 0x10, 0x01, 0x02, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 20 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xD), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(2, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(2, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(2, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x10, 0x01, 0x00, 0xF0, 0x10, 0x01, 0xF0, 0x10, 0x01, 0x02, 0x02, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 21 + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(1, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(2, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x1), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(2, 0x1), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, { { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 22 Used by En_Du, En_Go, En_Ma1, En_Ma2, En_Ma3 + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), } }, }; +// Gets the pointer to one of the 23 preset damage tables. Returns NULL if index is out of range. DamageTable* DamageTable_Get(s32 index) { - if (index < 0 || index >= 23) { + if (!(0 <= index && index < ARRAY_COUNT(sDamageTablePresets))) { + // Index over osSyncPrintf("CollisionBtlTbl_get():インデックスオーバー\n"); - return 0; + return NULL; } - return &D_8011DB20[index]; + return &sDamageTablePresets[index]; } -void func_8005B248(DamageTable* table) { +// Sets all entries in the damage table to 0x00 +void DamageTable_Clear(DamageTable* table) { s32 i; for (i = 0; i < 32; i++) { table->table[i] = 0; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index fbf8a5eba8..be884c4440 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,13 +1,53 @@ #include "global.h" #include "vt.h" +#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" -// draw red poly -void func_8005B280(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC) { - func_8005B2AC(gfxCtx, vA, vB, vC, 255, 0, 0); +typedef s32 (*ColChkResetFunc)(GlobalContext*, Collider*); +typedef void (*ColChkBloodFunc)(GlobalContext*, Collider*, Vec3f*); +typedef void (*ColChkApplyFunc)(GlobalContext*, CollisionCheckContext*, Collider*); +typedef void (*ColChkVsFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Collider*); +typedef s32 (*ColChkLineFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*); + +typedef struct { + /* 0 */ u8 blood; + /* 1 */ u8 effect; +} HitInfo; // size = 0x2 + +typedef enum { + /* 0 */ BLOOD_NONE, + /* 1 */ BLOOD_BLUE, + /* 2 */ BLOOD_GREEN, + /* 3 */ BLOOD_WATER, + /* 4 */ BLOOD_RED, + /* 5 */ BLOOD_RED2 +} ColChkBloodType; + +typedef enum { + /* 0 */ HIT_WHITE, + /* 1 */ HIT_DUST, + /* 2 */ HIT_RED, + /* 3 */ HIT_SOLID, + /* 4 */ HIT_WOOD, + /* 5 */ HIT_NONE +} ColChkHitType; + +typedef enum { + /* 0 */ MASSTYPE_IMMOVABLE, + /* 1 */ MASSTYPE_HEAVY, + /* 2 */ MASSTYPE_NORMAL +} ColChkMassType; + +/** + * Draws a red triangle with vertices vA, vB, and vC. + */ +void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC) { + Collider_DrawPoly(gfxCtx, vA, vB, vC, 255, 0, 0); } -// draw poly -void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b) { +/** + * Draws the triangle with vertices vA, vB, and vC and with the specified color. + */ +void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b) { Vtx* vtxTbl; Vtx* vtx; f32 nx; @@ -63,7 +103,10 @@ void func_8005B2AC(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 } s32 Collider_InitBase(GlobalContext* globalCtx, Collider* collider) { - static Collider init = { NULL, NULL, NULL, NULL, 0, 0, 0, 0, COLTYPE_UNK3, COLSHAPE_INVALID }; + static Collider init = { + NULL, NULL, NULL, NULL, AT_NONE, AC_NONE, OC1_NONE, OC2_NONE, COLTYPE_HIT3, COLSHAPE_INVALID, + }; + *collider = init; return 1; } @@ -72,58 +115,63 @@ s32 Collider_DestroyBase(GlobalContext* globalCtx, Collider* collider) { return 1; } -s32 Collider_SetBase_Actor(GlobalContext* globalCtx, Collider* collider, ColliderInit_Actor* src) { +/** + * Uses default OC2_TYPE_1 and COLTYPE_HIT0 + */ +s32 Collider_SetBaseToActor(GlobalContext* globalCtx, Collider* collider, ColliderInitToActor* src) { collider->actor = src->actor; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; - collider->maskA = src->maskA; - collider->maskB = 0x10; + collider->ocFlags1 = src->ocFlags1; + collider->ocFlags2 = OC2_TYPE_1; collider->shape = src->shape; return 1; } -// maskB = 0x10 -s32 Collider_SetBase_Set3(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit_Set3* src) { +/** + * Uses default OC2_TYPE_1 + */ +s32 Collider_SetBaseType1(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInitType1* src) { collider->actor = actor; - collider->type = src->type; + collider->colType = src->colType; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; - collider->maskA = src->maskA; - collider->maskB = 0x10; + collider->ocFlags1 = src->ocFlags1; + collider->ocFlags2 = OC2_TYPE_1; collider->shape = src->shape; return 1; } -// maskB = src->maskB s32 Collider_SetBase(GlobalContext* globalCtx, Collider* collider, Actor* actor, ColliderInit* src) { collider->actor = actor; - collider->type = src->type; + collider->colType = src->colType; collider->atFlags = src->atFlags; collider->acFlags = src->acFlags; - collider->maskA = src->maskA; - collider->maskB = src->maskB; + collider->ocFlags1 = src->ocFlags1; + collider->ocFlags2 = src->ocFlags2; collider->shape = src->shape; return 1; } -void Collider_BaseSetAT(GlobalContext* globalCtx, Collider* collider) { +void Collider_ResetATBase(GlobalContext* globalCtx, Collider* collider) { collider->at = NULL; - collider->atFlags &= ~0x6; + collider->atFlags &= ~(AT_HIT | AT_BOUNCED); } -void Collider_BaseSetAC(GlobalContext* globalCtx, Collider* collider) { +void Collider_ResetACBase(GlobalContext* globalCtx, Collider* collider) { collider->ac = NULL; - collider->acFlags &= ~0x82; + collider->acFlags &= ~(AC_HIT | AC_BOUNCED); } -void Collider_BaseSetOC(GlobalContext* globalCtx, Collider* collider) { +void Collider_ResetOCBase(GlobalContext* globalCtx, Collider* collider) { collider->oc = NULL; - collider->maskA &= ~0x2; - collider->maskB &= ~0x1; + collider->ocFlags1 &= ~OC1_HIT; + collider->ocFlags2 &= ~OC2_HIT_PLAYER; } s32 Collider_InitTouch(GlobalContext* globalCtx, ColliderTouch* touch) { - static ColliderTouch init = { 0, 0, 0 }; + static ColliderTouch init = { 0x00000000, 0, 0 }; + *touch = init; return 1; } @@ -132,19 +180,19 @@ s32 Collider_DestroyTouch(GlobalContext* globalCtx, ColliderTouch* touch) { return 1; } -// src might actually be a different type s32 Collider_SetTouch(GlobalContext* globalCtx, ColliderTouch* dest, ColliderTouch* src) { - dest->flags = src->flags; + dest->dmgFlags = src->dmgFlags; dest->effect = src->effect; dest->damage = src->damage; return 1; } -void Collider_BodySetAT_Unk(GlobalContext* globalCtx, ColliderBody* body) { +void Collider_ResetATInfo_Unk(GlobalContext* globalCtx, ColliderInfo* info) { } s32 Collider_InitBump(GlobalContext* globalCtx, ColliderBump* bump) { static ColliderBump init = { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }; + *bump = init; return 1; } @@ -154,314 +202,321 @@ s32 Collider_DestroyBump(GlobalContext* globalCtx, ColliderBump* bump) { } s32 Collider_SetBump(GlobalContext* globalCtx, ColliderBump* bump, ColliderBumpInit* init) { - bump->flags = init->flags; + bump->dmgFlags = init->dmgFlags; bump->effect = init->effect; bump->defense = init->defense; return 1; } -s32 Collider_InitBody(GlobalContext* globalCtx, ColliderBody* body) { - static ColliderBody init = { - { 0, 0, 0 }, { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }, 0, 0, 0, 0, NULL, NULL, NULL, NULL, +s32 Collider_InitInfo(GlobalContext* globalCtx, ColliderInfo* info) { + static ColliderInfo init = { + { 0, 0, 0 }, { 0xFFCFFFFF, 0, 0, { 0, 0, 0 } }, + ELEMTYPE_UNK0, TOUCH_NONE, + BUMP_NONE, OCELEM_NONE, + NULL, NULL, + NULL, NULL, }; - *body = init; - Collider_InitTouch(globalCtx, &body->toucher); - Collider_InitBump(globalCtx, &body->bumper); + + *info = init; + Collider_InitTouch(globalCtx, &info->toucher); + Collider_InitBump(globalCtx, &info->bumper); return 1; } -s32 Collider_DestroyBody(GlobalContext* globalCtx, ColliderBody* body) { - Collider_DestroyTouch(globalCtx, &body->toucher); - Collider_DestroyBump(globalCtx, &body->bumper); +s32 Collider_DestroyInfo(GlobalContext* globalCtx, ColliderInfo* info) { + Collider_DestroyTouch(globalCtx, &info->toucher); + Collider_DestroyBump(globalCtx, &info->bumper); return 1; } -s32 Collider_SetBody(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInit* bodyInit) { - body->flags = bodyInit->bodyFlags; - Collider_SetTouch(globalCtx, &body->toucher, &bodyInit->toucher); - Collider_SetBump(globalCtx, &body->bumper, &bodyInit->bumper); - body->toucherFlags = bodyInit->toucherFlags; - body->bumperFlags = bodyInit->bumperFlags; - body->ocFlags = bodyInit->bodyFlags2; +s32 Collider_SetInfo(GlobalContext* globalCtx, ColliderInfo* info, ColliderInfoInit* infoInit) { + info->elemType = infoInit->elemType; + Collider_SetTouch(globalCtx, &info->toucher, &infoInit->toucher); + Collider_SetBump(globalCtx, &info->bumper, &infoInit->bumper); + info->toucherFlags = infoInit->toucherFlags; + info->bumperFlags = infoInit->bumperFlags; + info->ocElemFlags = infoInit->ocElemFlags; return 1; } -void Collider_BodySetAT(GlobalContext* globalCtx, ColliderBody* body) { - body->atHit = NULL; - body->atHitItem = NULL; - body->toucherFlags &= ~0x2; - body->toucherFlags &= ~0x40; - Collider_BodySetAT_Unk(globalCtx, body); +void Collider_ResetATInfo(GlobalContext* globalCtx, ColliderInfo* info) { + info->atHit = NULL; + info->atHitInfo = NULL; + info->toucherFlags &= ~TOUCH_HIT; + info->toucherFlags &= ~TOUCH_DREW_HITMARK; + Collider_ResetATInfo_Unk(globalCtx, info); } -void Collider_BodySetAC(GlobalContext* globalCtx, ColliderBody* body) { - body->bumper.unk_06.z = 0; - body->bumperFlags &= ~0x2; - body->bumperFlags &= ~0x80; - body->acHit = NULL; - body->acHitItem = NULL; - body->bumper.unk_06.y = body->bumper.unk_06.z; - body->bumper.unk_06.x = body->bumper.unk_06.z; +void Collider_ResetACInfo(GlobalContext* globalCtx, ColliderInfo* info) { + info->bumper.hitPos.x = info->bumper.hitPos.y = info->bumper.hitPos.z = 0; + info->bumperFlags &= ~BUMP_HIT; + info->bumperFlags &= ~BUMP_DRAW_HITMARK; + info->acHit = NULL; + info->acHitInfo = NULL; } -void Collider_BodySetOC(GlobalContext* globalCtx, ColliderBody* body) { - body->ocFlags &= ~0x2; +void Collider_ResetOCInfo(GlobalContext* globalCtx, ColliderInfo* info) { + info->ocElemFlags &= ~OCELEM_HIT; } -s32 Collider_InitJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dim) { - static ColliderJntSphItemDim init = { 0 }; +s32 Collider_InitJntSphElementDim(GlobalContext* globalCtx, ColliderJntSphElementDim* dim) { + static ColliderJntSphElementDim init = { + { { 0, 0, 0 }, 0 }, + { { 0, 0, 0 }, 0 }, + 0.0f, + 0, + }; *dim = init; return 1; } -s32 Collider_DestroyJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* item) { +s32 Collider_DestroyJntSphElementDim(GlobalContext* globalCtx, ColliderJntSphElementDim* element) { return 1; } -s32 Collider_SetJntSphItemDim(GlobalContext* globalCtx, ColliderJntSphItemDim* dest, ColliderJntSphItemDimInit* src) { - dest->joint = src->joint; +s32 Collider_SetJntSphElementDim(GlobalContext* globalCtx, ColliderJntSphElementDim* dest, + ColliderJntSphElementDimInit* src) { + dest->limb = src->limb; dest->modelSphere = src->modelSphere; dest->scale = src->scale * 0.01f; return 1; } -s32 Collider_InitJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item) { - Collider_InitBody(globalCtx, &item->body); - Collider_InitJntSphItemDim(globalCtx, &item->dim); +s32 Collider_InitJntSphElement(GlobalContext* globalCtx, ColliderJntSphElement* element) { + Collider_InitInfo(globalCtx, &element->info); + Collider_InitJntSphElementDim(globalCtx, &element->dim); return 1; } -s32 Collider_DestroyJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* item) { - Collider_DestroyBody(globalCtx, &item->body); - Collider_DestroyJntSphItemDim(globalCtx, &item->dim); +s32 Collider_DestroyJntSphElement(GlobalContext* globalCtx, ColliderJntSphElement* element) { + Collider_DestroyInfo(globalCtx, &element->info); + Collider_DestroyJntSphElementDim(globalCtx, &element->dim); return 1; } -s32 Collider_SetJntSphItem(GlobalContext* globalCtx, ColliderJntSphItem* dest, ColliderJntSphItemInit* src) { - Collider_SetBody(globalCtx, &dest->body, &src->body); - Collider_SetJntSphItemDim(globalCtx, &dest->dim, &src->dim); +s32 Collider_SetJntSphElement(GlobalContext* globalCtx, ColliderJntSphElement* dest, ColliderJntSphElementInit* src) { + Collider_SetInfo(globalCtx, &dest->info, &src->info); + Collider_SetJntSphElementDim(globalCtx, &dest->dim, &src->dim); return 1; } -s32 Collider_JntSphItemSetAT(GlobalContext* globalCtx, ColliderJntSphItem* collider) { - Collider_BodySetAT(globalCtx, &collider->body); +s32 Collider_ResetJntSphElementAT(GlobalContext* globalCtx, ColliderJntSphElement* collider) { + Collider_ResetATInfo(globalCtx, &collider->info); return 1; } -s32 Collider_JntSphItemSetAC(GlobalContext* globalCtx, ColliderJntSphItem* collider) { - Collider_BodySetAC(globalCtx, &collider->body); +s32 Collider_ResetJntSphElementAC(GlobalContext* globalCtx, ColliderJntSphElement* collider) { + Collider_ResetACInfo(globalCtx, &collider->info); return 1; } -s32 Collider_JntSphItemSetOC(GlobalContext* globalCtx, ColliderJntSphItem* collider) { - Collider_BodySetOC(globalCtx, &collider->body); +s32 Collider_ResetJntSphElementOC(GlobalContext* globalCtx, ColliderJntSphElement* collider) { + Collider_ResetOCInfo(globalCtx, &collider->info); return 1; } +/** + * Initializes a ColliderJntSph to default values + */ s32 Collider_InitJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) { Collider_InitBase(globalCtx, &collider->base); collider->count = 0; - collider->list = NULL; + collider->elements = NULL; return 1; } -// Destruct ColliderJntSph (malloc) +/** + * Destroys a dynamically allocated ColliderJntSph + */ s32 Collider_FreeJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) { - ColliderJntSphItem* next; + ColliderJntSphElement* element; Collider_DestroyBase(globalCtx, &collider->base); - next = collider->list; - - while (next < collider->list + collider->count) { - Collider_DestroyJntSphItem(globalCtx, next); - next++; + for (element = collider->elements; element < collider->elements + collider->count; element++) { + Collider_DestroyJntSphElement(globalCtx, element); } collider->count = 0; - if (collider->list != NULL) { - ZeldaArena_FreeDebug(collider->list, "../z_collision_check.c", 1393); + if (collider->elements != NULL) { + ZeldaArena_FreeDebug(collider->elements, "../z_collision_check.c", 1393); } - collider->list = NULL; + collider->elements = NULL; return 1; } -// Destruct ColliderJntSph (no malloc) +/** + * Destroys a preallocated ColliderJntSph + */ s32 Collider_DestroyJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) { - ColliderJntSphItem* next; + ColliderJntSphElement* element; Collider_DestroyBase(globalCtx, &collider->base); - next = collider->list; - - while (next < collider->list + collider->count) { - - Collider_DestroyJntSphItem(globalCtx, next); - next++; + for (element = collider->elements; element < collider->elements + collider->count; element++) { + Collider_DestroyJntSphElement(globalCtx, element); } collider->count = 0; - collider->list = NULL; + collider->elements = NULL; return 1; } -// ClObjJntSph -s32 Collider_SetJntSph_Set(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInit_Actor* src) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; +/** + * Sets up the ColliderJntSph using the values in src, sets it to the actor specified in src, and dynamically allocates + * the element array. Uses default OC2_TYPE_1 and COLTYPE_HIT0. Unused. + */ +s32 Collider_SetJntSphToActor(GlobalContext* globalCtx, ColliderJntSph* dest, ColliderJntSphInitToActor* src) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; - Collider_SetBase_Actor(globalCtx, &dest->base, &src->base); + Collider_SetBaseToActor(globalCtx, &dest->base, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphItem), "../z_collision_check.c", 1443); + dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1443); - if (dest->list == NULL) { + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjJntSph_set():zelda_malloc()出来ません。\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjJntSph_set():zelda_malloc()出来ません。\n"); osSyncPrintf(VT_RST); return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } -// ClObjJntSph_set3 (maskB = 0x10) -// called by En_Nwc -s32 Collider_SetJntSph_Set3(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, - ColliderJntSphInit_Set3* src) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; +/** + * Sets up the ColliderJntSph using the values in src and dynamically allocates the element array. Uses default + * OC2_TYPE_1. Only used by En_Nwc, an unused and unfinished actor. + */ +s32 Collider_SetJntSphAllocType1(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, + ColliderJntSphInitType1* src) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; - Collider_SetBase_Set3(globalCtx, &dest->base, actor, &src->base); + Collider_SetBaseType1(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphItem), "../z_collision_check.c", 1490); + dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1490); - if (dest->list == NULL) { + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjJntSph_set3():zelda_malloc_出来ません。\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjJntSph_set3():zelda_malloc_出来ません。\n"); osSyncPrintf(VT_RST); return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } -// ClObjJntSph_set5 (maskB = src->maskB) -s32 Collider_SetJntSph_Set5(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; +/** + * Sets up the ColliderJntSph using the values in src and dynamically allocates the element array. + * Unused. + */ +s32 Collider_SetJntSphAlloc(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphItem), "../z_collision_check.c", 1551); + dest->elements = ZeldaArena_MallocDebug(src->count * sizeof(ColliderJntSphElement), "../z_collision_check.c", 1551); - if (dest->list == NULL) { + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjJntSph_set5():zelda_malloc出来ません\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjJntSph_set5():zelda_malloc出来ません\n"); osSyncPrintf(VT_RST); return 0; } - - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } +/** + * Sets up the ColliderJntSph using the values in src, placing the element array in elements. + */ s32 Collider_SetJntSph(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src, - ColliderJntSphItem* list) { - ColliderJntSphItem* destNext; - ColliderJntSphItemInit* srcNext; + ColliderJntSphElement* elements) { + ColliderJntSphElement* destElem; + ColliderJntSphElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = list; + dest->elements = elements; - if (dest->list == NULL) { + if (dest->elements == NULL) { __assert("pclobj_jntsph->elem_tbl != NULL", "../z_collision_check.c", 1603); } - - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitJntSphItem(globalCtx, destNext); - Collider_SetJntSphItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitJntSphElement(globalCtx, destElem); + Collider_SetJntSphElement(globalCtx, destElem, srcElem); } return 1; } -s32 Collider_JntSphSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderJntSphItem* next; - ColliderJntSph* col = (ColliderJntSph*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetJntSphAT(GlobalContext* globalCtx, Collider* collider) { + ColliderJntSphElement* element; + ColliderJntSph* jntSph = (ColliderJntSph*)collider; - Collider_BaseSetAT(gctx, &col->base); - next = col->list; + Collider_ResetATBase(globalCtx, &jntSph->base); - while (next < col->list + col->count) { - Collider_JntSphItemSetAT(gctx, next); - next++; + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + Collider_ResetJntSphElementAT(globalCtx, element); } return 1; } -s32 Collider_JntSphSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderJntSphItem* next; - ColliderJntSph* col = (ColliderJntSph*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetJntSphAC(GlobalContext* globalCtx, Collider* collider) { + ColliderJntSphElement* element; + ColliderJntSph* jntSph = (ColliderJntSph*)collider; - Collider_BaseSetAC(gctx, &col->base); - next = col->list; + Collider_ResetACBase(globalCtx, &jntSph->base); - while (next < col->list + col->count) { - Collider_JntSphItemSetAC(gctx, next); - next++; + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + Collider_ResetJntSphElementAC(globalCtx, element); } return 1; } -s32 Collider_JntSphSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderJntSphItem* next; - ColliderJntSph* col = (ColliderJntSph*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetJntSphOC(GlobalContext* globalCtx, Collider* collider) { + ColliderJntSphElement* element; + ColliderJntSph* jntSph = (ColliderJntSph*)collider; - Collider_BaseSetOC(gctx, &col->base); - next = col->list; - while (next < col->list + col->count) { - Collider_JntSphItemSetOC(gctx, next); - next++; + Collider_ResetOCBase(globalCtx, &jntSph->base); + + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + Collider_ResetJntSphElementOC(globalCtx, element); } return 1; } s32 Collider_InitCylinderDim(GlobalContext* globalCtx, Cylinder16* dim) { - Cylinder16 init = { 0 }; + Cylinder16 init = { 0, 0, 0, { 0, 0, 0 } }; + *dim = init; return 1; } @@ -475,306 +530,337 @@ s32 Collider_SetCylinderDim(GlobalContext* globalCtx, Cylinder16* dest, Cylinder return 1; } +/** + * Initializes a ColliderCylinder to default values + */ s32 Collider_InitCylinder(GlobalContext* globalCtx, ColliderCylinder* collider) { Collider_InitBase(globalCtx, &collider->base); - Collider_InitBody(globalCtx, &collider->body); + Collider_InitInfo(globalCtx, &collider->info); Collider_InitCylinderDim(globalCtx, &collider->dim); return 1; } +/** + * Destroys a ColliderCylinder + */ s32 Collider_DestroyCylinder(GlobalContext* globalCtx, ColliderCylinder* collider) { Collider_DestroyBase(globalCtx, &collider->base); - Collider_DestroyBody(globalCtx, &collider->body); + Collider_DestroyInfo(globalCtx, &collider->info); Collider_DestroyCylinderDim(globalCtx, &collider->dim); return 1; } -// used only by DekuJr, D_80B92A00 -s32 Collider_SetCylinder_Actor(GlobalContext* globalCtx, ColliderCylinder* collider, ColliderCylinderInit_Actor* src) { - Collider_SetBase_Actor(globalCtx, &collider->base, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); +/** + * Sets up the ColliderCylinder using the values in src and sets it to the actor specified in src. Uses default + * OC2_TYPE_1 and COLTYPE_0. Used only by DekuJr, who sets it to himself anyways. + */ +s32 Collider_SetCylinderToActor(GlobalContext* globalCtx, ColliderCylinder* collider, + ColliderCylinderInitToActor* src) { + Collider_SetBaseToActor(globalCtx, &collider->base, &src->base); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim); return 1; } -// maskB = 0x10 -s32 Collider_SetCylinder_Set3(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, - ColliderCylinderInit_Set3* src) { - Collider_SetBase_Set3(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); +/** + * Sets up the ColliderCylinder using the values in src. Uses default OC2_TYPE_1 + */ +s32 Collider_SetCylinderType1(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, + ColliderCylinderInitType1* src) { + Collider_SetBaseType1(globalCtx, &collider->base, actor, &src->base); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim); return 1; } -// maskB = src->maskB +/** + * Sets up the ColliderCylinder using the values in src. + */ s32 Collider_SetCylinder(GlobalContext* globalCtx, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src) { Collider_SetBase(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetCylinderDim(globalCtx, &collider->dim, &src->dim); return 1; } -s32 Collider_CylinderSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderCylinder* col = (ColliderCylinder*)collider; - Collider_BaseSetAT(globalCtx, &col->base); - Collider_BodySetAT(globalCtx, &col->body); +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetCylinderAT(GlobalContext* globalCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + Collider_ResetATBase(globalCtx, &cylinder->base); + Collider_ResetATInfo(globalCtx, &cylinder->info); return 1; } -s32 Collider_CylinderSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderCylinder* col = (ColliderCylinder*)collider; - Collider_BaseSetAC(globalCtx, &col->base); - Collider_BodySetAC(globalCtx, &col->body); +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetCylinderAC(GlobalContext* globalCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + Collider_ResetACBase(globalCtx, &cylinder->base); + Collider_ResetACInfo(globalCtx, &cylinder->info); return 1; } -s32 Collider_CylinderSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderCylinder* col = (ColliderCylinder*)collider; - Collider_BaseSetOC(globalCtx, &col->base); - Collider_BodySetOC(globalCtx, &col->body); +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetCylinderOC(GlobalContext* globalCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + Collider_ResetOCBase(globalCtx, &cylinder->base); + Collider_ResetOCInfo(globalCtx, &cylinder->info); return 1; } -s32 Collider_InitTrisItemDim(GlobalContext* globalCtx, TriNorm* dim) { - static TriNorm init = { 0 }; +s32 Collider_InitTrisElementDim(GlobalContext* globalCtx, TriNorm* dim) { + static TriNorm init = { + { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, + { { 0.0f, 0.0f, 0.0f }, 0.0f }, + }; + *dim = init; return 1; } -s32 Collider_DestroyTrisItemDim(GlobalContext* globalCtx, TriNorm* dim) { +s32 Collider_DestroyTrisElementDim(GlobalContext* globalCtx, TriNorm* dim) { return 1; } -s32 Collider_SetTrisItemDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisItemDimInit* src) { - Vec3f* d; - Vec3f* s; - f32 nx, ny, nz, nd; +s32 Collider_SetTrisElementDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisElementDimInit* src) { + Vec3f* destVtx; + Vec3f* srcVtx; + f32 nx; + f32 ny; + f32 nz; + f32 originDist; - d = dest->vtx; - s = src->vtx; - while (d < dest->vtx + 3) { - *d++ = *s++; + for (destVtx = dest->vtx, srcVtx = src->vtx; destVtx < dest->vtx + 3; destVtx++, srcVtx++) { + *destVtx = *srcVtx; } - Math3D_DefPlane(&src->vtx[0], &src->vtx[1], &src->vtx[2], &nx, &ny, &nz, &nd); + Math3D_DefPlane(&src->vtx[0], &src->vtx[1], &src->vtx[2], &nx, &ny, &nz, &originDist); dest->plane.normal.x = nx; dest->plane.normal.y = ny; dest->plane.normal.z = nz; - dest->plane.originDist = nd; + dest->plane.originDist = originDist; return 1; } -s32 Collider_InitTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider) { - Collider_InitBody(globalCtx, &collider->body); - Collider_InitTrisItemDim(globalCtx, &collider->dim); +s32 Collider_InitTrisElement(GlobalContext* globalCtx, ColliderTrisElement* collider) { + Collider_InitInfo(globalCtx, &collider->info); + Collider_InitTrisElementDim(globalCtx, &collider->dim); return 1; } -s32 Collider_DestroyTrisItem(GlobalContext* globalCtx, ColliderTrisItem* collider) { - Collider_DestroyBody(globalCtx, &collider->body); - Collider_DestroyTrisItemDim(globalCtx, &collider->dim); +s32 Collider_DestroyTrisElement(GlobalContext* globalCtx, ColliderTrisElement* collider) { + Collider_DestroyInfo(globalCtx, &collider->info); + Collider_DestroyTrisElementDim(globalCtx, &collider->dim); return 1; } -s32 Collider_SetTrisItem(GlobalContext* globalCtx, ColliderTrisItem* dest, ColliderTrisItemInit* src) { - Collider_SetBody(globalCtx, &dest->body, &src->body); - Collider_SetTrisItemDim(globalCtx, &dest->dim, &src->dim); +s32 Collider_SetTrisElement(GlobalContext* globalCtx, ColliderTrisElement* dest, ColliderTrisElementInit* src) { + Collider_SetInfo(globalCtx, &dest->info, &src->info); + Collider_SetTrisElementDim(globalCtx, &dest->dim, &src->dim); return 1; } -s32 Collider_TrisItemSetAT(GlobalContext* globalCtx, ColliderTrisItem* item) { - Collider_BodySetAT(globalCtx, &item->body); +s32 Collider_ResetTrisElementAT(GlobalContext* globalCtx, ColliderTrisElement* element) { + Collider_ResetATInfo(globalCtx, &element->info); return 1; } -s32 Collider_TrisItemSetAC(GlobalContext* globalCtx, ColliderTrisItem* item) { - Collider_BodySetAC(globalCtx, &item->body); +s32 Collider_ResetTrisElementAC(GlobalContext* globalCtx, ColliderTrisElement* element) { + Collider_ResetACInfo(globalCtx, &element->info); return 1; } -s32 Collider_TrisItemSetOC(GlobalContext* globalCtx, ColliderTrisItem* item) { - Collider_BodySetOC(globalCtx, &item->body); +s32 Collider_ResetTrisElementOC(GlobalContext* globalCtx, ColliderTrisElement* element) { + Collider_ResetOCInfo(globalCtx, &element->info); return 1; } +/** + * Initializes a ColliderTris to default values + */ s32 Collider_InitTris(GlobalContext* globalCtx, ColliderTris* tris) { Collider_InitBase(globalCtx, &tris->base); tris->count = 0; - tris->list = 0; + tris->elements = 0; return 1; } -// zelda malloc +/** + * Destroys a dynamically allocated ColliderTris + * Unused + */ s32 Collider_FreeTris(GlobalContext* globalCtx, ColliderTris* tris) { - ColliderTrisItem* next; + ColliderTrisElement* element; Collider_DestroyBase(globalCtx, &tris->base); - next = tris->list; - - while (next < tris->list + tris->count) { - Collider_DestroyTrisItem(globalCtx, next); - next++; + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_DestroyTrisElement(globalCtx, element); } tris->count = 0; - if (tris->list != NULL) { - ZeldaArena_FreeDebug(tris->list, "../z_collision_check.c", 2099); + if (tris->elements != NULL) { + ZeldaArena_FreeDebug(tris->elements, "../z_collision_check.c", 2099); } - tris->list = NULL; + tris->elements = NULL; return 1; } -// no malloc +/** + * Destroys a preallocated ColliderTris + */ s32 Collider_DestroyTris(GlobalContext* globalCtx, ColliderTris* tris) { - ColliderTrisItem* next; + ColliderTrisElement* element; Collider_DestroyBase(globalCtx, &tris->base); - next = tris->list; - - while (next < tris->list + tris->count) { - Collider_DestroyTrisItem(globalCtx, next); - next++; + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_DestroyTrisElement(globalCtx, element); } + tris->count = 0; - tris->list = NULL; + tris->elements = NULL; return 1; } -// ClObjTris_set3 (maskB = 0x10) -s32 Collider_SetTris_Set3(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit_Set3* src) { - ColliderTrisItem* destNext; - ColliderTrisItemInit* srcNext; +/** + * Sets up the ColliderTris using the values in src and dynamically allocates the element array. Uses default OC2_TYPE_1 + * Unused. + */ +s32 Collider_SetTrisAllocType1(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src) { + ColliderTrisElement* destElem; + ColliderTrisElementInit* srcElem; - Collider_SetBase_Set3(globalCtx, &dest->base, actor, &src->base); + Collider_SetBaseType1(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisItem), "../z_collision_check.c", 2156); - if (dest->list == NULL) { + dest->elements = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2156); + if (dest->elements == NULL) { dest->count = 0; osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjTris_set3():zelda_malloc()出来ません\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjTris_set3():zelda_malloc()出来ません\n"); osSyncPrintf(VT_RST); return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitTrisItem(globalCtx, destNext); - Collider_SetTrisItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitTrisElement(globalCtx, destElem); + Collider_SetTrisElement(globalCtx, destElem, srcElem); } return 1; } -// ClObjTris_set5 (maskB = src->maskB) -s32 Collider_SetTris_Set5(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src) { - ColliderTrisItem* destNext; - ColliderTrisItemInit* srcNext; +/** + * Sets up the ColliderTris using the values in src and dynamically allocates the element array. + * Unused + */ +s32 Collider_SetTrisAlloc(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src) { + ColliderTrisElement* destElem; + ColliderTrisElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisItem), "../z_collision_check.c", 2207); + dest->elements = ZeldaArena_MallocDebug(dest->count * sizeof(ColliderTrisElement), "../z_collision_check.c", 2207); - if (dest->list == NULL) { + if (dest->elements == NULL) { osSyncPrintf(VT_FGCOL(RED)); - osSyncPrintf("ClObjTris_set5():zelda_malloc出来ません\n"); // EUC-JP: 出来ません。 | Can not. + // Can not. + osSyncPrintf("ClObjTris_set5():zelda_malloc出来ません\n"); osSyncPrintf(VT_RST); dest->count = 0; return 0; } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitTrisItem(globalCtx, destNext); - Collider_SetTrisItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitTrisElement(globalCtx, destElem); + Collider_SetTrisElement(globalCtx, destElem, srcElem); } return 1; } +/** + * Sets up the ColliderTris using the values in src, placing the element array in elements. + */ s32 Collider_SetTris(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, ColliderTrisInit* src, - ColliderTrisItem* list) { - ColliderTrisItem* destNext; - ColliderTrisItemInit* srcNext; + ColliderTrisElement* elements) { + ColliderTrisElement* destElem; + ColliderTrisElementInit* srcElem; Collider_SetBase(globalCtx, &dest->base, actor, &src->base); dest->count = src->count; - dest->list = list; + dest->elements = elements; - if (dest->list == NULL) { + if (dest->elements == NULL) { __assert("pclobj_tris->elem_tbl != NULL", "../z_collision_check.c", 2258); } - destNext = dest->list; - srcNext = src->list; - - while (destNext < dest->list + dest->count) { - Collider_InitTrisItem(globalCtx, destNext); - Collider_SetTrisItem(globalCtx, destNext, srcNext); - destNext++; - srcNext++; + for (destElem = dest->elements, srcElem = src->elements; destElem < dest->elements + dest->count; + destElem++, srcElem++) { + Collider_InitTrisElement(globalCtx, destElem); + Collider_SetTrisElement(globalCtx, destElem, srcElem); } return 1; } -s32 Collider_TrisSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderTrisItem* next; - ColliderTris* col = (ColliderTris*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetTrisAT(GlobalContext* globalCtx, Collider* collider) { + ColliderTrisElement* element; + ColliderTris* tris = (ColliderTris*)collider; - Collider_BaseSetAT(gctx, &col->base); - next = col->list; - - while (next < col->list + col->count) { - Collider_TrisItemSetAT(gctx, next); - next++; + Collider_ResetATBase(globalCtx, &tris->base); + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_ResetTrisElementAT(globalCtx, element); } return 1; } -s32 Collider_TrisSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderTrisItem* next; - ColliderTris* col = (ColliderTris*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetTrisAC(GlobalContext* globalCtx, Collider* collider) { + ColliderTrisElement* element; + ColliderTris* tris = (ColliderTris*)collider; - Collider_BaseSetAC(gctx, &col->base); - next = col->list; - - while (next < col->list + col->count) { - Collider_TrisItemSetAC(gctx, next); - next++; + Collider_ResetACBase(globalCtx, &tris->base); + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_ResetTrisElementAC(globalCtx, element); } return 1; } -s32 Collider_TrisSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderTrisItem* next; - ColliderTris* col = (ColliderTris*)collider; - GlobalContext* gctx = globalCtx; +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetTrisOC(GlobalContext* globalCtx, Collider* collider) { + ColliderTrisElement* element; + ColliderTris* tris = (ColliderTris*)collider; - Collider_BaseSetOC(gctx, &col->base); - next = col->list; - - while (next < col->list + col->count) { - Collider_TrisItemSetOC(gctx, next); - next++; + Collider_ResetOCBase(globalCtx, &tris->base); + for (element = tris->elements; element < tris->elements + tris->count; element++) { + Collider_ResetTrisElementOC(globalCtx, element); } return 1; } s32 Collider_InitQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim) { static ColliderQuadDim init = { - { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0, 0, 0 }, { 0, 0, 0 }, 1.0E38f, }; + *dim = init; return 1; } @@ -783,14 +869,12 @@ s32 Collider_DestroyQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dim) { return 1; } -// Set ColliderQuadDim unk_3C -s32 func_8005CEC4(GlobalContext* globalCtx, ColliderQuadDim* dim) { - dim->unk_3C = 1.0E38f; +s32 Collider_ResetQuadACDist(GlobalContext* globalCtx, ColliderQuadDim* dim) { + dim->acDist = 1.0E38f; return 1; } -// ColliderQuadDim compute dc ba midpoints -void func_8005CEDC(ColliderQuadDim* dim) { +void Collider_SetQuadMidpoints(ColliderQuadDim* dim) { dim->dcMid.x = (dim->quad[3].x + dim->quad[2].x) * 0.5f; dim->dcMid.y = (dim->quad[3].y + dim->quad[2].y) * 0.5f; dim->dcMid.z = (dim->quad[3].z + dim->quad[2].z) * 0.5f; @@ -804,170 +888,225 @@ s32 Collider_SetQuadDim(GlobalContext* globalCtx, ColliderQuadDim* dest, Collide dest->quad[1] = src->quad[1]; dest->quad[2] = src->quad[2]; dest->quad[3] = src->quad[3]; - func_8005CEDC(dest); + Collider_SetQuadMidpoints(dest); return 1; } +/** + * Initializes a ColliderQuad to default values. + */ s32 Collider_InitQuad(GlobalContext* globalCtx, ColliderQuad* collider) { Collider_InitBase(globalCtx, &collider->base); - Collider_InitBody(globalCtx, &collider->body); + Collider_InitInfo(globalCtx, &collider->info); Collider_InitQuadDim(globalCtx, &collider->dim); return 1; } +/** + * Destroys a ColliderQuad. + */ s32 Collider_DestroyQuad(GlobalContext* globalCtx, ColliderQuad* collider) { Collider_DestroyBase(globalCtx, &collider->base); - Collider_DestroyBody(globalCtx, &collider->body); + Collider_DestroyInfo(globalCtx, &collider->info); Collider_DestroyQuadDim(globalCtx, &collider->dim); return 1; } -// maskB = 0x10 -s32 Collider_SetQuad_Set3(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit_Set3* src) { - Collider_SetBase_Set3(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); +/** + * Sets up the ColliderQuad using the values in src. Uses the default OC2_TYPE_1 + */ +s32 Collider_SetQuadType1(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src) { + Collider_SetBaseType1(globalCtx, &collider->base, actor, &src->base); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetQuadDim(globalCtx, &collider->dim, &src->dim); return 1; } -// maskB = src->maskB +/** + * Sets up the ColliderQuad using the values in src. + */ s32 Collider_SetQuad(GlobalContext* globalCtx, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src) { Collider_SetBase(globalCtx, &collider->base, actor, &src->base); - Collider_SetBody(globalCtx, &collider->body, &src->body); + Collider_SetInfo(globalCtx, &collider->info, &src->info); Collider_SetQuadDim(globalCtx, &collider->dim, &src->dim); return 1; } -s32 Collider_QuadSetAT(GlobalContext* globalCtx, Collider* collider) { - ColliderQuad* col = (ColliderQuad*)collider; - Collider_BaseSetAT(globalCtx, &col->base); - Collider_BodySetAT(globalCtx, &col->body); - func_8005CEC4(globalCtx, &col->dim); +/** + * Resets the collider's AT collision flags. + */ +s32 Collider_ResetQuadAT(GlobalContext* globalCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + + Collider_ResetATBase(globalCtx, &quad->base); + Collider_ResetATInfo(globalCtx, &quad->info); + Collider_ResetQuadACDist(globalCtx, &quad->dim); return 1; } -s32 Collider_QuadSetAC(GlobalContext* globalCtx, Collider* collider) { - ColliderQuad* col = (ColliderQuad*)collider; - Collider_BaseSetAC(globalCtx, &col->base); - Collider_BodySetAC(globalCtx, &col->body); +/** + * Resets the collider's AC collision flags. + */ +s32 Collider_ResetQuadAC(GlobalContext* globalCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + + Collider_ResetACBase(globalCtx, &quad->base); + Collider_ResetACInfo(globalCtx, &quad->info); return 1; } -s32 Collider_QuadSetOC(GlobalContext* globalCtx, Collider* collider) { - ColliderQuad* col = (ColliderQuad*)collider; - Collider_BaseSetOC(globalCtx, &col->base); - Collider_BodySetOC(globalCtx, &col->body); +/** + * Resets the collider's OC collision flags. + */ +s32 Collider_ResetQuadOC(GlobalContext* globalCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + + Collider_ResetOCBase(globalCtx, &quad->base); + Collider_ResetOCInfo(globalCtx, &quad->info); return 1; } -s32 func_8005D218(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* arg2) { - f32 temp; - Vec3f sp20; +/** + * For quad colliders with AT_NEAREST, resets the previous AC collider it hit if the current element is closer, + * otherwise returns false. Used on player AT colliders to prevent multiple collisions from registering. + */ +s32 Collider_QuadSetNearestAC(GlobalContext* globalCtx, ColliderQuad* quad, Vec3f* hitPos) { + f32 acDist; + Vec3f dcMid; - if (!(quad->body.toucherFlags & 4)) { - return 1; + if (!(quad->info.toucherFlags & TOUCH_NEAREST)) { + return true; } - Math_Vec3s_ToVec3f(&sp20, &quad->dim.dcMid); - temp = Math3D_Vec3fDistSq(&sp20, arg2); - if (temp < quad->dim.unk_3C) { - quad->dim.unk_3C = temp; - if (quad->body.atHit != NULL) { - Collider_BaseSetAC(globalCtx, quad->body.atHit); + Math_Vec3s_ToVec3f(&dcMid, &quad->dim.dcMid); + acDist = Math3D_Vec3fDistSq(&dcMid, hitPos); + if (acDist < quad->dim.acDist) { + quad->dim.acDist = acDist; + if (quad->info.atHit != NULL) { + Collider_ResetACBase(globalCtx, quad->info.atHit); } - if (quad->body.atHitItem != NULL) { - Collider_BodySetAC(globalCtx, quad->body.atHitItem); + if (quad->info.atHitInfo != NULL) { + Collider_ResetACInfo(globalCtx, quad->info.atHitInfo); } - return 1; + return true; } - return 0; + return false; } -s32 Collider_InitOcLine(GlobalContext* globalCtx, OcLine* line) { - static Vec3f init = { 0, 0, 0 }; - Vec3f temp; +/** + * Initializes an OcLine to default values + * OcLines are entirely unused. + */ +s32 Collider_InitLine(GlobalContext* globalCtx, OcLine* line) { + Vec3f init = { 0.0f, 0.0f, 0.0f }; - temp = init; - Math_Vec3f_Copy(&line->line.a, &temp); - Math_Vec3f_Copy(&line->line.b, &temp); + Math_Vec3f_Copy(&line->line.a, &init); + Math_Vec3f_Copy(&line->line.b, &init); return 1; } -s32 Collider_DestroyOcLine(GlobalContext* globalCtx, OcLine* line) { +/** + * Destroys an OcLine + * OcLines are entirely unused. + */ +s32 Collider_DestroyLine(GlobalContext* globalCtx, OcLine* line) { return 1; } -s32 func_8005D334(UNK_TYPE arg0, OcLine* arg1, Vec3f* arg2, Vec3f* arg3) { - Math_Vec3f_Copy(&arg1->line.a, arg2); - Math_Vec3f_Copy(&arg1->line.b, arg3); +/** + * Sets up an OcLine with endpoints a and b. + * OcLines are entirely unused. + */ +s32 Collider_SetLinePoints(GlobalContext* GlobalContext, OcLine* ocLine, Vec3f* a, Vec3f* b) { + Math_Vec3f_Copy(&ocLine->line.a, a); + Math_Vec3f_Copy(&ocLine->line.b, b); return 1; } -s32 func_8005D378(UNK_TYPE arg0, OcLine* arg1, OcLine* arg2) { - arg1->unk_18 = arg2->unk_18; - func_8005D334(arg0, arg1, &arg2->line.a, &arg2->line.b); +/** + * Sets up an OcLine using the values in src. + * OcLines are entirely unused. + */ +s32 Collider_SetLine(GlobalContext* globalCtx, OcLine* dest, OcLine* src) { + dest->ocFlags = src->ocFlags; + Collider_SetLinePoints(globalCtx, dest, &src->line.a, &src->line.b); return 1; } -s32 func_8005D3A4(GlobalContext* globalCtx, OcLine* line) { - line->unk_18 &= 0xFFFE; +/** + * Resets the OcLine's collision flags. + * OcLines are entirely unused. + */ +s32 Collider_ResetLineOC(GlobalContext* globalCtx, OcLine* line) { + line->ocFlags &= ~OCLINE_HIT; return 1; } -void func_8005D3BC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { +/** + * Initializes CollisionCheckContext. Clears all collider arrays, disables SAC, and sets flags for drawing colliders. + */ +void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { colChkCtx->sacFlags = 0; - CollisionCheck_InitContext(globalCtx, colChkCtx); - AREG(21) = 1; - AREG(22) = 1; - AREG(23) = 1; + CollisionCheck_ClearContext(globalCtx, colChkCtx); + AREG(21) = true; + AREG(22) = true; + AREG(23) = true; } void CollisionCheck_DestroyContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { } -// Initialize CollisionCheckContext -void CollisionCheck_InitContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider** c; - OcLine** d; +/** + * Clears all collider lists in CollisionCheckContext when not in SAC mode. + */ +void CollisionCheck_ClearContext(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { + Collider** col; + OcLine** line; if (!(colChkCtx->sacFlags & 1)) { - colChkCtx->colAtCount = 0; - colChkCtx->colAcCount = 0; - colChkCtx->colOcCount = 0; - colChkCtx->colOcLineCount = 0; - for (c = colChkCtx->colAt; c < colChkCtx->colAt + COLLISION_CHECK_AT_MAX; c++) { - *c = NULL; + colChkCtx->colATCount = 0; + colChkCtx->colACCount = 0; + colChkCtx->colOCCount = 0; + colChkCtx->colLineCount = 0; + for (col = colChkCtx->colAT; col < colChkCtx->colAT + COLLISION_CHECK_AT_MAX; col++) { + *col = NULL; } - for (c = colChkCtx->colAc; c < colChkCtx->colAc + COLLISION_CHECK_AC_MAX; c++) { - *c = NULL; + for (col = colChkCtx->colAC; col < colChkCtx->colAC + COLLISION_CHECK_AC_MAX; col++) { + *col = NULL; } - for (c = colChkCtx->colOc; c < colChkCtx->colOc + COLLISION_CHECK_OC_MAX; c++) { - *c = NULL; + for (col = colChkCtx->colOC; col < colChkCtx->colOC + COLLISION_CHECK_OC_MAX; col++) { + *col = NULL; } - for (d = colChkCtx->colOcLine; d < colChkCtx->colOcLine + COLLISION_CHECK_OC_LINE_MAX; d++) { - *d = NULL; + for (line = colChkCtx->colLine; line < colChkCtx->colLine + COLLISION_CHECK_OC_LINE_MAX; line++) { + *line = NULL; } } } -// Unused +/** + * Enables SAC, an alternate collision check mode that allows direct management of collider lists. Unused. + */ void CollisionCheck_EnableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - colChkCtx->sacFlags |= 1; + colChkCtx->sacFlags |= AC_ON; } -// Unused +/** + * Disables SAC, an alternate collision check mode that allows direct management of collider lists. Unused. + */ void CollisionCheck_DisableSAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - colChkCtx->sacFlags &= ~1; + colChkCtx->sacFlags &= ~AC_ON; } -// Draw Collider -void func_8005D4DC(GlobalContext* globalCtx, Collider* collider) { +/** + * Draws a collider of any shape. + * Math3D_DrawSphere and Math3D_DrawCylinder are noops, so JntSph and Cylinder are not drawn. + */ +void Collider_Draw(GlobalContext* globalCtx, Collider* collider) { ColliderJntSph* jntSph; ColliderCylinder* cylinder; ColliderTris* tris; - ColliderTrisItem* trisItem; ColliderQuad* quad; s32 i; @@ -978,7 +1117,7 @@ void func_8005D4DC(GlobalContext* globalCtx, Collider* collider) { case COLSHAPE_JNTSPH: jntSph = (ColliderJntSph*)collider; for (i = 0; i < jntSph->count; i++) { - Math3D_DrawSphere(globalCtx, &jntSph->list[i].dim.worldSphere); + Math3D_DrawSphere(globalCtx, &jntSph->elements[i].dim.worldSphere); } break; case COLSHAPE_CYLINDER: @@ -988,39 +1127,42 @@ void func_8005D4DC(GlobalContext* globalCtx, Collider* collider) { case COLSHAPE_TRIS: tris = (ColliderTris*)collider; for (i = 0; i < tris->count; i++) { - trisItem = &tris->list[i]; - func_8005B280(globalCtx->state.gfxCtx, &trisItem->dim.vtx[0], &trisItem->dim.vtx[1], - &trisItem->dim.vtx[2]); + Collider_DrawRedPoly(globalCtx->state.gfxCtx, &tris->elements[i].dim.vtx[0], + &tris->elements[i].dim.vtx[1], &tris->elements[i].dim.vtx[2]); } break; case COLSHAPE_QUAD: quad = (ColliderQuad*)collider; - func_8005B280(globalCtx->state.gfxCtx, &quad->dim.quad[2], &quad->dim.quad[3], &quad->dim.quad[1]); - func_8005B280(globalCtx->state.gfxCtx, &quad->dim.quad[1], &quad->dim.quad[0], &quad->dim.quad[2]); + Collider_DrawRedPoly(globalCtx->state.gfxCtx, &quad->dim.quad[2], &quad->dim.quad[3], &quad->dim.quad[1]); + Collider_DrawRedPoly(globalCtx->state.gfxCtx, &quad->dim.quad[1], &quad->dim.quad[0], &quad->dim.quad[2]); break; } } -void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { +/** + * Draws collision if AREG(15) and other AREGs are set. AREG(21) draws AT colliders, AREG(22) draws AC colliders, + * AREG(23) draws OC colliders, AREG(24) draws dynapolys, and AREG(25) draws bg polys + */ +void CollisionCheck_DrawCollision(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { Collider* collider; s32 i; if (AREG(15)) { if (AREG(21)) { - for (i = 0; i < colChkCtx->colAtCount; i++) { - func_8005D4DC(globalCtx, colChkCtx->colAt[i]); + for (i = 0; i < colChkCtx->colATCount; i++) { + Collider_Draw(globalCtx, colChkCtx->colAT[i]); } } if (AREG(22)) { - for (i = 0; i < colChkCtx->colAcCount; i++) { - func_8005D4DC(globalCtx, colChkCtx->colAc[i]); + for (i = 0; i < colChkCtx->colACCount; i++) { + Collider_Draw(globalCtx, colChkCtx->colAC[i]); } } if (AREG(23)) { - for (i = 0; i < colChkCtx->colOcCount; i++) { - collider = colChkCtx->colOc[i]; - if (collider->maskA & 1) { - func_8005D4DC(globalCtx, collider); + for (i = 0; i < colChkCtx->colOCCount; i++) { + collider = colChkCtx->colOC[i]; + if (collider->ocFlags1 & OC1_ON) { + Collider_Draw(globalCtx, collider); } } } @@ -1033,262 +1175,298 @@ void CollisionCheck_Draw(GlobalContext* globalCtx, CollisionCheckContext* colChk } } -s32 (*D_8011DEF8[])(GlobalContext*, Collider*) = { Collider_JntSphSetAT, Collider_CylinderSetAT, Collider_TrisSetAT, - Collider_QuadSetAT }; +static ColChkResetFunc sATResetFuncs[] = { + Collider_ResetJntSphAT, + Collider_ResetCylinderAT, + Collider_ResetTrisAT, + Collider_ResetQuadAT, +}; -// Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders) +/** + * Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders) + * The last argument takes a Collider, so pass collider.base rather than the raw collider. + */ s32 CollisionCheck_SetAT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 2997); } - D_8011DEF8[collider->shape](globalCtx, collider); - if (collider->actor != NULL) { - if (collider->actor->update == NULL) { - return -1; - } + sATResetFuncs[collider->shape](globalCtx, collider); + if (collider->actor != NULL && collider->actor->update == NULL) { + return -1; } - if (colChkCtx->colAtCount >= COLLISION_CHECK_AT_MAX) { + if (colChkCtx->colATCount >= COLLISION_CHECK_AT_MAX) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); - // EUC-JP: インデックスがオーバーして追加不能 | Index exceeded and cannot be added return -1; } if (colChkCtx->sacFlags & 1) { return -1; } - index = colChkCtx->colAtCount; - colChkCtx->colAt[colChkCtx->colAtCount++] = collider; + index = colChkCtx->colATCount; + colChkCtx->colAT[colChkCtx->colATCount++] = collider; return index; } -// Unused. Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders). -// If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it -// will be inserted into the next slot +/** + * Unused. Sets collider as an AT (attack) for the current frame, which will be checked against ACs (attack colliders). + * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it + * will be inserted into the next slot + */ s32 CollisionCheck_SetAT_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index) { - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3037); } if (func_800C0D28(globalCtx) == 1) { return -1; } - D_8011DEF8[collider->shape](globalCtx, collider); + sATResetFuncs[collider->shape](globalCtx, collider); if (collider->actor != NULL && collider->actor->update == NULL) { return -1; } if (colChkCtx->sacFlags & 1) { - if (!(index < colChkCtx->colAtCount)) { + if (!(index < colChkCtx->colATCount)) { + // You are trying to register a location that is larger than the total number of data. osSyncPrintf("CollisionCheck_setAT_SAC():全データ数より大きいところに登録しようとしている。\n"); - // EUC-JP: 全データ数より大きいところに登録しようとしている。 | You are trying to register a location that - // is larger than the total number of data. return -1; } - colChkCtx->colAt[index] = collider; + colChkCtx->colAT[index] = collider; } else { - if (!(colChkCtx->colAtCount < COLLISION_CHECK_AT_MAX)) { + if (!(colChkCtx->colATCount < COLLISION_CHECK_AT_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); return -1; } - index = colChkCtx->colAtCount; - colChkCtx->colAt[colChkCtx->colAtCount++] = collider; + index = colChkCtx->colATCount; + colChkCtx->colAT[colChkCtx->colATCount++] = collider; } return index; } -s32 (*D_8011DF08[])(GlobalContext*, Collider*) = { Collider_JntSphSetAC, Collider_CylinderSetAC, Collider_TrisSetAC, - Collider_QuadSetAC }; +static ColChkResetFunc sACResetFuncs[] = { + Collider_ResetJntSphAC, + Collider_ResetCylinderAC, + Collider_ResetTrisAC, + Collider_ResetQuadAC, +}; -// Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks) +/** + * Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks) + * The last argument takes a Collider, so pass collider.base rather than the raw collider. + */ s32 CollisionCheck_SetAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3114); } - D_8011DF08[collider->shape](globalCtx, collider); - if (collider->actor != NULL) { - if (collider->actor->update == NULL) { - return -1; - } + sACResetFuncs[collider->shape](globalCtx, collider); + if (collider->actor != NULL && collider->actor->update == NULL) { + return -1; } - if (colChkCtx->colAcCount >= COLLISION_CHECK_AC_MAX) { + if (colChkCtx->colACCount >= COLLISION_CHECK_AC_MAX) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } if (colChkCtx->sacFlags & 1) { return -1; } - index = colChkCtx->colAcCount; - colChkCtx->colAc[colChkCtx->colAcCount++] = collider; + index = colChkCtx->colACCount; + colChkCtx->colAC[colChkCtx->colACCount++] = collider; return index; } -// Unused. Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks). -// If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it -// will be inserted into the next slot +/** + * Unused. Sets collider as an AC (attack collider) for the current frame, allowing it to detect ATs (attacks). + * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it + * will be inserted into the next slot + */ s32 CollisionCheck_SetAC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index) { - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3153); } if (func_800C0D28(globalCtx) == 1) { return -1; } - D_8011DF08[collider->shape](globalCtx, collider); + sACResetFuncs[collider->shape](globalCtx, collider); if (collider->actor != NULL && collider->actor->update == NULL) { return -1; } if (colChkCtx->sacFlags & 1) { - if (!(index < colChkCtx->colAcCount)) { + if (!(index < colChkCtx->colACCount)) { + // You are trying to register a location that is larger than the total number of data. osSyncPrintf("CollisionCheck_setAC_SAC():全データ数より大きいところに登録しようとしている。\n"); - // EUC-JP: 全データ数より大きいところに登録しようとしている。| You are trying to register a location that is - // larger than the total number of data. return -1; } - colChkCtx->colAc[index] = collider; + colChkCtx->colAC[index] = collider; } else { - if (!(colChkCtx->colAcCount < COLLISION_CHECK_AC_MAX)) { + if (!(colChkCtx->colACCount < COLLISION_CHECK_AC_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } - index = colChkCtx->colAcCount; - colChkCtx->colAc[colChkCtx->colAcCount++] = collider; + index = colChkCtx->colACCount; + colChkCtx->colAC[colChkCtx->colACCount++] = collider; } return index; } -s32 (*D_8011DF18[])(GlobalContext*, Collider*) = { - Collider_JntSphSetOC, - Collider_CylinderSetOC, - Collider_TrisSetOC, - Collider_QuadSetOC, +static ColChkResetFunc sOCResetFuncs[] = { + Collider_ResetJntSphOC, + Collider_ResetCylinderOC, + Collider_ResetTrisOC, + Collider_ResetQuadOC, }; -// Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs +/** + * Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs + * The last argument takes a Collider, so pass collider.base rather than the raw collider. + */ s32 CollisionCheck_SetOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3229); } - D_8011DF18[collider->shape](globalCtx, collider); - if (collider->actor != NULL) { - if (collider->actor->update == NULL) { - return -1; - } + sOCResetFuncs[collider->shape](globalCtx, collider); + if (collider->actor != NULL && collider->actor->update == NULL) { + return -1; } - if (colChkCtx->colOcCount >= COLLISION_CHECK_OC_MAX) { + if (colChkCtx->colOCCount >= COLLISION_CHECK_OC_MAX) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } if (colChkCtx->sacFlags & 1) { return -1; } - index = colChkCtx->colOcCount; - colChkCtx->colOc[colChkCtx->colOcCount++] = collider; + index = colChkCtx->colOCCount; + colChkCtx->colOC[colChkCtx->colOCCount++] = collider; return index; } -// Unused. Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs -// If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it -// will be inserted into the next slot +/** + * Unused. Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs + * If CollisionCheck_SAC is enabled, the collider will be inserted into the list at the specified index, otherwise it + * will be inserted into the next slot + */ s32 CollisionCheck_SetOC_SAC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, s32 index) { if (func_800C0D28(globalCtx) == 1) { return -1; } - if (!(collider->shape < COLSHAPE_INVALID)) { + if (!(collider->shape <= COLSHAPE_QUAD)) { __assert("pcl_obj->data_type <= CL_DATA_LBL_SWRD", "../z_collision_check.c", 3274); } - D_8011DF18[collider->shape](globalCtx, collider); + sOCResetFuncs[collider->shape](globalCtx, collider); if (collider->actor != NULL && collider->actor->update == NULL) { return -1; } if (colChkCtx->sacFlags & 1) { - if (!(index < colChkCtx->colOcCount)) { + if (!(index < colChkCtx->colOCCount)) { + // You are trying to register a location that is larger than the total number of data. osSyncPrintf("CollisionCheck_setOC_SAC():全データ数より大きいところに登録しようとしている。\n"); - // EUC-JP: 全データ数より大きいところに登録しようとしている。| You are trying to register a location that is - // larger than the total number of data. return -1; } - //! @bug Should be colOc - colChkCtx->colAt[index] = collider; + //! @bug Should be colOC + colChkCtx->colAT[index] = collider; } else { - if (!(colChkCtx->colOcCount < COLLISION_CHECK_OC_MAX)) { + if (!(colChkCtx->colOCCount < COLLISION_CHECK_OC_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); - // EUC-JP: インデックスがオーバして追加不能 | Index exceeded and cannot be added return -1; } - index = colChkCtx->colOcCount; - colChkCtx->colOc[colChkCtx->colOcCount++] = collider; + index = colChkCtx->colOCCount; + colChkCtx->colOC[colChkCtx->colOCCount++] = collider; } return index; } +/** + * Sets a line as an OC collider for this frame. + * OC lines are entirely unused, and do not even have collision check functions. + */ s32 CollisionCheck_SetOCLine(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, OcLine* collider) { s32 index; if (func_800C0D28(globalCtx) == 1) { return -1; } - func_8005D3A4(globalCtx, collider); - if (!(colChkCtx->colOcLineCount < COLLISION_CHECK_OC_LINE_MAX)) { + Collider_ResetLineOC(globalCtx, collider); + if (!(colChkCtx->colLineCount < COLLISION_CHECK_OC_LINE_MAX)) { + // Index exceeded and cannot add more osSyncPrintf("CollisionCheck_setOCLine():インデックスがオーバして追加不能\n"); return -1; } - index = colChkCtx->colOcLineCount; - colChkCtx->colOcLine[colChkCtx->colOcLineCount++] = collider; + index = colChkCtx->colLineCount; + colChkCtx->colLine[colChkCtx->colLineCount++] = collider; return index; } -s32 func_8005DF2C(ColliderBody* body) { - if (!(body->toucherFlags & 1)) { +/** + * Skips AT elements that are off. + */ +s32 CollisionCheck_SkipTouch(ColliderInfo* info) { + if (!(info->toucherFlags & TOUCH_ON)) { return 1; } return 0; } -s32 func_8005DF50(ColliderBody* body) { - if (!(body->bumperFlags & 1)) { +/** + * Skips AC elements that are off. + */ +s32 CollisionCheck_SkipBump(ColliderInfo* info) { + if (!(info->bumperFlags & BUMP_ON)) { return 1; } return 0; } -s32 func_8005DF74(ColliderBody* left, ColliderBody* right) { - if (!(left->toucher.flags & right->bumper.flags)) { +/** + * If the AT element has no dmgFlags in common with the AC element, no collision happens. + */ +s32 CollisionCheck_NoSharedFlags(ColliderInfo* atInfo, ColliderInfo* acInfo) { + if (!(atInfo->toucher.dmgFlags & acInfo->bumper.dmgFlags)) { return 1; } return 0; } -void func_8005DF9C(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { +/** + * Spawns no blood drops. + * Used by collider types HIT1, HIT3, HIT5, METAL, NONE, WOOD, HARD, and TREE + */ +void CollisionCheck_NoBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { } -// Blue EffectSpark -void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { +/** + * Spawns blue blood drops. + * Used by collider types HIT0 and HIT8. + */ +void CollisionCheck_BlueBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { static EffectSparkInit D_8015D8A0; - s32 sp24; + s32 effectIndex; - D_8015D8A0.position.x = (s32)pos->x; - D_8015D8A0.position.y = (s32)pos->y; - D_8015D8A0.position.z = (s32)pos->z; + D_8015D8A0.position.x = v->x; + D_8015D8A0.position.y = v->y; + D_8015D8A0.position.z = v->z; D_8015D8A0.uDiv = 5; D_8015D8A0.vDiv = 5; D_8015D8A0.colorStart[0].r = 10; @@ -1328,17 +1506,20 @@ void func_8005DFAC(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { D_8015D8A0.speed = 8.0f; D_8015D8A0.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015D8A0); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015D8A0); } -// Green EffectSpark -void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { +/** + * Spawns green blood drops. + * Used by collider types HIT2 and HIT6. No actor has type HIT2. + */ +void CollisionCheck_GreenBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { static EffectSparkInit D_8015DD68; - s32 sp24; + s32 effectIndex; - D_8015DD68.position.x = (s32)pos->x; - D_8015DD68.position.y = (s32)pos->y; - D_8015DD68.position.z = (s32)pos->z; + D_8015DD68.position.x = v->x; + D_8015DD68.position.y = v->y; + D_8015DD68.position.z = v->z; D_8015DD68.uDiv = 5; D_8015DD68.vDiv = 5; D_8015DD68.colorStart[0].r = 10; @@ -1378,505 +1559,245 @@ void func_8005E10C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { D_8015DD68.speed = 8.0f; D_8015DD68.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015DD68); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015DD68); } -void func_8005E26C(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { +/** + * Spawns a burst of water. + * Used by collider type HIT4, which no actor has. + */ +void CollisionCheck_WaterBurst(GlobalContext* globalCtx, Collider* collider, Vec3f* pos) { EffectSsSibuki_SpawnBurst(globalCtx, pos); - func_80062B80(globalCtx, pos); + CollisionCheck_SpawnWaterDroplets(globalCtx, pos); } -void func_8005E2A4(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { - func_80062A28(globalCtx, v); +/** + * Spawns red blood drops. + * Used by collider type HIT7, which no actor has. + */ +void CollisionCheck_RedBlood(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { + CollisionCheck_SpawnRedBlood(globalCtx, v); } -void func_8005E2C8(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { - func_80062A28(globalCtx, v); +/** + * Spawns red blood drops. + * Unused. + */ +void CollisionCheck_RedBloodUnused(GlobalContext* globalCtx, Collider* collider, Vec3f* v) { + CollisionCheck_SpawnRedBlood(globalCtx, v); } -void func_8005E2EC(GlobalContext* globalCtx, ColliderBody* colliderBody, Collider* collider, Vec3f* arg3) { +/** + * Plays sound effects and displays hitmarks for solid-type AC colliders (METAL, WOOD, HARD, and TREE) + */ +void CollisionCheck_HitSolid(GlobalContext* globalCtx, ColliderInfo* info, Collider* collider, Vec3f* hitPos) { s32 flags; - flags = colliderBody->toucherFlags & 0x18; - if (flags == 0 && collider->type != COLTYPE_METAL_SHIELD) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 0, arg3); + flags = info->toucherFlags & TOUCH_SFX_NONE; + if (flags == TOUCH_SFX_NORMAL && collider->colType != COLTYPE_METAL) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - return; + } else { + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); } - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - return; - } - if (flags == 0) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 3, arg3); + } else if (flags == TOUCH_SFX_NORMAL) { // collider->colType == COLTYPE_METAL + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_METAL, hitPos); if (collider->actor == NULL) { - func_80062D60(globalCtx, arg3); - return; + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, hitPos); + } else { + CollisionCheck_SpawnShieldParticlesMetalSound(globalCtx, hitPos, &collider->actor->projectedPos); } - func_80062DAC(globalCtx, arg3, &collider->actor->projectedPos); - return; - } - if (flags == 8) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 0, arg3); + } else if (flags == TOUCH_SFX_HARD) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_WHITE, hitPos); if (collider->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - return; + } else { + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); } - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - return; - } - if (flags == 0x10) { - EffectSsHitMark_SpawnFixedScale(globalCtx, 1, arg3); + } else if (flags == TOUCH_SFX_WOOD) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_DUST, hitPos); if (collider->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - return; + } else { + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - return; } } -s32 func_8005E4F8(Collider* left, ColliderBody* rightBody) { - if (left->actor != NULL) { - if (ACTORTYPE_PLAYER == left->actor->type) { - if (rightBody->flags == 0) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - } else if (rightBody->flags == 1) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &left->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - } else if (rightBody->flags == 2) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - } else if (rightBody->flags == 3) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0, - &D_801333E0, &D_801333E8); - } +/** + * Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemType. + */ +s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) { + if (at->actor != NULL && at->actor->type == ACTORTYPE_PLAYER) { + if (acInfo->elemType == ELEMTYPE_UNK0) { + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else if (acInfo->elemType == ELEMTYPE_UNK1) { + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + &D_801333E8); + } else if (acInfo->elemType == ELEMTYPE_UNK2) { + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } else if (acInfo->elemType == ELEMTYPE_UNK3) { + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &at->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } } return 1; } -typedef struct { - u8 unk00; - u8 unk01; -} D_8011DF40_s; +static ColChkBloodFunc sBloodFuncs[] = { + CollisionCheck_NoBlood, CollisionCheck_BlueBlood, CollisionCheck_GreenBlood, + CollisionCheck_WaterBurst, CollisionCheck_RedBlood, CollisionCheck_RedBloodUnused, +}; +static HitInfo sHitInfo[] = { + { BLOOD_BLUE, HIT_WHITE }, { BLOOD_NONE, HIT_DUST }, { BLOOD_GREEN, HIT_DUST }, { BLOOD_NONE, HIT_WHITE }, + { BLOOD_WATER, HIT_NONE }, { BLOOD_NONE, HIT_RED }, { BLOOD_GREEN, HIT_WHITE }, { BLOOD_RED, HIT_WHITE }, + { BLOOD_BLUE, HIT_RED }, { BLOOD_NONE, HIT_SOLID }, { BLOOD_NONE, HIT_NONE }, { BLOOD_NONE, HIT_SOLID }, + { BLOOD_NONE, HIT_SOLID }, { BLOOD_NONE, HIT_WOOD }, +}; -void func_8005E604(GlobalContext* globalCtx, Collider* left, ColliderBody* leftBody, Collider* right, - ColliderBody* rightBody, Vec3f* arg5) { - - static void (*D_8011DF28[])(GlobalContext*, Collider*, Vec3f*) = { - func_8005DF9C, func_8005DFAC, func_8005E10C, func_8005E26C, func_8005E2A4, func_8005E2C8, - }; - - static D_8011DF40_s D_8011DF40[] = { - { 1, 0 }, { 0, 1 }, { 2, 1 }, { 0, 0 }, { 3, 5 }, { 0, 2 }, { 2, 0 }, - { 4, 0 }, { 1, 2 }, { 0, 3 }, { 0, 5 }, { 0, 3 }, { 0, 3 }, { 0, 4 }, - }; - - if (rightBody->bumperFlags & 0x40) { +/** + * Handles hitmarks, blood, and sound effects for each AC collision, determined by the AC collider's colType + */ +void CollisionCheck_HitEffects(GlobalContext* globalCtx, Collider* at, ColliderInfo* atInfo, Collider* ac, + ColliderInfo* acInfo, Vec3f* hitPos) { + if (acInfo->bumperFlags & BUMP_NO_HITMARK) { return; } - if (!(leftBody->toucherFlags & 0x20) && leftBody->toucherFlags & 0x40) { + if (!(atInfo->toucherFlags & TOUCH_AT_HITMARK) && atInfo->toucherFlags & TOUCH_DREW_HITMARK) { return; } - if (right->actor != NULL) { - (*D_8011DF28[D_8011DF40[right->type].unk00])(globalCtx, right, arg5); + if (ac->actor != NULL) { + sBloodFuncs[sHitInfo[ac->colType].blood](globalCtx, ac, hitPos); } - if (right->actor != NULL) { - if (D_8011DF40[right->type].unk01 == 3) { - func_8005E2EC(globalCtx, leftBody, right, arg5); - } else if (D_8011DF40[right->type].unk01 == 4) { - if (left->actor == NULL) { - func_80062CD4(globalCtx, arg5); + if (ac->actor != NULL) { + if (sHitInfo[ac->colType].effect == HIT_SOLID) { + CollisionCheck_HitSolid(globalCtx, atInfo, ac, hitPos); + } else if (sHitInfo[ac->colType].effect == HIT_WOOD) { + if (at->actor == NULL) { + CollisionCheck_SpawnShieldParticles(globalCtx, hitPos); Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { - func_80062E14(globalCtx, arg5, &left->actor->projectedPos); + CollisionCheck_SpawnShieldParticlesWood(globalCtx, hitPos, &at->actor->projectedPos); } - } else if (D_8011DF40[right->type].unk01 != 5) { - EffectSsHitMark_SpawnFixedScale(globalCtx, D_8011DF40[right->type].unk01, arg5); - if ((rightBody->bumperFlags & 0x20) == 0) { - func_8005E4F8(left, rightBody); + } else if (sHitInfo[ac->colType].effect != HIT_NONE) { + EffectSsHitMark_SpawnFixedScale(globalCtx, sHitInfo[ac->colType].effect, hitPos); + if (!(acInfo->bumperFlags & BUMP_NO_SWORD_SFX)) { + CollisionCheck_SwordHitAudio(at, acInfo); } } } else { - EffectSsHitMark_SpawnFixedScale(globalCtx, 0, arg5); - if (right->actor == NULL) { + EffectSsHitMark_SpawnFixedScale(globalCtx, EFFECT_HITMARK_WHITE, hitPos); + if (ac->actor == NULL) { Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &right->actor->projectedPos, 4, &D_801333E0, &D_801333E0, + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_BOUND, &ac->actor->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } } -void func_8005E800(Collider* left, Collider* right) { - left->atFlags |= 4; - right->acFlags |= 0x80; +/** + * Sets the flags to indicate an attack bounced off an AC_HARD collider. + */ +void CollisionCheck_SetBounce(Collider* at, Collider* ac) { + at->atFlags |= AT_BOUNCED; + ac->acFlags |= AC_BOUNCED; } -// Set AT to AC collision -s32 func_8005E81C(GlobalContext* globalCtx, Collider* left, ColliderBody* leftBody, Vec3f* leftv, Collider* right, - ColliderBody* rightBody, Vec3f* rightv, Vec3f* arg7) { +/** + * Performs the AC collision between the AT element and AC element that collided. + */ +s32 CollisionCheck_SetATvsAC(GlobalContext* globalCtx, Collider* at, ColliderInfo* atInfo, Vec3f* atPos, Collider* ac, + ColliderInfo* acInfo, Vec3f* acPos, Vec3f* hitPos) { - if (right->acFlags & 4 && left->actor != NULL && right->actor != NULL) { - func_8005E800(left, right); + if (ac->acFlags & AC_HARD && at->actor != NULL && ac->actor != NULL) { + CollisionCheck_SetBounce(at, ac); } - if (!(rightBody->bumperFlags & 8)) { - left->atFlags |= 2; - left->at = right->actor; - leftBody->atHit = right; - leftBody->atHitItem = rightBody; - leftBody->toucherFlags |= 2; - if (left->actor != NULL) { - left->actor->colChkInfo.atHitEffect = rightBody->bumper.effect; + if (!(acInfo->bumperFlags & BUMP_NO_AT_INFO)) { + at->atFlags |= AT_HIT; + at->at = ac->actor; + atInfo->atHit = ac; + atInfo->atHitInfo = acInfo; + atInfo->toucherFlags |= TOUCH_HIT; + if (at->actor != NULL) { + at->actor->colChkInfo.atHitEffect = acInfo->bumper.effect; } } - right->acFlags |= 2; - right->ac = left->actor; - rightBody->acHit = left; - rightBody->acHitItem = leftBody; - rightBody->bumperFlags |= 2; - if (right->actor != NULL) { - right->actor->colChkInfo.acHitEffect = leftBody->toucher.effect; + ac->acFlags |= AC_HIT; + ac->ac = at->actor; + acInfo->acHit = at; + acInfo->acHitInfo = atInfo; + acInfo->bumperFlags |= BUMP_HIT; + if (ac->actor != NULL) { + ac->actor->colChkInfo.acHitEffect = atInfo->toucher.effect; } - rightBody->bumper.unk_06.x = (s16)arg7->x; - rightBody->bumper.unk_06.y = (s16)arg7->y; - rightBody->bumper.unk_06.z = (s16)arg7->z; - if (!(leftBody->toucherFlags & 0x20) && right->type != COLTYPE_METAL_SHIELD && - right->type != COLTYPE_WOODEN_SHIELD && right->type != COLTYPE_UNK12) { - rightBody->bumperFlags |= 0x80; + acInfo->bumper.hitPos.x = hitPos->x; + acInfo->bumper.hitPos.y = hitPos->y; + acInfo->bumper.hitPos.z = hitPos->z; + if (!(atInfo->toucherFlags & TOUCH_AT_HITMARK) && ac->colType != COLTYPE_METAL && ac->colType != COLTYPE_WOOD && + ac->colType != COLTYPE_HARD) { + acInfo->bumperFlags |= BUMP_DRAW_HITMARK; } else { - func_8005E604(globalCtx, left, leftBody, right, rightBody, arg7); - leftBody->toucherFlags |= 0x40; + CollisionCheck_HitEffects(globalCtx, at, atInfo, ac, acInfo, hitPos); + atInfo->toucherFlags |= TOUCH_DREW_HITMARK; } return 1; } -void CollisionCheck_AC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left; - ColliderJntSph* right; - ColliderJntSphItem* lItem; - ColliderJntSphItem* rItem; - f32 sp8C; - f32 sp88; - f32 temp_f0; - Vec3f sp78; - Vec3f sp6C; - Vec3f sp60; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderJntSphElement* atItem; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + ColliderJntSphElement* acElem; + f32 overlapSize; + f32 centerDist; - left = (ColliderJntSph*)l; - right = (ColliderJntSph*)r; - if (left->count <= 0 || left->list == NULL || right->count <= 0 || right->list == NULL) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + if (at->count > 0 && at->elements != NULL && ac->count > 0 && ac->elements != NULL) { + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { continue; } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { - continue; - } - if (Math3D_SphVsSphOverlapCenter(&lItem->dim.worldSphere, &rItem->dim.worldSphere, &sp8C, &sp88) == 1) { - sp6C.x = lItem->dim.worldSphere.center.x; - sp6C.y = lItem->dim.worldSphere.center.y; - sp6C.z = lItem->dim.worldSphere.center.z; - sp60.x = rItem->dim.worldSphere.center.x; - sp60.y = rItem->dim.worldSphere.center.y; - sp60.z = rItem->dim.worldSphere.center.z; - if (!IS_ZERO(sp88)) { - temp_f0 = rItem->dim.worldSphere.radius / sp88; - sp78.x = (((sp6C.x - sp60.x) * temp_f0) + sp60.x); - sp78.y = (((sp6C.y - sp60.y) * temp_f0) + sp60.y); - sp78.z = (((sp6C.z - sp60.z) * temp_f0) + sp60.z); - } else { - Math_Vec3f_Copy(&sp78, &sp6C); - } - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp6C, &right->base, &rItem->body, &sp60, &sp78); - if (!(right->base.maskB & 0x40)) { - return; - } - } - } - } -} - -void CollisionCheck_AC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left = (ColliderJntSph*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - ColliderJntSphItem* lItem; - f32 sp80; - f32 sp7C; - Vec3f sp70; - Vec3f sp64; - Vec3f sp58; - f32 temp_f0; - - if (left->count <= 0 || left->list == NULL || right->dim.radius <= 0 || right->dim.height <= 0) { - return; - } - if (func_8005DF50(&right->body) == 1) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &right->body) == 1) { - continue; - } - if (Math3D_SphVsCylOverlapCenterDist(&lItem->dim.worldSphere, &right->dim, &sp80, &sp7C) != 0) { - sp64.x = lItem->dim.worldSphere.center.x; - sp64.y = lItem->dim.worldSphere.center.y; - sp64.z = lItem->dim.worldSphere.center.z; - sp58.x = right->dim.pos.x; - sp58.y = right->dim.pos.y; - sp58.z = right->dim.pos.z; - if (!IS_ZERO(sp7C)) { - temp_f0 = right->dim.radius / sp7C; - if (temp_f0 <= 1.0f) { - sp70.x = ((sp64.x - sp58.x) * temp_f0) + sp58.x; - sp70.y = ((sp64.y - sp58.y) * temp_f0) + sp58.y; - sp70.z = ((sp64.z - sp58.z) * temp_f0) + sp58.z; - } else { - Math_Vec3f_Copy(&sp70, &sp64); - } - } else { - Math_Vec3f_Copy(&sp70, &sp64); - } - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp64, &right->base, &right->body, &sp58, &sp70); - return; - } - } -} - -void CollisionCheck_AC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderJntSph* right = (ColliderJntSph*)r; - f32 sp9C; - f32 sp98; - ColliderJntSphItem* rItem; - Vec3f sp88; - Vec3f sp7C; - Vec3f sp70; - f32 temp_f0; - - if (right->count <= 0 || right->list == NULL || left->dim.radius <= 0 || left->dim.height <= 0) { - return; - } - if (func_8005DF2C(&left->body) == 1) { - return; - } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&left->body, &rItem->body) == 1) { - continue; - } - if (Math3D_SphVsCylOverlapCenterDist(&rItem->dim.worldSphere, &left->dim, &sp9C, &sp98) != 0) { - sp7C.x = left->dim.pos.x; - sp7C.y = left->dim.pos.y; - sp7C.z = left->dim.pos.z; - sp70.x = rItem->dim.worldSphere.center.x; - sp70.y = rItem->dim.worldSphere.center.y; - sp70.z = rItem->dim.worldSphere.center.z; - if (!IS_ZERO(sp98)) { - temp_f0 = (f32)rItem->dim.worldSphere.radius / sp98; - if (temp_f0 <= 1.0f) { - sp88.x = ((sp7C.x - sp70.x) * temp_f0) + sp70.x; - sp88.y = ((sp7C.y - sp70.y) * temp_f0) + sp70.y; - sp88.z = ((sp7C.z - sp70.z) * temp_f0) + sp70.z; - } else { - Math_Vec3f_Copy(&sp88, &sp7C); - } - } else { - Math_Vec3f_Copy(&sp88, &sp7C); - } - func_8005E81C(globalCtx, &left->base, &left->body, &sp7C, &right->base, &rItem->body, &sp70, &sp88); - if (!(right->base.maskB & 0x40)) { - break; - } - } - } -} - -void CollisionCheck_AC_JntSphVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left = (ColliderJntSph*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderJntSphItem* lItem; - ColliderTrisItem* rItem; - Vec3f sp6C; - Vec3f sp60; - Vec3f sp54; - - if (left->count <= 0 || left->list == NULL || right->count <= 0 || right->list == NULL) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&lItem->dim.worldSphere, &rItem->dim, &sp6C) == 1) { - sp60.x = lItem->dim.worldSphere.center.x; - sp60.y = lItem->dim.worldSphere.center.y; - sp60.z = lItem->dim.worldSphere.center.z; - sp54.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp54.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp54.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp60, &right->base, &rItem->body, &sp54, &sp6C); - return; - } - } - } -} - -void CollisionCheck_AC_TrisVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderTrisItem* lItem; - ColliderJntSph* right = (ColliderJntSph*)r; - ColliderJntSphItem* rItem; - Vec3f sp7C; - Vec3f sp70; - Vec3f sp64; - - if (right->count > 0 && right->list != NULL) { - if (left->count > 0 && left->list != NULL) { - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { continue; } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; + if (CollisionCheck_NoSharedFlags(&atItem->info, &acElem->info) == 1) { + continue; + } + if (Math3D_SphVsSphOverlapCenter(&atItem->dim.worldSphere, &acElem->dim.worldSphere, &overlapSize, + ¢erDist) == 1) { + f32 acToHit; + Vec3f hitPos; + Vec3f atPos; + Vec3f acPos; + + atPos.x = atItem->dim.worldSphere.center.x; + atPos.y = atItem->dim.worldSphere.center.y; + atPos.z = atItem->dim.worldSphere.center.z; + acPos.x = acElem->dim.worldSphere.center.x; + acPos.y = acElem->dim.worldSphere.center.y; + acPos.z = acElem->dim.worldSphere.center.z; + if (!IS_ZERO(centerDist)) { + acToHit = acElem->dim.worldSphere.radius / centerDist; + hitPos.x = (((atPos.x - acPos.x) * acToHit) + acPos.x); + hitPos.y = (((atPos.y - acPos.y) * acToHit) + acPos.y); + hitPos.z = (((atPos.z - acPos.z) * acToHit) + acPos.z); + } else { + Math_Vec3f_Copy(&hitPos, &atPos); } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&rItem->dim.worldSphere, &lItem->dim, &sp7C) == 1) { - Math_Vec3s_ToVec3f(&sp64, &rItem->dim.worldSphere.center); - sp70.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp70.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp70.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp70, &right->base, &rItem->body, &sp64, - &sp7C); - if (!(right->base.maskB & 0x40)) { - return; - } - } - } - } - } - } -} - -static TriNorm D_8015E230; -static TriNorm D_8015E268; - -void CollisionCheck_AC_JntSphVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* left = (ColliderJntSph*)l; - ColliderQuad* right = (ColliderQuad*)r; - Vec3f sp7C; - ColliderJntSphItem* lItem; - Vec3f sp6C; - Vec3f sp60; - - if (left->count > 0 && left->list != NULL) { - if (func_8005DF50(&right->body) == 1) { - return; - } - Math3D_TriNorm(&D_8015E230, &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E268, &right->dim.quad[1], &right->dim.quad[0], &right->dim.quad[2]); - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &right->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&lItem->dim.worldSphere, &D_8015E230, &sp7C) == 1 || - Math3D_TriVsSphIntersect(&lItem->dim.worldSphere, &D_8015E268, &sp7C) == 1) { - Math_Vec3s_ToVec3f(&sp6C, &lItem->dim.worldSphere.center); - - sp60.x = - (right->dim.quad[0].x + (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp60.y = - (right->dim.quad[0].y + (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp60.z = - (right->dim.quad[0].z + (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp6C, &right->base, &right->body, &sp60, &sp7C); - return; - } - } - } -} - -static TriNorm D_8015E2A0; -static TriNorm D_8015E2D8; - -void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderJntSph* right = (ColliderJntSph*)r; - Vec3f sp88; - ColliderQuad* left = (ColliderQuad*)l; - ColliderJntSphItem* rItem; - Vec3f sp74; - Vec3f sp68; - - if (right->count > 0 && right->list != NULL) { - if (func_8005DF2C(&left->body) != 1) { - Math3D_TriNorm(&D_8015E2A0, &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E2D8, &left->dim.quad[2], &left->dim.quad[1], &left->dim.quad[0]); - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&left->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsSphIntersect(&rItem->dim.worldSphere, &D_8015E2A0, &sp88) != 1 && - Math3D_TriVsSphIntersect(&rItem->dim.worldSphere, &D_8015E2D8, &sp88) != 1) { - continue; - } - if (func_8005D218(globalCtx, left, &sp88) != 0) { - sp68.x = rItem->dim.worldSphere.center.x; - sp68.y = rItem->dim.worldSphere.center.y; - sp68.z = rItem->dim.worldSphere.center.z; - - sp74.x = - (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp74.y = - (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp74.z = - (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp74, &right->base, &rItem->body, &sp68, &sp88); - if ((right->base.maskB & 0x40) == 0) { + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &acElem->info, + &acPos, &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { return; } } @@ -1885,152 +1806,453 @@ void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckCont } } -void CollisionCheck_AC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - f32 sp6C; - f32 sp68; - Vec3f sp5C; - Vec3f sp50; - Vec3f sp44; - f32 temp_f0; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderJntSphElement* atItem; + ColliderCylinder* ac = (ColliderCylinder*)colAC; + f32 overlapSize; + f32 centerDist; - if (left->dim.radius <= 0 || left->dim.height <= 0 || right->dim.radius <= 0 || right->dim.height <= 0) { - return; - } - if (func_8005DF50(&right->body) == 1) { - return; - } - if (func_8005DF2C(&left->body) == 1) { - return; - } - if (func_8005DF74(&left->body, &right->body) == 1) { - return; - } - if (Math3D_CylOutsideCylDist(&left->dim, &right->dim, &sp6C, &sp68) == 1) { - Math_Vec3s_ToVec3f(&sp50, &left->dim.pos); - Math_Vec3s_ToVec3f(&sp44, &right->dim.pos); - if (!IS_ZERO(sp68)) { - temp_f0 = (f32)right->dim.radius / sp68; - sp5C.y = (f32)right->dim.pos.y + (f32)right->dim.yShift + (f32)right->dim.height * 0.5f; - sp5C.x = ((f32)left->dim.pos.x - right->dim.pos.x) * temp_f0 + right->dim.pos.x; - sp5C.z = ((f32)left->dim.pos.z - right->dim.pos.z) * temp_f0 + right->dim.pos.z; - } else { - Math_Vec3s_ToVec3f(&sp5C, &right->dim.pos); - } - func_8005E81C(globalCtx, &left->base, &left->body, &sp50, &right->base, &right->body, &sp44, &sp5C); - } -} - -void CollisionCheck_AC_CylVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderTrisItem* rItem; - Vec3f sp68; - Vec3f sp5C; - Vec3f sp50; - - if (left->dim.radius > 0 && left->dim.height > 0 && right->count > 0 && right->list != NULL) { - if (func_8005DF2C(&left->body) == 1) { + if (at->count > 0 && at->elements != NULL && ac->dim.radius > 0 && ac->dim.height > 0) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { return; } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { continue; } - if (func_8005DF74(&left->body, &rItem->body) == 1) { + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { continue; } - if (Math3D_CylTriVsIntersect(&left->dim, &rItem->dim, &sp68) == 1) { - Math_Vec3s_ToVec3f(&sp5C, &left->dim.pos); + if (Math3D_SphVsCylOverlapCenterDist(&atItem->dim.worldSphere, &ac->dim, &overlapSize, ¢erDist)) { + Vec3f hitPos; + Vec3f atPos; + Vec3f acPos; + f32 acToHit; - sp50.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp50.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp50.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &left->body, &sp5C, &right->base, &rItem->body, &sp50, &sp68); + atPos.x = atItem->dim.worldSphere.center.x; + atPos.y = atItem->dim.worldSphere.center.y; + atPos.z = atItem->dim.worldSphere.center.z; + acPos.x = ac->dim.pos.x; + acPos.y = ac->dim.pos.y; + acPos.z = ac->dim.pos.z; + if (!IS_ZERO(centerDist)) { + acToHit = ac->dim.radius / centerDist; + if (acToHit <= 1.0f) { + hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; + hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; + hitPos.z = ((atPos.z - acPos.z) * acToHit) + acPos.z; + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &hitPos); return; } } } } -static Vec3f D_8015E310; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + f32 overlapSize; + f32 centerDist; + ColliderJntSphElement* acElem; -void CollisionCheck_AC_TrisVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - ColliderTrisItem* lItem; - Vec3f sp60; - Vec3f sp54; - - if (right->dim.radius > 0 && right->dim.height > 0 && left->count > 0 && left->list != NULL) { - if (func_8005DF50(&right->body) == 1) { + if (ac->count > 0 && ac->elements != NULL && at->dim.radius > 0 && at->dim.height > 0) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { return; } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { continue; } - if (func_8005DF74(&lItem->body, &right->body) == 1) { + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { continue; } + if (Math3D_SphVsCylOverlapCenterDist(&acElem->dim.worldSphere, &at->dim, &overlapSize, ¢erDist)) { + Vec3f hitPos; + Vec3f atPos; + Vec3f acPos; + f32 acToHit; - if (Math3D_CylTriVsIntersect(&right->dim, &lItem->dim, &D_8015E310) == 1) { - sp60.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp60.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp60.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - Math_Vec3s_ToVec3f(&sp54, &right->dim.pos); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp60, &right->base, &right->body, &sp54, - &D_8015E310); + atPos.x = at->dim.pos.x; + atPos.y = at->dim.pos.y; + atPos.z = at->dim.pos.z; + acPos.x = acElem->dim.worldSphere.center.x; + acPos.y = acElem->dim.worldSphere.center.y; + acPos.z = acElem->dim.worldSphere.center.z; + if (!IS_ZERO(centerDist)) { + acToHit = acElem->dim.worldSphere.radius / centerDist; + if (acToHit <= 1.0f) { + hitPos.x = ((atPos.x - acPos.x) * acToHit) + acPos.x; + hitPos.y = ((atPos.y - acPos.y) * acToHit) + acPos.y; + hitPos.z = ((atPos.z - acPos.z) * acToHit) + acPos.z; + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + } else { + Math_Vec3f_Copy(&hitPos, &atPos); + } + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, + &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { + break; + } + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderJntSphElement* atSph; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acTri; + Vec3f hitPos; + + if (at->count > 0 && at->elements != NULL && ac->count > 0 && ac->elements != NULL) { + for (atSph = at->elements; atSph < at->elements + at->count; atSph++) { + if (CollisionCheck_SkipTouch(&atSph->info) == 1) { + continue; + } + for (acTri = ac->elements; acTri < ac->elements + ac->count; acTri++) { + if (CollisionCheck_SkipBump(&acTri->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atSph->info, &acTri->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&atSph->dim.worldSphere, &acTri->dim, &hitPos) == 1) { + Vec3f atPos; + Vec3f acPos; + + atPos.x = atSph->dim.worldSphere.center.x; + atPos.y = atSph->dim.worldSphere.center.y; + atPos.z = atSph->dim.worldSphere.center.z; + acPos.x = (acTri->dim.vtx[0].x + acTri->dim.vtx[1].x + acTri->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acTri->dim.vtx[0].y + acTri->dim.vtx[1].y + acTri->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acTri->dim.vtx[0].z + acTri->dim.vtx[1].z + acTri->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atSph->info, &atPos, &ac->base, &acTri->info, + &acPos, &hitPos); + return; + } + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + ColliderJntSphElement* acElem; + Vec3f hitPos; + + if (ac->count > 0 && ac->elements != NULL && at->count > 0 && at->elements != NULL) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &acElem->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &atItem->dim, &hitPos) == 1) { + Vec3f atPos; + Vec3f acPos; + + Math_Vec3s_ToVec3f(&acPos, &acElem->dim.worldSphere.center); + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &acElem->info, + &acPos, &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { + return; + } + } + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_JntSphVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E230; + static TriNorm D_8015E268; + ColliderJntSph* at = (ColliderJntSph*)colAT; + ColliderQuad* ac = (ColliderQuad*)colAC; + Vec3f hitPos; + ColliderJntSphElement* atItem; + + if (at->count > 0 && at->elements != NULL) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E230, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E268, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&atItem->dim.worldSphere, &D_8015E230, &hitPos) == 1 || + Math3D_TriVsSphIntersect(&atItem->dim.worldSphere, &D_8015E268, &hitPos) == 1) { + Vec3f atPos; + Vec3f acPos; + + Math_Vec3s_ToVec3f(&atPos, &atItem->dim.worldSphere.center); + + acPos.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &hitPos); return; } } } } -static TriNorm D_8015E320; -static TriNorm D_8015E358; -static Vec3f D_8015E390; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E2A0; + static TriNorm D_8015E2D8; + ColliderJntSph* ac = (ColliderJntSph*)colAC; + Vec3f hitPos; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderJntSphElement* acElem; -void CollisionCheck_AC_CylVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderCylinder* left = (ColliderCylinder*)l; - ColliderQuad* right = (ColliderQuad*)r; - Vec3f sp64; - Vec3f sp58; - Vec3f sp4C; - Vec3f sp40; + if (ac->count > 0 && ac->elements != NULL) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E2A0, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E2D8, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]); + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { + continue; + } + if (Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &D_8015E2A0, &hitPos) == 1 || + Math3D_TriVsSphIntersect(&acElem->dim.worldSphere, &D_8015E2D8, &hitPos) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &hitPos)) { + Vec3f atPos; + Vec3f acPos; - if (left->dim.height <= 0 || left->dim.radius <= 0) { - return; + acPos.x = acElem->dim.worldSphere.center.x; + acPos.y = acElem->dim.worldSphere.center.y; + acPos.z = acElem->dim.worldSphere.center.z; + + atPos.x = + (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos.y = + (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos.z = + (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, + &hitPos); + if (!(ac->base.ocFlags2 & OC2_FIRST_ONLY)) { + return; + } + } + } + } } - if (func_8005DF2C(&left->body) == 1 || func_8005DF50(&right->body) == 1) { - return; +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderCylinder* ac = (ColliderCylinder*)colAC; + f32 deadSpace; + f32 centerDistXZ; + Vec3f hitPos; + + if (at->dim.radius > 0 && at->dim.height > 0 && ac->dim.radius > 0 && ac->dim.height > 0) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { + return; + } + if (Math3D_CylOutsideCylDist(&at->dim, &ac->dim, &deadSpace, ¢erDistXZ) == 1) { + Vec3f atPos; + Vec3f acPos; + f32 acToHit; + + Math_Vec3s_ToVec3f(&atPos, &at->dim.pos); + Math_Vec3s_ToVec3f(&acPos, &ac->dim.pos); + if (!IS_ZERO(centerDistXZ)) { + acToHit = ac->dim.radius / centerDistXZ; + hitPos.y = (f32)ac->dim.pos.y + ac->dim.yShift + ac->dim.height * 0.5f; + hitPos.x = ((f32)at->dim.pos.x - ac->dim.pos.x) * acToHit + ac->dim.pos.x; + hitPos.z = ((f32)at->dim.pos.z - ac->dim.pos.z) * acToHit + ac->dim.pos.z; + } else { + Math_Vec3s_ToVec3f(&hitPos, &ac->dim.pos); + } + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, &hitPos); + } } - if (func_8005DF74(&left->body, &right->body) == 1) { - return; +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acElem; + Vec3f hitPos; + + if (at->dim.radius > 0 && at->dim.height > 0 && ac->count > 0 && ac->elements != NULL) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { + continue; + } + if (Math3D_CylTriVsIntersect(&at->dim, &acElem->dim, &hitPos) == 1) { + Vec3f atpos; + Vec3f acPos; + + Math_Vec3s_ToVec3f(&atpos, &at->dim.pos); + + acPos.x = (acElem->dim.vtx[0].x + acElem->dim.vtx[1].x + acElem->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acElem->dim.vtx[0].y + acElem->dim.vtx[1].y + acElem->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acElem->dim.vtx[0].z + acElem->dim.vtx[1].z + acElem->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atpos, &ac->base, &acElem->info, &acPos, + &hitPos); + return; + } + } } - Math3D_TriNorm(&D_8015E320, &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E358, &right->dim.quad[1], &right->dim.quad[0], &right->dim.quad[2]); - if (Math3D_CylTriVsIntersect(&left->dim, &D_8015E320, &D_8015E390) == 1) { - Math_Vec3s_ToVec3f(&sp64, &left->dim.pos); - sp58.x = - (right->dim.quad[0].x + (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * 0.25f; - sp58.y = - (right->dim.quad[0].y + (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * 0.25f; - sp58.z = - (right->dim.quad[0].z + (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * 0.25f; - func_8005E81C(globalCtx, &left->base, &left->body, &sp64, &right->base, &right->body, &sp58, &D_8015E390); - return; +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E310; + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderCylinder* ac = (ColliderCylinder*)colAC; + Vec3f atPos; + Vec3f acPos; + + if (ac->dim.radius > 0 && ac->dim.height > 0 && at->count > 0 && at->elements != NULL) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { + continue; + } + + if (Math3D_CylTriVsIntersect(&ac->dim, &atItem->dim, &D_8015E310) == 1) { + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + Math_Vec3s_ToVec3f(&acPos, &ac->dim.pos); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &D_8015E310); + return; + } + } } - if (Math3D_CylTriVsIntersect(&left->dim, &D_8015E358, &D_8015E390) == 1) { - Math_Vec3s_ToVec3f(&sp4C, &left->dim.pos); - sp40.x = (right->dim.quad[0].x + (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp40.y = (right->dim.quad[0].y + (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp40.z = (right->dim.quad[0].z + (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp4C, &right->base, &right->body, &sp40, &D_8015E390); +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_CylVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E320; + static TriNorm D_8015E358; + static Vec3f D_8015E390; + ColliderCylinder* at = (ColliderCylinder*)colAT; + ColliderQuad* ac = (ColliderQuad*)colAC; + + if (at->dim.height > 0 && at->dim.radius > 0) { + if (CollisionCheck_SkipTouch(&at->info) == 1 || CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E320, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E358, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + if (Math3D_CylTriVsIntersect(&at->dim, &D_8015E320, &D_8015E390) == 1) { + Vec3f atPos1; + Vec3f acPos1; + + Math_Vec3s_ToVec3f(&atPos1, &at->dim.pos); + acPos1.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos1.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos1.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos1, &ac->base, &ac->info, &acPos1, + &D_8015E390); + } else if (Math3D_CylTriVsIntersect(&at->dim, &D_8015E358, &D_8015E390) == 1) { + Vec3f atPos2; + Vec3f acPos2; + + Math_Vec3s_ToVec3f(&atPos2, &at->dim.pos); + acPos2.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos2.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos2.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos2, &ac->base, &ac->info, &acPos2, + &D_8015E390); + } } } @@ -2038,52 +2260,52 @@ static s8 sBssDummy0; static s8 sBssDummy1; static s8 sBssDummy2; -static TriNorm D_8015E3A0; -static TriNorm D_8015E3D8; -static Vec3f D_8015E410; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E3A0; + static TriNorm D_8015E3D8; + static Vec3f D_8015E410; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderCylinder* ac = (ColliderCylinder*)colAC; -void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { - ColliderQuad* left = (ColliderQuad*)l; - ColliderCylinder* right = (ColliderCylinder*)r; - Vec3f sp64; - Vec3f sp58; - Vec3f sp4C; - Vec3f sp40; - - if (right->dim.height <= 0 || right->dim.radius <= 0) { - return; - } - if (func_8005DF50(&right->body) == 1 || func_8005DF2C(&left->body) == 1) { - return; - } - if (func_8005DF74(&left->body, &right->body) == 1) { - return; - } - Math3D_TriNorm(&D_8015E3A0, &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E3D8, &left->dim.quad[2], &left->dim.quad[1], &left->dim.quad[0]); - if (Math3D_CylTriVsIntersect(&right->dim, &D_8015E3A0, &D_8015E410) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E410) != 0) { - sp64.x = (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp64.y = (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp64.z = (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - Math_Vec3s_ToVec3f(&sp58, &right->dim.pos); - func_8005E81C(globalCtx, &left->base, &left->body, &sp64, &right->base, &right->body, &sp58, &D_8015E410); + if (ac->dim.height > 0 && ac->dim.radius > 0) { + if (CollisionCheck_SkipBump(&ac->info) == 1 || CollisionCheck_SkipTouch(&at->info) == 1) { return; } - } - if (Math3D_CylTriVsIntersect(&right->dim, &D_8015E3D8, &D_8015E410) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E410) != 0) { - sp4C.x = (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp4C.y = (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp4C.z = (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - Math_Vec3s_ToVec3f(&sp40, &right->dim.pos); - func_8005E81C(globalCtx, &left->base, &left->body, &sp4C, &right->base, &right->body, &sp40, &D_8015E410); + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E3A0, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E3D8, &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]); + if (Math3D_CylTriVsIntersect(&ac->dim, &D_8015E3A0, &D_8015E410) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E410)) { + Vec3f atPos1; + Vec3f acPos1; + + atPos1.x = (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos1.y = (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos1.z = (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + Math_Vec3s_ToVec3f(&acPos1, &ac->dim.pos); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos1, &ac->base, &ac->info, &acPos1, + &D_8015E410); + return; + } + } + if (Math3D_CylTriVsIntersect(&ac->dim, &D_8015E3D8, &D_8015E410) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E410)) { + Vec3f atPos2; + Vec3f acPos2; + + atPos2.x = (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos2.y = (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos2.z = (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + Math_Vec3s_ToVec3f(&acPos2, &ac->dim.pos); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos2, &ac->base, &ac->info, &acPos2, + &D_8015E410); + } } } } @@ -2093,39 +2315,41 @@ static s8 sBssDummy4; static s8 sBssDummy5; static s8 sBssDummy6; -static Vec3f D_8015E420; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E420; + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acElem; -void CollisionCheck_AC_TrisVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderTrisItem* lItem; - ColliderTrisItem* rItem; - - Vec3f sp5C; - Vec3f sp50; - - if (right->count > 0 && right->list != NULL && left->count > 0 && left->list != NULL) { - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { + if (ac->count > 0 && ac->elements != NULL && at->count > 0 && at->elements != NULL) { + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { continue; } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { continue; } - if (func_8005DF74(&lItem->body, &rItem->body) == 1) { + if (CollisionCheck_NoSharedFlags(&atItem->info, &acElem->info) == 1) { continue; } - if (Math3D_TriVsTriIntersect(&lItem->dim, &rItem->dim, &D_8015E420) == 1) { - sp5C.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp5C.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp5C.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - sp50.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp50.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp50.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp5C, &right->base, &rItem->body, &sp50, - &D_8015E420); + if (Math3D_TriVsTriIntersect(&atItem->dim, &acElem->dim, &D_8015E420) == 1) { + Vec3f atPos; + Vec3f acPos; + + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + acPos.x = (acElem->dim.vtx[0].x + acElem->dim.vtx[1].x + acElem->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acElem->dim.vtx[0].y + acElem->dim.vtx[1].y + acElem->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acElem->dim.vtx[0].z + acElem->dim.vtx[1].z + acElem->dim.vtx[2].z) * (1.0f / 3); + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &acElem->info, + &acPos, &D_8015E420); return; } } @@ -2138,45 +2362,92 @@ static s8 sBssDummy8; static s8 sBssDummy9; static s8 sBssDummy10; -static Vec3f D_8015E430; -static TriNorm D_8015E440; -static TriNorm D_8015E478; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_TrisVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E430; + static TriNorm D_8015E440; + static TriNorm D_8015E478; + ColliderTris* at = (ColliderTris*)colAT; + ColliderTrisElement* atItem; + ColliderQuad* ac = (ColliderQuad*)colAC; -void CollisionCheck_AC_TrisVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderTris* left = (ColliderTris*)l; - ColliderQuad* right = (ColliderQuad*)r; - ColliderTrisItem* lItem; - Vec3f sp68; - Vec3f sp5C; + if (at->count > 0 && at->elements != NULL) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E440, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E478, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + for (atItem = at->elements; atItem < at->elements + at->count; atItem++) { + if (CollisionCheck_SkipTouch(&atItem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&atItem->info, &ac->info) == 1) { + continue; + } + if (Math3D_TriVsTriIntersect(&D_8015E440, &atItem->dim, &D_8015E430) == 1 || + Math3D_TriVsTriIntersect(&D_8015E478, &atItem->dim, &D_8015E430) == 1) { + Vec3f atPos; + Vec3f acPos; - if (left->count > 0 && left->list != NULL) { - if (func_8005DF50(&right->body) != 1) { - Math3D_TriNorm(&D_8015E440, &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E478, &right->dim.quad[1], &right->dim.quad[0], &right->dim.quad[2]); - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (func_8005DF2C(&lItem->body) == 1) { - continue; - } - if (func_8005DF74(&lItem->body, &right->body) == 1) { - continue; - } - if (Math3D_TriVsTriIntersect(&D_8015E440, &lItem->dim, &D_8015E430) == 1 || - Math3D_TriVsTriIntersect(&D_8015E478, &lItem->dim, &D_8015E430) == 1) { - sp68.x = (lItem->dim.vtx[0].x + lItem->dim.vtx[1].x + lItem->dim.vtx[2].x) * (1.0f / 3); - sp68.y = (lItem->dim.vtx[0].y + lItem->dim.vtx[1].y + lItem->dim.vtx[2].y) * (1.0f / 3); - sp68.z = (lItem->dim.vtx[0].z + lItem->dim.vtx[1].z + lItem->dim.vtx[2].z) * (1.0f / 3); - sp5C.x = (right->dim.quad[0].x + - (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp5C.y = (right->dim.quad[0].y + - (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp5C.z = (right->dim.quad[0].z + - (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &lItem->body, &sp68, &right->base, &right->body, &sp5C, - &D_8015E430); + atPos.x = (atItem->dim.vtx[0].x + atItem->dim.vtx[1].x + atItem->dim.vtx[2].x) * (1.0f / 3); + atPos.y = (atItem->dim.vtx[0].y + atItem->dim.vtx[1].y + atItem->dim.vtx[2].y) * (1.0f / 3); + atPos.z = (atItem->dim.vtx[0].z + atItem->dim.vtx[1].z + atItem->dim.vtx[2].z) * (1.0f / 3); + acPos.x = (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos.y = (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos.z = (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &atItem->info, &atPos, &ac->base, &ac->info, &acPos, + &D_8015E430); + return; + } + } + } +} + +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static Vec3f D_8015E4B0; + static TriNorm D_8015E4C0; + static TriNorm D_8015E4F8; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderTris* ac = (ColliderTris*)colAC; + ColliderTrisElement* acElem; + + if (ac->count > 0 && ac->elements != NULL) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { + return; + } + Math3D_TriNorm(&D_8015E4C0, &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E4F8, &at->dim.quad[1], &at->dim.quad[0], &at->dim.quad[2]); + for (acElem = ac->elements; acElem < ac->elements + ac->count; acElem++) { + if (CollisionCheck_SkipBump(&acElem->info) == 1) { + continue; + } + if (CollisionCheck_NoSharedFlags(&at->info, &acElem->info) == 1) { + continue; + } + if (Math3D_TriVsTriIntersect(&D_8015E4C0, &acElem->dim, &D_8015E4B0) == 1 || + Math3D_TriVsTriIntersect(&D_8015E4F8, &acElem->dim, &D_8015E4B0) == 1) { + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E4B0)) { + Vec3f atPos; + Vec3f acPos; + + acPos.x = (acElem->dim.vtx[0].x + acElem->dim.vtx[1].x + acElem->dim.vtx[2].x) * (1.0f / 3); + acPos.y = (acElem->dim.vtx[0].y + acElem->dim.vtx[1].y + acElem->dim.vtx[2].y) * (1.0f / 3); + acPos.z = (acElem->dim.vtx[0].z + acElem->dim.vtx[1].z + acElem->dim.vtx[2].z) * (1.0f / 3); + atPos.x = + (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos.y = + (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos.z = + (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &acElem->info, &acPos, + &D_8015E4B0); return; } } @@ -2184,104 +2455,53 @@ void CollisionCheck_AC_TrisVsQuad(GlobalContext* globalCtx, CollisionCheckContex } } -static Vec3f D_8015E4B0; -static TriNorm D_8015E4C0; -static TriNorm D_8015E4F8; - -void CollisionCheck_AC_QuadVsTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderQuad* left = (ColliderQuad*)l; - ColliderTris* right = (ColliderTris*)r; - ColliderTrisItem* rItem; - Vec3f sp68; - Vec3f sp5C; - - if (right->count > 0 && right->list != NULL) { - if (func_8005DF2C(&left->body) != 1) { - Math3D_TriNorm(&D_8015E4C0, &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E4F8, &left->dim.quad[1], &left->dim.quad[0], &left->dim.quad[2]); - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (func_8005DF50(&rItem->body) == 1) { - continue; - } - if (func_8005DF74(&left->body, &rItem->body) == 1) { - continue; - } - if (Math3D_TriVsTriIntersect(&D_8015E4C0, &rItem->dim, &D_8015E4B0) == 1 || - Math3D_TriVsTriIntersect(&D_8015E4F8, &rItem->dim, &D_8015E4B0) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E4B0) != 0) { - sp5C.x = (rItem->dim.vtx[0].x + rItem->dim.vtx[1].x + rItem->dim.vtx[2].x) * (1.0f / 3); - sp5C.y = (rItem->dim.vtx[0].y + rItem->dim.vtx[1].y + rItem->dim.vtx[2].y) * (1.0f / 3); - sp5C.z = (rItem->dim.vtx[0].z + rItem->dim.vtx[1].z + rItem->dim.vtx[2].z) * (1.0f / 3); - sp68.x = (left->dim.quad[0].x + - (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp68.y = (left->dim.quad[0].y + - (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp68.z = (left->dim.quad[0].z + - (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp68, &right->base, &rItem->body, &sp5C, - &D_8015E4B0); - return; - } - } - } - } - } -} - -static TriNorm D_8015E530[2]; -static Vec3f D_8015E598; -static TriNorm D_8015E5A8[2]; - -void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, - Collider* r) { - ColliderQuad* left = (ColliderQuad*)l; - ColliderQuad* right = (ColliderQuad*)r; +/** + * AC overlap check. Calculates the center of each collider element and the point of contact. + */ +void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT, + Collider* colAC) { + static TriNorm D_8015E530[2]; + static Vec3f D_8015E598; + static TriNorm D_8015E5A8[2]; + ColliderQuad* at = (ColliderQuad*)colAT; + ColliderQuad* ac = (ColliderQuad*)colAC; s32 i; s32 j; - Vec3f sp6C; - Vec3f sp60; - if (func_8005DF2C(&left->body) == 1) { + if (CollisionCheck_SkipTouch(&at->info) == 1) { return; } - if (func_8005DF50(&right->body) == 1) { + if (CollisionCheck_SkipBump(&ac->info) == 1) { return; } - if (func_8005DF74(&left->body, &right->body) == 1) { + if (CollisionCheck_NoSharedFlags(&at->info, &ac->info) == 1) { return; } - Math3D_TriNorm(&D_8015E5A8[0], &left->dim.quad[2], &left->dim.quad[3], &left->dim.quad[1]); - Math3D_TriNorm(&D_8015E5A8[1], &left->dim.quad[2], &left->dim.quad[1], &left->dim.quad[0]); - Math3D_TriNorm(&D_8015E530[0], &right->dim.quad[2], &right->dim.quad[3], &right->dim.quad[1]); - Math3D_TriNorm(&D_8015E530[1], &right->dim.quad[2], &right->dim.quad[1], &right->dim.quad[0]); + Math3D_TriNorm(&D_8015E5A8[0], &at->dim.quad[2], &at->dim.quad[3], &at->dim.quad[1]); + Math3D_TriNorm(&D_8015E5A8[1], &at->dim.quad[2], &at->dim.quad[1], &at->dim.quad[0]); + Math3D_TriNorm(&D_8015E530[0], &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_8015E530[1], &ac->dim.quad[2], &ac->dim.quad[1], &ac->dim.quad[0]); for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { if (Math3D_TriVsTriIntersect(&D_8015E5A8[j], &D_8015E530[i], &D_8015E598) == 1) { - if (func_8005D218(globalCtx, left, &D_8015E598) != 0) { - sp6C.x = - (left->dim.quad[0].x + (left->dim.quad[1].x + (left->dim.quad[3].x + left->dim.quad[2].x))) * - (1.0f / 4); - sp6C.y = - (left->dim.quad[0].y + (left->dim.quad[1].y + (left->dim.quad[3].y + left->dim.quad[2].y))) * - (1.0f / 4); - sp6C.z = - (left->dim.quad[0].z + (left->dim.quad[1].z + (left->dim.quad[3].z + left->dim.quad[2].z))) * - (1.0f / 4); - sp60.x = (right->dim.quad[0].x + - (right->dim.quad[1].x + (right->dim.quad[3].x + right->dim.quad[2].x))) * - (1.0f / 4); - sp60.y = (right->dim.quad[0].y + - (right->dim.quad[1].y + (right->dim.quad[3].y + right->dim.quad[2].y))) * - (1.0f / 4); - sp60.z = (right->dim.quad[0].z + - (right->dim.quad[1].z + (right->dim.quad[3].z + right->dim.quad[2].z))) * - (1.0f / 4); - func_8005E81C(globalCtx, &left->base, &left->body, &sp6C, &right->base, &right->body, &sp60, - &D_8015E598); + if (Collider_QuadSetNearestAC(globalCtx, at, &D_8015E598)) { + Vec3f atPos; + Vec3f acPos; + + atPos.x = + (at->dim.quad[0].x + (at->dim.quad[1].x + (at->dim.quad[3].x + at->dim.quad[2].x))) / 4.0f; + atPos.y = + (at->dim.quad[0].y + (at->dim.quad[1].y + (at->dim.quad[3].y + at->dim.quad[2].y))) / 4.0f; + atPos.z = + (at->dim.quad[0].z + (at->dim.quad[1].z + (at->dim.quad[3].z + at->dim.quad[2].z))) / 4.0f; + acPos.x = + (ac->dim.quad[0].x + (ac->dim.quad[1].x + (ac->dim.quad[3].x + ac->dim.quad[2].x))) / 4.0f; + acPos.y = + (ac->dim.quad[0].y + (ac->dim.quad[1].y + (ac->dim.quad[3].y + ac->dim.quad[2].y))) / 4.0f; + acPos.z = + (ac->dim.quad[0].z + (ac->dim.quad[1].z + (ac->dim.quad[3].z + ac->dim.quad[2].z))) / 4.0f; + CollisionCheck_SetATvsAC(globalCtx, &at->base, &at->info, &atPos, &ac->base, &ac->info, &acPos, + &D_8015E598); return; } } @@ -2289,174 +2509,184 @@ void CollisionCheck_AC_QuadVsQuad(GlobalContext* globalCtx, CollisionCheckContex } } -// D_8011DF5C ColliderJntSph -void func_80060EBC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderJntSph* col = (ColliderJntSph*)collider; - ColliderJntSphItem* item; - Vec3f sp24; +/** + * Sets a ColliderJntSph's hit effects + */ +void CollisionCheck_SetJntSphHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderJntSph* jntSph = (ColliderJntSph*)collider; + ColliderJntSphElement* element; + Vec3f hitPos; - for (item = col->list; item < col->list + col->count; item++) { - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp24, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &col->base, &item->body, &sp24); - item->body.acHitItem->toucherFlags |= 0x40; - return; - } - } + for (element = jntSph->elements; element < jntSph->elements + jntSph->count; element++) { + if ((element->info.bumperFlags & BUMP_DRAW_HITMARK) && (element->info.acHitInfo != NULL) && + !(element->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &element->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &jntSph->base, + &element->info, &hitPos); + element->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; + return; } } } -// D_8011DF5C ColliderCylinder -void func_80060F94(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderCylinder* item = (ColliderCylinder*)collider; - Vec3f sp28; +/** + * Sets a ColliderCylinder's hit effects + */ +void CollisionCheck_SetCylHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + Vec3f hitPos; - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp28, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &item->base, &item->body, &sp28); - item->body.acHitItem->toucherFlags |= 0x40; - } + if ((cylinder->info.bumperFlags & BUMP_DRAW_HITMARK) && (cylinder->info.acHitInfo != NULL) && + !(cylinder->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &cylinder->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, cylinder->info.acHit, cylinder->info.acHitInfo, &cylinder->base, + &cylinder->info, &hitPos); + cylinder->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; + } +} + +/** + * Sets a ColliderTris's hit effects + */ +void CollisionCheck_SetTrisHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderTris* tris = (ColliderTris*)collider; + ColliderTrisElement* element; + Vec3f hitPos; + + for (element = tris->elements; element < tris->elements + tris->count; element++) { + if ((element->info.bumperFlags & BUMP_DRAW_HITMARK) && (element->info.acHitInfo != NULL) && + !(element->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &element->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, element->info.acHit, element->info.acHitInfo, &tris->base, + &element->info, &hitPos); + element->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; + return; } } } -// D_8011DF5C ColliderTris -void func_80061028(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderTris* col = (ColliderTris*)collider; - ColliderTrisItem* item; - Vec3f sp24; +/** + * Sets a ColliderQuad's hit effects + */ +void CollisionCheck_SetQuadHitFX(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { + ColliderQuad* quad = (ColliderQuad*)collider; + Vec3f hitPos; - for (item = col->list; item < col->list + col->count; item++) { - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp24, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &col->base, &item->body, &sp24); - item->body.acHitItem->toucherFlags |= 0x40; - return; - } - } - } + if ((quad->info.bumperFlags & BUMP_DRAW_HITMARK) && (quad->info.acHitInfo != NULL) && + !(quad->info.acHitInfo->toucherFlags & TOUCH_DREW_HITMARK)) { + Math_Vec3s_ToVec3f(&hitPos, &quad->info.bumper.hitPos); + CollisionCheck_HitEffects(globalCtx, quad->info.acHit, quad->info.acHitInfo, &quad->base, &quad->info, &hitPos); + quad->info.acHitInfo->toucherFlags |= TOUCH_DREW_HITMARK; } } -// D_8011DF5C ColliderQuad -void func_8006110C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { - ColliderQuad* item = (ColliderQuad*)collider; - Vec3f sp28; +static ColChkApplyFunc sColChkApplyFuncs[] = { + CollisionCheck_SetJntSphHitFX, + CollisionCheck_SetCylHitFX, + CollisionCheck_SetTrisHitFX, + CollisionCheck_SetQuadHitFX, +}; - if (item->body.bumperFlags & 0x80) { - if (item->body.acHitItem != NULL) { - if (!(item->body.acHitItem->toucherFlags & 0x40)) { - Math_Vec3s_ToVec3f(&sp28, &item->body.bumper.unk_06); - func_8005E604(globalCtx, item->body.acHit, item->body.acHitItem, &item->base, &item->body, &sp28); - item->body.acHitItem->toucherFlags |= 0x40; - } - } - } -} - -void func_800611A0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { +/** + * Handles hit effects for each AC collider that had an AC collision. Spawns hitmarks and plays sound effects. + */ +void CollisionCheck_SetHitEffects(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { Collider** col; - Collider* temp; - static void (*D_8011DF5C[4])(GlobalContext*, CollisionCheckContext*, Collider*) = { - func_80060EBC, - func_80060F94, - func_80061028, - func_8006110C, - }; + for (col = colChkCtx->colAC; col < colChkCtx->colAC + colChkCtx->colACCount; col++) { + Collider* colAC = *col; - for (col = colChkCtx->colAc; col < colChkCtx->colAc + colChkCtx->colAcCount; col++) { - temp = *col; - if (temp != NULL) { - if (temp->acFlags & 1) { - if (temp->actor == NULL || temp->actor->update != NULL) { - (*D_8011DF5C[temp->shape])(globalCtx, colChkCtx, temp); - } + if (colAC != NULL && colAC->acFlags & AC_ON) { + if (colAC->actor != NULL && colAC->actor->update == NULL) { + continue; } + sColChkApplyFuncs[colAC->shape](globalCtx, colChkCtx, colAC); } } } -void CollisionCheck_AC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +static ColChkVsFunc sACVsFuncs[4][4] = { + { CollisionCheck_AC_JntSphVsJntSph, CollisionCheck_AC_JntSphVsCyl, CollisionCheck_AC_JntSphVsTris, + CollisionCheck_AC_JntSphVsQuad }, + { CollisionCheck_AC_CylVsJntSph, CollisionCheck_AC_CylVsCyl, CollisionCheck_AC_CylVsTris, + CollisionCheck_AC_CylVsQuad }, + { CollisionCheck_AC_TrisVsJntSph, CollisionCheck_AC_TrisVsCyl, CollisionCheck_AC_TrisVsTris, + CollisionCheck_AC_TrisVsQuad }, + { CollisionCheck_AC_QuadVsJntSph, CollisionCheck_AC_QuadVsCyl, CollisionCheck_AC_QuadVsTris, + CollisionCheck_AC_QuadVsQuad }, +}; + +/** + * Iterates through all AC colliders, performing AC collisions with the AT collider. + */ +void CollisionCheck_AC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* colAT) { Collider** col; - Collider* temp; - static void (*D_8011DF6C[4][4])(GlobalContext*, CollisionCheckContext*, Collider*, Collider*) = { - { CollisionCheck_AC_JntSphVsJntSph, CollisionCheck_AC_JntSphVsCyl, CollisionCheck_AC_JntSphVsTris, - CollisionCheck_AC_JntSphVsQuad }, - { CollisionCheck_AC_CylVsJntSph, CollisionCheck_AC_CylVsCyl, CollisionCheck_AC_CylVsTris, - CollisionCheck_AC_CylVsQuad }, - { CollisionCheck_AC_TrisVsJntSph, CollisionCheck_AC_TrisVsCyl, CollisionCheck_AC_TrisVsTris, - CollisionCheck_AC_TrisVsQuad }, - { CollisionCheck_AC_QuadVsJntSph, CollisionCheck_AC_QuadVsCyl, CollisionCheck_AC_QuadVsTris, - CollisionCheck_AC_QuadVsQuad }, - }; - for (col = colChkCtx->colAc; col < colChkCtx->colAc + colChkCtx->colAcCount; col++) { - temp = *col; - if (temp == NULL) { - continue; - } else if (!(temp->acFlags & 1)) { - continue; - } else if (temp->actor != NULL && temp->actor->update == NULL) { - continue; - } else if (!((temp->acFlags & collider->atFlags) & 0x38)) { - continue; - } else if (collider == temp) { - continue; - } + for (col = colChkCtx->colAC; col < colChkCtx->colAC + colChkCtx->colACCount; col++) { + Collider* colAC = *col; - else if ((collider->atFlags & 0x40) || collider->actor == NULL || temp->actor != collider->actor) { - D_8011DF6C[collider->shape][temp->shape](globalCtx, colChkCtx, collider, temp); - } - } -} - -// Test Attack Collisions -void func_8006139C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider** colAt; - Collider* colliderAt; - - if (colChkCtx->colAtCount != 0) { - if (colChkCtx->colAcCount != 0) { - for (colAt = colChkCtx->colAt; colAt < colChkCtx->colAt + colChkCtx->colAtCount; colAt++) { - colliderAt = *colAt; - if (colliderAt != NULL) { - if (colliderAt->atFlags & 1) { - if ((colliderAt->actor == NULL) || (colliderAt->actor->update != NULL)) { - CollisionCheck_AC(globalCtx, colChkCtx, colliderAt); - } - } - } + if (colAC != NULL && colAC->acFlags & AC_ON) { + if (colAC->actor != NULL && colAC->actor->update == NULL) { + continue; + } + if ((colAC->acFlags & colAT->atFlags & AC_TYPE_ALL) && (colAT != colAC)) { + if (!(colAT->atFlags & AT_SELF) && colAT->actor != NULL && colAC->actor == colAT->actor) { + continue; + } + sACVsFuncs[colAT->shape][colAC->shape](globalCtx, colChkCtx, colAT, colAC); } - func_800611A0(globalCtx, colChkCtx); } } } -// Get mass type -s32 func_8006146C(u8 mass) { - if (mass == 0xFF) { - return 0; +/** + * Iterates through all AT colliders, testing them for AC collisions with each AC collider, setting the info regarding + * the collision for each AC and AT collider that collided. Then spawns hitmarks and plays sound effects for each + * successful collision. To collide, an AT collider must share a type (PLAYER, ENEMY, or BOMB) with the AC collider and + * the toucher and bumper elements that overlapped must share a dmgFlag. + */ +void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { + Collider** col; + + if (colChkCtx->colATCount == 0 || colChkCtx->colACCount == 0) { + return; } - if (mass == 0xFE) { - return 1; + for (col = colChkCtx->colAT; col < colChkCtx->colAT + colChkCtx->colATCount; col++) { + Collider* colAT = *col; + + if (colAT != NULL && colAT->atFlags & AT_ON) { + if (colAT->actor != NULL && colAT->actor->update == NULL) { + continue; + } + CollisionCheck_AC(globalCtx, colChkCtx, colAT); + } } - return 2; + CollisionCheck_SetHitEffects(globalCtx, colChkCtx); } -// SetOC collision, perform elastic collision -void func_800614A4(Collider* left, ColliderBody* leftBody, Vec3f* leftv, Collider* right, ColliderBody* rightBody, - Vec3f* rightv, f32 arg6) { - f32 temp_f0; - f32 leftDisplacementFactor; - f32 rightDisplacementFactor; +/** + * Get mass type. Immobile colliders cannot be pushed, while heavy colliders can only be pushed by heavy and immobile + * colliders. + */ +s32 CollisionCheck_GetMassType(u8 mass) { + if (mass == MASS_IMMOVABLE) { + return MASSTYPE_IMMOVABLE; + } + if (mass == MASS_HEAVY) { + return MASSTYPE_HEAVY; + } + return MASSTYPE_NORMAL; +} + +/** + * Sets OC collision flags for OC collider overlaps. If both colliders are attached to actors and can push, + * also performs an elastic collision where both colliders are moved apart in proportion to their masses. + */ +void CollisionCheck_SetOCvsOC(Collider* left, ColliderInfo* leftInfo, Vec3f* leftPos, Collider* right, + ColliderInfo* rightInfo, Vec3f* rightPos, f32 overlap) { + f32 pad; + f32 leftDispRatio; + f32 rightDispRatio; f32 xzDist; f32 leftMass; f32 rightMass; @@ -2464,248 +2694,283 @@ void func_800614A4(Collider* left, ColliderBody* leftBody, Vec3f* leftv, Collide f32 inverseTotalMass; f32 xDelta; f32 zDelta; - Actor* leftActor; - Actor* rightActor; - s32 rightMassType; + Actor* leftActor = left->actor; + Actor* rightActor = right->actor; s32 leftMassType; + s32 rightMassType; - leftActor = left->actor; - rightActor = right->actor; - left->maskA |= 2; + left->ocFlags1 |= OC1_HIT; left->oc = rightActor; - leftBody->ocFlags |= 2; - if ((right->maskB & 8) != 0) { - left->maskB |= 1; + leftInfo->ocElemFlags |= OCELEM_HIT; + if (right->ocFlags2 & OC2_TYPE_PLAYER) { + left->ocFlags2 |= OC2_HIT_PLAYER; } right->oc = leftActor; - right->maskA |= 2; - rightBody->ocFlags |= 2; - if ((left->maskB & 8) != 0) { - right->maskB |= 1; + right->ocFlags1 |= OC1_HIT; + rightInfo->ocElemFlags |= OCELEM_HIT; + if (left->ocFlags2 & OC2_TYPE_PLAYER) { + right->ocFlags2 |= OC2_HIT_PLAYER; } - if (leftActor == NULL || rightActor == NULL || (left->maskA & 4) || (right->maskA & 4)) { + if (leftActor == NULL || rightActor == NULL || left->ocFlags1 & OC1_NO_PUSH || right->ocFlags1 & OC1_NO_PUSH) { return; } - leftMassType = func_8006146C(leftActor->colChkInfo.mass); - rightMassType = func_8006146C(rightActor->colChkInfo.mass); + rightMassType = CollisionCheck_GetMassType(leftActor->colChkInfo.mass); + leftMassType = CollisionCheck_GetMassType(rightActor->colChkInfo.mass); leftMass = leftActor->colChkInfo.mass; rightMass = rightActor->colChkInfo.mass; totalMass = leftMass + rightMass; if (IS_ZERO(totalMass)) { - totalMass = (leftMass = rightMass = 1.0f) * 2; + leftMass = rightMass = 1.0f; + totalMass = 2.0f; } - xDelta = rightv->x - leftv->x; - zDelta = rightv->z - leftv->z; + xDelta = rightPos->x - leftPos->x; + zDelta = rightPos->z - leftPos->z; xzDist = sqrtf(SQ(xDelta) + SQ(zDelta)); - if (leftMassType == 0) { - if (rightMassType == 0) { + if (rightMassType == MASSTYPE_IMMOVABLE) { + if (leftMassType == MASSTYPE_IMMOVABLE) { return; - } else { - leftDisplacementFactor = 0; - rightDisplacementFactor = 1; + } else { // leftMassType == MASS_HEAVY | MASS_NORMAL + leftDispRatio = 0; + rightDispRatio = 1; } - } else if (leftMassType == 1) { - if (rightMassType == 0) { - leftDisplacementFactor = 1; - rightDisplacementFactor = 0; - } else if (rightMassType == 1) { - leftDisplacementFactor = 0.5f; - rightDisplacementFactor = 0.5f; - } else { - leftDisplacementFactor = 0; - rightDisplacementFactor = 1; + } else if (rightMassType == MASSTYPE_HEAVY) { + if (leftMassType == MASSTYPE_IMMOVABLE) { + leftDispRatio = 1; + rightDispRatio = 0; + } else if (leftMassType == MASSTYPE_HEAVY) { + leftDispRatio = 0.5f; + rightDispRatio = 0.5f; + } else { // leftMassType == MASS_NORMAL + leftDispRatio = 0; + rightDispRatio = 1; } - } else { - if (rightMassType == 2) { + } else { // rightMassType == MASS_NORMAL + if (leftMassType == MASSTYPE_NORMAL) { inverseTotalMass = 1 / totalMass; - leftDisplacementFactor = rightMass * inverseTotalMass; - rightDisplacementFactor = leftMass * inverseTotalMass; - } else { - leftDisplacementFactor = 1; - rightDisplacementFactor = 0; + leftDispRatio = rightMass * inverseTotalMass; + rightDispRatio = leftMass * inverseTotalMass; + } else { // leftMassType == MASS_HEAVY | MASS_IMMOVABLE + leftDispRatio = 1; + rightDispRatio = 0; } } if (!IS_ZERO(xzDist)) { - temp_f0 = arg6 / xzDist; - xDelta *= temp_f0; - zDelta *= temp_f0; - leftActor->colChkInfo.displacement.x += -xDelta * leftDisplacementFactor; - leftActor->colChkInfo.displacement.z += -zDelta * leftDisplacementFactor; - rightActor->colChkInfo.displacement.x += xDelta * rightDisplacementFactor; - rightActor->colChkInfo.displacement.z += zDelta * rightDisplacementFactor; - } else if (!(arg6 == 0.0f)) { - leftActor->colChkInfo.displacement.x += -arg6 * leftDisplacementFactor; - rightActor->colChkInfo.displacement.x += arg6 * rightDisplacementFactor; + xDelta *= overlap / xzDist; + zDelta *= overlap / xzDist; + leftActor->colChkInfo.displacement.x += -xDelta * leftDispRatio; + leftActor->colChkInfo.displacement.z += -zDelta * leftDispRatio; + rightActor->colChkInfo.displacement.x += xDelta * rightDispRatio; + rightActor->colChkInfo.displacement.z += zDelta * rightDispRatio; + } else if (!(overlap == 0.0f)) { + leftActor->colChkInfo.displacement.x += -overlap * leftDispRatio; + rightActor->colChkInfo.displacement.x += overlap * rightDispRatio; } else { - leftActor->colChkInfo.displacement.x -= leftDisplacementFactor; - rightActor->colChkInfo.displacement.x += rightDisplacementFactor; + leftActor->colChkInfo.displacement.x -= leftDispRatio; + rightActor->colChkInfo.displacement.x += rightDispRatio; } } +/** + * OC overlap check for two JntSphs + */ void CollisionCheck_OC_JntSphVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; + ColliderJntSphElement* leftElem; ColliderJntSph* right = (ColliderJntSph*)r; - ColliderJntSphItem* lItem; - ColliderJntSphItem* rItem; - f32 sp74; - Vec3f sp68; - Vec3f sp5C; + ColliderJntSphElement* rightElem; + f32 overlap; - if (left->count > 0 && left->list != NULL && right->count > 0 && right->list != NULL) { - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (!(lItem->body.ocFlags & 1)) { + if (left->count > 0 && left->elements != NULL && right->count > 0 && right->elements != NULL) { + for (leftElem = left->elements; leftElem < left->elements + left->count; leftElem++) { + if (!(leftElem->info.ocElemFlags & OCELEM_ON)) { continue; } - for (rItem = right->list; rItem < right->list + right->count; rItem++) { - if (!(rItem->body.ocFlags & 1)) { + for (rightElem = right->elements; rightElem < right->elements + right->count; rightElem++) { + if (!(rightElem->info.ocElemFlags & OCELEM_ON)) { continue; } - if (Math3D_SphVsSphOverlap(&lItem->dim.worldSphere, &rItem->dim.worldSphere, &sp74) == 1) { - Math_Vec3s_ToVec3f(&sp68, &lItem->dim.worldSphere.center); - Math_Vec3s_ToVec3f(&sp5C, &rItem->dim.worldSphere.center); - func_800614A4(&left->base, &lItem->body, &sp68, &right->base, &rItem->body, &sp5C, sp74); + if (Math3D_SphVsSphOverlap(&leftElem->dim.worldSphere, &rightElem->dim.worldSphere, &overlap) == 1) { + Vec3f leftPos; + Vec3f rightPos; + + Math_Vec3s_ToVec3f(&leftPos, &leftElem->dim.worldSphere.center); + Math_Vec3s_ToVec3f(&rightPos, &rightElem->dim.worldSphere.center); + CollisionCheck_SetOCvsOC(&left->base, &leftElem->info, &leftPos, &right->base, &rightElem->info, + &rightPos, overlap); } } } } } +/** + * OC overlap check for a JntSph and Cylinder + */ void CollisionCheck_OC_JntSphVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { ColliderJntSph* left = (ColliderJntSph*)l; + ColliderJntSphElement* leftElem; ColliderCylinder* right = (ColliderCylinder*)r; - ColliderJntSphItem* lItem; - f32 sp78; - Vec3f sp6C; - Vec3f sp60; + f32 overlap; - if (left->count > 0 && left->list != NULL) { - if (!(right->base.maskA & 1)) { - return; - } - if (!(right->body.ocFlags & 1)) { - return; - } - for (lItem = left->list; lItem < left->list + left->count; lItem++) { - if (!(lItem->body.ocFlags & 1)) { - continue; - } - if (Math3D_SphVsCylOverlapDist(&lItem->dim.worldSphere, &right->dim, &sp78) == 1) { - Math_Vec3s_ToVec3f(&sp6C, &lItem->dim.worldSphere.center); - Math_Vec3s_ToVec3f(&sp60, &right->dim.pos); - func_800614A4(&left->base, &lItem->body, &sp6C, &right->base, &right->body, &sp60, sp78); + if (left->count > 0 && left->elements != NULL) { + if ((right->base.ocFlags1 & OC1_ON) && (right->info.ocElemFlags & OCELEM_ON)) { + for (leftElem = left->elements; leftElem < left->elements + left->count; leftElem++) { + if (!(leftElem->info.ocElemFlags & OCELEM_ON)) { + continue; + } + if (Math3D_SphVsCylOverlapDist(&leftElem->dim.worldSphere, &right->dim, &overlap) == 1) { + Vec3f leftPos; + Vec3f rightPos; + + Math_Vec3s_ToVec3f(&leftPos, &leftElem->dim.worldSphere.center); + Math_Vec3s_ToVec3f(&rightPos, &right->dim.pos); + CollisionCheck_SetOCvsOC(&left->base, &leftElem->info, &leftPos, &right->base, &right->info, + &rightPos, overlap); + } } } } } +/** + * OC overlap check for a Cylinder and JntSph + */ void CollisionCheck_OC_CylVsJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { CollisionCheck_OC_JntSphVsCyl(globalCtx, colChkCtx, r, l); } +/** + * OC overlap check for two Cylinders + */ void CollisionCheck_OC_CylVsCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* l, Collider* r) { ColliderCylinder* left = (ColliderCylinder*)l; ColliderCylinder* right = (ColliderCylinder*)r; - f32 sp4C; - Vec3f sp40; - Vec3f sp34; + f32 deadSpace; - if (!(left->base.maskA & 1) || !(right->base.maskA & 1)) { - return; - } - if (!(left->body.ocFlags & 1) || !(right->body.ocFlags & 1)) { - return; - } - if (Math3D_CylOutsideCyl(&left->dim, &right->dim, &sp4C) == 1) { - Math_Vec3s_ToVec3f(&sp40, &left->dim.pos); - Math_Vec3s_ToVec3f(&sp34, &right->dim.pos); - func_800614A4(&left->base, &left->body, &sp40, &right->base, &right->body, &sp34, sp4C); + if ((left->base.ocFlags1 & OC1_ON) && (right->base.ocFlags1 & OC1_ON)) { + if ((left->info.ocElemFlags & OCELEM_ON) && (right->info.ocElemFlags & OCELEM_ON)) { + if (Math3D_CylOutsideCyl(&left->dim, &right->dim, &deadSpace) == 1) { + Vec3f leftPos; + Vec3f rightPos; + + Math_Vec3s_ToVec3f(&leftPos, &left->dim.pos); + Math_Vec3s_ToVec3f(&rightPos, &right->dim.pos); + CollisionCheck_SetOCvsOC(&left->base, &left->info, &leftPos, &right->base, &right->info, &rightPos, + deadSpace); + } + } } } -// CollisionCheck_OC test ? -s32 func_80061BF4(Collider* collider) { - if (!(collider->maskA & 1)) { +/** + * Skip any OC colliders that are off + */ +s32 CollisionCheck_SkipOC(Collider* collider) { + if (!(collider->ocFlags1 & OC1_ON)) { return 1; } return 0; } -// CollisionCheck_OC test ? -s32 func_80061C18(Collider* arg0, Collider* arg1) { - if (!((arg0->maskA & arg1->maskB) & 0x38) || !((arg0->maskB & arg1->maskA) & 0x38) || - ((arg0->maskB & 2) && (arg1->maskB & 4)) || ((arg1->maskB & 2) && (arg0->maskB & 4))) { +/** + * Checks for OC compatibility. There are three conditions: + * First, each collider must have an OC flag corresponding to the other's OC type. + * Second, OC2_UNK1 and OC2_UNK2 can't collide with each other (has something to do with horses?) + * Third, the colliders can't collide if they belong to the same actor + */ +s32 CollisionCheck_Incompatible(Collider* left, Collider* right) { + if (!(left->ocFlags1 & right->ocFlags2 & OC1_TYPE_ALL) || !(left->ocFlags2 & right->ocFlags1 & OC1_TYPE_ALL) || + ((left->ocFlags2 & OC2_UNK1) && (right->ocFlags2 & OC2_UNK2)) || + ((right->ocFlags2 & OC2_UNK1) && (left->ocFlags2 & OC2_UNK2))) { return 1; } - if (arg0->actor == arg1->actor) { + if (left->actor == right->actor) { return 1; } return 0; } +static ColChkVsFunc sOCVsFuncs[4][4] = { + { CollisionCheck_OC_JntSphVsJntSph, CollisionCheck_OC_JntSphVsCyl, NULL, NULL }, + { CollisionCheck_OC_CylVsJntSph, CollisionCheck_OC_CylVsCyl, NULL, NULL }, + { NULL, NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL }, +}; + +/** + * Iterates through all OC colliders and collides them with all subsequent OC colliders on the list. During an OC + * collision, colliders with overlapping elements move away from each other so that their elements no longer overlap. + * The relative amount each collider is pushed is determined by the collider's mass. Only JntSph and Cylinder colliders + * can collide, and each collider must have the OC flag corresponding to the other's OC type. Additionally, OC2_UNK1 + * cannot collide with OC2_UNK2, nor can two colliders that share an actor. + */ void CollisionCheck_OC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider** phi_s2; - Collider** phi_s0; - Collider** new_var; - Collider** new_var2; - void (*test)(GlobalContext*, CollisionCheckContext*, Collider*, Collider*); + Collider** left; + Collider** right; + ColChkVsFunc vsFunc; - static void (*D_8011DFAC[4][4])(GlobalContext*, CollisionCheckContext*, Collider*, Collider*) = { - { CollisionCheck_OC_JntSphVsJntSph, CollisionCheck_OC_JntSphVsCyl, NULL, NULL }, - { CollisionCheck_OC_CylVsJntSph, CollisionCheck_OC_CylVsCyl, NULL, NULL }, - { NULL, NULL, NULL, NULL }, - { NULL, NULL, NULL, NULL }, - }; - - for (phi_s2 = colChkCtx->colOc; phi_s2 < colChkCtx->colOc + colChkCtx->colOcCount; phi_s2++) { - if (*phi_s2 == NULL || func_80061BF4(*phi_s2) == 1) { + for (left = colChkCtx->colOC; left < colChkCtx->colOC + colChkCtx->colOCCount; left++) { + if (*left == NULL || CollisionCheck_SkipOC(*left) == 1) { continue; } - for (phi_s0 = phi_s2 + 1; phi_s0 < colChkCtx->colOc + colChkCtx->colOcCount; phi_s0++) { - if (*phi_s0 == NULL || func_80061BF4(*phi_s0) == 1 || func_80061C18(*phi_s2, *phi_s0) == 1) { + for (right = left + 1; right < colChkCtx->colOC + colChkCtx->colOCCount; right++) { + if (*right == NULL || CollisionCheck_SkipOC(*right) == 1 || + CollisionCheck_Incompatible(*left, *right) == 1) { continue; } - new_var2 = phi_s0; - new_var = phi_s2; - test = D_8011DFAC[(*new_var)->shape][(*new_var2)->shape]; - if (test == NULL) { - osSyncPrintf("CollisionCheck_OC():未対応 %d, %d\n", (*new_var)->shape, (*new_var2)->shape); - // EUC-JP: 未対応 | Not compatible + vsFunc = sOCVsFuncs[(*left)->shape][(*right)->shape]; + if (vsFunc == NULL) { + // Not compatible + osSyncPrintf("CollisionCheck_OC():未対応 %d, %d\n", (*left)->shape, (*right)->shape); continue; } - (*test)(globalCtx, colChkCtx, *new_var, *new_var2); + vsFunc(globalCtx, colChkCtx, *left, *right); } } } -// Initialize CollisionCheckInfo -void func_80061E48(CollisionCheckInfo* info) { - static CollisionCheckInfo init = { NULL, { 0, 0, 0 }, 10, 10, 0, 50, 8, 0, 0, 0, 0 }; +/** + * Initializes CollisionCheckInfo to default values + */ +void CollisionCheck_InitInfo(CollisionCheckInfo* info) { + static CollisionCheckInfo init = { + NULL, { 0.0f, 0.0f, 0.0f }, 10, 10, 0, 50, 8, 0, 0, 0, 0, + }; + *info = init; } -void func_80061E8C(CollisionCheckInfo* info) { +/** + * Resets ColisionCheckInfo fields other than DamageTable, mass, and dim. + */ +void CollisionCheck_ResetDamage(CollisionCheckInfo* info) { info->damage = 0; info->damageEffect = 0; info->atHitEffect = 0; info->acHitEffect = 0; - info->displacement.z = 0.0f; - info->displacement.y = 0.0f; - info->displacement.x = 0.0f; + info->displacement.x = info->displacement.y = info->displacement.z = 0.0f; } -void func_80061EB0(CollisionCheckInfo* info, CollisionCheckInfoInit* init) { +/** + * Sets up CollisionCheckInfo using the values in init. Does not set a damage table or the unused unk_14. + * Unused, as all actors that don't set a damage table set their CollisionCheckInfo manually + */ +void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init) { info->health = init->health; info->unk_10 = init->unk_02; info->unk_12 = init->unk_04; info->mass = init->mass; } -void func_80061ED4(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) { +/** + * Sets up CollisionCheckInfo using the values in init. Does not set the unused unk_14 + */ +void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) { info->health = init->health; info->damageTable = damageTable; info->unk_10 = init->unk_02; @@ -2713,7 +2978,10 @@ void func_80061ED4(CollisionCheckInfo* info, DamageTable* damageTable, Collision info->mass = init->mass; } -void func_80061EFC(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) { +/** + * Sets up CollisionCheckInfo using the values in init. Sets the unused unk_14 + */ +void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) { info->health = init->health; info->damageTable = damageTable; info->unk_10 = init->unk_02; @@ -2722,183 +2990,206 @@ void func_80061EFC(CollisionCheckInfo* info, DamageTable* damageTable, Collision info->mass = init->mass; } -void func_80061F2C(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init) { - func_80061EFC(info, DamageTable_Get(index), init); +/** + * Sets up CollisionCheckInfo using the values in Init and a preset damage table. Sets the unused unk_14. + * Unused, as all actors that use a preset damage table set their CollisionCheckInfo manually. + */ +void CollisionCheck_SetInfoGetDamageTable(CollisionCheckInfo* info, s32 index, CollisionCheckInfoInit2* init) { + CollisionCheck_SetInfo2(info, DamageTable_Get(index), init); } -// Apply AC damage effect -void func_80061F64(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, ColliderBody* body) { +/** + * Apply AC damage effect + */ +void CollisionCheck_ApplyDamage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, + ColliderInfo* info) { DamageTable* tbl; - u32 flags; - s32 i; f32 damage; - s32 tblLookup; - if (collider->actor == NULL || !(collider->acFlags & 2)) { + if (collider->actor == NULL || !(collider->acFlags & AC_HIT)) { return; } - if (!(body->bumperFlags & 2) || (body->bumperFlags & 0x10)) { + if (!(info->bumperFlags & BUMP_HIT) || info->bumperFlags & BUMP_NO_DAMAGE) { return; } - if (body->acHitItem == NULL) { + if (info->acHitInfo == NULL) { __assert("pclobj_elem->ac_hit_elem != NULL", "../z_collision_check.c", 6493); } tbl = collider->actor->colChkInfo.damageTable; if (tbl == NULL) { - damage = (f32)body->acHitItem->toucher.damage - (f32)body->bumper.defense; + damage = (f32)info->acHitInfo->toucher.damage - info->bumper.defense; if (damage < 0) { damage = 0; } } else { - for (i = 0, flags = body->acHitItem->toucher.flags; i < 0x20; i++, flags >>= 1) { + s32 i; + u32 flags = info->acHitInfo->toucher.dmgFlags; + + for (i = 0; i < 0x20; i++, flags >>= 1) { if (flags == 1) { break; } } - tblLookup = tbl->table[i]; - damage = tblLookup & 0xF; - collider->actor->colChkInfo.damageEffect = tblLookup >> 4 & 0xF; + damage = tbl->table[i] & 0xF; + collider->actor->colChkInfo.damageEffect = tbl->table[i] >> 4 & 0xF; } - if (!(collider->acFlags & 4)) { - collider->actor->colChkInfo.damage = (u32)(collider->actor->colChkInfo.damage + damage); + if (!(collider->acFlags & AC_HARD)) { + collider->actor->colChkInfo.damage += damage; } } -// Apply ColliderJntSph AC damage effect -void func_8006216C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderJntSph AC damage effect + */ +void CollisionCheck_ApplyDamageJntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderJntSph* jntSph = (ColliderJntSph*)collider; s32 i; - if (!(jntSph->count > 0) || jntSph->list == NULL) { - return; - } - for (i = 0; i < jntSph->count; i++) { - func_80061F64(globalCtx, colChkCtx, &jntSph->base, &jntSph->list[i].body); + if (jntSph->count > 0 && jntSph->elements != NULL) { + for (i = 0; i < jntSph->count; i++) { + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, &jntSph->base, &jntSph->elements[i].info); + } } } -// Apply ColliderCylinder AC damage effect -void func_80062210(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderCylinder AC damage effect + */ +void CollisionCheck_ApplyDamageCyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderCylinder* cylinder = (ColliderCylinder*)collider; - func_80061F64(globalCtx, colChkCtx, &cylinder->base, &cylinder->body); + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, &cylinder->base, &cylinder->info); } -// Apply ColliderTris AC damage effect -void func_80062230(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderTris AC damage effect + */ +void CollisionCheck_ApplyDamageTris(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderTris* tris = (ColliderTris*)collider; s32 i; for (i = 0; i < tris->count; i++) { - func_80061F64(globalCtx, colChkCtx, collider, &tris->list[i].body); + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, collider, &tris->elements[i].info); } } -// Apply ColliderQuad AC damage effect -void func_800622C4(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { +/** + * Apply ColliderQuad AC damage effect + */ +void CollisionCheck_ApplyDamageQuad(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider) { ColliderQuad* quad = (ColliderQuad*)collider; - func_80061F64(globalCtx, colChkCtx, &quad->base, &quad->body); + CollisionCheck_ApplyDamage(globalCtx, colChkCtx, &quad->base, &quad->info); } -// Apply all AC damage effects -void func_800622E4(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { - Collider* collider; +static ColChkApplyFunc sApplyDamageFuncs[4] = { + CollisionCheck_ApplyDamageJntSph, + CollisionCheck_ApplyDamageCyl, + CollisionCheck_ApplyDamageTris, + CollisionCheck_ApplyDamageQuad, +}; + +/** + * For all AC colliders, sets any damage effects from collisions with AT colliders to their corresponding actor's + * CollisionCheckInfo. + */ +void CollisionCheck_Damage(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx) { s32 i; - static void (*D_8011E008[4])(GlobalContext*, CollisionCheckContext*, Collider*) = { - func_8006216C, - func_80062210, - func_80062230, - func_800622C4, - }; + for (i = 0; i < colChkCtx->colACCount; i++) { + Collider* collider = colChkCtx->colAC[i]; - for (i = 0; i < colChkCtx->colAcCount; i++) { - collider = colChkCtx->colAc[i]; - if (collider == 0) { + if (collider == NULL) { continue; } - if ((collider->acFlags & 0x40)) { + if (collider->acFlags & AC_NO_DAMAGE) { continue; } - D_8011E008[collider->shape](globalCtx, colChkCtx, collider); + sApplyDamageFuncs[collider->shape](globalCtx, colChkCtx, collider); } } -static Linef D_8015E610; - -s32 CollisionCheck_generalLineOcCheck_JntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, - Collider* collider, Vec3f* arg3, Vec3f* arg4) { +/** + * Checks if the line ab intersects any of the ColliderJntSph's elements + */ +s32 CollisionCheck_LineOC_JntSph(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, + Vec3f* a, Vec3f* b) { + static Linef D_8015E610; ColliderJntSph* jntSph = (ColliderJntSph*)collider; - ColliderJntSphItem* item; - s32 phi_s0; - for (phi_s0 = 0; phi_s0 < jntSph->count; phi_s0++) { - item = &jntSph->list[phi_s0]; - if (!(item->body.ocFlags & 1)) { - continue; - } - D_8015E610.a = *arg3; - D_8015E610.b = *arg4; - if (Math3D_LineVsSph(&item->dim.worldSphere, &D_8015E610) == 1) { - return 1; - } - } - return 0; -} - -static Vec3f D_8015E628; -static Vec3f D_8015E638; - -s32 CollisionCheck_generalLineOcCheck_Cyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, - Collider* collider, Vec3f* arg3, Vec3f* arg4) { - ColliderCylinder* cylinder = (ColliderCylinder*)collider; - if (!(cylinder->body.ocFlags & 1)) { - return 0; - } - if (Math3D_CylVsLineSeg(&cylinder->dim, arg3, arg4, &D_8015E628, &D_8015E638) != 0) { - return 1; - } - return 0; -} - -s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, - Vec3f* arg3, Actor** arg4, s32 arg5) { - Collider* collider; - s32 (*t)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*); - Collider** c; s32 i; - s32 test; - s32 result; - static s32 (*D_8011E018[4])(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*) = { - CollisionCheck_generalLineOcCheck_JntSph, - CollisionCheck_generalLineOcCheck_Cyl, - NULL, - NULL, - }; + for (i = 0; i < jntSph->count; i++) { + ColliderJntSphElement* element = &jntSph->elements[i]; - result = 0; - for (c = colChkCtx->colOc; c < colChkCtx->colOc + colChkCtx->colOcCount; c++) { - if (func_80061BF4(*c) == 1) { + if (!(element->info.ocElemFlags & OCELEM_ON)) { continue; } - test = 0; - for (i = 0; i < arg5; i++) { - if ((*c)->actor == arg4[i]) { - test = 1; + D_8015E610.a = *a; + D_8015E610.b = *b; + if (Math3D_LineVsSph(&element->dim.worldSphere, &D_8015E610) == 1) { + return true; + } + } + return false; +} + +/** + * Checks if the line segment ab intersects the ColliderCylinder + */ +s32 CollisionCheck_LineOC_Cyl(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Collider* collider, Vec3f* a, + Vec3f* b) { + static Vec3f D_8015E628; + static Vec3f D_8015E638; + ColliderCylinder* cylinder = (ColliderCylinder*)collider; + + if (!(cylinder->info.ocElemFlags & OCELEM_ON)) { + return false; + } + if (Math3D_CylVsLineSeg(&cylinder->dim, a, b, &D_8015E628, &D_8015E638) != 0) { + return true; + } + return false; +} + +static ColChkLineFunc sOCLineCheckFuncs[4] = { + CollisionCheck_LineOC_JntSph, + CollisionCheck_LineOC_Cyl, + NULL, + NULL, +}; + +/** + * Checks if the line segment ab intersects any OC colliders, excluding those attached to actors + * on the exclusion list. Returns true if there are any intersections and false otherwise. + */ +s32 CollisionCheck_LineOC(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions) { + ColChkLineFunc lineCheck; + Collider** col; + s32 i; + s32 exclude; + s32 result = 0; + + for (col = colChkCtx->colOC; col < colChkCtx->colOC + colChkCtx->colOCCount; col++) { + if (CollisionCheck_SkipOC(*col) == 1) { + continue; + } + exclude = 0; + for (i = 0; i < numExclusions; i++) { + if ((*col)->actor == exclusions[i]) { + exclude = 1; break; } } - if (test == 1) { + if (exclude == 1) { continue; } - collider = *c; - t = D_8011E018[collider->shape]; - if (t == NULL) { - osSyncPrintf("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", collider->shape); - // EUC-JP: 未対応 %dタイプ | %d's type is not supported + lineCheck = sOCLineCheckFuncs[(*col)->shape]; + if (lineCheck == NULL) { + // type %d not supported + osSyncPrintf("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", (*col)->shape); } else { - result = (*t)(globalCtx, colChkCtx, collider, camera_3C, arg3); - if (result != 0) { + result = lineCheck(globalCtx, colChkCtx, (*col), a, b); + if (result) { break; } } @@ -2906,60 +3197,79 @@ s32 CollisionCheck_GeneralLineOcCheck(GlobalContext* globalCtx, CollisionCheckCo return result; } -s32 func_8006268C(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* arg2, Vec3f* arg3) { - CollisionCheck_GeneralLineOcCheck(globalCtx, colChkCtx, arg2, arg3, NULL, 0); +/** + * Checks if the line segment ab intersects any OC colliders. Returns true if there are any intersections and false + * otherwise. Unused. + */ +s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b) { + CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, NULL, 0); } -s32 func_800626B0(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* camera_3C, Vec3f* arg3, - Actor** arg4, s32 arg5) { - CollisionCheck_GeneralLineOcCheck(globalCtx, colChkCtx, camera_3C, arg3, arg4, arg5); +/** + * Checks if the line segment ab intersects any OC colliders, excluding those attached to actors on the exclusion list. + * Returns true if there are any intersections and false otherwise. + */ +s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b, + Actor** exclusions, s32 numExclusions) { + CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, exclusions, numExclusions); } -void Collider_CylinderUpdate(Actor* actor, ColliderCylinder* collider) { - collider->dim.pos.x = (s32)actor->posRot.pos.x; - collider->dim.pos.y = (s32)actor->posRot.pos.y; - collider->dim.pos.z = (s32)actor->posRot.pos.z; +/** + * Moves the ColliderCylinder's position to the actor's position + */ +void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider) { + collider->dim.pos.x = actor->posRot.pos.x; + collider->dim.pos.y = actor->posRot.pos.y; + collider->dim.pos.z = actor->posRot.pos.z; } -// Set ColliderCylinder position -void func_80062718(ColliderCylinder* collider, Vec3s* pos) { +/** + * Sets the ColliderCylinder's position + */ +void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos) { collider->dim.pos.x = pos->x; collider->dim.pos.y = pos->y; collider->dim.pos.z = pos->z; } -// Set ColliderQuad vertices -void func_80062734(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d) { +/** + * Sets the ColliderQuad's vertices + */ +void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d) { Math_Vec3f_Copy(&collider->dim.quad[2], c); Math_Vec3f_Copy(&collider->dim.quad[3], d); Math_Vec3f_Copy(&collider->dim.quad[0], a); Math_Vec3f_Copy(&collider->dim.quad[1], b); - func_8005CEDC(&collider->dim); + Collider_SetQuadMidpoints(&collider->dim); } -// Set ColliderTrisItem at index -void func_800627A0(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c) { - ColliderTrisItem* item; - f32 sp40; - f32 sp3C; - f32 sp38; - f32 sp34; +/** + * Sets the specified ColliderTrisElement's vertices + */ +void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c) { + ColliderTrisElement* element = &collider->elements[index]; + f32 nx; + f32 ny; + f32 nz; + f32 originDist; - item = &collider->list[index]; - Math_Vec3f_Copy(&item->dim.vtx[0], a); - Math_Vec3f_Copy(&item->dim.vtx[1], b); - Math_Vec3f_Copy(&item->dim.vtx[2], c); - Math3D_DefPlane(a, b, c, &sp40, &sp3C, &sp38, &sp34); - item->dim.plane.normal.x = sp40; - item->dim.plane.normal.y = sp3C; - item->dim.plane.normal.z = sp38; - item->dim.plane.originDist = sp34; + Math_Vec3f_Copy(&element->dim.vtx[0], a); + Math_Vec3f_Copy(&element->dim.vtx[1], b); + Math_Vec3f_Copy(&element->dim.vtx[2], c); + Math3D_DefPlane(a, b, c, &nx, &ny, &nz, &originDist); + element->dim.plane.normal.x = nx; + element->dim.plane.normal.y = ny; + element->dim.plane.normal.z = nz; + element->dim.plane.originDist = originDist; } -// Set ColliderTrisItem at index -void func_8006285C(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisItemDimInit* init) { - ColliderTrisItem* item = &collider->list[index]; - Collider_SetTrisItemDim(globalCtx, &item->dim, init); +/** + * Sets the specified ColliderTrisElement's dim using the values in src + */ +void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* src) { + ColliderTrisElement* element = &collider->elements[index]; + + Collider_SetTrisElementDim(globalCtx, &element->dim, src); } // Due to an unknown reason, bss ordering changed between the 2 static Vec3f variables in the function below. @@ -2971,33 +3281,40 @@ static s8 sBssDummy12; static s8 sBssDummy13; static s8 sBssDummy14; -void func_800628A4(s32 arg0, ColliderJntSph* collider) { +/** + * Updates the world spheres for all of the collider's JntSph elements attached to the specified limb + */ +void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider) { static Vec3f D_8015E648; static Vec3f D_8015CF00; // bss ordering changes here s32 i; for (i = 0; i < collider->count; i++) { - if (arg0 == collider->list[i].dim.joint) { - D_8015E648.x = collider->list[i].dim.modelSphere.center.x; - D_8015E648.y = collider->list[i].dim.modelSphere.center.y; - D_8015E648.z = collider->list[i].dim.modelSphere.center.z; + if (limb == collider->elements[i].dim.limb) { + D_8015E648.x = collider->elements[i].dim.modelSphere.center.x; + D_8015E648.y = collider->elements[i].dim.modelSphere.center.y; + D_8015E648.z = collider->elements[i].dim.modelSphere.center.z; Matrix_MultVec3f(&D_8015E648, &D_8015CF00); - collider->list[i].dim.worldSphere.center.x = (s32)D_8015CF00.x; - collider->list[i].dim.worldSphere.center.y = (s32)D_8015CF00.y; - collider->list[i].dim.worldSphere.center.z = (s32)D_8015CF00.z; - collider->list[i].dim.worldSphere.radius = - (s32)((f32)collider->list[i].dim.modelSphere.radius * collider->list[i].dim.scale); + collider->elements[i].dim.worldSphere.center.x = D_8015CF00.x; + collider->elements[i].dim.worldSphere.center.y = D_8015CF00.y; + collider->elements[i].dim.worldSphere.center.z = D_8015CF00.z; + collider->elements[i].dim.worldSphere.radius = + collider->elements[i].dim.modelSphere.radius * collider->elements[i].dim.scale; } } } -void func_80062A28(GlobalContext* globalCtx, Vec3f* v) { +/** + * Spawns red blood droplets. + * No actor has a collision type that spawns red blood. + */ +void CollisionCheck_SpawnRedBlood(GlobalContext* globalCtx, Vec3f* v) { static EffectSparkInit D_8015CF10; - s32 sp24; + s32 effectIndex; - D_8015CF10.position.x = (s32)v->x; - D_8015CF10.position.y = (s32)v->y; - D_8015CF10.position.z = (s32)v->z; + D_8015CF10.position.x = v->x; + D_8015CF10.position.y = v->y; + D_8015CF10.position.z = v->z; D_8015CF10.uDiv = 5; D_8015CF10.vDiv = 5; D_8015CF10.colorStart[0].r = 128; @@ -3037,16 +3354,20 @@ void func_80062A28(GlobalContext* globalCtx, Vec3f* v) { D_8015CF10.speed = 8.0f; D_8015CF10.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015CF10); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015CF10); } -void func_80062B80(GlobalContext* globalCtx, Vec3f* v) { +/** + * Spawns water droplets. + * No actor has a collision type that spawns water droplets. + */ +void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v) { static EffectSparkInit D_8015D3D8; - s32 sp24; + s32 effectIndex; - D_8015D3D8.position.x = (s32)v->x; - D_8015D3D8.position.y = (s32)v->y; - D_8015D3D8.position.z = (s32)v->z; + D_8015D3D8.position.x = v->x; + D_8015D3D8.position.y = v->y; + D_8015D3D8.position.z = v->z; D_8015D3D8.uDiv = 5; D_8015D3D8.vDiv = 5; D_8015D3D8.colorStart[0].r = 255; @@ -3086,90 +3407,105 @@ void func_80062B80(GlobalContext* globalCtx, Vec3f* v) { D_8015D3D8.speed = 8.0f; D_8015D3D8.gravity = -1.0f; - Effect_Add(globalCtx, &sp24, EFFECT_SPARK, 0, 1, &D_8015D3D8); + Effect_Add(globalCtx, &effectIndex, EFFECT_SPARK, 0, 1, &D_8015D3D8); } -void func_80062CD4(GlobalContext* globalCtx, Vec3f* v) { - static EffectShieldParticleInit init = { +/** + * Spawns streaks of light from hits against solid objects + */ +void CollisionCheck_SpawnShieldParticles(GlobalContext* globalCtx, Vec3f* v) { + static EffectShieldParticleInit initMetal = { 16, - { 0.0f, 0.0f, 0.0f }, - { 0x00, 0xC8, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0x80, 0xFF }, - { 0xFF, 0xFF, 0x00, 0xFF }, - { 0xFF, 0x40, 0x00, 0xC8 }, - { 0xFF, 0x00, 0x00, 0xFF }, + { 0, 0, 0 }, + { 0, 200, 255, 255 }, + { 255, 255, 255, 255 }, + { 255, 255, 128, 255 }, + { 255, 255, 0, 255 }, + { 255, 64, 0, 200 }, + { 255, 0, 0, 255 }, 2.1f, 35.0f, 30.0f, 8, - { 0, 0, 0, 0x00, 0x80, 0xFF, 0x00, 300 }, - 1, + { 0, 0, 0, { 0, 128, 255 }, false, 300 }, + true, }; - s32 sp24; + s32 effectIndex; - init.position.x = (s32)v->x; - init.position.y = (s32)v->y; - init.position.z = (s32)v->z; - init.lightPoint.x = init.position.x; - init.lightPoint.y = init.position.y; - init.lightPoint.z = init.position.z; + initMetal.position.x = v->x; + initMetal.position.y = v->y; + initMetal.position.z = v->z; + initMetal.lightPoint.x = initMetal.position.x; + initMetal.lightPoint.y = initMetal.position.y; + initMetal.lightPoint.z = initMetal.position.z; - Effect_Add(globalCtx, &sp24, EFFECT_SHIELD_PARTICLE, 0, 1, &init); + Effect_Add(globalCtx, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &initMetal); } -void func_80062D60(GlobalContext* globalCtx, Vec3f* v) { - func_80062CD4(globalCtx, v); +/** + * Spawns streaks of light and makes a metallic sound + */ +void CollisionCheck_SpawnShieldParticlesMetal(GlobalContext* globalCtx, Vec3f* v) { + CollisionCheck_SpawnShieldParticles(globalCtx, v); Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void func_80062DAC(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2) { - func_80062CD4(globalCtx, v); - Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, arg2, 4, &D_801333E0, &D_801333E0, &D_801333E8); +/** + * Spawns streaks of light and makes a metallic sound at the specified position + */ +void CollisionCheck_SpawnShieldParticlesMetalSound(GlobalContext* globalCtx, Vec3f* v, Vec3f* pos) { + CollisionCheck_SpawnShieldParticles(globalCtx, v); + Audio_PlaySoundGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -void func_80062DF4(GlobalContext* globalCtx, Vec3f* v) { - func_80062D60(globalCtx, v); +/** + * Spawns streaks of light and makes a metallic sound + */ +void CollisionCheck_SpawnShieldParticlesMetal2(GlobalContext* globalCtx, Vec3f* v) { + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, v); } -void func_80062E14(GlobalContext* globalCtx, Vec3f* v, Vec3f* arg2) { - static EffectShieldParticleInit init = { +/** + * Spawns streaks of light and makes a wooden sound + */ +void CollisionCheck_SpawnShieldParticlesWood(GlobalContext* globalCtx, Vec3f* v, Vec3f* actorPos) { + static EffectShieldParticleInit initWood = { 16, - { 0.0f, 0.0f, 0.0f }, - { 0x00, 0xC8, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0xFF, 0xFF }, - { 0xFF, 0xFF, 0x80, 0xFF }, - { 0xFF, 0xFF, 0x00, 0xFF }, - { 0xFF, 0x40, 0x00, 0xC8 }, - { 0xFF, 0x00, 0x00, 0xFF }, + { 0, 0, 0 }, + { 0, 200, 255, 255 }, + { 255, 255, 255, 255 }, + { 255, 255, 128, 255 }, + { 255, 255, 0, 255 }, + { 255, 64, 0, 200 }, + { 255, 0, 0, 255 }, 2.1f, 35.0f, 30.0f, 8, - { 0, 0, 0, 0x00, 0x80, 0xFF, 0x00, 300 }, - 0, + { 0, 0, 0, { 0, 128, 255 }, false, 300 }, + false, }; - s32 sp24; + s32 effectIndex; - init.position.x = (s32)v->x; - init.position.y = (s32)v->y; - init.position.z = (s32)v->z; - init.lightPoint.x = init.position.x; - init.lightPoint.y = init.position.y; - init.lightPoint.z = init.position.z; + initWood.position.x = v->x; + initWood.position.y = v->y; + initWood.position.z = v->z; + initWood.lightPoint.x = initWood.position.x; + initWood.lightPoint.y = initWood.position.y; + initWood.lightPoint.z = initWood.position.z; - Effect_Add(globalCtx, &sp24, EFFECT_SHIELD_PARTICLE, 0, 1, &init); - Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, arg2, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Effect_Add(globalCtx, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &initWood); + Audio_PlaySoundGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } -/* +/** * Determines if the line segment connecting itemPos and itemProjPos intersects the side of a cylinder with the given * radius, height, and offset at actorPos. Returns 3 if either endpoint is inside the cylinder, otherwise returns the * number of points of intersection with the side of the cylinder. The locations of those points are put in out1 and * out2, with out1 being closer to itemPos. Line segments that pass through both bases of the cylinder are not detected. */ -s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, Vec3f* itemProjPos, Vec3f* out1, - Vec3f* out2) { +s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* itemPos, + Vec3f* itemProjPos, Vec3f* out1, Vec3f* out2) { Vec3f actorToItem; Vec3f actorToItemProj; Vec3f itemStep; @@ -3301,20 +3637,23 @@ s32 func_80062ECC(f32 radius, f32 height, f32 offset, Vec3f* actorPos, Vec3f* it return 1; } -s32 func_800635D0(s32 arg0) { - s32 result; +/** + * Gets damage from a sword strike using generic values, and returns 0 if the attack is + * not sword-type. Used by bosses to require that a sword attack deal the killing blow. + */ +u8 CollisionCheck_GetSwordDamage(s32 dmgFlags) { + u8 damage = 0; - result = 0; - if (arg0 & 0x00400100) { - result = 1; - } else if (arg0 & 0x03000242) { - result = 2; - } else if (arg0 & 0x48800400) { - result = 4; - } else if (arg0 & 0x04000000) { - result = 8; + if (dmgFlags & 0x00400100) { + damage = 1; + } else if (dmgFlags & 0x03000242) { + damage = 2; + } else if (dmgFlags & 0x48800400) { + damage = 4; + } else if (dmgFlags & 0x04000000) { + damage = 8; } - KREG(7) = result; - return result; + KREG(7) = damage; + return damage; } diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 64b18aea31..3e62d46cb3 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -34,8 +34,22 @@ const ActorInit En_A_Obj_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x39, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ALL, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 60, 0, { 0, 0, 0 } }, }; @@ -138,7 +152,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { func_8001D234(this, thisx->params); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; thisx->unk_1F = 0; break; case A_OBJ_KNOB: @@ -152,7 +166,7 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { } if (thisx->params < 5) { - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; } if (this->dyna.bgId != BGACTOR_NEG_ONE) { @@ -315,8 +329,8 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) { switch (this->dyna.actor.params) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 4a67a71720..af464beeb1 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -499,8 +499,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->actor.params == ITEM00_SHIELD_DEKU) || (this->actor.params == ITEM00_SHIELD_HYLIAN) || (this->actor.params == ITEM00_TUNIC_ZORA) || (this->actor.params == ITEM00_TUNIC_GORON)) { diff --git a/src/code/z_play.c b/src/code/z_play.c index 12d1b07bdf..fba0e5a4c4 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -237,7 +237,7 @@ void Gameplay_Init(GameState* thisx) { func_8006BA00(globalCtx); Effect_InitContext(globalCtx); EffectSs_InitInfo(globalCtx, 0x55); - func_8005D3BC(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); AnimationContext_Reset(&globalCtx->animationCtx); func_8006450C(globalCtx, &globalCtx->csCtx); @@ -835,7 +835,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3612); } - func_8006139C(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_AT(globalCtx, &globalCtx->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3618); @@ -847,13 +847,13 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3624); } - func_800622E4(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_Damage(globalCtx, &globalCtx->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3631); } - CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); + CollisionCheck_ClearContext(globalCtx, &globalCtx->colChkCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3637); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index db619db673..248998e214 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -945,7 +945,7 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w Vec3f* newBase) { if (weaponInfo->active == 0) { if (collider != NULL) { - Collider_QuadSetAT(globalCtx, &collider->base); + Collider_ResetQuadAT(globalCtx, &collider->base); } Math_Vec3f_Copy(&weaponInfo->tip, newTip); Math_Vec3f_Copy(&weaponInfo->base, newBase); @@ -955,12 +955,12 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w (weaponInfo->tip.z == newTip->z) && (weaponInfo->base.x == newBase->x) && (weaponInfo->base.y == newBase->y) && (weaponInfo->base.z == newBase->z)) { if (collider != NULL) { - Collider_QuadSetAT(globalCtx, &collider->base); + Collider_ResetQuadAT(globalCtx, &collider->base); } return 0; } else { if (collider != NULL) { - func_80062734(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip); + Collider_SetQuadVertices(collider, newBase, newTip, &weaponInfo->base, &weaponInfo->tip); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base); } Math_Vec3f_Copy(&weaponInfo->base, newBase); @@ -972,22 +972,22 @@ u8 func_80090480(GlobalContext* globalCtx, ColliderQuad* collider, WeaponInfo* w void func_80090604(GlobalContext* globalCtx, Player* this, ColliderQuad* collider, Vec3f* quadSrc) { static u8 shieldColTypes[PLAYER_SHIELD_MAX] = { - COLTYPE_METAL_SHIELD, - COLTYPE_WOODEN_SHIELD, - COLTYPE_METAL_SHIELD, - COLTYPE_METAL_SHIELD, + COLTYPE_METAL, + COLTYPE_WOOD, + COLTYPE_METAL, + COLTYPE_METAL, }; if (this->stateFlags1 & 0x400000) { Vec3f quadDest[4]; - this->shieldQuad.base.type = shieldColTypes[this->currentShield]; + this->shieldQuad.base.colType = shieldColTypes[this->currentShield]; Matrix_MultVec3f(&quadSrc[0], &quadDest[0]); Matrix_MultVec3f(&quadSrc[1], &quadDest[1]); Matrix_MultVec3f(&quadSrc[2], &quadDest[2]); Matrix_MultVec3f(&quadSrc[3], &quadDest[3]); - func_80062734(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]); + Collider_SetQuadVertices(collider, &quadDest[0], &quadDest[1], &quadDest[2], &quadDest[3]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &collider->base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base); diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index d8abe9dda2..26e784b19c 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -25,8 +25,22 @@ const ActorInit Arms_Hook_InitVars = { }; ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00000080, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000080, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 0 }, }; @@ -161,10 +175,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { ArmsHook_CheckForCancel(this); if (this->timer != 0) { - if ((this->collider.base.atFlags & 2) && (this->collider.body.atHitItem->flags != 4)) { + if ((this->collider.base.atFlags & AT_HIT) && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) { touchedActor = this->collider.base.at; if ((touchedActor->update != NULL) && (touchedActor->flags & 0x600)) { - if (this->collider.body.atHitItem->bumperFlags & 4) { + if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) { ArmsHook_AttachHookToActor(this, touchedActor); if ((touchedActor->flags & 0x400) == 0x400) { func_80865044(this); @@ -278,7 +292,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { &D_801333E0, &D_801333E8); return; } - func_80062D60(globalCtx, &this->actor.posRot.pos); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.posRot.pos); Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); return; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 6aa587bbcf..7b2c3dd01c 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -45,8 +45,22 @@ const ActorInit Bg_Bdan_Objects_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x09, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_NONE, + OCELEM_NONE, + }, { 0x00BB, 0x0050, 0x0000, { 0 } }, }; @@ -298,8 +312,8 @@ void func_8086C5BC(BgBdanObjects* this, GlobalContext* globalCtx) { } void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) { - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { Flags_SetSwitch(globalCtx, this->unk_168); this->dyna.actor.initPosRot.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index ef13edeecd..c0afb59bf3 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -59,17 +59,31 @@ extern CollisionHeader D_06005CF8; extern Gfx D_060061A0[]; extern Gfx D_06005A20[]; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x00, { { 0x0000, 0x0078, 0x0000 }, 370 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xEFC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 120, 0 }, 370 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -398,14 +412,14 @@ void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) { default: return; case YELLOW_TALL_1: - if (((this->collider.base.acFlags & 2) != 0) && this->unk_1D8 <= 0) { + if (((this->collider.base.acFlags & AC_HIT) != 0) && this->unk_1D8 <= 0) { this->unk_1D8 = 0xA; func_8086DC30(this); func_8086D4B4(this, globalCtx); } break; case YELLOW_TALL_2: - if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) { + if (((this->collider.base.acFlags & AC_HIT) != 0) && ((this->unk_1DC & 2) == 0) && this->unk_1D8 <= 0) { this->unk_1D8 = 0xA; func_8086DC30(this); func_8086D4B4(this, globalCtx); @@ -441,7 +455,7 @@ void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) { } break; case YELLOW_TALL_2: - if (((this->collider.base.acFlags & 2) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) { + if (((this->collider.base.acFlags & AC_HIT) != 0) && ((this->unk_1DC & 2) == 0) && (this->unk_1D8 <= 0)) { this->unk_1D8 = 0xA; func_8086DDA8(this); func_8086D548(this, globalCtx); @@ -466,29 +480,28 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) { } void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; BgBdanSwitch* this = THIS; s32 type; - s32 temp; if (this->unk_1DA > 0) { - this->unk_1DA -= 1; + this->unk_1DA--; } this->actionFunc(this, globalCtx); func_8086D0EC(this); type = this->dyna.actor.params & 0xFF; if (type != 3 && type != 4) { - this->unk_1D8 -= 1; - return; + this->unk_1D8--; + } else { + if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) { + this->unk_1D8--; + } + this->unk_1DC = this->collider.base.acFlags; + this->collider.base.acFlags &= ~AC_HIT; + this->collider.elements[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f; + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - if (!Player_InCsMode(globalCtx) && this->unk_1D8 > 0) { - this->unk_1D8 -= 1; - } - temp = this->collider.base.acFlags; - this->collider.base.acFlags &= 0xFFFD; - this->unk_1DC = temp; - this->collider.list[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f; - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) { @@ -510,7 +523,7 @@ void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { case YELLOW_TALL_1: case YELLOW_TALL_2: func_8086DF58(this, globalCtx, D_060061A0); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.posRot2.pos); break; case BLUE: diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index 89d597baff..44c7a62a9c 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -21,7 +21,7 @@ typedef struct BgBdanSwitch { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ BgBdanSwitchActionFunc actionFunc; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItems[1]; + /* 0x0188 */ ColliderJntSphElement colliderItems[1]; /* 0x01C8 */ f32 unk_1C8; /* 0x01CC */ s16 unk_1CC; /* 0x01CE */ char unk_1CE[0x2]; diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 802597b102..9e74db67a6 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -25,25 +25,53 @@ extern CollisionHeader D_050041B0; extern Gfx D_05003FC0[]; extern Gfx D_05004088[]; -static ColliderTrisItemInit sTrimItemInit[3] = { +static ColliderTrisElementInit sTrisElementsInit[3] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -70.0f, 176.0f, 0.0f }, { -70.0f, -4.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 70.0f, 176.0f, 0.0f }, { -70.0f, 176.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 70.0f, -4.0f, 0.0f }, { 70.0f, 176.0f, 0.0f }, { 0.0f, -4.0f, 30.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 3, - sTrimItemInit, + sTrisElementsInit, }; const ActorInit Bg_Bombwall_InitVars = { @@ -109,9 +137,9 @@ void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i <= 2; i++) { for (j = 0; j <= 2; j++) { - sp80.x = sTrisInit.list[i].dim.vtx[j].x; - sp80.y = sTrisInit.list[i].dim.vtx[j].y; - sp80.z = sTrisInit.list[i].dim.vtx[j].z + 2.0f; + sp80.x = sTrisInit.elements[i].dim.vtx[j].x; + sp80.y = sTrisInit.elements[i].dim.vtx[j].y; + sp80.z = sTrisInit.elements[i].dim.vtx[j].z + 2.0f; BgBombwall_RotateVec(&vecs[j], &sp80, sin, cos); @@ -119,7 +147,7 @@ void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx) { vecs[j].y += this->dyna.actor.posRot.pos.y; vecs[j].z += this->dyna.actor.posRot.pos.z; } - func_800627A0(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]); + Collider_SetTrisVertices(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]); } this->unk_2A2 |= 1; @@ -187,8 +215,8 @@ void func_8086ED50(BgBombwall* this, GlobalContext* globalCtx) { } void func_8086ED70(BgBombwall* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); } else if (this->dyna.actor.xzDistToLink < 600.0f) { diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h index e375f579fc..d462cefe48 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h @@ -11,7 +11,7 @@ typedef void (*BgBombwallActionFunc)(struct BgBombwall*, GlobalContext*); typedef struct BgBombwall { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderTris collider; - /* 0x0184 */ ColliderTrisItem colliderItems[3]; + /* 0x0184 */ ColliderTrisElement colliderItems[3]; /* 0x0298 */ BgBombwallActionFunc actionFunc; /* 0x029C */ Gfx* dList; /* 0x02A0 */ s16 unk_2A0; diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 6a2e770d0e..5251158b07 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -33,6 +33,26 @@ const ActorInit Bg_Breakwall_InitVars = { (ActorFunc)BgBreakwall_Update, NULL, }; + +static ColliderQuadInit D_80870760 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000048, 0x00, 0x00 }, + { 0x00000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Breakwall/BgBreakwall_SetupAction.s") diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index e9853ab6e1..9b21211cb5 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -32,8 +32,22 @@ const ActorInit Bg_Ddan_Kd_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ALL, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 245, 180, -400, { 0, 0, 0 } }, }; @@ -107,8 +121,8 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) { this->prevExplosivePos = explosive->posRot.pos; } } - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index e24925c47d..fddb975b92 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -34,14 +34,42 @@ const ActorInit Bg_Dodoago_InitVars = { }; static ColliderCylinderInit sColCylinderInit0 = { - { COLTYPE_UNK10, 0x00, 0x39, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ALL, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 80, 30, 80, { 0, 0, 0 } }, }; static ColliderCylinderInit sColCylinderInit1 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x3D, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 50, 60, 280, { 0, 0, 0 } }, }; @@ -152,9 +180,9 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) { } else { if (Flags_GetEventChkInf(0xB0)) { - Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[0]); - Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[1]); - Collider_CylinderUpdate(&this->dyna.actor, &this->colliders[2]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[0]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[1]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[2]); this->colliders[0].dim.pos.z += 0xC8; this->colliders[1].dim.pos.z += 0xD7; this->colliders[1].dim.pos.x += 0x5A; @@ -239,15 +267,15 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) { EnBom* bomb; if (this->dyna.actor.parent == NULL) { - if ((s32)(this->colliders[1].base.maskA & 2) || (this->colliders[2].base.maskA & 2)) { + if ((s32)(this->colliders[1].base.ocFlags1 & OC1_HIT) || (this->colliders[2].base.ocFlags1 & OC1_HIT)) { - if ((s32)(this->colliders[1].base.maskA & 2)) { + if ((s32)(this->colliders[1].base.ocFlags1 & OC1_HIT)) { bomb = (EnBom*)this->colliders[1].base.oc; } else { bomb = (EnBom*)this->colliders[2].base.oc; } - this->colliders[1].base.maskA &= ~2; - this->colliders[2].base.maskA &= ~2; + this->colliders[1].base.ocFlags1 &= ~OC1_HIT; + this->colliders[2].base.ocFlags1 &= ~OC1_HIT; if (bomb->actor.type == ACTORTYPE_EXPLOSIVES && bomb->actor.id == ACTOR_EN_BOM && bomb->actor.params == 0) { this->dyna.actor.parent = &bomb->actor; bomb->timer = 50; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index b82e3d7493..2b550e8469 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -33,8 +33,22 @@ const ActorInit Bg_Gnd_Soulmeiro_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00020800, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 50, 20, 20, { 0, 0, 0 } }, }; @@ -159,13 +173,13 @@ void func_8087B284(BgGndSoulmeiro* this, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { this->actor.draw = BgGndSoulmeiro_Draw; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_198 = 40; this->actionFunc = func_8087AF38; return; } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 0f77b4f89d..0a80e8864e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -41,38 +41,87 @@ const ActorInit Bg_Haka_Sgami_InitVars = { NULL, }; -static ColliderTrisItemInit sTriItemsInit[] = { +static ColliderTrisElementInit sTrisElementsInit[4] = { { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 365.0f, 45.0f, 27.0f }, { 130.0f, 45.0f, 150.0f }, { 290.0f, 45.0f, 145.0f } } }, }, { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 250.0f, 45.0f, 90.0f }, { 50.0f, 45.0f, 80.0f }, { 160.0f, 45.0f, 160.0f } } }, }, { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { -305.0f, 33.0f, -7.0f }, { -220.0f, 33.0f, 40.0f }, { -130.0f, 33.0f, -5.0f } } }, }, { - { 0x02, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { -190.0f, 33.0f, 40.0f }, { -30.0f, 33.0f, 15.0f }, { -70.0f, 33.0f, -30.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 4, - sTriItemsInit, + sTrisElementsInit, }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 80, 130, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), @@ -108,7 +157,7 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) { this->colliderScytheCenter.dim.pos.y = thisx->posRot.pos.y; this->colliderScytheCenter.dim.pos.z = thisx->posRot.pos.z; - func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); for (i = 0; i < 4; i++) { blureInit.p1StartColor[i] = sP1StartColor[i]; @@ -174,7 +223,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { f32 actorRotYSin; f32 actorRotYCos; s32 iterateCount; - ColliderTrisItemInit* colliderList; + ColliderTrisElementInit* elementInit; if (this->timer != 0) { this->timer--; @@ -192,24 +241,25 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { iterateCount = (this->actor.params != 0) ? 4 : 2; for (i = iterateCount - 2; i < iterateCount; i++) { - colliderList = &sTrisInit.list[i]; + elementInit = &sTrisInit.elements[i]; for (j = 0; j < 3; j++) { - scytheVertices[j].x = this->actor.posRot.pos.x + colliderList->dim.vtx[j].z * actorRotYSin + - colliderList->dim.vtx[j].x * actorRotYCos; - scytheVertices[j].y = this->actor.posRot.pos.y + colliderList->dim.vtx[j].y; - scytheVertices[j].z = this->actor.posRot.pos.z + colliderList->dim.vtx[j].z * actorRotYCos - - colliderList->dim.vtx[j].x * actorRotYSin; + scytheVertices[j].x = this->actor.posRot.pos.x + elementInit->dim.vtx[j].z * actorRotYSin + + elementInit->dim.vtx[j].x * actorRotYCos; + scytheVertices[j].y = this->actor.posRot.pos.y + elementInit->dim.vtx[j].y; + scytheVertices[j].z = this->actor.posRot.pos.z + elementInit->dim.vtx[j].z * actorRotYCos - + elementInit->dim.vtx[j].x * actorRotYSin; } - func_800627A0(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + Collider_SetTrisVertices(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); for (j = 0; j < 3; j++) { scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; } - func_800627A0(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); + Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], + &scytheVertices[2]); } if ((this->unk_151 == 0) || (globalCtx->actorCtx.unk_03 != 0)) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index 240cb7f07d..fb7f5b9f9c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -17,7 +17,7 @@ typedef struct BgHakaSgami { /* 0x0154 */ s32 blureEffectIndex[2]; /* 0x015C */ ColliderCylinder colliderScytheCenter; /* 0x01A8 */ ColliderTris colliderScythe; - /* 0x01C8 */ ColliderTrisItem colliderScytheItems[4]; + /* 0x01C8 */ ColliderTrisElement colliderScytheItems[4]; } BgHakaSgami; // size = 0x0338 extern const ActorInit Bg_Haka_Sgami_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 2c85b369ab..c0b7f761f0 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -43,29 +43,64 @@ const ActorInit Bg_Haka_Trap_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_METAL_SHIELD, 0x11, 0x0D, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 30, 90, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00020000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 1800.0f, 1200.0f, 0.0f }, { -1800.0f, 1200.0f, 0.0f }, { -1800.0f, 0.0f, 0.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00020000, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00020000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 1800.0f, 1200.0f, 0.0f }, { -1800.0f, 0.0f, 0.0f }, { 1800.0f, 0.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 2, - sTrisItemsInit, + sTrisElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x00, 0x0050, 0x0064, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 100, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), @@ -137,8 +172,8 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { this->colliderCylinder.dim.radius = 18; this->colliderCylinder.dim.height = 115; - this->colliderCylinder.body.toucherFlags = this->colliderCylinder.body.toucherFlags; - this->colliderCylinder.body.toucherFlags |= 0x10; + this->colliderCylinder.info.toucherFlags = this->colliderCylinder.info.toucherFlags; + this->colliderCylinder.info.toucherFlags |= TOUCH_SFX_WOOD; this->actionFunc = func_808801B8; } @@ -151,7 +186,7 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->uncullZoneScale = 500.0f; } - func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, 0, &sColChkInfoInit); } void BgHakaTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -212,7 +247,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) { func_8087FFC0(this, globalCtx); - if (this->colliderSpikes.base.acFlags & 2) { + if (this->colliderSpikes.base.acFlags & AC_HIT) { this->timer = 20; D_80880F30 = 1; this->actionFunc = func_808802D8; @@ -475,13 +510,13 @@ void func_80880D68(BgHakaTrap* this) { Vec3f vec2; Vec3f vec1; - Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[0], &vec1); - Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[1], &vec2); - Matrix_MultVec3f(&sTrisItemsInit[0].dim.vtx[2], &vec3); - func_800627A0(&this->colliderSpikes, 0, &vec1, &vec2, &vec3); + Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[0], &vec1); + Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[1], &vec2); + Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[2], &vec3); + Collider_SetTrisVertices(&this->colliderSpikes, 0, &vec1, &vec2, &vec3); - Matrix_MultVec3f(&sTrisItemsInit[1].dim.vtx[2], &vec2); - func_800627A0(&this->colliderSpikes, 1, &vec1, &vec3, &vec2); + Matrix_MultVec3f(&sTrisElementsInit[1].dim.vtx[2], &vec2); + Collider_SetTrisVertices(&this->colliderSpikes, 1, &vec1, &vec3, &vec2); } void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index f7641d44c1..c83a7cd584 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -26,7 +26,7 @@ typedef struct BgHakaTrap { /* 0x016C */ Vec3f unk_16C; /* 0x0178 */ ColliderCylinder colliderCylinder; /* 0x01C4 */ ColliderTris colliderSpikes; - /* 0x01E4 */ ColliderTrisItem colliderSpikesItem[2]; + /* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2]; } BgHakaTrap; // size = 0x029C extern const ActorInit Bg_Haka_Trap_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 17475c9d8b..1d1a34d6a4 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -31,14 +31,42 @@ const ActorInit Bg_Haka_Tubo_InitVars = { }; static ColliderCylinderInit sPotColliderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 25, 60, 30, { 0, 0, 0 } }, }; static ColliderCylinderInit sFlamesColliderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000008, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 60, 45, 235, { 0, 0, 0 } }, }; @@ -89,13 +117,13 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) { this->dyna.actor.posRot.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f; } // Colliding with flame circle - if (this->flamesCollider.base.atFlags & 2) { - this->flamesCollider.base.atFlags &= ~2; + if (this->flamesCollider.base.atFlags & AT_HIT) { + this->flamesCollider.base.atFlags &= ~AT_HIT; func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsLink, 5.0f); } // Colliding with hitbox inside the pot - if (this->potCollider.base.acFlags & 2) { - this->potCollider.base.acFlags &= ~2; + if (this->potCollider.base.acFlags & AC_HIT) { + this->potCollider.base.acFlags &= ~AC_HIT; // If the colliding actor is within a 50 unit radius and 50 unit height cylinder centered // on the actor's position, break the pot if (func_8002DBB0(&this->dyna.actor, &this->potCollider.base.ac->posRot.pos) < 50.0f && @@ -112,8 +140,8 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) { this->actionFunc = BgHakaTubo_DropCollectible; } } else { - Collider_CylinderUpdate(&this->dyna.actor, &this->flamesCollider); - Collider_CylinderUpdate(&this->dyna.actor, &this->potCollider); + Collider_UpdateCylinder(&this->dyna.actor, &this->flamesCollider); + Collider_UpdateCylinder(&this->dyna.actor, &this->potCollider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->potCollider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->flamesCollider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->flamesCollider.base); diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 80b7f232ae..a4cbcfe377 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -30,6 +30,26 @@ const ActorInit Bg_Haka_Zou_InitVars = { (ActorFunc)BgHakaZou_Update, NULL, }; + +static ColliderCylinderInit D_808835F0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 5, 60, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Haka_Zou/BgHakaZou_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 6bbad8798c..5ede60fe52 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -33,12 +33,26 @@ typedef struct { } BgHidanCurtainParams; // size = 0x10 static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 81, 144, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sCcInfoInit = { 1, 0x50, 0x64, 0xFF }; +static CollisionCheckInfoInit sCcInfoInit = { 1, 80, 100, MASS_IMMOVABLE }; static BgHidanCurtainParams sHCParams[] = { { 81, 144, 0.090f, 144.0f, 5.0f }, { 46, 88, 0.055f, 88.0f, 3.0f } }; @@ -88,8 +102,8 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.dim.pos.z = this->actor.posRot.pos.z; this->collider.dim.radius = hcParams->radius; this->collider.dim.height = hcParams->height; - Collider_CylinderUpdate(&this->actor, &this->collider); - func_80061ED4(&thisx->colChkInfo, NULL, &sCcInfoInit); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sCcInfoInit); if (this->type == 0) { this->actionFunc = BgHidanCurtain_WaitForClear; } else { @@ -196,10 +210,10 @@ void BgHidanCurtain_Update(Actor* thisx, GlobalContext* globalCtx2) { f32 riseProgress; if ((globalCtx->cameraPtrs[0]->setting == 0x28) || (globalCtx->cameraPtrs[0]->setting == 0x38)) { - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } else { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 1.0f); } if ((this->type == 4) || (this->type == 5)) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 4b8b2ff229..55179f9861 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -30,34 +30,69 @@ const ActorInit Bg_Hidan_Dalm_InitVars = { (ActorFunc)BgHidanDalm_Draw, }; -static ColliderTrisItemInit sTrisItemInit[4] = { +static ColliderTrisElementInit sTrisElementInit[4] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { 305.0f, 0.0f, -300.0f }, { 305.0f, 600.0f, -300.0f }, { 305.0f, 600.0f, 300.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { 305.0f, 0.0f, -300.0f }, { 305.0f, 600.0f, 300.0f }, { 305.0f, 0.0f, 300.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { -305.0f, 0.0f, -300.0f }, { -305.0f, 600.0f, 300.0f }, { -305.0f, 600.0f, -300.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000040, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, { { { -305.0f, 0.0f, -300.0f }, { -305.0f, 0.0f, 300.0f }, { -305.0f, 600.0f, 300.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 4, - sTrisItemInit, + sTrisElementInit, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 65336, ICHAIN_STOP), + ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_STOP), }; extern Gfx D_0600BBF0[]; @@ -95,10 +130,11 @@ void BgHidanDalm_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->collider.base.acFlags & 2) && !Player_InCsMode(globalCtx) && + if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(globalCtx) && (player->swordAnimation == 22 || player->swordAnimation == 23)) { - this->collider.base.acFlags &= ~2; - if (this->collider.list[0].body.bumperFlags & 2 || this->collider.list[1].body.bumperFlags & 2) { + this->collider.base.acFlags &= ~AC_HIT; + if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) || + (this->collider.elements[1].info.bumperFlags & BUMP_HIT)) { this->dyna.actor.posRot.rot.y -= 0x4000; } else { this->dyna.actor.posRot.rot.y += 0x4000; @@ -161,19 +197,19 @@ void BgHidanDalm_UpdateCollider(BgHidanDalm* this) { Vec3f pos1; Vec3f pos0; - Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[0], &pos0); - Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[1], &pos1); - Matrix_MultVec3f(&sTrisItemInit[0].dim.vtx[2], &pos2); - func_800627A0(&this->collider, 0, &pos0, &pos1, &pos2); - Matrix_MultVec3f(&sTrisItemInit[1].dim.vtx[2], &pos1); - func_800627A0(&this->collider, 1, &pos0, &pos2, &pos1); + Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[0], &pos0); + Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[1], &pos1); + Matrix_MultVec3f(&sTrisElementInit[0].dim.vtx[2], &pos2); + Collider_SetTrisVertices(&this->collider, 0, &pos0, &pos1, &pos2); + Matrix_MultVec3f(&sTrisElementInit[1].dim.vtx[2], &pos1); + Collider_SetTrisVertices(&this->collider, 1, &pos0, &pos2, &pos1); - Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[0], &pos0); - Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[1], &pos1); - Matrix_MultVec3f(&sTrisItemInit[2].dim.vtx[2], &pos2); - func_800627A0(&this->collider, 2, &pos0, &pos1, &pos2); - Matrix_MultVec3f(&sTrisItemInit[3].dim.vtx[1], &pos2); - func_800627A0(&this->collider, 3, &pos0, &pos2, &pos1); + Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[0], &pos0); + Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[1], &pos1); + Matrix_MultVec3f(&sTrisElementInit[2].dim.vtx[2], &pos2); + Collider_SetTrisVertices(&this->collider, 2, &pos0, &pos1, &pos2); + Matrix_MultVec3f(&sTrisElementInit[3].dim.vtx[1], &pos2); + Collider_SetTrisVertices(&this->collider, 3, &pos0, &pos2, &pos1); } void BgHidanDalm_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h index 1044a0b988..50bde8bea9 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h @@ -13,7 +13,7 @@ typedef struct BgHidanDalm { /* 0x0164 */ BgHidanDalmActionFunc actionFunc; /* 0x0168 */ u8 switchFlag; /* 0x016C */ ColliderTris collider; - /* 0x018C */ ColliderTrisItem colliderItems[4]; + /* 0x018C */ ColliderTrisElement colliderItems[4]; } BgHidanDalm; // size = 0x02FC extern const ActorInit Bg_Hidan_Dalm_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 3840b409de..dcf8a8751e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -37,17 +37,26 @@ const ActorInit Bg_Hidan_Firewall_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 83, 0, { 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x01, - 0x0050, - 0x0064, - 0xFF, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 80, 100, MASS_IMMOVABLE }; static UNK_PTR D_80886D04[] = { 0x06015D20, 0x06016120, 0x06016520, 0x06016920, 0x06016D20, 0x06017120, 0x06017520, 0x06017920, @@ -67,7 +76,7 @@ void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.dim.pos.y = this->actor.posRot.pos.y; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actionFunc = BgHidanFirewall_Wait; } @@ -176,16 +185,16 @@ void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_150 = (this->unk_150 + 1) % 8; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; BgHidanFirewall_Collide(this, globalCtx); } this->actionFunc(this, globalCtx); if (this->actionFunc == BgHidanFirewall_Erupt) { BgHidanFirewall_ColliderFollowPlayer(this, globalCtx); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8002F974(&this->actor, NA_SE_EV_FIRE_PLATE - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 1d3007ec35..eb8252faca 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -41,8 +41,22 @@ const ActorInit Bg_Hidan_Fwbig_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x09, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 130, 0, { 0, 0, 0 } }, }; @@ -58,7 +72,7 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->direction = (u16)(thisx->params >> 8); thisx->params &= 0xFF; if (this->direction != 0) { @@ -205,8 +219,8 @@ void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgHidanFwbig* this = THIS; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.posRot.rot.y, 1.0f); if (this->direction != 0) { this->actionFunc = BgHidanFwbig_Lower; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index adceaf2e4c..c2468da577 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -30,21 +30,42 @@ static f32 sYPosOffsets[] = { -20.0f, -120.0f, -220.0f, -320.0f, -420.0f, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -20.0f, 3.0f, -20.0f }, { -20.0f, 3.0f, 20.0f }, { 20.0f, 3.0f, 20.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 20.0f, 3.0f, 20.0f }, { 20.0f, 3.0f, -20.0f }, { -20.0f, 3.0f, -20.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, - ARRAY_COUNT(sTrisItemsInit), - sTrisItemsInit, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, + 2, + sTrisElementsInit, }; const ActorInit Bg_Hidan_Hamstep_InitVars = { @@ -100,7 +121,7 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx) params |= (this->dyna.actor.params & 0xFF00); step = (BgHidanHamstep*)Actor_SpawnAsChild( - &globalCtx2->actorCtx, step, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, + &globalCtx2->actorCtx, &step->dyna.actor, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, params); if (step == NULL) { @@ -119,7 +140,7 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i2; BgHidanHamstep* step; - DynaPolyActor_Init(&this->dyna.actor, DPM_PLAYER); + DynaPolyActor_Init(&this->dyna, DPM_PLAYER); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if ((this->dyna.actor.params & 0xFF) == 0) { @@ -128,11 +149,11 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < 2; i++) { for (i2 = 0; i2 < 3; i2++) { - sp48[i2].x = sTrisInit.list[i].dim.vtx[i2].x + this->dyna.actor.initPosRot.pos.x; - sp48[i2].y = sTrisInit.list[i].dim.vtx[i2].y + this->dyna.actor.initPosRot.pos.y; - sp48[i2].z = sTrisInit.list[i].dim.vtx[i2].z + this->dyna.actor.initPosRot.pos.z; + sp48[i2].x = sTrisInit.elements[i].dim.vtx[i2].x + this->dyna.actor.initPosRot.pos.x; + sp48[i2].y = sTrisInit.elements[i].dim.vtx[i2].y + this->dyna.actor.initPosRot.pos.y; + sp48[i2].z = sTrisInit.elements[i].dim.vtx[i2].z + this->dyna.actor.initPosRot.pos.z; } - func_800627A0(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]); + Collider_SetTrisVertices(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]); } } @@ -174,7 +195,7 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { while (step != NULL) { Actor_Kill(&step->dyna.actor); - step = step->dyna.actor.child; + step = (BgHidanHamstep*)step->dyna.actor.child; } } } @@ -213,13 +234,13 @@ void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) { } void func_80888638(BgHidanHamstep* this, GlobalContext* globalCtx) { - BgHidanHamstep* child = this->dyna.actor.child; + BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { if ((child->dyna.actor.params & 0xFF) != 0) { func_808884C8(child, globalCtx); } - child = child->dyna.actor.child; + child = (BgHidanHamstep*)child->dyna.actor.child; } } @@ -234,18 +255,18 @@ void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { } } - child = this->dyna.actor.child; + child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { if (this->dyna.actor.posRot.pos.y < child->dyna.actor.posRot.pos.y) { child->dyna.actor.posRot.pos.y = this->dyna.actor.posRot.pos.y; } - child = child->dyna.actor.child; + child = (BgHidanHamstep*)child->dyna.actor.child; } } void func_80888734(BgHidanHamstep* this) { - BgHidanHamstep* parent = this->dyna.actor.parent; + BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent; f32 factor = SREG(30) * 0.5f; if (parent != NULL) { @@ -262,14 +283,14 @@ void func_80888734(BgHidanHamstep* this) { } void func_808887C4(BgHidanHamstep* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_800800F8(globalCtx, 3310, 100, &this->dyna.actor, 0); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); - this->collider.base.acFlags = 0; + this->collider.base.acFlags = AC_NONE; BgHidanHamstep_SetupAction(this, 1); Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0xFF); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -300,7 +321,7 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { Quake_SetCountdown(quakeIndex, 20); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); func_800AA000(this->dyna.actor.xyzDistToLinkSq, 255, 20, 150); - func_80888638(&this->dyna.actor, globalCtx); + func_80888638(this, globalCtx); osSyncPrintf("A(%d)\n", this->dyna.actor.params); } } @@ -309,7 +330,7 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { void func_808889B8(BgHidanHamstep* this, GlobalContext* globalCtx) { s32 pad; - BgHidanHamstep* parent = this->dyna.actor.parent; + BgHidanHamstep* parent = (BgHidanHamstep*)this->dyna.actor.parent; func_80888734(this); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h index e64a91bf93..2ecd7ee2c6 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h @@ -11,7 +11,7 @@ typedef void (*BgHidanHamstepActionFunc)(struct BgHidanHamstep*, GlobalContext*) typedef struct BgHidanHamstep { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderTris collider; - /* 0x0184 */ ColliderTrisItem colliderItems[2]; + /* 0x0184 */ ColliderTrisElement colliderItems[2]; /* 0x023C */ BgHidanHamstepActionFunc actionFunc; /* 0x0240 */ s32 action; /* 0x0244 */ s32 unk_244; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 196152636c..c43fcfdfe5 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -29,6 +29,44 @@ const ActorInit Bg_Hidan_Hrock_InitVars = { (ActorFunc)BgHidanHrock_Update, (ActorFunc)BgHidanHrock_Draw, }; + +static ColliderTrisElementInit D_80889820[2] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, + { { { -40.0f, 3.0f, -40.0f }, { -40.0f, 3.0f, 40.0f }, { 40.0f, 3.0f, 40.0f } } }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, + { { { 40.0f, 3.0f, 40.0f }, { 40.0f, 3.0f, -40.0f }, { -40.0f, 3.0f, -40.0f } } }, + }, +}; + +static ColliderTrisInit D_80889898 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, + 2, + D_80889820, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Hrock/BgHidanHrock_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 3910fbfb97..a0bc3555fd 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -38,15 +38,31 @@ const ActorInit Bg_Hidan_Kowarerukabe_InitVars = { static Gfx* sBreakableWallDLists[] = { 0x0600B9C0, 0x0600C038, 0x0600B900 }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, - { 0, { { 0, 0, 0 }, 100 }, 100 }, -} }; +static ColliderJntSphElementInit sJntSphElementsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 100 }, 100 }, + }, +}; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphItemsInit), - sJntSphItemsInit, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementsInit, }; void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { @@ -72,8 +88,8 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, GlobalCon Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.list[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF]; - this->collider.list[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF]; + this->collider.elements[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF]; + this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF]; } void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { @@ -311,7 +327,7 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[this->dyna.actor.params & 0xFF]); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 573); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h index 692fa4366b..80996a4082 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h @@ -9,7 +9,7 @@ struct BgHidanKowarerukabe; typedef struct BgHidanKowarerukabe { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph collider; - /* 0x0184 */ ColliderJntSphItem colliderItems[1]; + /* 0x0184 */ ColliderJntSphElement colliderItems[1]; } BgHidanKowarerukabe; // size = 0x01C4 extern const ActorInit Bg_Hidan_Kowarerukabe_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index aeb48a58df..b2e30caa43 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -27,6 +27,26 @@ const ActorInit Bg_Hidan_Rock_InitVars = { (ActorFunc)BgHidanRock_Update, (ActorFunc)BgHidanRock_Draw, }; + +static ColliderCylinderInit D_8088BF8C = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 45, 77, -40, { 3310, 120, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index 77f560850f..8c016d664a 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -21,37 +21,86 @@ const ActorInit Bg_Hidan_Rsekizou_InitVars = { (ActorFunc)BgHidanRsekizou_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[6] = { +static ColliderJntSphElementInit sJntSphElementsInit[6] = { { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 0, 30, 40 }, 25 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { -35, 32, 77 }, 32 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { -80, 35, 130 }, 42 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 0, 30, -40 }, 25 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 35, 32, -77 }, 32 }, 100 }, }, { - { 0x00, { 0x20000000, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 1, { { 80, 35, -130 }, 42 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 6, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -81,7 +130,7 @@ void BgHidanRsekizou_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) { - this->collider.list[i].dim.worldSphere.radius = this->collider.list[i].dim.modelSphere.radius; + this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius; } this->burnFrame = 0; this->bendFrame = 0; @@ -97,7 +146,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) { BgHidanRsekizou* this = THIS; s32 i; - ColliderJntSphItem* sphere; + ColliderJntSphElement* sphere; s32 pad; f32 yawSine; f32 yawCosine; @@ -117,7 +166,7 @@ void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) { yawCosine = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) { - sphere = &this->collider.list[i]; + sphere = &this->collider.elements[i]; sphere->dim.worldSphere.center.x = this->dyna.actor.initPosRot.pos.x + yawCosine * sphere->dim.modelSphere.center.x + yawSine * sphere->dim.modelSphere.center.z; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h index 5a4f80a575..465ffeb4aa 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h @@ -11,7 +11,7 @@ typedef struct BgHidanRsekizou { /* 0x0164 */ s16 bendFrame; /* 0x0166 */ s16 burnFrame; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItems[6]; + /* 0x0188 */ ColliderJntSphElement colliderItems[6]; } BgHidanRsekizou; // size = 0x0308 extern const ActorInit Bg_Hidan_Rsekizou_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index 2f49bb218d..4dc6d98337 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -26,6 +26,88 @@ const ActorInit Bg_Hidan_Sekizou_InitVars = { (ActorFunc)BgHidanSekizou_Update, (ActorFunc)BgHidanSekizou_Draw, }; + +static ColliderJntSphElementInit D_8088E180[6] = { + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 30, 40 }, 23 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 32, 87 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 35, 150 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 30, 40 }, 23 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 32, 87 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 35, 150 }, 40 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8088E258 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 6, + D_8088E180, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sekizou/func_8088CEC0.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index f303aca374..0603e79f1d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -27,6 +27,44 @@ const ActorInit Bg_Hidan_Sima_InitVars = { (ActorFunc)BgHidanSima_Update, (ActorFunc)BgHidanSima_Draw, }; + +static ColliderJntSphElementInit D_8088F1A0[2] = { + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 1, { { 0, 40, 100 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 1, { { 0, 40, 145 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8088F1E8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 2, + D_8088F1A0, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Sima/BgHidanSima_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index e132947ccb..fa04dc3ddb 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -27,6 +27,46 @@ const ActorInit Bg_Ice_Shelter_InitVars = { (ActorFunc)BgIceShelter_Update, (ActorFunc)BgIceShelter_Draw, }; + +static ColliderCylinderInit D_8089170C = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, 0, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80891738 = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFF6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, 0, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ice_Shelter/func_80890740.s") diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index e286c7366d..4feb20b469 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -22,8 +22,22 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx); void BgIceTurara_Regrow(BgIceTurara* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x4FC007CA, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x4FC007CA, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 13, 120, 0, { 0, 0, 0 } }, }; @@ -59,7 +73,7 @@ void BgIceTurara_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06002594, &colHeader); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); if (this->dyna.actor.params == TURARA_STALAGMITE) { this->actionFunc = BgIceTurara_Stalagmite; @@ -104,7 +118,7 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) { } void BgIceTurara_Stalagmite(BgIceTurara* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { BgIceTurara_Break(this, globalCtx, 50.0f); Actor_Kill(&this->dyna.actor); return; @@ -133,7 +147,7 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) { if (this->shiverTimer == 0) { this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x; this->dyna.actor.posRot.pos.z = this->dyna.actor.initPosRot.pos.z; - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgIceTurara_Fall; @@ -148,8 +162,8 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) { } void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) { - if ((this->collider.base.atFlags & 2) || (this->dyna.actor.bgCheckFlags & 1)) { - this->collider.base.atFlags &= ~2; + if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & 1)) { + this->collider.base.atFlags &= ~AT_HIT; this->dyna.actor.bgCheckFlags &= ~1; if (this->dyna.actor.posRot.pos.y < this->dyna.actor.groundY) { this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; @@ -168,7 +182,7 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) { this->dyna.actor.posRot.pos.y += 40.0f; func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); this->dyna.actor.posRot.pos.y -= 40.0f; - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index e588b79a36..da23f69d81 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -39,8 +39,22 @@ const ActorInit Bg_Jya_1flift_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 70, 80, -82, { 0, 0, 0 } }, }; @@ -77,7 +91,7 @@ void BgJya1flift_InitCollision(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; } void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -186,8 +200,8 @@ void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->isLinkRiding = tempIsRiding; - Collider_CylinderUpdate(thisx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } else { Actor_Kill(thisx); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index e6fb1b04db..aaaf9fc72a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -28,17 +28,31 @@ const ActorInit Bg_Jya_Bombchuiwa_InitVars = { (ActorFunc)BgJyaBombchuiwa_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { -300, 0, 0 }, 40 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x21, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -135,7 +149,7 @@ void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* } void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & 2) || (this->timer > 0)) { + if ((this->collider.base.acFlags & AC_HIT) || (this->timer > 0)) { if (this->timer == 0) { func_800800F8(globalCtx, 3410, -99, &this->actor, 0); } @@ -146,8 +160,8 @@ void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* glob Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); } } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -220,7 +234,7 @@ void BgJyaBombchuiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->drawFlags & 1) { Gfx_DrawDListOpa(globalCtx, &D_0600E8D0); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } if (this->drawFlags & 2) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h index d9e9a2353a..3b03360be0 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h @@ -12,7 +12,7 @@ typedef struct BgJyaBombchuiwa { /* 0x0000 */ Actor actor; /* 0x014C */ BgJyaBombchuiwaActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems; + /* 0x0170 */ ColliderJntSphElement colliderItems; /* 0x01B0 */ f32 lightRayIntensity; /* 0x01B4 */ s16 timer; /* 0x01B6 */ u8 drawFlags; // Used to determine how the actor is drawn. diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index c3d6266c3d..c5818724a8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -23,16 +23,30 @@ const ActorInit Bg_Jya_Bombiwa_InitVars = { (ActorFunc)BgJyaBombiwa_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 50 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit, + &sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), @@ -143,13 +157,13 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) { void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { BgJyaBombiwa* this = THIS; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -157,5 +171,5 @@ void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { BgJyaBombiwa* this = THIS; Gfx_DrawDListOpa(globalCtx, D_0600E490); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h index 965c3a2ccd..c42747f557 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h @@ -11,7 +11,7 @@ typedef struct BgJyaBombiwa { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ s32 unk_164; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItems; + /* 0x0188 */ ColliderJntSphElement colliderItems; } BgJyaBombiwa; // size = 0x01C8 extern const ActorInit Bg_Jya_Bombiwa_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index b9f0b0b85f..0926d5e4ee 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -37,20 +37,34 @@ const ActorInit Bg_Jya_Goroiwa_InitVars = { }; extern Gfx D_060006B0[]; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 58 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x01, 0xF, 0x0, 0xFE }; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 0, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), @@ -60,7 +74,7 @@ static InitChainEntry sInitChain[] = { }; void func_80897970(BgJyaGoroiwa* this) { - Sphere16* worldSphere = &this->collider.list->dim.worldSphere; + Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; worldSphere->center.x = this->actor.posRot.pos.x; worldSphere->center.y = (s32)(this->actor.posRot.pos.y + 59.5f); @@ -73,15 +87,13 @@ void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItem); func_80897970(this); - this->collider.list->dim.worldSphere.radius = 0x3A; + this->collider.elements[0].dim.worldSphere.radius = 58; } void func_80897A2C(BgJyaGoroiwa* this) { - Actor* thisx = &this->actor; - f32 rotFactor = 175.30046f; - f32 posDiff = thisx->posRot.pos.x - thisx->pos4.x; + f32 posDiff = this->actor.posRot.pos.x - this->actor.pos4.x; - thisx->shape.rot.z -= rotFactor * posDiff; + this->actor.shape.rot.z -= 0x10000 / (119 * M_PI) * posDiff; } void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -89,10 +101,8 @@ void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); func_808979C0(this, globalCtx); - this->actor.shape.rot.z = 0; - this->actor.shape.rot.y = this->actor.shape.rot.z; - this->actor.shape.rot.x = this->actor.shape.rot.z; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0; + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); ActorShape_Init(&this->actor.shape, 595.0f, &ActorShadow_DrawFunc_Circle, 9.0f); this->actor.shape.unk_14 = 0x80; func_80897B1C(this); @@ -106,7 +116,7 @@ void BgJyaGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80897B1C(BgJyaGoroiwa* this) { this->actionFunc = func_80897B48; - this->collider.base.atFlags = this->collider.base.atFlags | 1; + this->collider.base.atFlags |= AT_ON; this->unk_1B4 = 0; this->unk_1B0 = 1.0f; } @@ -137,8 +147,8 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) { thisx->posRot.pos.y = (0.38043478f * tmpf1) - 129.5f; } - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~3; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT & ~AT_ON; tmp16 = thisx->yawTowardsLink - thisx->posRot.rot.y; if ((tmp16 >= -0x3FFF) && (tmp16 < 0x4000)) { @@ -202,7 +212,7 @@ void BgJyaGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &pos); func_80897970(this); - if (this->collider.base.atFlags & 1) { + if (this->collider.base.atFlags & AT_ON) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h index 7859396a1e..5641aea257 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h @@ -12,7 +12,7 @@ typedef struct BgJyaGoroiwa { /* 0x0000 */ Actor actor; /* 0x014C */ BgJyaGoroiwaFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItem; + /* 0x0170 */ ColliderJntSphElement colliderItem; /* 0x01B0 */ f32 unk_1B0; /* 0x01B4 */ s16 unk_1B4; /* 0x01B6 */ s16 unk_1B6; diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index f027aa244f..e5250d1c21 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -35,17 +35,31 @@ const ActorInit Bg_Jya_Haheniron_InitVars = { (ActorFunc)BgJyaHaheniron_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 10 }, 100 }, }, }; -static ColliderJntSphInit D_80898764 = { - { COLTYPE_UNK10, 0x11, 0x01, 0x00, 0x00, COLSHAPE_JNTSPH }, +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static s16 sKakeraScales[] = { 5, 8, 11, 14, 17 }; @@ -68,7 +82,7 @@ void BgJyaHaheniron_ColliderInit(BgJyaHaheniron* this, GlobalContext* globalCtx) s32 pad; Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &D_80898764, this->colliderItems); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); } void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f* vec2) { @@ -95,7 +109,7 @@ void BgJyaHaheniron_SpawnFragments(GlobalContext* globalCtx, Vec3f* vec1, Vec3f* } EffectSsKakera_Spawn(globalCtx, vec1, &vel, vec1, -350, arg5, 40, 4, 0, sKakeraScales[i], 0, 20, 40, - KAKERA_COLOR_NONE, OBJECT_JYA_IRON, &D_06000880); + KAKERA_COLOR_NONE, OBJECT_JYA_IRON, D_06000880); angle += 0x3333; } pos.x = vec1->x + (vec2->x * 5.0f); @@ -139,17 +153,17 @@ void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx) Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85); - if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & 2) && (this->collider.base.at != NULL) && + if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) && (this->collider.base.at->type == ACTORTYPE_PLAYER))) { vec.x = -Rand_ZeroOne() * this->actor.velocity.x; vec.y = -Rand_ZeroOne() * this->actor.velocity.y; vec.z = -Rand_ZeroOne() * this->actor.velocity.z; - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, &vec); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, &vec); Actor_Kill(&this->actor); } else if (this->timer > 60) { Actor_Kill(&this->actor); } else { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } this->actor.shape.rot.y += 0x4B0; this->actor.shape.rot.x += 0xFA0; @@ -163,7 +177,7 @@ void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx if (this->timer >= 8) { Actor_MoveForward(&this->actor); } else if (this->timer >= 17) { - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, D_808987A0); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, D_808987A0); Actor_Kill(&this->actor); } this->actor.shape.rot.y += 0x258; @@ -176,8 +190,8 @@ void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this) { void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx) { if (this->timer >= 17) { - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot, D_808987AC); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, D_808987AC); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); Actor_Kill(&this->actor); } } @@ -196,7 +210,7 @@ void BgJyaHaheniron_Draw(Actor* thisx, GlobalContext* globalCtx) { BgJyaHaheniron* this = THIS; if (this->actor.params == 0) { - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } Gfx_DrawDListOpa(globalCtx, dLists[this->actor.params]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h index dc698b72ca..c25b443dfe 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h @@ -12,7 +12,7 @@ typedef struct BgJyaHaheniron { /* 0x0000 */ Actor actor; /* 0x014C */ BgJyaHahenironActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ s16 timer; } BgJyaHaheniron; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 0fcf2c89d8..cafa2768a1 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -23,6 +23,26 @@ const ActorInit Bg_Jya_Ironobj_InitVars = { (ActorFunc)BgJyaIronobj_Update, (ActorFunc)BgJyaIronobj_Draw, }; + +static ColliderCylinderInit D_808994AC = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 150, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_808988A0.s") diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 13fcc1ce60..72dc49dd3b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -39,17 +39,31 @@ const ActorInit Bg_Jya_Megami_InitVars = { (ActorFunc)BgJyaMegami_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, - { 0x00, { { 0x0000, 0xFDA8, 0xFF38 }, 0x003C }, 0x0064 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00200000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, -600, -200 }, 60 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static BgJyaMegamiPieceInit sPiecesInit[] = { @@ -185,9 +199,9 @@ void BgJyaMegami_SetupDetectLight(BgJyaMegami* this) { } void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 0x2) { + if (this->collider.base.acFlags & AC_HIT) { this->lightTimer++; - this->collider.base.acFlags &= ~0x2; + this->collider.base.acFlags &= ~AC_HIT; if (globalCtx->gameplayFrames % 4 == 0) { func_8089A41C(this, globalCtx, (this->crumbleIndex * 0.04f) + 0.05f); } @@ -334,7 +348,7 @@ void BgJyaMegami_DrawExplode(BgJyaMegami* this, GlobalContext* globalCtx) { void BgJyaMegami_Draw(Actor* thisx, GlobalContext* globalCtx) { BgJyaMegami* this = THIS; - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); if (this->actionFunc == BgJyaMegami_Explode) { BgJyaMegami_DrawExplode(this, globalCtx); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h index 7a52d11a28..4e6450d53d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h @@ -19,7 +19,7 @@ typedef struct BgJyaMegami { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ BgJyaMegamiActionFunc actionFunc; /* 0x0168 */ ColliderJntSph collider; - /* 0x0188 */ ColliderJntSphItem colliderItem; + /* 0x0188 */ ColliderJntSphElement colliderItem; /* 0x01C8 */ s16 lightTimer; /* 0x01CA */ s16 explosionTimer; /* 0x01CC */ s16 crumbleIndex; diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 7b7574c589..235b6befe0 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -30,17 +30,31 @@ const ActorInit Bg_Menkuri_Eye_InitVars = { extern Gfx D_06002D20[]; static s32 D_8089C1A0; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 1, { { 0, 0, 0 }, 14 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -49,15 +63,15 @@ static InitChainEntry sInitChain[] = { void BgMenkuriEye_Init(Actor* thisx, GlobalContext* globalCtx) { BgMenkuriEye* this = THIS; - ColliderJntSphItem* colliderList; + ColliderJntSphElement* colliderList; Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); - this->collider.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list->dim.worldSphere.center.y = this->actor.posRot.pos.y; - this->collider.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; - colliderList = this->collider.list; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + colliderList = this->collider.elements; colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius; if (!Flags_GetSwitch(globalCtx, this->actor.params)) { D_8089C1A0 = 0; @@ -85,9 +99,9 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) { } } } - if ((this->collider.base.acFlags & 2) && + if ((this->collider.base.acFlags & AC_HIT) && (ABS((s16)(this->collider.base.ac->posRot.rot.y - this->actor.shape.rot.y)) > 0x5000)) { - this->collider.base.acFlags &= ~0x2; + this->collider.base.acFlags &= ~AC_HIT; if (this->framesUntilDisable == -1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_AMOS_DAMAGE); D_8089C1A0 += 1; diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h index 07b5fba7e9..8bea99133e 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h @@ -10,7 +10,7 @@ typedef struct BgMenkuriEye { /* 0x0000 */ Actor actor; /* 0x014C */ s16 framesUntilDisable; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; } BgMenkuriEye; // size = 0x01B0 extern const ActorInit Bg_Menkuri_Eye_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 55d4fb12eb..b8c7153a35 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -31,55 +31,118 @@ const ActorInit Bg_Mizu_Bwall_InitVars = { (ActorFunc)BgMizuBwall_Draw, }; -static ColliderTrisItemInit sTrisElementInitFloor[2] = { +static ColliderTrisElementInit sTrisElementInitFloor[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -40.0f, 0.0f, -40.0f }, { -40.0f, 0.0f, 40.0f }, { 40.0f, 0.0f, 40.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -40.0f, 0.0f, -40.0f }, { 40.0f, 0.0f, 40.0f }, { 40.0f, 0.0f, -40.0f } } }, }, }; static ColliderTrisInit sTrisInitFloor = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementInitFloor, }; -static ColliderTrisItemInit sTrisElementInitRutoWall[1] = { +static ColliderTrisElementInit sTrisElementInitRutoWall[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 116.0f, 0.0f }, { 0.0f, 0.0f, 70.0f }, { 0.0f, 0.0f, -70.0f } } }, }, }; static ColliderTrisInit sTrisInitRutoWall = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 1, sTrisElementInitRutoWall, }; -static ColliderTrisItemInit sTrisElementInitWall[2] = { +static ColliderTrisElementInit sTrisElementInitWall[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 120.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 60.0f, 0.0f, 0.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 120.0f, 0.0f }, { 60.0f, 0.0f, 0.0f }, { 60.0f, 120.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInitUnusedWall = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementInitWall, }; static ColliderTrisInit sTrisInitStingerWall = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementInitWall, }; @@ -138,15 +201,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); vtx[j].x += this->dyna.actor.posRot.pos.x; vtx[j].y += this->dyna.actor.posRot.pos.y; vtx[j].z += this->dyna.actor.posRot.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -174,15 +237,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) { for (j = 0; j < 3; j++) { - offset.x = sTrisInitRutoWall.list[i].dim.vtx[j].x; - offset.y = sTrisInitRutoWall.list[i].dim.vtx[j].y; - offset.z = sTrisInitRutoWall.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitRutoWall.elements[i].dim.vtx[j].x; + offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y; + offset.z = sTrisInitRutoWall.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); vtx[j].x += this->dyna.actor.posRot.pos.x; vtx[j].y += this->dyna.actor.posRot.pos.y; vtx[j].z += this->dyna.actor.posRot.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -212,15 +275,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitUnusedWall. - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); vtx[j].x += this->dyna.actor.posRot.pos.x; vtx[j].y += this->dyna.actor.posRot.pos.y; vtx[j].z += this->dyna.actor.posRot.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -250,15 +313,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitStingerWall. - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); vtx[j].x += this->dyna.actor.posRot.pos.x; vtx[j].y += this->dyna.actor.posRot.pos.y; vtx[j].z += this->dyna.actor.posRot.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -288,15 +351,15 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { for (j = 0; j < 3; j++) { //! @bug This uses the wrong set of collision triangles, causing the collider to be //! flat to the ground instead of vertical. It should use sTrisInitStingerWall. - offset.x = sTrisInitFloor.list[i].dim.vtx[j].x; - offset.y = sTrisInitFloor.list[i].dim.vtx[j].y; - offset.z = sTrisInitFloor.list[i].dim.vtx[j].z + 2.0f; + offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; + offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; + offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); vtx[j].x += this->dyna.actor.posRot.pos.x; vtx[j].y += this->dyna.actor.posRot.pos.y; vtx[j].z += this->dyna.actor.posRot.pos.z; } - func_800627A0(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); + Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } this->actionFunc = BgMizuBwall_Idle; } @@ -399,8 +462,8 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, GlobalContext* globalCtx) { void BgMizuBwall_Idle(BgMizuBwall* this, GlobalContext* globalCtx) { BgMizuBwall_SetAlpha(this, globalCtx); - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; Flags_SetSwitch(globalCtx, ((u16)this->dyna.actor.params >> 8) & 0x3F); this->breakTimer = 1; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h index 5814be5942..2b01ce9f57 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h @@ -11,7 +11,7 @@ typedef void (*BgMizuBwallActionFunc)(struct BgMizuBwall*, GlobalContext*); typedef struct BgMizuBwall { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderTris collider; - /* 0x0184 */ ColliderTrisItem elements[3]; // only ever uses 2 + /* 0x0184 */ ColliderTrisElement elements[3]; // only ever uses 2 /* 0x0298 */ BgMizuBwallActionFunc actionFunc; /* 0x029C */ f32 yRot; /* 0x02A0 */ s32 scrollAlpha1; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index 727c869fb7..e481ee3289 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -41,17 +41,31 @@ const ActorInit Bg_Mori_Hashigo_InitVars = { NULL, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 25 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChainClasp[] = { @@ -94,10 +108,10 @@ void BgMoriHashigo_InitCollider(BgMoriHashigo* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.list[0].dim.worldSphere.center.x = (s16)this->dyna.actor.posRot.pos.x; - this->collider.list[0].dim.worldSphere.center.y = (s16)this->dyna.actor.posRot.pos.y + 21; - this->collider.list[0].dim.worldSphere.center.z = (s16)this->dyna.actor.posRot.pos.z; - this->collider.list[0].dim.worldSphere.radius = 19; + this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.posRot.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.posRot.pos.y + 21; + this->collider.elements[0].dim.worldSphere.center.z = (s16)this->dyna.actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.radius = 19; } s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) { @@ -205,8 +219,8 @@ void BgMoriHashigo_SetupClasp(BgMoriHashigo* this) { void BgMoriHashigo_Clasp(BgMoriHashigo* this, GlobalContext* globalCtx) { if (this->hitTimer <= 0) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->hitTimer = 10; } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index 0cb728dd98..aeeea7fc71 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -11,7 +11,7 @@ typedef void (*BgMoriHashigoActionFunc)(struct BgMoriHashigo*, GlobalContext*); typedef struct BgMoriHashigo { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph collider; - /* 0x0184 */ ColliderJntSphItem colliderItems[1]; + /* 0x0184 */ ColliderJntSphElement colliderItems[1]; /* 0x01C4 */ BgMoriHashigoActionFunc actionFunc; /* 0x01C8 */ s16 hitTimer; /* 0x01CA */ s16 bounceCounter; diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 0a4841443e..241d59eb95 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -48,21 +48,42 @@ const ActorInit Bg_Po_Event_InitVars = { (ActorFunc)BgPoEvent_Draw, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 25.0f, 33.0f, 0.0f }, { -25.0f, 33.0f, 0.0f }, { -25.0f, -33.0f, 0.0f } } }, }, { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 25.0f, 33.0f, 0.0f }, { -25.0f, -33.0f, 0.0f }, { 25.0f, -33.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 2, - sTrisItemsInit, + sTrisElementsInit, }; static u8 sBlocksAtRest = 0; @@ -75,7 +96,7 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { static s16 paintingPosX[] = { -1302, -866, 1421, 985 }; static s16 paintingPosY[] = { 1107, 1091 }; static s16 paintingPosZ[] = { -3384, -3252 }; - ColliderTrisItemInit* item; + ColliderTrisElementInit* item; Vec3f* vtxVec; s32 i1; s32 i2; @@ -96,7 +117,7 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { scaleY = 1.0f; } for (i1 = 0; i1 < sTrisInit.count; i1++) { - item = &sTrisInit.list[i1]; + item = &sTrisInit.elements[i1]; if (1) {} // This section looks like a macro of some sort. for (i2 = 0; i2 < 3; i2++) { vtxVec = &item->dim.vtx[i2]; @@ -104,7 +125,7 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.initPosRot.pos.y; sp9C[i2].z = this->dyna.actor.initPosRot.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); } - func_800627A0(&this->collider, i1, &sp9C[0], &sp9C[1], &sp9C[2]); + Collider_SetTrisVertices(&this->collider, i1, &sp9C[0], &sp9C[1], &sp9C[2]); } if ((this->type != 4) && (this->index != 2)) { phi_t2 = (this->type == 2) ? this->index : this->index + 2; @@ -434,7 +455,7 @@ void BgPoEvent_BlockSolved(BgPoEvent* this, GlobalContext* globalCtx) { } void BgPoEvent_AmyWait(BgPoEvent* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { sPuzzleState |= 0x20; this->timer = 5; func_8003426C(&this->dyna.actor, 0x4000, 0xFF, 0, 5); @@ -518,7 +539,7 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) { this->timer = 0; Audio_PlayActorSound2(thisx, NA_SE_EN_PO_LAUGH); this->actionFunc = BgPoEvent_PaintingVanish; - } else if (this->collider.base.acFlags & 2) { + } else if (this->collider.base.acFlags & AC_HIT) { if (!BgPoEvent_NextPainting(this)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->posRot.pos.x, thisx->posRot.pos.y - 40.0f, thisx->posRot.pos.z, 0, thisx->shape.rot.y, 0, diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h index a22b332cc0..e742d4cbd6 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h @@ -16,7 +16,7 @@ typedef struct BgPoEvent { /* 0x016A */ s8 direction; /* 0x016C */ s16 timer; /* 0x0170 */ ColliderTris collider; - /* 0x0190 */ ColliderTrisItem colliderItems[2]; + /* 0x0190 */ ColliderTrisElement colliderItems[2]; } BgPoEvent; // size = 0x0248 extern const ActorInit Bg_Po_Event_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index fd90ab6168..c608cd05da 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -25,8 +25,22 @@ void BgPoSyokudai_Update(Actor* thisx, GlobalContext* globalCtx); void BgPoSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 12, 60, 0, { 0, 0, 0 } }, }; @@ -72,7 +86,7 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { this->flameColor = (thisx->params >> 8) & 0xFF; thisx->params &= 0x3F; - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); Lights_PointGlowSetInfo(&this->lightInfo, thisx->posRot.pos.x, (s16)thisx->posRot.pos.y + 65, thisx->posRot.pos.z, diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 4acfdaa789..4a386d3f45 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -29,6 +29,33 @@ const ActorInit Bg_Spot06_Objects_InitVars = { (ActorFunc)BgSpot06Objects_Update, (ActorFunc)BgSpot06Objects_Draw, }; + +static ColliderJntSphElementInit D_808AF930[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000080, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 1, { { 0, 0, -160 }, 18 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808AF954 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 1, + D_808AF930, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot06_Objects/BgSpot06Objects_Init.s") diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index ad5bac8e6b..ae21bdbf3d 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -35,25 +35,53 @@ extern Gfx D_0500A880[]; extern CollisionHeader D_060039D4; extern Gfx D_06003898[]; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 50, 50 }, 70 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { -100, 50, 50 }, 70 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 100, 50, 50 }, 70 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 3, - sJntSphItemsInit, + sJntSphElementsInit, }; static Vec3f D_808B08AC[] = { @@ -158,7 +186,7 @@ void BgSpot08Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { BgSpot08Bakudankabe* this = THIS; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); @@ -172,8 +200,8 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { void BgSpot08Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx) { BgSpot08Bakudankabe* this = THIS; - func_800628A4(0, &this->collider); - func_800628A4(1, &this->collider); - func_800628A4(2, &this->collider); + Collider_UpdateSpheres(0, &this->collider); + Collider_UpdateSpheres(1, &this->collider); + Collider_UpdateSpheres(2, &this->collider); Gfx_DrawDListOpa(globalCtx, D_06003898); } diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h index 65c6f28858..eb166e19f6 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h @@ -9,7 +9,7 @@ struct BgSpot08Bakudankabe; typedef struct BgSpot08Bakudankabe { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph collider; - /* 0x0184 */ ColliderJntSphItem colliderItems[3]; + /* 0x0184 */ ColliderJntSphElement colliderItems[3]; } BgSpot08Bakudankabe; // size = 0x0244 extern const ActorInit Bg_Spot08_Bakudankabe_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index cbaba02def..98bb62497d 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -30,8 +30,22 @@ const ActorInit Bg_Spot11_Bakudankabe_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 40, 80, 0, { 2259, 108, -1580 } }, }; @@ -123,7 +137,7 @@ void BgSpot11Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot11Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { BgSpot11Bakudankabe* this = THIS; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); Audio_PlaySoundAtPosition(globalCtx, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index d684c39f9c..595b3808cd 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -36,22 +36,50 @@ static s16 D_808B5DD8[][10] = { { 0x0006, 0x0009, 0x0028, 0x0000, 0x0BB8, 0xD8F0, 0x001E, 0x0000, 0x0000, 0x0000 }, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFF6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 50, 0 }, 288 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 190, 80, 0, { 10, 0, 50 } }, }; @@ -127,11 +155,11 @@ void func_808B4C4C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { s32 pad; Collider_InitJntSph(globalCtx, &this->colliderJntSph); - Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphItems); - this->colliderJntSph.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->colliderJntSph.list->dim.worldSphere.center.y = this->actor.posRot.pos.y + 50.0f; - this->colliderJntSph.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; - this->colliderJntSph.list->dim.worldSphere.radius = 120; + Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderElements); + this->colliderJntSph.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->colliderJntSph.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + 50.0f; + this->colliderJntSph.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->colliderJntSph.elements[0].dim.worldSphere.radius = 120; } void func_808B4D04(BgSpot16Bombstone* this, GlobalContext* globalCtx) { @@ -151,7 +179,7 @@ s32 func_808B4D9C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { } Actor_ProcessInitChain(&this->actor, sInitChainBoulder); Actor_SetScale(&this->actor, 0.4f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; func_808B4C4C(this, globalCtx); func_808B4D04(this, globalCtx); this->sinRotation = Math_SinS(this->actor.shape.rot.y); @@ -214,7 +242,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case 0xFF: // The boulder is intact - shouldLive = func_808B4D9C(thisx, globalCtx); + shouldLive = func_808B4D9C(this, globalCtx); break; case 0: case 1: @@ -223,7 +251,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx) { case 4: case 5: // The boulder is debris - shouldLive = func_808B4E58(thisx, globalCtx); + shouldLive = func_808B4E58(this, globalCtx); break; default: osSyncPrintf("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668, @@ -233,7 +261,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx) { } if (!shouldLive) { - Actor_Kill(thisx); + Actor_Kill(&this->actor); return; } osSyncPrintf("Spot16 obj 爆弾石 (scaleX %f)(arg_data 0x%04x)\n", this->actor.scale.x, this->actor.params); @@ -270,6 +298,8 @@ void func_808B5240(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (1) {} + // for(;this->unk_158 < ARRAY_COUNTU(D_808B5EB0); this->unk_158++) + while (true) { if (this->unk_158 >= ARRAY_COUNTU(D_808B5EB0) || this->unk_154 < D_808B5EB0[this->unk_158][0]) { break; @@ -391,7 +421,7 @@ void func_808B57E0(BgSpot16Bombstone* this, GlobalContext* globalCtx) { playerHeldActor = player->heldActor; if (playerHeldActor != NULL && playerHeldActor->type == ACTORTYPE_EXPLOSIVES && playerHeldActor->id == ACTOR_EN_BOMBF) { - sPlayerBomb = playerHeldActor; + sPlayerBomb = (EnBombf*)playerHeldActor; } } } @@ -409,8 +439,8 @@ void func_808B5950(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (globalCtx) {} - if (this->colliderCylinder.base.acFlags & 2) { - this->colliderCylinder.base.acFlags &= ~2; + if (this->colliderCylinder.base.acFlags & AC_HIT) { + this->colliderCylinder.base.acFlags &= ~AC_HIT; func_808B561C(this, globalCtx); @@ -421,9 +451,9 @@ void func_808B5950(BgSpot16Bombstone* this, GlobalContext* globalCtx) { func_808B5A78(this); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph.base); } if (mREG(64) == 1) { @@ -486,7 +516,7 @@ void func_808B5B6C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (actor->bgCheckFlags & 8 || (actor->bgCheckFlags & 1 && actor->velocity.y < 0.0f)) { BgSpot16Bombstone_SpawnFragments(this, globalCtx); BgSpot16Bombstone_SpawnDust(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &actor->posRot, 20, NA_SE_EV_ROCK_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 20, NA_SE_EV_ROCK_BROKEN); Actor_Kill(actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 90bd7e4f57..9ebec63a10 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -18,7 +18,7 @@ typedef struct BgSpot16Bombstone { /* 0x015C */ f32 sinRotation; /* 0x0160 */ f32 cosRotation; /* 0x0164 */ ColliderJntSph colliderJntSph; - /* 0x0184 */ ColliderJntSphItem colliderJntSphItems[1]; + /* 0x0184 */ ColliderJntSphElement colliderElements[1]; /* 0x01C4 */ ColliderCylinder colliderCylinder; /* 0x0210 */ s16 unk_210; /* 0x0212 */ s16 unk_212; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index d14cf84aa0..29b00e8f01 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -38,21 +38,42 @@ const ActorInit Bg_Spot18_Basket_InitVars = { (ActorFunc)BgSpot18Basket_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[2] = { +static ColliderJntSphElementInit sJntSphElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 2040, 0 }, 54 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 1, { { 0, 1400, 0 }, 13 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 2, - sJntSphItemsInit, + sJntSphElementsInit, }; static s16 D_808B85C8[] = { 0x8000, 0x2AAA, 0xD555, 0x0000 }; @@ -61,8 +82,9 @@ void func_808B7710(Actor* thisx, GlobalContext* globalCtx) { BgSpot18Basket* this = THIS; Collider_InitJntSph(globalCtx, &this->colliderJntSph); - Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, &this->colliderJntSphItems); - this->dyna.actor.colChkInfo.mass = 0xFF; + Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, + &this->ColliderJntSphElements); + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; } void func_808B7770(BgSpot18Basket* this, GlobalContext* globalCtx, f32 arg2) { @@ -197,7 +219,7 @@ void func_808B7BCC(BgSpot18Basket* this, GlobalContext* globalCtx) { this->dyna.actor.posRot.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.x; this->dyna.actor.posRot.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.z; - if (this->colliderJntSph.base.acFlags & 2) { + if (this->colliderJntSph.base.acFlags & AC_HIT) { colliderBaseAc = this->colliderJntSph.base.ac; if (colliderBaseAc != NULL) { @@ -418,7 +440,7 @@ void BgSpot18Basket_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != func_808B7AFC) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); if (this->actionFunc != func_808B7B6C) { - this->colliderJntSph.base.acFlags &= ~2; + this->colliderJntSph.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); } } @@ -427,7 +449,7 @@ void BgSpot18Basket_Update(Actor* thisx, GlobalContext* globalCtx) { void BgSpot18Basket_Draw(Actor* thisx, GlobalContext* globalCtx) { BgSpot18Basket* this = THIS; - func_800628A4(0, &this->colliderJntSph); - func_800628A4(1, &this->colliderJntSph); + Collider_UpdateSpheres(0, &this->colliderJntSph); + Collider_UpdateSpheres(1, &this->colliderJntSph); Gfx_DrawDListOpa(globalCtx, D_060018B0); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h index c95658e36f..00dc9eb606 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h @@ -11,7 +11,7 @@ typedef void (*BgSpot18BasketActionFunc)(struct BgSpot18Basket*, GlobalContext*) typedef struct BgSpot18Basket { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ColliderJntSph colliderJntSph; - /* 0x0184 */ ColliderJntSphItem colliderJntSphItems[2]; + /* 0x0184 */ ColliderJntSphElement ColliderJntSphElements[2]; /* 0x0204 */ BgSpot18BasketActionFunc actionFunc; /* 0x0208 */ f32 unk_208; /* 0x020C */ s16 unk_20C; diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 5a4cebe0be..15919f8ba6 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -37,18 +37,25 @@ const ActorInit Bg_Toki_Swd_InitVars = { (ActorFunc)BgTokiSwd_Draw, }; -static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 10, 70, 0, { 0 } } -}; +static ColliderCylinderInit sCylinderInit = { { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 10, 70, 0, { 0 } } }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x0A, - 0x0023, - 0x0064, - 0xFF, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x19, ICHAIN_STOP), @@ -76,8 +83,8 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - Collider_CylinderUpdate(thisx, &this->collider); - func_80061ED4(&thisx->colChkInfo, 0, &sColChkInfoInit); + Collider_UpdateCylinder(thisx, &this->collider); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); } void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -149,7 +156,7 @@ void BgTokiSwd_Update(Actor* thisx, GlobalContext* globalCtx) { BgTokiSwd* this = THIS; this->actionFunc(this, globalCtx); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index c5fde6dfa4..a505aaf54a 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -33,21 +33,42 @@ const ActorInit Bg_Ydan_Maruta_InitVars = { (ActorFunc)BgYdanMaruta_Draw, }; -static ColliderTrisItemInit sTrisItemInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000004, 0x00, 0x00 }, 0x11, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_ON, + OCELEM_NONE, + }, { { { 220.0f, -10.0f, 0.0f }, { 220.0f, 10.0f, 0.0f }, { -220.0f, 10.0f, 0.0f } } }, }, { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000004, 0x00, 0x00 }, 0x11, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_ON, + OCELEM_NONE, + }, { { { 16.0f, 0.0f, 0.0f }, { 16.0f, 135.0f, 0.0f }, { -16.0f, 135.0f, 0.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, 2, - sTrisItemInit, + sTrisElementsInit, }; static InitChainEntry sInitChain[] = { @@ -66,20 +87,20 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) { f32 sinRotY; f32 cosRotY; CollisionHeader* colHeader = NULL; - ColliderTrisItemInit* items; + ColliderTrisElementInit* triInit; Actor_ProcessInitChain(thisx, sInitChain); Collider_InitTris(globalCtx, &this->collider); - Collider_SetTris(globalCtx, &this->collider, thisx, &sTrisInit, &this->colliderItems); + Collider_SetTris(globalCtx, &this->collider, thisx, &sTrisInit, &this->elements); this->unk_168 = thisx->params & 0xFFFF; thisx->params = (thisx->params >> 8) & 0xFF; if (thisx->params == 0) { - items = &sTrisItemInit[0]; + triInit = &sTrisElementsInit[0]; this->actionFunc = func_808BEFF4; } else { - items = &sTrisItemInit[1]; + triInit = &sTrisElementsInit[1]; DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_060066A8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); @@ -96,18 +117,18 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) { cosRotY = Math_CosS(thisx->shape.rot.y); for (i = 0; i < 3; i++) { - sp4C[i].x = (items->dim.vtx[i].x * cosRotY) + thisx->posRot.pos.x; - sp4C[i].y = items->dim.vtx[i].y + thisx->posRot.pos.y; - sp4C[i].z = thisx->posRot.pos.z - (items->dim.vtx[i].x * sinRotY); + sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + thisx->posRot.pos.x; + sp4C[i].y = triInit->dim.vtx[i].y + thisx->posRot.pos.y; + sp4C[i].z = thisx->posRot.pos.z - (triInit->dim.vtx[i].x * sinRotY); } - func_800627A0(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); + Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); - sp4C[1].x = (items->dim.vtx[2].x * cosRotY) + thisx->posRot.pos.x; - sp4C[1].y = items->dim.vtx[0].y + thisx->posRot.pos.y; - sp4C[1].z = thisx->posRot.pos.z - (items->dim.vtx[2].x * sinRotY); + sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + thisx->posRot.pos.x; + sp4C[1].y = triInit->dim.vtx[0].y + thisx->posRot.pos.y; + sp4C[1].z = thisx->posRot.pos.z - (triInit->dim.vtx[2].x * sinRotY); - func_800627A0(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); + Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); } void BgYdanMaruta_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -120,23 +141,23 @@ void BgYdanMaruta_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_808BEFF4(BgYdanMaruta* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 2) { + if (this->collider.base.atFlags & AT_HIT) { func_8002F71C(globalCtx, &this->dyna.actor, 7.0f, this->dyna.actor.shape.rot.y, 6.0f); } this->dyna.actor.shape.rot.x += 0x360; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8002F974(&this->dyna.actor, NA_SE_EV_TOGE_STICK_ROLLING - SFX_FLAG); } void func_808BF078(BgYdanMaruta* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { this->unk_16A = 20; Flags_SetSwitch(globalCtx, this->unk_168); func_80078884(NA_SE_SY_CORRECT_CHIME); this->actionFunc = func_808BF108; func_800800F8(globalCtx, 0xBC2, 0x32, &this->dyna.actor, 0); } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h index 4b6af1c4c4..29bc4393d3 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h @@ -14,7 +14,7 @@ typedef struct BgYdanMaruta { /* 0x0168 */ u8 unk_168; /* 0x016A */ s16 unk_16A; /* 0x016C */ ColliderTris collider; - /* 0x018C */ ColliderTrisItem colliderItems[2]; + /* 0x018C */ ColliderTrisElement elements[2]; } BgYdanMaruta; // size = 0x0244 extern const ActorInit Bg_Ydan_Maruta_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index c3ad198afb..23ab479902 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -27,6 +27,44 @@ const ActorInit Bg_Ydan_Sp_InitVars = { (ActorFunc)BgYdanSp_Update, (ActorFunc)BgYdanSp_Draw, }; + +static ColliderTrisElementInit D_808C0930[2] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 75.0f, -8.0f, 75.0f }, { -75.0f, -8.0f, 75.0f }, { -75.0f, -8.0f, -75.0f } } }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 140.0f, 288.79998779296875f, 0.0f }, { -140.0f, 288.0f, 0.0f }, { -140.0f, 0.0f, 0.0f } } }, + }, +}; + +static ColliderTrisInit D_808C09A8 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_TRIS, + }, + 2, + D_808C0930, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s") diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index e4c336bc46..74a507add7 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -50,6 +50,231 @@ const ActorInit Boss_Dodongo_InitVars = { (ActorFunc)BossDodongo_Update, (ActorFunc)BossDodongo_Draw, }; + +static ColliderJntSphElementInit D_808C7100[19] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 8500, 1200, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 33, { { 2000, -2000, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 22, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 23, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 24, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 29, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 30, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 31, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 32, { { 0, 0, 0 }, 50 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 38, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 39, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 40, { { 0, 0, 0 }, 40 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 45, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 46, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 47, { { 0, 0, 0 }, 40 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808C73AC = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 19, + D_808C7100, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C1190.s") diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 094a9ce29e..c8c54eb48e 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -21,6 +21,231 @@ const ActorInit Boss_Fd_InitVars = { (ActorFunc)BossFd_Update, (ActorFunc)BossFd_Draw, }; + +static ColliderJntSphElementInit D_808D1660[19] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 18 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 16 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 14 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 12 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 18, { { 0, 0, 0 }, 10 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808D190C = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 19, + D_808D1660, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CADC0.s") diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index e07569343c..6d63591a83 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -21,6 +21,121 @@ const ActorInit Boss_Fd2_InitVars = { (ActorFunc)BossFd2_Update, (ActorFunc)BossFd2_Draw, }; + +static ColliderJntSphElementInit D_808D5FD0[9] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 35, { { 6000, 0, 0 }, 21 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 18, { { 4000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 19, { { 3000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 20, { { 4000, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 24, { { 4000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 25, { { 3000, 0, 0 }, 13 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 26, { { 3500, 1500, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 26 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 30, { { 0, 0, 0 }, 17 }, 100 }, + }, +}; + +static ColliderJntSphInit D_808D6114 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 9, + D_808D5FD0, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Fd2/func_808D2670.s") diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 9eb05740c6..96bb15eb43 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -68,6 +68,46 @@ const ActorInit Boss_Ganon_InitVars = { (ActorFunc)BossGanon_Update, (ActorFunc)BossGanon_Draw, }; + +static ColliderCylinderInit D_808E4C00 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 20, 80, -50, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_808E4C2C = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK6, + { 0x00100700, 0x00, 0x08 }, + { 0x0D900740, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, 30, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808D6870.s") diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 06118cfef6..955f7ae390 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -51,6 +51,236 @@ const ActorInit Boss_Ganon2_InitVars = { (ActorFunc)BossGanon2_Update, (ActorFunc)BossGanon2_Draw, }; + +static ColliderJntSphElementInit D_80906D7C[16] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80906FBC = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_FIRST_ONLY | OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 16, + D_80906D7C, +}; + +static ColliderJntSphElementInit D_80906FCC[2] = { + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x40 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 45 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x40 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 45 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80907014 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 2, + D_80906FCC, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/func_808FCF40.s") diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 927ec6bad1..0cd9326856 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -21,6 +21,46 @@ const ActorInit Boss_Ganondrof_InitVars = { (ActorFunc)BossGanondrof_Update, (ActorFunc)BossGanondrof_Draw, }; + +static ColliderCylinderInit D_80914CD0 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 30, 90, -50, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80914CFC = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, 30, -20, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Ganondrof/func_80910640.s") diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index cfd515eb7c..4f80de5239 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -21,6 +21,165 @@ const ActorInit Boss_Goma_InitVars = { (ActorFunc)BossGoma_Update, (ActorFunc)BossGoma_Draw, }; + +static ColliderJntSphElementInit D_8091AE60[13] = { + { + { + ELEMTYPE_UNK3, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 1200 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 12 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 22, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 23, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 29, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 57, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 64, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 74, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 75, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK2, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 81, { { 0, 0, 0 }, 15 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8091B034 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 13, + D_8091AE60, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80915A10.s") diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index ad286f44b6..d4eaecf626 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -21,6 +21,251 @@ const ActorInit Boss_Mo_InitVars = { (ActorFunc)BossMo_Update, (ActorFunc)BossMo_Draw, }; + +static ColliderCylinderInit D_8092603C = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 20, 40, -20, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80925D80[19] = { + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 0 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 0 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 2, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 3, { { 0, 0, 0 }, 24 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 4, { { 0, 0, 0 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 18 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 0, 0, 0 }, 16 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 8, { { 0, 0, 0 }, 14 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 9, { { 0, 0, 0 }, 12 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 14, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 17, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK4, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 18, { { 0, 0, 0 }, 10 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8092602C = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 19, + D_80925D80, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_8091BB00.s") diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 08bbca0fb1..9fdb914f79 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -21,6 +21,320 @@ const ActorInit Boss_Sst_InitVars = { (ActorFunc)BossSst_Update, (ActorFunc)BossSst_Draw, }; + +static ColliderJntSphElementInit D_80937630[11] = { + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 7, { { 1500, 0, 0 }, 70 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 0, 0, 0 }, 75 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 4, { { 5000, 0, 0 }, 120 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 3, { { -2500, 0, 0 }, 150 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 43, { { 1500, 0, 0 }, 80 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 43, { { 7500, 0, 0 }, 70 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 44, { { 3000, 0, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 40, { { 1500, 0, 0 }, 80 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 40, { { 7500, 0, 0 }, 70 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 41, { { 3000, 0, 0 }, 60 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x30 }, + { 0x00000080, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 8, { { 1500, 0, 0 }, 70 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809377BC = { + { + COLTYPE_HARD, + AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 11, + D_80937630, +}; + +static ColliderCylinderInit D_809377CC = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 85, 100, -50, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80937494[11] = { + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 2, { { 2000, -1500, 250 }, 65 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 10, { { 0, 0, 0 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 11, { { 500, 0, 0 }, 22 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, { { -250, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 16, { { 500, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, { { 250, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 21, { { 500, -250, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 25, { { 0, 0, 0 }, 27 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 26, { { 750, 0, 0 }, 26 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 5, { { 750, -150, 0 }, 21 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 6, { { 750, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80937620 = { + { + COLTYPE_HIT0, + AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 11, + D_80937494, +}; + +static ColliderCylinderInit D_809377F8 = { + { + COLTYPE_NONE, + AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x04, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 85, 1, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s") diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index aca2a89971..1d57f3d0e0 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -95,6 +95,66 @@ const ActorInit Boss_Tw_InitVars = { (ActorFunc)BossTw_Update, (ActorFunc)BossTw_Draw, }; + +static ColliderCylinderInit D_8094A7E8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ALL, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x30 }, + { 0x00100000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 25, 35, -17, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_8094A814 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 45, 120, -30, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_8094A840 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x20 }, + { 0xFFCDFFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 45, 120, -30, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80938CD0.s") diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 9071d779c4..cf16102d4a 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -59,6 +59,120 @@ const ActorInit Boss_Va_InitVars = { (ActorFunc)BossVa_Update, (ActorFunc)BossVa_Draw, }; + +static ColliderCylinderInit D_8095BF60 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFEF, 0x03, 0x08 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 85, 120, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_8095BF8C[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 25 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8095BFB0 = { + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_8095BF8C, +}; + +static ColliderQuadInit D_8095BFF4 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x03, 0x04 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderJntSphElementInit D_8095BFC0[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_8095BFE4 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_8095BFC0, +}; + +static ColliderQuadInit D_8095BFF4 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x03, 0x04 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Boss_Va/func_8094F2C0.s") diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 1f18593df2..4533af9d09 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -39,6 +39,63 @@ const ActorInit Demo_Gj_InitVars = { (ActorFunc)DemoGj_Update, (ActorFunc)DemoGj_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 100, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 25, 110, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 25, 200, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Gj/func_80978930.s") diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 6af3c9bb64..bb20b10222 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -59,8 +59,14 @@ static UNK_PTR D_80987830[] = { static u32 D_8098783C = 0; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 25, 80, 0, { 0, 0, 0 } }, }; @@ -154,7 +160,7 @@ void func_80984D00(Actor* thisx, GlobalContext* globalCtx) { DemoIm* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80984D4C(Actor* thisx, GlobalContext* globalCtx) { @@ -166,7 +172,7 @@ void func_80984D4C(Actor* thisx, GlobalContext* globalCtx) { void func_80984D74(DemoIm* this, GlobalContext* globalCtx) { s32 pad[5]; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 9d8ffb9a95..8508c46c7d 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -27,6 +27,26 @@ const ActorInit Demo_Kekkai_InitVars = { (ActorFunc)DemoKekkai_Update, (ActorFunc)DemoKekkai_Draw, }; + +static ColliderCylinderInit D_8098E0B0 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x07, 0x04 }, + { 0x00002000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 680, 220, 120, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Kekkai/func_8098CFD0.s") diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 6d536961b8..74bdef8e1d 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -32,8 +32,22 @@ const ActorInit Door_Ana_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00000048, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00000048, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 50, 10, 0, { 0 } }, }; @@ -83,7 +97,7 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) { // update routine for grottos that are currently "hidden"/unopened void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) { u32 openGrotto = false; - if ((this->actor.params & 0x200) == 0) { + if (!(this->actor.params & 0x200)) { // opening with song of storms if (this->actor.xyzDistToLinkSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) { openGrotto = true; @@ -91,12 +105,12 @@ void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) { } } else { // bombing/hammering open a grotto - if ((this->collider.base.acFlags & 2) != 0) { + if (this->collider.base.acFlags & AC_HIT) { openGrotto = true; Collider_DestroyCylinder(globalCtx, &this->collider); } else { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } // open the grotto @@ -114,7 +128,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { s32 destinationIdx; player = PLAYER; - if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f) != 0) { + if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { if ((this->actor.unk_1F != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && (player->unk_84F == 0)) { destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 7caae0a96e..1366e85d60 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -22,6 +22,53 @@ const ActorInit Door_Killer_InitVars = { (ActorFunc)DoorKiller_Update, NULL, }; + +static ColliderCylinderInit D_80995FB0 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0x0001FFEE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 20, 100, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80995FDC[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 100 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80996000 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 1, + D_80995FDC, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Door_Killer/DoorKiller_Init.s") diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 47540f90c4..68442538eb 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -33,6 +33,66 @@ const ActorInit En_Am_InitVars = { (ActorFunc)EnAm_Update, (ActorFunc)EnAm_Draw, }; + +static ColliderCylinderInit D_809AFF80 = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 15, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_809AFFAC = { + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00400106, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 15, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_809AFFD8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF20.s") diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 41046b80ca..f48a4f5ddc 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -45,8 +45,22 @@ const ActorInit En_Ani_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0 } }, }; @@ -77,7 +91,7 @@ void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_PlayOnce(&this->skelAnime, &D_060076EC); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; if (LINK_IS_CHILD) { EnAni_SetupAction(this, func_809B064C); } else { @@ -237,8 +251,8 @@ void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) { EnAni* this = THIS; s32 pad[2]; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.npcActions[0] != NULL)) { diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 697007b1eb..1ed8f0843c 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -33,6 +33,26 @@ const ActorInit En_Anubice_InitVars = { (ActorFunc)EnAnubice_Update, (ActorFunc)EnAnubice_Draw, }; + +static ColliderCylinderInit D_809B22D0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 29, 103, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Anubice/func_809B1120.s") diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index e6d83de004..ced0195be0 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -29,6 +29,26 @@ const ActorInit En_Anubice_Fire_InitVars = { (ActorFunc)EnAnubiceFire_Update, (ActorFunc)EnAnubiceFire_Draw, }; + +static ColliderCylinderInit D_809B31E0 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 0, 0, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Init.s") diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 84732bce24..5d9e908f1f 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -32,6 +32,26 @@ const ActorInit En_Arrow_InitVars = { (ActorFunc)EnArrow_Update, (ActorFunc)EnArrow_Draw, }; + +static ColliderQuadInit D_809B4D50 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000020, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Arrow/func_809B3920.s") diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 1064c084c3..65bae38dac 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -30,6 +30,44 @@ const ActorInit En_Ba_InitVars = { (ActorFunc)EnBa_Update, (ActorFunc)EnBa_Draw, }; + +static ColliderJntSphElementInit D_809B808C[2] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000010, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 8, { { 0, 0, 0 }, 20 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 13, { { 0, 0, 0 }, 25 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809B80D4 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 2, + D_809B808C, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6350.s") diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 50192b42d3..6ae8e87b45 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -96,18 +96,108 @@ extern AnimationHeader D_06000444; extern SkeletonHeader D_06001A30; static DamageTable sDamageTableBlueGreen = { - 0xF0, 0x02, 0x01, 0xA2, 0xF0, 0xE2, 0xA2, 0xF0, 0x01, 0x02, 0x04, 0xE2, 0xC4, 0xB4, 0x00, 0x00, - 0x00, 0x60, 0x93, 0x83, 0xA0, 0xA0, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x60, 0x00, 0xA4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xF), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xA), + /* Boomerang */ DMG_ENTRY(0, 0xF), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xA), + /* Hookshot */ DMG_ENTRY(0, 0xF), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(4, 0xC), + /* Light arrow */ DMG_ENTRY(4, 0xB), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0x9), + /* Light magic */ DMG_ENTRY(3, 0x8), + /* Shield */ DMG_ENTRY(0, 0xA), + /* Mirror Ray */ DMG_ENTRY(0, 0xA), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x6), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xA), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static DamageTable sDamageTableRed = { - 0xD0, 0xD0, 0xD0, 0xA2, 0xD0, 0xE2, 0xA2, 0xD0, 0xD0, 0xE2, 0xE4, 0xE2, 0x94, 0xE2, 0xE4, 0xE2, - 0xE2, 0x60, 0x93, 0x60, 0xA0, 0xA0, 0x01, 0xE4, 0xE2, 0x02, 0xE8, 0xE4, 0x60, 0x00, 0xA4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xD), + /* Deku stick */ DMG_ENTRY(0, 0xD), + /* Slingshot */ DMG_ENTRY(0, 0xD), + /* Explosive */ DMG_ENTRY(2, 0xA), + /* Boomerang */ DMG_ENTRY(0, 0xD), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xA), + /* Hookshot */ DMG_ENTRY(0, 0xD), + /* Kokiri sword */ DMG_ENTRY(0, 0xD), + /* Master sword */ DMG_ENTRY(2, 0xE), + /* Giant's Knife */ DMG_ENTRY(4, 0xE), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(4, 0x9), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xE), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0x9), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0xA), + /* Mirror Ray */ DMG_ENTRY(0, 0xA), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0xE), + /* Master spin */ DMG_ENTRY(2, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x6), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xA), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static DamageTable sDamageTableWhite = { - 0xF0, 0xE2, 0xE1, 0xA2, 0xF0, 0xE2, 0xA2, 0xF0, 0xE1, 0xE2, 0xE4, 0x54, 0xE2, 0xE2, 0xE4, 0xE2, - 0xE2, 0x74, 0x60, 0x60, 0xA0, 0xA0, 0xE1, 0xE4, 0xE2, 0xE2, 0xE8, 0xE4, 0x60, 0x00, 0xA4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xF), + /* Deku stick */ DMG_ENTRY(2, 0xE), + /* Slingshot */ DMG_ENTRY(1, 0xE), + /* Explosive */ DMG_ENTRY(2, 0xA), + /* Boomerang */ DMG_ENTRY(0, 0xF), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xA), + /* Hookshot */ DMG_ENTRY(0, 0xF), + /* Kokiri sword */ DMG_ENTRY(1, 0xE), + /* Master sword */ DMG_ENTRY(2, 0xE), + /* Giant's Knife */ DMG_ENTRY(4, 0xE), + /* Fire arrow */ DMG_ENTRY(4, 0x5), + /* Ice arrow */ DMG_ENTRY(2, 0xE), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xE), + /* Fire magic */ DMG_ENTRY(4, 0x7), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0xA), + /* Mirror Ray */ DMG_ENTRY(0, 0xA), + /* Kokiri spin */ DMG_ENTRY(1, 0xE), + /* Giant spin */ DMG_ENTRY(4, 0xE), + /* Master spin */ DMG_ENTRY(2, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0xE), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x6), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xA), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; const ActorInit En_Bb_InitVars = { @@ -122,16 +212,30 @@ const ActorInit En_Bb_InitVars = { (ActorFunc)EnBb_Draw, }; -static ColliderJntSphItemInit sJntSphElementInit[1] = { +static ColliderJntSphElementInit sJntSphElementInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, -120, 0 }, 4 }, 300 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x09, 0x10, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphElementInit), + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, sJntSphElementInit, }; @@ -230,9 +334,9 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { this->timer = 0; this->flameScaleY = 80.0f; this->flameScaleX = 100.0f; - this->collider.list[0].body.toucherFlags = 9; - this->collider.list[0].body.toucher.flags = 0xFFCFFFFF; - this->collider.list[0].body.toucher.damage = 8; + this->collider.elements[0].info.toucherFlags = TOUCH_ON | TOUCH_SFX_HARD; + this->collider.elements[0].info.toucher.dmgFlags = 0xFFCFFFFF; + this->collider.elements[0].info.toucher.damage = 8; this->bobSize = this->actionState * 20.0f; this->flamePrimAlpha = 255; this->moveMode = BBMOVE_NORMAL; @@ -250,7 +354,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->naviEnemyId = 0x24; thisx->colChkInfo.damageTable = &sDamageTableRed; this->flameEnvColor.r = 255; - this->collider.list[0].body.toucher.effect = 1; + this->collider.elements[0].info.toucher.effect = 1; EnBb_SetupRed(globalCtx, this); break; case ENBB_WHITE: @@ -277,7 +381,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { break; case ENBB_GREEN_BIG: this->path = this->actionState >> 4; - this->collider.list[0].dim.modelSphere.radius = 0x16; + this->collider.elements[0].dim.modelSphere.radius = 0x16; Actor_SetScale(thisx, 0.03f); case ENBB_GREEN: thisx->naviEnemyId = 0x1E; @@ -293,8 +397,8 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { } else { EnBb_SetupFlameTrail(this); } - this->collider.list[0].dim.worldSphere.radius = - this->collider.list[0].dim.modelSphere.radius * this->collider.list[0].dim.scale; + this->collider.elements[0].dim.worldSphere.radius = + this->collider.elements[0].dim.modelSphere.radius * this->collider.elements[0].dim.scale; } void EnBb_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -530,9 +634,9 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { } } Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x3E8, 0); - if ((this->collider.base.acFlags & 2) || (this->collider.base.atFlags & 2)) { + if ((this->collider.base.acFlags & AC_HIT) || (this->collider.base.atFlags & AT_HIT)) { this->vMoveAngleY = this->actor.yawTowardsLink + 0x8000; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { afterHitAngle = -0x8000; } else { afterHitAngle = 0x4000; @@ -542,8 +646,8 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { } } this->actor.posRot.rot.y = this->actor.yawTowardsLink + afterHitAngle; - this->collider.base.acFlags &= ~2; - this->collider.base.atFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; + this->collider.base.atFlags &= ~AT_HIT; } if (this->maxSpeed >= 6.0f) { @@ -815,9 +919,9 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { this->moveMode = BBMOVE_NOCLIP; this->maxSpeed = 10.0f; } - if (this->collider.base.atFlags & 2) { + if (this->collider.base.atFlags & AT_HIT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_BITE); - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } this->actor.shape.rot.y = this->actor.posRot.rot.y; } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { @@ -902,9 +1006,9 @@ void EnBb_Green(EnBb* this, GlobalContext* globalCtx) { } this->moveMode = BBMOVE_NOCLIP; this->maxSpeed = 10.0f; - if (this->collider.base.atFlags & 2) { + if (this->collider.base.atFlags & AT_HIT) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_BITE); - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } if (Math_CosF(this->bobPhase) == 0.0f) { if (this->charge) { @@ -940,7 +1044,7 @@ void EnBb_Green(EnBb* this, GlobalContext* globalCtx) { this->actionState++; this->timer = (Rand_ZeroOne() * 30.0f) + 60.0f; if (this->vFlameTimer != 0) { - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DOWN); } @@ -1033,8 +1137,8 @@ void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) { } void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~4; + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~AT_BOUNCED; if (this->action != BB_DOWN) { if (this->actor.params >= ENBB_RED) { this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000; @@ -1047,13 +1151,13 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { this->actionVar2 = 1; } } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->dmgEffect = this->actor.colChkInfo.damageEffect; - func_80035650(&this->actor, &this->collider.list[0].body, 0); + func_80035650(&this->actor, &this->collider.elements[0].info, 0); switch (this->dmgEffect) { case 7: - this->actor.freezeTimer = this->collider.list[0].body.acHitItem->toucher.damage; + this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage; case 5: this->fireIceTimer = 0x30; //! @bug @@ -1062,7 +1166,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { //! Din's Fire on a white bubble will do just that. The mechanism is complex and described below. goto block_15; case 6: - this->actor.freezeTimer = this->collider.list[0].body.acHitItem->toucher.damage; + this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage; break; case 8: case 9: @@ -1087,7 +1191,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { ((this->actor.params != ENBB_WHITE) && (this->flameScaleX < 20.0f))) { Actor_ApplyDamage(&this->actor); } else { - this->collider.base.acFlags |= 2; + this->collider.base.acFlags |= AC_HIT; } } if (this->actor.colChkInfo.health == 0) { @@ -1143,10 +1247,10 @@ void EnBb_Update(Actor* thisx, GlobalContext* globalCtx2) { func_8002E4B4(globalCtx, &this->actor, sp34, 25.0f, 20.0f, 5); } this->actor.posRot2.pos = this->actor.posRot.pos; - this->collider.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list->dim.worldSphere.center.y = + this->collider.elements->dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->collider.elements->dim.worldSphere.center.y = this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y); - this->collider.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->collider.elements->dim.worldSphere.center.z = this->actor.posRot.pos.z; if ((this->action > BB_KILL) && ((this->actor.speedXZ != 0.0f) || (this->action == BB_GREEN))) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h index c76f3f6abf..d12fd825fe 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -41,7 +41,7 @@ typedef struct EnBb { /* 0x02A8 */ s16 fireIceTimer; /* 0x02AA */ u8 dmgEffect; /* 0x02AC */ ColliderJntSph collider; - /* 0x02CC */ ColliderJntSphItem elements[1]; + /* 0x02CC */ ColliderJntSphElement elements[1]; /* 0x030C */ struct_80032E24 enPartInfo; /* 0x0324 */ Actor* targetActor; } EnBb; // size = 0x0328 diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 028ee627db..61259b5970 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -28,6 +28,53 @@ const ActorInit En_Bigokuta_InitVars = { (ActorFunc)EnBigokuta_Update, (ActorFunc)EnBigokuta_Draw, }; + +static ColliderJntSphElementInit D_809BF3D4[1] = { + { + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 45, -30 }, 75 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809BF3F8 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_809BF3D4, +}; + +static ColliderCylinderInit D_809BF408 = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x20000000, 0x00, 0x08 }, + { 0xFFCFFFE7, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 50, 100, 0, { 30, 0, 12 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s") diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 602f82a146..7e3b622839 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -26,6 +26,26 @@ const ActorInit En_Bili_InitVars = { (ActorFunc)EnBili_Update, (ActorFunc)EnBili_Draw, }; + +static ColliderCylinderInit D_809C1640 = { + { + COLTYPE_HIT8, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 9, 28, -20, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s") diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 22fb09a256..9a92d42fff 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -32,28 +32,56 @@ const ActorInit En_Bom_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x29, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x0003F828, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x0003F828, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 6, 11, 14, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000008, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000008, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 0 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK0, 0x39, 0x00, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ALL, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 0, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 61536, ICHAIN_STOP), + ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_STOP), }; extern Gfx D_04007A50[]; // gold fuse cap @@ -77,7 +105,7 @@ void EnBom_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->explosionCollider); Collider_SetCylinder(globalCtx, &this->bombCollider, thisx, &sCylinderInit); Collider_SetJntSph(globalCtx, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderItems[0]); - this->explosionColliderItems[0].body.toucher.damage += (thisx->shape.rot.z & 0xFF00) >> 8; + this->explosionColliderItems[0].info.toucher.damage += (thisx->shape.rot.z & 0xFF00) >> 8; thisx->shape.rot.z &= 0xFF; if (thisx->shape.rot.z & 0x80) { @@ -145,12 +173,12 @@ void EnBom_WaitForRelease(EnBom* this, GlobalContext* globalCtx) { void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) { Player* player; - if (this->explosionCollider.list->dim.modelSphere.radius == 0) { + if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) { this->actor.flags |= 0x20; func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); } - this->explosionCollider.list->dim.worldSphere.radius += this->actor.shape.rot.z + 8; + this->explosionCollider.elements[0].dim.worldSphere.radius += this->actor.shape.rot.z + 8; if (this->actor.params == BOMB_EXPLOSION) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base); @@ -240,8 +268,8 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002829C(globalCtx, &effPos, &effVelocity, &dustAccel, &dustColor, &dustColor, 50, 5); } - if ((this->bombCollider.base.acFlags & 2) || - ((this->bombCollider.base.maskA & 2) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { + if ((this->bombCollider.base.acFlags & AC_HIT) || + ((this->bombCollider.base.ocFlags1 & OC1_HIT) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { this->timer = 0; thisx->shape.rot.z = 0; } else { @@ -303,7 +331,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetHeight(thisx, 20.0f); if (thisx->params <= BOMB_BODY) { - Collider_CylinderUpdate(thisx, &this->bombCollider); + Collider_UpdateCylinder(thisx, &this->bombCollider); // if link is not holding the bomb anymore and bump conditions are met, subscribe to OC if (!Actor_HasParent(thisx, globalCtx) && this->bumpOn) { @@ -350,7 +378,7 @@ void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->flashIntensity, 0, 40, 255); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, (s16)this->flashIntensity, 0, 40, 255); gSPDisplayList(POLY_OPA_DISP++, D_04007860); - func_800628A4(0, &this->explosionCollider); + Collider_UpdateSpheres(0, &this->explosionCollider); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_bom.c", 951); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index 6660253089..7de3e925c3 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -12,7 +12,7 @@ typedef struct EnBom { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder bombCollider; /* 0x0198 */ ColliderJntSph explosionCollider; - /* 0x01B8 */ ColliderJntSphItem explosionColliderItems[1]; + /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1]; /* 0x01F8 */ s16 timer; /* 0x01FA */ s16 flashSpeedScale; /* 0x01FC */ f32 flashIntensity; diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 6880033acd..6d1c781175 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -23,6 +23,33 @@ const ActorInit En_Bom_Chu_InitVars = { (ActorFunc)EnBomChu_Update, (ActorFunc)EnBomChu_Draw, }; + +static ColliderJntSphElementInit D_809C6D30[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 12 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809C6D54 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_1 | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, + 1, + D_809C6D30, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Init.s") diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 97786c504f..eea7b88ee0 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -35,22 +35,50 @@ const ActorInit En_Bombf_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x29, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x0003F828, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x0003F828, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 9, 18, 10, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000008, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000008, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 0 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x39, 0x00, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ALL, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; extern Gfx D_06000340[]; @@ -97,7 +125,7 @@ void EnBombf_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->flags &= ~1; EnBombf_SetupAction(this, EnBombf_Move); } else { - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->bumpOn = true; this->flowerBombScale = 1.0f; EnBombf_SetupGrowBomb(this, thisx->params); @@ -131,7 +159,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { - func_8002F5C4(&this->actor, bombFlower, globalCtx); + func_8002F5C4(&this->actor, &bombFlower->actor, globalCtx); this->timer = 180; this->flowerBombScale = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_PL_PULL_UP_ROCK); @@ -143,8 +171,8 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { this->actor.parent = NULL; player->stateFlags1 &= ~0x800; } - } else if (this->bombCollider.base.acFlags & 2) { - this->bombCollider.base.acFlags &= ~2; + } else if (this->bombCollider.base.acFlags & AC_HIT) { + this->bombCollider.base.acFlags &= ~AC_HIT; if (this->bombCollider.base.ac->type != ACTORTYPE_BOSS) { bombFlower = @@ -239,13 +267,14 @@ void EnBombf_WaitForRelease(EnBombf* this, GlobalContext* globalCtx) { void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) { Player* player; - if (this->explosionCollider.list->dim.modelSphere.radius == 0) { + if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) { this->actor.flags |= 0x20; func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); } - this->explosionCollider.list->dim.modelSphere.radius += 8; - this->explosionCollider.list->dim.worldSphere.radius = this->explosionCollider.list->dim.modelSphere.radius; + this->explosionCollider.elements[0].dim.modelSphere.radius += 8; + this->explosionCollider.elements[0].dim.worldSphere.radius = + this->explosionCollider.elements[0].dim.modelSphere.radius; if (this->actor.params == BOMBFLOWER_EXPLOSION) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base); @@ -342,8 +371,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { thisx->bgCheckFlags &= ~8; } - if ((this->bombCollider.base.acFlags & 2) || - ((this->bombCollider.base.maskA & 2) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { + if ((this->bombCollider.base.acFlags & AC_HIT) || + ((this->bombCollider.base.ocFlags1 & OC1_HIT) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { this->unk_200 = 1; this->timer = 0; } else { @@ -416,7 +445,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params <= BOMBFLOWER_BODY) { - Collider_CylinderUpdate(thisx, &this->bombCollider); + Collider_UpdateCylinder(thisx, &this->bombCollider); if ((this->flowerBombScale >= 1.0f) && (this->bumpOn)) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bombCollider.base); @@ -482,7 +511,7 @@ void EnBombf_Draw(Actor* thisx, GlobalContext* globalCtx) { SEGMENTED_TO_VIRTUAL(EnBombf_NewMtxDList(globalCtx->state.gfxCtx, globalCtx))); gSPDisplayList(POLY_OPA_DISP++, D_06000408); } else { - func_800628A4(0, &this->explosionCollider); + Collider_UpdateSpheres(0, &this->explosionCollider); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_bombf.c", 1063); diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index 8ef4078829..0ca2841b37 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -12,7 +12,7 @@ typedef struct EnBombf { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderCylinder bombCollider; /* 0x0198 */ ColliderJntSph explosionCollider; - /* 0x01B8 */ ColliderJntSphItem explosionColliderItems[1]; + /* 0x01B8 */ ColliderJntSphElement explosionColliderItems[1]; /* 0x01F8 */ s16 timer; /* 0x01FC */ EnBombfActionFunc actionFunc; /* 0x0200 */ s32 unk_200; diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 04d8d1a561..58bfb2edaa 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -30,9 +30,23 @@ const ActorInit En_Boom_InitVars = { }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00000010, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 }, - { 0 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000010, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static InitChainEntry sInitChain[] = { @@ -142,8 +156,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { func_8002F974(this, NA_SE_IT_BOOMERANG_FLY - SFX_FLAG); // If the boomerang collides with EnItem00 or a Skulltula token, set grabbed pointer to pick it up - collided = this->collider.base.atFlags & 0x2; - collided = !!collided; + collided = this->collider.base.atFlags & AT_HIT; + collided = !!(collided); if (collided) { if (((this->collider.base.at->id == ACTOR_EN_ITEM00) || (this->collider.base.at->id == ACTOR_EN_SI))) { this->grabbed = this->collider.base.at; @@ -179,8 +193,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else { - collided = this->collider.base.atFlags & 0x2; - collided = !!collided; + collided = (this->collider.base.atFlags & AT_HIT); + collided = (!!(collided)); if (collided) { // Copy the position from the prevous frame to the boomerang to start the bounce back. Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4); @@ -198,7 +212,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { hitActor->id == ACTOR_BG_BDAN_OBJECTS && hitActor->params == 0)) { collided = false; } else { - func_80062D60(globalCtx, &hitPoint); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &hitPoint); } } } diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index c3ca256a7b..b7d5e80bea 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -34,6 +34,26 @@ const ActorInit En_Brob_InitVars = { (ActorFunc)EnBrob_Update, (ActorFunc)EnBrob_Draw, }; + +static ColliderCylinderInit D_809CBA80 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0xFFCFFFFF, 0x03, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 8000, 11000, -5000, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Brob/EnBrob_Init.s") diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 81ca623c93..d205542177 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -27,25 +27,46 @@ const ActorInit En_Bubble_InitVars = { (ActorFunc)EnBubble_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[2] = { { - { 0x00, { 0x00000000, 0x00, 0x04 }, { 0xFFCFD753, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x00, { { 0x0000, 0x0000, 0x0000 }, 16 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x04 }, + { 0xFFCFD753, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 16 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00002824, 0x00, 0x00 }, 0x00, 0x79, 0x00 }, - { 0x00, { { 0x0000, 0x0000, 0x0000 }, 16 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00002824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 16 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 2, - sJntSphItemsInit, + sJntSphElementsInit, }; static CollisionCheckInfoInit2 sColChkInfoInit2 = { - 0x01, 0x0002, 0x0019, 0x0019, 0xFF, + 1, 2, 25, 25, MASS_IMMOVABLE, }; static Vec3f sEffectAccel = { 0.0f, -0.5f, 0.0f }; @@ -79,12 +100,12 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) { } u32 func_809CBCBC(EnBubble* this) { - ColliderBody* body = &this->colliderSphere.list->body; + ColliderInfo* info = &this->colliderSphere.elements[0].info; - body->toucher.flags = 0x8; - body->toucher.effect = 0; - body->toucher.damage = 4; - body->toucherFlags = 1; + info->toucher.dmgFlags = 0x8; + info->toucher.effect = 0; + info->toucher.damage = 4; + info->toucherFlags = TOUCH_ON; this->actor.velocity.y = 0.0f; return 6; } @@ -96,7 +117,7 @@ u32 func_809CBCEC(EnBubble* this) { } void EnBubble_DamagePlayer(EnBubble* this, GlobalContext* globalCtx) { - s32 damage = -this->colliderSphere.list->body.toucher.damage; + s32 damage = -this->colliderSphere.elements[0].info.toucher.damage; globalCtx->damagePlayer(globalCtx, damage); func_8002F7A0(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f); @@ -191,7 +212,7 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) { s32 bgId; u8 bounceCount; - if (this->colliderSphere.list[1].body.bumperFlags & 0x2) { + if (this->colliderSphere.elements[1].info.bumperFlags & BUMP_HIT) { bumpActor = this->colliderSphere.base.ac; this->normalizedBumpVelocity = bumpActor->velocity; EnBubble_Vec3fNormalize(&this->normalizedBumpVelocity); @@ -265,11 +286,11 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) { } u32 func_809CC648(EnBubble* this) { - if (((this->colliderSphere.base.acFlags & 0x2) != 0) == false) { + if (((this->colliderSphere.base.acFlags & AC_HIT) != 0) == false) { return false; } - this->colliderSphere.base.acFlags &= ~0x2; - if (this->colliderSphere.list[1].body.bumperFlags & 0x2) { + this->colliderSphere.base.acFlags &= ~AC_HIT; + if (this->colliderSphere.elements[1].info.bumperFlags & BUMP_HIT) { this->unk_1F0.x = this->colliderSphere.base.ac->velocity.x / 10.0f; this->unk_1F0.y = this->colliderSphere.base.ac->velocity.y / 10.0f; this->unk_1F0.z = this->colliderSphere.base.ac->velocity.z / 10.0f; @@ -285,8 +306,8 @@ u32 EnBubble_DetectPop(EnBubble* this, GlobalContext* globalCtx) { if (DECR(this->unk_208) != 0 || this->actionFunc == EnBubble_Pop) { return false; } - if (this->colliderSphere.base.maskB & 0x1) { - this->colliderSphere.base.maskB &= ~0x1; + if (this->colliderSphere.base.ocFlags2 & OC2_HIT_PLAYER) { + this->colliderSphere.base.ocFlags2 &= ~OC2_HIT_PLAYER; EnBubble_DamagePlayer(this, globalCtx); this->unk_208 = 8; return true; @@ -295,11 +316,11 @@ u32 EnBubble_DetectPop(EnBubble* this, GlobalContext* globalCtx) { } void func_809CC774(EnBubble* this) { - ColliderJntSphItemDim* dim; + ColliderJntSphElementDim* dim; Vec3f src; Vec3f dest; - dim = &this->colliderSphere.list[0].dim; + dim = &this->colliderSphere.elements[0].dim; src.x = dim->modelSphere.center.x; src.y = dim->modelSphere.center.y; src.z = dim->modelSphere.center.z; @@ -309,7 +330,7 @@ void func_809CC774(EnBubble* this) { dim->worldSphere.center.y = dest.y; dim->worldSphere.center.z = dest.z; dim->worldSphere.radius = dim->modelSphere.radius * (1.0f + this->expansionWidth); - this->colliderSphere.list[1].dim = *dim; + this->colliderSphere.elements[1].dim = *dim; } void EnBubble_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -319,7 +340,7 @@ void EnBubble_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawFunc_Circle, 0.2f); Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, this->colliderSphereItems); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(9), &sColChkInfoInit2); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(9), &sColChkInfoInit2); this->actor.naviEnemyId = 0x16; this->bounceDirection.x = Rand_ZeroOne(); this->bounceDirection.y = Rand_ZeroOne(); @@ -371,7 +392,7 @@ void EnBubble_Disappear(EnBubble* this, GlobalContext* globalCtx) { // unused void EnBubble_Regrow(EnBubble* this, GlobalContext* globalCtx) { - if (func_809CC020(this) != 0) { + if (func_809CC020(this)) { this->actionFunc = EnBubble_Wait; } CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h index 2d8c684a57..83b1b81de5 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -12,7 +12,7 @@ typedef struct EnBubble { /* 0x0000 */ Actor actor; /* 0x014C */ EnBubbleActionFunc actionFunc; /* 0x0150 */ ColliderJntSph colliderSphere; - /* 0x0170 */ ColliderJntSphItem colliderSphereItems[2]; + /* 0x0170 */ ColliderJntSphElement colliderSphereItems[2]; /* 0x01F0 */ Vec3f unk_1F0; // set but never used /* 0x01FC */ Vec3f unk_1FC; // randomly generated, set but never used /* 0x0208 */ s16 unk_208; // set to 8 when about to pop diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index b260180e2d..4143acc8e7 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -26,14 +26,26 @@ void EnButte_TransformIntoFairy(EnButte* this, GlobalContext* globalCtx); void EnButte_SetupWaitToDie(EnButte* this); void EnButte_WaitToDie(EnButte* this, GlobalContext* globalCtx); -static ColliderJntSphItemInit sColliderItemInit[] = { - { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x000, 0x00 }, 0x00, 0x00, 0x01 }, - { 0, { { 0, 0, 0 }, 5 }, 100 } } -}; +static ColliderJntSphElementInit sJntSphElementsInit[] = { { { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x000, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 5 }, 100 } } }; static ColliderJntSphInit sColliderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x19, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sColliderItemInit, + sJntSphElementsInit, }; const ActorInit En_Butte_InitVars = { @@ -413,7 +425,7 @@ void EnButte_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->drawSkelAnime) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } if (((this->actor.params & 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/src/overlays/actors/ovl_En_Butte/z_en_butte.h index c4bc6e7384..b36ff083db 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -11,7 +11,7 @@ typedef void (*EnButteActionFunc)(struct EnButte*, GlobalContext*); typedef struct EnButte { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderJntSph collider; - /* 0x016C */ ColliderJntSphItem colliderItems[1]; + /* 0x016C */ ColliderJntSphElement colliderItems[1]; /* 0x01AC */ SkelAnime skelAnime; /* 0x01F0 */ Vec3s jointTable[8]; /* 0x0220 */ Vec3s morphTable[8]; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 49c319a4b8..1769502172 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -52,20 +52,78 @@ const ActorInit En_Bw_InitVars = { }; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 30, 65, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK0, 0x00, 0x09, 0x09, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 35, 0, { 0, 0, 0 } }, }; static DamageTable sDamageTable = { - 0x10, 0x00, 0x00, 0xF2, 0x00, 0xF2, 0xF2, 0x10, 0x00, 0xF2, 0xF4, 0xF2, 0xE4, 0xF2, 0xF2, 0xF2, - 0xF2, 0x60, 0xE3, 0x60, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0xE), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0xE), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static s32 sSlugGroup = 0; @@ -84,7 +142,7 @@ void EnBw_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.posRot2.pos = this->actor.posRot.pos; func_809CE9A8(this); this->color1.a = this->color1.r = 255; @@ -387,11 +445,11 @@ void func_809CF984(EnBw* this, GlobalContext* globalCtx) { this->actor.scale.x = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f; this->actor.scale.y = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0245f; this->actor.scale.z = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0034999999f; - if (this->collider1.base.atFlags & 2) { - this->collider1.base.atFlags &= ~2; + if (this->collider1.base.atFlags & AT_HIT) { + this->collider1.base.atFlags &= ~AT_HIT; this->actor.speedXZ = -6.0f; this->actor.posRot.rot.y = this->actor.yawTowardsLink; - if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & 4)) { + if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } } @@ -626,13 +684,13 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); func_809D00F4(this); } else { - if (this->collider2.base.acFlags & 2) { - this->collider2.base.acFlags &= ~2; + if (this->collider2.base.acFlags & AC_HIT) { + this->collider2.base.acFlags &= ~AC_HIT; if ((this->actor.colChkInfo.damageEffect == 0) || (this->unk_220 == 6)) { return; } this->damageEffect = this->actor.colChkInfo.damageEffect; - func_80035650(&this->actor, &this->collider2.body, 0); + func_80035650(&this->actor, &this->collider2.info, 0); if ((this->damageEffect == 1) || (this->damageEffect == 0xE)) { if (this->unk_23C == 0) { Actor_ApplyDamage(&this->actor); @@ -707,7 +765,7 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { func_8002836C(globalCtx, &thisx->posRot.pos, &velocity, &accel, &sp50, &sp4C, 0x3C, 0, 0x14); } if (this->unk_248 <= 0.4f) { - this->collider1.body.toucher.effect = 0; + this->collider1.info.toucher.effect = 0; if (((globalCtx->gameplayFrames & 1) == 0) && (this->unk_220 < 5) && (this->unk_23C == 0)) { accel.y = -0.1f; velocity.x = Rand_CenteredFloat(4.0f); @@ -727,7 +785,7 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { 20.0f - (this->unk_248 * 40.0f)); } } else { - this->collider1.body.toucher.effect = 1; + this->collider1.info.toucher.effect = 1; } this->unk_234 = func_800339B8(thisx, globalCtx, 50.0f, thisx->posRot.rot.y); @@ -737,13 +795,13 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { } func_8002E4B4(globalCtx, thisx, 20.0f, 30.0f, 21.0f, 0x1F); } - Collider_CylinderUpdate(thisx, &this->collider2); + Collider_UpdateCylinder(thisx, &this->collider2); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); if ((this->unk_220 != 0) && ((thisx->dmgEffectTimer == 0) || !(thisx->dmgEffectParams & 0x4000))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } if ((this->unk_221 != 1) && (this->unk_220 < 5) && (this->unk_248 > 0.4f)) { - Collider_CylinderUpdate(thisx, &this->collider1); + Collider_UpdateCylinder(thisx, &this->collider1); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); } thisx->posRot2.pos = thisx->posRot.pos; diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 1159607696..0055cb0a93 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -30,14 +30,42 @@ const ActorInit En_Bx_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x01, { 0xFFCFFFFF, 0x03, 0x04 }, { 0xFFCFFFFF, 0x01, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0xFFCFFFFF, 0x03, 0x04 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 60, 100, 100, { 0, 0, 0 } }, }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x03, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; @@ -70,7 +98,7 @@ void EnBx_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Collider_InitQuad(globalCtx, &this->colliderQuad); Collider_SetQuad(globalCtx, &this->colliderQuad, &this->actor, &sQuadInit); - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->unk_14C = 0; thisx->uncullZoneDownward = 2000.0f; if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0xFF)) { @@ -98,7 +126,8 @@ void func_809D1D0C(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_809D254C, &sp38); Matrix_MultVec3f(&sp5C, &this->colliderQuad.dim.quad[1]); Matrix_MultVec3f(&sp50, &this->colliderQuad.dim.quad[0]); - func_80062734(&this->colliderQuad, &sp38, &sp44, &this->colliderQuad.dim.quad[0], &this->colliderQuad.dim.quad[1]); + Collider_SetQuadVertices(&this->colliderQuad, &sp38, &sp44, &this->colliderQuad.dim.quad[0], + &this->colliderQuad.dim.quad[1]); } void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -108,8 +137,8 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { s16 tmp32; s32 tmp33; - if ((thisx->xzDistToLink <= 70.0f) || (this->collider.base.atFlags & 2) || (this->collider.base.acFlags & 2) || - (this->colliderQuad.base.atFlags & 2)) { + if ((thisx->xzDistToLink <= 70.0f) || (this->collider.base.atFlags & AT_HIT) || + (this->collider.base.acFlags & AC_HIT) || (this->colliderQuad.base.atFlags & AT_HIT)) { if ((thisx->xzDistToLink <= 70.0f) || (&player->actor == this->collider.base.at) || (&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) { tmp33 = player->invincibilityTimer & 0xFF; @@ -130,9 +159,9 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { player->invincibilityTimer = tmp33; } - this->collider.base.atFlags &= ~2; - this->collider.base.acFlags &= ~2; - this->colliderQuad.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; + this->collider.base.acFlags &= ~AC_HIT; + this->colliderQuad.base.atFlags &= ~AT_HIT; this->colliderQuad.base.at = NULL; this->collider.base.ac = NULL; this->collider.base.at = NULL; @@ -160,7 +189,7 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayActorSound2(thisx, NA_SE_EN_BIRI_SPARK - SFX_FLAG); } thisx->posRot2.pos = thisx->posRot.pos; - Collider_CylinderUpdate(thisx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (thisx->params & 0x80) { diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 33ef760987..490316eaaa 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -21,6 +21,46 @@ const ActorInit En_Clear_Tag_InitVars = { (ActorFunc)EnClearTag_Update, (ActorFunc)EnClearTag_Draw, }; + +static ColliderCylinderInit D_809D5C6C = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_809D5C40 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/func_809D35B0.s") diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index f4a191350d..bf47b4e77f 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -39,8 +39,22 @@ const ActorInit En_Cow_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -138,7 +152,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_278 = ((u32)(Rand_ZeroFloat(1000.0f)) & 0xFFFF) + 40.0f; break; } - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->unk_276 = 0; } diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index d6cb3bb9ca..896855a202 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -34,22 +34,68 @@ const ActorInit En_Crow_InitVars = { (ActorFunc)EnCrow_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit = { - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, - { 1, { { 0, 0, 0 }, 20 }, 100 }, +static ColliderJntSphElementInit sJntSphElementsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 20 }, 100 }, + }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 1, 0x000F, 0x001E, 30 }; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 30, 30 }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x24, 0x32, 0x02, 0x04, 0x02, - 0x02, 0x24, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static u32 sDeathCount = 0; @@ -57,11 +103,11 @@ static u32 sDeathCount = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 3000, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 88, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 65336, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 2000, ICHAIN_STOP), }; -static Vec3f sHeadVec[] = { 2500.0f, 0.0f, 0.0f }; +static Vec3f sHeadVec = { 2500.0f, 0.0f, 0.0f }; void EnCrow_Init(Actor* thisx, GlobalContext* globalCtx) { EnCrow* this = THIS; @@ -69,9 +115,9 @@ void EnCrow_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060010C0, &D_060000F0, this->jointTable, this->morphTable, 9); Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderItems); - this->collider.list[0].dim.worldSphere.radius = sJntSphInit.list->dim.modelSphere.radius; - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); + this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawFunc_Circle, 20.0f); sDeathCount = 0; EnCrow_SetupWait(this); @@ -85,7 +131,7 @@ void EnCrow_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnCrow_SetupWait(EnCrow* this) { this->timer = 100; - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; this->actionFunc = EnCrow_Wait; this->skelAnime.playSpeed = 1.0f; } @@ -125,7 +171,7 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 255, 0, 40); for (i = 0; i < 4; i++) { - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot, 50.0f * scale, 0, 0, i); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 50.0f * scale, 0, 0, i); } } else { func_8003426C(&this->actor, 0x4000, 255, 0, 40); @@ -135,7 +181,7 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; } - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actor.flags |= 0x10; this->actionFunc = func_809E0E2C; @@ -161,14 +207,15 @@ void func_809E0770(EnCrow* this) { if (sDeathCount == 10) { this->actor.params = 1; sDeathCount = 0; - this->collider.list[0].dim.worldSphere.radius = sJntSphInit.list->dim.modelSphere.radius * 0.03f * 100.0f; + this->collider.elements[0].dim.worldSphere.radius = + sJntSphInit.elements[0].dim.modelSphere.radius * 0.03f * 100.0f; } else { this->actor.params = 0; - this->collider.list[0].dim.worldSphere.radius = sJntSphInit.list->dim.modelSphere.radius; + this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; } Animation_PlayLoop(&this->skelAnime, &D_060000F0); - Math_Vec3f_Copy(&this->actor.posRot, &this->actor.initPosRot); + Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.initPosRot.pos); this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->timer = 300; @@ -189,13 +236,13 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 8) { this->aimRotY = this->actor.wallPolyRot; - } else if (func_8002DBB0(&this->actor, &this->actor.initPosRot) > 300.0f) { - this->aimRotY = func_8002DAC0(&this->actor, &this->actor.initPosRot); + } else if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 300.0f) { + this->aimRotY = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); } - if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->aimRotY, 5, 0x300, 0x10) == 0) && (skelanimeUpdated) && + if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->aimRotY, 5, 0x300, 0x10) == 0) && skelanimeUpdated && (Rand_ZeroOne() < 0.1f)) { - var = func_8002DAC0(&this->actor, &this->actor.initPosRot) - this->actor.shape.rot.y; + var = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos) - this->actor.shape.rot.y; if (var > 0) { this->aimRotY += 0x1000 + (0x1000 * Rand_ZeroOne()); } else { @@ -265,10 +312,11 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 4, 0xC00); } - if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) || (this->collider.base.atFlags & 2) || - (this->actor.bgCheckFlags & 9) || (player->stateFlags1 & 0x00800000) || (this->actor.yDistToWater > -40.0f)) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) || + (this->collider.base.atFlags & AT_HIT) || (this->actor.bgCheckFlags & 9) || + (player->stateFlags1 & 0x00800000) || (this->actor.yDistToWater > -40.0f)) { + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_ATTACK); } @@ -302,12 +350,12 @@ void EnCrow_Die(EnCrow* this, GlobalContext* globalCtx) { step = 0.002f; } - if (Math_StepToF(&this->actor.scale, 0.0f, step)) { + if (Math_StepToF(&this->actor.scale.x, 0.0f, step)) { if (this->actor.params == 0) { sDeathCount++; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot, 0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot, ITEM00_RUPEE_RED); + Item_DropCollectible(globalCtx, &this->actor.posRot.pos, ITEM00_RUPEE_RED); } func_809E0770(this); } @@ -350,7 +398,7 @@ void func_809E10A8(EnCrow* this, GlobalContext* globalCtx) { } else { target = 0.01f; } - if (Math_StepToF(&this->actor.scale, target, target * 0.1f)) { + if (Math_StepToF(&this->actor.scale.x, target, target * 0.1f)) { this->actor.flags |= 1; this->actor.flags &= ~0x10; this->actor.colChkInfo.health = 1; @@ -361,9 +409,9 @@ void func_809E10A8(EnCrow* this, GlobalContext* globalCtx) { } void func_809E1174(EnCrow* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.list[0].body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.elements[0].info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actor.colChkInfo.damageEffect == 1) { func_809E06E8(this); @@ -402,20 +450,20 @@ void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx) { height = 0.0f; } - this->collider.list[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + height; - this->collider.list[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + height; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; if (this->actionFunc == func_809E0C8C) { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - if (this->collider.base.acFlags & 1) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + if (this->collider.base.acFlags & AC_ON) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != func_809E10A8) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } Actor_SetHeight(&this->actor, height); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h index 75709dd846..741eee3663 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -19,7 +19,7 @@ typedef struct EnCrow { /* 0x01CA */ Vec3s jointTable[9]; /* 0x0200 */ Vec3s morphTable[9]; /* 0x0238 */ ColliderJntSph collider; - /* 0x0258 */ ColliderJntSphItem colliderItems[1]; + /* 0x0258 */ ColliderJntSphElement colliderItems[1]; } EnCrow; // size = 0x0298 extern const ActorInit En_Crow_InitVars; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 3496455bcf..15d2f40e74 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -24,6 +24,26 @@ const ActorInit En_Cs_InitVars = { (ActorFunc)EnCs_Update, (ActorFunc)EnCs_Draw, }; + +static ColliderCylinderInit D_809E28C0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 18, 63, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E18B0.s") diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index bdf11791b2..625136448a 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -72,14 +72,61 @@ const ActorInit En_Daiku_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 66, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable sDamageTable = { 0 }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static EnDaikuAnimation sAnimations[] = { { 0x06001AB0, 1.0f, 0, 0 }, { 0x06007DE0, 1.0f, 0, 0 }, { 0x0600885C, 1.0f, 0, 0 }, @@ -143,7 +190,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); Animation_Change(&this->skelAnime, sAnimations[0].anim, 1.0f, 0.0f, Animation_GetLastFrame(sAnimations[0].anim), sAnimations[0].mode, sAnimations[0].transitionRate); @@ -544,7 +591,7 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index f327132059..44457977ce 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -23,6 +23,26 @@ const ActorInit En_Daiku_Kakariko_InitVars = { (ActorFunc)EnDaikuKakariko_Update, (ActorFunc)EnDaikuKakariko_Draw, }; + +static ColliderCylinderInit D_809E54B0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 18, 66, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4320.s") diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 2eb93eec02..4f0c991ab2 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -29,6 +29,99 @@ const ActorInit En_Dekubaba_InitVars = { (ActorFunc)EnDekubaba_Update, (ActorFunc)EnDekubaba_Draw, }; + +static ColliderJntSphElementInit D_809E8ECC[7] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 100, 1000 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 51, { { 0, 0, 1500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 52, { { 0, 0, 500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 53, { { 0, 0, 1500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 54, { { 0, 0, 500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 55, { { 0, 0, 1500 }, 8 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 56, { { 0, 0, 500 }, 8 }, 100 }, + }, +}; + +static ColliderJntSphInit D_809E8FC8 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 7, + D_809E8ECC, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s") diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 9f2deb29b2..377c5ef40b 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -40,6 +40,26 @@ const ActorInit En_Dekunuts_InitVars = { (ActorFunc)EnDekunuts_Update, (ActorFunc)EnDekunuts_Draw, }; + +static ColliderCylinderInit D_809EAB50 = { + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 18, 32, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s") diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 393c2d4dba..d728b93510 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -56,28 +56,86 @@ const ActorInit En_Dh_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x0D, 0x09, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000008, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 35, 70, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x09 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON | OCELEM_UNK3, + }, { 1, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x09, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static DamageTable D_809EC620 = { { - 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, -} }; +static DamageTable D_809EC620 = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(4, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 47, ICHAIN_CONTINUE), @@ -98,7 +156,7 @@ void EnDh_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007E88, &D_06005880, this->jointTable, this->limbRotTable, 16); ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 64.0f); this->actor.params = ENDH_WAIT_UNDERGROUND; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = (gSaveContext.linkAge == 0) ? 14 : 20; this->alpha = this->unk_258 = 255; this->actor.flags &= ~1; @@ -256,8 +314,8 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { } else if ((this->actor.xzDistToLink > 100.0f) || !func_8002E084(&this->actor, 60 * 0x10000 / 360)) { Animation_Change(&this->skelAnime, &D_06004658, -1.0f, this->skelAnime.curFrame, 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState = 4; - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; } switch (this->actionState) { case 1: @@ -269,17 +327,19 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { break; case 2: if (this->skelAnime.curFrame >= 4.0f) { - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0x11; - this->collider2.list[0].body.toucher.flags = 0xFFCFFFFF; - this->collider2.list->body.toucher.damage = 8; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = + AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD + this->collider2.elements[0].info.toucher.dmgFlags = 0xFFCFFFFF; + this->collider2.elements[0].info.toucher.damage = 8; } - if (this->collider2.base.atFlags & 4) { - this->collider2.base.atFlags &= ~6; - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + if (this->collider2.base.atFlags & AT_BOUNCED) { + this->collider2.base.atFlags &= ~(AT_HIT | AT_BOUNCED); + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = + AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; this->actionState++; - } else if (this->collider2.base.atFlags & 2) { - this->collider2.base.atFlags &= ~2; + } else if (this->collider2.base.atFlags & AT_HIT) { + this->collider2.base.atFlags &= ~AT_HIT; func_8002F71C(globalCtx, &this->actor, 8.0f, this->actor.shape.rot.y, 8.0f); } break; @@ -292,8 +352,9 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_06004658, -1.0f, Animation_GetLastFrame(&D_06004658), 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState++; - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = + AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; } break; case 5: @@ -322,9 +383,10 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) { case 0: this->actionState++; this->drawDirtWave++; - this->collider1.base.atFlags = this->collider1.body.toucherFlags = 0x11; - this->collider1.body.toucher.flags = 0xFFCFFFFF; - this->collider1.body.toucher.damage = 4; + this->collider1.base.atFlags = this->collider1.info.toucherFlags = + AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD + this->collider1.info.toucher.dmgFlags = 0xFFCFFFFF; + this->collider1.info.toucher.damage = 4; case 1: this->dirtWavePhase += 0x47E; Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 8.0f, 0.0f); @@ -339,8 +401,8 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) { case 2: this->drawDirtWave = false; this->collider1.dim.radius = 35; - this->collider1.base.atFlags = this->collider1.body.toucherFlags = 0; - this->collider1.body.toucher.flags = this->collider1.body.toucher.damage = 0; + this->collider1.base.atFlags = this->collider1.info.toucherFlags = AT_NONE; // Also TOUCH_NONE + this->collider1.info.toucher.dmgFlags = this->collider1.info.toucher.damage = 0; EnDh_SetupWait(this); break; } @@ -420,11 +482,11 @@ void EnDh_CollisionCheck(EnDh* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 lastHealth; - if ((this->collider2.base.acFlags & 2) && !this->retreat) { - this->collider2.base.acFlags &= ~2; + if ((this->collider2.base.acFlags & AC_HIT) && !this->retreat) { + this->collider2.base.acFlags &= ~AC_HIT; if ((this->actor.colChkInfo.damageEffect != 0) && (this->actor.colChkInfo.damageEffect != 6)) { - this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0; - this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0; + this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = AT_NONE; // also TOUCH_NONE + this->collider2.elements[0].info.toucher.dmgFlags = this->collider2.elements[0].info.toucher.damage = 0; if (player->unk_844 != 0) { this->unk_258 = player->unk_845; } @@ -457,7 +519,7 @@ void EnDh_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 20.0f, 45.0f, 45.0f, 0x1D); this->actor.posRot2.pos = this->headPos; - Collider_CylinderUpdate(&this->actor, &this->collider1); + Collider_UpdateCylinder(&this->actor, &this->collider1); if (this->actor.colChkInfo.health > 0) { if (this->curAction == DH_WAIT) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); @@ -485,7 +547,7 @@ void EnDh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Matrix_MultVec3f(&headOffset, &this->headPos); Matrix_Push(); Matrix_Translate(headOffset.x, headOffset.y, headOffset.z, MTXMODE_APPLY); - func_800628A4(1, &this->collider2); + Collider_UpdateSpheres(1, &this->collider2); Matrix_Pull(); } } diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/src/overlays/actors/ovl_En_Dh/z_en_dh.h index 587de29040..85bda207d8 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -25,7 +25,7 @@ typedef struct EnDh { /* 0x025E */ s16 dirtWavePhase; /* 0x0260 */ ColliderCylinder collider1; /* 0x02AC */ ColliderJntSph collider2; - /* 0x02CC */ ColliderJntSphItem elements[1]; + /* 0x02CC */ ColliderJntSphElement elements[1]; /* 0x030C */ Vec3f headPos; /* 0x0318 */ f32 dirtWaveSpread; /* 0x031C */ f32 dirtWaveHeight; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 19688ec4e7..ba52daaacf 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -36,38 +36,110 @@ const ActorInit En_Dha_InitVars = { (ActorFunc)EnDha_Draw, }; -static DamageTable sDamageTable = { { - 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0xF4, 0xF2, 0xF4, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(2, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(4, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 1, { { 0, 0, 0 }, 12 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 2, { { 3200, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 3, { { 1200, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 4, { { 2700, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 5, { { 1200, 0, 0 }, 10 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x19, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 5, - sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -92,7 +164,7 @@ void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Teardrop, 90.0f); this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += 50.0f; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 8; this->unk_1CE = -0x4000; Collider_InitJntSph(globalCtx, &this->collider); @@ -287,8 +359,8 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { } void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx) { - if (!((this->unk_1C0 >= 8) || !(this->collider.base.acFlags & 2))) { - this->collider.base.acFlags &= ~2; + if (!((this->unk_1C0 >= 8) || !(this->collider.base.acFlags & AC_HIT))) { + this->collider.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect == 0 || this->actor.colChkInfo.damageEffect == 6) { return; } else { @@ -346,18 +418,18 @@ void EnDha_OverridePostDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList switch (limbIndex) { case 1: - func_800628A4(2, &this->collider); - func_800628A4(3, &this->collider); + Collider_UpdateSpheres(2, &this->collider); + Collider_UpdateSpheres(3, &this->collider); break; case 2: - func_800628A4(4, &this->collider); - func_800628A4(5, &this->collider); + Collider_UpdateSpheres(4, &this->collider); + Collider_UpdateSpheres(5, &this->collider); Matrix_MultVec3f(&D_809ED770, &this->unk_1F4); break; case 3: - func_800628A4(1, &this->collider); + Collider_UpdateSpheres(1, &this->collider); Matrix_MultVec3f(&D_809ED764, &this->unk_1DC); Matrix_MultVec3f(&D_809ED770, &this->unk_1E8); break; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.h b/src/overlays/actors/ovl_En_Dha/z_en_dha.h index 3b14252b9d..6a6b8311e6 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.h +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.h @@ -25,7 +25,7 @@ typedef struct EnDha { /* 0x01E8 */ Vec3f unk_1E8; /* 0x01F4 */ Vec3f unk_1F4; /* 0x0200 */ ColliderJntSph collider; - /* 0x0220 */ ColliderJntSphItem colliderItem[5]; + /* 0x0220 */ ColliderJntSphElement colliderItem[5]; } EnDha; // size = 0x0360 extern const ActorInit En_Dha_InitVars; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index a9b8c0f395..c67aea9a16 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -25,6 +25,26 @@ const ActorInit En_Diving_Game_InitVars = { (ActorFunc)EnDivingGame_Update, (ActorFunc)EnDivingGame_Draw, }; + +static ColliderCylinderInit D_809EF0B4 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 10, 10, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s") diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 8f1ff9d7e1..150159e138 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -56,9 +56,22 @@ const ActorInit En_Dns_InitVars = { (ActorFunc)EnDns_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 18, 32, 0, { 0, 0, 0 } }, }; @@ -143,11 +156,11 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_060009A0, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 35.0f); this->actor.textId = D_809F040C[this->actor.params]; Actor_SetScale(&this->actor, 0.01f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->maintainCollider = 1; this->standOnGround = 1; this->dropCollectible = 0; @@ -316,7 +329,7 @@ void EnDns_Wait(EnDns* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = EnDns_Talk; } else { - if ((this->collider.base.maskA & 2) || (this->actor.unk_10C != 0)) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->actor.unk_10C != 0)) { this->actor.flags |= 0x10000; } else { this->actor.flags &= ~0x10000; @@ -477,7 +490,7 @@ void EnDns_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4); } if (this->maintainCollider) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index cd9622c448..3d588b927f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -31,6 +31,26 @@ const ActorInit En_Dnt_Jiji_InitVars = { (ActorFunc)EnDntJiji_Update, (ActorFunc)EnDntJiji_Draw, }; + +static ColliderCylinderInit D_809F2FA0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 30, 80, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s") diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 79b31a6b2d..ee987978c1 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -35,6 +35,46 @@ const ActorInit En_Dnt_Nomal_InitVars = { (ActorFunc)EnDntNomal_Update, NULL, }; + +static ColliderQuadInit D_809F5DFC = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderCylinderInit D_809F5DD0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 16, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Init.s") diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index a9c17f8eba..37b7de4a41 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -28,6 +28,26 @@ const ActorInit En_Dodojr_InitVars = { (ActorFunc)EnDodojr_Update, (ActorFunc)EnDodojr_Draw, }; + +static ColliderCylinderInit D_809F7EB0 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFC5FFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 18, 20, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Init.s") diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 09d569c5c7..cd9a7ea29f 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -59,69 +59,190 @@ const ActorInit En_Dodongo_InitVars = { (ActorFunc)EnDodongo_Draw, }; -static ColliderJntSphItemInit sBodyElementsInit[6] = { +static ColliderJntSphElementInit sBodyElementsInit[6] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 15, { { 0, 0, 0 }, 17 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 14, { { 0, 0, 0 }, 15 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 13, { { 0, 0, 0 }, 10 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 21, { { 0, 0, 0 }, 20 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 28, { { 0, 0, 0 }, 20 }, 100 }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x0D800691, 0x00, 0x00 }, 0x00, 0x01, 0x09 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0D800691, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON | OCELEM_UNK3, + }, { 6, { { 0, 0, 0 }, 35 }, 100 }, }, }; static ColliderJntSphInit sBodyJntSphInit = { - { COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 6, sBodyElementsInit, }; -static ColliderTrisItemInit sHardElementsInit[3] = { +static ColliderTrisElementInit sHardElementsInit[3] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xF24BF96E, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xF24BF96E, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCBF96E, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCBF96E, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCBF96E, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCBF96E, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sHardTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 3, sHardElementsInit, }; static ColliderQuadInit sAttackQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x20000000, 0x01, 0x10 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x01, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0xF4, 0x02, 0x02, 0x02, - 0x02, 0x60, 0xF3, 0x60, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(1, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0xF), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(3, 0xF), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; void EnDodongo_SetupAction(EnDodongo* this, EnDodongoActionFunc actionFunc) { @@ -208,7 +329,7 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01875f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31); this->actor.colChkInfo.health = 4; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.damageTable = &sDamageTable; Collider_InitQuad(globalCtx, &this->colliderAT); Collider_InitTris(globalCtx, &this->colliderHard); @@ -494,13 +615,13 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { if ((this->timer != 0) || (ABS(yawDiff1) < 0x4000)) { - this->sphElements[2].body.toucherFlags = 0; - this->sphElements[1].body.toucherFlags = 0; - this->colliderBody.base.atFlags = 0; - this->sphElements[2].body.toucher.flags = 0; - this->sphElements[1].body.toucher.flags = 0; - this->sphElements[2].body.toucher.damage = 0; - this->sphElements[1].body.toucher.damage = 0; + this->sphElements[2].info.toucherFlags = TOUCH_NONE; + this->sphElements[1].info.toucherFlags = TOUCH_NONE; + this->colliderBody.base.atFlags = AT_NONE; + this->sphElements[2].info.toucher.dmgFlags = 0; + this->sphElements[1].info.toucher.dmgFlags = 0; + this->sphElements[2].info.toucher.damage = 0; + this->sphElements[1].info.toucher.damage = 0; EnDodongo_SetupBreatheFire(this); this->timer = Rand_S16Offset(5, 10); } else { @@ -517,10 +638,10 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_TAIL); Animation_PlayOnceSetSpeed(&this->skelAnime, animation, 2.0f); this->timer = 18; - this->colliderBody.base.atFlags = this->sphElements[1].body.toucherFlags = - this->sphElements[2].body.toucherFlags = 0x11; - this->sphElements[1].body.toucher.flags = this->sphElements[2].body.toucher.flags = 0xFFCFFFFF; - this->sphElements[1].body.toucher.damage = this->sphElements[2].body.toucher.damage = 8; + this->colliderBody.base.atFlags = this->sphElements[1].info.toucherFlags = + this->sphElements[2].info.toucherFlags = AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD + this->sphElements[1].info.toucher.dmgFlags = this->sphElements[2].info.toucher.dmgFlags = 0xFFCFFFFF; + this->sphElements[1].info.toucher.damage = this->sphElements[2].info.toucher.damage = 8; } } else if (this->timer > 1) { Vec3f tailPos; @@ -536,7 +657,7 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { tailPos.z = this->sphElements[2].dim.worldSphere.center.z; func_80033260(globalCtx, &this->actor, &tailPos, 5.0f, 2, 2.0f, 100, 15, 0); - if (this->colliderBody.base.atFlags & 2) { + if (this->colliderBody.base.atFlags & AT_HIT) { Player* player = PLAYER; if (this->colliderBody.base.at == &player->actor) { @@ -600,11 +721,11 @@ void EnDodongo_Stunned(EnDodongo* this, GlobalContext* globalCtx) { } void EnDodongo_CollisionCheck(EnDodongo* this, GlobalContext* globalCtx) { - if (this->colliderHard.base.acFlags & 0x80) { - this->colliderHard.base.acFlags &= ~0x80; - this->colliderBody.base.acFlags &= ~2; - } else if ((this->colliderBody.base.acFlags & 2) && (this->actionState > DODONGO_DEATH)) { - this->colliderBody.base.acFlags &= ~2; + if (this->colliderHard.base.acFlags & AC_BOUNCED) { + this->colliderHard.base.acFlags &= ~AC_BOUNCED; + this->colliderBody.base.acFlags &= ~AC_HIT; + } else if ((this->colliderBody.base.acFlags & AC_HIT) && (this->actionState > DODONGO_DEATH)) { + this->colliderBody.base.acFlags &= ~AC_HIT; func_8003573C(&this->actor, &this->colliderBody, 0); if (this->actor.colChkInfo.damageEffect != 0xE) { this->damageEffect = this->actor.colChkInfo.damageEffect; @@ -647,8 +768,8 @@ void EnDodongo_UpdateQuad(EnDodongo* this, GlobalContext* globalCtx) { Matrix_MultVec3f(&sp7C, &this->colliderAT.dim.quad[d]); Matrix_MultVec3f(&sp70, &this->colliderAT.dim.quad[c]); - func_80062734(&this->colliderAT, &this->colliderAT.dim.quad[a], &this->colliderAT.dim.quad[b], - &this->colliderAT.dim.quad[c], &this->colliderAT.dim.quad[d]); + Collider_SetQuadVertices(&this->colliderAT, &this->colliderAT.dim.quad[a], &this->colliderAT.dim.quad[b], + &this->colliderAT.dim.quad[c], &this->colliderAT.dim.quad[d]); } void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -727,7 +848,7 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList Vec3f mouthOffset = { 1800.0f, 1200.0f, 0.0f }; Vec3f headOffset = { 1500.0f, 300.0f, 0.0f }; - func_800628A4(limbIndex, &this->colliderBody); + Collider_UpdateSpheres(limbIndex, &this->colliderBody); switch (limbIndex) { case 2: @@ -742,9 +863,9 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList Matrix_MultVec3f(&hardTris1VtxOffset[i], &hardTris1Vtx[i]); Matrix_MultVec3f(&hardTris2VtxOffset[i], &hardTris2Vtx[i]); } - func_800627A0(&this->colliderHard, 0, &hardTris0Vtx[0], &hardTris0Vtx[1], &hardTris0Vtx[2]); - func_800627A0(&this->colliderHard, 1, &hardTris1Vtx[0], &hardTris1Vtx[1], &hardTris1Vtx[2]); - func_800627A0(&this->colliderHard, 2, &hardTris2Vtx[0], &hardTris2Vtx[1], &hardTris2Vtx[2]); + Collider_SetTrisVertices(&this->colliderHard, 0, &hardTris0Vtx[0], &hardTris0Vtx[1], &hardTris0Vtx[2]); + Collider_SetTrisVertices(&this->colliderHard, 1, &hardTris1Vtx[0], &hardTris1Vtx[1], &hardTris1Vtx[2]); + Collider_SetTrisVertices(&this->colliderHard, 2, &hardTris2Vtx[0], &hardTris2Vtx[1], &hardTris2Vtx[2]); Matrix_MultVec3f(&mouthOffset, &this->mouthPos); Matrix_MultVec3f(&headOffset, &this->headPos); break; diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index b7ea2e6a3c..d882e06e96 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -34,9 +34,9 @@ typedef struct EnDodongo { /* 0x03D0 */ s32 blureIdx; /* 0x03D4 */ ColliderQuad colliderAT; /* 0x0454 */ ColliderTris colliderHard; - /* 0x0474 */ ColliderTrisItem trisElements[3]; + /* 0x0474 */ ColliderTrisElement trisElements[3]; /* 0x0588 */ ColliderJntSph colliderBody; - /* 0x05A8 */ ColliderJntSphItem sphElements[6]; + /* 0x05A8 */ ColliderJntSphElement sphElements[6]; } EnDodongo; // size = 0x0728 typedef enum { diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 4736341b18..c62aa7da2f 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -35,18 +35,26 @@ const ActorInit En_Dog_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 16, 20, 0, { 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, // health - 0x0000, // unk_10 - 0x0000, // unk_12 - 0x0000, // unk_14 - 0x32, // mass -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, 50 }; static struct_80034EC0_Entry sAnimations[] = { { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x06001368, 1.0f, 0.0f, -1.0f, 0x00, -6.0f }, @@ -157,8 +165,8 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) { } s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; return 2; } @@ -166,8 +174,8 @@ s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) { return 0; } - if (this->collider.base.maskB & 1) { - this->collider.base.maskB &= ~1; + if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; if (gSaveContext.dogParams != 0) { return 0; } @@ -241,7 +249,7 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, 0, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; @@ -437,8 +445,8 @@ void EnDog_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, 5); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnDog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 0f3603195c..1dce215b9d 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -39,7 +39,7 @@ void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004768, &D_0600039C, this->jointTable, this->morphTable, 6); Animation_PlayOnce(&this->skelAnime, &D_0600039C); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.013f); diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index f852d5b39b..9252b64701 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -27,6 +27,26 @@ const ActorInit En_Du_InitVars = { (ActorFunc)EnDu_Update, (ActorFunc)EnDu_Draw, }; + +static ColliderCylinderInit D_809FF230 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Du/func_809FDC30.s") diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 0ae3508130..3a986d679c 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -28,6 +28,26 @@ const ActorInit En_Eiyer_InitVars = { (ActorFunc)EnEiyer_Update, (ActorFunc)EnEiyer_Draw, }; + +static ColliderCylinderInit D_80A01970 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x04, 0x08 }, + { 0x00000019, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 27, 17, -10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s") diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 76f6cc0e05..3a4467f2d7 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -42,64 +42,155 @@ const ActorInit En_Fd_InitVars = { (ActorFunc)EnFd_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[12] = { +static ColliderJntSphElementInit sJntSphElementsInit[12] = { { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040088, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040088, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 21, { { 1600, 0, 0 }, 5 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 12, { { 1600, 0, 0 }, 5 }, 400 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 14, { { 800, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 15, { { 1600, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 16, { { 2000, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 17, { { 800, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 18, { { 1600, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 19, { { 2000, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 4, { { 2200, 0, 0 }, 4 }, 400 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 4, { { 5000, 0, 0 }, 4 }, 300 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 8, { { 2200, 0, 0 }, 4 }, 400 }, }, { - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00040008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00040008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 8, { { 5000, 0, 0 }, 4 }, 300 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 12, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit2 sColChkInit = { 24, 2, 25, 25, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 24, 2, 25, 25, MASS_IMMOVABLE }; static struct_80034EC0_Entry sAnimations[] = { { 0x060010B4, 1.0f, 0.0f, -1.0f, 0x03, 0.0f }, { 0x06005C64, 1.0f, 0.0f, -1.0f, 0x03, -10.0f }, @@ -175,15 +266,15 @@ s32 EnFd_CheckHammer(EnFd* this, GlobalContext* globalCtx) { s32 EnFd_ColliderCheck(EnFd* this, GlobalContext* globalCtx) { Player* player = PLAYER; - ColliderBody* body; + ColliderInfo* info; - if (this->collider.base.acFlags & 2 || EnFd_CheckHammer(this, globalCtx)) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT || EnFd_CheckHammer(this, globalCtx)) { + this->collider.base.acFlags &= ~AC_HIT; if (this->invincibilityTimer != 0) { return false; } - body = &this->collider.list[0].body; - if (body->acHitItem != NULL && (body->acHitItem->toucher.flags & 0x80)) { + info = &this->collider.elements[0].info; + if (info->acHitInfo != NULL && (info->acHitInfo->toucher.dmgFlags & 0x80)) { return false; } @@ -195,13 +286,13 @@ s32 EnFd_ColliderCheck(EnFd* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLAME_DAMAGE); func_80032C7C(globalCtx, &this->actor); return true; - } else if (DECR(this->attackTimer) == 0 && this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + } else if (DECR(this->attackTimer) == 0 && this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; if (this->invincibilityTimer != 0) { return false; } - if (this->collider.base.atFlags & 4) { + if (this->collider.base.atFlags & AT_BOUNCED) { return false; } this->attackTimer = 30; @@ -230,7 +321,7 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, GlobalContext* globalCtx) { // Check to see if the angle between this facing angle and `actor` is withing ~40 degrees angle = (f32)Math_Vec3f_Yaw(&this->actor.posRot.pos, &actor->posRot.pos) - this->actor.shape.rot.y; - if (ABS(angle) >= 0x1C71) { + if (ABS(angle) > 0x1C70) { return false; } @@ -354,7 +445,7 @@ void EnFd_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 32.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colSphs); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit); this->actor.flags &= ~1; this->actor.flags |= 0x1000000; Actor_SetScale(&this->actor, 0.01f); @@ -643,7 +734,7 @@ void EnFd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } } - func_800628A4(limbIndex, &this->collider); + Collider_UpdateSpheres(limbIndex, &this->collider); } void EnFd_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/src/overlays/actors/ovl_En_Fd/z_en_fd.h index 05203b5dcb..0095bbc6cb 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -32,7 +32,7 @@ typedef struct EnFd { /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ EnFdActionFunc actionFunc; /* 0x0194 */ ColliderJntSph collider; - /* 0x01B4 */ ColliderJntSphItem colSphs[12]; + /* 0x01B4 */ ColliderJntSphElement colSphs[12]; /* 0x04B4 */ u8 coreActive; /* 0x04B6 */ s16 initYawToInitPos; /* 0x04B8 */ s16 curYawToInitPos; diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 8561ae6823..89cfb3ba72 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -28,17 +28,61 @@ const ActorInit En_Fd_Fire_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x08 }, { 0x0D840008, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0x0D840008, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 12, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 1, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable sDamageTable = { { - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; void EnFdFire_UpdatePos(EnFdFire* this, Vec3f* targetPos) { f32 dist; @@ -66,13 +110,13 @@ s32 EnFdFire_CheckCollider(EnFdFire* this, GlobalContext* globalCtx) { return false; } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; return true; } - if (this->collider.base.maskB & 1) { - this->collider.base.maskB &= ~1; + if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; return true; } return false; @@ -86,7 +130,7 @@ void EnFdFire_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); this->actor.flags &= ~1; this->actor.gravity = -0.6f; this->actor.speedXZ = 5.0f; @@ -181,7 +225,7 @@ void EnFdFire_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 12.0f, 10.0f, 0.0f, 5); if (this->actionFunc != EnFdFire_Disappear) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index e809813ab1..ffd4615c39 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -276,8 +276,8 @@ void func_80A0FC48(EnFhgFire* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f pos; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags = this->collider.base.atFlags & ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER); } @@ -288,7 +288,7 @@ void func_80A0FC48(EnFhgFire* this, GlobalContext* globalCtx) { } Actor_MoveForward(&this->actor); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (player->invincibilityTimer == 0) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -337,9 +337,9 @@ void func_80A0FD8C(EnFhgFire* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, this->scale); if (3.0f < this->unk_18C) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (player->invincibilityTimer == 0) { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, (Collider*)&this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index d206566342..4b0d8fb6dd 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -23,6 +23,46 @@ const ActorInit En_Fire_Rock_InitVars = { (ActorFunc)EnFireRock_Update, (ActorFunc)EnFireRock_Draw, }; + +static ColliderCylinderInit D_80A12CCC = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 30, -10, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80A12CA0 = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x09, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 30, 30, -10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s") diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 00e535c605..55e6a64f6e 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -41,22 +41,68 @@ const ActorInit En_Firefly_InitVars = { (ActorFunc)EnFirefly_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { { - { 0x00, { 0xFFCFFFFF, 0x01, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, - { 1, { { 0, 1000, 0 }, 15 }, 100 }, -} }; +static ColliderJntSphElementInit sJntSphElementsInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 1, { { 0, 1000, 0 }, 15 }, 100 }, + }, +}; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit[0], + sJntSphElementsInit, }; static CollisionCheckInfoInit sColChkInfoInit = { 1, 10, 10, 30 }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0xF2, 0x34, 0x02, 0x02, 0x02, - 0x02, 0x20, 0x34, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x2), + /* Ice magic */ DMG_ENTRY(4, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { @@ -71,7 +117,7 @@ extern Gfx D_06001678[]; void EnFirefly_Extinguish(EnFirefly* this) { this->actor.params += 2; - this->collider.list->body.toucher.effect = 0; // None + this->collider.elements[0].info.toucher.effect = 0; // None this->auraType = KEESE_AURA_NONE; this->onFire = false; this->actor.naviEnemyId = 0x12; // Keese @@ -83,7 +129,7 @@ void EnFirefly_Ignite(EnFirefly* this) { } else { this->actor.params -= 2; } - this->collider.list->body.toucher.effect = 1; // Fire + this->collider.elements[0].info.toucher.effect = 1; // Fire this->auraType = KEESE_AURA_FIRE; this->onFire = true; this->actor.naviEnemyId = 0x11; // Fire Keese @@ -97,7 +143,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if ((this->actor.params & 0x8000) != 0) { this->actor.flags |= 0x80; @@ -127,11 +173,11 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { } if (this->actor.params == KEESE_ICE_FLY) { - this->collider.list->body.toucher.effect = 2; // Ice - this->actor.naviEnemyId = 0x56; // Ice Keese + this->collider.elements[0].info.toucher.effect = 2; // Ice + this->actor.naviEnemyId = 0x56; // Ice Keese } else { - this->collider.list->body.toucher.effect = 0; // Nothing - this->actor.naviEnemyId = 0x12; // Keese + this->collider.elements[0].info.toucher.effect = 0; // Nothing + this->actor.naviEnemyId = 0x12; // Keese } this->maxAltitude = this->actor.initPosRot.pos.y + 100.0f; @@ -143,7 +189,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { } } - this->collider.list->dim.worldSphere.radius = sJntSphInit.list[0].dim.modelSphere.radius; + this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; } void EnFirefly_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -564,9 +610,9 @@ void EnFirefly_Combust(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_UpdateDamage(EnFirefly* this, GlobalContext* globalCtx) { u8 damageEffect; - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.list->body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.elements[0].info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { @@ -612,8 +658,8 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { EnFirefly* this = THIS; GlobalContext* globalCtx = globalCtx2; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_ATTACK); if (this->onFire) { EnFirefly_Extinguish(this); @@ -639,9 +685,9 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { } func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 15.0f, 7); - this->collider.list->dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.list->dim.worldSphere.center.y = this->actor.posRot.pos.y + 10.0f; - this->collider.list->dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + 10.0f; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; if ((this->actionFunc == EnFirefly_DiveAttack) || (this->actionFunc == EnFirefly_DisturbDiveAttack)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index 0c48ba0990..7f90581c03 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -21,7 +21,7 @@ typedef struct EnFirefly { /* 0x0266 */ Vec3s morphTable[28]; /* 0x0310 */ f32 maxAltitude; /* 0x0314 */ ColliderJntSph collider; - /* 0x0344 */ ColliderJntSphItem colliderItems[1]; + /* 0x0344 */ ColliderJntSphElement colliderItems[1]; } EnFirefly; // size = 0x0374 typedef enum { diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 84c0395fb6..8c0efc5cb1 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -25,6 +25,33 @@ const ActorInit En_Fish_InitVars = { (ActorFunc)EnFish_Update, (ActorFunc)EnFish_Draw, }; + +static ColliderJntSphElementInit D_80A1701C[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 5 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80A17040 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80A1701C, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A15280.s") diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index a9b6eabad9..bb704421fc 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -58,22 +58,66 @@ const ActorInit En_Floormas_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x04, 0x10 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x05, 0x01 }, + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x04, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 25, 40, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x001E, 0x0028, 0x96 }; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 30, 40, 150 }; -static DamageTable sDamageTable = { { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, - 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x4), + /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(4, 0x4), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 0x157C, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 0xFC18, ICHAIN_STOP), + ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; extern Gfx D_06008688[]; @@ -102,7 +146,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->zOffset = -1600; invisble = this->actor.params & SPAWN_INVISIBLE; @@ -152,15 +196,15 @@ void EnFloormas_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnFloormas_MakeInvulnerable(EnFloormas* this) { - this->collider.base.type = COLTYPE_UNK12; - this->collider.base.acFlags |= 4; + this->collider.base.colType = COLTYPE_HARD; + this->collider.base.acFlags |= AC_HARD; this->actionTarget = 0x28; } void EnFloormas_MakeVulnerable(EnFloormas* this) { - this->collider.base.type = COLTYPE_UNK0; + this->collider.base.colType = COLTYPE_HIT0; this->actionTarget = 0; - this->collider.base.acFlags &= ~4; + this->collider.base.acFlags &= ~AC_HARD; } void EnFloormas_SetupBigDecideAction(EnFloormas* this) { @@ -262,7 +306,7 @@ void EnFloormas_SetupSplit(EnFloormas* this) { 0.0f); this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f; this->collider.dim.height = sCylinderInit.dim.height * 0.6f; - this->collider.body.bumperFlags &= ~4; + this->collider.info.bumperFlags &= ~BUMP_HOOKABLE; this->actor.speedXZ = 4.0f; this->actor.velocity.y = 7.0f; // using div creates a signed check. @@ -359,7 +403,7 @@ void EnFloormas_SetupSmWait(EnFloormas* this) { void EnFloormas_SetupTakeDamage(EnFloormas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); - if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) { this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; } else { this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; @@ -549,7 +593,7 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) { func_800286CC(globalCtx, &pos, &velocity, &accel, 450, 100); - func_8002F974(this, NA_SE_EN_FLOORMASTER_SLIDING); + func_8002F974(&this->actor, NA_SE_EN_FLOORMASTER_SLIDING); } void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) { @@ -720,7 +764,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); EnFloormas_SetupLand(this); - } else if ((this->actor.yDistToLink < -10.0f) && (this->collider.base.maskA & 2) && + } else if ((this->actor.yDistToLink < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && (&player->actor == this->collider.base.oc)) { globalCtx->grabPlayer(globalCtx, player); EnFloormas_SetupGrabLink(this, player); @@ -760,8 +804,8 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { // let go if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) { - parent = this->actor.parent; - child = this->actor.child; + parent = (EnFloormas*)this->actor.parent; + child = (EnFloormas*)this->actor.child; if (((parent->actionFunc == EnFloormas_GrabLink) || parent->actionFunc == EnFloormas_SmWait) && (child->actionFunc == EnFloormas_GrabLink || child->actionFunc == EnFloormas_SmWait)) { @@ -815,7 +859,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx) (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 10.0f)) && (fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 10.0f)) { EnFloormas_SetupSmWait(this); - this->collider.base.maskA |= 1; + this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & 2) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); @@ -839,8 +883,8 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { DECR(this->smActionTimer); - parent = this->actor.parent; - child = this->actor.child; + parent = (EnFloormas*)this->actor.parent; + child = (EnFloormas*)this->actor.child; if (this->smActionTimer == 0) { if (parent->actionFunc != EnFloormas_SmWait) { @@ -883,7 +927,7 @@ void EnFloormas_Merge(EnFloormas* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10; EnFloormas_MakeVulnerable(this); this->actor.params = 0; - this->collider.body.bumperFlags |= 4; + this->collider.info.bumperFlags |= BUMP_HOOKABLE; this->actor.colChkInfo.health = sColChkInfoInit.health; EnFloormas_SetupStand(this); } else { @@ -945,16 +989,16 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) { s32 pad; s32 isSmall; - if ((this->collider.base.acFlags & 2) != 0) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if ((this->collider.base.acFlags & AC_HIT) != 0) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { - if (this->collider.base.type != COLTYPE_UNK12) { + if (this->collider.base.colType != COLTYPE_HARD) { isSmall = 0; if (this->actor.scale.x < 0.01f) { isSmall = 1; } - if (isSmall && this->collider.body.acHitItem->toucher.flags & 0x80) { + if (isSmall && this->collider.info.acHitInfo->toucher.dmgFlags & 0x80) { this->actor.colChkInfo.damage = 2; this->actor.colChkInfo.damageEffect = 0; } @@ -991,8 +1035,8 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (this->actionFunc != EnFloormas_SmWait) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; this->actor.speedXZ *= -0.5f; if (-5.0f < this->actor.speedXZ) { @@ -1017,25 +1061,25 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { } func_8002E4B4(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (this->actionFunc == EnFloormas_Charge) { this->actor.flags |= 0x1000000; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != EnFloormas_GrabLink) { if (this->actionFunc != EnFloormas_Split && this->actionFunc != EnFloormas_TakeDamage && this->actor.freezeTimer == 0) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if ((this->actionFunc != EnFloormas_SmSlaveJumpAtMaster) || (this->skelAnime.curFrame < 20.0f)) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } Actor_SetHeight(&this->actor, this->actor.scale.x * 2500.0f); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { if (this->actionTarget != 0) { this->actionTarget--; } @@ -1077,14 +1121,14 @@ void EnFloormas_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_floormas.c", 2318); func_80093D18(globalCtx->state.gfxCtx); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026230(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28); } POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFloormas_OverrideLimbDraw, EnFloormas_PostLimbDraw, this, POLY_OPA_DISP); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026608(globalCtx); } @@ -1097,13 +1141,13 @@ void EnFloormas_DrawHighlighted(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_floormas.c", 2352); func_80093D84(globalCtx->state.gfxCtx); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026690(globalCtx, &sMergeColor, this->actionTarget % 0x28, 0x28); } POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFloormas_OverrideLimbDraw, EnFloormas_PostLimbDraw, this, POLY_XLU_DISP); - if (this->collider.base.type == COLTYPE_UNK12) { + if (this->collider.base.colType == COLTYPE_HARD) { func_80026A6C(globalCtx); } diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 5f549ec529..45480e1275 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -41,8 +41,22 @@ const ActorInit En_Fu_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -81,7 +95,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelanime, &D_06000B04); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); if (LINK_IS_CHILD) { this->actionFunc = EnFu_WaitChild; @@ -239,8 +253,8 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) { EnFu* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((!(this->behaviorFlags & FU_WAIT)) && (SkelAnime_Update(&this->skelanime) != 0)) { diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 8fff3863a0..9de9b3923c 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -30,20 +30,34 @@ const ActorInit En_Fw_InitVars = { (ActorFunc)EnFw_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x04 }, { 0xFFCFFFFE, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x04 }, + { 0xFFCFFFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 2, { { 1200, 0, 0 }, 16 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, 0xFF }; +static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, MASS_IMMOVABLE }; static struct_80034EC0_Entry D_80A1FBA0[] = { { 0x06006CF8, 0.0f, 0.0f, -1.0f, 0x03, 0.0f }, @@ -116,17 +130,17 @@ Vec3f* EnFw_GetPosAdjAroundCircle(Vec3f* dst, EnFw* this, f32 radius, s16 dir) { } s32 EnFw_CheckCollider(EnFw* this, GlobalContext* globalCtx) { - ColliderBody* body; + ColliderInfo* info; s32 phi_return; - if (this->collider.base.acFlags & 2) { - body = &this->collider.list[0].body; - if (body->acHitItem->toucher.flags & 0x80) { + if (this->collider.base.acFlags & AC_HIT) { + info = &this->collider.elements[0].info; + if (info->acHitInfo->toucher.dmgFlags & 0x80) { this->lastDmgHook = true; } else { this->lastDmgHook = false; } - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; if (Actor_ApplyDamage(&this->actor) <= 0) { if (this->actor.parent->colChkInfo.health <= 8) { func_80032C7C(globalCtx, &this->actor); @@ -174,7 +188,7 @@ void EnFw_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->sphs); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94); Actor_SetScale(&this->actor, 0.01f); this->runDirection = -this->actor.params; this->actionFunc = EnFw_Bounce; @@ -369,7 +383,7 @@ void EnFw_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Matrix_MultVec3f(&zeroVec, &this->actor.posRot2.pos); } - func_800628A4(limbIndex, &this->collider); + Collider_UpdateSpheres(limbIndex, &this->collider); } void EnFw_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/src/overlays/actors/ovl_En_Fw/z_en_fw.h index 5e0627b27d..46319dc186 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -26,7 +26,7 @@ typedef struct EnFw { /* 0x014C */ SkelAnime skelAnime; /* 0x0190 */ EnFwActionFunc actionFunc; /* 0x0194 */ ColliderJntSph collider; - /* 0x01B4 */ ColliderJntSphItem sphs[1]; + /* 0x01B4 */ ColliderJntSphElement sphs[1]; /* 0x01F4 */ Vec3f bompPos; /* 0x0200 */ u8 lastDmgHook; /* 0x0202 */ s16 runDirection; diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index c6b887da9d..d9b25d66bc 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -26,6 +26,63 @@ const ActorInit En_Fz_InitVars = { (ActorFunc)EnFz_Update, (ActorFunc)EnFz_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCE0FDB, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 30, 80, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x0001F024, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 35, 80, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x02, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 20, 30, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Init.s") diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 9edd8b2a3b..8bc8a09ad8 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -1,7 +1,14 @@ +/* + * File: z_en_g_switch.c + * Overlay: ovl_En_G_Switch + * Description: Silver rupees, shooting gallery targets, and horseback archery pots + */ + #include "z_en_g_switch.h" #include "vt.h" #include "overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" +#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" #define FLAGS 0x00000030 @@ -36,8 +43,22 @@ extern Gfx D_06001960[]; static s16 sCollectedCount = 0; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 13, 40, 0, { 0, 0, 0 } }, }; @@ -117,7 +138,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = 0.25f; this->actor.scale.y = 0.45f; this->actor.scale.z = 0.25f; - this->collider.body.bumper.flags = 0x1F820; + this->collider.info.bumper.dmgFlags = 0x1F820; this->objId = OBJECT_TSUBO; this->objIndex = Object_GetIndex(&globalCtx->objectCtx, this->objId); if (this->objIndex < 0) { @@ -163,10 +184,10 @@ void EnGSwitch_Break(EnGSwitch* this, GlobalContext* globalCtx) { randPos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(40.0f); randPos.y = this->actor.posRot.pos.y + 30.0f + Rand_CenteredFloat(35.0f); randPos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(40.0f); - hitPos.x = this->collider.body.bumper.unk_06.x; - hitPos.y = this->collider.body.bumper.unk_06.y; - hitPos.z = this->collider.body.bumper.unk_06.z; - EffectSsHitMark_SpawnCustomScale(globalCtx, 0, 700, &hitPos); + hitPos.x = this->collider.info.bumper.hitPos.x; + hitPos.y = this->collider.info.bumper.hitPos.y; + hitPos.z = this->collider.info.bumper.hitPos.z; + EffectSsHitMark_SpawnCustomScale(globalCtx, EFFECT_HITMARK_WHITE, 700, &hitPos); if (this->type == ENGSWITCH_ARCHERY_POT) { velocity.y = 15.0f; EffectSsExtra_Spawn(globalCtx, &hitPos, &velocity, &accel, 5, 2); @@ -319,9 +340,9 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { } break; } - if ((this->collider.base.acFlags & 2) || BREG(8)) { + if ((this->collider.base.acFlags & AC_HIT) || BREG(8)) { gallery = ((EnSyatekiItm*)this->actor.parent); - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; if (gallery->actor.update != NULL) { gallery->hitCount++; gallery->targetState[this->index] = ENSYATEKIHIT_HIT; @@ -344,8 +365,8 @@ void EnGSwitch_ArcheryPot(EnGSwitch* this, GlobalContext* globalCtx) { Vec3f* thisPos = &this->actor.posRot.pos; this->actor.shape.rot.y += 0x3C0; - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; for (i = 0, angle = 0; i < 30; i++, angle += 0x4E20) { Vec3f pos; Vec3f vel; @@ -421,7 +442,7 @@ void EnGSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { EnGSwitch_UpdateEffects(this, globalCtx); } if ((this->actionFunc != EnGSwitch_Kill) && (this->actionFunc != EnGSwitch_SilverRupeeIdle)) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 17667811ea..3aca501e6e 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -27,6 +27,44 @@ const ActorInit En_Gb_InitVars = { (ActorFunc)EnGb_Update, (ActorFunc)EnGb_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 40, 75, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 4, 20, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Gb/func_80A2F180.s") diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 608b5bfa45..11bf3d537f 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -26,6 +26,26 @@ const ActorInit En_Ge1_InitVars = { (ActorFunc)EnGe1_Update, (ActorFunc)EnGe1_Draw, }; + +static ColliderCylinderInit D_80A32770 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000702, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 40, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s") diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 678e3e3819..7ad8026138 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -24,6 +24,26 @@ const ActorInit En_Ge2_InitVars = { (ActorFunc)EnGe2_Update, (ActorFunc)EnGe2_Draw, }; + +static ColliderCylinderInit D_80A34310 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x000007A2, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 60, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A32BD0.s") diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index fea4223242..ecae5b6293 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -30,6 +30,26 @@ const ActorInit En_Ge3_InitVars = { (ActorFunc)EnGe3_Update, (ActorFunc)EnGe3_Draw, }; + +static ColliderCylinderInit D_80A35190 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000722, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 50, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34620.s") diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index dbe064d370..12d255ad3b 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -24,15 +24,6 @@ typedef enum { /* 16 */ GELDB_SPIN_DODGE } EnGeldBActionState; -typedef enum { - /* 0x0 */ GELDB_DAMAGE_NORMAL, - /* 0x1 */ GELDB_DAMAGE_STUN, - /* 0x6 */ GELDB_DAMAGE_UNK6 = 0x6, - /* 0xD */ GELDB_DAMAGE_UNKD = 0xD, - /* 0xE */ GELDB_DAMAGE_UNKE, - /* 0xF */ GELDB_DAMAGE_FREEZE -} EnGeldBDamageEffects; - void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx); void EnGeldB_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx); @@ -99,37 +90,125 @@ const ActorInit En_GeldB_InitVars = { }; static ColliderCylinderInit sBodyCylInit = { - { COLTYPE_UNK5, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 50, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sBlockTrisElementsInit[] = { +static ColliderTrisElementInit sBlockTrisElementsInit[2] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC1FFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sBlockTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sBlockTrisElementsInit, }; -static ColliderQuadInit sSwordQuadinit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, +static ColliderQuadInit sSwordQuadInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; +typedef enum { + /* 0x0 */ GELDB_DMG_NORMAL, + /* 0x1 */ GELDB_DMG_STUN, + /* 0x6 */ GELDB_DMG_UNK_6 = 0x6, + /* 0xD */ GELDB_DMG_UNK_D = 0xD, + /* 0xE */ GELDB_DMG_UNK_E, + /* 0xF */ GELDB_DMG_FREEZE +} EnGeldBDamageEffects; + static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0xF2, 0x02, 0x02, 0x02, - 0x02, 0xE4, 0x60, 0xD3, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x04, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, GELDB_DMG_STUN), + /* Deku stick */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Slingshot */ DMG_ENTRY(1, GELDB_DMG_NORMAL), + /* Explosive */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Boomerang */ DMG_ENTRY(0, GELDB_DMG_STUN), + /* Normal arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Hookshot */ DMG_ENTRY(0, GELDB_DMG_STUN), + /* Kokiri sword */ DMG_ENTRY(1, GELDB_DMG_NORMAL), + /* Master sword */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Fire arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Ice arrow */ DMG_ENTRY(2, GELDB_DMG_FREEZE), + /* Light arrow */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Unk arrow 1 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Unk arrow 2 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Unk arrow 3 */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Fire magic */ DMG_ENTRY(4, GELDB_DMG_UNK_E), + /* Ice magic */ DMG_ENTRY(0, GELDB_DMG_UNK_6), + /* Light magic */ DMG_ENTRY(3, GELDB_DMG_UNK_D), + /* Shield */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Mirror Ray */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Kokiri spin */ DMG_ENTRY(1, GELDB_DMG_NORMAL), + /* Giant spin */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Master spin */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, GELDB_DMG_NORMAL), + /* Giant jump */ DMG_ENTRY(8, GELDB_DMG_NORMAL), + /* Master jump */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Unknown 1 */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Unblockable */ DMG_ENTRY(0, GELDB_DMG_NORMAL), + /* Hammer jump */ DMG_ENTRY(4, GELDB_DMG_NORMAL), + /* Unknown 2 */ DMG_ENTRY(0, GELDB_DMG_NORMAL), }; static InitChainEntry sInitChain[] = { @@ -152,7 +231,7 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); thisx->colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Teardrop, 0.0f); - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.health = 20; thisx->colChkInfo.unk_10 = 50; thisx->colChkInfo.unk_12 = 100; @@ -167,7 +246,7 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitTris(globalCtx, &this->blockCollider); Collider_SetTris(globalCtx, &this->blockCollider, thisx, &sBlockTrisInit, this->blockElements); Collider_InitQuad(globalCtx, &this->swordCollider); - Collider_SetQuad(globalCtx, &this->swordCollider, thisx, &sSwordQuadinit); + Collider_SetQuad(globalCtx, &this->swordCollider, thisx, &sSwordQuadInit); blureInit.p1StartColor[0] = blureInit.p1StartColor[1] = blureInit.p1StartColor[2] = blureInit.p1StartColor[3] = blureInit.p2StartColor[0] = blureInit.p2StartColor[1] = blureInit.p2StartColor[2] = blureInit.p1EndColor[0] = blureInit.p1EndColor[1] = blureInit.p1EndColor[2] = blureInit.p2EndColor[0] = blureInit.p2EndColor[1] = @@ -758,7 +837,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { void EnGeldB_SetupSlash(EnGeldB* this) { Animation_PlayOnce(&this->skelAnime, &D_060003CC); - this->swordCollider.base.atFlags &= ~4; + this->swordCollider.base.atFlags &= ~AT_BOUNCED; this->actionState = GELDB_SLASH; this->spinAttackState = 0; this->actor.speedXZ = 0.0f; @@ -781,9 +860,9 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { } else if ((s32)this->skelAnime.curFrame == 6) { this->swordState = -1; } - if (this->swordCollider.base.atFlags & 4) { + if (this->swordCollider.base.atFlags & AT_BOUNCED) { this->swordState = -1; - this->swordCollider.base.atFlags &= ~6; + this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); EnGeldB_SetupRollBack(this); } else if (SkelAnime_Update(&this->skelAnime)) { if (!func_8002E084(&this->actor, 0x1554)) { @@ -816,7 +895,7 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { void EnGeldB_SetupSpinAttack(EnGeldB* this) { Animation_Change(&this->skelAnime, &D_06000F5C, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000F5C), ANIMMODE_ONCE_INTERP, 0.0f); - this->swordCollider.base.atFlags &= ~6; + this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); this->actionState = GELDB_SPIN_ATTACK; this->spinAttackState = 0; this->actor.speedXZ = 0.0f; @@ -829,12 +908,12 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { s16 angleToLink; if (this->spinAttackState < 2) { - if (this->swordCollider.base.atFlags & 4) { - this->swordCollider.base.atFlags &= ~6; + if (this->swordCollider.base.atFlags & AT_BOUNCED) { + this->swordCollider.base.atFlags &= ~(AT_HIT | AT_BOUNCED); this->spinAttackState = 1; this->skelAnime.playSpeed = 1.5f; - } else if (this->swordCollider.base.atFlags & 2) { - this->swordCollider.base.atFlags &= ~2; + } else if (this->swordCollider.base.atFlags & AT_HIT) { + this->swordCollider.base.atFlags &= ~AT_HIT; if (&player->actor == this->swordCollider.base.at) { func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f); this->spinAttackState = 2; @@ -925,10 +1004,10 @@ void EnGeldB_SetupStunned(EnGeldB* this) { if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = 0.0f; } - if ((this->damageEffect != GELDB_DAMAGE_FREEZE) || (this->actionState == GELDB_SPIN_ATTACK)) { + if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->actionState == GELDB_SPIN_ATTACK)) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06002280, 0.0f); } - if (this->damageEffect == GELDB_DAMAGE_FREEZE) { + if (this->damageEffect == GELDB_DMG_FREEZE) { this->iceTimer = 36; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -1277,18 +1356,18 @@ void func_80A392D8(EnGeldB* this, GlobalContext* globalCtx) { s32 pad; EnItem00* key; - if (this->blockCollider.base.acFlags & 0x80) { - this->blockCollider.base.acFlags &= ~0x80; - this->bodyCollider.base.acFlags &= ~2; - } else if ((this->bodyCollider.base.acFlags & 2) && (this->actionState >= GELDB_READY) && + if (this->blockCollider.base.acFlags & AC_BOUNCED) { + this->blockCollider.base.acFlags &= ~AC_BOUNCED; + this->bodyCollider.base.acFlags &= ~AC_HIT; + } else if ((this->bodyCollider.base.acFlags & AC_HIT) && (this->actionState >= GELDB_READY) && (this->spinAttackState < 2)) { - this->bodyCollider.base.acFlags &= ~2; - if (this->actor.colChkInfo.damageEffect != GELDB_DAMAGE_UNK6) { + this->bodyCollider.base.acFlags &= ~AC_HIT; + if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { this->damageEffect = this->actor.colChkInfo.damageEffect; - func_80035650(&this->actor, &this->bodyCollider.body, 1); + func_80035650(&this->actor, &this->bodyCollider.info, 1); func_800F8A44(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH); - if ((this->actor.colChkInfo.damageEffect == GELDB_DAMAGE_STUN) || - (this->actor.colChkInfo.damageEffect == GELDB_DAMAGE_FREEZE)) { + if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) || + (this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) { if (this->actionState != GELDB_STUNNED) { func_8003426C(&this->actor, 0, 0x78, 0, 0x50); Actor_ApplyDamage(&this->actor); @@ -1323,7 +1402,7 @@ void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx) { EnGeldB* this = THIS; func_80A392D8(this, globalCtx); - if (this->actor.colChkInfo.damageEffect != GELDB_DAMAGE_UNK6) { + if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); this->actionFunc(this, globalCtx); @@ -1331,7 +1410,7 @@ void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.posRot2.pos.y += 40.0f; func_80A391D8(this, globalCtx); } - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); if ((this->actionState >= GELDB_READY) && (this->spinAttackState < 2) && ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) { @@ -1395,8 +1474,9 @@ void EnGeldB_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Matrix_MultVec3f(&swordQuadOffset0, &this->swordCollider.dim.quad[0]); Matrix_MultVec3f(&swordQuadOffset3, &this->swordCollider.dim.quad[3]); Matrix_MultVec3f(&swordQuadOffset2, &this->swordCollider.dim.quad[2]); - func_80062734(&this->swordCollider, &this->swordCollider.dim.quad[0], &this->swordCollider.dim.quad[1], - &this->swordCollider.dim.quad[2], &this->swordCollider.dim.quad[3]); + Collider_SetQuadVertices(&this->swordCollider, &this->swordCollider.dim.quad[0], + &this->swordCollider.dim.quad[1], &this->swordCollider.dim.quad[2], + &this->swordCollider.dim.quad[3]); Matrix_MultVec3f(&swordTipOffset, &swordTip); Matrix_MultVec3f(&swordHiltOffset, &swordHilt); @@ -1511,8 +1591,8 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&blockTrisOffsets0[i], &blockTrisVtx0[i]); Matrix_MultVec3f(&blockTrisOffsets1[i], &blockTrisVtx1[i]); } - func_800627A0(&this->blockCollider, 0, &blockTrisVtx0[0], &blockTrisVtx0[1], &blockTrisVtx0[2]); - func_800627A0(&this->blockCollider, 1, &blockTrisVtx1[0], &blockTrisVtx1[1], &blockTrisVtx1[2]); + Collider_SetTrisVertices(&this->blockCollider, 0, &blockTrisVtx0[0], &blockTrisVtx0[1], &blockTrisVtx0[2]); + Collider_SetTrisVertices(&this->blockCollider, 1, &blockTrisVtx1[0], &blockTrisVtx1[1], &blockTrisVtx1[2]); } if (this->iceTimer != 0) { diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index 9e4fca5866..6e196cf6f9 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -35,7 +35,7 @@ typedef struct EnGeldB { /* 0x0320 */ ColliderCylinder bodyCollider; /* 0x036C */ ColliderQuad swordCollider; /* 0x03EC */ ColliderTris blockCollider; - /* 0x040C */ ColliderTrisItem blockElements[2]; + /* 0x040C */ ColliderTrisElement blockElements[2]; /* 0x04C4 */ Vec3f leftFootPos; /* 0x04D0 */ Vec3f rightFootPos; /* 0x04DC */ Vec3s headRot; diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 09f1e73611..202940f12f 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -40,6 +40,6 @@ typedef struct EnGirlA { /* 0x01D0 */ EnGirlA3Func unk_1D0; } EnGirlA; // size = 0x01D4 -extern const ActorInit En_Girla_InitVars; +extern const ActorInit En_GirlA_InitVars; #endif diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index b3ea1e86b6..aa5918a798 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -42,9 +42,22 @@ const ActorInit En_Gm_InitVars = { NULL, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 100, 120, 0, { 0, 0, 0 } }, }; @@ -101,10 +114,10 @@ void func_80A3D838(EnGm* this, GlobalContext* globalCtx) { 0.0f); this->actor.draw = EnGm_Draw; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); Actor_SetScale(&this->actor, 0.05f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->eyeTexIndex = 0; this->blinkTimer = 20; this->actor.textId = 0x3049; @@ -167,8 +180,8 @@ void func_80A3DB04(EnGm* this, GlobalContext* globalCtx) { this->actionFunc = func_80A3DC44; } else if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = func_80A3DBF4; - } else if ((this->collider.base.maskA & 2) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { - this->collider.base.acFlags &= ~2; + } else if ((this->collider.base.ocFlags1 & OC1_HIT) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { + this->collider.base.acFlags &= ~AC_HIT; func_8002F2CC(&this->actor, globalCtx, 415.0f); } } @@ -207,8 +220,8 @@ void func_80A3DC44(EnGm* this, GlobalContext* globalCtx) { this->actionFunc = EnGm_ProcessChoiceIndex; } - if ((this->collider.base.maskA & 2) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { - this->collider.base.acFlags &= ~2; + if ((this->collider.base.ocFlags1 & OC1_HIT) || (SQ(dx) + SQ(dz)) < SQ(100.0f)) { + this->collider.base.acFlags &= ~AC_HIT; func_8002F2CC(&this->actor, globalCtx, 415.0f); } } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index f73d6b1e84..2bbb9681c5 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -31,6 +31,26 @@ const ActorInit En_Go_InitVars = { (ActorFunc)EnGo_Update, (ActorFunc)EnGo_Draw, }; + +static ColliderCylinderInit D_80A41B00 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Go/func_80A3E570.s") diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 0a1192842c..aec705dd5d 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -30,6 +30,26 @@ const ActorInit En_Go2_InitVars = { (ActorFunc)EnGo2_Update, (ActorFunc)EnGo2_Draw, }; + +static ColliderCylinderInit D_80A48114 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000008, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 40, 65, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Go2/func_80A42D30.s") diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 2980e4e3e3..fc874ab498 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -33,6 +33,46 @@ const ActorInit En_Goma_InitVars = { (ActorFunc)EnGoma_Update, (ActorFunc)EnGoma_Draw, }; + +static ColliderCylinderInit D_80A4B7A0 = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80A4B7CC = { + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFDFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 15, 30, 10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s") diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 62db3bc38a..05754ba2b7 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -44,20 +44,34 @@ const ActorInit En_Goroiwa_InitVars = { (ActorFunc)EnGoroiwa_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x20000000, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 58 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, 254 }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY }; // Unused static f32 D_80A4DEBC[] = { 10.0f, 9.2f }; @@ -67,7 +81,7 @@ extern Gfx D_060006B0[]; void func_80A4BCA0(EnGoroiwa* this) { static f32 colliderHeightOffset[] = { 0.0f, 59.5f }; - Sphere16* worldSphere = &this->collider.list[0].dim.worldSphere; + Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; worldSphere->center.x = this->actor.posRot.pos.x; worldSphere->center.y = this->actor.posRot.pos.y + colliderHeightOffset[(this->actor.params >> 10) & 1]; @@ -80,7 +94,7 @@ void func_80A4BD04(EnGoroiwa* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); func_80A4BCA0(this); - this->collider.list[0].dim.worldSphere.radius = 58; + this->collider.elements[0].dim.worldSphere.radius = 58; } void func_80A4BD70(EnGoroiwa* this, u8 arg1) { @@ -524,7 +538,7 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); ActorShape_Init(&this->actor.shape, D_80A4DF10[(this->actor.params >> 10) & 1], ActorShadow_DrawFunc_Circle, 9.4f); this->actor.shape.unk_14 = 200; EnGoroiwa_SetSpeed(this, globalCtx); @@ -560,8 +574,8 @@ void func_80A4D624(EnGoroiwa* this, GlobalContext* globalCtx) { s16 yawDiff; s16 temp_v1_2; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; this->unk_1D3 &= ~4; yawDiff = this->actor.yawTowardsLink - this->actor.posRot.rot.y; if (yawDiff > -0x4000 && yawDiff < 0x4000) { @@ -643,7 +657,7 @@ void func_80A4DA3C(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->waitTimer > 0) { this->waitTimer--; } else { - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; func_80A4D5E0(this); } } @@ -656,8 +670,8 @@ void func_80A4DA7C(EnGoroiwa* this) { } void func_80A4DAD0(EnGoroiwa* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 4); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); if ((this->actor.initPosRot.rot.z & 1) == 1) { @@ -681,8 +695,8 @@ void func_80A4DB90(EnGoroiwa* this) { } void func_80A4DC00(EnGoroiwa* this, GlobalContext* globalCtx) { - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 4); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); if ((this->actor.initPosRot.rot.z & 1) == 1) { diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h index 03de3a9a11..1080f34cad 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -12,7 +12,7 @@ typedef struct EnGoroiwa { /* 0x0000 */ Actor actor; /* 0x014C */ EnGoroiwaActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ Vec3f unk_1B0; /* 0x01BC */ f32 unk_1BC; /* 0x01C0 */ f32 unk_1C0; diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index b016760776..2d10a0cd88 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -38,17 +38,62 @@ const ActorInit En_Gs_InitVars = { (ActorFunc)EnGs_Draw, }; -static ColliderCylinderInit D_80A4FDA0 = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 21, 48, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 D_80A4FDCC = { 0, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable D_80A4FDD8 = { 0x00, 0x00, 0xE0, 0xC0, 0xE0, 0xE0, 0xD0, 0xE0, 0xF0, 0xF0, 0xF0, - 0xB0, 0xB0, 0xB0, 0x00, 0x00, 0x00, 0xB0, 0xB0, 0xB0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0xE), + /* Explosive */ DMG_ENTRY(0, 0xC), + /* Boomerang */ DMG_ENTRY(0, 0xE), + /* Normal arrow */ DMG_ENTRY(0, 0xE), + /* Hammer swing */ DMG_ENTRY(0, 0xD), + /* Hookshot */ DMG_ENTRY(0, 0xE), + /* Kokiri sword */ DMG_ENTRY(0, 0xF), + /* Master sword */ DMG_ENTRY(0, 0xF), + /* Giant's Knife */ DMG_ENTRY(0, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0xB), + /* Ice arrow */ DMG_ENTRY(0, 0xB), + /* Light arrow */ DMG_ENTRY(0, 0xB), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0xB), + /* Ice magic */ DMG_ENTRY(0, 0xB), + /* Light magic */ DMG_ENTRY(0, 0xB), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), @@ -58,9 +103,9 @@ void EnGs_Init(Actor* thisx, GlobalContext* globalCtx) { EnGs* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - Collider_InitCylinder(globalCtx, &this->unk_14C); - Collider_SetCylinder(globalCtx, &this->unk_14C, thisx, &D_80A4FDA0); - func_80061EFC(&thisx->colChkInfo, &D_80A4FDD8, &D_80A4FDCC); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); + CollisionCheck_SetInfo2(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); thisx->unk_1F = 6; this->unk_1D8 = thisx->posRot.pos; @@ -481,9 +526,9 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx) {}; if (!(this->unk_19E & 0x10)) { if (globalCtx) {}; - if (this->unk_14C.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { this->unk_19F = 0; - this->unk_14C.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; switch (this->actor.colChkInfo.damageEffect) { case 15: @@ -513,9 +558,9 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { break; } } - Collider_CylinderUpdate(&this->actor, &this->unk_14C); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->unk_14C.base); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->unk_14C.base); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } this->actionFunc(this, globalCtx); func_80A4E648(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h index 04c45e9fcd..b8eecc4e5a 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -10,7 +10,7 @@ typedef void (*EnGsActionFunc)(struct EnGs*, GlobalContext*); typedef struct EnGs { /* 0x0000 */ Actor actor; - /* 0x014C */ ColliderCylinder unk_14C; + /* 0x014C */ ColliderCylinder collider; /* 0x0198 */ EnGsActionFunc actionFunc; /* 0x019C */ u8 unk_19C; /* 0x019D */ u8 unk_19D; diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 83f4e14e9a..f41c037e21 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -32,8 +32,14 @@ const ActorInit En_Guest_InitVars = { NULL, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 10, 60, 0, { 0, 0, 0 } }, }; @@ -93,7 +99,7 @@ void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.update = func_80A505CC; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); Actor_SetHeight(&this->actor, 60.0f); @@ -170,7 +176,7 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Actor_SetHeight(&this->actor, 60.0f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 46ed39c49f..580fc91f01 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -69,8 +69,22 @@ const ActorInit En_Heishi2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 33, 40, 0, { 0, 0, 0 } }, }; @@ -80,7 +94,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->initParams = this->actor.params & 0xFF; - this->actor.colChkInfo.mass = 255; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->initParams == 6) || (this->initParams == 9)) { this->actor.draw = func_80A54C6C; @@ -793,8 +807,8 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) { break; default: func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); break; } } diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 20acf705e3..33f8a17b9c 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -43,8 +43,22 @@ const ActorInit En_Heishi3_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 15, 70, 0, { 0, 0, 0 } }, }; @@ -63,7 +77,7 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.unk_1F = 6; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -213,8 +227,8 @@ void EnHeishi3_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.rot = this->actor.posRot.rot; Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnHeishi3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index d045135dad..4af73b3871 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -37,8 +37,22 @@ const ActorInit En_Heishi4_InitVars = { static u32 sFaceReactionSets[] = { 6, 7 }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 33, 40, 0, { 0, 0, 0 } }, }; @@ -53,7 +67,7 @@ void EnHeishi4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); this->type = thisx->params & 0xFF; - thisx->colChkInfo.mass = 0xFF; + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->pos = thisx->posRot.pos; thisx->unk_1F = 6; if (this->type == HEISHI4_AT_MARKET_DYING) { @@ -350,8 +364,8 @@ void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); func_8002E4B4(globalCtx, thisx, 10.0f, 10.0f, 30.0f, 0x1D); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnHeishi_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index ca38e6b78a..cf8f3ae4d1 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -53,17 +53,26 @@ const ActorInit En_Hintnuts_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 18, 32, 0, { 0, 0, 0 } } + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 18, 32, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x01, - 0x0012, - 0x0020, - 0xFE, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 18, 32, MASS_HEAVY }; static s16 sPuzzleCounter = 0; @@ -85,7 +94,7 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Init(globalCtx, &this->skelAnime, &D_060023B8, &D_06002F7C, this->jointTable, this->morphTable, 10); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetTextWithPrefix(globalCtx, &this->actor, (this->actor.params >> 8) & 0xFF); this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; @@ -123,7 +132,7 @@ void EnHintnuts_SetupWait(EnHintnuts* this) { this->animFlagAndTimer = Rand_S16Offset(100, 50); this->collider.dim.height = 5; this->actor.posRot.pos = this->actor.initPosRot.pos; - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnHintnuts_Wait; } @@ -158,7 +167,7 @@ void EnHintnuts_HitByScrubProjectile2(EnHintnuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060026C4, -3.0f); this->collider.dim.height = 0x25; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; if (this->actor.params > 0 && this->actor.params < 4 && this->actor.type == ACTORTYPE_ENEMY) { if (sPuzzleCounter == -4) { @@ -196,7 +205,7 @@ void EnHintnuts_SetupLeave(EnHintnuts* this, GlobalContext* globalCtx) { this->actor.speedXZ = 3.0f; this->animFlagAndTimer = 100; this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->collider.base.maskA &= ~1; + this->collider.base.ocFlags1 &= ~OC1_ON; this->actor.flags |= 0x10; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, this->actor.posRot.pos.x, this->actor.posRot.pos.y, @@ -228,7 +237,7 @@ void EnHintnuts_Wait(EnHintnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); } @@ -302,7 +311,7 @@ void EnHintnuts_Burrow(EnHintnuts* this, GlobalContext* globalCtx) { this->collider.dim.height = 5.0f + ((3.0f - CLAMP(this->skelAnime.curFrame, 1.0f, 3.0f)) * 12.0f); } if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; } Math_ApproachF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 0.5f, 3.0f); @@ -325,7 +334,7 @@ void EnHintnuts_BeginFreeze(EnHintnuts* this, GlobalContext* globalCtx) { void EnHintnuts_CheckProximity(EnHintnuts* this, GlobalContext* globalCtx) { if (this->actor.type != ACTORTYPE_ENEMY) { - if ((this->collider.base.maskA & 2) || (this->actor.unk_10C != 0)) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->actor.unk_10C != 0)) { this->actor.flags |= 0x10000; } else { this->actor.flags &= ~0x10000; @@ -462,9 +471,9 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) { } void EnHintnuts_ColliderCheck(EnHintnuts* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if (this->collider.base.ac->id != ACTOR_EN_NUTSBALL) { EnHintnuts_SetupBurrow(this); } else { @@ -488,8 +497,8 @@ void EnHintnuts_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 0x1D); } - Collider_CylinderUpdate(&this->actor, &this->collider); - if (this->collider.base.acFlags & 1) { + Collider_UpdateCylinder(&this->actor, &this->collider); + if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index c68d6cdd66..df9db553ad 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -62,26 +62,61 @@ const ActorInit En_Honotrap_InitVars = { (ActorFunc)EnHonotrap_Draw, }; -static ColliderTrisItemInit sTrisElementsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { -23.0f, 0.0f, 8.5f }, { 0.0f, -23.0f, 8.5f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { 0.0f, -23.0f, 8.5f }, { 23.0f, 0.0f, 8.5f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, sTrisElementsInit, }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00100000, 0x00, 0x00 }, 0x19, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00100000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 25, 0, { 0, 0, 0 } }, }; @@ -96,7 +131,7 @@ static InitChainEntry sInitChain[] = { void EnHonotrap_FlameCollisionCheck(EnHonotrap* this, GlobalContext* globalCtx) { s32 pad[3]; - Collider_CylinderUpdate(&this->actor, &this->collider.cyl); + Collider_UpdateCylinder(&this->actor, &this->collider.cyl); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.cyl.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.cyl.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.cyl.base); @@ -138,14 +173,14 @@ void EnHonotrap_InitEye(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < 2; i++) { for (j = 0, vtx = triangle; j < 3; j++, vtx++) { - Vec3f* baseVtx = &sTrisInit.list[i].dim.vtx[j]; + Vec3f* baseVtx = &sTrisInit.elements[i].dim.vtx[j]; vtx->x = baseVtx->z * sin + baseVtx->x * cos; vtx->y = baseVtx->y; vtx->z = baseVtx->z * cos - baseVtx->x * sin; Math_Vec3f_Sum(vtx, &thisx->posRot.pos, vtx); } - func_800627A0(&this->collider.tris, i, &triangle[0], &triangle[1], &triangle[2]); + Collider_SetTrisVertices(&this->collider.tris, i, &triangle[0], &triangle[1], &triangle[2]); } EnHonotrap_SetupEyeIdle(this); Actor_SetHeight(thisx, 0.0f); @@ -158,9 +193,9 @@ void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.0001f); Collider_InitCylinder(globalCtx, &this->collider.cyl); Collider_SetCylinder(globalCtx, &this->collider.cyl, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider.cyl); + Collider_UpdateCylinder(&this->actor, &this->collider.cyl); this->actor.minVelocityY = -1.0f; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); this->actor.shape.unk_14 = 0x80; this->targetPos = PLAYER->actor.posRot.pos; @@ -286,8 +321,8 @@ void EnHonotrap_SetupFlameDrop(EnHonotrap* this) { } void EnHonotrap_FlameDrop(EnHonotrap* this, GlobalContext* globalCtx) { - if ((this->collider.cyl.base.atFlags & 2) || (this->timer <= 0)) { - if ((this->collider.cyl.base.atFlags & 2) && !(this->collider.cyl.base.atFlags & 4)) { + if ((this->collider.cyl.base.atFlags & AT_HIT) || (this->timer <= 0)) { + if ((this->collider.cyl.base.atFlags & AT_HIT) && !(this->collider.cyl.base.atFlags & AT_BOUNCED)) { func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 0.0f); } this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; @@ -335,7 +370,7 @@ void EnHonotrap_FlameMove(EnHonotrap* this, GlobalContext* globalCtx) { ready &= Math_StepToF(&this->actor.posRot.pos.z, this->targetPos.z, speed.z); func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); - if (this->collider.tris.base.atFlags & 4) { + if (this->collider.tris.base.atFlags & AT_BOUNCED) { Player* player = PLAYER; Vec3f shieldNorm; Vec3f tempVel; @@ -351,7 +386,7 @@ void EnHonotrap_FlameMove(EnHonotrap* this, GlobalContext* globalCtx) { this->actor.speedXZ = this->speedMod * 0.5f; this->actor.posRot.rot.y = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); EnHonotrap_SetupFlameVanish(this); - } else if (this->collider.tris.base.atFlags & 2) { + } else if (this->collider.tris.base.atFlags & AT_HIT) { this->actor.velocity.y = this->actor.speedXZ = 0.0f; EnHonotrap_SetupFlameVanish(this); } else if (this->timer <= 0) { @@ -386,14 +421,14 @@ void EnHonotrap_FlameChase(EnHonotrap* this, GlobalContext* globalCtx) { this->actor.velocity.y *= 0.95f; func_8002D7EC(&this->actor); func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); - if (this->collider.cyl.base.atFlags & 4) { + if (this->collider.cyl.base.atFlags & AT_BOUNCED) { Player* player = PLAYER; Vec3s shieldRot; func_800D20CC(&player->shieldMf, &shieldRot, false); this->actor.posRot.rot.y = ((shieldRot.y * 2) - this->actor.posRot.rot.y) + 0x8000; EnHonotrap_SetupFlameVanish(this); - } else if (this->collider.cyl.base.atFlags & 2) { + } else if (this->collider.cyl.base.atFlags & AT_HIT) { this->actor.speedXZ *= 0.1f; this->actor.velocity.y *= 0.1f; EnHonotrap_SetupFlameVanish(this); @@ -442,11 +477,11 @@ void EnHonotrap_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actionFunc(this, globalCtx); if (this->actor.params == HONOTRAP_EYE) { - if (this->collider.tris.base.acFlags & 2) { + if (this->collider.tris.base.acFlags & AC_HIT) { EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.posRot.pos, &velocity, &accel, 15, 8); Actor_Kill(&this->actor); } else if (this->eyeState < HONOTRAP_EYE_SHUT) { - this->collider.tris.base.acFlags &= ~2; + this->collider.tris.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.tris.base); } } diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index b38efffbdf..a3f77c4029 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -11,7 +11,7 @@ typedef void (*EnHonotrapActionFunc)(struct EnHonotrap*, GlobalContext*); typedef union { struct { ColliderTris tris; - ColliderTrisItem elements[2]; + ColliderTrisElement elements[2]; }; ColliderCylinder cyl; } EnHonotrapCollider; // size = 0xD8 diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 96dfd62c74..1aa05a024a 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -25,6 +25,73 @@ const ActorInit En_Horse_InitVars = { (ActorFunc)EnHorse_Update, (ActorFunc)EnHorse_Draw, }; + +static ColliderCylinderInit D_80A65EAC = { + { + COLTYPE_NONE, + AT_TYPE_PLAYER, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000400, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80A65ED8 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderJntSphElementInit D_80A65F04[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO | BUMP_NO_DAMAGE | BUMP_NO_SWORD_SFX | BUMP_NO_HITMARK, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80A65F28 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, + 1, + D_80A65F04, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B2F0.s") diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index 04ead5aaec..a848647246 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -41,30 +41,53 @@ static AnimationHeader* D_80A691B0[] = { 0x06004AA4, 0x06005264, 0x06005B78, 0x0 static f32 splaySpeeds[] = { 0.66666666f, 0.66666666f, 1.0f, 1.0f, 1.0f, 0.66666666f }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x12, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 13, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x0A, - 0x0023, - 0x0064, - 0xFE, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; static unk_D_80A69248 D_80A69248[] = { { 0x09B8, 0x0126, 0x0E2C, 0x07 }, { 0x0C11, 0x017A, 0x1269, 0x07 }, { 0x064E, 0xFEFB, 0x1DAC, 0x07 }, @@ -159,12 +182,12 @@ void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { this->currentAnimation = 0; Animation_PlayOnce(&this->skin.skelAnime, D_80A691B0[0]); - Collider_InitCylinder(globalCtx, &this->colliderCylinder); - Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); - Collider_InitJntSph(globalCtx, &this->colliderSphere); - Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem); + Collider_InitCylinder(globalCtx, &this->colliderBody); + Collider_SetCylinder(globalCtx, &this->colliderBody, &this->actor, &sCylinderInit); + Collider_InitJntSph(globalCtx, &this->colliderHead); + Collider_SetJntSph(globalCtx, &this->colliderHead, &this->actor, &sJntSphInit, this->headElements); - func_80061ED4(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, 0, &sColChkInfoInit); func_80A68AC4(this); } @@ -172,8 +195,8 @@ void EnHorseGanon_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnHorseGanon* this = THIS; func_800A6888(globalCtx, &this->skin); - Collider_DestroyCylinder(globalCtx, &this->colliderCylinder); - Collider_DestroyJntSph(globalCtx, &this->colliderSphere); + Collider_DestroyCylinder(globalCtx, &this->colliderBody); + Collider_DestroyJntSph(globalCtx, &this->colliderHead); } void func_80A68AC4(EnHorseGanon* this) { @@ -270,8 +293,8 @@ void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += 70.0f; - Collider_CylinderUpdate(&this->actor, &this->colliderCylinder); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); + Collider_UpdateCylinder(&this->actor, &this->colliderBody); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderBody.base); } void func_80A68FA8(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { @@ -280,21 +303,21 @@ void func_80A68FA8(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { EnHorseGanon* this = THIS; s32 index; - for (index = 0; index < this->colliderSphere.count; index++) { - sp4C.x = this->colliderSphere.list[index].dim.modelSphere.center.x; - sp4C.y = this->colliderSphere.list[index].dim.modelSphere.center.y; - sp4C.z = this->colliderSphere.list[index].dim.modelSphere.center.z; + for (index = 0; index < this->colliderHead.count; index++) { + sp4C.x = this->colliderHead.elements[index].dim.modelSphere.center.x; + sp4C.y = this->colliderHead.elements[index].dim.modelSphere.center.y; + sp4C.z = this->colliderHead.elements[index].dim.modelSphere.center.z; - func_800A6408(skin, this->colliderSphere.list[index].dim.joint, &sp4C, &sp40); + func_800A6408(skin, this->colliderHead.elements[index].dim.limb, &sp4C, &sp40); - this->colliderSphere.list[index].dim.worldSphere.center.x = sp40.x; - this->colliderSphere.list[index].dim.worldSphere.center.y = sp40.y; - this->colliderSphere.list[index].dim.worldSphere.center.z = sp40.z; + this->colliderHead.elements[index].dim.worldSphere.center.x = sp40.x; + this->colliderHead.elements[index].dim.worldSphere.center.y = sp40.y; + this->colliderHead.elements[index].dim.worldSphere.center.z = sp40.z; - this->colliderSphere.list[index].dim.worldSphere.radius = - this->colliderSphere.list[index].dim.modelSphere.radius * this->colliderSphere.list[index].dim.scale; + this->colliderHead.elements[index].dim.worldSphere.radius = + this->colliderHead.elements[index].dim.modelSphere.radius * this->colliderHead.elements[index].dim.scale; } - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderHead.base); } void EnHorseGanon_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h index 6d6e7bdda7..5c8edce0e4 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h @@ -19,9 +19,9 @@ typedef struct EnHorseGanon { /* 0x01F0 */ u8 unk_1F0[0x04]; /* 0x01F4 */ f32 unk_1F4; /* 0x01F8 */ u8 unk_1F8[0x04]; - /* 0x01FC */ ColliderCylinder colliderCylinder; - /* 0x0248 */ ColliderJntSph colliderSphere; - /* 0x0268 */ ColliderJntSphItem colliderSphereItem; + /* 0x01FC */ ColliderCylinder colliderBody; + /* 0x0248 */ ColliderJntSph colliderHead; + /* 0x0268 */ ColliderJntSphElement headElements[1]; } EnHorseGanon; // size = 0x02A8 extern const ActorInit En_Horse_Ganon_InitVars; diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 357f006fec..8767bef5fe 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -33,19 +33,54 @@ const ActorInit En_Horse_Link_Child_InitVars = { }; static AnimationHeader* sAnimations[] = { 0x060043E4, 0x06004B08, 0x060053F0, 0x0600360C, 0x06002F98 }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 20, 100, 0, { 0, 0, 0 } } + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemInit[] = { - { { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 0xD, { { 0, 0, 0 }, 10 }, 100 } } + +static ColliderJntSphElementInit sJntSphElementInit[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 13, { { 0, 0, 0 }, 10 }, 100 }, + }, }; -static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphItemInit), - sJntSphItemInit }; -static CollisionCheckInfoInit sColCheckInfoInit = { 10, 35, 100, 0xFE }; + +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementInit, +}; + +static CollisionCheckInfoInit sColCheckInfoInit = { 10, 35, 100, MASS_HEAVY }; extern AnimationHeader D_06002F98; extern SkeletonHeader D_06007B20; @@ -121,10 +156,10 @@ void EnHorseLinkChild_Init(Actor* thisx, GlobalContext* globalCtx) { this->animationIdx = 0; Animation_PlayOnce(&this->skin.skelAnime, sAnimations[0]); Collider_InitCylinder(globalCtx, &this->bodyCollider); - Collider_SetCylinder_Set3(globalCtx, &this->bodyCollider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->bodyCollider, &this->actor, &sCylinderInit); Collider_InitJntSph(globalCtx, &this->headCollider); - Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderItems); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColCheckInfoInit); + Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headElements); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColCheckInfoInit); this->unk_1F0 = 0; this->unk_1EC = 0; @@ -538,7 +573,7 @@ void EnHorseLinkChild_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); func_80A6948C(this); } @@ -550,15 +585,15 @@ void func_80A6ABF8(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { s32 i; for (i = 0; i < this->headCollider.count; i++) { - center.x = this->headCollider.list[i].dim.modelSphere.center.x; - center.y = this->headCollider.list[i].dim.modelSphere.center.y; - center.z = this->headCollider.list[i].dim.modelSphere.center.z; - func_800A6408(skin, this->headCollider.list[i].dim.joint, ¢er, &newCenter); - this->headCollider.list[i].dim.worldSphere.center.x = newCenter.x; - this->headCollider.list[i].dim.worldSphere.center.y = newCenter.y; - this->headCollider.list[i].dim.worldSphere.center.z = newCenter.z; - this->headCollider.list[i].dim.worldSphere.radius = - this->headCollider.list[i].dim.modelSphere.radius * this->headCollider.list[i].dim.scale; + center.x = this->headCollider.elements[i].dim.modelSphere.center.x; + center.y = this->headCollider.elements[i].dim.modelSphere.center.y; + center.z = this->headCollider.elements[i].dim.modelSphere.center.z; + func_800A6408(skin, this->headCollider.elements[i].dim.limb, ¢er, &newCenter); + this->headCollider.elements[i].dim.worldSphere.center.x = newCenter.x; + this->headCollider.elements[i].dim.worldSphere.center.y = newCenter.y; + this->headCollider.elements[i].dim.worldSphere.center.z = newCenter.z; + this->headCollider.elements[i].dim.worldSphere.radius = + this->headCollider.elements[i].dim.modelSphere.radius * this->headCollider.elements[i].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->headCollider.base); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h index 95fd9f75f2..6e64d1408c 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h @@ -19,7 +19,7 @@ typedef struct EnHorseLinkChild { /* 0x01F0 */ s32 unk_1F0; /* 0x01F4 */ ColliderCylinder bodyCollider; /* 0x0240 */ ColliderJntSph headCollider; - /* 0x0260 */ ColliderJntSphItem headColliderItems[1]; + /* 0x0260 */ ColliderJntSphElement headElements[1]; /* 0x02A0 */ s32 unk_2A0; } EnHorseLinkChild; // size = 0x02A4 diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 2adf7bd12c..d6bf1cc480 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -68,31 +68,73 @@ static AnimationHeader* sAnimations[] = { }; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 100, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 60, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[] = { +static ColliderJntSphElementInit sJntSphElementsInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 11, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_JNTSPH }, - ARRAY_COUNT(sJntSphItemsInit), - sJntSphItemsInit, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + ARRAY_COUNT(sJntSphElementsInit), + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, 0xFE }; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; // Unused static EnHorseNormalUnkStruct1 D_80A6D428[] = { @@ -165,10 +207,10 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->bodyCollider); Collider_SetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sCylinderInit1); Collider_InitJntSph(globalCtx, &this->headCollider); - Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headColliderItems); + Collider_SetJntSph(globalCtx, &this->headCollider, &this->actor, &sJntSphInit, this->headElements); Collider_InitCylinder(globalCtx, &this->cloneCollider); Collider_SetCylinder(globalCtx, &this->cloneCollider, &this->actor, &sCylinderInit2); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (globalCtx->sceneNum == SCENE_SPOT20) { if (this->actor.posRot.rot.z == 0 || gSaveContext.nightFlag) { Actor_Kill(&this->actor); @@ -363,9 +405,9 @@ void EnHorseNormal_Wander(EnHorseNormal* this, GlobalContext* globalCtx) { this->actor.speedXZ = 8.0f; phi_t0 = 6; } - if (Rand_ZeroOne() < 0.1f || - (this->unk_21E == 0 && (this->actor.bgCheckFlags & 8 || this->bodyCollider.base.maskA & 2 || - this->headCollider.base.maskA & 2))) { + if (Rand_ZeroOne() < 0.1f || (this->unk_21E == 0 && ((this->actor.bgCheckFlags & 8) || + (this->bodyCollider.base.ocFlags1 & OC1_HIT) || + (this->headCollider.base.ocFlags1 & OC1_HIT)))) { this->unk_21E += (Rand_ZeroOne() * 30.0f) - 15.0f; if (this->unk_21E > 50) { this->unk_21E = 50; @@ -546,12 +588,12 @@ void EnHorseNormal_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.posRot2.pos.y += 70.0f; this->unk_204 = this->actor.projectedPos; this->unk_204.y += 120.0f; - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); if (this->actor.speedXZ == 0.0f) { - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; } else { - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; } } @@ -562,15 +604,15 @@ void func_80A6CAFC(Actor* thisx, GlobalContext* globalCtx, PSkinAwb* skin) { s32 i; for (i = 0; i < this->headCollider.count; i++) { - sp4C.x = this->headCollider.list[i].dim.modelSphere.center.x; - sp4C.y = this->headCollider.list[i].dim.modelSphere.center.y; - sp4C.z = this->headCollider.list[i].dim.modelSphere.center.z; - func_800A6408(skin, this->headCollider.list[i].dim.joint, &sp4C, &sp40); - this->headCollider.list[i].dim.worldSphere.center.x = sp40.x; - this->headCollider.list[i].dim.worldSphere.center.y = sp40.y; - this->headCollider.list[i].dim.worldSphere.center.z = sp40.z; - this->headCollider.list[i].dim.worldSphere.radius = - this->headCollider.list[i].dim.modelSphere.radius * this->headCollider.list[i].dim.scale; + sp4C.x = this->headCollider.elements[i].dim.modelSphere.center.x; + sp4C.y = this->headCollider.elements[i].dim.modelSphere.center.y; + sp4C.z = this->headCollider.elements[i].dim.modelSphere.center.z; + func_800A6408(skin, this->headCollider.elements[i].dim.limb, &sp4C, &sp40); + this->headCollider.elements[i].dim.worldSphere.center.x = sp40.x; + this->headCollider.elements[i].dim.worldSphere.center.y = sp40.y; + this->headCollider.elements[i].dim.worldSphere.center.z = sp40.z; + this->headCollider.elements[i].dim.worldSphere.radius = + this->headCollider.elements[i].dim.modelSphere.radius * this->headCollider.elements[i].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->headCollider.base); diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h index e34efe07ec..b1f21d07ec 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h @@ -26,7 +26,7 @@ typedef struct EnHorseNormal { /* 0x0224 */ char unk_224[0x04]; /* 0x0228 */ ColliderCylinder bodyCollider; /* 0x0274 */ ColliderJntSph headCollider; - /* 0x0294 */ ColliderJntSphItem headColliderItems[1]; + /* 0x0294 */ ColliderJntSphElement headElements[1]; /* 0x02D4 */ ColliderCylinder cloneCollider; /* 0x0320 */ char unk_320[0x04]; /* 0x0324 */ s32 waypoint; diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index 18f21b1c67..bd83b93cbd 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -35,26 +35,53 @@ static AnimationHeader* sAnimationHeaders[] = { 0x06007148 }; static f32 splaySpeeds[] = { 0.66666666f }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 100, 0, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 13, { { 0, 0, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x12, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1 | OC2_UNK1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0xA, 0x23, 0x64, 0xFE }; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 35, 100, MASS_HEAVY }; typedef struct { /* 0x0 */ Vec3s unk_0; @@ -138,10 +165,10 @@ void EnHorseZelda_Init(Actor* thisx, GlobalContext* globalCtx) { this->animationIndex = 0; Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[0]); Collider_InitCylinder(globalCtx, &this->colliderCylinder); - Collider_SetCylinder_Set3(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, &this->colliderSphereItem); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->animationIndex = 0; func_80A6DC7C(this); } @@ -213,7 +240,7 @@ void EnHorseZelda_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += 70.0f; - Collider_CylinderUpdate(&this->actor, &this->colliderCylinder); + Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); } @@ -224,18 +251,18 @@ void func_80A6DFD4(EnHorseZelda* this, GlobalContext* globalCtx, PSkinAwb* skin) s32 i; for (i = 0; i < this->colliderSphere.count; i++) { - sp4C.x = this->colliderSphere.list[i].dim.modelSphere.center.x; - sp4C.y = this->colliderSphere.list[i].dim.modelSphere.center.y; - sp4C.z = this->colliderSphere.list[i].dim.modelSphere.center.z; + sp4C.x = this->colliderSphere.elements[i].dim.modelSphere.center.x; + sp4C.y = this->colliderSphere.elements[i].dim.modelSphere.center.y; + sp4C.z = this->colliderSphere.elements[i].dim.modelSphere.center.z; - func_800A6408(skin, this->colliderSphere.list[i].dim.joint, &sp4C, &sp40); + func_800A6408(skin, this->colliderSphere.elements[i].dim.limb, &sp4C, &sp40); - this->colliderSphere.list[i].dim.worldSphere.center.x = sp40.x; - this->colliderSphere.list[i].dim.worldSphere.center.y = sp40.y; - this->colliderSphere.list[i].dim.worldSphere.center.z = sp40.z; + this->colliderSphere.elements[i].dim.worldSphere.center.x = sp40.x; + this->colliderSphere.elements[i].dim.worldSphere.center.y = sp40.y; + this->colliderSphere.elements[i].dim.worldSphere.center.z = sp40.z; - this->colliderSphere.list[i].dim.worldSphere.radius = - this->colliderSphere.list[i].dim.modelSphere.radius * this->colliderSphere.list[i].dim.scale; + this->colliderSphere.elements[i].dim.worldSphere.radius = + this->colliderSphere.elements[i].dim.modelSphere.radius * this->colliderSphere.elements[i].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); } diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h index f0e18eae33..49e45b965b 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h @@ -20,7 +20,7 @@ typedef struct EnHorseZelda { /* 0x01F8 */ char unk_1F8[0x4]; /* 0x01FC */ ColliderCylinder colliderCylinder; /* 0x0248 */ ColliderJntSph colliderSphere; - /* 0x0268 */ ColliderJntSphItem colliderSphereItem; + /* 0x0268 */ ColliderJntSphElement colliderSphereItem; } EnHorseZelda; // size = 0x02A8 extern const ActorInit En_Horse_Zelda_InitVars; diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 5b94c86cc5..195b7584ec 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -32,8 +32,22 @@ const ActorInit En_Hs_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 40, 40, 0, { 0, 0, 0 } }, }; @@ -55,7 +69,7 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelAnime, &D_060005C0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); if (LINK_IS_CHILD) { @@ -221,7 +235,7 @@ void EnHs_Update(Actor* thisx, GlobalContext* globalCtx) { EnHs* this = THIS; s32 pad; - Collider_CylinderUpdate(thisx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 24c5b6882d..b525708147 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -30,8 +30,22 @@ const ActorInit En_Hs2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 40, 40, 0, { 0, 0, 0 } }, }; @@ -47,7 +61,7 @@ void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelAnime, &D_060005C0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST); this->actionFunc = func_80A6F1A4; @@ -98,7 +112,7 @@ void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx) { EnHs2* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index c0f64e11f2..56444cbc34 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -29,6 +29,26 @@ const ActorInit En_Hy_InitVars = { (ActorFunc)EnHy_Update, (ActorFunc)EnHy_Draw, }; + +static ColliderCylinderInit D_80A71EC0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A6F5B0.s") diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 5596843d87..7dd6db38a1 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -34,14 +34,42 @@ const ActorInit En_Ice_Hono_InitVars = { }; static ColliderCylinderInit sCylinderInitCapturableFlame = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInitDroppedFlame = { - { COLTYPE_UNK10, 0x21, 0x00, 0x21, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_OTHER, + AC_NONE, + OC1_ON | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 12, 60, 0, { 0, 0, 0 } }, }; @@ -82,9 +110,9 @@ void EnIceHono_InitCapturableFlame(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitCapturableFlame); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; EnIceHono_SetupActionCapturableFlame(this); } @@ -101,7 +129,7 @@ void EnIceHono_InitDroppedFlame(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitDroppedFlame); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 4000.4f; this->collider.dim.height = this->actor.scale.y * 8000.2f; @@ -217,7 +245,7 @@ void EnIceHono_DropFlame(EnIceHono* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 4000.0f; this->collider.dim.height = this->actor.scale.y * 8000.0f; CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -250,7 +278,7 @@ void EnIceHono_SpreadFlames(EnIceHono* this, GlobalContext* globalCtx) { } if ((this->alpha > 100) && (this->timer < 40)) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 6000.0f; this->collider.dim.height = this->actor.scale.y * 8000.0f; CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 0921024ba5..1034e7967f 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -81,38 +81,117 @@ extern AnimationHeader D_060203D8; extern FlexSkeletonHeader D_060205C0; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sTrisItemsInit[] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC3FFFF, 0x00, 0x00 }, 0x00, 0x09, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC3FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFC3FFFF, 0x00, 0x00 }, 0x00, 0x09, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC3FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, - ARRAY_COUNT(sTrisItemsInit), - sTrisItemsInit, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, + 2, + sTrisElementsInit, }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x20000000, 0x00, 0x40 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x20000000, 0x00, 0x40 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -static DamageTable sDamageTable = { { - 0xD0, 0xF2, 0xE1, 0xF2, 0xD0, 0xE2, 0xF2, 0xD0, 0xF1, 0xF2, 0xF4, 0xE2, 0xE2, 0xE2, 0xE2, 0xE2, - 0xEF, 0x60, 0x60, 0x60, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0xFA, 0x00, 0xF4, 0x00, -} }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0xD), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(1, 0xE), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0xD), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0xD), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(2, 0xE), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(15, 0xE), + /* Fire magic */ DMG_ENTRY(0, 0x6), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x6), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(10, 0xF), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; void EnIk_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnIk* this = THIS; @@ -147,7 +226,7 @@ void func_80A74398(Actor* thisx, GlobalContext* globalCtx) { Collider_SetQuad(globalCtx, &this->axeCollider, thisx, &sQuadInit); thisx->colChkInfo.damageTable = &sDamageTable; - thisx->colChkInfo.mass = 0xFE; + thisx->colChkInfo.mass = MASS_HEAVY; this->unk_2FC = 0; thisx->colChkInfo.health = 30; thisx->gravity = -1.0f; @@ -235,7 +314,7 @@ void func_80A74714(EnIk* this) { void func_80A747C0(EnIk* this, GlobalContext* globalCtx) { Vec3f sp24; - if (this->bodyCollider.base.acFlags & 2) { + if (this->bodyCollider.base.acFlags & AC_HIT) { sp24 = this->actor.posRot.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); sp24.y += 30.0f; @@ -378,7 +457,7 @@ void func_80A74EBC(EnIk* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); - func_80062CD4(globalCtx, &sp2C); + CollisionCheck_SpawnShieldParticles(globalCtx, &sp2C); } if ((this->skelAnime.curFrame > 17.0f) && (this->skelAnime.curFrame < 23.0f)) { @@ -618,30 +697,30 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { if ((this->unk_2F8 == 3) || (this->unk_2F8 == 2)) { return; } - if (this->shieldCollider.base.acFlags & 0x80) { + if (this->shieldCollider.base.acFlags & AC_BOUNCED) { temp_f0 = Animation_GetLastFrame(&D_0600485C) - 2.0f; if (this->skelAnime.curFrame < temp_f0) { this->skelAnime.curFrame = temp_f0; } - this->shieldCollider.base.acFlags &= ~0x80; - this->bodyCollider.base.acFlags &= ~0x2; + this->shieldCollider.base.acFlags &= ~AC_BOUNCED; + this->bodyCollider.base.acFlags &= ~AC_HIT; return; } - if (!(this->bodyCollider.base.acFlags & 2)) { + if (!(this->bodyCollider.base.acFlags & AC_HIT)) { return; } sp38 = this->actor.posRot.pos; sp38.y += 50.0f; - func_80035650(&this->actor, &this->bodyCollider.body, 1); + func_80035650(&this->actor, &this->bodyCollider.info, 1); temp_v0_3 = this->actor.colChkInfo.damageEffect; this->unk_2FD = temp_v0_3 & 0xFF; - this->bodyCollider.base.acFlags &= ~0x2; + this->bodyCollider.base.acFlags &= ~AC_HIT; if (1) {} if ((this->unk_2FD == 0) || (this->unk_2FD == 0xD) || ((this->unk_2FB == 0) && (this->unk_2FD == 0xE))) { if (this->unk_2FD != 0) { - func_80062D60(globalCtx, &sp38); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &sp38); } return; } @@ -687,7 +766,7 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { } Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DAMAGE); - func_80062CD4(globalCtx, &sp38); + CollisionCheck_SpawnShieldParticles(globalCtx, &sp38); } void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { @@ -703,8 +782,8 @@ void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { return; } this->actionFunc(this, globalCtx); - if (this->axeCollider.base.atFlags & 2) { - this->axeCollider.base.atFlags &= ~0x2; + if (this->axeCollider.base.atFlags & AT_HIT) { + this->axeCollider.base.atFlags &= ~AT_HIT; if (&player->actor == this->axeCollider.base.at) { prevInvincibilityTimer = player->invincibilityTimer; if (player->invincibilityTimer <= 0) { @@ -724,7 +803,7 @@ void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 0x1D); this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += 45.0f; - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); if ((this->actor.colChkInfo.health > 0) && (this->actor.dmgEffectTimer == 0) && (this->unk_2F8 >= 2)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); @@ -824,8 +903,8 @@ void EnIk_PostLimbDraw3(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Matrix_MultVec3f(&D_80A7847C[1], &this->axeCollider.dim.quad[0]); Matrix_MultVec3f(&D_80A7847C[2], &this->axeCollider.dim.quad[3]); Matrix_MultVec3f(&D_80A7847C[3], &this->axeCollider.dim.quad[2]); - func_80062734(&this->axeCollider, &this->axeCollider.dim.quad[0], &this->axeCollider.dim.quad[1], - &this->axeCollider.dim.quad[2], &this->axeCollider.dim.quad[3]); + Collider_SetQuadVertices(&this->axeCollider, &this->axeCollider.dim.quad[0], &this->axeCollider.dim.quad[1], + &this->axeCollider.dim.quad[2], &this->axeCollider.dim.quad[3]); Matrix_MultVec3f(&D_80A7847C[0], &spF4); Matrix_MultVec3f(&D_80A7847C[1], &spE8); if (this->unk_2FE > 0) { @@ -840,8 +919,8 @@ void EnIk_PostLimbDraw3(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Matrix_MultVec3f(&D_80A784D0[i], &sp78[i]); } - func_800627A0(&this->shieldCollider, 0, &sp9C[0], &sp9C[1], &sp9C[2]); - func_800627A0(&this->shieldCollider, 1, &sp78[0], &sp78[1], &sp78[2]); + Collider_SetTrisVertices(&this->shieldCollider, 0, &sp9C[0], &sp9C[1], &sp9C[2]); + Collider_SetTrisVertices(&this->shieldCollider, 1, &sp78[0], &sp78[1], &sp78[2]); } } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index 082ec8d1bd..22a406ab23 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -28,7 +28,7 @@ typedef struct EnIk { /* 0x0320 */ ColliderCylinder bodyCollider; /* 0x036C */ ColliderQuad axeCollider; /* 0x03EC */ ColliderTris shieldCollider; - /* 0x040C */ ColliderTrisItem shieldColliderItems[2]; + /* 0x040C */ ColliderTrisElement shieldColliderItems[2]; /* 0x04C4 */ s32 blureIdx; /* 0x04C8 */ s32 action; /* 0x04CC */ s32 drawMode; diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index afa769c019..876ac309a0 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -38,13 +38,27 @@ const ActorInit En_In_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, + 0, 0, 0, 0, MASS_IMMOVABLE, }; static struct_D_80AA1678 sAnimationInfo[] = { @@ -320,7 +334,7 @@ s32 func_80A7975C(EnIn* this, GlobalContext* globalCtx) { return 0; } this->unk_1E6 = 1; - this->collider.base.maskA &= ~1; + this->collider.base.ocFlags1 &= ~OC1_ON; Animation_Change(&this->skelAnime, D_80A7B918[this->unk_1E6], 1.0f, 0.0f, Animation_GetLastFrame(D_80A7B918[this->unk_1E6]), 2, 0.0f); this->actionFunc = func_80A7A304; @@ -484,7 +498,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013B88, NULL, this->jointTable, this->morphTable, 20); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (func_80A7975C(this, globalCtx)) { gSaveContext.eventInf[0] &= ~0x8000; return; @@ -882,7 +896,7 @@ void EnIn_Update(Actor* thisx, GlobalContext* globalCtx) { return; } collider = &this->collider; - Collider_CylinderUpdate(&this->actor, collider); + Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); if (this->actionFunc != func_80A7A304) { SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 7738180faf..fcc7d4c091 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -45,15 +45,29 @@ const ActorInit En_Insect_InitVars = { (ActorFunc)EnInsect_Draw, }; -static ColliderJntSphItemInit sColliderItemInit[1] = { +static ColliderJntSphElementInit sColliderItemInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 5 }, 100 }, }, }; static ColliderJntSphInit sColliderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x19, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, sColliderItemInit, }; @@ -779,6 +793,6 @@ void EnInsect_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); D_80A7DEB4 = 0; } diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h index 2d43a0e5d7..6f65cbb90a 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -12,7 +12,7 @@ typedef void (*EnInsectActionFunc)(struct EnInsect*, GlobalContext*); typedef struct EnInsect { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderJntSph collider; - /* 0x016C */ ColliderJntSphItem colliderItem; + /* 0x016C */ ColliderJntSphElement colliderItem; /* 0x01AC */ SkelAnime skelAnime; /* 0x01F0 */ Vec3s jointTable[24]; /* 0x0280 */ Vec3s morphTable[24]; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 6263ee1dde..8b1abd989d 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -68,25 +68,46 @@ static EnIshiEffectSpawnFunc sDustSpawnFuncs[] = { EnIshi_SpawnDustSmall, EnIshi static ColliderCylinderInit sCylinderInits[] = { { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 18, -2, { 0, 0, 0 } }, }, { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 55, 70, 0, { 0, 0, 0 } }, } }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; void EnIshi_InitCollider(Actor* thisx, GlobalContext* globalCtx) { EnIshi* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInits[this->actor.params & 1]); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } s32 EnIshi_SnapToFloor(EnIshi* this, GlobalContext* globalCtx, f32 arg2) { @@ -302,7 +323,7 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actor.shape.unk_08 = D_80A7FA20[type]; if (!((this->actor.params >> 5) & 1) && !EnIshi_SnapToFloor(this, globalCtx, 0.0f)) { Actor_Kill(&this->actor); @@ -333,16 +354,16 @@ void EnIshi_Wait(EnIshi* this, GlobalContext* globalCtx) { if ((this->actor.params >> 4) & 1) { EnIshi_SpawnBugs(this, globalCtx); } - } else if (this->collider.base.acFlags & 2 && (type == ROCK_SMALL) && - this->collider.body.acHitItem->toucher.flags & 0x40000048) { + } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && + this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000048) { EnIshi_DropCollectible(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, sBreakSoundDurations[type], sBreakSounds[type]); sFragmentSpawnFuncs[type](this, globalCtx); sDustSpawnFuncs[type](this, globalCtx); Actor_Kill(&this->actor); } else if (this->actor.xzDistToLink < 600.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); - this->collider.base.acFlags &= ~2; + Collider_UpdateCylinder(&this->actor, &this->collider); + this->collider.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.xzDistToLink < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -443,7 +464,7 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { this->actor.shape.rot.x += sRotSpeedX; this->actor.shape.rot.y += sRotSpeedY; func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 0ecfb2d2b4..72d29daec2 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -15,14 +15,26 @@ void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnIt_Update(Actor* thisx, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_NO_PUSH, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 40, 10, 0, { 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_It_InitVars = { ACTOR_EN_IT, @@ -42,7 +54,7 @@ void EnIt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.params = 0x0D05; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, 0, &sColChkInfoInit); } void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -55,6 +67,6 @@ void EnIt_Update(Actor* thisx, GlobalContext* globalCtx) { EnIt* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index b38293040e..9957f8999f 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -33,6 +33,26 @@ const ActorInit En_Jj_InitVars = { (ActorFunc)EnJj_Update, (ActorFunc)EnJj_Draw, }; + +static ColliderCylinderInit D_80A88CB4 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 170, 150, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Jj/func_80A87800.s") diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index 8b4cdf4de0..27c3bbe1b5 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -30,8 +30,22 @@ const ActorInit En_Js_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -52,7 +66,7 @@ void EnJs_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_PlayOnce(&this->skelAnime, &D_0600045C); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); En_Js_SetupAction(this, func_80A89304); this->unk_284 = 0; @@ -158,7 +172,7 @@ void EnJs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; s32 pad2; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 59e49753e5..01b3774171 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -24,8 +24,22 @@ void func_80A8FBB8(EnKakasi* this, GlobalContext* globalCtx); void func_80A8FAA4(EnKakasi* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x04, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; @@ -64,7 +78,7 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) { this->rot = this->actor.posRot.rot; this->actor.flags |= 0x400; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80A8F660; @@ -325,7 +339,7 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 428c4980d4..f8e4512865 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -12,8 +12,22 @@ #define THIS ((EnKakasi2*)thisx) static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; @@ -76,7 +90,7 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ SAVE ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); osSyncPrintf("\n\n"); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->height = 60.0f; Actor_SetScale(&this->actor, 0.01f); this->actor.flags |= 0x400; @@ -199,7 +213,7 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (this->actor.shape.unk_08 == 0.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index 8ee621cdbd..6578155f9d 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -28,8 +28,22 @@ void func_80A918E4(EnKakasi3* this, GlobalContext* globalCtx); void func_80A91A90(EnKakasi3* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; @@ -68,7 +82,7 @@ void EnKakasi3_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060065B0, &D_06000214, NULL, NULL, 0); this->actor.flags |= 0x400; this->rot = this->actor.posRot.rot; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80A911F0; } @@ -420,7 +434,7 @@ void EnKakasi3_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 60c87825b2..b3a5c1bfbf 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -92,8 +92,22 @@ const ActorInit En_Kanban_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 20, 50, 5, { 0, 0, 0 } }, }; @@ -263,19 +277,19 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->partFlags == 0xFFFF) { EnKanban_Message(this, globalCtx); } - if ((this->invincibilityTimer == 0) && (this->collider.base.acFlags & 2)) { - this->collider.base.acFlags &= ~2; + if ((this->invincibilityTimer == 0) && (this->collider.base.acFlags & AC_HIT)) { + this->collider.base.acFlags &= ~AC_HIT; this->invincibilityTimer = 6; piece = (EnKanban*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_KANBAN, this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, ENKANBAN_PIECE); if (piece != NULL) { - ColliderBody* hitItem = this->collider.body.acHitItem; + ColliderInfo* hitItem = this->collider.info.acHitInfo; s16 yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; u8 i; - if (hitItem->toucher.flags & 0x700) { + if (hitItem->toucher.dmgFlags & 0x700) { this->cutType = sCutTypes[player->swordAnimation]; } else { this->cutType = CUT_POST; @@ -384,7 +398,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { } this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += 44.0f; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.xzDistToLink > 500.0f) { diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 0ef89bf56a..82dcd30045 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -42,18 +42,46 @@ const ActorInit En_Karebaba_InitVars = { }; static ColliderCylinderInit sBodyColliderInit = { - { 0xC, 0, 9, 0, 0x10, COLSHAPE_CYLINDER }, - { 0, { 0x00000000, 0, 0 }, { ~0x00300000, 0, 0 }, 0, 1, 0 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 7, 25, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sHeadColliderInit = { - { 0x0C, 0x11, 0, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0, { ~0x00300000, 0, 8 }, { 0x00000000, 0, 0 }, 9, 0, 1 }, + { + COLTYPE_HARD, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_NONE, + OCELEM_ON, + }, { 4, 25, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, 0xFE }; +static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_F32(unk_4C, 2500, ICHAIN_CONTINUE), @@ -77,11 +105,11 @@ void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002A40, &D_060002B8, this->jointTable, this->morphTable, 8); Collider_InitCylinder(globalCtx, &this->bodyCollider); Collider_SetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sBodyColliderInit); - Collider_CylinderUpdate(&this->actor, &this->bodyCollider); + Collider_UpdateCylinder(&this->actor, &this->bodyCollider); Collider_InitCylinder(globalCtx, &this->headCollider); Collider_SetCylinder(globalCtx, &this->headCollider, &this->actor, &sHeadColliderInit); - Collider_CylinderUpdate(&this->actor, &this->headCollider); - func_80061ED4(&this->actor.colChkInfo, DamageTable_Get(1), &sColCheckInfoInit); + Collider_UpdateCylinder(&this->actor, &this->headCollider); + CollisionCheck_SetInfo(&this->actor.colChkInfo, DamageTable_Get(1), &sColCheckInfoInit); this->boundFloor = NULL; @@ -102,9 +130,9 @@ void EnKarebaba_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnKarebaba_ResetCollider(EnKarebaba* this) { this->bodyCollider.dim.radius = 7; this->bodyCollider.dim.height = 25; - this->bodyCollider.base.type = COLTYPE_UNK12; - this->bodyCollider.base.acFlags |= 4; - this->bodyCollider.body.bumper.flags = ~0x00300000; + this->bodyCollider.base.colType = COLTYPE_HARD; + this->bodyCollider.base.acFlags |= AC_HARD; + this->bodyCollider.info.bumper.dmgFlags = ~0x00300000; this->headCollider.dim.height = 25; } @@ -132,9 +160,9 @@ void EnKarebaba_SetupAwaken(EnKarebaba* this) { void EnKarebaba_SetupUpright(EnKarebaba* this) { if (this->actionFunc != EnKarebaba_Spin) { Actor_SetScale(&this->actor, 0.01f); - this->bodyCollider.base.type = COLTYPE_UNK6; - this->bodyCollider.base.acFlags &= ~0x0004; - this->bodyCollider.body.bumper.flags = gSaveContext.linkAge != 0 ? 0x07C00710 : 0x0FC00710; + this->bodyCollider.base.colType = COLTYPE_HIT6; + this->bodyCollider.base.acFlags &= ~AC_HARD; + this->bodyCollider.info.bumper.dmgFlags = gSaveContext.linkAge != 0 ? 0x07C00710 : 0x0FC00710; this->bodyCollider.dim.radius = 15; this->bodyCollider.dim.height = 80; this->headCollider.dim.height = 80; @@ -241,7 +269,7 @@ void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKU_JR_MOUTH); } - if (this->bodyCollider.base.acFlags & 2) { + if (this->bodyCollider.base.acFlags & AC_HIT) { EnKarebaba_SetupDying(this); func_80032C7C(globalCtx, &this->actor); } else if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) > 240.0f) { @@ -284,7 +312,7 @@ void EnKarebaba_Spin(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.posRot.pos.x = (Math_SinS(this->actor.shape.rot.y) * cos60) + this->actor.initPosRot.pos.x; this->actor.posRot.pos.z = (Math_CosS(this->actor.shape.rot.y) * cos60) + this->actor.initPosRot.pos.z; - if (this->bodyCollider.base.acFlags & 2) { + if (this->bodyCollider.base.acFlags & AC_HIT) { EnKarebaba_SetupDying(this); func_80032C7C(globalCtx, &this->actor); } else if (this->actor.params == 0) { diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 90656eda03..87a0bfc9a9 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -27,6 +27,26 @@ const ActorInit En_Ko_InitVars = { (ActorFunc)EnKo_Update, (ActorFunc)EnKo_Draw, }; + +static ColliderCylinderInit D_80A9A100 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A96DB0.s") diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index f7914e56ee..1e6780a540 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -54,12 +54,26 @@ const ActorInit En_Kusa_InitVars = { static s16 sObjectIds[] = { OBJECT_GAMEPLAY_FIELD_KEEP, OBJECT_KUSA, OBJECT_KUSA }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x29, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC00758, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_2, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC00758, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 12, 44, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 30, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 30, MASS_IMMOVABLE }; static Vec3f D_80A9C23C[] = { { 0.0f, 0.7071f, 0.7071f }, @@ -212,7 +226,7 @@ void EnKusa_InitCollider(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void EnKusa_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -225,7 +239,7 @@ void EnKusa_Init(Actor* thisx, GlobalContext* globalCtx) { } EnKusa_InitCollider(thisx, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (this->actor.shape.rot.y == 0) { s16 rand = Rand_ZeroFloat(0x10000); @@ -288,8 +302,8 @@ void func_80A9B8D8(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnKusa_SetupLiftedUp(this); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_PL_PULL_UP_PLANT); - } else if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + } else if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_PLANT_BROKEN); @@ -306,12 +320,12 @@ void func_80A9B8D8(EnKusa* this, GlobalContext* globalCtx) { func_80A9BEAC(this); this->actor.flags |= 0x800; } else { - if (!(this->collider.base.maskA & 8) && (this->actor.xzDistToLink > 12.0f)) { - this->collider.base.maskA |= 8; + if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToLink > 12.0f)) { + this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; } if (this->actor.xzDistToLink < 600.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.xzDistToLink < 400.0f) { @@ -399,7 +413,7 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { func_80A9B174(&this->actor.velocity, 0.05f); func_8002D7EC(&this->actor); func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -458,7 +472,7 @@ void func_80A9C068(EnKusa* this, GlobalContext* globalCtx) { if (sp24) { Actor_SetScale(&this->actor, 0.4f); func_80A9B89C(this); - this->collider.base.maskA &= ~8; + this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index a9adcc766e..9305ae1886 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -36,14 +36,26 @@ const ActorInit En_Kz_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 80, 120, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_80034EC0_Entry sAnimations[] = { { 0x0600075C, 1.0f, 0.0f, -1.0f, 0x00, 0.0f }, @@ -308,7 +320,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0, NULL, 0.0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01); this->actor.unk_1F = 3; this->unk_1E0.unk_00 = 0; @@ -441,8 +453,8 @@ void EnKz_Update(Actor* thisx, GlobalContext* globalCtx) { if (LINK_IS_ADULT && !(gSaveContext.infTable[19] & 0x100)) { gSaveContext.infTable[19] |= 0x100; } - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelanime); EnKz_UpdateEyes(this); Actor_MoveForward(&this->actor); diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index f2b8de8b3a..257f7bb107 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -26,11 +26,23 @@ const ActorInit En_M_Fire1_InitVars = { NULL, }; -static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000001, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, - { 200, 200, 0, { 0 } } -}; +static ColliderCylinderInit sCylinderInit = { { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000001, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 200, 200, 0, { 0 } } }; void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx) { EnMFire1* this = THIS; @@ -57,7 +69,7 @@ void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx) { if (Math_StepToF(&this->unk_198, 1.0f, 0.2f)) { Actor_Kill(&this->actor); } else { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 8937b08009..d0591ec984 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -27,6 +27,26 @@ const ActorInit En_M_Thunder_InitVars = { (ActorFunc)EnMThunder_Update, (ActorFunc)EnMThunder_Draw, }; + +static ColliderCylinderInit D_80AA0420 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000001, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 200, 200, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/func_80A9EFE0.s") diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 8519840de9..c24477b694 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -40,14 +40,26 @@ const ActorInit En_Ma1_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_D_80AA1678 D_80AA1678[] = { { 0x06000820, 1.0f, 0x00, 0.0f }, @@ -252,7 +264,7 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); if (!func_80AA08C4(this, globalCtx)) { Actor_Kill(&this->actor); @@ -384,7 +396,7 @@ void EnMa1_Update(Actor* thisx, GlobalContext* globalCtx) { EnMa1* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); func_80AA0A0C(this); diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index cc73f4b212..669dd57e00 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -34,14 +34,26 @@ const ActorInit En_Ma2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_D_80AA1678 D_80AA2858[] = { { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f }, @@ -215,7 +227,7 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); switch (func_80AA1B58(this, globalCtx)) { case 1: @@ -309,7 +321,7 @@ void EnMa2_Update(Actor* thisx, GlobalContext* globalCtx) { EnMa2* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); func_80AA1CC0(this); diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 2145f0a6fb..3f97c761d7 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -38,12 +38,26 @@ const ActorInit En_Ma3_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { 0x00, 0x0000, 0x0000, 0x0000, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_D_80AA1678 D_80AA3848[] = { { 0x060007D4, 1.0f, 0x00, 0.0f }, { 0x060007D4, 1.0f, 0x00, -10.0f }, { 0x060093BC, 1.0f, 0x00, 0.0f }, @@ -244,7 +258,7 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); switch (func_80AA2EC8(this, globalCtx)) { case 0: @@ -283,7 +297,7 @@ void EnMa3_Update(Actor* thisx, GlobalContext* globalCtx) { EnMa3* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); func_80AA2F80(this); diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 20e8327b52..874c1ed4e8 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -70,42 +70,151 @@ void EnMb_SetupAction(EnMb* this, EnMbActionFunc actionFunc) { } static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; -static ColliderTrisItemInit sTrisItemsInit[2] = { +static ColliderTrisElementInit sTrisElementsInit[2] = { { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, 14.0f, 2.0f }, { -10.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, { - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x0D, 0x00 }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO, + OCELEM_NONE, + }, { { { -10.0f, -6.0f, 2.0f }, { 9.0f, -6.0f, 2.0f }, { 9.0f, 14.0f, 2.0f } } }, }, }; static ColliderTrisInit sTrisInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, - sTrisItemsInit, + sTrisElementsInit, }; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static DamageTable sDamageTable = { - 0x50, 0xF2, 0xF1, 0xF2, 0x10, 0xF2, 0xF2, 0xF2, 0xF1, 0xF2, 0xF4, 0xF2, 0x64, 0xF2, 0xF4, 0xF2, - 0xF2, 0x50, 0x63, 0x50, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x50, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x5), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(1, 0xF), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(2, 0xF), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0x6), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xF), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(0, 0x5), + /* Ice magic */ DMG_ENTRY(3, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x5), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x5), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static DamageTable sBigMoblinDamageTable = { - 0x50, 0xF2, 0x00, 0xF2, 0x00, 0xF2, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0xF2, 0x64, 0xF2, 0xF4, 0xF2, - 0xF2, 0x50, 0x63, 0x50, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x50, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x5), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(2, 0xF), + /* Ice arrow */ DMG_ENTRY(4, 0x6), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xF), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(0, 0x5), + /* Ice magic */ DMG_ENTRY(3, 0x6), + /* Light magic */ DMG_ENTRY(0, 0x5), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x5), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { @@ -122,7 +231,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 46.0f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.damageTable = &sDamageTable; Collider_InitCylinder(globalCtx, &this->collider1); Collider_SetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit); @@ -136,7 +245,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008F38, &D_060028E0, this->jointTable, this->morphTable, 28); this->actor.colChkInfo.health = 2; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->unk_360 = 1000.0f; this->unk_364 = 1750.0f; func_80AA6830(this); @@ -145,7 +254,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014190, &D_0600EBE4, this->jointTable, this->morphTable, 28); this->actor.colChkInfo.health = 6; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.damageTable = &sBigMoblinDamageTable; Actor_SetScale(&this->actor, 0.02f); this->collider1.dim.height = 170; @@ -154,7 +263,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneScale = 800.0f; this->actor.uncullZoneDownward = 1800.0f; this->unk_364 = 710.0f; - this->collider2.body.toucher.flags = 0x20000000; + this->collider2.info.toucher.dmgFlags = 0x20000000; yawDiff = (this->actor.posRot.rot.y - Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->actor.posRot.pos)); if (ABS(yawDiff) > 0x4000) { @@ -175,7 +284,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.params = 1; this->waypoint = 0; this->actor.colChkInfo.health = 1; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->unk_360 = 350.0f; this->unk_364 = 1750.0f; this->actor.flags &= ~1; @@ -679,8 +788,8 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, sp4C[this->attackParams - 1] + this->actor.posRot.rot.y, 1, 0x2EE, 0); - if (this->collider2.base.atFlags & 2) { - this->collider2.base.atFlags &= ~2; + if (this->collider2.base.atFlags & AT_HIT) { + this->collider2.base.atFlags &= ~AT_HIT; if (this->collider2.base.at == &player->actor) { u8 oldInvincibilityTimer = player->invincibilityTimer; @@ -755,7 +864,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } } } - if (this->collider2.base.atFlags & 2) { + if (this->collider2.base.atFlags & AT_HIT) { if (this->collider2.base.at == &player->actor) { if ((sp48 == 0) && !(player->stateFlags2 & 0x80)) { if (player->invincibilityTimer < 0) { @@ -766,7 +875,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); } } - if (!(this->collider2.base.atFlags & 4)) { + if (!(this->collider2.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } if (globalCtx->grabPlayer(globalCtx, player) != 0) { @@ -775,7 +884,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } sp4C = 1; } else { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; } } if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { @@ -790,7 +899,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } if (sp48 != 0) { if ((sp4C != 0) || (player->stateFlags2 & 0x80)) { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & 0x80) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; @@ -821,7 +930,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); } } - if (this->collider2.base.atFlags & 2) { + if (this->collider2.base.atFlags & AT_HIT) { if (this->collider2.base.at == &player->actor) { if ((sp50 == 0) && !(player->stateFlags2 & 0x80)) { if (player->invincibilityTimer < 0) { @@ -832,7 +941,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); } } - if (!(this->collider2.base.atFlags & 4)) { + if (!(this->collider2.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } if (globalCtx->grabPlayer(globalCtx, player) != 0) { @@ -841,7 +950,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { } sp54 = 1; } else { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; } } if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { @@ -856,7 +965,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { } if (sp50 != 0) { if ((sp54 != 0) || (player->stateFlags2 & 0x80)) { - this->collider2.base.atFlags &= ~2; + this->collider2.base.atFlags &= ~AT_HIT; if (player->stateFlags2 & 0x80) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; @@ -1193,8 +1302,8 @@ void func_80AA92B8(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_80AA9D9C, &this->collider2.dim.quad[0]); Matrix_MultVec3f(&D_80AA9DA8, &this->collider2.dim.quad[3]); Matrix_MultVec3f(&D_80AA9DB4, &this->collider2.dim.quad[2]); - func_80062734(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], - &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); + Collider_SetQuadVertices(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], + &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); } void func_80AA9440(Actor* thisx, GlobalContext* globalCtx) { @@ -1208,20 +1317,20 @@ void func_80AA9440(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_80AA9DCC, &this->collider2.dim.quad[0]); Matrix_MultVec3f(&D_80AA9DD8, &this->collider2.dim.quad[3]); Matrix_MultVec3f(&D_80AA9DE4, &this->collider2.dim.quad[2]); - func_80062734(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], - &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); + Collider_SetQuadVertices(&this->collider2, &this->collider2.dim.quad[0], &this->collider2.dim.quad[1], + &this->collider2.dim.quad[2], &this->collider2.dim.quad[3]); } void func_80AA94D8(EnMb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->collider3.base.acFlags & 2) { - this->collider3.base.acFlags &= ~0x82; - this->collider1.base.acFlags &= ~2; + if (this->collider3.base.acFlags & AC_HIT) { + this->collider3.base.acFlags &= ~(AC_HIT | AC_BOUNCED); + this->collider1.base.acFlags &= ~AC_HIT; return; } - if ((this->collider1.base.acFlags & 2) && (this->unk_320 >= 5)) { - this->collider1.base.acFlags &= ~2; + if ((this->collider1.base.acFlags & AC_HIT) && (this->unk_320 >= 5)) { + this->collider1.base.acFlags &= ~AC_HIT; if ((this->actor.colChkInfo.damageEffect != 0) && (this->actor.colChkInfo.damageEffect != 5)) { if ((player->stateFlags2 & 0x80) && &this->actor == player->actor.parent) { player->stateFlags2 &= ~0x80; @@ -1231,7 +1340,7 @@ void func_80AA94D8(EnMb* this, GlobalContext* globalCtx) { } this->unk_188 = this->actor.colChkInfo.damageEffect; this->attackParams = 0; - func_80035650(&this->actor, &this->collider1.body, 0); + func_80035650(&this->actor, &this->collider1.info, 0); if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 6)) { if (this->unk_320 != 5) { Actor_ApplyDamage(&this->actor); @@ -1267,7 +1376,7 @@ void EnMb_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(thisx); func_8002E4B4(globalCtx, thisx, 40.0f, 40.0f, 70.0f, 0x1D); Actor_SetHeight(thisx, thisx->scale.x * 4500.0f); - Collider_CylinderUpdate(thisx, &this->collider1); + Collider_UpdateCylinder(thisx, &this->collider1); if (thisx->colChkInfo.health <= 0) { this->collider1.dim.pos.x += (Math_SinS(thisx->shape.rot.y) * (-4400.0f * thisx->scale.y)); this->collider1.dim.pos.z += (Math_CosS(thisx->shape.rot.y) * (-4400.0f * thisx->scale.y)); @@ -1378,8 +1487,8 @@ void EnMb_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&D_80AA9E20[i], &phi_s2[i]); Matrix_MultVec3f(&D_80AA9E44[i], &phi_s0[i]); } - func_800627A0(&this->collider3, 0, &phi_s2[0], &phi_s2[1], &phi_s2[2]); - func_800627A0(&this->collider3, 1, &phi_s0[0], &phi_s0[1], &phi_s0[2]); + Collider_SetTrisVertices(&this->collider3, 0, &phi_s2[0], &phi_s2[1], &phi_s2[2]); + Collider_SetTrisVertices(&this->collider3, 1, &phi_s0[0], &phi_s0[1], &phi_s0[2]); } if (this->unk_328 != 0) { thisx->dmgEffectTimer++; diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/src/overlays/actors/ovl_En_Mb/z_en_mb.h index 9f3e39416f..51b724edcb 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -36,7 +36,7 @@ typedef struct EnMb { /* 0x0368 */ ColliderCylinder collider1; /* 0x03B4 */ ColliderQuad collider2; /* 0x0434 */ ColliderTris collider3; - /* 0x0454 */ ColliderTrisItem collider3Items[2]; + /* 0x0454 */ ColliderTrisElement collider3Items[2]; } EnMb; // size = 0x050C extern const ActorInit En_Mb_InitVars; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 5bce798043..0db2aa988a 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -35,14 +35,26 @@ const ActorInit En_Md_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 36, 46, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static struct_80034EC0_Entry sAnimations[] = { { 0x060002C8, 0.0f, 0.0f, -1.0f, 0x00, 0.0f }, { 0x060002C8, 0.0f, 0.0f, -1.0f, 0x00, -10.0f }, @@ -597,7 +609,7 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (!EnMd_ShouldSpawn(&this->actor, globalCtx)) { Actor_Kill(&this->actor); return; @@ -760,8 +772,8 @@ void EnMd_Update(Actor* thisx, GlobalContext* globalCtx) { EnMd* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); EnMd_UpdateEyes(this); func_80AAB5A4(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index b74d487388..cd3d2979b1 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -33,6 +33,26 @@ const ActorInit En_Mk_InitVars = { (ActorFunc)EnMk_Update, (ActorFunc)EnMk_Draw, }; + +static ColliderCylinderInit D_80AAD620 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 30, 40, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s") diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index ee9ab4c012..f0aeda893e 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -24,6 +24,26 @@ const ActorInit En_Mm_InitVars = { (ActorFunc)EnMm_Update, (ActorFunc)EnMm_Draw, }; + +static ColliderCylinderInit D_80AAEAE0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 18, 63, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AAD770.s") diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index bd5d7cc656..8e5e37e046 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -23,6 +23,26 @@ const ActorInit En_Mm2_InitVars = { (ActorFunc)EnMm2_Update, (ActorFunc)EnMm2_Draw, }; + +static ColliderCylinderInit D_80AAFAC0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 18, 63, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mm2/func_80AAEE50.s") diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 104221d3bc..28f1e62877 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -33,8 +33,14 @@ const ActorInit En_Ms_InitVars = { (ActorFunc)EnMs_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, { 22, 37, 0, { 0 } }, }; @@ -77,11 +83,11 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, this, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); Actor_SetScale(&this->actor, 0.015f); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; @@ -174,8 +180,8 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); } - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void EnMs_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 18a9418e4b..9bb18cb732 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -24,6 +24,26 @@ const ActorInit En_Mu_InitVars = { (ActorFunc)EnMu_Update, (ActorFunc)EnMu_Draw, }; + +static ColliderCylinderInit D_80AB0BD0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 100, 70, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Mu/func_80AB0420.s") diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 4c467f67bb..913bdb8feb 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -78,9 +78,22 @@ extern AnimationHeader D_06005614; // crossed legs, looking behind to the right extern Gfx D_06013158[]; extern UNK_TYPE D_0600D8E8; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; @@ -138,14 +151,14 @@ void EnNb_SetupCollider(Actor* thisx, GlobalContext* globalCtx) { EnNb* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, thisx, &sCylinderInit); } void EnNb_UpdateCollider(EnNb* this, GlobalContext* globalCtx) { s32 pad[4]; ColliderCylinder* collider = &this->collider; - Collider_CylinderUpdate(&this->actor, collider); + Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); } diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 447c0e42bf..dffcc499de 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -74,14 +74,42 @@ static u8 sLowerRiverSpawned = false; static u8 sUpperRiverSpawned = false; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK5, 0x00, 0x09, 0x01, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 15, 25, 4, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 15, 25, 4, { 0, 0, 0 } }, }; @@ -199,7 +227,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case 0xA: - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; case 0xD: case 0xE: Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit2); @@ -835,8 +863,8 @@ void func_80AB7420(EnNiw* this, GlobalContext* globalCtx) { void func_80AB747C(EnNiw* this, GlobalContext* globalCtx) { if (this->unk_2A8 == 0 && this->actor.params != 0xA && this->actionFunc != func_80AB6450 && - this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->sfxTimer1 = 30; if (this->unk_2A4 > 0 && D_80AB85E0 == 0) { this->unk_2A4--; @@ -1071,15 +1099,15 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { } } if (this->unk_2A8 == 0) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (thisx->params != 0xA && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 4) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != func_80AB6BF8 && this->actionFunc != func_80AB6D08 && this->actionFunc != func_80AB6324 && this->actionFunc != func_80AB63A8 && this->actionFunc != func_80AB6450) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 24c721a6b2..946e1396ec 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -33,8 +33,22 @@ const ActorInit En_Niw_Girl_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 10, 30, 0, { 0, 0, 0 } }, }; @@ -74,7 +88,7 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ シツレイしちゃうわね!プンプン ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ きゃははははは、まてー ☆☆☆☆☆ %d\n" VT_RST, this->path); osSyncPrintf("\n\n"); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actionFunc = EnNiwGirl_Talk; } else { osSyncPrintf("\n\n"); @@ -218,8 +232,8 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 100.0f, 100.0f, 200.0f, 0x1C); - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } s32 EnNiwGirlOverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 4b5cc5aa59..f49a84d52a 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -46,8 +46,22 @@ static s16 D_80ABB3B4[] = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 10, 0, { 0, 0, 0 } }, }; @@ -519,7 +533,7 @@ void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { } } func_8002E4B4(globalCtx, thisx, 20.0f, 20.0f, 60.0f, 0x1D); - Collider_CylinderUpdate(thisx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); if (1) {} CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 96687e3681..6bf6ad81e4 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -32,8 +32,22 @@ const ActorInit En_Nutsball_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x11, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_WOOD, + BUMP_ON, + OCELEM_ON, + }, { 13, 13, 0, { 0 } }, }; @@ -87,18 +101,18 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { this->actor.initPosRot.rot.z += 0x2AA8; - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & 2) || - (this->collider.base.acFlags & 2) || (this->collider.base.maskA & 2)) { + if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || + (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { // Checking if the player is using a shield that reflects projectiles // And if so, reflects the projectile on impact if ((player->currentShield == PLAYER_SHIELD_DEKU) || ((player->currentShield == PLAYER_SHIELD_HYLIAN) && LINK_IS_ADULT)) { - if ((this->collider.base.atFlags & 2) && (this->collider.base.atFlags & 0x10) && - (this->collider.base.atFlags & 4)) { - this->collider.base.atFlags &= ~0x16; - this->collider.base.atFlags |= 0x08; + if ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.atFlags & AT_TYPE_ENEMY) && + (this->collider.base.atFlags & AT_BOUNCED)) { + this->collider.base.atFlags &= ~AT_TYPE_ENEMY & ~AT_BOUNCED & ~AT_HIT; + this->collider.base.atFlags |= AT_TYPE_PLAYER; - this->collider.body.toucher.flags = 2; + this->collider.info.toucher.dmgFlags = 2; func_800D20CC(&player->shieldMf, &sp4C, 0); this->actor.posRot.rot.y = sp4C.y + 0x8000; this->timer = 30; @@ -130,13 +144,13 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.flags |= 0x1000000; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 8f0f1869a0..5dfde88285 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -49,13 +49,26 @@ const ActorInit En_Nwc_InitVars = { (ActorFunc)EnNwc_Draw, }; -static ColliderJntSphItemInit sJntSphElementInit = { - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, +static ColliderJntSphElementInit sJntSphElementInit = { + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 10 }, 100 }, }; -static ColliderJntSphInit_Set3 sJntSphInit = { - { COLTYPE_UNK3, 0x00, 0x09, 0x39, COLSHAPE_JNTSPH }, +static ColliderJntSphInitType1 sJntSphInit = { + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_JNTSPH, + }, 16, NULL, }; @@ -105,7 +118,7 @@ void EnNwc_ChickFall(EnNwcChick* chick, EnNwc* this, GlobalContext* globalCtx) { void EnNwc_UpdateChicks(EnNwc* this, GlobalContext* globalCtx) { static EnNwcChickFunc chickActionFuncs[] = { EnNwc_ChickNoop, EnNwc_ChickFall }; EnNwcChick* chick = this->chicks; - ColliderJntSphItem* element = this->collider.list; + ColliderJntSphElement* element = this->collider.elements; Vec3f prevChickPos; s32 i; f32 test; @@ -198,18 +211,18 @@ void EnNwc_DrawChicks(EnNwc* this, GlobalContext* globalCtx) { void EnNwc_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnNwc* this = THIS; - ColliderJntSphItemInit elementInits[16]; - ColliderJntSphItemInit* element; + ColliderJntSphElementInit elementInits[16]; + ColliderJntSphElementInit* element; EnNwcChick* chick; s32 i; - element = sJntSphInit.list = elementInits; + element = sJntSphInit.elements = elementInits; for (i = 0; i < 16; i++, element++) { *element = sJntSphElementInit; } Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph_Set3(globalCtx, &this->collider, &this->actor, &sJntSphInit); + Collider_SetJntSphAllocType1(globalCtx, &this->collider, &this->actor, &sJntSphInit); this->count = 16; chick = this->chicks; for (i = 0; i < this->count; i++, chick++) { diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 473ec73a2b..1ce1126056 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -25,6 +25,33 @@ const ActorInit En_Ny_InitVars = { (ActorFunc)EnNy_Update, (ActorFunc)EnNy_Draw, }; + +static ColliderJntSphElementInit D_80ABE330[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x04, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 15 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80ABE354 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80ABE330, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s") diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 3586a2e960..366b7e5103 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -42,22 +42,80 @@ extern AnimationHeader D_06003910; extern AnimationHeader D_06003C64; static ColliderCylinderInit sProjectileColliderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 13, 20, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sOctorockColliderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 40, -30, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 1, 0xF, 0x3C, 0x64 }; +static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 60, 100 }; static DamageTable sDamageTable = { - 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x02, 0x34, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { @@ -79,7 +137,7 @@ void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003660, &D_06003C64, this->jointTable, this->morphTable, 38); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sOctorockColliderInit); - func_80061ED4(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); if ((this->numShots == 0xFF) || (this->numShots == 0)) { this->numShots = 1; } @@ -192,7 +250,7 @@ void EnOkuta_SetupShoot(EnOkuta* this, GlobalContext* globalCtx) { void EnOkuta_SetupWaitToDie(EnOkuta* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06003910, -5.0f); func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0xB); - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; Actor_SetScale(&this->actor, 0.01f); Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_DEAD1); this->actionFunc = EnOkuta_WaitToDie; @@ -433,14 +491,16 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { this->actor.speedXZ -= 0.1f; this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 1.0f); } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & 2) || - this->collider.base.acFlags & 2 || this->collider.base.maskA & 2 || this->actor.groundY == BGCHECK_Y_MIN) { + if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || + this->collider.base.acFlags & AC_HIT || this->collider.base.ocFlags1 & OC1_HIT || + this->actor.groundY == BGCHECK_Y_MIN) { if ((player->currentShield == PLAYER_SHIELD_DEKU || (player->currentShield == PLAYER_SHIELD_HYLIAN && LINK_IS_ADULT)) && - this->collider.base.atFlags & 2 && this->collider.base.atFlags & 0x10 && this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~0x16; - this->collider.base.atFlags |= 8; - this->collider.body.toucher.flags = 2; + this->collider.base.atFlags & AT_HIT && this->collider.base.atFlags & AT_TYPE_ENEMY && + this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~(AT_HIT | AT_BOUNCED | AT_TYPE_ENEMY); + this->collider.base.atFlags |= AT_TYPE_PLAYER; + this->collider.info.toucher.dmgFlags = 2; func_800D20CC(&player->shieldMf, &sp40, 0); this->actor.posRot.rot.y = sp40.y + 0x8000; this->timer = 30; @@ -503,9 +563,9 @@ void EnOkuta_UpdateHeadScale(EnOkuta* this) { } void EnOkuta_ColliderCheck(EnOkuta* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { func_80032C7C(globalCtx, &this->actor); this->actor.colChkInfo.health = 0; @@ -569,7 +629,7 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { Math_Vec3f_Copy(&this->actor.posRot.pos, &sp38); } } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if ((this->actionFunc == EnOkuta_Appear) || (this->actionFunc == EnOkuta_Hide)) { this->collider.dim.pos.y = this->actor.posRot.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); this->collider.dim.radius = sOctorockColliderInit.dim.radius * this->actor.scale.x * 100.0f; diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index bfd901ae48..65b098cb0c 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -86,9 +86,23 @@ const ActorInit En_Owl_InitVars = { (ActorFunc)EnOwl_Draw, }; -ColliderCylinderInit sOwlCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x11, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, +static ColliderCylinderInit sOwlCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -112,7 +126,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { 16); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sOwlCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.minVelocityY = -10.0f; this->actor.unk_4C = 500.0f; EnOwl_ChangeMode(this, EnOwl_WaitDefault, func_80ACC540, &this->skelAnime2, &D_0600C8A0, 0.0f); @@ -1093,7 +1107,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { EnOwl* this = THIS; s16 phi_a1; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5); this->unk_410(this); diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 66df031ab5..5b79062497 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -27,6 +27,73 @@ const ActorInit En_Peehat_InitVars = { (ActorFunc)EnPeehat_Update, (ActorFunc)EnPeehat_Draw, }; + +static ColliderCylinderInit D_80AD2740 = { + { + COLTYPE_WOOD, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 50, 160, -70, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_80AD27A0 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderJntSphElementInit D_80AD276C[1] = { + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80AD2790 = { + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80AD276C, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Peehat/func_80ACF4A0.s") diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 7cb1f0db97..419a4ce52e 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -33,8 +33,22 @@ const ActorInit En_Po_Desert_InitVars = { }; static ColliderCylinderInit sColliderInit = { - { COLTYPE_UNK3, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT3, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 50, 20, { 0, 0, 0 } }, }; @@ -188,7 +202,7 @@ void EnPoDesert_Update(Actor* thisx, GlobalContext* globalCtx) { EnPoDesert_UpdateSpeedModifier(this); func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); Actor_SetHeight(&this->actor, 42.0f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (globalCtx->actorCtx.unk_03) { this->actor.flags |= 0x81; diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index b7c4ce1deb..917385f95f 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -46,22 +46,80 @@ const ActorInit En_Po_Field_InitVars = { }; static ColliderCylinderInit D_80AD7080 = { - { COLTYPE_UNK3, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 50, 20, { 0, 0, 0 } }, }; static ColliderCylinderInit D_80AD70AC = { - { COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x01, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x19, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x01, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 10, 30, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit D_80AD70D8 = { 0x04, 0x0019, 0x0032, 0x28 }; +static CollisionCheckInfoInit D_80AD70D8 = { 4, 25, 50, 40 }; static DamageTable sDamageTable = { - 0x00, 0x02, 0x01, 0x02, 0x11, 0x02, 0x02, 0x12, 0x01, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static s32 sNumSpawned = 0; @@ -124,7 +182,7 @@ void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80AD7080); Collider_InitCylinder(globalCtx, &this->flameCollider); Collider_SetCylinder(globalCtx, &this->flameCollider, &this->actor, &D_80AD70AC); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &D_80AD70D8); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &D_80AD70D8); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, 255, 255, 255, 0); @@ -150,8 +208,8 @@ void EnPoField_SetupWaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer = 200; Actor_SetScale(&this->actor, 0.0f); this->actor.flags &= ~0x00010001; - this->collider.base.acFlags &= ~1; - this->collider.base.maskA = 0x39; + this->collider.base.acFlags &= ~AC_ON; + this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_ALL; this->actor.colChkInfo.health = D_80AD70D8.health; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; @@ -193,7 +251,7 @@ void EnPoField_SetupCirclePlayer(EnPoField* this, GlobalContext* globalCtx) { Player* player = PLAYER; Animation_PlayLoop(&this->skelAnime, &D_06000924); - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; this->scaleModifier = this->actor.xzDistToLink; Math_Vec3f_Copy(&this->actor.initPosRot.pos, &player->actor.posRot.pos); this->actor.posRot.rot.y = this->actor.yawTowardsLink; @@ -207,7 +265,7 @@ void EnPoField_SetupCirclePlayer(EnPoField* this, GlobalContext* globalCtx) { void EnPoField_SetupFlee(EnPoField* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000608, -5.0f); - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; this->actionFunc = EnPoField_Flee; this->actor.speedXZ = 12.0f; if (this->actionFunc != EnPoField_Damage) { @@ -220,12 +278,12 @@ void EnPoField_SetupFlee(EnPoField* this) { void EnPoField_SetupDamage(EnPoField* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000454, -6.0f); - if (this->collider.body.acHitItem->toucher.flags & 0x1F824) { + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) { this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; } else { this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; } - this->collider.base.acFlags &= ~3; + this->collider.base.acFlags &= ~(AC_HIT | AC_ON); this->actor.speedXZ = 5.0f; func_8003426C(&this->actor, 0x4000, 255, 0, 16); this->actionFunc = EnPoField_Damage; @@ -246,7 +304,7 @@ void EnPoField_SetupDeath(EnPoField* this) { void EnPoField_SetupDisappear(EnPoField* this) { Animation_MorphToLoop(&this->skelAnime, &D_06001360, -6.0f); this->actionTimer = 16; - this->collider.base.acFlags &= ~3; + this->collider.base.acFlags &= ~(AC_HIT | AC_ON); this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); @@ -295,7 +353,7 @@ void func_80AD4384(EnPoField* this) { this->collider.dim.pos.x = this->actor.posRot.pos.x; this->collider.dim.pos.y = this->actor.posRot.pos.y - 20.0f; this->collider.dim.pos.z = this->actor.posRot.pos.z; - this->collider.base.maskA = 9; + this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; this->actor.textId = 0x5005; this->actionTimer = 400; this->unk_194 = 32; @@ -617,7 +675,7 @@ void func_80AD58D4(EnPoField* this, GlobalContext* globalCtx) { EnPoField_SetupSoulDisappear(this); return; } - if (this->collider.base.maskA & 2) { + if (this->collider.base.ocFlags1 & OC1_HIT) { this->actor.flags |= 0x10000; func_8002F2F4(&this->actor, globalCtx); } else { @@ -683,8 +741,8 @@ void EnPoField_SoulInteract(EnPoField* this, GlobalContext* globalCtx) { } void EnPoField_TestForDamage(EnPoField* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); @@ -712,8 +770,8 @@ void EnPoField_UpdateFlame(EnPoField* this, GlobalContext* globalCtx) { if (this->flameTimer != 0) { this->flameTimer--; } - if (this->flameCollider.base.atFlags & 2) { - this->flameCollider.base.atFlags &= ~2; + if (this->flameCollider.base.atFlags & AT_HIT) { + this->flameCollider.base.atFlags &= ~AT_HIT; this->flameTimer = 19; } if (this->flameTimer < 20) { @@ -822,9 +880,9 @@ void EnPoField_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); func_80AD619C(this); func_80AD6330(this); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->collider.base.acFlags & 1) { + if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index b65c3667f5..219c8216bc 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -47,8 +47,22 @@ const ActorInit En_Po_Relay_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 52, 0, { 0, 0, 0 } }, }; @@ -114,7 +128,7 @@ void EnPoRelay_SetupIdle(EnPoRelay* this) { this->actor.room = -1; this->actor.shape.rot.y = 0; this->actor.posRot.rot.y = -0x8000; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actionFunc = EnPoRelay_Idle; } @@ -345,7 +359,7 @@ void EnPoRelay_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); EnPoRelay_CorrectY(this); func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_SetHeight(&this->actor, 50.0f); if (this->unk_195 != 0) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 7d880a9ba9..572b2e6455 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -74,16 +74,60 @@ const ActorInit En_Po_Sisters_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x4FC7FFEA, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x4FC7FFEA, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 18, 60, 15, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0x0A, 0x0019, 0x003C, 0x28 }; +static CollisionCheckInfoInit sColChkInfoInit = { 10, 25, 60, 40 }; static DamageTable sDamageTable = { - 0xF0, 0x02, 0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0xE1, 0xE2, 0xE4, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE1, 0xE4, 0xE2, 0xE2, 0xE8, 0xE4, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0xF), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x0), + /* Kokiri sword */ DMG_ENTRY(1, 0xE), + /* Master sword */ DMG_ENTRY(2, 0xE), + /* Giant's Knife */ DMG_ENTRY(4, 0xE), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xE), + /* Giant spin */ DMG_ENTRY(4, 0xE), + /* Master spin */ DMG_ENTRY(2, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0xE), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static s32 D_80ADD784 = 0; @@ -149,7 +193,7 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.initPosRot.pos.z, 0, 0, 0, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->unk_194 = (thisx->params >> 8) & 3; this->actor.naviEnemyId = this->unk_194 + 0x50; if (1) {} @@ -164,13 +208,13 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { func_80ADA094(this, globalCtx); } else if (this->unk_194 == 0) { if (this->unk_195 == 0) { - this->collider.base.maskA = 9; + this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; func_80AD9AA8(this, globalCtx); } else { - this->actor.flags &= -0x4201; - this->collider.body.flags = 4; - this->collider.body.bumper.flags |= 1; - this->collider.base.maskA = 0; + this->actor.flags &= ~0x00004200; + this->collider.info.elemType = ELEMTYPE_UNK4; + this->collider.info.bumper.dmgFlags |= 1; + this->collider.base.ocFlags1 = OC1_NONE; func_80AD9C24(this, NULL); } } else { @@ -224,8 +268,8 @@ void func_80AD943C(EnPoSisters* this) { void func_80AD944C(EnPoSisters* this) { if (this->unk_22E.a != 0) { - this->collider.base.type = COLTYPE_METAL_SHIELD; - this->collider.base.acFlags |= 4; + this->collider.base.colType = COLTYPE_METAL; + this->collider.base.acFlags |= AC_HARD; } Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); this->actor.speedXZ = 0.0f; @@ -237,8 +281,8 @@ void func_80AD944C(EnPoSisters* this) { void func_80AD94E0(EnPoSisters* this) { this->actor.speedXZ = 5.0f; if (this->unk_194 == 0) { - this->collider.base.type = COLTYPE_METAL_SHIELD; - this->collider.base.acFlags |= 4; + this->collider.base.colType = COLTYPE_METAL; + this->collider.base.acFlags |= AC_HARD; Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); } this->unk_19A = 5; @@ -251,8 +295,8 @@ void func_80AD9568(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x8000; if (this->unk_194 != 0) { - this->collider.base.type = COLTYPE_UNK3; - this->collider.base.acFlags &= ~4; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.acFlags &= ~AC_HARD; } this->actionFunc = func_80ADA9E8; } @@ -260,7 +304,7 @@ void func_80AD9568(EnPoSisters* this) { void func_80AD95D8(EnPoSisters* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060008C0, -3.0f); if (this->collider.base.ac != NULL) { - this->actor.posRot.rot.y = (this->collider.body.acHitItem->toucher.flags & 0x1F824) + this->actor.posRot.rot.y = (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) ? this->collider.base.ac->posRot.rot.y : func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; } @@ -388,8 +432,8 @@ void func_80AD9C24(EnPoSisters* this, GlobalContext* globalCtx) { this->actor.flags &= -2; this->unk_19C = 100; this->unk_199 = 32; - this->collider.base.type = COLTYPE_UNK3; - this->collider.base.acFlags &= ~4; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.acFlags &= ~AC_HARD; if (globalCtx != NULL) { vec.x = this->actor.posRot.pos.x; vec.y = this->actor.posRot.pos.y + 45.0f; @@ -628,8 +672,8 @@ void func_80ADA8C0(EnPoSisters* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += (384.0f * this->skelAnime.endFrame) * 3.0f; if (this->unk_19A == 0 && ABS((s16)(this->actor.shape.rot.y - this->actor.posRot.rot.y)) < 0x1000) { if (this->unk_194 != 0) { - this->collider.base.type = COLTYPE_UNK3; - this->collider.base.acFlags &= ~4; + this->collider.base.colType = COLTYPE_HIT3; + this->collider.base.acFlags &= ~AC_HARD; func_80AD93C4(this); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -701,7 +745,7 @@ void func_80ADAD54(EnPoSisters* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->unk_22E.a = 0; - this->collider.body.bumper.flags = 0x60001; + this->collider.info.bumper.dmgFlags = 0x00060001; func_80AD93C4(this); } else { endFrame = this->skelAnime.endFrame; @@ -714,7 +758,7 @@ void func_80ADAE6C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 255; if (this->unk_194 != 0) { this->unk_199 |= 1; - this->collider.body.bumper.flags = 0x4FC7FFEA; + this->collider.info.bumper.dmgFlags = 0x4FC7FFEA; if (this->unk_19A != 0) { this->unk_19A--; } @@ -1086,9 +1130,9 @@ void func_80ADC034(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) { Vec3f sp24; - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if (this->unk_195 != 0) { ((EnPoSisters*)this->actor.parent)->unk_19C--; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -1099,7 +1143,7 @@ void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) { sp24.z = this->actor.posRot.pos.z; Item_DropCollectible(globalCtx, &sp24, ITEM00_ARROWS_SMALL); } - } else if (this->collider.base.type == 9 || + } else if (this->collider.base.colType == 9 || (this->actor.colChkInfo.damageEffect == 0 && this->actor.colChkInfo.damage == 0)) { if (this->unk_194 == 0) { this->actor.freezeTimer = 0; @@ -1130,8 +1174,8 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { EnPoSisters* this = THIS; s16 temp; - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; func_80AD9568(this); } func_80ADC10C(this, globalCtx); @@ -1158,7 +1202,7 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp34, &this->actor, &vec); } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if (this->actionFunc == func_80ADA8C0 || this->actionFunc == func_80ADA7F0) { this->unk_198++; this->unk_198 = CLAMP_MAX(this->unk_198, 8); diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 07b76abd96..fc15d97d8c 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -55,25 +55,87 @@ const ActorInit En_Poh_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK3, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT3, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 20, 40, 20, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit D_80AE1AA0[] = { +static ColliderJntSphElementInit D_80AE1AA0[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 18, { { 0, 1400, 0 }, 10 }, 100 }, }, }; -static ColliderJntSphInit sJntSphInit = { { COLTYPE_UNK3, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, 1, D_80AE1AA0 }; +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80AE1AA0, +}; -static CollisionCheckInfoInit sColChkInfoInit = { 0x04, 0x0019, 0x0032, 0x28 }; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 25, 50, 40 }; static DamageTable sDamageTable = { - 0x00, 0x02, 0x01, 0x02, 0x11, 0x02, 0x02, 0x12, 0x01, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(1, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(2, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static EnPohInfo sPoeInfo[2] = { @@ -145,13 +207,13 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); Collider_InitJntSph(globalCtx, &this->colliderSph); Collider_SetJntSph(globalCtx, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem); - this->colliderSph.list[0].dim.worldSphere.radius = 0; - this->colliderSph.list[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->colliderSph.list[0].dim.worldSphere.center.y = this->actor.posRot.pos.y; - this->colliderSph.list[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->colliderSph.elements[0].dim.worldSphere.radius = 0; + this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y; + this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; Collider_InitCylinder(globalCtx, &this->colliderCyl); Collider_SetCylinder(globalCtx, &this->colliderCyl, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->unk_194 = 0; this->unk_195 = 32; this->visibilityTimer = Rand_S16Offset(700, 300); @@ -248,12 +310,12 @@ void func_80ADE28C(EnPoh* this) { } else { Animation_PlayOnce(&this->skelAnime, &D_06000570); } - if (this->colliderCyl.body.acHitItem->toucher.flags & 0x0001F824) { + if (this->colliderCyl.info.acHitInfo->toucher.dmgFlags & 0x0001F824) { this->actor.posRot.rot.y = this->colliderCyl.base.ac->posRot.rot.y; } else { this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->colliderCyl.base.ac) + 0x8000; } - this->colliderCyl.base.acFlags &= ~1; + this->colliderCyl.base.acFlags &= ~AC_ON; this->actor.speedXZ = 5.0f; func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0x10); this->actionFunc = func_80ADEECC; @@ -263,7 +325,7 @@ void func_80ADE368(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, this->info->unk_18, -5.0f); this->actor.speedXZ = 5.0f; this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; - this->colliderCyl.base.acFlags |= 1; + this->colliderCyl.base.acFlags |= AC_ON; this->unk_198 = 200; this->actionFunc = func_80ADF894; } @@ -373,7 +435,7 @@ void EnPoh_Talk(EnPoh* this, GlobalContext* globalCtx) { this->colliderCyl.dim.pos.x = this->actor.posRot.pos.x; this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f; this->colliderCyl.dim.pos.z = this->actor.posRot.pos.z; - this->colliderCyl.base.maskA = 9; + this->colliderCyl.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; if (this->actor.params == EN_POH_FLAT || this->actor.params == EN_POH_SHARP) { if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { this->actor.textId = 0x5000; @@ -731,7 +793,7 @@ void func_80ADFE80(EnPoh* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; return; } - if (this->colliderCyl.base.maskA & 2) { + if (this->colliderCyl.base.ocFlags1 & OC1_HIT) { this->actor.flags |= 0x10000; func_8002F2F4(&this->actor, globalCtx); } else { @@ -817,8 +879,8 @@ void EnPoh_TalkComposer(EnPoh* this, GlobalContext* globalCtx) { } void func_80AE032C(EnPoh* this, GlobalContext* globalCtx) { - if (this->colliderCyl.base.acFlags & 2) { - this->colliderCyl.base.acFlags &= ~2; + if (this->colliderCyl.base.acFlags & AC_HIT) { + this->colliderCyl.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); @@ -873,8 +935,8 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006F90, &D_060009DC, this->jointTable, this->morphTable, 12); this->actor.draw = EnPoh_DrawComposer; - this->colliderSph.list[0].dim.joint = 9; - this->colliderSph.list->dim.modelSphere.center.y *= -1; + this->colliderSph.elements[0].dim.limb = 9; + this->colliderSph.elements[0].dim.modelSphere.center.y *= -1; this->actor.shape.rot.y = this->actor.posRot.rot.y = -0x4000; this->colliderCyl.dim.radius = 20; this->colliderCyl.dim.height = 55; @@ -943,8 +1005,8 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) { Vec3f vec; UNK_TYPE sp38; - if (this->colliderSph.base.atFlags & 2) { - this->colliderSph.base.atFlags &= ~2; + if (this->colliderSph.base.atFlags & AT_HIT) { + this->colliderSph.base.atFlags &= ~AT_HIT; func_80ADE4C8(this); } func_80AE032C(this, globalCtx); @@ -955,8 +1017,8 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x1000000; CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base); } - Collider_CylinderUpdate(&this->actor, &this->colliderCyl); - if ((this->colliderCyl.base.acFlags & 1) && this->lightColor.a == 255) { + Collider_UpdateCylinder(&this->actor, &this->colliderCyl); + if ((this->colliderCyl.base.acFlags & AC_ON) && this->lightColor.a == 255) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); @@ -998,7 +1060,7 @@ s32 EnPoh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfxP) { EnPoh* this = THIS; - func_800628A4(limbIndex, &this->colliderSph); + Collider_UpdateSpheres(limbIndex, &this->colliderSph); if (this->actionFunc == func_80ADF15C && this->unk_198 >= 2 && limbIndex == this->info->unk_7) { gSPMatrix((*gfxP)++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_poh.c", 2460), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -1015,10 +1077,10 @@ void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve this->actor.posRot.pos.y = this->unk_368.wy; this->actor.posRot.pos.z = this->unk_368.wz; } - Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.list[0].dim.worldSphere.center.x, - this->colliderSph.list[0].dim.worldSphere.center.y, - this->colliderSph.list[0].dim.worldSphere.center.z, this->envColor.r, this->envColor.g, - this->envColor.b, this->envColor.a * 0.78431374f); + Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.elements[0].dim.worldSphere.center.x, + this->colliderSph.elements[0].dim.worldSphere.center.y, + this->colliderSph.elements[0].dim.worldSphere.center.z, this->envColor.r, + this->envColor.g, this->envColor.b, this->envColor.a * 0.78431374f); } } diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index ec824eb575..cad0c23cf8 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -55,7 +55,7 @@ typedef struct EnPoh { /* 0x02AC */ LightInfo lightInfo; /* 0x02BC */ ColliderCylinder colliderCyl; /* 0x0308 */ ColliderJntSph colliderSph; - /* 0x0328 */ ColliderJntSphItem colliderSphItem; + /* 0x0328 */ ColliderJntSphElement colliderSphItem; /* 0x0368 */ MtxF unk_368; } EnPoh; // size = 0x03A8 diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 85b5735d97..982797112e 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -43,14 +43,58 @@ const ActorInit En_Rd_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x09, 0x10, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 70, 0, { 0, 0, 0 } }, }; static DamageTable sDamageTable = { - 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xE4, 0x60, 0xD3, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0x00, 0x00, 0xF4, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xF), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xF), + /* Master sword */ DMG_ENTRY(2, 0xF), + /* Giant's Knife */ DMG_ENTRY(4, 0xF), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0xE), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(3, 0xD), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xF), + /* Giant spin */ DMG_ENTRY(4, 0xF), + /* Master spin */ DMG_ENTRY(2, 0xF), + /* Kokiri jump */ DMG_ENTRY(2, 0xF), + /* Giant jump */ DMG_ENTRY(8, 0xF), + /* Master jump */ DMG_ENTRY(4, 0xF), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0xF), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { @@ -101,7 +145,7 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_310 = this->unk_30E = 0; thisx->posRot2.pos = thisx->posRot.pos; thisx->posRot2.pos.y += 50.0f; - thisx->colChkInfo.mass = 0xFE; + thisx->colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.health = 8; this->unk_314 = this->unk_31D = 0xFF; this->unk_312 = (thisx->params & 0xFF00) >> 8; @@ -713,12 +757,12 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { return; } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; this->unk_31C = this->actor.colChkInfo.damageEffect; if (this->unk_31B != 11) { - func_80035650(&this->actor, &this->collider.body, 1); + func_80035650(&this->actor, &this->collider.info, 1); if (player->unk_844 != 0) { this->unk_31D = player->unk_845; } @@ -754,10 +798,10 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { } void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; EnRd* this = THIS; - CollisionCheckContext* colChkCtx = &globalCtx->colChkCtx; Player* player = PLAYER; - ColliderCylinder* collider = &this->collider; + s32 pad2; func_80AE4114(this, globalCtx); @@ -788,10 +832,10 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.posRot2.pos.y += 50.0f; if ((this->actor.colChkInfo.health > 0) && (this->unk_31B != 8)) { - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, colChkCtx, &collider->base); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->unk_31B != 9) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_31D))) { - CollisionCheck_SetAC(globalCtx, colChkCtx, &collider->base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 4702090c16..f5a563e14a 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -32,8 +32,38 @@ void func_80AE5938(EnReeba* this, GlobalContext* globalCtx); void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx); static DamageTable sDamageTable = { - 0x00, 0xE2, 0xE1, 0xE2, 0xC1, 0xE2, 0xE2, 0xD2, 0xE1, 0xE4, 0xE6, 0xE2, 0x34, 0xE2, 0xE2, 0xE2, - 0xE2, 0x00, 0x34, 0x00, 0x00, 0x00, 0xE2, 0xE8, 0xE4, 0xE2, 0xE8, 0xE4, 0x10, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(2, 0xE), + /* Slingshot */ DMG_ENTRY(1, 0xE), + /* Explosive */ DMG_ENTRY(2, 0xE), + /* Boomerang */ DMG_ENTRY(1, 0xC), + /* Normal arrow */ DMG_ENTRY(2, 0xE), + /* Hammer swing */ DMG_ENTRY(2, 0xE), + /* Hookshot */ DMG_ENTRY(2, 0xD), + /* Kokiri sword */ DMG_ENTRY(1, 0xE), + /* Master sword */ DMG_ENTRY(4, 0xE), + /* Giant's Knife */ DMG_ENTRY(6, 0xE), + /* Fire arrow */ DMG_ENTRY(2, 0xE), + /* Ice arrow */ DMG_ENTRY(4, 0x3), + /* Light arrow */ DMG_ENTRY(2, 0xE), + /* Unk arrow 1 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xE), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xE), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(4, 0x3), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(2, 0xE), + /* Giant spin */ DMG_ENTRY(8, 0xE), + /* Master spin */ DMG_ENTRY(4, 0xE), + /* Kokiri jump */ DMG_ENTRY(2, 0xE), + /* Giant jump */ DMG_ENTRY(8, 0xE), + /* Master jump */ DMG_ENTRY(4, 0xE), + /* Unknown 1 */ DMG_ENTRY(0, 0x1), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; const ActorInit En_Reeba_InitVars = { @@ -49,8 +79,22 @@ const ActorInit En_Reeba_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK5, 0x11, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x08, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + COLTYPE_HIT5, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x08, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 40, 0, { 0, 0, 0 } }, }; @@ -67,7 +111,7 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.5f; this->actor.posRot2.pos = this->actor.posRot.pos; SkelAnime_Init(globalCtx, &this->skelanime, &D_06001EE8, &D_060001E4, this->jointTable, this->morphTable, 18); - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 4; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -80,8 +124,8 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale *= 1.5f; osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ リーバぼす登場 ☆☆☆☆☆ %f\n" VT_RST, this->scale); this->actor.colChkInfo.health = 20; - this->collider.body.toucher.effect = 4; - this->collider.body.toucher.damage = 16; + this->collider.info.toucher.effect = 4; + this->collider.info.toucher.damage = 16; Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); } @@ -471,8 +515,8 @@ void func_80AE5E48(EnReeba* this, GlobalContext* globalCtx) { } void func_80AE5EDC(EnReeba* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; if ((this->actionfunc != func_80AE5C38) && (this->actionfunc != func_80AE5854)) { this->actor.shape.rot.x = this->actor.shape.rot.z = 0; @@ -562,8 +606,8 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); - if (this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~4; + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~AT_BOUNCED; if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) { this->actor.speedXZ = 8.0f; @@ -574,8 +618,8 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) { } } - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; if ((this->collider.base.at == &player->actor) && !this->isBig && (this->actionfunc != func_80AE56E0)) { this->actionfunc = func_80AE5688; } @@ -589,7 +633,7 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actor.posRot2.pos.y += 30.0f; } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); if ((this->actor.shape.unk_08 >= -700.0f) && (this->actor.colChkInfo.health > 0) && (this->actionfunc != func_80AE56E0)) { diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index facb1b29e8..13874581e0 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -26,15 +26,16 @@ typedef enum { } EnRrReachState; typedef enum { - /* 0x1 */ RR_DAMAGE_STUN = 1, - /* 0x2 */ RR_DAMAGE_FIRE, - /* 0x3 */ RR_DAMAGE_ICE, - /* 0x4 */ RR_DAMAGE_LIGHT_MAGIC, - /* 0xB */ RR_DAMAGE_LIGHT_ARROW = 11, - /* 0xC */ RR_DAMAGE_UNK_ARROW_1, - /* 0xD */ RR_DAMAGE_UNK_ARROW_2, - /* 0xE */ RR_DAMAGE_UNK_ARROW_3, - /* 0xF */ RR_DAMAGE_NORMAL + /* 0x0 */ RR_DMG_NONE, + /* 0x1 */ RR_DMG_STUN, + /* 0x2 */ RR_DMG_FIRE, + /* 0x3 */ RR_DMG_ICE, + /* 0x4 */ RR_DMG_LIGHT_MAGIC, + /* 0xB */ RR_DMG_LIGHT_ARROW = 11, + /* 0xC */ RR_DMG_SHDW_ARROW, + /* 0xD */ RR_DMG_WIND_ARROW, + /* 0xE */ RR_DMG_SPRT_ARROW, + /* 0xF */ RR_DMG_NORMAL } EnRrDamageEffect; typedef enum { @@ -83,21 +84,77 @@ static char* sDropNames[] = { "タイプ7 ", "魔法の壷小", "矢 ", "妖精 ", "20ルピー ", "50ルピー ", }; -static ColliderCylinderInit_Set3 sCylinderInit1 = { - { COLTYPE_UNK10, 0x00, 0x09, 0x09, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit1 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 30, 55, 0, { 0, 0, 0 } }, }; -static ColliderCylinderInit_Set3 sCylinderInit2 = { - { COLTYPE_UNK10, 0x00, 0x0D, 0x0D, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit2 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 20, 20, -10, { 0, 0, 0 } }, }; static DamageTable sDamageTable = { - 0x00, 0xF2, 0xF1, 0xF2, 0x10, 0xF2, 0xF2, 0x10, 0xF1, 0xF2, 0xF4, 0x24, 0x34, 0xBF, 0xD4, 0xCF, - 0xEF, 0x24, 0x33, 0x4A, 0x00, 0x00, 0xF1, 0xF4, 0xF2, 0xF2, 0xF8, 0xF4, 0xEA, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, RR_DMG_NONE), + /* Deku stick */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Slingshot */ DMG_ENTRY(1, RR_DMG_NORMAL), + /* Explosive */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Boomerang */ DMG_ENTRY(0, RR_DMG_STUN), + /* Normal arrow */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Hammer swing */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Hookshot */ DMG_ENTRY(0, RR_DMG_STUN), + /* Kokiri sword */ DMG_ENTRY(1, RR_DMG_NORMAL), + /* Master sword */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Giant's Knife */ DMG_ENTRY(4, RR_DMG_NORMAL), + /* Fire arrow */ DMG_ENTRY(4, RR_DMG_FIRE), + /* Ice arrow */ DMG_ENTRY(4, RR_DMG_ICE), + /* Light arrow */ DMG_ENTRY(15, RR_DMG_LIGHT_ARROW), + /* Unk arrow 1 */ DMG_ENTRY(4, RR_DMG_WIND_ARROW), + /* Unk arrow 2 */ DMG_ENTRY(15, RR_DMG_SHDW_ARROW), + /* Unk arrow 3 */ DMG_ENTRY(15, RR_DMG_SPRT_ARROW), + /* Fire magic */ DMG_ENTRY(4, RR_DMG_FIRE), + /* Ice magic */ DMG_ENTRY(3, RR_DMG_ICE), + /* Light magic */ DMG_ENTRY(10, RR_DMG_LIGHT_MAGIC), + /* Shield */ DMG_ENTRY(0, RR_DMG_NONE), + /* Mirror Ray */ DMG_ENTRY(0, RR_DMG_NONE), + /* Kokiri spin */ DMG_ENTRY(1, RR_DMG_NORMAL), + /* Giant spin */ DMG_ENTRY(4, RR_DMG_NORMAL), + /* Master spin */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Kokiri jump */ DMG_ENTRY(2, RR_DMG_NORMAL), + /* Giant jump */ DMG_ENTRY(8, RR_DMG_NORMAL), + /* Master jump */ DMG_ENTRY(4, RR_DMG_NORMAL), + /* Unknown 1 */ DMG_ENTRY(10, RR_DMG_SPRT_ARROW), + /* Unblockable */ DMG_ENTRY(0, RR_DMG_NONE), + /* Hammer jump */ DMG_ENTRY(0, RR_DMG_NONE), + /* Unknown 2 */ DMG_ENTRY(0, RR_DMG_NONE), }; static InitChainEntry sInitChain[] = { @@ -115,13 +172,13 @@ void EnRr_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 4; Collider_InitCylinder(globalCtx, &this->collider1); - Collider_SetCylinder_Set3(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); + Collider_SetCylinderType1(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); Collider_InitCylinder(globalCtx, &this->collider2); - Collider_SetCylinder_Set3(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); + Collider_SetCylinderType1(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); Actor_SetHeight(&this->actor, 30.0f); this->actor.scale.y = 0.013f; this->actor.scale.x = this->actor.scale.z = 0.014f; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.velocity.y = this->actor.speedXZ = 0.0f; this->actor.gravity = -0.4f; this->actionTimer = 0; @@ -359,35 +416,35 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { Vec3f hitPos; Player* player = PLAYER; - if (this->collider2.base.acFlags & 2) { - this->collider2.base.acFlags &= ~2; + if (this->collider2.base.acFlags & AC_HIT) { + this->collider2.base.acFlags &= ~AC_HIT; // Kakin (not sure what this means) osSyncPrintf(VT_FGCOL(GREEN) "カキン(%d)!!" VT_RST "\n", this->frameCount); - hitPos.x = this->collider2.body.bumper.unk_06.x; - hitPos.y = this->collider2.body.bumper.unk_06.y; - hitPos.z = this->collider2.body.bumper.unk_06.z; - func_80062DF4(globalCtx, &hitPos); + hitPos.x = this->collider2.info.bumper.hitPos.x; + hitPos.y = this->collider2.info.bumper.hitPos.y; + hitPos.z = this->collider2.info.bumper.hitPos.z; + CollisionCheck_SpawnShieldParticlesMetal2(globalCtx, &hitPos); } else { - if (this->collider1.base.acFlags & 2) { + if (this->collider1.base.acFlags & AC_HIT) { u8 dropType = RR_DROP_RANDOM_RUPEE; - this->collider1.base.acFlags &= ~2; + this->collider1.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != 0) { - hitPos.x = this->collider1.body.bumper.unk_06.x; - hitPos.y = this->collider1.body.bumper.unk_06.y; - hitPos.z = this->collider1.body.bumper.unk_06.z; - func_8005DFAC(globalCtx, NULL, &hitPos); + hitPos.x = this->collider1.info.bumper.hitPos.x; + hitPos.y = this->collider1.info.bumper.hitPos.y; + hitPos.z = this->collider1.info.bumper.hitPos.z; + CollisionCheck_BlueBlood(globalCtx, NULL, &hitPos); } switch (this->actor.colChkInfo.damageEffect) { - case RR_DAMAGE_LIGHT_ARROW: + case RR_DMG_LIGHT_ARROW: dropType++; // purple rupee - case RR_DAMAGE_UNK_ARROW_1: + case RR_DMG_SHDW_ARROW: dropType++; // flexible - case RR_DAMAGE_UNK_ARROW_2: + case RR_DMG_WIND_ARROW: dropType++; // arrow - case RR_DAMAGE_UNK_ARROW_3: + case RR_DMG_SPRT_ARROW: dropType++; // magic jar - case RR_DAMAGE_NORMAL: + case RR_DMG_NORMAL: // ouch osSyncPrintf(VT_FGCOL(RED) "いてっ( %d : LIFE %d : DAMAGE %d : %x )!!" VT_RST "\n", this->frameCount, this->actor.colChkInfo.health, this->actor.colChkInfo.damage, @@ -405,7 +462,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { EnRr_SetupDeath(this); } return; - case RR_DAMAGE_FIRE: // Fire Arrow and Din's Fire + case RR_DMG_FIRE: // Fire Arrow and Din's Fire Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; @@ -414,7 +471,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { this->effectTimer = 20; EnRr_SetupStunned(this); return; - case RR_DAMAGE_ICE: // Ice Arrow and unused ice magic + case RR_DMG_ICE: // Ice Arrow and unused ice magic Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; @@ -425,7 +482,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { } EnRr_SetupStunned(this); return; - case RR_DAMAGE_LIGHT_MAGIC: // Unused light magic + case RR_DMG_LIGHT_MAGIC: // Unused light magic Actor_ApplyDamage(&this->actor); if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RUPEE_RED; @@ -433,7 +490,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, -0x8000, 0xFF, 0x2000, 0x50); EnRr_SetupStunned(this); return; - case RR_DAMAGE_STUN: // Boomerang and Hookshot + case RR_DMG_STUN: // Boomerang and Hookshot Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); func_8003426C(&this->actor, 0, 0xFF, 0x2000, 0x50); EnRr_SetupStunned(this); @@ -441,9 +498,10 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { } } if ((this->ocTimer == 0) && (this->actor.dmgEffectTimer == 0) && (player->invincibilityTimer == 0) && - !(player->stateFlags2 & 0x80) && ((this->collider1.base.maskA & 2) || (this->collider2.base.maskA & 2))) { - this->collider1.base.maskA &= ~2; - this->collider2.base.maskA &= ~2; + !(player->stateFlags2 & 0x80) && + ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT))) { + this->collider1.base.ocFlags1 &= ~OC1_HIT; + this->collider2.base.ocFlags1 &= ~OC1_HIT; // catch osSyncPrintf(VT_FGCOL(GREEN) "キャッチ(%d)!!" VT_RST "\n", this->frameCount); if (globalCtx->grabPlayer(globalCtx, player)) { @@ -737,7 +795,7 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f); Actor_MoveForward(&this->actor); - Collider_CylinderUpdate(&this->actor, &this->collider1); + Collider_UpdateCylinder(&this->actor, &this->collider1); this->collider2.dim.pos.x = this->mouthPos.x; this->collider2.dim.pos.y = this->mouthPos.y; this->collider2.dim.pos.z = this->mouthPos.z; @@ -749,10 +807,10 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } else { - this->collider2.base.maskA &= ~2; - this->collider2.base.acFlags &= ~2; - this->collider1.base.maskA &= ~2; - this->collider1.base.acFlags &= ~2; + this->collider2.base.ocFlags1 &= ~OC1_HIT; + this->collider2.base.acFlags &= ~AC_HIT; + this->collider1.base.ocFlags1 &= ~OC1_HIT; + this->collider1.base.acFlags &= ~AC_HIT; } func_8002E4B4(globalCtx, &this->actor, 20.0f, 30.0f, 20.0f, 7); if (!this->stopScroll) { diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 95c216ae9b..818dbb5964 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -69,14 +69,26 @@ void func_80AF03F4(EnRu1* this, GlobalContext* globalCtx); void func_80AF0400(EnRu1* this, GlobalContext* globalCtx); void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 sCylinderInit1 = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit1 = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 25, 80, 0, { 0 } }, }; -static ColliderCylinderInit_Set3 sCylinderInit2 = { - { COLTYPE_UNK0, 0x09, 0x00, 0x09, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit2 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000101, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, { 20, 30, 0, { 0 } }, }; @@ -156,43 +168,38 @@ extern AnimationHeader D_06012E94; extern AnimationHeader D_06013A64; void func_80AEAC10(EnRu1* this, GlobalContext* globalCtx) { - s32 pad[4]; - ColliderCylinder* collider = &this->collider; + s32 pad[5]; - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void func_80AEAC54(EnRu1* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; - ColliderCylinder* collider2 = &this->collider2; - s32 pad[3]; + s32 pad[5]; - Collider_CylinderUpdate(thisx, collider2); + Collider_UpdateCylinder(&this->actor, &this->collider2); if (this->unk_34C != 0) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider2); - } else if (thisx->xzDistToLink > 32.0f) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); + } else if (this->actor.xzDistToLink > 32.0f) { this->unk_34C = 1; } } void func_80AEACDC(EnRu1* this, GlobalContext* globalCtx) { - s32 pad[4]; - ColliderCylinder* collider2 = &this->collider2; + s32 pad[5]; - Collider_CylinderUpdate(&this->actor, collider2); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, collider2); + Collider_UpdateCylinder(&this->actor, &this->collider2); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } -void func_80AEAD20(EnRu1* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; +void func_80AEAD20(Actor* thisx, GlobalContext* globalCtx) { + EnRu1* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - if (!thisx) {} // necessary to match - Collider_SetCylinder_Set3(globalCtx, &this->collider, thisx, &sCylinderInit1); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit1); Collider_InitCylinder(globalCtx, &this->collider2); - Collider_SetCylinder_Set3(globalCtx, &this->collider2, thisx, &sCylinderInit2); + Collider_SetCylinderType1(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); } void func_80AEAD98(EnRu1* this, GlobalContext* globalCtx) { @@ -307,12 +314,12 @@ s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { return 0; } -DynaPolyActor* func_80AEB088(GlobalContext* globalCtx) { +BgBdanObjects* func_80AEB088(GlobalContext* globalCtx) { Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BG].first; while (actorIt != NULL) { if (actorIt->id == ACTOR_BG_BDAN_OBJECTS && actorIt->params == 0) { - return actorIt; + return (BgBdanObjects*)actorIt; } actorIt = actorIt->next; } @@ -1024,8 +1031,8 @@ void func_80AECCB0(EnRu1* this, GlobalContext* globalCtx) { spawnX = ((kREG(1) + 12.0f) * Math_SinS(yawTowardsLink)) + pos->x; spawnY = pos->y; spawnZ = ((kREG(1) + 12.0f) * Math_CosS(yawTowardsLink)) + pos->z; - this->unk_278 = Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, spawnY, spawnZ, - 0, yawTowardsLink, 0, 5); + this->unk_278 = (DoorWarp1*)Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, + spawnY, spawnZ, 0, yawTowardsLink, 0, 5); } void func_80AECDA0(EnRu1* this, GlobalContext* globalCtx) { @@ -1578,7 +1585,7 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { gSaveContext.cutsceneTrigger = 1; this->action = 36; this->drawConfig = 0; - this->unk_28C = dynaActor; + this->unk_28C = (BgBdanObjects*)dynaActor; this->actor.shape.unk_14 = 0; return 1; } diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index cb60ae2eba..bfcdacb227 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -19,7 +19,7 @@ typedef struct EnRu1 { /* 0x0190 */ Vec3s jointTable[17]; /* 0x01F6 */ Vec3s morphTable[17]; /* 0x025C */ s16 unk_25C; - /* 0x025E */ char unk_25E[0x2]; + /* 0x025E */ s16 unk_25E; /* 0x0260 */ s16 unk_260; /* 0x0262 */ char unk_262[0x2]; /* 0x0264 */ s32 action; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 04f4d14be2..5bfe126adc 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -43,8 +43,14 @@ void func_80AF321C(EnRu2* this, GlobalContext* globalCtx); void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000080, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, { 30, 100, 0, { 0 } }, }; @@ -96,17 +102,14 @@ void func_80AF2550(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) { - s32 pad; - ColliderCylinder* collider = &this->collider; - Actor* thisx = &this->actor; - s32 pad2[2]; + s32 pad[5]; - Collider_CylinderUpdate(thisx, collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } void EnRu2_Destroy(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 8e9e8934c5..4f3a3e827e 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -30,6 +30,26 @@ const ActorInit En_Sa_InitVars = { (ActorFunc)EnSa_Update, (ActorFunc)EnSa_Draw, }; + +static ColliderCylinderInit D_80AF7260 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 46, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sa/func_80AF5560.s") diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 4fc23e8698..b2037c6a48 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -38,15 +38,51 @@ const ActorInit En_Sb_InitVars = { (ActorFunc)EnSb_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, { 0x00, { 0xFFCFFFFF, 0x04, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, { 30, 40, 0, { 0, 0, 0 } }, }; static DamageTable sDamageTable[] = { - 0x00, 0x00, 0x00, 0xF2, 0x00, 0xF2, 0xF2, 0x12, 0xD1, 0xD2, 0xD4, 0x24, 0xF2, 0xF2, 0xE4, 0xF2, - 0xF2, 0x24, 0x00, 0x00, 0x00, 0x00, 0xD1, 0xD4, 0xD2, 0xD2, 0xD8, 0xD4, 0x00, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(2, 0xF), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(2, 0xF), + /* Hammer swing */ DMG_ENTRY(2, 0xF), + /* Hookshot */ DMG_ENTRY(2, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0xD), + /* Master sword */ DMG_ENTRY(2, 0xD), + /* Giant's Knife */ DMG_ENTRY(4, 0xD), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0xF), + /* Light arrow */ DMG_ENTRY(2, 0xF), + /* Unk arrow 1 */ DMG_ENTRY(4, 0xE), + /* Unk arrow 2 */ DMG_ENTRY(2, 0xF), + /* Unk arrow 3 */ DMG_ENTRY(2, 0xF), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0xD), + /* Giant spin */ DMG_ENTRY(4, 0xD), + /* Master spin */ DMG_ENTRY(2, 0xD), + /* Kokiri jump */ DMG_ENTRY(2, 0xD), + /* Giant jump */ DMG_ENTRY(8, 0xD), + /* Master jump */ DMG_ENTRY(4, 0xD), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { @@ -85,7 +121,7 @@ void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.health = 2; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->isDead = false; this->actor.colChkInfo.mass = 0; Actor_SetScale(&this->actor, 0.006f); @@ -340,23 +376,23 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { u8 hitByWindArrow; // hit box collided, switch to cool down - if ((this->collider.base.atFlags & 2)) { + if ((this->collider.base.atFlags & AT_HIT)) { EnSb_SetupCooldown(this, 1); return 1; } // hurt box collided, take damage if appropriate - if ((this->collider.base.acFlags & 2)) { + if ((this->collider.base.acFlags & AC_HIT)) { hitByWindArrow = false; tookDamage = false; - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; switch (this->actor.colChkInfo.damageEffect) { case 14: // wind arrow hitByWindArrow = true; case 15: // explosions, arrow, hammer, ice arrow, light arrow, spirit arrow, shadow arrow if (EnSb_IsVulnerable(this)) { - hitY = this->collider.body.bumper.unk_06.y - this->actor.posRot.pos.y; + hitY = this->collider.info.bumper.hitPos.y - this->actor.posRot.pos.y; yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); @@ -374,7 +410,7 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { case 1: // hookshot/longshot case 13: // all sword damage if (EnSb_IsVulnerable(this)) { - hitY = this->collider.body.bumper.unk_06.y - this->actor.posRot.pos.y; + hitY = this->collider.info.bumper.hitPos.y - this->actor.posRot.pos.y; yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); @@ -398,10 +434,10 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { // if player attack didn't do damage, play recoil sound and spawn sparks if (!tookDamage) { - hitPoint.x = this->collider.body.bumper.unk_06.x; - hitPoint.y = this->collider.body.bumper.unk_06.y; - hitPoint.z = this->collider.body.bumper.unk_06.z; - func_80062DF4(globalCtx, &hitPoint); + hitPoint.x = this->collider.info.bumper.hitPos.x; + hitPoint.y = this->collider.info.bumper.hitPos.y; + hitPoint.z = this->collider.info.bumper.hitPos.z; + CollisionCheck_SpawnShieldParticlesMetal2(globalCtx, &hitPoint); } } @@ -433,7 +469,7 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); EnSb_UpdateDamage(this, globalCtx); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index fa032a7c64..ebab784faf 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -39,9 +39,23 @@ const ActorInit En_Shopnuts_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x0014, 0x0028, 0x0000, { 0x0000, 0x0000, 0x0000 } } + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 40, 0, { 0, 0, 0 } }, }; static CollisionCheckInfoInit sColChkInfoInit = { 1, 20, 40, 0xFE }; @@ -60,8 +74,8 @@ void EnShopnuts_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_06004574, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + Collider_UpdateCylinder(&this->actor, &this->collider); if (((this->actor.params == 0x0002) && (gSaveContext.itemGetInf[0] & 0x800)) || ((this->actor.params == 0x0009) && (gSaveContext.infTable[25] & 4)) || @@ -82,7 +96,7 @@ void EnShopnuts_SetupWait(EnShopnuts* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_0600139C, 0.0f); this->animFlagAndTimer = Rand_S16Offset(100, 50); this->collider.dim.height = 5; - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnShopnuts_Wait; } @@ -116,7 +130,7 @@ void EnShopnuts_SetupBurrow(EnShopnuts* this) { void EnShopnuts_SetupSpawnSalesman(EnShopnuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000764, -3.0f); Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnShopnuts_SpawnSalesman; } @@ -130,7 +144,7 @@ void EnShopnuts_Wait(EnShopnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (Animation_OnFrame(&this->skelAnime, 9.0f)) { - this->collider.base.acFlags |= 1; + this->collider.base.acFlags |= AC_ON; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP); } @@ -147,8 +161,7 @@ void EnShopnuts_Wait(EnShopnuts* this, GlobalContext* globalCtx) { EnShopnuts_SetupStand(this); } } - if (hasSlowPlaybackSpeed && - ((this->actor.xzDistToLink > 160.0f) && (fabsf(this->actor.yDistToLink) < 120.0f)) && + if (hasSlowPlaybackSpeed && ((this->actor.xzDistToLink > 160.0f) && (fabsf(this->actor.yDistToLink) < 120.0f)) && ((this->animFlagAndTimer == 0) || (this->actor.xzDistToLink < 480.0f))) { this->skelAnime.playSpeed = 1.0f; } @@ -205,7 +218,7 @@ void EnShopnuts_Burrow(EnShopnuts* this, GlobalContext* globalCtx) { this->collider.dim.height = ((4.0f - CLAMP_MAX(this->skelAnime.curFrame, 4.0f)) * 10.0f) + 5.0f; } if (Animation_OnFrame(&this->skelAnime, 4.0f)) { - this->collider.base.acFlags &= ~1; + this->collider.base.acFlags &= ~AC_ON; } } @@ -221,9 +234,9 @@ void EnShopnuts_SpawnSalesman(EnShopnuts* this, GlobalContext* globalCtx) { } void EnShopnuts_ColliderCheck(EnShopnuts* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); EnShopnuts_SetupSpawnSalesman(this); } else if (globalCtx->actorCtx.unk_02 != 0) { EnShopnuts_SetupSpawnSalesman(this); @@ -236,7 +249,7 @@ void EnShopnuts_Update(Actor* thisx, GlobalContext* globalCtx) { EnShopnuts_ColliderCheck(this, globalCtx); this->actionFunc(this, globalCtx); func_8002E4B4(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 4); - if (this->collider.base.acFlags & 1) { + if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 32a3147c49..a2d55a86e7 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -1,7 +1,7 @@ /* * File: z_en_si.c * Overlay: En_Si - * Description: + * Description: Gold Skulltula token */ #include "z_en_si.h" @@ -21,14 +21,26 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx); void func_80AFB950(EnSi* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x3D, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000090, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000090, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 20, 18, 2, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 D_80AFBADC = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 D_80AFBADC = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Si_InitVars = { ACTOR_EN_SI, @@ -47,7 +59,7 @@ void EnSi_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &D_80AFBADC); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &D_80AFBADC); Actor_SetScale(&this->actor, 0.025f); this->unk_19C = 0; this->actionFunc = func_80AFB768; @@ -61,8 +73,8 @@ void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx) { } s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 0x2) { - this->collider.base.acFlags &= ~0x2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; } return 0; } @@ -80,17 +92,17 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) { if (!Player_InCsMode(globalCtx)) { func_80AFB748(this, globalCtx); - if (this->collider.base.maskB & 0x1) { - this->collider.base.maskB &= ~0x1; + if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { + this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; Item_Give(globalCtx, ITEM_SKULL_TOKEN); player->actor.freezeTimer = 10; func_8010B680(globalCtx, 0xB4, 0); func_800F5C64(0x39); this->actionFunc = func_80AFB950; } else { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index de77df6688..23e761f692 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -28,6 +28,44 @@ const ActorInit En_Skb_InitVars = { (ActorFunc)EnSkb_Update, (ActorFunc)EnSkb_Draw, }; + +static ColliderJntSphElementInit D_80AFE020[2] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 15, { { 0, 0, 0 }, 10 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 1, { { 0, 0, 0 }, 20 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80AFE068 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 2, + D_80AFE020, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skb/func_80AFC9A0.s") diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index f7d16990eb..c5997cab00 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -28,6 +28,25 @@ const ActorInit En_Skj_InitVars = { (ActorFunc)EnSkj_Update, (ActorFunc)EnSkj_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 8, 48, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Skj/func_80AFE2B0.s") diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index 90e8fb8b2b..7ef4782be3 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -31,8 +31,14 @@ const ActorInit En_Skjneedle_InitVars = { (ActorFunc)EnSkjneedle_Draw, }; -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK1, 0x11, 0x09, 0x00, COLSHAPE_CYLINDER }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT1, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + COLSHAPE_CYLINDER, + }, { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, { 10, 4, -2, { 0, 0, 0 } }, }; @@ -47,7 +53,7 @@ void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 20.0f); thisx->flags &= ~0x1; Actor_SetScale(&this->actor, 0.01f); @@ -60,8 +66,8 @@ void EnSkjneedle_Destroy(Actor* thisx, GlobalContext* globalCtx) { } s32 func_80B01F6C(EnSkjneedle* this) { - if (this->collider.base.atFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.acFlags &= ~AC_HIT; return 1; } return 0; @@ -80,7 +86,7 @@ void EnSkjneedle_Update(Actor* thisx, GlobalContext* globalCtx) { } else { globalCtx = preserve; // workaround Actor_SetScale(&this->actor, 0.01f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index 7725ce30f2..4f07c3f4bf 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -68,30 +68,72 @@ const ActorInit En_Ssh_InitVars = { }; static ColliderCylinderInit sCylinderInit1 = { - { COLTYPE_UNK6, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 32, 50, -24, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK6, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 20, 60, -30, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphElementInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 1, { { 0, -240, 0 }, 28 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x00, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphElementInit, + sJntSphElementsInit, }; void EnSsh_SetupAction(EnSsh* this, EnSshActionFunc actionFunc) { @@ -183,14 +225,14 @@ void EnSsh_InitColliders(EnSsh* this, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->colCylinder[i], &this->actor, cylinders[i]); } - this->colCylinder[0].body.bumper.flags = 0x0003F8E9; - this->colCylinder[1].body.bumper.flags = 0xFFC00716; - this->colCylinder[2].base.type = 9; - this->colCylinder[2].body.bumperFlags = 0xD; - this->colCylinder[2].body.flags = 2; - this->colCylinder[2].body.bumper.flags = 0xFFCC0716; + this->colCylinder[0].info.bumper.dmgFlags = 0x0003F8E9; + this->colCylinder[1].info.bumper.dmgFlags = 0xFFC00716; + this->colCylinder[2].base.colType = COLTYPE_METAL; + this->colCylinder[2].info.bumperFlags = BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO; + this->colCylinder[2].info.elemType = ELEMTYPE_UNK2; + this->colCylinder[2].info.bumper.dmgFlags = 0xFFCC0716; - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInfoInit); Collider_InitJntSph(globalCtx, &this->colSph); Collider_SetJntSph(globalCtx, &this->colSph, &this->actor, &sJntSphInit, this->colSphElements); @@ -246,9 +288,9 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 scale, f32 radiusMod) { f32 yShift; s32 i; - radius = this->colSph.list[0].dim.modelSphere.radius; + radius = this->colSph.elements[0].dim.modelSphere.radius; radius *= scale; - this->colSph.list[0].dim.modelSphere.radius = radius; + this->colSph.elements[0].dim.modelSphere.radius = radius; for (i = 0; i < 6; i++) { yShift = this->colCylinder[i].dim.yShift; @@ -412,17 +454,17 @@ void EnSsh_Sway(EnSsh* this) { } void EnSsh_CheckBodyStickHit(EnSsh* this, GlobalContext* globalCtx) { - ColliderBody* body = &this->colCylinder[0].body; + ColliderInfo* info0 = &this->colCylinder[0].info; Player* player = PLAYER; if (player->unk_860 != 0) { - body->bumper.flags |= 2; - this->colCylinder[1].body.bumper.flags &= ~2; - this->colCylinder[2].body.bumper.flags &= ~2; + info0->bumper.dmgFlags |= 2; + this->colCylinder[1].info.bumper.dmgFlags &= ~2; + this->colCylinder[2].info.bumper.dmgFlags &= ~2; } else { - body->bumper.flags &= ~2; - this->colCylinder[1].body.bumper.flags |= 2; - this->colCylinder[2].body.bumper.flags |= 2; + info0->bumper.dmgFlags &= ~2; + this->colCylinder[1].info.bumper.dmgFlags |= 2; + this->colCylinder[2].info.bumper.dmgFlags |= 2; } } @@ -434,8 +476,8 @@ s32 EnSsh_CheckHitLink(EnSsh* this, GlobalContext* globalCtx) { return false; } for (i = 0; i < 3; i++) { - if (this->colCylinder[i + 3].base.maskB & 1) { - this->colCylinder[i + 3].base.maskB &= ~1; + if (this->colCylinder[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) { + this->colCylinder[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER; hit = true; } } @@ -460,10 +502,10 @@ s32 EnSsh_CheckHitFront(EnSsh* this) { if (this->colCylinder[2].base.acFlags) {} // Needed for matching acFlags = this->colCylinder[2].base.acFlags; - if (!!(acFlags & 2) == 0) { + if (!!(acFlags & AC_HIT) == 0) { return 0; } else { - this->colCylinder[2].base.acFlags &= ~2; + this->colCylinder[2].base.acFlags &= ~AC_HIT; this->invincibilityTimer = 8; if ((this->swayTimer == 0) && (this->hitTimer == 0) && (this->stunTimer == 0)) { this->swayTimer = 60; @@ -476,13 +518,13 @@ s32 EnSsh_CheckHitBack(EnSsh* this, GlobalContext* globalCtx) { ColliderCylinder* cyl = &this->colCylinder[0]; s32 hit = false; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; } cyl = &this->colCylinder[1]; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; } if (!hit) { @@ -523,7 +565,7 @@ s32 EnSsh_CollisionCheck(EnSsh* this, GlobalContext* globalCtx) { } void EnSsh_SetBodyCylinderAC(EnSsh* this, GlobalContext* globalCtx) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[0]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[0]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[0].base); } @@ -531,10 +573,10 @@ void EnSsh_SetLegsCylinderAC(EnSsh* this, GlobalContext* globalCtx) { s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); if (angleTowardsLink < 90 * (0x10000 / 360)) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[2]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[2].base); } else { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[1]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[1]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[1].base); } } @@ -845,7 +887,7 @@ s32 EnSsh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, void EnSsh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) { EnSsh* this = THIS; - func_800628A4(limbIndex, &this->colSph); + Collider_UpdateSpheres(limbIndex, &this->colSph); } void EnSsh_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index af1f411fe1..8559d72b5f 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -16,7 +16,7 @@ typedef struct EnSsh { /* 0x02F8 */ EnSshActionFunc actionFunc; /* 0x02FC */ ColliderCylinder colCylinder[6]; /* 0x04C4 */ ColliderJntSph colSph; - /* 0x04E4 */ ColliderJntSphItem colSphElements[1]; + /* 0x04E4 */ ColliderJntSphElement colSphElements[1]; /* 0x0524 */ s16 initialYaw; /* 0x0526 */ s16 maxTurnRate; /* 0x0528 */ s16 unkTimer; diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 84a190fac8..dba76af959 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -49,30 +49,72 @@ const ActorInit En_St_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK6, 0x00, 0x09, 0x00, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 32, 50, -24, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 2, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 2, 0, 0, 0, MASS_IMMOVABLE }; static ColliderCylinderInit sCylinderInit2 = { - { COLTYPE_UNK6, 0x00, 0x00, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_HIT6, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 20, 60, -30, { 0, 0, 0 } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 1, { { 0, -240, 0 }, 28 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x00, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; extern SkeletonHeader D_06005298; @@ -247,36 +289,36 @@ void EnSt_InitColliders(EnSt* this, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->colCylinder[i], &this->actor, cylinders[i]); } - this->colCylinder[0].body.bumper.flags = 0x0003F8F9; - this->colCylinder[1].body.bumper.flags = 0xFFC00706; - this->colCylinder[2].base.type = 9; - this->colCylinder[2].body.bumperFlags = 0xD; - this->colCylinder[2].body.flags = 2; - this->colCylinder[2].body.bumper.flags = 0xFFCC0706; + this->colCylinder[0].info.bumper.dmgFlags = 0x0003F8F9; + this->colCylinder[1].info.bumper.dmgFlags = 0xFFC00706; + this->colCylinder[2].base.colType = COLTYPE_METAL; + this->colCylinder[2].info.bumperFlags = BUMP_ON | BUMP_HOOKABLE | BUMP_NO_AT_INFO; + this->colCylinder[2].info.elemType = ELEMTYPE_UNK2; + this->colCylinder[2].info.bumper.dmgFlags = 0xFFCC0706; - func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(2), &sColChkInit); Collider_InitJntSph(globalCtx, &this->colSph); Collider_SetJntSph(globalCtx, &this->colSph, &this->actor, &sJntSphInit, this->colSphItems); } void EnSt_CheckBodyStickHit(EnSt* this, GlobalContext* globalCtx) { - ColliderBody* body = &this->colCylinder[0].body; + ColliderInfo* body = &this->colCylinder[0].info; Player* player = PLAYER; if (player->unk_860 != 0) { - body->bumper.flags |= 2; - this->colCylinder[1].body.bumper.flags &= ~2; - this->colCylinder[2].body.bumper.flags &= ~2; + body->bumper.dmgFlags |= 2; + this->colCylinder[1].info.bumper.dmgFlags &= ~2; + this->colCylinder[2].info.bumper.dmgFlags &= ~2; } else { - body->bumper.flags &= ~2; - this->colCylinder[1].body.bumper.flags |= 2; - this->colCylinder[2].body.bumper.flags |= 2; + body->bumper.dmgFlags &= ~2; + this->colCylinder[1].info.bumper.dmgFlags |= 2; + this->colCylinder[2].info.bumper.dmgFlags |= 2; } } void EnSt_SetBodyCylinderAC(EnSt* this, GlobalContext* globalCtx) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[0]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[0]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[0].base); } @@ -284,10 +326,10 @@ void EnSt_SetLegsCylinderAC(EnSt* this, GlobalContext* globalCtx) { s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); if (angleTowardsLink < 0x3FFC) { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[2]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[2].base); } else { - Collider_CylinderUpdate(&this->actor, &this->colCylinder[1]); + Collider_UpdateCylinder(&this->actor, &this->colCylinder[1]); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colCylinder[1].base); } } @@ -342,10 +384,10 @@ s32 EnSt_CheckHitLink(EnSt* this, GlobalContext* globalCtx) { s32 i; for (i = 0, hit = 0; i < 3; i++) { - if (((this->colCylinder[i + 3].base.maskB & 1) != 0) == 0) { + if (((this->colCylinder[i + 3].base.ocFlags2 & OC2_HIT_PLAYER) != 0) == 0) { continue; } - this->colCylinder[i + 3].base.maskB &= ~0x1; + this->colCylinder[i + 3].base.ocFlags2 &= ~OC2_HIT_PLAYER; hit = true; } @@ -367,11 +409,11 @@ s32 EnSt_CheckHitLink(EnSt* this, GlobalContext* globalCtx) { s32 EnSt_CheckHitFrontside(EnSt* this) { u8 acFlags = this->colCylinder[2].base.acFlags; - if (!!(acFlags & 2) == 0) { + if (!!(acFlags & AC_HIT) == 0) { // not hit return false; } else { - this->colCylinder[2].base.acFlags &= ~0x2; + this->colCylinder[2].base.acFlags &= ~AC_HIT; this->invulnerableTimer = 8; this->playSwayFlag = 0; this->swayTimer = 60; @@ -384,17 +426,17 @@ s32 EnSt_CheckHitBackside(EnSt* this, GlobalContext* globalCtx) { s32 flags = 0; // ac hit flags from colliders 0 and 1 s32 hit = false; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; - flags |= cyl->body.acHitItem->toucher.flags; + flags |= cyl->info.acHitInfo->toucher.dmgFlags; } cyl = &this->colCylinder[1]; - if (cyl->base.acFlags & 2) { - cyl->base.acFlags &= ~2; + if (cyl->base.acFlags & AC_HIT) { + cyl->base.acFlags &= ~AC_HIT; hit = true; - flags |= cyl->body.acHitItem->toucher.flags; + flags |= cyl->info.acHitInfo->toucher.dmgFlags; } if (!hit) { @@ -475,9 +517,9 @@ void EnSt_SetColliderScale(EnSt* this) { scaleAmount = 1.4f; } - radius = this->colSph.list[0].dim.modelSphere.radius; + radius = this->colSph.elements[0].dim.modelSphere.radius; radius *= scaleAmount; - this->colSph.list[0].dim.modelSphere.radius = radius; + this->colSph.elements[0].dim.modelSphere.radius = radius; for (i = 0; i < 6; i++) { yShift = this->colCylinder[i].dim.yShift; @@ -1037,7 +1079,7 @@ s32 EnSt_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dListP, void EnSt_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dListP, Vec3s* rot, void* thisx) { EnSt* this = THIS; - func_800628A4(limbIndex, &this->colSph); + Collider_UpdateSpheres(limbIndex, &this->colSph); } void EnSt_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index c969c5450b..98a4bac635 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -14,7 +14,7 @@ typedef struct EnSt { /* 0x0190 */ EnStActionFunc actionFunc; /* 0x0194 */ ColliderCylinder colCylinder[6]; /* 0x035C */ ColliderJntSph colSph; - /* 0x037C */ ColliderJntSphItem colSphItems[1]; + /* 0x037C */ ColliderJntSphElement colSphItems[1]; /* 0x03BC */ s16 initalYaw; /* 0x03BE */ s16 deathYawTarget; /* 0x03C0 */ s16 groundBounces; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 1db2c5fd02..d2b21b2397 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -20,6 +20,26 @@ const ActorInit En_Sth_InitVars = { (ActorFunc)EnSth_Update, NULL, }; + +static ColliderCylinderInit D_80B0B404 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 30, 40, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07540.s") diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index b6d30505d8..8b93e11559 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -34,6 +34,33 @@ const ActorInit En_Sw_InitVars = { (ActorFunc)EnSw_Update, (ActorFunc)EnSw_Draw, }; + +static ColliderJntSphElementInit D_80B0F040[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFC3FFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 2, { { 0, -300, 0 }, 21 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B0F064 = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80B0F040, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0BDB0.s") diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 755e71db59..d2f49aaf00 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -45,14 +45,28 @@ const ActorInit En_Syateki_Niw_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK5, 0x00, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 10, 20, 4, { 0, 0, 0 } }, }; static InitChainEntry sInitChain[] = { ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), - ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_CONTINUE), + ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), }; @@ -80,7 +94,7 @@ void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Bomb chicken osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ボムにわ! ☆☆☆☆☆ \n" VT_RST); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); } @@ -536,8 +550,8 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) { } void func_80B12BA4(EnSyatekiNiw* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; switch (this->unk_29E) { case 0: if (this->unk_29C == 0) { @@ -654,7 +668,7 @@ void EnSyatekiNiw_Update(Actor* thisx, GlobalContext* globalCtx) { } if (i != 0) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 990290a587..6fab5e935f 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -45,8 +45,22 @@ const ActorInit En_Ta_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000004, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0, 0, 0 } }, }; @@ -116,7 +130,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx2, &this->collider); Collider_SetCylinder(globalCtx2, &this->collider, &this->actor, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_2E0 = 0; this->unk_2CE = 0; this->unk_2E2 = 0; @@ -1140,7 +1154,7 @@ void EnTa_Update(Actor* thisx, GlobalContext* globalCtx) { EnTa* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 04d04cb2a4..416e681db0 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -73,6 +73,66 @@ const ActorInit En_Test_InitVars = { (ActorFunc)EnTest_Update, (ActorFunc)EnTest_Draw, }; + +static ColliderCylinderInit D_80864570 = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 25, 65, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_8086459C = { + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 20, 70, -50, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_808645C8 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_SetupAction.s") diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index 1e50abb903..374fd04f03 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -30,6 +30,26 @@ const ActorInit En_Tg_InitVars = { (ActorFunc)EnTg_Update, (ActorFunc)EnTg_Draw, }; + +static ColliderCylinderInit D_80B18910 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 20, 64, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tg/func_80B18360.s") diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index f7f39e9db9..64b82d23cf 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -102,22 +102,66 @@ const ActorInit En_Tite_InitVars = { (ActorFunc)EnTite_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0xFFCFFFFF, 0x00, 0x08 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x05, 0x01 }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 0, { { 0, 1500, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH }, + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static DamageTable sDamageTable[] = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0xF4, 0x02, 0x02, 0x02, - 0x02, 0xE0, 0xF3, 0xE0, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(4, 0xF), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0xE), + /* Ice magic */ DMG_ENTRY(3, 0xF), + /* Light magic */ DMG_ENTRY(0, 0xE), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { @@ -160,7 +204,7 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->posRot2.pos = thisx->posRot.pos; thisx->posRot2.pos.y += 20.0f; thisx->colChkInfo.health = 2; - thisx->colChkInfo.mass = 0xFE; + thisx->colChkInfo.mass = MASS_HEAVY; Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, thisx, &sJntSphInit, &this->colliderItem); this->unk_2DC = 0x1D; @@ -294,7 +338,7 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { if (this->vQueuedJumps != 0) { this->vQueuedJumps--; this->vAttackState = TEKTITE_BEGIN_LUNGE; - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; } else { EnTite_SetupTurnTowardPlayer(this); } @@ -335,16 +379,16 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { func_800355B8(globalCtx, &this->backLeftFootPos); } } - if (!(this->collider.base.atFlags & 2) && (this->actor.flags & 0x40)) { + if (!(this->collider.base.atFlags & AT_HIT) && (this->actor.flags & 0x40)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } else { Player* player = PLAYER; - this->collider.base.atFlags &= ~2; + this->collider.base.atFlags &= ~AT_HIT; Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); this->actor.speedXZ = -6.0f; this->actor.posRot.rot.y = this->actor.yawTowardsLink; if (&player->actor == this->collider.base.at) { - if (!(this->collider.base.atFlags & 4)) { + if (!(this->collider.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } } @@ -622,7 +666,7 @@ void EnTite_Recoil(EnTite* this, GlobalContext* globalCtx) { if ((this->actor.speedXZ == 0.0f) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->collider.base.atFlags &= ~0x2; + this->collider.base.atFlags &= ~AT_HIT; if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000) && ((this->actor.bgCheckFlags & 1) || @@ -813,11 +857,11 @@ void EnTite_FlipUpright(EnTite* this, GlobalContext* globalCtx) { void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { EnTite* this = THIS; - if ((this->collider.base.acFlags & 2) && (this->action >= TEKTITE_IDLE)) { - this->collider.base.acFlags &= ~2; + if ((this->collider.base.acFlags & AC_HIT) && (this->action >= TEKTITE_IDLE)) { + this->collider.base.acFlags &= ~AC_HIT; if (thisx->colChkInfo.damageEffect != 0xE) { // Immune to fire magic this->damageEffect = thisx->colChkInfo.damageEffect; - func_80035650(thisx, &this->collider.list->body, 0); + func_80035650(thisx, &this->collider.elements[0].info, 0); // Stun if Tektite hit by nut, boomerang, hookshot, ice arrow or ice magic if ((thisx->colChkInfo.damageEffect == 1) || (thisx->colChkInfo.damageEffect == 0xF)) { if (this->action != TEKTITE_STUNNED) { @@ -954,7 +998,7 @@ void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_tite.c", 1704); func_80093D18(globalCtx->state.gfxCtx); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); if (this->actor.params == TEKTITE_BLUE) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&D_06001300)); gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(&D_06001700)); diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h index dabc9e823e..40f2906778 100755 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -28,7 +28,7 @@ typedef struct EnTite { /* 0x02E3 */ u8 spawnIceTimer; /* 0x02E4 */ u8 damageEffect; /* 0x02E8 */ ColliderJntSph collider; - /* 0x0308 */ ColliderJntSphItem colliderItem; + /* 0x0308 */ ColliderJntSphElement colliderItem; /* 0x0348 */ Vec3f frontLeftFootPos; /* 0x0354 */ Vec3f frontRightFootPos; /* 0x0360 */ Vec3f backRightFootPos; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 6aceed9b8f..13b49dc81a 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -158,14 +158,26 @@ s32 EnTkEff_CreateDflt(EnTk* this, Vec3f* pos, u8 duration, f32 size, f32 growth /** z_en_tk_eff.c ends here probably **/ static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 30, 52, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInfoInit = { - 0x00, 0x0000, 0x0000, 0x0000, 0xFF, -}; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; void EnTk_RestAnim(EnTk* this, GlobalContext* globalCtx) { AnimationHeader* anim = &D_06002F84; @@ -494,7 +506,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD || globalCtx->sceneNum != SCENE_SPOT02) { @@ -660,8 +672,8 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { EnTk* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index d9cff7d2d9..7603c20257 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -89,8 +89,38 @@ const ActorInit En_Torch2_InitVars = { /* static */ u8 sAlpha; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0xE2, 0x60, 0xD3, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(2, 0x0), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(2, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(2, 0xE), + /* Ice magic */ DMG_ENTRY(0, 0x6), + /* Light magic */ DMG_ENTRY(3, 0xD), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { @@ -104,14 +134,14 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { Player_SetModelGroup(this, 2); globalCtx->playerInit(this, globalCtx, &D_06004764); this->actor.naviEnemyId = 0x26; - this->cylinder.base.acFlags = 9; - this->swordQuads[0].base.atFlags = this->swordQuads[1].base.atFlags = 0x11; - this->swordQuads[0].base.acFlags = this->swordQuads[1].base.acFlags = 0xD; - this->swordQuads[0].base.type = this->swordQuads[1].base.type = 9; - this->swordQuads[0].body.toucher.damage = this->swordQuads[1].body.toucher.damage = 8; - this->swordQuads[0].body.bumperFlags = this->swordQuads[1].body.bumperFlags = 1; - this->shieldQuad.base.atFlags = 0x11; - this->shieldQuad.base.acFlags = 0xD; + this->cylinder.base.acFlags = AC_ON | AC_TYPE_PLAYER; + this->swordQuads[0].base.atFlags = this->swordQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY; + this->swordQuads[0].base.acFlags = this->swordQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; + this->swordQuads[0].base.colType = this->swordQuads[1].base.colType = COLTYPE_METAL; + this->swordQuads[0].info.toucher.damage = this->swordQuads[1].info.toucher.damage = 8; + this->swordQuads[0].info.bumperFlags = this->swordQuads[1].info.bumperFlags = BUMP_ON; + this->shieldQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY; + this->shieldQuad.base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = gSaveContext.healthCapacity >> 3; this->actor.colChkInfo.unk_10 = 60; @@ -260,12 +290,12 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles Dark Link's sword clanking on Link's sword - if ((this->swordQuads[0].base.acFlags & 0x80) || (this->swordQuads[1].base.acFlags & 0x80)) { - this->swordQuads[0].base.acFlags &= ~0x80; - this->swordQuads[1].base.acFlags &= ~0x80; - this->swordQuads[0].base.atFlags |= 4; // Loads these out of order - this->swordQuads[1].base.atFlags |= 4; - this->cylinder.base.acFlags &= ~2; + if ((this->swordQuads[0].base.acFlags & AC_BOUNCED) || (this->swordQuads[1].base.acFlags & AC_BOUNCED)) { + this->swordQuads[0].base.acFlags &= ~AC_BOUNCED; + this->swordQuads[1].base.acFlags &= ~AC_BOUNCED; + this->swordQuads[0].base.atFlags |= AT_BOUNCED; // Loads these out of order + this->swordQuads[1].base.atFlags |= AT_BOUNCED; + this->cylinder.base.atFlags &= ~AC_HIT; if (sLastSwordAnim != this->swordAnimation) { sStaggerCount++; @@ -290,8 +320,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Ignores hits when jumping on Link's sword if ((this->invincibilityTimer < 0) && (sActionState != ENTORCH2_DAMAGE) && - (this->cylinder.base.acFlags & 2)) { - this->cylinder.base.acFlags &= ~2; + (this->cylinder.base.acFlags & AC_HIT)) { + this->cylinder.base.atFlags &= ~AC_HIT; } // Handles Dark Link rolling to dodge item attacks @@ -578,9 +608,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_46A = 1; sDeathFlag = false; } - if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) && (this->cylinder.base.acFlags & 2) && - !(this->stateFlags1 & 0x04000000) && !(this->swordQuads[0].base.atFlags & 2) && - !(this->swordQuads[1].base.atFlags & 2)) { + if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) && + (this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & 0x04000000) && + !(this->swordQuads[0].base.acFlags & AT_HIT) && !(this->swordQuads[1].base.acFlags & AT_HIT)) { if (!Actor_ApplyDamage(&this->actor)) { func_800F5B58(); @@ -610,7 +640,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A0 = this->actor.colChkInfo.damage; this->unk_8A4 = 8.0f; this->unk_8A2 = this->actor.yawTowardsLink + 0x8000; - func_80035650(&this->actor, &this->cylinder.body, 1); + func_80035650(&this->actor, &this->cylinder.info, 1); this->stateFlags3 &= ~4; this->stateFlags3 |= 1; sActionState = ENTORCH2_DAMAGE; @@ -690,8 +720,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->skelAnime.curFrame = player->skelAnime.curFrame - player->skelAnime.playSpeed; this->skelAnime.playSpeed = player->skelAnime.playSpeed; LinkAnimation_Update(globalCtx, &this->skelAnime); - Collider_QuadSetAT(globalCtx, &this->swordQuads[0].base); - Collider_QuadSetAT(globalCtx, &this->swordQuads[1].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[0].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[1].base); } } if (sStaggerTimer != 0) { @@ -708,11 +738,11 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sDodgeRollState = (this->invincibilityTimer > 0) ? 2 : 0; } if (this->invincibilityTimer != 0) { - this->cylinder.base.type = 0xA; - this->cylinder.body.flags = 5; + this->cylinder.base.colType = COLTYPE_NONE; + this->cylinder.info.elemType = ELEMTYPE_UNK5; } else { - this->cylinder.base.type = 5; - this->cylinder.body.flags = 1; + this->cylinder.base.colType = COLTYPE_HIT5; + this->cylinder.info.elemType = ELEMTYPE_UNK1; } /* * Handles the jump movement onto Link's sword. Dark Link doesn't move during the diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index ce091eed50..a1c00b5f96 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -31,17 +31,61 @@ const ActorInit En_Toryo_InitVars = { (ActorFunc)EnToryo_Draw, }; -static ColliderCylinderInit sColliderCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 18, 63, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sCollisionCheckInfoInit2 = { 0x00, 0x00, 0x00, 0x00, 0xFF }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static DamageTable sDamageTable = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; typedef struct { @@ -50,6 +94,7 @@ typedef struct { u8 mode; f32 transitionRate; } EnToryoAnimation; + static EnToryoAnimation sEnToryoAnimation = { 0x06000E50, 1.0f, 0, 0 }; static Vec3f sMultVec = { 800.0f, 1000.0f, 0.0f }; @@ -85,8 +130,8 @@ void EnToryo_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 42.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, NULL, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sColliderCylinderInit); - func_80061EFC(&this->actor.colChkInfo, &sDamageTable, &sCollisionCheckInfoInit2); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Animation_Change(&this->skelAnime, sEnToryoAnimation.anim, 1.0f, 0.0f, Animation_GetLastFrame(sEnToryoAnimation.anim), sEnToryoAnimation.mode, @@ -316,7 +361,7 @@ void EnToryo_Update(Actor* thisx, GlobalContext* globalCtx) { Player* player = PLAYER; f32 rot; - Collider_CylinderUpdate(thisx, collider); + Collider_UpdateCylinder(thisx, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, (Collider*)collider); this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 54806e7dab..c55abf968c 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -31,6 +31,33 @@ const ActorInit En_Tp_InitVars = { (ActorFunc)EnTp_Update, (ActorFunc)EnTp_Draw, }; + +static ColliderJntSphElementInit D_80B22A90[1] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x03, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, + { 0, { { 0, 0, 0 }, 4 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B22AB4 = { + { + COLTYPE_HIT1, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 1, + D_80B22A90, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tp/func_80B20DE0.s") diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 1ed8aac7c6..c5f15a9238 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -29,6 +29,20 @@ const ActorInit En_Trap_InitVars = { (ActorFunc)EnTrap_Update, (ActorFunc)EnTrap_Draw, }; + +static ColliderCylinderInit D_80B25830 = { + { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_NO_PUSH | OC1_TYPE_1 | OC1_TYPE_2, OC2_TYPE_1, +COLSHAPE_CYLINDER }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00001000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 30, 20, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s") diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 840d8e70fc..d2d2489c2e 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -22,8 +22,22 @@ void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 9, 23, 0, { 0 } }, }; @@ -168,8 +182,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { return; } - if (this->collider.base.atFlags & 4) { - this->collider.base.atFlags &= ~4; + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~AT_BOUNCED; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); @@ -178,8 +192,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { return; } - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_EXPLOSION); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); @@ -188,8 +202,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { return; } - if (this->collider.base.atFlags & 2) { - this->collider.base.atFlags &= ~2; + if (this->collider.base.atFlags & AT_HIT) { + this->collider.base.atFlags &= ~AT_HIT; if (this->collider.base.at == &player->actor) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); @@ -269,7 +283,7 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 20.0f, 0x1D); Actor_SetHeight(&this->actor, 0.0f); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index e3813d2bc2..1e41a67d06 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -36,6 +36,46 @@ const ActorInit En_Vali_InitVars = { (ActorFunc)EnVali_Update, (ActorFunc)EnVali_Draw, }; + +static ColliderQuadInit D_80B288A0 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x07, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; + +static ColliderCylinderInit D_80B288F0 = { + { + COLTYPE_HIT8, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x07, 0x08 }, + { 0xFFCFFFFF, 0x01, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 17, 35, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s") diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 337dcf3b33..e968639180 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -27,6 +27,26 @@ const ActorInit En_Vb_Ball_InitVars = { (ActorFunc)EnVbBall_Update, (ActorFunc)EnVbBall_Draw, }; + +static ColliderCylinderInit D_80B2A000 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK6, + { 0x00100700, 0x00, 0x20 }, + { 0x00100700, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 20, 30, 10, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Init.s") diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index c77837c362..fe39bf63f6 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -36,20 +36,62 @@ const ActorInit En_Vm_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 25, 70, 0, { 0, 0, 0 } }, }; static ColliderQuadInit sQuadInit1 = { - { COLTYPE_METAL_SHIELD, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x10 }, { 0x00000000, 0x00, 0x00 }, 0x81, 0x00, 0x00 }, + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; static ColliderQuadInit sQuadInit2 = { - { COLTYPE_METAL_SHIELD, 0x00, 0x09, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; @@ -114,7 +156,7 @@ void EnVm_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); } - EnVm_SetupWait(thisx); + EnVm_SetupWait(this); } void EnVm_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -154,7 +196,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { if (this->actor.xzDistToLink <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 && this->actor.yDistToLink <= 80.0f && this->actor.yDistToLink >= -160.0f) { - Math_SmoothStepToS(&this->beamRot, pitch, 10, 0xFA0, 0); + Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xFA0, 0); if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, (ABS((s16)(dist * 180.0f)) / 3) + 0xFA0, 0) <= 5460) { this->timer--; @@ -187,7 +229,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { if (this->unk_260 == 2) { this->beamRot.y = this->actor.yawTowardsLink; - this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos.x); + this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos); if (this->beamRot.x > 0x1B91) { this->beamRot.x = 0x1B91; @@ -213,7 +255,7 @@ void EnVm_SetupAttack(EnVm* this) { this->beamScale.x = 0.6f; this->beamSpeed = 40.0f; this->unk_21C = 1; - this->colliderQuad1.base.atFlags &= ~2; + this->colliderQuad1.base.atFlags &= ~AT_HIT; EnVm_SetupAction(this, EnVm_Attack); } @@ -227,8 +269,8 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { pitch = 0x1B91; } - if (this->colliderQuad1.base.atFlags & 2) { - this->colliderQuad1.base.atFlags &= ~0x2; + if (this->colliderQuad1.base.atFlags & AT_HIT) { + this->colliderQuad1.base.atFlags &= ~AT_HIT; this->timer = 0; if (this->beamScale.x > 0.1f) { @@ -237,12 +279,11 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { } if (this->beamRot.x < 0xAAA || this->timer == 0) { - Math_SmoothStepToF(&this->beamScale, 0.0f, 1.0f, 0.03f, 0.0f); + Math_SmoothStepToF(&this->beamScale.x, 0.0f, 1.0f, 0.03f, 0.0f); this->unk_260 = 0; if (this->beamScale.x == 0.0f) { - this->beamScale.z = 0.0f; - this->beamScale.y = 0.0f; + this->beamScale.y = this->beamScale.z = 0.0f; EnVm_SetupWait(this); } } else { @@ -252,7 +293,7 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsLink, 10, 0xDAC, 0); Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsLink, 10, 0xDAC, 0); - Math_SmoothStepToS(&this->beamRot, pitch, 10, 0xDAC, 0); + Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xDAC, 0); playerPos = player->actor.posRot.pos; if (player->actor.groundY > BGCHECK_Y_MIN) { @@ -265,7 +306,7 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BIMOS_LAZER - SFX_FLAG); if (this->unk_260 > 2) { - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderQuad1); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderQuad1.base); } this->unk_260 = 3; @@ -305,7 +346,7 @@ void EnVm_Stun(EnVm* this, GlobalContext* globalCtx) { } } } else { - Math_SmoothStepToS(&this->beamRot, 0, 10, 0x5DC, 0); + Math_SmoothStepToS(&this->beamRot.x, 0, 10, 0x5DC, 0); this->timer--; SkelAnime_Update(&this->skelAnime); } @@ -343,7 +384,7 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx) { bomb->timer = 0; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot, 0xA0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xA0); Actor_Kill(&this->actor); } } @@ -351,14 +392,14 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx) { void EnVm_CheckHealth(EnVm* this, GlobalContext* globalCtx) { EnBom* bomb; - if (Actor_GetCollidedExplosive(globalCtx, &this->colliderCylinder) != NULL) { + if (Actor_GetCollidedExplosive(globalCtx, &this->colliderCylinder.base) != NULL) { this->actor.colChkInfo.health--; osSyncPrintf("hp down %d\n", this->actor.colChkInfo.health); } else { - if (!(this->colliderQuad2.base.acFlags & 2) || this->unk_21C == 2) { + if (!(this->colliderQuad2.base.acFlags & AC_HIT) || this->unk_21C == 2) { return; } - this->colliderQuad2.base.acFlags &= ~2; + this->colliderQuad2.base.acFlags &= ~AC_HIT; } if (this->actor.colChkInfo.health != 0) { @@ -397,14 +438,14 @@ void EnVm_Update(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BIMOS_ROLL_HEAD - SFX_FLAG); } - Collider_CylinderUpdate(&this->actor, &this->colliderCylinder); - CollisionCheck_SetOC(globalCtx, colChkCtx, &this->colliderCylinder); + Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); + CollisionCheck_SetOC(globalCtx, colChkCtx, &this->colliderCylinder.base); if (this->actor.dmgEffectTimer == 0 && this->actor.colChkInfo.health != 0) { - CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderCylinder); + CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderCylinder.base); } - CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderQuad2); + CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderQuad2.base); this->actor.posRot2.pos = this->actor.posRot.pos; this->actor.posRot2.pos.y += (6500.0f + this->actor.shape.unk_08) * this->actor.scale.y; } @@ -460,16 +501,18 @@ void EnVm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Matrix_MultVec3f(&D_80B2EB70, &this->colliderQuad1.dim.quad[2]); Matrix_MultVec3f(&sp74, &this->colliderQuad1.dim.quad[1]); Matrix_MultVec3f(&sp68, &this->colliderQuad1.dim.quad[0]); - func_80062734(&this->colliderQuad1, &this->colliderQuad1.dim.quad[0], &this->colliderQuad1.dim.quad[1], - &this->colliderQuad1.dim.quad[2], &this->colliderQuad1.dim.quad[3]); + Collider_SetQuadVertices(&this->colliderQuad1, &this->colliderQuad1.dim.quad[0], + &this->colliderQuad1.dim.quad[1], &this->colliderQuad1.dim.quad[2], + &this->colliderQuad1.dim.quad[3]); } } Matrix_MultVec3f(&D_80B2EB34, &this->colliderQuad2.dim.quad[1]); Matrix_MultVec3f(&D_80B2EB40, &this->colliderQuad2.dim.quad[0]); Matrix_MultVec3f(&D_80B2EB4C, &this->colliderQuad2.dim.quad[3]); Matrix_MultVec3f(&D_80B2EB58, &this->colliderQuad2.dim.quad[2]); - func_80062734(&this->colliderQuad2, &this->colliderQuad2.dim.quad[0], &this->colliderQuad2.dim.quad[1], - &this->colliderQuad2.dim.quad[2], &this->colliderQuad2.dim.quad[3]); + Collider_SetQuadVertices(&this->colliderQuad2, &this->colliderQuad2.dim.quad[0], + &this->colliderQuad2.dim.quad[1], &this->colliderQuad2.dim.quad[2], + &this->colliderQuad2.dim.quad[3]); } } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index f3f3324e3c..7eede7d024 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -53,27 +53,66 @@ const ActorInit En_Wallmas_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 40, 0, { 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x04, - 0x001E, - 0x0028, - 0x96, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 30, 40, 150 }; static DamageTable sDamageTable = { - 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x10, 0x01, 0x02, 0x04, 0x24, 0x02, 0x44, 0x04, 0x02, - 0x02, 0x24, 0x00, 0x44, 0x00, 0x00, 0x01, 0x04, 0x02, 0x02, 0x08, 0x04, 0x00, 0x00, 0x04, 0x00, + /* Deku nut */ DMG_ENTRY(0, 0x1), + /* Deku stick */ DMG_ENTRY(2, 0x0), + /* Slingshot */ DMG_ENTRY(1, 0x0), + /* Explosive */ DMG_ENTRY(2, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x1), + /* Normal arrow */ DMG_ENTRY(2, 0x0), + /* Hammer swing */ DMG_ENTRY(2, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x1), + /* Kokiri sword */ DMG_ENTRY(1, 0x0), + /* Master sword */ DMG_ENTRY(2, 0x0), + /* Giant's Knife */ DMG_ENTRY(4, 0x0), + /* Fire arrow */ DMG_ENTRY(4, 0x2), + /* Ice arrow */ DMG_ENTRY(2, 0x0), + /* Light arrow */ DMG_ENTRY(4, 0x4), + /* Unk arrow 1 */ DMG_ENTRY(4, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(2, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(2, 0x0), + /* Fire magic */ DMG_ENTRY(4, 0x2), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(4, 0x4), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(1, 0x0), + /* Giant spin */ DMG_ENTRY(4, 0x0), + /* Master spin */ DMG_ENTRY(2, 0x0), + /* Kokiri jump */ DMG_ENTRY(2, 0x0), + /* Giant jump */ DMG_ENTRY(8, 0x0), + /* Master jump */ DMG_ENTRY(4, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(4, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x30, 1), ICHAIN_F32(unk_4C, 0x157C, 1), - ICHAIN_F32_DIV1000(gravity, 0xFA24, 0), + ICHAIN_F32_DIV1000(gravity, -1500, 0), }; extern AnimationHeader D_06000EA4; @@ -97,7 +136,7 @@ void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - func_80061ED4(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); this->switchFlag = (u8)(thisx->params >> 0x8); thisx->params = thisx->params & 0xFF; @@ -193,7 +232,7 @@ void EnWallmas_SetupReturnToCeiling(EnWallmas* this) { void EnWallmas_SetupTakeDamage(EnWallmas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); - if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) { + if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x0001F824) { this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; } else { this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; @@ -474,9 +513,9 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) { } void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & 2) != 0) { - this->collider.base.acFlags &= ~2; - func_80035650(&this->actor, &this->collider.body, 1); + if ((this->collider.base.acFlags & AC_HIT) != 0) { + this->collider.base.acFlags &= ~AC_HIT; + func_80035650(&this->actor, &this->collider.info, 1); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { func_80032C7C(globalCtx, &this->actor); @@ -529,12 +568,12 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actionFunc != EnWallmas_Die) && (this->actionFunc != EnWallmas_Drop)) { - Collider_CylinderUpdate(&this->actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->actionFunc != EnWallmas_TakeDamage) && (this->actor.bgCheckFlags & 1) != 0 && (this->actor.freezeTimer == 0)) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 7327138672..4c1fe4786a 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -32,6 +32,26 @@ const ActorInit En_Weiyer_InitVars = { (ActorFunc)EnWeiyer_Update, (ActorFunc)EnWeiyer_Draw, }; + +static ColliderCylinderInit D_80B33A90 = { + { + COLTYPE_HIT0, + AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, + { 16, 10, -6, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s") diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index a0a677f838..e112e76b8a 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -37,6 +37,106 @@ const ActorInit En_Wf_InitVars = { (ActorFunc)EnWf_Update, (ActorFunc)EnWf_Draw, }; + +static ColliderJntSphElementInit D_80B37990[4] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 15, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, + { 21, { { 0, 0, 0 }, 15 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 17, { { 800, 0, 0 }, 25 }, 100 }, + }, + { + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFC1FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, + { 12, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B37A20 = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 4, + D_80B37990, +}; + +static ColliderCylinderInit D_80B37A30 = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 20, 50, 0, { 0, 0, 0 } }, +}; + +static ColliderCylinderInit D_80B37A5C = { + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { 15, 20, -15, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33CB0.s") diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 1adb9c07b3..11e02ccc5d 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -24,8 +24,22 @@ void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx); void EnWonderItem_RollDrop(EnWonderItem* this, GlobalContext* globalCtx); static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 20, 30, 0, { 0, 0, 0 } }, }; @@ -142,7 +156,7 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { colTypeIndex = this->actor.posRot.rot.z & 0xFF; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.body.bumper.flags = collisionTypes[colTypeIndex]; + this->collider.info.bumper.dmgFlags = collisionTypes[colTypeIndex]; this->collider.dim.radius = 20; this->collider.dim.height = 30; this->updateFunc = EnWonderItem_InteractSwitch; @@ -171,7 +185,7 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { case WONDERITEM_BOMB_SOLDIER: Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.body.bumper.flags = 0x00000004; // slingshot + this->collider.info.bumper.dmgFlags = 0x00000004; // slingshot this->unkPos = this->actor.posRot.pos; this->collider.dim.radius = 35; this->collider.dim.height = 75; @@ -233,8 +247,8 @@ void EnWonderItem_ProximityDrop(EnWonderItem* this, GlobalContext* globalCtx) { } void EnWonderItem_InteractSwitch(EnWonderItem* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; EnWonderItem_DropCollectible(this, globalCtx, false); } } @@ -292,8 +306,8 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) } void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HEISHI2, this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, 9) != NULL) { @@ -334,7 +348,7 @@ void EnWonderItem_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetHeight(&this->actor, this->unkHeight); } if ((this->wonderMode == WONDERITEM_INTERACT_SWITCH) || (this->wonderMode == WONDERITEM_BOMB_SOLDIER)) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 74f75420ae..aaa84f1f59 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -47,8 +47,22 @@ const ActorInit En_Wood02_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK13, 0x00, 0x0D, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x05, { 0x00000000, 0x00, 0x00 }, { 0x0FC0074A, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_TREE, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK5, + { 0x00000000, 0x00, 0x00 }, + { 0x0FC0074A, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 18, 60, 0, { 0, 0, 0 } }, }; @@ -265,7 +279,7 @@ void EnWood02_Init(Actor* thisx, GlobalContext* globalCtx2) { } ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); this->actor.initPosRot.rot.y = 0; - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; } void EnWood02_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -306,8 +320,8 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { } if (this->actor.params <= WOOD_TREE_KAKARIKO_ADULT) { - if (this->collider.base.acFlags & 2) { - this->collider.base.acFlags &= ~2; + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; Audio_PlayActorSound2(&this->actor, NA_SE_IT_REFLECTION_WOOD); } @@ -347,7 +361,7 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { } if (this->actor.xzDistToLink < 600.0f) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 4cae1ff07d..21deafa2a2 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -58,6 +58,25 @@ const ActorInit En_Xc_InitVars = { (ActorFunc)EnXc_Update, (ActorFunc)EnXc_Draw, }; + +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 25, 80, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C1E0.s") diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 057dd87f5a..742edf8d77 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -26,6 +26,26 @@ const ActorInit En_Yabusame_Mark_InitVars = { (ActorFunc)EnYabusameMark_Update, NULL, }; + +static ColliderQuadInit D_80B434F0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Yabusame_Mark/EnYabusameMark_Destroy.s") diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 7f8daa3f97..67fcd4499e 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -32,8 +32,22 @@ const ActorInit En_Yukabyun_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x11, 0x09, 0x3D, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x09, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_NO_PUSH | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x04 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_HARD, + BUMP_ON, + OCELEM_ON, + }, { 28, 8, 0, { 0, 0, 0 } }, }; @@ -106,12 +120,12 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { EnYukabyun* this = THIS; s32 pad; - if (((this->collider.base.atFlags & 2) || (this->collider.base.acFlags & 2) || - ((this->collider.base.maskA & 2) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || + if (((this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || + ((this->collider.base.ocFlags1 & OC1_HIT) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || ((this->actionfunc == func_80B43B6C) && (this->actor.bgCheckFlags & 8))) { - this->collider.base.atFlags &= ~0x2; - this->collider.base.acFlags &= ~0x2; - this->collider.base.maskA &= ~0x2; + this->collider.base.atFlags &= ~AT_HIT; + this->collider.base.acFlags &= ~AC_HIT; + this->collider.base.ocFlags1 &= ~OC1_HIT; this->actor.flags &= ~0x5; Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_ROCK); this->actionfunc = EnYukabyun_Break; @@ -122,7 +136,7 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(this->actionfunc == func_80B43A94 || this->actionfunc == EnYukabyun_Break)) { func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 8.0f, 5); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.flags |= 0x1000000; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 4b5390b37a..c3eabcda58 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -42,6 +42,46 @@ const ActorInit En_Zf_InitVars = { (ActorFunc)EnZf_Update, (ActorFunc)EnZf_Draw, }; + +static ColliderCylinderInit D_80B4A1D8 = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 20, 70, 0, { 0, 0, 0 } }, +}; + +static ColliderQuadInit D_80B4A204 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x08 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL | TOUCH_UNK7, + BUMP_ON, + OCELEM_NONE, + }, + { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44050.s") diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index 7c652bc297..e89ccb0427 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -39,8 +39,22 @@ const ActorInit En_Zl1_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 20, 46, 0, { 0, 0, 0 } }, }; @@ -145,7 +159,7 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) { func_8002F2F4(&this->actor, globalCtx); } - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -552,7 +566,7 @@ void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5); this->actionFunc(this, globalCtx); if (this->actionFunc != func_80B4B8B4) { - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x, 0xA, 0x3E8, 1); diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index dcce2a523e..00e10bd645 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -20,9 +20,22 @@ void EnZl3_Update(Actor* thisx, GlobalContext* globalCtx); void EnZl3_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80B59AD0(EnZl3* this, GlobalContext* globalCtx); -static ColliderCylinderInit_Set3 sCylinderInit = { - { COLTYPE_UNK0, 0x00, 0x00, 0x09, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 25, 80, 0, { 0, 0, 0 } }, }; @@ -93,14 +106,14 @@ void func_80B533B0(Actor* thisx, GlobalContext* globalCtx) { EnZl3* this = THIS; Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &sCylinderInit); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); } void func_80B533FC(EnZl3* this, GlobalContext* globalCtx) { ColliderCylinder* collider = &this->collider; s32 pad[4]; - Collider_CylinderUpdate(&this->actor, collider); + Collider_UpdateCylinder(&this->actor, collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); } diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 93b5c31cc7..a06dff8c6d 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -48,6 +48,26 @@ const ActorInit En_Zl4_InitVars = { (ActorFunc)EnZl4_Update, (ActorFunc)EnZl4_Draw, }; + +static ColliderCylinderInit D_80B5E780 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 10, 44, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Zl4/func_80B5B7B0.s") diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 67f8f869b6..c16e726c5d 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -292,12 +292,26 @@ void EnZo_TreadWaterRipples(EnZo* this, f32 scale, f32 targetScale, u8 alpha) { } static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, - { 0x1A, 0x40, 0, { 0, 0, 0 } }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 26, 64, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, 0xFF }; +static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Zo_InitVars = { ACTOR_EN_ZO, @@ -560,7 +574,7 @@ void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BFA8, NULL, this->jointTable, this->morphTable, 20); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - func_80061EFC(&this->actor.colChkInfo, NULL, &sColChkInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit); if (LINK_IS_ADULT && ((this->actor.params & 0x3F) == 8)) { Actor_Kill(&this->actor); @@ -724,7 +738,7 @@ void EnZo_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((s32)this->alpha != 0) { - Collider_CylinderUpdate(thisx, &this->collider); + Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index ac92bbc417..7b9b971225 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -70,6 +70,154 @@ const ActorInit Fishing_InitVars = { (ActorFunc)Fishing_Update, (ActorFunc)Fishing_Draw, }; + +static ColliderJntSphElementInit D_80B7A6D8[12] = { + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, + { + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x00, 0x10 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 30 }, 100 }, + }, +}; + +static ColliderJntSphInit D_80B7A888 = { + { + COLTYPE_NONE, + AT_TYPE_ENEMY, + AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 12, + D_80B7A6D8, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Fishing/func_80B699A0.s") diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index 420c4017d3..40b94ab725 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -29,6 +29,26 @@ const ActorInit Item_Shield_InitVars = { (ActorFunc)ItemShield_Update, (ActorFunc)ItemShield_Draw, }; + +static ColliderCylinderInit D_80B871A0 = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000004, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 15, 15, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86920.s") diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index a5143cd2e3..69378f85e6 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -27,6 +27,26 @@ const ActorInit Magic_Fire_InitVars = { (ActorFunc)MagicFire_Update, (ActorFunc)MagicFire_Draw, }; + +static ColliderCylinderInit D_80B8AF50 = { + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00020000, 0x00, 0x01 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, + { 9, 9, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Magic_Fire/MagicFire_Init.s") diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 8bac9b91e8..5b4b82d7ca 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -46,22 +46,50 @@ const ActorInit Mir_Ray_InitVars = { u8 D_80B8E670 = 0; static ColliderQuadInit sQuadInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x00, COLSHAPE_QUAD }, - { 0x00, { 0x00200000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK0, + { 0x00200000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00200000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00200000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 50 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x00, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, 1, - sJntSphItemsInit, + sJntSphElementsInit, }; static MirRayDataEntry sMirRayData[] = { @@ -89,16 +117,15 @@ extern Gfx D_06000C50[]; void MirRay_SetupCollider(MirRay* this) { Vec3f colliderOffset; - MirRayDataEntry* dataEntry; + MirRayDataEntry* dataEntry = &sMirRayData[this->actor.params]; - dataEntry = &sMirRayData[this->actor.params]; colliderOffset.x = (this->poolPt.x - this->sourcePt.x) * dataEntry->unk_10; colliderOffset.y = (this->poolPt.y - this->sourcePt.y) * dataEntry->unk_10; colliderOffset.z = (this->poolPt.z - this->sourcePt.z) * dataEntry->unk_10; - this->colliderSph.list->dim.worldSphere.center.x = colliderOffset.x + this->sourcePt.x; - this->colliderSph.list->dim.worldSphere.center.y = colliderOffset.y + this->sourcePt.y; - this->colliderSph.list->dim.worldSphere.center.z = colliderOffset.z + this->sourcePt.z; - this->colliderSph.list->dim.worldSphere.radius = dataEntry->unk_14 * this->colliderSph.list->dim.scale; + this->colliderSph.elements[0].dim.worldSphere.center.x = colliderOffset.x + this->sourcePt.x; + this->colliderSph.elements[0].dim.worldSphere.center.y = colliderOffset.y + this->sourcePt.y; + this->colliderSph.elements[0].dim.worldSphere.center.z = colliderOffset.z + this->sourcePt.z; + this->colliderSph.elements[0].dim.worldSphere.radius = dataEntry->unk_14 * this->colliderSph.elements->dim.scale; } // Set up a light point between source point and reflection point. Reflection point is the pool point (for windows) or @@ -381,7 +408,7 @@ void MirRay_ReflectedBeam(MirRay* this, GlobalContext* globalCtx, MirRayShieldRe vecC.y = vecD.y + (shieldMtx->xy * 300.0f); vecC.z = vecD.z + (shieldMtx->xz * 300.0f); - func_80062734(&this->shieldRay, &vecA, &vecB, &vecC, &vecD); + Collider_SetQuadVertices(&this->shieldRay, &vecA, &vecB, &vecC, &vecD); for (i = 0; i < 6; i++) { currentReflection = &reflection[i]; diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index 0bcad33762..e1ea91e18f 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -29,7 +29,7 @@ typedef struct { typedef struct MirRay { /* 0x0000 */ Actor actor; /* 0x014C */ ColliderJntSph colliderSph; - /* 0x016C */ ColliderJntSphItem colliderSphItem; + /* 0x016C */ ColliderJntSphElement colliderSphItem; /* 0x01AC */ ColliderQuad shieldRay; /* 0x022C */ f32 reflectIntensity; // Reflection occurs if it is positive, brightness depends on it /* 0x0230 */ Vec3f shieldCorners[6]; diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 53717842c8..2f0fee0c81 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -33,6 +33,26 @@ const ActorInit Obj_Bean_InitVars = { (ActorFunc)ObjBean_Update, (ActorFunc)ObjBean_Draw, }; + +static ColliderCylinderInit D_80B90E54 = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, + { 64, 30, -31, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Bean/func_80B8EA80.s") diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 872cf9a916..ec3ea8626d 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -32,17 +32,26 @@ const ActorInit Obj_Bombiwa_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 55, 70, 0, { 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { - 0x00, - 0x000C, - 0x003C, - 0xFF, -}; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), @@ -62,7 +71,7 @@ void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -71,7 +80,7 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { if ((Flags_GetSwitch(globalCtx, thisx->params & 0x3F) != 0)) { Actor_Kill(thisx); } else { - func_80061ED4(&thisx->colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); if (thisx->shape.rot.y == 0) { s16 rand = (s16)Rand_ZeroFloat(65536.0f); thisx->posRot.rot.y = rand; @@ -117,8 +126,8 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { ObjBombiwa* this = THIS; s32 pad; - if (func_80033684(globalCtx, &this->actor) != NULL || - ((this->collider.base.acFlags & 2) != 0 && (this->collider.body.acHitItem->toucher.flags & 0x40000040) != 0)) { + if ((func_80033684(globalCtx, &this->actor) != NULL) || + ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040))) { ObjBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EV_WALL_BROKEN); @@ -127,10 +136,10 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); } else { - this->collider.base.acFlags &= ~0x2; + this->collider.base.acFlags &= ~AC_HIT; if (this->actor.xzDistToLink < 800.0f) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 4c4dbc884b..72a42bebf7 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -33,17 +33,31 @@ const ActorInit Obj_Comb_InitVars = { (ActorFunc)ObjComb_Draw, }; -static ColliderJntSphItemInit sJntSphItemsInit[1] = { +static ColliderJntSphElementInit sJntSphElementsInit[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, - { 0x00, { { 0, 0, 0 }, 15 }, 100 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4001FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, + { 0, { { 0, 0, 0 }, 15 }, 100 }, }, }; static ColliderJntSphInit sJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_PLAYER, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - &sJntSphItemsInit, + sJntSphElementsInit, }; static InitChainEntry sInitChain[] = { @@ -60,7 +74,7 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { Vec3f pos1; Vec3f pos; Vec3f velocity; - Gfx** dlist = D_05009940; + Gfx* dlist = D_05009940; s16 scale; s16 angle = 0; s16 gravity; @@ -131,7 +145,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) { params = -1; } if (params >= 0) { - Item_DropCollectible(globalCtx, &this->actor.posRot, params); + Item_DropCollectible(globalCtx, &this->actor.posRot.pos, params); } } } @@ -141,7 +155,7 @@ void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(globalCtx, &this->collider); - Collider_SetJntSph(globalCtx, &this->collider, this, &sJntSphInit, &this->colliderItems); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); ObjComb_SetupWait(this); } @@ -157,17 +171,17 @@ void ObjComb_SetupWait(ObjComb* this) { } void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) { - s32 toucherFlags; + s32 dmgFlags; this->unk_1B0 -= 50; if (this->unk_1B0 < 0) { this->unk_1B0 = 0; } - if ((this->collider.base.acFlags & 0x2) != 0) { - this->collider.base.acFlags &= ~0x2; - toucherFlags = this->collider.list->body.acHitItem->toucher.flags; - if (toucherFlags & 0x4001F866) { + if ((this->collider.base.acFlags & AC_HIT) != 0) { + this->collider.base.acFlags &= ~AC_HIT; + dmgFlags = this->collider.elements[0].info.acHitInfo->toucher.dmgFlags; + if (dmgFlags & 0x4001F866) { this->unk_1B0 = 1500; } else { ObjComb_Break(this, globalCtx); @@ -175,11 +189,11 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actor.update != NULL) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -211,7 +225,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_OPA_DISP++, D_050095B0); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_comb.c", 402); } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index 83945325bf..7700b5c372 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -12,7 +12,7 @@ typedef struct ObjComb { /* 0x0000 */ Actor actor; /* 0x014C */ ObjCombActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ s16 unk_1B0; /* 0x01B2 */ s16 unk_1B2; } ObjComb; // size = 0x01B4 diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index 8f54370d02..3bce721557 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -29,8 +29,14 @@ const ActorInit Obj_Dekujr_InitVars = { (ActorFunc)ObjDekujr_Draw, }; -static ColliderCylinderInit_Actor sCylinderInit = { - { NULL, 0x00, 0x00, 0x39, COLSHAPE_CYLINDER }, +static ColliderCylinderInitToActor sCylinderInit = { + { + NULL, + 0x00, + 0x00, + 0x39, + COLSHAPE_CYLINDER, + }, { 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, { 60, 80, 0, { 0, 0, 0 } }, }; @@ -59,8 +65,8 @@ void ObjDekujr_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); Collider_InitCylinder(globalCtx, &this->collider); sCylinderInit.base.actor = thisx; // thisx required to match here - Collider_SetCylinder_Actor(globalCtx, &this->collider, &sCylinderInit); - this->actor.colChkInfo.mass = 0xFF; + Collider_SetCylinderToActor(globalCtx, &this->collider, &sCylinderInit); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.textId = func_80037C30(globalCtx, 0xF); Actor_SetScale(&this->actor, 0.4f); } @@ -127,7 +133,7 @@ void ObjDekujr_Update(Actor* thisx, GlobalContext* globalCtx) { ObjDekujr* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (this->unk_19B == 0)) { this->unk_19C = 0; diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 12c0133afe..7dd37a5598 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -31,12 +31,26 @@ const ActorInit Obj_Hamishi_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4FC1FFF6, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4FC1FFF6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 50, 70, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 0xC, 0x3C, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static s16 sEffectScales[] = { 145, 135, 115, 85, 75, 53, 45, 40, 35, @@ -54,7 +68,7 @@ void ObjHamishi_InitCollision(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void ObjHamishi_Shake(ObjHamishi* this) { @@ -119,11 +133,11 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) { } EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, gravity, phi_v0, 30, 5, 0, - sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, &D_0500A5E8); + sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); } - func_80033480(globalCtx, &this->actor.posRot, 140.0f, 6, 180, 90, 1); - func_80033480(globalCtx, &this->actor.posRot, 140.0f, 12, 80, 90, 1); + func_80033480(globalCtx, &this->actor.posRot.pos, 140.0f, 6, 180, 90, 1); + func_80033480(globalCtx, &this->actor.posRot.pos, 140.0f, 12, 80, 90, 1); } void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -139,7 +153,7 @@ void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { } ObjHamishi_InitCollision(&this->actor, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { Actor_Kill(&this->actor); @@ -162,8 +176,8 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { ObjHamishi_Shake(this); - if ((this->collider.base.acFlags & 2) && (this->collider.body.acHitItem->toucher.flags & 0x40000040)) { - this->collider.base.acFlags &= ~2; + if ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040)) { + this->collider.base.acFlags &= ~AC_HIT; this->hitCount++; if (this->hitCount < 2) { this->shakeFrames = 15; @@ -176,11 +190,11 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else { - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; if (this->actor.xzDistToLink < 600.0f) { - CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider); - CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider.base); } } } @@ -193,7 +207,7 @@ void ObjHamishi_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 404), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 170, 130, 255); - gSPDisplayList(POLY_OPA_DISP++, &D_0500A3B8); + gSPDisplayList(POLY_OPA_DISP++, D_0500A3B8); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_hamishi.c", 411); } diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 6631b9fccd..8dca0f5d64 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -28,12 +28,26 @@ const ActorInit Obj_Hana_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x00, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_NONE, + OCELEM_ON, + }, { 8, 10, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sColChkInfoInit = { 0, 0xC, 0x3C, 0xFF }; +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; typedef struct { /* 0x00 */ Gfx* dList; @@ -67,10 +81,10 @@ void ObjHana_Init(Actor* thisx, GlobalContext* globalCtx) { if (params->radius >= 0) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = params->radius; this->collider.dim.height = params->height; - func_80061ED4(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); } if (type == 2 && (gSaveContext.eventChkInf[4] & 1)) { diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 3c9ca8ff0b..3e79a7f7db 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -33,14 +33,42 @@ const ActorInit Obj_Ice_Poly_InitVars = { }; static ColliderCylinderInit sCylinderInitIce = { - { COLTYPE_UNK10, 0x11, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0xFFCFFFFF, 0x02, 0x00 }, { 0x00020800, 0x00, 0x00 }, 0x19, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0xFFCFFFFF, 0x02, 0x00 }, + { 0x00020800, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_ON, + OCELEM_ON, + }, { 50, 120, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylinderInitHard = { - { COLTYPE_UNK12, 0x00, 0x0D, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4E01F7F6, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x4E01F7F6, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 50, 120, 0, { 0, 0, 0 } }, }; @@ -64,9 +92,9 @@ void ObjIcePoly_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->colliderIce, thisx, &sCylinderInitIce); Collider_InitCylinder(globalCtx, &this->colliderHard); Collider_SetCylinder(globalCtx, &this->colliderHard, thisx, &sCylinderInitHard); - Collider_CylinderUpdate(thisx, &this->colliderIce); - Collider_CylinderUpdate(thisx, &this->colliderHard); - thisx->colChkInfo.mass = 0xFF; + Collider_UpdateCylinder(thisx, &this->colliderIce); + Collider_UpdateCylinder(thisx, &this->colliderHard); + thisx->colChkInfo.mass = MASS_IMMOVABLE; this->alpha = 255; this->colliderIce.dim.radius *= thisx->scale.x; this->colliderIce.dim.height *= thisx->scale.y; @@ -91,8 +119,8 @@ void ObjIcePoly_Idle(ObjIcePoly* this, GlobalContext* globalCtx) { s32 pad; Vec3f pos; - if (this->colliderIce.base.acFlags & 2) { - this->meltTimer = -this->colliderIce.body.acHitItem->toucher.damage; + if (this->colliderIce.base.acFlags & AC_HIT) { + this->meltTimer = -this->colliderIce.info.acHitInfo->toucher.damage; this->actor.posRot2.rot.y = this->actor.yawTowardsLink; func_800800F8(globalCtx, 0x1400, 40, &this->actor, 0); this->actionFunc = ObjIcePoly_Melt; diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index e1fecf29af..9b312ae001 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -39,12 +39,26 @@ const ActorInit Obj_Kibako_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x09, 0x09, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000002, 0x00, 0x01 }, { 0x4FC00748, 0x00, 0x00 }, 0x01, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000002, 0x00, 0x01 }, + { 0x4FC00748, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 12, 27, 0, { 0, 0, 0 } }, }; -static CollisionCheckInfoInit sCCInfoInit = { 0, 0xC, 0x3C, 0xFE }; +static CollisionCheckInfoInit sCCInfoInit = { 0, 12, 60, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), @@ -75,7 +89,7 @@ void ObjKibako_InitCollider(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Collider_CylinderUpdate(&this->actor, &this->collider); + Collider_UpdateCylinder(&this->actor, &this->collider); } void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -86,7 +100,7 @@ void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.2f; this->actor.minVelocityY = -13.0f; ObjKibako_InitCollider(&this->actor, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sCCInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sCCInfoInit); ObjKibako_SetupIdle(this); // wooden box osSyncPrintf("(dungeon keep 木箱)(arg_data 0x%04x)\n", this->actor.params); @@ -172,10 +186,12 @@ void ObjKibako_WaterBreak(ObjKibako* this, GlobalContext* globalCtx) { void ObjKibako_SetupIdle(ObjKibako* this) { this->actionFunc = ObjKibako_Idle; - this->actor.colChkInfo.mass = 0xFE; + this->actor.colChkInfo.mass = MASS_HEAVY; } void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { + s32 pad; + if (Actor_HasParent(&this->actor, globalCtx)) { ObjKibako_SetupHeld(this); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 19.0f)) { @@ -183,7 +199,7 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); - } else if (this->collider.base.acFlags & 2) { + } else if (this->collider.base.acFlags & AC_HIT) { ObjKibako_AirBreak(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); @@ -191,16 +207,14 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { } else { Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); - if (!(this->collider.base.maskA & 8) && (this->actor.xzDistToLink > 28.0f)) { - this->collider.base.maskA |= 8; + if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToLink > 28.0f)) { + this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; } if (this->actor.xzDistToLink < 600.0f) { - ColliderCylinder* collider = &this->collider; - - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &collider->base); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.xzDistToLink < 180.0f) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } if (this->actor.xzDistToLink < 100.0f) { @@ -221,7 +235,7 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) { if (fabsf(this->actor.speedXZ) < 0.1f) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_PUT_DOWN_WOODBOX); ObjKibako_SetupIdle(this); - this->collider.base.maskA &= ~8; + this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER; } else { ObjKibako_SetupThrown(this); ObjKibako_ApplyGravity(this); @@ -239,27 +253,26 @@ void ObjKibako_SetupThrown(ObjKibako* this) { } void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; + s32 pad; + s32 pad2; - if ((thisx->bgCheckFlags & 0xB) || (this->collider.base.atFlags & 2)) { + if ((this->actor.bgCheckFlags & 0xB) || (this->collider.base.atFlags & AT_HIT)) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); - Actor_Kill(thisx); + Actor_Kill(&this->actor); } else if (this->actor.bgCheckFlags & 0x40) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); - Actor_Kill(thisx); + Actor_Kill(&this->actor); } else { - ColliderCylinder* collider = &this->collider; - ObjKibako_ApplyGravity(this); - func_8002D7EC(thisx); - func_8002E4B4(globalCtx, thisx, 19.0f, 20.0f, 0.0f, 5); - Collider_CylinderUpdate(thisx, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &collider->base); + func_8002D7EC(&this->actor); + func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index bdce44d611..1da76f9390 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -35,8 +35,22 @@ const ActorInit Obj_Kibako2_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 31, 48, 0, { 0, 0, 0 } }, }; @@ -52,7 +66,7 @@ void ObjKibako2_InitCollider(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - Collider_CylinderUpdate(&this->dyna.actor, &this->collider); + Collider_UpdateCylinder(&this->dyna.actor, &this->collider); } void ObjKibako2_Break(ObjKibako2* this, GlobalContext* globalCtx) { @@ -134,17 +148,15 @@ void ObjKibako2_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjKibako2_Idle(ObjKibako2* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & 2) || this->dyna.actor.initPosRot.rot.z != 0 || - func_80033684(globalCtx, &this->dyna.actor) != 0) { + if ((this->collider.base.acFlags & AC_HIT) || (this->dyna.actor.initPosRot.rot.z != 0) || + func_80033684(globalCtx, &this->dyna.actor) != NULL) { ObjKibako2_Break(this, globalCtx); Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); this->dyna.actor.flags |= 0x10; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->dyna.actor.draw = NULL; this->actionFunc = ObjKibako2_Kill; - return; - } - if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToLink < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index f66055ed5c..250b8c5c51 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -55,18 +55,33 @@ const ActorInit Obj_Lightswitch_InitVars = { (ActorFunc)ObjLightswitch_Draw, }; -static ColliderJntSphItemInit sColliderJntSphItemInit[] = { +static ColliderJntSphElementInit sColliderJntSphElementInit[] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00200000, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00200000, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 19 }, 100 }, }, }; static ColliderJntSphInit sColliderJntSphInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, - sColliderJntSphItemInit, + sColliderJntSphElementInit, }; -static CollisionCheckInfoInit sCollisionCheckInfoInit = { 0, 0xC, 0x3C, 0xFF }; + +static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static UNK_PTR faceTextures[] = { D_06000C20, D_06000420, D_06001420 }; @@ -88,7 +103,7 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, GlobalContext* globalCtx) func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y), this->actor.posRot.pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, GlobalContext* globalCtx) { @@ -189,7 +204,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { } } ObjLightswitch_InitCollider(this, globalCtx); - func_80061ED4(&this->actor.colChkInfo, NULL, &sCollisionCheckInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (removeSelf) { Actor_Kill(&this->actor); } @@ -217,19 +232,19 @@ void ObjLightswitch_Off(ObjLightswitch* this, GlobalContext* globalCtx) { switch (this->actor.params >> 4 & 3) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { ObjLightswitch_SetupTurnOn(this); ObjLightswitch_SetSwitchFlag(this, globalCtx); } break; case OBJLIGHTSWITCH_TYPE_1: - if ((this->collider.base.acFlags & 2) && !(this->prevFrameACflags & 2)) { + if ((this->collider.base.acFlags & AC_HIT) && !(this->prevFrameACflags & AC_HIT)) { ObjLightswitch_SetupTurnOn(this); ObjLightswitch_SetSwitchFlag(this, globalCtx); } break; case OBJLIGHTSWITCH_TYPE_BURN: - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { ObjLightswitch_SetupDisappearDelay(this); ObjLightswitch_SetSwitchFlag(this, globalCtx); } @@ -288,13 +303,13 @@ void ObjLightswitch_On(ObjLightswitch* this, GlobalContext* globalCtx) { } break; case OBJLIGHTSWITCH_TYPE_1: - if (this->collider.base.acFlags & 2 && !(this->prevFrameACflags & 2)) { + if (this->collider.base.acFlags & AC_HIT && !(this->prevFrameACflags & AC_HIT)) { ObjLightswitch_SetupTurnOff(this); ObjLightswitch_ClearSwitchFlag(this, globalCtx); } break; case OBJLIGHTSWITCH_TYPE_2: - if (!(this->collider.base.acFlags & 2)) { + if (!(this->collider.base.acFlags & AC_HIT)) { if (this->timer >= 7) { ObjLightswitch_SetupTurnOff(this); ObjLightswitch_ClearSwitchFlag(this, globalCtx); @@ -379,7 +394,7 @@ void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx) { } this->prevFrameACflags = this->collider.base.acFlags; - this->collider.base.acFlags &= ~2; + this->collider.base.acFlags &= ~AC_HIT; CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); } @@ -481,7 +496,7 @@ void ObjLightswitch_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 alpha = this->alpha >> 6 & 0xFF; if ((this->actor.params & 1) == 1) { - func_800628A4(0, &this->collider); + Collider_UpdateSpheres(0, &this->collider); } if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index 9a36dca8cb..17341ded90 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -19,7 +19,7 @@ typedef struct ObjLightswitch { /* 0x0000 */ Actor actor; /* 0x014C */ ObjLightswitchActionFunc actionFunc; /* 0x0150 */ ColliderJntSph collider; - /* 0x0170 */ ColliderJntSphItem colliderItems[1]; + /* 0x0170 */ ColliderJntSphElement colliderItems[1]; /* 0x01B0 */ s16 timer; // collision-related threshold and controls animation/logic when turning on/off /* 0x01B2 */ s16 toggleDelay; // timer ticking down used for delaying tuning on/off or disappearing, can be bypassed /* 0x01B4 */ s16 faceTextureIndex; // texture used by the center part of the sun diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index c9538e19db..d67d1d52c6 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -306,7 +306,7 @@ void ObjOshihiki_Init(Actor* thisx, GlobalContext* globalCtx2) { ObjOshihiki_SetScale(this, globalCtx); ObjOshihiki_SetTexture(this, globalCtx); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; ObjOshihiki_SetColor(this, globalCtx); ObjOshihiki_ResetFloors(this); ObjOshihiki_SetupOnActor(this, globalCtx); diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index a44c339508..d440aa8d34 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -71,49 +71,105 @@ const ActorInit Obj_Switch_InitVars = { static f32 sHeights[] = { 10, 10, 0, 30, 30 }; -static ColliderTrisItemInit D_80B9EC34[2] = { +static ColliderTrisElementInit D_80B9EC34[2] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { -20.0f, 19.0f, -20.0f }, { -20.0f, 19.0f, 20.0f }, { 20.0f, 19.0f, 20.0f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x40000040, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x40000040, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 20.0f, 19.0f, 20.0f }, { 20.0f, 19.0f, -20.0f }, { -20.0f, 19.0f, -20.0f } } }, }, }; static ColliderTrisInit sRustyFloorTrisInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, D_80B9EC34, }; -static ColliderTrisItemInit D_80B9ECBC[2] = { +static ColliderTrisElementInit D_80B9ECBC[2] = { { - { 0x04, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK4, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { -23.0f, 0.0f, 8.5f }, { 0.0f, -23.0f, 8.5f } } }, }, { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x0001F824, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x0001F824, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 23.0f, 8.5f }, { 0.0f, -23.0f, 8.5f }, { 23.0f, 0.0f, 8.5f } } }, }, }; static ColliderTrisInit trisColliderEye = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_TRIS }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_TRIS, + }, 2, D_80B9ECBC, }; -static ColliderJntSphItemInit D_80B9ED44[1] = { +static ColliderJntSphElementInit D_80B9ED44[1] = { { - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0xEFC1FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xEFC1FFFE, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 300, 0 }, 20 }, 100 }, }, }; static ColliderJntSphInit sCyrstalJntSphereInit = { - { COLTYPE_METAL_SHIELD, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_JNTSPH, + }, 1, D_80B9ED44, }; @@ -160,7 +216,7 @@ void ObjSwitch_InitJntSphCollider(ObjSwitch* this, GlobalContext* globalCtx, Col this->dyna.actor.posRot.pos.y + this->dyna.actor.shape.unk_08 * this->dyna.actor.scale.y, this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); - func_800628A4(0, colliderJntSph); + Collider_UpdateSpheres(0, colliderJntSph); } void ObjSwitch_InitTrisCollider(ObjSwitch* this, GlobalContext* globalCtx, ColliderTrisInit* colliderTrisInit) { @@ -174,11 +230,11 @@ void ObjSwitch_InitTrisCollider(ObjSwitch* this, GlobalContext* globalCtx, Colli for (i = 0; i < 2; i++) { for (j = 0; j < 3; j++) { - ObjSwitch_RotateY(&pos[j], &colliderTrisInit->list[i].dim.vtx[j], this->dyna.actor.initPosRot.rot.y); + ObjSwitch_RotateY(&pos[j], &colliderTrisInit->elements[i].dim.vtx[j], this->dyna.actor.initPosRot.rot.y); Math_Vec3f_Sum(&pos[j], &this->dyna.actor.posRot.pos, &pos[j]); } - func_800627A0(colliderTris, i, &pos[0], &pos[1], &pos[2]); + Collider_SetTrisVertices(colliderTris, i, &pos[0], &pos[1], &pos[2]); } } @@ -263,7 +319,7 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.unk_1F = 4; } - this->dyna.actor.colChkInfo.mass = 0xFF; + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->dyna.actor.params >> 7 & 1) && (ObjSwitch_SpawnIce(this, globalCtx) == NULL)) { osSyncPrintf(VT_FGCOL(RED)); @@ -326,10 +382,10 @@ void ObjSwitch_FloorUpInit(ObjSwitch* this) { void ObjSwitch_FloorUp(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params & 7) == OBJSWITCH_TYPE_FLOOR_RUSTY) { - if (this->tris.col.base.acFlags & 2) { + if (this->tris.col.base.acFlags & AC_HIT) { ObjSwitch_FloorPressInit(this); ObjSwitch_SetOn(this, globalCtx); - this->tris.col.base.acFlags &= ~2; + this->tris.col.base.acFlags &= ~AC_HIT; } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->tris.col.base); } @@ -442,7 +498,7 @@ s32 ObjSwitch_EyeIsHit(ObjSwitch* this) { Actor* collidingActor; s16 yawDiff; - if ((this->tris.col.base.acFlags & 2) && !(this->unk_17F & 2)) { + if ((this->tris.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2)) { collidingActor = this->tris.col.base.ac; if (collidingActor != NULL) { yawDiff = collidingActor->posRot.rot.y - this->dyna.actor.shape.rot.y; @@ -544,14 +600,14 @@ void ObjSwitch_CrystalOffInit(ObjSwitch* this) { void ObjSwitch_CrystalOff(ObjSwitch* this, GlobalContext* globalCtx) { switch ((this->dyna.actor.params >> 4 & 7)) { case OBJSWITCH_SUBTYPE_CRYSTAL_0: - if ((this->jntSph.col.base.acFlags & 2) && this->disableAcTimer <= 0) { + if ((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, globalCtx); ObjSwitch_CrystalTurnOnInit(this); } break; case OBJSWITCH_SUBTYPE_CRYSTAL_4: - if (((this->jntSph.col.base.acFlags & 2) && this->disableAcTimer <= 0) || + if (((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) || Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8 & 0x3F))) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, globalCtx); @@ -559,7 +615,7 @@ void ObjSwitch_CrystalOff(ObjSwitch* this, GlobalContext* globalCtx) { } break; case OBJSWITCH_SUBTYPE_CRYSTAL_1: - if ((this->jntSph.col.base.acFlags & 2) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { + if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, globalCtx); ObjSwitch_CrystalTurnOnInit(this); @@ -601,7 +657,7 @@ void ObjSwitch_CrystalOn(ObjSwitch* this, GlobalContext* globalCtx) { } break; case OBJSWITCH_SUBTYPE_CRYSTAL_1: - if ((this->jntSph.col.base.acFlags & 2) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { + if ((this->jntSph.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; globalCtx = globalCtx; ObjSwitch_CrystalTurnOffInit(this); @@ -645,7 +701,7 @@ void ObjSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { break; case OBJSWITCH_TYPE_EYE: this->unk_17F = this->tris.col.base.acFlags; - this->tris.col.base.acFlags &= ~2; + this->tris.col.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->tris.col.base); break; case OBJSWITCH_TYPE_CRYSTAL: @@ -654,7 +710,7 @@ void ObjSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { this->disableAcTimer--; } this->unk_17F = this->jntSph.col.base.acFlags; - this->jntSph.col.base.acFlags &= ~2; + this->jntSph.col.base.acFlags &= ~AC_HIT; if (this->disableAcTimer <= 0) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->jntSph.col.base); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index dd2bc3994b..337019be71 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -36,12 +36,12 @@ typedef enum { typedef struct { /* 0x00 */ ColliderJntSph col; - /* 0x20 */ ColliderJntSphItem items[2]; + /* 0x20 */ ColliderJntSphElement items[2]; } ObjSwitchJntSph; typedef struct { /* 0x00 */ ColliderTris col; - /* 0x20 */ ColliderTrisItem items[2]; + /* 0x20 */ ColliderTrisElement items[2]; } ObjSwitchTris; typedef struct ObjSwitch { diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 1d0513b5f6..ffba831462 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -31,14 +31,42 @@ const ActorInit Obj_Syokudai_InitVars = { }; static ColliderCylinderInit sCylInitStand = { - { COLTYPE_METAL_SHIELD, 0x00, 0x0D, 0x39, 0x20, COLSHAPE_CYLINDER }, - { 0x02, { 0x00100000, 0x00, 0x00 }, { 0xEE01FFFF, 0x00, 0x00 }, 0x00, 0x05, 0x01 }, + { + COLTYPE_METAL, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00100000, 0x00, 0x00 }, + { 0xEE01FFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 12, 45, 0, { 0, 0, 0 } }, }; static ColliderCylinderInit sCylInitFlame = { - { COLTYPE_UNK10, 0x00, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER }, - { 0x02, { 0x00000000, 0x00, 0x00 }, { 0x00020820, 0x00, 0x00 }, 0x00, 0x01, 0x00 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_NONE, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00020820, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_NONE, + }, { 15, 45, 45, { 0, 0, 0 } }, }; @@ -62,12 +90,12 @@ void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->colliderStand); Collider_SetCylinder(globalCtx, &this->colliderStand, &this->actor, &sCylInitStand); - this->colliderStand.base.type = sColTypesStand[this->actor.params >> 0xC]; + this->colliderStand.base.colType = sColTypesStand[this->actor.params >> 0xC]; Collider_InitCylinder(globalCtx, &this->colliderFlame); Collider_SetCylinder(globalCtx, &this->colliderFlame, &this->actor, &sCylInitFlame); - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y + 70.0f, this->actor.posRot.pos.z, 255, 255, 180, -1); @@ -105,10 +133,10 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { Player* player; EnArrow* arrow; s32 interactionType; - u32 toucherFlags; + u32 dmgFlags; Vec3f tipToFlame; - ColliderCylinder* colliderStand; - ColliderCylinder* colliderFlame; + s32 pad; + s32 pad2; litTimeScale = torchCount; if (torchCount == 10) { @@ -144,9 +172,9 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { this->litTimer = 20; } } - if (this->colliderFlame.base.acFlags & 2) { - toucherFlags = this->colliderFlame.body.acHitItem->toucher.flags; - if (toucherFlags & 0x20820) { + if (this->colliderFlame.base.acFlags & AC_HIT) { + dmgFlags = this->colliderFlame.info.acHitInfo->toucher.dmgFlags; + if (dmgFlags & 0x20820) { interactionType = 1; } } else if (player->heldItemActionParam == 6) { @@ -166,7 +194,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (player->unk_860 < 200) { player->unk_860 = 200; } - } else if (toucherFlags & 0x20) { + } else if (dmgFlags & 0x20) { arrow = (EnArrow*)this->colliderFlame.base.ac; if ((arrow->actor.update != NULL) && (arrow->actor.id == ACTOR_EN_ARROW)) { arrow->actor.params = 0; @@ -176,7 +204,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { if ((0 <= this->litTimer) && (this->litTimer < (50 * litTimeScale + 100)) && (torchType != 0)) { this->litTimer = 50 * litTimeScale + 100; } - } else if ((torchType != 0) && (((interactionType > 0) && (toucherFlags & 0x20800)) || + } else if ((torchType != 0) && (((interactionType > 0) && (dmgFlags & 0x20800)) || ((interactionType < 0) && (player->unk_860 != 0)))) { if ((interactionType < 0) && (player->unk_860 < 200)) { @@ -203,14 +231,13 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { } } } - colliderStand = &this->colliderStand; - Collider_CylinderUpdate(&this->actor, colliderStand); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &colliderStand->base); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &colliderStand->base); - colliderFlame = &this->colliderFlame; - Collider_CylinderUpdate(&this->actor, colliderFlame); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &colliderFlame->base); + Collider_UpdateCylinder(&this->actor, &this->colliderStand); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderStand.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderStand.base); + + Collider_UpdateCylinder(&this->actor, &this->colliderFlame); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderFlame.base); if (this->litTimer > 0) { this->litTimer--; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 01514b9fc3..55bcf88b4e 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -26,6 +26,26 @@ const ActorInit Obj_Tsubo_InitVars = { (ActorFunc)ObjTsubo_Update, NULL, }; + +static ColliderCylinderInit D_80BA1B94 = { + { + COLTYPE_HARD, + AT_ON | AT_TYPE_PLAYER, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000002, 0x00, 0x01 }, + { 0x4FC1FFFE, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, + { 9, 26, 0, { 0, 0, 0 } }, +}; */ #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA0D60.s") diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 379482ef45..b51872f64d 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -47,7 +47,7 @@ void OceffWipe4_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe4_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe4* this = THIS; - + this->actor.posRot.pos = ACTIVE_CAM->eye; if (this->counter < 50) { this->counter++; diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index f2011f3439..d7c6261165 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -36,8 +36,22 @@ const ActorInit Shot_Sun_InitVars = { }; static ColliderCylinderInit sCylinderInit = { - { COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER }, - { 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000020, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x00000020, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 30, 60, 0, { 0, 0, 0 } }, }; @@ -151,7 +165,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) { s32 pad; Vec3f spawnPos; - if (this->collider.base.acFlags & 2) { + if (this->collider.base.acFlags & AC_HIT) { func_80078884(NA_SE_SY_CORRECT_CHIME); osSyncPrintf(VT_FGCOL(CYAN) "SHOT_SUN HIT!!!!!!!\n" VT_RST); if (INV_CONTENT(SLOT_ARROW_FIRE) == ITEM_NONE) { @@ -179,7 +193,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) { this->hitboxPos = cylinderPos; - func_80062718(&this->collider, &cylinderPos); + Collider_SetCylinderPosition(&this->collider, &cylinderPos); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 2d55a4d005..35c55aa61e 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -3371,12 +3371,12 @@ s32 func_80837818(Player* this) { } void func_80837918(Player* this, s32 quadIndex, u32 flags) { - this->swordQuads[quadIndex].body.toucher.flags = flags; + this->swordQuads[quadIndex].info.toucher.dmgFlags = flags; if (flags == 2) { - this->swordQuads[quadIndex].body.toucherFlags = 0x15; + this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD; } else { - this->swordQuads[quadIndex].body.toucherFlags = 5; + this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST; } } @@ -3714,14 +3714,14 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { this->actor.colChkInfo.damage += this->unk_8A0; func_80837C0C(globalCtx, this, sp5C[this->unk_8A1 - 1], this->unk_8A4, this->unk_8A8, this->unk_8A2, 20); } else { - sp64 = (this->shieldQuad.base.acFlags & 0x80) != 0; + sp64 = (this->shieldQuad.base.acFlags & AC_BOUNCED) != 0; // @bug The second set of conditions here seems intended as a way for Link to "block" hits by rolling. - // However, `ColliderBody.atFlags` is a byte so the flag check at the end is incorrect and cannot work. - // Additionally, `ColliderBody.atHit` can never be set while already colliding as AC, so it's also bugged. + // However, `Collider.atFlags` is a byte so the flag check at the end is incorrect and cannot work. + // Additionally, `Collider.atHit` can never be set while already colliding as AC, so it's also bugged. // This behavior was later fixed in MM, most likely by removing both the `atHit` and `atFlags` checks. - if (sp64 || ((this->invincibilityTimer < 0) && (this->cylinder.base.acFlags & 2) && - (this->cylinder.body.atHit != NULL) && (this->cylinder.body.atHit->atFlags & 0x20000000))) { + if (sp64 || ((this->invincibilityTimer < 0) && (this->cylinder.base.acFlags & AC_HIT) && + (this->cylinder.info.atHit != NULL) && (this->cylinder.info.atHit->atFlags & 0x20000000))) { func_8083264C(this, 180, 20, 100, 0); @@ -3754,7 +3754,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { } } - if (sp64 && (this->shieldQuad.body.acHitItem->toucher.effect == 1)) { + if (sp64 && (this->shieldQuad.info.acHitInfo->toucher.effect == 1)) { func_8083819C(this, globalCtx); } @@ -3762,12 +3762,12 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { } if ((this->unk_A87 != 0) || (this->invincibilityTimer > 0) || (this->stateFlags1 & 0x4000000) || - (this->csMode != 0) || (this->swordQuads[0].base.atFlags & 2) || - (this->swordQuads[1].base.atFlags & 2)) { + (this->csMode != 0) || (this->swordQuads[0].base.atFlags & AT_HIT) || + (this->swordQuads[1].base.atFlags & AT_HIT)) { return 0; } - if (this->cylinder.base.acFlags & 2) { + if (this->cylinder.base.acFlags & AC_HIT) { Actor* ac = this->cylinder.base.ac; s32 sp4C; @@ -7554,7 +7554,7 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) { if (this->swordState > 0) { if (this->swordAnimation < 0x18) { - if (!(this->swordQuads[0].base.atFlags & 4) && !(this->swordQuads[1].base.atFlags & 4)) { + if (!(this->swordQuads[0].base.atFlags & AT_BOUNCED) && !(this->swordQuads[1].base.atFlags & AT_BOUNCED)) { if (this->skelAnime.curFrame >= 2.0f) { phi_f2 = Math_Vec3f_DistXYZAndStoreDiff(&this->swordInfo[0].tip, &this->swordInfo[0].base, &sp50); @@ -7583,9 +7583,9 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) { sp48 = func_80041F10(&globalCtx->colCtx, sp78, sp74); if (sp48 == 0xA) { - func_80062E14(globalCtx, &sp5C, &this->actor.projectedPos); + CollisionCheck_SpawnShieldParticlesWood(globalCtx, &sp5C, &this->actor.projectedPos); } else { - func_80062CD4(globalCtx, &sp5C); + CollisionCheck_SpawnShieldParticles(globalCtx, &sp5C); if (sp48 == 0xB) { func_8002F7DC(&this->actor, NA_SE_IT_WALL_HIT_SOFT); } else { @@ -7606,7 +7606,7 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) { } } - temp1 = (this->swordQuads[0].base.atFlags & 2) || (this->swordQuads[1].base.atFlags & 2); + temp1 = (this->swordQuads[0].base.atFlags & AT_HIT) || (this->swordQuads[1].base.atFlags & AT_HIT); if (temp1) { if (this->swordAnimation < 0x18) { @@ -7791,7 +7791,8 @@ void func_8084377C(Player* this, GlobalContext* globalCtx) { if (this->unk_850 == 0) { func_80853080(this, globalCtx); } - } else if ((this->stateFlags1 & 0x20000000) || (!(this->cylinder.base.acFlags & 2) && (this->unk_8A1 == 0))) { + } else if ((this->stateFlags1 & 0x20000000) || + (!(this->cylinder.base.acFlags & AC_HIT) && (this->unk_8A1 == 0))) { if (this->stateFlags1 & 0x20000000) { this->unk_850++; } else { @@ -8152,7 +8153,7 @@ void func_80844708(Player* this, GlobalContext* globalCtx) { } else { if (this->linearVelocity >= 7.0f) { if (((this->actor.bgCheckFlags & 0x200) && (D_8085360C < 0x2000)) || - ((this->cylinder.base.maskA & 2) && + ((this->cylinder.base.ocFlags1 & OC1_HIT) && (cylinderOc = this->cylinder.base.oc, ((cylinderOc->id == ACTOR_EN_WOOD02) && (ABS((s16)(this->actor.posRot.rot.y - cylinderOc->yawTowardsLink)) > 0x6000))))) { @@ -8886,20 +8887,62 @@ void func_80846578(Player* this, GlobalContext* globalCtx) { } ColliderCylinderInit D_80854624 = { - { COLTYPE_UNK5, 0x00, 0x11, 0x39, 0x08, COLSHAPE_CYLINDER }, - { 0x01, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 }, + { + COLTYPE_HIT5, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_PLAYER, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_NONE, + BUMP_ON, + OCELEM_ON, + }, { 12, 60, 0, { 0, 0, 0 } }, }; ColliderQuadInit D_80854650 = { - { COLTYPE_UNK10, 0x09, 0x00, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00000100, 0x00, 0x01 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x00, 0x00 }, + { + COLTYPE_NONE, + AT_ON | AT_TYPE_PLAYER, + AC_NONE, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00000100, 0x00, 0x01 }, + { 0xFFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; ColliderQuadInit D_808546A0 = { - { COLTYPE_METAL_SHIELD, 0x09, 0x15, 0x00, 0x08, COLSHAPE_QUAD }, - { 0x02, { 0x00100000, 0x00, 0x00 }, { 0xDFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, + { + COLTYPE_METAL, + AT_ON | AT_TYPE_PLAYER, + AC_ON | AC_HARD | AC_TYPE_ENEMY, + OC1_NONE, + OC2_TYPE_PLAYER, + COLSHAPE_QUAD, + }, + { + ELEMTYPE_UNK2, + { 0x00100000, 0x00, 0x00 }, + { 0xDFCFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; @@ -10212,7 +10255,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->cylinder.dim.height = this->cylinder.dim.height * 0.8f; } - Collider_CylinderUpdate(&this->actor, &this->cylinder); + Collider_UpdateCylinder(&this->actor, &this->cylinder); if (!(this->stateFlags2 & 0x4000)) { if (!(this->stateFlags1 & 0x806080)) { @@ -10235,20 +10278,20 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[0]); if (this->stateFlags1 & 0x30000080) { - this->actor.colChkInfo.mass = 0xFF; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; } else { this->actor.colChkInfo.mass = 50; } this->stateFlags3 &= ~4; - Collider_CylinderSetAC(globalCtx, &this->cylinder.base); + Collider_ResetCylinderAC(globalCtx, &this->cylinder.base); - Collider_QuadSetAT(globalCtx, &this->swordQuads[0].base); - Collider_QuadSetAT(globalCtx, &this->swordQuads[1].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[0].base); + Collider_ResetQuadAT(globalCtx, &this->swordQuads[1].base); - Collider_QuadSetAC(globalCtx, &this->shieldQuad.base); - Collider_QuadSetAT(globalCtx, &this->shieldQuad.base); + Collider_ResetQuadAC(globalCtx, &this->shieldQuad.base); + Collider_ResetQuadAT(globalCtx, &this->shieldQuad.base); } Vec3f D_80854838 = { 0.0f, 0.0f, -30.0f }; diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c index c6dac726f2..8f5cd55ea4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.c @@ -44,7 +44,7 @@ u32 EffectSsHitMark_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo this->pos = initParams->pos; this->gfx = SEGMENTED_TO_VIRTUAL(D_04021770); - if (initParams->type == 1) { + if (initParams->type == EFFECT_HITMARK_DUST) { this->life = 16; } else { this->life = 8; @@ -101,7 +101,7 @@ void EffectSsHitMark_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) { void EffectSsHitMark_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { s32 colorIdx; - if (this->rType == 1) { + if (this->rType == EFFECT_HITMARK_DUST) { this->rTexIdx = (15 - this->life) / 2; } else { this->rTexIdx = 7 - this->life; diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h index 92c0734c22..23a94b1472 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h @@ -10,4 +10,11 @@ typedef struct { /* 0x08 */ Vec3f pos; } EffectSsHitMarkInitParams; // size = 0x14 +typedef enum { + EFFECT_HITMARK_WHITE, + EFFECT_HITMARK_DUST, + EFFECT_HITMARK_RED, + EFFECT_HITMARK_METAL +} EffectSsHitmarkType; + #endif diff --git a/tools/overlayhelpers/DamageTable.py b/tools/overlayhelpers/DamageTable.py deleted file mode 100755 index 5bad30f425..0000000000 --- a/tools/overlayhelpers/DamageTable.py +++ /dev/null @@ -1,22 +0,0 @@ -import struct - -ROM_ADDR = 0xDA3210 -COUNT = 1 - -rom = open("../../baserom.z64", "rb") -rom.seek(ROM_ADDR) -data = bytearray(rom.read(0x20 * COUNT)) -rom.close() - -valFormat = "0x{:02X}" -sfmt = "" -for i in range(4): - sfmt += valFormat + ", " - -for i in range(3): - sfmt += sfmt - -sfmt = "{{ {{ " + sfmt + "}} }}," -for i in range(COUNT): - line = struct.unpack_from(">32B", data, i * 0x20) - print(sfmt.format(*line)) diff --git a/tools/overlayhelpers/colliderinit.py b/tools/overlayhelpers/colliderinit.py index 9d958405f9..da99e4e986 100755 --- a/tools/overlayhelpers/colliderinit.py +++ b/tools/overlayhelpers/colliderinit.py @@ -6,24 +6,24 @@ import argparse from filemap import FileResult, GetFromVRam, GetFromRom T_DEFAULT = '' -T_SET3 = '_Set3' +TType1 = 'Type1' T_ACTOR = '_Actor' TYPE_ENUM = [ - "COLTYPE_UNK0", - "COLTYPE_UNK1", - "COLTYPE_UNK2", - "COLTYPE_UNK3", - "COLTYPE_UNK4", - "COLTYPE_UNK5", - "COLTYPE_UNK6", - "COLTYPE_UNK7", - "COLTYPE_UNK8", - "COLTYPE_METAL_SHIELD", - "COLTYPE_UNK10", - "COLTYPE_WOODEN_SHIELD", - "COLTYPE_UNK12", - "COLTYPE_UNK13" ] + "COLTYPE_HIT0", + "COLTYPE_HIT1", + "COLTYPE_HIT2", + "COLTYPE_HIT3", + "COLTYPE_HIT4", + "COLTYPE_HIT5", + "COLTYPE_HIT6", + "COLTYPE_HIT7", + "COLTYPE_HIT8", + "COLTYPE_METAL", + "COLTYPE_NONE", + "COLTYPE_WOOD", + "COLTYPE_HARD", + "COLTYPE_TREE" ] SHAPE_ENUM = [ "COLSHAPE_JNTSPH", @@ -31,35 +31,188 @@ SHAPE_ENUM = [ "COLSHAPE_TRIS", "COLSHAPE_QUAD" ] +ELEMTYPE_UNKENUM = [ + "ELEMTYPE_UNK0", + "ELEMTYPE_UNK1", + "ELEMTYPE_UNK2", + "ELEMTYPE_UNK3", + "ELEMTYPE_UNK4", + "ELEMTYPE_UNK5", + "ELEMTYPE_UNK6"] + +ATFLAGS_ENUM = [ + "AT_ON", + "AT_HIT", + "AT_BOUNCED", + "AT_TYPE_PLAYER", + "AT_TYPE_ENEMY", + "AT_TYPE_OTHER", + "AT_SELF"] + +ACFLAGS_ENUM = [ + "AC_ON", + "AC_HIT", + "AC_HARD", + "AC_TYPE_PLAYER", + "AC_TYPE_ENEMY", + "AC_TYPE_OTHER", + "AC_NO_DAMAGE", + "AC_BOUNCED"] + +OCFLAGS_ENUM = [ + "OC1_ON", + "OC1_HIT", + "OC1_NO_PUSH", + "OC1_TYPE_PLAYER", + "OC1_TYPE_1", + "OC1_TYPE_2"] + +OCTYPE_ENUM = [ + "OC2_HIT_PLAYER", + "OC2_UNK1", + "OC2_UNK2", + "OC2_TYPE_PLAYER", + "OC2_TYPE_1", + "OC2_TYPE_2", + "OC2_FIRST_ONLY"] + +TOUCHERFLAGS_ENUM = [ + "TOUCH_ON", + "TOUCH_HIT", + "TOUCH_NEAREST", + "TOUCH_SFX_HARD", + "TOUCH_SFX_WOOD", + "TOUCH_AT_HITMARK", + "TOUCH_DREW_HITMARK", + "TOUCH_UNK7"] + +BUMPERFLAGS_ENUM = [ + "BUMP_ON", + "BUMP_HIT", + "BUMP_HOOKABLE", + "BUMP_NO_AT_INFO", + "BUMP_NO_DAMAGE", + "BUMP_NO_SWORD_SFX", + "BUMP_NO_HITMARK", + "BUMP_DRAW_HITMARK"] + +OCELEMFLAGS_ENUM = [ + "OCELEM_ON", + "OCELEM_HIT", + "OCELEM_UNK2", + "OCELEM_UNK3", + "OCELEM_UNK4", + "OCELEM_UNK5", + "OCELEM_UNK6", + "OCELEM_UNK7",] + sf_ColliderInit = ">BBBBBB" -sf_ColliderInit_Set3 = ">BBBBB" -sf_ColliderInit_Actor = ">IBBBB" +sf_ColliderInitType1 = ">BBBBB" +sf_ColliderInitToActor = ">IBBBB" sf_ColliderBodyInit = ">B3xIBB2xIBB2xBBB" sf_JntSph = ">II" -sf_JntSphItem = ">Bx5h" +sf_JntSphElement = ">Bx5h" sf_Cylinder16 = ">6h" sf_Tris = ">II" -sf_TrisItem = ">9f" +sf_TrisElement = ">9f" sf_Quad = ">12f" -f_ColliderInit = "{{ {0}, 0x{1:02X}, 0x{2:02X}, 0x{3:02X}, 0x{4:02X}, {5} }}" -f_ColliderInit_Set3 = "{{ {0}, 0x{1:02X}, 0x{2:02X}, 0x{3:02X}, {4} }}" -f_ColliderInit_Actor = "{{ {0}, 0x{1:02X}, 0x{2:02X}, 0x{3:02X}, {4} }}" -f_ColliderBodyInit = "{{ 0x{0:02X}, {{ 0x{1:08X}, 0x{2:02X}, 0x{3:02X} }}, {{ 0x{4:08X}, 0x{5:02X}, 0x{6:02X} }}, 0x{7:02X}, 0x{8:02X}, 0x{9:02X} }}" +f_ColliderInit = "{{ {0}, {1}, {2}, {3}, {4}, {5}, }}" +f_ColliderInitType1 = "{{ {0}, {1}, {2}, {3}, {4}, }}" +f_ColliderInitToActor = "{{ {0}, {1}, {2}, {3}, {4}, }}" +f_ColliderBodyInit = "{{ {0}, {{ 0x{1:08X}, 0x{2:02X}, 0x{3:02X} }}, {{ 0x{4:08X}, 0x{5:02X}, 0x{6:02X} }}, {7}, {8}, {9}, }}" f_JntSph = "{0}, D_{1:08X}" -f_JntSphItem = "{{ {0}, {{ {{ {1}, {2}, {3} }}, {4} }}, {5} }}" +f_JntSphElement = "{{ {0}, {{ {{ {1}, {2}, {3} }}, {4} }}, {5} }}" f_Cylinder16 = "{{ {0}, {1}, {2}, {{ {3}, {4}, {5} }} }}" f_Tris = "{0}, D_{1:08X}" -f_TrisItem = "{{ {{ {{ {0}f, {1}f, {2}f }}, {{ {3}f, {4}f, {5}f }}, {{ {6}f, {7}f, {8}f }} }} }}" +f_TrisElement = "{{ {{ {{ {0}f, {1}f, {2}f }}, {{ {3}f, {4}f, {5}f }}, {{ {6}f, {7}f, {8}f }} }} }}" f_Quad = "{{ {{ {{ {0}f, {1}f, {2}f }}, {{ {3}f, {4}f, {5}f }}, {{ {6}f, {7}f, {8}f }}, {{ {9}f, {10}f, {11}f }} }} }}" +def GetATflags(at): + for i, flag in enumerate(ATFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "AT_ON" + else: + output = "AT_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output.replace("AT_TYPE_PLAYER | AT_TYPE_ENEMY | AT_TYPE_OTHER","AT_TYPE_ALL") + +def GetACflags(at): + for i, flag in enumerate(ACFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "AC_ON" + else: + output = "AC_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output.replace("AC_TYPE_OTHER | AC_TYPE_ENEMY | AC_TYPE_PLAYER","AC_TYPE_ALL") + +def GetOCflags(at): + for i, flag in enumerate(OCFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "OC1_ON" + else: + output = "OC1_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output.replace("OC1_TYPE_PLAYER | OC1_TYPE_1 | OC1_TYPE_2","OC1_TYPE_ALL") + +def GetOCtype(at): + output = "" + for i, flag in enumerate(OCTYPE_ENUM): + if(at & (1 << i)): + output = " | " + flag + output + if(output == ""): + return "OC2_NONE" + else: + return output.strip(" | ") + +def GetToucherFlags(at): + for i, flag in enumerate(TOUCHERFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "TOUCH_ON" + else: + output = "TOUCH_NONE" + elif(at & (1 << i)): + output += " | " + flag + if(i == 4 and output.find("SFX") == -1 and output.find("OFF") == -1): + output += " | TOUCH_SFX_NORMAL" + return output.replace("TOUCH_SFX_HARD | TOUCH_SFX_WOOD", "TOUCH_SFX_NONE") + +def GetBumperFlags(at): + for i, flag in enumerate(BUMPERFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "BUMP_ON" + else: + output = "BUMP_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output + +def GetOcElemFlags(at): + for i, flag in enumerate(OCELEMFLAGS_ENUM): + if(i == 0): + if(at & (1 << i)): + output = "OCELEM_ON" + else: + output = "OCELEM_NONE" + elif(at & (1 << i)): + output += " | " + flag + return output + def GetColliderFormat(type): if type == T_DEFAULT: return (sf_ColliderInit, f_ColliderInit) - if type == T_SET3: - return (sf_ColliderInit_Set3, f_ColliderInit_Set3) + if type == TType1: + return (sf_ColliderInitType1, f_ColliderInitType1) if type == T_ACTOR: - return (sf_ColliderInit_Actor, f_ColliderInit_Actor) + return (sf_ColliderInitToActor, f_ColliderInitToActor) return None def GetColliderStr(data, off, type): @@ -76,9 +229,15 @@ def GetColliderStr(data, off, type): else: cBase[0] = '0x{0:02X}'.format(cBase[0]) - i = 4 + cBase[1] = GetATflags(cBase[1]) + cBase[2] = GetACflags(cBase[2]) + cBase[3] = GetOCflags(cBase[3]) + if type == T_DEFAULT: + cBase[4] = GetOCtype(cBase[4]) i = 5 + else: + i = 4 if cBase[i] < 4: cBase[i] = SHAPE_ENUM[cBase[i]] @@ -91,8 +250,18 @@ def GetItems(data, off, count, structf, fmt, size): result = '' for i in range(count): ioff = (i * size) - cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + ioff) + cBody = list(struct.unpack_from(sf_ColliderBodyInit, data, off + ioff)) cItem = struct.unpack_from(structf, data, off + 0x18 + ioff) + + if cBody[0] < 7: + cBody[0] = ELEMTYPE_UNKENUM[cBody[0]] + else: + cBody[0] = '0x{0:02X}'.format(cBody[0]) + + cBody[7] = GetToucherFlags(cBody[7]) + cBody[8] = GetBumperFlags(cBody[8]) + cBody[9] = GetOcElemFlags(cBody[9]) + result += ''' {{ {0}, @@ -100,10 +269,10 @@ def GetItems(data, off, count, structf, fmt, size): }},'''.format(f_ColliderBodyInit.format(*cBody), fmt.format(*cItem)) return result -def GetJntSphItems(data, off, count): - items = GetItems(data, off, count, sf_JntSphItem, f_JntSphItem, 0x24) - print(''' -static ColliderJntSphItemInit sJntSphItemsInit[{0}] = {{{1} +def GetJntSphElements(data, off, count): + items = GetItems(data, off, count, sf_JntSphElement, f_JntSphElement, 0x24) + return(''' +static ColliderJntSphElementInit sJntSphElementsInit[{0}] = {{{1} }}; '''.format(count, items)) @@ -111,79 +280,147 @@ def GetJntSph(data, off, type): sBase = GetColliderStr(data, off, type) cJntSph = struct.unpack_from(sf_JntSph, data, off + 8) - print(''' -static ColliderJntSphInit{0} sJntSphInit = -{{ + return(''' +static ColliderJntSphInit{0} sJntSphInit = {{ {1}, {2}, }}; - '''.format(type, sBase, f_JntSph.format(*cJntSph))) +'''.format(type, sBase, f_JntSph.format(*cJntSph))) -def GetTrisItems(data, off, count): - items = GetItems(data, off, count, sf_TrisItem, f_TrisItem, 0x3C) - print(''' -static ColliderTrisItemInit sTrisItemsInit[{0}] = {{{1} +def GetTrisElements(data, off, count): + items = GetItems(data, off, count, sf_TrisElement, f_TrisElement, 0x3C) + return(''' +static ColliderTrisElementInit sTrisElementsInit[{0}] = {{{1} }}; '''.format(count, items)) def GetCylinder(data, off, type): sBase = GetColliderStr(data, off, type) - cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08) + cBody = list(struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08)) cCyl16 = struct.unpack_from(sf_Cylinder16, data, off + 0x20) - print(''' -static ColliderCylinderInit{0} sCylinderInit = -{{ + if cBody[0] < 7: + cBody[0] = ELEMTYPE_UNKENUM[cBody[0]] + else: + cBody[0] = '0x{0:02X}'.format(cBody[0]) + + cBody[7] = GetToucherFlags(cBody[7]) + cBody[8] = GetBumperFlags(cBody[8]) + cBody[9] = GetOcElemFlags(cBody[9]) + + return(''' +static ColliderCylinderInit{0} sCylinderInit = {{ {1}, {2}, {3}, }}; - '''.format(type, sBase, f_ColliderBodyInit.format(*cBody),f_Cylinder16.format(*cCyl16))) +'''.format(type,sBase,f_ColliderBodyInit.format(*cBody),f_Cylinder16.format(*cCyl16))) def GetTris(data, off, type): sBase = GetColliderStr(data, off, type) cTris = struct.unpack_from(sf_Tris, data, off + 8) - print(''' -static ColliderTrisInit{0} sTrisInit = -{{ + return(''' +static ColliderTrisInit{0} sTrisInit = {{ {1}, {2}, }}; - '''.format(type, sBase, f_Tris.format(*cTris))) +'''.format(type, sBase, f_Tris.format(*cTris))) def GetQuad(data, off, type): sBase = GetColliderStr(data, off, type) - cBody = struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08) + cBody = list(struct.unpack_from(sf_ColliderBodyInit, data, off + 0x08)) cQuad = struct.unpack_from(sf_Quad, data, off + 0x20) - print(''' -static ColliderQuadInit{0} sQuadInit = -{{ + + if cBody[0] < 7: + cBody[0] = ELEMTYPE_UNKENUM[cBody[0]] + else: + cBody[0] = '0x{0:02X}'.format(cBody[0]) + + cBody[7] = GetToucherFlags(cBody[7]) + cBody[8] = GetBumperFlags(cBody[8]) + cBody[9] = GetOcElemFlags(cBody[9]) + + return(''' +static ColliderQuadInit{0} sQuadInit = {{ {1}, {2}, {3}, }}; - '''.format(type, sBase, f_ColliderBodyInit.format(*cBody), f_Quad.format(*cQuad))) +'''.format(type, sBase, f_ColliderBodyInit.format(*cBody), f_Quad.format(*cQuad))) -TYPE_DICT = { - 'ColliderJntSphInit' : (GetJntSph, 'Shape', T_DEFAULT), - 'ColliderCylinderInit' : (GetCylinder, 'Shape', T_DEFAULT), - 'ColliderTrisInit': (GetTris, 'Shape', T_DEFAULT), - 'ColliderQuadInit': (GetQuad, 'Shape', T_DEFAULT), - 'ColliderJntSphItemInit' : (GetJntSphItems, 'Item'), - 'ColliderTrisItemInit' : (GetTrisItems, 'Item') -} +def GetColliderInit(address, type, num, path): + TYPE_DICT = { + 'ColliderJntSphInit' : (GetJntSph, 'Shape', T_DEFAULT), + 'ColliderCylinderInit' : (GetCylinder, 'Shape', T_DEFAULT), + 'ColliderTrisInit': (GetTris, 'Shape', T_DEFAULT), + 'ColliderQuadInit': (GetQuad, 'Shape', T_DEFAULT), + 'ColliderJntSphElementInit' : (GetJntSphElements, 'Item'), + 'ColliderTrisElementInit' : (GetTrisElements, 'Item') + } + + update = [(k, v[0]) for k,v in TYPE_DICT.items() if v[1] == 'Shape'] + for i in update: + for j in (TType1, T_ACTOR): + TYPE_DICT[i[0] + j] = (i[1], 'Shape', j) + + fileResult = None + + if address >= 0x80000000: + fileResult = GetFromVRam(address) + else: + fileResult = GetFromRom(address) + + if fileResult is None: + return("Invalid address") + + print(fileResult) + + selectedType = TYPE_DICT[type] + arg2 = None + if selectedType[1] == 'Shape': + arg2 = selectedType[2] + elif num > 0: + arg2 = num + else: + return("ItemInit type must specify number of elements") + + ovlFile = open(path + "/baserom/" + fileResult.name, "rb") + ovlData = bytearray(ovlFile.read()) + ovlFile.close() + + return selectedType[0](ovlData, fileResult.offset, arg2) + +def GetColliderInitFull(address, type, num, path): + if(type.find('Element') != -1): + return GetColliderInit(address, type, num, path) + + base = GetColliderInit(address, type, 0, path) + + if(type.find('JntSph') != -1): + [num, address2, dummy] = base.split('\n')[3].split(',') + hexaddress = int(address2.strip(' D_'), 16) + if(hexaddress == 0): + return base.replace(address2,' NULL') + else: + elements = GetColliderInit(hexaddress, 'ColliderJntSphElementInit', int(num), path) + return elements + base.replace(address2,' sJntSphElementsInit') + elif(type.find('Tris') != -1): + [num, address2, dummy] = base.split('\n')[3].split(',') + hexaddress = int(address2.strip(' D_'), 16) + if(hexaddress == 0): + return base.replace(address2,' NULL') + else: + elements = GetColliderInit(hexaddress, 'ColliderTrisElementInit', int(num), path) + return elements + base.replace(address2,' sTrisElementsInit') + else: + return base -update = [(k, v[0]) for k,v in TYPE_DICT.items() if v[1] == 'Shape'] -for i in update: - for j in (T_SET3, T_ACTOR): - TYPE_DICT[i[0] + j] = (i[1], 'Shape', j) - #ovlName = 'ovl_Obj_Comb' -#address = 0x000780 -#inputType = 'ColliderJntSphItemInit' +#address = 0x000780 +#inputType = 'ColliderJntSphElementInit' #ovlName = 'ovl_En_Boom' #address = 0x0007D0 @@ -201,33 +438,40 @@ parser.add_argument('num', nargs='?', default=0, type=HexParse, help="Number of args = parser.parse_args() -fileResult = None +scriptDir = os.path.dirname(os.path.realpath(__file__)) -if args.address >= 0x80000000: - fileResult = GetFromVRam(args.address) -else: - fileResult = GetFromRom(args.address) +repo = scriptDir + os.sep + ".." + os.sep + ".." -if fileResult is None: - print("Invalid address") - exit() +print(GetColliderInitFull(args.address, args.type, args.num, repo)) +# print(GetColliderInit(args.address, args.type, args.num, "../..")) -print(fileResult) +# fileResult = None -selectedType = TYPE_DICT[args.type] -arg2 = None -if selectedType[1] == 'Shape': - arg2 = selectedType[2] -elif args.num > 0: - arg2 = args.num -else: - print("ItemInit type must specify number of elements") - exit() +# if args.address >= 0x80000000: +# fileResult = GetFromVRam(args.address) +# else: +# fileResult = GetFromRom(args.address) -script_dir = os.path.dirname(os.path.realpath(__file__)) +# if fileResult is None: +# print("Invalid address") +# exit() -ovlFile = open(script_dir + "/../../baserom/" + fileResult.name, "rb") -ovlData = bytearray(ovlFile.read()) -ovlFile.close() +# print(fileResult) -selectedType[0](ovlData, fileResult.offset, arg2) +# selectedType = TYPE_DICT[args.type] +# arg2 = None +# if selectedType[1] == 'Shape': +# arg2 = selectedType[2] +# elif args.num > 0: +# arg2 = args.num +# else: +# print("ItemInit type must specify number of elements") +# exit() + +# script_dir = os.path.dirname(os.path.realpath(__file__)) + +# ovlFile = open(script_dir + "/../../baserom/" + fileResult.name, "rb") +# ovlData = bytearray(ovlFile.read()) +# ovlFile.close() + +# selectedType[0](ovlData, fileResult.offset, arg2) diff --git a/tools/overlayhelpers/damage_table.py b/tools/overlayhelpers/damage_table.py new file mode 100644 index 0000000000..3dedb31545 --- /dev/null +++ b/tools/overlayhelpers/damage_table.py @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 + +import os +import argparse +from filemap import FileResult, GetFromVRam, GetFromRom + +damage_types = [ + 'Deku nut', + 'Deku stick', + 'Slingshot', + 'Explosive', + 'Boomerang', + 'Normal arrow', + 'Hammer swing', + 'Hookshot', + 'Kokiri sword', + 'Master sword', + "Giant's Knife", + 'Fire arrow', + 'Ice arrow', + 'Light arrow', + 'Unk arrow 1', + 'Unk arrow 2', + 'Unk arrow 3', + 'Fire magic', + 'Ice magic', + 'Light magic', + 'Shield', + 'Mirror Ray', + 'Kokiri spin', + 'Giant spin', + 'Master spin', + 'Kokiri jump', + 'Giant jump', + 'Master jump', + 'Unknown 1', + 'Unblockable', + 'Hammer jump', + 'Unknown 2' +] + +def convert_dmg_table_str(dmg_table_str): + split_data = dmg_table_str.replace(' ','').replace('\n','').replace('{',',').replace('}',',').split(',') + hex_data = [int(x, 16) for x in split_data if '0x' in x] + + name = dmg_table_str.split('=')[0].split()[-1] + + return make_table(name, hex_data) + +def replace_damage_table_all(repo): + actors = 'src' + os.sep + 'overlays' + os.sep + 'actors' + for subdir, dirs, files in os.walk(repo + os.sep + actors): + for filename in files: + if(filename.endswith('.c')): + file = subdir + os.sep + filename + status = replace_damage_table(file) + if(status < 0): + print('Encountered error in', file) + elif(status > 0): + print('Updated', status, 'table' + ('s' if status > 1 else ''), file) + return 1 + +def replace_damage_table(src): + with open(src, 'r', encoding = 'utf-8') as srcfile: + srcdata = srcfile.readlines() + read_table = False + replacements = [] + + for i, line in enumerate(srcdata): + if("DamageTable" in line and "= {" in line): + if(read_table): + print('Bad formatting in', file, 'at line', i) + return -1 + else: + read_table = True + start = i + + if(read_table and "DMG_" in line): + read_table = False + + if(read_table and ";" in line): + dmg_table_str = "".join(srcdata[start:i+1]) + damage_table = convert_dmg_table_str(dmg_table_str) + replacements += [[dmg_table_str, damage_table]] + read_table = False + + if len(replacements) == 0: + return 0 + + with open(src,'r', encoding = 'utf-8') as srcfile: + srcstr = srcfile.read() + for replace in replacements: + srcstr = srcstr.replace(replace[0], replace[1]) + with open(src,'w', encoding = 'utf-8', newline = '\n') as outfile: + outfile.write(srcstr) + return len(replacements) + +def make_table(name, data): + damage_table = "DamageTable " + name + " = {\n" + linestart = " /* " + padlen = max([len(x) for x in damage_types]) + for i, dbyte in enumerate(data): + typestr = damage_types[i] + typestr += ' ' * (padlen - len(typestr)) + ' */ ' + damage_table += linestart + typestr + format_damage_byte(dbyte) + damage_table += '};\n' + + return damage_table + +def format_damage_byte(dbyte): + effect = (dbyte >> 4) & 0xF + damage = dbyte & 0xF + + effstr = format(effect, 'X') + dstr = str(damage) + + dtentry = 'DMG_ENTRY(' + dstr + ' , 0x' + effstr + '),\n' + + return dtentry + +def get_damage_bytes(address, repo): + file_result = None + + if address >= 0x80000000: + file_result = GetFromVRam(address) + else: + file_result = GetFromRom(address) + + if file_result is None: + print("Invalid address") + exit() + + print(file_result) + + with open(repo + os.sep + "baserom" + os.sep + file_result.name, "rb") as ovl_file: + ovl_data = bytearray(ovl_file.read()) + + damage_data = ovl_data[file_result.offset:file_result.offset+0x20] + + damage_table = make_table('D_' + format(address, 'X'), damage_data) + + return damage_table + +def hex_parse(s): + return int(s, 16) + +parser = argparse.ArgumentParser(description = "Converts raw bytes into a formatted damage table") +parser.add_argument('-a', metavar='address', dest='address', help="VRam or Rom address of the damage table", type=hex_parse) +parser.add_argument('-f', metavar='file', dest='file', help='C file with unformatted damage tables') + +if __name__ == "__main__": + args = parser.parse_args() + script_dir = os.path.dirname(os.path.realpath(__file__)) + repo = script_dir + os.sep + ".." + os.sep + ".." + if(args.address): + print(get_damage_bytes(args.address, repo)) + elif(args.file): + replace_damage_table(args.file) + else: + print('Error: address or file required. Use -h for more detail.')