From ac12cf13214d39c890bb089c88d9e81d391fbf6b Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Sun, 2 Oct 2022 00:38:39 +0300 Subject: [PATCH] Add CDamageVulnerability.cpp, fill header Former-commit-id: dc47a3af22c1e50ff116781902ff715f02c58395 --- asm/MetroidPrime/CDamageInfo.s | 4 +- asm/MetroidPrime/CDamageVulnerability.s | 12 +- asm/MetroidPrime/CGameProjectile.s | 2 +- asm/MetroidPrime/CStateManager.s | 7 +- asm/MetroidPrime/Enemies/CBabygoth.s | 2 +- asm/MetroidPrime/Enemies/CBeetle.s | 6 +- asm/MetroidPrime/Enemies/CBloodFlower.s | 2 +- asm/MetroidPrime/Enemies/CBurrower.s | 2 +- asm/MetroidPrime/Enemies/CEyeBall.s | 4 +- asm/MetroidPrime/Enemies/CGrenadeLauncher.s | 2 +- asm/MetroidPrime/Enemies/CMagdolite.s | 4 +- asm/MetroidPrime/Enemies/CMetroid.s | 14 +- asm/MetroidPrime/Enemies/CMetroidBeta.s | 2 +- asm/MetroidPrime/Enemies/CMetroidPrimeExo.s | 2 +- asm/MetroidPrime/Enemies/CPatterned.s | 4 +- asm/MetroidPrime/Enemies/CRidley.s | 4 +- asm/MetroidPrime/Enemies/CSpacePirate.s | 10 +- asm/MetroidPrime/Enemies/CThardus.s | 2 +- asm/MetroidPrime/Enemies/CTryclops.s | 2 +- asm/MetroidPrime/Enemies/CWallCrawlerSwarm.s | 2 +- asm/MetroidPrime/ScriptObjects/CScriptActor.s | 2 +- .../ScriptObjects/CScriptDamageableTrigger.s | 2 +- .../ScriptObjects/CScriptTrigger.s | 2 +- asm/MetroidPrime/Weapons/CEnergyProjectile.s | 2 +- asm/MetroidPrime/Weapons/CNewFlameThrower.s | 2 +- include/MetroidPrime/CDamageVulnerability.hpp | 40 ++- include/MetroidPrime/Weapons/WeaponTypes.hpp | 51 ++++ src/MetroidPrime/CDamageVulnerability.cpp | 236 ++++++++++++++++++ 28 files changed, 372 insertions(+), 54 deletions(-) create mode 100644 include/MetroidPrime/Weapons/WeaponTypes.hpp create mode 100644 src/MetroidPrime/CDamageVulnerability.cpp diff --git a/asm/MetroidPrime/CDamageInfo.s b/asm/MetroidPrime/CDamageInfo.s index b9b9810d..8f727d3a 100644 --- a/asm/MetroidPrime/CDamageInfo.s +++ b/asm/MetroidPrime/CDamageInfo.s @@ -54,7 +54,7 @@ GetRadiusDamage__11CDamageInfoCFRC20CDamageVulnerability: /* 800C34AC 000C040C 7C 7F 1B 78 */ mr r31, r3 /* 800C34B0 000C0410 7C 83 23 78 */ mr r3, r4 /* 800C34B4 000C0414 7F E4 FB 78 */ mr r4, r31 -/* 800C34B8 000C0418 48 03 F0 05 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800C34B8 000C0418 48 03 F0 05 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 800C34BC 000C041C 2C 03 00 02 */ cmpwi r3, 2 /* 800C34C0 000C0420 40 82 00 0C */ bne lbl_800C34CC /* 800C34C4 000C0424 C0 22 8E 04 */ lfs f1, lbl_805AAB24@sda21(r2) @@ -85,7 +85,7 @@ GetDamage__11CDamageInfoCFRC20CDamageVulnerability: /* 800C3510 000C0470 7C 7F 1B 78 */ mr r31, r3 /* 800C3514 000C0474 7C 83 23 78 */ mr r3, r4 /* 800C3518 000C0478 7F E4 FB 78 */ mr r4, r31 -/* 800C351C 000C047C 48 03 EF A1 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800C351C 000C047C 48 03 EF A1 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 800C3520 000C0480 2C 03 00 02 */ cmpwi r3, 2 /* 800C3524 000C0484 40 82 00 0C */ bne lbl_800C3530 /* 800C3528 000C0488 C0 22 8E 04 */ lfs f1, lbl_805AAB24@sda21(r2) diff --git a/asm/MetroidPrime/CDamageVulnerability.s b/asm/MetroidPrime/CDamageVulnerability.s index f71a926c..bfaa67f7 100644 --- a/asm/MetroidPrime/CDamageVulnerability.s +++ b/asm/MetroidPrime/CDamageVulnerability.s @@ -30,8 +30,8 @@ lbl_801024B4: /* 801024B4 000FF414 80 63 00 5C */ lwz r3, 0x5c(r3) /* 801024B8 000FF418 4E 80 00 20 */ blr -.global GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode -GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode: +.global GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei +GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei: /* 801024BC 000FF41C 80 E4 00 00 */ lwz r7, 0(r4) /* 801024C0 000FF420 2C 07 00 00 */ cmpwi r7, 0 /* 801024C4 000FF424 41 80 00 0C */ blt lbl_801024D0 @@ -214,8 +214,8 @@ lbl_80102700: /* 80102700 000FF660 38 60 00 01 */ li r3, 1 /* 80102704 000FF664 4E 80 00 20 */ blr -.global WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode -WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode: +.global WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei +WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei: /* 80102708 000FF668 80 E4 00 00 */ lwz r7, 0(r4) /* 8010270C 000FF66C 2C 07 00 00 */ cmpwi r7, 0 /* 80102710 000FF670 41 80 00 0C */ blt lbl_8010271C @@ -376,8 +376,8 @@ lbl_8010292C: /* 8010292C 000FF88C 38 60 00 01 */ li r3, 1 /* 80102930 000FF890 4E 80 00 20 */ blr -.global __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType -__ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType: +.global __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +__ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType: /* 80102934 000FF894 90 83 00 00 */ stw r4, 0(r3) /* 80102938 000FF898 80 01 00 08 */ lwz r0, 8(r1) /* 8010293C 000FF89C 90 A3 00 04 */ stw r5, 4(r3) diff --git a/asm/MetroidPrime/CGameProjectile.s b/asm/MetroidPrime/CGameProjectile.s index dc206e00..54e4e0a8 100644 --- a/asm/MetroidPrime/CGameProjectile.s +++ b/asm/MetroidPrime/CGameProjectile.s @@ -2157,7 +2157,7 @@ CanCollideWith__15CGameProjectileFR6CActorR13CStateManager: /* 800390B0 00036010 4E 80 04 21 */ bctrl /* 800390B4 00036014 38 9D 01 2C */ addi r4, r29, 0x12c /* 800390B8 00036018 38 A0 00 00 */ li r5, 0 -/* 800390BC 0003601C 48 0C 94 01 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800390BC 0003601C 48 0C 94 01 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 800390C0 00036020 2C 03 00 04 */ cmpwi r3, 4 /* 800390C4 00036024 40 82 00 84 */ bne lbl_80039148 /* 800390C8 00036028 A0 0D A3 8C */ lhz r0, kInvalidUniqueId@sda21(r13) diff --git a/asm/MetroidPrime/CStateManager.s b/asm/MetroidPrime/CStateManager.s index 9828b4ac..7edcb380 100644 --- a/asm/MetroidPrime/CStateManager.s +++ b/asm/MetroidPrime/CStateManager.s @@ -5999,7 +5999,7 @@ ApplyKnockBack__13CStateManagerFR6CActorRC11CDamageInfoRC20CDamageVulnerabilityR /* 80048AD4 00045A34 7C C3 33 78 */ mr r3, r6 /* 80048AD8 00045A38 7F 84 E3 78 */ mr r4, r28 /* 80048ADC 00045A3C 38 A0 00 00 */ li r5, 0 -/* 80048AE0 00045A40 48 0B 99 DD */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80048AE0 00045A40 48 0B 99 DD */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80048AE4 00045A44 2C 03 00 02 */ cmpwi r3, 2 /* 80048AE8 00045A48 41 82 01 98 */ beq lbl_80048C80 /* 80048AEC 00045A4C 7F 63 DB 78 */ mr r3, r27 @@ -6605,7 +6605,7 @@ lbl_800493A8: /* 800493A8 00046308 7F 83 E3 78 */ mr r3, r28 /* 800493AC 0004630C 7F 64 DB 78 */ mr r4, r27 /* 800493B0 00046310 38 A0 00 01 */ li r5, 1 -/* 800493B4 00046314 48 0B 93 55 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800493B4 00046314 48 0B 93 55 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 800493B8 00046318 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 800493BC 0004631C 41 82 00 6C */ beq lbl_80049428 /* 800493C0 00046320 7F 63 DB 78 */ mr r3, r27 @@ -7594,7 +7594,7 @@ lbl_8004A21C: /* 8004A228 00047188 41 82 00 18 */ beq lbl_8004A240 /* 8004A22C 0004718C 7F 24 CB 78 */ mr r4, r25 /* 8004A230 00047190 38 A0 00 00 */ li r5, 0 -/* 8004A234 00047194 48 0B 84 D5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8004A234 00047194 48 0B 84 D5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8004A238 00047198 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8004A23C 0004719C 41 82 00 68 */ beq lbl_8004A2A4 lbl_8004A240: @@ -15516,4 +15516,3 @@ lbl_803CCEE0: .asciz "ject list full!" .asciz "DefaultShadow" .balign 4 - diff --git a/asm/MetroidPrime/Enemies/CBabygoth.s b/asm/MetroidPrime/Enemies/CBabygoth.s index 7481c7d4..29b1321f 100644 --- a/asm/MetroidPrime/Enemies/CBabygoth.s +++ b/asm/MetroidPrime/Enemies/CBabygoth.s @@ -6359,7 +6359,7 @@ Shock__9CBabygothFff: /* 80222AC4 0021FA24 4E 80 04 21 */ bctrl /* 80222AC8 0021FA28 38 81 00 14 */ addi r4, r1, 0x14 /* 80222ACC 0021FA2C 38 A0 00 00 */ li r5, 0 -/* 80222AD0 0021FA30 4B ED F9 ED */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80222AD0 0021FA30 4B ED F9 ED */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80222AD4 0021FA34 2C 03 00 01 */ cmpwi r3, 1 /* 80222AD8 0021FA38 41 82 00 34 */ beq lbl_80222B0C /* 80222ADC 0021FA3C 40 80 00 40 */ bge lbl_80222B1C diff --git a/asm/MetroidPrime/Enemies/CBeetle.s b/asm/MetroidPrime/Enemies/CBeetle.s index 9b6b8515..9710305d 100644 --- a/asm/MetroidPrime/Enemies/CBeetle.s +++ b/asm/MetroidPrime/Enemies/CBeetle.s @@ -1456,7 +1456,7 @@ lbl_800E3DBC: /* 800E3DBC 000E0D1C 7F C4 F3 78 */ mr r4, r30 /* 800E3DC0 000E0D20 38 7B 07 44 */ addi r3, r27, 0x744 /* 800E3DC4 000E0D24 38 A0 00 00 */ li r5, 0 -/* 800E3DC8 000E0D28 48 01 E9 41 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800E3DC8 000E0D28 48 01 E9 41 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 800E3DCC 000E0D2C 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 800E3DD0 000E0D30 40 82 00 08 */ bne lbl_800E3DD8 /* 800E3DD4 000E0D34 3B E0 00 45 */ li r31, 0x45 @@ -1735,7 +1735,7 @@ lbl_800E4198: /* 800E41C8 000E1128 90 A1 00 08 */ stw r5, 8(r1) /* 800E41CC 000E112C 38 A0 00 00 */ li r5, 0 /* 800E41D0 000E1130 98 01 00 0C */ stb r0, 0xc(r1) -/* 800E41D4 000E1134 48 01 E2 E9 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800E41D4 000E1134 48 01 E2 E9 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 800E41D8 000E1138 2C 03 00 01 */ cmpwi r3, 1 /* 800E41DC 000E113C 41 82 00 34 */ beq lbl_800E4210 /* 800E41E0 000E1140 40 80 00 40 */ bge lbl_800E4220 @@ -1910,7 +1910,7 @@ lbl_800E4438: /* 800E4468 000E13C8 90 A1 00 08 */ stw r5, 8(r1) /* 800E446C 000E13CC 38 A0 00 00 */ li r5, 0 /* 800E4470 000E13D0 98 01 00 0C */ stb r0, 0xc(r1) -/* 800E4474 000E13D4 48 01 E0 49 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800E4474 000E13D4 48 01 E0 49 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 800E4478 000E13D8 2C 03 00 01 */ cmpwi r3, 1 /* 800E447C 000E13DC 41 82 00 34 */ beq lbl_800E44B0 /* 800E4480 000E13E0 40 80 00 40 */ bge lbl_800E44C0 diff --git a/asm/MetroidPrime/Enemies/CBloodFlower.s b/asm/MetroidPrime/Enemies/CBloodFlower.s index 4b1824c8..378f9aa0 100644 --- a/asm/MetroidPrime/Enemies/CBloodFlower.s +++ b/asm/MetroidPrime/Enemies/CBloodFlower.s @@ -799,7 +799,7 @@ GetCollisionResponseType__12CBloodFlowerCFRC9CVector3fRC9CVector3fRC11CWeaponMod /* 80119330 00116290 4E 80 04 21 */ bctrl /* 80119334 00116294 7F E4 FB 78 */ mr r4, r31 /* 80119338 00116298 38 A0 00 00 */ li r5, 0 -/* 8011933C 0011629C 4B FE 93 CD */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8011933C 0011629C 4B FE 93 CD */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 80119340 001162A0 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 80119344 001162A4 38 60 00 4E */ li r3, 0x4e /* 80119348 001162A8 41 82 00 08 */ beq lbl_80119350 diff --git a/asm/MetroidPrime/Enemies/CBurrower.s b/asm/MetroidPrime/Enemies/CBurrower.s index 40805acb..50359ff1 100644 --- a/asm/MetroidPrime/Enemies/CBurrower.s +++ b/asm/MetroidPrime/Enemies/CBurrower.s @@ -1827,7 +1827,7 @@ __sinit_CBurrower_cpp: /* 802711B0 0026E110 91 61 00 20 */ stw r11, 0x20(r1) /* 802711B4 0026E114 91 61 00 24 */ stw r11, 0x24(r1) /* 802711B8 0026E118 90 01 00 28 */ stw r0, 0x28(r1) -/* 802711BC 0026E11C 4B E9 17 79 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 802711BC 0026E11C 4B E9 17 79 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 802711C0 0026E120 3C 60 80 57 */ lis r3, lbl_80572694@ha /* 802711C4 0026E124 82 21 00 30 */ lwz r17, 0x30(r1) /* 802711C8 0026E128 3A 03 26 94 */ addi r16, r3, lbl_80572694@l diff --git a/asm/MetroidPrime/Enemies/CEyeBall.s b/asm/MetroidPrime/Enemies/CEyeBall.s index c7a7423f..59fb3bc6 100644 --- a/asm/MetroidPrime/Enemies/CEyeBall.s +++ b/asm/MetroidPrime/Enemies/CEyeBall.s @@ -1142,7 +1142,7 @@ lbl_802252D8: /* 80225328 00222288 4E 80 04 21 */ bctrl /* 8022532C 0022228C 38 9F 01 2C */ addi r4, r31, 0x12c /* 80225330 00222290 38 A0 00 00 */ li r5, 0 -/* 80225334 00222294 4B ED D1 89 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80225334 00222294 4B ED D1 89 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80225338 00222298 2C 03 00 02 */ cmpwi r3, 2 /* 8022533C 0022229C 41 82 00 14 */ beq lbl_80225350 /* 80225340 002222A0 88 1B 04 00 */ lbz r0, 0x400(r27) @@ -1177,7 +1177,7 @@ lbl_80225358: /* 802253A8 00222308 4E 80 04 21 */ bctrl /* 802253AC 0022230C 38 9F 01 2C */ addi r4, r31, 0x12c /* 802253B0 00222310 38 A0 00 00 */ li r5, 0 -/* 802253B4 00222314 4B ED D1 09 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 802253B4 00222314 4B ED D1 09 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 802253B8 00222318 2C 03 00 02 */ cmpwi r3, 2 /* 802253BC 0022231C 41 82 00 14 */ beq lbl_802253D0 /* 802253C0 00222320 88 1B 04 00 */ lbz r0, 0x400(r27) diff --git a/asm/MetroidPrime/Enemies/CGrenadeLauncher.s b/asm/MetroidPrime/Enemies/CGrenadeLauncher.s index 01db36e6..5ff9b8bb 100644 --- a/asm/MetroidPrime/Enemies/CGrenadeLauncher.s +++ b/asm/MetroidPrime/Enemies/CGrenadeLauncher.s @@ -1535,7 +1535,7 @@ Touch__16CGrenadeLauncherFR6CActorR13CStateManager: /* 80230A44 0022D9A4 98 C1 00 20 */ stb r6, 0x20(r1) /* 80230A48 0022D9A8 50 E0 2E B4 */ rlwimi r0, r7, 5, 0x1a, 0x1a /* 80230A4C 0022D9AC 98 01 00 20 */ stb r0, 0x20(r1) -/* 80230A50 0022D9B0 4B ED 1C B9 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80230A50 0022D9B0 4B ED 1C B9 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 80230A54 0022D9B4 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 80230A58 0022D9B8 41 82 00 44 */ beq lbl_80230A9C /* 80230A5C 0022D9BC C0 02 B6 94 */ lfs f0, lbl_805AD3B4@sda21(r2) diff --git a/asm/MetroidPrime/Enemies/CMagdolite.s b/asm/MetroidPrime/Enemies/CMagdolite.s index 300db5cc..55929039 100644 --- a/asm/MetroidPrime/Enemies/CMagdolite.s +++ b/asm/MetroidPrime/Enemies/CMagdolite.s @@ -2923,7 +2923,7 @@ lbl_80236AB0: /* 80236B04 00233A64 38 7C 05 BC */ addi r3, r28, 0x5bc /* 80236B08 00233A68 38 9B 01 2C */ addi r4, r27, 0x12c /* 80236B0C 00233A6C 38 A0 00 00 */ li r5, 0 -/* 80236B10 00233A70 4B EC B9 AD */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80236B10 00233A70 4B EC B9 AD */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80236B14 00233A74 2C 03 00 02 */ cmpwi r3, 2 /* 80236B18 00233A78 41 82 00 30 */ beq lbl_80236B48 /* 80236B1C 00233A7C 88 1C 04 00 */ lbz r0, 0x400(r28) @@ -2967,7 +2967,7 @@ lbl_80236BAC: /* 80236BAC 00233B0C 38 7C 06 24 */ addi r3, r28, 0x624 /* 80236BB0 00233B10 38 9B 01 2C */ addi r4, r27, 0x12c /* 80236BB4 00233B14 38 A0 00 00 */ li r5, 0 -/* 80236BB8 00233B18 4B EC B9 05 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80236BB8 00233B18 4B EC B9 05 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80236BBC 00233B1C 2C 03 00 02 */ cmpwi r3, 2 /* 80236BC0 00233B20 41 82 00 14 */ beq lbl_80236BD4 /* 80236BC4 00233B24 88 1C 04 00 */ lbz r0, 0x400(r28) diff --git a/asm/MetroidPrime/Enemies/CMetroid.s b/asm/MetroidPrime/Enemies/CMetroid.s index 1bffe19f..f4fdf3ba 100644 --- a/asm/MetroidPrime/Enemies/CMetroid.s +++ b/asm/MetroidPrime/Enemies/CMetroid.s @@ -8362,7 +8362,7 @@ lbl_8017136C: /* 8017136C 0016E2CC 7F 63 DB 78 */ mr r3, r27 /* 80171370 0016E2D0 7F E4 FB 78 */ mr r4, r31 /* 80171374 0016E2D4 38 A0 00 00 */ li r5, 0 -/* 80171378 0016E2D8 4B F9 13 91 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80171378 0016E2D8 4B F9 13 91 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8017137C 0016E2DC 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 80171380 0016E2E0 41 82 00 50 */ beq lbl_801713D0 /* 80171384 0016E2E4 80 7E 09 00 */ lwz r3, 0x900(r30) @@ -8494,7 +8494,7 @@ GetCollisionResponseType__8CMetroidCFRC9CVector3fRC9CVector3fRC11CWeaponModei: /* 80171548 0016E4A8 4E 80 04 21 */ bctrl /* 8017154C 0016E4AC 7F A4 EB 78 */ mr r4, r29 /* 80171550 0016E4B0 38 A0 00 00 */ li r5, 0 -/* 80171554 0016E4B4 4B F9 11 B5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80171554 0016E4B4 4B F9 11 B5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 80171558 0016E4B8 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8017155C 0016E4BC 40 82 00 10 */ bne lbl_8017156C /* 80171560 0016E4C0 28 1E 00 00 */ cmplwi r30, 0 @@ -9850,7 +9850,7 @@ __sinit_CMetroid_cpp: /* 8017289C 0016F7FC 91 61 00 20 */ stw r11, 0x20(r1) /* 801728A0 0016F800 91 61 00 24 */ stw r11, 0x24(r1) /* 801728A4 0016F804 90 01 00 28 */ stw r0, 0x28(r1) -/* 801728A8 0016F808 4B F9 00 8D */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 801728A8 0016F808 4B F9 00 8D */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 801728AC 0016F80C 39 60 00 02 */ li r11, 2 /* 801728B0 0016F810 3C 60 80 57 */ lis r3, lbl_80571E6C@ha /* 801728B4 0016F814 91 61 00 08 */ stw r11, 8(r1) @@ -9872,7 +9872,7 @@ __sinit_CMetroid_cpp: /* 801728F4 0016F854 91 61 00 20 */ stw r11, 0x20(r1) /* 801728F8 0016F858 91 61 00 24 */ stw r11, 0x24(r1) /* 801728FC 0016F85C 90 01 00 28 */ stw r0, 0x28(r1) -/* 80172900 0016F860 4B F9 00 35 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 80172900 0016F860 4B F9 00 35 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 80172904 0016F864 39 60 00 02 */ li r11, 2 /* 80172908 0016F868 3C 60 80 57 */ lis r3, lbl_80571ED4@ha /* 8017290C 0016F86C 91 61 00 08 */ stw r11, 8(r1) @@ -9894,7 +9894,7 @@ __sinit_CMetroid_cpp: /* 8017294C 0016F8AC 91 61 00 20 */ stw r11, 0x20(r1) /* 80172950 0016F8B0 91 61 00 24 */ stw r11, 0x24(r1) /* 80172954 0016F8B4 90 01 00 28 */ stw r0, 0x28(r1) -/* 80172958 0016F8B8 4B F8 FF DD */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 80172958 0016F8B8 4B F8 FF DD */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 8017295C 0016F8BC 39 60 00 02 */ li r11, 2 /* 80172960 0016F8C0 3C 60 80 57 */ lis r3, lbl_80571F3C@ha /* 80172964 0016F8C4 91 61 00 08 */ stw r11, 8(r1) @@ -9916,7 +9916,7 @@ __sinit_CMetroid_cpp: /* 801729A4 0016F904 91 61 00 20 */ stw r11, 0x20(r1) /* 801729A8 0016F908 91 61 00 24 */ stw r11, 0x24(r1) /* 801729AC 0016F90C 90 01 00 28 */ stw r0, 0x28(r1) -/* 801729B0 0016F910 4B F8 FF 85 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 801729B0 0016F910 4B F8 FF 85 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 801729B4 0016F914 39 60 00 02 */ li r11, 2 /* 801729B8 0016F918 3C 60 80 57 */ lis r3, lbl_80571FA4@ha /* 801729BC 0016F91C 91 61 00 08 */ stw r11, 8(r1) @@ -9937,7 +9937,7 @@ __sinit_CMetroid_cpp: /* 801729F8 0016F958 91 61 00 20 */ stw r11, 0x20(r1) /* 801729FC 0016F95C 91 61 00 24 */ stw r11, 0x24(r1) /* 80172A00 0016F960 90 01 00 28 */ stw r0, 0x28(r1) -/* 80172A04 0016F964 4B F8 FF 31 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 80172A04 0016F964 4B F8 FF 31 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 80172A08 0016F968 3B A0 00 FE */ li r29, 0xfe /* 80172A0C 0016F96C 39 40 00 D8 */ li r10, 0xd8 /* 80172A10 0016F970 39 2D A4 2C */ addi r9, r13, lbl_805A8FEC@sda21 diff --git a/asm/MetroidPrime/Enemies/CMetroidBeta.s b/asm/MetroidPrime/Enemies/CMetroidBeta.s index 22152f02..6b93c8cd 100644 --- a/asm/MetroidPrime/Enemies/CMetroidBeta.s +++ b/asm/MetroidPrime/Enemies/CMetroidBeta.s @@ -4788,7 +4788,7 @@ GetCollisionResponseType__12CMetroidBetaCFRC9CVector3fRC9CVector3fRC11CWeaponMod /* 801C4D28 001C1C88 4E 80 04 21 */ bctrl /* 801C4D2C 001C1C8C 7F A4 EB 78 */ mr r4, r29 /* 801C4D30 001C1C90 38 A0 00 00 */ li r5, 0 -/* 801C4D34 001C1C94 4B F3 D9 D5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 801C4D34 001C1C94 4B F3 D9 D5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 801C4D38 001C1C98 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 801C4D3C 001C1C9C 40 82 00 10 */ bne lbl_801C4D4C /* 801C4D40 001C1CA0 28 1E 00 00 */ cmplwi r30, 0 diff --git a/asm/MetroidPrime/Enemies/CMetroidPrimeExo.s b/asm/MetroidPrime/Enemies/CMetroidPrimeExo.s index bf585988..77e6576f 100644 --- a/asm/MetroidPrime/Enemies/CMetroidPrimeExo.s +++ b/asm/MetroidPrime/Enemies/CMetroidPrimeExo.s @@ -8726,7 +8726,7 @@ sub_8027827c: /* 80278328 00275288 4E 80 04 21 */ bctrl /* 8027832C 0027528C 38 9E 01 2C */ addi r4, r30, 0x12c /* 80278330 00275290 38 A0 00 00 */ li r5, 0 -/* 80278334 00275294 4B E8 A3 D5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80278334 00275294 4B E8 A3 D5 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 80278338 00275298 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8027833C 0027529C 41 82 01 B8 */ beq lbl_802784F4 /* 80278340 002752A0 C0 02 88 F0 */ lfs f0, lbl_805AA610@sda21(r2) diff --git a/asm/MetroidPrime/Enemies/CPatterned.s b/asm/MetroidPrime/Enemies/CPatterned.s index 7dc83c98..b13b449b 100644 --- a/asm/MetroidPrime/Enemies/CPatterned.s +++ b/asm/MetroidPrime/Enemies/CPatterned.s @@ -2420,7 +2420,7 @@ Shock__10CPatternedFff: /* 80078D50 00075CB0 4E 80 04 21 */ bctrl /* 80078D54 00075CB4 38 81 00 08 */ addi r4, r1, 8 /* 80078D58 00075CB8 38 A0 00 00 */ li r5, 0 -/* 80078D5C 00075CBC 48 08 97 61 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80078D5C 00075CBC 48 08 97 61 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80078D60 00075CC0 2C 03 00 01 */ cmpwi r3, 1 /* 80078D64 00075CC4 41 82 00 34 */ beq lbl_80078D98 /* 80078D68 00075CC8 40 80 00 40 */ bge lbl_80078DA8 @@ -2483,7 +2483,7 @@ Burn__10CPatternedFff: /* 80078E34 00075D94 4E 80 04 21 */ bctrl /* 80078E38 00075D98 38 81 00 08 */ addi r4, r1, 8 /* 80078E3C 00075D9C 38 A0 00 00 */ li r5, 0 -/* 80078E40 00075DA0 48 08 96 7D */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80078E40 00075DA0 48 08 96 7D */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80078E44 00075DA4 2C 03 00 01 */ cmpwi r3, 1 /* 80078E48 00075DA8 41 82 00 34 */ beq lbl_80078E7C /* 80078E4C 00075DAC 40 80 00 40 */ bge lbl_80078E8C diff --git a/asm/MetroidPrime/Enemies/CRidley.s b/asm/MetroidPrime/Enemies/CRidley.s index dd42cda5..e6f563a0 100644 --- a/asm/MetroidPrime/Enemies/CRidley.s +++ b/asm/MetroidPrime/Enemies/CRidley.s @@ -10988,7 +10988,7 @@ __sinit_CRidley_cpp: /* 8025BD40 00258CA0 D0 21 00 34 */ stfs f1, 0x34(r1) /* 8025BD44 00258CA4 91 81 00 38 */ stw r12, 0x38(r1) /* 8025BD48 00258CA8 91 E1 00 28 */ stw r15, 0x28(r1) -/* 8025BD4C 00258CAC 4B EA 6B E9 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 8025BD4C 00258CAC 4B EA 6B E9 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 8025BD50 00258CB0 81 E1 06 78 */ lwz r15, 0x678(r1) /* 8025BD54 00258CB4 3C 60 80 57 */ lis r3, lbl_80572544@ha /* 8025BD58 00258CB8 3A 03 25 44 */ addi r16, r3, lbl_80572544@l @@ -11078,7 +11078,7 @@ __sinit_CRidley_cpp: /* 8025BEA8 00258E08 38 00 00 00 */ li r0, 0 /* 8025BEAC 00258E0C 91 E1 06 B0 */ stw r15, 0x6b0(r1) /* 8025BEB0 00258E10 90 01 00 28 */ stw r0, 0x28(r1) -/* 8025BEB4 00258E14 4B EA 6A 81 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 8025BEB4 00258E14 4B EA 6A 81 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 8025BEB8 00258E18 3C 60 80 57 */ lis r3, lbl_805725AC@ha /* 8025BEBC 00258E1C 83 81 05 C8 */ lwz r28, 0x5c8(r1) /* 8025BEC0 00258E20 3B A3 25 AC */ addi r29, r3, lbl_805725AC@l diff --git a/asm/MetroidPrime/Enemies/CSpacePirate.s b/asm/MetroidPrime/Enemies/CSpacePirate.s index fd2640e3..3b4e7b38 100644 --- a/asm/MetroidPrime/Enemies/CSpacePirate.s +++ b/asm/MetroidPrime/Enemies/CSpacePirate.s @@ -12542,7 +12542,7 @@ lbl_8012AD1C: /* 8012AD68 00127CC8 4E 80 04 21 */ bctrl /* 8012AD6C 00127CCC 38 81 00 64 */ addi r4, r1, 0x64 /* 8012AD70 00127CD0 38 A0 00 00 */ li r5, 0 -/* 8012AD74 00127CD4 4B FD 79 95 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8012AD74 00127CD4 4B FD 79 95 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8012AD78 00127CD8 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8012AD7C 00127CDC 41 82 00 10 */ beq lbl_8012AD8C /* 8012AD80 00127CE0 38 7D 04 60 */ addi r3, r29, 0x460 @@ -12582,7 +12582,7 @@ lbl_8012ADB0: /* 8012AE00 00127D60 90 A1 00 5C */ stw r5, 0x5c(r1) /* 8012AE04 00127D64 38 A0 00 00 */ li r5, 0 /* 8012AE08 00127D68 98 01 00 60 */ stb r0, 0x60(r1) -/* 8012AE0C 00127D6C 4B FD 78 FD */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8012AE0C 00127D6C 4B FD 78 FD */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8012AE10 00127D70 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8012AE14 00127D74 41 82 00 30 */ beq lbl_8012AE44 /* 8012AE18 00127D78 38 A0 00 FE */ li r5, 0xfe @@ -12612,7 +12612,7 @@ lbl_8012AE44: /* 8012AE74 00127DD4 90 A1 00 54 */ stw r5, 0x54(r1) /* 8012AE78 00127DD8 38 A0 00 00 */ li r5, 0 /* 8012AE7C 00127DDC 98 01 00 58 */ stb r0, 0x58(r1) -/* 8012AE80 00127DE0 4B FD 78 89 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8012AE80 00127DE0 4B FD 78 89 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8012AE84 00127DE4 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8012AE88 00127DE8 41 82 00 14 */ beq lbl_8012AE9C /* 8012AE8C 00127DEC 48 21 F1 21 */ bl White__6CColorFv @@ -12634,7 +12634,7 @@ lbl_8012AE9C: /* 8012AEC8 00127E28 50 C0 2E B4 */ rlwimi r0, r6, 5, 0x1a, 0x1a /* 8012AECC 00127E2C 38 A0 00 00 */ li r5, 0 /* 8012AED0 00127E30 98 01 00 50 */ stb r0, 0x50(r1) -/* 8012AED4 00127E34 4B FD 78 35 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8012AED4 00127E34 4B FD 78 35 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8012AED8 00127E38 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8012AEDC 00127E3C 41 82 00 30 */ beq lbl_8012AF0C /* 8012AEE0 00127E40 38 A0 00 FD */ li r5, 0xfd @@ -12664,7 +12664,7 @@ lbl_8012AF0C: /* 8012AF3C 00127E9C 90 A1 00 44 */ stw r5, 0x44(r1) /* 8012AF40 00127EA0 38 A0 00 00 */ li r5, 0 /* 8012AF44 00127EA4 98 01 00 48 */ stb r0, 0x48(r1) -/* 8012AF48 00127EA8 4B FD 77 C1 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 8012AF48 00127EA8 4B FD 77 C1 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 8012AF4C 00127EAC 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8012AF50 00127EB0 41 82 00 28 */ beq lbl_8012AF78 /* 8012AF54 00127EB4 38 00 00 FF */ li r0, 0xff diff --git a/asm/MetroidPrime/Enemies/CThardus.s b/asm/MetroidPrime/Enemies/CThardus.s index 44abf12a..8f671252 100644 --- a/asm/MetroidPrime/Enemies/CThardus.s +++ b/asm/MetroidPrime/Enemies/CThardus.s @@ -8180,7 +8180,7 @@ lbl_801E119C: /* 801E137C 001DE2DC 91 61 00 20 */ stw r11, 0x20(r1) /* 801E1380 001DE2E0 91 61 00 24 */ stw r11, 0x24(r1) /* 801E1384 001DE2E4 90 01 00 28 */ stw r0, 0x28(r1) -/* 801E1388 001DE2E8 4B F2 15 AD */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 801E1388 001DE2E8 4B F2 15 AD */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 801E138C 001DE2EC 90 61 00 08 */ stw r3, 8(r1) /* 801E1390 001DE2F0 38 1F 00 68 */ addi r0, r31, 0x68 /* 801E1394 001DE2F4 3C 60 80 5A */ lis r3, sIdentity__12CTransform4f@ha diff --git a/asm/MetroidPrime/Enemies/CTryclops.s b/asm/MetroidPrime/Enemies/CTryclops.s index 9703af36..67bd659a 100644 --- a/asm/MetroidPrime/Enemies/CTryclops.s +++ b/asm/MetroidPrime/Enemies/CTryclops.s @@ -3909,7 +3909,7 @@ __sinit_CTryclops_cpp: /* 80260F70 0025DED0 91 61 00 20 */ stw r11, 0x20(r1) /* 80260F74 0025DED4 91 61 00 24 */ stw r11, 0x24(r1) /* 80260F78 0025DED8 90 01 00 28 */ stw r0, 0x28(r1) -/* 80260F7C 0025DEDC 4B EA 19 B9 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType +/* 80260F7C 0025DEDC 4B EA 19 B9 */ bl __ct__20CDamageVulnerabilityF14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability14EVulnerability15EDeflectionType /* 80260F80 0025DEE0 80 61 00 30 */ lwz r3, 0x30(r1) /* 80260F84 0025DEE4 3C 80 80 57 */ lis r4, lbl_80572614@ha /* 80260F88 0025DEE8 C0 22 BA 34 */ lfs f1, lbl_805AD754@sda21(r2) diff --git a/asm/MetroidPrime/Enemies/CWallCrawlerSwarm.s b/asm/MetroidPrime/Enemies/CWallCrawlerSwarm.s index dd157403..d64708c7 100644 --- a/asm/MetroidPrime/Enemies/CWallCrawlerSwarm.s +++ b/asm/MetroidPrime/Enemies/CWallCrawlerSwarm.s @@ -1069,7 +1069,7 @@ Touch__17CWallCrawlerSwarmFR6CActorR13CStateManager: /* 801E8278 001E51D8 38 7C 03 C4 */ addi r3, r28, 0x3c4 /* 801E827C 001E51DC 7F 64 DB 78 */ mr r4, r27 /* 801E8280 001E51E0 38 A0 00 00 */ li r5, 0 -/* 801E8284 001E51E4 4B F1 A4 85 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 801E8284 001E51E4 4B F1 A4 85 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 801E8288 001E51E8 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 801E828C 001E51EC 41 82 01 94 */ beq lbl_801E8420 /* 801E8290 001E51F0 7F 44 D3 78 */ mr r4, r26 diff --git a/asm/MetroidPrime/ScriptObjects/CScriptActor.s b/asm/MetroidPrime/ScriptObjects/CScriptActor.s index 6ed7266a..cd3c3d66 100644 --- a/asm/MetroidPrime/ScriptObjects/CScriptActor.s +++ b/asm/MetroidPrime/ScriptObjects/CScriptActor.s @@ -133,7 +133,7 @@ GetCollisionResponseType__12CScriptActorCFRC9CVector3fRC9CVector3fRC11CWeaponMod /* 80075018 00071F78 7F A4 EB 78 */ mr r4, r29 /* 8007501C 00071F7C 7C 7F 1B 78 */ mr r31, r3 /* 80075020 00071F80 38 A0 00 00 */ li r5, 0 -/* 80075024 00071F84 48 08 D4 99 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80075024 00071F84 48 08 D4 99 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80075028 00071F88 2C 03 00 02 */ cmpwi r3, 2 /* 8007502C 00071F8C 40 82 00 2C */ bne lbl_80075058 /* 80075030 00071F90 7F E3 FB 78 */ mr r3, r31 diff --git a/asm/MetroidPrime/ScriptObjects/CScriptDamageableTrigger.s b/asm/MetroidPrime/ScriptObjects/CScriptDamageableTrigger.s index 48b92f3e..7adad342 100644 --- a/asm/MetroidPrime/ScriptObjects/CScriptDamageableTrigger.s +++ b/asm/MetroidPrime/ScriptObjects/CScriptDamageableTrigger.s @@ -164,7 +164,7 @@ GetCollisionResponseType__24CScriptDamageableTriggerCFRC9CVector3fRC9CVector3fRC /* 800FA668 000F75C8 38 A0 00 00 */ li r5, 0 /* 800FA66C 000F75CC 90 01 00 14 */ stw r0, 0x14(r1) /* 800FA670 000F75D0 38 63 01 74 */ addi r3, r3, 0x174 -/* 800FA674 000F75D4 48 00 80 95 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800FA674 000F75D4 48 00 80 95 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 800FA678 000F75D8 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 800FA67C 000F75DC 38 60 00 0F */ li r3, 0xf /* 800FA680 000F75E0 41 82 00 08 */ beq lbl_800FA688 diff --git a/asm/MetroidPrime/ScriptObjects/CScriptTrigger.s b/asm/MetroidPrime/ScriptObjects/CScriptTrigger.s index cc981652..d19c7ecd 100644 --- a/asm/MetroidPrime/ScriptObjects/CScriptTrigger.s +++ b/asm/MetroidPrime/ScriptObjects/CScriptTrigger.s @@ -1032,7 +1032,7 @@ lbl_80076998: /* 800769BC 0007391C 4E 80 04 21 */ bctrl /* 800769C0 00073920 38 9B 01 00 */ addi r4, r27, 0x100 /* 800769C4 00073924 38 A0 00 00 */ li r5, 0 -/* 800769C8 00073928 48 08 BD 41 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponMode +/* 800769C8 00073928 48 08 BD 41 */ bl WeaponHurts__20CDamageVulnerabilityCFRC11CWeaponModei /* 800769CC 0007392C 80 1B 01 00 */ lwz r0, 0x100(r27) /* 800769D0 00073930 7C 7E 1B 78 */ mr r30, r3 /* 800769D4 00073934 2C 00 00 08 */ cmpwi r0, 8 diff --git a/asm/MetroidPrime/Weapons/CEnergyProjectile.s b/asm/MetroidPrime/Weapons/CEnergyProjectile.s index ff78ad7e..01300fc4 100644 --- a/asm/MetroidPrime/Weapons/CEnergyProjectile.s +++ b/asm/MetroidPrime/Weapons/CEnergyProjectile.s @@ -1265,7 +1265,7 @@ Explode__17CEnergyProjectileFRC9CVector3fRC9CVector3f29EWeaponCollisionResponseT /* 80214C9C 00211BFC D0 41 01 28 */ stfs f2, 0x128(r1) /* 80214CA0 00211C00 D0 21 01 2C */ stfs f1, 0x12c(r1) /* 80214CA4 00211C04 D0 01 01 30 */ stfs f0, 0x130(r1) -/* 80214CA8 00211C08 4B EE D8 15 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80214CA8 00211C08 4B EE D8 15 */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80214CAC 00211C0C 7C 7B 1B 78 */ mr r27, r3 /* 80214CB0 00211C10 2C 1B 00 02 */ cmpwi r27, 2 /* 80214CB4 00211C14 40 82 01 58 */ bne lbl_80214E0C diff --git a/asm/MetroidPrime/Weapons/CNewFlameThrower.s b/asm/MetroidPrime/Weapons/CNewFlameThrower.s index 30a09357..b64aa4c9 100644 --- a/asm/MetroidPrime/Weapons/CNewFlameThrower.s +++ b/asm/MetroidPrime/Weapons/CNewFlameThrower.s @@ -395,7 +395,7 @@ sub_80261430: /* 80261464 0025E3C4 4E 80 04 21 */ bctrl /* 80261468 0025E3C8 38 9D 01 2C */ addi r4, r29, 0x12c /* 8026146C 0025E3CC 38 A0 00 00 */ li r5, 0 -/* 80261470 0025E3D0 4B EA 10 4D */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponMode +/* 80261470 0025E3D0 4B EA 10 4D */ bl GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei /* 80261474 0025E3D4 2C 03 00 04 */ cmpwi r3, 4 /* 80261478 0025E3D8 40 82 00 0C */ bne lbl_80261484 /* 8026147C 0025E3DC 38 60 00 00 */ li r3, 0 diff --git a/include/MetroidPrime/CDamageVulnerability.hpp b/include/MetroidPrime/CDamageVulnerability.hpp index bdc31456..5fd5ad6c 100644 --- a/include/MetroidPrime/CDamageVulnerability.hpp +++ b/include/MetroidPrime/CDamageVulnerability.hpp @@ -1,8 +1,10 @@ #ifndef _CDAMAGEVULNERABILITY_HPP #define _CDAMAGEVULNERABILITY_HPP +#include "MetroidPrime/Weapons/WeaponTypes.hpp" #include "types.h" + enum EVulnerability { kVN_Weak, kVN_Normal, @@ -27,11 +29,34 @@ class CInputStream; class CDamageVulnerability { public: CDamageVulnerability(CInputStream& in); - CDamageVulnerability(EVulnerability, EVulnerability, EVulnerability, EVulnerability, - EVulnerability, EVulnerability, EVulnerability, EVulnerability, - EVulnerability, EVulnerability, EDeflectionType); + CDamageVulnerability(EVulnerability power, EVulnerability ice, EVulnerability wave, + EVulnerability plasma, EVulnerability bomb, EVulnerability powerBomb, + EVulnerability missile, EVulnerability boostBall, EVulnerability phazon, + EVulnerability enemyWp1, EVulnerability enemyWp2, EVulnerability enemyWp3, + EVulnerability enemyWp4, EVulnerability v1, EVulnerability v2, + EDeflectionType deflectType); - // TODO + CDamageVulnerability(EVulnerability power, EVulnerability ice, EVulnerability wave, + EVulnerability plasma, EVulnerability bomb, EVulnerability powerBomb, + EVulnerability missile, EVulnerability boostBall, EVulnerability phazon, + EVulnerability enemyWp1, EVulnerability enemyWp2, EVulnerability enemyWp3, + EVulnerability enemyWp4, EVulnerability v1, EVulnerability v2, + EVulnerability chargedPower, EVulnerability chargedIce, + EVulnerability chargedWave, EVulnerability chargedPlasma, + EVulnerability superMissile, EVulnerability iceSpreader, + EVulnerability waveBuster, EVulnerability flameThrower, + EDeflectionType deflected); + + EDeflectionType GetDeflectionType(const CWeaponMode& mode) const; + + bool WeaponHurts(const CWeaponMode&, int ignoreDirect) const; + bool WeaponHits(const CWeaponMode& mode, int checkDirect) const; + EVulnerability GetVulnerability(const CWeaponMode& mode, int ignoreDirect) const; + + static const CDamageVulnerability& NormalVulnerabilty() { return sNormalVulnerability; } + static const CDamageVulnerability& ImmuneVulnerabilty() { return sImmuneVulnerability; } + static const CDamageVulnerability& ReflectVulnerabilty() { return sReflectVulnerability; } + static const CDamageVulnerability& PassThroughVulnerabilty() { return sPassThroughVulnerability; } private: EVulnerability x0_normal[15]; @@ -40,6 +65,13 @@ private: EDeflectionType x5c_deflect; EDeflectionType x60_chargedDeflect; EDeflectionType x64_comboDeflect; + + void LoadData(CInputStream& in, int propCount); + + static const CDamageVulnerability sNormalVulnerability; + static const CDamageVulnerability sImmuneVulnerability; + static const CDamageVulnerability sReflectVulnerability; + static const CDamageVulnerability sPassThroughVulnerability; }; CHECK_SIZEOF(CDamageVulnerability, 0x68) diff --git a/include/MetroidPrime/Weapons/WeaponTypes.hpp b/include/MetroidPrime/Weapons/WeaponTypes.hpp new file mode 100644 index 00000000..05a614a1 --- /dev/null +++ b/include/MetroidPrime/Weapons/WeaponTypes.hpp @@ -0,0 +1,51 @@ +#ifndef _WEAPONTYPES_HPP +#define _WEAPONTYPES_HPP + +enum EWeaponType { + kWT_None = -1, + kWT_Power = 0, + kWT_Ice = 1, + kWT_Wave = 2, + kWT_Plasma = 3, + kWT_Bomb = 4, + kWT_PowerBomb = 5, + kWT_Missile = 6, + kWT_BoostBall = 7, + kWT_Phazon = 8, + kWT_AI = 9, + kWT_PoisonWater = 10, + kWT_Lava = 11, + kWT_Heat = 12, + kWT_Unused1 = 13, + kWT_OrangePhazon = 14, + kWT_Max = 15 +}; + +class CWeaponMode { + EWeaponType x0_weaponType; + bool x4_24_charged : 1; + bool x4_25_comboed : 1; + bool x4_26_instantKill : 1; + +public: + //constexpr CWeaponMode() = default; + explicit CWeaponMode(EWeaponType type = kWT_None, bool charged = false, bool comboed = false, bool instaKill = false) + : x0_weaponType(type), x4_24_charged(charged), x4_25_comboed(comboed), x4_26_instantKill(instaKill) {} + EWeaponType GetType() const { return x0_weaponType; } + + bool IsCharged() const { return x4_24_charged; } + bool IsComboed() const { return x4_25_comboed; } + bool IsInstantKill() const { return x4_26_instantKill; } + + static CWeaponMode Invalid() { return CWeaponMode(kWT_None); } + static CWeaponMode Phazon() { return CWeaponMode(kWT_Phazon); } + static CWeaponMode Plasma() { return CWeaponMode(kWT_Plasma); } + static CWeaponMode Wave() { return CWeaponMode(kWT_Wave); } + static CWeaponMode BoostBall() { return CWeaponMode(kWT_BoostBall); } + static CWeaponMode Ice() { return CWeaponMode(kWT_Ice); } + static CWeaponMode Power() { return CWeaponMode(kWT_Power); } + static CWeaponMode Bomb() { return CWeaponMode(kWT_Bomb); } + static CWeaponMode PowerBomb() { return CWeaponMode(kWT_PowerBomb); } +}; + +#endif diff --git a/src/MetroidPrime/CDamageVulnerability.cpp b/src/MetroidPrime/CDamageVulnerability.cpp new file mode 100644 index 00000000..023b659a --- /dev/null +++ b/src/MetroidPrime/CDamageVulnerability.cpp @@ -0,0 +1,236 @@ +#include "MetroidPrime/CDamageVulnerability.hpp" + +#include "Kyoto/Streams/CInputStream.hpp" +#include "rstl/math.hpp" + +const CDamageVulnerability CDamageVulnerability::sNormalVulnerability( + kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, + kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, + kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kVN_Normal, kDT_None); + +const CDamageVulnerability CDamageVulnerability::sImmuneVulnerability( + kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, + kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, + kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, + kVN_Deflect, kVN_Deflect, kDT_None); + +const CDamageVulnerability CDamageVulnerability::sReflectVulnerability( + kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, + kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, + kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, kVN_Deflect, + kVN_Deflect, kVN_Deflect, kDT_One); + +const CDamageVulnerability CDamageVulnerability::sPassThroughVulnerability( + kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, + kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, + kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, + kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, + kVN_PassThrough, kVN_PassThrough, kVN_PassThrough, kDT_None); + +static inline bool is_deflect_direct(EVulnerability vuln) { + return vuln == kVN_Deflect || (EVulnerability(u32(vuln) - u32(kVN_DirectWeak)) < kVN_Deflect) || + vuln == kVN_DirectImmune; +} + +static inline bool is_normal_or_weak(EVulnerability vuln) { + return vuln == kVN_Weak || vuln == kVN_Normal; +} +static inline bool is_not_deflect(EVulnerability vuln) { return vuln != kVN_Deflect; } + +CDamageVulnerability::CDamageVulnerability(CInputStream& in) { + u32 propCount = in.ReadLong(); + if (propCount == 11) { + for (int i = 0; i < 15; ++i) { + x0_normal[i] = EVulnerability(in.ReadLong()); + } + + x5c_deflect = EDeflectionType(in.ReadLong()); + x3c_charged[0] = x0_normal[0]; + x4c_combo[0] = x0_normal[0]; + x3c_charged[1] = x0_normal[1]; + x4c_combo[1] = x0_normal[1]; + x3c_charged[2] = x0_normal[2]; + x4c_combo[2] = x0_normal[2]; + x3c_charged[3] = x0_normal[3]; + x4c_combo[3] = x0_normal[3]; + } else { + LoadData(in, propCount); + } +} + +void CDamageVulnerability::LoadData(CInputStream& in, int propCount) { + propCount -= 3; + + for (int i = 0; i < rstl::min_val(propCount, 15); ++i) { + x0_normal[i] = EVulnerability(in.ReadLong()); + } + + if (propCount < 15) { + for (int i = propCount; i < 15; ++i) { + x0_normal[i] = kVN_Deflect; + } + } + + for (int i = 15; i < propCount; ++i) { + in.ReadLong(); + } + + x5c_deflect = EDeflectionType(in.ReadLong()); + in.ReadLong(); + for (int i = 0; i < 4; ++i) { + x3c_charged[i] = EVulnerability(in.ReadLong()); + } + + x60_chargedDeflect = EDeflectionType(in.ReadLong()); + in.ReadLong(); + for (int i = 0; i < 4; ++i) { + x4c_combo[i] = EVulnerability(in.ReadLong()); + } + + x64_comboDeflect = EDeflectionType(in.ReadLong()); +} + +CDamageVulnerability::CDamageVulnerability(EVulnerability power, EVulnerability ice, + EVulnerability wave, EVulnerability plasma, + EVulnerability bomb, EVulnerability powerBomb, + EVulnerability missile, EVulnerability boostBall, + EVulnerability phazon, EVulnerability enemyWp1, + EVulnerability enemyWp2, EVulnerability enemyWp3, + EVulnerability enemyWp4, EVulnerability v1, + EVulnerability v2, EDeflectionType deflectType) { + this->x0_normal[0] = power; + this->x0_normal[1] = ice; + this->x0_normal[2] = wave; + this->x0_normal[3] = plasma; + this->x0_normal[4] = bomb; + this->x0_normal[5] = powerBomb; + this->x0_normal[6] = missile; + this->x0_normal[7] = boostBall; + this->x0_normal[8] = phazon; + this->x0_normal[9] = enemyWp1; + this->x0_normal[10] = enemyWp2; + this->x0_normal[0xb] = enemyWp3; + this->x0_normal[0xc] = enemyWp4; + this->x0_normal[0xd] = v1; + this->x0_normal[0xe] = v2; + this->x3c_charged[0] = this->x0_normal[0]; + this->x4c_combo[0] = this->x0_normal[0]; + this->x3c_charged[1] = this->x0_normal[1]; + this->x4c_combo[1] = this->x0_normal[1]; + this->x3c_charged[2] = this->x0_normal[2]; + this->x4c_combo[2] = this->x0_normal[2]; + this->x3c_charged[3] = this->x0_normal[3]; + this->x4c_combo[3] = this->x0_normal[3]; + x5c_deflect = deflectType; +} + +static inline bool check_hurts(EVulnerability vuln, bool direct) { + return direct == 0 + ? (is_normal_or_weak(vuln) || vuln == kVN_DirectWeak || vuln == kVN_DirectNormal) + : is_normal_or_weak(vuln); +} + +bool CDamageVulnerability::WeaponHurts(const CWeaponMode& mode, int ignoreDirect) const { + if (mode.GetType() < kWT_Power || mode.GetType() > kWT_OrangePhazon) { + return false; + } + + if (mode.IsInstantKill()) { + return true; + } + + bool normalHurts = check_hurts(x0_normal[u32(mode.GetType())], ignoreDirect); + bool chargedHurts = (mode.GetType() < kWT_Bomb) + ? check_hurts(x3c_charged[u32(mode.GetType())], ignoreDirect) + : true; + bool comboedHurts = (mode.GetType() < kWT_Bomb) + ? check_hurts(x4c_combo[u32(mode.GetType())], ignoreDirect) + : true; + + return (normalHurts && !mode.IsCharged() && !mode.IsComboed()) || + (chargedHurts && mode.IsCharged()) || (comboedHurts && mode.IsComboed()); +} + +static inline bool check_hits(EVulnerability vuln, int direct) { + if (!direct) { + return is_not_deflect(vuln); + } + if (vuln == kVN_Deflect || + (static_cast< EVulnerability >(static_cast< u32 >(vuln) - + static_cast< u32 >(kVN_DirectWeak)) <= kVN_Normal) || + vuln == kVN_DirectImmune) { + return false; + } + return true; +} + +bool CDamageVulnerability::WeaponHits(const CWeaponMode& mode, int checkDirect) const { + if (mode.GetType() < kWT_Power || mode.GetType() > kWT_OrangePhazon) { + return false; + } + if (mode.IsInstantKill()) { + return true; + } + + bool normalHits = check_hits(x0_normal[u32(mode.GetType())], checkDirect); + bool chargedHits = + mode.GetType() < kWT_Bomb ? check_hits(x3c_charged[u32(mode.GetType())], checkDirect) : true; + bool comboedHits = + mode.GetType() < kWT_Bomb ? check_hits(x4c_combo[u32(mode.GetType())], checkDirect) : true; + bool result = false; + if ((normalHits && !mode.IsCharged() && !mode.IsComboed()) || (chargedHits && mode.IsCharged()) || + (comboedHits && mode.IsComboed())) { + result = true; + } + + return (normalHits && !mode.IsCharged() && !mode.IsComboed()) || + (chargedHits && mode.IsCharged()) || (comboedHits && mode.IsComboed()); +} + +inline EVulnerability direct_to_normal(EVulnerability vuln) { + if (vuln == kVN_DirectWeak) { + return kVN_Weak; + } + if (vuln == kVN_DirectNormal) { + return kVN_Normal; + } + if (vuln == kVN_DirectImmune) { + return kVN_Immune; + } + return vuln; +} + +EVulnerability CDamageVulnerability::GetVulnerability(const CWeaponMode& mode, + int ignoreDirect) const { + if (mode.GetType() < kWT_Power || mode.GetType() > kWT_OrangePhazon) { + return kVN_Deflect; + } + + if (mode.IsInstantKill()) { + return kVN_Normal; + } + + EVulnerability vuln = x0_normal[u32(mode.GetType())]; + EWeaponType type = mode.GetType(); + if (mode.IsCharged()) { + vuln = type < kWT_Bomb ? x3c_charged[u32(type)] : kVN_Normal; + } + + if (mode.IsComboed()) { + vuln = type < kWT_Bomb ? x4c_combo[u32(type)] : kVN_Normal; + } + if (ignoreDirect == 1) { + return vuln; + } + return direct_to_normal(vuln); +} + +EDeflectionType CDamageVulnerability::GetDeflectionType(const CWeaponMode& mode) const { + if (mode.IsCharged()) { + return x60_chargedDeflect; + } + if (mode.IsComboed()) { + return x64_comboDeflect; + } + return x5c_deflect; +}