diff --git a/assets/yaml/jp/rev0/ast_arwing.yaml b/assets/yaml/jp/rev0/ast_arwing.yaml index 45a7f400..89515c40 100644 --- a/assets/yaml/jp/rev0/ast_arwing.yaml +++ b/assets/yaml/jp/rev0/ast_arwing.yaml @@ -56,8 +56,8 @@ D_arwing_3007550: D_arwing_30075D0: { type: TEXTURE, format: RGBA16, offset: 0x30075D0, width: 8, height: 8, ctype: u16, symbol: D_arwing_30075D0 } -D_arwing_3007650: - { type: GFX, offset: 0x3007650, symbol: D_arwing_3007650 } +aArwingItemLasersDL: + { type: GFX, offset: 0x3007650, symbol: aArwingItemLasersDL } ast_arwing_seg3_vtx_7A20: { type: VTX, offset: 0x3007A20, count: 244, symbol: ast_arwing_seg3_vtx_7A20 } diff --git a/assets/yaml/jp/rev0/ast_corneria.yaml b/assets/yaml/jp/rev0/ast_corneria.yaml index 5f7be606..953521ce 100644 --- a/assets/yaml/jp/rev0/ast_corneria.yaml +++ b/assets/yaml/jp/rev0/ast_corneria.yaml @@ -18,8 +18,8 @@ D_CO_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 128, height: 28, offset: 0x6000000, symbol: D_CO_6000000 } -D_CO_6000E00: - { type: GFX, offset: 0x6000E00, symbol: D_CO_6000E00 } +aCoWaterfallDL: + { type: GFX, offset: 0x6000E00, symbol: aCoWaterfallDL } D_CO_60018F8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x060018F8, symbol: D_CO_60018F8 } @@ -48,8 +48,8 @@ D_CO_60059F0: D_CO_6005A80: { type: TEXTURE, ctype: u16, format: RGBA16, width: 64, height: 32, offset: 0x06005A80, symbol: D_CO_6005A80 } -D_CO_6006A80: - { type: GFX, offset: 0x6006A80, symbol: D_CO_6006A80 } +aCoArch3DL: + { type: GFX, offset: 0x6006A80, symbol: aCoArch3DL } D_CO_6006E08: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06006E08, symbol: D_CO_6006E08 } @@ -102,11 +102,11 @@ D_CO_6010250: D_CO_6010F90: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06010F90, symbol: D_CO_6010F90 } -D_CO_6010A50: - { type: GFX, offset: 0x6010A50, symbol: D_CO_6010A50 } +aCoHighway7DL: + { type: GFX, offset: 0x6010A50, symbol: aCoHighway7DL } -D_CO_6010E00: - { type: GFX, offset: 0x6010E00, symbol: D_CO_6010E00 } +aCoHighway5DL: + { type: GFX, offset: 0x6010E00, symbol: aCoHighway5DL } D_CO_6011790: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06011790, symbol: D_CO_6011790 } @@ -123,53 +123,53 @@ D_CO_6012840: D_CO_6012D00: { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x06012D00, symbol: D_CO_6012D00 } -D_CO_60132B0: - { type: GFX, offset: 0x60132B0, symbol: D_CO_60132B0 } +aCoHighway1DL: + { type: GFX, offset: 0x60132B0, symbol: aCoHighway1DL } -D_CO_60137B0: - { type: GFX, offset: 0x60137B0, symbol: D_CO_60137B0 } +aCoArch2DL: + { type: GFX, offset: 0x60137B0, symbol: aCoArch2DL } -D_CO_6013B50: - { type: GFX, offset: 0x6013B50, symbol: D_CO_6013B50 } +aCoRockwallDL: + { type: GFX, offset: 0x6013B50, symbol: aCoRockwallDL } D_CO_6013BE0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06013BE0, symbol: D_CO_6013BE0 } -D_CO_60143E0: - { type: GFX, offset: 0x60143E0, symbol: D_CO_60143E0 } +aCoHighway8DL: + { type: GFX, offset: 0x60143E0, symbol: aCoHighway8DL } -D_CO_6014500: - { type: GFX, offset: 0x6014500, symbol: D_CO_6014500 } +aCoHighway4DL: + { type: GFX, offset: 0x6014500, symbol: aCoHighway4DL } -D_CO_6014670: - { type: GFX, offset: 0x6014670, symbol: D_CO_6014670 } +aCoHighway6DL: + { type: GFX, offset: 0x6014670, symbol: aCoHighway6DL } -D_CO_6014A20: - { type: GFX, offset: 0x6014A20, symbol: D_CO_6014A20 } +aCoHighway9DL: + { type: GFX, offset: 0x6014A20, symbol: aCoHighway9DL } -D_CO_6014B50: - { type: GFX, offset: 0x6014B50, symbol: D_CO_6014B50 } +aCoBuilding3DL: + { type: GFX, offset: 0x6014B50, symbol: aCoBuilding3DL } D_CO_60151A8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x060151A8, symbol: D_CO_60151A8 } -D_CO_60153B0: - { type: GFX, offset: 0x60153B0, symbol: D_CO_60153B0 } +aCoTowerDL: + { type: GFX, offset: 0x60153B0, symbol: aCoTowerDL } -D_CO_6015F00: - { type: GFX, offset: 0x6015F00, symbol: D_CO_6015F00 } +aCoStoneArchDL: + { type: GFX, offset: 0x6015F00, symbol: aCoStoneArchDL } D_CO_6015700: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06015700, symbol: D_CO_6015700 } -D_CO_6016270: - { type: GFX, offset: 0x6016270, symbol: D_CO_6016270 } +aRadarDL: + { type: GFX, offset: 0x6016270, symbol: aRadarDL } -D_CO_60164F0: - { type: GFX, offset: 0x60164F0, symbol: D_CO_60164F0 } +aCoHighway3DL: + { type: GFX, offset: 0x60164F0, symbol: aCoHighway3DL } -D_CO_6016580: - { type: GFX, offset: 0x6016580, symbol: D_CO_6016580 } +aCoBuilding4DL: + { type: GFX, offset: 0x6016580, symbol: aCoBuilding4DL } D_CO_6017F10: { type: GFX, offset: 0x6017F10, symbol: D_CO_6017F10 } @@ -177,8 +177,8 @@ D_CO_6017F10: D_CO_60186E0: { type: GFX, offset: 0x60186E0, symbol: D_CO_60186E0 } -D_CO_6018E80: - { type: GFX, offset: 0x6018E80, symbol: D_CO_6018E80 } +aCoBuilding7DL: + { type: GFX, offset: 0x6018E80, symbol: aCoBuilding7DL } D_CO_60191C8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x060191C8, symbol: D_CO_60191C8 } @@ -195,14 +195,14 @@ D_CO_6019E60: D_CO_601FF58: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601FF58, symbol: D_CO_601FF58 } -D_CO_601A7D0: - { type: GFX, offset: 0x601A7D0, symbol: D_CO_601A7D0 } +aCoBuilding2DL: + { type: GFX, offset: 0x601A7D0, symbol: aCoBuilding2DL } D_CO_601AD60: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601AD60, symbol: D_CO_601AD60 } -D_CO_601B560: - { type: GFX, offset: 0x601B560, symbol: D_CO_601B560 } +aCoBuilding5DL: + { type: GFX, offset: 0x601B560, symbol: aCoBuilding5DL } D_CO_601B640: { type: GFX, offset: 0x601B640, symbol: D_CO_601B640 } @@ -210,14 +210,14 @@ D_CO_601B640: D_CO_601B6C0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601B6C0, symbol: D_CO_601B6C0 } -D_CO_601BEC0: - { type: GFX, offset: 0x601BEC0, symbol: D_CO_601BEC0 } +aCoBump2DL: + { type: GFX, offset: 0x601BEC0, symbol: aCoBump2DL } D_CO_601C1A8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601C1A8, symbol: D_CO_601C1A8 } -D_CO_601C9B0: - { type: GFX, offset: 0x601C9B0, symbol: D_CO_601C9B0 } +aCoTreeDL: + { type: GFX, offset: 0x601C9B0, symbol: aCoTreeDL } D_CO_601CAA0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 64, offset: 0x0601CAA0, symbol: D_CO_601CAA0 } @@ -234,8 +234,8 @@ D_CO_601ED00: D_CO_601F500: { type: GFX, offset: 0x601F500, symbol: D_CO_601F500 } -D_CO_601F5A0: - { type: GFX, offset: 0x601F5A0, symbol: D_CO_601F5A0 } +aCoArch1DL: + { type: GFX, offset: 0x601F5A0, symbol: aCoArch1DL } D_CO_6020760: { type: GFX, offset: 0x6020760, symbol: D_CO_6020760 } @@ -258,8 +258,8 @@ D_CO_6023DE8: D_CO_6024160: { type: GFX, offset: 0x6024160, symbol: D_CO_6024160 } -D_CO_60244A0: - { type: GFX, offset: 0x60244A0, symbol: D_CO_60244A0 } +aCoBump4DL: + { type: GFX, offset: 0x60244A0, symbol: aCoBump4DL } D_CO_60245E0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 44, height: 44, offset: 0x060245E0, symbol: D_CO_60245E0 } @@ -285,14 +285,14 @@ D_CO_6029528: D_CO_6029674: { type: SF64:SKELETON, offset: 0x6029674, symbol: D_CO_6029674 } -D_CO_602991C: - { type: SF64:ANIM, offset: 0x602991C, symbol: D_CO_602991C } +aCoGaruda1Anim: + { type: SF64:ANIM, offset: 0x602991C, symbol: aCoGaruda1Anim } -D_CO_6029A48: - { type: SF64:SKELETON, offset: 0x6029A48, symbol: D_CO_6029A48 } +aCoGarudaSkel: + { type: SF64:SKELETON, offset: 0x6029A48, symbol: aCoGarudaSkel } -D_CO_602A520: - { type: SF64:ANIM, offset: 0x602A520, symbol: D_CO_602A520 } +aCoGaruda3Anim: + { type: SF64:ANIM, offset: 0x602A520, symbol: aCoGaruda3Anim } D_CO_602AA04: { type: SF64:ANIM, offset: 0x602AA04, symbol: D_CO_602AA04 } @@ -300,8 +300,8 @@ D_CO_602AA04: D_CO_602AA7C: { type: SF64:ANIM, offset: 0x602AA7C, symbol: D_CO_602AA7C } -D_CO_602AB48: - { type: SF64:SKELETON, offset: 0x602AB48, symbol: D_CO_602AB48 } +aCoDoorsSkel: + { type: SF64:SKELETON, offset: 0x602AB48, symbol: aCoDoorsSkel } D_CO_602BC18: { type: SF64:ANIM, offset: 0x602BC18, symbol: D_CO_602BC18 } @@ -318,11 +318,11 @@ D_CO_602D31C: D_CO_602D400: { type: SF64:ANIM, offset: 0x602D400, symbol: D_CO_602D400 } -D_CO_602D5AC: - { type: SF64:SKELETON, offset: 0x602D5AC, symbol: D_CO_602D5AC } +aCoCarrierSkel: + { type: SF64:SKELETON, offset: 0x602D5AC, symbol: aCoCarrierSkel } -D_CO_602D5F0: - { type: GFX, offset: 0x602D5F0, symbol: D_CO_602D5F0 } +aCoBuilding1DL: + { type: GFX, offset: 0x602D5F0, symbol: aCoBuilding1DL } D_CO_602DA20: { type: GFX, offset: 0x602DA20, symbol: D_CO_602DA20 } @@ -333,17 +333,17 @@ D_CO_602DCA0: D_CO_602DD40: { type: GFX, offset: 0x602DD40, symbol: D_CO_602DD40 } -D_CO_602E080: - { type: GFX, offset: 0x602E080, symbol: D_CO_602E080 } +aCoHighway2DL: + { type: GFX, offset: 0x602E080, symbol: aCoHighway2DL } -D_CO_602E570: - { type: GFX, offset: 0x602E570, symbol: D_CO_602E570 } +aCoBump5DL: + { type: GFX, offset: 0x602E570, symbol: aCoBump5DL } -D_CO_602E7A0: - { type: GFX, offset: 0x602E7A0, symbol: D_CO_602E7A0 } +aCoBump3DL: + { type: GFX, offset: 0x602E7A0, symbol: aCoBump3DL } -D_CO_602E9E0: - { type: GFX, offset: 0x602E9E0, symbol: D_CO_602E9E0 } +aCoBump1DL: + { type: GFX, offset: 0x602E9E0, symbol: aCoBump1DL } D_CO_602ECB0: { type: GFX, offset: 0x602ECB0, symbol: D_CO_602ECB0 } @@ -351,8 +351,8 @@ D_CO_602ECB0: D_CO_602ED50: { type: TEXTURE, ctype: u16, format: RGBA16, width: 8, height: 16, offset: 0x0602ED50, symbol: D_CO_602ED50 } -D_CO_602F7C0: - { type: GFX, offset: 0x602F7C0, symbol: D_CO_602F7C0 } +aCoPoleDL: + { type: GFX, offset: 0x602F7C0, symbol: aCoPoleDL } D_CO_602F848: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 64, offset: 0x0602F848, symbol: D_CO_602F848 } @@ -408,11 +408,11 @@ D_CO_60355A0: D_CO_6035DA0: { type: GFX, offset: 0x6035DA0, symbol: D_CO_6035DA0 } -D_CO_6035F10: - { type: GFX, offset: 0x6035F10, symbol: D_CO_6035F10 } +aCoBuilding8DL: + { type: GFX, offset: 0x6035F10, symbol: aCoBuilding8DL } -D_CO_60361F0: - { type: GFX, offset: 0x60361F0, symbol: D_CO_60361F0 } +aCoBuilding6DL: + { type: GFX, offset: 0x60361F0, symbol: aCoBuilding6DL } D_CO_60363B0: { type: GFX, offset: 0x60363B0, symbol: D_CO_60363B0 } @@ -435,11 +435,11 @@ D_CO_6036D58: D_CO_6037160: { type: SF64:ENVIRONMENT, offset: 0x6037160, symbol: D_CO_6037160 } -D_CO_60371A4: - { type: SF64:OBJECT_INIT, offset: 0x60371A4, symbol: D_CO_60371A4 } +aCoOnRailsLevelObjects: + { type: SF64:OBJECT_INIT, offset: 0x60371A4, symbol: aCoOnRailsLevelObjects } -D_CO_603B074: - { type: SF64:OBJECT_INIT, offset: 0x603B074, symbol: D_CO_603B074 } +aCoAllRangeLevelObjects: + { type: SF64:OBJECT_INIT, offset: 0x603B074, symbol: aCoAllRangeLevelObjects } D_CO_603D9E8: { type: SF64:SCRIPT, offset: 0x603D9E8, symbol: D_CO_603D9E8 } @@ -448,50 +448,50 @@ D_CO_603D9E8: D_CO_603DC40: { type: SF64:HITBOX, offset: 0x603DC40, symbol: D_CO_603DC40 } -D_CO_603DD40: - { type: SF64:HITBOX, offset: 0x603DD40, symbol: D_CO_603DD40 } +aCoHighway2Hitbox: + { type: SF64:HITBOX, offset: 0x603DD40, symbol: aCoHighway2Hitbox } -D_CO_603DDF0: - { type: SF64:HITBOX, offset: 0x603DDF0, symbol: D_CO_603DDF0 } +aCoBuilding1Hitbox: + { type: SF64:HITBOX, offset: 0x603DDF0, symbol: aCoBuilding1Hitbox } -D_CO_603DCA4: - { type: SF64:HITBOX, offset: 0x603DCA4, symbol: D_CO_603DCA4 } +aCoHighway1Hitbox: + { type: SF64:HITBOX, offset: 0x603DCA4, symbol: aCoHighway1Hitbox } -D_CO_603DE8C: - { type: SF64:HITBOX, offset: 0x603DE8C, symbol: D_CO_603DE8C } +aCoBuilding2Hitbox: + { type: SF64:HITBOX, offset: 0x603DE8C, symbol: aCoBuilding2Hitbox } -D_CO_603DEF4: - { type: SF64:HITBOX, offset: 0x603DEF4, symbol: D_CO_603DEF4 } +aCoBuilding3Hitbox: + { type: SF64:HITBOX, offset: 0x603DEF4, symbol: aCoBuilding3Hitbox } -D_CO_603DF8C: - { type: SF64:HITBOX, offset: 0x603DF8C, symbol: D_CO_603DF8C } +aCoBuilding4Hitbox: + { type: SF64:HITBOX, offset: 0x603DF8C, symbol: aCoBuilding4Hitbox } -D_CO_603DFDC: - { type: SF64:HITBOX, offset: 0x603DFDC, symbol: D_CO_603DFDC } +aCoBuilding5Hitbox: + { type: SF64:HITBOX, offset: 0x603DFDC, symbol: aCoBuilding5Hitbox } -D_CO_603E014: - { type: SF64:HITBOX, offset: 0x603E014, symbol: D_CO_603E014 } +aCoBuilding6Hitbox: + { type: SF64:HITBOX, offset: 0x603E014, symbol: aCoBuilding6Hitbox } -D_CO_603E030: - { type: SF64:HITBOX, offset: 0x603E030, symbol: D_CO_603E030 } +aCoBuilding7Hitbox: + { type: SF64:HITBOX, offset: 0x603E030, symbol: aCoBuilding7Hitbox } -D_CO_603E09C: - { type: SF64:HITBOX, offset: 0x603E09C, symbol: D_CO_603E09C } +aCoBuilding8Hitbox: + { type: SF64:HITBOX, offset: 0x603E09C, symbol: aCoBuilding8Hitbox } -D_CO_603E0EC: - { type: SF64:HITBOX, offset: 0x603E0EC, symbol: D_CO_603E0EC } +aCoWaterfallHitbox: + { type: SF64:HITBOX, offset: 0x603E0EC, symbol: aCoWaterfallHitbox } -D_CO_603E118: - { type: SF64:HITBOX, offset: 0x603E118, symbol: D_CO_603E118 } +aCoTowerHitbox: + { type: SF64:HITBOX, offset: 0x603E118, symbol: aCoTowerHitbox } -D_CO_603E14C: - { type: SF64:HITBOX, offset: 0x603E14C, symbol: D_CO_603E14C } +aCoArch1Hitbox: + { type: SF64:HITBOX, offset: 0x603E14C, symbol: aCoArch1Hitbox } -D_CO_603E1B4: - { type: SF64:HITBOX, offset: 0x603E1B4, symbol: D_CO_603E1B4 } +aCoArch2Hitbox: + { type: SF64:HITBOX, offset: 0x603E1B4, symbol: aCoArch2Hitbox } -D_CO_603E21C: - { type: SF64:HITBOX, offset: 0x603E21C, symbol: D_CO_603E21C } +aCoArch3Hitbox: + { type: SF64:HITBOX, offset: 0x603E21C, symbol: aCoArch3Hitbox } # seems unused D_CO_603E2C0: @@ -501,26 +501,26 @@ D_CO_603E2C0: D_CO_603E2F4: { type: SF64:HITBOX, offset: 0x603E2F4, symbol: D_CO_603E2F4 } -D_CO_603E3E0: - { type: SF64:HITBOX, offset: 0x603E3E0, symbol: D_CO_603E3E0 } +aCoStoneArchHitbox: + { type: SF64:HITBOX, offset: 0x603E3E0, symbol: aCoStoneArchHitbox } -D_CO_603E468: - { type: SF64:HITBOX, offset: 0x603E468, symbol: D_CO_603E468 } +aCoPoleHitbox: + { type: SF64:HITBOX, offset: 0x603E468, symbol: aCoPoleHitbox } -D_CO_603E484: - { type: SF64:HITBOX, offset: 0x603E484, symbol: D_CO_603E484 } +aCoTreeHitbox: + { type: SF64:HITBOX, offset: 0x603E484, symbol: aCoTreeHitbox } -D_CO_603E4A0: - { type: SF64:HITBOX, offset: 0x603E4A0, symbol: D_CO_603E4A0 } +aCoRadarHitbox: + { type: SF64:HITBOX, offset: 0x603E4A0, symbol: aCoRadarHitbox } -D_CO_603E4A4: - { type: SF64:HITBOX, offset: 0x603E4A4, symbol: D_CO_603E4A4 } +aCoBuilding9Hitbox: + { type: SF64:HITBOX, offset: 0x603E4A4, symbol: aCoBuilding9Hitbox } -D_CO_603E4DC: - { type: SF64:HITBOX, offset: 0x603E4DC, symbol: D_CO_603E4DC } +aCoBuilding10Hitbox: + { type: SF64:HITBOX, offset: 0x603E4DC, symbol: aCoBuilding10Hitbox } -D_CO_603E514: - { type: SF64:HITBOX, offset: 0x603E514, symbol: D_CO_603E514 } +aCoIBeamHitbox: + { type: SF64:HITBOX, offset: 0x603E514, symbol: aCoIBeamHitbox } D_CO_603E54C: { type: SF64:HITBOX, offset: 0x603E54C, symbol: D_CO_603E54C } @@ -531,11 +531,11 @@ D_CO_603E598: D_CO_603E5B4: { type: SF64:HITBOX, offset: 0x603E5B4, symbol: D_CO_603E5B4 } -D_CO_603E5D0: - { type: SF64:HITBOX, offset: 0x603E5D0, symbol: D_CO_603E5D0 } +CoGarudaHitbox: + { type: SF64:HITBOX, offset: 0x603E5D0, symbol: CoGarudaHitbox } -D_CO_603E604: - { type: SF64:HITBOX, offset: 0x603E604, symbol: D_CO_603E604 } +aCoGarudaDestroyHitbox: + { type: SF64:HITBOX, offset: 0x603E604, symbol: aCoGarudaDestroyHitbox } D_CO_603E620: { type: SF64:HITBOX, offset: 0x603E620, symbol: D_CO_603E620 } @@ -552,32 +552,32 @@ D_CO_603E7C4: D_CO_603E840: { type: SF64:HITBOX, offset: 0x603E840, symbol: D_CO_603E840 } -D_CO_603E88C: - { type: SF64:HITBOX, offset: 0x603E88C, symbol: D_CO_603E88C } +aCoRockwallHitbox: + { type: SF64:HITBOX, offset: 0x603E88C, symbol: aCoRockwallHitbox } -D_CO_603E8A8: - { type: SF64:HITBOX, offset: 0x603E8A8, symbol: D_CO_603E8A8 } +aCoDoorsHitbox: + { type: SF64:HITBOX, offset: 0x603E8A8, symbol: aCoDoorsHitbox } D_CO_603E924: { type: SF64:HITBOX, offset: 0x603E924, symbol: D_CO_603E924 } -D_CO_603E98C: - { type: SF64:HITBOX, offset: 0x603E98C, symbol: D_CO_603E98C } +aCoBuildingOnFireHitbox: + { type: SF64:HITBOX, offset: 0x603E98C, symbol: aCoBuildingOnFireHitbox } -D_CO_603E9EC: - { type: SF64:HITBOX, offset: 0x603E9EC, symbol: D_CO_603E9EC } +aCoHighway5Hitbox: + { type: SF64:HITBOX, offset: 0x603E9EC, symbol: aCoHighway5Hitbox } -D_CO_603EA08: - { type: SF64:HITBOX, offset: 0x603EA08, symbol: D_CO_603EA08 } +aCoHighway6Hitbox: + { type: SF64:HITBOX, offset: 0x603EA08, symbol: aCoHighway6Hitbox } -D_CO_603EA74: - { type: SF64:HITBOX, offset: 0x603EA74, symbol: D_CO_603EA74 } +aCoHighway7Hitbox: + { type: SF64:HITBOX, offset: 0x603EA74, symbol: aCoHighway7Hitbox } -D_CO_603EAE0: - { type: SF64:HITBOX, offset: 0x603EAE0, symbol: D_CO_603EAE0 } +aCoHighway8Hitbox: + { type: SF64:HITBOX, offset: 0x603EAE0, symbol: aCoHighway8Hitbox } -D_CO_603EB0C: - { type: SF64:HITBOX, offset: 0x603EB0C, symbol: D_CO_603EB0C } +aCoHighway9Hitbox: + { type: SF64:HITBOX, offset: 0x603EB0C, symbol: aCoHighway9Hitbox } D_CO_603EB38: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0603EB38, symbol: D_CO_603EB38 } diff --git a/assets/yaml/jp/rev0/ast_fortuna.yaml b/assets/yaml/jp/rev0/ast_fortuna.yaml index a6d15d0f..7815eeeb 100644 --- a/assets/yaml/jp/rev0/ast_fortuna.yaml +++ b/assets/yaml/jp/rev0/ast_fortuna.yaml @@ -116,8 +116,8 @@ D_FO_6009F90: D_FO_600A018: { type: TEXTURE, format: IA8, width: 32, height: 32, offset: 0x600A018, ctype: u8, symbol: D_FO_600A018 } -D_FO_600A420: - { type: GFX, offset: 0x600A420, symbol: D_FO_600A420 } +aFoPoleDL: + { type: GFX, offset: 0x600A420, symbol: aFoPoleDL } D_FO_600A4A8: { type: TEXTURE, format: RGBA16, width: 32, height: 64, offset: 0x600A4A8, ctype: u16, symbol: D_FO_600A4A8 } @@ -158,14 +158,14 @@ D_FO_600F3F4: D_FO_600F60C: { type: SF64:COLPOLY, offset: 0x600F60C, count: 93, symbol: D_FO_600F60C, mesh_symbol: D_FO_OFFSET } -D_FO_600FE9C: - { type: SF64:HITBOX, offset: 0x600FE9C, symbol: D_FO_600FE9C } +aFoPoleHitbox: + { type: SF64:HITBOX, offset: 0x600FE9C, symbol: aFoPoleHitbox } D_FO_600FEB8: { type: SF64:HITBOX, offset: 0x600FEB8, symbol: D_FO_600FEB8 } -D_FO_600FF30: - { type: SF64:HITBOX, offset: 0x600FF30, symbol: D_FO_600FF30 } +aFoRadarHitbox: + { type: SF64:HITBOX, offset: 0x600FF30, symbol: aFoRadarHitbox } D_FO_600FF64: { type: SF64:HITBOX, offset: 0x600FF64, symbol: D_FO_600FF64 } diff --git a/assets/yaml/jp/rev0/ast_sector_z.yaml b/assets/yaml/jp/rev0/ast_sector_z.yaml index 4fb35bc7..96233307 100644 --- a/assets/yaml/jp/rev0/ast_sector_z.yaml +++ b/assets/yaml/jp/rev0/ast_sector_z.yaml @@ -30,11 +30,11 @@ D_SZ_6000840: D_SZ_60012D0: { type: TEXTURE, ctype: u8, format: IA8, width: 16, height: 9, offset: 0x60012D0, symbol: D_SZ_60012D0 } -D_SZ_6001360: - { type: GFX, offset: 0x6001360, symbol: D_SZ_6001360 } +aSzSpaceJunk1DL: + { type: GFX, offset: 0x6001360, symbol: aSzSpaceJunk1DL } -D_SZ_6001A10: - { type: GFX, offset: 0x6001A10, symbol: D_SZ_6001A10 } +aSzSpaceJunk2DL: + { type: GFX, offset: 0x6001A10, symbol: aSzSpaceJunk2DL } D_SZ_6001C80: { type: TEXTURE, ctype: u8, format: CI8, width: 16, height: 16, offset: 0x06001C80, symbol: D_SZ_6001C80, tlut: 0x06001D80 } @@ -42,8 +42,8 @@ D_SZ_6001C80: D_SZ_6001D80: { type: TEXTURE, ctype: u16, format: TLUT, colors: 16, offset: 0x06001D80, symbol: D_SZ_6001D80 } -D_SZ_6001DA0: - { type: GFX, offset: 0x6001DA0, symbol: D_SZ_6001DA0 } +aSzSpaceJunk3DL: + { type: GFX, offset: 0x6001DA0, symbol: aSzSpaceJunk3DL } D_SZ_60025F0: { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x60025F0, symbol: D_SZ_60025F0, tlut: 0x060029F0 } @@ -69,12 +69,12 @@ D_SZ_6002DE0: D_SZ_6002EE0: { type: TEXTURE, ctype: u16, format: TLUT, colors: 80, offset: 0x06002EE0, symbol: D_SZ_6002EE0 } -D_SZ_6002F80: - { type: GFX, offset: 0x6002F80, symbol: D_SZ_6002F80 } +aSzBackgroundDL: + { type: GFX, offset: 0x6002F80, symbol: aSzBackgroundDL } # Sector Z Background -D_SZ_6003010: - { type: TEXTURE, ctype: u16, format: RGBA16, width: 64, height: 32, offset: 0x06003010, symbol: D_SZ_6003010 } +aSzBackgroundTex: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 64, height: 32, offset: 0x06003010, symbol: aSzBackgroundTex } D_SZ_6004010: { type: GFX, offset: 0x6004010, symbol: D_SZ_6004010 } @@ -97,8 +97,8 @@ D_SZ_6004558: D_SZ_6004570: { type: GFX, offset: 0x6004570, symbol: D_SZ_6004570 } -D_SZ_60045E0: - { type: GFX, offset: 0x60045E0, symbol: D_SZ_60045E0 } +aSZSpaceJunk4DL: + { type: GFX, offset: 0x60045E0, symbol: aSZSpaceJunk4DL } D_SZ_60047E0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x60047E0, symbol: D_SZ_60047E0 } @@ -145,8 +145,8 @@ D_SZ_6006CD8: D_SZ_6006D64: { type: SF64:ANIM, offset: 0x6006D64, symbol: D_SZ_6006D64 } -D_SZ_6006E50: - { type: SF64:SKELETON, offset: 0x6006E50, symbol: D_SZ_6006E50 } +aSzMissileSkel: + { type: SF64:SKELETON, offset: 0x6006E50, symbol: aSzMissileSkel } D_SZ_6006E70: { type: SF64:ENVIRONMENT, offset: 0x6006E70, symbol: D_SZ_6006E70 } diff --git a/assets/yaml/jp/rev0/ast_titania.yaml b/assets/yaml/jp/rev0/ast_titania.yaml index 1e1210f4..d782b058 100644 --- a/assets/yaml/jp/rev0/ast_titania.yaml +++ b/assets/yaml/jp/rev0/ast_titania.yaml @@ -28,8 +28,8 @@ D_TI_6001B10: D_TI_6001BA8: {type: TEXTURE, format: RGBA16, ctype: u16, width: 32, height: 32, offset: 0x6001BA8, symbol: D_TI_6001BA8} -D_TI_60023B0: - {type: GFX, offset: 0x60023B0, symbol: D_TI_60023B0} +aTiCactusDL: + {type: GFX, offset: 0x60023B0, symbol: aTiCactusDL} D_TI_6002438: {type: TEXTURE, format: RGBA16, ctype: u16, width: 32, height: 64, offset: 0x6002438, symbol: D_TI_6002438} @@ -82,35 +82,35 @@ D_TI_60064AC: D_TI_60064C8: {type: SF64:HITBOX, offset: 0x60064C8, symbol: D_TI_60064C8} -D_TI_60064FC: - {type: SF64:HITBOX, offset: 0x60064FC, symbol: D_TI_60064FC} +aTiSkullHitbox: + {type: SF64:HITBOX, offset: 0x60064FC, symbol: aTiSkullHitbox} -D_TI_6006518: - {type: SF64:HITBOX, offset: 0x6006518, symbol: D_TI_6006518} +aTiRib0Hitbox: + {type: SF64:HITBOX, offset: 0x6006518, symbol: aTiRib0Hitbox} -D_TI_6006564: - {type: SF64:HITBOX, offset: 0x6006564, symbol: D_TI_6006564} +aTiRib1Hitbox: + {type: SF64:HITBOX, offset: 0x6006564, symbol: aTiRib1Hitbox} -D_TI_60065B0: - {type: SF64:HITBOX, offset: 0x60065B0, symbol: D_TI_60065B0} +aTiRib2Hitbox: + {type: SF64:HITBOX, offset: 0x60065B0, symbol: aTiRib2Hitbox} -D_TI_60065FC: - {type: SF64:HITBOX, offset: 0x60065FC, symbol: D_TI_60065FC} +aTiRib3Hitbox: + {type: SF64:HITBOX, offset: 0x60065FC, symbol: aTiRib3Hitbox} -D_TI_6006648: - {type: SF64:HITBOX, offset: 0x6006648, symbol: D_TI_6006648} +aTiRib4Hitbox: + {type: SF64:HITBOX, offset: 0x6006648, symbol: aTiRib4Hitbox} -D_TI_6006694: - {type: SF64:HITBOX, offset: 0x6006694, symbol: D_TI_6006694} +aTiRib5Hitbox: + {type: SF64:HITBOX, offset: 0x6006694, symbol: aTiRib5Hitbox} -D_TI_60066E0: - {type: SF64:HITBOX, offset: 0x60066E0, symbol: D_TI_60066E0} +aTiRib6Hitbox: + {type: SF64:HITBOX, offset: 0x60066E0, symbol: aTiRib6Hitbox} -D_TI_600672C: - {type: SF64:HITBOX, offset: 0x600672C, symbol: D_TI_600672C} +aTiRib7Hitbox: + {type: SF64:HITBOX, offset: 0x600672C, symbol: aTiRib7Hitbox} -D_TI_6006778: - {type: SF64:HITBOX, offset: 0x6006778, symbol: D_TI_6006778} +aTiRib8Hitbox: + {type: SF64:HITBOX, offset: 0x6006778, symbol: aTiRib8Hitbox} D_TI_60067C4: {type: SF64:HITBOX, offset: 0x60067C4, symbol: D_TI_60067C4} @@ -133,8 +133,8 @@ D_TI_6006874: D_TI_6006890: {type: SF64:HITBOX, offset: 0x6006890, symbol: D_TI_6006890} -D_TI_60068BC: - {type: SF64:HITBOX, offset: 0x60068BC, symbol: D_TI_60068BC} +aTiCactusHitbox: + {type: SF64:HITBOX, offset: 0x60068BC, symbol: aTiCactusHitbox} D_TI_60068F0: {type: SF64:HITBOX, offset: 0x60068F0, symbol: D_TI_60068F0} diff --git a/assets/yaml/jp/rev0/ast_zoness.yaml b/assets/yaml/jp/rev0/ast_zoness.yaml index 3961d8fb..8f634226 100644 --- a/assets/yaml/jp/rev0/ast_zoness.yaml +++ b/assets/yaml/jp/rev0/ast_zoness.yaml @@ -471,8 +471,8 @@ D_ZO_6024220: D_ZO_60242B8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x60242B8, symbol: D_ZO_60242B8} -D_ZO_6024AC0: - { type: GFX, offset: 0x6024AC0, symbol: D_ZO_6024AC0} +aZoRock1DL: + { type: GFX, offset: 0x6024AC0, symbol: aZoRock1DL} D_ZO_6024D60: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x6024D60, symbol: D_ZO_6024D60} @@ -502,8 +502,8 @@ D_ZO_602AC50: D_ZO_602AE94: { type: ARRAY, count: 242, array_type: Vec3f, offset: 0x602AE94, symbol: D_ZO_602AE94} -D_ZO_602B9EC: - { type: SF64:HITBOX, offset: 0x602B9EC, symbol: D_ZO_602B9EC} +aZoRock1Hitbox: + { type: SF64:HITBOX, offset: 0x602B9EC, symbol: aZoRock1Hitbox} D_ZO_602BA20: { type: SF64:HITBOX, offset: 0x602BA20, symbol: D_ZO_602BA20} diff --git a/assets/yaml/us/rev1/ast_arwing.yaml b/assets/yaml/us/rev1/ast_arwing.yaml index 43443489..dcd135ab 100644 --- a/assets/yaml/us/rev1/ast_arwing.yaml +++ b/assets/yaml/us/rev1/ast_arwing.yaml @@ -56,8 +56,8 @@ D_arwing_3007550: D_arwing_30075D0: { type: TEXTURE, format: RGBA16, offset: 0x30075D0, width: 8, height: 8, ctype: u16, symbol: D_arwing_30075D0 } -D_arwing_3007650: - { type: GFX, offset: 0x3007650, symbol: D_arwing_3007650 } +aArwingItemLasersDL: + { type: GFX, offset: 0x3007650, symbol: aArwingItemLasersDL } ast_arwing_seg3_vtx_7A20: { type: VTX, offset: 0x3007A20, count: 244, symbol: ast_arwing_seg3_vtx_7A20 } diff --git a/assets/yaml/us/rev1/ast_corneria.yaml b/assets/yaml/us/rev1/ast_corneria.yaml index cec3e86c..15f83392 100644 --- a/assets/yaml/us/rev1/ast_corneria.yaml +++ b/assets/yaml/us/rev1/ast_corneria.yaml @@ -18,8 +18,8 @@ D_CO_6000000: { type: TEXTURE, ctype: u8, format: IA8, width: 128, height: 28, offset: 0x6000000, symbol: D_CO_6000000 } -D_CO_6000E00: - { type: GFX, offset: 0x6000E00, symbol: D_CO_6000E00 } +aCoWaterfallDL: + { type: GFX, offset: 0x6000E00, symbol: aCoWaterfallDL } D_CO_60018F8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x060018F8, symbol: D_CO_60018F8 } @@ -48,8 +48,8 @@ D_CO_60059F0: D_CO_6005A80: { type: TEXTURE, ctype: u16, format: RGBA16, width: 64, height: 32, offset: 0x06005A80, symbol: D_CO_6005A80 } -D_CO_6006A80: - { type: GFX, offset: 0x6006A80, symbol: D_CO_6006A80 } +aCoArch3DL: + { type: GFX, offset: 0x6006A80, symbol: aCoArch3DL } D_CO_6006E08: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06006E08, symbol: D_CO_6006E08 } @@ -102,11 +102,11 @@ D_CO_6010250: D_CO_6010F90: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06010F90, symbol: D_CO_6010F90 } -D_CO_6010A50: - { type: GFX, offset: 0x6010A50, symbol: D_CO_6010A50 } +aCoHighway7DL: + { type: GFX, offset: 0x6010A50, symbol: aCoHighway7DL } -D_CO_6010E00: - { type: GFX, offset: 0x6010E00, symbol: D_CO_6010E00 } +aCoHighway5DL: + { type: GFX, offset: 0x6010E00, symbol: aCoHighway5DL } D_CO_6011790: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06011790, symbol: D_CO_6011790 } @@ -123,53 +123,53 @@ D_CO_6012840: D_CO_6012D00: { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x06012D00, symbol: D_CO_6012D00 } -D_CO_60132B0: - { type: GFX, offset: 0x60132B0, symbol: D_CO_60132B0 } +aCoHighway1DL: + { type: GFX, offset: 0x60132B0, symbol: aCoHighway1DL } -D_CO_60137B0: - { type: GFX, offset: 0x60137B0, symbol: D_CO_60137B0 } +aCoArch2DL: + { type: GFX, offset: 0x60137B0, symbol: aCoArch2DL } -D_CO_6013B50: - { type: GFX, offset: 0x6013B50, symbol: D_CO_6013B50 } +aCoRockwallDL: + { type: GFX, offset: 0x6013B50, symbol: aCoRockwallDL } D_CO_6013BE0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06013BE0, symbol: D_CO_6013BE0 } -D_CO_60143E0: - { type: GFX, offset: 0x60143E0, symbol: D_CO_60143E0 } +aCoHighway8DL: + { type: GFX, offset: 0x60143E0, symbol: aCoHighway8DL } -D_CO_6014500: - { type: GFX, offset: 0x6014500, symbol: D_CO_6014500 } +aCoHighway4DL: + { type: GFX, offset: 0x6014500, symbol: aCoHighway4DL } -D_CO_6014670: - { type: GFX, offset: 0x6014670, symbol: D_CO_6014670 } +aCoHighway6DL: + { type: GFX, offset: 0x6014670, symbol: aCoHighway6DL } -D_CO_6014A20: - { type: GFX, offset: 0x6014A20, symbol: D_CO_6014A20 } +aCoHighway9DL: + { type: GFX, offset: 0x6014A20, symbol: aCoHighway9DL } -D_CO_6014B50: - { type: GFX, offset: 0x6014B50, symbol: D_CO_6014B50 } +aCoBuilding3DL: + { type: GFX, offset: 0x6014B50, symbol: aCoBuilding3DL } D_CO_60151A8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 16, height: 16, offset: 0x060151A8, symbol: D_CO_60151A8 } -D_CO_60153B0: - { type: GFX, offset: 0x60153B0, symbol: D_CO_60153B0 } +aCoTowerDL: + { type: GFX, offset: 0x60153B0, symbol: aCoTowerDL } -D_CO_6015F00: - { type: GFX, offset: 0x6015F00, symbol: D_CO_6015F00 } +aCoStoneArchDL: + { type: GFX, offset: 0x6015F00, symbol: aCoStoneArchDL } D_CO_6015700: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x06015700, symbol: D_CO_6015700 } -D_CO_6016270: - { type: GFX, offset: 0x6016270, symbol: D_CO_6016270 } +aRadarDL: + { type: GFX, offset: 0x6016270, symbol: aRadarDL } -D_CO_60164F0: - { type: GFX, offset: 0x60164F0, symbol: D_CO_60164F0 } +aCoHighway3DL: + { type: GFX, offset: 0x60164F0, symbol: aCoHighway3DL } -D_CO_6016580: - { type: GFX, offset: 0x6016580, symbol: D_CO_6016580 } +aCoBuilding4DL: + { type: GFX, offset: 0x6016580, symbol: aCoBuilding4DL } D_CO_6017F10: { type: GFX, offset: 0x6017F10, symbol: D_CO_6017F10 } @@ -177,8 +177,8 @@ D_CO_6017F10: D_CO_60186E0: { type: GFX, offset: 0x60186E0, symbol: D_CO_60186E0 } -D_CO_6018E80: - { type: GFX, offset: 0x6018E80, symbol: D_CO_6018E80 } +aCoBuilding7DL: + { type: GFX, offset: 0x6018E80, symbol: aCoBuilding7DL } D_CO_60191C8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x060191C8, symbol: D_CO_60191C8 } @@ -195,14 +195,14 @@ D_CO_6019E60: D_CO_601FF58: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601FF58, symbol: D_CO_601FF58 } -D_CO_601A7D0: - { type: GFX, offset: 0x601A7D0, symbol: D_CO_601A7D0 } +aCoBuilding2DL: + { type: GFX, offset: 0x601A7D0, symbol: aCoBuilding2DL } D_CO_601AD60: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601AD60, symbol: D_CO_601AD60 } -D_CO_601B560: - { type: GFX, offset: 0x601B560, symbol: D_CO_601B560 } +aCoBuilding5DL: + { type: GFX, offset: 0x601B560, symbol: aCoBuilding5DL } D_CO_601B640: { type: GFX, offset: 0x601B640, symbol: D_CO_601B640 } @@ -210,14 +210,14 @@ D_CO_601B640: D_CO_601B6C0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601B6C0, symbol: D_CO_601B6C0 } -D_CO_601BEC0: - { type: GFX, offset: 0x601BEC0, symbol: D_CO_601BEC0 } +aCoBump2DL: + { type: GFX, offset: 0x601BEC0, symbol: aCoBump2DL } D_CO_601C1A8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0601C1A8, symbol: D_CO_601C1A8 } -D_CO_601C9B0: - { type: GFX, offset: 0x601C9B0, symbol: D_CO_601C9B0 } +aCoTreeDL: + { type: GFX, offset: 0x601C9B0, symbol: aCoTreeDL } D_CO_601CAA0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 64, offset: 0x0601CAA0, symbol: D_CO_601CAA0 } @@ -234,8 +234,8 @@ D_CO_601ED00: D_CO_601F500: { type: GFX, offset: 0x601F500, symbol: D_CO_601F500 } -D_CO_601F5A0: - { type: GFX, offset: 0x601F5A0, symbol: D_CO_601F5A0 } +aCoArch1DL: + { type: GFX, offset: 0x601F5A0, symbol: aCoArch1DL } D_CO_6020760: { type: GFX, offset: 0x6020760, symbol: D_CO_6020760 } @@ -258,8 +258,8 @@ D_CO_6023DE8: D_CO_6024160: { type: GFX, offset: 0x6024160, symbol: D_CO_6024160 } -D_CO_60244A0: - { type: GFX, offset: 0x60244A0, symbol: D_CO_60244A0 } +aCoBump4DL: + { type: GFX, offset: 0x60244A0, symbol: aCoBump4DL } D_CO_60245E0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 44, height: 44, offset: 0x060245E0, symbol: D_CO_60245E0 } @@ -285,14 +285,14 @@ D_CO_6029528: D_CO_6029674: { type: SF64:SKELETON, offset: 0x6029674, symbol: D_CO_6029674 } -D_CO_602991C: - { type: SF64:ANIM, offset: 0x602991C, symbol: D_CO_602991C } +aCoGaruda1Anim: + { type: SF64:ANIM, offset: 0x602991C, symbol: aCoGaruda1Anim } -D_CO_6029A48: - { type: SF64:SKELETON, offset: 0x6029A48, symbol: D_CO_6029A48 } +aCoGarudaSkel: + { type: SF64:SKELETON, offset: 0x6029A48, symbol: aCoGarudaSkel } -D_CO_602A520: - { type: SF64:ANIM, offset: 0x602A520, symbol: D_CO_602A520 } +aCoGaruda3Anim: + { type: SF64:ANIM, offset: 0x602A520, symbol: aCoGaruda3Anim } D_CO_602AA04: { type: SF64:ANIM, offset: 0x602AA04, symbol: D_CO_602AA04 } @@ -300,8 +300,8 @@ D_CO_602AA04: D_CO_602AA7C: { type: SF64:ANIM, offset: 0x602AA7C, symbol: D_CO_602AA7C } -D_CO_602AB48: - { type: SF64:SKELETON, offset: 0x602AB48, symbol: D_CO_602AB48 } +aCoDoorsSkel: + { type: SF64:SKELETON, offset: 0x602AB48, symbol: aCoDoorsSkel } D_CO_602BC18: { type: SF64:ANIM, offset: 0x602BC18, symbol: D_CO_602BC18 } @@ -318,11 +318,11 @@ D_CO_602D31C: D_CO_602D400: { type: SF64:ANIM, offset: 0x602D400, symbol: D_CO_602D400 } -D_CO_602D5AC: - { type: SF64:SKELETON, offset: 0x602D5AC, symbol: D_CO_602D5AC } +aCoCarrierSkel: + { type: SF64:SKELETON, offset: 0x602D5AC, symbol: aCoCarrierSkel } -D_CO_602D5F0: - { type: GFX, offset: 0x602D5F0, symbol: D_CO_602D5F0 } +aCoBuilding1DL: + { type: GFX, offset: 0x602D5F0, symbol: aCoBuilding1DL } D_CO_602DA20: { type: GFX, offset: 0x602DA20, symbol: D_CO_602DA20 } @@ -333,17 +333,17 @@ D_CO_602DCA0: D_CO_602DD40: { type: GFX, offset: 0x602DD40, symbol: D_CO_602DD40 } -D_CO_602E080: - { type: GFX, offset: 0x602E080, symbol: D_CO_602E080 } +aCoHighway2DL: + { type: GFX, offset: 0x602E080, symbol: aCoHighway2DL } -D_CO_602E570: - { type: GFX, offset: 0x602E570, symbol: D_CO_602E570 } +aCoBump5DL: + { type: GFX, offset: 0x602E570, symbol: aCoBump5DL } -D_CO_602E7A0: - { type: GFX, offset: 0x602E7A0, symbol: D_CO_602E7A0 } +aCoBump3DL: + { type: GFX, offset: 0x602E7A0, symbol: aCoBump3DL } -D_CO_602E9E0: - { type: GFX, offset: 0x602E9E0, symbol: D_CO_602E9E0 } +aCoBump1DL: + { type: GFX, offset: 0x602E9E0, symbol: aCoBump1DL } D_CO_602ECB0: { type: GFX, offset: 0x602ECB0, symbol: D_CO_602ECB0 } @@ -351,8 +351,8 @@ D_CO_602ECB0: D_CO_602ED50: { type: TEXTURE, ctype: u16, format: RGBA16, width: 8, height: 16, offset: 0x0602ED50, symbol: D_CO_602ED50 } -D_CO_602F7C0: - { type: GFX, offset: 0x602F7C0, symbol: D_CO_602F7C0 } +aCoPoleDL: + { type: GFX, offset: 0x602F7C0, symbol: aCoPoleDL } D_CO_602F848: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 64, offset: 0x0602F848, symbol: D_CO_602F848 } @@ -408,11 +408,11 @@ D_CO_60355A0: D_CO_6035DA0: { type: GFX, offset: 0x6035DA0, symbol: D_CO_6035DA0 } -D_CO_6035F10: - { type: GFX, offset: 0x6035F10, symbol: D_CO_6035F10 } +aCoBuilding8DL: + { type: GFX, offset: 0x6035F10, symbol: aCoBuilding8DL } -D_CO_60361F0: - { type: GFX, offset: 0x60361F0, symbol: D_CO_60361F0 } +aCoBuilding6DL: + { type: GFX, offset: 0x60361F0, symbol: aCoBuilding6DL } D_CO_60363B0: { type: GFX, offset: 0x60363B0, symbol: D_CO_60363B0 } @@ -435,11 +435,11 @@ D_CO_6036D58: D_CO_6037160: { type: SF64:ENVIRONMENT, offset: 0x6037160, symbol: D_CO_6037160 } -D_CO_60371A4: - { type: SF64:OBJECT_INIT, offset: 0x60371A4, symbol: D_CO_60371A4 } +aCoOnRailsLevelObjects: + { type: SF64:OBJECT_INIT, offset: 0x60371A4, symbol: aCoOnRailsLevelObjects } -D_CO_603B074: - { type: SF64:OBJECT_INIT, offset: 0x603B074, symbol: D_CO_603B074 } +aCoAllRangeLevelObjects: + { type: SF64:OBJECT_INIT, offset: 0x603B074, symbol: aCoAllRangeLevelObjects } D_CO_603D9E8: { type: SF64:SCRIPT, offset: 0x603D9E8, symbol: D_CO_603D9E8 } @@ -448,50 +448,50 @@ D_CO_603D9E8: D_CO_603DC40: { type: SF64:HITBOX, offset: 0x603DC40, symbol: D_CO_603DC40 } -D_CO_603DD40: - { type: SF64:HITBOX, offset: 0x603DD40, symbol: D_CO_603DD40 } +aCoHighway2Hitbox: + { type: SF64:HITBOX, offset: 0x603DD40, symbol: aCoHighway2Hitbox } -D_CO_603DDF0: - { type: SF64:HITBOX, offset: 0x603DDF0, symbol: D_CO_603DDF0 } +aCoBuilding1Hitbox: + { type: SF64:HITBOX, offset: 0x603DDF0, symbol: aCoBuilding1Hitbox } -D_CO_603DCA4: - { type: SF64:HITBOX, offset: 0x603DCA4, symbol: D_CO_603DCA4 } +aCoHighway1Hitbox: + { type: SF64:HITBOX, offset: 0x603DCA4, symbol: aCoHighway1Hitbox } -D_CO_603DE8C: - { type: SF64:HITBOX, offset: 0x603DE8C, symbol: D_CO_603DE8C } +aCoBuilding2Hitbox: + { type: SF64:HITBOX, offset: 0x603DE8C, symbol: aCoBuilding2Hitbox } -D_CO_603DEF4: - { type: SF64:HITBOX, offset: 0x603DEF4, symbol: D_CO_603DEF4 } +aCoBuilding3Hitbox: + { type: SF64:HITBOX, offset: 0x603DEF4, symbol: aCoBuilding3Hitbox } -D_CO_603DF8C: - { type: SF64:HITBOX, offset: 0x603DF8C, symbol: D_CO_603DF8C } +aCoBuilding4Hitbox: + { type: SF64:HITBOX, offset: 0x603DF8C, symbol: aCoBuilding4Hitbox } -D_CO_603DFDC: - { type: SF64:HITBOX, offset: 0x603DFDC, symbol: D_CO_603DFDC } +aCoBuilding5Hitbox: + { type: SF64:HITBOX, offset: 0x603DFDC, symbol: aCoBuilding5Hitbox } -D_CO_603E014: - { type: SF64:HITBOX, offset: 0x603E014, symbol: D_CO_603E014 } +aCoBuilding6Hitbox: + { type: SF64:HITBOX, offset: 0x603E014, symbol: aCoBuilding6Hitbox } -D_CO_603E030: - { type: SF64:HITBOX, offset: 0x603E030, symbol: D_CO_603E030 } +aCoBuilding7Hitbox: + { type: SF64:HITBOX, offset: 0x603E030, symbol: aCoBuilding7Hitbox } -D_CO_603E09C: - { type: SF64:HITBOX, offset: 0x603E09C, symbol: D_CO_603E09C } +aCoBuilding8Hitbox: + { type: SF64:HITBOX, offset: 0x603E09C, symbol: aCoBuilding8Hitbox } -D_CO_603E0EC: - { type: SF64:HITBOX, offset: 0x603E0EC, symbol: D_CO_603E0EC } +aCoWaterfallHitbox: + { type: SF64:HITBOX, offset: 0x603E0EC, symbol: aCoWaterfallHitbox } -D_CO_603E118: - { type: SF64:HITBOX, offset: 0x603E118, symbol: D_CO_603E118 } +aCoTowerHitbox: + { type: SF64:HITBOX, offset: 0x603E118, symbol: aCoTowerHitbox } -D_CO_603E14C: - { type: SF64:HITBOX, offset: 0x603E14C, symbol: D_CO_603E14C } +aCoArch1Hitbox: + { type: SF64:HITBOX, offset: 0x603E14C, symbol: aCoArch1Hitbox } -D_CO_603E1B4: - { type: SF64:HITBOX, offset: 0x603E1B4, symbol: D_CO_603E1B4 } +aCoArch2Hitbox: + { type: SF64:HITBOX, offset: 0x603E1B4, symbol: aCoArch2Hitbox } -D_CO_603E21C: - { type: SF64:HITBOX, offset: 0x603E21C, symbol: D_CO_603E21C } +aCoArch3Hitbox: + { type: SF64:HITBOX, offset: 0x603E21C, symbol: aCoArch3Hitbox } # seems unused D_CO_603E2C0: @@ -501,26 +501,26 @@ D_CO_603E2C0: D_CO_603E2F4: { type: SF64:HITBOX, offset: 0x603E2F4, symbol: D_CO_603E2F4 } -D_CO_603E3E0: - { type: SF64:HITBOX, offset: 0x603E3E0, symbol: D_CO_603E3E0 } +aCoStoneArchHitbox: + { type: SF64:HITBOX, offset: 0x603E3E0, symbol: aCoStoneArchHitbox } -D_CO_603E468: - { type: SF64:HITBOX, offset: 0x603E468, symbol: D_CO_603E468 } +aCoPoleHitbox: + { type: SF64:HITBOX, offset: 0x603E468, symbol: aCoPoleHitbox } -D_CO_603E484: - { type: SF64:HITBOX, offset: 0x603E484, symbol: D_CO_603E484 } +aCoTreeHitbox: + { type: SF64:HITBOX, offset: 0x603E484, symbol: aCoTreeHitbox } -D_CO_603E4A0: - { type: SF64:HITBOX, offset: 0x603E4A0, symbol: D_CO_603E4A0 } +aCoRadarHitbox: + { type: SF64:HITBOX, offset: 0x603E4A0, symbol: aCoRadarHitbox } -D_CO_603E4A4: - { type: SF64:HITBOX, offset: 0x603E4A4, symbol: D_CO_603E4A4 } +aCoBuilding9Hitbox: + { type: SF64:HITBOX, offset: 0x603E4A4, symbol: aCoBuilding9Hitbox } -D_CO_603E4DC: - { type: SF64:HITBOX, offset: 0x603E4DC, symbol: D_CO_603E4DC } +aCoBuilding10Hitbox: + { type: SF64:HITBOX, offset: 0x603E4DC, symbol: aCoBuilding10Hitbox } -D_CO_603E514: - { type: SF64:HITBOX, offset: 0x603E514, symbol: D_CO_603E514 } +aCoIBeamHitbox: + { type: SF64:HITBOX, offset: 0x603E514, symbol: aCoIBeamHitbox } D_CO_603E54C: { type: SF64:HITBOX, offset: 0x603E54C, symbol: D_CO_603E54C } @@ -531,14 +531,14 @@ D_CO_603E598: D_CO_603E5B4: { type: SF64:HITBOX, offset: 0x603E5B4, symbol: D_CO_603E5B4 } -D_CO_603E5D0: - { type: SF64:HITBOX, offset: 0x603E5D0, symbol: D_CO_603E5D0 } +CoGarudaHitbox: + { type: SF64:HITBOX, offset: 0x603E5D0, symbol: CoGarudaHitbox } -D_CO_603E604: - { type: SF64:HITBOX, offset: 0x603E604, symbol: D_CO_603E604 } +aCoGarudaDestroyHitbox: + { type: SF64:HITBOX, offset: 0x603E604, symbol: aCoGarudaDestroyHitbox } -D_CO_603E620: - { type: SF64:HITBOX, offset: 0x603E620, symbol: D_CO_603E620 } +aCoGrangaHitbox: + { type: SF64:HITBOX, offset: 0x603E620, symbol: aCoGrangaHitbox } D_CO_603E714: { type: SF64:HITBOX, offset: 0x603E714, symbol: D_CO_603E714 } @@ -549,35 +549,35 @@ D_CO_603E748: D_CO_603E7C4: { type: SF64:HITBOX, offset: 0x603E7C4, symbol: D_CO_603E7C4 } -D_CO_603E840: - { type: SF64:HITBOX, offset: 0x603E840, symbol: D_CO_603E840 } +aCoCarrierHitbox: + { type: SF64:HITBOX, offset: 0x603E840, symbol: aCoCarrierHitbox } -D_CO_603E88C: - { type: SF64:HITBOX, offset: 0x603E88C, symbol: D_CO_603E88C } +aCoRockwallHitbox: + { type: SF64:HITBOX, offset: 0x603E88C, symbol: aCoRockwallHitbox } -D_CO_603E8A8: - { type: SF64:HITBOX, offset: 0x603E8A8, symbol: D_CO_603E8A8 } +aCoDoorsHitbox: + { type: SF64:HITBOX, offset: 0x603E8A8, symbol: aCoDoorsHitbox } D_CO_603E924: { type: SF64:HITBOX, offset: 0x603E924, symbol: D_CO_603E924 } -D_CO_603E98C: - { type: SF64:HITBOX, offset: 0x603E98C, symbol: D_CO_603E98C } +aCoBuildingOnFireHitbox: + { type: SF64:HITBOX, offset: 0x603E98C, symbol: aCoBuildingOnFireHitbox } -D_CO_603E9EC: - { type: SF64:HITBOX, offset: 0x603E9EC, symbol: D_CO_603E9EC } +aCoHighway5Hitbox: + { type: SF64:HITBOX, offset: 0x603E9EC, symbol: aCoHighway5Hitbox } -D_CO_603EA08: - { type: SF64:HITBOX, offset: 0x603EA08, symbol: D_CO_603EA08 } +aCoHighway6Hitbox: + { type: SF64:HITBOX, offset: 0x603EA08, symbol: aCoHighway6Hitbox } -D_CO_603EA74: - { type: SF64:HITBOX, offset: 0x603EA74, symbol: D_CO_603EA74 } +aCoHighway7Hitbox: + { type: SF64:HITBOX, offset: 0x603EA74, symbol: aCoHighway7Hitbox } -D_CO_603EAE0: - { type: SF64:HITBOX, offset: 0x603EAE0, symbol: D_CO_603EAE0 } +aCoHighway8Hitbox: + { type: SF64:HITBOX, offset: 0x603EAE0, symbol: aCoHighway8Hitbox } -D_CO_603EB0C: - { type: SF64:HITBOX, offset: 0x603EB0C, symbol: D_CO_603EB0C } +aCoHighway9Hitbox: + { type: SF64:HITBOX, offset: 0x603EB0C, symbol: aCoHighway9Hitbox } D_CO_603EB38: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x0603EB38, symbol: D_CO_603EB38 } diff --git a/assets/yaml/us/rev1/ast_fortuna.yaml b/assets/yaml/us/rev1/ast_fortuna.yaml index 2c33e207..4fafae5e 100644 --- a/assets/yaml/us/rev1/ast_fortuna.yaml +++ b/assets/yaml/us/rev1/ast_fortuna.yaml @@ -116,8 +116,8 @@ D_FO_6009F90: D_FO_600A018: { type: TEXTURE, format: IA8, width: 32, height: 32, offset: 0x600A018, ctype: u8, symbol: D_FO_600A018 } -D_FO_600A420: - { type: GFX, offset: 0x600A420, symbol: D_FO_600A420 } +aFoPoleDL: + { type: GFX, offset: 0x600A420, symbol: aFoPoleDL } D_FO_600A4A8: { type: TEXTURE, format: RGBA16, width: 32, height: 64, offset: 0x600A4A8, ctype: u16, symbol: D_FO_600A4A8 } @@ -158,14 +158,14 @@ D_FO_600F3F4: D_FO_600F60C: { type: SF64:COLPOLY, offset: 0x600F60C, count: 93, symbol: D_FO_600F60C, mesh_symbol: D_FO_OFFSET } -D_FO_600FE9C: - { type: SF64:HITBOX, offset: 0x600FE9C, symbol: D_FO_600FE9C } +aFoPoleHitbox: + { type: SF64:HITBOX, offset: 0x600FE9C, symbol: aFoPoleHitbox } D_FO_600FEB8: { type: SF64:HITBOX, offset: 0x600FEB8, symbol: D_FO_600FEB8 } -D_FO_600FF30: - { type: SF64:HITBOX, offset: 0x600FF30, symbol: D_FO_600FF30 } +aFoRadarHitbox: + { type: SF64:HITBOX, offset: 0x600FF30, symbol: aFoRadarHitbox } D_FO_600FF64: { type: SF64:HITBOX, offset: 0x600FF64, symbol: D_FO_600FF64 } diff --git a/assets/yaml/us/rev1/ast_map.yaml b/assets/yaml/us/rev1/ast_map.yaml index 44747cae..a77becb0 100644 --- a/assets/yaml/us/rev1/ast_map.yaml +++ b/assets/yaml/us/rev1/ast_map.yaml @@ -367,11 +367,14 @@ D_MAP_6047E70: { type: GFX, offset: 0x6047E70, symbol: D_MAP_6047E70 } D_MAP_6047F80: - { type: TEXTURE, format: IA8, offset: 0x06047F80, width: 64, height: 64, ctype: u8, symbol: D_MAP_6047F80 } + { type: TEXTURE, format: IA8, offset: 0x06047F80, width: 64, height: 32, ctype: u8, symbol: D_MAP_6047F80 } + +D_MAP_6048780: + { type: TEXTURE, format: IA8, offset: 0x06048780, width: 64, height: 32, ctype: u8, symbol: D_MAP_6048780 } D_MAP_6048F80: { type: TEXTURE, format: IA8, offset: 0x06048F80, width: 64, height: 64, ctype: u8, symbol: D_MAP_6048F80 } - + D_MAP_6049F80: { type: GFX, offset: 0x6049F80, symbol: D_MAP_6049F80 } diff --git a/assets/yaml/us/rev1/ast_sector_z.yaml b/assets/yaml/us/rev1/ast_sector_z.yaml index bd532e3f..5213b9d2 100644 --- a/assets/yaml/us/rev1/ast_sector_z.yaml +++ b/assets/yaml/us/rev1/ast_sector_z.yaml @@ -30,11 +30,11 @@ D_SZ_6000840: D_SZ_60012D0: { type: TEXTURE, ctype: u8, format: IA8, width: 16, height: 9, offset: 0x60012D0, symbol: D_SZ_60012D0 } -D_SZ_6001360: - { type: GFX, offset: 0x6001360, symbol: D_SZ_6001360 } +aSzSpaceJunk1DL: + { type: GFX, offset: 0x6001360, symbol: aSzSpaceJunk1DL } -D_SZ_6001A10: - { type: GFX, offset: 0x6001A10, symbol: D_SZ_6001A10 } +aSzSpaceJunk2DL: + { type: GFX, offset: 0x6001A10, symbol: aSzSpaceJunk2DL } D_SZ_6001C80: { type: TEXTURE, ctype: u8, format: CI8, width: 16, height: 16, offset: 0x06001C80, symbol: D_SZ_6001C80, tlut: 0x06001D80 } @@ -42,8 +42,8 @@ D_SZ_6001C80: D_SZ_6001D80: { type: TEXTURE, ctype: u16, format: TLUT, colors: 16, offset: 0x06001D80, symbol: D_SZ_6001D80 } -D_SZ_6001DA0: - { type: GFX, offset: 0x6001DA0, symbol: D_SZ_6001DA0 } +aSzSpaceJunk3DL: + { type: GFX, offset: 0x6001DA0, symbol: aSzSpaceJunk3DL } D_SZ_60025F0: { type: TEXTURE, ctype: u8, format: CI8, width: 32, height: 32, offset: 0x60025F0, symbol: D_SZ_60025F0, tlut: 0x060029F0 } @@ -69,12 +69,12 @@ D_SZ_6002DE0: D_SZ_6002EE0: { type: TEXTURE, ctype: u16, format: TLUT, colors: 80, offset: 0x06002EE0, symbol: D_SZ_6002EE0 } -D_SZ_6002F80: - { type: GFX, offset: 0x6002F80, symbol: D_SZ_6002F80 } +aSzBackgroundDL: + { type: GFX, offset: 0x6002F80, symbol: aSzBackgroundDL } # Sector Z Background -D_SZ_6003010: - { type: TEXTURE, ctype: u16, format: RGBA16, width: 64, height: 32, offset: 0x06003010, symbol: D_SZ_6003010 } +aSzBackgroundTex: + { type: TEXTURE, ctype: u16, format: RGBA16, width: 64, height: 32, offset: 0x06003010, symbol: aSzBackgroundTex } D_SZ_6004010: { type: GFX, offset: 0x6004010, symbol: D_SZ_6004010 } @@ -97,8 +97,8 @@ D_SZ_6004558: D_SZ_6004570: { type: GFX, offset: 0x6004570, symbol: D_SZ_6004570 } -D_SZ_60045E0: - { type: GFX, offset: 0x60045E0, symbol: D_SZ_60045E0 } +aSZSpaceJunk4DL: + { type: GFX, offset: 0x60045E0, symbol: aSZSpaceJunk4DL } D_SZ_60047E0: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x60047E0, symbol: D_SZ_60047E0 } @@ -145,8 +145,8 @@ D_SZ_6006CD8: D_SZ_6006D64: { type: SF64:ANIM, offset: 0x6006D64, symbol: D_SZ_6006D64 } -D_SZ_6006E50: - { type: SF64:SKELETON, offset: 0x6006E50, symbol: D_SZ_6006E50 } +aSzMissileSkel: + { type: SF64:SKELETON, offset: 0x6006E50, symbol: aSzMissileSkel } D_SZ_6006E70: { type: SF64:ENVIRONMENT, offset: 0x6006E70, symbol: D_SZ_6006E70 } @@ -157,8 +157,8 @@ D_SZ_6006EB4: D_SZ_6007558: {type: SF64:COLPOLY, count: 316, offset: 0x6007558, symbol: D_SZ_6007558, mesh_symbol: D_SZ_OFFSET } -D_SZ_6009230: - { type: SF64:HITBOX, offset: 0x6009230, symbol: D_SZ_6009230 } +aSZMissileHitbox: + { type: SF64:HITBOX, offset: 0x6009230, symbol: aSZMissileHitbox } D_SZ_600924C: { type: SF64:HITBOX, offset: 0x600924C, symbol: D_SZ_600924C } diff --git a/assets/yaml/us/rev1/ast_titania.yaml b/assets/yaml/us/rev1/ast_titania.yaml index 63bf8435..829c10bd 100644 --- a/assets/yaml/us/rev1/ast_titania.yaml +++ b/assets/yaml/us/rev1/ast_titania.yaml @@ -28,8 +28,8 @@ D_TI_6001B10: D_TI_6001BA8: {type: TEXTURE, format: RGBA16, ctype: u16, width: 32, height: 32, offset: 0x6001BA8, symbol: D_TI_6001BA8} -D_TI_60023B0: - {type: GFX, offset: 0x60023B0, symbol: D_TI_60023B0} +aTiCactusDL: + {type: GFX, offset: 0x60023B0, symbol: aTiCactusDL} D_TI_6002438: {type: TEXTURE, format: RGBA16, ctype: u16, width: 32, height: 64, offset: 0x6002438, symbol: D_TI_6002438} @@ -82,35 +82,35 @@ D_TI_60064AC: D_TI_60064C8: {type: SF64:HITBOX, offset: 0x60064C8, symbol: D_TI_60064C8} -D_TI_60064FC: - {type: SF64:HITBOX, offset: 0x60064FC, symbol: D_TI_60064FC} +aTiSkullHitbox: + {type: SF64:HITBOX, offset: 0x60064FC, symbol: aTiSkullHitbox} -D_TI_6006518: - {type: SF64:HITBOX, offset: 0x6006518, symbol: D_TI_6006518} +aTiRib0Hitbox: + {type: SF64:HITBOX, offset: 0x6006518, symbol: aTiRib0Hitbox} -D_TI_6006564: - {type: SF64:HITBOX, offset: 0x6006564, symbol: D_TI_6006564} +aTiRib1Hitbox: + {type: SF64:HITBOX, offset: 0x6006564, symbol: aTiRib1Hitbox} -D_TI_60065B0: - {type: SF64:HITBOX, offset: 0x60065B0, symbol: D_TI_60065B0} +aTiRib2Hitbox: + {type: SF64:HITBOX, offset: 0x60065B0, symbol: aTiRib2Hitbox} -D_TI_60065FC: - {type: SF64:HITBOX, offset: 0x60065FC, symbol: D_TI_60065FC} +aTiRib3Hitbox: + {type: SF64:HITBOX, offset: 0x60065FC, symbol: aTiRib3Hitbox} -D_TI_6006648: - {type: SF64:HITBOX, offset: 0x6006648, symbol: D_TI_6006648} +aTiRib4Hitbox: + {type: SF64:HITBOX, offset: 0x6006648, symbol: aTiRib4Hitbox} -D_TI_6006694: - {type: SF64:HITBOX, offset: 0x6006694, symbol: D_TI_6006694} +aTiRib5Hitbox: + {type: SF64:HITBOX, offset: 0x6006694, symbol: aTiRib5Hitbox} -D_TI_60066E0: - {type: SF64:HITBOX, offset: 0x60066E0, symbol: D_TI_60066E0} +aTiRib6Hitbox: + {type: SF64:HITBOX, offset: 0x60066E0, symbol: aTiRib6Hitbox} -D_TI_600672C: - {type: SF64:HITBOX, offset: 0x600672C, symbol: D_TI_600672C} +aTiRib7Hitbox: + {type: SF64:HITBOX, offset: 0x600672C, symbol: aTiRib7Hitbox} -D_TI_6006778: - {type: SF64:HITBOX, offset: 0x6006778, symbol: D_TI_6006778} +aTiRib8Hitbox: + {type: SF64:HITBOX, offset: 0x6006778, symbol: aTiRib8Hitbox} D_TI_60067C4: {type: SF64:HITBOX, offset: 0x60067C4, symbol: D_TI_60067C4} @@ -133,8 +133,8 @@ D_TI_6006874: D_TI_6006890: {type: SF64:HITBOX, offset: 0x6006890, symbol: D_TI_6006890} -D_TI_60068BC: - {type: SF64:HITBOX, offset: 0x60068BC, symbol: D_TI_60068BC} +aTiCactusHitbox: + {type: SF64:HITBOX, offset: 0x60068BC, symbol: aTiCactusHitbox} D_TI_60068F0: {type: SF64:HITBOX, offset: 0x60068F0, symbol: D_TI_60068F0} diff --git a/assets/yaml/us/rev1/ast_zoness.yaml b/assets/yaml/us/rev1/ast_zoness.yaml index 9a7e21ee..406db142 100644 --- a/assets/yaml/us/rev1/ast_zoness.yaml +++ b/assets/yaml/us/rev1/ast_zoness.yaml @@ -471,8 +471,8 @@ D_ZO_6024220: D_ZO_60242B8: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x60242B8, symbol: D_ZO_60242B8} -D_ZO_6024AC0: - { type: GFX, offset: 0x6024AC0, symbol: D_ZO_6024AC0} +aZoRock1DL: + { type: GFX, offset: 0x6024AC0, symbol: aZoRock1DL} D_ZO_6024D60: { type: TEXTURE, ctype: u16, format: RGBA16, width: 32, height: 32, offset: 0x6024D60, symbol: D_ZO_6024D60} @@ -502,8 +502,8 @@ D_ZO_602AC50: D_ZO_602AE94: { type: ARRAY, count: 242, array_type: Vec3f, offset: 0x602AE94, symbol: D_ZO_602AE94} -D_ZO_602B9EC: - { type: SF64:HITBOX, offset: 0x602B9EC, symbol: D_ZO_602B9EC} +aZoRock1Hitbox: + { type: SF64:HITBOX, offset: 0x602B9EC, symbol: aZoRock1Hitbox} D_ZO_602BA20: { type: SF64:HITBOX, offset: 0x602BA20, symbol: D_ZO_602BA20} diff --git a/include/fox_co.h b/include/fox_co.h new file mode 100644 index 00000000..7ffad414 --- /dev/null +++ b/include/fox_co.h @@ -0,0 +1,162 @@ +#ifndef FOX_CO_H +#define FOX_CO_H + +// Granga Boss: + +#define DMG_FLICKER_5 (5) // Damage indicator flickers for 5 frames +#define DMG_FLICKER_15 (15) // Damage indicator flickers for 15 frames +#define DMG_DESTROYED (1000) // Damage part is destroyed + +typedef enum GrangaStates { + /* 0 */ GRANGA_STATIONARY, + /* 1 */ GRANGA_STATE_1, + /* 2 */ GRANGA_STATE_2, + /* 3 */ GRANGA_STATE_3, + /* 4 */ GRANGA_STATE_4, + /* 5 */ GRANGA_STATE_5, + /* 6 */ GRANGA_STATE_6, + /* 7 */ GRANGA_STATE_7, +} GrangaStates; + +typedef enum GrangaWork { + /* 00 */ GRANGA_WORK_00, // x of missiles launched from it's right arm ? + /* 01 */ GRANGA_WORK_01, // y of missiles launched from it's right arm ? + /* 02 */ GRANGA_WORK_02, // z of missiles launched from it's right arm ? + /* 03 */ GRANGA_WORK_03, // x of something // destroy effect related? + /* 04 */ GRANGA_WORK_04, // y of something // destroy effect related? + /* 05 */ GRANGA_WORK_05, // z of something // destroy effect related? + /* 06 */ GRANGA_WORK_06, // x of missiles launched from it's left arm ? + /* 07 */ GRANGA_WORK_07, // y of missiles launched from it's left arm ? + /* 08 */ GRANGA_WORK_08, // z of missiles launched from it's left arm ? + /* 09 */ GRANGA_WORK_09, + /* 10 */ GRANGA_WORK_10, + /* 11 */ GRANGA_WORK_11, + /* 12 */ GRANGA_WORK_12, + /* 13 */ GRANGA_WORK_13, + /* 14 */ GRANGA_WORK_14, + /* 15 */ GRANGA_WORK_15, + /* 16 */ GRANGA_WORK_16, // yRot of missiles launched from both arms ? + /* 17 */ GRANGA_WORK_17, // x of something + /* 18 */ GRANGA_WORK_18, // y of something + /* 19 */ GRANGA_WORK_19, // z of something + /* 20 */ GRANGA_WORK_20, + /* 21 */ GRANGA_WORK_21, + /* 22 */ GRANGA_WORK_22, + /* 23 */ GRANGA_WORK_23, + /* 24 */ GRANGA_WORK_24, + /* 25 */ GRANGA_WORK_25, + /* 26 */ GRANGA_WORK_26, + /* 27 */ GRANGA_WORK_27, + /* 28 */ GRANGA_WORK_28, + /* 29 */ GRANGA_WORK_29, + /* 30 */ GRANGA_WORK_30, + /* 31 */ GRANGA_WORK_31, + /* 32 */ GRANGA_WORK_32, + /* 33 */ GRANGA_WORK_33, + /* 34 */ GRANGA_WORK_34, + /* 35 */ GRANGA_WORK_35, + /* 36 */ GRANGA_WORK_36, + /* 37 */ GRANGA_WORK_37, + /* 38 */ GRANGA_WORK_38, + /* 39 */ GRANGA_WORK_39, + /* 40 */ GRANGA_WORK_40, + /* 41 */ GRANGA_WORK_41, + /* 42 */ GRANGA_WORK_42, + /* 43 */ GRANGA_WORK_43, + /* 44 */ GRANGA_WORK_44, + /* 45 */ GRANGA_WORK_45, + /* 46 */ GRANGA_WORK_46, + /* 47 */ GRANGA_WORK_47, + /* 48 */ GRANGA_WORK_48, + /* 49 */ GRANGA_WORK_49, + /* 50 */ GRANGA_WORK_50, + /* 51 */ GRANGA_WORK_51, + /* 52 */ GRANGA_WORK_52, + /* 53 */ GRANGA_WORK_53, + /* 54 */ GRANGA_WORK_54, + /* 55 */ GRANGA_WORK_55, + /* 56 */ GRANGA_WORK_56, + /* 57 */ GRANGA_WORK_57, + /* 58 */ GRANGA_WORK_58, + /* 59 */ GRANGA_WORK_59, + /* 60 */ GRANGA_WORK_60, + /* 61 */ GRANGA_WORK_61, + /* 62 */ GRANGA_WORK_62, // x + /* 63 */ GRANGA_WORK_63, // y + /* 64 */ GRANGA_WORK_64, // z + /* 65 */ GRANGA_WORK_65, + /* 66 */ GRANGA_WORK_66, // xTargetPos ? + /* 67 */ GRANGA_WORK_67 // zTargetPos ? +} GrangaWork; + +typedef enum GrangaSwork { + /* 00 */ GRANGA_SWK_0, + + // Damage indicators, one per limb + /* 01 */ GRANGA_RIGHT_ARM_DMG_IND, + /* 02 */ GRANGA_LEFT_ARM_DMG_IND, + /* 03 */ GRANGA_GUN_DMG_IND, + /* 04 */ GRANGA_RIGHT_LEG_DMG_IND, + /* 07 */ GRANGA_LEFT_LEG_DMG_IND = 7, + /* 10 */ GRANGA_BACKPACK_DMG_IND = 10, + + /* 18 */ GRANGA_SWK_18 = 18, + /* 19 */ GRANGA_SWK_19, + /* 20 */ GRANGA_SWK_20, + /* 21 */ GRANGA_SWK_21, + /* 22 */ GRANGA_SWK_22, + /* 23 */ GRANGA_SWK_23, + + /* 24 */ GRANGA_LEFT_LEG_HP, + /* 25 */ GRANGA_RIGHT_LEG_HP, + /* 26 */ GRANGA_LEFT_ARM_HP, + /* 27 */ GRANGA_RIGHT_ARM_HP, + /* 28 */ GRANGA_PLASMA_GUN_HP, + /* 29 */ GRANGA_BACKPACK_HP, + + /* 30 */ GRANGA_ATTACK_STATE, + /* 31 */ GRANGA_NEXT_STATE, + /* 32 */ GRANGA_SWK_32, + /* 33 */ GRANGA_INIT, + /* 35 */ GRANGA_MISSILE_COUNT = 35, + /* 36 */ GRANGA_1UP_CHECK +} GrangaSwork; + +typedef enum GrangaFwork { + /* 00 */ GRANGA_FWK_00, + /* 01 */ GRANGA_FWK_01, + /* 02 */ GRANGA_FWK_02, + /* 03 */ GRANGA_FWK_03, + /* 04 */ GRANGA_FWK_04, + /* 12 */ GRANGA_FWK_12 = 12, + /* 13 */ GRANGA_FWK_13, + /* 14 */ GRANGA_FWK_14, +} GrangaFwork; + +typedef enum GrangaDmgParts { + /* 0 */ GRANGA_DMG_BACKPACK, + /* 1 */ GRANGA_DMG_LEFT_ARM, + /* 2 */ GRANGA_DMG_RIGHT_ARM, + /* 3 */ GRANGA_DMG_GUN, + /* 4 */ GRANGA_DMG_LEFT_LEG, + /* 5 */ GRANGA_DMG_RIGHT_LEG, +} GrangaDmgParts; + +typedef enum GrangaAttackState { + /* 0 */ GRANGA_ATTACK_IDLE, + /* 1 */ GRANGA_ATTACK_MISSILES, + /* 2 */ GRANGA_ATTACK_LASERS, + /* 3 */ GRANGA_ATTACK_PLASMA, +} GrangaAttackState; + + +// Carrier Boss: + +typedef enum CoCarrierParts { + /* 0 */ CARRIER_0, + /* 1 */ CARRIER_1, + /* 2 */ CARRIER_2, + /* 3 */ CARRIER_3 +} CarrierParts; + +#endif diff --git a/include/functions.h b/include/functions.h index 717a5235..e0c9f879 100644 --- a/include/functions.h +++ b/include/functions.h @@ -25,7 +25,7 @@ void ActorAllRange_SetShadowData(Actor* this); void ActorAllRange_SpawnTeam(void); void ActorAllRange_PlayMessage(u16* msg, RadioCharacterId character); void ActorAllRange_UpdateStarWolfEvents(Actor*); -void ActorAllRange_UpdateEvemyEvents(Actor*); +void ActorAllRange_UpdateEnemyEvents(Actor*); void ActorAllRange_ApplyDamage(Actor*); bool func_360_80031900(Actor*); void ActorAllRange_Update(Actor* this); @@ -50,7 +50,7 @@ void Background_dummy_80040CDC(void); void Background_DrawGround(void); // fox_boss -void Boss_AwardBonus(Boss* boss); +void Boss_AwardBonus(Boss* this); void Boss299_Init(Boss* boss); void Boss299_Update(Boss* boss); void Boss299_Draw(Boss* boss); @@ -92,10 +92,10 @@ void func_display_80057814(Player*); void Play_Draw(void); // fox_edata -void func_edata_800594F0(Scenery*); -void func_edata_800595D0(Scenery*); +void Scenery48_Draw(Scenery*); +void Scenery49_Draw(Scenery*); void Object_ApplyWaterDistortion(void); -void func_edata_800596B0(Actor*); +void Actor289_Draw(Actor*); // fox_edisplay void Graphics_SetScaleMtx(f32); @@ -104,22 +104,22 @@ void Actor201_Draw(Actor*); void Actor202_Draw(Actor*); void MeteoTunnel_Draw(Scenery*); void Scenery_DrawTitaniaBones(Scenery*); -void Scenery42_Draw(Scenery*); +void CoIBeam_Draw(Scenery*); void Actor196_Draw(Actor*); void Sprite167_Draw(Sprite*); void FogShadow_Draw(Sprite*); -void func_edisplay_80059F68(Scenery*); -void func_edisplay_80059FDC(Scenery*); +void CoBuilding9_Draw(Scenery*); +void CoBuilding10_Draw(Scenery*); void ActorDebris_Draw(Actor*); void Actor_DrawEngineAndContrails(Actor*); void Actor_DrawEngineGlow(Actor*, s32); void func_edisplay_8005B388(Actor*); -void func_edisplay_8005B6A4(Actor*); -void func_edisplay_8005B71C(Actor*); -void func_edisplay_8005B7CC(Actor*); -void func_edisplay_8005B848(Actor*); -void func_edisplay_8005B9A4(Actor*); -void func_edisplay_8005BA30(Actor*); +void Actor180_Draw(Actor*); +void Actor182_Draw(Actor*); +void Actor186_Draw(Actor*); +void Actor190_191_Draw(Actor*); +void Actor192_Draw(Actor*); +void Actor193_Draw(Actor*); void ItemCheckpoint_Draw(Item*); void ItemSilverRing_Draw(Item*); void ItemSilverStar_Draw(Item*); @@ -160,20 +160,20 @@ void func_enmy_80062C38(f32, f32); bool Object_CheckHitboxCollision(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 yRot, f32 zRot); bool Object_CheckSingleHitbox(Vec3f*, f32*, Vec3f*); bool Object_CheckPolyCollision(Vec3f* , Vec3f* , ObjectId , Object* ); -s32 Object_CheckCollision(s32 , Vec3f* , Vec3f* , s32 ); +s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode); void Scenery_UpdateTitaniaBones(Scenery*); void func_enmy_800654E4(Object*); -void func_enmy_800656D4(Actor*); +void Actors190_191_Update(Actor*); void func_enmy_800660F0(Actor*); void Actor_Despawn(Actor*); -void func_enmy_8006654C(Actor*); +void Actor192_Update(Actor*); void func_enmy_8006684C(Actor*); -void func_enmy_800669A0(Actor*); -void func_enmy_80066A80(Actor*); +void Actor193_Update(Actor*); +void Actor180_Update(Actor*); void func_enmy_80066C00(Scenery*); -void func_enmy_80066D5C(Scenery*); +void CoBuilding9_Update(Scenery*); void Sprite167_Update(Sprite*); -void func_enmy_80066EA8(Scenery*); +void SceneryRotateTowardsCamera(Scenery*); void Item_CheckBounds(Item*); void Item_SpinPickup(Item*); void Actor_SpawnDebris70(f32, f32, f32, f32, f32, f32, f32, f32); @@ -212,18 +212,19 @@ void Object_Update(void); //fox_enmy2 void Actor237_Update(Actor*); void Actor237_Draw(Actor*); -void Scenery54_Update(Scenery*); +void CoWaterfall_Update(Scenery*); void Actor201_Update(Actor*); void Actor202_Update(Actor*); void Actor194_Update(Actor*); void Actor194_Dying(Actor*); void Actor194_Draw(Actor*); -void Scenery42_Update(Scenery*); +void CoIBeam_Update(Scenery*); void Actor196_Update(Actor*); void ActorDebris_Update(Actor*); void MeteoTunnel_Update(Scenery*); void Actor_SetupPlayerShot(PlayerShotId, PlayerShot*, s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); -void Actor_SpawnPlayerLaser(s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); +void Actor_SpawnPlayerLaser(s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, + f32 zRot); void Actor_SpawnGreatFoxLaser(s32 actorId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, f32 zRot); void ActorEvent_SpawnEffect347(f32 xPos, f32 yPos, f32 zPos, f32 scale1); @@ -243,78 +244,78 @@ void BonusText_Update(void); void BonusText_DrawAll(void); Effect* func_effect_8007783C(ObjectId objId); void func_effect_8007797C(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2); -void func_effect_80077A00(Effect* ); -void func_effect_80077A7C(Effect* ); -void func_effect_80077B78(Effect* ); -void func_effect_80077B84(Effect* ); -void func_effect_80078038(Effect* ); -void func_effect_800780F8(Effect* ); -void func_effect_800783C0(Effect* ); -void func_effect_80078438(Effect* ); -void func_effect_800784B4(Effect* ); -void func_effect_80078550(Effect* ); -void func_effect_80078604(Effect* ); -void func_effect_8007868C(Effect* ); -void func_effect_8007879C(Effect* ); -void func_effect_800788B0(Effect* ); -void func_effect_80078A64(Effect* ); -void func_effect_80078AEC(Effect* ); -void func_effect_80078B8C(Effect*); -void func_effect_80078BE0(Effect* ); -void func_effect_80078C84(Effect* ); -void func_effect_80078CE8(Effect* ); +void Effect_Effect372_Draw(Effect* ); +void Effect_Effect382_Draw(Effect* ); +void Effect_Effect388_Draw(Effect* ); +void Effect_Effect384_Draw(Effect* ); +void Effect_Effect385_Draw(Effect* ); +void Effect_Effect389_Draw(Effect* ); +void Effect_Effect347_Draw(Effect* ); +void Effect_Effect351_Draw(Effect* ); +void Effect_Clouds_Draw(Effect* ); +void Effect_Effect366_Draw(Effect* ); +void Effect_Effect367_Draw(Effect* ); +void Effect_Effect344_Draw(Effect* ); +void Effect_Effect345_Draw(Effect* ); +void Effect_Effect346_Draw(Effect* ); +void Effect_Effect348_Draw(Effect* ); +void Effect_Effect355_Draw(Effect* ); +void Effect_Effect353_Draw(Effect*); +void Macbeth_Effect377_Draw(Effect* ); +void Effect_Effect356_Draw(Effect* ); +void Macbeth_Effect376_Draw(Effect* ); void func_effect_80078E50(f32 xPos, f32 yPos, f32 zPos, f32 scale2); -void func_effect_80078EBC(Effect* ); -void func_effect_80078F78(Effect* ); +void Effect_Effect393_Update(Effect* ); +void Effect_Effect393_Draw(Effect* ); void func_effect_800794CC(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_8007953C(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_800795AC(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_80079618(f32 xPos, f32 yPos, f32 zPos, f32 scale2); -void func_effect_8007968C(Effect*); -void func_effect_800798F0(Effect* ); -void func_effect_8007A28C(Effect* ); -void func_effect_8007A3C0(Effect* ); +void Effect_Effect357_Update(Effect*); +void Effect_Effect357_Draw(Effect* ); +void Effect_Effect383_Update(Effect* ); +void Effect_Effect383_Draw(Effect* ); void func_effect_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 scale1); -void func_effect_8007A5F8(Effect* , Vec3f* pos, u32 sfxId); -void func_effect_8007A6F0(Vec3f* pos, s32 sfxId); -void func_effect_8007A748(Effect*); +void Effect_SetupTimedSfxAtPos(Effect* , Vec3f* pos, u32 sfxId); +void Effect_SpawnTimedSfxAtPos(Vec3f* pos, s32 sfxId); +void Effect_TimedSfx_Update(Effect*); bool func_effect_8007A774(Player*, Effect*, f32); void func_effect_8007A900(f32 xPos, f32 yPos, f32 zPos, f32 scale1, u8, u8, u16); -void func_effect_8007A994(Effect*); -void func_effect_8007AA60(Effect*); -void func_effect_8007AB50(Effect*); +void Effect_Effect359_Update(Effect359*); +void Effect_Effect359_Draw(Effect*); +void Effect_Effect372_Update(Effect*); void func_effect_8007ACE0(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, f32 yRot); void func_effect_8007ADF4(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1); void func_effect_8007AFD0(f32 xPos, f32 zPos, f32 xVel, f32 zVel, f32 scale1); -void func_effect_8007B040(Effect*); -void func_effect_8007B0F4(Effect*); +void Effect_Effect382_Update(Effect*); +void Effect_Effect381_Update(Effect*); void func_effect_8007B228(f32 xPos, f32 yPos, f32 zPos, f32 scale1); void func_effect_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 ); -void func_effect_8007B3B8(Effect*); +void Effect_Effect384_Update(Effect*); void func_effect_8007B550(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 ); -void func_effect_8007B5C0(Effect*); -void func_effect_8007B62C(Effect*); -void func_effect_8007B670(Effect*); -void func_effect_8007B67C(Effect*); -void func_effect_8007B758(Effect*); +void Effect_Effect385_Update(Effect*); +void Effect_Clouds_Update(Effect*); +void Effect_Effect388_Update(Effect*); +void Effect_Effect389_Update(Effect*); +void Effect_Effect347_Update(Effect*); void func_effect_8007B8F8(f32 xPos, f32 yPos, f32 zPos, f32 scale2); -void func_effect_8007B960(Effect*); +void Effect_Effect364_Update(Effect*); void func_effect_8007BC7C(f32 xPos, f32 yPos, f32 zPos, f32 scale2); -void func_effect_8007BCE8(Effect*); -void func_effect_8007B9DC(Effect*); -void func_effect_8007BDE0(Effect*); -void func_effect_8007BE54(Effect*); -void func_effect_8007BEE8(Effect*); +void Effect_Effect362_Update(Effect*); +void Effect_Effect364_Draw(Effect*); +void Effect_Effect361_Update(Effect*); +void Effect_Effect360_Update(Effect*); +void Effect_Effect360_361_362_Draw(Effect*); void func_effect_8007BFFC(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 timer50); void func_effect_8007C120(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 timer50); -void func_effect_8007C250(Effect*); +void Effect_Effect386_Update(Effect*); void func_effect_8007C484(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 arg7); -void func_effect_8007C50C(Effect*); +void Effect_Effect390_Update(Effect*); void func_effect_8007C688(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50); -void func_effect_8007C8C4(Effect*); +void Effect_Effect387_Update(Effect*); void func_effect_8007C85C(f32 xPos, f32 yPos, f32 zPos, f32 scale2); -void func_effect_8007C9E0(Effect*); -void func_effect_8007CAF0(Effect*); +void Effect_Effect343_Update(Effect*); +void Effect_Effect343_Draw(Effect*); void func_effect_8007CF30(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_8007D074(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_8007D0E0(f32 xPos, f32 yPos, f32 zPos, f32 scale2); @@ -322,54 +323,54 @@ void func_effect_8007D10C(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_8007D1E0(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_8007D24C(f32 xPos, f32 yPos, f32 zPos, f32 scale2); void func_effect_8007D2C8(f32 xPos, f32 yPos, f32 zPos, f32 scale2); -void func_effect_8007D2F4(Effect*); -void func_effect_8007D55C(Effect*); -void func_effect_8007D748(Effect*); -void func_effect_8007D8A8(Effect*); +void Effect_Effect339_Update(Effect*); +void Effect_FireSmoke_Draw(Effect*); +void Effect_Effect340_Update(Effect*); +void Effect_Effect341_Update(Effect*); void func_effect_8007D9DC(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, s32 timer50); -void func_effect_8007DA58(Effect*); -void func_effect_8007DAE4(Effect*); -void func_effect_8007DB70(Effect*); -void func_effect_8007DED4(Effect*); -void func_effect_8007E014(Effect*); -void func_effect_8007E258(Effect*); -void func_effect_8007E298(Effect*); -void func_effect_8007E330(Effect*); -void func_effect_8007E3E4(Effect*); -void func_effect_8007E45C(Effect*); -void func_effect_8007E5CC(Effect*); -void func_effect_8007E648(Effect*); -void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed); +void Effect_Effect375_Update(Effect*); +void Macbeth_Effect375_Draw(Effect*); +void Effect_Effect374_Update(Effect*); +void Macbeth_Effect374_Draw(Effect*); +void Effect_Effect344_Update(Effect*); +void Effect_Effect345_Update(Effect*); +void Effect_Effect342_Update(Effect*); +void Effect_Effect342_Draw(Effect*); +void Effect_Effect351_Update(Effect*); +void Effect_Effect365_Update(Effect*); +void Effect_Effect365_Draw(Effect*); +void Effect_Effect367_Update(Effect*); +void func_effect_8007E93C(Effect* this, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed); void func_effect_8007EE68(ObjectId objId, Vec3f* pos, Vec3f* rot, Vec3f* arg3, Vec3f* arg4, f32 scale2); void func_effect_8007F04C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 unkX, f32 unkY, f32 unkZ, f32 xVel, f32 yVel, f32 zVel, f32 scale2); -void func_effect_8007F11C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed); +void Effect_EnemyLaser(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed); void func_effect_8007F20C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed); -void func_effect_8007F438(Effect*); -void func_effect_8007F6B0(Effect*); -void func_effect_8007F958(Effect*); -void func_effect_8007FBE0(Effect*); -void func_effect_8007FE88(Effect*); +void Effect_Effect346_Update(Effect*); +void Effect_Effect348_Update(Effect*); +void Effect_Effect349_Update(Effect*); +void Effect_Effect350_Update(Effect*); +void Effect_Effect353_354_Update(Effect*); bool func_effect_8007FD84(Effect*); -void func_effect_800802B8(Effect*); -void func_effect_800802D8(Effect*); -void func_effect_800802F8(Effect*); -void func_effect_80080360(Effect*); -void func_effect_8008040C(Effect*); -void func_effect_8008092C(Effect*); -void func_effect_80080ACC(Effect*); -void func_effect_80080D04(Effect*); +void Effect_Effect355_Update(Effect*); +void Effect_Effect377_Update(Effect*); +void Effect_Effect356_Update(Effect*); +void Effect_Effect376_Update(Effect*); +void Effect_Effect398_Update(Effect*); +void Effect_Effect398_Draw(Effect*); +void Effect_Effect394_Update(Effect*); +void Effect_Effect394_Draw(Effect*); void func_effect_800815DC(void); void func_effect_80081A8C(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 arg4); void func_effect_80081BEC(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 arg4); -void func_effect_80081C5C(Effect*); -void func_effect_80082F78(Effect*); +void Effect_Effect395_Update(Effect*); +void Effect_Effect395_Draw(Effect*); void func_effect_8008377C(f32, f32, f32, f32, f32); -void func_effect_800837EC(Effect*); -void func_effect_80083B8C(Effect*); -void func_effect_80083C70(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 arg7, s32 arg8); +void Effect_Effect391_Update(Effect*); +void Effect_Effect391_Draw(Effect*); +void func_effect_80083C70(Effect* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 arg7, s32 arg8); void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ); -void func_effect_80083FA8(Effect*); -void func_effect_80084194(Effect*); +void Effect_Effect399_Update(Effect*); +void Effect_Effect399_Draw(Effect*); // fox_fade void Wipe_Draw(WipeMode mode, s32 frame); @@ -385,7 +386,7 @@ void func_hud_80087530(f32, f32, s32); void func_hud_800884E4(void); void func_hud_80088564(void); void HUD_DrawStatusScreens(void); -s32 func_hud_8008AC54(s32); +s32 Hud_MissileSeekModeCheck(s32); void func_hud_8008AD94(void); void func_hud_8008B5B0(f32 x, f32 y); s32 func_hud_8008B774(void); @@ -419,8 +420,8 @@ void func_hud_800953A0(Actor*, s32); void func_hud_8009546C(Actor*, s32); void func_hud_80095538(Actor*, s32); void HUD_AquasComplete(Player*); -void func_hud_80094954(Effect*); -void func_hud_80094BBC(Effect*); +void Hud_Effect363_Update(Effect*); +void Hud_Effect363_Draw(Effect*); void func_hud_80094D20(f32, f32); void func_hud_80096A74(Player* player); @@ -465,12 +466,12 @@ void Player_UpdateArwingRoll(Player*); void Player_ArwingBoost(Player*); void Camera_UpdateArwingOnRails(Player*); void Camera_UpdateCockpitOnRails(Player*, s32); -void Camera_FollowPlayer(Player*, s32 , bool ); -void Camera_UpdateArwing360(Player*, s32); +void Camera_FollowPlayer(Player*, s32 , bool); +void Camera_UpdateArwing360(Player*, bool); void Camera_UpdateTank360(Player*, s32 ); void Camera_UpdateOnFoot360(Player*, s32 ); void Camera_SetStarfieldPos(f32, f32, f32, f32, f32, f32); -void Camera_Update360(Player*, s32); +void Camera_Update360(Player*, bool); void Camera_SetupLights(Player*); void Play_SpawnVsItem(ObjectId , Item*); void Play_Main(void); diff --git a/include/i1.h b/include/i1.h index ba1ce7fe..42dced9d 100644 --- a/include/i1.h +++ b/include/i1.h @@ -14,50 +14,50 @@ extern void Corneria_LevelStart(Player*); extern void Corneria_LevelComplete1(Player*); extern void Venom1_LevelStart(Player*); -void Corneria_801875A4(Sprite*); -void Corneria_80189058(Boss*); -void Corneria_8018AA74(Boss*); -void Corneria_8018AED0(Actor*); -void Corneria_8018B15C(Actor*); -void Corneria_8018B418(Actor*); -void Corneria_8018B58C(Actor*); -void Corneria_8018BAAC(Actor*); -void Corneria_8018BBA4(Actor*); -void Corneria_8018BBF8(Actor*); -void Corneria_8018BD7C(Actor*); -void Corneria_8018C19C(Boss*); -void Corneria_8018DDAC(Boss*); -void Corneria_8018E290(Boss*); -void Corneria_8018E76C(Boss*); -void Corneria_8018ECAC(Boss*); -void Corneria_8018ED78(Boss*); -void Corneria_8018EE84(Boss*); -void Corneria_8018EF90(Boss*); -void Corneria_8018F044(Scenery*); -void Corneria_8018F31C(Scenery*); +void Corneria_Smoke_Update(Sprite*); +void Corneria_Granga_Update(Granga*); +void Corneria_Granga_Draw(Granga*); +void Corneria_CoGaruda1_Update(CoGaruda1*); +void Corneria_CoGaruda2_Update(CoGaruda2*); +void Corneria_CoGaruda3_Update(CoGaruda3*); +void Corneria_CoGarudaDestroy_Update(CoGarudaDestroy*); +void Corneria_CoGaruda1_Draw(CoGaruda1*); +void Corneria_CoGaruda2_Draw(CoGaruda2*); +void Corneria_CoGaruda3_Draw(CoGaruda3*); +void Corneria_CoGarudaDestroy_Draw(CoGarudaDestroy*); +void Corneria_Carrier_Update(Carrier*); +void Corneria_Boss294_Update(Boss294*); +void Corneria_Boss295_Update(Boss295*); +void Corneria_Boss296_Update(Boss296*); +void Corneria_Carrier_Draw(Carrier*); +void Corneria_Boss294_Draw(Boss294*); +void Corneria_Boss295_Draw(Boss295*); +void Corneria_Boss296_Draw(Boss296*); +void Corneria_Doors_Update(Scenery*); +void Corneria_Doors_Draw(Scenery*); void Venom1_BossTrigger1_Update(Sprite*); void Venom1_BossTrigger2_Update(Sprite*); void Venom1_BossTrigger3_Update(Sprite*); void Venom1_BossTrigger4_Update(Sprite*); -void Venom1_80192518(Actor*); -void Venom1_80192CD4(Actor*); -void Venom1_80192E2C(Actor*); -void Venom1_80192EB0(Actor*); -void Venom1_801933DC(Actor*); -void Venom1_801934D0(Actor*); -void Venom1_80193540(Scenery*); +void Venom1_Actor280_Update(Actor*); +void Venom1_Doodad_Update(Actor*); +void Venom1_Actor281_Draw(Actor*); +void Venom1_Actor283_Update(Actor*); +void Venom1_Actor284_Update(Actor*); +void Venom1_Actor284_Draw(Actor*); +void Venom1_Scenery52_Update(Scenery*); void Venom1_Boss_Update(Boss*); void Venom1_Boss_Draw(Boss*); void Training_ItemRing_Update(Item*); void OvlI1_CallFunction(s32, void*); -void Corneria_80187530(Scenery*); -void Corneria_8018753C(Scenery*); -void Corneria_Boss292_Init(Boss *); -void Corneria_8018B0B4(Actor *); -void Corneria_Boss293_Init(Boss *); -void Corneria_8018ED78(Boss*); -void Venom1_801924A8(Scenery* ); +void Corneria_BuildingOnFire_Update(Scenery*); +void Corneria_BuildingOnFire_Draw(Scenery*); +void Corneria_Granga_Init(Boss *); +void Corneria_IBeam_Init(Actor *); +void Corneria_Carrier_Init(Carrier *); +void Corneria_Boss294_Draw(Boss*); +void Venom1_Scenery127_Update(Scenery* ); void Venom1_8019250C(Actor *); void Venom1_80192CB0(Actor *); void Venom1_80192EA4(Actor *); @@ -65,9 +65,9 @@ void Venom1_801933B4(Actor *); void Venom1_Boss319_Init(Boss *); void Venom1_80198310(Boss *); void Venom1_80198594(Boss *); -void Training_801988E0(void); +void Training_RingPassCount_Draw(void); void Training_Setup360(void); -void Training_8019949C(void); +void Training_SpawnEnemies(void); void Venom1_8019864C(PlayerShot*); #endif diff --git a/include/i2.h b/include/i2.h index 326cfe64..92d7b465 100644 --- a/include/i2.h +++ b/include/i2.h @@ -18,31 +18,31 @@ void Meteo_80187B08(Actor *); void Meteo_Boss297_Init(Boss *); void Meteo_8018CCF8(Actor *); -void Meteo_8018756C(Actor*); -void Meteo_80187650(Actor*); -void Meteo_801877C4(Actor*); -void Meteo_8018795C(Actor*); -void Meteo_80188344(Boss*); -void Meteo_801887D0(Boss*); -void Meteo_80188CAC(Effect*); -void Meteo_80188FAC(Effect*); -void Meteo_80189114(Effect*); -void Meteo_8018978C(Boss*); -void Meteo_8018BACC(Boss*); -void Meteo_8018D9EC(Actor*); -void Meteo_8018DA6C(Actor*); -void Meteo_8018DAEC(Actor*); -void Meteo_8018DB6C(Actor*); -void Meteo_8018DBEC(Effect*); -void Meteo_8018DCE4(Effect*); -void Meteo_8018DE14(Effect*); -void SectorX_8018F330(Actor*); -void SectorX_8018F884(Actor*); -void SectorX_8018FE38(Boss*); -void SectorX_8018FF20(Boss*); -void SectorX_8018FF84(Boss*); -void SectorX_80190020(Boss*); -void SectorX_80190078(Boss*); -void SectorX_80193434(Boss*); +void Meteo_Actor181_Update(Actor*); +void Meteo_Actor182_Update(Actor*); +void Meteo_Actor187_Update(Actor*); +void Meteo_Actor186_Update(Actor*); +void Meteo_Boss298_Update(Boss*); +void Meteo_Boss298_Draw(Boss*); +void Meteo_Effect369_Update(Effect*); +void Meteo_Effect370_Update(Effect*); +void Meteo_Effect371_Update(Effect*); +void Meteo_Boss297_Update(Boss*); +void Meteo_Boss297_Draw(Boss*); +void Meteo_ActorDoodad_Update(Actor*); +void Meteo_Actor183_Draw(Actor*); +void Meteo_Actor184_Draw(Actor*); +void Meteo_Actor185_Draw(Actor*); +void Meteo_Effect370_Draw(Effect*); +void Meteo_Effect369_Draw(Effect*); +void Meteo_Effect371_Draw(Effect*); +void SectorX_Slippy_Update(Actor*); +void SectorX_Slippy_Draw(Actor*); +void SectorX_Boss304_Update(Boss*); +void SectorX_Boss305_Update(Boss*); +void SectorX_Boss304_Draw(Boss*); +void SectorX_Boss305_Draw(Boss*); +void SectorX_Boss_Update(Boss*); +void SectorX_Boss_Draw(Boss*); #endif diff --git a/include/i3.h b/include/i3.h index f9ece938..5d70bdc9 100644 --- a/include/i3.h +++ b/include/i3.h @@ -13,7 +13,6 @@ void Aquas_801BE034(Actor*); void Area6_8018DA58(Actor*); void Zoness_8019E5F0(Actor*); -void Solar_801A8BE8(Actor*); void Aquas_BlueMarineDown(Player*); void Aquas_801BE0F0(Actor*); @@ -25,67 +24,67 @@ void Area6_LevelStart(Player *player); void Area6_LevelComplete(Player*); void Zoness_SpawnDebris(Vec3f*, Vec3f*, f32, f32, f32, s32, f32, s32, s32); -void Zoness_80190430(Actor* actor); -void Zoness_801904CC(Actor* actor); -void Zoness_80190A00(Actor* actor); -void Zoness_80190F08(Actor* actor); -void Zoness_80191010(Actor* actor); -void Zoness_801914C4(Actor* actor); -void Zoness_801915A4(Actor* actor); -void Zoness_80191680(Actor* actor); -void Zoness_80191B4C(Actor* actor); +void Zoness_Actor235_Draw(Actor235* this); +void Zoness_Actor235_Update(Actor235* this); +void Zoness_Actor236_Update(Actor* this); +void Zoness_Actor236_Draw(Actor* this); +void Zoness_Actor238_Update(Actor* this); +void Zoness_Actor238_Draw(Actor* this); +void Zoness_801915A4(Actor* this); +void Zoness_Actor240_Update(Actor* this); +void Zoness_Actor240_Draw(Actor* this); void Zoness_80191BB8(Actor* actor); -void Zoness_80191BC4(Actor* actor); -void Zoness_80191DB0(Actor* actor); -void Zoness_80191DB0(Actor* actor); -void Zoness_80191FFC(Actor* actor); -void Zoness_80192094(Actor* actor); -void Zoness_80192834(Actor* actor); -void Zoness_80192C18(Actor* actor); -void Zoness_80192E64(Actor* actor); -void Zoness_80193240(Actor* actor); +void Zoness_Actor241_Update(Actor* this); +void Zoness_Actor241_Draw(Actor* this); +void Zoness_Actor241_Draw(Actor* this); +void Zoness_Actor242_Draw(Actor* this); +void Zoness_Actor242_Update(Actor* this); +void Zoness_Actor243_Update(Actor* this); +void Zoness_Actor243_Draw(Actor* this); +void Zoness_Actor244_Update(Actor* this); +void Zoness_Actor244_Draw(Actor* actor); void Zoness_BossZo_Init(Boss* this); -void Zoness_Boss_Draw(Boss* bossZO); -void Zoness_Boss_Update(Boss* bossZO); -void Zoness_8019969C(Actor* actor); -void Zoness_8019983C(Actor* actor); -void Zoness_80199A28(Actor* actor); -void Zoness_80199E24(Actor* actor); -void Zoness_80199F10(Actor* actor); -void Zoness_8019A1FC(Actor* actor); -void Zoness_8019A5D4(Actor* actor); -void Zoness_8019ACCC(Actor* actor); +void Zoness_Boss_Draw(Boss* this); +void Zoness_Boss_Update(Boss* this); +void Zoness_Actor245_Update(Actor245* this); +void Zoness_Actor245_Draw(Actor* actor); +void Zoness_Actor246_Update(Actor* this); +void Zoness_Actor246_Draw(Actor246* actor); +void Zoness_Actor248_Update(Actor* this); +void Zoness_Actor248_Draw(Actor* this); +void Zoness_Actor249_Update(Actor* this); +void Zoness_Actor249_Draw(Actor* this); void Zoness_8019B1F0(Actor* actor); -void Zoness_8019B548(Actor* actor); -void Zoness_8019B7DC(Actor* actor); -void Zoness_8019B810(Actor* actor); -void Zoness_8019B854(Actor* actor); -void Zoness_8019BDE0(Actor* actor); -void Zoness_8019BE48(Actor* actor); -void Zoness_8019C1CC(Actor* actor); -void Zoness_8019C200(Actor* actor); -void Zoness_8019C454(Actor* actor); -void Zoness_8019C83C(Actor* actor); -void Zoness_8019CBEC(Actor* actor); -void Zoness_8019CE58(Actor* actor); +void Zoness_Actor250_Update(Actor* this); +void Zoness_Actor250_Draw(Actor* actor); +void Zoness_8019B810(Actor* this); +void Zoness_Actor251_Update(Actor* this); +void Zoness_Actor251_Draw(Actor* this); +void Zoness_Actor252_Update(Actor* this); +void Zoness_Actor252_Draw(Actor* actor); +void Zoness_8019C200(Actor* this); +void Zoness_Actor253_Update(Actor* this); +void Zoness_Actor253_Draw(Actor* this); +void Zoness_Actor254_Update(Actor* this); +void Zoness_Actor254_Draw(Actor* this); void Zoness_Actor247_Init(Actor* this); -void Zoness_8019D15C(Actor* actor); -void Zoness_8019D3C4(Actor* actor); +void Zoness_Actor247_Update(Actor* this); +void Zoness_Actor247_Draw(Actor* this); void Zoness_LevelStart(Player* player); void Zoness_LevelComplete(Player* player); void Solar_8019E8B8(f32, f32, f32, f32); void Solar_8019E9F4(f32, f32, f32, f32, f32, f32, f32, s32); -void Solar_8019EA7C(Actor*); -void Solar_8019F20C(Actor*); -void Solar_8019F7AC(Actor*); -void Solar_801A003C(Actor*); -void Solar_801A0120(Effect*); -void Solar_801A0AF0(Effect*); +void Solar_Actor278_Update(Actor278*); +void Solar_Doodad_Update(Actor*); +void Solar_Doodad_Draw(Actor*); +void Solar_Actor279_Update(Actor279*); +void Solar_Effect392_Update(Effect392*); +void Solar_Effect392_Draw(Effect392*); void Solar_LevelStart(Player* player); -void Solar_Boss_Update(Boss*); -void Solar_Boss_Draw(Boss*); -void Solar_801A8BE8(Actor*); +void Solar_Boss_Update(BossSO*); +void Solar_Boss_Draw(BossSO*); +void Solar_801A8BE8(ActorCutscene*); void Solar_LevelComplete(Player* player); void Aquas_801A9824(void); @@ -95,59 +94,59 @@ void Aquas_BlueMarineMove(Player*); void Aquas_801ABA40(PlayerShot*); void Aquas_BlueMarineShoot(Player*); void Aquas_801AC8A8(f32, f32, f32, f32, s32); -void Aquas_801AC918(Effect*); +void Aquas_Effect366_Update(Effect*); void Aquas_801ACBB4(Player*); void Aquas_BlueMarineBoost(Player*); void Aquas_BlueMarineBrake(Player*); void Aquas_801AD688(Actor *); -void Aquas_801AD6C0(Actor*); -void Aquas_801AE168(Actor*); +void Aquas_Actor255_Update(Actor*); +void Aquas_Actor255_Draw(Actor*); void Aquas_801AE3AC(Actor *); -void Aquas_801AE3D8(Actor*); -void Aquas_801AEB44(Actor*); +void Aquas_Actor256_Update(Actor*); +void Aquas_Actor256_Draw(Actor*); void Aquas_801AF9FC(Actor *); -void Aquas_801AFA5C(Actor*); -void Aquas_801B099C(Actor*); -void Aquas_801B0B60(Actor*); -void Aquas_801B0EC0(Actor*); +void Aquas_Actor257_Update(Actor*); +void Aquas_Actor257_Draw(Actor*); +void Aquas_Actor258_Update(Actor*); +void Aquas_Actor258_Draw(Actor*); void Aquas_BossAq_Init(Boss*); void Aquas_Boss_Update(Boss*); void Aquas_Boss_Draw(Boss*); -void Aquas_801B504C(Actor*); -void Aquas_801B50E8(Actor*); -void Aquas_801B619C(Actor*); +void Aquas_Actor261_Draw(Actor*); +void Aquas_Actor261_Update(Actor*); +void Aquas_Actor259_Draw(Actor*); void Aquas_801B6344(Actor *); -void Aquas_801B638C(Actor*); +void Aquas_Actor259_Update(Actor*); void Aquas_801B6E54(Actor *); -void Aquas_801B6FF8(Actor*); -void Aquas_801B7A24(Actor*); +void Aquas_Actor262_Update(Actor*); +void Aquas_Actor262_Draw(Actor*); void Aquas_801B7AF0(Actor *); -void Aquas_801B7C78(Actor*); -void Aquas_801B90DC(Actor*); -void Aquas_801B91A4(Actor*); -void Aquas_801BA108(Actor*); -void Aquas_801BA26C(Actor*); -void Aquas_801BA4E4(Actor*); +void Aquas_Actor260_Update(Actor*); +void Aquas_Actor260_Draw(Actor*); +void Aquas_Actor263_Update(Actor*); +void Aquas_Actor263_Draw(Actor*); +void Aquas_Actor264_Update(Actor*); +void Aquas_Actor264_Draw(Actor*); void Aquas_801BA57C(Actor *); -void Aquas_801BA6A4(Actor*); -void Aquas_801BAD7C(Actor*); -void Aquas_801BADF8(Actor*); -void Aquas_801BB204(Actor*); +void Aquas_Actor265_Update(Actor*); +void Aquas_Actor265_Draw(Actor*); +void Aquas_Actor266_Update(Actor*); +void Aquas_Actor266_Draw(Actor*); void Aquas_801BB26C(Actor *); -void Aquas_801BB79C(Actor*); -void Aquas_801BC930(Actor*); -void Aquas_801BC9A0(Actor*); -void Aquas_801BD264(Actor*); -void Aquas_801BD54C(Actor*); -void Aquas_801BDE6C(Actor*); +void Aquas_Actor267_Update(Actor*); +void Aquas_Actor267_Draw(Actor*); +void Aquas_Actor269_Update(Actor*); +void Aquas_Actor269_Draw(Actor*); +void Aquas_Actor268_Update(Actor*); +void Aquas_Actor268_Draw(Actor*); void Aquas_801BDF14(void); -void Aquas_801BE1FC(Scenery*); -void Aquas_801BE3F8(Actor*); -void Aquas_801BEB1C(Actor*); +void Aquas_Scenery126_Draw(Scenery*); +void Aquas_Actor270_Update(Actor*); +void Aquas_Actor270_Draw(Actor*); void Aquas_Boss301_Update(Boss*); void Aquas_Boss301_Draw(Boss*); -void Aquas_801BEC68(Actor*); -void Aquas_801BEC74(Actor*); +void Aquas_Actor188_Update(Actor*); +void Aquas_Actor188_Draw(Actor*); void Aquas_Update360(Player*); #endif diff --git a/include/i4.h b/include/i4.h index 3f8a3bfd..4769796e 100644 --- a/include/i4.h +++ b/include/i4.h @@ -17,37 +17,37 @@ void Katina_LevelComplete(Player*); void Katina_SFTeamFlyTowardsCamera(Actor*); void SectorZ_LevelStart(Player*); void SectorZ_LevelComplete(Player*); -void SectorZ_8019DD20(Actor*); +void SectorZ_LevelCompleteCsUpdate(Actor*); void OvlI4_CallFunction(u32, void*); void Fortuna_UpdateEvents(Actor*); -void Fortuna_8018BA2C(void); +void Fortuna_LoadLevelObjects(void); void Bolse_UpdateEventHandler(Actor*); void Bolse_80191ED8(void); void Bolse_DrawDynamicGround(void); void Katina_BossSetup(Boss *); void Katina_UpdateEvents(Actor*); void Katina_Init(void); -void SectorZ_80199900(Actor *, s32); +void SectorZ_MissileExplode(ActorAllRange* this, bool shotDown); void SectorZ_Missile_Update(Actor*); void SectorZ_UpdateEvents(Actor*); -void SectorZ_8019EA68(void); +void SectorZ_LoadLevelObjects(void); -void Fortuna_80188AD0(Actor*); -void Fortuna_80188FE4(Actor*); -void Bolse_80191054(Effect*); -void Bolse_80191180(Effect*); -void Bolse_801912FC(Boss*); -void Bolse_80191AFC(Boss*); +void Fortuna_Radar_Update(Actor*); +void Fortuna_Radar_Draw(Actor*); +void Bolse_Effect397_Update(Effect*); +void Bolse_Effect397_Draw(Effect*); +void Bolse_Boss311_Update(Boss*); +void Bolse_Boss311_Draw(Boss*); void Katina_LaserEnergyParticlesUpdate(Effect*); void Katina_LaserEnergyParticlesDraw(Effect*); void Katina_BaseUpdate(Boss*); void Katina_Base_Draw(Boss*); void Katina_BossUpdate(Boss*); void Katina_BossDraw(Boss*); -void SectorZ_8019E234(Actor*); -void SectorZ_8019E3A8(Actor*); -void SectorZ_Boss_Update(Boss*); -void SectorZ_Boss_Draw(Boss*); +void SectorZ_SpaceJunkUpdate(Actor*); +void SectorZ_SpaceJunkDraw(Actor*); +void SectorZ_GreatFoxUpdate(Boss*); +void SectorZ_GreatFoxDraw(Boss*); #endif diff --git a/include/i5.h b/include/i5.h index ae2b94d4..75a3374b 100644 --- a/include/i5.h +++ b/include/i5.h @@ -59,75 +59,75 @@ bool Macbeth_801A3C20(f32); bool Macbeth_801A3300(Player*, f32, f32); bool Macbeth_801A3790(Player*, f32, f32); -void Titania_80188F60(Effect*); -void Titania_80188FA8(Effect*); -void Titania_80189194(Actor*); -void Titania_801895B8(Actor*); -void Titania_80189AFC(Actor*); -void Titania_80189CC8(Actor*); -void Titania_8018A1C0(Actor*); -void Titania_8018A544(Actor*); -void Titania_8018AABC(Actor*); -void Titania_8018AB44(Actor*); -void Titania_8018B268(Actor*); -void Titania_8018B6AC(Actor*); -void Titania_8018B9D0(Actor*); -void Titania_8018BE84(Actor*); -void Titania_8018C8A8(Actor*); -void Titania_8018E2D8(Actor*); -void Titania_8018E54C(Actor*); -void Titania_8018E5B4(Actor*); -void Titania_8018E5F8(Actor*); -void Titania_8018EF14(Actor*); +void Titania_Effect368_Update(Effect*); +void Titania_Effect368_Draw(Effect*); +void Titania_Actor224_Update(Actor*); +void Titania_Actor226_Update(Actor*); +void Titania_Actor226_Draw(Actor*); +void Titania_Actor233_Update(Actor*); +void Titania_Actor233_Draw(Actor*); +void Titania_Actor230_Update(Actor*); +void Titania_Actor230_Draw(Actor*); +void Titania_Actor225_Update(Actor*); +void Titania_Actor232_Update(Actor*); +void Titania_Actor232_Draw(Actor*); +void Titania_Actor231_Update(Actor*); +void Titania_Actor231_Draw(Actor*); +void Titania_Actor229_Update(Actor*); +void Titania_Actor229_Draw(Actor*); +void Titania_Actor227_Update(Actor*); +void Titania_Actor227_Draw(Actor*); +void Titania_Actor228_Update(Actor*); +void Titania_Actor228_Draw(Actor*); void Titania_Cactus_Update(Sprite*); -void Titania_8018F4D8(Scenery*); -void Titania_8018F8B8(Scenery*); +void Titania_Scenery57_Update(Scenery*); +void Titania_Scenery57_Draw(Scenery*); void Titania_Boss_Update(Boss*); void Titania_Boss_Draw(Boss*); -void Macbeth_8019C778(Actor*); -void Macbeth_8019CE88(Actor*); -void Macbeth_8019D700(Actor*); -void Macbeth_8019E410(Actor*); -void Macbeth_8019EA60(Actor*); -void Macbeth_8019EE68(Actor*); -void Macbeth_8019FF9C(Actor*); -void Macbeth_801A0BD8(Scenery*); -void Macbeth_801A12C4(Actor*); -void Macbeth_801A23AC(Scenery*); -void Macbeth_801A2A78(Scenery*); -void Macbeth_801A2B24(Scenery*); -void Macbeth_801A2DD8(Scenery*); -void Macbeth_801A3240(Scenery*); -void Macbeth_801A3E98(Actor*); -void Macbeth_801A43BC(Actor*); -void Macbeth_801A46A0(Actor*); -void Macbeth_801A4A64(Actor*); -void Macbeth_801A4B24(Actor*); -void Macbeth_801A54E8(Actor*); -void Macbeth_801A57D0(Effect*); -void Macbeth_801A5AF0(Effect*); -void Macbeth_801A5B4C(Effect*); -void Macbeth_801A5D68(Effect*); -void Macbeth_801A5E54(Actor*); -void Macbeth_801A5F90(Actor*); -void Macbeth_801A5FD0(Actor*); -void Macbeth_801A6100(Actor*); -void Macbeth_801A6144(Actor*); -void Macbeth_801A6540(Actor*); -void Macbeth_801A6608(Scenery*); -void Macbeth_801A67C8(Actor*); -void Macbeth_801A68EC(Actor*); -void Macbeth_801A7E7C(Actor*); -void Macbeth_801AC294(Actor*); -void Macbeth_801AC438(Actor*); -void Macbeth_801AD6F0(Actor*); -void Macbeth_801ADAC8(Actor*); -void Macbeth_801ADD68(Actor*); -void Macbeth_801AE2C0(Actor*); -void Macbeth_801AE87C(Effect*); -void Macbeth_801AEAA0(Effect*); -void Macbeth_801AEC04(Actor*); -void Macbeth_801AEEFC(Actor*); +void Macbeth_Actor205_Update(Actor*); +void Macbeth_Actor210_Update(Actor*); +void Macbeth_Actor209_Update(Actor*); +void Macbeth_Actor211_Update(Actor*); +void Macbeth_Actor208_Update(Actor*); +void Macbeth_Actor213_Update(Actor*); +void Macbeth_Actor212_Update(Actor*); +void Macbeth_Scenery104_Update(Scenery*); +void Macbeth_ActorDoodad_Draw(Actor*); +void Macbeth_SceneryDoodad_Draw(Scenery*); +void Macbeth_Scenery61_Draw(Scenery*); +void Macbeth_SceneryDoodad2_Draw(Scenery*); +void Macbeth_Scenery83_Update(Scenery*); +void Macbeth_Scenery83_Draw(Scenery*); +void Macbeth_Actor214_Update(Actor*); +void Macbeth_Actor214_Draw(Actor*); +void Macbeth_Actor215_Update(Actor*); +void Macbeth_Actor215_Draw(Actor*); +void Macbeth_Actor223_Update(Actor*); +void Macbeth_Actor223_Draw(Actor*); +void Macbeth_Effect378_Update(Effect*); +void Macbeth_Effect378_Draw(Effect*); +void Macbeth_Effect380_Update(Effect*); +void Macbeth_Effect380_Draw(Effect*); +void Macbeth_Actor216_Update(Actor*); +void Macbeth_Actor216_Draw(Actor*); +void Macbeth_Actor217_Update(Actor*); +void Macbeth_Actor217_Draw(Actor*); +void Macbeth_Actor218_Update(Actor*); +void Macbeth_Actor218_Draw(Actor*); +void Macbeth_Scenery65_Draw(Scenery*); +void Macbeth_Actor219_Update(Actor*); +void Macbeth_Actor219_Draw(Actor*); +void Macbeth_Actor207_Update(Actor*); +void Macbeth_Actor207_Draw(Actor*); +void Macbeth_Actor206_Update(Actor*); +void Macbeth_Actor220_Update(Actor*); +void Macbeth_Actor220_Draw(Actor*); +void Macbeth_Actor221_Update(Actor*); +void Macbeth_Actor221_Draw(Actor*); +void Macbeth_Effect379_Update(Effect*); +void Macbeth_Effect379_Draw(Effect*); +void Macbeth_Actor222_Update(Actor*); +void Macbeth_Actor222_Draw(Actor*); s32 Macbeth_801A55D4(s32 , Vec3f* , Vec3f* , s32 ); #endif diff --git a/include/i6.h b/include/i6.h index 844e4fb5..f02600e9 100644 --- a/include/i6.h +++ b/include/i6.h @@ -32,7 +32,7 @@ void Andross_8018C390(Player*); void Andross_Boss320_Init(Boss *); void Andross_801961AC(void); void Venom2_UpdateEvents(Actor*); -void Venom2_80196968(void); +void Venom2_LoadLevelObjects(void); void SectorY_Boss314_Init(Boss *); void SectorY_Actor204_Update(Actor*); void SectorY_Actor204_Draw(Actor*); @@ -40,33 +40,33 @@ void Turret_Update(Player*); void Turret_UpdateCamera(Player*); void Turret_Draw(Player *); -void Andross_801880E4(Actor*); -void Andross_80188448(Actor*); -void Andross_80188528(Actor*); -void Andross_80188660(Actor*); -void Andross_8018933C(Actor*); -void Andross_801893B8(Actor*); -void Andross_80189470(Actor*); -void Andross_80189724(Actor*); -void Andross_80189B70(Boss*); -void Andross_8018B8C0(Boss*); -void Andross_8018CAD4(Effect*); -void Andross_8018CF98(Effect*); -void Andross_8018DBF0(Boss*); -void Andross_801928C8(Boss*); -void Andross_80192E94(Actor*); -void Andross_80193244(Actor*); -void Andross_80193380(Scenery*); -void Andross_8019350C(Scenery*); -void Andross_8019356C(Scenery*); -void Andross_801935D4(Scenery*); +void Andross_Actor199_Update(Actor*); +void Andross_Actor199_Draw(Actor*); +void Andross_Actor286_Update(Actor*); +void Andross_Actor286_Draw(Actor*); +void Andross_Actor290_Update(Actor*); +void Andross_Actor288_Update(Actor*); +void Andross_Actor289_Update(Actor*); +void Andross_Actor287_Update(Actor*); +void Andross_Boss321_Update(Boss*); +void Andross_Boss321_Draw(Boss*); +void Andross_Effect396_Update(Effect*); +void Andross_Effect396_Draw(Effect*); +void Andross_Boss320_Update(Boss*); +void Andross_Boss320_Draw(Boss*); +void Andross_Actor285_Update(Actor*); +void Andross_Actor285_Draw(Actor*); +void Andross_Scenery132_Update(Scenery*); +void Andross_Scenery132_Draw(Scenery*); +void Andross_Scenery131_Update(Scenery*); +void Andross_Scenery131_Draw(Scenery*); void Venom2_Boss_Update(Boss*); void Venom2_Boss_Draw(Boss*); -void SectorY_80197C64(Effect*); -void SectorY_80197CB8(Scenery*); +void SectorY_Effect354_Draw(Effect*); +void SectorY_Scenery156_Draw(Scenery*); void SectorY_Boss_Update(Boss*); void SectorY_Boss_Draw(Boss*); -void SectorY_801A4E44(Scenery*); -void SectorY_801A52B8(Scenery*); +void SectorY_Scenery109_Update(Scenery*); +void SectorY_Scenery112_Update(Scenery*); #endif diff --git a/include/macros.h b/include/macros.h index 6d7a15e6..f92ceb4f 100644 --- a/include/macros.h +++ b/include/macros.h @@ -7,6 +7,8 @@ #define SCREEN_HEIGHT 240 #define SCREEN_MARGIN 8 +#define TIME_IN_SECONDS(x) (x * 30); + #define RAND_FLOAT(max) (Rand_ZeroOne()*(max)) #define RAND_INT(max) ((s32)(Rand_ZeroOne()*(max))) #define RAND_FLOAT_CENTERED(width) ((Rand_ZeroOne()-0.5f)*(width)) diff --git a/include/sf64object.h b/include/sf64object.h index 1fae1be1..3fe7dc3b 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -20,8 +20,8 @@ typedef struct { } Hitbox; // size = 0x18 typedef struct { - /* 0x00 */ Triangle tri; - /* 0x08 */ PlaneI plane; + /* 0x00 */ Triangle tri; + /* 0x08 */ PlaneI plane; } CollisionPoly; // size = 0x14 typedef struct { @@ -33,11 +33,11 @@ typedef struct { } CollisionHeader; // size = 0x24 typedef struct { - /* 0x00 */ Vec3f min; - /* 0x0C */ Vec3f max; - /* 0x18 */ s32 polyCount; - /* 0x1C */ Triangle* polys; - /* 0x20 */ Vec3f* mesh; + /* 0x00 */ Vec3f min; + /* 0x0C */ Vec3f max; + /* 0x18 */ s32 polyCount; + /* 0x1C */ Triangle* polys; + /* 0x20 */ Vec3f* mesh; } CollisionHeader2; // size = 0x24 typedef enum { @@ -49,21 +49,21 @@ typedef enum { /* 5 */ COL1_5, // OBJ_SCENERY_149 /* 6 */ COL1_6, // OBJ_SCENERY_150 /* 7 */ COL1_7, // OBJ_BOSS_309 - /* 8 */ COL1_8, // OBJ_BOSS_SZ + /* 8 */ COL1_8, // OBJ_BOSS_SZ_GREAT_FOX /* 9 */ COL1_9, // OBJ_BOSS_VE2 } CollisonId_1; typedef enum { - /* 0 */ COL2_0, // default - /* 1 */ COL2_1, // OBJ_SCENERY_4, OBJ_SCENERY_5 - /* 2 */ COL2_2, // OBJ_SCENERY_2 - /* 3 */ COL2_3, // OBJ_SCENERY_3, OBJ_SCENERY_69 - /* 4 */ COL2_4, // OBJ_SCENERY_140 - /* 5 */ COL2_5, // PLAYERSHOT_7 ? - /* 6 */ COL2_6, // OBJ_SCENERY_141 - /* 7 */ COL2_7, // OBJ_SCENERY_47 - /* 8 */ COL2_8, // OBJ_SCENERY_70 - /* 9 */ COL2_9, // OBJ_SCENERY_72 + /* 0 */ COL2_0, // default + /* 1 */ COL2_1, // OBJ_SCENERY_CO_BUMP_4, OBJ_SCENERY_CO_BUMP_5 + /* 2 */ COL2_2, // OBJ_SCENERY_CO_BUMP_2 + /* 3 */ COL2_3, // OBJ_SCENERY_CO_BUMP_3, OBJ_SCENERY_69 + /* 4 */ COL2_4, // OBJ_SCENERY_140 + /* 5 */ COL2_5, // PLAYERSHOT_7 ? + /* 6 */ COL2_6, // OBJ_SCENERY_141 + /* 7 */ COL2_7, // OBJ_SCENERY_47 + /* 8 */ COL2_8, // OBJ_SCENERY_70 + /* 9 */ COL2_9, // OBJ_SCENERY_72 /* 10 */ COL2_10, // OBJ_SCENERY_71 /* 11 */ COL2_11, // OBJ_SCENERY_73 /* 12 */ COL2_12, // OBJ_SCENERY_67 @@ -123,7 +123,7 @@ typedef enum ObjectStatus { /* 3 */ OBJ_DYING, } ObjectStatus; -typedef struct { +typedef struct Object { /* 0x00 */ u8 status; /* 0x02 */ u16 id; /* 0x04 */ Vec3f pos; @@ -132,7 +132,7 @@ typedef struct { typedef void (*ObjectFunc)(Object*); -typedef struct { +typedef struct ObjectInfo { /* 0x00 */ union { ObjectFunc draw; Gfx* dList; @@ -140,16 +140,16 @@ typedef struct { /* 0x00 */ u8 drawType; /* 0x08 */ ObjectFunc action; // argument must have object type. /* 0x0C */ f32* hitbox; - /* 0x10 */ f32 cullDistance; // z coordinate of something - /* 0x14 */ s16 unk_14; // can be -1, 0, 1. governs camera-related behavior in effects (billboarding?) - /* 0x16 */ s16 unk_16; // can be 0, 1, 2. affects death behavior? + /* 0x10 */ f32 cullDistance; // z coordinate of something + /* 0x14 */ s16 unk_14; // can be -1, 0, 1. governs camera-related behavior in effects (billboarding?) + /* 0x16 */ s16 unk_16; // can be 0, 1, 2. affects death behavior? /* 0x18 */ u8 damage; - /* 0x19 */ u8 unk_19; // can be 0, 1, 2. Also camera-related? - /* 0x1C */ f32 targetOffset; // target lock y offset. 0.0f can't be targeted - /* 0x20 */ u8 bonus; // hits when killed. numbers above 1 indicate the hit+ bonus -} ObjectInfo; // size = 0x24 + /* 0x19 */ u8 unk_19; // can be 0, 1, 2. Also camera-related? + /* 0x1C */ f32 targetOffset; // target lock y offset. 0.0f can't be targeted + /* 0x20 */ u8 bonus; // hits when killed. numbers above 1 indicate the hit+ bonus +} ObjectInfo; // size = 0x24 -typedef struct { +typedef struct Scenery360 { /* 0x00 */ Object obj; /* 0x1C */ ObjectInfo info; /* 0x40 */ u8 pathIndex; @@ -158,7 +158,7 @@ typedef struct { /* 0x54 */ f32 unk_54; } Scenery360; // size = 0x58 -typedef struct { +typedef struct Scenery { /* 0x00 */ Object obj; /* 0x1C */ ObjectInfo info; /* 0x40 */ s32 index; @@ -173,7 +173,7 @@ typedef struct { /* 0x7C */ char pad7C[4]; } Scenery; // size = 0x80 -typedef struct { +typedef struct Sprite { /* 0x00 */ Object obj; /* 0x1C */ ObjectInfo info; /* 0x40 */ s32 index; @@ -183,7 +183,7 @@ typedef struct { /* 0x48 */ s32 toLeft; } Sprite; // size = 0x4C -typedef struct { +typedef struct Item { /* 0x00 */ Object obj; /* 0x1C */ ObjectInfo info; /* 0x40 */ s32 index; @@ -200,7 +200,7 @@ typedef struct { /* 0x68 */ f32 width; } Item; // size 0x6C -typedef struct { +typedef struct Effect { /* 0x00 */ Object obj; /* 0x1C */ ObjectInfo info; /* 0x40 */ s32 index; @@ -223,14 +223,14 @@ typedef struct { /* 0x80 */ f32 sfxSource[3]; } Effect; // size 0x8C -typedef struct { +typedef struct Boss { /* 0x000 */ Object obj; /* 0x01C */ ObjectInfo info; /* 0x040 */ s32 index; /* 0x044 */ s16 unk_044; - /* 0x046 */ s16 unk_046; - /* 0x048 */ s16 unk_048; - /* 0x04A */ s16 unk_04A; + /* 0x046 */ s16 unk_046; + /* 0x048 */ s16 unk_048; + /* 0x04A */ s16 unk_04A; /* 0x04C */ s16 unk_04C; /* 0x04E */ s16 state; /* 0x050 */ s16 timer_050; @@ -248,7 +248,7 @@ typedef struct { /* 0x068 */ f32 yOffset; /* 0x06C */ Vec3f vel; /* 0x078 */ Vec3f rot_078; - /* 0x084 */ f32 gravity; + /* 0x084 */ f32 gravity; /* 0x088 */ s16 swork[40]; /* 0x0D8 */ f32 fwork[50]; /* 0x1A0 */ Vec3f vwork[50]; @@ -261,11 +261,9 @@ typedef struct { #define DMG_BEAM 1 #define DMG_NONE 0 #define DMG_BOMB -1 -#define DMG_UNK_100 100 +#define DMG_MISSILE 100 - - -typedef struct { +typedef struct Actor { /* 0x000 */ Object obj; /* 0x01C */ ObjectInfo info; /* 0x040 */ s32 index; @@ -295,7 +293,7 @@ typedef struct { /* 0x0D4 */ s16 dmgSource; /* 0x0D6 */ u16 damage; /* 0x0D8 */ Vec3f hitPos; - /* 0x0E4 */ s16 aiType; // Actor index for AllRange, script index for Event + /* 0x0E4 */ s16 aiType; // Actor index for AllRange, script index for Event /* 0x0E6 */ s16 aiIndex; // Target index for AllRange, program counter for Event /* 0x0E8 */ Vec3f vel; /* 0x0F4 */ Vec3f rot_0F4; @@ -307,430 +305,430 @@ typedef struct { } Actor; // size = 0x2F4 typedef enum ObjectId { - /* -1 */ OBJ_INVALID=-1, - /* 0 */ OBJ_SCENERY_0, - /* 1 */ OBJ_SCENERY_1, - /* 2 */ OBJ_SCENERY_2, - /* 3 */ OBJ_SCENERY_3, - /* 4 */ OBJ_SCENERY_4, - /* 5 */ OBJ_SCENERY_5, - /* 6 */ OBJ_SCENERY_6, - /* 7 */ OBJ_SCENERY_7, - /* 8 */ OBJ_SCENERY_8, - /* 9 */ OBJ_SCENERY_9, - /* 10 */ OBJ_SCENERY_10, - /* 11 */ OBJ_SCENERY_11, - /* 12 */ OBJ_SCENERY_12, - /* 13 */ OBJ_SCENERY_13, - /* 14 */ OBJ_SCENERY_14, - /* 15 */ OBJ_SCENERY_15, - /* 16 */ OBJ_SCENERY_16, - /* 17 */ OBJ_SCENERY_17, - /* 18 */ OBJ_SCENERY_18, - /* 19 */ OBJ_SCENERY_19, - /* 20 */ OBJ_SCENERY_20, - /* 21 */ OBJ_SCENERY_21, - /* 22 */ OBJ_SCENERY_22, - /* 23 */ OBJ_SCENERY_23, - /* 24 */ OBJ_SCENERY_24, - /* 25 */ OBJ_SCENERY_25, - /* 26 */ OBJ_SCENERY_26, - /* 27 */ OBJ_SCENERY_27, - /* 28 */ OBJ_SCENERY_28, - /* 29 */ OBJ_SCENERY_TI_SKULL, - /* 30 */ OBJ_SCENERY_TI_RIB_0, - /* 31 */ OBJ_SCENERY_TI_RIB_1, - /* 32 */ OBJ_SCENERY_TI_RIB_2, - /* 33 */ OBJ_SCENERY_TI_RIB_3, - /* 34 */ OBJ_SCENERY_TI_RIB_4, - /* 35 */ OBJ_SCENERY_TI_RIB_5, - /* 36 */ OBJ_SCENERY_TI_RIB_6, - /* 37 */ OBJ_SCENERY_TI_RIB_7, - /* 38 */ OBJ_SCENERY_TI_RIB_8, - /* 39 */ OBJ_SCENERY_ME_TUNNEL, - /* 40 */ OBJ_SCENERY_40, - /* 41 */ OBJ_SCENERY_41, - /* 42 */ OBJ_SCENERY_42, - /* 43 */ OBJ_SCENERY_43, - /* 44 */ OBJ_SCENERY_44, - /* 45 */ OBJ_SCENERY_45, - /* 46 */ OBJ_SCENERY_46, - /* 47 */ OBJ_SCENERY_47, - /* 48 */ OBJ_SCENERY_48, - /* 49 */ OBJ_SCENERY_49, - /* 50 */ OBJ_SCENERY_50, - /* 51 */ OBJ_SCENERY_51, - /* 52 */ OBJ_SCENERY_52, - /* 53 */ OBJ_SCENERY_53, - /* 54 */ OBJ_SCENERY_54, - /* 55 */ OBJ_SCENERY_55, - /* 56 */ OBJ_SCENERY_56, - /* 57 */ OBJ_SCENERY_57, - /* 58 */ OBJ_SCENERY_58, - /* 59 */ OBJ_SCENERY_59, - /* 60 */ OBJ_SCENERY_60, - /* 61 */ OBJ_SCENERY_61, - /* 62 */ OBJ_SCENERY_62, - /* 63 */ OBJ_SCENERY_63, - /* 64 */ OBJ_SCENERY_64, - /* 65 */ OBJ_SCENERY_65, - /* 66 */ OBJ_SCENERY_66, - /* 67 */ OBJ_SCENERY_67, - /* 68 */ OBJ_SCENERY_68, - /* 69 */ OBJ_SCENERY_69, - /* 70 */ OBJ_SCENERY_70, - /* 71 */ OBJ_SCENERY_71, - /* 72 */ OBJ_SCENERY_72, - /* 73 */ OBJ_SCENERY_73, - /* 74 */ OBJ_SCENERY_74, - /* 75 */ OBJ_SCENERY_75, - /* 76 */ OBJ_SCENERY_76, - /* 77 */ OBJ_SCENERY_77, - /* 78 */ OBJ_SCENERY_78, - /* 79 */ OBJ_SCENERY_79, - /* 80 */ OBJ_SCENERY_80, - /* 81 */ OBJ_SCENERY_81, - /* 82 */ OBJ_SCENERY_82, - /* 83 */ OBJ_SCENERY_83, - /* 84 */ OBJ_SCENERY_84, - /* 85 */ OBJ_SCENERY_85, - /* 86 */ OBJ_SCENERY_86, - /* 87 */ OBJ_SCENERY_87, - /* 88 */ OBJ_SCENERY_88, - /* 89 */ OBJ_SCENERY_89, - /* 90 */ OBJ_SCENERY_90, - /* 91 */ OBJ_SCENERY_91, - /* 92 */ OBJ_SCENERY_92, - /* 93 */ OBJ_SCENERY_93, - /* 94 */ OBJ_SCENERY_94, - /* 95 */ OBJ_SCENERY_95, - /* 96 */ OBJ_SCENERY_96, - /* 97 */ OBJ_SCENERY_97, - /* 98 */ OBJ_SCENERY_98, - /* 99 */ OBJ_SCENERY_99, - /* 100 */ OBJ_SCENERY_100, - /* 101 */ OBJ_SCENERY_101, - /* 102 */ OBJ_SCENERY_102, - /* 103 */ OBJ_SCENERY_103, - /* 104 */ OBJ_SCENERY_104, - /* 105 */ OBJ_SCENERY_105, - /* 106 */ OBJ_SCENERY_106, - /* 107 */ OBJ_SCENERY_107, - /* 108 */ OBJ_SCENERY_108, - /* 109 */ OBJ_SCENERY_109, - /* 110 */ OBJ_SCENERY_110, - /* 111 */ OBJ_SCENERY_111, - /* 112 */ OBJ_SCENERY_112, - /* 113 */ OBJ_SCENERY_113, - /* 114 */ OBJ_SCENERY_114, - /* 115 */ OBJ_SCENERY_115, - /* 116 */ OBJ_SCENERY_116, - /* 117 */ OBJ_SCENERY_117, - /* 118 */ OBJ_SCENERY_118, - /* 119 */ OBJ_SCENERY_119, - /* 120 */ OBJ_SCENERY_120, - /* 121 */ OBJ_SCENERY_121, - /* 122 */ OBJ_SCENERY_122, - /* 123 */ OBJ_SCENERY_123, - /* 124 */ OBJ_SCENERY_124, - /* 125 */ OBJ_SCENERY_125, - /* 126 */ OBJ_SCENERY_126, - /* 127 */ OBJ_SCENERY_127, - /* 128 */ OBJ_SCENERY_128, - /* 129 */ OBJ_SCENERY_129, - /* 130 */ OBJ_SCENERY_130, - /* 131 */ OBJ_SCENERY_131, - /* 132 */ OBJ_SCENERY_132, - /* 133 */ OBJ_SCENERY_133, - /* 134 */ OBJ_SCENERY_134, - /* 135 */ OBJ_SCENERY_135, - /* 136 */ OBJ_SCENERY_136, - /* 137 */ OBJ_SCENERY_137, - /* 138 */ OBJ_SCENERY_138, - /* 139 */ OBJ_SCENERY_139, - /* 140 */ OBJ_SCENERY_140, - /* 141 */ OBJ_SCENERY_141, - /* 142 */ OBJ_SCENERY_142, - /* 143 */ OBJ_SCENERY_143, - /* 144 */ OBJ_SCENERY_144, - /* 145 */ OBJ_SCENERY_145, - /* 146 */ OBJ_SCENERY_146, - /* 147 */ OBJ_SCENERY_147, - /* 148 */ OBJ_SCENERY_148, - /* 149 */ OBJ_SCENERY_149, - /* 150 */ OBJ_SCENERY_150, - /* 151 */ OBJ_SCENERY_151, - /* 152 */ OBJ_SCENERY_152, - /* 153 */ OBJ_SCENERY_153, - /* 154 */ OBJ_SCENERY_154, - /* 155 */ OBJ_SCENERY_155, - /* 156 */ OBJ_SCENERY_156, - /* 157 */ OBJ_SCENERY_157, - /* 158 */ OBJ_SCENERY_158, - /* 159 */ OBJ_SCENERY_159, - /* 160 */ OBJ_SCENERY_160, - /* 161 */ OBJ_SPRITE_CO_POLE, - /* 162 */ OBJ_SPRITE_CO_TREE, - /* 163 */ OBJ_SPRITE_FO_POLE, - /* 164 */ OBJ_SPRITE_FOG_SHADOW, - /* 165 */ OBJ_SPRITE_CO_RUIN1, - /* 166 */ OBJ_SPRITE_CO_RUIN2, - /* 167 */ OBJ_SPRITE_167, - /* 168 */ OBJ_SPRITE_168, - /* 169 */ OBJ_SPRITE_TI_CACTUS, - /* 170 */ OBJ_SPRITE_CO_SMOKE, - /* 171 */ OBJ_SPRITE_VE1_BOSS_TRIGGER1, - /* 172 */ OBJ_SPRITE_VE1_BOSS_TRIGGER2, - /* 173 */ OBJ_SPRITE_VE1_BOSS_TRIGGER3, - /* 174 */ OBJ_SPRITE_VE1_BOSS_TRIGGER4, - /* 175 */ OBJ_SPRITE_GFOX_TARGET, - /* 176 */ OBJ_ACTOR_176, - /* 177 */ OBJ_ACTOR_177, - /* 178 */ OBJ_ACTOR_178, - /* 179 */ OBJ_ACTOR_179, - /* 180 */ OBJ_ACTOR_180, - /* 181 */ OBJ_ACTOR_181, - /* 182 */ OBJ_ACTOR_182, - /* 183 */ OBJ_ACTOR_183, - /* 184 */ OBJ_ACTOR_184, - /* 185 */ OBJ_ACTOR_185, - /* 186 */ OBJ_ACTOR_186, - /* 187 */ OBJ_ACTOR_187, - /* 188 */ OBJ_ACTOR_188, - /* 189 */ OBJ_ACTOR_DEBRIS, - /* 190 */ OBJ_ACTOR_190, - /* 191 */ OBJ_ACTOR_191, - /* 192 */ OBJ_ACTOR_192, - /* 193 */ OBJ_ACTOR_193, - /* 194 */ OBJ_ACTOR_194, - /* 195 */ OBJ_ACTOR_CUTSCENE, - /* 196 */ OBJ_ACTOR_196, - /* 197 */ OBJ_ACTOR_ALLRANGE, - /* 198 */ OBJ_ACTOR_TEAM_BOSS, - /* 199 */ OBJ_ACTOR_199, - /* 200 */ OBJ_ACTOR_EVENT, - /* 201 */ OBJ_ACTOR_201, - /* 202 */ OBJ_ACTOR_202, - /* 203 */ OBJ_ACTOR_SLIPPY_SX, - /* 204 */ OBJ_ACTOR_204, - /* 205 */ OBJ_ACTOR_205, - /* 206 */ OBJ_ACTOR_206, - /* 207 */ OBJ_ACTOR_207, - /* 208 */ OBJ_ACTOR_208, - /* 209 */ OBJ_ACTOR_209, - /* 210 */ OBJ_ACTOR_210, - /* 211 */ OBJ_ACTOR_211, - /* 212 */ OBJ_ACTOR_212, - /* 213 */ OBJ_ACTOR_213, - /* 214 */ OBJ_ACTOR_214, - /* 215 */ OBJ_ACTOR_215, - /* 216 */ OBJ_ACTOR_216, - /* 217 */ OBJ_ACTOR_217, - /* 218 */ OBJ_ACTOR_218, - /* 219 */ OBJ_ACTOR_219, - /* 220 */ OBJ_ACTOR_220, - /* 221 */ OBJ_ACTOR_221, - /* 222 */ OBJ_ACTOR_222, - /* 223 */ OBJ_ACTOR_223, - /* 224 */ OBJ_ACTOR_224, - /* 225 */ OBJ_ACTOR_225, - /* 226 */ OBJ_ACTOR_226, - /* 227 */ OBJ_ACTOR_227, - /* 228 */ OBJ_ACTOR_228, - /* 229 */ OBJ_ACTOR_229, - /* 230 */ OBJ_ACTOR_230, - /* 231 */ OBJ_ACTOR_231, - /* 232 */ OBJ_ACTOR_232, - /* 233 */ OBJ_ACTOR_233, - /* 234 */ OBJ_ACTOR_234, - /* 235 */ OBJ_ACTOR_235, - /* 236 */ OBJ_ACTOR_236, - /* 237 */ OBJ_ACTOR_237, - /* 238 */ OBJ_ACTOR_238, - /* 239 */ OBJ_ACTOR_239, - /* 240 */ OBJ_ACTOR_240, - /* 241 */ OBJ_ACTOR_241, - /* 242 */ OBJ_ACTOR_242, - /* 243 */ OBJ_ACTOR_243, - /* 244 */ OBJ_ACTOR_244, - /* 245 */ OBJ_ACTOR_245, - /* 246 */ OBJ_ACTOR_246, - /* 247 */ OBJ_ACTOR_247, - /* 248 */ OBJ_ACTOR_248, - /* 249 */ OBJ_ACTOR_249, - /* 250 */ OBJ_ACTOR_250, - /* 251 */ OBJ_ACTOR_251, - /* 252 */ OBJ_ACTOR_252, - /* 253 */ OBJ_ACTOR_253, - /* 254 */ OBJ_ACTOR_254, - /* 255 */ OBJ_ACTOR_255, - /* 256 */ OBJ_ACTOR_256, - /* 257 */ OBJ_ACTOR_257, - /* 258 */ OBJ_ACTOR_258, - /* 259 */ OBJ_ACTOR_259, - /* 260 */ OBJ_ACTOR_260, - /* 261 */ OBJ_ACTOR_261, - /* 262 */ OBJ_ACTOR_262, - /* 263 */ OBJ_ACTOR_263, - /* 264 */ OBJ_ACTOR_264, - /* 265 */ OBJ_ACTOR_265, - /* 266 */ OBJ_ACTOR_266, - /* 267 */ OBJ_ACTOR_267, - /* 268 */ OBJ_ACTOR_268, - /* 269 */ OBJ_ACTOR_269, - /* 270 */ OBJ_ACTOR_270, - /* 271 */ OBJ_ACTOR_271, - /* 272 */ OBJ_ACTOR_272, - /* 273 */ OBJ_ACTOR_273, - /* 274 */ OBJ_ACTOR_274, - /* 275 */ OBJ_ACTOR_275, - /* 276 */ OBJ_ACTOR_276, - /* 277 */ OBJ_ACTOR_277, - /* 278 */ OBJ_ACTOR_278, - /* 279 */ OBJ_ACTOR_279, - /* 280 */ OBJ_ACTOR_280, - /* 281 */ OBJ_ACTOR_281, - /* 282 */ OBJ_ACTOR_282, - /* 283 */ OBJ_ACTOR_283, - /* 284 */ OBJ_ACTOR_284, - /* 285 */ OBJ_ACTOR_285, - /* 286 */ OBJ_ACTOR_286, - /* 287 */ OBJ_ACTOR_287, - /* 288 */ OBJ_ACTOR_288, - /* 289 */ OBJ_ACTOR_289, - /* 290 */ OBJ_ACTOR_290, - /* 291 */ OBJ_ACTOR_SUPPLIES, - /* 292 */ OBJ_BOSS_292, - /* 293 */ OBJ_BOSS_293, - /* 294 */ OBJ_BOSS_294, - /* 295 */ OBJ_BOSS_295, - /* 296 */ OBJ_BOSS_296, - /* 297 */ OBJ_BOSS_297, - /* 298 */ OBJ_BOSS_298, - /* 299 */ OBJ_BOSS_299, - /* 300 */ OBJ_BOSS_300, - /* 301 */ OBJ_BOSS_301, - /* 302 */ OBJ_BOSS_A6, - /* 303 */ OBJ_BOSS_303, - /* 304 */ OBJ_BOSS_304, - /* 305 */ OBJ_BOSS_305, - /* 306 */ OBJ_BOSS_TI, - /* 307 */ OBJ_BOSS_ZO, - /* 308 */ OBJ_BOSS_FO, - /* 309 */ OBJ_BOSS_309, - /* 310 */ OBJ_BOSS_310, - /* 311 */ OBJ_BOSS_311, - /* 312 */ OBJ_BOSS_VE2, - /* 313 */ OBJ_BOSS_SZ, - /* 314 */ OBJ_BOSS_SY, - /* 315 */ OBJ_BOSS_SO, - /* 316 */ OBJ_BOSS_KA, - /* 317 */ OBJ_BOSS_KA_BASE, - /* 318 */ OBJ_BOSS_AQ, - /* 319 */ OBJ_BOSS_VE1, - /* 320 */ OBJ_BOSS_320, - /* 321 */ OBJ_BOSS_321, - /* 322 */ OBJ_ITEM_LASERS, - /* 323 */ OBJ_ITEM_CHECKPOINT, - /* 324 */ OBJ_ITEM_SILVER_RING, - /* 325 */ OBJ_ITEM_SILVER_STAR, - /* 326 */ OBJ_ITEM_METEO_WARP, - /* 327 */ OBJ_ITEM_BOMB, - /* 328 */ OBJ_ITEM_PATH_SPLIT_X, - /* 329 */ OBJ_ITEM_PATH_TURN_LEFT, - /* 330 */ OBJ_ITEM_PATH_TURN_RIGHT, - /* 331 */ OBJ_ITEM_PATH_SPLIT_Y, - /* 332 */ OBJ_ITEM_PATH_TURN_UP, - /* 333 */ OBJ_ITEM_PATH_TURN_DOWN, - /* 334 */ OBJ_ITEM_RING_CHECK, - /* 335 */ OBJ_ITEM_1UP, - /* 336 */ OBJ_ITEM_GOLD_RING, - /* 337 */ OBJ_ITEM_WING_REPAIR, - /* 338 */ OBJ_ITEM_TRAINING_RING, - /* 339 */ OBJ_EFFECT_FIRE_SMOKE, - /* 340 */ OBJ_EFFECT_340, - /* 341 */ OBJ_EFFECT_341, - /* 342 */ OBJ_EFFECT_342, - /* 343 */ OBJ_EFFECT_343, - /* 344 */ OBJ_EFFECT_344, - /* 345 */ OBJ_EFFECT_345, - /* 346 */ OBJ_EFFECT_346, - /* 347 */ OBJ_EFFECT_347, - /* 348 */ OBJ_EFFECT_348, - /* 349 */ OBJ_EFFECT_349, - /* 350 */ OBJ_EFFECT_350, - /* 351 */ OBJ_EFFECT_351, - /* 352 */ OBJ_EFFECT_352, - /* 353 */ OBJ_EFFECT_353, - /* 354 */ OBJ_EFFECT_354, - /* 355 */ OBJ_EFFECT_355, - /* 356 */ OBJ_EFFECT_356, - /* 357 */ OBJ_EFFECT_357, - /* 358 */ OBJ_EFFECT_358, - /* 359 */ OBJ_EFFECT_359, - /* 360 */ OBJ_EFFECT_360, - /* 361 */ OBJ_EFFECT_361, - /* 362 */ OBJ_EFFECT_362, - /* 363 */ OBJ_EFFECT_363, - /* 364 */ OBJ_EFFECT_364, - /* 365 */ OBJ_EFFECT_365, - /* 366 */ OBJ_EFFECT_366, - /* 367 */ OBJ_EFFECT_367, - /* 368 */ OBJ_EFFECT_368, - /* 369 */ OBJ_EFFECT_369, - /* 370 */ OBJ_EFFECT_370, - /* 371 */ OBJ_EFFECT_371, - /* 372 */ OBJ_EFFECT_372, - /* 373 */ OBJ_EFFECT_373, - /* 374 */ OBJ_EFFECT_374, - /* 375 */ OBJ_EFFECT_375, - /* 376 */ OBJ_EFFECT_376, - /* 377 */ OBJ_EFFECT_377, - /* 378 */ OBJ_EFFECT_378, - /* 379 */ OBJ_EFFECT_379, - /* 380 */ OBJ_EFFECT_380, - /* 381 */ OBJ_EFFECT_381, - /* 382 */ OBJ_EFFECT_382, - /* 383 */ OBJ_EFFECT_383, - /* 384 */ OBJ_EFFECT_384, - /* 385 */ OBJ_EFFECT_385, - /* 386 */ OBJ_EFFECT_386, - /* 387 */ OBJ_EFFECT_387, - /* 388 */ OBJ_EFFECT_388, - /* 389 */ OBJ_EFFECT_389, - /* 390 */ OBJ_EFFECT_390, - /* 391 */ OBJ_EFFECT_391, - /* 392 */ OBJ_EFFECT_392, - /* 393 */ OBJ_EFFECT_393, - /* 394 */ OBJ_EFFECT_394, - /* 395 */ OBJ_EFFECT_395, - /* 396 */ OBJ_EFFECT_396, - /* 397 */ OBJ_EFFECT_397, - /* 398 */ OBJ_EFFECT_398, - /* 399 */ OBJ_EFFECT_399, - /* 400 */ OBJ_UNK_400, - /* 401 */ OBJ_UNK_401, - /* 402 */ OBJ_UNK_402, - /* 403 */ OBJ_UNK_403, - /* 404 */ OBJ_UNK_404, - /* 405 */ OBJ_UNK_405, - /* 407 */ OBJ_ID_MAX, + /* -1 */ OBJ_INVALID = -1, + /* 0 */ OBJ_SCENERY_CO_STONE_ARCH, + /* 1 */ OBJ_SCENERY_CO_BUMP_1, // Terrain bump 1 + /* 2 */ OBJ_SCENERY_CO_BUMP_2, // Terrain bump 2 + /* 3 */ OBJ_SCENERY_CO_BUMP_3, // Terrain bump 3 + /* 4 */ OBJ_SCENERY_CO_BUMP_4, // Terrain bump 4 + /* 5 */ OBJ_SCENERY_CO_BUMP_5, // Terrain bump 5 + /* 6 */ OBJ_SCENERY_CO_HIGHWAY_1, + /* 7 */ OBJ_SCENERY_CO_HIGHWAY_2, + /* 8 */ OBJ_SCENERY_CO_HIGHWAY_3, + /* 9 */ OBJ_SCENERY_CO_HIGHWAY_4, + /* 10 */ OBJ_SCENERY_CO_BUILDING_1, // Building with "GOOD LUCK!" legend. + /* 11 */ OBJ_SCENERY_CO_BUILDING_2, + /* 12 */ OBJ_SCENERY_CO_BUILDING_3, + /* 13 */ OBJ_SCENERY_CO_BUILDING_4, + /* 14 */ OBJ_SCENERY_CO_BUILDING_5, + /* 15 */ OBJ_SCENERY_CO_BUILDING_6, + /* 16 */ OBJ_SCENERY_CO_BUILDING_7, // Building with Pepper's face on it + /* 17 */ OBJ_SCENERY_CO_BUILDING_8, + /* 18 */ OBJ_SCENERY_CO_BUILDING_ON_FIRE, + /* 19 */ OBJ_SCENERY_CO_TOWER, + /* 20 */ OBJ_SCENERY_CO_ARCH_1, + /* 21 */ OBJ_SCENERY_CO_ARCH_2, + /* 22 */ OBJ_SCENERY_CO_ARCH_3, + /* 23 */ OBJ_SCENERY_CO_RADAR, + /* 24 */ OBJ_SCENERY_CO_HIGHWAY_5, + /* 25 */ OBJ_SCENERY_CO_HIGHWAY_6, + /* 26 */ OBJ_SCENERY_CO_HIGHWAY_7, + /* 27 */ OBJ_SCENERY_CO_HIGHWAY_8, + /* 28 */ OBJ_SCENERY_CO_HIGHWAY_9, + /* 29 */ OBJ_SCENERY_TI_SKULL, + /* 30 */ OBJ_SCENERY_TI_RIB_0, + /* 31 */ OBJ_SCENERY_TI_RIB_1, + /* 32 */ OBJ_SCENERY_TI_RIB_2, + /* 33 */ OBJ_SCENERY_TI_RIB_3, + /* 34 */ OBJ_SCENERY_TI_RIB_4, + /* 35 */ OBJ_SCENERY_TI_RIB_5, + /* 36 */ OBJ_SCENERY_TI_RIB_6, + /* 37 */ OBJ_SCENERY_TI_RIB_7, + /* 38 */ OBJ_SCENERY_TI_RIB_8, + /* 39 */ OBJ_SCENERY_ME_TUNNEL, + /* 40 */ OBJ_SCENERY_CO_BUILDING_9, + /* 41 */ OBJ_SCENERY_CO_BUILDING_10, + /* 42 */ OBJ_SCENERY_IBEAM, + /* 43 */ OBJ_SCENERY_ZO_ROCK_1, + /* 44 */ OBJ_SCENERY_44, + /* 45 */ OBJ_SCENERY_45, + /* 46 */ OBJ_SCENERY_46, + /* 47 */ OBJ_SCENERY_47, + /* 48 */ OBJ_SCENERY_48, + /* 49 */ OBJ_SCENERY_49, + /* 50 */ OBJ_SCENERY_50, + /* 51 */ OBJ_SCENERY_51, + /* 52 */ OBJ_SCENERY_52, + /* 53 */ OBJ_SCENERY_53, + /* 54 */ OBJ_SCENERY_CO_WATERFALL, + /* 55 */ OBJ_SCENERY_CO_ROCKWALL, + /* 56 */ OBJ_SCENERY_CO_DOORS, + /* 57 */ OBJ_SCENERY_57, + /* 58 */ OBJ_SCENERY_58, + /* 59 */ OBJ_SCENERY_59, + /* 60 */ OBJ_SCENERY_60, + /* 61 */ OBJ_SCENERY_61, + /* 62 */ OBJ_SCENERY_62, + /* 63 */ OBJ_SCENERY_63, + /* 64 */ OBJ_SCENERY_64, + /* 65 */ OBJ_SCENERY_65, + /* 66 */ OBJ_SCENERY_66, + /* 67 */ OBJ_SCENERY_67, + /* 68 */ OBJ_SCENERY_68, + /* 69 */ OBJ_SCENERY_69, + /* 70 */ OBJ_SCENERY_70, + /* 71 */ OBJ_SCENERY_71, + /* 72 */ OBJ_SCENERY_72, + /* 73 */ OBJ_SCENERY_73, + /* 74 */ OBJ_SCENERY_74, + /* 75 */ OBJ_SCENERY_75, + /* 76 */ OBJ_SCENERY_76, + /* 77 */ OBJ_SCENERY_77, + /* 78 */ OBJ_SCENERY_78, + /* 79 */ OBJ_SCENERY_79, + /* 80 */ OBJ_SCENERY_80, + /* 81 */ OBJ_SCENERY_81, + /* 82 */ OBJ_SCENERY_82, + /* 83 */ OBJ_SCENERY_83, + /* 84 */ OBJ_SCENERY_84, + /* 85 */ OBJ_SCENERY_85, + /* 86 */ OBJ_SCENERY_86, + /* 87 */ OBJ_SCENERY_87, + /* 88 */ OBJ_SCENERY_88, + /* 89 */ OBJ_SCENERY_89, + /* 90 */ OBJ_SCENERY_90, + /* 91 */ OBJ_SCENERY_91, + /* 92 */ OBJ_SCENERY_92, + /* 93 */ OBJ_SCENERY_93, + /* 94 */ OBJ_SCENERY_94, + /* 95 */ OBJ_SCENERY_95, + /* 96 */ OBJ_SCENERY_96, + /* 97 */ OBJ_SCENERY_97, + /* 98 */ OBJ_SCENERY_98, + /* 99 */ OBJ_SCENERY_99, + /* 100 */ OBJ_SCENERY_100, + /* 101 */ OBJ_SCENERY_101, + /* 102 */ OBJ_SCENERY_102, + /* 103 */ OBJ_SCENERY_103, + /* 104 */ OBJ_SCENERY_104, + /* 105 */ OBJ_SCENERY_105, + /* 106 */ OBJ_SCENERY_106, + /* 107 */ OBJ_SCENERY_107, + /* 108 */ OBJ_SCENERY_108, + /* 109 */ OBJ_SCENERY_109, + /* 110 */ OBJ_SCENERY_110, + /* 111 */ OBJ_SCENERY_111, + /* 112 */ OBJ_SCENERY_112, + /* 113 */ OBJ_SCENERY_113, + /* 114 */ OBJ_SCENERY_114, + /* 115 */ OBJ_SCENERY_115, + /* 116 */ OBJ_SCENERY_116, + /* 117 */ OBJ_SCENERY_117, + /* 118 */ OBJ_SCENERY_118, + /* 119 */ OBJ_SCENERY_119, + /* 120 */ OBJ_SCENERY_120, + /* 121 */ OBJ_SCENERY_121, + /* 122 */ OBJ_SCENERY_122, + /* 123 */ OBJ_SCENERY_123, + /* 124 */ OBJ_SCENERY_124, + /* 125 */ OBJ_SCENERY_125, + /* 126 */ OBJ_SCENERY_126, + /* 127 */ OBJ_SCENERY_127, + /* 128 */ OBJ_SCENERY_128, + /* 129 */ OBJ_SCENERY_129, + /* 130 */ OBJ_SCENERY_130, + /* 131 */ OBJ_SCENERY_131, + /* 132 */ OBJ_SCENERY_132, + /* 133 */ OBJ_SCENERY_133, + /* 134 */ OBJ_SCENERY_134, + /* 135 */ OBJ_SCENERY_135, + /* 136 */ OBJ_SCENERY_136, + /* 137 */ OBJ_SCENERY_137, + /* 138 */ OBJ_SCENERY_138, + /* 139 */ OBJ_SCENERY_139, + /* 140 */ OBJ_SCENERY_140, + /* 141 */ OBJ_SCENERY_141, + /* 142 */ OBJ_SCENERY_142, + /* 143 */ OBJ_SCENERY_143, + /* 144 */ OBJ_SCENERY_144, + /* 145 */ OBJ_SCENERY_145, + /* 146 */ OBJ_SCENERY_146, + /* 147 */ OBJ_SCENERY_147, + /* 148 */ OBJ_SCENERY_148, + /* 149 */ OBJ_SCENERY_149, + /* 150 */ OBJ_SCENERY_150, + /* 151 */ OBJ_SCENERY_151, + /* 152 */ OBJ_SCENERY_152, + /* 153 */ OBJ_SCENERY_153, + /* 154 */ OBJ_SCENERY_154, + /* 155 */ OBJ_SCENERY_155, + /* 156 */ OBJ_SCENERY_156, + /* 157 */ OBJ_SCENERY_157, + /* 158 */ OBJ_SCENERY_158, + /* 159 */ OBJ_SCENERY_159, + /* 160 */ OBJ_SCENERY_160, + /* 161 */ OBJ_SPRITE_CO_POLE, + /* 162 */ OBJ_SPRITE_CO_TREE, + /* 163 */ OBJ_SPRITE_FO_POLE, + /* 164 */ OBJ_SPRITE_FOG_SHADOW, + /* 165 */ OBJ_SPRITE_CO_RUIN1, + /* 166 */ OBJ_SPRITE_CO_RUIN2, + /* 167 */ OBJ_SPRITE_167, + /* 168 */ OBJ_SPRITE_168, + /* 169 */ OBJ_SPRITE_TI_CACTUS, + /* 170 */ OBJ_SPRITE_CO_SMOKE, + /* 171 */ OBJ_SPRITE_VE1_BOSS_TRIGGER1, + /* 172 */ OBJ_SPRITE_VE1_BOSS_TRIGGER2, + /* 173 */ OBJ_SPRITE_VE1_BOSS_TRIGGER3, + /* 174 */ OBJ_SPRITE_VE1_BOSS_TRIGGER4, + /* 175 */ OBJ_SPRITE_GFOX_TARGET, + /* 176 */ OBJ_ACTOR_CO_GARUDA_1, // Robot that pushes buildings. + /* 177 */ OBJ_ACTOR_CO_GARUDA_2, // Robot that throws I-Beams. + /* 178 */ OBJ_ACTOR_CO_GARUDA_3, // Robot that spins I-Beams. + /* 179 */ OBJ_ACTOR_CO_GARUDA_DESTROY, + /* 180 */ OBJ_ACTOR_180, + /* 181 */ OBJ_ACTOR_181, + /* 182 */ OBJ_ACTOR_182, + /* 183 */ OBJ_ACTOR_183, + /* 184 */ OBJ_ACTOR_184, + /* 185 */ OBJ_ACTOR_185, + /* 186 */ OBJ_ACTOR_186, + /* 187 */ OBJ_ACTOR_187, + /* 188 */ OBJ_ACTOR_188, + /* 189 */ OBJ_ACTOR_DEBRIS, + /* 190 */ OBJ_MISSILE_SEEK_TEAM, + /* 191 */ OBJ_MISSILE_SEEK_PLAYER, + /* 192 */ OBJ_ACTOR_192, + /* 193 */ OBJ_ACTOR_193, + /* 194 */ OBJ_ACTOR_194, + /* 195 */ OBJ_ACTOR_CUTSCENE, + /* 196 */ OBJ_ACTOR_196, + /* 197 */ OBJ_ACTOR_ALLRANGE, + /* 198 */ OBJ_ACTOR_TEAM_BOSS, + /* 199 */ OBJ_ACTOR_199, + /* 200 */ OBJ_ACTOR_EVENT, + /* 201 */ OBJ_ACTOR_201, + /* 202 */ OBJ_ACTOR_202, + /* 203 */ OBJ_ACTOR_SLIPPY_SX, + /* 204 */ OBJ_ACTOR_204, + /* 205 */ OBJ_ACTOR_205, + /* 206 */ OBJ_ACTOR_206, + /* 207 */ OBJ_ACTOR_207, + /* 208 */ OBJ_ACTOR_208, + /* 209 */ OBJ_ACTOR_209, + /* 210 */ OBJ_ACTOR_210, + /* 211 */ OBJ_ACTOR_211, + /* 212 */ OBJ_ACTOR_212, + /* 213 */ OBJ_ACTOR_213, + /* 214 */ OBJ_ACTOR_214, + /* 215 */ OBJ_ACTOR_215, + /* 216 */ OBJ_ACTOR_216, + /* 217 */ OBJ_ACTOR_217, + /* 218 */ OBJ_ACTOR_218, + /* 219 */ OBJ_ACTOR_219, + /* 220 */ OBJ_ACTOR_220, + /* 221 */ OBJ_ACTOR_221, + /* 222 */ OBJ_ACTOR_222, + /* 223 */ OBJ_ACTOR_223, + /* 224 */ OBJ_ACTOR_224, + /* 225 */ OBJ_ACTOR_225, + /* 226 */ OBJ_ACTOR_226, + /* 227 */ OBJ_ACTOR_227, + /* 228 */ OBJ_ACTOR_228, + /* 229 */ OBJ_ACTOR_229, + /* 230 */ OBJ_ACTOR_230, + /* 231 */ OBJ_ACTOR_231, + /* 232 */ OBJ_ACTOR_232, + /* 233 */ OBJ_ACTOR_233, + /* 234 */ OBJ_ACTOR_234, + /* 235 */ OBJ_ACTOR_235, + /* 236 */ OBJ_ACTOR_236, + /* 237 */ OBJ_ACTOR_237, + /* 238 */ OBJ_ACTOR_238, + /* 239 */ OBJ_ACTOR_239, + /* 240 */ OBJ_ACTOR_240, + /* 241 */ OBJ_ACTOR_241, + /* 242 */ OBJ_ACTOR_242, + /* 243 */ OBJ_ACTOR_243, + /* 244 */ OBJ_ACTOR_244, + /* 245 */ OBJ_ACTOR_245, + /* 246 */ OBJ_ACTOR_246, + /* 247 */ OBJ_ACTOR_247, + /* 248 */ OBJ_ACTOR_248, + /* 249 */ OBJ_ACTOR_249, + /* 250 */ OBJ_ACTOR_250, + /* 251 */ OBJ_ACTOR_251, + /* 252 */ OBJ_ACTOR_252, + /* 253 */ OBJ_ACTOR_253, + /* 254 */ OBJ_ACTOR_254, + /* 255 */ OBJ_ACTOR_255, + /* 256 */ OBJ_ACTOR_256, + /* 257 */ OBJ_ACTOR_257, + /* 258 */ OBJ_ACTOR_258, + /* 259 */ OBJ_ACTOR_259, + /* 260 */ OBJ_ACTOR_260, + /* 261 */ OBJ_ACTOR_261, + /* 262 */ OBJ_ACTOR_262, + /* 263 */ OBJ_ACTOR_263, + /* 264 */ OBJ_ACTOR_264, + /* 265 */ OBJ_ACTOR_265, + /* 266 */ OBJ_ACTOR_266, + /* 267 */ OBJ_ACTOR_267, + /* 268 */ OBJ_ACTOR_268, + /* 269 */ OBJ_ACTOR_269, + /* 270 */ OBJ_ACTOR_270, + /* 271 */ OBJ_ACTOR_271, + /* 272 */ OBJ_ACTOR_272, + /* 273 */ OBJ_ACTOR_FO_RADAR, + /* 274 */ OBJ_ACTOR_SZ_SPACE_JUNK, + /* 275 */ OBJ_ACTOR_275, + /* 276 */ OBJ_ACTOR_276, + /* 277 */ OBJ_ACTOR_277, + /* 278 */ OBJ_ACTOR_278, + /* 279 */ OBJ_ACTOR_279, + /* 280 */ OBJ_ACTOR_280, + /* 281 */ OBJ_ACTOR_281, + /* 282 */ OBJ_ACTOR_282, + /* 283 */ OBJ_ACTOR_283, + /* 284 */ OBJ_ACTOR_284, + /* 285 */ OBJ_ACTOR_285, + /* 286 */ OBJ_ACTOR_286, + /* 287 */ OBJ_ACTOR_287, + /* 288 */ OBJ_ACTOR_288, + /* 289 */ OBJ_ACTOR_289, + /* 290 */ OBJ_ACTOR_290, + /* 291 */ OBJ_ACTOR_SUPPLIES, + /* 292 */ OBJ_BOSS_CO_GRANGA, + /* 293 */ OBJ_BOSS_CO_CARRIER, + /* 294 */ OBJ_BOSS_294, + /* 295 */ OBJ_BOSS_295, + /* 296 */ OBJ_BOSS_296, + /* 297 */ OBJ_BOSS_297, + /* 298 */ OBJ_BOSS_298, + /* 299 */ OBJ_BOSS_299, + /* 300 */ OBJ_BOSS_300, + /* 301 */ OBJ_BOSS_301, + /* 302 */ OBJ_BOSS_A6, + /* 303 */ OBJ_BOSS_SX_SPYBORG, + /* 304 */ OBJ_BOSS_304, + /* 305 */ OBJ_BOSS_305, + /* 306 */ OBJ_BOSS_TI, + /* 307 */ OBJ_BOSS_ZO, + /* 308 */ OBJ_BOSS_FO, + /* 309 */ OBJ_BOSS_309, + /* 310 */ OBJ_BOSS_310, + /* 311 */ OBJ_BOSS_311, + /* 312 */ OBJ_BOSS_VE2, + /* 313 */ OBJ_BOSS_SZ_GREAT_FOX, + /* 314 */ OBJ_BOSS_SY, + /* 315 */ OBJ_BOSS_SO, + /* 316 */ OBJ_BOSS_KA, + /* 317 */ OBJ_BOSS_KA_BASE, + /* 318 */ OBJ_BOSS_AQ, + /* 319 */ OBJ_BOSS_VE1, + /* 320 */ OBJ_BOSS_320, + /* 321 */ OBJ_BOSS_321, + /* 322 */ OBJ_ITEM_LASERS, + /* 323 */ OBJ_ITEM_CHECKPOINT, + /* 324 */ OBJ_ITEM_SILVER_RING, + /* 325 */ OBJ_ITEM_SILVER_STAR, + /* 326 */ OBJ_ITEM_METEO_WARP, + /* 327 */ OBJ_ITEM_BOMB, + /* 328 */ OBJ_ITEM_PATH_SPLIT_X, + /* 329 */ OBJ_ITEM_PATH_TURN_LEFT, + /* 330 */ OBJ_ITEM_PATH_TURN_RIGHT, + /* 331 */ OBJ_ITEM_PATH_SPLIT_Y, + /* 332 */ OBJ_ITEM_PATH_TURN_UP, + /* 333 */ OBJ_ITEM_PATH_TURN_DOWN, + /* 334 */ OBJ_ITEM_RING_CHECK, + /* 335 */ OBJ_ITEM_1UP, + /* 336 */ OBJ_ITEM_GOLD_RING, + /* 337 */ OBJ_ITEM_WING_REPAIR, + /* 338 */ OBJ_ITEM_TRAINING_RING, + /* 339 */ OBJ_EFFECT_FIRE_SMOKE, + /* 340 */ OBJ_EFFECT_340, + /* 341 */ OBJ_EFFECT_341, + /* 342 */ OBJ_EFFECT_342, + /* 343 */ OBJ_EFFECT_343, + /* 344 */ OBJ_EFFECT_344, + /* 345 */ OBJ_EFFECT_345, + /* 346 */ OBJ_EFFECT_346, + /* 347 */ OBJ_EFFECT_347, + /* 348 */ OBJ_EFFECT_348, + /* 349 */ OBJ_EFFECT_349, + /* 350 */ OBJ_EFFECT_350, + /* 351 */ OBJ_EFFECT_351, + /* 352 */ OBJ_EFFECT_CLOUDS, + /* 353 */ OBJ_EFFECT_ENEMY_LASER_1, + /* 354 */ OBJ_EFFECT_354, + /* 355 */ OBJ_EFFECT_355, + /* 356 */ OBJ_EFFECT_356, + /* 357 */ OBJ_EFFECT_357, + /* 358 */ OBJ_EFFECT_358, + /* 359 */ OBJ_EFFECT_359, + /* 360 */ OBJ_EFFECT_360, + /* 361 */ OBJ_EFFECT_361, + /* 362 */ OBJ_EFFECT_362, + /* 363 */ OBJ_EFFECT_363, + /* 364 */ OBJ_EFFECT_364, + /* 365 */ OBJ_EFFECT_365, + /* 366 */ OBJ_EFFECT_366, + /* 367 */ OBJ_EFFECT_367, + /* 368 */ OBJ_EFFECT_368, + /* 369 */ OBJ_EFFECT_369, + /* 370 */ OBJ_EFFECT_370, + /* 371 */ OBJ_EFFECT_371, + /* 372 */ OBJ_EFFECT_372, + /* 373 */ OBJ_EFFECT_TIMED_SFX, + /* 374 */ OBJ_EFFECT_374, + /* 375 */ OBJ_EFFECT_375, + /* 376 */ OBJ_EFFECT_376, + /* 377 */ OBJ_EFFECT_377, + /* 378 */ OBJ_EFFECT_378, + /* 379 */ OBJ_EFFECT_379, + /* 380 */ OBJ_EFFECT_380, + /* 381 */ OBJ_EFFECT_381, + /* 382 */ OBJ_EFFECT_382, + /* 383 */ OBJ_EFFECT_383, + /* 384 */ OBJ_EFFECT_384, + /* 385 */ OBJ_EFFECT_385, + /* 386 */ OBJ_EFFECT_386, + /* 387 */ OBJ_EFFECT_387, + /* 388 */ OBJ_EFFECT_388, + /* 389 */ OBJ_EFFECT_389, + /* 390 */ OBJ_EFFECT_390, + /* 391 */ OBJ_EFFECT_391, + /* 392 */ OBJ_EFFECT_392, + /* 393 */ OBJ_EFFECT_393, + /* 394 */ OBJ_EFFECT_394, + /* 395 */ OBJ_EFFECT_395, + /* 396 */ OBJ_EFFECT_396, + /* 397 */ OBJ_EFFECT_397, + /* 398 */ OBJ_EFFECT_398, + /* 399 */ OBJ_EFFECT_399, + /* 400 */ OBJ_UNK_400, + /* 401 */ OBJ_UNK_401, + /* 402 */ OBJ_UNK_402, + /* 403 */ OBJ_UNK_403, + /* 404 */ OBJ_UNK_404, + /* 405 */ OBJ_UNK_405, + /* 407 */ OBJ_ID_MAX, } ObjectId; -#define OBJ_SCENERY_START OBJ_SCENERY_0 -#define OBJ_SPRITE_START OBJ_SPRITE_CO_POLE -#define OBJ_ACTOR_START OBJ_ACTOR_176 -#define OBJ_BOSS_START OBJ_BOSS_292 -#define OBJ_ITEM_START OBJ_ITEM_LASERS -#define OBJ_EFFECT_START OBJ_EFFECT_FIRE_SMOKE -#define OBJ_ENV_START OBJ_UNK_400 +#define OBJ_SCENERY_START OBJ_SCENERY_CO_STONE_ARCH +#define OBJ_SPRITE_START OBJ_SPRITE_CO_POLE +#define OBJ_ACTOR_START OBJ_ACTOR_CO_GARUDA_1 +#define OBJ_BOSS_START OBJ_BOSS_CO_GRANGA +#define OBJ_ITEM_START OBJ_ITEM_LASERS +#define OBJ_EFFECT_START OBJ_EFFECT_FIRE_SMOKE +#define OBJ_ENV_START OBJ_UNK_400 -#define OBJ_SCENERY_MAX OBJ_SPRITE_START -#define OBJ_SPRITE_MAX OBJ_ACTOR_START -#define OBJ_ACTOR_MAX OBJ_BOSS_START -#define OBJ_BOSS_MAX OBJ_ITEM_START -#define OBJ_ITEM_MAX OBJ_EFFECT_START -#define OBJ_EFFECT_MAX OBJ_ENV_START +#define OBJ_SCENERY_MAX OBJ_SPRITE_START +#define OBJ_SPRITE_MAX OBJ_ACTOR_START +#define OBJ_ACTOR_MAX OBJ_BOSS_START +#define OBJ_BOSS_MAX OBJ_ITEM_START +#define OBJ_ITEM_MAX OBJ_EFFECT_START +#define OBJ_EFFECT_MAX OBJ_ENV_START #define ACTOR_EVENT_ID 1000 @@ -775,7 +773,7 @@ typedef enum AllRangeAi { /* 7 */ AI360_ANDREW, /* 8 */ AI360_KATT, /* 9 */ AI360_BILL, - /* 10 */ AI360_10, + /* 10 */ AI360_ENEMY, /* 100 */ AI360_GREAT_FOX = 100, /* 200 */ AI360_MISSILE = 200, /* 200 */ AI360_EVENT_HANDLER = 1000, @@ -937,106 +935,106 @@ typedef enum { /* 50 */ LN_VWK_MAX, } BossLNvwork; -typedef Scenery Scenery_0; -typedef Scenery Scenery_1; -typedef Scenery Scenery_2; -typedef Scenery Scenery_3; -typedef Scenery Scenery_4; -typedef Scenery Scenery_5; -typedef Scenery Scenery_6; -typedef Scenery Scenery_7; -typedef Scenery Scenery_8; -typedef Scenery Scenery_9; -typedef Scenery Scenery_10; -typedef Scenery Scenery_11; -typedef Scenery Scenery_12; -typedef Scenery Scenery_13; -typedef Scenery Scenery_14; -typedef Scenery Scenery_15; -typedef Scenery Scenery_16; -typedef Scenery Scenery_17; -typedef Scenery Scenery_18; -typedef Scenery Scenery_19; -typedef Scenery Scenery_20; -typedef Scenery Scenery_21; -typedef Scenery Scenery_22; -typedef Scenery Scenery_23; -typedef Scenery Scenery_24; -typedef Scenery Scenery_25; -typedef Scenery Scenery_26; -typedef Scenery Scenery_27; -typedef Scenery Scenery_28; -typedef Scenery Scenery_29; -typedef Scenery Scenery_30; -typedef Scenery Scenery_31; -typedef Scenery Scenery_32; -typedef Scenery Scenery_33; -typedef Scenery Scenery_34; -typedef Scenery Scenery_35; -typedef Scenery Scenery_36; -typedef Scenery Scenery_37; -typedef Scenery Scenery_38; -typedef Scenery MeteoTunnel; -typedef Scenery Scenery_40; -typedef Scenery Scenery_41; -typedef Scenery Scenery_42; -typedef Scenery Scenery_43; -typedef Scenery Scenery_44; -typedef Scenery Scenery_45; -typedef Scenery Scenery_46; -typedef Scenery Scenery_47; -typedef Scenery Scenery_48; -typedef Scenery Scenery_49; -typedef Scenery Scenery_50; -typedef Scenery Scenery_51; -typedef Scenery Scenery_52; -typedef Scenery Scenery_53; -typedef Scenery Scenery_54; -typedef Scenery Scenery_55; -typedef Scenery Scenery_56; -typedef Scenery Scenery_57; -typedef Scenery Scenery_58; -typedef Scenery Scenery_59; -typedef Scenery Scenery_60; -typedef Scenery Scenery_61; -typedef Scenery Scenery_62; -typedef Scenery Scenery_63; -typedef Scenery Scenery_64; -typedef Scenery Scenery_65; -typedef Scenery Scenery_66; -typedef Scenery Scenery_67; -typedef Scenery Scenery_68; -typedef Scenery Scenery_69; -typedef Scenery Scenery_70; -typedef Scenery Scenery_71; -typedef Scenery Scenery_72; -typedef Scenery Scenery_73; -typedef Scenery Scenery_74; -typedef Scenery Scenery_75; -typedef Scenery Scenery_76; -typedef Scenery Scenery_77; -typedef Scenery Scenery_78; -typedef Scenery Scenery_79; -typedef Scenery Scenery_80; -typedef Scenery Scenery_81; -typedef Scenery Scenery_82; -typedef Scenery Scenery_83; -typedef Scenery Scenery_84; -typedef Scenery Scenery_85; -typedef Scenery Scenery_86; -typedef Scenery Scenery_87; -typedef Scenery Scenery_88; -typedef Scenery Scenery_89; -typedef Scenery Scenery_90; -typedef Scenery Scenery_91; -typedef Scenery Scenery_92; -typedef Scenery Scenery_93; -typedef Scenery Scenery_94; -typedef Scenery Scenery_95; -typedef Scenery Scenery_96; -typedef Scenery Scenery_97; -typedef Scenery Scenery_98; -typedef Scenery Scenery_99; +typedef Scenery Scenery_0; +typedef Scenery Scenery_1; +typedef Scenery Scenery_2; +typedef Scenery Scenery_3; +typedef Scenery Scenery_4; +typedef Scenery Scenery_5; +typedef Scenery Scenery_6; +typedef Scenery Scenery_7; +typedef Scenery Scenery_8; +typedef Scenery Scenery_9; +typedef Scenery Scenery_10; +typedef Scenery Scenery_11; +typedef Scenery Scenery_12; +typedef Scenery Scenery_13; +typedef Scenery Scenery_14; +typedef Scenery Scenery_15; +typedef Scenery Scenery_16; +typedef Scenery Scenery_17; +typedef Scenery CoBuildingOnFire; +typedef Scenery Scenery_19; +typedef Scenery Scenery_20; +typedef Scenery Scenery_21; +typedef Scenery Scenery_22; +typedef Scenery Scenery_23; +typedef Scenery Scenery_24; +typedef Scenery Scenery_25; +typedef Scenery Scenery_26; +typedef Scenery Scenery_27; +typedef Scenery Scenery_28; +typedef Scenery Scenery_29; +typedef Scenery Scenery_30; +typedef Scenery Scenery_31; +typedef Scenery Scenery_32; +typedef Scenery Scenery_33; +typedef Scenery Scenery_34; +typedef Scenery Scenery_35; +typedef Scenery Scenery_36; +typedef Scenery Scenery_37; +typedef Scenery Scenery_38; +typedef Scenery MeteoTunnel; +typedef Scenery CoBuilding9; +typedef Scenery CoBuilding10; +typedef Scenery CoIBeam; +typedef Scenery Scenery_43; +typedef Scenery Scenery_44; +typedef Scenery Scenery_45; +typedef Scenery Scenery_46; +typedef Scenery Scenery_47; +typedef Scenery Scenery_48; +typedef Scenery Scenery_49; +typedef Scenery Scenery_50; +typedef Scenery Scenery_51; +typedef Scenery Scenery_52; +typedef Scenery Scenery_53; +typedef Scenery CoWaterfall; +typedef Scenery Scenery_55; +typedef Scenery CoDoors; +typedef Scenery Scenery_57; +typedef Scenery Scenery_58; +typedef Scenery Scenery_59; +typedef Scenery Scenery_60; +typedef Scenery Scenery_61; +typedef Scenery Scenery_62; +typedef Scenery Scenery_63; +typedef Scenery Scenery_64; +typedef Scenery Scenery_65; +typedef Scenery Scenery_66; +typedef Scenery Scenery_67; +typedef Scenery Scenery_68; +typedef Scenery Scenery_69; +typedef Scenery Scenery_70; +typedef Scenery Scenery_71; +typedef Scenery Scenery_72; +typedef Scenery Scenery_73; +typedef Scenery Scenery_74; +typedef Scenery Scenery_75; +typedef Scenery Scenery_76; +typedef Scenery Scenery_77; +typedef Scenery Scenery_78; +typedef Scenery Scenery_79; +typedef Scenery Scenery_80; +typedef Scenery Scenery_81; +typedef Scenery Scenery_82; +typedef Scenery Scenery_83; +typedef Scenery Scenery_84; +typedef Scenery Scenery_85; +typedef Scenery Scenery_86; +typedef Scenery Scenery_87; +typedef Scenery Scenery_88; +typedef Scenery Scenery_89; +typedef Scenery Scenery_90; +typedef Scenery Scenery_91; +typedef Scenery Scenery_92; +typedef Scenery Scenery_93; +typedef Scenery Scenery_94; +typedef Scenery Scenery_95; +typedef Scenery Scenery_96; +typedef Scenery Scenery_97; +typedef Scenery Scenery_98; +typedef Scenery Scenery_99; typedef Scenery Scenery_100; typedef Scenery Scenery_101; typedef Scenery Scenery_102; @@ -1113,10 +1111,10 @@ typedef Sprite Ve1BossTrigger2; typedef Sprite Ve1BossTrigger3; typedef Sprite Ve1BossTrigger4; typedef Sprite GfoxTarget; -typedef Actor Actor176; -typedef Actor Actor177; -typedef Actor Actor178; -typedef Actor Actor179; +typedef Actor CoGaruda1; +typedef Actor CoGaruda2; +typedef Actor CoGaruda3; +typedef Actor CoGarudaDestroy; typedef Actor Actor180; typedef Actor Actor181; typedef Actor Actor182; @@ -1210,8 +1208,8 @@ typedef Actor Actor269; typedef Actor Actor270; typedef Actor Actor271; typedef Actor Actor272; -typedef Actor Actor273; -typedef Actor Actor274; +typedef Actor FoRadar; +typedef Actor ActorSpaceJunk; typedef Actor Actor275; typedef Actor Actor276; typedef Actor Actor277; @@ -1229,8 +1227,8 @@ typedef Actor Actor288; typedef Actor Actor289; typedef Actor Actor290; typedef Actor ActorSupplies; -typedef Boss Boss292; -typedef Boss Boss293; +typedef Boss Granga; +typedef Boss Carrier; typedef Boss Boss294; typedef Boss Boss295; typedef Boss Boss296; @@ -1240,18 +1238,18 @@ typedef Boss Boss299; typedef Boss Boss300; typedef Boss Boss301; typedef Boss BossA6; -typedef Boss Boss303; +typedef Boss Spyborg; typedef Boss Boss304; typedef Boss Boss305; typedef Boss Boss306; typedef Boss BossZO; -typedef Boss Boss308; +typedef Boss BossFO; typedef Boss Boss309; typedef Boss Boss310; typedef Boss Boss311; -typedef Boss Boss312; -typedef Boss Boss313; -typedef Boss Boss314; +typedef Boss BossVE2; +typedef Boss GreatFoxSZ; +typedef Boss BossSY; typedef Boss BossSO; typedef Boss Saucerer; typedef Boss Frontlinebase; @@ -1289,7 +1287,7 @@ typedef Effect Effect348; typedef Effect Effect349; typedef Effect Effect350; typedef Effect Effect351; -typedef Effect Effect352; +typedef Effect Clouds; typedef Effect Effect353; typedef Effect Effect354; typedef Effect Effect355; @@ -1310,7 +1308,7 @@ typedef Effect Effect369; typedef Effect Effect370; typedef Effect Effect371; typedef Effect Effect372; -typedef Effect Effect373; +typedef Effect TimedSfx; typedef Effect Effect374; typedef Effect Effect375; typedef Effect Effect376; @@ -1338,5 +1336,4 @@ typedef Effect Effect397; typedef Effect Effect398; typedef Effect Effect399; - #endif diff --git a/include/sf64player.h b/include/sf64player.h index 2d191a66..72aee784 100644 --- a/include/sf64player.h +++ b/include/sf64player.h @@ -318,7 +318,7 @@ typedef struct Player { /* 0x498 */ s32 mercyTimer; /* 0x49C */ WingInfo wings; /* 0x4D8 */ f32 aerobaticPitch; - /* 0x4DC */ s32 somersault; + /* 0x4DC */ bool somersault; } Player; // size = 0x4E0 diff --git a/linker_scripts/us/rev1/symbol_addrs.txt b/linker_scripts/us/rev1/symbol_addrs.txt index 3e708ccf..9b9dbbec 100644 --- a/linker_scripts/us/rev1/symbol_addrs.txt +++ b/linker_scripts/us/rev1/symbol_addrs.txt @@ -153,7 +153,7 @@ D_800D8594 = 0x800D8594; // force_migration:True D_800C93EC = 0x800C93EC; // force_migration:True D_i1_8019B1EC = 0x8019B1EC; // force_migration:True segment:ovl_i1 -D_i1_8019B6D8 = 0x8019B6D8; // size:0x110 segment:ovl_i1 +sCoGrangaWork = 0x8019B6D8; // size:0x110 segment:ovl_i1 D_i3_801C171C = 0x801C171C; // force_migration:True segment:ovl_i3 D_i3_801C1728 = 0x801C1728; // force_migration:True segment:ovl_i3 D_i3_801C1730 = 0x801C1730; // force_migration:True segment:ovl_i3 diff --git a/linker_scripts/us/rev1/symbol_addrs_engine.txt b/linker_scripts/us/rev1/symbol_addrs_engine.txt index 08b68111..d3f16df6 100644 --- a/linker_scripts/us/rev1/symbol_addrs_engine.txt +++ b/linker_scripts/us/rev1/symbol_addrs_engine.txt @@ -176,13 +176,13 @@ Actor202_Draw = 0x80059A24; MeteoTunnel_Draw = 0x80059AEC; Scenery_DrawTitaniaBones = 0x80059B20; func_edisplay_80059BB0 = 0x80059BB0; -Scenery42_Draw = 0x80059BBC; +CoIBeam_Draw = 0x80059BBC; Actor196_Draw = 0x80059BF0; func_edisplay_80059C28 = 0x80059C28; Sprite167_Draw = 0x80059C34; FogShadow_Draw = 0x80059C40; -func_edisplay_80059F68 = 0x80059F68; -func_edisplay_80059FDC = 0x80059FDC; +CoBuilding9_Draw = 0x80059F68; +CoBuilding10_Draw = 0x80059FDC; func_edisplay_8005A010 = 0x8005A010; func_edisplay_8005A07C = 0x8005A07C; func_edisplay_8005A088 = 0x8005A088; @@ -190,12 +190,12 @@ ActorDebris_Draw = 0x8005A094; Actor_DrawEngineAndContrails = 0x8005ADAC; Actor_DrawEngineGlow = 0x8005B1E8; func_edisplay_8005B388 = 0x8005B388; -func_edisplay_8005B6A4 = 0x8005B6A4; -func_edisplay_8005B71C = 0x8005B71C; -func_edisplay_8005B7CC = 0x8005B7CC; -func_edisplay_8005B848 = 0x8005B848; -func_edisplay_8005B9A4 = 0x8005B9A4; -func_edisplay_8005BA30 = 0x8005BA30; +Actor180_Draw = 0x8005B6A4; +Actor182_Draw = 0x8005B71C; +Actor186_Draw = 0x8005B7CC; +Actor190_191_Draw = 0x8005B848; +Actor192_Draw = 0x8005B9A4; +Actor193_Draw = 0x8005BA30; func_edisplay_8005BAAC = 0x8005BAAC; Object_SetShadowDL = 0x8005BAB4; ItemCheckpoint_Draw = 0x8005C5F0; @@ -237,7 +237,7 @@ BonusText_Display = 0x80077240; func_effect_8007783C = 0x8007783C; func_effect_80079618 = 0x80079618; func_effect_8007A568 = 0x8007A568; -func_effect_8007A6F0 = 0x8007A6F0; +Effect_SpawnTimedSfxAtPos = 0x8007A6F0; func_effect_8007A900 = 0x8007A900; func_effect_8007AFD0 = 0x8007AFD0; func_effect_8007B8F8 = 0x8007B8F8; @@ -297,19 +297,19 @@ func_enmy_8006546C = 0x8006546C; func_enmy_800654E4 = 0x800654E4; func_enmy_800655C8 = 0x800655C8; func_enmy_8006566C = 0x8006566C; -func_enmy_800656D4 = 0x800656D4; +Actors190_191_Update = 0x800656D4; func_enmy_800660F0 = 0x800660F0; Actor_Despawn = 0x80066254; -func_enmy_8006654C = 0x8006654C; +Actor192_Update = 0x8006654C; func_enmy_8006684C = 0x8006684C; -func_enmy_800669A0 = 0x800669A0; -func_enmy_80066A80 = 0x80066A80; +Actor193_Update = 0x800669A0; +Actor180_Update = 0x80066A80; func_enmy_80066A8C = 0x80066A8C; func_enmy_80066C00 = 0x80066C00; -func_enmy_80066D5C = 0x80066D5C; +CoBuilding9_Update = 0x80066D5C; func_enmy_80066E80 = 0x80066E80; Sprite167_Update = 0x80066E8C; -func_enmy_80066EA8 = 0x80066EA8; +SceneryRotateTowardsCamera = 0x80066EA8; func_enmy_80066EE4 = 0x80066EE4; Item_CheckBounds = 0x80066EF0; Item_SpinPickup = 0x800671D0; diff --git a/linker_scripts/us/rev1/symbol_addrs_overlays.txt b/linker_scripts/us/rev1/symbol_addrs_overlays.txt index 9a1bc028..1ceb0b8e 100644 --- a/linker_scripts/us/rev1/symbol_addrs_overlays.txt +++ b/linker_scripts/us/rev1/symbol_addrs_overlays.txt @@ -1,8 +1,8 @@ -Corneria_8018ED78 = 0x8018ED78;//segment:ovl_i1 -Corneria_8018EE84 = 0x8018EE84;//segment:ovl_i1 -Corneria_8018B0B4 = 0x8018B0B4;//segment:ovl_i1 -Corneria_Boss292_Init = 0x801878D8;//segment:ovl_i1 -Corneria_Boss293_Init = 0x8018BE7C;//segment:ovl_i1 +Corneria_Boss294_Draw = 0x8018ED78;//segment:ovl_i1 +Corneria_Boss295_Draw = 0x8018EE84;//segment:ovl_i1 +Corneria_IBeam_Init = 0x8018B0B4;//segment:ovl_i1 +Corneria_Granga_Init = 0x801878D8;//segment:ovl_i1 +Corneria_Carrier_Init = 0x8018BE7C;//segment:ovl_i1 Venom1_8019250C = 0x8019250C;//segment:ovl_i1 Venom1_80192CB0 = 0x80192CB0;//segment:ovl_i1 Venom1_80192EA4 = 0x80192EA4;//segment:ovl_i1 @@ -97,16 +97,16 @@ Aquas_801AC8A8 = 0x801AC8A8;//segment:ovl_i3 Aquas_801AD688 = 0x801AD688;//segment:ovl_i3 Aquas_801AE3AC = 0x801AE3AC;//segment:ovl_i3 Aquas_801AF9FC = 0x801AF9FC;//segment:ovl_i3 -Aquas_801AFA5C = 0x801AFA5C;//segment:ovl_i3 +Aquas_Actor257_Update = 0x801AFA5C;//segment:ovl_i3 Aquas_801B0F88 = 0x801B0F88;//segment:ovl_i3 Aquas_801B0FCC = 0x801B0FCC;//segment:ovl_i3 Aquas_801B1008 = 0x801B1008;//segment:ovl_i3 Aquas_BossAq_Init = 0x801B10F8;//segment:ovl_i3 Aquas_Boss_Update = 0x801B134C;//segment:ovl_i3 Aquas_801B6344 = 0x801B6344;//segment:ovl_i3 -Aquas_801B638C = 0x801B638C;//segment:ovl_i3 +Aquas_Actor259_Update = 0x801B638C;//segment:ovl_i3 Aquas_801B6E54 = 0x801B6E54;//segment:ovl_i3 -Aquas_801B6FF8 = 0x801B6FF8;//segment:ovl_i3 +Aquas_Actor262_Update = 0x801B6FF8;//segment:ovl_i3 Aquas_801B7AF0 = 0x801B7AF0;//segment:ovl_i3 Aquas_801BA57C = 0x801BA57C;//segment:ovl_i3 Aquas_801BB26C = 0x801BB26C;//segment:ovl_i3 @@ -157,7 +157,7 @@ D_i3_801C27A0 = 0x801C27A0; //segment:ovl_i3 size:0x20 Katina_UpdateEvents = 0x80198594;//segment:ovl_i4 Katina_BossSetup = 0x80193CA4;//segment:ovl_i4 SectorZ_Missile_Update = 0x80199C60;//segment:ovl_i4 -SectorZ_80199900 = 0x80199900;//segment:ovl_i4 +SectorZ_MissileExplode = 0x80199900;//segment:ovl_i4 D_i4_801A03C0 = 0x801A03C0;//segment:ovl_i4 D_BO_8019EE80 = 0x8019EE80;//segment:ovl_i4 D_BO_801A03DC = 0x801A03DC;//segment:ovl_i4 @@ -213,8 +213,8 @@ D_i5_801B7630 = 0x801B7630;//size:0x24 segment:ovl_i5 Andross_801888F4 = 0x801888F4; //segment:ovl_i6 SectorY_Boss314_Init = 0x80197CC4; //segment:ovl_i6 Andross_Boss320_Init = 0x8018D16C; //segment:ovl_i6 -D_i6_801A68B0 = 0x801A68B0;//size:0x48 type:Vec3f segment:ovl_i6 -D_i6_801A68F8 = 0x801A68F8;//size:0xC type:f32 segment:ovl_i6 +sTeamInitPos = 0x801A68B0;//size:0x48 type:Vec3f segment:ovl_i6 +sTeamInitRot = 0x801A68F8;//size:0xC type:f32 segment:ovl_i6 D_i6_801A7F30 = 0x801A7F30; //segment:ovl_i6 D_Andross_801A7F58 = 0x801A7F58; //segment:ovl_i6 D_Andross_801A7F60 = 0x801A7F60; //segment:ovl_i6 diff --git a/src/audio/audio_general.c b/src/audio/audio_general.c index 8701a594..455dfde4 100644 --- a/src/audio/audio_general.c +++ b/src/audio/audio_general.c @@ -2322,7 +2322,7 @@ void Audio_AnalyzeFrequencies(f32* buffer0, f32* buffer1, s32 length, f32* buffe buff0fromStart++; buff1half1++; - // seconnd half of buffer 1 in reverse order this time + // second half of buffer 1 in reverse order this time buff1half2 = &buffer1[size - 1]; // convert to real amplitudes diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index dfa2b95c..cb52d2ef 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -49,14 +49,15 @@ bool gShowAllRangeCountdown; s32 gAllRangeFrameCount; f32 gAllRangeCountdownScale; -void AllRange_GetStarWolfHits(Actor* actor) { +void AllRange_GetStarWolfHits(Actor* this) { s32 hits = 0; - (void) "time=%d\n"; - (void) "time=%d\n"; - (void) "time=%d\n"; - (void) "time=%d\n"; - (void) "time=%d\n"; + PRINTF("time=%d\n"); + PRINTF("time=%d\n"); + PRINTF("time=%d\n"); + PRINTF("time=%d\n"); + PRINTF("time=%d\n"); + if (gCurrentLevel == LEVEL_VENOM_2) { if (gAllRangeFrameCount < 128 * 30) { hits = 50; @@ -79,7 +80,7 @@ void AllRange_GetStarWolfHits(Actor* actor) { } } if (hits != 0) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, hits); + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, hits); } gHitCount += hits; D_ctx_80177850 = 15; @@ -105,49 +106,51 @@ void AllRange_DrawCountdown(void) { } } -void Boss309_Update(Boss* boss) { - OvlI4_CallFunction(OVLCALL_BOSS309_UPDATE, boss); +void Boss309_Update(Boss309* this) { + OvlI4_CallFunction(OVLCALL_BOSS309_UPDATE, this); } -void Boss309_Draw(Boss* boss) { - OvlI4_CallFunction(OVLCALL_BOSS309_DRAW, boss); +void Boss309_Draw(Boss309* this) { + OvlI4_CallFunction(OVLCALL_BOSS309_DRAW, this); } -void Boss310_Update(Boss* boss) { - OvlI4_CallFunction(OVLCALL_BOSS310_UPDATE, boss); +void Boss310_Update(Boss310* this) { + OvlI4_CallFunction(OVLCALL_BOSS310_UPDATE, this); } -void Boss310_Draw(Boss* boss) { - OvlI4_CallFunction(OVLCALL_BOSS310_DRAW, boss); +void Boss310_Draw(Boss310* this) { + OvlI4_CallFunction(OVLCALL_BOSS310_DRAW, this); } -void Actor271_Update(Actor* actor) { - OvlI4_CallFunction(OVLCALL_ACTOR271_UPDATE, actor); +void Actor271_Update(Actor271* this) { + OvlI4_CallFunction(OVLCALL_ACTOR271_UPDATE, this); } -void Actor271_Draw(Actor* actor) { - OvlI4_CallFunction(OVLCALL_ACTOR271_DRAW, actor); +void Actor271_Draw(Actor271* this) { + OvlI4_CallFunction(OVLCALL_ACTOR271_DRAW, this); } -void Actor272_Update(Actor* actor) { - OvlI4_CallFunction(OVLCALL_ACTOR272_UPDATE, actor); +void Actor272_Update(Actor272* this) { + OvlI4_CallFunction(OVLCALL_ACTOR272_UPDATE, this); } -void Actor272_Draw(Actor* actor) { - OvlI4_CallFunction(OVLCALL_ACTOR272_DRAW, actor); +void Actor272_Draw(Actor272* this) { + OvlI4_CallFunction(OVLCALL_ACTOR272_DRAW, this); } void AllRange_GreatFoxRepair(Player* player) { - Vec3f sp6C; - Vec3f sp60; + Vec3f src; + Vec3f dest; gCsFrameCount++; + switch (player->csState) { case 0: player->hitTimer = player->mercyTimer = player->damage = player->barrelRollAlpha = player->boostMeter = player->boostCooldown = player->somersault = gCsFrameCount = 0; player->zRotBarrelRoll = player->camRoll = player->boostSpeed = player->camDist = player->knockback.x = player->knockback.y = player->knockback.z = player->damageShake = player->aerobaticPitch = 0.0f; + gCsCamEyeX = 1673.0f; gCsCamEyeY = 337.0f; if (player->pos.z < 0.0f) { @@ -155,6 +158,7 @@ void AllRange_GreatFoxRepair(Player* player) { } else { gCsCamEyeZ = 480.0f; } + player->rot.y = 0.0f; player->pos.x = 2100.0f; player->baseSpeed = 30.0f; @@ -169,6 +173,7 @@ void AllRange_GreatFoxRepair(Player* player) { player->wings.modelId = 1; player->csState++; break; + case 1: if (gCsFrameCount >= 47) { gFillScreenAlphaTarget = 255; @@ -180,6 +185,7 @@ void AllRange_GreatFoxRepair(Player* player) { player->baseSpeed = 0.0f; } break; + case 2: if (gFillScreenAlpha == 255) { gFillScreenAlphaTarget = 0; @@ -187,12 +193,15 @@ void AllRange_GreatFoxRepair(Player* player) { player->pos.y = -420.0f; player->pos.z = 0.0f; player->rot.z = 0.0f; + gCsCamEyeX = -683.0f; gCsCamEyeY = -346.0f; gCsCamEyeZ = 305.0f; + player->shields = Play_GetMaxShields(); player->wings.rightState = WINGSTATE_INTACT; player->wings.leftState = WINGSTATE_INTACT; + if (gExpertMode) { gRightWingHealth[0] = gLeftWingHealth[0] = 10; } else { @@ -202,6 +211,7 @@ void AllRange_GreatFoxRepair(Player* player) { player->csState++; } break; + case 3: gFillScreenAlphaStep = 32; gCsCamEyeZ -= 1.0f; @@ -210,10 +220,10 @@ void AllRange_GreatFoxRepair(Player* player) { player->yRot_114 = 90.0f; player->baseSpeed = gArwingSpeed; player->csState++; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, player->sfxSource, 0); } break; + case 4: gCsCamEyeZ -= 1.0f; gCsCamEyeX -= 1.0f; @@ -235,13 +245,13 @@ void AllRange_GreatFoxRepair(Player* player) { Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 3.0f, 0); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); - sp6C.x = 0.0f; - sp6C.y = 0.0f; - sp6C.z = player->baseSpeed; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp60); - player->vel.x = sp60.x; - player->vel.z = sp60.z; - player->vel.y = sp60.y; + src.x = 0.0f; + src.y = 0.0f; + src.z = player->baseSpeed; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + player->vel.x = dest.x; + player->vel.z = dest.z; + player->vel.y = dest.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->pos.z += player->vel.z; @@ -293,16 +303,15 @@ void ActorAllRange_SetShadowData(Actor* this) { Vec3f spA8; f32 spA0[2]; Vec3f sp94 = { 0.0f, -10.0f, 0.0f }; - s32 pad1; - s32 pad2; + s32 pad[2]; this->fwork[25] = this->fwork[26] = this->fwork[28] = this->fwork[27] = 0.0f; if (this->drawShadow && (gLevelMode == LEVELMODE_ALL_RANGE) && (gLevelType == LEVELTYPE_PLANET)) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && ((scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_149) || - (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_1) || - (scenery360->obj.id == OBJ_SCENERY_3)) && + (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_1) || + (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3)) && (fabsf(scenery360->obj.pos.x - this->obj.pos.x) < 2500.0f) && (fabsf(scenery360->obj.pos.z - this->obj.pos.z) < 2500.0f)) { temp1.x = scenery360->obj.pos.x; @@ -322,6 +331,7 @@ void ActorAllRange_SetShadowData(Actor* this) { spC0.z = temp1.z; // fake? weird ordering spCC.y = spD8.y + temp1.y; spCC.z = spD8.z + temp1.z; + if ((scenery360->obj.id == OBJ_SCENERY_149) || (scenery360->obj.id == OBJ_SCENERY_150)) { if (scenery360->obj.id == OBJ_SCENERY_149) { colId = COL1_5; @@ -336,7 +346,7 @@ void ActorAllRange_SetShadowData(Actor* this) { } } else { colId = COL2_0; - if (scenery360->obj.id == OBJ_SCENERY_3) { + if (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3) { colId = COL2_3; } if (func_col2_800A3690(&spCC, &spC0, colId, &spB4)) { @@ -358,22 +368,24 @@ static Vec3f sTeamSpawnPos[4] = { { 300.0f, 900.0f, 7200.0f }, }; static AllRangeAi sTeamAi[4] = { AI360_FOX, AI360_FALCO, AI360_SLIPPY, AI360_PEPPY }; -static s32 sTeamSpawnTargets[4] = { -1, AI360_10, AI360_10 + 1, AI360_10 + 2 }; -static s32 sTeamSpawnTargetsKA[4] = { -1, AI360_10 + 11, AI360_10 + 13, AI360_10 + 15 }; +static s32 sTeamSpawnTargets[4] = { -1, AI360_ENEMY, AI360_ENEMY + 1, AI360_ENEMY + 2 }; +static s32 sTeamSpawnTargetsKA[4] = { -1, AI360_ENEMY + 11, AI360_ENEMY + 13, AI360_ENEMY + 15 }; void ActorAllRange_SpawnTeam(void) { - Actor* actor; + ActorAllRange* actor; s32 i; s32 temp = 4; - for (i = 0, actor = gActors; i < temp; i++, actor++) { + for (i = 0, actor = &gActors[0]; i < temp; i++, actor++) { if ((i > 0) && (gTeamShields[i] <= 0)) { continue; } + Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = OBJ_ACTOR_ALLRANGE; Object_SetInfo(&actor->info, actor->obj.id); + if (i == 0) { actor->aiType = AI360_EVENT_HANDLER; } else { @@ -381,21 +393,28 @@ void ActorAllRange_SpawnTeam(void) { actor->obj.pos.y = sTeamSpawnPos[i].y; actor->obj.pos.z = sTeamSpawnPos[i].z; actor->aiType = sTeamAi[i]; + if (gCurrentLevel == LEVEL_KATINA) { actor->aiIndex = sTeamSpawnTargetsKA[i]; } else { actor->aiIndex = sTeamSpawnTargets[i]; } + actor->state = STATE360_2; actor->rot_0F4.y = 180.0f; + if (actor->aiIndex <= -1) { actor->state = STATE360_3; } + actor->health = 50; + if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { actor->drawShadow = true; } + actor->iwork[11] = 1; + if (actor->aiType <= AI360_PEPPY) { AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); @@ -419,7 +438,7 @@ static f32 sStarWolfVE2SpawnRot[4] = { 330.0f, 90.0f, 280.0f, 70.0f }; s32 gAllRangeSpawnEvent = 96 * 30; void ActorAllRange_SpawnStarWolf(void) { - Actor* actor; + ActorAllRange* actor; s32 i; for (i = 0, actor = &gActors[4]; i < ARRAY_COUNT(sStarWolfSpawnPos); i++, actor++) { @@ -440,11 +459,14 @@ void ActorAllRange_SpawnStarWolf(void) { actor->timer_0BC = 250; actor->rot_0F4.x = -20.0f; actor->iwork[11] = 1; + if (gCurrentLevel == LEVEL_VENOM_2) { actor->obj.rot.z = sStarWolfVE2SpawnRot[i]; actor->itemDrop = DROP_SILVER_STAR; } + Object_SetInfo(&actor->info, actor->obj.id); + if (gCurrentLevel == LEVEL_VENOM_2) { AUDIO_PLAY_SFX(NA_SE_EN_WOLF_ENGINE2, actor->sfxSource, 4); } else { @@ -467,8 +489,8 @@ void ActorAllRange_StarWolfDefeatMesg(u16* msg, RadioCharacterId character) { ActorAllRange_PlayMessage(msg, character); } -void ActorAllRange_UpdateStarWolfEvents(Actor* this) { - Actor* actor; +void ActorAllRange_UpdateStarWolfEvents(ActorAllRange* this) { + ActorAllRange* actor; s32 i; if (sStarWolfKillTimer != 0) { @@ -503,6 +525,7 @@ void ActorAllRange_UpdateStarWolfEvents(Actor* this) { gPlayer[0].cam.at.y = gActors[AI360_WOLF].obj.pos.y; gPlayer[0].cam.at.z = gActors[AI360_WOLF].obj.pos.z; } + if ((gAllRangeEventTimer > gAllRangeSpawnEvent) && (gStarWolfMsgTimer == 0)) { gAllRangeFrameCount++; for (i = AI360_FALCO, actor = &gActors[AI360_FALCO]; i <= AI360_ANDREW; i++, actor++) { @@ -512,10 +535,12 @@ void ActorAllRange_UpdateStarWolfEvents(Actor* this) { gActors[actor->aiIndex].iwork[2] = AI360_FOX; gActors[actor->aiIndex].state = STATE360_2; gActors[actor->aiIndex].aiIndex = actor->aiType; + if (gTeamHelpActor == &gActors[actor->aiIndex]) { gTeamHelpActor = NULL; gTeamHelpTimer = 0; } + if (gActors[actor->aiIndex].iwork[3] == 0) { switch (gActors[actor->aiIndex].aiType) { case AI360_FALCO: @@ -531,6 +556,7 @@ void ActorAllRange_UpdateStarWolfEvents(Actor* this) { gActors[actor->aiIndex].iwork[3] = 200; } } + if (actor->aiType == AI360_WOLF) { if (gCurrentLevel != LEVEL_VENOM_2) { actor->state = STATE360_3; @@ -542,6 +568,7 @@ void ActorAllRange_UpdateStarWolfEvents(Actor* this) { } } } + if (gTeamShields[TEAM_ID_FALCO] <= 0) { gActors[AI360_LEON].aiIndex = AI360_FOX; } @@ -554,47 +581,48 @@ void ActorAllRange_UpdateStarWolfEvents(Actor* this) { } } -void ActorAllRange_ChooseNewTarget(Actor* actor) { - Actor* team; - Actor* enemy; - s32 alreadyTaken; - s32 teamId; - s32 enemyId; +void ActorAllRange_ChooseNewTarget(ActorAllRange* this) { + ActorAllRange* team; + ActorAllRange* enemy; + bool alreadyTaken; + TeamId teamId; + AllRangeAi enemyId; - for (enemyId = AI360_10, enemy = &gActors[AI360_10]; enemyId < ARRAY_COUNT(gActors); enemyId++, enemy++) { + for (enemyId = AI360_ENEMY, enemy = &gActors[AI360_ENEMY]; enemyId < ARRAY_COUNT(gActors); enemyId++, enemy++) { if ((enemy->obj.status == OBJ_ACTIVE) && (enemy->obj.id == OBJ_ACTOR_ALLRANGE) && (enemy->animFrame == 0) && (enemy->aiIndex <= -1)) { alreadyTaken = false; for (teamId = AI360_FALCO, team = &gActors[AI360_FALCO]; teamId <= AI360_PEPPY; teamId++, team++) { - if ((teamId != actor->index) && (enemyId == team->aiIndex)) { + if ((teamId != this->index) && (enemyId == team->aiIndex)) { alreadyTaken = true; } } if (!alreadyTaken) { - actor->aiIndex = enemyId; - actor->state = STATE360_2; - actor->iwork[2] = AI360_FOX; + this->aiIndex = enemyId; + this->state = STATE360_2; + this->iwork[2] = AI360_FOX; break; } } } } -void ActorAllRange_UpdateEvemyEvents(Actor* this) { - Actor* enemy; +void ActorAllRange_UpdateEnemyEvents(Actor* this) { + ActorAllRange* enemy; s32 i; - for (i = 0, enemy = &gActors[AI360_10]; i < 50; i++, enemy++) { + for (i = 0, enemy = &gActors[AI360_ENEMY]; i < 50; i++, enemy++) { if ((enemy->obj.status == OBJ_DYING) && (enemy->aiIndex >= AI360_FALCO) && (enemy->aiIndex <= AI360_PEPPY)) { - Actor* enemy2; + ActorAllRange* enemy2; s32 j; - for (j = 0, enemy2 = &gActors[AI360_10]; j <= 50; j++, enemy2++) { // bug? should be < + for (j = 0, enemy2 = &gActors[AI360_ENEMY]; j <= 50; j++, enemy2++) { // bug? should be < if ((enemy2->obj.status == OBJ_ACTIVE) && (enemy2->state == STATE360_2) && (enemy2->aiIndex == enemy->aiIndex)) { return; } } + if (gTeamShields[enemy->aiIndex] > 0) { ActorAllRange_ChooseNewTarget(&gActors[enemy->aiIndex]); if ((enemy->iwork[5] != 0) && (enemy->dmgSource == AI360_FOX + 1) && @@ -635,7 +663,7 @@ bool AllRange_SupplyEvent(void) { } void ActorAllRange_SpawnSupplies(Actor* this) { - Actor* supplies; + ActorSupplies* supplies; s32 i; if ((gCallTimer != 0) && (gControllerPress[gMainController].button & R_CBUTTONS)) { @@ -645,6 +673,7 @@ void ActorAllRange_SpawnSupplies(Actor* this) { Radio_PlayMessage(gMsg_ID_20230, RCID_ROB64); gAllRangeSupplyTimer = 160; } + if (gAllRangeSupplyTimer != 0) { gAllRangeSupplyTimer--; if (gAllRangeSupplyTimer == 0) { @@ -671,6 +700,7 @@ void ActorAllRange_SpawnSupplies(Actor* this) { } } } + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !gAllRangeSuppliesSent) { if (gAllRangeWingRepairTimer != 0) { gAllRangeWingRepairTimer--; @@ -687,7 +717,9 @@ void ActorAllRange_UpdateEvents(Actor* this) { Object_Kill(&this->obj, this->sfxSource); return; } + gAllRangeEventTimer++; + switch (gCurrentLevel) { case LEVEL_FORTUNA: Fortuna_UpdateEvents(this); @@ -719,10 +751,13 @@ s32 func_360_800301F4(Actor* this) { if (gLevelMode == LEVELMODE_ON_RAILS) { return 0; } + sinY = SIN_DEG(this->obj.rot.y); cosY = COS_DEG(this->obj.rot.y); + temp_ft4 = this->fwork[9] * 10.0f + (sinY * 650.0f); temp_ft5 = this->fwork[9] * 10.0f + (cosY * 650.0f); + for (i = 0; i < 200; i++) { if ((gScenery360[i].obj.status == OBJ_ACTIVE) && (fabsf(gScenery360[i].obj.pos.x - (this->obj.pos.x + temp_ft4)) < 1000.0f) && @@ -736,6 +771,7 @@ s32 func_360_800301F4(Actor* this) { } } } + boss = &gBosses[0]; if ((gCurrentLevel == LEVEL_SECTOR_Z) && (fabsf(boss->obj.pos.x - (this->obj.pos.x + temp_ft4)) < 2000.0f) && (fabsf(boss->obj.pos.z - (this->obj.pos.z + temp_ft5)) < 2000.0f)) { @@ -750,7 +786,7 @@ s32 func_360_800301F4(Actor* this) { return 0; } -s32 func_360_8003049C(Actor* this) { +s32 func_360_8003049C(ActorAllRange* this) { Scenery360* scenery360; s32 i; f32 sp44; @@ -765,13 +801,17 @@ s32 func_360_8003049C(Actor* this) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { return 0; } + if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { return func_360_800301F4(this); } + sp40 = SIN_DEG(this->obj.rot.y); sp3C = COS_DEG(this->obj.rot.y); + temp_fa0 = this->fwork[9] * 10.0f + (sp40 * 650.0f); temp_ft4 = this->fwork[9] * 10.0f + (sp3C * 650.0f); + if (gLevelMode == LEVELMODE_ALL_RANGE) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && @@ -781,13 +821,15 @@ s32 func_360_8003049C(Actor* this) { } } } + sp44 = 1200.0f; var_ft5 = 650.0f; + if (this->aiType < AI360_KATT) { var_ft5 = 720.0f; } - if (boss->obj.id == OBJ_BOSS_293) { + if (boss->obj.id == OBJ_BOSS_CO_CARRIER) { var_ft5 = 350.0f; } else if (boss->obj.id == OBJ_BOSS_309) { sp44 = 2000.0f; @@ -796,43 +838,50 @@ s32 func_360_8003049C(Actor* this) { sp44 = 1500.0f; var_ft5 = 700.0f; } + if ((fabsf(boss->obj.pos.x - (this->obj.pos.x + temp_fa0)) < sp44) && (fabsf(boss->obj.pos.z - (this->obj.pos.z + temp_ft4)) < sp44) && (fabsf(boss->obj.pos.y - this->obj.pos.y) < var_ft5)) { return 1; + } else { + return 0; } - return 0; } -void ActorAllRange_ApplyDamage(Actor* this) { - s32 var_a1; - Vec3f sp48; - Vec3f sp3C; +void ActorAllRange_ApplyDamage(ActorAllRange* this) { + bool var_a1; + Vec3f src; + Vec3f dest; if (this->dmgType != DMG_NONE) { if (this->aiType == AI360_GREAT_FOX) { this->dmgType = DMG_NONE; } + if ((this->dmgType >= DMG_EXPLOSION) && (this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { this->damage = 10; this->timer_0C2 = 10; } + if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) && (this->dmgType == DMG_EXPLOSION)) { this->dmgType = DMG_NONE; } + if ((this->dmgType == DMG_EXPLOSION) && (this->fwork[22] > 0.0f)) { this->dmgType = DMG_NONE; } + if (this->fwork[23] > 1.0f) { this->dmgType = DMG_NONE; } + if (this->dmgType != DMG_NONE) { var_a1 = false; if ((this->animFrame == 3) || ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && (this->aiType >= AI360_WOLF)) || - ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && + ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_ENEMY) && (this->dmgType == DMG_EXPLOSION))) { this->damage = DMG_NONE; var_a1 = true; @@ -840,6 +889,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->dmgSource = 0; } } + if (this->aiType >= AI360_WOLF) { if (!((this->dmgType == DMG_COLLISION) && (this->aiType == AI360_WOLF)) && !((this->aiType == AI360_MISSILE) && (this->dmgType == DMG_EXPLOSION))) { @@ -852,10 +902,11 @@ void ActorAllRange_ApplyDamage(Actor* this) { gTeamDamage[this->aiType] = this->damage * 2; } } + if (this->health <= 0) { this->health = 0; if (this->aiType == AI360_MISSILE) { - SectorZ_80199900(this, 1); + SectorZ_MissileExplode(this, true); if (this->dmgSource == AI360_FOX + 1) { if (gActors[AI360_KATT].obj.status == OBJ_ACTIVE) { Radio_PlayMessage(gMsg_ID_16140, RCID_KATT); @@ -881,15 +932,19 @@ void ActorAllRange_ApplyDamage(Actor* this) { } return; } + this->timer_0C6 = 50; this->iwork[8] = 20; this->obj.status = OBJ_DYING; this->fwork[23] = 0.0f; + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 4.0f); AUDIO_PLAY_SFX(NA_SE_EN_CRASH_DOWN, this->sfxSource, 4); + this->timer_0C2 = 10; this->timer_0BE = 0; this->timer_04C = RAND_INT(2.9f); + switch (RAND_INT(4.0f)) { case 0: this->timer_0BC = 0; @@ -904,9 +959,11 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->timer_0BC = 300; break; } + if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { this->timer_0BC = 70; } + if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { if (Rand_ZeroOne() < 0.5f) { this->timer_0BC = 10; @@ -914,18 +971,22 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->timer_0BC = RAND_INT(50.0f); } } + if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { this->timer_0BC = RAND_INT(40.0f) + 60.0f; } + if (this->damage >= 20) { this->timer_0BC = 0; } + if ((gCurrentLevel == LEVEL_KATINA) && (this->animFrame == 1) && (this->dmgSource == AI360_FOX + 1)) { if (gKaAllyKillCount < 2) { ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL); } gKaAllyKillCount++; } + switch (this->aiType) { case AI360_WOLF: gStarWolfTeamAlive[0] = 0; @@ -935,6 +996,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9365, RCID_WOLF); } break; + case AI360_LEON: gStarWolfTeamAlive[1] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { @@ -943,6 +1005,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9366, RCID_LEON); } break; + case AI360_PIGMA: gStarWolfTeamAlive[2] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { @@ -951,6 +1014,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9367, RCID_PIGMA); } break; + case AI360_ANDREW: gStarWolfTeamAlive[3] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { @@ -960,12 +1024,14 @@ void ActorAllRange_ApplyDamage(Actor* this) { } break; } + if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { sStarWolfKillTimer = 150; } + switch (this->dmgSource) { case AI360_FOX + 1: - if (this->aiType >= AI360_10) { + if (this->aiType >= AI360_ENEMY) { switch (this->iwork[2]) { case AI360_FALCO: ActorAllRange_PlayMessage(gMsg_ID_20170, RCID_FALCO); @@ -979,6 +1045,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } break; + case AI360_FALCO + NPC_SHOT_ID + 1: case AI360_SLIPPY + NPC_SHOT_ID + 1: case AI360_PEPPY + NPC_SHOT_ID + 1: @@ -1021,33 +1088,37 @@ void ActorAllRange_ApplyDamage(Actor* this) { this->timer_0C6 = 20; this->iwork[8] = 20; } + if (this->aiType == AI360_MISSILE) { AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); } else if (this->iwork[7] == 0) { AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); } + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); + if (this->aiType < AI360_GREAT_FOX) { Matrix_RotateY(gCalcMatrix, this->rot_0F4.y * M_DTOR, MTXF_NEW); - sp48.x = 30.0f; + src.x = 30.0f; if (Rand_ZeroOne() < 0.5f) { - sp48.x = -30.0f; + src.x = -30.0f; } - sp48.y = RAND_FLOAT_CENTERED(30.0f); - sp48.z = 0.0f; + src.y = RAND_FLOAT_CENTERED(30.0f); + src.z = 0.0f; if (this->iwork[7] != 0) { - sp48.x *= 1.5f; - sp48.y = 30.0f; + src.x *= 1.5f; + src.y = 30.0f; if ((this->obj.pos.y > 100.0f) && (Rand_ZeroOne() < 0.5f)) { - sp48.y = -30.0f; + src.y = -30.0f; } } - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp48, &sp3C); - this->fwork[13] = sp3C.x; - this->fwork[14] = sp3C.y; - this->fwork[12] = sp3C.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + this->fwork[13] = dest.x; + this->fwork[14] = dest.y; + this->fwork[12] = dest.z; } + if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { if (this->dmgType == DMG_COLLISION) { switch (this->aiType) { @@ -1118,6 +1189,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { gTeamHelpTimer = 320; } break; + case AI360_SLIPPY: if (gTeamShields[TEAM_ID_SLIPPY] >= 90) { ActorAllRange_PlayMessage(gMsg_ID_9140, RCID_SLIPPY); @@ -1129,12 +1201,14 @@ void ActorAllRange_ApplyDamage(Actor* this) { gTeamHelpTimer = 320; } break; + case AI360_PEPPY: if (gTeamShields[TEAM_ID_PEPPY] >= 90) { ActorAllRange_PlayMessage(gMsg_ID_9150, RCID_PEPPY); } else { Radio_PlayMessage(gMsg_ID_9153, RCID_PEPPY); } + if ((gTeamHelpActor == NULL) || (gTeamShields[this->aiType] <= 50)) { gTeamHelpActor = this; gTeamHelpTimer = 320; @@ -1149,27 +1223,30 @@ void ActorAllRange_ApplyDamage(Actor* this) { } } -void ActorAllRange_CheckPlayerNearby(Actor* actor) { - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (actor->iwork[24] != 0) && - (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && - (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 1000.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { - actor->iwork[10]++; +void ActorAllRange_CheckPlayerNearby(ActorAllRange* this) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->iwork[24] != 0) && + (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && + (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 1000.0f) && + (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { + this->iwork[10]++; } else { - actor->iwork[10] = 0; + this->iwork[10] = 0; } } -bool func_360_80031900(Actor* actor) { - Vec3f sp24; - Vec3f sp18; +bool func_360_80031900(ActorAllRange* this) { + Vec3f src; + Vec3f dest; - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_NEW); - sp24.x = actor->fwork[4] - actor->obj.pos.x; - sp24.y = 0.0f; - sp24.z = actor->fwork[6] - actor->obj.pos.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp24, &sp18); - if (sp18.z > 0.0f) { + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_NEW); + + src.x = this->fwork[4] - this->obj.pos.x; + src.y = 0.0f; + src.z = this->fwork[6] - this->obj.pos.z; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + + if (dest.z > 0.0f) { return true; } else { return false; @@ -1181,7 +1258,7 @@ static Vec3f sSectorZRetreatPath[6] = { { -500.0f, 250.0f, 0.0f }, { 0.0f, 250.0f, 0.0f }, { 0.0f, 250.0f, 0.0f }, }; -void ActorAllRange_Update(Actor* this) { +void ActorAllRange_Update(ActorAllRange* this) { u8 sp10F; s32 sp108; s32 sp104; @@ -1210,9 +1287,7 @@ void ActorAllRange_Update(Actor* this) { Vec3f sp90; Vec3f sp84 = { 60.0f, 0.0f, -170.0f }; Vec3f sp78 = { -60.0f, 0.0f, -170.0f }; - s32 pad1; - s32 pad2; - s32 pad3; + s32 pad[3]; if (this->aiType == AI360_EVENT_HANDLER) { this->timer_0C2 = 10; @@ -1220,6 +1295,7 @@ void ActorAllRange_Update(Actor* this) { ActorAllRange_UpdateEvents(this); return; } + if ((this->iwork[17] != 0) && (this->iwork[16] == STATE360_0) && (this->aiType >= AI360_WOLF)) { switch (RAND_INT(3.9f)) { case 0: @@ -1228,23 +1304,28 @@ void ActorAllRange_Update(Actor* this) { this->iwork[16] = STATE360_10; } break; + case 2: this->iwork[16] = STATE360_8; break; + case 3: this->iwork[16] = STATE360_7; break; } + this->iwork[17] = 0; if (this->iwork[18] != 0) { this->iwork[18]--; this->iwork[16] = STATE360_0; } } - if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < AI360_10) && + + if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < AI360_ENEMY) && (this->lockOnTimers[TEAM_ID_FOX] < 5) && ((gGameFrameCount % 32) == 0)) { this->iwork[16] = STATE360_10; } + if ((this->iwork[16] != STATE360_0) && (this->state < STATE360_7)) { this->state = this->iwork[16]; switch (this->state) { @@ -1255,6 +1336,7 @@ void ActorAllRange_Update(Actor* this) { } this->unk_046 = 0; break; + case STATE360_9: this->timer_0BC = RAND_INT(20.0f) + 30; if (Rand_ZeroOne() < 0.5f) { @@ -1269,6 +1351,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[19] += 360.0f; } break; + case STATE360_10: this->timer_0BC = 35; if (Rand_ZeroOne() < 0.5f) { @@ -1284,23 +1367,29 @@ void ActorAllRange_Update(Actor* this) { break; } } + this->iwork[16] = STATE360_0; spCC = spC8 = spC4 = 0.0f; + if (this->iwork[7] != 0) { this->iwork[7]--; this->fwork[22] = 1.0f; } + if (this->iwork[3] != 0) { this->iwork[3]--; } + Math_SmoothStepToF(&this->fwork[10], 0.0f, 0.1f, 0.2f, 0.00001f); Math_SmoothStepToF(&this->fwork[9], this->fwork[10], 0.1f, 2.0f, 0.00001f); + if (this->fwork[10] > 0.1f) { this->iwork[11] = 2; } else { this->iwork[11] = 1; } - if (this->aiType < AI360_10) { + + if (this->aiType < AI360_ENEMY) { ActorAllRange_CheckPlayerNearby(this); if (this->iwork[10] == 200) { switch (this->aiType) { @@ -1310,6 +1399,7 @@ void ActorAllRange_Update(Actor* this) { case AI360_ANDREW: case AI360_KATT: break; + case AI360_FALCO: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20298, RCID_FALCO); @@ -1319,6 +1409,7 @@ void ActorAllRange_Update(Actor* this) { Radio_PlayMessage(gMsg_ID_20301, RCID_FALCO); } break; + case AI360_SLIPPY: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20297, RCID_SLIPPY); @@ -1328,6 +1419,7 @@ void ActorAllRange_Update(Actor* this) { Radio_PlayMessage(gMsg_ID_20300, RCID_SLIPPY); } break; + case AI360_PEPPY: if (gPlayer[0].shields < (Play_GetMaxShields() / 2)) { Radio_PlayMessage(gMsg_ID_20296, RCID_PEPPY); @@ -1337,14 +1429,17 @@ void ActorAllRange_Update(Actor* this) { Radio_PlayMessage(gMsg_ID_20299, RCID_PEPPY); } break; + case AI360_BILL: Radio_PlayMessage(gMsg_ID_18120, RCID_BILL); break; } } } + sp104 = 0; this->iwork[5] = 0; + if ((this->aiType >= AI360_FALCO) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) && (this->state != STATE360_6)) { this->state = STATE360_6; @@ -1372,6 +1467,7 @@ void ActorAllRange_Update(Actor* this) { this->iwork[1] = 0; this->timer_0C2 = 10000; } + switch (this->state) { case STATE360_6: this->timer_0C2 = 10000; @@ -1399,17 +1495,21 @@ void ActorAllRange_Update(Actor* this) { } sp104 = 2; break; + case STATE360_5: SectorZ_Missile_Update(this); sp104 = 1; break; + case STATE360_0: if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { this->fwork[0] = this->fwork[1] = 40.0f; + if (gActors[0].state == STATE360_5) { Math_SmoothStepToF(&this->rot_0F4.x, 30.0f, 0.1f, 0.5f, 0.0f); this->fwork[1] = 200.0f; } + if (this->timer_0BC == 0) { if (this->aiType == AI360_WOLF) { this->state = STATE360_3; @@ -1429,11 +1529,14 @@ void ActorAllRange_Update(Actor* this) { Math_SmoothStepToAngle(&this->obj.rot.z, 0.0f, 0.03f, 0.5f, 0.0f); } break; + case STATE360_1: this->fwork[1] = 40.0f; + if ((this->timer_0BC < 35) && (gCurrentLevel == LEVEL_FORTUNA)) { Math_SmoothStepToF(&this->rot_0F4.x, 15.0f, 0.1f, 1.0f, 0.0f); } + if (this->timer_0BC == 0) { this->state = STATE360_3; if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex > -1)) { @@ -1441,6 +1544,7 @@ void ActorAllRange_Update(Actor* this) { } } break; + case STATE360_2: sp104 = 1; spF8 = 800.0f; @@ -1449,14 +1553,17 @@ void ActorAllRange_Update(Actor* this) { spEC = fabsf(this->fwork[4] - this->obj.pos.x); spE8 = fabsf(this->fwork[6] - this->obj.pos.z); sp10F = 0xB; + if (this->aiType == AI360_FALCO) { spF0 = 0.5f; } else if ((this->animFrame != 2) && (this->animFrame == 3)) { spF0 = 0.5f; } + if (this->aiIndex == AI360_FOX) { spF0 = 0.2f; } + if (this->aiIndex <= -1) { this->state = STATE360_3; } else { @@ -1465,6 +1572,7 @@ void ActorAllRange_Update(Actor* this) { spF4 = spF8 = 3000.0f; this->fwork[3] = 2.0f; } + if (this->aiIndex == AI360_FOX) { if (gCurrentLevel != LEVEL_VENOM_2) { if ((gPlayer[0].somersault && (this->iwork[4] > 10)) || @@ -1481,18 +1589,21 @@ void ActorAllRange_Update(Actor* this) { break; } } + if ((this->aiType >= AI360_WOLF) && (this->aiType != AI360_KATT) && !((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType == AI360_WOLF))) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 100.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; } + if (!gPlayer[0].somersault) { this->fwork[4] = gPlayer[0].pos.x + spCC; this->fwork[5] = gPlayer[0].pos.y + spC8; this->fwork[6] = gPlayer[0].trueZpos + spC4; this->fwork[1] = gPlayer[0].baseSpeed + 10.0f; } + if ((gActors[0].state == STATE360_6) && (this->aiType <= AI360_PEPPY)) { this->fwork[3] = 3.0f; this->fwork[1] = gPlayer[0].baseSpeed - 5.0f; @@ -1503,8 +1614,10 @@ void ActorAllRange_Update(Actor* this) { } else { this->fwork[3] = 1.2f; } + spF4 = 2000.0f; spF8 = 700.0f; + if (gCurrentLevel == LEVEL_VENOM_2) { spF0 = 0.5f; sp10F = 3; @@ -1512,18 +1625,20 @@ void ActorAllRange_Update(Actor* this) { spF0 = 0.7f; } } else if (this->aiIndex != AI360_GREAT_FOX) { - if (this->aiType >= AI360_10) { + if (this->aiType >= AI360_ENEMY) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 200.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; } + this->fwork[4] = gActors[this->aiIndex].obj.pos.x + spCC; this->fwork[5] = gActors[this->aiIndex].obj.pos.y + spC8; this->fwork[6] = gActors[this->aiIndex].obj.pos.z + spC4; + if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { this->fwork[1] = 55.0f; this->fwork[3] = 1.6f; - } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType > AI360_10)) { + } else if ((gCurrentLevel == LEVEL_FORTUNA) && (this->aiType > AI360_ENEMY)) { this->fwork[3] = 1.4f; this->fwork[1] = 50.0f; } else { @@ -1539,6 +1654,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[6] = gBosses[0].obj.pos.z; this->fwork[1] = 40.0f; } + if ((this->aiIndex > -1) && (this->aiIndex != AI360_GREAT_FOX) && (gActors[0].state != STATE360_6)) { if (spE8 < spF8) { if (spEC < spF8) { @@ -1557,6 +1673,7 @@ void ActorAllRange_Update(Actor* this) { this->timer_0C0 = RAND_INT(200.0f) + 200; this->fwork[10] = 20.0f; } + if ((spE8 < spF4) && (spEC < spF4)) { this->iwork[4]++; this->iwork[5] = 1; @@ -1590,6 +1707,7 @@ void ActorAllRange_Update(Actor* this) { this->iwork[0] = 1; } } + if ((gRadioState == 0) && (this->timer_0C4 == 0) && (gAllRangeEventTimer > 700) && (gStarWolfMsgTimer == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { this->timer_0C4 = 600; @@ -1610,6 +1728,7 @@ void ActorAllRange_Update(Actor* this) { gTeamHelpTimer = 320; } break; + case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { ActorAllRange_PlayMessage(gMsg_ID_19463, RCID_SLIPPY); @@ -1624,6 +1743,7 @@ void ActorAllRange_Update(Actor* this) { gTeamHelpTimer = 320; } break; + case AI360_PEPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { ActorAllRange_PlayMessage(gMsg_ID_19464, RCID_PEPPY); @@ -1638,21 +1758,25 @@ void ActorAllRange_Update(Actor* this) { gTeamHelpTimer = 320; } break; + case AI360_WOLF: if (gStarWolfTeamAlive[0] != 0) { ActorAllRange_PlayMessage(gMsg_ID_9330, RCID_WOLF); } break; + case AI360_LEON: if (gStarWolfTeamAlive[1] != 0) { ActorAllRange_PlayMessage(gMsg_ID_9340, RCID_LEON); } break; + case AI360_PIGMA: if (gStarWolfTeamAlive[2] != 0) { ActorAllRange_PlayMessage(gMsg_ID_9350, RCID_PIGMA); } break; + case AI360_ANDREW: if (gStarWolfTeamAlive[3] != 0) { ActorAllRange_PlayMessage(gMsg_ID_9360, RCID_ANDREW); @@ -1669,6 +1793,7 @@ void ActorAllRange_Update(Actor* this) { } gActors[this->aiIndex].iwork[2] = AI360_FALCO; break; + case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { ActorAllRange_PlayMessage(gMsg_ID_9212, RCID_SLIPPY); @@ -1677,6 +1802,7 @@ void ActorAllRange_Update(Actor* this) { } gActors[this->aiIndex].iwork[2] = AI360_SLIPPY; break; + case AI360_PEPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { ActorAllRange_PlayMessage(gMsg_ID_9213, RCID_PEPPY); @@ -1685,6 +1811,7 @@ void ActorAllRange_Update(Actor* this) { } gActors[this->aiIndex].iwork[2] = AI360_PEPPY; break; + case AI360_WOLF: if (gCurrentLevel != LEVEL_VENOM_2) { if (this->iwork[6] == 0) { @@ -1702,6 +1829,7 @@ void ActorAllRange_Update(Actor* this) { } } break; + case AI360_LEON: if (gCurrentLevel == LEVEL_VENOM_2) { if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { @@ -1715,6 +1843,7 @@ void ActorAllRange_Update(Actor* this) { ActorAllRange_PlayMessage(gMsg_ID_9300, RCID_LEON); } break; + case AI360_PIGMA: if (gCurrentLevel == LEVEL_VENOM_2) { if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { @@ -1728,6 +1857,7 @@ void ActorAllRange_Update(Actor* this) { ActorAllRange_PlayMessage(gMsg_ID_9310, RCID_PIGMA); } break; + case AI360_ANDREW: if (gCurrentLevel == LEVEL_VENOM_2) { if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { @@ -1747,6 +1877,7 @@ void ActorAllRange_Update(Actor* this) { } else { this->iwork[4] = 0; } + if ((this->aiIndex >= AI360_FALCO) && ((gActors[this->aiIndex].obj.status == OBJ_DYING) || (gActors[this->aiIndex].state == STATE360_6) || (gActors[this->aiIndex].obj.status == OBJ_FREE))) { @@ -1758,10 +1889,11 @@ void ActorAllRange_Update(Actor* this) { } } break; + case STATE360_3: sp104 = 1; if (this->timer_0BC == 0) { - if ((this->aiType < AI360_10) || (gCurrentLevel == LEVEL_BOLSE)) { + if ((this->aiType < AI360_ENEMY) || (gCurrentLevel == LEVEL_BOLSE)) { if (gCurrentLevel == LEVEL_VENOM_2) { if (this->aiType >= AI360_WOLF) { this->fwork[3] = 1.6f; @@ -1778,9 +1910,11 @@ void ActorAllRange_Update(Actor* this) { this->fwork[3] = 1.0f; this->fwork[1] = 38.0f; } + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == STATE360_10)) { this->fwork[10] = 30.0f; } + if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { if ((gCurrentLevel == LEVEL_SECTOR_Z) && (this->aiType == AI360_KATT)) { spE4 = RAND_FLOAT_CENTERED(0.0f); @@ -1805,6 +1939,7 @@ void ActorAllRange_Update(Actor* this) { spDC = RAND_FLOAT_CENTERED(5000.0f); } } + if ((fabsf(this->obj.pos.x - spE4) > 2000.0f) || (fabsf(this->obj.pos.z - spDC) > 2000.0f)) { this->fwork[4] = spE4; this->fwork[5] = spE0; @@ -1812,15 +1947,18 @@ void ActorAllRange_Update(Actor* this) { this->timer_0BC = RAND_INT(20.0f) + 10; } } + if (this->timer_0C0 == 0) { this->timer_0C0 = RAND_INT(200.0f) + 200; this->fwork[10] = 30.0f; } + if ((this->aiIndex >= AI360_FALCO) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_ALLRANGE) && (gActors[this->aiIndex].timer_0C2 == 0) && (gActors[this->aiIndex].obj.status == OBJ_ACTIVE)) { this->state = STATE360_2; this->iwork[2] = AI360_FOX; } + if (this->aiIndex == AI360_FOX) { if (this->counter_04E != 0) { this->counter_04E--; @@ -1831,6 +1969,7 @@ void ActorAllRange_Update(Actor* this) { } } break; + case STATE360_7: this->fwork[1] = 40.0f; Math_SmoothStepToF(&this->rot_0F4.x, 360.0f, 0.1f, 5.0f, 0.0001f); @@ -1839,6 +1978,7 @@ void ActorAllRange_Update(Actor* this) { this->state = STATE360_3; } break; + case STATE360_8: this->fwork[1] = 40.0f; if ((this->index % 2) != 0) { @@ -1846,6 +1986,7 @@ void ActorAllRange_Update(Actor* this) { } else { Math_SmoothStepToAngle(&this->obj.rot.z, 5.0f, 0.1f, 3.0f, 0.01f); } + switch (this->unk_046) { case 0: Math_SmoothStepToF(&this->rot_0F4.x, 200.0f, 0.1f, 6.0f, 0.0001f); @@ -1871,6 +2012,7 @@ void ActorAllRange_Update(Actor* this) { break; } break; + case STATE360_9: this->fwork[1] = 40.0f; if (Math_SmoothStepToAngle(&this->rot_0F4.y, this->fwork[19], 0.5f, 5.0f, 0.0f) < 0.0f) { @@ -1883,6 +2025,7 @@ void ActorAllRange_Update(Actor* this) { this->state = STATE360_3; } break; + case STATE360_10: sp104 = 1; if (this->timer_0BC == 0) { @@ -1893,6 +2036,7 @@ void ActorAllRange_Update(Actor* this) { } break; } + if (sp104 != 0) { s32 var_v0 = 4 - 1; @@ -1903,17 +2047,20 @@ void ActorAllRange_Update(Actor* this) { if (gCurrentLevel == LEVEL_VENOM_2) { var_v0 = 2 - 1; } + if (((this->index + gGameFrameCount) & var_v0) == 0) { this->fwork[19] = Math_RadToDeg(Math_Atan2F(spE4, spDC)); this->fwork[20] = Math_RadToDeg(Math_Atan2F(spE0, sqrtf(SQ(spE4) + SQ(spDC)))); } + spD8 = this->fwork[20]; spD4 = this->fwork[19]; sp108 = 0; + if (sp104 == 1) { if (this->aiType < AI360_GREAT_FOX) { sp108 = func_360_8003049C(this); - if ((sp108 != 0) && (this->aiType < AI360_10) && (this->timer_0BE == 0) && + if ((sp108 != 0) && (this->aiType < AI360_ENEMY) && (this->timer_0BE == 0) && ((this->fwork[7] < 0.01f) || (this->fwork[7] > 359.9f))) { this->timer_0BE = RAND_INT(200.0f) + 200; if (Rand_ZeroOne() < 0.5f) { @@ -1925,8 +2072,9 @@ void ActorAllRange_Update(Actor* this) { } } } + if (sp108 != 0) { - if ((this->aiType < AI360_10) || (gCurrentLevel != LEVEL_FORTUNA)) { + if ((this->aiType < AI360_ENEMY) || (gCurrentLevel != LEVEL_FORTUNA)) { spD8 += 40.0f * sp108; } else { spD8 += 20.0f * sp108; @@ -1942,13 +2090,16 @@ void ActorAllRange_Update(Actor* this) { this->rot_0F4.x = 0.0f; } } + Math_SmoothStepToAngle(&this->rot_0F4.x, spD8, 0.5f, this->fwork[2], 0.0001f); + spD0 = Math_SmoothStepToAngle(&this->rot_0F4.y, spD4, 0.5f, this->fwork[2], 0.0001f) * 30.0f; if (spD0 < 0.0f) { spD0 = spD0 * -1.0f; } else { spD0 = 360.0f - spD0; } + if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) { if ((((gGameFrameCount + 15) % 32) == 0) && (gCurrentLevel != LEVEL_VENOM_2)) { this->lockOnTimers[TEAM_ID_FOX] = 0; @@ -1958,11 +2109,13 @@ void ActorAllRange_Update(Actor* this) { this->iwork[19] = 0; } } + if (this->iwork[19] != 0) { Math_SmoothStepToF(&this->fwork[7], this->fwork[8], 1.0f, 60.0f, 0.01f); } else { Math_SmoothStepToF(&this->fwork[7], this->fwork[8], 0.2f, 30.0f, 0.01f); } + if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) { Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[7], 0.2f, 100.0f, 0.01f); if ((this->aiType == AI360_KATT) && ((gGameFrameCount % 2) == 0)) { @@ -1981,8 +2134,10 @@ void ActorAllRange_Update(Actor* this) { } this->obj.rot.x = -this->rot_0F4.x; this->obj.rot.y = this->rot_0F4.y; + Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.2f, 1.0f, 0.1f); Math_SmoothStepToF(&this->fwork[2], this->fwork[3], 1.0f, 0.1f, 0.1f); + spC0 = SIN_DEG(this->obj.rot.x); spB8 = COS_DEG(this->obj.rot.x); spBC = SIN_DEG(this->obj.rot.y); @@ -1996,13 +2151,16 @@ void ActorAllRange_Update(Actor* this) { this->vel.x = this->fwork[13] + sp9C.x; this->vel.y = this->fwork[14] + sp9C.y; this->vel.z = this->fwork[12] + sp9C.z; + this->fwork[13] -= (this->fwork[13] * 0.1f); this->fwork[14] -= (this->fwork[14] * 0.1f); this->fwork[12] -= (this->fwork[12] * 0.1f); + if ((this->obj.pos.y < gGroundHeight + 40.0f) && (this->vel.y < 0.0f)) { this->obj.pos.y = gGroundHeight + 40.0f; this->vel.y = 0.0f; } + if (this->iwork[0] != 0) { this->iwork[0] = 0; @@ -2039,9 +2197,12 @@ void ActorAllRange_Update(Actor* this) { this->obj.rot.y, this->obj.rot.z); } } + ActorAllRange_ApplyDamage(this); + radarMark = &gRadarMarks[this->index]; radarMark->status = 1; + if (this->aiType == AI360_MISSILE) { radarMark->type = 100; } else { @@ -2050,10 +2211,12 @@ void ActorAllRange_Update(Actor* this) { if (gCurrentLevel == LEVEL_TRAINING) { radarMark->type = 4; } + radarMark->pos.x = this->obj.pos.x; radarMark->pos.y = this->obj.pos.y; radarMark->pos.z = this->obj.pos.z; radarMark->yRot = this->rot_0F4.y + 180.0f; + if (this->iwork[1] != 0) { this->iwork[1]--; if ((this->iwork[1] == 0) && (gActors[0].state == STATE360_2) && (gRadioState == 0)) { @@ -2074,28 +2237,31 @@ void ActorAllRange_Update(Actor* this) { } } } + if ((gCurrentLevel != LEVEL_KATINA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && (this->timer_0C2 == 0)) { - if (((this->aiType >= AI360_10) && (this->aiType < AI360_GREAT_FOX)) || - ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && (this->timer_0C6 != 0))) { + if (((this->aiType >= AI360_ENEMY) && (this->aiType < AI360_GREAT_FOX)) || + ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_ENEMY) && (this->timer_0C6 != 0))) { s32 var_a3 = 0; if (((gCurrentLevel == LEVEL_BOLSE) || (gCurrentLevel == LEVEL_SECTOR_Z)) && (this->timer_0C6 == 0)) { var_a3 = 3; } + sp90.x = this->vel.x; sp90.y = this->vel.y; sp90.z = this->vel.z; + temp_v0_27 = Object_CheckCollision(this->index, &this->obj.pos, &sp90, var_a3); if (temp_v0_27 != 0) { this->obj.pos.x -= this->vel.x; this->obj.pos.y -= this->vel.y; this->obj.pos.z -= this->vel.z; - if ((temp_v0_27 >= 2) && (this->aiType > AI360_10)) { + if ((temp_v0_27 >= 2) && (this->aiType > AI360_ENEMY)) { this->timer_0BE = 2; this->obj.status = OBJ_DYING; this->itemDrop = DROP_NONE; func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 15); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } else { this->dmgType = DMG_BEAM; this->damage = 10; @@ -2105,6 +2271,7 @@ void ActorAllRange_Update(Actor* this) { } } } + if (gCurrentLevel == LEVEL_FORTUNA) { ActorAllRange_SetShadowData(this); } else if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { @@ -2113,14 +2280,16 @@ void ActorAllRange_Update(Actor* this) { this->unk_04A = 0; } } + Math_SmoothStepToF(&this->fwork[22], 0.0f, 0.8f, 0.05f, 1e-7f); Math_SmoothStepToF(&this->fwork[23], 0.0f, 1.0f, 30.0f, 0.01f); + if (this->iwork[8] != 0) { this->iwork[8]--; } } -void ActorAllRange_DrawShield(Actor* this) { +void ActorAllRange_DrawShield(ActorAllRange* this) { f32 sp24; s32 sp20; @@ -2148,7 +2317,7 @@ void ActorAllRange_DrawShield(Actor* this) { } } -void ActorAllRange_DrawBarrelRoll(Actor* this) { +void ActorAllRange_DrawBarrelRoll(ActorAllRange* this) { s32 alpha; if (this->fwork[23] > 1.0f) { @@ -2160,9 +2329,11 @@ void ActorAllRange_DrawBarrelRoll(Actor* this) { Matrix_RotateY(gGfxMatrix, M_DTOR * -this->obj.rot.y - gPlayer[0].camYaw, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, gPlayer[0].camPitch, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * this->iwork[15] * M_DTOR, MTXF_APPLY); + if (this->iwork[15] < 0) { Matrix_RotateX(gGfxMatrix, M_PI, MTXF_APPLY); } + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, SETUPDL_67); @@ -2182,6 +2353,7 @@ bool ActorAllRange_MissileOverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* po } else { RCP_SetupDL(&gMasterDisp, SETUPDL_29); } + if ((limbIndex == 1) || (limbIndex == 3)) { rot->z += gGameFrameCount * 3.0f; } @@ -2196,7 +2368,7 @@ void ActorAllRange_Draw(ActorAllRange* this) { f32 sp38; s32 pad[3]; Vec3f sp1E4 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp7C[30]; + Vec3f jointTable[30]; f32 pad2; if (this->aiType != AI360_EVENT_HANDLER) { @@ -2208,10 +2380,12 @@ void ActorAllRange_Draw(ActorAllRange* this) { Matrix_RotateZ(gGfxMatrix, M_DTOR * sp38, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } + if ((this->timer_0C6 % 2) == 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_29); gSPFogPosition(gMasterDisp++, gFogNear, 1005); } + switch (this->aiType) { case AI360_FOX: case AI360_FALCO: @@ -2222,6 +2396,7 @@ void ActorAllRange_Draw(ActorAllRange* this) { Matrix_Pop(&gGfxMatrix); ActorAllRange_DrawBarrelRoll(this); break; + case AI360_WOLF: case AI360_LEON: case AI360_PIGMA: @@ -2248,27 +2423,32 @@ void ActorAllRange_Draw(ActorAllRange* this) { } } break; + case AI360_KATT: gSPDisplayList(gMasterDisp++, D_D009A40); Actor_DrawEngineAndContrails(this); break; + case AI360_BILL: gSPDisplayList(gMasterDisp++, D_D00B880); Actor_DrawEngineAndContrails(this); break; + case AI360_GREAT_FOX: Display_SetSecondLight(&this->obj.pos); this->animFrame = 1; ActorCutscene_Draw(this); break; + case AI360_MISSILE: - Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C); - Animation_DrawSkeleton(3, D_SZ_6006E50, sp7C, ActorAllRange_MissileOverrideLimbDraw, NULL, this, + Animation_GetFrameData(&D_SZ_6006D64, 0, jointTable); + Animation_DrawSkeleton(3, aSzMissileSkel, jointTable, ActorAllRange_MissileOverrideLimbDraw, NULL, this, gCalcMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -400.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, this->fwork[29], this->fwork[29], this->fwork[29], MTXF_APPLY); Actor_DrawEngineGlow(this, 3); break; + default: if (gCurrentLevel == LEVEL_FORTUNA) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 60.0f, MTXF_APPLY); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 53b5276a..fa72deda 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -69,7 +69,7 @@ void PlayerShot_ExplodeBomb(PlayerShot* shot) { shot->unk_48 * 3.0f, 10); func_effect_8007ADF4(shot->obj.pos.x, gGroundHeight, shot->obj.pos.z, shot->unk_48 * 0.05f, shot->unk_48 * 0.5f); - func_effect_8007A6F0(&shot->obj.pos, NA_SE_OB_WATER_BOUND_M); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_OB_WATER_BOUND_M); } else { func_enmy_80062B60(shot->obj.pos.x, shot->obj.pos.z, 0, shot->unk_48 * 3.0f); } @@ -305,10 +305,11 @@ s32 PlayerShot_CheckObjectHitbox(PlayerShot* shot, f32* hitboxData, Object* obj) if (!((obj->id >= OBJ_ACTOR_START) && (obj->id < OBJ_ACTOR_MAX))) { PlayerShot_Impact(shot); } - if ((obj->id == OBJ_SCENERY_15) || ((obj->id == OBJ_SCENERY_22) && (i == 0)) || - ((obj->id == OBJ_SCENERY_10) && (i == 0)) || ((obj->id == OBJ_SCENERY_13) && (i == 0)) || - ((obj->id == OBJ_SCENERY_12) && (i < 3)) || (obj->id == OBJ_SCENERY_16) || - (obj->id == OBJ_SCENERY_14)) { + if ((obj->id == OBJ_SCENERY_CO_BUILDING_6) || ((obj->id == OBJ_SCENERY_CO_ARCH_3) && (i == 0)) || + ((obj->id == OBJ_SCENERY_CO_BUILDING_1) && (i == 0)) || + ((obj->id == OBJ_SCENERY_CO_BUILDING_4) && (i == 0)) || + ((obj->id == OBJ_SCENERY_CO_BUILDING_3) && (i < 3)) || (obj->id == OBJ_SCENERY_CO_BUILDING_7) || + (obj->id == OBJ_SCENERY_CO_BUILDING_5)) { if (shot->obj.pos.x - (obj->pos.x + hitbox->x.offset) < -hitbox->x.size) { if (hitbox->z.size + (obj->pos.z + hitbox->z.offset) < shot->obj.pos.z) { shot->obj.pos.z = hitbox->z.size + (obj->pos.z + hitbox->z.offset) - 5.0f; @@ -336,7 +337,7 @@ s32 PlayerShot_CheckObjectHitbox(PlayerShot* shot, f32* hitboxData, Object* obj) return i + 1; } if (obj->id < OBJ_SCENERY_MAX) { - func_effect_8007A6F0(&shot->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_EN_REFLECT); } return i + 1; } @@ -485,7 +486,7 @@ bool PlayerShot_CheckPolyCollision(PlayerShot* shot, ObjectId objId, Object* obj sp7C.z = obj->pos.z - shot->obj.pos.z; // undefined behavior: if this check fails, the function returns no value if (((fabsf(sp7C.x) < 1100.0f) && (fabsf(sp7C.z) < 1100.0f) && (shot->obj.pos.y < 900.0f)) || - (objId == OBJ_BOSS_SZ) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_SCENERY_ME_TUNNEL)) { + (objId == OBJ_BOSS_SZ_GREAT_FOX) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_SCENERY_ME_TUNNEL)) { Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_NEW); sp7C.x = shot->obj.pos.x - obj->pos.x; sp7C.y = shot->obj.pos.y - obj->pos.y; @@ -506,8 +507,8 @@ bool PlayerShot_CheckPolyCollision(PlayerShot* shot, ObjectId objId, Object* obj case OBJ_ACTOR_180: objId = COL1_0; break; - case OBJ_SCENERY_4: - case OBJ_SCENERY_5: + case OBJ_SCENERY_CO_BUMP_4: + case OBJ_SCENERY_CO_BUMP_5: objId = COL2_1; useCol2 = true; break; @@ -529,7 +530,7 @@ bool PlayerShot_CheckPolyCollision(PlayerShot* shot, ObjectId objId, Object* obj case ACTOR_EVENT_ID: objId = COL1_3; break; - case OBJ_BOSS_SZ: + case OBJ_BOSS_SZ_GREAT_FOX: objId = COL1_8; break; case OBJ_SCENERY_ME_TUNNEL: @@ -555,11 +556,11 @@ bool PlayerShot_CheckPolyCollision(PlayerShot* shot, ObjectId objId, Object* obj objId = COL2_7; useCol2 = true; break; - case OBJ_SCENERY_2: + case OBJ_SCENERY_CO_BUMP_2: objId = COL2_2; useCol2 = true; break; - case OBJ_SCENERY_3: + case OBJ_SCENERY_CO_BUMP_3: case OBJ_SCENERY_69: objId = COL2_3; useCol2 = true; @@ -612,7 +613,7 @@ bool PlayerShot_CheckPolyCollision(PlayerShot* shot, ObjectId objId, Object* obj return false; } PlayerShot_Impact(shot); - func_effect_8007A6F0(&shot->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_EN_REFLECT); if (gCurrentLevel == LEVEL_METEO) { Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_NEW); sp7C.x = sp4C.x - obj->pos.x; @@ -635,7 +636,7 @@ bool PlayerShot_CheckPolyCollision(PlayerShot* shot, ObjectId objId, Object* obj return false; } PlayerShot_Impact(shot); - func_effect_8007A6F0(&shot->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_EN_REFLECT); if (gCurrentLevel == LEVEL_FORTUNA) { func_effect_8007BC7C(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z, 3.0f); func_effect_8007BC7C(shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z, 3.0f); @@ -790,7 +791,7 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) { default: if (actor->info.unk_16 != 0) { if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { - if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && + if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_ENEMY) && (((gCurrentLevel == LEVEL_VENOM_2) && (shot->sourceId <= NPC_SHOT_ID + AI360_PEPPY)) || ((gCurrentLevel != LEVEL_VENOM_2) && (shot->sourceId == AI360_FOX))) && @@ -906,8 +907,8 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) { if ((scenery360->obj.id == OBJ_SCENERY_117) || (scenery360->obj.id == OBJ_SCENERY_141) || (scenery360->obj.id == OBJ_SCENERY_149) || (scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_143) || - (scenery360->obj.id == OBJ_SCENERY_160) || (scenery360->obj.id == OBJ_SCENERY_1) || - (scenery360->obj.id == OBJ_SCENERY_3) || (scenery360->obj.id == OBJ_SCENERY_140)) { + (scenery360->obj.id == OBJ_SCENERY_160) || (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_1) || + (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3) || (scenery360->obj.id == OBJ_SCENERY_140)) { PlayerShot_CheckPolyCollision(shot, scenery360->obj.id, &scenery360->obj); } else { PlayerShot_CheckObjectHitbox(shot, scenery360->info.hitbox, &scenery360->obj); @@ -917,13 +918,13 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) { } else { for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { if (scenery->obj.status == OBJ_ACTIVE) { - if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || - (scenery->obj.id == OBJ_SCENERY_4) || (scenery->obj.id == OBJ_SCENERY_5) || + if ((scenery->obj.id == OBJ_SCENERY_CO_BUMP_1) || (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_4) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_5) || (scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) || (scenery->obj.id == OBJ_SCENERY_126) || (scenery->obj.id == OBJ_SCENERY_47) || - (scenery->obj.id == OBJ_SCENERY_2) || (scenery->obj.id == OBJ_SCENERY_3) || + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_2) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_3) || (scenery->obj.id == OBJ_SCENERY_67) || (scenery->obj.id == OBJ_SCENERY_74) || - (scenery->obj.id == OBJ_SCENERY_3)) { + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_3)) { PlayerShot_CheckPolyCollision(shot, scenery->obj.id, &scenery->obj); } else { temp_v0 = PlayerShot_CheckObjectHitbox(shot, scenery->info.hitbox, &scenery->obj); @@ -953,7 +954,7 @@ void PlayerShot_CollisionCheck(PlayerShot* shot) { for (i = 0, boss = gBosses; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status == OBJ_ACTIVE) && (boss->timer_05A == 0)) { if ((boss->obj.id == OBJ_BOSS_FO) || (boss->obj.id == OBJ_BOSS_VE2) || (boss->obj.id == OBJ_BOSS_309) || - (boss->obj.id == OBJ_BOSS_SZ)) { + (boss->obj.id == OBJ_BOSS_SZ_GREAT_FOX)) { PlayerShot_CheckPolyCollision(shot, boss->obj.id, &boss->obj); } else if (boss->obj.id == OBJ_BOSS_310) { test.x = fabsf(boss->obj.pos.x - shot->obj.pos.x) * .8333333f; @@ -1614,7 +1615,7 @@ void PlayerShot_UpdateBeam(PlayerShot* shot, s32 index) { PlayerShot_Impact(shot); shot->obj.pos.y = gGroundHeight + 2; if (gCurrentLevel == LEVEL_BOLSE) { - func_effect_8007A6F0(&shot->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_EN_REFLECT); } if ((gCamCount != 4) && (gCurrentLevel != LEVEL_AQUAS)) { if ((shot->sourceId == TEAM_ID_FOX) && (gLaserStrength[0] != LASERS_SINGLE) && @@ -1660,7 +1661,7 @@ void PlayerShot_UpdateBeam(PlayerShot* shot, s32 index) { Object_Kill(&shot->obj, shot->sfxSource); return; } - if ((shot->sourceId < NPC_SHOT_ID + AI360_10) || ((shot->timer % 2) != 0)) { + if ((shot->sourceId < NPC_SHOT_ID + AI360_ENEMY) || ((shot->timer % 2) != 0)) { PlayerShot_CollisionCheck(shot); } } @@ -1863,7 +1864,7 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) { scenery = gScenery; for (i = 0; i < ARRAY_COUNT(gScenery); i++, scenery++) { - if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_56)) { + if ((scenery->obj.status == OBJ_ACTIVE) && (scenery->obj.id == OBJ_SCENERY_CO_DOORS)) { dx = scenery->obj.pos.x - shot->obj.pos.x; dy = scenery->obj.pos.y - shot->obj.pos.y; dz = scenery->obj.pos.z - shot->obj.pos.z; @@ -1904,7 +1905,7 @@ void PlayerShot_ApplyExplosionDamage(PlayerShot* shot, s32 damage) { actor->hitPos.z = shot->obj.pos.z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < radius) { if ((actor->obj.id == OBJ_ACTOR_193) || (actor->obj.id == OBJ_ACTOR_186) || - (actor->obj.id == OBJ_ACTOR_190) || (actor->obj.id == OBJ_ACTOR_202) || + (actor->obj.id == OBJ_MISSILE_SEEK_TEAM) || (actor->obj.id == OBJ_ACTOR_202) || (actor->obj.id == OBJ_ACTOR_201) || (actor->obj.id == OBJ_ACTOR_187) || ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SUPPLY_CRATE)) || ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SX_WARP_GATE)) || @@ -2093,7 +2094,7 @@ void PlayerShot_UpdateLockOnShot(PlayerShot* shot) { shot->unk_48 * 3.0f, 5); func_effect_8007ADF4(shot->obj.pos.x, gGroundHeight, shot->obj.pos.z, shot->unk_48 * 0.05f, shot->unk_48 * 0.5f); - func_effect_8007A6F0(&shot->obj.pos, NA_SE_OB_WATER_BOUND_M); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_OB_WATER_BOUND_M); } PlayerShot_Impact(shot); } else { @@ -2246,7 +2247,7 @@ void PlayerShot_UpdateShot(PlayerShot* shot, s32 index) { } } Object_Kill(&shot->obj, shot->sfxSource); - func_effect_8007A6F0(&shot->obj.pos, NA_SE_SPREAD_EXPLOSION); + Effect_SpawnTimedSfxAtPos(&shot->obj.pos, NA_SE_SPREAD_EXPLOSION); } else if (gCurrentLevel == LEVEL_AQUAS) { Aquas_801ABA40(shot); } else { diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 9979ac97..98c1af7a 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -168,20 +168,19 @@ void Background_DrawStarfield(void) { } void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { - f32 by; // 8C - f32 bx; // 88 - s16 vy; // 84 + f32 by; + f32 bx; + s16 vy; s16 vx; - s32 i; // 80 - s32 var_s2; // 7C - f32 cos; // 78 - f32 sin; // 74 - f32 spf68; // 70 - f32 spf64; // 6C - f32* sp60; // 68 - f32* sp5C; // 64 - u32* sp58; // 60 - + s32 i; + s32 var_s2; + f32 cos; + f32 sin; + f32 spf68; + f32 spf64; + f32* sp60; + f32* sp5C; + u32* sp58; gDPPipeSync(gMasterDisp++); gDPSetCycleType(gMasterDisp++, G_CYC_FILL); gDPSetCombineMode(gMasterDisp++, G_CC_SHADE, G_CC_SHADE); @@ -261,10 +260,13 @@ void Background_DrawBackdrop(void) { levelType = LEVELTYPE_SPACE; } levelId = gCurrentLevel; + Matrix_Push(&gGfxMatrix); + if (D_ctx_80177C70 == 2) { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY); } + switch (levelType) { case LEVELTYPE_PLANET: RCP_SetupDL(&gMasterDisp, SETUPDL_17); @@ -277,12 +279,14 @@ void Background_DrawBackdrop(void) { sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f); Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, MTXF_APPLY); + if (gCurrentLevel == LEVEL_FORTUNA) { Matrix_Translate(gGfxMatrix, 0.0f, -2000.0f, 0, MTXF_APPLY); } else if (gCurrentLevel == LEVEL_KATINA) { Matrix_Translate(gGfxMatrix, 0.0f, -2500.0f, 0, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); + switch (gCurrentLevel) { case LEVEL_VERSUS: if (gVersusStage == VS_STAGE_CORNERIA) { @@ -305,6 +309,7 @@ void Background_DrawBackdrop(void) { } Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); + switch (gCurrentLevel) { case LEVEL_VERSUS: if (gVersusStage == VS_STAGE_CORNERIA) { @@ -326,6 +331,7 @@ void Background_DrawBackdrop(void) { break; } break; + case LEVEL_CORNERIA: case LEVEL_VENOM_1: sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); @@ -333,6 +339,7 @@ void Background_DrawBackdrop(void) { Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); + switch (gCurrentLevel) { case LEVEL_CORNERIA: gSPDisplayList(gMasterDisp++, D_CO_60059F0); @@ -341,8 +348,10 @@ void Background_DrawBackdrop(void) { gSPDisplayList(gMasterDisp++, D_VE1_60046F0); break; } + Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); + switch (gCurrentLevel) { case LEVEL_CORNERIA: gSPDisplayList(gMasterDisp++, D_CO_60059F0); @@ -352,6 +361,7 @@ void Background_DrawBackdrop(void) { break; } break; + case LEVEL_VENOM_ANDROSS: if (gDrawBackdrop != 6) { if ((gDrawBackdrop == 2) || (gDrawBackdrop == 7)) { @@ -412,6 +422,7 @@ void Background_DrawBackdrop(void) { } } break; + case LEVEL_AQUAS: if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { sp13C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114; @@ -423,6 +434,7 @@ void Background_DrawBackdrop(void) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp13C, sp134, -7000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { gSPDisplayList(gMasterDisp++, D_AQ_601AFF0); } else { @@ -445,6 +457,7 @@ void Background_DrawBackdrop(void) { Matrix_Pop(&gGfxMatrix); } break; + case LEVEL_SOLAR: case LEVEL_ZONESS: case LEVEL_MACBETH: @@ -452,6 +465,7 @@ void Background_DrawBackdrop(void) { sp12C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].yRot_114; sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); sp13C = sp12C * -40.44444f * 2.0f; // close to 7280.0f / 180.0f + if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].csState < 3)) { D_bg_8015F968 += __sinf(gPlayer[0].camYaw) * 20.0f; @@ -462,10 +476,12 @@ void Background_DrawBackdrop(void) { D_bg_8015F968 = __sinf(gPlayer[0].camPitch) * 7000.0f; sp134 -= fabsf(D_bg_8015F968); } + sp13C = Math_ModF(sp13C, 7280.0f); RCP_SetupDL_17(); Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY); + if ((gCurrentLevel == LEVEL_TITANIA) || (gCurrentLevel == LEVEL_ZONESS)) { Matrix_Translate(gGfxMatrix, sp13C, -3000.0f + sp134, -7000.0f, MTXF_APPLY); } else if (gCurrentLevel == LEVEL_SOLAR) { @@ -474,6 +490,7 @@ void Background_DrawBackdrop(void) { Matrix_Translate(gGfxMatrix, sp13C, -4000.0f + sp134, -7000.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); + if (gCurrentLevel == LEVEL_TITANIA) { gSPDisplayList(gMasterDisp++, D_TI_6000A80); } else if (gCurrentLevel == LEVEL_MACBETH) { @@ -490,6 +507,7 @@ void Background_DrawBackdrop(void) { } Matrix_Translate(gGfxMatrix, 7280.0f * sp13C, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); + if (gCurrentLevel == LEVEL_TITANIA) { gSPDisplayList(gMasterDisp++, D_TI_6000A80); } else if (gCurrentLevel == LEVEL_MACBETH) { @@ -502,6 +520,7 @@ void Background_DrawBackdrop(void) { break; } break; + case LEVELTYPE_SPACE: if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ENTER_WARP_ZONE) { Matrix_Push(&gGfxMatrix); @@ -534,13 +553,16 @@ void Background_DrawBackdrop(void) { sp138 = Math_ModF(sp138, 480.0f); sp134 = Math_ModF(sp134, 360.0f); } + if ((sp12C < 180.0f) && (sp138 > 380.0f)) { sp138 = -(480.0f - sp138); } if ((sp130 > 180.0f) && (sp134 > 280.0f)) { sp134 = -(360.0f - sp134); } + Matrix_RotateZ(gGfxMatrix, gStarfieldRoll, MTXF_APPLY); + switch (levelId) { case LEVEL_WARP_ZONE: if ((s32) gWarpZoneBgAlpha != 0) { @@ -558,6 +580,7 @@ void Background_DrawBackdrop(void) { Matrix_Pop(&gGfxMatrix); } break; + case LEVEL_METEO: if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCsFrameCount > 260)) { Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 30.0f, -290.0f, @@ -573,6 +596,7 @@ void Background_DrawBackdrop(void) { gSPDisplayList(gMasterDisp++, D_ME_600DDF0); } break; + case LEVEL_SECTOR_X: if (gSceneSetup == 0) { Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); @@ -583,6 +607,7 @@ void Background_DrawBackdrop(void) { gSPDisplayList(gMasterDisp++, D_SX_6029890); } break; + case LEVEL_TRAINING: Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.2f, 0.2f, 1.0f, MTXF_APPLY); @@ -591,6 +616,7 @@ void Background_DrawBackdrop(void) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gSPDisplayList(gMasterDisp++, D_TR_6003760); break; + case LEVEL_AREA_6: case LEVEL_UNK_4: sp128 = (gPathProgress * 0.00004f) + 0.5f; @@ -609,6 +635,7 @@ void Background_DrawBackdrop(void) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_601BB40); break; + case LEVEL_FORTUNA: sp128 = 1.5f; if ((gCsFrameCount > 400) && (gMissionStatus == MISSION_COMPLETE)) { @@ -619,6 +646,7 @@ void Background_DrawBackdrop(void) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_FO_600B4B0); break; + case LEVEL_BOLSE: sp128 = 1.0f; if ((gCsFrameCount > 500) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { @@ -629,13 +657,15 @@ void Background_DrawBackdrop(void) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BO_600D190); break; + case LEVEL_SECTOR_Z: Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_SZ_6002F80); + gSPDisplayList(gMasterDisp++, aSzBackgroundDL); break; + case LEVEL_SECTOR_Y: Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY); @@ -648,6 +678,7 @@ void Background_DrawBackdrop(void) { } Matrix_Pop(&gGfxMatrix); } + if (gStarWarpDistortion > 0.0f) { f32* xStar = gStarOffsetsX; f32* yStar = gStarOffsetsY; @@ -655,7 +686,7 @@ void Background_DrawBackdrop(void) { RCP_SetupDL_14(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 128, 128, 255, 255); - i = 0; + zRot = 0.0f; for (i = 0; i < 300; i++, xStar++, yStar++) { *xStar = RAND_FLOAT_SEEDED(480.0f) - 80.0f; @@ -690,10 +721,12 @@ void Background_DrawSun(void) { (gCurrentLevel == LEVEL_SOLAR) || (gCurrentLevel == LEVEL_TRAINING) || gVersusMode) { return; } + gPlayerGlareAlphas[gPlayerNum] -= sSunGlareAlphaStep[levelType]; if (gPlayerGlareAlphas[gPlayerNum] > 300) { gPlayerGlareAlphas[gPlayerNum] = 0; } + if (((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO)) || (((gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_U_TURN) || (gLevelMode == LEVELMODE_ALL_RANGE) || (gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) && @@ -701,14 +734,17 @@ void Background_DrawSun(void) { gPlayerGlareReds[gPlayerNum] = 128; gPlayerGlareGreens[gPlayerNum] = 128; gPlayerGlareBlues[gPlayerNum] = 128; + camYaw = Math_RadToDeg(gPlayer[gPlayerNum].camYaw); camPitch = Math_RadToDeg(gPlayer[gPlayerNum].camPitch); if (camPitch > 180.0f) { camPitch -= 360.0f; } + camYaw -= 135.0f; gSunViewX = -camYaw * 3.2f; gSunViewY = (-camPitch * 3.2f) + 130.0f - ((gPlayer[gPlayerNum].cam.eye.y - 350.0f) * 0.015f); + if (gCurrentLevel == LEVEL_KATINA) { gSunViewY -= 80.0f; } @@ -716,6 +752,7 @@ void Background_DrawSun(void) { gSunViewY -= 60.0f; gSunViewX -= 480.0f; } + if ((gSunViewX < 120.0f) && (gSunViewX > -120.0f) && (gSunViewY < 120.0f)) { gPlayerGlareAlphas[gPlayerNum] += sSunGlareAlphaStep[levelType] * 2; if (sSunGlareMaxAlpha[levelType] < gPlayerGlareAlphas[gPlayerNum]) { @@ -723,6 +760,7 @@ void Background_DrawSun(void) { } } } + if (gPlayerGlareAlphas[gPlayerNum] != 0) { Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); @@ -732,12 +770,14 @@ void Background_DrawSun(void) { sunAlpha = sSunAlphas; sunDL = sSunDLs; sunScale = sSunScales; + if (gCurrentLevel == LEVEL_KATINA) { sunColor = sKaSunColors; sunAlpha = sKaSunAlphas; sunDL = sKaSunDLs; sunScale = sKaSunScales; } + for (i = 0; i < 5; i++, sunColor++, sunAlpha++, sunDL++, sunScale++) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, *sunScale, *sunScale, *sunScale, MTXF_APPLY); @@ -766,11 +806,13 @@ void Background_DrawLensFlare(void) { (gPlayerGlareAlphas[gPlayerNum] == 0)) { return; } + alphaMod = 1.0f; if (gPlayerGlareAlphas[gPlayerNum] < 80) { alphaMod = gPlayerGlareAlphas[gPlayerNum] / 80.0f; } alphaMod *= sLensFlareAlphaMod[gLevelType]; + Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, gSunViewX, gSunViewY, -200.0f, MTXF_APPLY); @@ -782,6 +824,7 @@ void Background_DrawLensFlare(void) { lensFlareDL = &sSunDLs[5]; lensFlareScale = &sSunScales[5]; lensFlareShift = &sSunShifts[5]; + if (gCurrentLevel == LEVEL_KATINA) { lensFlareColor = &sKaSunColors[5]; lensFlareAlpha = &sKaSunAlphas[5]; @@ -789,6 +832,7 @@ void Background_DrawLensFlare(void) { lensFlareScale = &sKaSunScales[5]; lensFlareShift = &sKaSunShifts[5]; } + for (i = 5; i < 13; i++, lensFlareColor++, lensFlareAlpha++, lensFlareDL++, lensFlareScale++, lensFlareShift++) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, *lensFlareShift * lensFlareOffsetX, *lensFlareShift * -lensFlareOffsetY, 0.0f, @@ -828,6 +872,7 @@ void Background_DrawGround(void) { Bolse_DrawDynamicGround(); return; } + sp1D4 = 0.0f; if ((gGroundType != 10) && (gGroundType != 11)) { sp1D4 = -4000.0f; @@ -849,10 +894,13 @@ void Background_DrawGround(void) { sp1B4.x = 0; sp1B4.y = 0; sp1B4.z = -5500.0f; + Matrix_RotateY(gCalcMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp1B4, &sp1A8); + temp_fv1 = gPlayer[gPlayerNum].cam.eye.x + sp1A8.x; temp_fa0 = gPlayer[gPlayerNum].cam.eye.z + sp1A8.z; + if (temp_fv1 > 6000.0f) { gPlayer[gPlayerNum].xPath = 12000.0f; } @@ -865,6 +913,7 @@ void Background_DrawGround(void) { if (temp_fv1 < -18000.0f) { gPlayer[gPlayerNum].xPath = -24000.0f; } + if (temp_fa0 > 6000.0f) { sp1D4 = 12000.0f; } @@ -878,12 +927,16 @@ void Background_DrawGround(void) { sp1D4 = -24000.0f; } } + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].xPath, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY); + if (D_ctx_80177C70 == 2) { Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY); } + Matrix_SetGfxMtx(&gMasterDisp); + switch (gCurrentLevel) { case LEVEL_CORNERIA: if (gGroundClipMode != 0) { @@ -891,6 +944,7 @@ void Background_DrawGround(void) { } else { RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } + if (gLevelMode == LEVELMODE_ON_RAILS) { gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, SEGMENTED_TO_VIRTUAL(D_CO_601B6C0)); temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); // 0.64f / 3.0f @@ -935,6 +989,7 @@ void Background_DrawGround(void) { } } break; + case LEVEL_VENOM_1: case LEVEL_MACBETH: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -972,6 +1027,7 @@ void Background_DrawGround(void) { gSPDisplayList(gMasterDisp++, sp1C0); Matrix_Pop(&gGfxMatrix); break; + case LEVEL_TRAINING: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); if (gLevelMode == LEVELMODE_ON_RAILS) { @@ -1002,10 +1058,12 @@ void Background_DrawGround(void) { } } break; + case LEVEL_AQUAS: RCP_SetupDL(&gMasterDisp, SETUPDL_20); sp1C0 = D_AQ_600AB10; gSPFogPosition(gMasterDisp++, gFogNear, gFogFar); + if ((D_bg_8015F964 == 0) && ((gAqDrawMode == 0) || (gAqDrawMode == 2))) { gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_600AB68), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, @@ -1029,6 +1087,7 @@ void Background_DrawGround(void) { gSPDisplayList(gMasterDisp++, sp1C0); Matrix_Pop(&gGfxMatrix); } + if ((D_bg_8015F964 != 0) || (gAqDrawMode == 0)) { gDPLoadTileTexture(gMasterDisp++, SEGMENTED_TO_VIRTUAL(D_AQ_602ACC0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); @@ -1042,6 +1101,7 @@ void Background_DrawGround(void) { } else { RCP_SetupDL(&gMasterDisp, SETUPDL_37); } + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].csState < 2)) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { @@ -1050,6 +1110,7 @@ void Background_DrawGround(void) { } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_AQ_801C4188); } + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, D_bg_8015F970, -3000.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.5f, MTXF_APPLY); @@ -1062,6 +1123,7 @@ void Background_DrawGround(void) { gSPDisplayList(gMasterDisp++, D_AQ_602AC40); } break; + case LEVEL_FORTUNA: case LEVEL_KATINA: case LEVEL_BOLSE: @@ -1071,6 +1133,7 @@ void Background_DrawGround(void) { } else { RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } + for (i = 0; i < ARRAY_COUNT(sGroundPositions360x); i++) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sGroundPositions360x[i], 0.0f, sGroundPositions360z[i], MTXF_APPLY); @@ -1087,12 +1150,14 @@ void Background_DrawGround(void) { Matrix_Pop(&gGfxMatrix); } break; + case LEVEL_VERSUS: if (gGroundClipMode != 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } + for (i = 0; i < ARRAY_COUNT(sGroundPositions360x); i++) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sGroundPositions360x[i], 0.0f, sGroundPositions360z[i], MTXF_APPLY); @@ -1105,6 +1170,7 @@ void Background_DrawGround(void) { Matrix_Pop(&gGfxMatrix); } break; + case LEVEL_SOLAR: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -2000.0f, MTXF_APPLY); @@ -1116,6 +1182,7 @@ void Background_DrawGround(void) { gSPDisplayList(gMasterDisp++, D_SO_6002E60); } break; + case LEVEL_ZONESS: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1500.0f, MTXF_APPLY); diff --git a/src/engine/fox_boss.c b/src/engine/fox_boss.c index 722f116f..ae9235e0 100644 --- a/src/engine/fox_boss.c +++ b/src/engine/fox_boss.c @@ -11,7 +11,7 @@ s32 PAD_boss_C9EC4[14] = { 0 }; const f32 D_boss_800D55D0[] = { 6000.0f, 18000.0f, -6000.0f, -18000.0f }; // unused? -void Boss_AwardBonus(Boss* boss) { +void Boss_AwardBonus(Boss* this) { s32 bonus; f32 yOffset; @@ -26,15 +26,17 @@ void Boss_AwardBonus(Boss* boss) { } else { bonus = 0; } + if (bonus != 0) { yOffset = 0.0f; - if (boss->obj.id == OBJ_BOSS_292) { + if (this->obj.id == OBJ_BOSS_CO_GRANGA) { yOffset = 300.0f; - } else if (boss->obj.id == OBJ_BOSS_TI) { + } else if (this->obj.id == OBJ_BOSS_TI) { yOffset = 200.0f; } - BonusText_Display(boss->obj.pos.x, boss->obj.pos.y + yOffset, boss->obj.pos.z, bonus); + BonusText_Display(this->obj.pos.x, this->obj.pos.y + yOffset, this->obj.pos.z, bonus); } + gHitCount += bonus + 1; D_ctx_80177850 = 15; } @@ -57,27 +59,27 @@ void Boss300_Update(Boss300* this) { void Boss300_Draw(Boss300* this) { } -void Boss_SetupDebris(Actor* actor, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, +void Boss_SetupDebris(ActorDebris* this, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, f32 argA, s32 argB, s32 argC) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_DEBRIS; - actor->state = argB; - actor->obj.pos.x = arg1; - actor->obj.pos.y = arg2; - actor->obj.pos.z = arg3; - actor->obj.rot.x = arg4; - actor->obj.rot.y = arg5; - actor->obj.rot.z = arg6; - actor->vel.x = arg7; - actor->vel.y = arg8; - actor->vel.z = arg9; - actor->scale = argA; - actor->timer_0BC = argC; - actor->timer_0BE = 20; - Object_SetInfo(&actor->info, actor->obj.id); + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_DEBRIS; + this->state = argB; + this->obj.pos.x = arg1; + this->obj.pos.y = arg2; + this->obj.pos.z = arg3; + this->obj.rot.x = arg4; + this->obj.rot.y = arg5; + this->obj.rot.z = arg6; + this->vel.x = arg7; + this->vel.y = arg8; + this->vel.z = arg9; + this->scale = argA; + this->timer_0BC = argC; + this->timer_0BE = 20; + Object_SetInfo(&this->info, this->obj.id); if (gLevelType == LEVELTYPE_PLANET) { - actor->gravity = 0.5f; + this->gravity = 0.5f; } } @@ -93,8 +95,8 @@ void Boss_SpawnDebris(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5 } } -void Boss_SetCullDistance(Boss* boss) { - boss->info.cullDistance = 30000.0f; +void Boss_SetCullDistance(Boss* this) { + this->info.cullDistance = 30000.0f; } void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) { @@ -110,10 +112,13 @@ void Boss_CompleteLevel(Player* player, f32 xPos, f32 yPos, f32 zPos) { player->csState = 10; player->csTimer = 50; player->csEventTimer = 50; + player->unk_000 = 0.0f; player->unk_004 = 1.0f; + if (player->pos.x < player->xPath) { player->unk_004 = -1.0f; } + gPlayer[0].vel.x = 0.0f; } diff --git a/src/engine/fox_col1.c b/src/engine/fox_col1.c index f570c6fc..0739b801 100644 --- a/src/engine/fox_col1.c +++ b/src/engine/fox_col1.c @@ -194,6 +194,7 @@ void func_col1_80097C88(Vec3f* norms, Vtx_tn* quad) { __vtx1_x = quad->ob[0]; __vtx1_y = quad->ob[1]; __vtx1_z = quad->ob[2]; + quad++; __vtx2_x = quad->ob[0]; __vtx2_y = quad->ob[1]; @@ -205,17 +206,21 @@ void func_col1_80097C88(Vec3f* norms, Vtx_tn* quad) { __dy2 = __vtx2_y - __vtx1_y; __dz1 = __vtx1_z - __vtx0_z; __dz2 = __vtx2_z - __vtx1_z; + norms->x = (__dy1 * __dz2) - (__dz1 * __dy2); norms->y = (__dz1 * __dx2) - (__dx1 * __dz2); norms->z = (__dx1 * __dy2) - (__dy1 * __dx2); + temp_fv0 = VEC3F_MAG(norms); if (temp_fv0 != 0.0f) { norms->x = (norms->x / temp_fv0) * 127.0f; norms->y = (norms->y / temp_fv0) * 127.0f; norms->z = (norms->z / temp_fv0) * 127.0f; } + norms++; quad++; + __vtx1_x = __vtx2_x; __vtx1_y = __vtx2_y; __vtx1_z = __vtx2_z; @@ -223,15 +228,18 @@ void func_col1_80097C88(Vec3f* norms, Vtx_tn* quad) { __vtx2_x = quad->ob[0]; __vtx2_y = quad->ob[1]; __vtx2_z = quad->ob[2]; + __dx1 = __vtx1_x - __vtx0_x; __dx2 = __vtx2_x - __vtx1_x; __dy1 = __vtx1_y - __vtx0_y; __dy2 = __vtx2_y - __vtx1_y; __dz1 = __vtx1_z - __vtx0_z; __dz2 = __vtx2_z - __vtx1_z; + norms->x = (__dy1 * __dz2) - (__dz1 * __dy2); norms->y = (__dz1 * __dx2) - (__dx1 * __dz2); norms->z = (__dx1 * __dy2) - (__dy1 * __dx2); + temp_fv0 = VEC3F_MAG(norms); if (temp_fv0 != 0.0f) { norms->x = (norms->x / temp_fv0) * 127.0f; @@ -260,8 +268,10 @@ s32 func_col1_8009808C(Vec3f* pos, Vtx_tn* quad, Vec3f* normOut) { __vtx3_x = quad[3].ob[0]; __vtx3_y = quad[3].ob[1]; __vtx3_z = quad[3].ob[2]; + __pos_x = pos->x; __pos_z = pos->z; + test1 = TRINORM_Y(__vtx0, __vtx1, __pos); if (test1 >= 0.0f) { test1 = TRINORM_Y(__vtx1, __vtx2, __pos); @@ -277,6 +287,7 @@ s32 func_col1_8009808C(Vec3f* pos, Vtx_tn* quad, Vec3f* normOut) { } } } + if (var_v1 == 0) { test1 = TRINORM_Y(__vtx0, __vtx2, __pos); if ((test1 >= 0.0f)) { diff --git a/src/engine/fox_col2.c b/src/engine/fox_col2.c index 6d75b7fc..f1d5bc52 100644 --- a/src/engine/fox_col2.c +++ b/src/engine/fox_col2.c @@ -26,14 +26,18 @@ bool func_col2_800A36FC(Vec3f* objPos, Vec3f* colliderPos, CollisionHeader2* col objRelPos.x = objPos->x - colliderPos->x; objRelPos.y = objPos->y - colliderPos->y; objRelPos.z = objPos->z - colliderPos->z; + if ((objRelPos.x < colHeader->min.x) || (objRelPos.y < colHeader->min.y) || (objRelPos.z < colHeader->min.z) || (colHeader->max.x < objRelPos.x) || (colHeader->max.y < objRelPos.y) || (colHeader->max.z < objRelPos.z)) { return false; } + above = false; count = colHeader->polyCount; + polys = SEGMENTED_TO_VIRTUAL(colHeader->polys); mesh = SEGMENTED_TO_VIRTUAL(colHeader->mesh); + for (i = 0; i < count; i++, polys++) { for (j = 0; j < 3; j++) { tri[j] = &mesh[polys->vtx[j]]; @@ -43,12 +47,15 @@ bool func_col2_800A36FC(Vec3f* objPos, Vec3f* colliderPos, CollisionHeader2* col break; } } + if (above) { vtx.x = tri[0]->x; vtx.y = tri[0]->y; vtx.z = tri[0]->z; + func_col1_80098860(&triPlane, &vtx, &norm); hitDataOut->y = func_col1_800988B4(&objRelPos, &triPlane); + if (triPlane.normal.x != 0.0f) { norm.x = -triPlane.dist / triPlane.normal.x; } else { @@ -64,6 +71,7 @@ bool func_col2_800A36FC(Vec3f* objPos, Vec3f* colliderPos, CollisionHeader2* col } else { norm.z = 0.0f; } + hitDataOut->x = Math_Atan2F_XY(norm.y, norm.z); if (norm.z != 0.0f) { hitDataOut->z = -Math_Atan2F_XY(__sinf(Math_Atan2F_XY(norm.y, norm.z)) * norm.z, norm.x); @@ -72,6 +80,7 @@ bool func_col2_800A36FC(Vec3f* objPos, Vec3f* colliderPos, CollisionHeader2* col } else { hitDataOut->z = -Math_Atan2F_XY(norm.y, norm.x); } + if ((objPos->y - hitDataOut->y <= 0.0f) || (gCurrentLevel == LEVEL_MACBETH)) { sp38 = true; } @@ -106,6 +115,7 @@ bool func_col2_800A3A74(Vec3f* point, Vec3f** tri, Vec3f* normOut) { ptx = point->x; ptz = point->z; + temp1 = ((vtx2.z - vtx1.z) * (ptx - vtx2.x)) - ((vtx2.x - vtx1.x) * (ptz - vtx2.z)); if (temp1 >= 0.0f) { if (((vtx3.x - vtx2.x) * (ptz - vtx3.z)) <= ((vtx3.z - vtx2.z) * (ptx - vtx3.x))) { diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index afd62d62..954a2a08 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -7,7 +7,7 @@ s32 gSceneId; s32 gSceneSetup; s32 gClearPlayerInfo; // some sort of flag -s32 D_ctx_8017782C; // some sort of flag. all range related? +bool D_ctx_8017782C; // some sort of flag. all range related? GameState gGameState; s32 gNextGameStateTimer; s32 gVsItemSpawnTimer; @@ -287,7 +287,7 @@ UNK_TYPE P_800D31A8 = 0; u16 gEnemyShotSpeed; // enemy shot speed? u8 gShowLevelClearStatusScreen; s32 gLevelStartStatusScreenTimer; -s32 gLevelClearScreenTimer; // timer for mission accomplished scrren +s32 gLevelClearScreenTimer; // timer for mission accomplished screen s32 gBossHealthBar; s32 D_ctx_80177850; // bonus text related. set to 15 but never read s32 D_ctx_80177858[4]; // set to 3 but never used. related to VS mode customization? diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 67daab35..17a1fc61 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -79,24 +79,26 @@ static Vec3f D_demo_800C9F60[] = { }; static f32 D_demo_800C9F90[] = { 75.0f, -80.0f, 85.0f, 0.0f }; -void func_demo_80048CC4(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_demo_800C9F60[arg1].x + gPlayer[0].pos.x; - actor->obj.pos.y = D_demo_800C9F60[arg1].y + gPlayer[0].pos.y; - actor->obj.pos.z = D_demo_800C9F60[arg1].z + gPlayer[0].trueZpos; - actor->rot_0F4.y = 0.0f; - actor->rot_0F4.z = D_demo_800C9F90[arg1]; - Object_SetInfo(&actor->info, actor->obj.id); +void func_demo_80048CC4(ActorCutscene* this, s32 index) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; - if (arg1 == 3) { - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); - actor->animFrame = 1; + this->obj.pos.x = D_demo_800C9F60[index].x + gPlayer[0].pos.x; + this->obj.pos.y = D_demo_800C9F60[index].y + gPlayer[0].pos.y; + this->obj.pos.z = D_demo_800C9F60[index].z + gPlayer[0].trueZpos; + + this->rot_0F4.y = 0.0f; + this->rot_0F4.z = D_demo_800C9F90[index]; + Object_SetInfo(&this->info, this->obj.id); + + if (index == 3) { + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, this->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, this->sfxSource, 0); + this->animFrame = 1; } else { - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } } @@ -109,6 +111,7 @@ void Cutscene_WarpZoneComplete(Player* player) { s32 temp_v1; gBosses[1].obj.status = OBJ_FREE; + Math_SmoothStepToF(&player->zRotBarrelRoll, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 3.0f, 0.0f); @@ -190,6 +193,7 @@ void Cutscene_WarpZoneComplete(Player* player) { default: break; } + if (gCsFrameCount > 450) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 0.1f, 0.004f, 0.0f); player->baseSpeed += 2.0f; @@ -328,37 +332,40 @@ static f32 D_demo_800CA020[] = { 45.0f, -45.0f, 10.0f, 0.0f }; static s32 D_demo_800CA030[] = { 0, 0, 0, 1 }; static s32 D_demo_800CA040[] = { 0, 0, 0, 0 }; -void func_demo_80049968(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_demo_800C9FD0[arg1]; - actor->obj.pos.y = D_demo_800C9FE0[arg1]; - actor->obj.pos.z = D_demo_800C9FF0[arg1] + gPlayer[0].trueZpos; - actor->fwork[0] = D_demo_800CA000[arg1]; - actor->fwork[1] = D_demo_800CA010[arg1]; - actor->animFrame = D_demo_800CA030[arg1]; - actor->state = D_demo_800CA040[arg1]; - actor->obj.rot.z = D_demo_800CA020[arg1]; - actor->obj.rot.y = 180.0f; - actor->vel.z = gPlayer[0].vel.z; - Object_SetInfo(&actor->info, actor->obj.id); - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); +void func_demo_80049968(ActorCutscene* this, s32 index) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = D_demo_800C9FD0[index]; + this->obj.pos.y = D_demo_800C9FE0[index]; + this->obj.pos.z = D_demo_800C9FF0[index] + gPlayer[0].trueZpos; + + this->fwork[0] = D_demo_800CA000[index]; + this->fwork[1] = D_demo_800CA010[index]; + + this->animFrame = D_demo_800CA030[index]; + this->state = D_demo_800CA040[index]; + this->obj.rot.z = D_demo_800CA020[index]; + this->obj.rot.y = 180.0f; + this->vel.z = gPlayer[0].vel.z; + Object_SetInfo(&this->info, this->obj.id); + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } -void func_demo_80049A9C(Effect* effect, f32 x, f32 y, f32 z) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_346; - effect->timer_50 = 100; - effect->scale2 = 0.2f; - effect->obj.pos.x = x; - effect->obj.pos.y = y; - effect->obj.pos.z = z; - effect->vel.z = 40.0f; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); +void func_demo_80049A9C(Effect346* this, f32 x, f32 y, f32 z) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_346; + this->timer_50 = 100; + this->scale2 = 0.2f; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; + this->vel.z = 40.0f; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } void func_demo_80049B44(void) { @@ -659,65 +666,68 @@ static f32 D_demo_800CA05C[] = { -60.0f, -60.0f, -120.0f }; static f32 D_demo_800CA068[] = { -150.0f, -150.0f, -300.0f }; static f32 D_demo_800CA074[] = { 360.0f, -360.0f, 0.0f }; -void func_demo_8004A700(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = gPlayer[0].pos.x; - actor->obj.pos.y = gPlayer[0].pos.y - 1000.0f; - actor->obj.pos.z = gPlayer[0].pos.z; - actor->fwork[0] = D_demo_800CA050[arg1]; - actor->fwork[1] = D_demo_800CA05C[arg1]; - actor->fwork[2] = D_demo_800CA068[arg1]; - actor->fwork[3] = 4.0f; - actor->fwork[7] = RAND_FLOAT(100.0f); - actor->fwork[8] = RAND_FLOAT(100.0f); - actor->obj.rot.z = D_demo_800CA074[arg1]; - actor->iwork[11] = 1; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); +void func_demo_8004A700(ActorCutscene* this, s32 index) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = gPlayer[0].pos.x; + this->obj.pos.y = gPlayer[0].pos.y - 1000.0f; + this->obj.pos.z = gPlayer[0].pos.z; + + this->fwork[0] = D_demo_800CA050[index]; + this->fwork[1] = D_demo_800CA05C[index]; + this->fwork[2] = D_demo_800CA068[index]; + + this->fwork[3] = 4.0f; + this->fwork[7] = RAND_FLOAT(100.0f); + this->fwork[8] = RAND_FLOAT(100.0f); + this->obj.rot.z = D_demo_800CA074[index]; + this->iwork[11] = 1; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } void func_demo_8004A840(s32 actor) { func_demo_8004A700(&gActors[actor], actor); } -void func_demo_8004A888(Effect* effect) { - Vec3f sp2C; - Vec3f sp20; +void func_demo_8004A888(Clouds* this) { + Vec3f src; + Vec3f dest; Matrix_RotateY(gCalcMatrix, (gPlayer[0].rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -(gPlayer[0].rot.x * M_DTOR), MTXF_APPLY); - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - sp2C.x = RAND_FLOAT_CENTERED(1500.0f); - sp2C.y = RAND_FLOAT_CENTERED(800.0f); - sp2C.z = 3000.0f; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + src.x = RAND_FLOAT_CENTERED(1500.0f); + src.y = RAND_FLOAT_CENTERED(800.0f); + src.z = 3000.0f; - Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); - effect->obj.pos.x = gPlayer[0].pos.x + sp20.x; - effect->obj.pos.y = gPlayer[0].pos.y + sp20.y; - effect->obj.pos.z = gPlayer[0].pos.z + sp20.z; - sp2C.x = 0.0f; - sp2C.y = 0.0f; - sp2C.z = -80.0f; + this->obj.pos.x = gPlayer[0].pos.x + dest.x; + this->obj.pos.y = gPlayer[0].pos.y + dest.y; + this->obj.pos.z = gPlayer[0].pos.z + dest.z; + src.x = 0.0f; + src.y = 0.0f; + src.z = -80.0f; - Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); - effect->vel.x = sp20.x; - effect->vel.y = sp20.y; - effect->vel.z = sp20.z; - effect->obj.id = OBJ_EFFECT_352; - effect->timer_50 = 40; - effect->unk_46 = 144; - effect->scale2 = RAND_FLOAT(30.0f) + 10.0f; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; + this->obj.id = OBJ_EFFECT_CLOUDS; + this->timer_50 = 40; + this->unk_46 = 144; + this->scale2 = RAND_FLOAT(30.0f) + 10.0f; if (Rand_ZeroOne() < 0.5f) { - effect->obj.rot.z = 180.0f; + this->obj.rot.z = 180.0f; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_demo_8004AA84(void) { @@ -740,7 +750,7 @@ void Cutscene_AllRangeMode(Player* player) { s32 pad; Vec3f sp70; Vec3f sp64; - Actor* actor; + ActorTeamBoss* actor; f32 var_s1; f32 var_s2; f32 var_s3; @@ -749,7 +759,9 @@ void Cutscene_AllRangeMode(Player* player) { s32 pad2; gCsFrameCount++; + Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); + if (gCsFrameCount == 37) { gChangeTo360 = true; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { @@ -1872,7 +1884,7 @@ void func_demo_8004E4D4(ActorCutscene* this) { Vec3f sp54; Vec3f sp48; Vec3f sp3C; - Player* sp38 = gPlayer; + Player* sp38 = &gPlayer[0]; f32 sp34; this->fwork[7] += 3.0f; @@ -1925,6 +1937,7 @@ void func_demo_8004E4D4(ActorCutscene* this) { if (this->fwork[9] > 50.0f) { this->fwork[9] = 50.0f; } + if (this->timer_0BE == 0) { switch (this->index) { case 1: @@ -2102,55 +2115,55 @@ void func_demo_8004EBD0(ActorCutscene* this) { } } -void func_demo_8004F05C(Actor* actor) { - if (((gLevelType == LEVELTYPE_PLANET) && (actor->animFrame == 0)) || (gCurrentLevel == LEVEL_BOLSE)) { - actor->fwork[0] += 3.0f; - actor->fwork[1] = SIN_DEG(actor->fwork[0]) * 1.5f; +void func_demo_8004F05C(ActorCutscene* this) { + if (((gLevelType == LEVELTYPE_PLANET) && (this->animFrame == 0)) || (gCurrentLevel == LEVEL_BOLSE)) { + this->fwork[0] += 3.0f; + this->fwork[1] = SIN_DEG(this->fwork[0]) * 1.5f; } switch (gCurrentLevel) { case LEVEL_BOLSE: - switch (actor->animFrame) { + switch (this->animFrame) { case 0: if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { - actor->rot_0F4.z += actor->rot_0F4.y; - actor->vel.x = SIN_DEG(actor->rot_0F4.z) * 10.0f; - actor->obj.rot.z = SIN_DEG(actor->rot_0F4.z) * 40.0f; + this->rot_0F4.z += this->rot_0F4.y; + this->vel.x = SIN_DEG(this->rot_0F4.z) * 10.0f; + this->obj.rot.z = SIN_DEG(this->rot_0F4.z) * 40.0f; break; } - Math_SmoothStepToF(&actor->obj.rot.z, actor->fwork[1], 0.05f, 0.3f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.z, this->fwork[1], 0.05f, 0.3f, 0.0f); - switch (actor->state) { + switch (this->state) { case 0: break; case 1: - actor->state = 2; - actor->timer_0BC = 100; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 2; + this->timer_0BC = 100; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 5.0f; case 2: - actor->iwork[11] = 2; - actor->vel.z -= 5.0f; - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + this->iwork[11] = 2; + this->vel.z -= 5.0f; + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } break; case 31: - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; case 32: - actor->obj.rot.z += actor->rot_0F4.z; - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + this->obj.rot.z += this->rot_0F4.z; + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; @@ -2160,40 +2173,40 @@ void func_demo_8004F05C(Actor* actor) { break; case LEVEL_AREA_6: - Area6_8018DA58(actor); + Area6_8018DA58(this); break; case LEVEL_SECTOR_Y: - switch (actor->animFrame) { + switch (this->animFrame) { case 0: - SectorY_8019FF00(actor); + SectorY_8019FF00(this); break; case 42: - if (actor->timer_0BC == 0) { - if (actor->obj.pos.x >= -3500.0f) { - if (actor->obj.pos.z <= 3000.0f) { - if ((fabsf(actor->obj.pos.y) <= 400.0f) && (gCsFrameCount <= 300)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); + if (this->timer_0BC == 0) { + if (this->obj.pos.x >= -3500.0f) { + if (this->obj.pos.z <= 3000.0f) { + if ((fabsf(this->obj.pos.y) <= 400.0f) && (gCsFrameCount <= 300)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 8.0f); } } } - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } break; case 43: - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } break; case LEVEL_SECTOR_X: - if ((actor->state != 0) && (actor->state == 1)) { - actor->vel.y += 0.1f; - Math_SmoothStepToF(&actor->obj.rot.x, -20.0f, 0.1f, 0.5f, 0.0f); + if ((this->state != 0) && (this->state == 1)) { + this->vel.y += 0.1f; + Math_SmoothStepToF(&this->obj.rot.x, -20.0f, 0.1f, 0.5f, 0.0f); } break; @@ -2202,84 +2215,84 @@ void func_demo_8004F05C(Actor* actor) { break; default: - switch (actor->state) { + switch (this->state) { case 100: - Math_SmoothStepToF(&actor->obj.pos.x, actor->vwork[0x14].x, 0.03f, 3.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->vwork[0x14].y, 0.03f, 2.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->vwork[0x14].z, 0.03f, 2.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.z, 0.0f, 0.02f, 0.3f, 0); + Math_SmoothStepToF(&this->obj.pos.x, this->vwork[0x14].x, 0.03f, 3.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, this->vwork[0x14].y, 0.03f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.z, this->vwork[0x14].z, 0.03f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.z, 0.0f, 0.02f, 0.3f, 0); break; case 0: - actor->obj.rot.z = actor->rot_0F4.z; - if (actor->animFrame == 10) { - actor->obj.pos.z = gPlayer[0].cam.eye.z + 12000.0f; + this->obj.rot.z = this->rot_0F4.z; + if (this->animFrame == 10) { + this->obj.pos.z = gPlayer[0].cam.eye.z + 12000.0f; } break; case 1: - actor->vel.y += 0.8f; - actor->vel.x += 0.8f; - Math_SmoothStepToF(&actor->obj.rot.z, 420.0f, 0.1f, 15.0f, 0.001f); + this->vel.y += 0.8f; + this->vel.x += 0.8f; + Math_SmoothStepToF(&this->obj.rot.z, 420.0f, 0.1f, 15.0f, 0.001f); break; case 2: - actor->vel.y += 0.8f; - actor->vel.x -= 0.8f; - Math_SmoothStepToF(&actor->obj.rot.z, -420.0f, 0.1f, 15.0f, 0.001f); + this->vel.y += 0.8f; + this->vel.x -= 0.8f; + Math_SmoothStepToF(&this->obj.rot.z, -420.0f, 0.1f, 15.0f, 0.001f); break; case 3: - actor->vel.y += 1.2f; - actor->vel.z += 0.1f; - Math_SmoothStepToF(&actor->obj.rot.x, -45.0f, 0.1f, 15.0f, 0.001f); + this->vel.y += 1.2f; + this->vel.z += 0.1f; + Math_SmoothStepToF(&this->obj.rot.x, -45.0f, 0.1f, 15.0f, 0.001f); break; case 10: - actor->vel.x -= 1.0f; - Math_SmoothStepToF(&actor->obj.rot.z, -45.0f, 0.05f, 0.5f, 0.0f); + this->vel.x -= 1.0f; + Math_SmoothStepToF(&this->obj.rot.z, -45.0f, 0.05f, 0.5f, 0.0f); break; case 11: - actor->vel.x -= 2.0f; - Math_SmoothStepToF(&actor->obj.rot.z, -70.0f, 0.1f, 6.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.y, 225.0f, 0.05f, 2.0f, 0.0f); + this->vel.x -= 2.0f; + Math_SmoothStepToF(&this->obj.rot.z, -70.0f, 0.1f, 6.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.y, 225.0f, 0.05f, 2.0f, 0.0f); break; case 12: - actor->vel.x += 2.0f; - actor->vel.y += 1.0f; - Math_SmoothStepToF(&actor->obj.rot.z, 80.0f, 0.1f, 6.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.x, -15.0f, 0.05f, 4.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.y, 135.0f, 0.05f, 2.0f, 0.0f); + this->vel.x += 2.0f; + this->vel.y += 1.0f; + Math_SmoothStepToF(&this->obj.rot.z, 80.0f, 0.1f, 6.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.x, -15.0f, 0.05f, 4.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.y, 135.0f, 0.05f, 2.0f, 0.0f); break; case 13: - actor->vel.y += 2.0f; - Math_SmoothStepToF(&actor->obj.rot.z, -400.0f, 0.2f, 14.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.x, -45.0f, 0.05f, 4.0f, 0.0f); + this->vel.y += 2.0f; + Math_SmoothStepToF(&this->obj.rot.z, -400.0f, 0.2f, 14.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.x, -45.0f, 0.05f, 4.0f, 0.0f); break; } break; } } -void func_demo_8004F798(Actor* actor) { - actor->iwork[11] = 2; +void func_demo_8004F798(ActorCutscene* this) { + this->iwork[11] = 2; - switch (actor->state) { + switch (this->state) { case 0: - Math_SmoothStepToF(&actor->obj.pos.x, actor->fwork[0], 0.05f, 50.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->fwork[1], 0.05f, 50.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.z, 0.0f, 0.05f, 1.0f, 0.0f); - actor->obj.pos.z -= 2.0f; + Math_SmoothStepToF(&this->obj.pos.x, this->fwork[0], 0.05f, 50.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[1], 0.05f, 50.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.z, 0.0f, 0.05f, 1.0f, 0.0f); + this->obj.pos.z -= 2.0f; break; case 1: - actor->fwork[29] = 10.0f; - actor->vel.z -= 100.0f; - if ((actor->obj.pos.z + gPathProgress) < -15000.0f) { - Object_Kill(&actor->obj, actor->sfxSource); + this->fwork[29] = 10.0f; + this->vel.z -= 100.0f; + if ((this->obj.pos.z + gPathProgress) < -15000.0f) { + Object_Kill(&this->obj, this->sfxSource); } break; } @@ -2323,7 +2336,7 @@ void ActorCutscene_Update(ActorCutscene* this) { break; case LEVEL_SECTOR_Z: - SectorZ_8019DD20(this); + SectorZ_LevelCompleteCsUpdate(this); break; case LEVEL_AREA_6: @@ -2460,19 +2473,19 @@ static Animation* D_demo_800CA1F4[] = { &D_SY_60265B4, &D_SY_602B8DC, &D_SY_60034C4, &D_SY_602A2CC, &D_SY_602CEB4, &D_SY_602B778, &D_SY_601F3B8, }; -void func_demo_8004FCB8(Actor* actor, s32 arg1) { +void func_demo_8004FCB8(ActorCutscene* this, s32 arg1) { f32 angle; f32 scale; s32 i; - if (actor->timer_0BC == 0) { - actor->timer_0BC = 32; - actor->fwork[5] = 0.3f; + if (this->timer_0BC == 0) { + this->timer_0BC = 32; + this->fwork[5] = 0.3f; } - if (actor->fwork[5] > 0.0f) { - scale = actor->fwork[5]; - actor->fwork[5] -= 0.05f; + if (this->fwork[5] > 0.0f) { + scale = this->fwork[5]; + this->fwork[5] -= 0.05f; RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 16, 16, 240, 255); @@ -2481,9 +2494,8 @@ void func_demo_8004FCB8(Actor* actor, s32 arg1) { for (i = arg1; i < (arg1 + 4); i++) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_demo_800CA110[i].x + actor->obj.pos.x, - D_demo_800CA110[i].y + actor->obj.pos.y, D_demo_800CA110[i].z + actor->obj.pos.z, - MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_demo_800CA110[i].x + this->obj.pos.x, D_demo_800CA110[i].y + this->obj.pos.y, + D_demo_800CA110[i].z + this->obj.pos.z, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, angle, MTXF_APPLY); Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2492,7 +2504,7 @@ void func_demo_8004FCB8(Actor* actor, s32 arg1) { } } -void ActorCutscene_Draw(Actor* actor) { +void ActorCutscene_Draw(ActorCutscene* this) { static f32 D_800CA210 = 0.0f; static f32 D_800CA214 = 0.0f; static f32 D_800CA218 = 0.0f; @@ -2512,26 +2524,26 @@ void ActorCutscene_Draw(Actor* actor) { f32 y; f32 x; - switch (actor->animFrame) { + switch (this->animFrame) { case 1000: RCP_SetupDL(&gMasterDisp, SETUPDL_45); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->unk_046); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_046); gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); - if (actor->unk_046 > 50) { - Actor_DrawEngineAndContrails(actor); + if (this->unk_046 > 50) { + Actor_DrawEngineAndContrails(this); } break; case 0: - func_edisplay_8005B388(actor); + func_edisplay_8005B388(this); break; case 1: if (gCurrentLevel == LEVEL_SECTOR_Z) { gSPFogPosition(gMasterDisp++, gFogNear, 1005); } - actor->info.bonus = 1; + this->info.bonus = 1; Cutscene_DrawGreatFox(); break; @@ -2547,12 +2559,12 @@ void ActorCutscene_Draw(Actor* actor) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); Matrix_Scale(gGfxMatrix, 60.0f, 60.0f, 1.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 10.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale, this->scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->iwork[0]); - gDPSetEnvColor(gMasterDisp++, 255, 255, 00, actor->iwork[0]); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->iwork[0]); + gDPSetEnvColor(gMasterDisp++, 255, 255, 00, this->iwork[0]); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -2562,42 +2574,42 @@ void ActorCutscene_Draw(Actor* actor) { case 24: gSPDisplayList(gMasterDisp++, D_D009A40); - Actor_DrawEngineAndContrails(actor); + Actor_DrawEngineAndContrails(this); break; case 25: - if ((actor->index % 2) != 0) { - gSPDisplayList(gMasterDisp++, D_SZ_6001DA0); + if ((this->index % 2) != 0) { + gSPDisplayList(gMasterDisp++, aSzSpaceJunk3DL); } else { - gSPDisplayList(gMasterDisp++, D_SZ_6001360); + gSPDisplayList(gMasterDisp++, aSzSpaceJunk1DL); } break; case 26: gSPDisplayList(gMasterDisp++, D_SZ_6004FE0); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); - Actor_DrawEngineGlow(actor, 2); + Actor_DrawEngineGlow(this, 2); break; case 28: gSPDisplayList(gMasterDisp++, D_ENMY_SPACE_400AAE0); Matrix_Translate(gGfxMatrix, 0.f, 0.f, -60.0f, MTXF_APPLY); - Actor_DrawEngineGlow(actor, 2); + Actor_DrawEngineGlow(this, 2); break; case 30: - Display_SetSecondLight(&actor->obj.pos); + Display_SetSecondLight(&this->obj.pos); - if (actor->unk_046 != 0) { + if (this->unk_046 != 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_55); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Rand_SetSeed(1, 29000, 9876); for (sp2D0 = 0; sp2D0 < 30; sp2D0++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], - RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], - RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, RAND_FLOAT_CENTERED_SEEDED(3000.0f) * this->fwork[20], + RAND_FLOAT_CENTERED_SEEDED(3000.0f) * this->fwork[20], + RAND_FLOAT_CENTERED_SEEDED(3000.0f) * this->fwork[20], MTXF_APPLY); Matrix_RotateY(gGfxMatrix, 2.0f * RAND_FLOAT_SEEDED(M_PI), MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (2.0f * gGameFrameCount) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, 2.0f * RAND_FLOAT_SEEDED(M_PI), MTXF_APPLY); @@ -2717,13 +2729,13 @@ void ActorCutscene_Draw(Actor* actor) { break; case 33: - if ((actor->index == 3) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { + if ((this->index == 3) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { gSPDisplayList(gMasterDisp++, D_D00B880); } else { gSPDisplayList(gMasterDisp++, aKaCornerianFighterDL); } Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); - Actor_DrawEngineGlow(actor, 0); + Actor_DrawEngineGlow(this, 0); break; case 34: @@ -2736,44 +2748,44 @@ void ActorCutscene_Draw(Actor* actor) { /* fallthrough */ case 39: gSPDisplayList(gMasterDisp++, D_SY_60097E0); - func_demo_8004FCB8(actor, 4); + func_demo_8004FCB8(this, 4); break; case 36: - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale, this->scale, this->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SY_601D730); - func_demo_8004FCB8(actor, 0); + func_demo_8004FCB8(this, 0); break; case 37: RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0, 0, actor->iwork[0], actor->iwork[1], actor->iwork[2], actor->iwork[3]); - gDPSetEnvColor(gMasterDisp++, actor->iwork[4], actor->iwork[5], actor->iwork[6], actor->iwork[7]); - Matrix_Scale(gGfxMatrix, actor->scale, actor->fwork[4], 1.0f, MTXF_APPLY); + gDPSetPrimColor(gMasterDisp++, 0, 0, this->iwork[0], this->iwork[1], this->iwork[2], this->iwork[3]); + gDPSetEnvColor(gMasterDisp++, this->iwork[4], this->iwork[5], this->iwork[6], this->iwork[7]); + Matrix_Scale(gGfxMatrix, this->scale, this->fwork[4], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; case 38: - animFrameData = Animation_GetFrameData(D_demo_800CA1F4[actor->iwork[4]], actor->iwork[5], sp144); - Math_SmoothStepToVec3fArray(sp144, actor->vwork, 1, animFrameData, actor->fwork[2], 100.0f, .0f); + animFrameData = Animation_GetFrameData(D_demo_800CA1F4[this->iwork[4]], this->iwork[5], sp144); + Math_SmoothStepToVec3fArray(sp144, this->vwork, 1, animFrameData, this->fwork[2], 100.0f, .0f); RCP_SetupDL_30(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0, 0, 150, 255, 150, 255); - Animation_DrawSkeleton(1, D_SY_602D140, actor->vwork, 0, 0, actor, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_SY_602D140, this->vwork, 0, 0, this, &gIdentityMatrix); - if (actor->fwork[0] != 0.0f) { + if (this->fwork[0] != 0.0f) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 32, 32, 255); Matrix_Translate(gGfxMatrix, 10.0f, -5.0f, -40.0f, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, (-actor->obj.rot.y) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (-this->obj.rot.y) * M_DTOR, MTXF_APPLY); Graphics_SetScaleMtx(1.0f); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[0], actor->fwork[0], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[0], this->fwork[0], this->fwork[0], MTXF_APPLY); - camX = gPlayer[0].cam.eye.x - actor->obj.pos.x; - camY = gPlayer[0].cam.eye.y - actor->obj.pos.y; - camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress); + camX = gPlayer[0].cam.eye.x - this->obj.pos.x; + camY = gPlayer[0].cam.eye.y - this->obj.pos.y; + camZ = gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress); y = -Math_Atan2F(camX, camZ); x = Math_Atan2F(camY, sqrtf(SQ(camZ) + SQ(camX))); @@ -2783,29 +2795,29 @@ void ActorCutscene_Draw(Actor* actor) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); - Math_SmoothStepToF(&actor->fwork[0], 0.0f, 0.1f, 0.2f, 0.05f); + Math_SmoothStepToF(&this->fwork[0], 0.0f, 0.1f, 0.2f, 0.05f); } - if (actor->fwork[6] != 0.0f) { + if (this->fwork[6] != 0.0f) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, (actor->obj.rot.y - 90.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (this->obj.rot.y - 90.0f) * M_DTOR, MTXF_NEW); sp2B8.x = 210.0f; sp2B8.y = 0.0f; sp2B8.z = 40.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp2B8, &sp2AC); - Matrix_Translate(gGfxMatrix, actor->obj.pos.x + sp2AC.x, actor->obj.pos.y + sp2AC.y, - actor->obj.pos.z + sp2AC.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, actor->fwork[6], actor->fwork[6], actor->fwork[6], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x + sp2AC.x, this->obj.pos.y + sp2AC.y, + this->obj.pos.z + sp2AC.z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[6], this->fwork[6], this->fwork[6], MTXF_APPLY); - camX = gPlayer[0].cam.eye.x - actor->obj.pos.x; - camY = gPlayer[0].cam.eye.y - actor->obj.pos.y; - camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress); + camX = gPlayer[0].cam.eye.x - this->obj.pos.x; + camY = gPlayer[0].cam.eye.y - this->obj.pos.y; + camZ = gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress); y = -Math_Atan2F(camX, camZ); x = Math_Atan2F(camY, sqrtf(SQ(camZ) + SQ(camX))); @@ -2815,7 +2827,7 @@ void ActorCutscene_Draw(Actor* actor) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); - Math_SmoothStepToF(&actor->fwork[6], 0.00f, 0.1f, 0.6f, 0); + Math_SmoothStepToF(&this->fwork[6], 0.00f, 0.1f, 0.6f, 0); } break; @@ -2824,7 +2836,7 @@ void ActorCutscene_Draw(Actor* actor) { break; case 41: - Aquas_801BE0F0(actor); + Aquas_801BE0F0(this); break; case 42: @@ -2834,28 +2846,28 @@ void ActorCutscene_Draw(Actor* actor) { case 43: RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, actor->iwork[0]); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->iwork[0]); gDPSetEnvColor(gMasterDisp++, 255, 192, 128, 255); Matrix_RotateY( gGfxMatrix, Math_Atan2F(gPlayer[0].cam.eye.x - gPlayer[0].cam.at.x, gPlayer[0].cam.eye.z - gPlayer[0].cam.at.z), MTXF_APPLY); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[0], actor->fwork[0], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[0], this->fwork[0], this->fwork[0], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); - if (actor->iwork[0] != 0) { - actor->iwork[0] -= 7; + if (this->iwork[0] != 0) { + this->iwork[0] -= 7; } - actor->fwork[0] += 0.2f; + this->fwork[0] += 0.2f; break; case 44: - Animation_GetFrameData(&D_AQ_6020A40, actor->iwork[0], actor->vwork); + Animation_GetFrameData(&D_AQ_6020A40, this->iwork[0], this->vwork); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Animation_DrawSkeleton(1, D_AQ_6020C6C, actor->vwork, 0, 0, &actor->index, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_AQ_6020C6C, this->vwork, 0, 0, &this->index, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; @@ -2882,9 +2894,9 @@ void Cutscene_DrawGreatFox(void) { f32 sp9C[4]; Gfx* var_fp; - (void) "Demo_Time=%d\n"; - (void) "Demo_Time=%d\n"; - (void) "d Enm->wrk0 %d\n"; + PRINTF("Demo_Time=%d\n"); + PRINTF("Demo_Time=%d\n"); + PRINTF("d Enm->wrk0 %d\n"); if (gGameState == GSTATE_TITLE) { var_fp = D_TITLE_60320E0; @@ -2933,6 +2945,7 @@ void Cutscene_DrawGreatFox(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 48); gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 48); + for (i = 0, var_s6_2 = D_demo_800CA0EC; i < 3; i++, var_s6_2++) { sp9C[i] = D_demo_800CA190[gGameFrameCount % 2U]; Matrix_Push(&gGfxMatrix); diff --git a/src/engine/fox_edata.c b/src/engine/fox_edata.c index c58f1357..56b5af5e 100644 --- a/src/engine/fox_edata.c +++ b/src/engine/fox_edata.c @@ -4,7 +4,7 @@ f32* D_edata_800CF964[] = { NULL }; // Likely a scrapped array of scenery shadow boxes -void func_edata_800594F0(Scenery* scenery) { +void Scenery48_Draw(Scenery* scenery) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -12,7 +12,7 @@ void func_edata_800594F0(Scenery* scenery) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edata_800595D0(Scenery* scenery) { +void Scenery49_Draw(Scenery* scenery) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -20,5 +20,5 @@ void func_edata_800595D0(Scenery* scenery) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edata_800596B0(Actor* actor) { +void Actor289_Draw(Actor* actor) { } diff --git a/src/engine/fox_edata_info.c b/src/engine/fox_edata_info.c index 3f551440..241d4b4e 100644 --- a/src/engine/fox_edata_info.c +++ b/src/engine/fox_edata_info.c @@ -93,72 +93,72 @@ f32 gWarpZoneEvent93Hitbox[] = { // clang-format off ObjectInfo gObjectInfo[] = { - /* OBJ_SCENERY_0, */ {(void*) D_CO_6015F00, 0, (ObjectFunc) NULL, D_CO_603E3E0, 800.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_1, */ {(void*) D_CO_602E9E0, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_2, */ {(void*) D_CO_601BEC0, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_3, */ {(void*) D_CO_602E7A0, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_4, */ {(void*) D_CO_60244A0, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_5, */ {(void*) D_CO_602E570, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_6, */ {(void*) D_CO_60132B0, 0, (ObjectFunc) NULL, D_CO_603DCA4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_7, */ {(void*) D_CO_602E080, 0, (ObjectFunc) NULL, D_CO_603DD40, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_8, */ {(void*) D_CO_60164F0, 0, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_9, */ {(void*) D_CO_6014500, 0, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_10, */ {(void*) D_CO_602D5F0, 0, (ObjectFunc) NULL, D_CO_603DDF0, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_11, */ {(void*) D_CO_601A7D0, 0, (ObjectFunc) NULL, D_CO_603DE8C, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_12, */ {(void*) D_CO_6014B50, 0, (ObjectFunc) NULL, D_CO_603DEF4, 500.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_13, */ {(void*) D_CO_6016580, 0, (ObjectFunc) NULL, D_CO_603DF8C, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_14, */ {(void*) D_CO_601B560, 0, (ObjectFunc) func_enmy_80066EA8, D_CO_603DFDC, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_15, */ {(void*) D_CO_60361F0, 0, (ObjectFunc) func_enmy_80066EA8, D_CO_603E014, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_16, */ {(void*) D_CO_6018E80, 0, (ObjectFunc) func_enmy_80066EA8, D_CO_603E030, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_17, */ {(void*) D_CO_6035F10, 0, (ObjectFunc) func_enmy_80066EA8, D_CO_603E09C, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_18, */ {(void*) Corneria_8018753C, 1, (ObjectFunc) Corneria_80187530, D_CO_603E98C, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_19, */ {(void*) D_CO_60153B0, 0, (ObjectFunc) NULL, D_CO_603E118, 100.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_20, */ {(void*) D_CO_601F5A0, 0, (ObjectFunc) NULL, D_CO_603E14C, 500.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_21, */ {(void*) D_CO_60137B0, 0, (ObjectFunc) NULL, D_CO_603E1B4, 400.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_22, */ {(void*) D_CO_6006A80, 0, (ObjectFunc) NULL, D_CO_603E21C, 400.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_23, */ {(void*) D_CO_6016270, 0, (ObjectFunc) NULL, D_CO_603E4A0, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_24, */ {(void*) D_CO_6010E00, 0, (ObjectFunc) NULL, D_CO_603E9EC, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_25, */ {(void*) D_CO_6014670, 0, (ObjectFunc) NULL, D_CO_603EA08, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_26, */ {(void*) D_CO_6010A50, 0, (ObjectFunc) NULL, D_CO_603EA74, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_27, */ {(void*) D_CO_60143E0, 0, (ObjectFunc) NULL, D_CO_603EAE0, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_28, */ {(void*) D_CO_6014A20, 0, (ObjectFunc) NULL, D_CO_603EB0C, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_SKULL, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60064FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_0, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006518, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_1, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006564, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_2, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60065B0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_3, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60065FC, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_4, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006648, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_5, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006694, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_6, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_60066E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_7, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_600672C, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_TI_RIB_8, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, D_TI_6006778, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_STONE_ARCH, */ {(void*) aCoStoneArchDL, 0, (ObjectFunc) NULL, aCoStoneArchHitbox, 800.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUMP_1, */ {(void*) aCoBump1DL, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUMP_2, */ {(void*) aCoBump2DL, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUMP_3, */ {(void*) aCoBump3DL, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUMP_4, */ {(void*) aCoBump4DL, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUMP_5, */ {(void*) aCoBump5DL, 0, (ObjectFunc) NULL, gNoHitbox, 3000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_1, */ {(void*) aCoHighway1DL, 0, (ObjectFunc) NULL, aCoHighway1Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_2, */ {(void*) aCoHighway2DL, 0, (ObjectFunc) NULL, aCoHighway2Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_3, */ {(void*) aCoHighway3DL, 0, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_4, */ {(void*) aCoHighway4DL, 0, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_1, */ {(void*) aCoBuilding1DL, 0, (ObjectFunc) NULL, aCoBuilding1Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_2, */ {(void*) aCoBuilding2DL, 0, (ObjectFunc) NULL, aCoBuilding2Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_3, */ {(void*) aCoBuilding3DL, 0, (ObjectFunc) NULL, aCoBuilding3Hitbox, 500.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_4, */ {(void*) aCoBuilding4DL, 0, (ObjectFunc) NULL, aCoBuilding4Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_5, */ {(void*) aCoBuilding5DL, 0, (ObjectFunc) SceneryRotateTowardsCamera, aCoBuilding5Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_6, */ {(void*) aCoBuilding6DL, 0, (ObjectFunc) SceneryRotateTowardsCamera, aCoBuilding6Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_7, */ {(void*) aCoBuilding7DL, 0, (ObjectFunc) SceneryRotateTowardsCamera, aCoBuilding7Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_8, */ {(void*) aCoBuilding8DL, 0, (ObjectFunc) SceneryRotateTowardsCamera, aCoBuilding8Hitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_ON_FIRE, */ {(void*) Corneria_BuildingOnFire_Draw, 1, (ObjectFunc) Corneria_BuildingOnFire_Update, aCoBuildingOnFireHitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_TOWER, */ {(void*) aCoTowerDL, 0, (ObjectFunc) NULL, aCoTowerHitbox, 100.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_ARCH_1, */ {(void*) aCoArch1DL, 0, (ObjectFunc) NULL, aCoArch1Hitbox, 500.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_ARCH_2, */ {(void*) aCoArch2DL, 0, (ObjectFunc) NULL, aCoArch2Hitbox, 400.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_ARCH_3, */ {(void*) aCoArch3DL, 0, (ObjectFunc) NULL, aCoArch3Hitbox, 400.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_RADAR, */ {(void*) aRadarDL, 0, (ObjectFunc) NULL, aCoRadarHitbox, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_5, */ {(void*) aCoHighway5DL, 0, (ObjectFunc) NULL, aCoHighway5Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_6, */ {(void*) aCoHighway6DL, 0, (ObjectFunc) NULL, aCoHighway6Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_7, */ {(void*) aCoHighway7DL, 0, (ObjectFunc) NULL, aCoHighway7Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_8, */ {(void*) aCoHighway8DL, 0, (ObjectFunc) NULL, aCoHighway8Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_HIGHWAY_9, */ {(void*) aCoHighway9DL, 0, (ObjectFunc) NULL, aCoHighway9Hitbox, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_SKULL, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiSkullHitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_0, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib0Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_1, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib1Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_2, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib2Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_3, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib3Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_4, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib4Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_5, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib5Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_6, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib6Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_7, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib7Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_TI_RIB_8, */ {(void*) Scenery_DrawTitaniaBones, 1, (ObjectFunc) Scenery_UpdateTitaniaBones, aTiRib8Hitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_ME_TUNNEL, */ {(void*) MeteoTunnel_Draw, 1, (ObjectFunc) MeteoTunnel_Update, gNoHitbox, 6000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_40, */ {(void*) func_edisplay_80059F68, 1, (ObjectFunc) func_enmy_80066D5C, D_CO_603E4A4, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_41, */ {(void*) func_edisplay_80059FDC, 1, (ObjectFunc) func_enmy_80066EA8, D_CO_603E4DC, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_42, */ {(void*) Scenery42_Draw, 1, (ObjectFunc) Scenery42_Update, D_CO_603E514, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_43, */ {(void*) D_ZO_6024AC0, 0, (ObjectFunc) NULL, D_ZO_602B9EC, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_9, */ {(void*) CoBuilding9_Draw, 1, (ObjectFunc) CoBuilding9_Update, aCoBuilding9Hitbox, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_BUILDING_10, */ {(void*) CoBuilding10_Draw, 1, (ObjectFunc) SceneryRotateTowardsCamera, aCoBuilding10Hitbox, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_IBEAM, */ {(void*) CoIBeam_Draw, 1, (ObjectFunc) CoIBeam_Update, aCoIBeamHitbox, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_ZO_ROCK_1, */ {(void*) aZoRock1DL, 0, (ObjectFunc) NULL, aZoRock1Hitbox, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_44, */ {(void*) D_ZO_600F560, 0, (ObjectFunc) NULL, D_ZO_602BA20, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_45, */ {(void*) D_ZO_600EC90, 0, (ObjectFunc) NULL, D_ZO_602BAE4, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_46, */ {(void*) D_ZO_600E820, 0, (ObjectFunc) NULL, D_ZO_602BBD8, 1500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_47, */ {(void*) D_ZO_601FCB0, 0, (ObjectFunc) NULL, D_ZO_602BC54, 500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_48, */ {(void*) func_edata_800594F0, 1, (ObjectFunc) NULL, D_VE1_601B4E0, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_49, */ {(void*) func_edata_800595D0, 1, (ObjectFunc) NULL, D_VE1_601B4FC, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_48, */ {(void*) Scenery48_Draw, 1, (ObjectFunc) NULL, D_VE1_601B4E0, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_49, */ {(void*) Scenery49_Draw, 1, (ObjectFunc) NULL, D_VE1_601B4FC, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_50, */ {(void*) D_VE1_6007410, 0, (ObjectFunc) NULL, D_VE1_601B518, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_51, */ {(void*) D_VE1_6006F50, 0, (ObjectFunc) NULL, D_VE1_601B584, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_52, */ {(void*) D_VE1_6005780, 0, (ObjectFunc) Venom1_80193540, D_VE1_601B5F4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_52, */ {(void*) D_VE1_6005780, 0, (ObjectFunc) Venom1_Scenery52_Update, D_VE1_601B5F4, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_53, */ {(void*) D_VE1_6003610, 0, (ObjectFunc) NULL, D_VE1_601B644, 2500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_54, */ {(void*) D_CO_6000E00, 0, (ObjectFunc) Scenery54_Update, D_CO_603E0EC, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_55, */ {(void*) D_CO_6013B50, 0, (ObjectFunc) NULL, D_CO_603E88C, 1000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_SCENERY_56, */ {(void*) Corneria_8018F31C, 2, (ObjectFunc) Corneria_8018F044, D_CO_603E8A8, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_SCENERY_57, */ {(void*) Titania_8018F8B8, 1, (ObjectFunc) Titania_8018F4D8, D_TI_6006BF0, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_WATERFALL, */ {(void*) aCoWaterfallDL, 0, (ObjectFunc) CoWaterfall_Update, aCoWaterfallHitbox, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_ROCKWALL, */ {(void*) aCoRockwallDL, 0, (ObjectFunc) NULL, aCoRockwallHitbox, 1000.0f, 0, 0, 41, 0, 0.0f, 0 }, + /* OBJ_SCENERY_CO_DOORS, */ {(void*) Corneria_Doors_Draw, 2, (ObjectFunc) Corneria_Doors_Update, aCoDoorsHitbox, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_SCENERY_57, */ {(void*) Titania_Scenery57_Draw, 1, (ObjectFunc) Titania_Scenery57_Update, D_TI_6006BF0, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_58, */ {(void*) D_TI1_700BE00, 0, (ObjectFunc) NULL, D_TI_6006C44, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_59, */ {(void*) D_MA_6024010, 0, (ObjectFunc) NULL, D_MA_603626C, 300.0f, 0, 0, 5, 0, 0.0f, 0 }, /* OBJ_SCENERY_60, */ {(void*) D_MA_6027180, 0, (ObjectFunc) NULL, D_MA_6036288, 400.0f, 0, 0, 5, 0, 0.0f, 0 }, - /* OBJ_SCENERY_61, */ {(void*) Macbeth_801A2A78, 1, (ObjectFunc) NULL, D_MA_60362A4, 200.0f, 0, 0, 5, 0, 0.0f, 0 }, + /* OBJ_SCENERY_61, */ {(void*) Macbeth_Scenery61_Draw, 1, (ObjectFunc) NULL, D_MA_60362A4, 200.0f, 0, 0, 5, 0, 0.0f, 0 }, /* OBJ_SCENERY_62, */ {(void*) D_MA_60270E0, 0, (ObjectFunc) NULL, gNoHitbox, 1500.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SCENERY_63, */ {(void*) D_MA_6013960, 0, (ObjectFunc) NULL, D_MA_6036894, 500.0f, 0, 0, 5, 0, 0.0f, 0 }, /* OBJ_SCENERY_64, */ {(void*) D_MA_600AF40, 0, (ObjectFunc) NULL, D_MA_60368E0, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_65, */ {(void*) Macbeth_801A6608, 1, (ObjectFunc) NULL, D_MA_6036724, 400.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_65, */ {(void*) Macbeth_Scenery65_Draw, 1, (ObjectFunc) NULL, D_MA_6036724, 400.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SCENERY_66, */ {(void*) D_MA_601F1D0, 0, (ObjectFunc) NULL, D_MA_60362D8, 2500.0f, 0, 0, 5, 0, 0.0f, 0 }, /* OBJ_SCENERY_67, */ {(void*) D_MA_60238F0, 0, (ObjectFunc) NULL, D_MA_6036328, 2000.0f, 0, 0, 5, 0, 0.0f, 0 }, /* OBJ_SCENERY_68, */ {(void*) D_MA_601B7C0, 0, (ObjectFunc) NULL, D_MA_60362F4, 2500.0f, 0, 0, 5, 0, 0.0f, 0 }, @@ -170,42 +170,42 @@ ObjectInfo gObjectInfo[] = { /* OBJ_SCENERY_74, */ {(void*) D_MA_602DC20, 0, (ObjectFunc) NULL, D_MA_603643C, 1000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SCENERY_75, */ {(void*) D_MA_601B0D0, 0, (ObjectFunc) NULL, D_MA_6036760, 3000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SCENERY_76, */ {(void*) D_MA_60075D0, 0, (ObjectFunc) NULL, gNoHitbox, 1000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_77, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, D_MA_6036344, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_78, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_79, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_80, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_81, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_82, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_83, */ {(void*) Macbeth_801A3240, 1, (ObjectFunc) Macbeth_801A2DD8, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_84, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_85, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_86, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_87, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_88, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_89, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_90, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_91, */ {(void*) Macbeth_801A2B24, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_92, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_93, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_94, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_95, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_96, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_97, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_98, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_99, */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_100 */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_101 */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_102 */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_103 */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_104 */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) Macbeth_801A0BD8, D_MA_6036594, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_105 */ {(void*) Macbeth_801A23AC, 1, (ObjectFunc) NULL, D_MA_6036204, 1300.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_77, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, D_MA_6036344, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_78, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_79, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_80, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_81, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_82, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_83, */ {(void*) Macbeth_Scenery83_Draw, 1, (ObjectFunc) Macbeth_Scenery83_Update, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_84, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_85, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_86, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_87, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_88, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_89, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_90, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_91, */ {(void*) Macbeth_SceneryDoodad2_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_92, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_93, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_94, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_95, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_96, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_97, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_98, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 15000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_99, */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_100 */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_101 */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_102 */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_103 */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_104 */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) Macbeth_Scenery104_Update, D_MA_6036594, 2500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SCENERY_105 */ {(void*) Macbeth_SceneryDoodad_Draw, 1, (ObjectFunc) NULL, D_MA_6036204, 1300.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SCENERY_106 */ {(void*) D_SY_60097E0, 0, (ObjectFunc) NULL, D_SY_6034478, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_107 */ {(void*) D_SY_601D730, 0, (ObjectFunc) NULL, D_SY_603450C, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_108 */ {(void*) D_SY_60102C0, 0, (ObjectFunc) NULL, D_SY_6034588, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_SCENERY_109 */ {(void*) D_SY_60036A0, 0, (ObjectFunc) SectorY_801A4E44, D_SY_6034664, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, + /* OBJ_SCENERY_109 */ {(void*) D_SY_60036A0, 0, (ObjectFunc) SectorY_Scenery109_Update, D_SY_6034664, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_110 */ {(void*) D_SY_6005360, 0, (ObjectFunc) NULL, D_SY_6034770, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_111 */ {(void*) Scenery111_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SCENERY_112 */ {(void*) D_SY_600F6C0, 0, (ObjectFunc) SectorY_801A52B8, D_SY_60347F0, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, + /* OBJ_SCENERY_112 */ {(void*) D_SY_600F6C0, 0, (ObjectFunc) SectorY_Scenery112_Update, D_SY_60347F0, 4000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_113 */ {(void*) D_SY_601B610, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_114 */ {(void*) D_SY_601C6A0, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_115 */ {(void*) D_SY_60188D0, 0, (ObjectFunc) NULL, D_SY_603486C, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, @@ -219,13 +219,13 @@ ObjectInfo gObjectInfo[] = { /* OBJ_SCENERY_123 */ {(void*) D_AQ_60120F0, 0, (ObjectFunc) NULL, D_AQ_6030E4C, 2000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_124 */ {(void*) D_AQ_600EEF0, 0, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_125 */ {(void*) D_AQ_600BF80, 0, (ObjectFunc) NULL, D_AQ_6030E68, 2000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_SCENERY_126 */ {(void*) Aquas_801BE1FC, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_SCENERY_127 */ {(void*) D_VE1_9005C80, 0, (ObjectFunc) Venom1_801924A8, D_VE1_601B678, 1000.0f, 0, 0, 42, 0, 0.0f, 0 }, + /* OBJ_SCENERY_126 */ {(void*) Aquas_Scenery126_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 2000.0f, 0, 0, 41, 0, 0.0f, 0 }, + /* OBJ_SCENERY_127 */ {(void*) D_VE1_9005C80, 0, (ObjectFunc) Venom1_Scenery127_Update, D_VE1_601B678, 1000.0f, 0, 0, 42, 0, 0.0f, 0 }, /* OBJ_SCENERY_128 */ {(void*) D_VE1_9003F50, 0, (ObjectFunc) NULL, D_VE1_601B6C4, 3200.0f, 0, 0, 42, 0, 0.0f, 0 }, /* OBJ_SCENERY_129 */ {(void*) D_VE1_900F060, 0, (ObjectFunc) NULL, D_VE1_601B710, 3200.0f, 0, 0, 42, 0, 0.0f, 0 }, /* OBJ_SCENERY_130 */ {(void*) D_VE1_900F1D0, 0, (ObjectFunc) NULL, D_VE1_601B75C, 3200.0f, 0, 0, 42, 0, 0.0f, 0 }, - /* OBJ_SCENERY_131 */ {(void*) Andross_801935D4, 1, (ObjectFunc) Andross_8019356C, D_ANDROSS_C038BD8, 500.0f, 0, 0, 41, 0, 0.0f, 0 }, - /* OBJ_SCENERY_132 */ {(void*) Andross_8019350C, 1, (ObjectFunc) Andross_80193380, D_ANDROSS_C038A48, 500.0f, 0, 0, 41, 0, 0.0f, 0 }, + /* OBJ_SCENERY_131 */ {(void*) Andross_Scenery131_Draw, 1, (ObjectFunc) Andross_Scenery131_Update, D_ANDROSS_C038BD8, 500.0f, 0, 0, 41, 0, 0.0f, 0 }, + /* OBJ_SCENERY_132 */ {(void*) Andross_Scenery132_Draw, 1, (ObjectFunc) Andross_Scenery132_Update, D_ANDROSS_C038A48, 500.0f, 0, 0, 41, 0, 0.0f, 0 }, /* OBJ_SCENERY_133 */ {(void*) D_TR_60030F0, 0, (ObjectFunc) NULL, D_TR_6009CC4, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, /* OBJ_SCENERY_134 */ {(void*) D_VE2_6003000, 0, (ObjectFunc) NULL, D_ANDROSS_C038BA4, 0.0f, 0, 0, 41, 1, 0.0f, 0 }, /* OBJ_SCENERY_135 */ {(void*) D_VE2_6006890, 0, (ObjectFunc) NULL, D_ANDROSS_C038B40, 0.0f, 0, 0, 41, 1, 0.0f, 0 }, @@ -249,172 +249,172 @@ ObjectInfo gObjectInfo[] = { /* OBJ_SCENERY_153 */ {(void*) D_BO_600B8B0, 0, (ObjectFunc) NULL, D_BO_6011C48, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_154 */ {(void*) aKaFLBaseDL, 0, (ObjectFunc) NULL, D_KA_601115C, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_155 */ {(void*) NULL, 0, (ObjectFunc) NULL, gNoHitbox, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_156 */ {(void*) SectorY_80197CB8, 1, (ObjectFunc) NULL, D_SY_6034368, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_157 */ {(void*) D_SZ_6001DA0, 0, (ObjectFunc) NULL, D_SZ_600924C, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SCENERY_158 */ {(void*) D_SZ_6001360, 0, (ObjectFunc) NULL, D_SZ_60092E8, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_156 */ {(void*) SectorY_Scenery156_Draw, 1, (ObjectFunc) NULL, D_SY_6034368, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_157 */ {(void*) aSzSpaceJunk3DL, 0, (ObjectFunc) NULL, D_SZ_600924C, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SCENERY_158 */ {(void*) aSzSpaceJunk1DL, 0, (ObjectFunc) NULL, D_SZ_60092E8, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_159 */ {(void*) D_VE2_6008370, 0, (ObjectFunc) NULL, D_VE2_601668C, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SCENERY_160 */ {(void*) D_VE2_6010960, 0, (ObjectFunc) NULL, D_VE2_6016714, 0.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SPRITE_CO_POLE */ {(void*) D_CO_602F7C0, 0, (ObjectFunc) Sprite_UpdateDoodad, D_CO_603E468, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SPRITE_CO_TREE */ {(void*) D_CO_601C9B0, 0, (ObjectFunc) Sprite_UpdateDoodad, D_CO_603E484, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SPRITE_FO_POLE */ {(void*) D_FO_600A420, 0, (ObjectFunc) Sprite_UpdateDoodad, D_FO_600FE9C, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SPRITE_CO_POLE */ {(void*) aCoPoleDL, 0, (ObjectFunc) Sprite_UpdateDoodad, aCoPoleHitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SPRITE_CO_TREE */ {(void*) aCoTreeDL, 0, (ObjectFunc) Sprite_UpdateDoodad, aCoTreeHitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_SPRITE_FO_POLE */ {(void*) aFoPoleDL, 0, (ObjectFunc) Sprite_UpdateDoodad, aFoPoleHitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SPRITE_FOG_SHADOW */ {(void*) FogShadow_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 1800.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SPRITE_CO_RUIN1 */ {(void*) D_CO_602DCA0, 0, (ObjectFunc) NULL, gNoHitbox, -100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SPRITE_CO_RUIN2 */ {(void*) D_CO_601F500, 0, (ObjectFunc) NULL, gNoHitbox, -100.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SPRITE_167 */ {(void*) Sprite167_Draw, 1, (ObjectFunc) Sprite167_Update, gNoHitbox, 500.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_SPRITE_168 */ {(void*) Sprite168_Draw, 1, (ObjectFunc) NULL, gNoHitbox, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_SPRITE_TI_CACTUS */ {(void*) D_TI_60023B0, 0, (ObjectFunc) Titania_Cactus_Update, D_TI_60068BC, 100.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_SPRITE_CO_SMOKE */ {(void*) NULL, 1, (ObjectFunc) Corneria_801875A4, gNoHitbox, 0.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SPRITE_TI_CACTUS */ {(void*) aTiCactusDL, 0, (ObjectFunc) Titania_Cactus_Update, aTiCactusHitbox, 100.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_SPRITE_CO_SMOKE */ {(void*) NULL, 1, (ObjectFunc) Corneria_Smoke_Update, gNoHitbox, 0.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SPRITE_VE1_BOSS_TRIGGER1 */ {(void*) NULL, 1, (ObjectFunc) Venom1_BossTrigger1_Update, gNoHitbox, 0.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SPRITE_VE1_BOSS_TRIGGER2 */ {(void*) NULL, 1, (ObjectFunc) Venom1_BossTrigger2_Update, gNoHitbox, 0.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SPRITE_VE1_BOSS_TRIGGER3 */ {(void*) NULL, 1, (ObjectFunc) Venom1_BossTrigger3_Update, gNoHitbox, 0.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SPRITE_VE1_BOSS_TRIGGER4 */ {(void*) NULL, 1, (ObjectFunc) Venom1_BossTrigger4_Update, gNoHitbox, 0.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_SPRITE_GFOX_TARGET */ {(void*) NULL, 1, (ObjectFunc) NULL, gNoHitbox, 1000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ACTOR_176 */ {(void*) Corneria_8018BAAC, 2, (ObjectFunc) Corneria_8018AED0, D_CO_603E5D0, 500.0f, 0, 0, 39, 1, 200.0f, 1 }, - /* OBJ_ACTOR_177 */ {(void*) Corneria_8018BBA4, 2, (ObjectFunc) Corneria_8018B15C, D_CO_603E5D0, 500.0f, 0, 0, 39, 1, 200.0f, 1 }, - /* OBJ_ACTOR_178 */ {(void*) Corneria_8018BBF8, 2, (ObjectFunc) Corneria_8018B418, D_CO_603E5D0, 500.0f, 0, 0, 39, 1, 200.0f, 1 }, - /* OBJ_ACTOR_179 */ {(void*) Corneria_8018BD7C, 2, (ObjectFunc) Corneria_8018B58C, D_CO_603E604, 500.0f, 0, 0, 39, 1, 0.0f, 1 }, - /* OBJ_ACTOR_180 */ {(void*) func_edisplay_8005B6A4, 1, (ObjectFunc) func_enmy_80066A80, gNoHitbox, 1000.0f, 0, 0, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_181 */ {(void*) D_ME_6018C00, 0, (ObjectFunc) Meteo_8018756C, D_ME_602F6EC, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_182 */ {(void*) func_edisplay_8005B71C, 1, (ObjectFunc) Meteo_80187650, D_ME_602F708, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_183 */ {(void*) Meteo_8018DA6C, 1, (ObjectFunc) Meteo_8018D9EC, gNoHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_184 */ {(void*) Meteo_8018DAEC, 1, (ObjectFunc) Meteo_8018D9EC, gNoHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_185 */ {(void*) Meteo_8018DB6C, 1, (ObjectFunc) Meteo_8018D9EC, gNoHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 1 }, - /* OBJ_ACTOR_186 */ {(void*) func_edisplay_8005B7CC, 1, (ObjectFunc) Meteo_8018795C, D_ME_602F724, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_187 */ {(void*) D_ME_6018450, 0, (ObjectFunc) Meteo_801877C4, D_ME_602F740, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_188 */ {(void*) Aquas_801BEC74, 1, (ObjectFunc) Aquas_801BEC68, D_AQ_6030BE0, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_CO_GARUDA_1 */ {(void*) Corneria_CoGaruda1_Draw, 2, (ObjectFunc) Corneria_CoGaruda1_Update, CoGarudaHitbox, 500.0f, 0, 0, 39, 1, 200.0f, 1 }, + /* OBJ_ACTOR_CO_GARUDA_2 */ {(void*) Corneria_CoGaruda2_Draw, 2, (ObjectFunc) Corneria_CoGaruda2_Update, CoGarudaHitbox, 500.0f, 0, 0, 39, 1, 200.0f, 1 }, + /* OBJ_ACTOR_CO_GARUDA_3 */ {(void*) Corneria_CoGaruda3_Draw, 2, (ObjectFunc) Corneria_CoGaruda3_Update, CoGarudaHitbox, 500.0f, 0, 0, 39, 1, 200.0f, 1 }, + /* OBJ_ACTOR_CO_GARUDA_DESTROY */ {(void*) Corneria_CoGarudaDestroy_Draw, 2, (ObjectFunc) Corneria_CoGarudaDestroy_Update, aCoGarudaDestroyHitbox, 500.0f, 0, 0, 39, 1, 0.0f, 1 }, + /* OBJ_ACTOR_180 */ {(void*) Actor180_Draw, 1, (ObjectFunc) Actor180_Update, gNoHitbox, 1000.0f, 0, 0, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_181 */ {(void*) D_ME_6018C00, 0, (ObjectFunc) Meteo_Actor181_Update, D_ME_602F6EC, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_182 */ {(void*) Actor182_Draw, 1, (ObjectFunc) Meteo_Actor182_Update, D_ME_602F708, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_183 */ {(void*) Meteo_Actor183_Draw, 1, (ObjectFunc) Meteo_ActorDoodad_Update, gNoHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_184 */ {(void*) Meteo_Actor184_Draw, 1, (ObjectFunc) Meteo_ActorDoodad_Update, gNoHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_185 */ {(void*) Meteo_Actor185_Draw, 1, (ObjectFunc) Meteo_ActorDoodad_Update, gNoHitbox, 100.0f, 0, 1, 39, 0, 0.0f, 1 }, + /* OBJ_ACTOR_186 */ {(void*) Actor186_Draw, 1, (ObjectFunc) Meteo_Actor186_Update, D_ME_602F724, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_187 */ {(void*) D_ME_6018450, 0, (ObjectFunc) Meteo_Actor187_Update, D_ME_602F740, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_188 */ {(void*) Aquas_Actor188_Draw, 1, (ObjectFunc) Aquas_Actor188_Update, D_AQ_6030BE0, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_DEBRIS */ {(void*) ActorDebris_Draw, 1, (ObjectFunc) ActorDebris_Update, gNoHitbox, 0.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_190 */ {(void*) func_edisplay_8005B848, 1, (ObjectFunc) func_enmy_800656D4, gActor190_191Hitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, - /* OBJ_ACTOR_191 */ {(void*) func_edisplay_8005B848, 1, (ObjectFunc) func_enmy_800656D4, gActor190_191Hitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, - /* OBJ_ACTOR_192 */ {(void*) func_edisplay_8005B9A4, 1, (ObjectFunc) func_enmy_8006654C, D_CO_603E54C, 200.0f, 0, 1, 39, 0, 50.0f, 1 }, - /* OBJ_ACTOR_193 */ {(void*) func_edisplay_8005BA30, 1, (ObjectFunc) func_enmy_800669A0, D_CO_603E598, 100.0f, 0, 1, 39, 0, 0.0f, 0 }, + /* OBJ_MISSILE_SEEK_TEAM */ {(void*) Actor190_191_Draw, 1, (ObjectFunc) Actors190_191_Update, gActor190_191Hitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, + /* OBJ_MISSILE_SEEK_PLAYER */ {(void*) Actor190_191_Draw, 1, (ObjectFunc) Actors190_191_Update, gActor190_191Hitbox, 100.0f, 0, 1, 39, 0, 1.0f, 0 }, + /* OBJ_ACTOR_192 */ {(void*) Actor192_Draw, 1, (ObjectFunc) Actor192_Update, D_CO_603E54C, 200.0f, 0, 1, 39, 0, 50.0f, 1 }, + /* OBJ_ACTOR_193 */ {(void*) Actor193_Draw, 1, (ObjectFunc) Actor193_Update, D_CO_603E598, 100.0f, 0, 1, 39, 0, 0.0f, 0 }, /* OBJ_ACTOR_194 */ {(void*) Actor194_Draw, 1, (ObjectFunc) Actor194_Update, gActor194Hitbox, 200.0f, 0, 1, 39, 0, 0.0f, 1 }, /* OBJ_ACTOR_CUTSCENE */ {(void*) ActorCutscene_Draw, 1, (ObjectFunc) ActorCutscene_Update, gNoHitbox, 20000.0f, 0, 1, 39, 0, 0.0f, 0 }, /* OBJ_ACTOR_196 */ {(void*) Actor196_Draw, 1, (ObjectFunc) Actor196_Update, D_CO_603E5B4, 200.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_ALLRANGE */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorAllRange_Update, gActorAllRangeHItbox, 20000.0f, 0, 1, 39, 1, 1.0f, 1 }, /* OBJ_ACTOR_TEAM_BOSS */ {(void*) ActorAllRange_Draw, 1, (ObjectFunc) ActorTeamBoss_Update, gTeamHitbox, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, - /* OBJ_ACTOR_199 */ {(void*) Andross_80188448, 1, (ObjectFunc) Andross_801880E4, gNoHitbox, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, + /* OBJ_ACTOR_199 */ {(void*) Andross_Actor199_Draw, 1, (ObjectFunc) Andross_Actor199_Update, gNoHitbox, 20000.0f, 0, 0, 39, 1, 0.0f, 0 }, /* OBJ_ACTOR_EVENT */ {(void*) ActorEvent_Draw, 1, (ObjectFunc) ActorEvent_Update, gNoHitbox, 2000.0f, 0, 1, 39, 0, 0.0f, 1 }, /* OBJ_ACTOR_201 */ {(void*) Actor201_Draw, 1, (ObjectFunc) Actor201_Update, D_ME_602F684, 100.0f, 0, 1, 39, 0, 1.0f, 1 }, /* OBJ_ACTOR_202 */ {(void*) Actor202_Draw, 1, (ObjectFunc) Actor202_Update, D_ME_602F6A0, 100.0f, 0, 1, 39, 0, 180.0f, 1 }, - /* OBJ_ACTOR_SLIPPY_SX */ {(void*) SectorX_8018F884, 1, (ObjectFunc) SectorX_8018F330, gNoHitbox, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_SLIPPY_SX */ {(void*) SectorX_Slippy_Draw, 1, (ObjectFunc) SectorX_Slippy_Update, gNoHitbox, 1000.0f, 0, 0, 39, 0, 0.0f, 0 }, /* OBJ_ACTOR_204 */ {(void*) SectorY_Actor204_Draw, 1, (ObjectFunc) SectorY_Actor204_Update, D_SY_603405C, 1000.0f, 0, 0, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_205 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019C778, D_MA_60359C8, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_206 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_801AC438, D_MA_6035A48, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_207 */ {(void*) Macbeth_801AC294, 2, (ObjectFunc) Macbeth_801A7E7C, D_MA_603677C, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_208 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019EA60, D_MA_6035A14, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_209 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019D700, D_MA_6035AE0, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_210 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019CE88, D_MA_6035D9C, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_211 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019E410, D_MA_6035E04, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_212 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019FF9C, D_MA_60360C0, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_213 */ {(void*) Macbeth_801A12C4, 1, (ObjectFunc) Macbeth_8019EE68, D_MA_6036154, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_214 */ {(void*) Macbeth_801A43BC, 1, (ObjectFunc) Macbeth_801A3E98, D_MA_6036458, 300.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_215 */ {(void*) Macbeth_801A4A64, 1, (ObjectFunc) Macbeth_801A46A0, D_MA_60364C0, 300.0f, 0, 1, 40, 1, 0.0f, 1 }, - /* OBJ_ACTOR_216 */ {(void*) Macbeth_801A5F90, 1, (ObjectFunc) Macbeth_801A5E54, D_MA_60366EC, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_217 */ {(void*) Macbeth_801A6100, 1, (ObjectFunc) Macbeth_801A5FD0, D_MA_6036708, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_218 */ {(void*) Macbeth_801A6540, 1, (ObjectFunc) Macbeth_801A6144, D_MA_6036728, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_219 */ {(void*) Macbeth_801A68EC, 1, (ObjectFunc) Macbeth_801A67C8, D_MA_6036744, 300.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_220 */ {(void*) Macbeth_801ADAC8, 1, (ObjectFunc) Macbeth_801AD6F0, D_MA_6036930, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_221 */ {(void*) Macbeth_801AE2C0, 1, (ObjectFunc) Macbeth_801ADD68, D_MA_603694C, 300.0f, 0, 0, 40, 1, 1.0f, 0 }, - /* OBJ_ACTOR_222 */ {(void*) Macbeth_801AEEFC, 1, (ObjectFunc) Macbeth_801AEC04, D_MA_6036968, 300.0f, 0, 0, 40, 1, 1.0f, 0 }, - /* OBJ_ACTOR_223 */ {(void*) Macbeth_801A54E8, 1, (ObjectFunc) Macbeth_801A4B24, D_MA_60364DC, 300.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_224 */ {(void*) NULL, 1, (ObjectFunc) Titania_80189194, gNoHitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, - /* OBJ_ACTOR_225 */ {(void*) D_TI1_700AB70, 0, (ObjectFunc) Titania_8018AB44, D_TI_60064AC, 50.0f, 0, 0, 39, 1, 1.0f, 0 }, - /* OBJ_ACTOR_226 */ {(void*) Titania_80189AFC, 1, (ObjectFunc) Titania_801895B8, D_TI_60064C8, 300.0f, 0, 0, 39, 1, 70.0f, 1 }, - /* OBJ_ACTOR_227 */ {(void*) Titania_8018E5B4, 1, (ObjectFunc) Titania_8018E54C, D_TI_60067C4, 0.0f, 0, 0, 39, 1, 0.0f, 0 }, - /* OBJ_ACTOR_228 */ {(void*) Titania_8018EF14, 1, (ObjectFunc) Titania_8018E5F8, D_TI_6006808, 0.0f, 0, 0, 39, 1, 1.0f, 1 }, - /* OBJ_ACTOR_229 */ {(void*) Titania_8018E2D8, 1, (ObjectFunc) Titania_8018C8A8, D_TI_6006A3C, 1000.0f, 0, 0, 20, 1, 0.0f, 1 }, - /* OBJ_ACTOR_230 */ {(void*) Titania_8018AABC, 1, (ObjectFunc) Titania_8018A544, D_TI_600683C, 0.0f, 0, 1, 39, 1, 0.0f, 1 }, - /* OBJ_ACTOR_231 */ {(void*) Titania_8018BE84, 1, (ObjectFunc) Titania_8018B9D0, D_TI_6006858, 0.0f, 0, 0, 39, 1, 0.0f, 1 }, - /* OBJ_ACTOR_232 */ {(void*) Titania_8018B6AC, 1, (ObjectFunc) Titania_8018B268, D_TI_6006890, 0.0f, 0, 0, 39, 1, 20.0f, 1 }, - /* OBJ_ACTOR_233 */ {(void*) Titania_8018A1C0, 1, (ObjectFunc) Titania_80189CC8, D_TI_60068F0, 200.0f, 0, 0, 39, 1, 1.0f, 1 }, + /* OBJ_ACTOR_205 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor205_Update, D_MA_60359C8, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_206 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor206_Update, D_MA_6035A48, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_207 */ {(void*) Macbeth_Actor207_Draw, 2, (ObjectFunc) Macbeth_Actor207_Update, D_MA_603677C, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_208 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor208_Update, D_MA_6035A14, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_209 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor209_Update, D_MA_6035AE0, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_210 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor210_Update, D_MA_6035D9C, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_211 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor211_Update, D_MA_6035E04, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_212 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor212_Update, D_MA_60360C0, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_213 */ {(void*) Macbeth_ActorDoodad_Draw, 1, (ObjectFunc) Macbeth_Actor213_Update, D_MA_6036154, 20000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_214 */ {(void*) Macbeth_Actor214_Draw, 1, (ObjectFunc) Macbeth_Actor214_Update, D_MA_6036458, 300.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_215 */ {(void*) Macbeth_Actor215_Draw, 1, (ObjectFunc) Macbeth_Actor215_Update, D_MA_60364C0, 300.0f, 0, 1, 40, 1, 0.0f, 1 }, + /* OBJ_ACTOR_216 */ {(void*) Macbeth_Actor216_Draw, 1, (ObjectFunc) Macbeth_Actor216_Update, D_MA_60366EC, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_217 */ {(void*) Macbeth_Actor217_Draw, 1, (ObjectFunc) Macbeth_Actor217_Update, D_MA_6036708, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_218 */ {(void*) Macbeth_Actor218_Draw, 1, (ObjectFunc) Macbeth_Actor218_Update, D_MA_6036728, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_219 */ {(void*) Macbeth_Actor219_Draw, 1, (ObjectFunc) Macbeth_Actor219_Update, D_MA_6036744, 300.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_220 */ {(void*) Macbeth_Actor220_Draw, 1, (ObjectFunc) Macbeth_Actor220_Update, D_MA_6036930, 200.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_221 */ {(void*) Macbeth_Actor221_Draw, 1, (ObjectFunc) Macbeth_Actor221_Update, D_MA_603694C, 300.0f, 0, 0, 40, 1, 1.0f, 0 }, + /* OBJ_ACTOR_222 */ {(void*) Macbeth_Actor222_Draw, 1, (ObjectFunc) Macbeth_Actor222_Update, D_MA_6036968, 300.0f, 0, 0, 40, 1, 1.0f, 0 }, + /* OBJ_ACTOR_223 */ {(void*) Macbeth_Actor223_Draw, 1, (ObjectFunc) Macbeth_Actor223_Update, D_MA_60364DC, 300.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_224 */ {(void*) NULL, 1, (ObjectFunc) Titania_Actor224_Update, gNoHitbox, 200.0f, 0, 0, 39, 0, 0.0f, 0 }, + /* OBJ_ACTOR_225 */ {(void*) D_TI1_700AB70, 0, (ObjectFunc) Titania_Actor225_Update, D_TI_60064AC, 50.0f, 0, 0, 39, 1, 1.0f, 0 }, + /* OBJ_ACTOR_226 */ {(void*) Titania_Actor226_Draw, 1, (ObjectFunc) Titania_Actor226_Update, D_TI_60064C8, 300.0f, 0, 0, 39, 1, 70.0f, 1 }, + /* OBJ_ACTOR_227 */ {(void*) Titania_Actor227_Draw, 1, (ObjectFunc) Titania_Actor227_Update, D_TI_60067C4, 0.0f, 0, 0, 39, 1, 0.0f, 0 }, + /* OBJ_ACTOR_228 */ {(void*) Titania_Actor228_Draw, 1, (ObjectFunc) Titania_Actor228_Update, D_TI_6006808, 0.0f, 0, 0, 39, 1, 1.0f, 1 }, + /* OBJ_ACTOR_229 */ {(void*) Titania_Actor229_Draw, 1, (ObjectFunc) Titania_Actor229_Update, D_TI_6006A3C, 1000.0f, 0, 0, 20, 1, 0.0f, 1 }, + /* OBJ_ACTOR_230 */ {(void*) Titania_Actor230_Draw, 1, (ObjectFunc) Titania_Actor230_Update, D_TI_600683C, 0.0f, 0, 1, 39, 1, 0.0f, 1 }, + /* OBJ_ACTOR_231 */ {(void*) Titania_Actor231_Draw, 1, (ObjectFunc) Titania_Actor231_Update, D_TI_6006858, 0.0f, 0, 0, 39, 1, 0.0f, 1 }, + /* OBJ_ACTOR_232 */ {(void*) Titania_Actor232_Draw, 1, (ObjectFunc) Titania_Actor232_Update, D_TI_6006890, 0.0f, 0, 0, 39, 1, 20.0f, 1 }, + /* OBJ_ACTOR_233 */ {(void*) Titania_Actor233_Draw, 1, (ObjectFunc) Titania_Actor233_Update, D_TI_60068F0, 200.0f, 0, 0, 39, 1, 1.0f, 1 }, /* OBJ_ACTOR_234 */ {(void*) Actor234_Draw, 1, (ObjectFunc) Actor234_Update, gNoHitbox, 2000.0f, 0, 0, 39, 0, 0.0f, 5 }, - /* OBJ_ACTOR_235 */ {(void*) Zoness_80190430, 2, (ObjectFunc) Zoness_801904CC, D_ZO_602C294, 1000.0f, 0, 1, 40, 0, 1.0f, 1 }, - /* OBJ_ACTOR_236 */ {(void*) Zoness_80190F08, 1, (ObjectFunc) Zoness_80190A00, D_ZO_602BC58, 5000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_235 */ {(void*) Zoness_Actor235_Draw, 2, (ObjectFunc) Zoness_Actor235_Update, D_ZO_602C294, 1000.0f, 0, 1, 40, 0, 1.0f, 1 }, + /* OBJ_ACTOR_236 */ {(void*) Zoness_Actor236_Draw, 1, (ObjectFunc) Zoness_Actor236_Update, D_ZO_602BC58, 5000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_ACTOR_237 */ {(void*) Actor237_Draw, 1, (ObjectFunc) Actor237_Update, gNoHitbox, 200.0f, 0, 0, 40, 0, 0.0f, 2 }, - /* OBJ_ACTOR_238 */ {(void*) Zoness_801914C4, 2, (ObjectFunc) Zoness_80191010, gCubeHitbox100, 200.0f, 0, 1, 40, 0, 1.0f, 1 }, + /* OBJ_ACTOR_238 */ {(void*) Zoness_Actor238_Draw, 2, (ObjectFunc) Zoness_Actor238_Update, gCubeHitbox100, 200.0f, 0, 1, 40, 0, 1.0f, 1 }, /* OBJ_ACTOR_239 */ {(void*) NULL, 1, (ObjectFunc) NULL, gNoHitbox, 1000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ACTOR_240 */ {(void*) Zoness_80191B4C, 1, (ObjectFunc) Zoness_80191680, gCubeHitbox100, 1500.0f, 0, 1, 40, 0, 20.0f, 0 }, - /* OBJ_ACTOR_241 */ {(void*) Zoness_80191DB0, 1, (ObjectFunc) Zoness_80191BC4, gActor241Hitbox, 1500.0f, 0, 1, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_242 */ {(void*) Zoness_80191FFC, 2, (ObjectFunc) Zoness_80192094, D_ZO_602BE3C, 500.0f, 0, 0, 40, 0, 1.0f, 0 }, - /* OBJ_ACTOR_243 */ {(void*) Zoness_80192C18, 2, (ObjectFunc) Zoness_80192834, gCubeHitbox100, 0.0f, 0, 1, 40, 0, 1.0f, 1 }, - /* OBJ_ACTOR_244 */ {(void*) Zoness_80193240, 2, (ObjectFunc) Zoness_80192E64, D_ZO_602BE58, 2000.0f, 0, 0, 40, 0, 50.0f, 0 }, - /* OBJ_ACTOR_245 */ {(void*) Zoness_8019983C, 1, (ObjectFunc) Zoness_8019969C, gCubeHitbox100, 200.0f, 0, 0, 40, 0, 1.0f, 0 }, - /* OBJ_ACTOR_246 */ {(void*) Zoness_80199E24, 1, (ObjectFunc) Zoness_80199A28, gCubeHitbox100, 2000.0f, 0, 0, 40, 0, 1.0f, 0 }, - /* OBJ_ACTOR_247 */ {(void*) Zoness_8019D3C4, 1, (ObjectFunc) Zoness_8019D15C, D_ZO_602BFC4, 500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_248 */ {(void*) Zoness_8019A1FC, 1, (ObjectFunc) Zoness_80199F10, gCubeHitbox150, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_249 */ {(void*) Zoness_8019ACCC, 1, (ObjectFunc) Zoness_8019A5D4, gCubeHitbox200, 5000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_250 */ {(void*) Zoness_8019B7DC, 1, (ObjectFunc) Zoness_8019B548, D_ZO_602C1D4, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_251 */ {(void*) Zoness_8019BDE0, 2, (ObjectFunc) Zoness_8019B854, D_ZO_602C218, 1000.0f, 0, 0, 40, 0, 1.0f, 1 }, - /* OBJ_ACTOR_252 */ {(void*) Zoness_8019C1CC, 1, (ObjectFunc) Zoness_8019BE48, D_ZO_602C234, 200.0f, 0, 0, 40, 0, 80.0f, 1 }, - /* OBJ_ACTOR_253 */ {(void*) Zoness_8019C83C, 1, (ObjectFunc) Zoness_8019C454, D_ZO_602C250, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_254 */ {(void*) Zoness_8019CE58, 1, (ObjectFunc) Zoness_8019CBEC, D_ZO_602C2B0, 300.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ACTOR_255 */ {(void*) Aquas_801AE168, 1, (ObjectFunc) Aquas_801AD6C0, D_AQ_6030BFC, 500.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_256 */ {(void*) Aquas_801AEB44, 1, (ObjectFunc) Aquas_801AE3D8, D_AQ_6030C18, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_257 */ {(void*) Aquas_801B099C, 1, (ObjectFunc) Aquas_801AFA5C, D_AQ_6030C44, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_258 */ {(void*) Aquas_801B0EC0, 1, (ObjectFunc) Aquas_801B0B60, gCubeHitbox100, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_259 */ {(void*) Aquas_801B619C, 2, (ObjectFunc) Aquas_801B638C, D_AQ_6031398, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_260 */ {(void*) Aquas_801B90DC, 2, (ObjectFunc) Aquas_801B7C78, D_AQ_60313CC, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_261 */ {(void*) Aquas_801B504C, 2, (ObjectFunc) Aquas_801B50E8, D_AQ_6031400, 300.0f, 0, 0, 40, 0, 0.0f, 1 }, - /* OBJ_ACTOR_262 */ {(void*) Aquas_801B7A24, 2, (ObjectFunc) Aquas_801B6FF8, D_AQ_603144C, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_263 */ {(void*) Aquas_801BA108, 2, (ObjectFunc) Aquas_801B91A4, D_AQ_6031480, 200.0f, 0, 0, 40, 0, 0.0f, 1 }, - /* OBJ_ACTOR_264 */ {(void*) Aquas_801BA4E4, 1, (ObjectFunc) Aquas_801BA26C, gCubeHitbox100, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ACTOR_265 */ {(void*) Aquas_801BAD7C, 1, (ObjectFunc) Aquas_801BA6A4, D_AQ_6031500, 200.0f, 0, 0, 40, 0, 0.0f, 1 }, - /* OBJ_ACTOR_266 */ {(void*) Aquas_801BB204, 2, (ObjectFunc) Aquas_801BADF8, D_AQ_6031538, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ACTOR_267 */ {(void*) Aquas_801BC930, 2, (ObjectFunc) Aquas_801BB79C, D_AQ_6031554, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_268 */ {(void*) Aquas_801BDE6C, 1, (ObjectFunc) Aquas_801BD54C, D_AQ_6031570, 10000.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ACTOR_269 */ {(void*) Aquas_801BD264, 1, (ObjectFunc) Aquas_801BC9A0, D_AQ_6030D20, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_270 */ {(void*) Aquas_801BEB1C, 1, (ObjectFunc) Aquas_801BE3F8, D_AQ_60314C8, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_240 */ {(void*) Zoness_Actor240_Draw, 1, (ObjectFunc) Zoness_Actor240_Update, gCubeHitbox100, 1500.0f, 0, 1, 40, 0, 20.0f, 0 }, + /* OBJ_ACTOR_241 */ {(void*) Zoness_Actor241_Draw, 1, (ObjectFunc) Zoness_Actor241_Update, gActor241Hitbox, 1500.0f, 0, 1, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_242 */ {(void*) Zoness_Actor242_Draw, 2, (ObjectFunc) Zoness_Actor242_Update, D_ZO_602BE3C, 500.0f, 0, 0, 40, 0, 1.0f, 0 }, + /* OBJ_ACTOR_243 */ {(void*) Zoness_Actor243_Draw, 2, (ObjectFunc) Zoness_Actor243_Update, gCubeHitbox100, 0.0f, 0, 1, 40, 0, 1.0f, 1 }, + /* OBJ_ACTOR_244 */ {(void*) Zoness_Actor244_Draw, 2, (ObjectFunc) Zoness_Actor244_Update, D_ZO_602BE58, 2000.0f, 0, 0, 40, 0, 50.0f, 0 }, + /* OBJ_ACTOR_245 */ {(void*) Zoness_Actor245_Draw, 1, (ObjectFunc) Zoness_Actor245_Update, gCubeHitbox100, 200.0f, 0, 0, 40, 0, 1.0f, 0 }, + /* OBJ_ACTOR_246 */ {(void*) Zoness_Actor246_Draw, 1, (ObjectFunc) Zoness_Actor246_Update, gCubeHitbox100, 2000.0f, 0, 0, 40, 0, 1.0f, 0 }, + /* OBJ_ACTOR_247 */ {(void*) Zoness_Actor247_Draw, 1, (ObjectFunc) Zoness_Actor247_Update, D_ZO_602BFC4, 500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_248 */ {(void*) Zoness_Actor248_Draw, 1, (ObjectFunc) Zoness_Actor248_Update, gCubeHitbox150, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_249 */ {(void*) Zoness_Actor249_Draw, 1, (ObjectFunc) Zoness_Actor249_Update, gCubeHitbox200, 5000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_250 */ {(void*) Zoness_Actor250_Draw, 1, (ObjectFunc) Zoness_Actor250_Update, D_ZO_602C1D4, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_251 */ {(void*) Zoness_Actor251_Draw, 2, (ObjectFunc) Zoness_Actor251_Update, D_ZO_602C218, 1000.0f, 0, 0, 40, 0, 1.0f, 1 }, + /* OBJ_ACTOR_252 */ {(void*) Zoness_Actor252_Draw, 1, (ObjectFunc) Zoness_Actor252_Update, D_ZO_602C234, 200.0f, 0, 0, 40, 0, 80.0f, 1 }, + /* OBJ_ACTOR_253 */ {(void*) Zoness_Actor253_Draw, 1, (ObjectFunc) Zoness_Actor253_Update, D_ZO_602C250, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_254 */ {(void*) Zoness_Actor254_Draw, 1, (ObjectFunc) Zoness_Actor254_Update, D_ZO_602C2B0, 300.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ACTOR_255 */ {(void*) Aquas_Actor255_Draw, 1, (ObjectFunc) Aquas_Actor255_Update, D_AQ_6030BFC, 500.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_256 */ {(void*) Aquas_Actor256_Draw, 1, (ObjectFunc) Aquas_Actor256_Update, D_AQ_6030C18, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_257 */ {(void*) Aquas_Actor257_Draw, 1, (ObjectFunc) Aquas_Actor257_Update, D_AQ_6030C44, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_258 */ {(void*) Aquas_Actor258_Draw, 1, (ObjectFunc) Aquas_Actor258_Update, gCubeHitbox100, 200.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_259 */ {(void*) Aquas_Actor259_Draw, 2, (ObjectFunc) Aquas_Actor259_Update, D_AQ_6031398, 10000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_260 */ {(void*) Aquas_Actor260_Draw, 2, (ObjectFunc) Aquas_Actor260_Update, D_AQ_60313CC, 300.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_261 */ {(void*) Aquas_Actor261_Draw, 2, (ObjectFunc) Aquas_Actor261_Update, D_AQ_6031400, 300.0f, 0, 0, 40, 0, 0.0f, 1 }, + /* OBJ_ACTOR_262 */ {(void*) Aquas_Actor262_Draw, 2, (ObjectFunc) Aquas_Actor262_Update, D_AQ_603144C, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_263 */ {(void*) Aquas_Actor263_Draw, 2, (ObjectFunc) Aquas_Actor263_Update, D_AQ_6031480, 200.0f, 0, 0, 40, 0, 0.0f, 1 }, + /* OBJ_ACTOR_264 */ {(void*) Aquas_Actor264_Draw, 1, (ObjectFunc) Aquas_Actor264_Update, gCubeHitbox100, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ACTOR_265 */ {(void*) Aquas_Actor265_Draw, 1, (ObjectFunc) Aquas_Actor265_Update, D_AQ_6031500, 200.0f, 0, 0, 40, 0, 0.0f, 1 }, + /* OBJ_ACTOR_266 */ {(void*) Aquas_Actor266_Draw, 2, (ObjectFunc) Aquas_Actor266_Update, D_AQ_6031538, 200.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ACTOR_267 */ {(void*) Aquas_Actor267_Draw, 2, (ObjectFunc) Aquas_Actor267_Update, D_AQ_6031554, 800.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_268 */ {(void*) Aquas_Actor268_Draw, 1, (ObjectFunc) Aquas_Actor268_Update, D_AQ_6031570, 10000.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ACTOR_269 */ {(void*) Aquas_Actor269_Draw, 1, (ObjectFunc) Aquas_Actor269_Update, D_AQ_6030D20, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_270 */ {(void*) Aquas_Actor270_Draw, 1, (ObjectFunc) Aquas_Actor270_Update, D_AQ_60314C8, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_ACTOR_271 */ {(void*) Actor271_Draw, 2, (ObjectFunc) Actor271_Update, D_BO_6011B24, 0.0f, 0, 0, 39, 0, 730.0f, 1 }, /* OBJ_ACTOR_272 */ {(void*) Actor272_Draw, 1, (ObjectFunc) Actor272_Update, D_BO_6011BF4, 0.0f, 0, 0, 39, 0, 150.0f, 1 }, - /* OBJ_ACTOR_273 */ {(void*) Fortuna_80188FE4, 2, (ObjectFunc) Fortuna_80188AD0, D_FO_600FF30, 0.0f, 0, 0, 39, 0, 220.0f, 1 }, - /* OBJ_ACTOR_274 */ {(void*) SectorZ_8019E3A8, 1, (ObjectFunc) SectorZ_8019E234, gCubeHitbox200, 0.0f, 0, 0, 39, 0, 1.0f, 0 }, - /* OBJ_ACTOR_275 */ {(void*) Solar_8019F7AC, 1, (ObjectFunc) Solar_8019F20C, gCubeHitbox100, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_276 */ {(void*) Solar_8019F7AC, 1, (ObjectFunc) Solar_8019F20C, gCubeHitbox100, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_277 */ {(void*) Solar_8019F7AC, 1, (ObjectFunc) Solar_8019F20C, gCubeHitbox200, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, - /* OBJ_ACTOR_278 */ {(void*) NULL, 1, (ObjectFunc) Solar_8019EA7C, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 1 }, - /* OBJ_ACTOR_279 */ {(void*) NULL, 1, (ObjectFunc) Solar_801A003C, gNoHitbox, 1000.0f, 0, 0, 0, 0, 0.0f, 1 }, - /* OBJ_ACTOR_280 */ {(void*) D_VE1_900DD20, 0, (ObjectFunc) Venom1_80192518, D_VE1_601B7F8, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_281 */ {(void*) Venom1_80192E2C, 1, (ObjectFunc) Venom1_80192CD4, D_VE1_601B830, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_282 */ {(void*) D_VE1_901DA50, 0, (ObjectFunc) Venom1_80192CD4, D_VE1_601B868, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_283 */ {(void*) D_VE1_9023AD0, 0, (ObjectFunc) Venom1_80192EB0, D_VE1_601B8A0, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_284 */ {(void*) Venom1_801934D0, 1, (ObjectFunc) Venom1_801933DC, D_VE1_601B8D8, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_285 */ {(void*) Andross_80193244, 1, (ObjectFunc) Andross_80192E94, gCubeHitbox100, 1000.0f, 0, 0, 20, 0, 1.0f, 1 }, - /* OBJ_ACTOR_286 */ {(void*) Andross_80188660, 1, (ObjectFunc) Andross_80188528, gCubeHitbox100, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_ACTOR_287 */ {(void*) NULL, 1, (ObjectFunc) Andross_80189724, gNoHitbox, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, - /* OBJ_ACTOR_288 */ {(void*) NULL, 1, (ObjectFunc) Andross_801893B8, gNoHitbox, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, - /* OBJ_ACTOR_289 */ {(void*) func_edata_800596B0, 1, (ObjectFunc) Andross_80189470, gNoHitbox, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, - /* OBJ_ACTOR_290 */ {(void*) NULL, 1, (ObjectFunc) Andross_8018933C, gNoHitbox, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, + /* OBJ_ACTOR_FO_RADAR */ {(void*) Fortuna_Radar_Draw, 2, (ObjectFunc) Fortuna_Radar_Update, aFoRadarHitbox, 0.0f, 0, 0, 39, 0, 220.0f, 1 }, + /* OBJ_ACTOR_SZ_SPACE_JUNK */ {(void*) SectorZ_SpaceJunkDraw, 1, (ObjectFunc) SectorZ_SpaceJunkUpdate, gCubeHitbox200, 0.0f, 0, 0, 39, 0, 1.0f, 0 }, + /* OBJ_ACTOR_275 */ {(void*) Solar_Doodad_Draw, 1, (ObjectFunc) Solar_Doodad_Update, gCubeHitbox100, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_276 */ {(void*) Solar_Doodad_Draw, 1, (ObjectFunc) Solar_Doodad_Update, gCubeHitbox100, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_277 */ {(void*) Solar_Doodad_Draw, 1, (ObjectFunc) Solar_Doodad_Update, gCubeHitbox200, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, + /* OBJ_ACTOR_278 */ {(void*) NULL, 1, (ObjectFunc) Solar_Actor278_Update, gNoHitbox, 200.0f, 0, 0, 0, 0, 0.0f, 1 }, + /* OBJ_ACTOR_279 */ {(void*) NULL, 1, (ObjectFunc) Solar_Actor279_Update, gNoHitbox, 1000.0f, 0, 0, 0, 0, 0.0f, 1 }, + /* OBJ_ACTOR_280 */ {(void*) D_VE1_900DD20, 0, (ObjectFunc) Venom1_Actor280_Update, D_VE1_601B7F8, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_281 */ {(void*) Venom1_Actor281_Draw, 1, (ObjectFunc) Venom1_Doodad_Update, D_VE1_601B830, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_282 */ {(void*) D_VE1_901DA50, 0, (ObjectFunc) Venom1_Doodad_Update, D_VE1_601B868, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_283 */ {(void*) D_VE1_9023AD0, 0, (ObjectFunc) Venom1_Actor283_Update, D_VE1_601B8A0, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_284 */ {(void*) Venom1_Actor284_Draw, 1, (ObjectFunc) Venom1_Actor284_Update, D_VE1_601B8D8, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_ACTOR_285 */ {(void*) Andross_Actor285_Draw, 1, (ObjectFunc) Andross_Actor285_Update, gCubeHitbox100, 1000.0f, 0, 0, 20, 0, 1.0f, 1 }, + /* OBJ_ACTOR_286 */ {(void*) Andross_Actor286_Draw, 1, (ObjectFunc) Andross_Actor286_Update, gCubeHitbox100, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, + /* OBJ_ACTOR_287 */ {(void*) NULL, 1, (ObjectFunc) Andross_Actor287_Update, gNoHitbox, 1000.0f, 0, 0, 40, 1, 0.0f, 0 }, + /* OBJ_ACTOR_288 */ {(void*) NULL, 1, (ObjectFunc) Andross_Actor288_Update, gNoHitbox, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, + /* OBJ_ACTOR_289 */ {(void*) Actor289_Draw, 1, (ObjectFunc) Andross_Actor289_Update, gNoHitbox, 1000.0f, 0, 0, 20, 1, 0.0f, 0 }, + /* OBJ_ACTOR_290 */ {(void*) NULL, 1, (ObjectFunc) Andross_Actor290_Update, gNoHitbox, 1000.0f, 0, 0, 20, 0, 0.0f, 0 }, /* OBJ_ACTOR_SUPPLIES */ {(void*) ActorSupplies_Draw, 1, (ObjectFunc) ActorSupplies_Update, gCubeHitbox150, 1000.0f, 0, 0, 0, 0, 1.0f, 0 }, - /* OBJ_BOSS_292 */ {(void*) Corneria_8018AA74, 2, (ObjectFunc) Corneria_80189058, D_CO_603E620, 20000.0f, 0, 0, 40, 1, 0.0f, 10 }, - /* OBJ_BOSS_293 */ {(void*) Corneria_8018ECAC, 1, (ObjectFunc) Corneria_8018C19C, D_CO_603E840, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_294 */ {(void*) Corneria_8018ED78, 1, (ObjectFunc) Corneria_8018DDAC, D_CO_603E714, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_295 */ {(void*) Corneria_8018EE84, 1, (ObjectFunc) Corneria_8018E290, D_CO_603E748, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_296 */ {(void*) Corneria_8018EF90, 1, (ObjectFunc) Corneria_8018E76C, D_CO_603E7C4, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_297 */ {(void*) Meteo_8018BACC, 1, (ObjectFunc) Meteo_8018978C, D_ME_602F75C, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_298 */ {(void*) Meteo_801887D0, 1, (ObjectFunc) Meteo_80188344, D_ME_602FA50, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_CO_GRANGA */ {(void*) Corneria_Granga_Draw, 2, (ObjectFunc) Corneria_Granga_Update, aCoGrangaHitbox, 20000.0f, 0, 0, 40, 1, 0.0f, 10 }, + /* OBJ_BOSS_CO_CARRIER */ {(void*) Corneria_Carrier_Draw, 1, (ObjectFunc) Corneria_Carrier_Update, aCoCarrierHitbox, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_294 */ {(void*) Corneria_Boss294_Draw, 1, (ObjectFunc) Corneria_Boss294_Update, D_CO_603E714, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_295 */ {(void*) Corneria_Boss295_Draw, 1, (ObjectFunc) Corneria_Boss295_Update, D_CO_603E748, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_296 */ {(void*) Corneria_Boss296_Draw, 1, (ObjectFunc) Corneria_Boss296_Update, D_CO_603E7C4, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_297 */ {(void*) Meteo_Boss297_Draw, 1, (ObjectFunc) Meteo_Boss297_Update, D_ME_602F75C, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_298 */ {(void*) Meteo_Boss298_Draw, 1, (ObjectFunc) Meteo_Boss298_Update, D_ME_602FA50, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_299 */ {(void*) Boss299_Draw, 2, (ObjectFunc) Boss299_Update, gNoHitbox, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_300 */ {(void*) Boss300_Draw, 1, (ObjectFunc) Boss300_Update, gNoHitbox, 20000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_301 */ {(void*) Aquas_Boss301_Draw, 1, (ObjectFunc) Aquas_Boss301_Update, D_AQ_6030B10, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_A6 */ {(void*) Area6_Boss_Draw, 1, (ObjectFunc) Area6_Boss_Update, D_A6_6028454, 2000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_303 */ {(void*) SectorX_80193434, 2, (ObjectFunc) SectorX_80190078, D_SX_6032550, 20000.0f, 0, 0, 20, 0, 0.0f, 10 }, - /* OBJ_BOSS_304 */ {(void*) SectorX_8018FF84, 2, (ObjectFunc) SectorX_8018FE38, D_SX_6032488, 1000.0f, 0, 0, 20, 0, 0.0f, 10 }, - /* OBJ_BOSS_305 */ {(void*) SectorX_80190020, 2, (ObjectFunc) SectorX_8018FF20, D_SX_60324EC, 1000.0f, 0, 0, 20, 0, 0.0f, 10 }, + /* OBJ_BOSS_SX_SPYBORG */ {(void*) SectorX_Boss_Draw, 2, (ObjectFunc) SectorX_Boss_Update, D_SX_6032550, 20000.0f, 0, 0, 20, 0, 0.0f, 10 }, + /* OBJ_BOSS_304 */ {(void*) SectorX_Boss304_Draw, 2, (ObjectFunc) SectorX_Boss304_Update, D_SX_6032488, 1000.0f, 0, 0, 20, 0, 0.0f, 10 }, + /* OBJ_BOSS_305 */ {(void*) SectorX_Boss305_Draw, 2, (ObjectFunc) SectorX_Boss305_Update, D_SX_60324EC, 1000.0f, 0, 0, 20, 0, 0.0f, 10 }, /* OBJ_BOSS_TI */ {(void*) Titania_Boss_Draw, 1, (ObjectFunc) Titania_Boss_Update,D_TI_801B83A8, 1000.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_ZO */ {(void*) Zoness_Boss_Draw, 2, (ObjectFunc) Zoness_Boss_Update, D_ZO_602C044, 1000.0f, 0, 0, 40, 0, 1.0f, 10 }, /* OBJ_BOSS_FO */ {(void*) HUD_BossFO_Draw, 1, (ObjectFunc) HUD_BossFO_Update, D_FO_600FFE0, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_309 */ {(void*) Boss309_Draw, 1, (ObjectFunc) Boss309_Update, gNoHitbox, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_310 */ {(void*) Boss310_Draw, 1, (ObjectFunc) Boss310_Update, gNoHitbox, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, - /* OBJ_BOSS_311 */ {(void*) Bolse_80191AFC, 2, (ObjectFunc) Bolse_801912FC, D_BO_6011C80, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, + /* OBJ_BOSS_311 */ {(void*) Bolse_Boss311_Draw, 2, (ObjectFunc) Bolse_Boss311_Update, D_BO_6011C80, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_VE2 */ {(void*) Venom2_Boss_Draw, 2, (ObjectFunc) Venom2_Boss_Update, D_VE2_60166F4, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, - /* OBJ_BOSS_SZ */ {(void*) SectorZ_Boss_Draw, 1, (ObjectFunc) SectorZ_Boss_Update, D_SZ_6009388, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_SZ_GREAT_FOX */ {(void*) SectorZ_GreatFoxDraw, 1, (ObjectFunc) SectorZ_GreatFoxUpdate, D_SZ_6009388, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_SY */ {(void*) SectorY_Boss_Draw, 2, (ObjectFunc) SectorY_Boss_Update, gNoHitbox, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_SO */ {(void*) Solar_Boss_Draw, 2, (ObjectFunc) Solar_Boss_Update, gNoHitbox, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_KA */ {(void*) Katina_BossDraw, 1, (ObjectFunc) Katina_BossUpdate, D_KA_6011058, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_KA_BASE */ {(void*) Katina_Base_Draw, 1, (ObjectFunc) Katina_BaseUpdate, D_KA_601115C, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_AQ */ {(void*) Aquas_Boss_Draw, 2, (ObjectFunc) Aquas_Boss_Update, D_AQ_6030F74, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_BOSS_VE1 */ {(void*) Venom1_Boss_Draw, 1, (ObjectFunc) Venom1_Boss_Update,D_VE1_8019A9B8, 3000.0f, 0, 0, 40, 1, 0.0f, 10 }, - /* OBJ_BOSS_320 */ {(void*) Andross_801928C8, 2, (ObjectFunc) Andross_8018DBF0, D_ANDROSS_C038DC0, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, - /* OBJ_BOSS_321 */ {(void*) Andross_8018B8C0, 1, (ObjectFunc) Andross_80189B70, D_ANDROSS_C038F24, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_320 */ {(void*) Andross_Boss320_Draw, 2, (ObjectFunc) Andross_Boss320_Update, D_ANDROSS_C038DC0, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, + /* OBJ_BOSS_321 */ {(void*) Andross_Boss321_Draw, 1, (ObjectFunc) Andross_Boss321_Update, D_ANDROSS_C038F24, 10000.0f, 0, 0, 40, 0, 0.0f, 10 }, /* OBJ_ITEM_LASERS */ {(void*) ItemLasers_Draw, 1, (ObjectFunc) ItemLasers_Update, gItemLasersHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_CHECKPOINT */ {(void*) ItemCheckpoint_Draw, 1, (ObjectFunc) ItemCheckpoint_Update, gItemCheckpointHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_SILVER_RING */ {(void*) ItemSilverRing_Draw, 1, (ObjectFunc) ItemSupplyRing_Update, gItemSupplyRingHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, @@ -430,68 +430,68 @@ ObjectInfo gObjectInfo[] = { /* OBJ_ITEM_RING_CHECK */ {(void*) NULL, 1, (ObjectFunc) ItemRingCheck_Update, gItemRingCheckHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_1UP */ {(void*) D_1022120, 0, (ObjectFunc) Item1up_Update, gCubeHitbox100, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_GOLD_RING */ {(void*) ItemGoldRing_Draw, 1, (ObjectFunc) ItemGoldRing_Update, gItemSupplyRingHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_ITEM_WING_REPAIR */ {(void*) D_arwing_3007650, 0, (ObjectFunc) ItemWingRepair_Update, gItemLasersHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_ITEM_WING_REPAIR */ {(void*) aArwingItemLasersDL, 0, (ObjectFunc) ItemWingRepair_Update, gItemLasersHitbox, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ITEM_TRAINING_RING */ {(void*) gItemTrainingRingDL, 0, (ObjectFunc) Training_ItemRing_Update, D_TR_6009CFC, 700.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_FIRE_SMOKE */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D2F4, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_340 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D748, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_341 */ {(void*) func_effect_8007D55C, 1, (ObjectFunc) func_effect_8007D8A8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_342 */ {(void*) func_effect_8007E330, 1, (ObjectFunc) func_effect_8007E298, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_343 */ {(void*) func_effect_8007CAF0, 1, (ObjectFunc) func_effect_8007C9E0, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_344 */ {(void*) func_effect_8007868C, 1, (ObjectFunc) func_effect_8007E014, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_345 */ {(void*) func_effect_8007879C, 1, (ObjectFunc) func_effect_8007E258, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_346 */ {(void*) func_effect_800788B0, 1, (ObjectFunc) func_effect_8007F438, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_347 */ {(void*) func_effect_800783C0, 1, (ObjectFunc) func_effect_8007B758, NULL, 100.0f, 1, 0, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_348 */ {(void*) func_effect_80078A64, 1, (ObjectFunc) func_effect_8007F6B0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_349 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007F958, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_350 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007FBE0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_351 */ {(void*) func_effect_80078438, 1, (ObjectFunc) func_effect_8007E3E4, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_352 */ {(void*) func_effect_800784B4, 1, (ObjectFunc) func_effect_8007B62C, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_353 */ {(void*) func_effect_80078B8C, 1, (ObjectFunc) func_effect_8007FE88, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_354 */ {(void*) SectorY_80197C64, 1, (ObjectFunc) func_effect_8007FE88, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_355 */ {(void*) func_effect_80078AEC, 1, (ObjectFunc) func_effect_800802B8, NULL, 100.0f, 1, 0, 20, 1, 0.0f, 0 }, - /* OBJ_EFFECT_356 */ {(void*) func_effect_80078C84, 1, (ObjectFunc) func_effect_800802F8, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_357 */ {(void*) func_effect_800798F0, 1, (ObjectFunc) func_effect_8007968C, NULL, 100.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_FIRE_SMOKE */ {(void*) Effect_FireSmoke_Draw, 1, (ObjectFunc) Effect_Effect339_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_340 */ {(void*) Effect_FireSmoke_Draw, 1, (ObjectFunc) Effect_Effect340_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_341 */ {(void*) Effect_FireSmoke_Draw, 1, (ObjectFunc) Effect_Effect341_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_342 */ {(void*) Effect_Effect342_Draw, 1, (ObjectFunc) Effect_Effect342_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_343 */ {(void*) Effect_Effect343_Draw, 1, (ObjectFunc) Effect_Effect343_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_344 */ {(void*) Effect_Effect344_Draw, 1, (ObjectFunc) Effect_Effect344_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_345 */ {(void*) Effect_Effect345_Draw, 1, (ObjectFunc) Effect_Effect345_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_346 */ {(void*) Effect_Effect346_Draw, 1, (ObjectFunc) Effect_Effect346_Update, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_347 */ {(void*) Effect_Effect347_Draw, 1, (ObjectFunc) Effect_Effect347_Update, NULL, 100.0f, 1, 0, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_348 */ {(void*) Effect_Effect348_Draw, 1, (ObjectFunc) Effect_Effect348_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_349 */ {(void*) NULL, 1, (ObjectFunc) Effect_Effect349_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_350 */ {(void*) NULL, 1, (ObjectFunc) Effect_Effect350_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_351 */ {(void*) Effect_Effect351_Draw, 1, (ObjectFunc) Effect_Effect351_Update, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_CLOUDS */ {(void*) Effect_Clouds_Draw, 1, (ObjectFunc) Effect_Clouds_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_ENEMY_LASER_1 */ {(void*) Effect_Effect353_Draw, 1, (ObjectFunc) Effect_Effect353_354_Update, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_354 */ {(void*) SectorY_Effect354_Draw, 1, (ObjectFunc) Effect_Effect353_354_Update, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_355 */ {(void*) Effect_Effect355_Draw, 1, (ObjectFunc) Effect_Effect355_Update, NULL, 100.0f, 1, 0, 20, 1, 0.0f, 0 }, + /* OBJ_EFFECT_356 */ {(void*) Effect_Effect356_Draw, 1, (ObjectFunc) Effect_Effect356_Update, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_357 */ {(void*) Effect_Effect357_Draw, 1, (ObjectFunc) Effect_Effect357_Update, NULL, 100.0f, 0, 1, 0, 0, 0.0f, 0 }, /* OBJ_EFFECT_358 */ {(void*) Katina_LaserEnergyParticlesDraw, 1, (ObjectFunc) Katina_LaserEnergyParticlesUpdate, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_359 */ {(void*) func_effect_8007AA60, 1, (ObjectFunc) func_effect_8007A994, NULL, -100.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_360 */ {(void*) func_effect_8007BEE8, 1, (ObjectFunc) func_effect_8007BE54, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_361 */ {(void*) func_effect_8007BEE8, 1, (ObjectFunc) func_effect_8007BDE0, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_362 */ {(void*) func_effect_8007BEE8, 1, (ObjectFunc) func_effect_8007BCE8, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_363 */ {(void*) func_hud_80094BBC, 1, (ObjectFunc) func_hud_80094954, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_364 */ {(void*) func_effect_8007B9DC, 1, (ObjectFunc) func_effect_8007B960, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_365 */ {(void*) func_effect_8007E5CC, 1, (ObjectFunc) func_effect_8007E45C, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_366 */ {(void*) func_effect_80078550, 1, (ObjectFunc) Aquas_801AC918, NULL, 100.0f, 1, 2, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_367 */ {(void*) func_effect_80078604, 1, (ObjectFunc) func_effect_8007E648, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_368 */ {(void*) Titania_80188FA8, 1, (ObjectFunc) Titania_80188F60, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_369 */ {(void*) Meteo_8018DCE4, 1, (ObjectFunc) Meteo_80188CAC, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_370 */ {(void*) Meteo_8018DBEC, 1, (ObjectFunc) Meteo_80188FAC, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_371 */ {(void*) Meteo_8018DE14, 1, (ObjectFunc) Meteo_80189114, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_372 */ {(void*) func_effect_80077A00, 1, (ObjectFunc) func_effect_8007AB50, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_373 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007A748, NULL, 500.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_374 */ {(void*) func_effect_8007DED4, 1, (ObjectFunc) func_effect_8007DB70, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_375 */ {(void*) func_effect_8007DAE4, 1, (ObjectFunc) func_effect_8007DA58, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_376 */ {(void*) func_effect_80078CE8, 1, (ObjectFunc) func_effect_80080360, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_377 */ {(void*) func_effect_80078BE0, 1, (ObjectFunc) func_effect_800802D8, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_378 */ {(void*) Macbeth_801A5AF0, 1, (ObjectFunc) Macbeth_801A57D0, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_379 */ {(void*) Macbeth_801AEAA0, 1, (ObjectFunc) Macbeth_801AE87C, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_380 */ {(void*) Macbeth_801A5D68, 1, (ObjectFunc) Macbeth_801A5B4C, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_381 */ {(void*) func_effect_80077A7C, 1, (ObjectFunc) func_effect_8007B0F4, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_382 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007B040, NULL, 200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_383 */ {(void*) func_effect_8007A3C0, 1, (ObjectFunc) func_effect_8007A28C, NULL, 10000.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_384 */ {(void*) func_effect_80077B84, 1, (ObjectFunc) func_effect_8007B3B8, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_385 */ {(void*) func_effect_80078038, 1, (ObjectFunc) func_effect_8007B5C0, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_386 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007C250, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_387 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007C8C4, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_388 */ {(void*) func_effect_80077B78, 1, (ObjectFunc) func_effect_8007B670, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_389 */ {(void*) func_effect_800780F8, 1, (ObjectFunc) func_effect_8007B67C, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_390 */ {(void*) NULL, 1, (ObjectFunc) func_effect_8007C50C, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_391 */ {(void*) func_effect_80083B8C, 1, (ObjectFunc) func_effect_800837EC, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_392 */ {(void*) Solar_801A0AF0, 1, (ObjectFunc) Solar_801A0120, NULL, 300.0f, 1, 2, 10, 0, 0.0f, 0 }, - /* OBJ_EFFECT_393 */ {(void*) func_effect_80078F78, 1, (ObjectFunc) func_effect_80078EBC, NULL, 300.0f, 1, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_394 */ {(void*) func_effect_80080D04, 1, (ObjectFunc) func_effect_80080ACC, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, - /* OBJ_EFFECT_395 */ {(void*) func_effect_80082F78, 1, (ObjectFunc) func_effect_80081C5C, NULL, 300.0f, 0, 1, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_396 */ {(void*) Andross_8018CF98, 1, (ObjectFunc) Andross_8018CAD4, NULL, 2000.0f, 0, 1, 40, 2, 0.0f, 0 }, - /* OBJ_EFFECT_397 */ {(void*) Bolse_80191180, 1, (ObjectFunc) Bolse_80191054, NULL, 2000.0f, 0, 1, 20, 0, 0.0f, 0 }, - /* OBJ_EFFECT_398 */ {(void*) func_effect_8008092C, 1, (ObjectFunc) func_effect_8008040C, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_EFFECT_399 */ {(void*) func_effect_80084194, 1, (ObjectFunc) func_effect_80083FA8, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_359 */ {(void*) Effect_Effect359_Draw, 1, (ObjectFunc) Effect_Effect359_Update, NULL, -100.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_360 */ {(void*) Effect_Effect360_361_362_Draw, 1, (ObjectFunc) Effect_Effect360_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_361 */ {(void*) Effect_Effect360_361_362_Draw, 1, (ObjectFunc) Effect_Effect361_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_362 */ {(void*) Effect_Effect360_361_362_Draw, 1, (ObjectFunc) Effect_Effect362_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_363 */ {(void*) Hud_Effect363_Draw, 1, (ObjectFunc) Hud_Effect363_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_364 */ {(void*) Effect_Effect364_Draw, 1, (ObjectFunc) Effect_Effect364_Update, NULL, -200.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_365 */ {(void*) Effect_Effect365_Draw, 1, (ObjectFunc) Effect_Effect365_Update, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_366 */ {(void*) Effect_Effect366_Draw, 1, (ObjectFunc) Aquas_Effect366_Update, NULL, 100.0f, 1, 2, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_367 */ {(void*) Effect_Effect367_Draw, 1, (ObjectFunc) Effect_Effect367_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_368 */ {(void*) Titania_Effect368_Draw, 1, (ObjectFunc) Titania_Effect368_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_369 */ {(void*) Meteo_Effect369_Draw, 1, (ObjectFunc) Meteo_Effect369_Update, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_370 */ {(void*) Meteo_Effect370_Draw, 1, (ObjectFunc) Meteo_Effect370_Update, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_371 */ {(void*) Meteo_Effect371_Draw, 1, (ObjectFunc) Meteo_Effect371_Update, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_372 */ {(void*) Effect_Effect372_Draw, 1, (ObjectFunc) Effect_Effect372_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_TIMED_SFX */ {(void*) NULL, 1, (ObjectFunc) Effect_TimedSfx_Update, NULL, 500.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_374 */ {(void*) Macbeth_Effect374_Draw, 1, (ObjectFunc) Effect_Effect374_Update, NULL, 100.0f, 0, 1, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_375 */ {(void*) Macbeth_Effect375_Draw, 1, (ObjectFunc) Effect_Effect375_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_376 */ {(void*) Macbeth_Effect376_Draw, 1, (ObjectFunc) Effect_Effect376_Update, NULL, -200.0f, 1, 0, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_377 */ {(void*) Macbeth_Effect377_Draw, 1, (ObjectFunc) Effect_Effect377_Update, NULL, 100.0f, 1, 0, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_378 */ {(void*) Macbeth_Effect378_Draw, 1, (ObjectFunc) Macbeth_Effect378_Update, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_379 */ {(void*) Macbeth_Effect379_Draw, 1, (ObjectFunc) Macbeth_Effect379_Update, NULL, 100.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_380 */ {(void*) Macbeth_Effect380_Draw, 1, (ObjectFunc) Macbeth_Effect380_Update, NULL, 100.0f, 0, 0, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_381 */ {(void*) Effect_Effect382_Draw, 1, (ObjectFunc) Effect_Effect381_Update, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_382 */ {(void*) NULL, 1, (ObjectFunc) Effect_Effect382_Update, NULL, 200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_383 */ {(void*) Effect_Effect383_Draw, 1, (ObjectFunc) Effect_Effect383_Update, NULL, 10000.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_384 */ {(void*) Effect_Effect384_Draw, 1, (ObjectFunc) Effect_Effect384_Update, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_385 */ {(void*) Effect_Effect385_Draw, 1, (ObjectFunc) Effect_Effect385_Update, NULL, -200.0f, -1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_386 */ {(void*) NULL, 1, (ObjectFunc) Effect_Effect386_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_387 */ {(void*) NULL, 1, (ObjectFunc) Effect_Effect387_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_388 */ {(void*) Effect_Effect388_Draw, 1, (ObjectFunc) Effect_Effect388_Update, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_389 */ {(void*) Effect_Effect389_Draw, 1, (ObjectFunc) Effect_Effect389_Update, NULL, -200.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_390 */ {(void*) NULL, 1, (ObjectFunc) Effect_Effect390_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_391 */ {(void*) Effect_Effect391_Draw, 1, (ObjectFunc) Effect_Effect391_Update, NULL, 500.0f, 0, 0, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_392 */ {(void*) Solar_Effect392_Draw, 1, (ObjectFunc) Solar_Effect392_Update, NULL, 300.0f, 1, 2, 10, 0, 0.0f, 0 }, + /* OBJ_EFFECT_393 */ {(void*) Effect_Effect393_Draw, 1, (ObjectFunc) Effect_Effect393_Update, NULL, 300.0f, 1, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_394 */ {(void*) Effect_Effect394_Draw, 1, (ObjectFunc) Effect_Effect394_Update, NULL, -200.0f, 0, 1, 0, 0, 0.0f, 0 }, + /* OBJ_EFFECT_395 */ {(void*) Effect_Effect395_Draw, 1, (ObjectFunc) Effect_Effect395_Update, NULL, 300.0f, 0, 1, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_396 */ {(void*) Andross_Effect396_Draw, 1, (ObjectFunc) Andross_Effect396_Update, NULL, 2000.0f, 0, 1, 40, 2, 0.0f, 0 }, + /* OBJ_EFFECT_397 */ {(void*) Bolse_Effect397_Draw, 1, (ObjectFunc) Bolse_Effect397_Update, NULL, 2000.0f, 0, 1, 20, 0, 0.0f, 0 }, + /* OBJ_EFFECT_398 */ {(void*) Effect_Effect398_Draw, 1, (ObjectFunc) Effect_Effect398_Update, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, + /* OBJ_EFFECT_399 */ {(void*) Effect_Effect399_Draw, 1, (ObjectFunc) Effect_Effect399_Update, NULL, 100.0f, 0, 0, 40, 0, 0.0f, 0 }, }; // clang-format on diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 92d72551..d53269c3 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -114,7 +114,7 @@ void Scenery_DrawTitaniaBones(Scenery* scenery) { void func_edisplay_80059BB0(void* arg0) { } -void Scenery42_Draw(Scenery_42* this) { +void CoIBeam_Draw(CoIBeam* this) { gSPDisplayList(gMasterDisp++, D_CO_6023AC0); } @@ -134,33 +134,33 @@ void FogShadow_Draw(FogShadow* this) { RCP_SetupDL_47(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 180); switch (this->sceneryId) { - case OBJ_SCENERY_0: + case OBJ_SCENERY_CO_STONE_ARCH: Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.7f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; - case OBJ_SCENERY_21: + case OBJ_SCENERY_CO_ARCH_2: Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.7f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; - case OBJ_SCENERY_6: - case OBJ_SCENERY_7: + case OBJ_SCENERY_CO_HIGHWAY_1: + case OBJ_SCENERY_CO_HIGHWAY_2: Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 10.55f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_Gfx_800DAC20); break; - case OBJ_SCENERY_56: + case OBJ_SCENERY_CO_DOORS: Matrix_Scale(gGfxMatrix, 1.6f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; - case OBJ_SCENERY_20: + case OBJ_SCENERY_CO_ARCH_1: Matrix_Scale(gGfxMatrix, 1.2f, 1.0f, 1.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; - case OBJ_SCENERY_22: + case OBJ_SCENERY_CO_ARCH_3: Matrix_Scale(gGfxMatrix, 2.2f, 1.0f, 1.4f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); @@ -169,22 +169,22 @@ void FogShadow_Draw(FogShadow* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void func_edisplay_80059F68(Scenery* scenery) { +void CoBuilding9_Draw(Scenery* scenery) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -95.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_602DA20); } -void func_edisplay_80059FDC(Scenery* scenery) { +void CoBuilding10_Draw(Scenery* scenery) { gSPDisplayList(gMasterDisp++, D_CO_6035DA0); } -// repurposed into OBJ_SCENERY_15 +// repurposed into OBJ_SCENERY_CO_BUILDING_6 void func_edisplay_8005A010(Sprite* sprite) { if (!sprite->toLeft) { Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_CO_60361F0); + gSPDisplayList(gMasterDisp++, aCoBuilding6DL); } } @@ -209,7 +209,7 @@ Gfx* D_edisplay_800CFADC[] = { }; Gfx* D_edisplay_800CFB08[] = { D_ZO_6020F10, D_ZO_6021100, D_ZO_60214B0 }; Gfx* D_edisplay_800CFB14[] = { D_ZO_60163E0, D_ZO_60165D0, D_ZO_6016880, D_ZO_6016B50, D_ZO_6000C40 }; -Gfx* D_edisplay_800CFB28[] = { D_CO_6018E80, D_ZO_601F620, D_ZO_601F420, D_ZO_6018C80, D_ZO_601F940, D_ZO_601F260 }; +Gfx* D_edisplay_800CFB28[] = { aCoBuilding7DL, D_ZO_601F620, D_ZO_601F420, D_ZO_6018C80, D_ZO_601F940, D_ZO_601F260 }; Gfx* D_edisplay_800CFB40[] = { D_SO_6014DB0, D_SO_60146D0, D_SO_6014B80, D_SO_6014470, D_SO_6014930, D_SO_60138A0, D_SO_60151A0, D_SO_600F750, D_SO_6015810, @@ -556,25 +556,25 @@ void func_edisplay_8005B388(Actor* actor) { Actor_DrawEngineAndContrails(actor); } -void func_edisplay_8005B6A4(Actor* actor) { +void Actor180_Draw(Actor* actor) { Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_6024B60); } -void func_edisplay_8005B71C(Actor* actor) { +void Actor182_Draw(Actor* actor) { RCP_SetupDL_29(actor->unk_046, gFogGreen, gFogBlue, gFogAlpha, actor->unk_048, gFogFar); Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_6018C00); } -void func_edisplay_8005B7CC(Actor* actor) { +void Actor186_Draw(Actor* actor) { RCP_SetupDL_29(actor->unk_046, gFogGreen, gFogBlue, gFogAlpha, actor->unk_048, gFogFar); gSPDisplayList(gMasterDisp++, D_ME_6022920); } -void func_edisplay_8005B848(Actor* actor) { +void Actor190_191_Draw(Actor* actor) { f32 scale; switch (actor->eventType) { @@ -599,13 +599,13 @@ void func_edisplay_8005B848(Actor* actor) { Actor_DrawEngineGlow(actor, 2); } -void func_edisplay_8005B9A4(Actor* actor) { +void Actor192_Draw(Actor* actor) { Matrix_Translate(gGfxMatrix, 0.0f, -124.0f, 0.0f, MTXF_APPLY); Animation_GetFrameData(&D_CO_6029528, actor->animFrame, actor->vwork); Animation_DrawSkeleton(1, D_CO_6029674, actor->vwork, NULL, NULL, actor, &gIdentityMatrix); } -void func_edisplay_8005BA30(Actor* actor) { +void Actor193_Draw(Actor* actor) { if (actor->timer_0BC != 0) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); @@ -667,7 +667,7 @@ void Object_SetShadowDL(ObjectId objId, s32 index) { break; } break; - case OBJ_BOSS_292: + case OBJ_BOSS_CO_GRANGA: gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; case OBJ_BOSS_KA: @@ -679,7 +679,7 @@ void Object_SetShadowDL(ObjectId objId, s32 index) { Graphics_SetScaleMtx(150.0f); gSPDisplayList(gMasterDisp++, D_102A8A0); break; - case OBJ_BOSS_293: + case OBJ_BOSS_CO_CARRIER: case OBJ_BOSS_294: case OBJ_BOSS_295: case OBJ_BOSS_296: @@ -690,7 +690,7 @@ void Object_SetShadowDL(ObjectId objId, s32 index) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 150); } switch (objId) { - case OBJ_BOSS_293: + case OBJ_BOSS_CO_CARRIER: gSPDisplayList(gMasterDisp++, D_CO_6036840); break; case OBJ_BOSS_294: @@ -946,8 +946,8 @@ void Scenery_Draw(Scenery* this, s32 arg1) { func_edisplay_8005D008(&this->obj, this->info.drawType); this->obj.pos.y -= gCameraShakeY; if (this->info.drawType == 0) { - if ((this->obj.id == OBJ_SCENERY_19) || (this->obj.id == OBJ_SCENERY_55) || (this->obj.id == OBJ_SCENERY_9) || - (this->obj.id == OBJ_SCENERY_50)) { + if ((this->obj.id == OBJ_SCENERY_CO_TOWER) || (this->obj.id == OBJ_SCENERY_CO_ROCKWALL) || + (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_4) || (this->obj.id == OBJ_SCENERY_50)) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); if (arg1 < 0) { @@ -956,7 +956,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) { gSPDisplayList(gMasterDisp++, this->info.dList); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { - if (this->obj.id == OBJ_SCENERY_8) { + if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) { if (arg1 < 0) { return; // weird control flow } @@ -967,7 +967,7 @@ void Scenery_Draw(Scenery* this, s32 arg1) { Object_ApplyWaterDistortion(); } gSPDisplayList(gMasterDisp++, this->info.dList); - if (this->obj.id == OBJ_SCENERY_8) { + if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } } @@ -999,7 +999,7 @@ void Actor_DrawOnRails(Actor* this) { Actor194_Draw(this); return; case OBJ_ACTOR_236: - Zoness_80190F08(this); + Zoness_Actor236_Draw(this); return; } if ((this->obj.id == OBJ_ACTOR_EVENT) && (this->eventType == EVID_200)) { @@ -1154,7 +1154,7 @@ void Boss_Draw(Boss* this, s32 arg1) { var_fv0 = 6000.0f; var_ft5 = 0.9f; var_fv1 = -20000.0f; - } else if (this->obj.id == OBJ_BOSS_SZ) { + } else if (this->obj.id == OBJ_BOSS_SZ_GREAT_FOX) { var_fv1 = -25000.0f; var_ft5 = 0.7f; var_fa1 = 3000.0f; @@ -1198,7 +1198,7 @@ void Effect_DrawOnRails(Effect* this, s32 arg1) { if ((arg1 < 0) && (this->obj.pos.y < 7.0f)) { return; } - if ((this->obj.id == OBJ_EFFECT_353) || (this->obj.id == OBJ_EFFECT_369)) { + if ((this->obj.id == OBJ_EFFECT_ENEMY_LASER_1) || (this->obj.id == OBJ_EFFECT_369)) { func_edisplay_8005D3CC(&this->obj, this->unk_60.x, this->unk_60.y, this->unk_60.z, 0); } else if (this->info.unk_14 == -1) { this->obj.pos.y += gCameraShakeY; @@ -1245,7 +1245,7 @@ void Effect_DrawAllRange(Effect* this) { } } Object_SetSfxSourceToView(this->sfxSource, &sp40); - if (!drawn && (this->obj.id != OBJ_EFFECT_352) && (this->obj.id != OBJ_EFFECT_373) && (!gVersusMode)) { + if (!drawn && (this->obj.id != OBJ_EFFECT_CLOUDS) && (this->obj.id != OBJ_EFFECT_TIMED_SFX) && (!gVersusMode)) { Object_Kill(&this->obj, this->sfxSource); } } diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index e0098b77..b3e5d6b3 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -42,7 +42,7 @@ void BonusText_Update(void) { BonusText* bonus; s32 i; - for (i = 0, bonus = gBonusText; i < ARRAY_COUNT(gBonusText); i++, bonus++) { + for (i = 0, bonus = &gBonusText[0]; i < ARRAY_COUNT(gBonusText); i++, bonus++) { if (bonus->hits != BONUS_TEXT_FREE) { if (bonus->timer != 0) { bonus->timer -= 1; // can't be -- @@ -164,25 +164,26 @@ Effect* func_effect_8007783C(ObjectId objId) { return effect; } -void func_effect_800778C4(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_FIRE_SMOKE; +void func_effect_800778C4(EffectFireSmoke* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, + f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_FIRE_SMOKE; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - effect->scale2 = scale2; - effect->unk_4C = 0; - effect->scale1 = 0.5f; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); - effect->unk_44 = 255; + this->scale2 = scale2; + this->unk_4C = 0; + this->scale1 = 0.5f; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); + this->unk_44 = 255; } void func_effect_8007797C(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2) { @@ -196,92 +197,92 @@ void func_effect_8007797C(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 } } -void func_effect_80077A00(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); +void Effect_Effect372_Draw(Effect372* this) { + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gSPDisplayList(gMasterDisp++, D_arwing_3016B30); } -void func_effect_80077A7C(Effect* effect) { +void Effect_Effect382_Draw(Effect382* this) { RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); - gDPSetEnvColor(gMasterDisp++, 255, 255, 255, effect->unk_44); - Matrix_Scale(gGfxMatrix, effect->scale1, effect->scale2, 1.0f, MTXF_APPLY); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 255, 255, this->unk_44); + Matrix_Scale(gGfxMatrix, this->scale1, this->scale2, 1.0f, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6024220); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_80077B78(Effect* effect) { +void Effect_Effect388_Draw(Effect388* this) { } -void func_effect_80077B84(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); +void Effect_Effect384_Draw(Effect384* this) { + Graphics_SetScaleMtx(this->scale2); - if ((effect->scale1 == 71.0f) || + if ((this->scale1 == 71.0f) || ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCurrentLevel == LEVEL_CORNERIA))) { RCP_SetupDL(&gMasterDisp, SETUPDL_38); } else { RCP_SetupDL(&gMasterDisp, SETUPDL_67); } - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); - switch (effect->unk_4C) { + switch (this->unk_4C) { case 0: - gDPSetEnvColor(gMasterDisp++, 0, 128, 255, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 0, 128, 255, this->unk_44); break; case 1: - gDPSetEnvColor(gMasterDisp++, 255, 64, 255, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 64, 255, this->unk_44); break; case 2: - gDPSetEnvColor(gMasterDisp++, 255, 128, 0, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 128, 0, this->unk_44); break; case 3: - gDPSetEnvColor(gMasterDisp++, 255, 48, 48, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 48, 48, this->unk_44); break; case 4: - gDPSetEnvColor(gMasterDisp++, 255, 255, 48, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 255, 48, this->unk_44); break; case 5: - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, effect->unk_44); - gDPSetEnvColor(gMasterDisp++, 255, 32, 32, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, this->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 32, 32, this->unk_44); break; case 6: if (gCurrentLevel == LEVEL_BOLSE) { RCP_SetupDL(&gMasterDisp, SETUPDL_38); } - switch ((effect->index + gGameFrameCount) % 4U) { + switch ((this->index + gGameFrameCount) % 4U) { case 0: - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 0, 0, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 0, 0, this->unk_44); break; case 1: - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, this->unk_44); break; case 2: - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 255, this->unk_44); break; case 3: - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, this->unk_44); break; } - gDPSetEnvColor(gMasterDisp++, 0, 0, 0, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 0, 0, 0, this->unk_44); break; case 7: - gDPSetEnvColor(gMasterDisp++, 48, 48, 255, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 48, 48, 255, this->unk_44); break; case 10: - gDPSetEnvColor(gMasterDisp++, 255, 255, 32, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 255, 32, this->unk_44); break; case 11: - gDPSetEnvColor(gMasterDisp++, 255, 32, 32, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 255, 32, 32, this->unk_44); break; case 12: - gDPSetEnvColor(gMasterDisp++, 32, 255, 32, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 32, 255, 32, this->unk_44); break; case 13: - gDPSetEnvColor(gMasterDisp++, 32, 32, 255, effect->unk_44); + gDPSetEnvColor(gMasterDisp++, 32, 32, 255, this->unk_44); break; } @@ -289,12 +290,12 @@ void func_effect_80077B84(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_80078038(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); +void Effect_Effect385_Draw(Effect385* this) { + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL_49(); RCP_SetupDL(&gMasterDisp, SETUPDL_38); - gDPSetPrimColor(gMasterDisp++, 0, 0, 64, 192, 255, effect->unk_44); - gDPSetEnvColor(gMasterDisp++, 0, 0, 0, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 64, 192, 255, this->unk_44); + gDPSetEnvColor(gMasterDisp++, 0, 0, 0, this->unk_44); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } @@ -329,25 +330,25 @@ static f32 D_800D1534[][10] = { 41.706547f }, }; -void func_effect_800780F8(Effect* effect) { +void Effect_Effect389_Draw(Effect389* this) { s32 i; - if (effect->unk_4A > 10) { - if (((effect->index + gGameFrameCount) % 2) == 0) { + if (this->unk_4A > 10) { + if (((this->index + gGameFrameCount) % 2) == 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 128, 32); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 128, 128, 128); } - } else if (((effect->index + gGameFrameCount) % 2) == 0) { + } else if (((this->index + gGameFrameCount) % 2) == 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 96, 96, 255, 255); } - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); for (i = 0; i < 10; i++) { - if ((i >= effect->unk_48) && (i < effect->unk_46)) { + if ((i >= this->unk_48) && (i < this->unk_46)) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, MTXF_APPLY); @@ -356,52 +357,52 @@ void func_effect_800780F8(Effect* effect) { Matrix_Pop(&gGfxMatrix); } Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, D_800D1534[effect->unk_4C][i] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_800D1534[this->unk_4C][i] * M_DTOR, MTXF_APPLY); } } -void func_effect_800783C0(Effect* effect) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); - Graphics_SetScaleMtx(effect->scale2); +void Effect_Effect347_Draw(Effect347* this) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); + Graphics_SetScaleMtx(this->scale2); gSPDisplayList(gMasterDisp++, D_BG_SPACE_2006F50); } -void func_effect_80078438(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); +void Effect_Effect351_Draw(Effect351* this) { + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); gSPDisplayList(gMasterDisp++, D_102A8A0); } -void func_effect_800784B4(Effect* effect) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_46); - Graphics_SetScaleMtx(effect->scale2); +void Effect_Clouds_Draw(Clouds* this) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_46); + Graphics_SetScaleMtx(this->scale2); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_200D750); } -void func_effect_80078550(Effect* effect) { +void Effect_Effect366_Draw(Effect366* this) { RCP_SetupDL(&gMasterDisp, SETUPDL_67); - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); gDPSetEnvColor(gMasterDisp++, 101, 138, 153, 255); gSPDisplayList(gMasterDisp++, D_blue_marine_3000660); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_80078604(Effect* effect) { - if (effect->timer_50 == 0) { - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); +void Effect_Effect367_Draw(Effect367* this) { + if (this->timer_50 == 0) { + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); } } -void func_effect_8007868C(Effect* effect) { +void Effect_Effect344_Draw(Effect344* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); - if (effect->unk_44 >= 2) { + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); + if (this->unk_44 >= 2) { Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); @@ -409,10 +410,10 @@ void func_effect_8007868C(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_8007879C(Effect* effect) { +void Effect_Effect345_Draw(Effect345* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, effect->scale2 * 0.6f, 1.0f, effect->scale2 * 3.5f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2 * 0.6f, 1.0f, this->scale2 * 3.5f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1029780); @@ -421,52 +422,52 @@ void func_effect_8007879C(Effect* effect) { static s32 D_800D173C[] = { 255, 255, 255, 0, 0, 0, 255, 0, 255, 0, 0, 0, 255, 255, 0, 0, 0, 255, 0, 0 }; -void func_effect_800788B0(Effect* effect) { +void Effect_Effect346_Draw(Effect346* this) { s32 temp_ft3; s32 tmp; switch (gCurrentLevel) { case LEVEL_METEO: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); gDPSetPrimColor(gMasterDisp++, 0, 0, 128, 128, 128, 255); gSPDisplayList(gMasterDisp++, D_ME_601FF80); break; case LEVEL_AQUAS: RCP_SetupDL(&gMasterDisp, SETUPDL_67); - temp_ft3 = Math_ModF(effect->index, 4.0f); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) effect->scale1); + temp_ft3 = Math_ModF(this->index, 4.0f); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, (s32) this->scale1); tmp = temp_ft3 * 4.0f; gDPSetEnvColor(gMasterDisp++, D_800D173C[tmp + 0], D_800D173C[tmp + 1], D_800D173C[tmp + 2], 255); - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; } } -void func_effect_80078A64(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); +void Effect_Effect348_Draw(Effect348* this) { + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); } -void func_effect_80078AE0(void* effect) { +void func_effect_80078AE0(Effect* this) { } -void func_effect_80078AEC(Effect* effect) { +void Effect_Effect355_Draw(Effect355* this) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 180); - Graphics_SetScaleMtx(effect->scale2 * (13.0f + ((s32) (gGameFrameCount % 2U) * 2.5f))); + Graphics_SetScaleMtx(this->scale2 * (13.0f + ((s32) (gGameFrameCount % 2U) * 2.5f))); gSPDisplayList(gMasterDisp++, D_102ED50); } -void func_effect_80078B8C(Effect* effect) { +void Effect_Effect353_Draw(Effect353* this) { RCP_SetupDL_21(); gSPDisplayList(gMasterDisp++, D_101ABD0); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_80078BE0(Effect* effect) { +void Macbeth_Effect377_Draw(Effect377* this) { f32 var_fv0; gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 160); @@ -475,45 +476,45 @@ void func_effect_80078BE0(Effect* effect) { if ((gGameFrameCount % 2) != 0) { var_fv0 *= 1.2f; } - Graphics_SetScaleMtx(effect->scale2 * var_fv0); + Graphics_SetScaleMtx(this->scale2 * var_fv0); gSPDisplayList(gMasterDisp++, D_SX_600F8A0); } -void func_effect_80078C84(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); +void Effect_Effect356_Draw(Effect356* this) { + Graphics_SetScaleMtx(this->scale2); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 192); gSPDisplayList(gMasterDisp++, D_ME_6000A80); } -void func_effect_80078CE8(Effect* effect) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); - Graphics_SetScaleMtx(effect->scale2); +void Macbeth_Effect376_Draw(Effect376* this) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); + Graphics_SetScaleMtx(this->scale2); gSPDisplayList(gMasterDisp++, D_CO_6033000); } -void func_effect_80078D60(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_393; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->scale2 = scale2; +void func_effect_80078D60(Effect393* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_393; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->scale2 = scale2; if (scale2 == 3.1f) { - effect->vel.x = gActors[8].vel.x; - effect->vel.y = gActors[8].vel.y; - effect->vel.z = gActors[8].vel.z; + this->vel.x = gActors[8].vel.x; + this->vel.y = gActors[8].vel.y; + this->vel.z = gActors[8].vel.z; } if (scale2 != 30.0f) { - effect->state = 1; + this->state = 1; } if (scale2 == 3.5f) { - effect->state = 2; + this->state = 2; } - effect->timer_50 = 14; - Object_SetInfo(&effect->info, effect->obj.id); + this->timer_50 = 14; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_80078E50(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -527,39 +528,39 @@ void func_effect_80078E50(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void func_effect_80078EBC(Effect* effect) { - if (effect->state == 2) { - effect->vel.x = gPlayer[0].vel.x; - effect->vel.y = gPlayer[0].vel.y; - effect->vel.z = gPlayer[0].vel.z; +void Effect_Effect393_Update(Effect393* this) { + if (this->state == 2) { + this->vel.x = gPlayer[0].vel.x; + this->vel.y = gPlayer[0].vel.y; + this->vel.z = gPlayer[0].vel.z; } - effect->obj.rot.z += 35.0f; + this->obj.rot.z += 35.0f; - if (effect->timer_50 >= 7) { - effect->scale1 += 0.25f; + if (this->timer_50 >= 7) { + this->scale1 += 0.25f; } else { - effect->scale1 -= 0.25f; + this->scale1 -= 0.25f; } - if (effect->scale1 <= 0.0f) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->scale1 <= 0.0f) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_80078F78(Effect* effect) { - if (effect->state != 0) { +void Effect_Effect393_Draw(Effect393* this) { + if (this->state != 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_67); } else { RCP_SetupDL(&gMasterDisp, SETUPDL_63); } gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 255); - Graphics_SetScaleMtx(effect->scale2 * effect->scale1); + Graphics_SetScaleMtx(this->scale2 * this->scale1); gSPDisplayList(gMasterDisp++, D_101C2E0); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_8007905C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, u8 arg5) { +void func_effect_8007905C(Effect357* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2, u8 arg5) { Vec3f sp54; Vec3f sp48; Vec3f sp3C; @@ -567,26 +568,26 @@ void func_effect_8007905C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal f32 xAng; f32 yAng; - Effect_Initialize(effect); - effect->obj.status = OBJ_ACTIVE; - effect->obj.id = OBJ_EFFECT_357; + Effect_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_EFFECT_357; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->unk_4C = arg5; + this->unk_4C = arg5; if (scale2 == 1.6f) { - effect->vel.x = (xPos - gBosses[1].obj.pos.x) * 0.1f; - effect->vel.z = (zPos - gBosses[1].obj.pos.z) * 0.1f; + this->vel.x = (xPos - gBosses[1].obj.pos.x) * 0.1f; + this->vel.z = (zPos - gBosses[1].obj.pos.z) * 0.1f; } else if (scale2 == 1.3f) { - effect->vel.x = (RAND_FLOAT(0.05f) + 0.03f) * xPos; - effect->vel.z = (RAND_FLOAT(0.05f) + 0.03f) * zPos; - effect->vel.y = 5.0f; + this->vel.x = (RAND_FLOAT(0.05f) + 0.03f) * xPos; + this->vel.z = (RAND_FLOAT(0.05f) + 0.03f) * zPos; + this->vel.y = 5.0f; } else if (scale2 == 1.55f) { - effect->vel.x = RAND_FLOAT_CENTERED(10.0f); - effect->vel.z = RAND_FLOAT_CENTERED(10.0f); + this->vel.x = RAND_FLOAT_CENTERED(10.0f); + this->vel.z = RAND_FLOAT_CENTERED(10.0f); } else if ((gCurrentLevel == LEVEL_BOLSE) && ((scale2 == 5.11f) || (scale2 == 7.22f))) { sp3C.x = gPlayer[0].pos.x; sp3C.y = gPlayer[0].pos.y; @@ -600,21 +601,21 @@ void func_effect_8007905C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal sp54.y = RAND_FLOAT_CENTERED(50.0f); sp54.z = RAND_FLOAT(10.0f) + 150.0f; Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); - effect->vel.x = sp48.x; - effect->vel.y = sp48.y; - effect->vel.z = sp48.z; + this->vel.x = sp48.x; + this->vel.y = sp48.y; + this->vel.z = sp48.z; } else { - effect->vel.y = (gLevelType == LEVELTYPE_PLANET) ? RAND_FLOAT(7.0f) + 7.0f : RAND_FLOAT_CENTERED(10.0f); - effect->vel.x = RAND_FLOAT_CENTERED(10.0f); - effect->vel.z = RAND_FLOAT_CENTERED(10.0f); + this->vel.y = (gLevelType == LEVELTYPE_PLANET) ? RAND_FLOAT(7.0f) + 7.0f : RAND_FLOAT_CENTERED(10.0f); + this->vel.x = RAND_FLOAT_CENTERED(10.0f); + this->vel.z = RAND_FLOAT_CENTERED(10.0f); } - effect->scale2 = (RAND_FLOAT(0.8f) + 0.3f) * scale2; - effect->timer_50 = RAND_INT(50.0f) + 70; - effect->obj.rot.x = RAND_FLOAT(360.0f); - effect->unk_60.x = RAND_FLOAT_CENTERED(30.0f); - effect->unk_60.y = RAND_FLOAT_CENTERED(30.0f); - effect->unk_60.z = RAND_FLOAT_CENTERED(30.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->scale2 = (RAND_FLOAT(0.8f) + 0.3f) * scale2; + this->timer_50 = RAND_INT(50.0f) + 70; + this->obj.rot.x = RAND_FLOAT(360.0f); + this->unk_60.x = RAND_FLOAT_CENTERED(30.0f); + this->unk_60.y = RAND_FLOAT_CENTERED(30.0f); + this->unk_60.z = RAND_FLOAT_CENTERED(30.0f); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_800794CC(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -662,42 +663,42 @@ void func_effect_80079618(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void func_effect_8007968C(Effect* effect) { - if ((gCurrentLevel != LEVEL_MACBETH) || (effect->unk_44 != 7)) { - if ((effect->timer_50 == 0) || (effect->obj.pos.y < gGroundHeight)) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect357_Update(Effect357* this) { + if ((gCurrentLevel != LEVEL_MACBETH) || (this->unk_44 != 7)) { + if ((this->timer_50 == 0) || (this->obj.pos.y < gGroundHeight)) { + Object_Kill(&this->obj, this->sfxSource); } } else { if (((gGameFrameCount % 4) == 0)) { - func_effect_8007D2C8(effect->obj.pos.x, effect->obj.pos.y + 550.0f, effect->obj.pos.z, 10.0f); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 550.0f, this->obj.pos.z, 10.0f); } - if ((effect->timer_50 == 0) || (effect->obj.pos.y < (gGroundHeight - 100.0f))) { - Object_Kill(&effect->obj, effect->sfxSource); + if ((this->timer_50 == 0) || (this->obj.pos.y < (gGroundHeight - 100.0f))) { + Object_Kill(&this->obj, this->sfxSource); } } - effect->obj.rot.x += effect->unk_60.x; - effect->obj.rot.y += effect->unk_60.y; - effect->obj.rot.z += effect->unk_60.z; + this->obj.rot.x += this->unk_60.x; + this->obj.rot.y += this->unk_60.y; + this->obj.rot.z += this->unk_60.z; if (gLevelType == LEVELTYPE_PLANET) { - effect->vel.y -= 0.5f; + this->vel.y -= 0.5f; } if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCsFrameCount > 175)) { - effect->vel.x *= 0.95f; - effect->vel.y *= 0.95f; - effect->vel.z *= 0.95f; + this->vel.x *= 0.95f; + this->vel.y *= 0.95f; + this->vel.z *= 0.95f; } - if ((gCurrentLevel == LEVEL_MACBETH) && (effect->unk_44 == 10)) { - effect->obj.rot.x = 0.0f; - effect->obj.rot.y = 0.0f; - if (effect->timer_50 >= 25) { - effect->scale1 = 0.5f; - } else if (effect->scale1 > 0.03) { - effect->scale1 -= 0.02f; + if ((gCurrentLevel == LEVEL_MACBETH) && (this->unk_44 == 10)) { + this->obj.rot.x = 0.0f; + this->obj.rot.y = 0.0f; + if (this->timer_50 >= 25) { + this->scale1 = 0.5f; + } else if (this->scale1 > 0.03) { + this->scale1 -= 0.02f; } } } @@ -709,11 +710,11 @@ bool func_effect_800798C4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, vo return false; } -void func_effect_800798F0(Effect* effect) { +void Effect_Effect357_Draw(Effect357* this) { Vec3f frameJointTable[50]; if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { - Display_SetSecondLight(&effect->obj.pos); + Display_SetSecondLight(&this->obj.pos); } RCP_SetupDL(&gMasterDisp, SETUPDL_29); @@ -722,13 +723,13 @@ void func_effect_800798F0(Effect* effect) { gSPFogPosition(gMasterDisp++, gFogNear, 1005); } - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); switch (gCurrentLevel) { case LEVEL_MACBETH: - switch (effect->unk_44) { + switch (this->unk_44) { case 1: - if ((effect->index % 2) != 0) { + if ((this->index % 2) != 0) { gSPDisplayList(gMasterDisp++, D_MA_6022530); } else { gSPDisplayList(gMasterDisp++, D_MA_6022450); @@ -737,7 +738,7 @@ void func_effect_800798F0(Effect* effect) { case 2: RCP_SetupDL(&gMasterDisp, SETUPDL_57); - if ((effect->index % 2) != 0) { + if ((this->index % 2) != 0) { gSPDisplayList(gMasterDisp++, D_MA_601A7A0); } else { gSPDisplayList(gMasterDisp++, D_MA_60223C0); @@ -747,7 +748,7 @@ void func_effect_800798F0(Effect* effect) { case 7: Animation_GetFrameData(&D_MA_6027320, 0, frameJointTable); - Animation_DrawSkeleton(1, D_MA_602742C, frameJointTable, func_effect_800798C4, NULL, effect, + Animation_DrawSkeleton(1, D_MA_602742C, frameJointTable, func_effect_800798C4, NULL, this, &gIdentityMatrix); break; @@ -767,7 +768,7 @@ void func_effect_800798F0(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_67); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 80, 0, 255); - Graphics_SetScaleMtx(effect->scale1); + Graphics_SetScaleMtx(this->scale1); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -814,7 +815,7 @@ void func_effect_800798F0(Effect* effect) { break; default: - if ((effect->index % 2) != 0) { + if ((this->index % 2) != 0) { gSPDisplayList(gMasterDisp++, D_10194C0); } else { gSPDisplayList(gMasterDisp++, D_1024290); @@ -830,9 +831,9 @@ void func_effect_800798F0(Effect* effect) { break; default: - switch (effect->unk_4C) { + switch (this->unk_4C) { case 0: - if ((effect->index % 2) != 0) { + if ((this->index % 2) != 0) { gSPDisplayList(gMasterDisp++, D_10194C0); } else { gSPDisplayList(gMasterDisp++, D_1024290); @@ -840,7 +841,7 @@ void func_effect_800798F0(Effect* effect) { break; case 1: - switch ((s32) (effect->index % 4U)) { + switch ((s32) (this->index % 4U)) { case 0: Matrix_Scale(gGfxMatrix, 1.0f, 0.3f, 1.0f, MTXF_APPLY); break; @@ -871,41 +872,41 @@ void func_effect_800798F0(Effect* effect) { } } -void func_effect_8007A28C(Effect* effect) { +void Effect_Effect383_Update(Effect383* this) { Texture_Scroll(D_10190C0, 16, 32, 0); gGroundClipMode = 2; - effect->obj.rot.y += 1.0f; - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.05f, 1.5f, 0.001f); + this->obj.rot.y += 1.0f; + Math_SmoothStepToF(&this->scale2, this->scale1, 0.05f, 1.5f, 0.001f); - if (effect->timer_50 > 10) { + if (this->timer_50 > 10) { D_ctx_801779A8[0] = 60.0f; } - if (effect->timer_50 == 48) { + if (this->timer_50 == 48) { gFillScreenAlpha = 150; } - if (effect->timer_50 > 45) { + if (this->timer_50 > 45) { gFillScreenAlphaTarget = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; } gFillScreenAlphaStep = 3; - if (effect->timer_50 == 0) { - effect->unk_44 -= 2; - if (effect->unk_44 < 0) { - effect->unk_44 = 0; - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + this->unk_44 -= 2; + if (this->unk_44 < 0) { + this->unk_44 = 0; + Object_Kill(&this->obj, this->sfxSource); gGroundClipMode = 0; } } } -void func_effect_8007A3C0(Effect* effect) { +void Effect_Effect383_Draw(Effect383* this) { if (gReflectY > 0) { - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64_2(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_10182C0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -913,20 +914,20 @@ void func_effect_8007A3C0(Effect* effect) { } } -void func_effect_8007A4B8(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_383; - effect->scale1 = scale1; - effect->timer_50 = 50; - effect->unk_44 = 200; +void func_effect_8007A4B8(Effect383* this, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_383; + this->scale1 = scale1; + this->timer_50 = 50; + this->unk_44 = 200; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - AUDIO_PLAY_SFX(NA_SE_EN_STAR_EXPLOSION, effect->sfxSource, 4); - Object_SetInfo(&effect->info, effect->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_STAR_EXPLOSION, this->sfxSource, 4); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { @@ -941,73 +942,73 @@ void func_effect_8007A568(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { func_effect_8007B344(xPos, yPos, zPos, 80.0f, 4); } -void func_effect_8007A5F8(Effect* effect, Vec3f* pos, u32 sfxId) { - Effect_Initialize(effect); - effect->obj.status = OBJ_ACTIVE; - effect->obj.id = OBJ_EFFECT_373; +void Effect_SetupTimedSfxAtPos(TimedSfx* this, Vec3f* pos, u32 sfxId) { + Effect_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_EFFECT_TIMED_SFX; - effect->obj.pos.x = pos->x; - effect->obj.pos.y = pos->y; - effect->obj.pos.z = pos->z; + this->obj.pos.x = pos->x; + this->obj.pos.y = pos->y; + this->obj.pos.z = pos->z; - effect->timer_50 = 50; + this->timer_50 = 50; if ((sfxId == NA_SE_OB_EXPLOSION_S) || (sfxId == NA_SE_OB_SMOKE)) { - AUDIO_PLAY_SFX(sfxId, effect->sfxSource, 0); + AUDIO_PLAY_SFX(sfxId, this->sfxSource, 0); if (sfxId == NA_SE_OB_SMOKE) { - effect->timer_50 = 300; + this->timer_50 = 300; } } else { - AUDIO_PLAY_SFX(sfxId, effect->sfxSource, 4); + AUDIO_PLAY_SFX(sfxId, this->sfxSource, 4); } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } -void func_effect_8007A6F0(Vec3f* pos, s32 sfxId) { +void Effect_SpawnTimedSfxAtPos(Vec3f* pos, s32 sfxId) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_effect_8007A5F8(&gEffects[i], pos, sfxId); + Effect_SetupTimedSfxAtPos(&gEffects[i], pos, sfxId); break; } } } -void func_effect_8007A748(Effect* effect) { - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_TimedSfx_Update(TimedSfx* this) { + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } -bool func_effect_8007A774(Player* player, Effect* effect, f32 arg2) { - if ((fabsf(player->trueZpos - effect->obj.pos.z) < arg2) && (fabsf(player->pos.x - effect->obj.pos.x) < arg2) && - (fabsf(player->pos.y - effect->obj.pos.y) < arg2) && (player->mercyTimer == 0)) { - Player_ApplyDamage(player, 0, effect->info.damage); +bool func_effect_8007A774(Player* player, Effect* this, f32 arg2) { + if ((fabsf(player->trueZpos - this->obj.pos.z) < arg2) && (fabsf(player->pos.x - this->obj.pos.x) < arg2) && + (fabsf(player->pos.y - this->obj.pos.y) < arg2) && (player->mercyTimer == 0)) { + Player_ApplyDamage(player, 0, this->info.damage); return true; } else { return false; } } -void func_effect_8007A818(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1, u8 arg5, u8 arg6, u16 arg7) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_359; +void func_effect_8007A818(Effect359* this, f32 xPos, f32 yPos, f32 zPos, f32 scale1, u8 arg5, u8 arg6, u16 arg7) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_359; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale1 = scale1; - effect->unk_44 = arg5; - effect->unk_46 = arg6; - effect->unk_60.z = RAND_FLOAT_CENTERED(10.0f); - effect->unk_60.y = scale1 * 0.1f; + this->scale1 = scale1; + this->unk_44 = arg5; + this->unk_46 = arg6; + this->unk_60.z = RAND_FLOAT_CENTERED(10.0f); + this->unk_60.y = scale1 * 0.1f; if (arg7 != 0) { - effect->vel.x = RAND_FLOAT_CENTERED(30.0f); + this->vel.x = RAND_FLOAT_CENTERED(30.0f); } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007A900(f32 xPos, f32 yPos, f32 zPos, f32 scale1, u8 arg4, u8 arg5, u16 arg6) { @@ -1023,70 +1024,70 @@ void func_effect_8007A900(f32 xPos, f32 yPos, f32 zPos, f32 scale1, u8 arg4, u8 } } -void func_effect_8007A994(Effect* effect) { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.1f, 10.0f, 0.01f); - effect->obj.rot.z += effect->unk_60.z; - effect->vel.y += effect->unk_60.y; +void Effect_Effect359_Update(Effect359* this) { + Math_SmoothStepToF(&this->scale2, this->scale1, 0.1f, 10.0f, 0.01f); + this->obj.rot.z += this->unk_60.z; + this->vel.y += this->unk_60.y; - if ((effect->unk_4A % 2) != 0) { - effect->unk_48++; - if (effect->unk_48 > 5) { - effect->unk_48 = 5; + if ((this->unk_4A % 2) != 0) { + this->unk_48++; + if (this->unk_48 > 5) { + this->unk_48 = 5; } } - effect->unk_44 -= effect->unk_46; - if (effect->unk_44 <= 20) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44 -= this->unk_46; + if (this->unk_44 <= 20) { + Object_Kill(&this->obj, this->sfxSource); } - effect->unk_4A++; + this->unk_4A++; } static Gfx* D_800D178C[] = { D_TI_6003440, D_TI_60034E0, D_TI_6003580, D_TI_6003620, D_TI_60036C0, D_TI_6003760 }; -void func_effect_8007AA60(Effect* effect) { +void Effect_Effect359_Draw(Effect359* this) { RCP_SetupDL(&gMasterDisp, SETUPDL_68); - gDPSetPrimColor(gMasterDisp++, 0, 0, 31, 10, 00, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 31, 10, 00, this->unk_44); gDPSetEnvColor(gMasterDisp++, 141, 73, 5, 0); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_800D178C[effect->unk_4C]); - effect->unk_4C = effect->unk_48; + gSPDisplayList(gMasterDisp++, D_800D178C[this->unk_4C]); + this->unk_4C = this->unk_48; RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_8007AB50(Effect* effect) { - if (effect->state == 0) { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.1f, 10.0f, 0.0f); - effect->unk_44 -= 20; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect372_Update(Effect372* this) { + if (this->state == 0) { + Math_SmoothStepToF(&this->scale2, this->scale1, 0.1f, 10.0f, 0.0f); + this->unk_44 -= 20; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } else { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.1f, 10.0f, 0.0f); - effect->unk_44 -= 10; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + Math_SmoothStepToF(&this->scale2, this->scale1, 0.1f, 10.0f, 0.0f); + this->unk_44 -= 10; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007AC0C(Effect* effect, f32 xPos, f32 unused_posY, f32 zPos, f32 scale2, f32 scale1, f32 yRot) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_372; +void func_effect_8007AC0C(Effect372* this, f32 xPos, f32 unused_posY, f32 zPos, f32 scale2, f32 scale1, f32 yRot) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_372; - effect->obj.pos.x = xPos; - effect->obj.pos.y = gGroundHeight; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = gGroundHeight; + this->obj.pos.z = zPos; - effect->unk_44 = 180; - effect->scale2 = scale2; - effect->scale1 = scale1; - effect->obj.rot.y = yRot; - effect->vel.x = gPlayer[0].vel.x * 0.6f; - effect->vel.z = gPlayer[0].vel.z * 0.6; // Forgotten f means bad codegen - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_44 = 180; + this->scale2 = scale2; + this->scale1 = scale1; + this->obj.rot.y = yRot; + this->vel.x = gPlayer[0].vel.x * 0.6f; + this->vel.z = gPlayer[0].vel.z * 0.6; // Forgotten f means bad codegen + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007ACE0(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, f32 yRot) { @@ -1100,21 +1101,21 @@ void func_effect_8007ACE0(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, } } -void func_effect_8007AD58(Effect* effect, f32 xPos, f32 unused_posY, f32 zPos, f32 scale2, f32 scale1, f32 yRot) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_372; - effect->state = 1; +void func_effect_8007AD58(Effect372* this, f32 xPos, f32 unused_posY, f32 zPos, f32 scale2, f32 scale1, f32 yRot) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_372; + this->state = 1; - effect->obj.pos.x = xPos; - effect->obj.pos.y = gGroundHeight; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = gGroundHeight; + this->obj.pos.z = zPos; - effect->unk_44 = 180; - effect->scale2 = scale2; - effect->scale1 = scale1; - effect->obj.rot.y = yRot; - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_44 = 180; + this->scale2 = scale2; + this->scale1 = scale1; + this->obj.rot.y = yRot; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007ADF4(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1) { @@ -1136,20 +1137,20 @@ void func_effect_8007ADF4(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1) } } -void func_effect_8007AF30(Effect* effect, f32 xPos, f32 zPos, f32 xVel, f32 zVel, f32 scale1) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_382; +void func_effect_8007AF30(Effect382* this, f32 xPos, f32 zPos, f32 xVel, f32 zVel, f32 scale1) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_382; - effect->obj.pos.x = xPos; - effect->obj.pos.y = -10.0f; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = -10.0f; + this->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.z = zVel - gPathVelZ; - effect->scale1 = scale1; - effect->timer_50 = 100; - Object_SetInfo(&effect->info, effect->obj.id); + this->vel.x = xVel; + this->vel.z = zVel - gPathVelZ; + this->scale1 = scale1; + this->timer_50 = 100; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007AFD0(f32 xPos, f32 zPos, f32 xVel, f32 zVel, f32 scale1) { @@ -1163,42 +1164,42 @@ void func_effect_8007AFD0(f32 xPos, f32 zPos, f32 xVel, f32 zVel, f32 scale1) { } } -void func_effect_8007B040(Effect* effect) { +void Effect_Effect382_Update(Effect382* this) { f32 sp2C; s32 sp28; - if (Play_CheckDynaFloorCollision(&sp2C, &sp28, effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z)) { - D_ctx_801782EC[sp28] = effect->scale1; - D_ctx_801782EC[sp28 + 1] = effect->scale1 * 0.7f; - D_ctx_801782EC[sp28 - 1] = effect->scale1 * 0.7f; + if (Play_CheckDynaFloorCollision(&sp2C, &sp28, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + D_ctx_801782EC[sp28] = this->scale1; + D_ctx_801782EC[sp28 + 1] = this->scale1 * 0.7f; + D_ctx_801782EC[sp28 - 1] = this->scale1 * 0.7f; } - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_8007B0F4(Effect* effect) { - Math_SmoothStepToF(&effect->scale2, effect->scale1 * 3.0f, 0.1f, 10.0f, 0.0f); - effect->unk_44 -= 13; - effect->obj.rot.y = 180.0f - effect->obj.rot.y; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect381_Update(Effect381* this) { + Math_SmoothStepToF(&this->scale2, this->scale1 * 3.0f, 0.1f, 10.0f, 0.0f); + this->unk_44 -= 13; + this->obj.rot.y = 180.0f - this->obj.rot.y; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_8007B180(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_381; +void func_effect_8007B180(Effect381* this, f32 xPos, f32 yPos, f32 zPos, f32 scale1) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_381; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->unk_44 = 255; - effect->scale1 = scale1; - Object_SetInfo(&effect->info, effect->obj.id); - AUDIO_PLAY_SFX(NA_SE_SPLASH_LEVEL_L, effect->sfxSource, 0); + this->unk_44 = 255; + this->scale1 = scale1; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_SPLASH_LEVEL_L, this->sfxSource, 0); } void func_effect_8007B228(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { @@ -1212,22 +1213,22 @@ void func_effect_8007B228(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { } } -void func_effect_8007B2BC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg5) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_384; +void func_effect_8007B2BC(Effect384* this, f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg5) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_384; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale1 = scale1; - effect->unk_44 = 255; - effect->unk_4C = arg5; - Object_SetInfo(&effect->info, effect->obj.id); + this->scale1 = scale1; + this->unk_44 = 255; + this->unk_4C = arg5; + Object_SetInfo(&this->info, this->obj.id); } -// Orange-yellowish light effect simulating an explosion +// Orange-yellowish light this simulating an explosion void func_effect_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg4) { s32 i; @@ -1239,16 +1240,16 @@ void func_effect_8007B344(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg4) { } } -void func_effect_8007B3B8(Effect* effect) { +void Effect_Effect384_Update(Effect384* this) { f32 var_fv0; f32 var_fv1; s32 var_v0; - if (effect->unk_4C == 6) { + if (this->unk_4C == 6) { var_fv0 = 15.0f; var_fv1 = 0.05f; var_v0 = 4; - } else if ((effect->unk_4C == 5) && ((gCurrentLevel == LEVEL_KATINA) || (gCurrentLevel == LEVEL_METEO))) { + } else if ((this->unk_4C == 5) && ((gCurrentLevel == LEVEL_KATINA) || (gCurrentLevel == LEVEL_METEO))) { var_fv0 = 10.0f; var_fv1 = 0.1f; var_v0 = 4; @@ -1258,35 +1259,35 @@ void func_effect_8007B3B8(Effect* effect) { var_v0 = 8; } - Math_SmoothStepToF(&effect->scale2, effect->scale1, var_fv1, var_fv0, 0.0f); + Math_SmoothStepToF(&this->scale2, this->scale1, var_fv1, var_fv0, 0.0f); - effect->unk_44 -= var_v0; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44 -= var_v0; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_8007B494(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg5) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_385; +void func_effect_8007B494(Effect385* this, f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg5) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_385; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->obj.rot.x = 90.0f; - effect->scale1 = scale1; - effect->unk_44 = arg5; + this->obj.rot.x = 90.0f; + this->scale1 = scale1; + this->unk_44 = arg5; if (arg5 < 60) { - effect->unk_46 = 1; + this->unk_46 = 1; } else if (arg5 < 90) { - effect->unk_46 = 2; + this->unk_46 = 2; } else { - effect->unk_46 = 3; + this->unk_46 = 3; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007B550(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg4) { @@ -1300,83 +1301,83 @@ void func_effect_8007B550(f32 xPos, f32 yPos, f32 zPos, f32 scale1, s32 arg4) { } } -void func_effect_8007B5C0(Effect* effect) { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.1f, 10.0f, 0.1f); - effect->unk_44 -= effect->unk_46; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect385_Update(Effect385* this) { + Math_SmoothStepToF(&this->scale2, this->scale1, 0.1f, 10.0f, 0.1f); + this->unk_44 -= this->unk_46; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_8007B62C(Effect* effect) { - if (effect->timer_50 == 0) { - effect->unk_46 -= 4; - if (effect->unk_46 <= 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Clouds_Update(Clouds* this) { + if (this->timer_50 == 0) { + this->unk_46 -= 4; + if (this->unk_46 <= 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007B670(Effect* effect) { +void Effect_Effect388_Update(Effect388* this) { } -void func_effect_8007B67C(Effect* effect) { +void Effect_Effect389_Update(Effect389* this) { s32 var_v1; - effect->unk_46 += 2; + this->unk_46 += 2; - if (effect->unk_46 >= 10) { - effect->unk_46 = 10; + if (this->unk_46 >= 10) { + this->unk_46 = 10; } - if (effect->unk_46 >= 9) { - effect->unk_48++; - if (effect->unk_48 >= 10) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_46 >= 9) { + this->unk_48++; + if (this->unk_48 >= 10) { + Object_Kill(&this->obj, this->sfxSource); } } - var_v1 = effect->unk_4A; + var_v1 = this->unk_4A; if (var_v1 != 0) { if (var_v1 > 10) { var_v1 -= 10; } - effect->vel.x = gPlayer[var_v1 - 1].vel.x; - effect->vel.y = gPlayer[var_v1 - 1].vel.y; - effect->vel.z = gPlayer[var_v1 - 1].vel.z; + this->vel.x = gPlayer[var_v1 - 1].vel.x; + this->vel.y = gPlayer[var_v1 - 1].vel.y; + this->vel.z = gPlayer[var_v1 - 1].vel.z; } } -void func_effect_8007B758(Effect* effect) { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.1f, 10.0f, 0.1f); - effect->unk_44 -= 2; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect347_Update(Effect347* this) { + Math_SmoothStepToF(&this->scale2, this->scale1, 0.1f, 10.0f, 0.1f); + this->unk_44 -= 2; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } - func_effect_8007A774(gPlayer, effect, effect->scale2 * 20.0f); + func_effect_8007A774(gPlayer, this, this->scale2 * 20.0f); } -void func_effect_8007B7E8(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_364; +void func_effect_8007B7E8(Effect364* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_364; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = RAND_FLOAT_CENTERED(5.0f); - effect->vel.y = RAND_FLOAT_CENTERED(3.0f); - effect->unk_48 = 3; + this->vel.x = RAND_FLOAT_CENTERED(5.0f); + this->vel.y = RAND_FLOAT_CENTERED(3.0f); + this->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - effect->unk_48 = -effect->unk_48; + this->unk_48 = -this->unk_48; } - effect->unk_4A = 50; - effect->unk_46 = 1; - effect->scale2 = scale2 * 0.2f; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_4A = 50; + this->unk_46 = 1; + this->scale2 = scale2 * 0.2f; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007B8F8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -1390,26 +1391,26 @@ void func_effect_8007B8F8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void func_effect_8007B960(Effect* effect) { - effect->scale2 += 0.07f; - effect->unk_4A -= effect->unk_46; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect364_Update(Effect364* this) { + this->scale2 += 0.07f; + this->unk_4A -= this->unk_46; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->unk_48; - effect->vel.y += 0.2f; + this->obj.rot.z += this->unk_48; + this->vel.y += 0.2f; } -void func_effect_8007B9DC(Effect* effect) { +void Effect_Effect364_Draw(Effect364* this) { //! DEBUG: Hold Z on controller 4 to set up a display list. if (gControllerHold[3].button & Z_TRIG) { RCP_SetupDL(&gMasterDisp, SETUPDL_4); } - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); if (gCurrentLevel != LEVEL_MACBETH) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 140, 99, 58, effect->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 140, 99, 58, this->unk_4A); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, (gGameFrameCount % 4U) + 5, (gGameFrameCount % 4U) + 3, (gGameFrameCount % 4U) + 3, 220); @@ -1424,38 +1425,38 @@ void func_effect_8007B9DC(Effect* effect) { } } -void func_effect_8007BB14(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_362; +void func_effect_8007BB14(Effect362* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_362; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = RAND_FLOAT_CENTERED(5.0f); - effect->vel.y = RAND_FLOAT_CENTERED(3.0f); - effect->unk_48 = 3; + this->vel.x = RAND_FLOAT_CENTERED(5.0f); + this->vel.y = RAND_FLOAT_CENTERED(3.0f); + this->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - effect->unk_48 = -effect->unk_48; + this->unk_48 = -this->unk_48; } - effect->unk_4A = 180; - effect->unk_46 = 8; + this->unk_4A = 180; + this->unk_46 = 8; if (scale2 > 15.0f) { - effect->unk_46 = 5; - effect->unk_4A = 80; + this->unk_46 = 5; + this->unk_4A = 80; } - effect->scale2 = scale2 * 0.25f; - effect->obj.rot.z = RAND_FLOAT(360.0f); + this->scale2 = scale2 * 0.25f; + this->obj.rot.z = RAND_FLOAT(360.0f); if (scale2 == 6.0f) { - effect->vel.z = gPlayer[0].vel.z * 0.6f; + this->vel.z = gPlayer[0].vel.z * 0.6f; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007BC7C(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -1469,69 +1470,69 @@ void func_effect_8007BC7C(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void func_effect_8007BCE8(Effect* effect) { +void Effect_Effect362_Update(Effect362* this) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { - effect->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); - effect->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + this->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); + this->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); } if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) { - effect->unk_46 = 2; - effect->vel.y -= 0.13f; + this->unk_46 = 2; + this->vel.y -= 0.13f; } - effect->scale2 += 0.07f; - effect->unk_4A -= effect->unk_46; + this->scale2 += 0.07f; + this->unk_4A -= this->unk_46; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->unk_48; - effect->vel.y += 0.2f; + this->obj.rot.z += this->unk_48; + this->vel.y += 0.2f; } -void func_effect_8007BDE0(Effect* effect) { - effect->scale2 += 0.04f; - effect->unk_4A -= 2; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect361_Update(Effect361* this) { + this->scale2 += 0.04f; + this->unk_4A -= 2; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->unk_48; - effect->vel.y += effect->scale1; + this->obj.rot.z += this->unk_48; + this->vel.y += this->scale1; } -void func_effect_8007BE54(Effect* effect) { - effect->scale2 += 0.02f; - effect->unk_4A -= 3; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect360_Update(Effect360* this) { + this->scale2 += 0.02f; + this->unk_4A -= 3; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->vel.z = gPlayer[0].vel.z + 7.0f; - effect->obj.rot.z += effect->unk_48; - effect->vel.y += 0.1f; + this->vel.z = gPlayer[0].vel.z + 7.0f; + this->obj.rot.z += this->unk_48; + this->vel.y += 0.1f; } -void func_effect_8007BEE8(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); +void Effect_Effect360_361_362_Draw(Effect* this) { + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); gSPDisplayList(gMasterDisp++, D_BG_PLANET_2010A30); } -void func_effect_8007BF64(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, +void func_effect_8007BF64(Effect386* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 timer50) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_386; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_386; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; - effect->scale2 = scale2; - effect->timer_50 = timer50; - Object_SetInfo(&effect->info, effect->obj.id); + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->scale2 = scale2; + this->timer_50 = timer50; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007BFFC(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 timer50) { @@ -1545,22 +1546,22 @@ void func_effect_8007BFFC(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 } } -void func_effect_8007C088(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, +void func_effect_8007C088(Effect390* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 timer50) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_390; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_390; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; - effect->scale2 = scale2; - effect->timer_50 = timer50; - Object_SetInfo(&effect->info, effect->obj.id); + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->scale2 = scale2; + this->timer_50 = timer50; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007C120(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 timer50) { @@ -1586,53 +1587,53 @@ void func_effect_8007C1AC(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 } } -void func_effect_8007C250(Effect* effect) { +void Effect_Effect386_Update(Effect386* this) { f32 randX; f32 randY; f32 randOther; s32 var_v0; - Math_SmoothStepToF(&effect->vel.x, 0.0f, 0.2f, 10.0f, 0.1f); - Math_SmoothStepToF(&effect->vel.y, 0.0f, 0.2f, 10.0f, 0.1f); - Math_SmoothStepToF(&effect->vel.z, 0.0f, 0.2f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.2f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.2f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.2f, 10.0f, 0.1f); var_v0 = 4 - 1; if (gLevelMode == LEVELMODE_ALL_RANGE) { var_v0 = 2 - 1; } - if ((effect->timer_50 & var_v0) == 0) { + if ((this->timer_50 & var_v0) == 0) { randX = RAND_FLOAT_CENTERED(40.0f); randY = RAND_FLOAT_CENTERED(40.0f); randOther = RAND_FLOAT(0.5f) + 1.0f; - func_effect_8007D0E0(effect->obj.pos.x + randX, effect->obj.pos.y + randY, effect->obj.pos.z, - effect->scale2 * randOther); - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + func_effect_8007D0E0(this->obj.pos.x + randX, this->obj.pos.y + randY, this->obj.pos.z, + this->scale2 * randOther); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007C3B4(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, +void func_effect_8007C3B4(Effect389* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 arg8) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_389; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_389; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - effect->scale2 = scale2; - effect->unk_4A = arg8; - effect->unk_4C = RAND_INT(12.0f); - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); - effect->unk_44 = 255; + this->scale2 = scale2; + this->unk_4A = arg8; + this->unk_4C = RAND_INT(12.0f); + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); + this->unk_44 = 255; } void func_effect_8007C484(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 arg7) { @@ -1646,35 +1647,35 @@ void func_effect_8007C484(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 } } -void func_effect_8007C50C(Effect* effect) { +void Effect_Effect390_Update(Effect390* this) { f32 randX; f32 randY; f32 randOther; - if ((effect->timer_50 % 8) == 0) { - randX = RAND_FLOAT_CENTERED(40.0f) * effect->scale2; - randY = RAND_FLOAT_CENTERED(40.0f) * effect->scale2; + if ((this->timer_50 % 8) == 0) { + randX = RAND_FLOAT_CENTERED(40.0f) * this->scale2; + randY = RAND_FLOAT_CENTERED(40.0f) * this->scale2; randOther = RAND_FLOAT(1.0f) + 1.0f; - func_effect_8007C484(effect->obj.pos.x + randX, effect->obj.pos.y + randY, effect->obj.pos.z, effect->vel.x, - effect->vel.y, effect->vel.z, effect->scale2 * randOther, 0); - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + func_effect_8007C484(this->obj.pos.x + randX, this->obj.pos.y + randY, this->obj.pos.z, this->vel.x, + this->vel.y, this->vel.z, this->scale2 * randOther, 0); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007C608(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_387; +void func_effect_8007C608(Effect387* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_387; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale2 = scale2; - effect->timer_50 = timer50; - Object_SetInfo(&effect->info, effect->obj.id); + this->scale2 = scale2; + this->timer_50 = timer50; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007C688(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) { @@ -1688,37 +1689,37 @@ void func_effect_8007C688(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) } } -void func_effect_8007C6FC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_343; +void func_effect_8007C6FC(Effect343* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_343; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->unk_48 = 3; - effect->vel.y = 5.0f; + this->unk_48 = 3; + this->vel.y = 5.0f; if (Rand_ZeroOne() < 0.5f) { - effect->unk_48 = -effect->unk_48; + this->unk_48 = -this->unk_48; } if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT)) { - effect->unk_4A = 180; + this->unk_4A = 180; } else { - effect->unk_4A = 255; + this->unk_4A = 255; } - effect->scale2 = scale2 * 0.25f; - effect->obj.rot.z = RAND_FLOAT(360.0f); - effect->unk_44 = 0; + this->scale2 = scale2 * 0.25f; + this->obj.rot.z = RAND_FLOAT(360.0f); + this->unk_44 = 0; if (Rand_ZeroOne() < 0.3f) { - effect->unk_44 = 1; - effect->unk_4A = 255; - effect->scale2 = scale2 * 0.3f; + this->unk_44 = 1; + this->unk_4A = 255; + this->scale2 = scale2 * 0.3f; } - effect->scale1 = RAND_FLOAT(0.2f); - Object_SetInfo(&effect->info, effect->obj.id); + this->scale1 = RAND_FLOAT(0.2f); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007C85C(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -1732,7 +1733,7 @@ void func_effect_8007C85C(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void func_effect_8007C8C4(Effect* effect) { +void Effect_Effect387_Update(Effect387* this) { f32 randX; f32 randY; f32 randOther; @@ -1743,121 +1744,121 @@ void func_effect_8007C8C4(Effect* effect) { var_v0 = 4 - 1; } - if (((effect->timer_50 & var_v0) == 0) && (gLevelType == LEVELTYPE_PLANET)) { + if (((this->timer_50 & var_v0) == 0) && (gLevelType == LEVELTYPE_PLANET)) { randX = RAND_FLOAT_CENTERED(10.0f); randY = RAND_FLOAT_CENTERED(10.0f); randOther = RAND_FLOAT(0.5f) + 1.0f; - func_effect_8007C85C(effect->obj.pos.x + randX, effect->obj.pos.y + randY, effect->obj.pos.z, - effect->scale2 * randOther); - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + func_effect_8007C85C(this->obj.pos.x + randX, this->obj.pos.y + randY, this->obj.pos.z, + this->scale2 * randOther); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007C9E0(Effect* effect) { - if (effect->unk_44 == 0) { - effect->scale2 *= 1.03f; - effect->unk_4A -= 3; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect343_Update(Effect343* this) { + if (this->unk_44 == 0) { + this->scale2 *= 1.03f; + this->unk_4A -= 3; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->unk_48; - effect->vel.y += 0.3f; - effect->vel.x += effect->scale1; + this->obj.rot.z += this->unk_48; + this->vel.y += 0.3f; + this->vel.x += this->scale1; } else { - effect->scale2 *= 1.03f; - effect->unk_4A -= 7; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->scale2 *= 1.03f; + this->unk_4A -= 7; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->unk_48; - effect->vel.y += 0.3f; - effect->vel.x += effect->scale1; + this->obj.rot.z += this->unk_48; + this->vel.y += 0.3f; + this->vel.x += this->scale1; } } -void func_effect_8007CAF0(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - if (effect->unk_44 == 0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, effect->unk_4A); +void Effect_Effect343_Draw(Effect343* this) { + Graphics_SetScaleMtx(this->scale2); + if (this->unk_44 == 0) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, this->unk_4A); gSPDisplayList(gMasterDisp++, D_102A010); } else { Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20031B0); } } -void func_effect_8007CC00(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_FIRE_SMOKE; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->scale2 = scale2; - effect->scale1 = 0.5f; - effect->unk_4C = 0; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); +void func_effect_8007CC00(EffectFireSmoke* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_FIRE_SMOKE; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->scale2 = scale2; + this->scale1 = 0.5f; + this->unk_4C = 0; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); if (gLevelType == LEVELTYPE_PLANET) { - effect->unk_44 = 230; + this->unk_44 = 230; } else { - effect->unk_44 = 255; + this->unk_44 = 255; } } -void func_effect_8007CCBC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_340; +void func_effect_8007CCBC(Effect340* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_340; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale2 = scale2; - effect->unk_4C = 3; - effect->scale1 = 0.2f; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->scale2 = scale2; + this->unk_4C = 3; + this->scale1 = 0.2f; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); if (gLevelType == LEVELTYPE_PLANET) { - effect->unk_44 = 230; + this->unk_44 = 230; } else { - effect->unk_44 = 255; + this->unk_44 = 255; } } -void func_effect_8007CD7C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_342; - effect->timer_50 = timer50; +void func_effect_8007CD7C(Effect342* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_342; + this->timer_50 = timer50; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->unk_48 = 3; + this->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - effect->unk_48 = -effect->unk_48; + this->unk_48 = -this->unk_48; } - effect->unk_4A = 255; - effect->scale2 = scale2; - effect->obj.rot.z = RAND_FLOAT(360.0f); + this->unk_4A = 255; + this->scale2 = scale2; + this->obj.rot.z = RAND_FLOAT(360.0f); if ((Rand_ZeroOne() < 0.5f) && (gLevelType == LEVELTYPE_PLANET) && (timer50 != 1)) { - effect->unk_44 = 1; + this->unk_44 = 1; } if (timer50 == 2) { - effect->unk_44 = 1; + this->unk_44 = 1; } if (scale2 == 2.2f) { - effect->unk_44 = 0; + this->unk_44 = 0; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007CEBC(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 timer50) { @@ -1923,22 +1924,22 @@ void func_effect_8007D10C(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { func_effect_8007CF9C(xPos, yPos, zPos, scale2); } -void func_effect_8007D138(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_341; +void func_effect_8007D138(Effect341* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_341; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale2 = scale2; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->scale2 = scale2; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); if (gLevelType == LEVELTYPE_PLANET) { - effect->unk_4C = 15; + this->unk_4C = 15; } - effect->unk_44 = 180; + this->unk_44 = 180; } void func_effect_8007D1E0(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -1965,58 +1966,58 @@ void func_effect_8007D2C8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { func_effect_8007D008(xPos, yPos, zPos, scale2); } -void func_effect_8007D2F4(Effect* effect) { +void Effect_Effect339_Update(EffectFireSmoke* this) { if (gLevelType == LEVELTYPE_PLANET) { if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { - effect->vel.y += 0.1f; - if (effect->timer_50 == 0) { - effect->unk_4C++; - effect->timer_50 = 4; - if (effect->unk_4C > 15) { - effect->timer_50 = 5; + this->vel.y += 0.1f; + if (this->timer_50 == 0) { + this->unk_4C++; + this->timer_50 = 4; + if (this->unk_4C > 15) { + this->timer_50 = 5; } - if (effect->unk_4C > 20) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_4C > 20) { + Object_Kill(&this->obj, this->sfxSource); } } } else { if ((gCurrentLevel == LEVEL_MACBETH) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && - (effect->vel.x != 0)) { - Math_SmoothStepToF(&effect->vel.x, -1.0f, 1.0f, 1.0f, 0.0f); - Math_SmoothStepToF(&effect->vel.z, 4.0f, 1.0f, 1.0f, 0.0f); - effect->vel.y += 1.7f; + (this->vel.x != 0)) { + Math_SmoothStepToF(&this->vel.x, -1.0f, 1.0f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->vel.z, 4.0f, 1.0f, 1.0f, 0.0f); + this->vel.y += 1.7f; } - effect->vel.y += 0.3f; - if (effect->timer_50 == 0) { - effect->unk_4C++; - if (effect->unk_4C > 15) { - effect->timer_50 = 2; + this->vel.y += 0.3f; + if (this->timer_50 == 0) { + this->unk_4C++; + if (this->unk_4C > 15) { + this->timer_50 = 2; } - if (effect->unk_4C > 20) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_4C > 20) { + Object_Kill(&this->obj, this->sfxSource); } } } } else { - if (effect->timer_50 == 0) { - effect->unk_4C++; - effect->timer_50 = effect->unk_46; - if (effect->unk_4C > 13) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + this->unk_4C++; + this->timer_50 = this->unk_46; + if (this->unk_4C > 13) { + Object_Kill(&this->obj, this->sfxSource); } } - effect->unk_44 -= 15; + this->unk_44 -= 15; } - if (gLight3Brightness < effect->scale1) { - gLight3Brightness = effect->scale1; - gLight3x = effect->obj.pos.x; - gLight3y = effect->obj.pos.y; - gLight3z = effect->obj.pos.z; + if (gLight3Brightness < this->scale1) { + gLight3Brightness = this->scale1; + gLight3x = this->obj.pos.x; + gLight3y = this->obj.pos.y; + gLight3z = this->obj.pos.z; gLight3R = 255; gLight3G = 50; gLight3B = 0; } - Math_SmoothStepToF(&effect->scale1, 0.0f, 1.0f, 0.05f, 0.0f); + Math_SmoothStepToF(&this->scale1, 0.0f, 1.0f, 0.05f, 0.0f); } static Gfx* D_800D17A4[] = { @@ -2047,95 +2048,99 @@ static Gfx* D_800D18A0[] = { D_BG_SPACE_20019B0, D_BG_SPACE_2001120, D_BG_SPACE_2000890, D_BG_SPACE_2000000, }; -void func_effect_8007D55C(Effect* effect) { +// Effects 339 to 341 +void Effect_FireSmoke_Draw(EffectFireSmoke* this) { f32 scale; - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); + if (gLevelType == LEVELTYPE_PLANET) { - gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D184C[effect->unk_4C].r, D_800D184C[effect->unk_4C].g, - D_800D184C[effect->unk_4C].b, D_800D184C[effect->unk_4C].a); - scale = D_800D17F8[effect->unk_4C] - 0.5f; + gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D184C[this->unk_4C].r, D_800D184C[this->unk_4C].g, + D_800D184C[this->unk_4C].b, D_800D184C[this->unk_4C].a); + scale = D_800D17F8[this->unk_4C] - 0.5f; Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_800D17A4[effect->unk_4C]); + gSPDisplayList(gMasterDisp++, D_800D17A4[this->unk_4C]); return; } - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 100, effect->unk_44); - if (effect->unk_4C == 0) { + + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 100, this->unk_44); + + if (this->unk_4C == 0) { Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_800D18A0[effect->unk_4C]); + gSPDisplayList(gMasterDisp++, D_800D18A0[this->unk_4C]); return; } - gSPDisplayList(gMasterDisp++, D_800D18A0[effect->unk_4C]); + gSPDisplayList(gMasterDisp++, D_800D18A0[this->unk_4C]); } -void func_effect_8007D748(Effect* effect) { +void Effect_Effect340_Update(Effect340* this) { if (gLevelType == LEVELTYPE_PLANET) { - effect->vel.y += 0.3f; - if (effect->timer_50 == 0) { - if (effect->unk_4C > 15) { - effect->timer_50 = 2; - effect->unk_4C = effect->unk_4C + 1; + this->vel.y += 0.3f; + if (this->timer_50 == 0) { + if (this->unk_4C > 15) { + this->timer_50 = 2; + this->unk_4C = this->unk_4C + 1; } else { - effect->unk_4C = effect->unk_4C + 2; + this->unk_4C = this->unk_4C + 2; } - if (effect->unk_4C > 20) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_4C > 20) { + Object_Kill(&this->obj, this->sfxSource); } } } else { - if (effect->timer_50 == 0) { - effect->unk_4C++; - effect->timer_50 = 0; - if (effect->unk_4C > 13) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + this->unk_4C++; + this->timer_50 = 0; + if (this->unk_4C > 13) { + Object_Kill(&this->obj, this->sfxSource); } } - effect->unk_44 -= 15; + this->unk_44 -= 15; } - if (gLight3Brightness < effect->scale1) { - gLight3Brightness = effect->scale1; - gLight3x = effect->obj.pos.x; - gLight3y = effect->obj.pos.y; - gLight3z = effect->obj.pos.z; + if (gLight3Brightness < this->scale1) { + gLight3Brightness = this->scale1; + gLight3x = this->obj.pos.x; + gLight3y = this->obj.pos.y; + gLight3z = this->obj.pos.z; gLight3R = 255; gLight3G = 50; gLight3B = 0; } - Math_SmoothStepToF(&effect->scale1, 0, 1.0f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->scale1, 0, 1.0f, 0.1f, 0.0f); } -void func_effect_8007D8A8(Effect* effect) { +void Effect_Effect341_Update(Effect341* this) { if (gLevelType == LEVELTYPE_SPACE) { - func_effect_8007D2F4(effect); + Effect_Effect339_Update(this); return; } - effect->vel.y += 0.3f; - if (effect->timer_50 == 0) { - effect->unk_4C++; - effect->timer_50 = 2; - if (effect->unk_4C >= 20) { - Object_Kill(&effect->obj, effect->sfxSource); + this->vel.y += 0.3f; + if (this->timer_50 == 0) { + this->unk_4C++; + this->timer_50 = 2; + if (this->unk_4C >= 20) { + Object_Kill(&this->obj, this->sfxSource); } } - if (effect->unk_4C > 15) { - effect->unk_44 -= 20; + if (this->unk_4C > 15) { + this->unk_44 -= 20; } } -void func_effect_8007D94C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, s32 timer50) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_367; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->unk_44 = 80; - effect->scale2 = scale2; - effect->scale1 = scale1; - effect->timer_50 = timer50; - Object_SetInfo(&effect->info, effect->obj.id); +void func_effect_8007D94C(Effect367* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, s32 timer50) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_367; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->unk_44 = 80; + this->scale2 = scale2; + this->scale1 = scale1; + this->timer_50 = timer50; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007D9DC(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, s32 timer50) { @@ -2149,88 +2154,87 @@ void func_effect_8007D9DC(f32 xPos, f32 yPos, f32 zPos, f32 scale2, f32 scale1, } } -void func_effect_8007DA58(Effect* effect) { - effect->scale2 += effect->scale1; - if (effect->scale1 > 0.0f) { - effect->scale1 -= 0.01f; +void Effect_Effect375_Update(Effect375* this) { + this->scale2 += this->scale1; + if (this->scale1 > 0.0f) { + this->scale1 -= 0.01f; } else { - effect->scale1 -= 0.001f; + this->scale1 -= 0.001f; } - effect->obj.rot.y += effect->unk_60.y; - if (effect->scale2 < 0.01f) { - Object_Kill(&effect->obj, effect->sfxSource); + this->obj.rot.y += this->unk_60.y; + if (this->scale2 < 0.01f) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_8007DAE4(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); +void Macbeth_Effect375_Draw(Effect375* this) { + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_CO_6004900); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_8007DB70(Effect* effect) { +void Effect_Effect374_Update(Effect374* this) { Vec3f sp54 = { 0.0f, -10.0f, 0.0f }; - switch (effect->state) { + switch (this->state) { case 0: - effect->vel.y -= 0.5f; - if ((effect->timer_50 == 0) && ((Object_CheckCollision(1000, &effect->obj.pos, &sp54, 1) != 0) || - (effect->obj.pos.y < (gGroundHeight + 10.0f)))) { - effect->vel.y = 0.0f; - if (effect->obj.pos.y < (gGroundHeight + 10.0f)) { - effect->obj.pos.y = gGroundHeight; + this->vel.y -= 0.5f; + if ((this->timer_50 == 0) && ((Object_CheckCollision(1000, &this->obj.pos, &sp54, 1) != 0) || + (this->obj.pos.y < (gGroundHeight + 10.0f)))) { + this->vel.y = 0.0f; + if (this->obj.pos.y < (gGroundHeight + 10.0f)) { + this->obj.pos.y = gGroundHeight; } - effect->state = 1; - effect->timer_50 = 30; - effect->unk_44 = 192; - effect->scale2 = 2.5f; - effect->scale1 = 2.5f; - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, effect->sfxSource, 4); - func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 7.0f); - func_effect_8007BFFC(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 0.0f, 0.0f, 0.0f, - 4.0f, 5); - if ((effect->obj.pos.y < (gGroundHeight + 10.0f)) || (gGroundSurface != SURFACE_WATER)) { - PlayerShot_SpawnEffect344(effect->obj.pos.x, 3.0f, effect->obj.pos.z, effect->obj.pos.x, - effect->obj.pos.z, 0.0f, 0.0f, 90.0f, 5.0f, 0, 0); + this->state = 1; + this->timer_50 = 30; + this->unk_44 = 192; + this->scale2 = 2.5f; + this->scale1 = 2.5f; + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, this->sfxSource, 4); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 7.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, + 5); + if ((this->obj.pos.y < (gGroundHeight + 10.0f)) || (gGroundSurface != SURFACE_WATER)) { + PlayerShot_SpawnEffect344(this->obj.pos.x, 3.0f, this->obj.pos.z, this->obj.pos.x, this->obj.pos.z, + 0.0f, 0.0f, 90.0f, 5.0f, 0, 0); break; } } break; case 1: - effect->scale2 += ((20.0f - effect->scale2) * 0.1f); - if (effect->scale2 > 19.0f) { - effect->scale1 -= 0.3f; - effect->unk_44 -= 20; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->scale2 += ((20.0f - this->scale2) * 0.1f); + if (this->scale2 > 19.0f) { + this->scale1 -= 0.3f; + this->unk_44 -= 20; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } - effect->obj.rot.y = 180.0f - effect->obj.rot.y; - if ((fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 40.0f) && - (fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < 80.0f)) { - if ((effect->obj.pos.y < gPlayer[0].pos.y) && - ((gPlayer[0].pos.y - effect->obj.pos.y) < (effect->scale2 * 35.0f)) && - (gPlayer[0].mercyTimer == 0)) { - Player_ApplyDamage(gPlayer, 0, effect->info.damage); + this->obj.rot.y = 180.0f - this->obj.rot.y; + if ((fabsf(gPlayer[0].trueZpos - this->obj.pos.z) < 40.0f) && + (fabsf(gPlayer[0].pos.x - this->obj.pos.x) < 80.0f)) { + if ((this->obj.pos.y < gPlayer[0].pos.y) && + ((gPlayer[0].pos.y - this->obj.pos.y) < (this->scale2 * 35.0f)) && (gPlayer[0].mercyTimer == 0)) { + Player_ApplyDamage(gPlayer, 0, this->info.damage); } } break; } } -void func_effect_8007DED4(Effect* effect) { - switch (effect->state) { +void Macbeth_Effect374_Draw(Effect374* this) { + switch (this->state) { case 0: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_4008CE0); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; case 1: - Matrix_Scale(gGfxMatrix, effect->scale1, effect->scale2, 2.5f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale1, this->scale2, 2.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -2240,144 +2244,143 @@ void func_effect_8007DED4(Effect* effect) { } } -void func_effect_8007E014(Effect* effect) { +void Effect_Effect344_Update(Effect344* this) { s32 i; f32 x; f32 z; f32 y; if (gGroundType == 4) { - Ground_801B6E20(effect->obj.pos.x, effect->obj.pos.z + gPathProgress, &x, &y, &z); - effect->obj.pos.y = y + 3.0f; - effect->obj.rot.x = RAD_TO_DEG(x); - effect->obj.rot.z = RAD_TO_DEG(z); + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + gPathProgress, &x, &y, &z); + this->obj.pos.y = y + 3.0f; + this->obj.rot.x = RAD_TO_DEG(x); + this->obj.rot.z = RAD_TO_DEG(z); } - if (((effect->unk_44 == 1) || (effect->unk_44 == 3)) && ((s32) (effect->timer_50 % 4U) == 1) && - (Rand_ZeroOne() < 0.5f)) { - func_effect_8007D10C(effect->obj.pos.x, effect->obj.pos.y + (effect->scale2 * 5.0f), effect->obj.pos.z + 3.0f, - (RAND_FLOAT(0.7f) + 1.0f) * (effect->scale2 * 1.2f)); + if (((this->unk_44 == 1) || (this->unk_44 == 3)) && ((s32) (this->timer_50 % 4U) == 1) && (Rand_ZeroOne() < 0.5f)) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y + (this->scale2 * 5.0f), this->obj.pos.z + 3.0f, + (RAND_FLOAT(0.7f) + 1.0f) * (this->scale2 * 1.2f)); } for (i = 0; i < ARRAY_COUNT(gEffects); i++) { - if ((gEffects[i].obj.status == OBJ_ACTIVE) && (gEffects[i].obj.id == OBJ_EFFECT_344) && (i != effect->index) && - (fabsf(effect->obj.pos.z - gEffects[i].obj.pos.z) < 20.0f) && - (fabsf(effect->obj.pos.x - gEffects[i].obj.pos.x) < 20.0f) && - (fabsf(effect->obj.pos.y - gEffects[i].obj.pos.y) < 20.0f)) { - Object_Kill(&effect->obj, effect->sfxSource); + if ((gEffects[i].obj.status == OBJ_ACTIVE) && (gEffects[i].obj.id == OBJ_EFFECT_344) && (i != this->index) && + (fabsf(this->obj.pos.z - gEffects[i].obj.pos.z) < 20.0f) && + (fabsf(this->obj.pos.x - gEffects[i].obj.pos.x) < 20.0f) && + (fabsf(this->obj.pos.y - gEffects[i].obj.pos.y) < 20.0f)) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007E258(Effect* effect) { - if ((gCamCount != 1) && (effect->timer_50 == 0)) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect345_Update(Effect345* this) { + if ((gCamCount != 1) && (this->timer_50 == 0)) { + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_8007E298(Effect* effect) { - if (effect->timer_50 == 0) { - effect->scale2 *= 1.035f; - effect->unk_4A -= 8; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect342_Update(Effect342* this) { + if (this->timer_50 == 0) { + this->scale2 *= 1.035f; + this->unk_4A -= 8; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } } - effect->obj.rot.z += effect->unk_48; + this->obj.rot.z += this->unk_48; if (gLevelType == LEVELTYPE_PLANET) { - effect->vel.y += 0.2f; + this->vel.y += 0.2f; } } -void func_effect_8007E330(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - if (effect->unk_44 == 0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, effect->unk_4A); +void Effect_Effect342_Draw(Effect342* this) { + Graphics_SetScaleMtx(this->scale2); + if (this->unk_44 == 0) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, this->unk_4A); } else { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); } gSPDisplayList(gMasterDisp++, D_BG_PLANET_2010A30); } -void func_effect_8007E3E4(Effect* effect) { - effect->scale2 += 0.02f; - effect->unk_4A -= 4; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect351_Update(Effect351* this) { + this->scale2 += 0.02f; + this->unk_4A -= 4; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->unk_48; - effect->vel.y += 0.05f; + this->obj.rot.z += this->unk_48; + this->vel.y += 0.05f; } -void func_effect_8007E45C(Effect* effect) { - switch (effect->state) { +void Effect_Effect365_Update(Effect365* this) { + switch (this->state) { case 0: - if (effect->unk_4C != 0) { - Math_SmoothStepToF(&effect->scale2, 5.0f, 0.05f, 0.5f, 0.0f); - effect->unk_44 -= 10; - effect->obj.rot.z += effect->scale1; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_4C != 0) { + Math_SmoothStepToF(&this->scale2, 5.0f, 0.05f, 0.5f, 0.0f); + this->unk_44 -= 10; + this->obj.rot.z += this->scale1; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } - effect->scale2 += 0.02f; - effect->unk_44--; + this->scale2 += 0.02f; + this->unk_44--; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += effect->scale1; - Math_SmoothStepToF(&effect->vel.y, 0.5f, 0.05f, 0.2f, 0.00001f); + this->obj.rot.z += this->scale1; + Math_SmoothStepToF(&this->vel.y, 0.5f, 0.05f, 0.2f, 0.00001f); break; case 1: - effect->vel.y = 3.0f; - Math_SmoothStepToF(&effect->scale2, 5.0f, 0.05f, 0.5f, 0.0f); - effect->unk_44 -= 10; - effect->obj.rot.z += effect->scale1; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->vel.y = 3.0f; + Math_SmoothStepToF(&this->scale2, 5.0f, 0.05f, 0.5f, 0.0f); + this->unk_44 -= 10; + this->obj.rot.z += this->scale1; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } } -void func_effect_8007E5CC(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); +void Effect_Effect365_Draw(Effect365* this) { + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gSPDisplayList(gMasterDisp++, D_BG_PLANET_2010A30); } -void func_effect_8007E648(Effect* effect) { - if (effect->timer_50 == 0) { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.05f, 100.0f, 0.0f); - effect->unk_44 -= 2; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); +void Effect_Effect367_Update(Effect367* this) { + if (this->timer_50 == 0) { + Math_SmoothStepToF(&this->scale2, this->scale1, 0.05f, 100.0f, 0.0f); + this->unk_44 -= 2; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { +void func_effect_8007E6B8(Effect* this, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { f32 sp54; f32 sp50; f32 temp_ft4; Vec3f sp40; Vec3f sp34; - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = objId; - effect->timer_50 = 100; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = objId; + this->timer_50 = 100; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); sp50 = Math_Atan2F(gPlayer[0].pos.x - xPos, gPlayer[0].trueZpos - zPos); temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].trueZpos - zPos)); sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4); @@ -2391,47 +2394,47 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); - effect->vel.x = sp34.x + gPathVelX; - effect->vel.y = sp34.y + gPathVelY; - effect->vel.z = sp34.z - gPathVelZ; + this->vel.x = sp34.x + gPathVelX; + this->vel.y = sp34.y + gPathVelY; + this->vel.z = sp34.z - gPathVelZ; - if ((objId == OBJ_EFFECT_353) || (objId == OBJ_EFFECT_354)) { - effect->obj.rot.x = RAD_TO_DEG(sp54); - effect->obj.rot.y = RAD_TO_DEG(sp50); + if ((objId == OBJ_EFFECT_ENEMY_LASER_1) || (objId == OBJ_EFFECT_354)) { + this->obj.rot.x = RAD_TO_DEG(sp54); + this->obj.rot.y = RAD_TO_DEG(sp50); } if (objId == OBJ_EFFECT_356) { - AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, this->sfxSource, 4); } if (objId == OBJ_EFFECT_376) { - effect->obj.rot.z = RAND_FLOAT(360.0f); - effect->unk_4A = 180; - effect->scale2 = 5.0f; + this->obj.rot.z = RAND_FLOAT(360.0f); + this->unk_4A = 180; + this->scale2 = 5.0f; } else if ((objId == OBJ_EFFECT_355) || (objId == OBJ_EFFECT_377)) { - AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, this->sfxSource, 4); } } -void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { +void func_effect_8007E93C(Effect* this, u32 objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { f32 sp54; f32 sp50; f32 temp_ft4; Vec3f sp40; Vec3f sp34; - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = objId; - effect->timer_50 = 100; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = objId; + this->timer_50 = 100; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); sp50 = Math_Atan2F(gPlayer[0].cam.eye.x - xPos, gPlayer[0].cam.eye.z - zPos); temp_ft4 = sqrtf(SQ(gPlayer[0].cam.eye.x - xPos) + SQ(gPlayer[0].cam.eye.z - zPos)); sp54 = -Math_Atan2F(gPlayer[0].cam.eye.y - yPos, temp_ft4); @@ -2445,53 +2448,53 @@ void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo Matrix_MultVec3f(gCalcMatrix, &sp40, &sp34); - effect->vel.x = sp34.x + gPathVelX; - effect->vel.y = sp34.y + gPathVelY; - effect->vel.z = sp34.z - gPathVelZ; + this->vel.x = sp34.x + gPathVelX; + this->vel.y = sp34.y + gPathVelY; + this->vel.z = sp34.z - gPathVelZ; - if (objId == OBJ_EFFECT_353) { - effect->obj.rot.x = RAD_TO_DEG(sp54); - effect->obj.rot.y = RAD_TO_DEG(sp50); + if (objId == OBJ_EFFECT_ENEMY_LASER_1) { + this->obj.rot.x = RAD_TO_DEG(sp54); + this->obj.rot.y = RAD_TO_DEG(sp50); } if (objId == OBJ_EFFECT_356) { - AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, this->sfxSource, 4); } if (objId == OBJ_EFFECT_376) { - effect->obj.rot.z = RAND_FLOAT(360.0f); - effect->unk_4A = 180; - effect->scale2 = 5.0f; + this->obj.rot.z = RAND_FLOAT(360.0f); + this->unk_4A = 180; + this->scale2 = 5.0f; } else if ((objId == OBJ_EFFECT_355) || (objId == OBJ_EFFECT_377)) { - AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, this->sfxSource, 4); } } -void func_effect_8007EBB8(Effect* effect, ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, +void func_effect_8007EBB8(Effect* this, ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = objId; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = objId; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->timer_50 = 100; + this->timer_50 = 100; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - effect->scale2 = scale2; + this->scale2 = scale2; if (objId == OBJ_EFFECT_355) { - AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BEAM, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, this->sfxSource, 4); } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007ECB4(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2) { @@ -2505,38 +2508,38 @@ void func_effect_8007ECB4(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xVel } } -void func_effect_8007ED54(Effect* effect, ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, +void func_effect_8007ED54(Effect* this, ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 unkX, f32 unkY, f32 unkZ, f32 xVel, f32 yVel, f32 zVel, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = objId; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = objId; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->timer_50 = 100; + this->timer_50 = 100; if (gCurrentLevel == LEVEL_AQUAS) { - effect->timer_50 = 75; + this->timer_50 = 75; } - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - effect->obj.rot.x = xRot; - effect->obj.rot.y = yRot; - effect->obj.rot.z = zRot; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + this->obj.rot.z = zRot; - effect->unk_60.x = unkX; - effect->unk_60.y = unkY; - effect->unk_60.z = unkZ; + this->unk_60.x = unkX; + this->unk_60.y = unkY; + this->unk_60.z = unkZ; - effect->scale2 = scale2; - if (effect->obj.id != OBJ_EFFECT_380) { - AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, effect->sfxSource, 4); + this->scale2 = scale2; + if (this->obj.id != OBJ_EFFECT_380) { + AUDIO_PLAY_SFX(NA_SE_EN_SHOT_0, this->sfxSource, 4); } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8007EE68(ObjectId objId, Vec3f* pos, Vec3f* rot, Vec3f* arg3, Vec3f* arg4, f32 scale2) { @@ -2574,7 +2577,7 @@ void func_effect_8007F04C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 xRot } } -void func_effect_8007F11C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { +void Effect_EnemyLaser(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { s32 i; if ((fabsf(zPos - gPlayer[0].trueZpos) > 300.0f) || (fabsf(xPos - gPlayer[0].pos.x) > 300.0f)) { @@ -2604,94 +2607,96 @@ void func_effect_8007F20C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 spee } } -void func_effect_8007F2FC(Effect* effect) { - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); +// Unused ? +void func_effect_8007F2FC(Effect* this) { + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } - if ((effect->obj.pos.y < gGroundHeight) && (gLevelType == LEVELTYPE_PLANET)) { - Object_Kill(&effect->obj, effect->sfxSource); + if ((this->obj.pos.y < gGroundHeight) && (gLevelType == LEVELTYPE_PLANET)) { + Object_Kill(&this->obj, this->sfxSource); } if (gLevelType == LEVELTYPE_PLANET) { - effect->vel.y -= 0.3f; + this->vel.y -= 0.3f; } - if (effect->obj.pos.y < gWaterLevel) { - effect->vel.y += 0.2f; - effect->obj.pos.y -= effect->vel.y * 0.5f; - effect->obj.pos.x -= effect->vel.x * 0.5f; - effect->obj.pos.z -= effect->vel.z * 0.5f; + if (this->obj.pos.y < gWaterLevel) { + this->vel.y += 0.2f; + this->obj.pos.y -= this->vel.y * 0.5f; + this->obj.pos.x -= this->vel.x * 0.5f; + this->obj.pos.z -= this->vel.z * 0.5f; } - if ((effect->unk_44 == 1) && ((gGameFrameCount % 2) == 0)) { - func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.5f); + if ((this->unk_44 == 1) && ((gGameFrameCount % 2) == 0)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); } } -void func_effect_8007F438(Effect* effect) { +void Effect_Effect346_Update(Effect346* this) { if (gCurrentLevel == LEVEL_AQUAS) { - effect->obj.rot.z += 3.5f; - effect->vel.z = 5.0f; + this->obj.rot.z += 3.5f; + this->vel.z = 5.0f; - if (effect->unk_44 != 0) { - Math_SmoothStepToF(&effect->scale1, 100.0f, 1.0f, 20.0f, 0.0001f); + if (this->unk_44 != 0) { + Math_SmoothStepToF(&this->scale1, 100.0f, 1.0f, 20.0f, 0.0001f); } else { - Math_SmoothStepToF(&effect->scale1, 0.0f, 1.0f, 20.0f, 0.0001f); + Math_SmoothStepToF(&this->scale1, 0.0f, 1.0f, 20.0f, 0.0001f); } - if (effect->unk_46 == 0) { - effect->unk_46 = 30; - effect->unk_44++; - effect->unk_44 &= 1; + if (this->unk_46 == 0) { + this->unk_46 = 30; + this->unk_44++; + this->unk_44 &= 1; } else { - effect->unk_46--; + this->unk_46--; } if (gPathVelZ < 0.0f) { - effect->vel.z = -10.0f; + this->vel.z = -10.0f; } - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } else { - effect->obj.rot.z += 3.5f; + this->obj.rot.z += 3.5f; if (gLevelType == LEVELTYPE_PLANET) { - effect->vel.y += 0.2f; + this->vel.y += 0.2f; } - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_effect_8007F5AC(Effect* effect) { - if (effect->unk_4C == 0) { - effect->unk_46++; - if ((effect->unk_46 & 0x20) == 0) { - effect->vel.x += 0.5f; +// Unused ? +void func_effect_8007F5AC(Effect* this) { + if (this->unk_4C == 0) { + this->unk_46++; + if ((this->unk_46 & 0x20) == 0) { + this->vel.x += 0.5f; } else { - effect->vel.x -= 0.5f; + this->vel.x -= 0.5f; } - if (((gGameFrameCount % 2) == 0)) { - effect->unk_44--; - if (effect->unk_44 < 20) { - Object_Kill(&effect->obj, effect->sfxSource); + if ((gGameFrameCount % 2) == 0) { + this->unk_44--; + if (this->unk_44 < 20) { + Object_Kill(&this->obj, this->sfxSource); } } - effect->scale2 += 0.02f; + this->scale2 += 0.02f; if ((gGameFrameCount & 0x10) == 0) { - effect->scale2 += 0.01f; + this->scale2 += 0.01f; } else { - effect->scale2 -= 0.01f; + this->scale2 -= 0.01f; } } } -void func_effect_8007F6B0(Effect* effect) { +void Effect_Effect348_Update(Effect348* this) { s32 i; f32 temp; f32 cos; @@ -2702,38 +2707,38 @@ void func_effect_8007F6B0(Effect* effect) { f32 y; f32 yPos; - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.1f, 12.0f, 0.1f); + Math_SmoothStepToF(&this->scale2, this->scale1, 0.1f, 12.0f, 0.1f); - effect->unk_44 -= 2; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44 -= 2; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } - if (((gGameFrameCount % 4) == 0) && (effect->state == 0)) { + if (((gGameFrameCount % 4) == 0) && (this->state == 0)) { randfloat = RAND_FLOAT(30.0f); for (i = 0; i < 36; i += 2) { temp = (i * 10.0f * M_DTOR) + randfloat; - sin = __sinf(temp) * effect->scale2 * 8.0f; - cos = __cosf(temp) * effect->scale2 * 8.0f; + sin = __sinf(temp) * this->scale2 * 8.0f; + cos = __cosf(temp) * this->scale2 * 8.0f; yPos = gGroundHeight + 40.0f; if (gGroundType == 4) { - Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + gPathProgress, &x, &y, &z); + Ground_801B6E20(this->obj.pos.x + sin, this->obj.pos.z + cos + gPathProgress, &x, &y, &z); yPos = y + 30.0f; } if (gCurrentLevel == LEVEL_AQUAS) { - func_effect_8007B8F8(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 20.0f); + func_effect_8007B8F8(this->obj.pos.x + sin, yPos, this->obj.pos.z + cos, 20.0f); } else if (gCurrentLevel == LEVEL_FORTUNA) { - func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 20.0f); + func_effect_8007BC7C(this->obj.pos.x + sin, yPos, this->obj.pos.z + cos, 20.0f); } else if (gCurrentLevel == LEVEL_TITANIA) { - func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 10.0f, 255, 15, 0); + func_effect_8007A900(this->obj.pos.x + sin, yPos, this->obj.pos.z + cos, 10.0f, 255, 15, 0); } } } } -void func_effect_8007F958(Effect* effect) { +void Effect_Effect349_Update(Effect349* this) { s32 i; f32 x; f32 z; @@ -2744,41 +2749,41 @@ void func_effect_8007F958(Effect* effect) { f32 randFloat; f32 yPos; - effect->scale2 += effect->scale1; - effect->scale1 -= 0.08f; - if (effect->scale1 < 0.1f) { - effect->scale1 = 0.1f; + this->scale2 += this->scale1; + this->scale1 -= 0.08f; + if (this->scale1 < 0.1f) { + this->scale1 = 0.1f; } - effect->unk_44 -= 9; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44 -= 9; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); return; } - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { randFloat = RAND_FLOAT(144.0f); for (i = 0; i < 5; i++) { temp = (i * 72.0f * M_DTOR) + randFloat; - sin = __sinf(temp) * effect->scale2 * 16.0f; - cos = __cosf(temp) * effect->scale2 * 16.0f; + sin = __sinf(temp) * this->scale2 * 16.0f; + cos = __cosf(temp) * this->scale2 * 16.0f; yPos = gGroundHeight + 10.0f; if (gGroundType == 4) { - Ground_801B6E20(effect->obj.pos.x + sin, effect->obj.pos.z + cos + gPathProgress, &x, &y, &z); + Ground_801B6E20(this->obj.pos.x + sin, this->obj.pos.z + cos + gPathProgress, &x, &y, &z); yPos = y + 10.0f; } if (gCurrentLevel == LEVEL_FORTUNA) { - func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f); + func_effect_8007BC7C(this->obj.pos.x + sin, yPos, this->obj.pos.z + cos, 8.0f); } else if (gCurrentLevel == LEVEL_TITANIA) { - func_effect_8007A900(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 8.0f, 255, 15, 0); + func_effect_8007A900(this->obj.pos.x + sin, yPos, this->obj.pos.z + cos, 8.0f, 255, 15, 0); } } } } -void func_effect_8007FBE0(Effect* effect) { +void Effect_Effect350_Update(Effect350* this) { s32 i; f32 temp; f32 sin; @@ -2786,30 +2791,30 @@ void func_effect_8007FBE0(Effect* effect) { f32 randFloat; f32 yPos; - effect->scale2 += effect->scale1; - effect->scale1 -= .1f; - if (effect->scale1 < 0.1f) { - effect->scale1 = 0.1f; + this->scale2 += this->scale1; + this->scale1 -= .1f; + if (this->scale1 < 0.1f) { + this->scale1 = 0.1f; } - effect->unk_44 -= 6; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44 -= 6; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } if (((gGameFrameCount % 2) == 0)) { randFloat = RAND_FLOAT(144.0f); for (i = 0; i < 10; i++) { temp = (i * 36.0f * M_DTOR) + randFloat; - sin = __sinf(temp) * effect->scale2 * 16.0f; - cos = __cosf(temp) * effect->scale2 * 16.0f; + sin = __sinf(temp) * this->scale2 * 16.0f; + cos = __cosf(temp) * this->scale2 * 16.0f; yPos = gGroundHeight + 10.0f; - func_effect_8007BC7C(effect->obj.pos.x + sin, yPos, effect->obj.pos.z + cos, 12.0f); + func_effect_8007BC7C(this->obj.pos.x + sin, yPos, this->obj.pos.z + cos, 12.0f); } } } -bool func_effect_8007FD84(Effect* effect) { +bool func_effect_8007FD84(Effect* this) { s32 i; Actor* actor; @@ -2817,13 +2822,13 @@ bool func_effect_8007FD84(Effect* effect) { actor = &gActors[gTeamEventActorIndex[i]]; if (actor->obj.status == OBJ_ACTIVE) { if ((actor->iwork[12] >= TEAM_ID_FALCO) && (actor->iwork[12] <= TEAM_ID_BILL) && - (fabsf(actor->obj.pos.z - effect->obj.pos.z) < 100.0f) && - (fabsf(actor->obj.pos.x - effect->obj.pos.x) < 100.0f) && - (fabsf(actor->obj.pos.y - effect->obj.pos.y) < 100.0f)) { + (fabsf(actor->obj.pos.z - this->obj.pos.z) < 100.0f) && + (fabsf(actor->obj.pos.x - this->obj.pos.x) < 100.0f) && + (fabsf(actor->obj.pos.y - this->obj.pos.y) < 100.0f)) { actor->dmgType = DMG_BEAM; actor->dmgPart = 0; actor->damage = 10; - if (effect->obj.id == OBJ_EFFECT_354) { + if (this->obj.id == OBJ_EFFECT_354) { actor->damage = 30; } actor->dmgSource = CS_SHOT_ID; @@ -2834,19 +2839,19 @@ bool func_effect_8007FD84(Effect* effect) { return false; } -void func_effect_8007FE88(Effect* effect) { +void Effect_Effect353_354_Update(Effect* this) { Vec3f srcVelocity; Vec3f destVelocity; Vec3f velocity; f32 var_fa0 = 0.0f; - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); return; } - if (func_effect_8007FD84(effect)) { - Object_Kill(&effect->obj, effect->sfxSource); + if (func_effect_8007FD84(this)) { + Object_Kill(&this->obj, this->sfxSource); return; } @@ -2854,98 +2859,98 @@ void func_effect_8007FE88(Effect* effect) { var_fa0 = 100.0f; } - if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < (50.0f + var_fa0)) { - if ((fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < (30.0f + var_fa0)) && - (fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < (30.0f + var_fa0))) { + if (fabsf(gPlayer[0].trueZpos - this->obj.pos.z) < (50.0f + var_fa0)) { + if ((fabsf(gPlayer[0].pos.x - this->obj.pos.x) < (30.0f + var_fa0)) && + (fabsf(gPlayer[0].pos.y - this->obj.pos.y) < (30.0f + var_fa0))) { if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) { - effect->obj.rot.y = 90.0f; - effect->obj.rot.x = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + this->obj.rot.y = 90.0f; + this->obj.rot.x = RAND_FLOAT(360.0f); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); srcVelocity.x = 0.0f; srcVelocity.y = 0.0f; srcVelocity.z = 100.0f; Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity); - effect->vel.x = destVelocity.x; - effect->vel.y = destVelocity.y; - effect->vel.z = destVelocity.z; + this->vel.x = destVelocity.x; + this->vel.y = destVelocity.y; + this->vel.z = destVelocity.z; gPlayer[0].deflectCount++; - AUDIO_PLAY_SFX(NA_SE_ROLLING_REFLECT, effect->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_ROLLING_REFLECT, this->sfxSource, 0); } if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].mercyTimer == 0)) { - Player_ApplyDamage(gPlayer, 0, effect->info.damage); + Player_ApplyDamage(gPlayer, 0, this->info.damage); gPlayer[0].knockback.x = 20.0f; - if (effect->vel.x < 0.0f) { + if (this->vel.x < 0.0f) { gPlayer[0].knockback.x *= -1.0f; } if (gCurrentLevel != LEVEL_MACBETH) { gPlayer[0].knockback.y = 20.0f; - if (effect->vel.y < 0.0f) { + if (this->vel.y < 0.0f) { gPlayer[0].knockback.y *= -1.0f; } } - Object_Kill(&effect->obj, effect->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } } } if (gGroundType == 4) { - if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (Ground_801B6AEC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress) != 0) { + Object_Kill(&this->obj, this->sfxSource); } - } else if (effect->obj.pos.y < gGroundHeight) { - Object_Kill(&effect->obj, effect->sfxSource); + } else if (this->obj.pos.y < gGroundHeight) { + Object_Kill(&this->obj, this->sfxSource); if (gGroundSurface != SURFACE_WATER) { - effect->obj.pos.y = gGroundHeight; - func_effect_8007D074(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); + this->obj.pos.y = gGroundHeight; + func_effect_8007D074(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); } } - velocity.x = effect->vel.x; - velocity.y = effect->vel.y; - velocity.z = effect->vel.z; + velocity.x = this->vel.x; + velocity.y = this->vel.y; + velocity.z = this->vel.z; if (gCurrentLevel != LEVEL_MACBETH) { - if (Object_CheckCollision(1000, &effect->obj.pos, &velocity, 2) != 0) { - func_effect_8007D10C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); - Object_Kill(&effect->obj, effect->sfxSource); + if (Object_CheckCollision(1000, &this->obj.pos, &velocity, 2) != 0) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); } - } else if (Macbeth_801A55D4(1000, &effect->obj.pos, &velocity, 0) != 0) { - func_effect_8007D10C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); - Object_Kill(&effect->obj, effect->sfxSource); + } else if (Macbeth_801A55D4(1000, &this->obj.pos, &velocity, 0) != 0) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); } } -void func_effect_800802B8(Effect* effect) { - func_effect_8007FE88(effect); +void Effect_Effect355_Update(Effect355* this) { + Effect_Effect353_354_Update(this); } -void func_effect_800802D8(Effect* effect) { - func_effect_8007FE88(effect); +void Effect_Effect377_Update(Effect377* this) { + Effect_Effect353_354_Update(this); } -void func_effect_800802F8(Effect* effect) { - func_effect_8007FE88(effect); - effect->obj.rot.z += 10.0f; - effect->scale2 = 3.0f; +void Effect_Effect356_Update(Effect356* this) { + Effect_Effect353_354_Update(this); + this->obj.rot.z += 10.0f; + this->scale2 = 3.0f; if ((gGameFrameCount % 2) != 0) { - effect->scale2 = 3.5f; + this->scale2 = 3.5f; } } -void func_effect_80080360(Effect* effect) { - effect->obj.rot.z += 8.0f; - effect->scale2 += 0.1f; +void Effect_Effect376_Update(Effect376* this) { + this->obj.rot.z += 8.0f; + this->scale2 += 0.1f; // It seems they forgot that unk_4A is s16 and not a float... - effect->unk_4A -= 3.5f; - if (effect->unk_4A < 50.0f) { - effect->unk_4A = 50; + this->unk_4A -= 3.5f; + if (this->unk_4A < 50.0f) { + this->unk_4A = 50; } - func_effect_8007A774(gPlayer, effect, 50.0f); + func_effect_8007A774(gPlayer, this, 50.0f); } -void func_effect_8008040C(Effect* effect) { +void Effect_Effect398_Update(Effect398* this) { f32 xRot; f32 yRot; f32 temp; @@ -2954,32 +2959,32 @@ void func_effect_8008040C(Effect* effect) { Vec3f destVelocity; Vec3f sp3C; - switch (effect->state) { + switch (this->state) { case 0: - yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, gPlayer[0].trueZpos - effect->obj.pos.z); - temp = sqrtf(SQ(gPlayer[0].pos.x - effect->obj.pos.x) + SQ(gPlayer[0].trueZpos - effect->obj.pos.z)); - xRot = -Math_Atan2F(gPlayer[0].pos.y - effect->obj.pos.y, temp); + yRot = Math_Atan2F(gPlayer[0].pos.x - this->obj.pos.x, gPlayer[0].trueZpos - this->obj.pos.z); + temp = sqrtf(SQ(gPlayer[0].pos.x - this->obj.pos.x) + SQ(gPlayer[0].trueZpos - this->obj.pos.z)); + xRot = -Math_Atan2F(gPlayer[0].pos.y - this->obj.pos.y, temp); Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW); Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY); srcVelocity.y = 0.0f; srcVelocity.x = 0.0f; srcVelocity.z = 100.0f; Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity); - effect->vel.x = destVelocity.x + gPathVelX; - effect->vel.y = destVelocity.y + gPathVelY; - effect->vel.z = destVelocity.z - gPathVelZ; - effect->state++; + this->vel.x = destVelocity.x + gPathVelX; + this->vel.y = destVelocity.y + gPathVelY; + this->vel.z = destVelocity.z - gPathVelZ; + this->state++; break; case 1: - effect->obj.rot.z = 360.0f - effect->obj.rot.z; - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->obj.rot.z = 360.0f - this->obj.rot.z; + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); return; } - if (func_effect_8007FD84(effect)) { - Object_Kill(&effect->obj, effect->sfxSource); + if (func_effect_8007FD84(this)) { + Object_Kill(&this->obj, this->sfxSource); return; } @@ -2987,68 +2992,68 @@ void func_effect_8008040C(Effect* effect) { var_fa0 = 100.0f; } - if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < (50.0f + var_fa0)) { - if ((fabsf(gPlayer[0].pos.x - effect->obj.pos.x) < (30.0f + var_fa0)) && - (fabsf(gPlayer[0].pos.y - effect->obj.pos.y) < (30.0f + var_fa0))) { + if (fabsf(gPlayer[0].trueZpos - this->obj.pos.z) < (50.0f + var_fa0)) { + if ((fabsf(gPlayer[0].pos.x - this->obj.pos.x) < (30.0f + var_fa0)) && + (fabsf(gPlayer[0].pos.y - this->obj.pos.y) < (30.0f + var_fa0))) { if ((gPlayer[0].barrelRollAlpha != 0) || (gPlayer[0].meteoWarpTimer != 0)) { - effect->obj.rot.y = 90.0f; - effect->obj.rot.x = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + this->obj.rot.y = 90.0f; + this->obj.rot.x = RAND_FLOAT(360.0f); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); srcVelocity.y = 0.0f; srcVelocity.x = 0.0f; srcVelocity.z = 100.0f; Matrix_MultVec3f(gCalcMatrix, &srcVelocity, &destVelocity); - effect->vel.x = destVelocity.x; - effect->vel.y = destVelocity.y; - effect->vel.z = destVelocity.z; + this->vel.x = destVelocity.x; + this->vel.y = destVelocity.y; + this->vel.z = destVelocity.z; gPlayer[0].deflectCount++; - AUDIO_PLAY_SFX(NA_SE_ROLLING_REFLECT, effect->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_ROLLING_REFLECT, this->sfxSource, 0); } if ((gPlayer[0].barrelRollAlpha == 0) && (gPlayer[0].mercyTimer == 0)) { - Player_ApplyDamage(gPlayer, 0, effect->info.damage); + Player_ApplyDamage(gPlayer, 0, this->info.damage); gPlayer[0].knockback.x = 20.0f; - if (effect->vel.x < 0.0f) { + if (this->vel.x < 0.0f) { gPlayer[0].knockback.x *= -1.0f; } gPlayer[0].knockback.y = 20.0f; - if (effect->vel.y < 0.0f) { + if (this->vel.y < 0.0f) { gPlayer[0].knockback.y *= -1.0f; } - Object_Kill(&effect->obj, effect->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } } if (gGroundType == 4) { - if (Ground_801B6AEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z + gPathProgress) != 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (Ground_801B6AEC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress) != 0) { + Object_Kill(&this->obj, this->sfxSource); } - } else if (effect->obj.pos.y < gGroundHeight) { - Object_Kill(&effect->obj, effect->sfxSource); + } else if (this->obj.pos.y < gGroundHeight) { + Object_Kill(&this->obj, this->sfxSource); if (gGroundSurface != SURFACE_WATER) { - effect->obj.pos.y = gGroundHeight; - func_effect_8007D074(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); + this->obj.pos.y = gGroundHeight; + func_effect_8007D074(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); } } - sp3C.x = effect->vel.x; - sp3C.y = effect->vel.y; - sp3C.z = effect->vel.z; + sp3C.x = this->vel.x; + sp3C.y = this->vel.y; + sp3C.z = this->vel.z; - if (Object_CheckCollision(1000, &effect->obj.pos, &sp3C, 2) != 0) { - func_effect_8007D10C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); - Object_Kill(&effect->obj, effect->sfxSource); + if (Object_CheckCollision(1000, &this->obj.pos, &sp3C, 2) != 0) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); + Object_Kill(&this->obj, this->sfxSource); } } break; } - func_effect_8007A774(gPlayer, effect, 50.0f); + func_effect_8007A774(gPlayer, this, 50.0f); } -void func_effect_8008092C(Effect* effect) { - switch (effect->unk_44) { +void Effect_Effect398_Draw(Effect398* this) { + switch (this->unk_44) { case 0: RCP_SetupDL(&gMasterDisp, SETUPDL_49); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); @@ -3070,118 +3075,118 @@ void func_effect_8008092C(Effect* effect) { } } -void func_effect_80080ACC(Effect* effect) { +void Effect_Effect394_Update(Effect394* this) { s16 temp_ft2; - switch (effect->unk_78) { + switch (this->unk_78) { case 0: break; case 1: - effect->unk_46--; + this->unk_46--; break; case 10: - effect->unk_44--; - if (effect->unk_44 <= 0) { - effect->unk_44 = effect->unk_46; + this->unk_44--; + if (this->unk_44 <= 0) { + this->unk_44 = this->unk_46; } - temp_ft2 = (((f32) effect->unk_44 / (f32) effect->unk_46) * 255.0f); - effect->unk_48 = temp_ft2; + temp_ft2 = (((f32) this->unk_44 / (f32) this->unk_46) * 255.0f); + this->unk_48 = temp_ft2; if (temp_ft2 > 255) { - effect->unk_48 = 255; + this->unk_48 = 255; } - if (effect->unk_48 < 32) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_48 < 32) { + Object_Kill(&this->obj, this->sfxSource); } break; case 11: - effect->obj.rot.z += effect->unk_60.z; - effect->scale2 += 0.07f; - effect->vel.y += 0.2f; - effect->unk_44 += effect->unk_46; - if (effect->unk_44 < 10) { - Object_Kill(&effect->obj, effect->sfxSource); + this->obj.rot.z += this->unk_60.z; + this->scale2 += 0.07f; + this->vel.y += 0.2f; + this->unk_44 += this->unk_46; + if (this->unk_44 < 10) { + Object_Kill(&this->obj, this->sfxSource); } break; case 12: - effect->obj.rot.x += effect->unk_60.x; - effect->obj.rot.y += effect->unk_60.y; - effect->obj.rot.z += effect->unk_60.z; - if ((effect->unk_44 == 0) && (effect->obj.pos.y < gGroundHeight)) { - Object_Kill(&effect->obj, effect->sfxSource); + this->obj.rot.x += this->unk_60.x; + this->obj.rot.y += this->unk_60.y; + this->obj.rot.z += this->unk_60.z; + if ((this->unk_44 == 0) && (this->obj.pos.y < gGroundHeight)) { + Object_Kill(&this->obj, this->sfxSource); } - if (effect->unk_44 != 0) { - effect->unk_44--; + if (this->unk_44 != 0) { + this->unk_44--; } - effect->vel.y -= 4.0f; + this->vel.y -= 4.0f; break; case 16: break; case 100: - func_effect_8007E45C(effect); + Effect_Effect365_Update(this); break; case 101: - func_effect_8007BCE8(effect); + Effect_Effect362_Update(this); break; case 102: - func_effect_8007B758(effect); + Effect_Effect347_Update(this); break; } } -void func_effect_80080D04(Effect* effect) { +void Effect_Effect394_Draw(Effect394* this) { static s32 D_800D18E4 = 0; s32 i; s32 alpha; - switch (effect->unk_7A) { + switch (this->unk_7A) { case 0: - if (effect->unk_44 != 64) { - RCP_SetupDL(&gMasterDisp, effect->unk_44); + if (this->unk_44 != 64) { + RCP_SetupDL(&gMasterDisp, this->unk_44); } - gSPDisplayList(gMasterDisp++, effect->unk_74); - if (effect->unk_44 != 64) { + gSPDisplayList(gMasterDisp++, this->unk_74); + if (this->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, SETUPDL_64); } break; case 1: - if (effect->unk_48 == 0) { - effect->unk_48 = effect->unk_46; + if (this->unk_48 == 0) { + this->unk_48 = this->unk_46; } - if (effect->unk_44 != 64) { - RCP_SetupDL(&gMasterDisp, effect->unk_44); + if (this->unk_44 != 64) { + RCP_SetupDL(&gMasterDisp, this->unk_44); } - alpha = (((f32) effect->unk_46 / (f32) effect->unk_48) * 255.0f); + alpha = (((f32) this->unk_46 / (f32) this->unk_48) * 255.0f); if (alpha > 255) { alpha = 255; } if (alpha < 32) { - Object_Kill(&effect->obj, effect->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha); - gSPDisplayList(gMasterDisp++, effect->unk_74); + gSPDisplayList(gMasterDisp++, this->unk_74); } - if (effect->unk_44 != 64) { + if (this->unk_44 != 64) { RCP_SetupDL(&gMasterDisp, SETUPDL_64); } break; case 10: RCP_SetupDL(&gMasterDisp, SETUPDL_65); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_48); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, effect->scale2, MTXF_APPLY); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_48); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TI_A000000); RCP_SetupDL(&gMasterDisp, SETUPDL_64); @@ -3189,49 +3194,49 @@ void func_effect_80080D04(Effect* effect) { case 11: RCP_SetupDL(&gMasterDisp, SETUPDL_68); - Graphics_SetScaleMtx(effect->scale2); - gDPSetPrimColor(gMasterDisp++, 0, 0, 120, 60, 0, effect->unk_44); + Graphics_SetScaleMtx(this->scale2); + gDPSetPrimColor(gMasterDisp++, 0, 0, 120, 60, 0, this->unk_44); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); gSPDisplayList(gMasterDisp++, D_1023750); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; case 12: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL(&gMasterDisp, SETUPDL_23); gSPDisplayList(gMasterDisp++, D_VE1_9013C20); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; case 13: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL(&gMasterDisp, SETUPDL_68); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gDPSetEnvColor(gMasterDisp++, 36, 45, 28, 0); gSPDisplayList(gMasterDisp++, D_1023750); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; case 14: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL(&gMasterDisp, SETUPDL_68); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gDPSetEnvColor(gMasterDisp++, 255, 255, 255, 0); gSPDisplayList(gMasterDisp++, D_1023750); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; case 15: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL(&gMasterDisp, SETUPDL_68); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_4A); gDPSetEnvColor(gMasterDisp++, 36, 45, 28, 0); gSPDisplayList(gMasterDisp++, D_1023750); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; case 16: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); gDPSetPrimColor(gMasterDisp++, 0, 0, 96, 96, 255, 255); Matrix_Translate(gGfxMatrix, 34.14f, 0.0f, 0.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); @@ -3250,7 +3255,7 @@ void func_effect_80080D04(Effect* effect) { gSPDisplayList(gMasterDisp++, D_102F5E0); Matrix_Pop(&gGfxMatrix); } - effect->obj.rot.z += 1.0f; + this->obj.rot.z += 1.0f; break; case 17: @@ -3262,13 +3267,13 @@ void func_effect_80080D04(Effect* effect) { D_800D18E4++; } - if (((effect->index + gGameFrameCount) % 2) == 0) { + if (((this->index + gGameFrameCount) % 2) == 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 96, 96, 255, 255); } - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); for (i = 0; i < 10; i++) { Matrix_Push(&gGfxMatrix); @@ -3286,7 +3291,7 @@ void func_effect_80080D04(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_48); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 190, 255); gDPSetEnvColor(gMasterDisp++, 239, 15, 0, 255); - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); gSPDisplayList(gMasterDisp++, D_1024AC0); break; } @@ -3305,90 +3310,90 @@ void func_effect_800815DC(void) { } } -void func_effect_8008165C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 arg5) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_395; +void func_effect_8008165C(Effect395* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 arg5) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_395; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale2 = scale2; - effect->state = arg5; - Object_SetInfo(&effect->info, effect->obj.id); - effect->timer_50 = 300; + this->scale2 = scale2; + this->state = arg5; + Object_SetInfo(&this->info, this->obj.id); + this->timer_50 = 300; - switch (effect->state) { + switch (this->state) { case 4: - effect->unk_4A = 255; - effect->unk_46 = 1; + this->unk_4A = 255; + this->unk_46 = 1; break; case 5: - effect->vel.x = RAND_FLOAT_CENTERED(20.0f); - effect->vel.y = RAND_FLOAT(20.0f) + 30.0f; - effect->vel.z = RAND_FLOAT(30.0f); + this->vel.x = RAND_FLOAT_CENTERED(20.0f); + this->vel.y = RAND_FLOAT(20.0f) + 30.0f; + this->vel.z = RAND_FLOAT(30.0f); - effect->unk_46 = 5; - effect->unk_44 = RAND_FLOAT_CENTERED(20.0f) * 1.5f; - effect->info.unk_14 = 0; - effect->unk_4A = 255; + this->unk_46 = 5; + this->unk_44 = RAND_FLOAT_CENTERED(20.0f) * 1.5f; + this->info.unk_14 = 0; + this->unk_4A = 255; break; case 6: - effect->unk_4A = 255; - effect->unk_46 = 10; + this->unk_4A = 255; + this->unk_46 = 10; break; case 7: - effect->vel.y = RAND_FLOAT(7.0f) + 7.0f; - effect->vel.x = RAND_FLOAT_CENTERED(10.0f); - effect->vel.z = RAND_FLOAT_CENTERED(10.0f); + this->vel.y = RAND_FLOAT(7.0f) + 7.0f; + this->vel.x = RAND_FLOAT_CENTERED(10.0f); + this->vel.z = RAND_FLOAT_CENTERED(10.0f); - effect->scale2 = (RAND_FLOAT(0.8f) + 0.3f) * scale2; - effect->timer_50 = RAND_INT(50.0f) + 70; - effect->obj.rot.x = RAND_FLOAT(360.0f); + this->scale2 = (RAND_FLOAT(0.8f) + 0.3f) * scale2; + this->timer_50 = RAND_INT(50.0f) + 70; + this->obj.rot.x = RAND_FLOAT(360.0f); - effect->unk_60.x = RAND_FLOAT_CENTERED(30.0f); - effect->unk_60.y = RAND_FLOAT_CENTERED(30.0f); - effect->unk_60.z = RAND_FLOAT_CENTERED(30.0f); + this->unk_60.x = RAND_FLOAT_CENTERED(30.0f); + this->unk_60.y = RAND_FLOAT_CENTERED(30.0f); + this->unk_60.z = RAND_FLOAT_CENTERED(30.0f); - effect->info.unk_14 = 0; + this->info.unk_14 = 0; break; case 9: - effect->obj.pos.x += RAND_FLOAT_CENTERED(600.0f); - effect->obj.pos.y += RAND_FLOAT_CENTERED(600.0f); - effect->obj.pos.z += RAND_FLOAT_CENTERED(300.0f) + 300.0f; - effect->scale1 = 0.0f; - effect->scale2 = RAND_FLOAT(1.0f) + 1.0f; + this->obj.pos.x += RAND_FLOAT_CENTERED(600.0f); + this->obj.pos.y += RAND_FLOAT_CENTERED(600.0f); + this->obj.pos.z += RAND_FLOAT_CENTERED(300.0f) + 300.0f; + this->scale1 = 0.0f; + this->scale2 = RAND_FLOAT(1.0f) + 1.0f; break; case 10: - effect->timer_50 = 10; - AUDIO_PLAY_SFX(NA_SE_EN_A6BOSS_BEAM, effect->sfxSource, 4); + this->timer_50 = 10; + AUDIO_PLAY_SFX(NA_SE_EN_A6BOSS_BEAM, this->sfxSource, 4); break; case 11: - effect->scale1 = 255.0f; - effect->vel.y = 20.0f; - if (effect->scale2 > 10.0f) { - effect->scale2 = 10.0f; + this->scale1 = 255.0f; + this->vel.y = 20.0f; + if (this->scale2 > 10.0f) { + this->scale2 = 10.0f; } break; case 12: - effect->scale1 = scale2; - effect->scale2 = 1.0f; - effect->timer_50 = 50; - effect->unk_44 = 100; + this->scale1 = scale2; + this->scale2 = 1.0f; + this->timer_50 = 50; + this->unk_44 = 100; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - AUDIO_PLAY_SFX(NA_SE_EN_STAR_EXPLOSION, effect->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_STAR_EXPLOSION, this->sfxSource, 4); gControllerRumbleTimers[0] = 60; break; } @@ -3452,7 +3457,7 @@ void func_effect_80081BEC(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 arg4) { static f32 D_800D18E8 = 0.0f; static f32 D_800D18EC = 0.0f; -void func_effect_80081C5C(Effect* effect) { +void Effect_Effect395_Update(Effect395* this) { f32 sp84; f32 posXDiff; f32 posYDiff; @@ -3464,183 +3469,182 @@ void func_effect_80081C5C(Effect* effect) { Vec3f velocity; Vec3f velocityDest; - velocity.x = effect->vel.x; - velocity.y = effect->vel.y; - velocity.z = effect->vel.z; + velocity.x = this->vel.x; + velocity.y = this->vel.y; + velocity.z = this->vel.z; //! FAKE: Probably some debug stuff printing different messages depending on what unk_4E is. - if (effect->state != 0 && effect->state != 6 && effect->state != 7 && effect->state != 11) { + if ((this->state != 0) && (this->state != 6) && (this->state != 7) && (this->state != 11)) { if (gCurrentLevel) {} PRINTF("ZO_MOVE HELP %d\n"); } - if (effect->state != 1 && effect->state != 2 && effect->state != 4 && effect->state != 5 && effect->state != 8 && - effect->state != 9) { + if ((this->state != 1) && (this->state != 2) && (this->state != 4) && (this->state != 5) && (this->state != 8) && + (this->state != 9)) { if (gCurrentLevel) {} PRINTF("AC_MOVE HELP %d\n"); } - switch (effect->state) { + switch (this->state) { case 0: - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); break; } - if (((gGameFrameCount % 2) == 0)) { - func_effect_8007C484(RAND_FLOAT_CENTERED(50.0f) + effect->obj.pos.x, - RAND_FLOAT_CENTERED(50.0f) + effect->obj.pos.y, - RAND_FLOAT_CENTERED(50.0f) + effect->obj.pos.z, effect->vel.x, effect->vel.y, - effect->vel.z, RAND_FLOAT(0.05f) + 0.05f, 0); + if ((gGameFrameCount % 2) == 0) { + func_effect_8007C484(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, RAND_FLOAT(0.05f) + 0.05f, 0); } - if (Object_CheckCollision(effect->index, &effect->obj.pos, &velocity, 1) != 0) { - func_effect_8007B344(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 3.0f, 7); - Object_Kill(&effect->obj, effect->sfxSource); + if (Object_CheckCollision(this->index, &this->obj.pos, &velocity, 1) != 0) { + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 7); + Object_Kill(&this->obj, this->sfxSource); } sp84 = 50.0f; break; case 1: - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); break; } - effect->unk_60.z += 10.0f; - effect->vel.z = 5.0f; + this->unk_60.z += 10.0f; + this->vel.z = 5.0f; - if (((gGameFrameCount % 8) == 0)) { - effect->unk_44++; - effect->unk_44 &= 1; + if ((gGameFrameCount % 8) == 0) { + this->unk_44++; + this->unk_44 &= 1; } - if (effect->unk_44 == 0) { - Math_SmoothStepToF(&effect->scale2, 0.2f, 0.01f, 0.02f, 0.0f); + if (this->unk_44 == 0) { + Math_SmoothStepToF(&this->scale2, 0.2f, 0.01f, 0.02f, 0.0f); } else { - Math_SmoothStepToF(&effect->scale2, 0.5f, 0.01f, 0.02f, 0.0f); + Math_SmoothStepToF(&this->scale2, 0.5f, 0.01f, 0.02f, 0.0f); } - if (Object_CheckCollision(effect->index, &effect->obj.pos, &velocity, 1) != 0) { - Object_Kill(&effect->obj, effect->sfxSource); - func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.0f); + if (Object_CheckCollision(this->index, &this->obj.pos, &velocity, 1) != 0) { + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); } break; case 2: - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); break; } - switch (effect->unk_44) { + switch (this->unk_44) { case 1: case 2: break; case 0: - Math_SmoothStepToF(&effect->scale2, 1.0f, 0.1f, 5.0f, 0.0001f); - if (effect->scale2 >= 1.0f) { - effect->unk_44++; + Math_SmoothStepToF(&this->scale2, 1.0f, 0.1f, 5.0f, 0.0001f); + if (this->scale2 >= 1.0f) { + this->unk_44++; } break; case 3: - Math_SmoothStepToF(&effect->scale2, 0.0f, 0.1f, 10.0f, 0.0001f); - if (effect->scale2 < 0.3f) { - Object_Kill(&effect->obj, effect->sfxSource); + Math_SmoothStepToF(&this->scale2, 0.0f, 0.1f, 10.0f, 0.0001f); + if (this->scale2 < 0.3f) { + Object_Kill(&this->obj, this->sfxSource); } break; } - if (((gGameFrameCount % 4) == 0)) { - func_effect_8007C120((RAND_FLOAT_CENTERED(effect->scale2) * 50.0f) + effect->obj.pos.x, - (RAND_FLOAT_CENTERED(effect->scale2) * 50.0f) + effect->obj.pos.y, - (RAND_FLOAT_CENTERED(effect->scale2) * 50.0f) + effect->obj.pos.z, effect->vel.x, - effect->vel.y, effect->vel.z, RAND_FLOAT(0.03f) + 0.05f, 10); + if ((gGameFrameCount % 4) == 0) { + func_effect_8007C120((RAND_FLOAT_CENTERED(this->scale2) * 50.0f) + this->obj.pos.x, + (RAND_FLOAT_CENTERED(this->scale2) * 50.0f) + this->obj.pos.y, + (RAND_FLOAT_CENTERED(this->scale2) * 50.0f) + this->obj.pos.z, this->vel.x, + this->vel.y, this->vel.z, RAND_FLOAT(0.03f) + 0.05f, 10); } - if (Object_CheckCollision(effect->index, &effect->obj.pos, &velocity, 1) != 0) { - func_effect_8007B344(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 3.0f, 7); - Object_Kill(&effect->obj, effect->sfxSource); + if (Object_CheckCollision(this->index, &this->obj.pos, &velocity, 1) != 0) { + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f, 7); + Object_Kill(&this->obj, this->sfxSource); } sp84 = 50.0f; break; case 3: - effect->info.unk_19 = 2; - if (effect->unk_44 != 0) { - Object_Kill(&effect->obj, effect->sfxSource); - func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f); - } else if (fabsf(gPlayer[0].trueZpos - effect->obj.pos.z) < 1000.0f) { - ActorEvent_SpawnEffect347(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 15.0f); - Object_Kill(&effect->obj, effect->sfxSource); + this->info.unk_19 = 2; + if (this->unk_44 != 0) { + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f); + } else if (fabsf(gPlayer[0].trueZpos - this->obj.pos.z) < 1000.0f) { + ActorEvent_SpawnEffect347(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 15.0f); + Object_Kill(&this->obj, this->sfxSource); } sp84 = 50.0f; break; case 4: - effect->scale2 += 0.07f; - effect->unk_4A -= effect->unk_46; - effect->obj.rot.z += 3.0f; - effect->vel.y += 0.2f; - if (effect->unk_4A < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->scale2 += 0.07f; + this->unk_4A -= this->unk_46; + this->obj.rot.z += 3.0f; + this->vel.y += 0.2f; + if (this->unk_4A < 0) { + Object_Kill(&this->obj, this->sfxSource); } break; case 5: - func_effect_80081A8C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 5.0f, 6); - effect->unk_4A -= effect->unk_46; - effect->obj.rot.x += effect->unk_44; - effect->obj.rot.y += effect->unk_44; - effect->obj.rot.z += effect->unk_44; - effect->vel.y -= 2.0f; - if ((effect->unk_4A < 0) || (effect->timer_50 == 0)) { - Object_Kill(&effect->obj, effect->sfxSource); + func_effect_80081A8C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f, 6); + this->unk_4A -= this->unk_46; + this->obj.rot.x += this->unk_44; + this->obj.rot.y += this->unk_44; + this->obj.rot.z += this->unk_44; + this->vel.y -= 2.0f; + if ((this->unk_4A < 0) || (this->timer_50 == 0)) { + Object_Kill(&this->obj, this->sfxSource); } break; case 6: - effect->unk_4A -= effect->unk_46; - Math_SmoothStepToF(&effect->scale2, 0.0f, 0.1f, 1.0f, 0.00001f); - if ((effect->unk_4A < 0) || (effect->timer_50 == 0)) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_4A -= this->unk_46; + Math_SmoothStepToF(&this->scale2, 0.0f, 0.1f, 1.0f, 0.00001f); + if ((this->unk_4A < 0) || (this->timer_50 == 0)) { + Object_Kill(&this->obj, this->sfxSource); } break; case 7: switch (gCurrentLevel) { case LEVEL_AQUAS: - if (((gGameFrameCount % 4) == 0)) { - func_effect_80081A8C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, effect->scale2, - 6); + if ((gGameFrameCount % 4) == 0) { + func_effect_80081A8C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale2, 6); } - effect->obj.rot.x += effect->unk_60.x; - effect->obj.rot.y += effect->unk_60.y; - effect->obj.rot.z += effect->unk_60.z; - effect->vel.y -= 0.5f; - if ((effect->timer_50 == 0) || (effect->obj.pos.y < gGroundHeight)) { - Object_Kill(&effect->obj, effect->sfxSource); + this->obj.rot.x += this->unk_60.x; + this->obj.rot.y += this->unk_60.y; + this->obj.rot.z += this->unk_60.z; + this->vel.y -= 0.5f; + if ((this->timer_50 == 0) || (this->obj.pos.y < gGroundHeight)) { + Object_Kill(&this->obj, this->sfxSource); } break; case LEVEL_ZONESS: - if (((gGameFrameCount % 4) == 0)) { + if ((gGameFrameCount % 4) == 0) { // clang-format off - func_effect_80081A8C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, effect->scale2 * 3.0f, 6); + func_effect_80081A8C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale2 * 3.0f, 6); // clang-format on } - effect->obj.rot.x += effect->unk_60.x; - effect->obj.rot.y += effect->unk_60.y; - effect->obj.rot.z += effect->unk_60.z; + this->obj.rot.x += this->unk_60.x; + this->obj.rot.y += this->unk_60.y; + this->obj.rot.z += this->unk_60.z; - effect->vel.y -= 1.0f; + this->vel.y -= 1.0f; - if ((Play_CheckDynaFloorCollision(&posYOut, &unusedOut, effect->obj.pos.x, effect->obj.pos.y, - effect->obj.pos.z)) || - (effect->timer_50 == 0)) { - func_effect_8007B228(effect->obj.pos.x, posYOut, effect->obj.pos.z, effect->scale2); - Object_Kill(&effect->obj, effect->sfxSource); + if ((Play_CheckDynaFloorCollision(&posYOut, &unusedOut, this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z)) || + (this->timer_50 == 0)) { + func_effect_8007B228(this->obj.pos.x, posYOut, this->obj.pos.z, this->scale2); + Object_Kill(&this->obj, this->sfxSource); } break; } @@ -3655,65 +3659,65 @@ void func_effect_80081C5C(Effect* effect) { velocity.x = 0; velocity.z = 250.0f; - if (effect->unk_44 > 0) { + if (this->unk_44 > 0) { velocity.z = 2000.0f; } Matrix_MultVec3fNoTranslate(gCalcMatrix, &velocity, &velocityDest); - effect->obj.pos.x = gBosses[0].obj.pos.x + velocityDest.x; - effect->obj.pos.y = gBosses[0].obj.pos.y + velocityDest.y; - effect->obj.pos.z = gBosses[0].obj.pos.z + velocityDest.z; + this->obj.pos.x = gBosses[0].obj.pos.x + velocityDest.x; + this->obj.pos.y = gBosses[0].obj.pos.y + velocityDest.y; + this->obj.pos.z = gBosses[0].obj.pos.z + velocityDest.z; - switch (effect->unk_44) { + switch (this->unk_44) { case 0: - func_effect_80081BEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.0f, 9); - Math_SmoothStepToF(&effect->scale2, 6.0f, 0.01f, 0.05f, 0.00001f); - if (effect->scale2 >= 5.0f) { + func_effect_80081BEC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f, 9); + Math_SmoothStepToF(&this->scale2, 6.0f, 0.01f, 0.05f, 0.00001f); + if (this->scale2 >= 5.0f) { gEffects[ARRAY_COUNT(gEffects) - 1].obj.status = gEffects[ARRAY_COUNT(gEffects) - 2].obj.status = OBJ_FREE; - func_effect_80081BEC(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.0f, 10); + func_effect_80081BEC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f, 10); gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 25; - effect->timer_50 = 10; + this->timer_50 = 10; D_800D18EC = 0.0f; D_800D18E8 = 0.0f; gBosses[0].timer_050 = 150; gBosses[0].state = 6; - effect->unk_44++; + this->unk_44++; } break; case 1: - Math_SmoothStepToF(&effect->scale2, 8.0f, 0.1f, 1.0f, 0.00001f); - if (effect->timer_50 == 0) { + Math_SmoothStepToF(&this->scale2, 8.0f, 0.1f, 1.0f, 0.00001f); + if (this->timer_50 == 0) { if (gFillScreenAlpha != 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 0; } - effect->timer_50 = gBosses[0].timer_050; - effect->unk_44++; + this->timer_50 = gBosses[0].timer_050; + this->unk_44++; } break; case 2: - if (effect->timer_50 == 0) { - Math_SmoothStepToF(&effect->scale2, 0.0f, 1.0f, 10.0f, 0.00001f); - if (effect->scale2 == 0.0f) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Math_SmoothStepToF(&this->scale2, 0.0f, 1.0f, 10.0f, 0.00001f); + if (this->scale2 == 0.0f) { + Object_Kill(&this->obj, this->sfxSource); } } else { - Math_SmoothStepToF(&effect->scale2, 8.0f, 0.1f, 1.0f, 0.00001f); + Math_SmoothStepToF(&this->scale2, 8.0f, 0.1f, 1.0f, 0.00001f); } break; } break; case 9: - posXDiff = gBosses[0].obj.pos.x - effect->obj.pos.x; - posYDiff = gBosses[0].obj.pos.y - effect->obj.pos.y; - posZDiff = gBosses[0].obj.pos.z - effect->obj.pos.z; + posXDiff = gBosses[0].obj.pos.x - this->obj.pos.x; + posYDiff = gBosses[0].obj.pos.y - this->obj.pos.y; + posZDiff = gBosses[0].obj.pos.z - this->obj.pos.z; yRotDeg = Math_RadToDeg(Math_Atan2F(posXDiff, posZDiff)); xRotDeg = Math_RadToDeg(-Math_Atan2F(posYDiff, sqrtf(SQ(posXDiff) + SQ(posZDiff)))); @@ -3726,38 +3730,38 @@ void func_effect_80081C5C(Effect* effect) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &velocity, &velocityDest); - effect->vel.x = velocityDest.x; - effect->vel.y = velocityDest.y; - effect->vel.z = -50.0f; + this->vel.x = velocityDest.x; + this->vel.y = velocityDest.y; + this->vel.z = -50.0f; - effect->unk_44++; - Math_SmoothStepToF(&effect->scale1, 255.0f, 1.0f, 20.0f, 0.0f); - Math_SmoothStepToF(&effect->vel.z, -70.0f, 0.01f, 0.1f, 0.0f); - Math_SmoothStepToF(&effect->scale2, 0.0f, 0.1f, 0.5f, 0.00001f); - if (effect->scale2 == 0.0f) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44++; + Math_SmoothStepToF(&this->scale1, 255.0f, 1.0f, 20.0f, 0.0f); + Math_SmoothStepToF(&this->vel.z, -70.0f, 0.01f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->scale2, 0.0f, 0.1f, 0.5f, 0.00001f); + if (this->scale2 == 0.0f) { + Object_Kill(&this->obj, this->sfxSource); } break; case 10: - switch (effect->unk_44) { + switch (this->unk_44) { case 0: D_ctx_801779A8[0] = 50.0f; - if (effect->unk_46 == 10) { + if (this->unk_46 == 10) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 25; gCameraShake = 50; } - if (effect->unk_46 == 0) { + if (this->unk_46 == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 0; - effect->unk_46 = 50; + this->unk_46 = 50; } - if (effect->unk_46 != 0) { - effect->unk_46--; + if (this->unk_46 != 0) { + this->unk_46--; } - if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) { + if (((gGameFrameCount % 16) == 0) && (this->timer_50 == 0)) { D_800D18EC = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x, gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + gPathProgress))); @@ -3768,8 +3772,8 @@ void func_effect_80081C5C(Effect* effect) { SQ(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x)))); } if (gBosses[0].timer_050 == 0) { - gBosses[0].swork[39] = effect->index; - effect->unk_44 = 1; + gBosses[0].swork[39] = this->index; + this->unk_44 = 1; } break; @@ -3778,14 +3782,14 @@ void func_effect_80081C5C(Effect* effect) { break; } - effect->info.unk_14 = 0; + this->info.unk_14 = 0; Math_SmoothStepToAngle(&gBosses[0].obj.rot.x, D_800D18E8, 0.1f, 1.0f, 0.00001f); Math_SmoothStepToAngle(&gBosses[0].obj.rot.y, D_800D18EC, 0.1f, 1.0f, 0.00001f); - effect->obj.rot.x = gBosses[0].obj.rot.x; - effect->obj.rot.y = gBosses[0].obj.rot.y; - effect->obj.rot.z += 30.0f; + this->obj.rot.x = gBosses[0].obj.rot.x; + this->obj.rot.y = gBosses[0].obj.rot.y; + this->obj.rot.z += 30.0f; Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, MTXF_APPLY); @@ -3795,68 +3799,68 @@ void func_effect_80081C5C(Effect* effect) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &velocity, &velocityDest); - effect->obj.pos.x = gBosses[0].obj.pos.x + velocityDest.x; - effect->obj.pos.y = gBosses[0].obj.pos.y + velocityDest.y; - effect->obj.pos.z = gBosses[0].obj.pos.z + velocityDest.z; + this->obj.pos.x = gBosses[0].obj.pos.x + velocityDest.x; + this->obj.pos.y = gBosses[0].obj.pos.y + velocityDest.y; + this->obj.pos.z = gBosses[0].obj.pos.z + velocityDest.z; - if (effect->unk_44 == 0) { - Math_SmoothStepToF(&effect->unk_60.x, 5.0f, 0.1f, 1.0f, 0.00001f); - Math_SmoothStepToF(&effect->unk_60.y, 5.0f, 0.1f, 1.0f, 0.00001f); - Math_SmoothStepToF(&effect->unk_60.z, 50.0f, 1.0f, 2.0f, 0.00001f); + if (this->unk_44 == 0) { + Math_SmoothStepToF(&this->unk_60.x, 5.0f, 0.1f, 1.0f, 0.00001f); + Math_SmoothStepToF(&this->unk_60.y, 5.0f, 0.1f, 1.0f, 0.00001f); + Math_SmoothStepToF(&this->unk_60.z, 50.0f, 1.0f, 2.0f, 0.00001f); } velocity.x = velocity.y = 0.0f; - velocity.z = fabsf(gPlayer[0].trueZpos - effect->obj.pos.z); + velocity.z = fabsf(gPlayer[0].trueZpos - this->obj.pos.z); Matrix_MultVec3fNoTranslate(gCalcMatrix, &velocity, &velocityDest); - if ((((effect->timer_50 == 0) && - (fabsf(gPlayer[0].pos.x - (effect->obj.pos.x + velocityDest.x)) <= (effect->unk_60.x * 50.0f))) && - (fabsf(gPlayer[0].pos.y - (effect->obj.pos.y + velocityDest.y)) <= (effect->unk_60.y * 50.0f))) && + if ((((this->timer_50 == 0) && + (fabsf(gPlayer[0].pos.x - (this->obj.pos.x + velocityDest.x)) <= (this->unk_60.x * 50.0f))) && + (fabsf(gPlayer[0].pos.y - (this->obj.pos.y + velocityDest.y)) <= (this->unk_60.y * 50.0f))) && (gPlayer[0].mercyTimer == 0)) { Player_ApplyDamage(gPlayer, 0, 40); } break; case 11: - effect->obj.rot.z += 20.0f; - effect->vel.y -= 2.0f; - if (effect->vel.y < (-20.0f)) { - effect->vel.y = -20.0f; + this->obj.rot.z += 20.0f; + this->vel.y -= 2.0f; + if (this->vel.y < (-20.0f)) { + this->vel.y = -20.0f; } - Math_SmoothStepToF(&effect->scale1, 0.0f, 0.1f, 100.0f, 0.00001f); + Math_SmoothStepToF(&this->scale1, 0.0f, 0.1f, 100.0f, 0.00001f); - if ((effect->scale1 < 1.0f) || (effect->timer_50 == 0)) { - Object_Kill(&effect->obj, effect->sfxSource); + if ((this->scale1 < 1.0f) || (this->timer_50 == 0)) { + Object_Kill(&this->obj, this->sfxSource); } break; case 12: - func_effect_8007A28C(effect); + Effect_Effect383_Update(this); break; } - if ((effect->state == 2) && (effect->unk_44 == 2)) { - func_effect_8007FE88(effect); + if ((this->state == 2) && (this->unk_44 == 2)) { + Effect_Effect353_354_Update(this); } - if ((effect->state < 4) && (effect->state != 1)) { - func_effect_8007A774(gPlayer, effect, sp84); + if ((this->state < 4) && (this->state != 1)) { + func_effect_8007A774(gPlayer, this, sp84); } } -void func_effect_80082F78(Effect* effect) { +void Effect_Effect395_Draw(Effect395* this) { //! FAKE: Probably some debug stuff printing different messages depending on what unk_4E is. - if (effect->state != 0 && effect->state != 6) { - if (effect->unk_4A && effect->unk_4A) {} + if ((this->state != 0) && (this->state != 6)) { + if (this->unk_4A && this->unk_4A) {} PRINTF("ZO_DISP HELP %d\n"); } - if (effect->state != 1 && effect->state != 2 && effect->state != 4 && effect->state != 5 && effect->state != 7) { - if (effect->unk_4A && !effect->scale2) {} + if ((this->state != 1) && (this->state != 2) && (this->state != 4) && (this->state != 5) && (this->state != 7)) { + if (this->unk_4A && !this->scale2) {} PRINTF("AC_DISP HELP %d\n"); } - switch (effect->state) { + switch (this->state) { case 0: RCP_SetupDL(&gMasterDisp, SETUPDL_49); Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.0f, MTXF_APPLY); @@ -3869,13 +3873,13 @@ void func_effect_80082F78(Effect* effect) { case 1: RCP_SetupDL(&gMasterDisp, SETUPDL_41); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); gSPDisplayList(gMasterDisp++, D_101C2E0); break; case 2: RCP_SetupDL(&gMasterDisp, SETUPDL_49); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 32, 32, 255, 255); @@ -3888,16 +3892,16 @@ void func_effect_80082F78(Effect* effect) { break; case 4: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL(&gMasterDisp, SETUPDL_68); - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, effect->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, this->unk_4A); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); gSPDisplayList(gMasterDisp++, D_1023750); break; case 5: case 7: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); RCP_SetupDL(&gMasterDisp, SETUPDL_60); if (gCurrentLevel == LEVEL_AQUAS) { gSPDisplayList(gMasterDisp++, D_AQ_600A220); @@ -3908,18 +3912,18 @@ void func_effect_80082F78(Effect* effect) { break; case 6: - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); if (gCurrentLevel == LEVEL_ZONESS) { - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); } RCP_SetupDL(&gMasterDisp, SETUPDL_64); - gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, effect->unk_4A); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, this->unk_4A); gSPDisplayList(gMasterDisp++, D_1023750); break; case 8: RCP_SetupDL(&gMasterDisp, SETUPDL_49); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 0, 128, 255); @@ -3928,9 +3932,9 @@ void func_effect_80082F78(Effect* effect) { case 9: RCP_SetupDL(&gMasterDisp, SETUPDL_49); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->scale1); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->scale1); gDPSetEnvColor(gMasterDisp++, 255, 255, 128, 255); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -3940,7 +3944,7 @@ void func_effect_80082F78(Effect* effect) { Texture_Scroll(D_A6_6012840, 16, 16, 0); } RCP_SetupDL(&gMasterDisp, SETUPDL_53); - Matrix_Scale(gGfxMatrix, effect->unk_60.x, effect->unk_60.y, effect->unk_60.z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->unk_60.x, this->unk_60.y, this->unk_60.z, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6012550); @@ -3948,39 +3952,39 @@ void func_effect_80082F78(Effect* effect) { case 11: RCP_SetupDL(&gMasterDisp, SETUPDL_67); - gDPSetPrimColor(gMasterDisp++, 0, 0, 111, 111, 111, (s32) effect->scale1); + gDPSetPrimColor(gMasterDisp++, 0, 0, 111, 111, 111, (s32) this->scale1); gDPSetEnvColor(gMasterDisp++, 255, 255, 255, 255); - Graphics_SetScaleMtx(effect->scale2); + Graphics_SetScaleMtx(this->scale2); gSPDisplayList(gMasterDisp++, D_1024AC0); break; case 12: - func_effect_8007A3C0(effect); + Effect_Effect383_Draw(this); break; } RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_800836C0(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 scale) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_391; +void func_effect_800836C0(Effect391* this, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 scale) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_391; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->unk_60.x = scale * 0.8f; - effect->unk_60.y = 1.2f; + this->unk_60.x = scale * 0.8f; + this->unk_60.y = 1.2f; if (arg4 != 0.0f) { - effect->unk_60.y = arg4; + this->unk_60.y = arg4; } - effect->unk_44 = 230; - effect->scale1 = scale; - effect->scale2 = 0.1f; - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_44 = 230; + this->scale1 = scale; + this->scale2 = 0.1f; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_8008377C(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 scale) { @@ -3994,92 +3998,92 @@ void func_effect_8008377C(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 scale) { } } -void func_effect_800837EC(Effect* effect) { +void Effect_Effect391_Update(Effect391* this) { s32 pad[2]; f32 var_fv1; s32 var_s2; s32 i; - switch (effect->state) { + switch (this->state) { case 0: - if (effect->unk_60.y == 1.2f) { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 0.5f, effect->scale1, 0.01f); + if (this->unk_60.y == 1.2f) { + Math_SmoothStepToF(&this->scale2, this->scale1, 0.5f, this->scale1, 0.01f); } else { - Math_SmoothStepToF(&effect->scale2, effect->scale1, 1.0f, effect->scale1 * 0.1f, 0.01f); + Math_SmoothStepToF(&this->scale2, this->scale1, 1.0f, this->scale1 * 0.1f, 0.01f); } - if (effect->scale2 > (effect->scale1 * 0.7f)) { - Math_SmoothStepToF(&effect->unk_60.x, effect->scale2 * 1.3f, 0.1f, 0.5f, 0.0001f); + if (this->scale2 > (this->scale1 * 0.7f)) { + Math_SmoothStepToF(&this->unk_60.x, this->scale2 * 1.3f, 0.1f, 0.5f, 0.0001f); } - if (effect->scale2 == effect->scale1) { - var_s2 = effect->scale2 * 5.0f; + if (this->scale2 == this->scale1) { + var_s2 = this->scale2 * 5.0f; if (var_s2 < 5) { var_s2 = 5; } if (var_s2 > 10) { var_s2 = 10; } - var_fv1 = effect->unk_60.y * 300.0f; - if (effect->unk_60.y == 1.2f) { - var_fv1 = effect->unk_60.y * 100.0f; + var_fv1 = this->unk_60.y * 300.0f; + if (this->unk_60.y == 1.2f) { + var_fv1 = this->unk_60.y * 100.0f; } for (i = 0; i < var_s2; i++) { - func_effect_80081BEC(effect->obj.pos.x + RAND_FLOAT_CENTERED(effect->scale2 * 200.0f), - effect->obj.pos.y + var_fv1 + RAND_FLOAT_CENTERED(effect->scale2 * 100.0f), - effect->obj.pos.z + RAND_FLOAT_CENTERED(effect->scale2 * 200.0f), + func_effect_80081BEC(this->obj.pos.x + RAND_FLOAT_CENTERED(this->scale2 * 200.0f), + this->obj.pos.y + var_fv1 + RAND_FLOAT_CENTERED(this->scale2 * 100.0f), + this->obj.pos.z + RAND_FLOAT_CENTERED(this->scale2 * 200.0f), 0.3f - RAND_FLOAT_CENTERED(0.2f), 11); } - effect->state++; + this->state++; } break; case 1: - effect->vel.y -= 4.0f; - Math_SmoothStepToF(&effect->scale2, 0.0f, 0.01f, 0.1f, 0.0001f); - Math_SmoothStepToF(&effect->unk_60.x, effect->scale2 * 1.3f, 0.1f, 0.5f, 0.0001f); - effect->unk_44 -= 35; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->vel.y -= 4.0f; + Math_SmoothStepToF(&this->scale2, 0.0f, 0.01f, 0.1f, 0.0001f); + Math_SmoothStepToF(&this->unk_60.x, this->scale2 * 1.3f, 0.1f, 0.5f, 0.0001f); + this->unk_44 -= 35; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } - effect->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - effect->obj.pos.x, - gPlayer[0].cam.eye.z - (effect->obj.pos.z + gPathProgress))); + this->obj.rot.y = RAD_TO_DEG( + Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress))); } -void func_effect_80083B8C(Effect* effect) { +void Effect_Effect391_Draw(Effect391* this) { RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gDPSetEnvColor(gMasterDisp++, 36, 45, 28, 255); - Matrix_Scale(gGfxMatrix, effect->unk_60.x, effect->scale2 * effect->unk_60.y, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->unk_60.x, this->scale2 * this->unk_60.y, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601BAD0); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void func_effect_80083C70(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 arg7, +void func_effect_80083C70(Effect399* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 arg7, s32 arg8) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_399; - effect->obj.pos.x = xPos; - effect->unk_60.x = xPos; - effect->unk_60.y = yPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_399; + this->obj.pos.x = xPos; + this->unk_60.x = xPos; + this->unk_60.y = yPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - effect->unk_60.z = arg7; - effect->scale2 = 1.6f; - effect->scale1 = 0.0f; - effect->timer_50 = 100; - effect->unk_44 = arg8; - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_60.z = arg7; + this->scale2 = 1.6f; + this->scale1 = 0.0f; + this->timer_50 = 100; + this->unk_44 = arg8; + Object_SetInfo(&this->info, this->obj.id); } void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) { @@ -4138,46 +4142,46 @@ void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) { } } -void func_effect_80083FA8(Effect* effect) { +void Effect_Effect399_Update(Effect399* this) { Vec3f src; Vec3f dest; - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); return; } - effect->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); - effect->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); - effect->obj.rot.z += 20.0f; + this->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + this->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); + this->obj.rot.z += 20.0f; - Matrix_RotateZ(gCalcMatrix, effect->unk_60.z * M_DTOR, MTXF_NEW); - Matrix_RotateZ(gCalcMatrix, effect->unk_46 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->unk_60.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->unk_46 * M_DTOR, MTXF_APPLY); src.x = 0.0f; - src.y = effect->scale1; + src.y = this->scale1; src.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - effect->unk_60.x += effect->vel.x; - effect->unk_60.y += effect->vel.y; + this->unk_60.x += this->vel.x; + this->unk_60.y += this->vel.y; - effect->obj.pos.x = effect->unk_60.x + dest.x; - effect->obj.pos.y = effect->unk_60.y + dest.y; + this->obj.pos.x = this->unk_60.x + dest.x; + this->obj.pos.y = this->unk_60.y + dest.y; - effect->unk_48 += 2; - if (effect->unk_48 > 20) { - effect->unk_48 = 20; + this->unk_48 += 2; + if (this->unk_48 > 20) { + this->unk_48 = 20; } - effect->unk_46 += effect->unk_48; + this->unk_46 += this->unk_48; - Math_SmoothStepToF(&effect->scale1, 350.0f, 1.0f, 20.0f, 0.00001f); + Math_SmoothStepToF(&this->scale1, 350.0f, 1.0f, 20.0f, 0.00001f); - if ((effect->scale1 >= 349.0f) && (effect->timer_50 > 50)) { - effect->timer_50 = 50; + if ((this->scale1 >= 349.0f) && (this->timer_50 > 50)) { + this->timer_50 = 50; } - func_effect_8007A774(gPlayer, effect, 100.0f); + func_effect_8007A774(gPlayer, this, 100.0f); } // RGB Values. Used like an array of [8][3], but only matches this way. @@ -4186,21 +4190,21 @@ static s32 D_800D18F0[] = { 32, 32, 255, 0, 255, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, // Alpha values static s32 D_800D1950[] = { 255, 210, 180, 120, 70, 30, 0, 0 }; -void func_effect_80084194(Effect* effect) { +void Effect_Effect399_Draw(Effect399* this) { s32 tmp; if (gCurrentLevel != LEVEL_AQUAS) { RCP_SetupDL(&gMasterDisp, SETUPDL_49); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - tmp = effect->unk_44 * 4; + tmp = this->unk_44 * 4; gDPSetEnvColor(gMasterDisp++, D_800D18F0[tmp + 0], D_800D18F0[tmp + 1], D_800D18F0[tmp + 2], 255); } else { RCP_SetupDL(&gMasterDisp, SETUPDL_49); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_800D1950[effect->unk_44]); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_800D1950[this->unk_44]); gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); } gSPDisplayList(gMasterDisp++, D_1024AC0); diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 6dccb46b..8273a1bf 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -24,12 +24,15 @@ s32 gLastPathChange; u8 gMissedZoSearchlight; ObjectInit* gLevelObjectInits[] = { - D_CO_60371A4, D_ME_6026CC4, D_SX_602A164, D_A6_6023F64, D_A6_60287A4, D_SY_602E4F4, D_VE1_6007E74, - D_SO_601F234, D_ZO_6026714, D_ANDROSS_C035154, D_TR_6006AA4, D_MA_6031000, D_TI_6006C60, D_AQ_602E5C8, - D_FO_600EAD4, NULL, D_KA_6011044, D_BO_600FF74, D_SZ_6006EB4, D_VE2_6014D94, D_versus_302DE3C, + aCoOnRailsLevelObjects, D_ME_6026CC4, D_SX_602A164, D_A6_6023F64, + D_A6_60287A4, D_SY_602E4F4, D_VE1_6007E74, D_SO_601F234, + D_ZO_6026714, D_ANDROSS_C035154, D_TR_6006AA4, D_MA_6031000, + D_TI_6006C60, D_AQ_602E5C8, D_FO_600EAD4, NULL, + D_KA_6011044, D_BO_600FF74, D_SZ_6006EB4, D_VE2_6014D94, + D_versus_302DE3C, }; static s32 D_enmy_800CFDF4[] = { - /* 0 */ OBJ_SCENERY_0, + /* 0 */ OBJ_SCENERY_CO_STONE_ARCH, /* 1 */ OBJ_ITEM_SILVER_RING, /* 2 */ OBJ_ITEM_SILVER_RING, /* 3 */ OBJ_ITEM_SILVER_RING, @@ -53,7 +56,7 @@ static s32 D_enmy_800CFDF4[] = { /* 21 */ OBJ_ITEM_SILVER_RING, /* 22 */ OBJ_ITEM_SILVER_RING, /* 23 */ OBJ_ITEM_WING_REPAIR, - /* 24 */ OBJ_SCENERY_0, + /* 24 */ OBJ_SCENERY_CO_STONE_ARCH, /* 25 */ OBJ_ITEM_SILVER_STAR, }; static f32 D_enmy_800CFE5C[] = { @@ -92,41 +95,48 @@ void Object_Kill(Object* obj, f32* sfxSrc) { } bool func_enmy_80060FE4(Vec3f* arg0, f32 arg1) { - Vec3f sp2C; - Vec3f sp20; + Vec3f src; + Vec3f dest; if ((gLevelMode != LEVELMODE_ALL_RANGE) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { return true; } - Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); - sp2C.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; - sp2C.y = 0.0f; - sp2C.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp2C, &sp20); - if ((sp20.z < 1000.0f) && (arg1 < sp20.z) && (fabsf(sp20.x) < (fabsf(sp20.z * 0.5f) + 2000.0f))) { + Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); + + src.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; + src.y = 0.0f; + src.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + + if ((dest.z < 1000.0f) && (arg1 < dest.z) && (fabsf(dest.x) < (fabsf(dest.z * 0.5f) + 2000.0f))) { return true; } return false; } bool func_enmy_80061148(Vec3f* arg0, f32 arg1) { - Vec3f sp2C; - Vec3f sp20; + Vec3f src; + Vec3f dest; if (gLevelMode != LEVELMODE_ALL_RANGE) { return true; } + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { return func_enmy_80060FE4(arg0, arg1); } - Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); - sp2C.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; - sp2C.y = 0.0f; - sp2C.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp2C, &sp20); - if ((sp20.z < 0.0f) && (arg1 < sp20.z) && (fabsf(sp20.x) < (fabsf(sp20.z * 0.5f) + 500.0f))) { + Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); + + src.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; + src.y = 0.0f; + src.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + + if ((dest.z < 0.0f) && (arg1 < dest.z) && (fabsf(dest.x) < (fabsf(dest.z * 0.5f) + 500.0f))) { return true; } return false; @@ -140,152 +150,156 @@ void Object_SetInfo(ObjectInfo* info, u32 objId) { } } -void Scenery_Initialize(Scenery* scenery) { +void Scenery_Initialize(Scenery* this) { s32 i; - u8* ptr = (u8*) scenery; + u8* ptr = (u8*) this; for (i = 0; i < sizeof(Scenery); i++, ptr++) { *ptr = 0; } } -void Sprite_Initialize(Sprite* sprite) { +void Sprite_Initialize(Sprite* this) { s32 i; - u8* ptr = (u8*) sprite; + u8* ptr = (u8*) this; for (i = 0; i < sizeof(Sprite); i++, ptr++) { *ptr = 0; } } -void Actor_Initialize(Actor* actor) { +void Actor_Initialize(Actor* this) { s32 i; - u8* ptr = (u8*) actor; + u8* ptr = (u8*) this; for (i = 0; i < sizeof(Actor); i++, ptr++) { *ptr = 0; } - actor->scale = 1.0f; + this->scale = 1.0f; } -void Boss_Initialize(Boss* boss) { +void Boss_Initialize(Boss* this) { s32 i; - u8* ptr = (u8*) boss; + u8* ptr = (u8*) this; for (i = 0; i < sizeof(Boss); i++, ptr++) { *ptr = 0; } - boss->scale = 1.0f; + this->scale = 1.0f; } -void Item_Initialize(Item* item) { +void Item_Initialize(Item* this) { s32 i; - u8* ptr = (u8*) item; + u8* ptr = (u8*) this; for (i = 0; i < sizeof(Item); i++, ptr++) { *ptr = 0; } } -void Effect_Initialize(Effect* effect) { +void Effect_Initialize(Effect* this) { s32 i; - u8* ptr = (u8*) effect; + u8* ptr = (u8*) this; for (i = 0; i < sizeof(Effect); i++, ptr++) { *ptr = 0; } - effect->scale2 = 1.0f; + this->scale2 = 1.0f; } -void Scenery_Load(Scenery* scenery, ObjectInit* objInit) { - Scenery_Initialize(scenery); - scenery->obj.status = OBJ_INIT; - scenery->obj.pos.z = -objInit->zPos1; - scenery->obj.pos.z += -3000.0f + objInit->zPos2; - scenery->obj.pos.x = objInit->xPos; - scenery->obj.pos.y = objInit->yPos; - scenery->obj.rot.x = objInit->rot.x; - scenery->obj.rot.y = objInit->rot.y; - scenery->obj.rot.z = objInit->rot.z; - scenery->obj.id = objInit->id; - Object_SetInfo(&scenery->info, scenery->obj.id); +void Scenery_Load(Scenery* this, ObjectInit* objInit) { + Scenery_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.pos.z = -objInit->zPos1; + this->obj.pos.z += -3000.0f + objInit->zPos2; + this->obj.pos.x = objInit->xPos; + this->obj.pos.y = objInit->yPos; + this->obj.rot.x = objInit->rot.x; + this->obj.rot.y = objInit->rot.y; + this->obj.rot.z = objInit->rot.z; + this->obj.id = objInit->id; + Object_SetInfo(&this->info, this->obj.id); } -void Sprite_Load(Sprite* sprite, ObjectInit* objInit) { - Sprite_Initialize(sprite); - sprite->obj.status = OBJ_INIT; - sprite->obj.pos.z = -objInit->zPos1; - sprite->obj.pos.z += -3000.0f + objInit->zPos2; - sprite->obj.pos.x = objInit->xPos; - sprite->obj.pos.y = objInit->yPos; - sprite->obj.rot.y = objInit->rot.y; - sprite->obj.rot.x = objInit->rot.x; - sprite->obj.rot.z = objInit->rot.z; - sprite->obj.id = objInit->id; - Object_SetInfo(&sprite->info, sprite->obj.id); +void Sprite_Load(Sprite* this, ObjectInit* objInit) { + Sprite_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.pos.z = -objInit->zPos1; + this->obj.pos.z += -3000.0f + objInit->zPos2; + this->obj.pos.x = objInit->xPos; + this->obj.pos.y = objInit->yPos; + this->obj.rot.y = objInit->rot.y; + this->obj.rot.x = objInit->rot.x; + this->obj.rot.z = objInit->rot.z; + this->obj.id = objInit->id; + Object_SetInfo(&this->info, this->obj.id); } -void Actor_Load(Actor* actor, ObjectInit* objInit) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.pos.z = -objInit->zPos1; - actor->obj.pos.z += -3000.0f + objInit->zPos2; - actor->obj.pos.x = objInit->xPos; - actor->obj.pos.y = objInit->yPos; - actor->obj.rot.y = objInit->rot.y; - actor->obj.rot.x = objInit->rot.x; - actor->obj.rot.z = objInit->rot.z; - actor->obj.id = objInit->id; - Object_SetInfo(&actor->info, actor->obj.id); +void Actor_Load(Actor* this, ObjectInit* objInit) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.pos.z = -objInit->zPos1; + this->obj.pos.z += -3000.0f + objInit->zPos2; + this->obj.pos.x = objInit->xPos; + this->obj.pos.y = objInit->yPos; + this->obj.rot.y = objInit->rot.y; + this->obj.rot.x = objInit->rot.x; + this->obj.rot.z = objInit->rot.z; + this->obj.id = objInit->id; + Object_SetInfo(&this->info, this->obj.id); } -void Boss_Load(Boss* boss, ObjectInit* objInit) { - Boss_Initialize(boss); - boss->obj.status = OBJ_INIT; - boss->obj.pos.z = -objInit->zPos1; - boss->obj.pos.z += -3000.0f + objInit->zPos2; - boss->obj.pos.x = objInit->xPos; - boss->obj.pos.y = objInit->yPos; - boss->obj.rot.y = objInit->rot.y; - boss->obj.rot.x = objInit->rot.x; - boss->obj.rot.z = objInit->rot.z; - boss->obj.id = objInit->id; - Object_SetInfo(&boss->info, boss->obj.id); +void Boss_Load(Boss* this, ObjectInit* objInit) { + Boss_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.pos.z = -objInit->zPos1; + this->obj.pos.z += -3000.0f + objInit->zPos2; + this->obj.pos.x = objInit->xPos; + this->obj.pos.y = objInit->yPos; + this->obj.rot.y = objInit->rot.y; + this->obj.rot.x = objInit->rot.x; + this->obj.rot.z = objInit->rot.z; + this->obj.id = objInit->id; + Object_SetInfo(&this->info, this->obj.id); } -void Item_Load(Item* item, ObjectInit* objInit) { - Item_Initialize(item); - item->obj.status = OBJ_INIT; - item->obj.pos.z = -objInit->zPos1; - item->obj.pos.z += -3000.0f + objInit->zPos2; - item->obj.pos.x = objInit->xPos; - item->obj.pos.y = objInit->yPos; - item->obj.rot.y = objInit->rot.y; - item->obj.rot.x = objInit->rot.x; - item->obj.rot.z = objInit->rot.z; - item->obj.id = objInit->id; - item->width = 1.0f; - Object_SetInfo(&item->info, item->obj.id); +void Item_Load(Item* this, ObjectInit* objInit) { + Item_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.pos.z = -objInit->zPos1; + this->obj.pos.z += -3000.0f + objInit->zPos2; + this->obj.pos.x = objInit->xPos; + this->obj.pos.y = objInit->yPos; + this->obj.rot.y = objInit->rot.y; + this->obj.rot.x = objInit->rot.x; + this->obj.rot.z = objInit->rot.z; + this->obj.id = objInit->id; + this->width = 1.0f; + Object_SetInfo(&this->info, this->obj.id); } -void func_enmy_80061958(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_346; - effect->timer_50 = 50; - effect->scale2 = 0.2f; +void func_enmy_80061958(Effect346* this, f32 xPos, f32 yPos, f32 zPos) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_346; + this->timer_50 = 50; + this->scale2 = 0.2f; + if (gCurrentLevel == LEVEL_AQUAS) { - effect->timer_50 = 200; - effect->scale2 = 0.3f; - effect->scale1 = RAND_FLOAT(255.0f); + this->timer_50 = 200; + this->scale2 = 0.3f; + this->scale1 = RAND_FLOAT(255.0f); } - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->obj.rot.z = RAND_FLOAT(360.0f); + + Object_SetInfo(&this->info, this->obj.id); + if (gLevelType == LEVELTYPE_PLANET) { - effect->info.cullDistance = 100.0f; + this->info.cullDistance = 100.0f; } } @@ -353,57 +367,57 @@ void func_enmy_80061CD0(void) { } } -void func_enmy_80061E48(Actor* actor, f32 xPos, f32 yPos, f32 zPos) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_181; +void func_enmy_80061E48(Actor* this, f32 xPos, f32 yPos, f32 zPos) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_181; if (Rand_ZeroOne() < 0.5f) { - actor->obj.id = OBJ_ACTOR_186; + this->obj.id = OBJ_ACTOR_186; } if (Rand_ZeroOne() < 0.5f) { - actor->obj.id = OBJ_ACTOR_182; + this->obj.id = OBJ_ACTOR_182; } - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->vel.z = 10.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->vel.z = 10.0f; + Object_SetInfo(&this->info, this->obj.id); } -void ActorEvent_Load(Actor* actor, ObjectInit* objInit, s32 index) { - Vec3f sp24; +void ActorEvent_Load(ActorEvent* this, ObjectInit* objInit, s32 index) { + Vec3f src; - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->index = index; - actor->obj.pos.z = -objInit->zPos1; - actor->obj.pos.z += -3000.0f + objInit->zPos2; - actor->obj.pos.x = objInit->xPos; - actor->obj.pos.y = objInit->yPos; - actor->obj.rot.y = actor->rot_0F4.y = objInit->rot.y; - actor->obj.rot.x = actor->rot_0F4.x = objInit->rot.x; - actor->rot_0F4.z = objInit->rot.z; - actor->obj.id = OBJ_ACTOR_EVENT; - actor->timer_0C2 = 10; - actor->eventType = EVID_FFF; - actor->aiType = objInit->id - ACTOR_EVENT_ID; + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->index = index; + this->obj.pos.z = -objInit->zPos1; + this->obj.pos.z += -3000.0f + objInit->zPos2; + this->obj.pos.x = objInit->xPos; + this->obj.pos.y = objInit->yPos; + this->obj.rot.y = this->rot_0F4.y = objInit->rot.y; + this->obj.rot.x = this->rot_0F4.x = objInit->rot.x; + this->rot_0F4.z = objInit->rot.z; + this->obj.id = OBJ_ACTOR_EVENT; + this->timer_0C2 = 10; + this->eventType = EVID_FFF; + this->aiType = objInit->id - ACTOR_EVENT_ID; - Object_SetInfo(&actor->info, actor->obj.id); - actor->info.cullDistance = 3000.0f; - actor->fwork[25] = 20000.0f; - actor->iwork[1] = gPrevEventActorIndex; - actor->iwork[10] = gActors[gPrevEventActorIndex].aiType; - actor->fwork[22] = gArwingSpeed; + Object_SetInfo(&this->info, this->obj.id); + this->info.cullDistance = 3000.0f; + this->fwork[25] = 20000.0f; + this->iwork[1] = gPrevEventActorIndex; + this->iwork[10] = gActors[gPrevEventActorIndex].aiType; + this->fwork[22] = gArwingSpeed; Matrix_RotateZ(gCalcMatrix, -gFormationInitRot.z * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -gFormationInitRot.x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, -gFormationInitRot.y * M_DTOR, MTXF_APPLY); - sp24.x = actor->obj.pos.x - gFormationInitPos.x; - sp24.y = actor->obj.pos.y - gFormationInitPos.y; - sp24.z = actor->obj.pos.z - gFormationInitPos.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp24, &actor->vwork[28]); - actor->iwork[9] = gFormationLeaderIndex; + src.x = this->obj.pos.x - gFormationInitPos.x; + src.y = this->obj.pos.y - gFormationInitPos.y; + src.z = this->obj.pos.z - gFormationInitPos.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &this->vwork[28]); + this->iwork[9] = gFormationLeaderIndex; gPrevEventActorIndex = index; - Actor_Update(actor); + Actor_Update(this); } void Object_Load(ObjectInit* objInit, f32 xMax, f32 xMin, f32 yMax, f32 yMin) { @@ -505,14 +519,15 @@ void Object_Load(ObjectInit* objInit, f32 xMax, f32 xMin, f32 yMax, f32 yMin) { void func_enmy_80062568(void) { ObjectInit* objInit; - s32 var_s0; + s32 i; s32 temp = gCurrentLevel; // seems fake + if (1) {} gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[temp]); - var_s0 = gSavedObjectLoadIndex - 40; - objInit = &gLevelObjects[var_s0]; + i = gSavedObjectLoadIndex - 40; + objInit = &gLevelObjects[i]; - for (; var_s0 < gSavedObjectLoadIndex; var_s0++, objInit++) { + for (; i < gSavedObjectLoadIndex; i++, objInit++) { Object_Load(objInit, 4000.0f, -4000.0f, 4000.0f, -4000.0f); } } @@ -748,8 +763,8 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o objPos.y = obj->pos.y; objPos.z = obj->pos.z; if ((objId == OBJ_ACTOR_180) || (objId == OBJ_SCENERY_149) || (objId == OBJ_SCENERY_150) || - (objId == OBJ_BOSS_FO) || (objId == OBJ_BOSS_SZ) || (objId == OBJ_BOSS_VE2) || (objId == OBJ_BOSS_309) || - (objId == OBJ_SCENERY_ME_TUNNEL)) { + (objId == OBJ_BOSS_FO) || (objId == OBJ_BOSS_SZ_GREAT_FOX) || (objId == OBJ_BOSS_VE2) || + (objId == OBJ_BOSS_309) || (objId == OBJ_SCENERY_ME_TUNNEL)) { colId = COL1_0; if (objId == OBJ_BOSS_VE2) { colId = COL1_9; @@ -764,7 +779,7 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o colId = COL1_5; } else if (objId == OBJ_SCENERY_150) { colId = COL1_6; - } else if (objId == OBJ_BOSS_SZ) { + } else if (objId == OBJ_BOSS_SZ_GREAT_FOX) { colId = COL1_8; } if (func_col1_800998FC(&relPos, &objPos, vel, colId, &sp44, sp30) > 0) { @@ -772,10 +787,10 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o } } else { colId = COL2_0; - if (objId == OBJ_SCENERY_2) { + if (objId == OBJ_SCENERY_CO_BUMP_2) { colId = COL2_2; } - if (objId == OBJ_SCENERY_3) { + if (objId == OBJ_SCENERY_CO_BUMP_3) { colId = COL2_3; } if (objId == OBJ_SCENERY_140) { @@ -786,7 +801,7 @@ bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* o } if (objId == OBJ_SCENERY_117) { colId = COL2_14; - } else if ((objId == OBJ_SCENERY_4) || (objId == OBJ_SCENERY_5)) { + } else if ((objId == OBJ_SCENERY_CO_BUMP_4) || (objId == OBJ_SCENERY_CO_BUMP_5)) { colId = COL2_1; } if (func_col2_800A3690(&relPos, &objPos, colId, &sp44)) { @@ -810,7 +825,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { scenery360 = gScenery360; for (i = 0; i < 200; i++, scenery360++) { if (scenery360->obj.status == OBJ_ACTIVE) { - if ((scenery360->obj.id == OBJ_SCENERY_1) || (scenery360->obj.id == OBJ_SCENERY_3) || + if ((scenery360->obj.id == OBJ_SCENERY_CO_BUMP_1) || (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3) || (scenery360->obj.id == OBJ_SCENERY_117) || (scenery360->obj.id == OBJ_SCENERY_141) || (scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_149) || (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_140)) { @@ -826,12 +841,13 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } } } - scenery = gScenery; + + scenery = &gScenery[0]; for (i = 0; (i < ARRAY_COUNT(gScenery)) && (gLevelMode == LEVELMODE_ON_RAILS); i++, scenery++) { if (scenery->obj.status == OBJ_ACTIVE) { - if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_4) || - (scenery->obj.id == OBJ_SCENERY_5) || (scenery->obj.id == OBJ_SCENERY_2) || - (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || (scenery->obj.id == OBJ_SCENERY_3)) { + if ((scenery->obj.id == OBJ_SCENERY_CO_BUMP_1) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_4) || + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_5) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_2) || + (scenery->obj.id == OBJ_SCENERY_ME_TUNNEL) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_3)) { if (Object_CheckPolyCollision(pos, vel, scenery->obj.id, &scenery->obj)) { return 2; } @@ -843,7 +859,8 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } } } - sprite = gSprites; + + sprite = &gSprites[0]; for (i = 0; i < ARRAY_COUNT(gSprites); i++, sprite++) { if ((sprite->obj.status == OBJ_ACTIVE) && (fabsf(pos->x - sprite->obj.pos.x) < 500.0f) && (fabsf(pos->z - sprite->obj.pos.z) < 500.0f) && @@ -855,13 +872,14 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { return 0; } } + if ((mode == 0) || (mode == 2) || (mode == 3)) { if (mode != 2) { - boss = gBosses; + boss = &gBosses[0]; for (i = 0; i < ARRAY_COUNT(gBosses); i++, boss++) { if (boss->obj.status == OBJ_ACTIVE) { if ((boss->obj.id == OBJ_BOSS_FO) || (boss->obj.id == OBJ_BOSS_VE2) || - (boss->obj.id == OBJ_BOSS_SZ) || (boss->obj.id == OBJ_BOSS_309)) { + (boss->obj.id == OBJ_BOSS_SZ_GREAT_FOX) || (boss->obj.id == OBJ_BOSS_309)) { if (Object_CheckPolyCollision(pos, vel, boss->obj.id, &boss->obj)) { return 2; } @@ -892,7 +910,8 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { } } } - actor = gActors; + + actor = &gActors[0]; for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(pos->x - actor->obj.pos.x) < 1000.0f) && (fabsf(pos->z - actor->obj.pos.z) < 1500.0f) && (index != i) && (actor->info.unk_16 != 2) && @@ -919,7 +938,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { actor->dmgPart = -1; if (!(((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->iwork[12] != 0)) || ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && - ((actor->aiType < AI360_10) || (actor->aiType >= AI360_GREAT_FOX))))) { + ((actor->aiType < AI360_ENEMY) || (actor->aiType >= AI360_GREAT_FOX))))) { actor->health = 0; } actor->hitPos.x = pos->x; @@ -934,7 +953,7 @@ s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { return 0; } -void func_enmy_80063CAC(Scenery* scenery) { +void func_enmy_80063CAC(Scenery* this) { s32 i; for (i = 0; i < ARRAY_COUNT(gActors); i++) { @@ -942,9 +961,9 @@ void func_enmy_80063CAC(Scenery* scenery) { Actor_Initialize(&gActors[i]); gActors[i].obj.status = OBJ_INIT; gActors[i].obj.id = OBJ_ACTOR_193; - gActors[i].obj.pos.x = scenery->obj.pos.x; - gActors[i].obj.pos.y = scenery->obj.pos.y; - gActors[i].obj.pos.z = scenery->obj.pos.z; + gActors[i].obj.pos.x = this->obj.pos.x; + gActors[i].obj.pos.y = this->obj.pos.y; + gActors[i].obj.pos.z = this->obj.pos.z; gActors[i].obj.rot.y = RAND_FLOAT(360.0f); Object_SetInfo(&gActors[i].info, gActors[i].obj.id); break; @@ -952,34 +971,37 @@ void func_enmy_80063CAC(Scenery* scenery) { } } -void func_enmy_80063D58(Scenery* scenery) { +void func_enmy_80063D58(CoDoors* this) { s32 i; - scenery->obj.pos.y = gGroundHeight; + this->obj.pos.y = gGroundHeight; + for (i = 0; i < ARRAY_COUNT(gSprites); i++) { if (gSprites[i].obj.status == OBJ_FREE) { Sprite_Initialize(&gSprites[i]); gSprites[i].obj.status = OBJ_INIT; gSprites[i].obj.id = OBJ_SPRITE_FOG_SHADOW; - gSprites[i].sceneryId = scenery->obj.id; - gSprites[i].obj.pos.x = scenery->obj.pos.x; + gSprites[i].sceneryId = this->obj.id; + gSprites[i].obj.pos.x = this->obj.pos.x; gSprites[i].obj.pos.y = 5.0f; - gSprites[i].obj.pos.z = scenery->obj.pos.z; - if ((scenery->obj.id == OBJ_SCENERY_0) || (scenery->obj.id == OBJ_SCENERY_6) || - (scenery->obj.id == OBJ_SCENERY_7) || (scenery->obj.id == OBJ_SCENERY_56) || - (scenery->obj.id == OBJ_SCENERY_20) || (scenery->obj.id == OBJ_SCENERY_21) || - (scenery->obj.id == OBJ_SCENERY_22)) { - gSprites[i].obj.rot.y = scenery->obj.rot.y; + gSprites[i].obj.pos.z = this->obj.pos.z; + + if ((this->obj.id == OBJ_SCENERY_CO_STONE_ARCH) || (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_1) || + (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_2) || (this->obj.id == OBJ_SCENERY_CO_DOORS) || + (this->obj.id == OBJ_SCENERY_CO_ARCH_1) || (this->obj.id == OBJ_SCENERY_CO_ARCH_2) || + (this->obj.id == OBJ_SCENERY_CO_ARCH_3)) { + gSprites[i].obj.rot.y = this->obj.rot.y; } else { gSprites[i].obj.rot.y = 44.9f; } + Object_SetInfo(&gSprites[i].info, gSprites[i].obj.id); break; } } } -void func_enmy_80063E5C(Scenery* scenery, f32* hitboxData) { +void func_enmy_80063E5C(Scenery* this, f32* hitboxData) { s32 i; Item* item; @@ -988,10 +1010,10 @@ void func_enmy_80063E5C(Scenery* scenery, f32* hitboxData) { Item_Initialize(&gItems[i]); item->obj.status = OBJ_INIT; item->obj.id = OBJ_ITEM_RING_CHECK; - item->obj.pos.x = scenery->obj.pos.x; - item->obj.pos.y = scenery->obj.pos.y; - item->obj.pos.z = scenery->obj.pos.z; - item->obj.rot.y = scenery->obj.rot.y; + item->obj.pos.x = this->obj.pos.x; + item->obj.pos.y = this->obj.pos.y; + item->obj.pos.z = this->obj.pos.z; + item->obj.rot.y = this->obj.rot.y; Object_SetInfo(&item->info, item->obj.id); item->info.hitbox = SEGMENTED_TO_VIRTUAL(hitboxData); break; @@ -1020,12 +1042,12 @@ void Object_Init(s32 index, ObjectId objId) { switch (objId) { case OBJ_SPRITE_CO_SMOKE: - func_effect_8007A6F0(&gSprites[index].obj.pos, NA_SE_OB_SMOKE); + Effect_SpawnTimedSfxAtPos(&gSprites[index].obj.pos, NA_SE_OB_SMOKE); break; case OBJ_ACTOR_234: AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, gActors[index].sfxSource, 0); break; - case OBJ_SCENERY_54: + case OBJ_SCENERY_CO_WATERFALL: AUDIO_PLAY_SFX(NA_SE_FALL, gScenery[index].sfxSource, 0); break; case OBJ_ACTOR_TEAM_BOSS: @@ -1075,7 +1097,7 @@ void Object_Init(s32 index, ObjectId objId) { case OBJ_SCENERY_TI_RIB_8: func_enmy_80063E5C(&gScenery[index], D_TI_6006A20); break; - case OBJ_SCENERY_23: + case OBJ_SCENERY_CO_RADAR: func_enmy_80063CAC(&gScenery[index]); break; case OBJ_ITEM_CHECKPOINT: @@ -1105,15 +1127,15 @@ void Object_Init(s32 index, ObjectId objId) { gItems[index].obj.status = OBJ_FREE; } break; - case OBJ_SCENERY_0: + case OBJ_SCENERY_CO_STONE_ARCH: func_enmy_80063E5C(&gScenery[index], gItemRingCheckHitbox); /* fallthrough */ - case OBJ_SCENERY_6: - case OBJ_SCENERY_7: - case OBJ_SCENERY_20: - case OBJ_SCENERY_21: - case OBJ_SCENERY_22: - case OBJ_SCENERY_56: + case OBJ_SCENERY_CO_HIGHWAY_1: + case OBJ_SCENERY_CO_HIGHWAY_2: + case OBJ_SCENERY_CO_ARCH_1: + case OBJ_SCENERY_CO_ARCH_2: + case OBJ_SCENERY_CO_ARCH_3: + case OBJ_SCENERY_CO_DOORS: func_enmy_80063D58(&gScenery[index]); break; case OBJ_ACTOR_187: @@ -1179,8 +1201,8 @@ void Object_Init(s32 index, ObjectId objId) { gActors[index].obj.status = OBJ_FREE; } break; - case OBJ_ACTOR_190: - case OBJ_ACTOR_191: + case OBJ_MISSILE_SEEK_TEAM: + case OBJ_MISSILE_SEEK_PLAYER: AUDIO_PLAY_SFX(NA_SE_EN_MISSILE_ENGINE, gActors[index].sfxSource, 4); break; case OBJ_ACTOR_192: @@ -1227,11 +1249,11 @@ void Object_Init(s32 index, ObjectId objId) { case OBJ_SCENERY_65: Macbeth_801A65E0(&gScenery[index]); break; - case OBJ_ACTOR_177: - case OBJ_ACTOR_178: - Corneria_8018B0B4(&gActors[index]); + case OBJ_ACTOR_CO_GARUDA_2: + case OBJ_ACTOR_CO_GARUDA_3: + Corneria_IBeam_Init(&gActors[index]); /* fallthrough */ - case OBJ_ACTOR_176: + case OBJ_ACTOR_CO_GARUDA_1: gActors[index].health = 24; AUDIO_PLAY_SFX(NA_SE_EN_TANK_RB_ENGINE, gActors[index].sfxSource, 4); break; @@ -1244,11 +1266,11 @@ void Object_Init(s32 index, ObjectId objId) { case OBJ_BOSS_300: Boss300_Init(&gBosses[index]); break; - case OBJ_BOSS_292: - Corneria_Boss292_Init(&gBosses[index]); + case OBJ_BOSS_CO_GRANGA: + Corneria_Granga_Init(&gBosses[index]); break; - case OBJ_BOSS_293: - Corneria_Boss293_Init(&gBosses[index]); + case OBJ_BOSS_CO_CARRIER: + Corneria_Carrier_Init(&gBosses[index]); break; case OBJ_BOSS_A6: Area6_BossA6_Init(&gBosses[index]); @@ -1344,37 +1366,37 @@ void Object_Init(s32 index, ObjectId objId) { } } -void Scenery_UpdateTitaniaBones(Scenery* scenery) { +void Scenery_UpdateTitaniaBones(Scenery* this) { f32 sp2C; f32 sp28; f32 sp24; - if ((gGroundType == 4) && (scenery->state == 0)) { - Ground_801B6E20(scenery->obj.pos.x, scenery->obj.pos.z + gPathProgress, &sp2C, &sp24, &sp28); - scenery->obj.pos.y = sp24 + 3.0f; - scenery->obj.rot.x = RAD_TO_DEG(sp2C); - scenery->obj.rot.z = RAD_TO_DEG(sp28); - scenery->state++; + if ((gGroundType == 4) && (this->state == 0)) { + Ground_801B6E20(this->obj.pos.x, this->obj.pos.z + gPathProgress, &sp2C, &sp24, &sp28); + this->obj.pos.y = sp24 + 3.0f; + this->obj.rot.x = RAD_TO_DEG(sp2C); + this->obj.rot.z = RAD_TO_DEG(sp28); + this->state++; } } -void func_enmy_80065380(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5, f32 arg6) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_182; - actor->timer_0BC = RAND_INT(10.0f) + 10; - actor->timer_0C2 = 30; - actor->vel.x = arg4; - actor->vel.y = arg5; - actor->vel.z = arg6; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->unk_046 = 255; - actor->unk_048 = 900; - actor->obj.rot.z = RAND_FLOAT(360.0f); - actor->obj.rot.y = RAND_FLOAT(360.0f); - Object_SetInfo(&actor->info, actor->obj.id); +void func_enmy_80065380(Actor182* this, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 arg5, f32 arg6) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_182; + this->timer_0BC = RAND_INT(10.0f) + 10; + this->timer_0C2 = 30; + this->vel.x = arg4; + this->vel.y = arg5; + this->vel.z = arg6; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->unk_046 = 255; + this->unk_048 = 900; + this->obj.rot.z = RAND_FLOAT(360.0f); + this->obj.rot.y = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } void func_enmy_8006546C(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 arg5) { @@ -1400,20 +1422,20 @@ void func_enmy_800654E4(Object* obj) { } } -void func_enmy_800655C8(Actor* actor, f32 xPos, f32 yPos, f32 zPos, s32 arg4) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_190; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->eventType = arg4; - actor->timer_0BE = 50; - if (actor->eventType == 1) { - actor->timer_0BE = 30; +void func_enmy_800655C8(Actor190* this, f32 xPos, f32 yPos, f32 zPos, s32 arg4) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_MISSILE_SEEK_TEAM; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->eventType = arg4; + this->timer_0BE = 50; + if (this->eventType == 1) { + this->timer_0BE = 30; } - actor->fwork[5] = 15.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->fwork[5] = 15.0f; + Object_SetInfo(&this->info, this->obj.id); } void func_enmy_8006566C(f32 xPos, f32 yPos, f32 zPos, s32 arg3) { @@ -1427,7 +1449,8 @@ void func_enmy_8006566C(f32 xPos, f32 yPos, f32 zPos, s32 arg3) { } } -void func_enmy_800656D4(Actor* actor) { +// Actors 190 & 191 +void Actors190_191_Update(Actor* this) { s32 i; s32 j; f32 spD4; @@ -1449,12 +1472,13 @@ void func_enmy_800656D4(Actor* actor) { var_ra = (gLevelMode == LEVELMODE_ALL_RANGE) ? 2 : 0; - if (actor->iwork[2] == 0) { - if (actor->obj.id == OBJ_ACTOR_190) { + if (this->iwork[2] == 0) { + if (this->obj.id == OBJ_MISSILE_SEEK_TEAM) { for (i = 0; i < 3; i++) { spB4[i] = gTeamShields[i + 1]; spA8[i] = var_ra + i; } + for (i = 0; i < 3; i++) { for (j = i + 1; j < 3; j++) { if (spB4[i] < spB4[j]) { @@ -1467,6 +1491,7 @@ void func_enmy_800656D4(Actor* actor) { } } } + switch (gGameFrameCount % 6U) { case 0: case 1: @@ -1484,155 +1509,166 @@ void func_enmy_800656D4(Actor* actor) { if (gLevelMode == LEVELMODE_ALL_RANGE) { if (gTeamShields[spC4 - 1] > 0) { - actor->iwork[1] = spC4; + this->iwork[1] = spC4; goto label; } else { - actor->iwork[1] = 10000; + this->iwork[1] = 10000; } } else { if (gTeamShields[spC4 + 1] > 0) { - actor->iwork[1] = spC4; + this->iwork[1] = spC4; goto label; } else { - actor->iwork[1] = 10000; + this->iwork[1] = 10000; } } } - actor->iwork[1] = 10000; + this->iwork[1] = 10000; label: - actor->iwork[2] = 1; + this->iwork[2] = 1; } - spC4 = actor->iwork[1]; + + spC4 = this->iwork[1]; if ((spC4 == var_ra) || ((var_ra + 1) == spC4) || ((var_ra + 2) == spC4)) { - actor->fwork[29] = gActors[spC4].obj.pos.z; - actor->fwork[28] = gActors[spC4].obj.pos.y; - actor->fwork[27] = gActors[spC4].obj.pos.x; - if ((fabsf(actor->obj.pos.x - gActors[spC4].obj.pos.x) < 400.0f) && - (fabsf(actor->obj.pos.z - gActors[spC4].obj.pos.z) < 400.0f)) { + this->fwork[29] = gActors[spC4].obj.pos.z; + this->fwork[28] = gActors[spC4].obj.pos.y; + this->fwork[27] = gActors[spC4].obj.pos.x; + if ((fabsf(this->obj.pos.x - gActors[spC4].obj.pos.x) < 400.0f) && + (fabsf(this->obj.pos.z - gActors[spC4].obj.pos.z) < 400.0f)) { if (RAND_FLOAT(spC4 - 1) < 0.6f) { gActors[spC4].iwork[10] = 1; } } - } else { - actor->fwork[29] = gPlayer[0].trueZpos; - actor->fwork[28] = gPlayer[0].pos.y; - actor->fwork[27] = gPlayer[0].pos.x; + this->fwork[29] = gPlayer[0].trueZpos; + this->fwork[28] = gPlayer[0].pos.y; + this->fwork[27] = gPlayer[0].pos.x; } - if (actor->timer_0BC != 0) { - Math_SmoothStepToAngle(&actor->obj.rot.x, 0.0f, 0.3f, 4.0f, 0.001f); + + if (this->timer_0BC != 0) { + Math_SmoothStepToAngle(&this->obj.rot.x, 0.0f, 0.3f, 4.0f, 0.001f); } else { - if ((actor->iwork[10] == 0) && ((fabsf(actor->fwork[27] - actor->obj.pos.x) > 300.0f) || - (fabsf(actor->fwork[29] - actor->obj.pos.z) > 300.0f))) { - actor->fwork[0] += 5.0f; - actor->fwork[1] += 8.0f; - sp88 = actor->fwork[27] - actor->obj.pos.x; - sp80 = actor->fwork[29] - actor->obj.pos.z; + if ((this->iwork[10] == 0) && ((fabsf(this->fwork[27] - this->obj.pos.x) > 300.0f) || + (fabsf(this->fwork[29] - this->obj.pos.z) > 300.0f))) { + this->fwork[0] += 5.0f; + this->fwork[1] += 8.0f; + sp88 = this->fwork[27] - this->obj.pos.x; + sp80 = this->fwork[29] - this->obj.pos.z; sp80 = sqrtf(SQ(sp88) + SQ(sp80)) * 0.2f; - if (actor->eventType == 1) { + if (this->eventType == 1) { sp80 = 0.1f; } - spD0 = SIN_DEG(actor->fwork[0]) * sp80; - sp88 = COS_DEG(actor->fwork[1]) * sp80; - spD4 = COS_DEG(actor->obj.rot.y) * sp88; - spCC = -SIN_DEG(actor->obj.rot.y) * sp88; + spD0 = SIN_DEG(this->fwork[0]) * sp80; + sp88 = COS_DEG(this->fwork[1]) * sp80; + spD4 = COS_DEG(this->obj.rot.y) * sp88; + spCC = -SIN_DEG(this->obj.rot.y) * sp88; - sp88 = (actor->fwork[27] + spD4) - actor->obj.pos.x; - sp84 = (actor->fwork[28] + spD0) - actor->obj.pos.y; - sp80 = (actor->fwork[29] + spCC) - actor->obj.pos.z; + sp88 = (this->fwork[27] + spD4) - this->obj.pos.x; + sp84 = (this->fwork[28] + spD0) - this->obj.pos.y; + sp80 = (this->fwork[29] + spCC) - this->obj.pos.z; sp78 = Math_RadToDeg(Math_Atan2F(sp88, sp80)); sp80 = sqrtf(SQ(sp88) + SQ(sp80)); sp7C = Math_RadToDeg(-Math_Atan2F(sp84, sp80)); - sp84 = Math_SmoothStepToAngle(&actor->obj.rot.y, sp78, 0.3f, 4.0f, 0.001f); - Math_SmoothStepToAngle(&actor->obj.rot.x, sp7C, 0.3f, 4.0f, 0.001f); + sp84 = Math_SmoothStepToAngle(&this->obj.rot.y, sp78, 0.3f, 4.0f, 0.001f); + Math_SmoothStepToAngle(&this->obj.rot.x, sp7C, 0.3f, 4.0f, 0.001f); } - if ((fabsf(actor->fwork[27] - actor->obj.pos.x) < 60.0f) && - (fabsf(actor->fwork[28] - actor->obj.pos.y) < 60.0f) && - (fabsf(actor->fwork[29] - actor->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) { + + if ((fabsf(this->fwork[27] - this->obj.pos.x) < 60.0f) && (fabsf(this->fwork[28] - this->obj.pos.y) < 60.0f) && + (fabsf(this->fwork[29] - this->obj.pos.z) < 60.0f) && ((spC4 == 2) || (spC4 == 3) || (spC4 == 4))) { gActors[spC4].dmgType = DMG_BEAM; gActors[spC4].damage = 20; gActors[spC4].dmgSource = DMG_SRC_2; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); - Object_Kill(&actor->obj, actor->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f); + Object_Kill(&this->obj, this->sfxSource); } } - Math_Vec3fFromAngles(&sp98, actor->obj.rot.x, actor->obj.rot.y, actor->fwork[5]); - actor->vel.x = sp98.x; - actor->vel.y = sp98.y; - actor->vel.z = sp98.z - gPathVelZ; - if (actor->eventType == 0) { - actor->obj.rot.z += 5.0f; + + Math_Vec3fFromAngles(&sp98, this->obj.rot.x, this->obj.rot.y, this->fwork[5]); + + this->vel.x = sp98.x; + this->vel.y = sp98.y; + this->vel.z = sp98.z - gPathVelZ; + + if (this->eventType == 0) { + this->obj.rot.z += 5.0f; } - if (actor->eventType == 1) { - if (actor->timer_0BE == 0) { - actor->timer_0BE = 30; - Math_Vec3fFromAngles(&sp98, actor->obj.rot.x, actor->obj.rot.y, 120.0f); - func_effect_8007F04C(OBJ_EFFECT_353, actor->obj.pos.x + sp98.x, actor->obj.pos.y + sp98.y, - actor->obj.pos.z + sp98.z, actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, 0.0f, + if (this->eventType == 1) { + if (this->timer_0BE == 0) { + this->timer_0BE = 30; + Math_Vec3fFromAngles(&sp98, this->obj.rot.x, this->obj.rot.y, 120.0f); + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x + sp98.x, this->obj.pos.y + sp98.y, + this->obj.pos.z + sp98.z, this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, 0.0f, 0.0f, 0.0f, sp98.x, sp98.y, sp98.z, 1.0f); } var_fv0 = 330.0f; if (sp84 < 0.0f) { var_fv0 = 30.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToAngle(&this->obj.rot.z, var_fv0, 0.1f, 3.0f, 0.01f); } - if ((gGroundType == 4) && Ground_801B6AEC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); - Object_Kill(&actor->obj, actor->sfxSource); + + if ((gGroundType == 4) && Ground_801B6AEC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f); + Object_Kill(&this->obj, this->sfxSource); } - sp8C.x = actor->vel.x; - sp8C.y = actor->vel.y; - sp8C.z = actor->vel.z; - if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->dmgType != DMG_NONE) || - (actor->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); - Object_Kill(&actor->obj, actor->sfxSource); - if (actor->dmgType != DMG_NONE) { - actor->itemDrop = DROP_SILVER_RING_50p; + + sp8C.x = this->vel.x; + sp8C.y = this->vel.y; + sp8C.z = this->vel.z; + + if ((Object_CheckCollision(this->index, &this->obj.pos, &sp8C, 1) != 0) || (this->dmgType != DMG_NONE) || + (this->obj.pos.y < (gGroundHeight + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f); + Object_Kill(&this->obj, this->sfxSource); + if (this->dmgType != DMG_NONE) { + this->itemDrop = DROP_SILVER_RING_50p; if ((gCurrentLevel == LEVEL_CORNERIA)) { if (gLevelMode == LEVELMODE_ALL_RANGE) { - actor->itemDrop = DROP_SILVER_RING_50p; + this->itemDrop = DROP_SILVER_RING_50p; } else { - actor->itemDrop = DROP_SILVER_RING_25p; + this->itemDrop = DROP_SILVER_RING_25p; } } if (gCurrentLevel == LEVEL_AREA_6) { - actor->itemDrop = DROP_SILVER_RING_10p; + this->itemDrop = DROP_SILVER_RING_10p; } - Actor_Despawn(actor); + Actor_Despawn(this); } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } + if (gLevelMode == LEVELMODE_ON_RAILS) { - if (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 100.0f) { - actor->iwork[10] = 1; + if (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 100.0f) { + this->iwork[10] = 1; } - if (gPlayer[0].cam.eye.z < (actor->obj.pos.z + gPathProgress)) { - Object_Kill(&actor->obj, actor->sfxSource); + if (gPlayer[0].cam.eye.z < (this->obj.pos.z + gPathProgress)) { + Object_Kill(&this->obj, this->sfxSource); } } } -void func_enmy_800660F0(Actor* actor) { - Item* item = gItems; +void func_enmy_800660F0(Actor* this) { + Item* item; s32 i; - for (i = 0; i < ARRAY_COUNT(gItems); i++, item++) { + for (item = &gItems[0], i = 0; i < ARRAY_COUNT(gItems); i++, item++) { if (item->obj.status == OBJ_FREE) { Item_Initialize(item); item->obj.status = OBJ_INIT; - item->obj.id = D_enmy_800CFDF4[actor->itemDrop]; - item->obj.pos.x = actor->obj.pos.x; - item->obj.pos.y = actor->obj.pos.y; - item->obj.pos.z = actor->obj.pos.z; + item->obj.id = D_enmy_800CFDF4[this->itemDrop]; + item->obj.pos.x = this->obj.pos.x; + item->obj.pos.y = this->obj.pos.y; + item->obj.pos.z = this->obj.pos.z; item->timer_4A = 8; + Object_SetInfo(&item->info, item->obj.id); + if ((item->obj.id == OBJ_ITEM_SILVER_RING) || (item->obj.id == OBJ_ITEM_BOMB) || (item->obj.id == OBJ_ITEM_LASERS)) { item->unk_50 = 90.0f; } + if ((item->obj.id >= OBJ_ITEM_GOLD_RING) || (item->obj.id == OBJ_ITEM_1UP)) { item->unk_50 = 90.0f; AUDIO_PLAY_SFX(NA_SE_ITEM_APPEAR, gDefaultSfxSource, 4); @@ -1646,18 +1682,19 @@ void func_enmy_800660F0(Actor* actor) { } } -void Actor_Despawn(Actor* actor) { +void Actor_Despawn(Actor* this) { Actor* otherActor; s32 i; if (gVersusMode) { - if ((actor->dmgSource >= 1) && (actor->dmgSource < 4 + 1) && !VS_TIME_UP(gVsCountdown)) { - gPlayerScores[actor->dmgSource - 1] += actor->info.bonus; + if ((this->dmgSource >= 1) && (this->dmgSource < 4 + 1) && !VS_TIME_UP(gVsCountdown)) { + gPlayerScores[this->dmgSource - 1] += this->info.bonus; } - } else if (!((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->animFrame == 1))) { - if ((actor->dmgSource == AI360_FOX + 1) && (actor->info.bonus != 0)) { - gHitCount += actor->info.bonus; + } else if (!((this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->animFrame == 1))) { + if ((this->dmgSource == AI360_FOX + 1) && (this->info.bonus != 0)) { + gHitCount += this->info.bonus; D_ctx_80177850 = 15; + if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gDropHitCountItem != 0)) { switch (gDropHitCountItem) { case 9: @@ -1668,32 +1705,34 @@ void Actor_Despawn(Actor* actor) { case 4: case 19: case 29: - actor->itemDrop = DROP_GOLD_RING_1; + this->itemDrop = DROP_GOLD_RING_1; break; case 14: - actor->itemDrop = DROP_LASERS; + this->itemDrop = DROP_LASERS; break; } gDropHitCountItem = 0; } - if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { - if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { - AllRange_GetStarWolfHits(actor); + + if (this->obj.id == OBJ_ACTOR_ALLRANGE) { + if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + AllRange_GetStarWolfHits(this); } } } - if (actor->itemDrop) { - if (D_enmy_800CFE5C[actor->itemDrop] < 0.0f) { - otherActor = gActors; + + if (this->itemDrop) { + if (D_enmy_800CFE5C[this->itemDrop] < 0.0f) { + otherActor = &gActors[0]; for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { - if ((otherActor->obj.status != OBJ_FREE) && (otherActor->index != actor->index) && - (otherActor->iwork[15] == actor->iwork[15])) { + if ((otherActor->obj.status != OBJ_FREE) && (otherActor->index != this->index) && + (otherActor->iwork[15] == this->iwork[15])) { return; } } - func_enmy_800660F0(actor); + func_enmy_800660F0(this); AUDIO_PLAY_SFX(NA_SE_ITEM_APPEAR, gDefaultSfxSource, 4); - } else if (actor->itemDrop == DROP_TEAM_MESG) { + } else if (this->itemDrop == DROP_TEAM_MESG) { if (gTeamShields[TEAM_ID_PEPPY] > 0) { Radio_PlayMessage(gMsg_ID_20261, RCID_PEPPY); } else if (gTeamShields[TEAM_ID_SLIPPY] > 0) { @@ -1701,196 +1740,211 @@ void Actor_Despawn(Actor* actor) { } else if (gTeamShields[TEAM_ID_FALCO] > 0) { Radio_PlayMessage(gMsg_ID_20262, RCID_FALCO); } - } else if (Rand_ZeroOne() <= D_enmy_800CFE5C[actor->itemDrop]) { - func_enmy_800660F0(actor); + } else if (Rand_ZeroOne() <= D_enmy_800CFE5C[this->itemDrop]) { + func_enmy_800660F0(this); } } } } -void func_enmy_8006654C(Actor* actor) { - actor->gravity = 0.4f; - if (actor->obj.pos.y <= gGroundHeight + 130.0f) { - actor->obj.pos.y = gGroundHeight + 130.0f; - actor->vel.y = 0.0f; +void Actor192_Update(Actor192* this) { + this->gravity = 0.4f; + + if (this->obj.pos.y <= gGroundHeight + 130.0f) { + this->obj.pos.y = gGroundHeight + 130.0f; + this->vel.y = 0.0f; } - actor->vel.x = SIN_DEG(actor->obj.rot.y) * actor->fwork[0]; - actor->vel.z = COS_DEG(actor->obj.rot.y) * actor->fwork[0]; - switch (actor->state) { + + this->vel.x = SIN_DEG(this->obj.rot.y) * this->fwork[0]; + this->vel.z = COS_DEG(this->obj.rot.y) * this->fwork[0]; + + switch (this->state) { case 0: - if (actor->fwork[0] < 20.0f) { - actor->fwork[0] += 0.5f; + if (this->fwork[0] < 20.0f) { + this->fwork[0] += 0.5f; } - actor->animFrame++; - if (Animation_GetFrameCount(&D_CO_6029528) < actor->animFrame) { - actor->animFrame = 0; + + this->animFrame++; + if (Animation_GetFrameCount(&D_CO_6029528) < this->animFrame) { + this->animFrame = 0; } - if ((actor->obj.rot.z < 15.0f) && (actor->animFrame < 20)) { - actor->obj.rot.z += 1.0f; + + if ((this->obj.rot.z < 15.0f) && (this->animFrame < 20)) { + this->obj.rot.z += 1.0f; } - if ((actor->obj.rot.z > -15.0f) && (actor->animFrame > 20)) { - actor->obj.rot.z -= 1.0f; + if ((this->obj.rot.z > -15.0f) && (this->animFrame > 20)) { + this->obj.rot.z -= 1.0f; } - if ((actor->animFrame == 20) || (actor->animFrame == 40)) { - actor->state++; - actor->timer_0BC = 20; + + if ((this->animFrame == 20) || (this->animFrame == 40)) { + this->state++; + this->timer_0BC = 20; } break; + case 1: - if (actor->obj.rot.z > 0.0f) { - actor->obj.rot.z -= 0.5f; + if (this->obj.rot.z > 0.0f) { + this->obj.rot.z -= 0.5f; } - if (actor->obj.rot.z < 0.0f) { - actor->obj.rot.z += 0.5f; + if (this->obj.rot.z < 0.0f) { + this->obj.rot.z += 0.5f; } - if (actor->fwork[0] > 0.0f) { - actor->fwork[0] -= 0.3f; + + if (this->fwork[0] > 0.0f) { + this->fwork[0] -= 0.3f; } - if (actor->timer_0BC == 0) { - actor->state = 0; + + if (this->timer_0BC == 0) { + this->state = 0; } break; } - actor->scale = 0.8f; - if (actor->dmgType != DMG_NONE) { - actor->obj.status = OBJ_DYING; - actor->vel.y = RAND_FLOAT(5.0f) + 6.0f; - if (actor->dmgType == DMG_EXPLOSION) { - actor->vel.y = -2.0f; + + this->scale = 0.8f; + + if (this->dmgType != DMG_NONE) { + this->obj.status = OBJ_DYING; + this->vel.y = RAND_FLOAT(5.0f) + 6.0f; + if (this->dmgType == DMG_EXPLOSION) { + this->vel.y = -2.0f; } - actor->vel.z = -15.0f; - actor->gravity = 0.5f; - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z, 13.0f); - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_S, actor->sfxSource, 4); + this->vel.z = -15.0f; + this->gravity = 0.5f; + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 13.0f); + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_S, this->sfxSource, 4); } } -void func_enmy_8006684C(Actor* actor) { +void func_enmy_8006684C(Actor192* this) { s32 pad; - if (actor->timer_0BE != 0) { - actor->vel.z = 0.0f; - actor->vel.x = 0.0f; - actor->vel.y = 0.0f; - if (actor->timer_0BE == 1) { - Object_Kill(&actor->obj, actor->sfxSource); - actor->itemDrop = DROP_SILVER_RING; - Actor_Despawn(actor); - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, actor->sfxSource, 4); - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y + 250.0f, actor->obj.pos.z, 3); + if (this->timer_0BE != 0) { + this->vel.z = 0.0f; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + if (this->timer_0BE == 1) { + Object_Kill(&this->obj, this->sfxSource); + this->itemDrop = DROP_SILVER_RING; + Actor_Despawn(this); + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, this->sfxSource, 4); + BonusText_Display(this->obj.pos.x, this->obj.pos.y + 250.0f, this->obj.pos.z, 3); gHitCount += 3; D_ctx_80177850 = 15; } } else { - actor->obj.rot.x += 11.0f; - actor->obj.rot.y += 7.0f; - if (actor->vel.y < -3.0f) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 7.0f, - 5); - actor->timer_0BE = 3; + this->obj.rot.x += 11.0f; + this->obj.rot.y += 7.0f; + if (this->vel.y < -3.0f) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 7.0f, 5); + this->timer_0BE = 3; } } } -void func_enmy_800669A0(Actor* actor) { - if (actor->timer_0BC != 0) { - if (actor->timer_0BC == 1) { - Object_Kill(&actor->obj, actor->sfxSource); +void Actor193_Update(Actor193* this) { + if (this->timer_0BC != 0) { + if (this->timer_0BC == 1) { + Object_Kill(&this->obj, this->sfxSource); } } else { - actor->obj.rot.y += 5.0f; - if (actor->dmgType != DMG_NONE) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 8.0f); - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 130.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, - 5); - actor->timer_0BC = 4; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_EXPLOSION_S); + this->obj.rot.y += 5.0f; + if (this->dmgType != DMG_NONE) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y + 130.0f, this->obj.pos.z, 8.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 130.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); + this->timer_0BC = 4; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_EXPLOSION_S); } } } -void func_enmy_80066A80(Actor* actor) { +void Actor180_Update(Actor180* this) { } -void func_enmy_80066A8C(Scenery* scenery) { - Vec3f sp64; - Vec3f sp58; +void func_enmy_80066A8C(CoBuilding9* this) { + Vec3f src; + Vec3f dest; f32 yf; - sp64.z = 0.0f; - sp64.x = -120.0f; - if (scenery->obj.rot.y > 90.0f) { - sp64.x = 120.0f; + src.z = 0.0f; + src.x = -120.0f; + + if (this->obj.rot.y > 90.0f) { + src.x = 120.0f; } + for (yf = 0.0f; yf < 680.0f; yf += 100.0f) { - Matrix_RotateY(gCalcMatrix, scenery->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, scenery->obj.rot.x * M_DTOR, MTXF_APPLY); - sp64.y = yf; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); - func_effect_8007D0E0(scenery->obj.pos.x + sp58.x, scenery->obj.pos.y + sp58.y, scenery->obj.pos.z + sp58.z, - 4.0f); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + src.y = yf; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + func_effect_8007D0E0(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 4.0f); } } -void func_enmy_80066C00(Scenery* scenery) { - Vec3f sp64; - Vec3f sp58; +void func_enmy_80066C00(CoBuilding9* this) { + Vec3f src; + Vec3f dest; f32 zf; - sp64.y = 30.0f; - sp64.x = -100.0f; - if (scenery->obj.rot.y > 90.0f) { - sp64.x = 100.0f; + src.y = 30.0f; + src.x = -100.0f; + + if (this->obj.rot.y > 90.0f) { + src.x = 100.0f; } - Matrix_RotateY(gCalcMatrix, scenery->obj.rot.y * M_DTOR, MTXF_NEW); + + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); for (zf = -180.0f; zf <= 0.0f; zf += 30.0f) { - sp64.z = zf; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); - func_effect_8007D0E0(scenery->obj.pos.x + sp58.x, scenery->obj.pos.y + sp58.y, scenery->obj.pos.z + sp58.z, + src.z = zf; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + func_effect_8007D0E0(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, RAND_FLOAT(1.0f) + 2.0f); } } -void func_enmy_80066D5C(Scenery* scenery) { - switch (scenery->state) { - case 1: - func_enmy_80066C00(scenery); - scenery->state++; - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_L, scenery->sfxSource, 4); - break; - case 2: - scenery->vel.x += 0.05f; - scenery->obj.rot.x += scenery->vel.x; - if (scenery->obj.rot.x >= 90.0f) { - scenery->obj.rot.x = 90.0f; - scenery->unk_44 = 40; - func_enmy_80066A8C(scenery); - scenery->state = 0; - gCameraShake = 25; - AUDIO_PLAY_SFX(NA_SE_EN_METAL_BOUND_M, scenery->sfxSource, 4); - } - break; +void CoBuilding9_Update(CoBuilding9* this) { + switch (this->state) { case 0: break; + + case 1: + func_enmy_80066C00(this); + this->state++; + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_L, this->sfxSource, 4); + break; + + case 2: + this->vel.x += 0.05f; + this->obj.rot.x += this->vel.x; + if (this->obj.rot.x >= 90.0f) { + this->obj.rot.x = 90.0f; + this->unk_44 = 40; + func_enmy_80066A8C(this); + this->state = 0; + gCameraShake = 25; + AUDIO_PLAY_SFX(NA_SE_EN_METAL_BOUND_M, this->sfxSource, 4); + } + break; } } -void func_enmy_80066E80(Scenery* scenery) { +void func_enmy_80066E80(Scenery* this) { } void Sprite167_Update(Sprite167* this) { this->obj.rot.y += 0.2f; } -void func_enmy_80066EA8(Scenery* scenery) { - scenery->obj.rot.y = 0.0f; - if (gPlayer[0].cam.eye.x < scenery->obj.pos.x) { - scenery->obj.rot.y = 271.0f; +// World-aligned billboarding +void SceneryRotateTowardsCamera(Scenery* this) { + this->obj.rot.y = 0.0f; + if (gPlayer[0].cam.eye.x < this->obj.pos.x) { + this->obj.rot.y = 271.0f; } } -void func_enmy_80066EE4(Sprite* sprite) { +void func_enmy_80066EE4(Sprite* this) { } void Item_CheckBounds(Item* this) { @@ -1899,6 +1953,7 @@ void Item_CheckBounds(Item* this) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) { Object_Kill(&this->obj, this->sfxSource); } + if ((gLevelMode == LEVELMODE_ON_RAILS) && (gLastPathChange == 0)) { var_fa1 = 900.0f; if (gPlayer[0].form != FORM_ARWING) { @@ -1911,9 +1966,11 @@ void Item_CheckBounds(Item* this) { Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].xPath - var_fa1, 0.1f, 10.0f, 0.01f); } } + if (this->obj.pos.y > 650.0f) { Math_SmoothStepToF(&this->obj.pos.y, 650.0f, 0.1f, 10.0f, 0.01f); } + if (gLevelType == LEVELTYPE_PLANET) { if (this->obj.pos.y < gGroundHeight + 70.0f) { Math_SmoothStepToF(&this->obj.pos.y, gGroundHeight + 70.0f, 0.1f, 5.0f, 0.01f); @@ -1924,6 +1981,7 @@ void Item_CheckBounds(Item* this) { } else if (this->obj.pos.y < -500.0f) { Math_SmoothStepToF(&this->obj.pos.y, -500.0f, 0.1f, 5.0f, 0.01f); } + if (gVersusMode && (this->index == 0) && (gItems[1].obj.status == OBJ_ACTIVE)) { if (fabsf(this->obj.pos.x - gItems[1].obj.pos.x) < 200.0f) { if (fabsf(this->obj.pos.z - gItems[1].obj.pos.z) < 200.0f) { @@ -1938,10 +1996,11 @@ void Item_CheckBounds(Item* this) { void Item_SpinPickup(Item* this) { s32 sparkleMask; - Vec3f sp40; - Vec3f sp34; + Vec3f src; + Vec3f dest; Math_SmoothStepToF(&this->unk_50, 10.0f, 1.0f, 2.0f, 0.0f); + if (this->unk_50 > 30.0f) { sparkleMask = 1 - 1; } else if (this->unk_50 > 20.0f) { @@ -1949,34 +2008,36 @@ void Item_SpinPickup(Item* this) { } else { sparkleMask = 8 - 1; } - if (!(sparkleMask & gGameFrameCount)) { + + if ((sparkleMask & gGameFrameCount) == 0) { Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, MTXF_NEW); - sp40.x = 50.0f; - sp40.y = RAND_FLOAT_CENTERED(120.0f); - sp40.z = 0.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); - func_effect_80078E50(this->obj.pos.x + sp34.x, this->obj.pos.y + sp34.y, this->obj.pos.z + sp34.z, 3.0f); + src.x = 50.0f; + src.y = RAND_FLOAT_CENTERED(120.0f); + src.z = 0.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + func_effect_80078E50(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 3.0f); } this->obj.rot.y += this->unk_50; this->obj.rot.y = Math_ModF(this->obj.rot.y, 360.0f); } -void Actor_SetupDebris70(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 xVel, f32 yVel, f32 zVel) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_DEBRIS; - actor->state = 70; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->obj.rot.x = xRot; - actor->obj.rot.y = yRot; - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; - actor->timer_0BC = RAND_INT(15.0f) + 25.0f; - actor->gravity = 0.5f; - Object_SetInfo(&actor->info, actor->obj.id); +void Actor_SetupDebris70(ActorDebris* this, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 xVel, f32 yVel, + f32 zVel) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_DEBRIS; + this->state = 70; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->timer_0BC = RAND_INT(15.0f) + 25.0f; + this->gravity = 0.5f; + Object_SetInfo(&this->info, this->obj.id); } void Actor_SpawnDebris70(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 arg5, f32 arg6, f32 arg7) { @@ -1995,6 +2056,7 @@ void ActorSupplies_Update(ActorSupplies* this) { s32 i; this->obj.rot.y += 1.0f; + if (gLevelMode == LEVELMODE_ALL_RANGE) { if (gCurrentLevel == LEVEL_SECTOR_Z) { Math_SmoothStepToF(&this->obj.pos.x, -2000.0f, 0.05f, 60.0f, 0.01f); @@ -2004,12 +2066,14 @@ void ActorSupplies_Update(ActorSupplies* this) { Math_SmoothStepToF(&this->obj.pos.y, 300.0f, 0.05f, 50.0f, 0.01f); } } + if (this->dmgType != DMG_NONE) { this->dmgType = DMG_NONE; this->health -= this->damage; if (this->health <= 0) { - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f); + if (((player[0].wings.rightState <= WINGSTATE_BROKEN) || (player[0].wings.leftState <= WINGSTATE_BROKEN)) && (player[0].form != FORM_LANDMASTER)) { this->itemDrop = DROP_WING_REPAIR; @@ -2020,7 +2084,9 @@ void ActorSupplies_Update(ActorSupplies* this) { } else { this->itemDrop = DROP_BOMB; } + Actor_Despawn(this); + for (i = 0; i < 6; i++) { Actor_SpawnDebris70(D_enmy_800CFEC4[i].x + this->obj.pos.x, D_enmy_800CFEC4[i].y + this->obj.pos.y, D_enmy_800CFEC4[i].z + this->obj.pos.z, D_enmy_800CFF0C[i].y + this->obj.rot.y, @@ -2039,10 +2105,11 @@ void ActorSupplies_Update(ActorSupplies* this) { gRadarMarks[63].yRot = 0.0f; } -void ActorSupplies_Draw(Actor* actor) { +void ActorSupplies_Draw(Actor* this) { s32 i; Lights_SetOneLight(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20); + for (i = 0; i < 6; i++) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_enmy_800CFEC4[i].x, D_enmy_800CFEC4[i].y, D_enmy_800CFEC4[i].z, MTXF_APPLY); @@ -2052,12 +2119,14 @@ void ActorSupplies_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_10177C0); Matrix_Pop(&gGfxMatrix); } + Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); } void func_enmy_80067A40(void) { AUDIO_PLAY_SFX(NA_SE_WING_REPAIR, gPlayer[0].sfxSource, 0); + if (gPlayer[0].wings.rightState <= WINGSTATE_BROKEN) { gRightWingFlashTimer[0] = 1050; gPlayer[0].wings.rightState = WINGSTATE_INTACT; @@ -2066,6 +2135,7 @@ void func_enmy_80067A40(void) { gLeftWingFlashTimer[0] = 1050; gPlayer[0].wings.leftState = WINGSTATE_INTACT; } + if (gExpertMode) { gRightWingHealth[0] = gLeftWingHealth[0] = 10; } else { @@ -2076,6 +2146,7 @@ void func_enmy_80067A40(void) { void Item1up_Update(Item1UP* this) { Item_CheckBounds(this); Item_SpinPickup(this); + if (this->collected) { Object_Kill(&this->obj, this->sfxSource); Object_PlayerSfx(gPlayer[this->playerNum].sfxSource, NA_SE_ONE_UP, this->playerNum); @@ -2083,6 +2154,7 @@ void Item1up_Update(Item1UP* this) { gLifeCount[this->playerNum]++; } } + if (this->timer_48 == 1) { Object_Kill(&this->obj, this->sfxSource); } @@ -2091,6 +2163,7 @@ void Item1up_Update(Item1UP* this) { void ItemPickup_Update(Item* this) { Item_CheckBounds(this); Item_SpinPickup(this); + if (this->state == 0) { switch (this->obj.id) { case OBJ_ITEM_BOMB: @@ -2105,23 +2178,29 @@ void ItemPickup_Update(Item* this) { Object_PlayerSfx(gPlayer[this->playerNum].sfxSource, NA_SE_BOMB_GAUGE_UP, this->playerNum); } break; + case OBJ_ITEM_LASERS: this->width = 18.0f; + if (this->collected) { this->timer_4A = 50; this->state = 1; this->timer_48 = 20; this->unk_50 = 60.0f; + gLaserStrength[this->playerNum]++; if (gLaserStrength[this->playerNum] > LASERS_HYPER) { gLaserStrength[this->playerNum] = LASERS_HYPER; } + Object_PlayerSfx(gPlayer[this->playerNum].sfxSource, NA_SE_TWIN_LASER_GET, this->playerNum); + if (gExpertMode) { gRightWingHealth[this->playerNum] = gLeftWingHealth[this->playerNum] = 10; } else { gRightWingHealth[this->playerNum] = gLeftWingHealth[this->playerNum] = 60; } + gRightWingFlashTimer[this->playerNum] = 1030; gLeftWingFlashTimer[this->playerNum] = 1030; } @@ -2129,13 +2208,17 @@ void ItemPickup_Update(Item* this) { } } else { Math_SmoothStepToF(&this->width, 2.5f, 1.0f, 0.5f, 0.0f); + this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f; + if (gPlayer[this->playerNum].form == FORM_LANDMASTER) { this->obj.pos.y += ((gPlayer[this->playerNum].pos.y + 50.0f) - this->obj.pos.y) * 0.5f; } else { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f; } + this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f; + if (this->timer_48 == 0) { Object_Kill(&this->obj, this->sfxSource); } @@ -2155,14 +2238,15 @@ void ItemLasers_Update(ItemLasers* this) { } void ItemSupplyRing_Update(Item* this) { - Vec3f sp4C; - Vec3f sp40; + Vec3f src; + Vec3f dest; switch (this->state) { case 0: Math_SmoothStepToF(&this->width, 0.4f, 1.0f, 0.05f, 0.0f); Item_CheckBounds(this); Item_SpinPickup(this); + if (this->collected) { this->state = 1; this->timer_48 = 50; @@ -2190,41 +2274,49 @@ void ItemSupplyRing_Update(Item* this) { Object_PlayerSfx(gPlayer[this->playerNum].sfxSource, NA_SE_SHIELD_RING_M, this->playerNum); } } + if ((this->obj.id == OBJ_ITEM_GOLD_RING) && (this->timer_48 == 1)) { Object_Kill(&this->obj, this->sfxSource); } break; + case 1: if (this->timer_48 > 30) { Math_SmoothStepToF(&this->width, 1.0f, 1.0f, 0.06f, 0.0f); } else { Math_SmoothStepToF(&this->width, 0.0f, 1.0f, 0.06f, 0.0f); } + this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.5f; + if (gPlayer[this->playerNum].form == FORM_LANDMASTER) { this->obj.pos.y += (gPlayer[this->playerNum].pos.y + 50.0f - this->obj.pos.y) * 0.5f; } else { this->obj.pos.y += (gPlayer[this->playerNum].pos.y - this->obj.pos.y) * 0.5f; } + if (gPlayer[0].alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - 300.0f - this->obj.pos.z) * 0.3f; } else { this->obj.pos.z += (gPlayer[this->playerNum].trueZpos - this->obj.pos.z) * 0.5f; } + this->obj.rot.z += 22.0f; + Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f, 0.0f); if (this->timer_48 == 0) { Object_Kill(&this->obj, this->sfxSource); } + if (this->width > 0.3f) { Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, MTXF_APPLY); - sp4C.x = 0.0f; - sp4C.y = this->width * 100.0f; - sp4C.z = 0.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); - func_effect_80078E50(this->obj.pos.x + sp40.x, this->obj.pos.y + sp40.y, this->obj.pos.z + sp40.z, + src.x = 0.0f; + src.y = this->width * 100.0f; + src.z = 0.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + func_effect_80078E50(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 3.5f); } break; @@ -2242,10 +2334,12 @@ void ItemGoldRing_Update(ItemGoldRing* this) { void ItemWingRepair_Update(ItemWingRepair* this) { Item_CheckBounds(this); Item_SpinPickup(this); + if (this->collected) { func_enmy_80067A40(); Object_Kill(&this->obj, this->sfxSource); } + if (this->timer_48 == 1) { Object_Kill(&this->obj, this->sfxSource); } @@ -2253,6 +2347,7 @@ void ItemWingRepair_Update(ItemWingRepair* this) { void ItemMeteoWarp_Update(ItemMeteoWarp* this) { Item_CheckBounds(this); + if (this->state > 0) { if (this->state == 1) { this->obj.rot.z -= 10.0f; @@ -2264,23 +2359,29 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { this->width = 0.0f; } } + this->unk_44 -= 10; if (this->unk_44 < 0) { Object_Kill(&this->obj, this->sfxSource); } } else { this->width = 100.0f; + if (gRingPassCount < 0) { this->state = 2; this->unk_44 = 255; } else if (this->collected) { this->state = 1; this->unk_44 = 255; + gPlayer[this->playerNum].meteoWarpTimer = 100; + AUDIO_PLAY_SFX(gWarpRingSfx[gRingPassCount], gPlayer[0].sfxSource, 0); + if (gRingPassCount == 0) { gPlayer[0].boostSpeed = 0.0f; } + gRingPassCount++; if (gRingPassCount >= 7) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; @@ -2294,10 +2395,11 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { } void ItemCheckpoint_Update(ItemCheckpoint* this) { - s32 i; + TeamId i; Item_CheckBounds(this); this->unk_58 -= this->unk_44; + if (this->state > 0) { this->unk_44++; this->obj.pos.x += (gPlayer[this->playerNum].pos.x - this->obj.pos.x) * 0.3f; @@ -2351,6 +2453,7 @@ void ItemRingCheck_Update(Item* this) { void ItemPathChange_Update(Item* this) { gLastPathChange = this->obj.id; + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE) { Object_Kill(&this->obj, this->sfxSource); } else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelPhase == 1)) { @@ -2379,10 +2482,13 @@ void ItemPathChange_Update(Item* this) { break; } } + if (this->collected) { Object_Kill(&this->obj, this->sfxSource); + gPlayer[0].pathStep = 0.0f; gPlayer[0].pathChangeTimer = this->width * 0.05f; + switch (this->obj.id) { case OBJ_ITEM_PATH_SPLIT_X: if (this->obj.pos.x < gPlayer[0].pos.x) { @@ -2393,14 +2499,17 @@ void ItemPathChange_Update(Item* this) { gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width; } break; + case OBJ_ITEM_PATH_TURN_LEFT: gPlayer[0].pathChangeYaw = 30.0f; gPlayer[0].xPathTarget = gPlayer[0].xPath - this->width; break; + case OBJ_ITEM_PATH_TURN_RIGHT: gPlayer[0].pathChangeYaw = -30.0f; gPlayer[0].xPathTarget = gPlayer[0].xPath + this->width; break; + case OBJ_ITEM_PATH_SPLIT_Y: if (this->obj.pos.y < gPlayer[0].pos.y) { gPlayer[0].pathChangePitch = 30.0f; @@ -2410,10 +2519,12 @@ void ItemPathChange_Update(Item* this) { gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width; } break; + case OBJ_ITEM_PATH_TURN_UP: gPlayer[0].pathChangePitch = 30.0f; gPlayer[0].yPathTarget = gPlayer[0].yPath + this->width; break; + case OBJ_ITEM_PATH_TURN_DOWN: gPlayer[0].pathChangePitch = -30.0f; gPlayer[0].yPathTarget = gPlayer[0].yPath - this->width; @@ -2430,7 +2541,7 @@ void Sprite_UpdateDoodad(Sprite* this) { M_PI; if (this->destroy) { this->obj.status = OBJ_FREE; - func_effect_8007A6F0(&this->obj.pos, NA_SE_OB_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_EXPLOSION_S); switch (this->obj.id) { case OBJ_SPRITE_CO_POLE: func_effect_8007D074(this->obj.pos.x, this->obj.pos.y + 160.0f, this->obj.pos.z, 4.0f); @@ -2448,6 +2559,7 @@ void Object_Dying(s32 index, ObjectId objId) { case OBJ_ACTOR_EVENT: ActorEvent_Dying(&gActors[index]); break; + case OBJ_ACTOR_ALLRANGE: if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { Andross_801888F4(&gActors[index]); @@ -2455,81 +2567,96 @@ void Object_Dying(s32 index, ObjectId objId) { func_enmy2_800763A4(&gActors[index]); } break; + case OBJ_ACTOR_202: func_enmy2_800763A4(&gActors[index]); break; + case OBJ_ACTOR_194: Actor194_Dying(&gActors[index]); break; + case OBJ_ACTOR_186: Meteo_80187B08(&gActors[index]); break; + case OBJ_ACTOR_181: Object_Kill(&gActors[index].obj, gActors[index].sfxSource); func_effect_8007D2C8(gActors[index].obj.pos.x, gActors[index].obj.pos.y, gActors[index].obj.pos.z, 20.0f); break; + case OBJ_ACTOR_182: Object_Kill(&gActors[index].obj, gActors[index].sfxSource); func_effect_8007D2C8(gActors[index].obj.pos.x, gActors[index].obj.pos.y, gActors[index].obj.pos.z, 10.0f); Actor_Despawn(&gActors[index]); break; + case OBJ_ACTOR_192: func_enmy_8006684C(&gActors[index]); break; + case OBJ_BOSS_TI: Titania_801990DC(&gBosses[index]); break; + case OBJ_ACTOR_232: Titania_8018B720(&gActors[index]); break; + case OBJ_BOSS_VE1: Venom1_80198594(&gBosses[index]); break; } } -void Actor_Move(Actor* actor) { +void Actor_Move(Actor* this) { f32 var_fv0; - actor->obj.pos.x += actor->vel.x; - actor->obj.pos.z += actor->vel.z; - actor->obj.pos.y += actor->vel.y; - actor->vel.y -= actor->gravity; + this->obj.pos.x += this->vel.x; + this->obj.pos.z += this->vel.z; + this->obj.pos.y += this->vel.y; + this->vel.y -= this->gravity; - if (!gCullObjects || (actor->obj.id == OBJ_ACTOR_TEAM_BOSS) || - ((gCurrentLevel == LEVEL_MACBETH) && (actor->obj.id != OBJ_ACTOR_EVENT))) { + if (!gCullObjects || (this->obj.id == OBJ_ACTOR_TEAM_BOSS) || + ((gCurrentLevel == LEVEL_MACBETH) && (this->obj.id != OBJ_ACTOR_EVENT))) { return; } - var_fv0 = 4000.0f; - if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || - ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_56))) { + var_fv0 = 4000.0f; + if ((this->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || + ((this->obj.id == OBJ_ACTOR_EVENT) && (this->eventType == EVID_56))) { var_fv0 = 8000.0f; } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { var_fv0 = 100000.0f; } - if (((gPlayer[0].cam.eye.z + actor->info.cullDistance) < (actor->obj.pos.z + gPathProgress)) || - ((actor->obj.pos.z + gPathProgress) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].yPath - var_fv0)) || - ((gPlayer[0].yPath + var_fv0) < actor->obj.pos.y) || ((gPlayer[0].xPath + var_fv0) < actor->obj.pos.x) || - (actor->obj.pos.x < (gPlayer[0].xPath - var_fv0))) { - Object_Kill(&actor->obj, actor->sfxSource); - switch (actor->obj.id) { + + if (((gPlayer[0].cam.eye.z + this->info.cullDistance) < (this->obj.pos.z + gPathProgress)) || + ((this->obj.pos.z + gPathProgress) < -15000.0f) || (this->obj.pos.y < (gPlayer[0].yPath - var_fv0)) || + ((gPlayer[0].yPath + var_fv0) < this->obj.pos.y) || ((gPlayer[0].xPath + var_fv0) < this->obj.pos.x) || + (this->obj.pos.x < (gPlayer[0].xPath - var_fv0))) { + Object_Kill(&this->obj, this->sfxSource); + + switch (this->obj.id) { case OBJ_ACTOR_236: gZOSnakeWaypointCount = 0; break; + case OBJ_ACTOR_229: - Titania_8018E3B0(actor); + Titania_8018E3B0(this); break; + case OBJ_ACTOR_194: - gActor194Status[actor->unk_046] = 0; + gActor194Status[this->unk_046] = 0; break; + case OBJ_ACTOR_EVENT: - if ((actor->eventType >= EVID_200) && (actor->eventType < EVID_300)) { - gActor194Status[actor->unk_046] = 0; - } else if ((actor->eventType == EVID_SX_WARP_GATE) && (actor->unk_046 != 2)) { + if ((this->eventType >= EVID_200) && (this->eventType < EVID_300)) { + gActor194Status[this->unk_046] = 0; + } else if ((this->eventType == EVID_SX_WARP_GATE) && (this->unk_046 != 2)) { gRingPassCount = -1; } break; + case OBJ_ACTOR_252: gMissedZoSearchlight = true; break; @@ -2537,28 +2664,29 @@ void Actor_Move(Actor* actor) { } } -void Boss_Move(Boss* boss) { - boss->obj.pos.x += boss->vel.x; - boss->obj.pos.y += boss->vel.y; - boss->obj.pos.z += boss->vel.z; - boss->vel.y -= boss->gravity; - if (gCullObjects && ((boss->obj.pos.z + gPathProgress) > (boss->info.cullDistance - gPlayer[0].cam.eye.z))) { - if (gPlayer[0].cam.eye.z) {} // fake - Object_Kill(&boss->obj, boss->sfxSource); +void Boss_Move(Boss* this) { + this->obj.pos.x += this->vel.x; + this->obj.pos.y += this->vel.y; + this->obj.pos.z += this->vel.z; + this->vel.y -= this->gravity; + + if (gCullObjects && ((this->obj.pos.z + gPathProgress) > (this->info.cullDistance - gPlayer[0].cam.eye.z))) { + if (gPlayer[0].cam.eye.z) {} //! FAKE + Object_Kill(&this->obj, this->sfxSource); } } -void Scenery_Move(Scenery* scenery) { +void Scenery_Move(Scenery* this) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { - scenery->obj.pos.z += scenery->effectVel.z; - if (scenery->info.cullDistance < scenery->obj.pos.z) { - Object_Kill(&scenery->obj, scenery->sfxSource); + this->obj.pos.z += this->effectVel.z; + if (this->info.cullDistance < this->obj.pos.z) { + Object_Kill(&this->obj, this->sfxSource); } } else if ((gLevelMode == LEVELMODE_ON_RAILS) && (gBossActive != 2)) { - f32 temp_fv0 = fabsf(scenery->obj.pos.x - gPlayer[0].cam.eye.x); + f32 temp_fv0 = fabsf(this->obj.pos.x - gPlayer[0].cam.eye.x); f32 var_fa0 = 500.0f; - if ((scenery->obj.id == OBJ_SCENERY_6) || (scenery->obj.id == OBJ_SCENERY_7)) { + if ((this->obj.id == OBJ_SCENERY_CO_HIGHWAY_1) || (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_2)) { var_fa0 = 1000.0f; } temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f : (temp_fv0 - var_fa0) * 1.7f; @@ -2566,51 +2694,54 @@ void Scenery_Move(Scenery* scenery) { temp_fv0 = 0.0f; } temp_fv0 -= gPlayer[0].cam.eye.z; - if ((scenery->info.cullDistance - temp_fv0) < (scenery->obj.pos.z + gPathProgress)) { - Object_Kill(&scenery->obj, scenery->sfxSource); + if ((this->info.cullDistance - temp_fv0) < (this->obj.pos.z + gPathProgress)) { + Object_Kill(&this->obj, this->sfxSource); } } } -void Sprite_Move(Sprite* sprite) { +void Sprite_Move(Sprite* this) { if (gCullObjects) { - f32 temp_fv0 = fabsf(sprite->obj.pos.x - gPlayer[0].cam.eye.x); + f32 temp_fv0 = fabsf(this->obj.pos.x - gPlayer[0].cam.eye.x); f32 var_fa0 = 500.0f; - if (((sprite->obj.id == OBJ_SPRITE_FOG_SHADOW) && - ((sprite->sceneryId == OBJ_SCENERY_6) || (sprite->sceneryId == OBJ_SCENERY_7))) || - (sprite->obj.id == OBJ_SCENERY_8)) { + if (((this->obj.id == OBJ_SPRITE_FOG_SHADOW) && + ((this->sceneryId == OBJ_SCENERY_CO_HIGHWAY_1) || (this->sceneryId == OBJ_SCENERY_CO_HIGHWAY_2))) || + (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3)) { var_fa0 = 1000.0f; } + temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f * 1.7f : (temp_fv0 - var_fa0) * 1.7f; temp_fv0 -= gPlayer[0].cam.eye.z; - if ((sprite->info.cullDistance - temp_fv0) < (sprite->obj.pos.z + gPathProgress)) { - sprite->obj.status = OBJ_FREE; + + if ((this->info.cullDistance - temp_fv0) < (this->obj.pos.z + gPathProgress)) { + this->obj.status = OBJ_FREE; } } } -void Effect_Move(Effect* effect) { - effect->obj.pos.x += effect->vel.x; - effect->obj.pos.y += effect->vel.y; - effect->obj.pos.z += effect->vel.z; +void Effect_Move(Effect* this) { + this->obj.pos.x += this->vel.x; + this->obj.pos.y += this->vel.y; + this->obj.pos.z += this->vel.z; + if (gCullObjects) { - if ((gPlayer[0].cam.eye.z + effect->info.cullDistance) < (effect->obj.pos.z + gPathProgress)) { - Object_Kill(&effect->obj, effect->sfxSource); - } else if ((fabsf(effect->obj.pos.y - gPlayer[0].cam.eye.y) > 25000.0f) || - (fabsf(effect->obj.pos.x - gPlayer[0].cam.eye.x) > 25000.0f)) { - Object_Kill(&effect->obj, effect->sfxSource); + if ((gPlayer[0].cam.eye.z + this->info.cullDistance) < (this->obj.pos.z + gPathProgress)) { + Object_Kill(&this->obj, this->sfxSource); + } else if ((fabsf(this->obj.pos.y - gPlayer[0].cam.eye.y) > 25000.0f) || + (fabsf(this->obj.pos.x - gPlayer[0].cam.eye.x) > 25000.0f)) { + Object_Kill(&this->obj, this->sfxSource); } } } -void Item_Move(Item* item) { +void Item_Move(Item* this) { if (gCullObjects) { f32 temp = (0.0f - gPlayer[0].cam.eye.z); - if ((item->info.cullDistance - temp) < (item->obj.pos.z + gPathProgress)) { - Object_Kill(&item->obj, item->sfxSource); - if ((item->obj.id == OBJ_ITEM_METEO_WARP) && (item->state == 0)) { + if ((this->info.cullDistance - temp) < (this->obj.pos.z + gPathProgress)) { + Object_Kill(&this->obj, this->sfxSource); + if ((this->obj.id == OBJ_ITEM_METEO_WARP) && (this->state == 0)) { gRingPassCount = -1; } } @@ -2635,6 +2766,7 @@ void Actor_Update(Actor* this) { if (this->timer_0C6 != 0) { this->timer_0C6--; } + if (gVersusMode) { for (i = 0; i < gCamCount; i++) { if (this->lockOnTimers[i] != 0) { @@ -2650,9 +2782,11 @@ void Actor_Update(Actor* this) { } gChargeTimers[0] = 0; } + if (this->timer_0C4 != 0) { this->timer_0C4--; } + switch (this->obj.status) { case OBJ_INIT: this->obj.status = OBJ_ACTIVE; @@ -2661,12 +2795,14 @@ void Actor_Update(Actor* this) { Actor_Move(this); } break; + case OBJ_ACTIVE: Actor_Move(this); if ((this->obj.status != OBJ_FREE) && (this->info.action != NULL)) { this->info.action(&this->obj); } break; + case OBJ_DYING: Actor_Move(this); if (this->obj.status != OBJ_FREE) { @@ -2698,18 +2834,21 @@ void Boss_Update(Boss* this) { if (this->timer_05C != 0) { this->timer_05C--; } + switch (this->obj.status) { case OBJ_INIT: this->obj.status = OBJ_ACTIVE; Object_Init(this->index, this->obj.id); Boss_Move(this); break; + case OBJ_ACTIVE: Boss_Move(this); if ((this->obj.status != OBJ_FREE) && (this->info.action != NULL)) { this->info.action(&this->obj); } break; + case OBJ_DYING: Boss_Move(this); if (this->obj.status != OBJ_FREE) { @@ -2723,12 +2862,14 @@ void Scenery_Update(Scenery* this) { if (this->timer_4C != 0) { this->timer_4C--; } + switch (this->obj.status) { case OBJ_INIT: this->obj.status = OBJ_ACTIVE; Object_Init(this->index, this->obj.id); Scenery_Move(this); break; + case OBJ_ACTIVE: Scenery_Move(this); if (this->info.action != NULL) { @@ -2745,12 +2886,14 @@ void Sprite_Update(Sprite* this) { Object_Init(this->index, this->obj.id); Sprite_Move(this); break; + case OBJ_ACTIVE: Sprite_Move(this); if (this->info.action != NULL) { this->info.action(&this->obj); } break; + case OBJ_DYING: Sprite_Move(this); Object_Dying(this->index, this->obj.id); @@ -2765,12 +2908,14 @@ void Item_Update(Item* this) { if (this->timer_4A != 0) { this->timer_4A--; } + switch (this->obj.status) { case OBJ_INIT: this->obj.status = OBJ_ACTIVE; Object_Init(this->index, this->obj.id); Item_Move(this); break; + case OBJ_ACTIVE: Item_Move(this); if (this->info.action != NULL) { @@ -2784,6 +2929,7 @@ void Effect_Update(Effect* this) { if (this->timer_50 != 0) { this->timer_50--; } + switch (this->obj.status) { case OBJ_INIT: this->obj.status = OBJ_ACTIVE; @@ -2808,11 +2954,14 @@ void TexturedLine_Update(TexturedLine* this) { if (this->timer != 0) { this->timer--; } + dx = this->posAA.x - this->posBB.x; dy = this->posAA.y - this->posBB.y; dz = this->posAA.z - this->posBB.z; + this->yRot = Math_Atan2F(dx, dz); this->xRot = -Math_Atan2F(dy, sqrtf(SQ(dx) + SQ(dz))); + if (this->mode != 4) { this->zScale = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); } @@ -2822,13 +2971,17 @@ void TexturedLine_Update(TexturedLine* this) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].hitTimer == 0)) { Matrix_RotateX(gCalcMatrix, -this->xRot, MTXF_NEW); Matrix_RotateY(gCalcMatrix, -this->yRot, MTXF_APPLY); + sp44.x = gPlayer[gPlayerNum].pos.x - this->posAA.x; sp44.y = gPlayer[gPlayerNum].pos.y - this->posAA.y; sp44.z = gPlayer[gPlayerNum].trueZpos - this->posAA.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + sp38.x += this->posAA.x; sp38.y += this->posAA.y; sp38.z += this->posAA.z; + if ((fabsf(sp38.x - this->posAA.x) < 30.0f) && (fabsf(sp38.y - this->posAA.y) < 30.0f) && (sp38.z < this->posAA.z) && ((this->posAA.z - this->zScale) < sp38.z)) { if (gCurrentLevel == LEVEL_AQUAS) { @@ -2841,9 +2994,11 @@ void TexturedLine_Update(TexturedLine* this) { } } } + if (((this->posAA.z + gPathProgress) > 1000.0f) && (gLevelMode != LEVELMODE_ALL_RANGE)) { this->mode = 0; } + if (((this->mode == 3) || (this->mode == 50)) && (this->timer == 0)) { this->mode = 0; } @@ -2900,37 +3055,44 @@ void Object_Update(void) { } } } - for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++, sprite++) { + + for (i = 0, sprite = &gSprites[0]; i < ARRAY_COUNT(gSprites); i++, sprite++) { if (sprite->obj.status != OBJ_FREE) { sprite->index = i; Sprite_Update(sprite); } } - for (i = 0, boss = gBosses; i < ARRAY_COUNT(gBosses); i++, boss++) { + + for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) { if (boss->obj.status != OBJ_FREE) { boss->index = i; Boss_Update(boss); } } - for (i = 0, actor = gActors; i < ARRAY_COUNT(gActors); i++, actor++) { + + for (i = 0, actor = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor++) { if (actor->obj.status != OBJ_FREE) { actor->index = i; Actor_Update(actor); } } - for (i = 0, item = gItems; i < ARRAY_COUNT(gItems); i++, item++) { + + for (i = 0, item = &gItems[0]; i < ARRAY_COUNT(gItems); i++, item++) { if (item->obj.status != OBJ_FREE) { item->index = i; Item_Update(item); } } - for (i = 0, effect = gEffects; i < ARRAY_COUNT(gEffects); i++, effect++) { + + for (i = 0, effect = &gEffects[0]; i < ARRAY_COUNT(gEffects); i++, effect++) { if (effect->obj.status != OBJ_FREE) { effect->index = i; Effect_Update(effect); } } + TexturedLine_UpdateAll(); + for (i = 0; i < ARRAY_COUNT(D_enmy_Timer_80161670); i++) { if (D_enmy_Timer_80161670[i] != 0) { D_enmy_Timer_80161670[i]--; diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index 2ad954ad..f647430c 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -32,30 +32,30 @@ void ActorEvent_SetMessage(u16* msg, s32 character) { } } -void func_enmy2_8006A800(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); +void func_enmy2_8006A800(Effect361* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_361; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->unk_48 = 3; + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_361; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - effect->unk_48 = -effect->unk_48; + this->unk_48 = -this->unk_48; } - effect->unk_4A = 100; - effect->scale2 = scale2 * 0.25f; - effect->scale1 = 0.3f; + this->unk_4A = 100; + this->scale2 = scale2 * 0.25f; + this->scale1 = 0.3f; if (scale2 < 10.0f) { - effect->scale1 = 0.1f; + this->scale1 = 0.1f; } - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } void func_enmy2_8006A900(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -75,21 +75,21 @@ void Actor237_Update(Actor237* this) { void Actor237_Draw(Actor237* this) { } -void Obj54_8006A984(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_365; +void Obj54_8006A984(Effect* this, f32 xPos, f32 yPos, f32 zPos) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_365; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->unk_44 = 40; - effect->scale2 = 5.0f; - effect->scale1 = RAND_FLOAT_CENTERED(2.0f); - effect->vel.y = 10.0f; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_44 = 40; + this->scale2 = 5.0f; + this->scale1 = RAND_FLOAT_CENTERED(2.0f); + this->vel.y = 10.0f; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } void Obj54_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { @@ -103,7 +103,7 @@ void Obj54_8006AA3C(f32 xPos, f32 yPos, f32 zPos) { } } -void Scenery54_Update(Scenery_54* this) { +void CoWaterfall_Update(CoWaterfall* this) { Vec3f sp24; Vec3f sp18; @@ -131,7 +131,7 @@ void Actor201_Update(Actor201* this) { f32 sp2C; if (Actor201_8006ABA4(this) && (this->timer_0BC == 0)) { - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); this->timer_0BC = 20; } sp2C = this->obj.pos.z + gPathProgress; @@ -157,9 +157,9 @@ void Actor202_Update(Actor202* this) { this->iwork[1] = true; } - if (((gGameFrameCount % 32) == 0)) { - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, - gEnemyShotSpeed); + if ((gGameFrameCount % 32) == 0) { + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, + gEnemyShotSpeed); } switch (this->state) { @@ -216,7 +216,7 @@ void Actor202_Update(Actor202* this) { func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, 8.0f, 30); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); gHitCount += this->info.bonus; D_ctx_80177850 = 15; } else { @@ -341,7 +341,7 @@ void Actor194_Draw(Actor194* this) { } } -void Scenery42_Update(Scenery_42* this) { +void CoIBeam_Update(CoIBeam* this) { this->obj.pos.x += this->vel.x; this->obj.pos.y += this->vel.y; this->obj.pos.z += this->vel.z; @@ -367,20 +367,20 @@ void Scenery42_Update(Scenery_42* this) { } } -void func_enmy2_8006BA64(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_375; +void func_enmy2_8006BA64(Effect375* this, f32 xPos, f32 yPos, f32 zPos) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_375; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - effect->scale2 = 0.0f; - effect->scale1 = 0.12f; - effect->obj.rot.y = RAND_FLOAT(360.0f); - effect->unk_60.y = RAND_FLOAT_CENTERED(3.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->scale2 = 0.0f; + this->scale1 = 0.12f; + this->obj.rot.y = RAND_FLOAT(360.0f); + this->unk_60.y = RAND_FLOAT_CENTERED(3.0f); + Object_SetInfo(&this->info, this->obj.id); } void func_enmy2_8006BB1C(f32 xPos, f32 yPos, f32 zPos) { @@ -445,12 +445,14 @@ void Actor196_Update(Actor196* this) { case 3: if (this->timer_0BC == 1) { - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, - gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, + gEnemyShotSpeed); } + if (this->vel.y < 12.0f) { Math_SmoothStepToF(&this->obj.rot.x, 180.0f, 0.1f, 7.0f, 0.01f); } + if (this->obj.pos.y < (gGroundHeight + 10.0f)) { this->obj.pos.y = gGroundHeight; this->state = 4; @@ -664,7 +666,7 @@ void ActorDebris_Update(ActorDebris* this) { (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } break; @@ -675,7 +677,7 @@ void ActorDebris_Update(ActorDebris* this) { (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } break; @@ -696,7 +698,7 @@ void ActorDebris_Update(ActorDebris* this) { (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } break; @@ -707,7 +709,7 @@ void ActorDebris_Update(ActorDebris* this) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } break; @@ -779,7 +781,7 @@ void ActorDebris_Update(ActorDebris* this) { (this->timer_0BE == 0)) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } } else if (((this->state >= 41) && (this->state < 45)) || (this->state == 59)) { if (((this->timer_0BC == 0) || @@ -787,7 +789,7 @@ void ActorDebris_Update(ActorDebris* this) { (this->timer_0BE == 0)) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f * this->scale); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } if (Play_CheckDynaFloorCollision(&sp44, &sp40, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { func_effect_8007B228(this->obj.pos.x, sp44, this->obj.pos.z, 2.0f); @@ -804,7 +806,7 @@ void ActorDebris_Update(ActorDebris* this) { func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, this->scale * 1.5f, 4); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } } else { if ((this->state == 3) && ((this->timer_0BC % 8) == 0)) { @@ -1008,7 +1010,7 @@ static EventActorInfo sEventActorInfo[108] = { /* 68 */ { D_SY_60205D0, D_SY_603445C, 3.0f, 100.0f, 3000.0f, 1, 0, EISFX_NONE, 0, 1.0f, 1 }, /* 69 */ { D_SY_60036A0, D_SY_6034664, -1.0f, 10000.0f, 3001.0f, 0, 0, EISFX_NONE, 0, 0.0f, 1 }, /* 70 */ { D_SY_601AD70, gNoHitbox, 4.0f, 100.0f, 3000.0f, 0, 0, EISFX_EN_ENGINE_01, 0, 0.0f, 1 }, - /* 71 */ { D_arwing_3007650, gNoHitbox, 1.0f, 100.0f, 3000.0f, 2, 0, EISFX_OB_WING, 0, 0.0f, 1 }, + /* 71 */ { aArwingItemLasersDL, gNoHitbox, 1.0f, 100.0f, 3000.0f, 2, 0, EISFX_OB_WING, 0, 0.0f, 1 }, /* 72 */ { D_SY_60034D0, D_SY_60347D4, 3.0f, 100.0f, 3000.0f, 1, 0, EISFX_NONE, 0, 0.0f, 1 }, /* 73 */ { D_SY_6005360, D_SY_6034770, -1.0f, 10000.0f, 3001.0f, 0, 0, EISFX_NONE, 0, 0.0f, 1 }, /* 74 */ { D_SY_600F6C0, D_SY_60347F0, -1.0f, 10000.0f, 3001.0f, 0, 0, EISFX_NONE, 0, 0.0f, 1 }, @@ -1761,7 +1763,7 @@ void ActorEvent_SetupEffect347(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 effect->scale1 = scale1; effect->unk_44 = 100; Object_SetInfo(&effect->info, effect->obj.id); - func_effect_8007A6F0(&effect->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&effect->obj.pos, NA_SE_EN_EXPLOSION_M); } void ActorEvent_SpawnEffect347(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { @@ -1790,7 +1792,7 @@ void ActorEvent_SetupEffect394(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 effect->unk_7A = 18; Object_SetInfo(&effect->info, effect->obj.id); effect->info.damage = 40; - func_effect_8007A6F0(&effect->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&effect->obj.pos, NA_SE_EN_EXPLOSION_M); } void ActorEvent_SpawnEffect394(f32 xPos, f32 yPos, f32 zPos, f32 scale1) { @@ -1819,9 +1821,9 @@ void ActorEvent_8006F254(ActorEvent* this) { sp54.z = gEnemyShotSpeed; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - func_effect_8007F04C(OBJ_EFFECT_353, this->obj.pos.x + sp48.x, this->obj.pos.y + sp48.y, this->obj.pos.z + sp48.z, - this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, this->vwork[29].x, this->vwork[29].y, - this->vwork[29].z + this->rot_0F4.z, sp48.x, sp48.y, sp48.z, 1.0f); + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x + sp48.x, this->obj.pos.y + sp48.y, + this->obj.pos.z + sp48.z, this->obj.rot.x, this->obj.rot.y, this->obj.rot.z, this->vwork[29].x, + this->vwork[29].y, this->vwork[29].z + this->rot_0F4.z, sp48.x, sp48.y, sp48.z, 1.0f); } void ActorEvent_ProcessActions(ActorEvent* this) { @@ -1844,8 +1846,8 @@ void ActorEvent_ProcessActions(ActorEvent* this) { case EVACT_2: // shoot at player if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, - gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, + gEnemyShotSpeed); } this->unk_048 = EVACT_NONE; break; @@ -1895,15 +1897,15 @@ void ActorEvent_ProcessActions(ActorEvent* this) { case EVACT_6: if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, - gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_355, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, + gEnemyShotSpeed); } this->unk_048 = EVACT_NONE; break; case EVACT_7: if (this->obj.pos.z < (gPlayer[0].trueZpos - 600.0f)) { - func_effect_8007F11C(OBJ_EFFECT_356, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 60.0f); + Effect_EnemyLaser(OBJ_EFFECT_356, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 60.0f); } this->unk_048 = EVACT_NONE; break; @@ -1913,8 +1915,8 @@ void ActorEvent_ProcessActions(ActorEvent* this) { sp6C.y = gPlayer[0].pos.y; gPlayer[0].pos.x += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].pos.y += RAND_FLOAT_CENTERED(300.0f); - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, - gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, + gEnemyShotSpeed); gPlayer[0].pos.x = sp6C.x; gPlayer[0].pos.y = sp6C.y; this->unk_048 = EVACT_NONE; @@ -1943,7 +1945,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { this->vel.z, this->scale * 3.0f, 15); Actor_Despawn(this); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_M); break; case EVACT_DESPAWN: @@ -1967,16 +1969,16 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_16: - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x + 190.0f, this->obj.pos.y + 90.0f, - this->obj.pos.z + 220.0f, gEnemyShotSpeed); - func_effect_8007F11C(OBJ_EFFECT_353, this->obj.pos.x - 190.0f, this->obj.pos.y + 90.0f, - this->obj.pos.z + 220.0f, gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x + 190.0f, this->obj.pos.y + 90.0f, + this->obj.pos.z + 220.0f, gEnemyShotSpeed); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x - 190.0f, this->obj.pos.y + 90.0f, + this->obj.pos.z + 220.0f, gEnemyShotSpeed); this->unk_048 = EVACT_NONE; break; case EVACT_17: if (this->obj.pos.z < (gPlayer[0].cam.eye.z - 600.0f)) { - func_effect_8007F20C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, + func_effect_8007F20C(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); } this->unk_048 = EVACT_NONE; @@ -2047,7 +2049,7 @@ void ActorEvent_8006FEEC(ActorEvent* this) { this->itemDrop = DROP_NONE; Actor_Despawn(this); Object_Kill(&this->obj, this->sfxSource); - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_BIRD_DOWN); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_BIRD_DOWN); func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 4.0f); } else { AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DAMAGE, this->sfxSource, 4); @@ -3161,7 +3163,7 @@ void ActorEvent_Update(ActorEvent* this) { var_fv0 = 0.0f; } - func_effect_8007F04C(OBJ_EFFECT_353, this->obj.pos.x + spAC.x + spA0.x, + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x + spAC.x + spA0.x, this->obj.pos.y + spAC.y + spA0.y + var_fv0, this->obj.pos.z + spAC.z + spA0.z, this->fwork[15], this->obj.rot.y, this->obj.rot.z, this->vwork[29].x, this->vwork[29].y, this->vwork[29].z + this->rot_0F4.z, spAC.x, spAC.y, spAC.z, @@ -3653,7 +3655,7 @@ void ActorEvent_Update(ActorEvent* this) { effect->unk_60.z = -effect->unk_60.z; } - if (gGameFrameCount & 2) { + if ((gGameFrameCount & 2) != 0) { effect->vel.y = -effect->vel.y; } } @@ -3905,6 +3907,7 @@ void ActorEvent_Draw(ActorEvent* this) { gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); break; + default: if ((this->eventType < EVID_200) && (sEventActorInfo[this->eventType].dList != NULL)) { gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList); @@ -4101,7 +4104,7 @@ void ActorEvent_Draw(ActorEvent* this) { case EVID_79: temp_s0 = this->state; this->state = 2; // actor 235 state - Zoness_80190430(this); + Zoness_Actor235_Draw(this); this->state = temp_s0; break; @@ -4261,7 +4264,7 @@ void func_enmy2_800763A4(Actor* actor) { actor->scale * 3.0f, 5); func_effect_8007B228(actor->obj.pos.x, sp58, actor->obj.pos.z, 2.0f); actor->timer_0BE = 2; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); return; } @@ -4272,7 +4275,7 @@ void func_enmy2_800763A4(Actor* actor) { actor->obj.pos.z - actor->vel.z, 0.0f, 0.0f, 0.0f, actor->scale * 4.0f, 20); func_enmy_80062C38(actor->obj.pos.x, actor->obj.pos.z); actor->timer_0BE = 2; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); return; } } else { @@ -4304,9 +4307,9 @@ void func_enmy2_800763A4(Actor* actor) { actor->obj.pos.z - actor->vel.z, actor->scale * 3.0f); if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); } else { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); } if ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->eventType == EVID_SLIPPY_METEO)) { @@ -4372,9 +4375,9 @@ void func_enmy2_800763A4(Actor* actor) { actor->timer_0BE = 2; if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); } else { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); } } } @@ -4410,9 +4413,9 @@ void func_enmy2_800763A4(Actor* actor) { actor->timer_0BE = 2; if ((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType < AI360_KATT)) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); } else { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); } } } diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index a695fa6c..d4006f58 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -95,7 +95,7 @@ void Game_SetGameState(void) { gLevelPhase = gNextLevelPhase; gNextLevelPhase = 0; if ((gLevelPhase != 0) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) { - D_ctx_8017782C = 0; + D_ctx_8017782C = false; } break; case GSTATE_MAP: diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index b6c2cde7..f59c8ecb 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -1322,7 +1322,7 @@ void HUD_DrawStatusScreens(void) { s32 func_hud_800886B8(void) { s32 var_v1 = 0; - f32 var_fv1 = gInputPress->stick_y; // related to the vertical height of the arwing + f32 var_fv1 = gInputPress->stick_y; if ((var_fv1 != 0.0f) && (D_80161810[4] != 0)) { return 0; @@ -2159,27 +2159,28 @@ s32 func_hud_8008A4DC(void) { return 0; } -s32 func_hud_8008AC54(s32 arg0) { +// Why is this function here in fox_hud? Weird. +s32 Hud_MissileSeekModeCheck(s32 missileSeekMode) { Actor* actor; s32 i; s32 ret = 0; - for (i = 0, actor = gActors; i < 60; i++, actor++) { - switch (arg0) { - case 0: - if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_ACTOR_190)) { + for (i = 0, actor = &gActors[0]; i < 60; i++, actor++) { + switch (missileSeekMode) { + case 0: // follows teammates + if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_MISSILE_SEEK_TEAM)) { ret++; } break; - case 1: - if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_ACTOR_191)) { + case 1: // follows player + if ((actor->obj.status == OBJ_ACTIVE) && (actor->obj.id == OBJ_MISSILE_SEEK_PLAYER)) { ret++; } break; - case 2: - if (((actor->obj.id == OBJ_ACTOR_190) || (actor->obj.id == OBJ_ACTOR_191)) && + case 2: // follows either + if (((actor->obj.id == OBJ_MISSILE_SEEK_TEAM) || (actor->obj.id == OBJ_MISSILE_SEEK_PLAYER)) && (actor->obj.status == OBJ_ACTIVE)) { ret++; } @@ -3526,7 +3527,7 @@ void func_hud_8008F96C(void) { } if (gCurrentLevel == LEVEL_TRAINING) { - Training_801988E0(); + Training_RingPassCount_Draw(); } } @@ -4186,7 +4187,7 @@ bool func_hud_800915FC(Actor* actor) { y = 720.0f; } - if (boss->obj.id == OBJ_BOSS_293) { + if (boss->obj.id == OBJ_BOSS_CO_CARRIER) { y = 280.0f; } @@ -5306,7 +5307,7 @@ f32 D_800D24C0[] = { 128.0f, 128.0f, 255.0f, 128.0f }; s32 D_800D24C8[] = { 0, 900 }; f32 D_800D24CC = 0.02f; -void func_hud_80094954(Effect* effect) { +void Hud_Effect363_Update(Effect* effect) { Player* player = &gPlayer[0]; if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->csState < 2)) { @@ -5363,7 +5364,7 @@ void func_hud_80094954(Effect* effect) { } } -void func_hud_80094BBC(Effect* effect) { +void Hud_Effect363_Draw(Effect* effect) { if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].csState < 2)) { RCP_SetupDL(&gMasterDisp, SETUPDL_68); diff --git a/src/engine/fox_pause.c b/src/engine/fox_pause.c index ee7de964..0345e1c9 100644 --- a/src/engine/fox_pause.c +++ b/src/engine/fox_pause.c @@ -26,12 +26,14 @@ void func_pause_800A3E00(void) { D_ctx_80177868 = 1; } break; + case 1: D_ctx_80177868 = 2; gDrawMode = DRAW_UNK_7; gCsCamEyeX = gCsCamEyeY = gCsCamEyeZ = gCsCamAtX = gCsCamAtY = 0.0f; gCsCamAtZ = -10.0f; break; + case 2: if ((gControllerPress[0].button & START_BUTTON) || (gControllerPress[1].button & START_BUTTON)) { Audio_PlayPauseSfx(0); @@ -41,6 +43,7 @@ void func_pause_800A3E00(void) { gNextGameStateTimer = 0; } break; + case 3: if (gNextGameStateTimer == 0) { gPlayState = PLAY_UPDATE; diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index bbbff3fa..6651bf43 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -342,7 +342,7 @@ void Play_Setup360_CO(void) { s32 i; s32 j; - gLevelObjects = SEGMENTED_TO_VIRTUAL(D_CO_603B074); + gLevelObjects = SEGMENTED_TO_VIRTUAL(aCoAllRangeLevelObjects); for (j = 0, scenery360 = gScenery360; j < 200; j++) { if (gLevelObjects[j].id <= OBJ_INVALID) { @@ -357,7 +357,7 @@ void Play_Setup360_CO(void) { scenery360->obj.pos.y = gLevelObjects[j].yPos; scenery360->obj.rot.y = gLevelObjects[j].rot.y; Object_SetInfo(&scenery360->info, scenery360->obj.id); - if (scenery360->obj.id == OBJ_SCENERY_1) { + if (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_1) { scenery360->info.dList = D_CO_6020760; } scenery360++; @@ -385,7 +385,7 @@ void Play_Setup360_CO(void) { gBosses[i].obj.pos.x = 0.0f; gBosses[i].obj.pos.y = 0.0f; gBosses[i].obj.pos.z = 0.0f; - gBosses[i].obj.id = OBJ_BOSS_292; + gBosses[i].obj.id = OBJ_BOSS_CO_GRANGA; Object_SetInfo(&gBosses[i].info, gBosses[i].obj.id); } @@ -461,10 +461,12 @@ void Play_Setup(void) { gAllRangeCheckpoint = gSavedObjectLoadIndex = 0; gSavedPathProgress = 0.0f; gSavedHitCount = gCsFrameCount = gLevelStartStatusScreenTimer = gLevelClearScreenTimer = gRadioState = 0; - D_ctx_8017782C = 1; + D_ctx_8017782C = true; + if (((gCurrentLevel == LEVEL_VENOM_2) && (gNextLevelPhase == 2)) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) { return; } + for (i = 1; i < 4; i++) { if (gSavedTeamShields[i] < 0) { if (gSavedTeamShields[i] == -1) { @@ -1212,8 +1214,8 @@ bool Play_CheckPolyCollision(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 a case OBJ_ACTOR_180: colId = COL1_0; break; - case OBJ_SCENERY_4: - case OBJ_SCENERY_5: + case OBJ_SCENERY_CO_BUMP_4: + case OBJ_SCENERY_CO_BUMP_5: colId = COL2_1; useCol2 = true; break; @@ -1235,7 +1237,7 @@ bool Play_CheckPolyCollision(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 a case ACTOR_EVENT_ID: colId = COL1_3; break; - case OBJ_BOSS_SZ: + case OBJ_BOSS_SZ_GREAT_FOX: colId = COL1_8; break; case OBJ_SCENERY_ME_TUNNEL: @@ -1257,11 +1259,11 @@ bool Play_CheckPolyCollision(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 a colId = COL2_7; useCol2 = true; break; - case OBJ_SCENERY_2: + case OBJ_SCENERY_CO_BUMP_2: colId = COL2_2; useCol2 = true; break; - case OBJ_SCENERY_3: + case OBJ_SCENERY_CO_BUMP_3: case OBJ_SCENERY_69: colId = COL2_3; useCol2 = true; @@ -1331,10 +1333,10 @@ bool Play_CheckPolyCollision(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 a case OBJ_SCENERY_146: case OBJ_SCENERY_147: case OBJ_SCENERY_148: - case OBJ_SCENERY_40: - case OBJ_SCENERY_41: - case OBJ_SCENERY_42: - case OBJ_SCENERY_43: + case OBJ_SCENERY_CO_BUILDING_9: + case OBJ_SCENERY_CO_BUILDING_10: + case OBJ_SCENERY_IBEAM: + case OBJ_SCENERY_ZO_ROCK_1: case OBJ_SCENERY_44: case OBJ_SCENERY_45: case OBJ_SCENERY_46: @@ -1344,9 +1346,9 @@ bool Play_CheckPolyCollision(ObjectId objId, f32 arg1, f32 arg2, f32 arg3, f32 a case OBJ_SCENERY_51: case OBJ_SCENERY_52: case OBJ_SCENERY_53: - case OBJ_SCENERY_54: - case OBJ_SCENERY_55: - case OBJ_SCENERY_56: + case OBJ_SCENERY_CO_WATERFALL: + case OBJ_SCENERY_CO_ROCKWALL: + case OBJ_SCENERY_CO_DOORS: case OBJ_SCENERY_57: case OBJ_SCENERY_58: case OBJ_SCENERY_59: @@ -1645,8 +1647,8 @@ void Player_CollisionCheck(Player* player) { if ((scenery360->obj.id == OBJ_SCENERY_117) || (scenery360->obj.id == OBJ_SCENERY_143) || (scenery360->obj.id == OBJ_SCENERY_141) || (scenery360->obj.id == OBJ_SCENERY_149) || (scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_148) || - (scenery360->obj.id == OBJ_SCENERY_160) || (scenery360->obj.id == OBJ_SCENERY_1) || - (scenery360->obj.id == OBJ_SCENERY_3) || (scenery360->obj.id == OBJ_SCENERY_140)) { + (scenery360->obj.id == OBJ_SCENERY_160) || (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_1) || + (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3) || (scenery360->obj.id == OBJ_SCENERY_140)) { temp_v0 = Player_CheckPolyCollision(player, scenery360->obj.id, scenery360->obj.pos.x, scenery360->obj.pos.y, scenery360->obj.pos.z, scenery360->obj.rot.x, scenery360->obj.rot.y, @@ -1666,7 +1668,7 @@ void Player_CollisionCheck(Player* player) { scenery360->obj.rot.y, scenery360->obj.rot.z, 0.0f, 0.0f, 0.0f); if ((temp_v0 != 0) && (temp_v0 < 0)) { if (player->whooshTimer == 0) { - func_effect_8007A6F0(&scenery360->obj.pos, NA_SE_PASS); + Effect_SpawnTimedSfxAtPos(&scenery360->obj.pos, NA_SE_PASS); } player->whooshTimer += 2; if (player->whooshTimer >= 4) { @@ -1682,7 +1684,7 @@ void Player_CollisionCheck(Player* player) { if (temp_v0 != 0) { if (temp_v0 < 0) { if (player->whooshTimer == 0) { - func_effect_8007A6F0(&scenery360->obj.pos, NA_SE_PASS); + Effect_SpawnTimedSfxAtPos(&scenery360->obj.pos, NA_SE_PASS); } player->whooshTimer += 2; if (player->whooshTimer >= 4) { @@ -1749,11 +1751,11 @@ void Player_CollisionCheck(Player* player) { (scenery->obj.id != OBJ_SCENERY_71) && (scenery->obj.id != OBJ_SCENERY_73) && (scenery->obj.id != OBJ_SCENERY_74) && (scenery->obj.id != OBJ_SCENERY_69) && ((player->trueZpos - 2000.0f) < scenery->obj.pos.z)) { - if ((scenery->obj.id == OBJ_SCENERY_1) || (scenery->obj.id == OBJ_SCENERY_4) || - (scenery->obj.id == OBJ_SCENERY_5) || (scenery->obj.id == OBJ_SCENERY_47) || + if ((scenery->obj.id == OBJ_SCENERY_CO_BUMP_1) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_4) || + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_5) || (scenery->obj.id == OBJ_SCENERY_47) || (scenery->obj.id == OBJ_SCENERY_117) || (scenery->obj.id == OBJ_SCENERY_120) || (scenery->obj.id == OBJ_SCENERY_124) || (scenery->obj.id == OBJ_SCENERY_126) || - (scenery->obj.id == OBJ_SCENERY_2) || (scenery->obj.id == OBJ_SCENERY_3)) { + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_2) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_3)) { spC8.x = scenery->obj.pos.x - player->pos.x; spC8.z = scenery->obj.pos.z - player->trueZpos; if (sqrtf(SQ(spC8.x) + SQ(spC8.z)) < 1100.0f) { @@ -1766,7 +1768,7 @@ void Player_CollisionCheck(Player* player) { } } else { padB0 = scenery->obj.rot.y; - if (scenery->info.action == (ObjectFunc) func_enmy_80066EA8) { + if (scenery->info.action == (ObjectFunc) SceneryRotateTowardsCamera) { padB0 = 0.0f; } temp_v0 = Player_CheckHitboxCollision( @@ -1788,7 +1790,7 @@ void Player_CollisionCheck(Player* player) { if (player->whooshTimer >= 4) { player->whooshTimer = 4; } - } else if (scenery->obj.id == OBJ_SCENERY_54) { + } else if (scenery->obj.id == OBJ_SCENERY_CO_WATERFALL) { if (player->whooshTimer == 0) { AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, scenery->sfxSource, 0); } @@ -1798,7 +1800,8 @@ void Player_CollisionCheck(Player* player) { } } else { Player_ApplyDamage(player, temp_v0, scenery->info.damage); - if ((scenery->obj.id == OBJ_SCENERY_48) || (scenery->obj.id == OBJ_SCENERY_55) || + if ((scenery->obj.id == OBJ_SCENERY_48) || + (scenery->obj.id == OBJ_SCENERY_CO_ROCKWALL) || (scenery->obj.id == OBJ_SCENERY_49)) { Matrix_RotateY(gCalcMatrix, scenery->obj.rot.y * M_DTOR, MTXF_NEW); spC8.x = -(player->baseSpeed + player->boostSpeed) * 0.7f; @@ -1841,8 +1844,8 @@ void Player_CollisionCheck(Player* player) { } for (i = 0, boss = gBosses; i < ARRAY_COUNT(gBosses); i++, boss++) { if (boss->obj.status == OBJ_ACTIVE) { - if ((boss->obj.id == OBJ_BOSS_VE2) || (boss->obj.id == OBJ_BOSS_FO) || (boss->obj.id == OBJ_BOSS_SZ) || - (boss->obj.id == OBJ_BOSS_309)) { + if ((boss->obj.id == OBJ_BOSS_VE2) || (boss->obj.id == OBJ_BOSS_FO) || + (boss->obj.id == OBJ_BOSS_SZ_GREAT_FOX) || (boss->obj.id == OBJ_BOSS_309)) { temp_v0 = Player_CheckPolyCollision(player, boss->obj.id, boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->obj.rot.x, boss->obj.rot.y, boss->obj.rot.z); @@ -1898,7 +1901,7 @@ void Player_CollisionCheck(Player* player) { break; } Player_ApplyDamage(player, temp_v0, boss->info.damage); - if ((boss->obj.id == OBJ_BOSS_303) && ((boss->state == 2) || (boss->state == 3)) && + if ((boss->obj.id == OBJ_BOSS_SX_SPYBORG) && ((boss->state == 2) || (boss->state == 3)) && (sp98 >= 9)) { player->knockback.y = -100.0f; } @@ -1996,7 +1999,7 @@ void Player_CollisionCheck(Player* player) { } } else { actor->dmgType = DMG_COLLISION; - if (actor->obj.id == OBJ_ACTOR_190) { + if (actor->obj.id == OBJ_MISSILE_SEEK_TEAM) { actor->dmgType = -1; } if (actor->info.damage) { @@ -2212,8 +2215,8 @@ void Player_FloorCheck(Player* player) { for (sp144 = 0, scenery360 = gScenery360; sp144 < 200; sp144++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && ((scenery360->obj.id == OBJ_SCENERY_150) || (scenery360->obj.id == OBJ_SCENERY_149) || - (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_1) || - (scenery360->obj.id == OBJ_SCENERY_3)) && + (scenery360->obj.id == OBJ_SCENERY_148) || (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_1) || + (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3)) && (fabsf(scenery360->obj.pos.x - player->pos.x) < 2500.0f) && (fabsf(scenery360->obj.pos.z - player->trueZpos) < 2500.0f)) { tempx = scenery360->obj.pos.x; @@ -2246,7 +2249,7 @@ void Player_FloorCheck(Player* player) { } } else { colId = COL2_0; - if (scenery360->obj.id == OBJ_SCENERY_3) { + if (scenery360->obj.id == OBJ_SCENERY_CO_BUMP_3) { colId = COL2_3; } if (func_col2_800A3690(&spD4, &spC8, colId, &spBC)) { @@ -2263,14 +2266,14 @@ void Player_FloorCheck(Player* player) { (sp144 < 50) && (gLevelMode == LEVELMODE_ON_RAILS) && (gCurrentLevel != LEVEL_VENOM_1); sp144++, scenery++) { if ((scenery->obj.status == OBJ_ACTIVE) && ((player->trueZpos - 3000.0f) < scenery->obj.pos.z) && - (scenery->obj.id != OBJ_SCENERY_0) && (scenery->obj.id != OBJ_SCENERY_8)) { + (scenery->obj.id != OBJ_SCENERY_CO_STONE_ARCH) && (scenery->obj.id != OBJ_SCENERY_CO_HIGHWAY_3)) { tempx = scenery->obj.pos.x; tempy = scenery->obj.pos.y; tempz = scenery->obj.pos.z; sp120 = scenery->obj.rot.y; - if ((scenery->obj.id == OBJ_SCENERY_3) || (scenery->obj.id == OBJ_SCENERY_2) || - (scenery->obj.id == OBJ_SCENERY_47) || (scenery->obj.id == OBJ_SCENERY_4) || - (scenery->obj.id == OBJ_SCENERY_5)) { + if ((scenery->obj.id == OBJ_SCENERY_CO_BUMP_3) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_2) || + (scenery->obj.id == OBJ_SCENERY_47) || (scenery->obj.id == OBJ_SCENERY_CO_BUMP_4) || + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_5)) { Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, MTXF_NEW); for (var_fs1 = var_fs0 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { spEC.x = player->pos.x - tempx; @@ -2292,11 +2295,12 @@ void Player_FloorCheck(Player* player) { if (scenery->obj.id == OBJ_SCENERY_47) { colId = COL2_7; } - if (scenery->obj.id == OBJ_SCENERY_2) { + if (scenery->obj.id == OBJ_SCENERY_CO_BUMP_2) { colId = COL2_2; - } else if (scenery->obj.id == OBJ_SCENERY_3) { + } else if (scenery->obj.id == OBJ_SCENERY_CO_BUMP_3) { colId = COL2_3; - } else if ((scenery->obj.id == OBJ_SCENERY_4) || (scenery->obj.id == OBJ_SCENERY_5)) { + } else if ((scenery->obj.id == OBJ_SCENERY_CO_BUMP_4) || + (scenery->obj.id == OBJ_SCENERY_CO_BUMP_5)) { colId = COL2_1; } if (func_col2_800A3690(&spD4, &spC8, colId, &spBC)) { @@ -2312,7 +2316,7 @@ void Player_FloorCheck(Player* player) { hitboxData = scenery->info.hitbox; count = *hitboxData; if (count != 0) { - if (scenery->info.action == (ObjectFunc) func_enmy_80066EA8) { + if (scenery->info.action == (ObjectFunc) SceneryRotateTowardsCamera) { sp120 = 0.0f; } hitboxData++; @@ -2543,7 +2547,7 @@ void Player_InitVersus(void) { Player_Initialize(&gPlayer[i]); Player_Setup(&gPlayer[i]); Player_Update360(&gPlayer[i]); - Camera_Update360(&gPlayer[i], 1); + Camera_Update360(&gPlayer[i], true); } Play_ClearObjectData(); } @@ -2665,12 +2669,12 @@ void Play_Init(void) { switch (gCurrentLevel) { case LEVEL_SECTOR_Z: if (!D_ctx_8017782C) { - SectorZ_8019EA68(); + SectorZ_LoadLevelObjects(); ActorAllRange_SpawnTeam(); } break; case LEVEL_FORTUNA: - Fortuna_8018BA2C(); + Fortuna_LoadLevelObjects(); ActorAllRange_SpawnTeam(); break; case LEVEL_KATINA: @@ -2686,7 +2690,7 @@ void Play_Init(void) { } break; case LEVEL_VENOM_2: - Venom2_80196968(); + Venom2_LoadLevelObjects(); if (gLevelPhase == 0) { ActorAllRange_SpawnTeam(); } @@ -4274,7 +4278,7 @@ void Player_Setup(Player* playerx) { } break; } - Camera_Update360(player, 1); + Camera_Update360(player, true); } player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->wingPosition = gLevelType; @@ -4291,7 +4295,7 @@ void Player_Setup(Player* playerx) { player->yRot_114 = 188.0f; player->hideShadow = true; } - Camera_UpdateArwing360(player, 1); + Camera_UpdateArwing360(player, true); } else { player->unk_014 = 1.0f; player->unk_018 = 1.0f; @@ -4302,7 +4306,7 @@ void Player_Setup(Player* playerx) { D_ctx_80177A10[j] = 0; D_ctx_80177A48[j] = 0.0f; } - D_ctx_8017782C = 0; + D_ctx_8017782C = false; gAllRangeCheckpoint = 0; switch (gCurrentLevel) { case LEVEL_CORNERIA: @@ -5497,7 +5501,7 @@ void Player_Update(Player* player) { Player_Initialize(player); Player_Setup(player); Player_Update360(player); - Camera_Update360(player, 1); + Camera_Update360(player, true); Player_PlaySfx(player->sfxSource, NA_SE_ARWING_BOOST, player->num); player->unk_190 = player->unk_194 = 5.0f; } else if (player->attacker >= 0) { @@ -5787,7 +5791,7 @@ void Camera_FollowPlayer(Player* player, s32 playerNum, bool arg2) { Math_SmoothStepToF(&player->camRoll, 0.0f, 0.05f, 5.0f, 0.00001f); } -void Camera_UpdateArwing360(Player* player, s32 arg1) { +void Camera_UpdateArwing360(Player* player, bool arg1) { Vec3f sp74; Vec3f sp68; f32 temp1; @@ -5855,7 +5859,7 @@ void Camera_UpdateArwing360(Player* player, s32 arg1) { Math_SmoothStepToF(&player->cam.at.z, atZ, player->unk_01C, 30000.0f, 0); Math_SmoothStepToF(&player->unk_018, 0.2f, 0.1f, 0.005f, 0); Math_SmoothStepToF(&player->unk_01C, 1.0f, 0.1f, 0.005f, 0); - if (arg1 != 0) { + if (arg1) { player->cam.eye.x = eyeX; player->cam.eye.y = eyeY; player->cam.eye.z = eyeZ; @@ -5999,7 +6003,7 @@ void Camera_SetStarfieldPos(f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 } } -void Camera_Update360(Player* player, s32 arg1) { +void Camera_Update360(Player* player, bool arg1) { switch (player->form) { case FORM_ON_FOOT: Camera_UpdateOnFoot360(player, arg1); @@ -6031,7 +6035,7 @@ void Camera_Update(Player* player) { } break; case LEVELMODE_ALL_RANGE: - Camera_Update360(player, 0); + Camera_Update360(player, false); break; case LEVELMODE_UNK_2: Turret_UpdateCamera(player); @@ -6040,7 +6044,7 @@ void Camera_Update(Player* player) { break; case PLAYERSTATE_1C8_U_TURN: player->camRoll -= player->camRoll * 0.1f; - Camera_Update360(player, 0); + Camera_Update360(player, false); break; case PLAYERSTATE_1C8_DOWN: if ((gLevelMode == LEVELMODE_ON_RAILS) && (player->form == FORM_ARWING)) { @@ -6158,7 +6162,7 @@ void Play_UpdateLevel(void) { switch (gCurrentLevel) { case LEVEL_TRAINING: if (gLevelMode == LEVELMODE_ALL_RANGE) { - Training_8019949C(); + Training_SpawnEnemies(); } break; case LEVEL_VERSUS: @@ -6183,7 +6187,7 @@ void Play_UpdateLevel(void) { gPlayer[0].csState = 0; gPlayer[0].draw = true; gPlayer[0].pos.z = 15000.0f; - Camera_Update360(gPlayer, 1); + Camera_Update360(gPlayer, true); gFillScreenAlpha = 255; gFillScreenAlphaStep = 255; gFillScreenAlphaTarget = 255; @@ -6436,7 +6440,7 @@ void Play_Main(void) { gPlayer[0].zPath = gPlayer[0].zPathVel = gPathVelZ = gPathProgress = 0.0f; } if (gPlayState != PLAY_PAUSE) { - (void) "play_time = %d\n"; + PRINTF("play_time = %d\n"); gGameFrameCount++; } switch (gPlayState) { @@ -6475,7 +6479,7 @@ void Play_Main(void) { gCamCount = 1; gBgColor = 0; gCsFrameCount = gLevelClearScreenTimer = gLevelStartStatusScreenTimer = gRadioState = 0; - D_ctx_8017782C = 0; + D_ctx_8017782C = false; } if (gVersusMode) { Versus_Main(); diff --git a/src/engine/fox_reset.c b/src/engine/fox_reset.c index f61236b1..e191109c 100644 --- a/src/engine/fox_reset.c +++ b/src/engine/fox_reset.c @@ -33,11 +33,13 @@ void Graphics_NMIWipe(void) { if (sWipeBarLength == 0) { AudioThread_PreNMIReset(); } + sWipeBarLength += SCREEN_WIDTH / 7; if (sWipeBarLength >= SCREEN_WIDTH * 85 / 8 / 7) { // Why 85 / 8 == 3400 / 320 == 10.625? Has to do with NMI timing? osViBlack(true); gStopTasks = true; } + for (i = 0; i < MAXCONTROLLERS; i++) { gControllerRumbleEnabled[i] = 0; gControllerRumbleFlags[i] = 0; diff --git a/src/engine/fox_save.c b/src/engine/fox_save.c index c6a88897..f477a78f 100644 --- a/src/engine/fox_save.c +++ b/src/engine/fox_save.c @@ -65,7 +65,7 @@ s32 Save_Read(void) { gSaveFile = gSaveIOBuffer; if (gSaveFile.save.checksum == Save_Checksum(&gSaveFile.save)) { - (void) "EEPROM ROM[0] 正常\n"; + PRINTF("EEPROM ROM[0] 正常\n"); return 0; } #ifdef AVOID_UB @@ -78,9 +78,10 @@ s32 Save_Read(void) { gSaveFile.save.checksum = gSaveFile.backup.checksum; if (gSaveFile.save.checksum == Save_Checksum(&gSaveFile.save)) { - (void) "EEPROM ROM[1] 正常\n"; + PRINTF("EEPROM ROM[1] 正常\n"); return 0; + } else { + PRINTF("EEPROM ROM[0] & ROM[1] 異常\n"); + return -1; } - (void) "EEPROM ROM[0] & ROM[1] 異常\n"; - return -1; } diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index 53f247fa..8b604450 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -537,7 +537,7 @@ void func_tank_80045130(Player* player) { } void func_tank_80045348(Player* player) { - f32 sp44 = 15.0f; + f32 baseSpeedTarget = 15.0f; f32 sp40 = 0; f32 sp3C = 0.1f; f32 sp38 = 3.5f; @@ -555,7 +555,7 @@ void func_tank_80045348(Player* player) { } else { player->unk_190 = 2.0f; } - sp44 = 25.0f; + baseSpeedTarget = 25.0f; sp40 = -200.0f; sp3C = 0.2f; sp38 = 6.0f; @@ -571,7 +571,7 @@ void func_tank_80045348(Player* player) { } if ((gBrakeButton[player->num] & gInputHold->button) && !player->boostCooldown && !sp2E) { D_800C9F14++; - sp44 = 5.0f; + baseSpeedTarget = 5.0f; sp40 = 100.0f; sp3C = 0.2f; D_800C9F28 += 1.0f; @@ -579,7 +579,7 @@ void func_tank_80045348(Player* player) { } else { D_800C9F28 = 0.0f; } - Math_SmoothStepToF(&player->baseSpeed, sp44, sp3C, sp38, 0.001f); + Math_SmoothStepToF(&player->baseSpeed, baseSpeedTarget, sp3C, sp38, 0.001f); Math_SmoothStepToF(&player->camDist, sp40, sp3C, sp38, 0.001f); } else if (player->unk_19C == -1) { Math_SmoothStepToF(&player->baseSpeed, player->unk_000, 0.1f, 2.0f, 0.01f); @@ -1351,7 +1351,7 @@ void func_tank_800481F4(Player* player) { (scenery->obj.id != OBJ_SCENERY_73) && (scenery->obj.id != OBJ_SCENERY_74) && (scenery->obj.id != OBJ_SCENERY_69) && ((player->trueZpos - 2000.0f) < scenery->obj.pos.z)) { var_fv1 = scenery->obj.rot.y; - if (scenery->info.action == (ObjectFunc) func_enmy_80066EA8) { + if (scenery->info.action == (ObjectFunc) SceneryRotateTowardsCamera) { var_fv1 = 0.0f; } temp_v0 = Player_CheckHitboxCollision(player, scenery->info.hitbox, &sp98, scenery->obj.pos.x, @@ -1463,7 +1463,7 @@ void func_tank_800481F4(Player* player) { actor->obj.rot.y, actor->obj.rot.z, 0.0f, 0.0f, 0.0f); if (temp_v0 != 0) { actor->dmgType = DMG_COLLISION; - if ((actor->obj.id == OBJ_ACTOR_225) || (actor->obj.id == OBJ_ACTOR_190)) { + if ((actor->obj.id == OBJ_ACTOR_225) || (actor->obj.id == OBJ_MISSILE_SEEK_TEAM)) { actor->dmgType = -1; } if (actor->info.damage) { diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index 015853d1..28633126 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -1953,7 +1953,7 @@ void func_versus_800C26C8(void) { actor->obj.pos.x = dest.x; actor->obj.pos.y = dest.y; actor->obj.pos.z = dest.z; - actor->aiType = i + AI360_10; + actor->aiType = i + AI360_ENEMY; actor->health = 24; actor->timer_0C2 = 30; diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index 880d9c9a..27eb1b1d 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -7,62 +7,63 @@ #include "global.h" #include "assets/ast_arwing.h" #include "assets/ast_corneria.h" +#include "fox_co.h" u8 D_i1_8019B6D0; -f32 D_i1_8019B6D8[68]; +f32 sCoGrangaWork[68]; -void Corneria_80187530(Scenery* scenery) { +void Corneria_BuildingOnFire_Update(CoBuildingOnFire* this) { } -void Corneria_8018753C(Scenery* scenery) { +void Corneria_BuildingOnFire_Draw(CoBuildingOnFire* this) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_CO_60199D0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } -void Corneria_801875A4(Sprite* sprite) { - f32 sp1C; - f32 sp18; - f32 var_f; +void Corneria_Smoke_Update(CoSmoke* this) { + f32 x; + f32 y; + f32 z; - if (((gGameFrameCount % 4) == 0)) { - sp1C = RAND_FLOAT_CENTERED(10.0f); - sp18 = RAND_FLOAT_CENTERED(10.0f); - var_f = RAND_FLOAT(0.5f) + 1.0f; - func_effect_8007C85C(sprite->obj.pos.x + sp1C, sprite->obj.pos.y + sp18, sprite->obj.pos.z, 4.0f * var_f); + if ((gGameFrameCount % 4) == 0) { + x = RAND_FLOAT_CENTERED(10.0f); + y = RAND_FLOAT_CENTERED(10.0f); + z = RAND_FLOAT(0.5f) + 1.0f; + func_effect_8007C85C(this->obj.pos.x + x, this->obj.pos.y + y, this->obj.pos.z, 4.0f * z); } } -void Corneria_80187670(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 xRot, f32 yRot, s32 arg7, s32 arg8, - ObjectId objId) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = objId; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->obj.rot.x = xRot; - actor->obj.rot.y = yRot; - actor->timer_0BC = arg7; - actor->timer_0BE = 20; - actor->eventType = arg8; - actor->fwork[5] = arg4; - Object_SetInfo(&actor->info, actor->obj.id); +void Corneria_Boss_MissileInit(Actor* this, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f32 xRot, f32 yRot, s32 arg7, + s32 eventType, ObjectId objId) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = objId; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + this->timer_0BC = arg7; + this->timer_0BE = 20; + this->eventType = eventType; + this->fwork[5] = arg4; + Object_SetInfo(&this->info, this->obj.id); } -void Corneria_80187710(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 xRot, f32 yRot, s32 arg6, s32 arg7, ObjectId objId) { +void Corneria_Boss_SpawnMissile(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 xRot, f32 yRot, s32 arg6, s32 eventType, + ObjectId objId) { s32 i; for (i = 0; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.status == OBJ_FREE) { - PRINTF("Enms[1].obj.mode %d\n"); - Corneria_80187670(&gActors[i], xPos, yPos, zPos, arg3, xRot, yRot, arg6, arg7, objId); - return; + Corneria_Boss_MissileInit(&gActors[i], xPos, yPos, zPos, arg3, xRot, yRot, arg6, eventType, objId); + break; } } } -void Corneria_801877A0(Boss* boss, f32 x, f32 y, f32 z) { +void Corneria_Granga_ShootLaser(Granga* this, f32 x, f32 y, f32 z) { Vec3f src; Vec3f dest; @@ -72,30 +73,29 @@ void Corneria_801877A0(Boss* boss, f32 x, f32 y, f32 z) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_effect_8007F11C(OBJ_EFFECT_353, boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, - 100.0f); + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, + this->obj.pos.z + dest.z, 100.0f); } -// Maybe Corneria_SpawnItem -void Corneria_80187838(s32 arg0, f32 x, f32 y, f32 z, ObjectId item) { +void Corneria_GrangaSpawnItem(s32 arg0, f32 x, f32 y, f32 z, ObjectId itemId) { s32 i; for (i = 0; i < ARRAY_COUNT(gItems); i++) { if (gItems[i].obj.status == OBJ_FREE) { Item_Initialize(&gItems[i]); gItems[i].obj.status = OBJ_INIT; - gItems[i].obj.id = item; + gItems[i].obj.id = itemId; gItems[i].timer_4A = 8; gItems[i].obj.pos.x = x; gItems[i].obj.pos.y = y; gItems[i].obj.pos.z = z; Object_SetInfo(&gItems[i].info, gItems[i].obj.id); - return; + break; } } } -void Corneria_Boss292_Init(Boss292* this) { +void Corneria_Granga_Init(Granga* this) { s32 i; gBossFrameCount = 0; @@ -111,23 +111,23 @@ void Corneria_Boss292_Init(Boss292* this) { return; } - for (i = 0; i < ARRAY_COUNT(D_i1_8019B6D8); i++) { - D_i1_8019B6D8[i] = 0.0f; + for (i = 0; i < ARRAY_COUNT(sCoGrangaWork); i++) { + sCoGrangaWork[i] = 0.0f; } } -void Corneria_8018798C(Boss* boss, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { - func_effect_8007BFFC(arg1, arg2, arg3, 0.0f, 0.0f, 0.0f, arg4, 30); - func_effect_8007A6F0(&boss->obj.pos, NA_SE_OB_DAMAGE_M); +void Corneria_8018798C(Granga* this, f32 xPos, f32 yPos, f32 zPos, f32 scale) { + func_effect_8007BFFC(xPos, yPos, zPos, 0.0f, 0.0f, 0.0f, scale, 30); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_DAMAGE_M); } -void Corneria_801879F0(Boss* boss, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { - func_effect_8007D1E0(arg1, arg2, arg3, arg4); - func_effect_8007A6F0(&boss->obj.pos, NA_SE_OB_DAMAGE_M); +void Corneria_801879F0(Granga* this, f32 xPos, f32 yPos, f32 zPos, f32 scale) { + func_effect_8007D1E0(xPos, yPos, zPos, scale); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_DAMAGE_M); } -void Corneria_80187A38(Boss* boss, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { - func_effect_8007C120(arg1, arg2, arg3, boss->vel.x, boss->vel.y, boss->vel.z, arg4, arg5); +void Corneria_80187A38(Granga* this, f32 xPos, f32 yPos, f32 zPos, f32 scale, s32 timer) { + func_effect_8007C120(xPos, yPos, zPos, this->vel.x, this->vel.y, this->vel.z, scale, timer); } f32 Corneria_80187A88(s32 arg0) { @@ -139,45 +139,46 @@ f32 Corneria_80187A88(s32 arg0) { return ret; } -void Corneria_80187AC8(Boss* boss) { - Sprite* sprite; +void Corneria_Granga_HandleDamage(Granga* this) { + CoTree* tree; s32 item; - s32 var_s1; - s32 var_s1_2; + s32 i; - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; - if (boss->dmgPart == 0) { - boss->swork[10] = 15; - boss->swork[29] -= boss->damage; + if (this->dmgPart == GRANGA_DMG_BACKPACK) { + this->swork[GRANGA_BACKPACK_DMG_IND] = DMG_FLICKER_15; + this->swork[GRANGA_BACKPACK_HP] -= this->damage; - Corneria_80187A38(boss, D_i1_8019B6D8[62], D_i1_8019B6D8[63], D_i1_8019B6D8[64], 0.2f, 20); + Corneria_80187A38(this, sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[GRANGA_WORK_63], + sCoGrangaWork[GRANGA_WORK_64], 0.2f, 20); - if (boss->swork[29] < 30) { - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_KNOCK_DOWN); + if (this->swork[GRANGA_BACKPACK_HP] < 30) { + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_KNOCK_DOWN); } else { - func_effect_8007A6F0(&boss->obj.pos, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_DAMAGE_M); } Radio_PlayMessage(gMsg_ID_2270, RCID_BOSS_CORNERIA); - if (boss->swork[29] <= 0) { - boss->swork[10] = 1000; - boss->info.hitbox[1 + 0] = 100000.0f; + if (this->swork[GRANGA_BACKPACK_HP] <= 0) { // Boss defeat check + this->swork[GRANGA_BACKPACK_DMG_IND] = DMG_DESTROYED; + this->info.hitbox[1 + 0] = 100000.0f; - Corneria_8018798C(boss, D_i1_8019B6D8[62], D_i1_8019B6D8[63], D_i1_8019B6D8[64], 10.0f); + Corneria_8018798C(this, sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[GRANGA_WORK_63], + sCoGrangaWork[GRANGA_WORK_64], 10.0f); - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); gScreenFlashTimer = 8; - if (fabsf(boss->obj.rot.x) < 20.0f) { - boss->swork[32] = 1; + if (fabsf(this->obj.rot.x) < 20.0f) { + this->swork[GRANGA_SWK_32] = true; } - boss->state = 7; - boss->timer_050 = 100; + this->state = GRANGA_STATE_7; + this->timer_050 = 100; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 80); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); @@ -201,273 +202,298 @@ void Corneria_80187AC8(Boss* boss) { Radio_PlayMessage(gMsg_ID_2280, RCID_BOSS_CORNERIA); - Boss_AwardBonus(boss); + Boss_AwardBonus(this); gBossFrameCount = 100000; return; } - } else if (boss->dmgPart == 3) { - boss->swork[3] = 15; - boss->swork[20] = 30; - boss->swork[28] -= boss->damage; + } else if (this->dmgPart == GRANGA_DMG_GUN) { + this->swork[GRANGA_GUN_DMG_IND] = DMG_FLICKER_15; + this->swork[GRANGA_SWK_20] = 30; + this->swork[GRANGA_PLASMA_GUN_HP] -= this->damage; - Corneria_801879F0(boss, D_i1_8019B6D8[12] + RAND_FLOAT_CENTERED(60.0f), D_i1_8019B6D8[13], - D_i1_8019B6D8[14] + RAND_FLOAT_CENTERED(60.0f), 2.0f); - Corneria_80187A38(boss, D_i1_8019B6D8[12], D_i1_8019B6D8[13], D_i1_8019B6D8[14], 0.1f, 20); + Corneria_801879F0(this, sCoGrangaWork[GRANGA_WORK_12] + RAND_FLOAT_CENTERED(60.0f), + sCoGrangaWork[GRANGA_WORK_13], sCoGrangaWork[GRANGA_WORK_14] + RAND_FLOAT_CENTERED(60.0f), + 2.0f); + Corneria_80187A38(this, sCoGrangaWork[GRANGA_WORK_12], sCoGrangaWork[GRANGA_WORK_13], + sCoGrangaWork[GRANGA_WORK_14], 0.1f, 20); - if (boss->swork[28] <= 0) { - boss->swork[3] = 1000; - boss->info.hitbox[1 + 18] = 100000.0f; - Corneria_8018798C(boss, D_i1_8019B6D8[12], D_i1_8019B6D8[13], D_i1_8019B6D8[14], 10.0f); + if (this->swork[GRANGA_PLASMA_GUN_HP] <= 0) { + this->swork[GRANGA_GUN_DMG_IND] = DMG_DESTROYED; + this->info.hitbox[1 + 18] = 100000.0f; + Corneria_8018798C(this, sCoGrangaWork[GRANGA_WORK_12], sCoGrangaWork[GRANGA_WORK_13], + sCoGrangaWork[GRANGA_WORK_14], 10.0f); } } - if (boss->dmgPart == 1) { - boss->swork[2] = 15; - boss->swork[21] = 30; - boss->swork[26] -= boss->damage; + if (this->dmgPart == GRANGA_DMG_LEFT_ARM) { + this->swork[GRANGA_LEFT_ARM_DMG_IND] = DMG_FLICKER_15; + this->swork[GRANGA_SWK_21] = 30; + this->swork[GRANGA_LEFT_ARM_HP] -= this->damage; - Corneria_801879F0(boss, D_i1_8019B6D8[6] + RAND_FLOAT_CENTERED(60.0f), D_i1_8019B6D8[7], - D_i1_8019B6D8[8] + RAND_FLOAT_CENTERED(60.0f), 2.0f); - Corneria_80187A38(boss, D_i1_8019B6D8[6], D_i1_8019B6D8[7], D_i1_8019B6D8[8], 0.1f, 20); + Corneria_801879F0(this, sCoGrangaWork[GRANGA_WORK_06] + RAND_FLOAT_CENTERED(60.0f), + sCoGrangaWork[GRANGA_WORK_07], sCoGrangaWork[GRANGA_WORK_08] + RAND_FLOAT_CENTERED(60.0f), + 2.0f); + Corneria_80187A38(this, sCoGrangaWork[GRANGA_WORK_06], sCoGrangaWork[GRANGA_WORK_07], + sCoGrangaWork[GRANGA_WORK_08], 0.1f, 20); - if (boss->swork[26] <= 0) { - boss->swork[2] = 1000; - boss->info.hitbox[1 + 6] = 100000.0f; - Corneria_8018798C(boss, D_i1_8019B6D8[6], D_i1_8019B6D8[7], D_i1_8019B6D8[8], 7.0f); + if (this->swork[GRANGA_LEFT_ARM_HP] <= 0) { + this->swork[GRANGA_LEFT_ARM_DMG_IND] = DMG_DESTROYED; + this->info.hitbox[1 + 6] = 100000.0f; + Corneria_8018798C(this, sCoGrangaWork[GRANGA_WORK_06], sCoGrangaWork[GRANGA_WORK_07], + sCoGrangaWork[GRANGA_WORK_08], 7.0f); } - } else if (boss->dmgPart == 2) { - boss->swork[1] = 15; - boss->swork[22] = 30; - boss->swork[27] -= boss->damage; + } else if (this->dmgPart == GRANGA_DMG_RIGHT_ARM) { + this->swork[GRANGA_RIGHT_ARM_DMG_IND] = DMG_FLICKER_15; + this->swork[GRANGA_SWK_22] = 30; + this->swork[GRANGA_RIGHT_ARM_HP] -= this->damage; - Corneria_801879F0(boss, D_i1_8019B6D8[0] + RAND_FLOAT_CENTERED(60.0f), D_i1_8019B6D8[1], - D_i1_8019B6D8[2] + RAND_FLOAT_CENTERED(60.0f), 2.0f); - Corneria_80187A38(boss, D_i1_8019B6D8[0], D_i1_8019B6D8[1], D_i1_8019B6D8[2], 0.1f, 20); + Corneria_801879F0(this, sCoGrangaWork[GRANGA_WORK_00] + RAND_FLOAT_CENTERED(60.0f), + sCoGrangaWork[GRANGA_WORK_01], sCoGrangaWork[GRANGA_WORK_02] + RAND_FLOAT_CENTERED(60.0f), + 2.0f); + Corneria_80187A38(this, sCoGrangaWork[GRANGA_WORK_00], sCoGrangaWork[GRANGA_WORK_01], + sCoGrangaWork[GRANGA_WORK_02], 0.1f, 20); - if (boss->swork[27] <= 0) { - boss->swork[1] = 1000; - boss->info.hitbox[1 + 12] = 100000.0f; - Corneria_8018798C(boss, D_i1_8019B6D8[0], D_i1_8019B6D8[1], D_i1_8019B6D8[2], 7.0f); + if (this->swork[GRANGA_RIGHT_ARM_HP] <= 0) { + this->swork[GRANGA_RIGHT_ARM_DMG_IND] = DMG_DESTROYED; + this->info.hitbox[1 + 12] = 100000.0f; + Corneria_8018798C(this, sCoGrangaWork[GRANGA_WORK_00], sCoGrangaWork[GRANGA_WORK_01], + sCoGrangaWork[GRANGA_WORK_02], 7.0f); } - } else if ((boss->dmgPart == 4) || (boss->dmgPart == 5)) { - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, boss->sfxSource, 4); - boss->swork[23] = 200; + } else if ((this->dmgPart == GRANGA_DMG_LEFT_LEG) || (this->dmgPart == GRANGA_DMG_RIGHT_LEG)) { + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); + this->swork[GRANGA_SWK_23] = 200; - if (boss->dmgPart == 4) { - boss->swork[24] -= boss->damage; - boss->swork[7] = boss->swork[8] = boss->swork[9] = 5; - boss->swork[18] = 30; + if (this->dmgPart == GRANGA_DMG_LEFT_LEG) { + this->swork[GRANGA_LEFT_LEG_HP] -= this->damage; + this->swork[GRANGA_LEFT_LEG_DMG_IND] = this->swork[GRANGA_LEFT_LEG_DMG_IND + 1] = + this->swork[GRANGA_LEFT_LEG_DMG_IND + 2] = DMG_FLICKER_5; + this->swork[GRANGA_SWK_18] = 30; - if (boss->swork[24] <= 0) { - boss->swork[7] = boss->swork[8] = boss->swork[9] = 1000; - boss->info.hitbox[1 + 24] = 100000.0f; + if (this->swork[GRANGA_LEFT_LEG_HP] <= 0) { + this->swork[GRANGA_LEFT_LEG_DMG_IND] = this->swork[GRANGA_LEFT_LEG_DMG_IND + 1] = + this->swork[GRANGA_LEFT_LEG_DMG_IND + 2] = DMG_DESTROYED; + this->info.hitbox[1 + 24] = 100000.0f; - for (var_s1 = 3; var_s1 < 6; var_s1++) { - Boss_SpawnDebris(D_i1_8019B6D8[18 + var_s1 + 2], D_i1_8019B6D8[24 + var_s1 + 2], - D_i1_8019B6D8[30 + var_s1 + 2], D_i1_8019B6D8[36 + var_s1 + 2], - D_i1_8019B6D8[42 + var_s1 + 2], D_i1_8019B6D8[48 + var_s1 + 2], 0.0f, - RAND_FLOAT(20.0f), 0.0f, 5.5f, var_s1 + 28, RAND_INT(30.0f) + 60.0f); + for (i = 3; i < 6; i++) { + Boss_SpawnDebris(sCoGrangaWork[18 + i + 2], sCoGrangaWork[24 + i + 2], + sCoGrangaWork[30 + i + 2], sCoGrangaWork[36 + i + 2], + sCoGrangaWork[42 + i + 2], sCoGrangaWork[48 + i + 2], 0.0f, RAND_FLOAT(20.0f), + 0.0f, 5.5f, i + 28, RAND_INT(30.0f) + 60.0f); } - if (boss->state < 5) { - boss->state = 5; - boss->timer_050 = 60; + if (this->state < GRANGA_STATE_5) { + this->state = GRANGA_STATE_5; + this->timer_050 = 60; } } - } else { - boss->swork[25] -= boss->damage; - boss->swork[4] = boss->swork[5] = boss->swork[6] = 5; - boss->swork[19] = 30; + } else { // (this->dmgPart == GRANGA_DMG_RIGHT_LEG) + this->swork[GRANGA_RIGHT_LEG_HP] -= this->damage; + this->swork[GRANGA_RIGHT_LEG_DMG_IND] = this->swork[GRANGA_RIGHT_LEG_DMG_IND + 1] = + this->swork[GRANGA_RIGHT_LEG_DMG_IND + 2] = DMG_FLICKER_5; + this->swork[GRANGA_SWK_19] = 30; - if (boss->swork[25] <= 0) { - boss->swork[4] = boss->swork[5] = boss->swork[6] = 1000; - boss->info.hitbox[1 + 30] = 100000.0f; + if (this->swork[GRANGA_RIGHT_LEG_HP] <= 0) { + this->swork[GRANGA_RIGHT_LEG_DMG_IND] = this->swork[GRANGA_RIGHT_LEG_DMG_IND + 1] = + this->swork[GRANGA_RIGHT_LEG_DMG_IND + 2] = DMG_DESTROYED; + this->info.hitbox[1 + 30] = 100000.0f; - for (var_s1 = 0; var_s1 < 3; var_s1++) { - Boss_SpawnDebris(D_i1_8019B6D8[18 + var_s1 + 2], D_i1_8019B6D8[24 + var_s1 + 2], - D_i1_8019B6D8[30 + var_s1 + 2], D_i1_8019B6D8[36 + var_s1 + 2], - D_i1_8019B6D8[42 + var_s1 + 2], D_i1_8019B6D8[48 + var_s1 + 2], 0.0f, - RAND_FLOAT(20.0f), 0.0f, 5.5f, var_s1 + 28, RAND_INT(30.0f) + 60.0f); + for (i = 0; i < 3; i++) { + Boss_SpawnDebris(sCoGrangaWork[18 + i + 2], sCoGrangaWork[24 + i + 2], + sCoGrangaWork[30 + i + 2], sCoGrangaWork[36 + i + 2], + sCoGrangaWork[42 + i + 2], sCoGrangaWork[48 + i + 2], 0.0f, RAND_FLOAT(20.0f), + 0.0f, 5.5f, i + 28, RAND_INT(30.0f) + 60.0f); } - if (boss->state < 5) { - boss->state = 6; - boss->timer_050 = 60; + if (this->state < GRANGA_STATE_5) { + this->state = GRANGA_STATE_6; + this->timer_050 = 60; } } } - if (boss->timer_050 < 50) { - boss->timer_050 += 10; + if (this->timer_050 < 50) { + this->timer_050 += 10; } - if ((boss->state != 0) && (boss->state < 5)) { - boss->fwork[14] = 0.0f; + if ((this->state != GRANGA_STATIONARY) && (this->state < GRANGA_STATE_5)) { + this->fwork[GRANGA_FWK_14] = 0.0f; if (Rand_ZeroOne() < 0.5f) { item = OBJ_ITEM_SILVER_RING; } else { item = OBJ_ITEM_BOMB; } - Corneria_80187838(boss, boss->obj.pos.x, boss->obj.pos.y + 100.0f, boss->obj.pos.z, item); + Corneria_GrangaSpawnItem(this, this->obj.pos.x, this->obj.pos.y + 100.0f, this->obj.pos.z, item); } - if (boss->state < 5) { - boss->state = 0; + if (this->state < GRANGA_STATE_5) { + this->state = GRANGA_STATIONARY; switch (RAND_INT(5.0f)) { case 0: - boss->swork[31] = 2; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_2; break; case 1: - boss->swork[31] = 3; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_3; break; case 2: case 3: case 4: - boss->swork[31] = 4; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_4; break; } } } else { - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } } if (!(D_edisplay_801615D0.y < 0.0f)) { - for (sprite = gSprites, var_s1 = 0; var_s1 < ARRAY_COUNT(gSprites); var_s1++, sprite++) { - if ((sprite->obj.status == OBJ_ACTIVE) && (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { - if ((fabsf(sprite->obj.pos.x - D_i1_8019B6D8[20]) < 90.0f) && - (fabsf(sprite->obj.pos.z - D_i1_8019B6D8[32]) < 90.0f)) { - sprite->destroy = 1; + for (tree = &gSprites[0], i = 0; i < ARRAY_COUNT(gSprites); i++, tree++) { + if ((tree->obj.status == OBJ_ACTIVE) && (tree->obj.id == OBJ_SPRITE_CO_TREE)) { + if ((fabsf(tree->obj.pos.x - sCoGrangaWork[GRANGA_WORK_20]) < 90.0f) && + (fabsf(tree->obj.pos.z - sCoGrangaWork[GRANGA_WORK_32]) < 90.0f)) { + tree->destroy = 1; break; - } else if ((fabsf(sprite->obj.pos.x - D_i1_8019B6D8[23]) < 90.0f) && - (fabsf(sprite->obj.pos.z - D_i1_8019B6D8[35]) < 90.0f)) { - sprite->destroy = 1; + } else if ((fabsf(tree->obj.pos.x - sCoGrangaWork[GRANGA_WORK_23]) < 90.0f) && + (fabsf(tree->obj.pos.z - sCoGrangaWork[GRANGA_WORK_35]) < 90.0f)) { + tree->destroy = 1; break; } } } - if ((boss->swork[1] == 1000) && ((gGameFrameCount % 4) == 0)) { - func_effect_8007BFFC(D_i1_8019B6D8[3], D_i1_8019B6D8[4], D_i1_8019B6D8[5], - (D_i1_8019B6D8[3] - boss->obj.pos.x) * 0.1f, 0.0f, - (D_i1_8019B6D8[5] - boss->obj.pos.z) * 0.1f, 1.5f, 5); + if ((this->swork[GRANGA_RIGHT_ARM_DMG_IND] == DMG_DESTROYED) && ((gGameFrameCount % 4) == 0)) { + func_effect_8007BFFC(sCoGrangaWork[GRANGA_WORK_03], sCoGrangaWork[GRANGA_WORK_04], + sCoGrangaWork[GRANGA_WORK_05], + (sCoGrangaWork[GRANGA_WORK_03] - this->obj.pos.x) * 0.1f, 0.0f, + (sCoGrangaWork[GRANGA_WORK_05] - this->obj.pos.z) * 0.1f, 1.5f, 5); } - if ((boss->swork[2] == 1000) && ((gGameFrameCount % 4) == 0)) { - func_effect_8007BFFC(D_i1_8019B6D8[9], D_i1_8019B6D8[10], D_i1_8019B6D8[11], - (D_i1_8019B6D8[9] - boss->obj.pos.x) * 0.1f, 0.0f, - (D_i1_8019B6D8[11] - boss->obj.pos.z) * 0.1f, 1.5f, 5); + if ((this->swork[GRANGA_LEFT_ARM_DMG_IND] == DMG_DESTROYED) && ((gGameFrameCount % 4) == 0)) { + func_effect_8007BFFC(sCoGrangaWork[GRANGA_WORK_09], sCoGrangaWork[GRANGA_WORK_10], + sCoGrangaWork[GRANGA_WORK_11], + (sCoGrangaWork[GRANGA_WORK_09] - this->obj.pos.x) * 0.1f, 0.0f, + (sCoGrangaWork[GRANGA_WORK_11] - this->obj.pos.z) * 0.1f, 1.5f, 5); } - if ((boss->swork[3] == 1000) && ((gGameFrameCount % 4) == 0)) { - func_effect_8007BFFC(D_i1_8019B6D8[12], D_i1_8019B6D8[13], D_i1_8019B6D8[14], 0.0f, 20.0f, 0.0f, 2.0f, 5); + if ((this->swork[GRANGA_GUN_DMG_IND] == DMG_DESTROYED) && ((gGameFrameCount % 4) == 0)) { + func_effect_8007BFFC(sCoGrangaWork[GRANGA_WORK_12], sCoGrangaWork[GRANGA_WORK_13], + sCoGrangaWork[GRANGA_WORK_14], 0.0f, 20.0f, 0.0f, 2.0f, 5); } - if ((boss->swork[4] == 1000) && ((gGameFrameCount % 4) == 0)) { - func_effect_8007BFFC(D_i1_8019B6D8[56], D_i1_8019B6D8[57], D_i1_8019B6D8[58], 0.0f, 10.0f, 0.0f, 2.0f, 5); + if ((this->swork[GRANGA_RIGHT_LEG_DMG_IND] == DMG_DESTROYED) && ((gGameFrameCount % 4) == 0)) { + func_effect_8007BFFC(sCoGrangaWork[GRANGA_WORK_56], sCoGrangaWork[GRANGA_WORK_57], + sCoGrangaWork[GRANGA_WORK_58], 0.0f, 10.0f, 0.0f, 2.0f, 5); } - if ((boss->swork[7] == 1000) && ((gGameFrameCount % 4) == 0)) { - func_effect_8007BFFC(D_i1_8019B6D8[59], D_i1_8019B6D8[60], D_i1_8019B6D8[61], 0.0f, 10.0f, 0.0f, 2.0f, 5); + if ((this->swork[GRANGA_LEFT_LEG_DMG_IND] == DMG_DESTROYED) && ((gGameFrameCount % 4) == 0)) { + func_effect_8007BFFC(sCoGrangaWork[GRANGA_WORK_59], sCoGrangaWork[GRANGA_WORK_60], + sCoGrangaWork[GRANGA_WORK_61], 0.0f, 10.0f, 0.0f, 2.0f, 5); } } } -ObjectId Corneria_80188750(Boss* boss) { - boss->swork[35]++; - - if (boss->swork[35] >= 5) { - boss->swork[35] = 0; - return OBJ_ACTOR_191; - } else if (func_hud_8008AC54(0) < 4) { - return OBJ_ACTOR_190; +ObjectId Corneria_Granga_ChooseMissileTarget(Granga* this) { + this->swork[GRANGA_MISSILE_COUNT]++; + /* + * Spawn up to 5 missiles that seek the teammates + * before spawning one for the player. + */ + if (this->swork[GRANGA_MISSILE_COUNT] >= 5) { + this->swork[GRANGA_MISSILE_COUNT] = 0; + return OBJ_MISSILE_SEEK_PLAYER; + } else if (Hud_MissileSeekModeCheck(0) < 4) { + return OBJ_MISSILE_SEEK_TEAM; } else { return 0; } } -void Corneria_801887AC(Boss* boss) { - Vec3f sp3C; +void Corneria_Granga_Attack(Granga* this) { + Vec3f savedPlayerPos; ObjectId objId; - if ((gBossFrameCount < 500)) { + // Granga won't attack for 500 frames. + if (gBossFrameCount < 500) { return; } - switch (boss->swork[30]) { - case 0: + switch (this->swork[GRANGA_ATTACK_STATE]) { + case GRANGA_ATTACK_IDLE: break; - case 1: - objId = Corneria_80188750(boss); + case GRANGA_ATTACK_MISSILES: + objId = Corneria_Granga_ChooseMissileTarget(this); if (objId != 0) { - if (boss->swork[1] != 1000) { - Corneria_80187710(D_i1_8019B6D8[0], D_i1_8019B6D8[1], D_i1_8019B6D8[2], 65.0f, 0.0f, - D_i1_8019B6D8[16] + boss->obj.rot.y, 0, 0, objId); + if (this->swork[GRANGA_RIGHT_ARM_DMG_IND] != DMG_DESTROYED) { + Corneria_Boss_SpawnMissile(sCoGrangaWork[GRANGA_WORK_00], sCoGrangaWork[GRANGA_WORK_01], + sCoGrangaWork[GRANGA_WORK_02], 65.0f, 0.0f, + sCoGrangaWork[GRANGA_WORK_16] + this->obj.rot.y, 0, 0, objId); } - if (boss->swork[2] != 1000) { - Corneria_80187710(D_i1_8019B6D8[6], D_i1_8019B6D8[7], D_i1_8019B6D8[8], 65.0f, 0.0f, - D_i1_8019B6D8[16] + boss->obj.rot.y, 0, 0, objId); + if (this->swork[GRANGA_LEFT_ARM_DMG_IND] != DMG_DESTROYED) { + Corneria_Boss_SpawnMissile(sCoGrangaWork[GRANGA_WORK_06], sCoGrangaWork[GRANGA_WORK_07], + sCoGrangaWork[GRANGA_WORK_08], 65.0f, 0.0f, + sCoGrangaWork[GRANGA_WORK_16] + this->obj.rot.y, 0, 0, objId); } } - boss->swork[30] = 0; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_IDLE; break; - case 2: - Corneria_801877A0(boss, 40.0f, 228.0f, 212.0f); - Corneria_801877A0(boss, -40.0f, 228.0f, 212.0f); - boss->swork[30] = 0; + case GRANGA_ATTACK_LASERS: + Corneria_Granga_ShootLaser(this, 40.0f, 228.0f, 212.0f); + Corneria_Granga_ShootLaser(this, -40.0f, 228.0f, 212.0f); + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_IDLE; break; - case 3: - if (boss->swork[3] != 1000) { - sp3C.x = gPlayer[0].pos.x; - sp3C.y = gPlayer[0].pos.y; - sp3C.z = gPlayer[0].trueZpos; + case GRANGA_ATTACK_PLASMA: + if (this->swork[GRANGA_GUN_DMG_IND] != DMG_DESTROYED) { + savedPlayerPos.x = gPlayer[0].pos.x; + savedPlayerPos.y = gPlayer[0].pos.y; + savedPlayerPos.z = gPlayer[0].trueZpos; gPlayer[0].pos.x += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].pos.y += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].trueZpos += RAND_FLOAT_CENTERED(300.0f); - func_effect_8007F11C(OBJ_EFFECT_376, D_i1_8019B6D8[12], D_i1_8019B6D8[13], D_i1_8019B6D8[14], 60.0f); + Effect_EnemyLaser(OBJ_EFFECT_376, sCoGrangaWork[GRANGA_WORK_12], sCoGrangaWork[GRANGA_WORK_13], + sCoGrangaWork[GRANGA_WORK_14], 60.0f); - gPlayer[0].pos.x = sp3C.x; - gPlayer[0].pos.y = sp3C.y; - gPlayer[0].trueZpos = sp3C.z; + gPlayer[0].pos.x = savedPlayerPos.x; + gPlayer[0].pos.y = savedPlayerPos.y; + gPlayer[0].trueZpos = savedPlayerPos.z; } - boss->swork[30] = 0; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_IDLE; break; } } -void Corneria_80188A18(Boss* boss) { - if (boss->timer_050 == 0) { - boss->state = 0; - boss->timer_050 = RAND_INT(20.0f) + 20; - boss->fwork[14] = 0.0f; +void Corneria_Granga_DecideNextAction(Granga* this) { + if (this->timer_050 == 0) { + this->state = GRANGA_STATIONARY; + this->timer_050 = RAND_INT(20.0f) + 20; + this->fwork[GRANGA_FWK_14] = 0.0f; switch (RAND_INT(8.0f)) { case 0: case 1: - boss->swork[31] = 1; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_1; break; case 2: case 3: - boss->swork[31] = 2; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_2; break; case 4: if (D_edisplay_801615D0.y < 0.0f) { - boss->swork[31] = 4; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_4; } else { - boss->swork[31] = 3; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_3; } break; case 5: case 6: case 7: - boss->swork[31] = 4; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_4; break; } @@ -491,42 +517,42 @@ void Corneria_80188A18(Boss* boss) { } } -void Corneria_80188C7C(Boss* boss) { - if (boss->unk_044 == 0) { - boss->unk_044++; - boss->fwork[12] *= -0.2f; - AUDIO_PLAY_SFX(NA_SE_OB_METAL_BOUND_L, boss->sfxSource, 4); - func_enmy_80062B60(D_i1_8019B6D8[56], D_i1_8019B6D8[58], 0, 30.0f); - boss->swork[18] = 13; - boss->swork[19] = 15; - boss->swork[21] = 10; - boss->swork[22] = 12; - boss->swork[20] = 17; +void Corneria_80188C7C(Granga* this) { + if (this->unk_044 == 0) { + this->unk_044++; + this->fwork[GRANGA_FWK_12] *= -0.2f; + AUDIO_PLAY_SFX(NA_SE_OB_METAL_BOUND_L, this->sfxSource, 4); + func_enmy_80062B60(sCoGrangaWork[GRANGA_WORK_56], sCoGrangaWork[GRANGA_WORK_58], 0, 30.0f); + this->swork[GRANGA_SWK_18] = 13; + this->swork[GRANGA_SWK_19] = 15; + this->swork[GRANGA_SWK_21] = 10; + this->swork[GRANGA_SWK_22] = 12; + this->swork[GRANGA_SWK_20] = 17; gCameraShake = 20; } else { - boss->fwork[12] = 0.0f; + this->fwork[GRANGA_FWK_12] = 0.0f; } } -void Corneria_80188D50(Boss* boss) { - static s32 D_i1_801997E0 = 0; +void Corneria_Granga_1UpCheck(Granga* this) { + static s32 sCo1UpHitTimer = 0; s32 i; Vec3f src; Vec3f dest; - s32 rnd; + TeamId teamId; - if (boss->swork[36] == 0) { + if (!this->swork[GRANGA_1UP_CHECK]) { if (gPlayer[0].hitTimer != 0) { - D_i1_801997E0 = 80; + sCo1UpHitTimer = 80; } - if (D_i1_801997E0 != 0) { - D_i1_801997E0--; - } else if ((gPlayer[0].pos.y < 200.0f) && (boss->state < 5) && - (fabsf(boss->obj.pos.x - gPlayer[0].pos.x) < 200.0f) && - (fabsf(boss->obj.pos.z - gPlayer[0].trueZpos) < 200.0f) && (gPlayer[0].aerobaticPitch > 180.0f)) { - boss->swork[36]++; - D_i1_801997E0 = 20; + if (sCo1UpHitTimer != 0) { + sCo1UpHitTimer--; + } else if ((gPlayer[0].pos.y < 200.0f) && (this->state < GRANGA_STATE_5) && + (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 200.0f) && + (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 200.0f) && (gPlayer[0].aerobaticPitch > 180.0f)) { + this->swork[GRANGA_1UP_CHECK]++; + sCo1UpHitTimer = 20; AUDIO_PLAY_SFX(NA_SE_RING_PASS, gDefaultSfxSource, 4); @@ -535,17 +561,17 @@ void Corneria_80188D50(Boss* boss) { if (0) {}; do { - rnd = RAND_INT(2.9f) + 1; - } while (gTeamShields[rnd] <= 0); + teamId = RAND_INT(2.9f) + 1; + } while (gTeamShields[teamId] <= 0); - switch (rnd) { - case 1: + switch (teamId) { + case TEAM_ID_FALCO: Radio_PlayMessage(gMsg_ID_7100, RCID_FALCO); break; - case 2: + case TEAM_ID_SLIPPY: Radio_PlayMessage(gMsg_ID_15252, RCID_SLIPPY); break; - case 3: + case TEAM_ID_PEPPY: Radio_PlayMessage(gMsg_ID_17160, RCID_PEPPY); break; } @@ -579,7 +605,7 @@ void Corneria_80188D50(Boss* boss) { } } -void Corneria_80189058(Boss* boss) { +void Corneria_Granga_Update(Granga* this) { Vec3f sp21C = { 0.0f, 0.0f, 0.0f }; s32 sp218; f32 sp214; @@ -591,55 +617,56 @@ void Corneria_80189058(Boss* boss) { f32 sp1FC; f32 sp1F8; Vec3f sp1EC = { 0.0f, 0.0f, 5.0f }; - Vec3f sp84[30]; + Vec3f frameTable[30]; Vec3f sp78 = { 0.0f, 0.0f, 40.0f }; Vec3f sp6C = { 0.0f, 0.0f, -30.0f }; f32 sp5C; if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { - if (boss->swork[33] == 0) { - boss->swork[33]++; + if (!this->swork[GRANGA_INIT]) { + this->swork[GRANGA_INIT]++; + gBossActive = 2; - boss->drawShadow = true; + this->drawShadow = true; - boss->swork[24] = 150; - boss->swork[25] = 150; - boss->swork[26] = 40; - boss->swork[27] = 40; - boss->swork[28] = 40; - boss->swork[29] = 130; + this->swork[GRANGA_LEFT_LEG_HP] = 150; + this->swork[GRANGA_RIGHT_LEG_HP] = 150; + this->swork[GRANGA_LEFT_ARM_HP] = 40; + this->swork[GRANGA_RIGHT_ARM_HP] = 40; + this->swork[GRANGA_PLASMA_GUN_HP] = 40; + this->swork[GRANGA_BACKPACK_HP] = 130; - boss->info.hitbox[1 + 0] = -241.0f; - boss->info.hitbox[1 + 6] = 0.0f; - boss->info.hitbox[1 + 12] = 0.0f; - boss->info.hitbox[1 + 18] = 0.0f; - boss->info.hitbox[1 + 24] = 0.0f; - boss->info.hitbox[1 + 30] = 0.0f; + this->info.hitbox[1 + 0] = -241.0f; + this->info.hitbox[1 + 6] = 0.0f; + this->info.hitbox[1 + 12] = 0.0f; + this->info.hitbox[1 + 18] = 0.0f; + this->info.hitbox[1 + 24] = 0.0f; + this->info.hitbox[1 + 30] = 0.0f; - boss->timer_052 = 100; - boss->state = 0; - boss->swork[31] = 1; + this->timer_052 = 100; + this->state = GRANGA_STATIONARY; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_1; - D_i1_8019B6D8[66] = 0.0f; - D_i1_8019B6D8[67] = 10000.0f; + sCoGrangaWork[GRANGA_WORK_66] = 0.0f; + sCoGrangaWork[GRANGA_WORK_67] = 10000.0f; - boss->timer_050 = 30; + this->timer_050 = 30; - Animation_GetFrameData(&D_CO_602C0D0, 0, boss->vwork); + Animation_GetFrameData(&D_CO_602C0D0, 0, this->vwork); gBossFrameCount = 0; } gBossFrameCount++; + gRadarMarks[59].status = 1; gRadarMarks[59].type = 102; - gRadarMarks[59].pos.x = boss->obj.pos.x; - gRadarMarks[59].pos.y = boss->obj.pos.y; - gRadarMarks[59].pos.z = boss->obj.pos.z; + gRadarMarks[59].pos.x = this->obj.pos.x; + gRadarMarks[59].pos.y = this->obj.pos.y; + gRadarMarks[59].pos.z = this->obj.pos.z; + gRadarMarks[59].yRot = this->obj.rot.y + 180.0f; - gRadarMarks[59].yRot = boss->obj.rot.y + 180.0f; - - Corneria_80188D50(boss); + Corneria_Granga_1UpCheck(this); if (D_edisplay_801615D0.z > 0.0f) { if (D_edisplay_801615D0.x > 0.0f) { @@ -660,7 +687,7 @@ void Corneria_80189058(Boss* boss) { Radio_PlayMessage(gMsg_ID_2225, RCID_SLIPPY); break; case 486: - gShowBossHealth = 1; + gShowBossHealth = true; break; case 500: Radio_PlayMessage(gMsg_ID_2260, RCID_BOSS_CORNERIA); @@ -669,45 +696,50 @@ void Corneria_80189058(Boss* boss) { Radio_PlayMessage(gMsg_ID_2230, RCID_PEPPY); break; case 3840: - if (boss->state < 5) { + if (this->state < GRANGA_STATE_5) { Radio_PlayMessage(gMsg_ID_2230, RCID_PEPPY); } break; } if (gBossFrameCount >= 487) { - gBossHealthBar = boss->swork[29] * 2; + gBossHealthBar = this->swork[GRANGA_BACKPACK_HP] * 2; } - for (sp218 = 0; sp218 < 24; sp218++) { - if ((boss->swork[sp218] != 0) && (boss->swork[sp218] < 1000)) { - boss->swork[sp218]--; + for (sp218 = GRANGA_SWK_0; sp218 <= GRANGA_SWK_23; sp218++) { + if ((this->swork[sp218] != 0) && (this->swork[sp218] < DMG_DESTROYED)) { + this->swork[sp218]--; } } - Corneria_80187AC8(boss); + Corneria_Granga_HandleDamage(this); - boss->fwork[0] = SIN_DEG(boss->swork[18] * 50.0f) * Corneria_80187A88(boss->swork[18]); - boss->fwork[1] = SIN_DEG(boss->swork[19] * 50.0f) * Corneria_80187A88(boss->swork[19]); - boss->fwork[2] = SIN_DEG(boss->swork[20] * 50.0f) * Corneria_80187A88(boss->swork[20]); - boss->fwork[3] = SIN_DEG(boss->swork[21] * 50.0f) * Corneria_80187A88(boss->swork[21]); - boss->fwork[4] = SIN_DEG(boss->swork[22] * 50.0f) * Corneria_80187A88(boss->swork[22]); + this->fwork[GRANGA_FWK_00] = + SIN_DEG(this->swork[GRANGA_SWK_18] * 50.0f) * Corneria_80187A88(this->swork[GRANGA_SWK_18]); + this->fwork[GRANGA_FWK_01] = + SIN_DEG(this->swork[GRANGA_SWK_19] * 50.0f) * Corneria_80187A88(this->swork[GRANGA_SWK_19]); + this->fwork[GRANGA_FWK_02] = + SIN_DEG(this->swork[GRANGA_SWK_20] * 50.0f) * Corneria_80187A88(this->swork[GRANGA_SWK_20]); + this->fwork[GRANGA_FWK_03] = + SIN_DEG(this->swork[GRANGA_SWK_21] * 50.0f) * Corneria_80187A88(this->swork[GRANGA_SWK_21]); + this->fwork[GRANGA_FWK_04] = + SIN_DEG(this->swork[GRANGA_SWK_22] * 50.0f) * Corneria_80187A88(this->swork[GRANGA_SWK_22]); - if (boss->state < 5) { - sp5C = SIN_DEG(boss->swork[23] * 12.0f) * Corneria_80187A88(boss->swork[23]) * 0.3f; - Math_SmoothStepToF(&boss->obj.rot.z, sp5C, 0.2f, 100.0f, 0.001f); + if (this->state < GRANGA_STATE_5) { + sp5C = SIN_DEG(this->swork[GRANGA_SWK_23] * 12.0f) * Corneria_80187A88(this->swork[GRANGA_SWK_23]) * 0.3f; + Math_SmoothStepToF(&this->obj.rot.z, sp5C, 0.2f, 100.0f, 0.001f); } - if (boss->obj.pos.y <= 10.0f) { - boss->obj.pos.y = 10.0f; + if (this->obj.pos.y <= 10.0f) { + this->obj.pos.y = 10.0f; } - sp214 = D_i1_8019B6D8[17] - boss->obj.pos.x; - sp210 = D_i1_8019B6D8[18] - (boss->obj.pos.y + 300.0f); - sp20C = D_i1_8019B6D8[19] - boss->obj.pos.z; + sp214 = sCoGrangaWork[GRANGA_WORK_17] - this->obj.pos.x; + sp210 = sCoGrangaWork[GRANGA_WORK_18] - (this->obj.pos.y + 300.0f); + sp20C = sCoGrangaWork[GRANGA_WORK_19] - this->obj.pos.z; sp1FC = Math_RadToDeg(Math_Atan2F(sp214, sp20C)); - sp204 = sqrtf((sp214 * sp214) + (sp20C * sp20C)); + sp204 = sqrtf(SQ(sp214) + SQ(sp20C)); sp200 = Math_RadToDeg(-Math_Atan2F(sp210, sp204)); if ((sp200 > 50.0f) && (sp200 < 180.0f)) { @@ -717,7 +749,7 @@ void Corneria_80189058(Boss* boss) { sp200 = 310.0f; } - sp1FC -= boss->obj.rot.y; + sp1FC -= this->obj.rot.y; if (sp1FC > 360.0f) { sp1FC -= 360.0f; } @@ -731,170 +763,170 @@ void Corneria_80189058(Boss* boss) { sp1FC = 310.0f; } - Math_SmoothStepToAngle(&D_i1_8019B6D8[16], sp1FC, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&D_i1_8019B6D8[15], sp200, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&sCoGrangaWork[GRANGA_WORK_16], sp1FC, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&sCoGrangaWork[GRANGA_WORK_15], sp200, 0.1f, 3.0f, 0.0f); - if (boss->state != 0) { - sp1F8 = - Math_RadToDeg(Math_Atan2F(D_i1_8019B6D8[66] - boss->obj.pos.x, D_i1_8019B6D8[67] - boss->obj.pos.z)); - Math_SmoothStepToAngle(&boss->obj.rot.y, sp1F8, 0.1f, 3.0f, 0.0f); + if (this->state != GRANGA_STATIONARY) { + sp1F8 = Math_RadToDeg(Math_Atan2F(sCoGrangaWork[GRANGA_WORK_66] - this->obj.pos.x, + sCoGrangaWork[GRANGA_WORK_67] - this->obj.pos.z)); + Math_SmoothStepToAngle(&this->obj.rot.y, sp1F8, 0.1f, 3.0f, 0.0f); } - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0U); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); - switch (boss->state) { - case 0: - boss->unk_04C = 0; - D_i1_8019B6D8[17] = gPlayer[0].pos.x; - D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = gPlayer[0].trueZpos; + switch (this->state) { + case GRANGA_STATIONARY: + this->unk_04C = 0; + sCoGrangaWork[GRANGA_WORK_17] = gPlayer[0].pos.x; + sCoGrangaWork[GRANGA_WORK_18] = gPlayer[0].pos.y; + sCoGrangaWork[GRANGA_WORK_19] = gPlayer[0].trueZpos; - if (boss->timer_050 == 0) { - switch (boss->swork[31]) { - case 1: - boss->state = 1; - boss->timer_050 = RAND_INT(50.0f) + 50; - boss->fwork[14] = 0.0f; + if (this->timer_050 == 0) { + switch (this->swork[GRANGA_NEXT_STATE]) { + case GRANGA_STATE_1: + this->state = GRANGA_STATE_1; + this->timer_050 = RAND_INT(50.0f) + 50; + this->fwork[GRANGA_FWK_14] = 0.0f; break; - case 2: - boss->state = 2; - boss->timer_050 = RAND_INT(100.0f) + 150; - boss->timer_052 = 40; - boss->timer_054 = 40; - boss->fwork[14] = 0.07f; + case GRANGA_STATE_2: + this->state = GRANGA_STATE_2; + this->timer_050 = RAND_INT(100.0f) + 150; + this->timer_052 = 40; + this->timer_054 = 40; + this->fwork[GRANGA_FWK_14] = 0.07f; break; - case 4: - boss->state = 4; - boss->timer_050 = RAND_INT(70.0f) + 100; - boss->fwork[14] = 0.1f; - D_i1_8019B6D8[66] = RAND_FLOAT_CENTERED(6000.0f); - D_i1_8019B6D8[67] = RAND_FLOAT_CENTERED(6000.0f); - boss->fwork[14] = 0.07f; + case GRANGA_STATE_4: + this->state = GRANGA_STATE_4; + this->timer_050 = RAND_INT(70.0f) + 100; + this->fwork[GRANGA_FWK_14] = 0.1f; + sCoGrangaWork[GRANGA_WORK_66] = RAND_FLOAT_CENTERED(6000.0f); + sCoGrangaWork[GRANGA_WORK_67] = RAND_FLOAT_CENTERED(6000.0f); + this->fwork[GRANGA_FWK_14] = 0.07f; break; - case 3: - boss->state = 3; - boss->timer_050 = RAND_INT(100.0f) + 150; - boss->fwork[14] = 0.07f; + case GRANGA_STATE_3: + this->state = GRANGA_STATE_3; + this->timer_050 = RAND_INT(100.0f) + 150; + this->fwork[GRANGA_FWK_14] = 0.07f; break; } } - Animation_GetFrameData(&D_CO_602C0D0, boss->unk_04C, sp84); + Animation_GetFrameData(&D_CO_602C0D0, this->unk_04C, frameTable); - if (boss->timer_052 == 0) { - boss->timer_052 = 150; - boss->swork[30] = 1; + if (this->timer_052 == 0) { + this->timer_052 = 150; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_MISSILES; } break; - case 1: - D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; - D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].trueZpos; + case GRANGA_STATE_1: + sCoGrangaWork[GRANGA_WORK_17] = sCoGrangaWork[GRANGA_WORK_66] = gPlayer[0].pos.x; + sCoGrangaWork[GRANGA_WORK_18] = gPlayer[0].pos.y; + sCoGrangaWork[GRANGA_WORK_19] = sCoGrangaWork[GRANGA_WORK_67] = gPlayer[0].trueZpos; - boss->unk_04C += 2; - if (boss->unk_04C >= Animation_GetFrameCount(&D_CO_602BC18)) { - boss->unk_04C = 0; + this->unk_04C += 2; + if (this->unk_04C >= Animation_GetFrameCount(&D_CO_602BC18)) { + this->unk_04C = 0; } - Animation_GetFrameData(&D_CO_602BC18, boss->unk_04C, sp84); + Animation_GetFrameData(&D_CO_602BC18, this->unk_04C, frameTable); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp1EC, &sp21C); - if (boss->timer_052 == 0) { - boss->timer_052 = 150; - boss->swork[30] = 1; + if (this->timer_052 == 0) { + this->timer_052 = 150; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_MISSILES; } - Corneria_80188A18(boss); + Corneria_Granga_DecideNextAction(this); break; - case 2: - D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; - D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].trueZpos; + case GRANGA_STATE_2: + sCoGrangaWork[GRANGA_WORK_17] = sCoGrangaWork[GRANGA_WORK_66] = gPlayer[0].pos.x; + sCoGrangaWork[GRANGA_WORK_18] = gPlayer[0].pos.y; + sCoGrangaWork[GRANGA_WORK_19] = sCoGrangaWork[GRANGA_WORK_67] = gPlayer[0].trueZpos; - boss->unk_04C -= 4; - if (boss->unk_04C < 0) { - boss->unk_04C = 100; + this->unk_04C -= 4; + if (this->unk_04C < 0) { + this->unk_04C = 100; } - Animation_GetFrameData(&D_CO_602BC18, boss->unk_04C, sp84); + Animation_GetFrameData(&D_CO_602BC18, this->unk_04C, frameTable); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp6C, &sp21C); - if (boss->timer_052 == 0) { - boss->timer_052 = 30; - boss->swork[30] = 2; + if (this->timer_052 == 0) { + this->timer_052 = 30; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_LASERS; } - if (boss->timer_054 == 0) { - boss->timer_054 = 9; - boss->swork[30] = 3; + if (this->timer_054 == 0) { + this->timer_054 = 9; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_PLASMA; } - Corneria_80188A18(boss); + Corneria_Granga_DecideNextAction(this); break; - case 3: - D_i1_8019B6D8[17] = D_i1_8019B6D8[66] = gPlayer[0].pos.x; - D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = D_i1_8019B6D8[67] = gPlayer[0].trueZpos; + case GRANGA_STATE_3: + sCoGrangaWork[GRANGA_WORK_17] = sCoGrangaWork[GRANGA_WORK_66] = gPlayer[0].pos.x; + sCoGrangaWork[GRANGA_WORK_18] = gPlayer[0].pos.y; + sCoGrangaWork[GRANGA_WORK_19] = sCoGrangaWork[GRANGA_WORK_67] = gPlayer[0].trueZpos; - boss->unk_04C += 4; - if (boss->unk_04C > 100) { - boss->unk_04C = 0; + this->unk_04C += 4; + if (this->unk_04C > 100) { + this->unk_04C = 0; } - Animation_GetFrameData(&D_CO_602BC18, boss->unk_04C, sp84); + Animation_GetFrameData(&D_CO_602BC18, this->unk_04C, frameTable); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp21C); - if (boss->timer_052 == 0) { - boss->timer_052 = 30; - boss->swork[30] = 2; + if (this->timer_052 == 0) { + this->timer_052 = 30; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_LASERS; } - if (boss->timer_054 == 0) { - boss->timer_054 = 9; - boss->swork[30] = 3; + if (this->timer_054 == 0) { + this->timer_054 = 9; + this->swork[GRANGA_ATTACK_STATE] = GRANGA_ATTACK_PLASMA; } - Corneria_80188A18(boss); + Corneria_Granga_DecideNextAction(this); break; - case 4: - D_i1_8019B6D8[17] = gPlayer[0].pos.x; - D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = gPlayer[0].trueZpos; + case GRANGA_STATE_4: + sCoGrangaWork[GRANGA_WORK_17] = gPlayer[0].pos.x; + sCoGrangaWork[GRANGA_WORK_18] = gPlayer[0].pos.y; + sCoGrangaWork[GRANGA_WORK_19] = gPlayer[0].trueZpos; - boss->unk_04C += 4; - if (boss->unk_04C > 100) { - boss->unk_04C = 0; + this->unk_04C += 4; + if (this->unk_04C > 100) { + this->unk_04C = 0; } - Animation_GetFrameData(&D_CO_602BC18, boss->unk_04C, sp84); + Animation_GetFrameData(&D_CO_602BC18, this->unk_04C, frameTable); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp21C); - Corneria_80188A18(boss); + Corneria_Granga_DecideNextAction(this); break; - case 5: - case 6: - boss->drawShadow = false; + case GRANGA_STATE_5: + case GRANGA_STATE_6: + this->drawShadow = false; gGroundClipMode = 1; - if (((gGameFrameCount % 8) == 0)) { - D_i1_8019B6D8[17] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(2000.0f); - D_i1_8019B6D8[18] = gPlayer[0].pos.y; - D_i1_8019B6D8[19] = gPlayer[0].trueZpos + RAND_FLOAT_CENTERED(2000.0f); + if ((gGameFrameCount % 8) == 0) { + sCoGrangaWork[GRANGA_WORK_17] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(2000.0f); + sCoGrangaWork[GRANGA_WORK_18] = gPlayer[0].pos.y; + sCoGrangaWork[GRANGA_WORK_19] = gPlayer[0].trueZpos + RAND_FLOAT_CENTERED(2000.0f); } - boss->fwork[12] += 0.05f; + this->fwork[GRANGA_FWK_12] += 0.05f; - if (boss->state == 6) { - boss->obj.rot.z += boss->fwork[12]; - if (boss->obj.rot.z > 60.0f) { - boss->obj.rot.z = 60.0f; - Corneria_80188C7C(boss); + if (this->state == GRANGA_STATE_6) { + this->obj.rot.z += this->fwork[GRANGA_FWK_12]; + if (this->obj.rot.z > 60.0f) { + this->obj.rot.z = 60.0f; + Corneria_80188C7C(this); if ((gGameFrameCount % 512U) == 0) { Radio_PlayMessage(gMsg_ID_2275, RCID_BOSS_CORNERIA); @@ -904,12 +936,12 @@ void Corneria_80189058(Boss* boss) { Radio_PlayMessage(gMsg_ID_2220, RCID_BOSS_CORNERIA); } } - boss->obj.rot.x = boss->obj.rot.z; - } else { - boss->obj.rot.z -= boss->fwork[12]; - if (boss->obj.rot.z < -60.0f) { - boss->obj.rot.z = -60.0f; - Corneria_80188C7C(boss); + this->obj.rot.x = this->obj.rot.z; + } else { // (this->state == GRANGA_STATE_5) + this->obj.rot.z -= this->fwork[GRANGA_FWK_12]; + if (this->obj.rot.z < -60.0f) { + this->obj.rot.z = -60.0f; + Corneria_80188C7C(this); if ((gGameFrameCount % 512U) == 0) { Radio_PlayMessage(gMsg_ID_2275, RCID_BOSS_CORNERIA); @@ -918,209 +950,215 @@ void Corneria_80189058(Boss* boss) { Radio_PlayMessage(gMsg_ID_2220, RCID_BOSS_CORNERIA); } } - boss->obj.rot.x = -boss->obj.rot.z; + this->obj.rot.x = -this->obj.rot.z; } - if (boss->timer_050 == 0) { + if (this->timer_050 == 0) { ObjectId objId; - boss->timer_050 = 60; - objId = Corneria_80188750(boss); + this->timer_050 = 60; + objId = Corneria_Granga_ChooseMissileTarget(this); if (objId != 0) { - Corneria_80187710(D_i1_8019B6D8[62], D_i1_8019B6D8[63], D_i1_8019B6D8[64], 65.0f, 270.0f, 0.0f, - 0, 0, objId); + Corneria_Boss_SpawnMissile(sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[GRANGA_WORK_63], + sCoGrangaWork[GRANGA_WORK_64], 65.0f, 270.0f, 0.0f, 0, 0, objId); } } - boss->yOffset = SIN_DEG(boss->obj.rot.z) * 30.0f; + this->yOffset = SIN_DEG(this->obj.rot.z) * 30.0f; - if (((gGameFrameCount % 16) == 0)) { - boss->unk_04C = RAND_INT(100.0f); + if ((gGameFrameCount % 16) == 0) { + this->unk_04C = RAND_INT(100.0f); } - Animation_GetFrameData(&D_CO_602BC18, boss->unk_04C, sp84); - boss->fwork[14] = 0.03f; + Animation_GetFrameData(&D_CO_602BC18, this->unk_04C, frameTable); + this->fwork[GRANGA_FWK_14] = 0.03f; break; - case 7: - if (boss->swork[32] != 0) { - boss->fwork[12] += 0.05f; - boss->obj.rot.x += boss->fwork[12]; - if (boss->obj.rot.x > 60.0f) { - boss->obj.rot.x = 60.0f; - Corneria_80188C7C(boss); + case GRANGA_STATE_7: + if (this->swork[GRANGA_SWK_32]) { + this->fwork[GRANGA_FWK_12] += 0.05f; + this->obj.rot.x += this->fwork[GRANGA_FWK_12]; + if (this->obj.rot.x > 60.0f) { + this->obj.rot.x = 60.0f; + Corneria_80188C7C(this); } } - boss->swork[24] = boss->swork[25] = boss->swork[26] = boss->swork[27] = boss->swork[28] = 0; + this->swork[GRANGA_LEFT_LEG_HP] = this->swork[GRANGA_RIGHT_LEG_HP] = this->swork[GRANGA_LEFT_ARM_HP] = + this->swork[GRANGA_RIGHT_ARM_HP] = this->swork[GRANGA_PLASMA_GUN_HP] = 0; - if (boss->timer_050 == 12) { + if (this->timer_050 == 12) { Object_Kill(&gEffects[0].obj, gEffects[0].sfxSource); - func_effect_8007D0E0(D_i1_8019B6D8[62], D_i1_8019B6D8[63] - 100.0f, D_i1_8019B6D8[64], 25.0f); + func_effect_8007D0E0(sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[GRANGA_WORK_63] - 100.0f, + sCoGrangaWork[GRANGA_WORK_64], 25.0f); } - if (boss->timer_050 == 10) { + if (this->timer_050 == 10) { for (sp218 = 0; sp218 < 50; sp218++) { if (gEffects[sp218].obj.status != OBJ_FREE) { Object_Kill(&gEffects[sp218].obj, gEffects[sp218].sfxSource); } } - func_effect_8007A568(D_i1_8019B6D8[62], D_i1_8019B6D8[63] - 100.0f, D_i1_8019B6D8[64], 40.0f); - func_effect_8007D0E0(D_i1_8019B6D8[62], D_i1_8019B6D8[63] - 100.0f, D_i1_8019B6D8[64], 30.0f); - func_enmy_80062B60(D_i1_8019B6D8[62], D_i1_8019B6D8[64], 0, 120.0f); + func_effect_8007A568(sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[GRANGA_WORK_63] - 100.0f, + sCoGrangaWork[GRANGA_WORK_64], 40.0f); + func_effect_8007D0E0(sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[GRANGA_WORK_63] - 100.0f, + sCoGrangaWork[GRANGA_WORK_64], 30.0f); + func_enmy_80062B60(sCoGrangaWork[GRANGA_WORK_62], sCoGrangaWork[64], 0, 120.0f); gCameraShake = 25; gShowBossHealth = 0; for (sp218 = 0; sp218 < 100; sp218++) { - func_effect_80079618(D_i1_8019B6D8[62] + RAND_FLOAT_CENTERED(600.0f), - (D_i1_8019B6D8[63] + RAND_FLOAT_CENTERED(500.0f)) - 100.0f, - D_i1_8019B6D8[64] + RAND_FLOAT_CENTERED(600.0f), 2.0f); + func_effect_80079618(sCoGrangaWork[GRANGA_WORK_62] + RAND_FLOAT_CENTERED(600.0f), + (sCoGrangaWork[GRANGA_WORK_63] + RAND_FLOAT_CENTERED(500.0f)) - 100.0f, + sCoGrangaWork[GRANGA_WORK_64] + RAND_FLOAT_CENTERED(600.0f), 2.0f); } } - if (boss->timer_050 < 50) { - boss->dmgPart = boss->timer_050 % 8U; + if (this->timer_050 < 50) { + this->dmgPart = this->timer_050 % 8U; - switch (boss->dmgPart) { - case 1: - if (boss->swork[2] != 1000) { - boss->dmgType = DMG_BEAM; + switch (this->dmgPart) { + case GRANGA_DMG_LEFT_ARM: + if (this->swork[GRANGA_LEFT_ARM_DMG_IND] != DMG_DESTROYED) { + this->dmgType = DMG_BEAM; } break; - case 2: - if (boss->swork[1] != 1000) { - boss->dmgType = DMG_BEAM; + case GRANGA_DMG_RIGHT_ARM: + if (this->swork[GRANGA_RIGHT_ARM_DMG_IND] != DMG_DESTROYED) { + this->dmgType = DMG_BEAM; } - case 3: - if (boss->swork[3] != 1000) { - boss->dmgType = DMG_BEAM; + case GRANGA_DMG_GUN: + if (this->swork[GRANGA_GUN_DMG_IND] != DMG_DESTROYED) { + this->dmgType = DMG_BEAM; } break; - case 4: - if (boss->swork[7] != 1000) { - boss->dmgType = DMG_BEAM; + case GRANGA_DMG_LEFT_LEG: + if (this->swork[GRANGA_LEFT_LEG_DMG_IND] != DMG_DESTROYED) { + this->dmgType = DMG_BEAM; } - case 5: - if (boss->swork[4] != 1000) { - boss->dmgType = DMG_BEAM; + case GRANGA_DMG_RIGHT_LEG: + if (this->swork[GRANGA_RIGHT_LEG_DMG_IND] != DMG_DESTROYED) { + this->dmgType = DMG_BEAM; } break; } } - if (boss->timer_050 == 0) { - Object_Kill(&boss->obj, boss->sfxSource); + if (this->timer_050 == 0) { + Object_Kill(&this->obj, this->sfxSource); } - Animation_GetFrameData(&D_CO_602BC18, 0, sp84); + Animation_GetFrameData(&D_CO_602BC18, 0, frameTable); break; default: - Animation_GetFrameData(&D_CO_602C0D0, boss->unk_04C, sp84); + Animation_GetFrameData(&D_CO_602C0D0, this->unk_04C, frameTable); break; } - Math_SmoothStepToF(&boss->vel.x, sp21C.x, 0.3f, 5.0f, 0.0f); - Math_SmoothStepToF(&boss->vel.z, sp21C.z, 0.3f, 5.0f, 0.0f); + Math_SmoothStepToF(&this->vel.x, sp21C.x, 0.3f, 5.0f, 0.0f); + Math_SmoothStepToF(&this->vel.z, sp21C.z, 0.3f, 5.0f, 0.0f); - Corneria_801887AC(boss); + Corneria_Granga_Attack(this); - Math_SmoothStepToVec3fArray(sp84, boss->vwork, 1, 19, boss->fwork[14], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[14], 1.0f, 1.0f, 0.01f, 0.0f); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, 19, this->fwork[GRANGA_FWK_14], 100.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[GRANGA_FWK_14], 1.0f, 1.0f, 0.01f, 0.0f); - if (boss->state < 5) { - if (((fabsf(boss->obj.pos.x) > 4000.0f) || (fabsf(boss->obj.pos.z) > 4000.0f)) && (boss->state != 4)) { - boss->state = 4; - boss->timer_050 = 150; - D_i1_8019B6D8[66] = 0.0f; - D_i1_8019B6D8[67] = 0.0f; - boss->swork[31] = 0; + if (this->state < GRANGA_STATE_5) { + if (((fabsf(this->obj.pos.x) > 4000.0f) || (fabsf(this->obj.pos.z) > 4000.0f)) && + (this->state != GRANGA_STATE_4)) { + this->state = GRANGA_STATE_4; + this->timer_050 = 150; + sCoGrangaWork[GRANGA_WORK_66] = 0.0f; + sCoGrangaWork[GRANGA_WORK_67] = 0.0f; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATIONARY; } - if ((boss->state != 0) && ((boss->unk_04C == 0) || (boss->unk_04C == 52))) { - AUDIO_PLAY_SFX(NA_SE_EN_HEAVY_WALK, boss->sfxSource, 4); + if ((this->state != GRANGA_STATIONARY) && ((this->unk_04C == 0) || (this->unk_04C == 52))) { + AUDIO_PLAY_SFX(NA_SE_EN_HEAVY_WALK, this->sfxSource, 4); } - if (gPlayer[0].somersault && (boss->state != 0)) { - boss->state = 0; - boss->swork[31] = 1; - boss->timer_050 = 100; - boss->fwork[14] = 0.0f; + if (gPlayer[0].somersault && (this->state != GRANGA_STATIONARY)) { + this->state = GRANGA_STATIONARY; + this->swork[GRANGA_NEXT_STATE] = GRANGA_STATE_1; + this->timer_050 = 100; + this->fwork[GRANGA_FWK_14] = 0.0f; } } } } -bool Corneria_8018A434(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Boss* boss = (Boss*) data; +bool Corneria_Granga_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + Granga* boss = (Granga*) data; - if (boss->swork[limbIndex] == 1000) { - *dList = 0; + if (boss->swork[limbIndex] == DMG_DESTROYED) { + *dList = NULL; } RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, 1001); switch (limbIndex) { case 6: - rot->x += boss->fwork[1]; - rot->y += boss->fwork[1]; - rot->y -= boss->fwork[13] * 0.6f; + rot->x += boss->fwork[GRANGA_FWK_01]; + rot->y += boss->fwork[GRANGA_FWK_01]; + rot->y -= boss->fwork[GRANGA_FWK_13] * 0.6f; break; case 5: - rot->x -= boss->fwork[1]; - rot->y -= boss->fwork[1]; - rot->z += boss->fwork[1]; + rot->x -= boss->fwork[GRANGA_FWK_01]; + rot->y -= boss->fwork[GRANGA_FWK_01]; + rot->z += boss->fwork[GRANGA_FWK_01]; break; case 4: - rot->x += boss->fwork[1]; - rot->y += boss->fwork[1]; - rot->z -= boss->fwork[1]; + rot->x += boss->fwork[GRANGA_FWK_01]; + rot->y += boss->fwork[GRANGA_FWK_01]; + rot->z -= boss->fwork[GRANGA_FWK_01]; break; case 9: - rot->x -= boss->fwork[0]; - rot->y -= boss->fwork[0]; - rot->y += boss->fwork[13]; + rot->x -= boss->fwork[GRANGA_FWK_00]; + rot->y -= boss->fwork[GRANGA_FWK_00]; + rot->y += boss->fwork[GRANGA_FWK_13]; break; case 8: - rot->x += boss->fwork[0]; - rot->y += boss->fwork[0]; - rot->z -= boss->fwork[0]; + rot->x += boss->fwork[GRANGA_FWK_00]; + rot->y += boss->fwork[GRANGA_FWK_00]; + rot->z -= boss->fwork[GRANGA_FWK_00]; break; case 7: - rot->x -= boss->fwork[0]; - rot->y -= boss->fwork[0]; - rot->z += boss->fwork[0]; + rot->x -= boss->fwork[GRANGA_FWK_00]; + rot->y -= boss->fwork[GRANGA_FWK_00]; + rot->z += boss->fwork[GRANGA_FWK_00]; break; case 3: - rot->x += boss->fwork[2]; - rot->y += boss->fwork[2]; - rot->z += D_i1_8019B6D8[15]; + rot->x += boss->fwork[GRANGA_FWK_02]; + rot->y += boss->fwork[GRANGA_FWK_02]; + rot->z += sCoGrangaWork[GRANGA_WORK_15]; break; case 1: - rot->x += boss->fwork[4] - D_i1_8019B6D8[15]; - rot->y += boss->fwork[4]; + rot->x += boss->fwork[GRANGA_FWK_04] - sCoGrangaWork[GRANGA_WORK_15]; + rot->y += boss->fwork[GRANGA_FWK_04]; break; case 2: - rot->x += boss->fwork[3] + D_i1_8019B6D8[15]; - rot->y += boss->fwork[3]; + rot->x += boss->fwork[GRANGA_FWK_03] + sCoGrangaWork[GRANGA_WORK_15]; + rot->y += boss->fwork[GRANGA_FWK_03]; break; case 16: - rot->x += D_i1_8019B6D8[16]; + rot->x += sCoGrangaWork[GRANGA_WORK_16]; break; } + // Damage indicator if (((boss->swork[limbIndex] % 2) != 0) || ((boss->timer_05C % 2) != 0)) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 64, 64, 255, 255); @@ -1128,7 +1166,7 @@ bool Corneria_8018A434(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Corneria_8018A730(s32 limbIndex, Vec3f* rot, void* data) { +void Corneria_Granga_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { s32 pad; Vec3f sp80 = { 0.0f, 0.0f, 0.0f }; Vec3f sp74; @@ -1142,63 +1180,63 @@ void Corneria_8018A730(s32 limbIndex, Vec3f* rot, void* data) { if ((limbIndex >= 4) && (limbIndex < 10)) { Matrix_MultVec3f(gCalcMatrix, &sp80, &sp74); - D_i1_8019B6D8[limbIndex + 16] = sp74.x; - D_i1_8019B6D8[limbIndex + 22] = sp74.y; - D_i1_8019B6D8[limbIndex + 28] = sp74.z; + sCoGrangaWork[limbIndex + 16] = sp74.x; + sCoGrangaWork[limbIndex + 22] = sp74.y; + sCoGrangaWork[limbIndex + 28] = sp74.z; Matrix_GetYRPAngles(gCalcMatrix, &sp74); - D_i1_8019B6D8[limbIndex + 34] = sp74.x; - D_i1_8019B6D8[limbIndex + 40] = sp74.y; - D_i1_8019B6D8[limbIndex + 46] = sp74.z; + sCoGrangaWork[limbIndex + 34] = sp74.x; + sCoGrangaWork[limbIndex + 40] = sp74.y; + sCoGrangaWork[limbIndex + 46] = sp74.z; } switch (limbIndex) { case 1: Matrix_MultVec3f(gCalcMatrix, &sp68, &sp74); - D_i1_8019B6D8[3] = sp74.x; - D_i1_8019B6D8[4] = sp74.y; - D_i1_8019B6D8[5] = sp74.z; + sCoGrangaWork[GRANGA_WORK_03] = sp74.x; + sCoGrangaWork[GRANGA_WORK_04] = sp74.y; + sCoGrangaWork[GRANGA_WORK_05] = sp74.z; Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp74); - D_i1_8019B6D8[0] = sp74.x; - D_i1_8019B6D8[1] = sp74.y; - D_i1_8019B6D8[2] = sp74.z; + sCoGrangaWork[GRANGA_WORK_00] = sp74.x; + sCoGrangaWork[GRANGA_WORK_01] = sp74.y; + sCoGrangaWork[GRANGA_WORK_02] = sp74.z; break; case 2: Matrix_MultVec3f(gCalcMatrix, &sp68, &sp74); - D_i1_8019B6D8[9] = sp74.x; - D_i1_8019B6D8[10] = sp74.y; - D_i1_8019B6D8[11] = sp74.z; + sCoGrangaWork[GRANGA_WORK_09] = sp74.x; + sCoGrangaWork[GRANGA_WORK_10] = sp74.y; + sCoGrangaWork[GRANGA_WORK_11] = sp74.z; Matrix_MultVec3f(gCalcMatrix, &sp5C, &sp74); - D_i1_8019B6D8[6] = sp74.x; - D_i1_8019B6D8[7] = sp74.y; - D_i1_8019B6D8[8] = sp74.z; + sCoGrangaWork[GRANGA_WORK_06] = sp74.x; + sCoGrangaWork[GRANGA_WORK_07] = sp74.y; + sCoGrangaWork[GRANGA_WORK_08] = sp74.z; break; case 3: Matrix_MultVec3f(gCalcMatrix, &sp50, &sp74); - D_i1_8019B6D8[12] = sp74.x; - D_i1_8019B6D8[13] = sp74.y; - D_i1_8019B6D8[14] = sp74.z; + sCoGrangaWork[GRANGA_WORK_12] = sp74.x; + sCoGrangaWork[GRANGA_WORK_13] = sp74.y; + sCoGrangaWork[GRANGA_WORK_14] = sp74.z; break; case 17: Matrix_MultVec3f(gCalcMatrix, &sp44, &sp74); - D_i1_8019B6D8[56] = sp74.x; - D_i1_8019B6D8[57] = sp74.y; - D_i1_8019B6D8[58] = sp74.z; + sCoGrangaWork[GRANGA_WORK_56] = sp74.x; + sCoGrangaWork[GRANGA_WORK_57] = sp74.y; + sCoGrangaWork[GRANGA_WORK_58] = sp74.z; Matrix_MultVec3f(gCalcMatrix, &sp38, &sp74); - D_i1_8019B6D8[59] = sp74.x; - D_i1_8019B6D8[60] = sp74.y; - D_i1_8019B6D8[61] = sp74.z; + sCoGrangaWork[GRANGA_WORK_59] = sp74.x; + sCoGrangaWork[GRANGA_WORK_60] = sp74.y; + sCoGrangaWork[GRANGA_WORK_61] = sp74.z; break; case 10: Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp74); - D_i1_8019B6D8[62] = sp74.x; - D_i1_8019B6D8[63] = sp74.y; - D_i1_8019B6D8[64] = sp74.z; + sCoGrangaWork[GRANGA_WORK_62] = sp74.x; + sCoGrangaWork[GRANGA_WORK_63] = sp74.y; + sCoGrangaWork[GRANGA_WORK_64] = sp74.z; break; default: @@ -1206,355 +1244,357 @@ void Corneria_8018A730(s32 limbIndex, Vec3f* rot, void* data) { } } -void Corneria_8018AA74(Boss* boss) { +void Corneria_Granga_Draw(Granga* this) { Matrix_Translate(gCalcMatrix, 0.0f, 700.0f, 0.0f, MTXF_APPLY); - Animation_DrawSkeleton(2, D_CO_602BE64, boss->vwork, Corneria_8018A434, Corneria_8018A730, boss, gCalcMatrix); + Animation_DrawSkeleton(2, D_CO_602BE64, this->vwork, Corneria_Granga_OverrideLimbDraw, Corneria_Granga_PostLimbDraw, + this, gCalcMatrix); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); } -bool Corneria_8018AB08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_Garuda_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; if (limbIndex == 1) { - rot->x += actor->fwork[1]; + rot->x += actor->fwork[GRANGA_FWK_01]; } - if ((limbIndex == 3) && (actor->obj.id == OBJ_ACTOR_176)) { - rot->x += actor->fwork[1]; + if ((limbIndex == 3) && (actor->obj.id == OBJ_ACTOR_CO_GARUDA_1)) { + rot->x += actor->fwork[GRANGA_FWK_01]; } return false; } -s32 Corneria_8018AB64(Actor* actor) { +s32 Corneria_Garuda_CheckCollision(CoGaruda1* this) { s32 pad[2]; s32 i; - s32 temp_v0; - Vec3f sp7C; - Vec3f sp70 = { 0.0f, -10.0f, 0.0f }; - f32 sp60[4] = { 130.0f, -130.0f, 0.0f, 0.0f }; - f32 sp50[4] = { 0.0f, 0.0f, 130.0f, -130.0f }; + s32 collision; + Vec3f pos; + Vec3f vel = { 0.0f, -10.0f, 0.0f }; + f32 xPos[4] = { 130.0f, -130.0f, 0.0f, 0.0f }; + f32 zPos[4] = { 0.0f, 0.0f, 130.0f, -130.0f }; for (i = 0; i < 4; i++) { - sp7C.x = sp60[i] + actor->obj.pos.x; - sp7C.y = actor->obj.pos.y; - sp7C.z = sp50[i] + actor->obj.pos.z; + pos.x = xPos[i] + this->obj.pos.x; + pos.y = this->obj.pos.y; + pos.z = zPos[i] + this->obj.pos.z; - temp_v0 = Object_CheckCollision(actor->index, &sp7C, &sp70, 1); - if ((temp_v0 != 0) && (temp_v0 >= 10)) { - if ((gScenery[temp_v0 - 10].obj.status == OBJ_ACTIVE) && - (gScenery[temp_v0 - 10].obj.id == OBJ_SCENERY_40)) { - return temp_v0 - 9; + collision = Object_CheckCollision(this->index, &pos, &vel, 1); + if ((collision != 0) && (collision >= 10)) { + if ((gScenery[collision - 10].obj.status == OBJ_ACTIVE) && + (gScenery[collision - 10].obj.id == OBJ_SCENERY_CO_BUILDING_9)) { + return collision - 9; } } } return 0; } -void Corneria_8018ACE0(Actor* actor) { - if (actor->dmgType != DMG_NONE) { - actor->dmgType = DMG_NONE; +void Corneria_Garuda_HandleDamage(Actor* this) { + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; - if (actor->dmgPart == 0) { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, actor->sfxSource, 4); - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 200.0f, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, 0.1f, 20); - actor->timer_0C6 = 15; - actor->health -= actor->damage; + if (this->dmgPart == 0) { + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y + 200.0f, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.1f, 20); + this->timer_0C6 = 15; + this->health -= this->damage; - if (actor->health <= 0) { - actor->obj.id = OBJ_ACTOR_179; - Object_SetInfo(&actor->info, actor->obj.id); - actor->state = 100; - actor->timer_0BC = 10; - actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->vel.x = actor->vel.y = actor->vel.z = 0.0f; + if (this->health <= 0) { + this->obj.id = OBJ_ACTOR_CO_GARUDA_DESTROY; + Object_SetInfo(&this->info, this->obj.id); + this->state = 100; + this->timer_0BC = 10; + this->lockOnTimers[TEAM_ID_FOX] = 0; + this->vel.x = this->vel.y = this->vel.z = 0.0f; } } } - if ((actor->health < 11) && ((gGameFrameCount % 4) == 0)) { - func_effect_8007D2C8(actor->obj.pos.x + RAND_FLOAT_CENTERED(100.0f), - actor->obj.pos.y + 200.0f + RAND_FLOAT_CENTERED(100.0f), - actor->obj.pos.z + 50.0f + RAND_FLOAT(50.0f), 3.0f); - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 200.0f, actor->obj.pos.z, actor->vel.x, actor->vel.y, - actor->vel.z, 0.1f, 10); + if ((this->health < 11) && ((gGameFrameCount % 4) == 0)) { + func_effect_8007D2C8(this->obj.pos.x + RAND_FLOAT_CENTERED(100.0f), + this->obj.pos.y + 200.0f + RAND_FLOAT_CENTERED(100.0f), + this->obj.pos.z + 50.0f + RAND_FLOAT(50.0f), 3.0f); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y + 200.0f, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.1f, 10); } } -void Corneria_8018AED0(Actor* actor) { - Vec3f sp40[20]; - f32 temp_sin; - f32 temp_cos; +void Corneria_CoGaruda1_Update(CoGaruda1* this) { + Vec3f frameTable[20]; + f32 sin; + f32 cos; - Corneria_8018ACE0(actor); + Corneria_Garuda_HandleDamage(this); - Math_SmoothStepToVec3fArray(sp40, actor->vwork, 0, Animation_GetFrameData(&D_CO_602991C, actor->animFrame, sp40), - 1.0f, 1.0f, 1.0f); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 0, + Animation_GetFrameData(&aCoGaruda1Anim, this->animFrame, frameTable), 1.0f, 1.0f, 1.0f); - temp_sin = SIN_DEG(actor->obj.rot.y); - actor->vel.x = actor->fwork[0] * temp_sin; - temp_cos = COS_DEG(actor->obj.rot.y); - actor->vel.z = actor->fwork[0] * temp_cos; + sin = SIN_DEG(this->obj.rot.y); + this->vel.x = this->fwork[0] * sin; + cos = COS_DEG(this->obj.rot.y); + this->vel.z = this->fwork[0] * cos; - switch (actor->state) { + switch (this->state) { case 0: - actor->fwork[1] += 20.0f; + this->fwork[1] += 20.0f; Texture_Scroll(D_CO_60329C0, 16, 16, 1); - actor->animFrame = 0; + this->animFrame = 0; - actor->fwork[0] += 1.0f; - if (actor->fwork[0] > 10.0f) { - actor->fwork[0] = 10.0f; + this->fwork[0] += 1.0f; + if (this->fwork[0] > 10.0f) { + this->fwork[0] = 10.0f; } - actor->iwork[0] = Corneria_8018AB64(actor); - if (actor->iwork[0] != 0) { - actor->state++; + this->iwork[0] = Corneria_Garuda_CheckCollision(this); + if (this->iwork[0] != 0) { + this->state++; } break; case 1: - actor->animFrame++; - actor->fwork[1] += 20.0f; - actor->fwork[0] = 0.0f; + this->animFrame++; + this->fwork[1] += 20.0f; + this->fwork[0] = 0.0f; - if (actor->animFrame == 50) { - gScenery[actor->iwork[0] - 1].state = 1; + if (this->animFrame == 50) { + gScenery[this->iwork[0] - 1].state = 1; } - if (actor->animFrame >= Animation_GetFrameCount(&D_CO_602991C)) { - actor->state++; + if (this->animFrame >= Animation_GetFrameCount(&aCoGaruda1Anim)) { + this->state++; } break; case 2: - actor->animFrame = 0; - actor->fwork[1] += 20.0f; + this->animFrame = 0; + this->fwork[1] += 20.0f; break; } } -void Corneria_8018B0B4(Actor* actor) { +void Corneria_IBeam_Init(Actor* this) { s32 i; for (i = 0; i < ARRAY_COUNT(gScenery); i++) { if (gScenery[i].obj.status == OBJ_FREE) { Scenery_Initialize(&gScenery[i]); gScenery[i].obj.status = OBJ_INIT; - gScenery[i].obj.id = OBJ_SCENERY_42; - gScenery[i].obj.pos.x = actor->obj.pos.x; - gScenery[i].obj.pos.y = actor->obj.pos.y; - gScenery[i].obj.pos.z = actor->obj.pos.z; - gScenery[i].obj.rot.y = actor->obj.rot.y; + gScenery[i].obj.id = OBJ_SCENERY_IBEAM; + gScenery[i].obj.pos.x = this->obj.pos.x; + gScenery[i].obj.pos.y = this->obj.pos.y; + gScenery[i].obj.pos.z = this->obj.pos.z; + gScenery[i].obj.rot.y = this->obj.rot.y; Object_SetInfo(&gScenery[i].info, gScenery[i].obj.id); - actor->iwork[0] = i; - return; + this->iwork[0] = i; + break; } } } -void Corneria_8018B15C(Actor* actor) { - Vec3f sp60[20]; - Vec3f sp54; - Vec3f sp48; +void Corneria_CoGaruda2_Update(CoGaruda2* this) { + Vec3f frameTable[20]; + Vec3f src; + Vec3f dest; Scenery* scenery; - f32 temp_sin; - f32 temp_cos; + f32 sin; + f32 cos; - Corneria_8018ACE0(actor); + Corneria_Garuda_HandleDamage(this); - scenery = &gScenery[actor->iwork[0]]; + scenery = &gScenery[this->iwork[0]]; - temp_sin = SIN_DEG(actor->obj.rot.y); - actor->vel.x = actor->fwork[0] * temp_sin; - temp_cos = COS_DEG(actor->obj.rot.y); - actor->vel.z = actor->fwork[0] * temp_cos; + sin = SIN_DEG(this->obj.rot.y); + this->vel.x = this->fwork[0] * sin; + cos = COS_DEG(this->obj.rot.y); + this->vel.z = this->fwork[0] * cos; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - - switch (actor->state) { - case 3: - break; + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + switch (this->state) { case 0: - actor->timer_0BC = 40; - actor->state = 1; - actor->animFrame = 0; + this->timer_0BC = 40; + this->state = 1; + this->animFrame = 0; break; case 1: - actor->fwork[0] = -10.0f; + this->fwork[0] = -10.0f; Texture_Scroll(D_CO_60329C0, 16, 16, 1); - if (actor->timer_0BC == 0) { - actor->state = 2; - actor->iwork[2] = RAND_INT(10.0f) + 10; + if (this->timer_0BC == 0) { + this->state = 2; + this->iwork[2] = RAND_INT(10.0f) + 10; } break; case 2: - actor->fwork[0] = -10.0f; + this->fwork[0] = -10.0f; Texture_Scroll(D_CO_60329C0, 16, 16, 1); - actor->animFrame++; + this->animFrame++; - if (actor->animFrame >= Animation_GetFrameCount(&D_CO_602AA04)) { - actor->state = 3; + if (this->animFrame >= Animation_GetFrameCount(&D_CO_602AA04)) { + this->state = 3; } - if (actor->animFrame == (Animation_GetFrameCount(&D_CO_602AA04) - actor->iwork[2])) { - actor->iwork[1] = 1; + if (this->animFrame == (Animation_GetFrameCount(&D_CO_602AA04) - this->iwork[2])) { + this->iwork[1] = 1; scenery->state = 1; - sp54.x = 0.0f; - sp54.y = 0.0f; - sp54.z = 30.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - scenery->vel.x = sp48.x; - scenery->vel.y = sp48.y; - scenery->vel.z = sp48.z; - AUDIO_PLAY_SFX(NA_SE_EN_THROW, actor->sfxSource, 4); + src.x = 0.0f; + src.y = 0.0f; + src.z = 30.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + scenery->vel.x = dest.x; + scenery->vel.y = dest.y; + scenery->vel.z = dest.z; + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); } break; + + case 3: + break; } - if (actor->iwork[1] == 0) { - scenery->obj.pos.x = actor->fwork[2]; - scenery->obj.pos.y = actor->fwork[6]; - scenery->obj.pos.z = actor->fwork[10]; - scenery->obj.rot.y = actor->obj.rot.y; + if (this->iwork[1] == 0) { + scenery->obj.pos.x = this->fwork[2]; + scenery->obj.pos.y = this->fwork[6]; + scenery->obj.pos.z = this->fwork[10]; + scenery->obj.rot.y = this->obj.rot.y; scenery->vel.y = 0.0f; } - Math_SmoothStepToVec3fArray(sp60, actor->vwork, 0, Animation_GetFrameData(&D_CO_602AA04, actor->animFrame, sp60), - 1.0f, 1.0f, 1.0f); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 0, + Animation_GetFrameData(&D_CO_602AA04, this->animFrame, frameTable), 1.0f, 1.0f, 1.0f); } -void Corneria_8018B418(Actor* actor) { +void Corneria_CoGaruda3_Update(CoGaruda3* this) { s32 pad; - Vec3f sp54[20]; - Scenery* temp_v0_2; - f32 temp_sin; - f32 temp_cos; + Vec3f frameTable[20]; + Scenery* scenery; + f32 sin; + f32 cos; s32 pad2[4]; - Corneria_8018ACE0(actor); + Corneria_Garuda_HandleDamage(this); - temp_sin = SIN_DEG(actor->obj.rot.y); - actor->vel.x = actor->fwork[0] * temp_sin; - temp_cos = COS_DEG(actor->obj.rot.y); - actor->vel.z = actor->fwork[0] * temp_cos; + sin = SIN_DEG(this->obj.rot.y); + this->vel.x = this->fwork[0] * sin; + cos = COS_DEG(this->obj.rot.y); + this->vel.z = this->fwork[0] * cos; - switch (actor->state) { + switch (this->state) { case 0: - actor->state = 1; + this->state = 1; break; case 1: - actor->fwork[0] = 5.0f; - actor->fwork[1] += 5.0f; + this->fwork[0] = 5.0f; + this->fwork[1] += 5.0f; Texture_Scroll(D_CO_60329C0, 16, 16, 1); - actor->animFrame++; - if (actor->animFrame >= Animation_GetFrameCount(&D_CO_602A520)) { - actor->animFrame = 0; + this->animFrame++; + if (this->animFrame >= Animation_GetFrameCount(&aCoGaruda3Anim)) { + this->animFrame = 0; } break; } - if (actor->iwork[1] == 0) { - temp_v0_2 = &gScenery[actor->iwork[0]]; - temp_v0_2->obj.pos.x = actor->fwork[2]; - temp_v0_2->obj.pos.y = actor->fwork[6]; - temp_v0_2->obj.pos.z = actor->fwork[10]; - temp_v0_2->obj.rot.y = actor->fwork[1]; - temp_v0_2->vel.y = 0.0f; + if (this->iwork[1] == 0) { + scenery = &gScenery[this->iwork[0]]; + scenery->obj.pos.x = this->fwork[2]; + scenery->obj.pos.y = this->fwork[6]; + scenery->obj.pos.z = this->fwork[10]; + scenery->obj.rot.y = this->fwork[1]; + scenery->vel.y = 0.0f; } - Math_SmoothStepToVec3fArray(sp54, actor->vwork, 0, Animation_GetFrameData(&D_CO_602A520, actor->animFrame, sp54), - 1.0f, 1.0f, 1.0f); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 0, + Animation_GetFrameData(&aCoGaruda3Anim, this->animFrame, frameTable), 1.0f, 1.0f, 1.0f); } -void Corneria_8018B58C(Actor* actor) { +void Corneria_CoGarudaDestroy_Update(CoGarudaDestroy* this) { s32 i; f32 spB4[4] = { -10.0f, -5.0f, 10.0f, 5.0f }; f32 spA4[4] = { 10.0f, 15.0f, 10.0f, 15.0f }; - Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.05f, 1.0f, 0.0001f); - Math_SmoothStepToF(&actor->vel.y, 0.0f, 0.05f, 1.0f, 0.0001f); - Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.05f, 1.0f, 0.0001f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.05f, 1.0f, 0.0001f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.05f, 1.0f, 0.0001f); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.05f, 1.0f, 0.0001f); - switch (actor->state) { + switch (this->state) { case 100: - if ((actor->timer_0BC & 3) == 0) { - - func_effect_8007D2C8(actor->obj.pos.x + RAND_FLOAT_CENTERED(100.0f), - actor->obj.pos.y + 200.0f + RAND_FLOAT_CENTERED(100.0f), - actor->obj.pos.z + 50.0f + RAND_FLOAT(50.0f), 3.0f); - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 200.0f, actor->obj.pos.z, actor->vel.x, - actor->vel.y, actor->vel.z, 0.1f, 10); - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_S, actor->sfxSource, 4); + if ((this->timer_0BC % 4) == 0) { + func_effect_8007D2C8(this->obj.pos.x + RAND_FLOAT_CENTERED(100.0f), + this->obj.pos.y + 200.0f + RAND_FLOAT_CENTERED(100.0f), + this->obj.pos.z + 50.0f + RAND_FLOAT(50.0f), 3.0f); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y + 200.0f, this->obj.pos.z, this->vel.x, + this->vel.y, this->vel.z, 0.1f, 10); + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_S, this->sfxSource, 4); } - if (actor->timer_0BC == 0) { + if (this->timer_0BC == 0) { for (i = 0; i < 4; i++) { - - Boss_SpawnDebris(actor->fwork[2 + i], actor->fwork[6 + i], actor->fwork[10 + i], 0.0f, 0.0f, 0.0f, + Boss_SpawnDebris(this->fwork[2 + i], this->fwork[6 + i], this->fwork[10 + i], 0.0f, 0.0f, 0.0f, spB4[i] * (RAND_FLOAT(0.75f) + 0.5f), spA4[i] * (RAND_FLOAT(0.75f) + 0.5f), RAND_FLOAT_CENTERED(20.0f), 3.0f, i + 24, RAND_INT(30.0f) + 60.0f); } - if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 500.0f) && - (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 200.0f) && - (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 200.0f)) { + if ((fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 500.0f) && + (fabsf(this->obj.pos.x - gPlayer[0].pos.x) < 200.0f) && + (fabsf(this->obj.pos.y - gPlayer[0].pos.y) < 200.0f)) { *gControllerRumbleTimers = 25; } - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y + 250.0f, actor->obj.pos.z, 5); + + BonusText_Display(this->obj.pos.x, this->obj.pos.y + 250.0f, this->obj.pos.z, 5); gHitCount += 6; + D_ctx_80177850 = 15; - actor->state = 101; - actor->timer_0BE = 50; + this->state = 101; + this->timer_0BE = 50; } - if (actor->timer_0BC == 8) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 200.0f, actor->obj.pos.z + 50.0f, 0.0f, 0.0f, + if (this->timer_0BC == 8) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 200.0f, this->obj.pos.z + 50.0f, 0.0f, 0.0f, 0.0f, 5.0f, 30); - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, this->sfxSource, 4); } break; case 101: - if ((actor->timer_0BE != 0) && ((gGameFrameCount % 2) == 0)) { - func_effect_8007797C(actor->obj.pos.x, actor->obj.pos.y + 150.0f, actor->obj.pos.z, 0.0f, 10.0f, 0.0f, + if ((this->timer_0BE != 0) && ((gGameFrameCount % 2) == 0)) { + func_effect_8007797C(this->obj.pos.x, this->obj.pos.y + 150.0f, this->obj.pos.z, 0.0f, 10.0f, 0.0f, 3.0f); } break; } } -void Corneria_8018BAAC(Actor* actor) { - Animation_DrawSkeleton(3, D_CO_6029A48, actor->vwork, Corneria_8018AB08, NULL, actor, gCalcMatrix); +void Corneria_CoGaruda1_Draw(CoGaruda1* this) { + Animation_DrawSkeleton(3, aCoGarudaSkel, this->vwork, Corneria_Garuda_OverrideLimbDraw, NULL, this, gCalcMatrix); } -void Corneria_8018BAFC(s32 limbIndex, Vec3f* rot, void* data) { +void Corneria_Garuda_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; - Vec3f sp28 = { 120.0f, 0.0f, 0.0f }; - Vec3f sp1C; + Vec3f src = { 120.0f, 0.0f, 0.0f }; + Vec3f dest; if (limbIndex == 1) { - Matrix_MultVec3f(gCalcMatrix, &sp28, &sp1C); - actor->fwork[2] = sp1C.x; - actor->fwork[6] = sp1C.y; - actor->fwork[10] = sp1C.z; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + actor->fwork[2] = dest.x; + actor->fwork[6] = dest.y; + actor->fwork[10] = dest.z; if (actor->iwork[1] == 0) { gScenery[actor->iwork[0]].obj.rot.x = -rot->y; } } } -void Corneria_8018BBA4(Actor* actor) { - Animation_DrawSkeleton(3, D_CO_6029A48, actor->vwork, NULL, Corneria_8018BAFC, actor, gCalcMatrix); +void Corneria_CoGaruda2_Draw(CoGaruda2* this) { + Animation_DrawSkeleton(3, aCoGarudaSkel, this->vwork, NULL, Corneria_Garuda_PostLimbDraw, this, gCalcMatrix); } -void Corneria_8018BBF8(Actor* actor) { - Animation_DrawSkeleton(3, D_CO_6029A48, actor->vwork, Corneria_8018AB08, Corneria_8018BAFC, actor, gCalcMatrix); +void Corneria_CoGaruda3_Draw(CoGaruda3* this) { + Animation_DrawSkeleton(3, aCoGarudaSkel, this->vwork, Corneria_Garuda_OverrideLimbDraw, + Corneria_Garuda_PostLimbDraw, this, gCalcMatrix); } -bool Corneria_8018BC50(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_CoGarudaDestroy_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; if ((actor->state == 101) && (limbIndex != 8)) { @@ -1563,8 +1603,8 @@ bool Corneria_8018BC50(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Corneria_8018BC84(s32 limbIndex, Vec3f* rot, void* data) { - Actor* actor = (Actor*) data; +void Corneria_CoGarudaDestroy_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { + CoGarudaDestroy* actor = (CoGarudaDestroy*) data; Vec3f src = { 0.0f, 0.0f, 0.0f }; Vec3f dest; @@ -1597,24 +1637,26 @@ void Corneria_8018BC84(s32 limbIndex, Vec3f* rot, void* data) { } } -void Corneria_8018BD7C(Actor* actor) { - Animation_DrawSkeleton(3, D_CO_6029A48, actor->vwork, Corneria_8018BC50, Corneria_8018BC84, actor, gCalcMatrix); +void Corneria_CoGarudaDestroy_Draw(CoGarudaDestroy* this) { + Animation_DrawSkeleton(3, aCoGarudaSkel, this->vwork, Corneria_CoGarudaDestroy_OverrideLimbDraw, + Corneria_CoGarudaDestroy_PostLimbDraw, this, gCalcMatrix); } -void Corneria_8018BDD4(Boss* boss, f32 xPos, f32 yPos, f32 zPos, f32 arg4, s32 arg5, s32 arg6) { - ObjectId objId = OBJ_ACTOR_191; +void Corneria_Carrier_ChooseMissileTarget(Carrier* this, f32 xPos, f32 yPos, f32 zPos, f32 arg4, s32 arg5, + s32 eventType) { + ObjectId objId = OBJ_MISSILE_SEEK_PLAYER; - if (func_hud_8008AC54(0) < 4) { - objId = OBJ_ACTOR_190; + if (Hud_MissileSeekModeCheck(0) < 4) { + objId = OBJ_MISSILE_SEEK_TEAM; } - Corneria_80187710(boss->obj.pos.x + xPos, boss->obj.pos.y + yPos, boss->obj.pos.z + zPos, arg4, boss->obj.rot.x, - boss->obj.rot.y, arg5, arg6, objId); + Corneria_Boss_SpawnMissile(this->obj.pos.x + xPos, this->obj.pos.y + yPos, this->obj.pos.z + zPos, arg4, + this->obj.rot.x, this->obj.rot.y, arg5, eventType, objId); } -void Corneria_Boss293_Init(Boss293* this) { +void Corneria_Carrier_Init(Carrier* this) { s32 i; - s16 temp_s1; + s16 timer; gBossActive = 1; gBossFrameCount = 0; @@ -1628,9 +1670,9 @@ void Corneria_Boss293_Init(Boss293* this) { this->timer_05A = 30000; this->obj.pos.z = (gPlayer[0].cam.eye.z - gPathProgress) - 2000.0f; AUDIO_PLAY_SFX(NA_SE_A_CARRIER_ENGINE, this->sfxSource, 4); - D_i1_8019B6D0 = 0; + D_i1_8019B6D0 = false; } else { - D_i1_8019B6D0 = 1; + D_i1_8019B6D0 = true; this->obj.rot.y = 180.0f; this->fwork[6] = 800.0f; this->obj.pos.z = gPlayer[0].trueZpos + 2000.0f; @@ -1641,29 +1683,29 @@ void Corneria_Boss293_Init(Boss293* this) { this->swork[8] = 3; } - temp_s1 = this->timer_05A; + timer = this->timer_05A; // Bosses OBJ_BOSS_294 to OBJ_BOSS_296 for (i = 1; i < ARRAY_COUNT(gBosses); i++) { Boss_Initialize(&gBosses[i]); gBosses[i].obj.status = OBJ_INIT; - gBosses[i].obj.id = i + 293; + gBosses[i].obj.id = (i - 1) + OBJ_BOSS_294; gBosses[i].obj.pos.x = this->obj.pos.x; gBosses[i].obj.pos.y = this->obj.pos.y; gBosses[i].obj.pos.z = this->obj.pos.z; gBosses[i].health = 200; gBosses[i].drawShadow = true; - gBosses[i].timer_05A = temp_s1; + gBosses[i].timer_05A = timer; Object_SetInfo(&gBosses[i].info, gBosses[i].obj.id); - gBosses[3].drawShadow = false; + gBosses[CARRIER_3].drawShadow = false; } } -void Corneria_8018C0B0(Boss* boss) { - func_effect_8007D9DC(boss->obj.pos.x, gGroundHeight + 2.0f, boss->obj.pos.z, 5.0f, 100.0f, 0); - func_effect_8007D9DC(boss->obj.pos.x, gGroundHeight + 2.0f, boss->obj.pos.z, 5.0f, 100.0f, 5); - func_effect_8007D9DC(boss->obj.pos.x, gGroundHeight + 2.0f, boss->obj.pos.z, 5.0f, 100.0f, 10); - func_effect_8007ADF4(boss->obj.pos.x, gGroundHeight, boss->obj.pos.z, 1.0f, 10.0f); +void Corneria_8018C0B0(Boss* this) { + func_effect_8007D9DC(this->obj.pos.x, gGroundHeight + 2.0f, this->obj.pos.z, 5.0f, 100.0f, 0); + func_effect_8007D9DC(this->obj.pos.x, gGroundHeight + 2.0f, this->obj.pos.z, 5.0f, 100.0f, 5); + func_effect_8007D9DC(this->obj.pos.x, gGroundHeight + 2.0f, this->obj.pos.z, 5.0f, 100.0f, 10); + func_effect_8007ADF4(this->obj.pos.x, gGroundHeight, this->obj.pos.z, 1.0f, 10.0f); } static Vec3f D_i1_801998CC = { 442.0f, 5.0f, 360.0f }; @@ -1689,63 +1731,59 @@ static Vec3f D_i1_8019995C[20] = { { -60.0f, -151.0f, 29.0f }, { -132.0f, 9.0f, 430.0f }, { 52.0f, 29.0f, 431.0f }, { -23.0f, 68.0f, 325.0f }, { 116.0f, 34.0f, 368.0f }, { -49.0f, -53.0f, 366.0f }, { 113.0f, -62.0f, 255.0f }, { -114.0f, -88.0f, 182.0f } }; - static s32 D_i1_80199A4C[4] = { 150, 200, 150, 200 }; - static f32 D_i1_80199A5C[4] = { -225.0f, 0.0f, 225.0f, 0.0f }; -void Corneria_8018C19C(Boss* boss) { - // todo: figure out vec3f stack - s32 pad[9]; - Vec3f sp84[30]; - Vec3f sp78; - Vec3f sp6C; - Effect* effect; +void Corneria_Carrier_Update(Carrier* this) { + Vec3f sp84[33]; + Vec3f src; + Vec3f dest; f32 temp_fv0_2; - s32 pad2; - s32 var_v1; - s32 var_v0; + s32 pad1; s32 i; - s32 pad3; + s32 k; + s32 j; + s32 pad2; f32* temp_a0; f32* temp_a1; + Effect398* effect398; gBossFrameCount++; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); - if (D_i1_8019B6D0 == 0) { - if (boss->obj.pos.x > 6000.0f) { - Object_Kill(&boss->obj, boss->sfxSource); + if (!D_i1_8019B6D0) { + if (this->obj.pos.x > 6000.0f) { + Object_Kill(&this->obj, this->sfxSource); for (i = 1; i < ARRAY_COUNT(gBosses); i++) { Object_Kill(&gBosses[i].obj, gBosses[i].sfxSource); } return; } - sp78.x = 0.0f; - sp78.y = 0.0f; - sp78.z = 60.0f; + src.x = 0.0f; + src.y = 0.0f; + src.z = 60.0f; - Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); - boss->vel.x = sp6C.x; - boss->vel.y = sp6C.y; - boss->vel.z = sp6C.z - gPathVelZ; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z - gPathVelZ; - boss->fwork[16] = 4.0f; + this->fwork[16] = 4.0f; - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[0], &sp84[6]); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[1], &sp84[7]); Matrix_MultVec3f(gCalcMatrix, &D_i1_8019992C, &sp84[8]); - func_effect_8007BC7C(sp84[6].x + boss->obj.pos.x, sp84[6].y + boss->obj.pos.y, sp84[6].z + boss->obj.pos.z, + func_effect_8007BC7C(sp84[6].x + this->obj.pos.x, sp84[6].y + this->obj.pos.y, sp84[6].z + this->obj.pos.z, 20.0f); - func_effect_8007BC7C(sp84[7].x + boss->obj.pos.x, sp84[7].y + boss->obj.pos.y, sp84[7].z + boss->obj.pos.z, + func_effect_8007BC7C(sp84[7].x + this->obj.pos.x, sp84[7].y + this->obj.pos.y, sp84[7].z + this->obj.pos.z, 10.0f); - func_effect_8007BC7C(sp84[8].x + boss->obj.pos.x, sp84[8].y + boss->obj.pos.y, sp84[8].z + boss->obj.pos.z, + func_effect_8007BC7C(sp84[8].x + this->obj.pos.x, sp84[8].y + this->obj.pos.y, sp84[8].z + this->obj.pos.z, 10.0f); } } else { @@ -1760,462 +1798,463 @@ void Corneria_8018C19C(Boss* boss) { Matrix_MultVec3f(gCalcMatrix, &D_i1_801998D8, &sp84[1]); Matrix_MultVec3f(gCalcMatrix, &D_i1_801998E4, &sp84[2]); - if (boss->health != 601) { - var_v1 = boss->health - 601; + if (this->health != 601) { + k = this->health - 601; - if (var_v1 < 0) { - var_v1 *= -1; + if (k < 0) { + k *= -1; } - for (i = 0; var_v1 >= 60; i++, var_v1 -= 60) {} + for (i = 0; k >= 60; i++, k -= 60) {} - for (var_v0 = 0, var_v1 = 13; var_v0 < i; var_v0++, var_v1++) { - if ((gGameFrameCount % 16U) == (var_v0 % 16U)) { - Matrix_MultVec3f(gCalcMatrix, &D_i1_8019995C[var_v0], &sp84[var_v1]); - func_effect_8007D0E0(sp84[var_v1].x + boss->obj.pos.x, sp84[var_v1].y + boss->obj.pos.y, - sp84[var_v1].z + boss->obj.pos.z, boss->fwork[17]); - func_effect_8007C120(sp84[var_v1].x + boss->obj.pos.x, sp84[var_v1].y + boss->obj.pos.y, - sp84[var_v1].z + boss->obj.pos.z, boss->vel.x, boss->vel.y, boss->vel.z, 0.1f, - 7); + for (j = 0, k = 13; j < i; j++, k++) { + if ((gGameFrameCount % 16U) == (j % 16U)) { + Matrix_MultVec3f(gCalcMatrix, &D_i1_8019995C[j], &sp84[k]); + func_effect_8007D0E0(sp84[k].x + this->obj.pos.x, sp84[k].y + this->obj.pos.y, + sp84[k].z + this->obj.pos.z, this->fwork[17]); + func_effect_8007C120(sp84[k].x + this->obj.pos.x, sp84[k].y + this->obj.pos.y, + sp84[k].z + this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, 0.1f, 7); } } } - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; - if ((gBosses[1].state != 0) && (gBosses[2].state != 0) && (gBosses[3].state != 0)) { - if (boss->health >= 2) { - boss->timer_05C = 15; - boss->health -= boss->damage; - if (boss->health < 120) { - boss->fwork[17] = 2.8f; - AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, boss->sfxSource, 4); + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if ((gBosses[CARRIER_1].state != 0) && (gBosses[CARRIER_2].state != 0) && (gBosses[CARRIER_3].state != 0)) { + if (this->health >= 2) { + this->timer_05C = 15; + this->health -= this->damage; + if (this->health < 120) { + this->fwork[17] = 2.8f; + AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); } } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - boss->vel.z = boss->fwork[18]; + this->vel.z = this->fwork[18]; - if (boss->state > 0) { - boss->fwork[3] = (gPlayer[0].cam.eye.z - gPathProgress) - 2500.0f; + if (this->state > 0) { + this->fwork[3] = (gPlayer[0].cam.eye.z - gPathProgress) - 2500.0f; } - if (boss->state != 7) { - Math_SmoothStepToF(&boss->fwork[4], boss->fwork[5], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&boss->obj.pos.z, boss->fwork[3], 0.1f, boss->fwork[4], 0.00001f); + if (this->state != 7) { + Math_SmoothStepToF(&this->fwork[4], this->fwork[5], 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->obj.pos.z, this->fwork[3], 0.1f, this->fwork[4], 0.00001f); } - Math_SmoothStepToF(&boss->obj.pos.y, boss->fwork[6], 0.02f, 2.0f, 0.00001f); - Math_SmoothStepToAngle(&boss->fwork[0], boss->fwork[9], 0.2f, 5.0f, 0.00001f); - Math_SmoothStepToAngle(&boss->fwork[1], boss->fwork[10], 0.2f, 5.0f, 0.00001f); - Math_SmoothStepToAngle(&boss->fwork[2], boss->fwork[11], 0.2f, 5.0f, 0.00001f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[6], 0.02f, 2.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[0], this->fwork[9], 0.2f, 5.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[1], this->fwork[10], 0.2f, 5.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[2], this->fwork[11], 0.2f, 5.0f, 0.00001f); - if (boss->state < 6) { - Math_SmoothStepToAngle(&boss->obj.rot.y, boss->fwork[13], 0.03f, boss->fwork[8], 0.00001f); - Math_SmoothStepToF(&boss->fwork[8], boss->fwork[12], 0.1f, 0.02f, 0.001f); - Math_SmoothStepToAngle(&boss->obj.rot.z, boss->fwork[14], 0.03f, boss->fwork[15], 0.00001f); + if (this->state < 6) { + Math_SmoothStepToAngle(&this->obj.rot.y, this->fwork[13], 0.03f, this->fwork[8], 0.00001f); + Math_SmoothStepToF(&this->fwork[8], this->fwork[12], 0.1f, 0.02f, 0.001f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[14], 0.03f, this->fwork[15], 0.00001f); - if (boss->timer_056 == 1) { - boss->fwork[14] = 0.0f; - boss->fwork[15] = 0.5f; + if (this->timer_056 == 1) { + this->fwork[14] = 0.0f; + this->fwork[15] = 0.5f; } } - if ((gBosses[1].state != 0) && ((gGameFrameCount % 16) == 0)) { + if ((gBosses[CARRIER_1].state != 0) && ((gGameFrameCount % 16) == 0)) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199908, &sp84[5]); - func_effect_8007D0E0(gBosses[0].obj.pos.x + sp84[5].x, gBosses[0].obj.pos.y + sp84[5].y, - gBosses[0].obj.pos.z + sp84[5].z, 5.0f); + func_effect_8007D0E0(gBosses[CARRIER_0].obj.pos.x + sp84[5].x, gBosses[CARRIER_0].obj.pos.y + sp84[5].y, + gBosses[CARRIER_0].obj.pos.z + sp84[5].z, 5.0f); } - if (gBosses[2].state != 0) { - gBosses[3].drawShadow = true; - if (gBosses[3].state != 0) { - if (((gGameFrameCount % 8) == 0)) { + if (gBosses[CARRIER_2].state != 0) { + gBosses[CARRIER_3].drawShadow = true; + if (gBosses[CARRIER_3].state != 0) { + if ((gGameFrameCount % 8) == 0) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199950, &sp84[11]); - func_effect_8007D0E0(gBosses[0].obj.pos.x + sp84[11].x, gBosses[0].obj.pos.y + sp84[11].y, - gBosses[0].obj.pos.z + sp84[11].z, 7.0f); + func_effect_8007D0E0(gBosses[CARRIER_0].obj.pos.x + sp84[11].x, + gBosses[CARRIER_0].obj.pos.y + sp84[11].y, + gBosses[CARRIER_0].obj.pos.z + sp84[11].z, 7.0f); } - } else if (((gGameFrameCount % 16) == 0)) { + } else if ((gGameFrameCount % 16) == 0) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199938, &sp84[9]); - func_effect_8007D0E0(gBosses[0].obj.pos.x + sp84[9].x, gBosses[0].obj.pos.y + sp84[9].y, - gBosses[0].obj.pos.z + sp84[9].z, 5.0f); + func_effect_8007D0E0(gBosses[CARRIER_0].obj.pos.x + sp84[9].x, gBosses[CARRIER_0].obj.pos.y + sp84[9].y, + gBosses[CARRIER_0].obj.pos.z + sp84[9].z, 5.0f); } } - if ((gBosses[3].state != 0) && (gBosses[2].state == 0) && ((gGameFrameCount % 16) == 0)) { + if ((gBosses[CARRIER_3].state != 0) && (gBosses[CARRIER_2].state == 0) && ((gGameFrameCount % 16) == 0)) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199944, &sp84[10]); - func_effect_8007D0E0(gBosses[0].obj.pos.x + sp84[10].x, gBosses[0].obj.pos.y + sp84[10].y, - gBosses[0].obj.pos.z + sp84[10].z, 5.0f); + func_effect_8007D0E0(gBosses[CARRIER_0].obj.pos.x + sp84[10].x, gBosses[CARRIER_0].obj.pos.y + sp84[10].y, + gBosses[CARRIER_0].obj.pos.z + sp84[10].z, 5.0f); } - if (((boss->state == 1) || (boss->state == 2)) && ((gGameFrameCount % 8) == 0)) { + if (((this->state == 1) || (this->state == 2)) && ((gGameFrameCount % 8) == 0)) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[0], &sp84[6]); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199914[1], &sp84[7]); Matrix_MultVec3f(gCalcMatrix, &D_i1_8019992C, &sp84[8]); - func_effect_8007BC7C(sp84[6].x + boss->obj.pos.x, sp84[6].y + boss->obj.pos.y, sp84[6].z + boss->obj.pos.z, + func_effect_8007BC7C(sp84[6].x + this->obj.pos.x, sp84[6].y + this->obj.pos.y, sp84[6].z + this->obj.pos.z, 20.0f); - func_effect_8007BC7C(sp84[7].x + boss->obj.pos.x, sp84[7].y + boss->obj.pos.y, sp84[7].z + boss->obj.pos.z, + func_effect_8007BC7C(sp84[7].x + this->obj.pos.x, sp84[7].y + this->obj.pos.y, sp84[7].z + this->obj.pos.z, 10.0f); - func_effect_8007BC7C(sp84[8].x + boss->obj.pos.x, sp84[8].y + boss->obj.pos.y, sp84[8].z + boss->obj.pos.z, + func_effect_8007BC7C(sp84[8].x + this->obj.pos.x, sp84[8].y + this->obj.pos.y, sp84[8].z + this->obj.pos.z, 10.0f); } - if (boss->timer_052 != 0) { + if (this->timer_052 != 0) { Math_SmoothStepToF(&D_ctx_801779A8[0], 50.0f, 1.0f, 1.6f, 0.0001f); } - switch (boss->state) { + switch (this->state) { case 0: - boss->fwork[3] = gPlayer[0].trueZpos + 1500.0f; + this->fwork[3] = gPlayer[0].trueZpos + 1500.0f; - if (boss->timer_050 == 350) { + if (this->timer_050 == 350) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); Radio_PlayMessage(gMsg_ID_2290, RCID_BOSS_CORNERIA2); } - if (boss->timer_050 == 180) { + if (this->timer_050 == 180) { Radio_PlayMessage(gMsg_ID_2298, RCID_PEPPY); - boss->timer_052 = 350; + this->timer_052 = 350; } - if (boss->timer_050 == 0) { - boss->obj.pos.y = 900.0f; - boss->state = 1; - boss->fwork[13] = 180.0f; - boss->fwork[12] = 1.5f; - boss->fwork[6] = 800.0f; - boss->fwork[3] = gPlayer[0].cam.eye.z - gPathProgress - 2500.0f; - boss->fwork[18] = -gArwingSpeed; + if (this->timer_050 == 0) { + this->obj.pos.y = 900.0f; + this->state = 1; + this->fwork[13] = 180.0f; + this->fwork[12] = 1.5f; + this->fwork[6] = 800.0f; + this->fwork[3] = gPlayer[0].cam.eye.z - gPathProgress - 2500.0f; + this->fwork[18] = -gArwingSpeed; AUDIO_PLAY_BGM(NA_BGM_BOSS_A_CARRIER); - boss->timer_050 = 40; + this->timer_050 = 40; } break; case 1: - if (boss->timer_050 == 0) { - boss->state = 2; - boss->fwork[8] = 0.0f; - boss->fwork[13] = 359.9f; - boss->timer_050 = 250; + if (this->timer_050 == 0) { + this->state = 2; + this->fwork[8] = 0.0f; + this->fwork[13] = 359.9f; + this->timer_050 = 250; } break; case 2: - if (boss->timer_050 == 0) { - boss->state = 3; - boss->swork[0] = 4; - boss->timer_050 = 75; - boss->timer_054 = 0; - boss->fwork[8] = 0.0f; + if (this->timer_050 == 0) { + this->state = 3; + this->swork[0] = 4; + this->timer_050 = 75; + this->timer_054 = 0; + this->fwork[8] = 0.0f; Radio_PlayMessage(gMsg_ID_2291, RCID_BOSS_CORNERIA2); - boss->swork[4]++; + this->swork[4]++; } break; case 3: - boss->fwork[12] = 1.5f; - boss->fwork[11] = 0.0f; - boss->fwork[9] = 0.0f; - boss->fwork[10] = 0.0f; - boss->fwork[13] = 0.0f; + this->fwork[12] = 1.5f; + this->fwork[11] = 0.0f; + this->fwork[9] = 0.0f; + this->fwork[10] = 0.0f; + this->fwork[13] = 0.0f; - if (boss->timer_050 == 0) { - boss->state = boss->swork[0]; - boss->timer_050 = 60; - boss->fwork[8] = 0.0f; - AUDIO_PLAY_SFX(NA_SE_EN_HATCH, boss->sfxSource, 4); + if (this->timer_050 == 0) { + this->state = this->swork[0]; + this->timer_050 = 60; + this->fwork[8] = 0.0f; + AUDIO_PLAY_SFX(NA_SE_EN_HATCH, this->sfxSource, 4); } break; case 4: - boss->fwork[11] = 120.0f; - boss->fwork[13] = 340.0f; + this->fwork[11] = 120.0f; + this->fwork[13] = 340.0f; - if ((boss->timer_050 == 0) || (gBosses[1].state != 0)) { - boss->state = 3; - boss->swork[0] = 5; - boss->timer_050 = 20; - boss->fwork[8] = 0.0f; + if ((this->timer_050 == 0) || (gBosses[CARRIER_1].state != 0)) { + this->state = 3; + this->swork[0] = 5; + this->timer_050 = 20; + this->fwork[8] = 0.0f; - if (gBosses[1].state == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_HATCH, boss->sfxSource, 4); + if (gBosses[CARRIER_1].state == 0) { + AUDIO_PLAY_SFX(NA_SE_EN_HATCH, this->sfxSource, 4); } - if ((boss->swork[5] == 0) && ((gBosses[2].state == 0) || (gBosses[3].state == 0))) { + if ((this->swork[5] == 0) && ((gBosses[CARRIER_2].state == 0) || (gBosses[CARRIER_3].state == 0))) { Radio_PlayMessage(gMsg_ID_2292, RCID_BOSS_CORNERIA2); } - boss->swork[5]++; - boss->swork[5] &= 3; + this->swork[5]++; + this->swork[5] &= 3; - } else if ((boss->fwork[2] > 60.0f) && (boss->timer_054 == 0)) { - boss->timer_054 = 20; - Corneria_8018BDD4(boss, sp84[0].x, sp84[0].y, sp84[0].z, 30.0f, 0, 1); + } else if ((this->fwork[2] > 60.0f) && (this->timer_054 == 0)) { + this->timer_054 = 20; + Corneria_Carrier_ChooseMissileTarget(this, sp84[0].x, sp84[0].y, sp84[0].z, 30.0f, 0, 1); } break; case 5: - boss->fwork[9] = 120.0f; - boss->fwork[10] = 120.0f; - boss->fwork[13] = 20.0f; + this->fwork[9] = 120.0f; + this->fwork[10] = 120.0f; + this->fwork[13] = 20.0f; - if ((boss->fwork[0] > 60.0f) && (gBosses[2].state == 0) && (boss->swork[1] == 0)) { - Corneria_8018BDD4(boss, sp84[1].x, sp84[1].y + 50.0f, sp84[1].z, 45.0f, 0, 0); - AUDIO_PLAY_SFX(NA_SE_EN_BARREL_SHOT, boss->sfxSource, 4); - Corneria_8018BDD4(boss, sp84[1].x, sp84[1].y - 50.0f, sp84[1].z, 40.0f, 0, 0); - boss->swork[1] = 1; + if ((this->fwork[0] > 60.0f) && (gBosses[CARRIER_2].state == 0) && (this->swork[1] == 0)) { + Corneria_Carrier_ChooseMissileTarget(this, sp84[1].x, sp84[1].y + 50.0f, sp84[1].z, 45.0f, 0, 0); + AUDIO_PLAY_SFX(NA_SE_EN_BARREL_SHOT, this->sfxSource, 4); + Corneria_Carrier_ChooseMissileTarget(this, sp84[1].x, sp84[1].y - 50.0f, sp84[1].z, 40.0f, 0, 0); + this->swork[1] = 1; } - if ((boss->fwork[1] > 60.0f) && (gBosses[3].state == 0) && (boss->swork[2] == 0)) { - Corneria_8018BDD4(boss, sp84[2].x, sp84[2].y + 50.0f, sp84[2].z, 35.0f, 0, 0); - AUDIO_PLAY_SFX(NA_SE_EN_BARREL_SHOT, boss->sfxSource, 4); - Corneria_8018BDD4(boss, sp84[2].x, sp84[2].y - 50.0f, sp84[2].z, 30.0f, 0, 0); - boss->swork[2] = 1; + if ((this->fwork[1] > 60.0f) && (gBosses[CARRIER_3].state == 0) && (this->swork[2] == 0)) { + Corneria_Carrier_ChooseMissileTarget(this, sp84[2].x, sp84[2].y + 50.0f, sp84[2].z, 35.0f, 0, 0); + AUDIO_PLAY_SFX(NA_SE_EN_BARREL_SHOT, this->sfxSource, 4); + Corneria_Carrier_ChooseMissileTarget(this, sp84[2].x, sp84[2].y - 50.0f, sp84[2].z, 30.0f, 0, 0); + this->swork[2] = 1; } - if ((boss->timer_050 == 0) || ((gBosses[3].state != 0) && (gBosses[2].state != 0))) { - boss->state = 3; - boss->swork[0] = 4; - boss->timer_050 = 70; - boss->swork[1] = 0; - boss->swork[2] = 0; - boss->fwork[8] = 0.0f; + if ((this->timer_050 == 0) || ((gBosses[CARRIER_3].state != 0) && (gBosses[CARRIER_2].state != 0))) { + this->state = 3; + this->swork[0] = 4; + this->timer_050 = 70; + this->swork[1] = 0; + this->swork[2] = 0; + this->fwork[8] = 0.0f; - if ((boss->swork[4] == 0) && (gBosses[1].state == 0)) { + if ((this->swork[4] == 0) && (gBosses[CARRIER_1].state == 0)) { Radio_PlayMessage(gMsg_ID_2291, RCID_BOSS_CORNERIA2); } - if ((boss->swork[4] == 2) && (boss->swork[7] == 0) && - ((gBosses[3].state == 0) || (gBosses[2].state == 0) || (gBosses[1].state == 0))) { + if ((this->swork[4] == 2) && (this->swork[7] == 0) && + ((gBosses[CARRIER_3].state == 0) || (gBosses[CARRIER_2].state == 0) || + (gBosses[CARRIER_1].state == 0))) { Radio_PlayMessage(gMsg_ID_2299, RCID_PEPPY); - boss->swork[7]++; + this->swork[7]++; } - boss->swork[4]++; - boss->swork[4] &= 3; + this->swork[4]++; + this->swork[4] &= 3; - if ((gBosses[3].state == 0) && (gBosses[2].state == 0)) { - AUDIO_PLAY_SFX(NA_SE_EN_HATCH, boss->sfxSource, 4); + if ((gBosses[CARRIER_3].state == 0) && (gBosses[CARRIER_2].state == 0)) { + AUDIO_PLAY_SFX(NA_SE_EN_HATCH, this->sfxSource, 4); } } break; case 6: - Math_SmoothStepToAngle(&boss->obj.rot.y, boss->fwork[13], 0.1f, 5.0f, 0.01f); - Math_SmoothStepToAngle(&boss->obj.rot.z, boss->fwork[14], 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->fwork[13], 0.1f, 5.0f, 0.01f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[14], 0.1f, 5.0f, 0.01f); - if ((boss->obj.rot.y == 0.0f) || (boss->timer_058 == 0)) { - boss->timer_058 = 0; - boss->state = 7; - boss->obj.rot.z = 0.0f; - boss->obj.rot.y = 0.0f; + if ((this->obj.rot.y == 0.0f) || (this->timer_058 == 0)) { + this->timer_058 = 0; + this->state = 7; + this->obj.rot.z = 0.0f; + this->obj.rot.y = 0.0f; } break; case 7: - boss->fwork[3] = (gPlayer[0].cam.eye.z - gPathProgress) - 4000.0f; - Math_SmoothStepToF(&boss->obj.pos.z, boss->fwork[3], 0.1f, 15.0f, 0.00001f); + this->fwork[3] = (gPlayer[0].cam.eye.z - gPathProgress) - 4000.0f; + Math_SmoothStepToF(&this->obj.pos.z, this->fwork[3], 0.1f, 15.0f, 0.00001f); - if (boss->timer_058 == 0) { - boss->timer_058 = D_i1_80199A4C[boss->swork[3]]; - boss->fwork[20] = D_i1_80199A5C[boss->swork[3]]; - boss->swork[3]++; - boss->swork[3] &= 3; - boss->fwork[8] = 0.0f; + if (this->timer_058 == 0) { + this->timer_058 = D_i1_80199A4C[this->swork[3]]; + this->fwork[20] = D_i1_80199A5C[this->swork[3]]; + this->swork[3]++; + this->swork[3] &= 3; + this->fwork[8] = 0.0f; - if ((boss->swork[3] != 1) || (boss->swork[3] != 3)) { - Audio_KillSfxBySourceAndId(boss->sfxSource, NA_SE_EN_ZOBOSS_BEAM); - boss->swork[9] = 0; + if ((this->swork[3] != 1) || (this->swork[3] != 3)) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_ZOBOSS_BEAM); + this->swork[9] = 0; } } - if ((boss->swork[3] == 0) || (boss->swork[3] == 2)) { - if ((boss->obj.rot.y < 20.0f) && (boss->obj.rot.y > -20.0f)) { - if (boss->swork[9] == 0) { - boss->swork[9]++; - AUDIO_PLAY_SFX(NA_SE_EN_ZOBOSS_BEAM, boss->sfxSource, 4); - if (boss->swork[6] == 0) { + if ((this->swork[3] == 0) || (this->swork[3] == 2)) { + if ((this->obj.rot.y < 20.0f) && (this->obj.rot.y > -20.0f)) { + if (this->swork[9] == 0) { + this->swork[9]++; + AUDIO_PLAY_SFX(NA_SE_EN_ZOBOSS_BEAM, this->sfxSource, 4); + if (this->swork[6] == 0) { Radio_PlayMessage(gMsg_ID_2293, RCID_BOSS_CORNERIA2); } - boss->swork[6]++; - boss->swork[6] &= 1; + this->swork[6]++; + this->swork[6] &= 1; } - if (((gGameFrameCount % 8) == 0)) { - if (fabsf(boss->obj.pos.z - gPlayer[0].trueZpos) > 700.0f) { + if ((gGameFrameCount % 8) == 0) { + if (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) > 700.0f) { Matrix_MultVec3f(gCalcMatrix, &D_i1_801998F0[0], &sp84[3]); - for (effect = gEffects, i = 0; i < ARRAY_COUNT(gEffects); i++, effect++) { - if (effect->obj.status == OBJ_FREE) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_398; - effect->timer_50 = 100; - effect->unk_44 = 1; - effect->scale2 = 1.0f; - effect->obj.rot.z = 30.0f; - effect->obj.pos.x = sp84[3].x + boss->obj.pos.x; - effect->obj.pos.y = sp84[3].y + boss->obj.pos.y; - effect->obj.pos.z = sp84[3].z + boss->obj.pos.z; - Object_SetInfo(&effect->info, effect->obj.id); + for (effect398 = &gEffects[0], i = 0; i < ARRAY_COUNT(gEffects); i++, effect398++) { + if (effect398->obj.status == OBJ_FREE) { + Effect_Initialize(effect398); + effect398->obj.status = OBJ_INIT; + effect398->obj.id = OBJ_EFFECT_398; + effect398->timer_50 = 100; + effect398->unk_44 = 1; + effect398->scale2 = 1.0f; + effect398->obj.rot.z = 30.0f; + effect398->obj.pos.x = sp84[3].x + this->obj.pos.x; + effect398->obj.pos.y = sp84[3].y + this->obj.pos.y; + effect398->obj.pos.z = sp84[3].z + this->obj.pos.z; + Object_SetInfo(&effect398->info, effect398->obj.id); break; } } if (i >= 60) { - effect->obj.status = OBJ_FREE; + effect398->obj.status = OBJ_FREE; } } } } } - if (boss->health < 2) { + if (this->health < 2) { gTeamLowHealthMsgTimer = -1; - Audio_KillSfxBySourceAndId(boss->sfxSource, NA_SE_EN_ZOBOSS_BEAM); + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_ZOBOSS_BEAM); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); gScreenFlashTimer = 8; gShowBossHealth = false; Radio_PlayMessage(gMsg_ID_2294, RCID_BOSS_CORNERIA2); - boss->health = 1; - boss->timer_056 = 150; - boss->state = 8; - boss->fwork[19] = 15.0f; + this->health = 1; + this->timer_056 = 150; + this->state = 8; + this->fwork[19] = 15.0f; } else { - Math_SmoothStepToF(&boss->fwork[8], 3.0f, 0.1f, 0.5f, 0.001f); - Math_SmoothStepToAngle(&boss->obj.rot.z, boss->fwork[14], 0.1f, 3.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[8], 3.0f, 0.1f, 0.5f, 0.001f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[14], 0.1f, 3.0f, 0.00001f); - temp_fv0_2 = Math_SmoothStepToF(&boss->obj.rot.y, boss->fwork[20], 0.1f, boss->fwork[8], 0.00001f); - boss->fwork[14] = 0.0f; + temp_fv0_2 = Math_SmoothStepToF(&this->obj.rot.y, this->fwork[20], 0.1f, this->fwork[8], 0.00001f); + this->fwork[14] = 0.0f; if (temp_fv0_2 < -1.0f) { - boss->fwork[14] = 25.0f; + this->fwork[14] = 25.0f; } if (temp_fv0_2 > 1.0f) { - boss->fwork[14] = 335.0f; + this->fwork[14] = 335.0f; } - sp78.x = 0.0f; - sp78.y = 0.0f; - sp78.z = 40.0f; + src.x = 0.0f; + src.y = 0.0f; + src.z = 40.0f; - Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); - boss->vel.x = sp6C.x; - boss->vel.y = sp6C.y; - boss->vel.z = sp6C.z - gPathVelZ; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z - gPathVelZ; } break; case 8: D_ctx_801779A8[0] = 20.0f; - if (((gGameFrameCount % 32) == 0)) { + if ((gGameFrameCount % 32) == 0) { for (i = 0; i < 10; i++) { - func_effect_80079618(RAND_FLOAT_CENTERED(300.0f) + boss->obj.pos.x, boss->obj.pos.y, - boss->obj.pos.z, 1.0f); + func_effect_80079618(RAND_FLOAT_CENTERED(300.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); } } - Math_SmoothStepToF(&boss->obj.pos.x, boss->fwork[7], 1.0f, 10.0f, 0.00001f); - Math_SmoothStepToF(&boss->vel.x, 0.0f, 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&boss->vel.y, 0.0f, 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&boss->vel.z, 0.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->obj.pos.x, this->fwork[7], 1.0f, 10.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.1f, 2.0f, 0.00001f); - if (boss->obj.rot.z == boss->fwork[14]) { - if (boss->fwork[14] == boss->fwork[19]) { - boss->fwork[14] = 360.0f - boss->fwork[19]; + if (this->obj.rot.z == this->fwork[14]) { + if (this->fwork[14] == this->fwork[19]) { + this->fwork[14] = 360.0f - this->fwork[19]; } else { - boss->fwork[14] = boss->fwork[19]; + this->fwork[14] = this->fwork[19]; } } - Math_SmoothStepToAngle(&boss->obj.rot.z, boss->fwork[14], 1.0f, 1.0f, 0.001f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[14], 1.0f, 1.0f, 0.001f); - if (boss->health != 0) { - if (boss->timer_056 == 0) { - Boss_AwardBonus(boss); - boss->fwork[17] = 10.0f; - boss->vel.y *= 1.5f; + if (this->health != 0) { + if (this->timer_056 == 0) { + Boss_AwardBonus(this); + this->fwork[17] = 10.0f; + this->vel.y *= 1.5f; gMissionStatus = MISSION_ACCOMPLISHED; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { - Boss_CompleteLevel(gPlayer, boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z); + Boss_CompleteLevel(gPlayer, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); } - boss->health--; - boss->fwork[8] = 0.0f; + this->health--; + this->fwork[8] = 0.0f; Radio_PlayMessage(gMsg_ID_2296, RCID_BOSS_CORNERIA2); } else { - Math_SmoothStepToF(&boss->obj.rot.y, 0.0f, 0.1f, boss->fwork[8], 0.00001f); - sp78.x = 0.0f; - sp78.y = 0.0f; - sp78.z = 20.0f; - Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); - boss->vel.x = sp6C.x; - boss->vel.y = sp6C.y; - boss->vel.z = sp6C.z - gPathVelZ; - if (boss->timer_056 == 60) { + Math_SmoothStepToF(&this->obj.rot.y, 0.0f, 0.1f, this->fwork[8], 0.00001f); + src.x = 0.0f; + src.y = 0.0f; + src.z = 20.0f; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z - gPathVelZ; + if (this->timer_056 == 60) { Radio_PlayMessage(gMsg_ID_2295, RCID_FOX); } } } else { - boss->state = 9; + this->state = 9; } break; case 9: - if (((gGameFrameCount % 16) == 0)) { + if ((gGameFrameCount % 16) == 0) { for (i = 0; i < 10; i++) { - func_effect_80079618(RAND_FLOAT_CENTERED(300.0f) + boss->obj.pos.x, boss->obj.pos.y, - boss->obj.pos.z, 1.0f); + func_effect_80079618(RAND_FLOAT_CENTERED(300.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); } } - Math_SmoothStepToF(&boss->vel.x, 0.0f, 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&boss->vel.y, 0.0f, 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&boss->vel.z, 0.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.1f, 2.0f, 0.00001f); - boss->obj.rot.z -= 2.0f; - boss->gravity = 1.0f; + this->obj.rot.z -= 2.0f; + this->gravity = 1.0f; - if (boss->obj.pos.y < (gGroundHeight + 150.0f)) { + if (this->obj.pos.y < (gGroundHeight + 150.0f)) { gCameraShake = 100; - func_effect_80081A8C(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f, 12); - boss->timer_050 = 20; - boss->vel.y = -10.0f; - boss->gravity = 0.0f; - boss->fwork[17] = 20.0f; - Corneria_8018C0B0(boss); - boss->state = 10; + func_effect_80081A8C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f, 12); + this->timer_050 = 20; + this->vel.y = -10.0f; + this->gravity = 0.0f; + this->fwork[17] = 20.0f; + Corneria_8018C0B0(this); + this->state = 10; } break; case 10: - if (((gGameFrameCount % 8) == 0)) { + if ((gGameFrameCount % 8) == 0) { for (i = 0; i < 10; i++) { - func_effect_80079618(RAND_FLOAT_CENTERED(300.0f) + boss->obj.pos.x, boss->obj.pos.y, - boss->obj.pos.z, 1.0f); + func_effect_80079618(RAND_FLOAT_CENTERED(300.0f) + this->obj.pos.x, this->obj.pos.y, + this->obj.pos.z, 1.0f); } } - if (boss->timer_050 == 0) { - func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y + 500.0f, boss->obj.pos.z, 120.0f); - Object_Kill(&boss->obj, boss->sfxSource); + if (this->timer_050 == 0) { + func_effect_8007A568(this->obj.pos.x, this->obj.pos.y + 500.0f, this->obj.pos.z, 120.0f); + Object_Kill(&this->obj, this->sfxSource); } break; } @@ -2227,27 +2266,27 @@ void Corneria_8018C19C(Boss* boss) { temp_a1[9] = -100000.0f; temp_a1[3] = -150.0f; - if (boss->fwork[0] > 60.0f) { + if (this->fwork[0] > 60.0f) { temp_a0[3] = -100000.0f; temp_a0[9] = 543.0f; } - if (boss->fwork[1] > 60.0f) { + if (this->fwork[1] > 60.0f) { temp_a1[3] = -100000.0f; temp_a1[9] = -557.0f; } - boss->fwork[16] = 4.0f; + this->fwork[16] = 4.0f; - if ((boss->swork[10] == 0) && (boss->state < 6)) { - boss->fwork[17] = 1.8f; - AUDIO_PLAY_SFX(NA_SE_EXPLOSION_DEMO6, boss->sfxSource, 4); - boss->timer_058 = 71; - boss->state = 6; - boss->fwork[12] = 0.0f; - boss->fwork[8] = 0.0f; - boss->fwork[14] = 0.0f; - boss->fwork[13] = 0.0f; + if ((this->swork[10] == 0) && (this->state < 6)) { + this->fwork[17] = 1.8f; + AUDIO_PLAY_SFX(NA_SE_EXPLOSION_DEMO6, this->sfxSource, 4); + this->timer_058 = 71; + this->state = 6; + this->fwork[12] = 0.0f; + this->fwork[8] = 0.0f; + this->fwork[14] = 0.0f; + this->fwork[13] = 0.0f; } if (gBossFrameCount == 430) { @@ -2257,7 +2296,7 @@ void Corneria_8018C19C(Boss* boss) { gShowBossHealth = true; } if (gBossFrameCount >= 587) { - gBossHealthBar = (boss->health / 601.0f) * 255.0f; + gBossHealthBar = (this->health / 601.0f) * 255.0f; } } } @@ -2265,100 +2304,100 @@ void Corneria_8018C19C(Boss* boss) { static Vec3f D_i1_80199A6C = { -270.0f, 0.0f, 200.0f }; static Vec3f D_i1_80199A78 = { 440.0f, 0.0f, 0.0f }; -void Corneria_8018DDAC(Boss* boss) { +void Corneria_Boss294_Update(Boss294* this) { Vec3f sp4C; Vec3f sp40; s32 i; - switch (boss->state) { + switch (this->state) { case 0: - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; - if (boss->dmgPart == 0) { - if (boss->fwork[2] > 60.0f) { - if (boss->health != 0) { - boss->timer_05C = 15; - boss->health -= boss->damage; - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, boss->sfxSource, 4); - if (boss->health <= 0) { - gBosses[0].swork[8]--; - if (gBosses[0].swork[8] != 0) { + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if (this->dmgPart == 0) { + if (this->fwork[2] > 60.0f) { + if (this->health != 0) { + this->timer_05C = 15; + this->health -= this->damage; + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); + if (this->health <= 0) { + gBosses[CARRIER_0].swork[8]--; + if (gBosses[CARRIER_0].swork[8] != 0) { Radio_PlayMessage(gMsg_ID_15130, RCID_FALCO); } else { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); } - boss->info.cullDistance = 300.0f; + this->info.cullDistance = 300.0f; - gBosses[0].fwork[14] = 25.0f; - gBosses[0].fwork[15] = 0.0f; + gBosses[CARRIER_0].fwork[14] = 25.0f; + gBosses[CARRIER_0].fwork[15] = 0.0f; - AUDIO_PLAY_SFX(NA_SE_EN_PARTS_BROKEN, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_PARTS_BROKEN, this->sfxSource, 4); - if (gBosses[0].swork[10] != 0) { - gBosses[0].swork[10]--; + if (gBosses[CARRIER_0].swork[10] != 0) { + gBosses[CARRIER_0].swork[10]--; } - gBosses[0].timer_056 = 30; - boss->state = 1; + gBosses[CARRIER_0].timer_056 = 30; + this->state = 1; Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A6C, &sp4C); for (i = 0; i < 10; i++) { - func_effect_80079618(boss->obj.pos.x + sp4C.x, boss->obj.pos.y + sp4C.y, - boss->obj.pos.z + sp4C.z, 1.0f); + func_effect_80079618(this->obj.pos.x + sp4C.x, this->obj.pos.y + sp4C.y, + this->obj.pos.z + sp4C.z, 1.0f); } - if ((gBosses[2].state == 1) && (gBosses[3].state == 1)) { - gBosses[0].fwork[14] = 335.0f; + if ((gBosses[CARRIER_2].state == 1) && (gBosses[CARRIER_3].state == 1)) { + gBosses[CARRIER_0].fwork[14] = 335.0f; } } } } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - boss->obj.rot.x = gBosses[0].obj.rot.x; - boss->obj.rot.y = gBosses[0].obj.rot.y; - boss->obj.rot.z = gBosses[0].obj.rot.z; + this->obj.rot.x = gBosses[CARRIER_0].obj.rot.x; + this->obj.rot.y = gBosses[CARRIER_0].obj.rot.y; + this->obj.rot.z = gBosses[CARRIER_0].obj.rot.z; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A78, &sp40); - boss->obj.pos.x = gBosses[0].obj.pos.x + sp40.x; - boss->obj.pos.y = gBosses[0].obj.pos.y + sp40.y; - boss->obj.pos.z = gBosses[0].obj.pos.z + sp40.z; + this->obj.pos.x = gBosses[CARRIER_0].obj.pos.x + sp40.x; + this->obj.pos.y = gBosses[CARRIER_0].obj.pos.y + sp40.y; + this->obj.pos.z = gBosses[CARRIER_0].obj.pos.z + sp40.z; - boss->fwork[2] = gBosses[0].fwork[2]; + this->fwork[2] = gBosses[CARRIER_0].fwork[2]; break; case 1: - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_NEW); - gBosses[0].fwork[15] += 0.5f; + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_NEW); + gBosses[CARRIER_0].fwork[15] += 0.5f; if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { - boss->timer_05C = 4; + this->timer_05C = 4; } - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A6C, &sp4C); - func_effect_8007C120(boss->obj.pos.x + sp4C.x, boss->obj.pos.y + sp4C.y, boss->obj.pos.z + sp4C.z, - boss->vel.x, boss->vel.y, boss->vel.z, 0.2f, 10); + func_effect_8007C120(this->obj.pos.x + sp4C.x, this->obj.pos.y + sp4C.y, this->obj.pos.z + sp4C.z, + this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); } - if (boss->obj.pos.y < (gGroundHeight + 150.0f)) { - if (boss->swork[0] == 0) { - boss->vel.y = -5.0f; - boss->swork[0] = 1; - boss->gravity = 0.0f; - Corneria_8018C0B0(boss); - AUDIO_PLAY_SFX(NA_SE_OB_WATER_BOUND_M, boss->sfxSource, 4); + if (this->obj.pos.y < (gGroundHeight + 150.0f)) { + if (this->swork[0] == 0) { + this->vel.y = -5.0f; + this->swork[0] = 1; + this->gravity = 0.0f; + Corneria_8018C0B0(this); + AUDIO_PLAY_SFX(NA_SE_OB_WATER_BOUND_M, this->sfxSource, 4); } } else { - boss->obj.rot.z -= 2.0f; - boss->gravity = 1.0f; + this->obj.rot.z -= 2.0f; + this->gravity = 1.0f; } break; } @@ -2367,106 +2406,106 @@ void Corneria_8018DDAC(Boss* boss) { static Vec3f D_i1_80199A84 = { 20.0f, -90.0f, 0.0f }; static Vec3f D_i1_80199A90 = { -440.0f, 210.0f, 0.0f }; -void Corneria_8018E290(Boss* boss) { +void Corneria_Boss295_Update(Boss295* this) { Vec3f sp4C; Vec3f sp40; s32 i; - switch (boss->state) { + switch (this->state) { case 0: - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; - if (boss->dmgPart == 2) { - if (boss->fwork[0] > 60.0f) { - if (boss->health != 0) { - boss->timer_05C = 15; - boss->health -= boss->damage; + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if (this->dmgPart == 2) { + if (this->fwork[0] > 60.0f) { + if (this->health != 0) { + this->timer_05C = 15; + this->health -= this->damage; - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); - if (boss->health <= 0) { - gBosses[0].swork[8]--; + if (this->health <= 0) { + gBosses[CARRIER_0].swork[8]--; - if (gBosses[0].swork[8] != 0) { + if (gBosses[CARRIER_0].swork[8] != 0) { Radio_PlayMessage(gMsg_ID_15130, RCID_FALCO); } else { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); } - boss->info.cullDistance = 300.0f; + this->info.cullDistance = 300.0f; - gBosses[0].fwork[15] = 0.0f; - gBosses[0].fwork[14] = 335.0f; - boss->health = 0; + gBosses[CARRIER_0].fwork[15] = 0.0f; + gBosses[CARRIER_0].fwork[14] = 335.0f; + this->health = 0; - AUDIO_PLAY_SFX(NA_SE_EN_PARTS_BROKEN, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_PARTS_BROKEN, this->sfxSource, 4); - if (gBosses[0].swork[10] != 0) { - gBosses[0].swork[10]--; + if (gBosses[CARRIER_0].swork[10] != 0) { + gBosses[CARRIER_0].swork[10]--; } - gBosses[0].timer_056 = 30; - boss->state = 1; + gBosses[CARRIER_0].timer_056 = 30; + this->state = 1; Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A84, &sp4C); for (i = 0; i < 10; i++) { - func_effect_80079618(boss->obj.pos.x + sp4C.x, boss->obj.pos.y + sp4C.y, - boss->obj.pos.z + sp4C.z, 1.0f); + func_effect_80079618(this->obj.pos.x + sp4C.x, this->obj.pos.y + sp4C.y, + this->obj.pos.z + sp4C.z, 1.0f); } - if (gBosses[1].state == 1) { - gBosses[0].fwork[14] = 25.0f; + if (gBosses[CARRIER_1].state == 1) { + gBosses[CARRIER_0].fwork[14] = 25.0f; } } } } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - boss->obj.rot.x = gBosses[0].obj.rot.x; - boss->obj.rot.y = gBosses[0].obj.rot.y; - boss->obj.rot.z = gBosses[0].obj.rot.z; + this->obj.rot.x = gBosses[CARRIER_0].obj.rot.x; + this->obj.rot.y = gBosses[CARRIER_0].obj.rot.y; + this->obj.rot.z = gBosses[CARRIER_0].obj.rot.z; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A90, &sp40); - boss->obj.pos.x = gBosses[0].obj.pos.x + sp40.x; - boss->obj.pos.y = gBosses[0].obj.pos.y + sp40.y; - boss->obj.pos.z = gBosses[0].obj.pos.z + sp40.z; + this->obj.pos.x = gBosses[CARRIER_0].obj.pos.x + sp40.x; + this->obj.pos.y = gBosses[CARRIER_0].obj.pos.y + sp40.y; + this->obj.pos.z = gBosses[CARRIER_0].obj.pos.z + sp40.z; - boss->fwork[0] = gBosses[0].fwork[0]; + this->fwork[0] = gBosses[CARRIER_0].fwork[0]; break; case 1: - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_NEW); - gBosses[0].fwork[15] += 0.5f; + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_NEW); + gBosses[CARRIER_0].fwork[15] += 0.5f; if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { - boss->timer_05C = 4; + this->timer_05C = 4; } - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A84, &sp4C); - func_effect_8007C120(boss->obj.pos.x + sp4C.x, boss->obj.pos.y + sp4C.y, boss->obj.pos.z + sp4C.z, - boss->vel.x, boss->vel.y, boss->vel.z, 0.2f, 10); + func_effect_8007C120(this->obj.pos.x + sp4C.x, this->obj.pos.y + sp4C.y, this->obj.pos.z + sp4C.z, + this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); } - if (boss->obj.pos.y < (gGroundHeight + 150.0f)) { - if (boss->swork[0] == 0) { - boss->vel.y = -5.0f; - boss->swork[0] = 1; - boss->gravity = 0.0f; - Corneria_8018C0B0(boss); - AUDIO_PLAY_SFX(NA_SE_OB_WATER_BOUND_M, boss->sfxSource, 4); + if (this->obj.pos.y < (gGroundHeight + 150.0f)) { + if (this->swork[0] == 0) { + this->vel.y = -5.0f; + this->swork[0] = 1; + this->gravity = 0.0f; + Corneria_8018C0B0(this); + AUDIO_PLAY_SFX(NA_SE_OB_WATER_BOUND_M, this->sfxSource, 4); } } else { - boss->obj.rot.z -= 2.0f; - boss->gravity = 1.0f; + this->obj.rot.z -= 2.0f; + this->gravity = 1.0f; } break; } @@ -2475,115 +2514,115 @@ void Corneria_8018E290(Boss* boss) { static Vec3f D_i1_80199A9C = { 20.0f, 90.0f, 0.0f }; static Vec3f D_i1_80199AA8 = { -440.0f, -210.0f, 0.0f }; -void Corneria_8018E76C(Boss* boss) { +void Corneria_Boss296_Update(Boss296* this) { Vec3f sp4C; Vec3f sp40; s32 i; - switch (boss->state) { + switch (this->state) { case 0: - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; - if (boss->dmgPart == 2) { - if (boss->fwork[1] > 60.0f) { - if (boss->health != 0) { - boss->timer_05C = 15; - boss->health -= boss->damage; + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if (this->dmgPart == 2) { + if (this->fwork[1] > 60.0f) { + if (this->health != 0) { + this->timer_05C = 15; + this->health -= this->damage; - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); - if (boss->health <= 0) { - gBosses[0].swork[8]--; - if (gBosses[0].swork[8] != 0) { + if (this->health <= 0) { + gBosses[CARRIER_0].swork[8]--; + if (gBosses[CARRIER_0].swork[8] != 0) { Radio_PlayMessage(gMsg_ID_15130, RCID_FALCO); } else { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); } - boss->info.cullDistance = 300.0f; + this->info.cullDistance = 300.0f; - gBosses[0].fwork[15] = 0.0f; - gBosses[0].fwork[14] = 335.0f; + gBosses[CARRIER_0].fwork[15] = 0.0f; + gBosses[CARRIER_0].fwork[14] = 335.0f; - boss->health = 0; + this->health = 0; - AUDIO_PLAY_SFX(NA_SE_EN_PARTS_BROKEN, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_PARTS_BROKEN, this->sfxSource, 4); - if (gBosses[0].swork[10] != 0) { - gBosses[0].swork[10]--; + if (gBosses[CARRIER_0].swork[10] != 0) { + gBosses[CARRIER_0].swork[10]--; } - gBosses[0].timer_056 = 30; - boss->state = 1; - gBosses[0].fwork[6] = 500.0f; + gBosses[CARRIER_0].timer_056 = 30; + this->state = 1; + gBosses[CARRIER_0].fwork[6] = 500.0f; Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A9C, &sp4C); for (i = 0; i < 10; i++) { - func_effect_80079618(boss->obj.pos.x + sp4C.x, boss->obj.pos.y + sp4C.y, - boss->obj.pos.z + sp4C.z, 1.0f); + func_effect_80079618(this->obj.pos.x + sp4C.x, this->obj.pos.y + sp4C.y, + this->obj.pos.z + sp4C.z, 1.0f); } - if (gBosses[1].state == 1) { - gBosses[0].fwork[14] = 25.0f; + if (gBosses[CARRIER_1].state == 1) { + gBosses[CARRIER_0].fwork[14] = 25.0f; } } } } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - boss->obj.rot.x = gBosses[0].obj.rot.x; - boss->obj.rot.y = gBosses[0].obj.rot.y; - boss->obj.rot.z = gBosses[0].obj.rot.z; + this->obj.rot.x = gBosses[CARRIER_0].obj.rot.x; + this->obj.rot.y = gBosses[CARRIER_0].obj.rot.y; + this->obj.rot.z = gBosses[CARRIER_0].obj.rot.z; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199AA8, &sp40); - boss->obj.pos.x = gBosses[0].obj.pos.x + sp40.x; - boss->obj.pos.y = gBosses[0].obj.pos.y + sp40.y; - boss->obj.pos.z = gBosses[0].obj.pos.z + sp40.z; + this->obj.pos.x = gBosses[CARRIER_0].obj.pos.x + sp40.x; + this->obj.pos.y = gBosses[CARRIER_0].obj.pos.y + sp40.y; + this->obj.pos.z = gBosses[CARRIER_0].obj.pos.z + sp40.z; - boss->fwork[1] = gBosses[0].fwork[1]; + this->fwork[1] = gBosses[CARRIER_0].fwork[1]; break; case 1: - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_NEW); - gBosses[0].fwork[15] += 0.5f; + gBosses[CARRIER_0].fwork[15] += 0.5f; if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { - boss->timer_05C = 4; + this->timer_05C = 4; } - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A9C, &sp4C); - func_effect_8007C120(boss->obj.pos.x + sp4C.x, boss->obj.pos.y + sp4C.y, boss->obj.pos.z + sp4C.z, - boss->vel.x, boss->vel.y, boss->vel.z, 0.2f, 10); + func_effect_8007C120(this->obj.pos.x + sp4C.x, this->obj.pos.y + sp4C.y, this->obj.pos.z + sp4C.z, + this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); } - if (boss->obj.pos.y < (gGroundHeight + 150.0f)) { - if (boss->swork[0] == 0) { - boss->vel.y = -5.0f; - boss->swork[0] = 1; - boss->gravity = 0.0f; - Corneria_8018C0B0(boss); - AUDIO_PLAY_SFX(NA_SE_OB_WATER_BOUND_M, boss->sfxSource, 4); + if (this->obj.pos.y < (gGroundHeight + 150.0f)) { + if (this->swork[0] == 0) { + this->vel.y = -5.0f; + this->swork[0] = 1; + this->gravity = 0.0f; + Corneria_8018C0B0(this); + AUDIO_PLAY_SFX(NA_SE_OB_WATER_BOUND_M, this->sfxSource, 4); } } else { - boss->obj.rot.z -= 2.0f; - boss->gravity = 1.0f; + this->obj.rot.z -= 2.0f; + this->gravity = 1.0f; } break; } } -bool Corneria_8018EC54(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - if ((limbIndex == 10) && (gBosses[2].state != 0) && (gBosses[3].state != 0)) { +bool Corneria_Carrier_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + if ((limbIndex == 10) && (gBosses[CARRIER_2].state != 0) && (gBosses[CARRIER_3].state != 0)) { *dList = NULL; } if ((limbIndex != 12) && (limbIndex != 10)) { @@ -2592,12 +2631,13 @@ bool Corneria_8018EC54(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Corneria_8018ECAC(Boss* boss) { - Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); - Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EC54, NULL, &boss->index, &gIdentityMatrix); +void Corneria_Carrier_Draw(Carrier* this) { + Animation_GetFrameData(&D_CO_602D400, 0, this->vwork); + Animation_DrawSkeleton(1, aCoCarrierSkel, this->vwork, Corneria_Carrier_OverrideLimbDraw, NULL, &this->index, + &gIdentityMatrix); } -bool Corneria_8018ED1C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_Boss294_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 5) { rot->y -= gBosses[*(s32*) data].fwork[2]; } @@ -2607,14 +2647,15 @@ bool Corneria_8018ED1C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Corneria_8018ED78(Boss* boss) { +void Corneria_Boss294_Draw(Boss294* this) { Matrix_Translate(gGfxMatrix, -D_i1_80199A78.x, -D_i1_80199A78.y, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); - Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018ED1C, NULL, &boss->index, &gIdentityMatrix); + Animation_GetFrameData(&D_CO_602D400, 0, this->vwork); + Animation_DrawSkeleton(1, aCoCarrierSkel, this->vwork, Corneria_Boss294_OverrideLimbDraw, NULL, &this->index, + &gIdentityMatrix); } -bool Corneria_8018EE2C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_Boss295_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 1) { rot->z -= gBosses[*(s32*) data].fwork[0]; } @@ -2624,14 +2665,15 @@ bool Corneria_8018EE2C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Corneria_8018EE84(Boss* boss) { +void Corneria_Boss295_Draw(Boss295* this) { Matrix_Translate(gGfxMatrix, -D_i1_80199A90.x, -D_i1_80199A90.y, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); - Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EE2C, NULL, &boss->index, &gIdentityMatrix); + Animation_GetFrameData(&D_CO_602D400, 0, this->vwork); + Animation_DrawSkeleton(1, aCoCarrierSkel, this->vwork, Corneria_Boss295_OverrideLimbDraw, NULL, &this->index, + &gIdentityMatrix); } -bool Corneria_8018EF38(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool Corneria_Boss296_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if (limbIndex == 3) { rot->z -= gBosses[*(s32*) data].fwork[1]; } @@ -2641,14 +2683,15 @@ bool Corneria_8018EF38(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Corneria_8018EF90(Boss* boss) { +void Corneria_Boss296_Draw(Boss296* this) { Matrix_Translate(gGfxMatrix, -D_i1_80199AA8.x, -D_i1_80199AA8.y, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); - Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EF38, NULL, &boss->index, &gIdentityMatrix); + Animation_GetFrameData(&D_CO_602D400, 0, this->vwork); + Animation_DrawSkeleton(1, aCoCarrierSkel, this->vwork, Corneria_Boss296_OverrideLimbDraw, NULL, &this->index, + &gIdentityMatrix); } -void Corneria_8018F044(Scenery* scenery) { +void Corneria_Doors_Update(CoDoors* scenery) { switch (scenery->state) { case 0: if (scenery->dmgType != DMG_NONE) { @@ -2676,8 +2719,8 @@ void Corneria_8018F044(Scenery* scenery) { } } -bool Corneria_8018F1C8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Scenery* scenery = (Scenery*) data; +bool Corneria_Doors_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + CoDoors* scenery = (CoDoors*) data; RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -2699,156 +2742,160 @@ bool Corneria_8018F1C8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return 0; } -void Corneria_8018F31C(Scenery* scenery) { - Vec3f sp28[10]; +void Corneria_Doors_Draw(CoDoors* this) { + Vec3f jointTable[10]; - Animation_GetFrameData(&D_CO_602AA7C, 0, sp28); - Animation_DrawSkeleton(3, D_CO_602AB48, sp28, Corneria_8018F1C8, NULL, scenery, gCalcMatrix); + Animation_GetFrameData(&D_CO_602AA7C, 0, jointTable); + Animation_DrawSkeleton(3, aCoDoorsSkel, jointTable, Corneria_Doors_OverrideLimbDraw, NULL, this, gCalcMatrix); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } -void Corneria_8018F3BC(Scenery* scenery, f32 arg1) { +// Initializer called by unused function +void Corneria_InitTerrainBumps(Scenery* scenery, f32 xPosOffset) { Scenery_Initialize(scenery); scenery->obj.status = OBJ_INIT; - scenery->obj.pos.x = RAND_FLOAT_CENTERED(1000.0f) + arg1; + scenery->obj.pos.x = RAND_FLOAT_CENTERED(1000.0f) + xPosOffset; scenery->obj.rot.y = RAND_FLOAT(90.0f) + 45.0f; - if (arg1 > 0.0f) { + if (xPosOffset > 0.0f) { scenery->obj.rot.y *= -1.0f; } scenery->obj.pos.y = 0.0f; - scenery->obj.id = OBJ_SCENERY_1; + scenery->obj.id = OBJ_SCENERY_CO_BUMP_1; scenery->effectVel.z = 60.0f; Object_SetInfo(&scenery->info, scenery->obj.id); scenery->obj.pos.z = -2000.0f; scenery->info.cullDistance = 15000.0f; } -void Corneria_8018F4A4(void) { +// Unused, seems to be creating some terrain bumps during the intro cutscene. +void Corneria_SpawnTerrainBumps(void) { s32 i; - if (((gGameFrameCount % 16) == 0) && !(gPlayer[0].csState < 4)) { + if (((gGameFrameCount % 16) == 0) && (gPlayer[0].csState >= 4)) { for (i = 0; i < ARRAY_COUNT(gScenery); i++) { if (gScenery[i].obj.status == OBJ_FREE) { - Corneria_8018F3BC(&gScenery[i], 4000.0f); + Corneria_InitTerrainBumps(&gScenery[i], 4000.0f); break; } } for (i = 0; i < ARRAY_COUNT(gScenery); i++) { if (gScenery[i].obj.status == OBJ_FREE) { - Corneria_8018F3BC(&gScenery[i], -4000.0f); + Corneria_InitTerrainBumps(&gScenery[i], -4000.0f); break; } } } } -void Corneria_8018F55C(Effect* effect) { - - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.pos.x = gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(500.0f); - effect->obj.pos.y = gPlayer[0].cam.eye.y + RAND_RANGE(-280.0f, 70.0f); - effect->obj.id = OBJ_EFFECT_352; - effect->timer_50 = 80; - effect->unk_46 = 144; - effect->obj.pos.z = -4000.0f; - effect->vel.z = 60.0f; - effect->scale2 = 10.0f + RAND_FLOAT(15.0f); +void Corneria_InitClouds(Clouds* this) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.pos.x = gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(500.0f); + this->obj.pos.y = gPlayer[0].cam.eye.y + RAND_RANGE(-280.0f, 70.0f); + this->obj.id = OBJ_EFFECT_CLOUDS; + this->timer_50 = 80; + this->unk_46 = 144; + this->obj.pos.z = -4000.0f; + this->vel.z = 60.0f; + this->scale2 = 10.0f + RAND_FLOAT(15.0f); if (Rand_ZeroOne() < 0.5f) { - effect->obj.rot.z = 180.0f; + this->obj.rot.z = 180.0f; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } -void Corneria_8018F678(void) { +void Corneria_SpawnClouds(void) { s32 i; if (((gGameFrameCount % 32) == 0) && gPlayer[0].pos.x == 0.0f) { for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - Corneria_8018F55C(&gEffects[i]); - return; + Corneria_InitClouds(&gEffects[i]); + break; } } } } -static f32 D_i1_80199AB4[3] = { 180.0f, -180.0f, 0.0f }; +static f32 sCoLevelStartTeamXpos[3] = { 180.0f, -180.0f, 0.0f }; -static f32 D_i1_80199AC0[3] = { 200.0f, 140.0f, 200.0f }; +static f32 sCoLevelStartTeamYpos[3] = { 200.0f, 140.0f, 200.0f }; -static f32 D_i1_80199ACC[3] = { 160.0f, 160.0f, 320.0f }; +static f32 sCoLevelStartTeamZpos[3] = { 160.0f, 160.0f, 320.0f }; -static f32 D_i1_80199AD8[3] = { -60.0f, 60.0f, -45.0f }; +static f32 sCoLevelStartTeamZrot[3] = { -60.0f, 60.0f, -45.0f }; -void Corneria_8018F6F8(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; +void Corneria_CsSFTeamUpdate(ActorCutscene* this, s32 teamIdx) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = (D_i1_80199AB4[arg1] * 4.0f) + gPlayer[0].pos.x; - actor->obj.pos.y = (D_i1_80199AC0[arg1] * 2.0f) + gPlayer[0].pos.y; - actor->obj.pos.z = (D_i1_80199ACC[arg1] * 3.0f) + gPlayer[0].trueZpos; + this->obj.pos.x = (sCoLevelStartTeamXpos[teamIdx] * 4.0f) + gPlayer[0].pos.x; + this->obj.pos.y = (sCoLevelStartTeamYpos[teamIdx] * 2.0f) + gPlayer[0].pos.y; + this->obj.pos.z = (sCoLevelStartTeamZpos[teamIdx] * 3.0f) + gPlayer[0].trueZpos; - actor->vwork[20].x = D_i1_80199AB4[arg1] + gPlayer[0].pos.x; - actor->vwork[20].y = gPlayer[0].pos.y; - actor->vwork[20].z = D_i1_80199ACC[arg1] + gPlayer[0].trueZpos; + this->vwork[20].x = sCoLevelStartTeamXpos[teamIdx] + gPlayer[0].pos.x; + this->vwork[20].y = gPlayer[0].pos.y; + this->vwork[20].z = sCoLevelStartTeamZpos[teamIdx] + gPlayer[0].trueZpos; - actor->obj.rot.z = D_i1_80199AD8[arg1]; - actor->obj.rot.y = 180.0f; + this->obj.rot.z = sCoLevelStartTeamZrot[teamIdx]; + this->obj.rot.y = 180.0f; - actor->state = 100; - actor->fwork[0] = RAND_FLOAT(360.0f); + this->state = 100; + this->fwork[0] = RAND_FLOAT(360.0f); - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); - actor->drawShadow = true; - actor->iwork[11] = 1; - actor->info.cullDistance = 200.0f; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->drawShadow = true; + this->iwork[11] = 1; + this->info.cullDistance = 200.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } void Corneria_LevelStart(Player* player) { s32 i; - Actor* actor0 = &gActors[0]; - Actor* actor1 = &gActors[1]; - Actor* actor2 = &gActors[2]; + ActorCutscene* falco = &gActors[0]; + ActorCutscene* slippy = &gActors[1]; + ActorCutscene* peppy = &gActors[2]; f32 sp44; f32 sp40; - f32 sp3C; - f32 sp38; - f32 sp34; + f32 x; + f32 y; + f32 z; f32 sp30; f32 sp2C; + PRINTF("Enms[1].obj.mode %d\n", gActors[1].obj.status); + if (gCsFrameCount < 815) { - sp3C = player->pos.x; - sp38 = player->pos.y + 15.0f; - sp34 = player->trueZpos - 20.0f; + x = player->pos.x; + y = player->pos.y + 15.0f; + z = player->trueZpos - 20.0f; } else { if (gCsFrameCount < 1009) { - sp3C = actor0->obj.pos.x; - sp38 = actor0->obj.pos.y + 15.0f; - sp34 = actor0->obj.pos.z - 20.0f; + x = falco->obj.pos.x; + y = falco->obj.pos.y + 15.0f; + z = falco->obj.pos.z - 20.0f; } else if (gCsFrameCount < 1198) { - sp3C = actor2->obj.pos.x; - sp38 = actor2->obj.pos.y + 15.0f; - sp34 = actor2->obj.pos.z - 20.0f; + x = peppy->obj.pos.x; + y = peppy->obj.pos.y + 15.0f; + z = peppy->obj.pos.z - 20.0f; } else { - sp3C = actor1->obj.pos.x; - sp38 = actor1->obj.pos.y + 15.0f; - sp34 = actor1->obj.pos.z - 20.0f; + x = slippy->obj.pos.x; + y = slippy->obj.pos.y + 15.0f; + z = slippy->obj.pos.z - 20.0f; } } - sp2C = -Math_Atan2F(player->cam.eye.x - sp3C, player->cam.eye.z - sp34); - sp30 = -Math_Atan2F(player->cam.eye.y - sp38, sqrtf(SQ(player->cam.eye.z - sp34) + SQ(player->cam.eye.x - sp3C))); + sp2C = -Math_Atan2F(player->cam.eye.x - x, player->cam.eye.z - z); + sp30 = -Math_Atan2F(player->cam.eye.y - y, sqrtf(SQ(player->cam.eye.z - z) + SQ(player->cam.eye.x - x))); + sp44 = Math_RadToDeg(sp2C) - D_ctx_80177A48[4]; sp40 = Math_RadToDeg(sp30) - D_ctx_80177A48[5]; @@ -2884,7 +2931,7 @@ void Corneria_LevelStart(Player* player) { } } - for (i = 0; (i < 40 && D_ctx_80177A48[7] >= 0.3f); i++, D_ctx_80177A48[7] -= 0.3f) { + for (i = 0; (i < 40) && (D_ctx_80177A48[7] >= 0.3f); i++, D_ctx_80177A48[7] -= 0.3f) { if (sp40 >= 0) { Texture_Scroll(D_arwing_30184D8, 64, 32, 0); } else { @@ -2910,7 +2957,7 @@ void Corneria_LevelStart(Player* player) { player->rockPhase += 3.0f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; - Corneria_8018F678(); + Corneria_SpawnClouds(); player->wings.unk_30 = 0; @@ -2922,13 +2969,13 @@ void Corneria_LevelStart(Player* player) { player->pos.y = 6000.0f; player->pos.x = 0.1f; - Corneria_8018F6F8(&gActors[0], 0); - Corneria_8018F6F8(&gActors[1], 1); - Corneria_8018F6F8(&gActors[2], 2); + Corneria_CsSFTeamUpdate(falco, 0); + Corneria_CsSFTeamUpdate(slippy, 1); + Corneria_CsSFTeamUpdate(peppy, 2); - actor0->iwork[14] = 2; - actor1->iwork[14] = 3; - actor2->iwork[14] = 4; + falco->iwork[14] = 2; + slippy->iwork[14] = 3; + peppy->iwork[14] = 4; player->cam.eye.x = gCsCamEyeX = player->pos.x - 400.0f; gPlayer[0].cam.eye.y = gCsCamEyeY = player->pos.y + 600.0f; @@ -3022,20 +3069,20 @@ void Corneria_LevelStart(Player* player) { player->csState = 3; player->csTimer = 180; player->unk_004 = 0.0f; - actor0->state = 0; - actor2->state = 0; - actor1->state = 0; - actor0->obj.pos.y = player->pos.y + 80.0f; - actor0->obj.pos.z += 100.0f; + falco->state = 0; + peppy->state = 0; + slippy->state = 0; + falco->obj.pos.y = player->pos.y + 80.0f; + falco->obj.pos.z += 100.0f; } - if (gMsgCharIsPrinting && (gGameFrameCount & 2)) { + if (gMsgCharIsPrinting && ((gGameFrameCount & 2) != 0)) { player->wings.unk_30 = 5.0f; } break; case 3: - if (fabsf(Math_SmoothStepToF(&actor0->obj.pos.z, player->pos.z + 100.0f, 0.05f, 5.0f, 0.0f)) < 1.0f) { + if (fabsf(Math_SmoothStepToF(&falco->obj.pos.z, player->pos.z + 100.0f, 0.05f, 5.0f, 0.0f)) < 1.0f) { player->csState = 4; D_ctx_80177A48[0] = 0.0f; player->csTimer = 190; @@ -3056,13 +3103,13 @@ void Corneria_LevelStart(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f); - gCsCamEyeX = actor0->obj.pos.x - 50.0f; - gCsCamEyeY = actor0->obj.pos.y + 10.0f; - gCsCamEyeZ = actor0->obj.pos.z - 10.0f; + gCsCamEyeX = falco->obj.pos.x - 50.0f; + gCsCamEyeY = falco->obj.pos.y + 10.0f; + gCsCamEyeZ = falco->obj.pos.z - 10.0f; - gCsCamAtX = actor0->obj.pos.x; - gCsCamAtY = actor0->obj.pos.y + 10.0f; - gCsCamAtZ = actor0->obj.pos.z + 10.0f; + gCsCamAtX = falco->obj.pos.x; + gCsCamAtY = falco->obj.pos.y + 10.0f; + gCsCamAtZ = falco->obj.pos.z + 10.0f; if (player->csTimer == 0) { player->csState = 5; @@ -3074,18 +3121,18 @@ void Corneria_LevelStart(Player* player) { } if (player->csTimer < 100) { - Math_SmoothStepToF(&actor0->fwork[19], 50.0f, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToF(&falco->fwork[19], 50.0f, 0.1f, 3.0f, 0.01f); } - actor0->fwork[20] = 0.0f; + falco->fwork[20] = 0.0f; if (gMsgCharIsPrinting && ((gGameFrameCount & 2) != 0)) { - actor0->fwork[20] = 5.0f; + falco->fwork[20] = 5.0f; } break; case 5: - Math_SmoothStepToF(&actor0->fwork[19], 0, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToF(&falco->fwork[19], 0, 0.1f, 3.0f, 0.01f); if (player->csTimer == 0) { player->csState = 6; @@ -3093,53 +3140,53 @@ void Corneria_LevelStart(Player* player) { player->csTimer = 190; } - gCsCamEyeY = actor0->obj.pos.y + 10.0f; - gCsCamAtY = actor0->obj.pos.y + 10.0f; + gCsCamEyeY = falco->obj.pos.y + 10.0f; + gCsCamAtY = falco->obj.pos.y + 10.0f; break; case 6: - Math_SmoothStepToF(&actor0->fwork[19], 0.0f, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToF(&falco->fwork[19], 0.0f, 0.1f, 3.0f, 0.01f); Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f); D_ctx_80177A48[3] -= 0.5f; - gCsCamEyeX = actor2->obj.pos.x + 100.0f + D_ctx_80177A48[3]; - gCsCamEyeY = actor2->obj.pos.y + 10.0f; - gCsCamEyeZ = actor2->obj.pos.z - 70.0f; + gCsCamEyeX = peppy->obj.pos.x + 100.0f + D_ctx_80177A48[3]; + gCsCamEyeY = peppy->obj.pos.y + 10.0f; + gCsCamEyeZ = peppy->obj.pos.z - 70.0f; - gCsCamAtX = actor2->obj.pos.x + 20.0f + (D_ctx_80177A48[3] * 0.5f); - gCsCamAtY = actor2->obj.pos.y + 10.0f; - gCsCamAtZ = actor2->obj.pos.z + 10.0f; + gCsCamAtX = peppy->obj.pos.x + 20.0f + (D_ctx_80177A48[3] * 0.5f); + gCsCamAtY = peppy->obj.pos.y + 10.0f; + gCsCamAtZ = peppy->obj.pos.z + 10.0f; if (player->csTimer == 0) { player->csState = 7; player->csTimer = 190; D_ctx_80177A48[0] = 0.0f; - actor0->obj.pos.y = player->pos.y; - actor0->obj.pos.z = player->trueZpos + 240.0f; + falco->obj.pos.y = player->pos.y; + falco->obj.pos.z = player->trueZpos + 240.0f; } if (player->csTimer == 80) { Radio_PlayMessage(gMsg_ID_2030, RCID_PEPPY); } - actor2->fwork[20] = 0.0f; + peppy->fwork[20] = 0.0f; if (gMsgCharIsPrinting && ((gGameFrameCount & 2) != 0)) { - actor2->fwork[20] = 5.0f; + peppy->fwork[20] = 5.0f; } break; case 7: Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.001f, 0.0f); - gCsCamEyeX = actor1->obj.pos.x + 20.0f; - gCsCamEyeY = actor1->obj.pos.y + 10.0f; - gCsCamEyeZ = actor1->obj.pos.z - 50.0f; + gCsCamEyeX = slippy->obj.pos.x + 20.0f; + gCsCamEyeY = slippy->obj.pos.y + 10.0f; + gCsCamEyeZ = slippy->obj.pos.z - 50.0f; - gCsCamAtX = actor1->obj.pos.x + 10.0f; - gCsCamAtY = actor1->obj.pos.y + 10.0f; - gCsCamAtZ = actor1->obj.pos.z + 10.0f; + gCsCamAtX = slippy->obj.pos.x + 10.0f; + gCsCamAtY = slippy->obj.pos.y + 10.0f; + gCsCamAtZ = slippy->obj.pos.z + 10.0f; if (player->csTimer == 0) { player->csState = 8; @@ -3155,13 +3202,13 @@ void Corneria_LevelStart(Player* player) { } if (player->csTimer < 100) { - Math_SmoothStepToF(&actor1->fwork[19], -20.0f, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToF(&slippy->fwork[19], -20.0f, 0.1f, 3.0f, 0.01f); } - actor1->fwork[20] = 0.0f; + slippy->fwork[20] = 0.0f; if (gMsgCharIsPrinting && ((gGameFrameCount & 2) != 0)) { - actor1->fwork[20] = 5.0f; + slippy->fwork[20] = 5.0f; } break; @@ -3195,41 +3242,41 @@ void Corneria_LevelStart(Player* player) { } if (player->csTimer == 80) { - actor0->fwork[29] = 5.0f; + falco->fwork[29] = 5.0f; } if (player->csTimer == 60) { - actor1->fwork[29] = 5.0f; + slippy->fwork[29] = 5.0f; } if (player->csTimer == 40) { - actor2->fwork[29] = 5.0f; + peppy->fwork[29] = 5.0f; } if ((player->csTimer > 70) && (player->csTimer < 80)) { - actor0->iwork[11] = 2; + falco->iwork[11] = 2; } if ((player->csTimer > 50) && (player->csTimer < 60)) { - actor1->iwork[11] = 2; + slippy->iwork[11] = 2; } if ((player->csTimer > 30) && (player->csTimer < 40)) { - actor2->iwork[11] = 2; + peppy->iwork[11] = 2; } if (player->csTimer == 70) { - actor0->state = 1; + falco->state = 1; Play_PlaySfxFirstPlayer(player->sfxSource, NA_SE_ARWING_BOOST); } if (player->csTimer == 50) { - actor1->state = 2; + slippy->state = 2; Play_PlaySfxFirstPlayer(player->sfxSource, NA_SE_ARWING_BOOST); } if (player->csTimer == 30) { - actor2->state = 3; + peppy->state = 3; Play_PlaySfxFirstPlayer(player->sfxSource, NA_SE_ARWING_BOOST); } @@ -3264,9 +3311,9 @@ void Corneria_LevelStart(Player* player) { if (gFillScreenAlpha == 255) { AUDIO_PLAY_BGM(gBgmSeqId); - Object_Kill(&actor0->obj, actor0->sfxSource); - Object_Kill(&actor1->obj, actor1->sfxSource); - Object_Kill(&actor2->obj, actor2->sfxSource); + Object_Kill(&falco->obj, falco->sfxSource); + Object_Kill(&slippy->obj, slippy->sfxSource); + Object_Kill(&peppy->obj, peppy->sfxSource); gLevelStartStatusScreenTimer = 80; @@ -3311,12 +3358,12 @@ void Corneria_LevelStart(Player* player) { player->cam.at.y -= 3.0f; player->pos.y -= 3.0f; - actor0->vwork[20].y -= 3.0f; - actor0->obj.pos.y -= 3.0f; - actor2->vwork[20].y -= 3.0f; - actor2->obj.pos.y -= 3.0f; - actor1->vwork[20].y -= 3.0f; - actor1->obj.pos.y -= 3.0f; + falco->vwork[20].y -= 3.0f; + falco->obj.pos.y -= 3.0f; + peppy->vwork[20].y -= 3.0f; + peppy->obj.pos.y -= 3.0f; + slippy->vwork[20].y -= 3.0f; + slippy->obj.pos.y -= 3.0f; } static f32 D_i1_80199AE4[3] = { -1500.0f, 700.0f, 0.0f }; @@ -3333,7 +3380,7 @@ static f32 D_i1_80199B20[3] = { 200.0f, 200.0f, 400.0f }; static f32 D_i1_80199B2C[3] = { 180.0f, -120.0f, 180.0f }; -void Corneria_80190F74(Actor* actor, s32 arg1) { +void Corneria_80190F74(ActorCutscene* this, s32 index) { Vec3f sp5C; Vec3f sp50; Vec3f sp44; @@ -3341,42 +3388,42 @@ void Corneria_80190F74(Actor* actor, s32 arg1) { Player* player = &gPlayer[0]; Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW); - sp5C.x = D_i1_80199AE4[arg1]; - sp5C.y = D_i1_80199AF0[arg1]; - sp5C.z = D_i1_80199AFC[arg1]; + sp5C.x = D_i1_80199AE4[index]; + sp5C.y = D_i1_80199AF0[index]; + sp5C.z = D_i1_80199AFC[index]; - sp44.x = D_i1_80199B08[arg1]; - sp44.y = D_i1_80199B14[arg1]; - sp44.z = D_i1_80199B20[arg1]; + sp44.x = D_i1_80199B08[index]; + sp44.y = D_i1_80199B14[index]; + sp44.z = D_i1_80199B20[index]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp5C, &sp50); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - Actor_Initialize(actor); + Actor_Initialize(this); - actor->obj.pos.x = player->pos.x + sp50.x; - actor->obj.pos.y = player->pos.y + sp50.y; - actor->obj.pos.z = player->pos.z + sp50.z; + this->obj.pos.x = player->pos.x + sp50.x; + this->obj.pos.y = player->pos.y + sp50.y; + this->obj.pos.z = player->pos.z + sp50.z; - actor->fwork[0] = sp38.x; - actor->fwork[1] = sp38.y; - actor->fwork[2] = sp38.z; + this->fwork[0] = sp38.x; + this->fwork[1] = sp38.y; + this->fwork[2] = sp38.z; - actor->fwork[7] = RAND_FLOAT(360.0f); - actor->fwork[8] = RAND_FLOAT(360.0f); + this->fwork[7] = RAND_FLOAT(360.0f); + this->fwork[8] = RAND_FLOAT(360.0f); - actor->vel.x = player->vel.x; - actor->vel.y = player->vel.y; - actor->vel.z = player->vel.z; + this->vel.x = player->vel.x; + this->vel.y = player->vel.y; + this->vel.z = player->vel.z; - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.rot.z = D_i1_80199B2C[arg1]; + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; + this->obj.rot.z = D_i1_80199B2C[index]; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } void Corneria_LevelComplete1(Player* player) { @@ -3412,8 +3459,8 @@ void Corneria_LevelComplete1(Player* player) { case 0: Audio_StopSfxByBankAndSource(1, player->sfxSource); - sp54 = player->cam.eye.x - D_i1_8019B6D8[62]; - sp4C = player->cam.eye.z - D_i1_8019B6D8[64]; + sp54 = player->cam.eye.x - sCoGrangaWork[62]; + sp4C = player->cam.eye.z - sCoGrangaWork[64]; D_ctx_80177A48[0] = Math_RadToDeg(Math_Atan2F(sp54, sp4C)); D_ctx_80177A48[1] = sqrtf(SQ(sp54) + SQ(sp4C)); @@ -3443,15 +3490,15 @@ void Corneria_LevelComplete1(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); - Math_SmoothStepToF(&player->cam.eye.x, D_i1_8019B6D8[62] + sp58.x, 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.y, D_i1_8019B6D8[63] + 100.0f, 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.z, D_i1_8019B6D8[64] + sp58.z, 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.x, D_i1_8019B6D8[62], 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.y, D_i1_8019B6D8[63], 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.z, D_i1_8019B6D8[64], 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, sCoGrangaWork[GRANGA_WORK_62] + sp58.x, 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, sCoGrangaWork[GRANGA_WORK_63] + 100.0f, 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, sCoGrangaWork[GRANGA_WORK_64] + sp58.z, 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, sCoGrangaWork[GRANGA_WORK_62], 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, sCoGrangaWork[GRANGA_WORK_63], 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, sCoGrangaWork[GRANGA_WORK_64], 0.05f, 500.0f, 0.0f); - temp_fa0 = player->pos.x - D_i1_8019B6D8[62]; - temp_fa1 = player->pos.z - D_i1_8019B6D8[64]; + temp_fa0 = player->pos.x - sCoGrangaWork[GRANGA_WORK_62]; + temp_fa1 = player->pos.z - sCoGrangaWork[GRANGA_WORK_64]; if (gCsFrameCount < 30) { temp_deg = Math_RadToDeg(-Math_Atan2F(temp_fa0, temp_fa1)); diff --git a/src/overlays/ovl_i1/fox_tr.c b/src/overlays/ovl_i1/fox_tr.c index 7ce67fdf..5bd61820 100644 --- a/src/overlays/ovl_i1/fox_tr.c +++ b/src/overlays/ovl_i1/fox_tr.c @@ -7,7 +7,7 @@ #include "global.h" #include "assets/ast_training.h" -void Training_801988E0(void) { +void Training_RingPassCount_Draw(void) { if (gRingPassCount != 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_83); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); diff --git a/src/overlays/ovl_i1/fox_tr360.c b/src/overlays/ovl_i1/fox_tr360.c index c2527c7d..6886ba18 100644 --- a/src/overlays/ovl_i1/fox_tr360.c +++ b/src/overlays/ovl_i1/fox_tr360.c @@ -10,7 +10,6 @@ void Training_Setup360(void) { Scenery360* scenery360; s32 i; - gLevelObjects = SEGMENTED_TO_VIRTUAL(D_TR_6008EF8); Rand_SetSeed(1, 29000, 9876); @@ -35,147 +34,148 @@ void Training_Setup360(void) { } } -bool Training_80198DCC(Actor* actor, f32 x, f32 z) { +bool Training_EnemyObstacleCheck(ActorAllRange* this, f32 sinRotY, f32 cosRotY) { Scenery360* scenery360; s32 i; for (i = 0, scenery360 = gScenery360; i < 200;) { if ((scenery360->obj.status == OBJ_ACTIVE) && - (fabsf(scenery360->obj.pos.x - (actor->obj.pos.x + ((x * 650.0f) + 350.0f))) < 1200.0f) && - (fabsf(scenery360->obj.pos.z - (actor->obj.pos.z + ((z * 650.0f) + 350.0f))) < 1200.0f) && - (actor->obj.pos.y < 650.0f)) { + (fabsf(scenery360->obj.pos.x - (this->obj.pos.x + ((sinRotY * 650.0f) + 350.0f))) < 1200.0f) && + (fabsf(scenery360->obj.pos.z - (this->obj.pos.z + ((cosRotY * 650.0f) + 350.0f))) < 1200.0f) && + (this->obj.pos.y < 650.0f)) { return true; } scenery360++; if ((scenery360->obj.status == OBJ_ACTIVE) && - (fabsf(scenery360->obj.pos.x - (actor->obj.pos.x + ((x * 650.0f) + 350.0f))) < 1200.0f) && - (fabsf(scenery360->obj.pos.z - (actor->obj.pos.z + ((z * 650.0f) + 350.0f))) < 1200.0f) && - (actor->obj.pos.y < 650.0f)) { + (fabsf(scenery360->obj.pos.x - (this->obj.pos.x + ((sinRotY * 650.0f) + 350.0f))) < 1200.0f) && + (fabsf(scenery360->obj.pos.z - (this->obj.pos.z + ((cosRotY * 650.0f) + 350.0f))) < 1200.0f) && + (this->obj.pos.y < 650.0f)) { return true; } scenery360++; if ((scenery360->obj.status == OBJ_ACTIVE) && - (fabsf(scenery360->obj.pos.x - (actor->obj.pos.x + ((x * 650.0f) + 350.0f))) < 1200.0f) && - (fabsf(scenery360->obj.pos.z - (actor->obj.pos.z + ((z * 650.0f) + 350.0f))) < 1200.0f) && - (actor->obj.pos.y < 650.0f)) { + (fabsf(scenery360->obj.pos.x - (this->obj.pos.x + ((sinRotY * 650.0f) + 350.0f))) < 1200.0f) && + (fabsf(scenery360->obj.pos.z - (this->obj.pos.z + ((cosRotY * 650.0f) + 350.0f))) < 1200.0f) && + (this->obj.pos.y < 650.0f)) { return true; } scenery360++; if ((scenery360->obj.status == OBJ_ACTIVE) && - (fabsf(scenery360->obj.pos.x - (actor->obj.pos.x + ((x * 650.0f) + 350.0f))) < 1200.0f) && - (fabsf(scenery360->obj.pos.z - (actor->obj.pos.z + ((z * 650.0f) + 350.0f))) < 1200.0f) && - (actor->obj.pos.y < 650.0f)) { + (fabsf(scenery360->obj.pos.x - (this->obj.pos.x + ((sinRotY * 650.0f) + 350.0f))) < 1200.0f) && + (fabsf(scenery360->obj.pos.z - (this->obj.pos.z + ((cosRotY * 650.0f) + 350.0f))) < 1200.0f) && + (this->obj.pos.y < 650.0f)) { return true; } scenery360++; i += 4; } - return false; } -void Training_80199024(Actor* actor) { +void Training_Enemy_Update(ActorAllRange* this) { s32 pad[8]; - Vec3f sp54; - f32 var_fv0; + f32 xPos; + f32 yPos; + f32 zPos; + f32 targetAngle2; RadarMark* radarMark; - f32 temp_fv0; - f32 temp_fv1; - f32 var_fv0_2; - s32 temp_v0; + f32 pad2; + f32 angle; + f32 targetAngle; + bool enemyNearObstacle; f32 sinRotX; f32 sinRotY; f32 cosRotX; f32 cosRotY; - if (actor->timer_0BC == 0) { - sp54.y = RAND_FLOAT(1000.0f); - sp54.z = RAND_FLOAT_CENTERED(10000.0f); - sp54.x = RAND_FLOAT_CENTERED(10000.0f); - actor->fwork[4] = sp54.z; - actor->fwork[5] = sp54.y; - actor->fwork[6] = sp54.x; - actor->timer_0BC = RAND_INT(20.0f) + 10; + if (this->timer_0BC == 0) { + yPos = RAND_FLOAT(1000.0f); + xPos = RAND_FLOAT_CENTERED(10000.0f); + zPos = RAND_FLOAT_CENTERED(10000.0f); + this->fwork[4] = xPos; + this->fwork[5] = yPos; + this->fwork[6] = zPos; + this->timer_0BC = RAND_INT(20.0f) + 10; } - sinRotX = SIN_DEG(actor->obj.rot.x); - cosRotX = COS_DEG(actor->obj.rot.x); - sinRotY = SIN_DEG(actor->obj.rot.y); - cosRotY = COS_DEG(actor->obj.rot.y); + sinRotX = SIN_DEG(this->obj.rot.x); + cosRotX = COS_DEG(this->obj.rot.x); + sinRotY = SIN_DEG(this->obj.rot.y); + cosRotY = COS_DEG(this->obj.rot.y); - sp54.z = actor->fwork[4] - actor->obj.pos.x; - sp54.y = actor->fwork[5] - actor->obj.pos.y; - sp54.x = actor->fwork[6] - actor->obj.pos.z; + xPos = this->fwork[4] - this->obj.pos.x; + yPos = this->fwork[5] - this->obj.pos.y; + zPos = this->fwork[6] - this->obj.pos.z; - if (((actor->index + gGameFrameCount) % 8) == 0) { - actor->fwork[19] = Math_RadToDeg(Math_Atan2F(sp54.z, sp54.x)); - actor->fwork[20] = Math_RadToDeg(Math_Atan2F(sp54.y, sqrtf(SQ(sp54.z) + SQ(sp54.x)))); + if (((this->index + gGameFrameCount) % 8) == 0) { + this->fwork[19] = Math_RadToDeg(Math_Atan2F(xPos, zPos)); + this->fwork[20] = Math_RadToDeg(Math_Atan2F(yPos, sqrtf(SQ(xPos) + SQ(zPos)))); } - var_fv0 = actor->fwork[20]; + targetAngle2 = this->fwork[20]; - temp_v0 = Training_80198DCC(actor, sinRotY, cosRotY); - if (temp_v0 != 0) { - var_fv0 += 40.0f * (f32) temp_v0; - if (var_fv0 >= 360.0f) { - var_fv0 -= 360.0f; + enemyNearObstacle = Training_EnemyObstacleCheck(this, sinRotY, cosRotY); + if (enemyNearObstacle) { + targetAngle2 += 40.0f * (f32) enemyNearObstacle; + if (targetAngle2 >= 360.0f) { + targetAngle2 -= 360.0f; } - if (var_fv0 < 0.0f) { - var_fv0 += 360.0f; + if (targetAngle2 < 0.0f) { + targetAngle2 += 360.0f; } - } else if ((actor->obj.pos.y < (gGroundHeight + 50.0f)) && (var_fv0 > 180.0f)) { - var_fv0 = 0.0f; - actor->rot_0F4.x = 0.0f; + } else if ((this->obj.pos.y < (gGroundHeight + 50.0f)) && (targetAngle2 > 180.0f)) { + targetAngle2 = 0.0f; + this->rot_0F4.x = 0.0f; } - Math_SmoothStepToAngle(&actor->rot_0F4.x, var_fv0, 0.5f, 1.0f, 0.0001f); - temp_fv1 = Math_SmoothStepToAngle(&actor->rot_0F4.y, actor->fwork[19], 0.5f, 1.0f, 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&this->rot_0F4.x, targetAngle2, 0.5f, 1.0f, 0.0001f); + angle = Math_SmoothStepToAngle(&this->rot_0F4.y, this->fwork[19], 0.5f, 1.0f, 0.0001f) * 30.0f; - if (temp_fv1 < 0.0f) { - var_fv0_2 = temp_fv1 * -1.0f; + if (angle < 0.0f) { + targetAngle = angle * -1.0f; } else { - var_fv0_2 = 360.0f - temp_fv1; + targetAngle = 360.0f - angle; } - Math_SmoothStepToAngle(&actor->obj.rot.z, var_fv0_2, 0.1f, 3.0f, 0.01f); + Math_SmoothStepToAngle(&this->obj.rot.z, targetAngle, 0.1f, 3.0f, 0.01f); - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y; - actor->vel.x = actor->fwork[13] + (sinRotY * (cosRotX * 35.0f)); - actor->vel.y = actor->fwork[14] + (-sinRotX * 35.0f); - actor->vel.z = actor->fwork[12] + (cosRotY * (cosRotX * 35.0f)); + this->vel.x = this->fwork[13] + (sinRotY * (cosRotX * 35.0f)); + this->vel.y = this->fwork[14] + (-sinRotX * 35.0f); + this->vel.z = this->fwork[12] + (cosRotY * (cosRotX * 35.0f)); - actor->fwork[13] -= (actor->fwork[13] * 0.1f); - actor->fwork[14] -= (actor->fwork[14] * 0.1f); - actor->fwork[12] -= (actor->fwork[12] * 0.1f); + this->fwork[13] -= (this->fwork[13] * 0.1f); + this->fwork[14] -= (this->fwork[14] * 0.1f); + this->fwork[12] -= (this->fwork[12] * 0.1f); - if ((actor->obj.pos.y < gGroundHeight + 40.0f) && (actor->vel.y < 0.0f)) { - actor->obj.pos.y = gGroundHeight + 40.0f; - actor->vel.y = 0.0f; + if ((this->obj.pos.y < gGroundHeight + 40.0f) && (this->vel.y < 0.0f)) { + this->obj.pos.y = gGroundHeight + 40.0f; + this->vel.y = 0.0f; } - ActorAllRange_ApplyDamage(actor); + ActorAllRange_ApplyDamage(this); - radarMark = &gRadarMarks[actor->index]; + radarMark = &gRadarMarks[this->index]; radarMark->status = 1; - radarMark->type = actor->aiType; - radarMark->pos.x = actor->obj.pos.x; - radarMark->pos.y = actor->obj.pos.y; - radarMark->pos.z = actor->obj.pos.z; - radarMark->yRot = actor->rot_0F4.y + 180.0f; + radarMark->type = this->aiType; + radarMark->pos.x = this->obj.pos.x; + radarMark->pos.y = this->obj.pos.y; + radarMark->pos.z = this->obj.pos.z; + radarMark->yRot = this->rot_0F4.y + 180.0f; - if (actor->iwork[8] != 0) { - actor->iwork[8]--; + if (this->iwork[8] != 0) { + this->iwork[8]--; } } -typedef struct { - u16* msg; - u16 unk; -} UnkMsg_D_i1_8019AE50; +typedef struct TrainingMessage { + /* 0x00 */ u16* msg; + /* 0x04 */ u16 msgTimer; +} TrainingMessage; -UnkMsg_D_i1_8019AE50 D_i1_8019AE50[] = { +TrainingMessage sTrainingMessages[] = { { gMsg_ID_23028, 224 }, { gMsg_ID_23029, 160 }, { gMsg_ID_23030, 224 }, { gMsg_ID_23031, 256 }, { gMsg_ID_23016, 160 }, { gMsg_ID_23024, 160 }, { gMsg_ID_23019, 256 }, { gMsg_ID_23015, 160 }, { gMsg_ID_23017, 160 }, { gMsg_ID_23025, 160 }, { gMsg_ID_23002, 160 }, { gMsg_ID_23004, 160 }, @@ -183,53 +183,53 @@ UnkMsg_D_i1_8019AE50 D_i1_8019AE50[] = { { gMsg_ID_20330, 0 }, { gMsg_ID_23026, 256 }, { gMsg_ID_23032, 256 }, { NULL, -1 }, }; -void Training_8019949C(void) { +void Training_SpawnEnemies(void) { s32 i; - Actor* actor; - Vec3f sp44; - Vec3f sp38; - s32 var_v1 = 1; + ActorAllRange* enemy; + Vec3f src; + Vec3f dest; + s32 aiTypeIndex; + aiTypeIndex = 1; if (gHitCount >= 100) { - var_v1 = 0; + aiTypeIndex = 0; } if (((gGameFrameCount % 4) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { - sp44.x = 0.0f; - sp44.y = 0.0f; - sp44.z = -15000.0f; + src.x = 0.0f; + src.y = 0.0f; + src.z = -15000.0f; - for (i = var_v1, actor = &gActors[i + 10]; i < 16; i++, actor++) { - if (actor->obj.status == OBJ_FREE) { - Actor_Initialize(actor); + for (i = aiTypeIndex, enemy = &gActors[i + 10]; i < 16; i++, enemy++) { + if (enemy->obj.status == OBJ_FREE) { + Actor_Initialize(enemy); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_ALLRANGE; + enemy->obj.status = OBJ_ACTIVE; + enemy->obj.id = OBJ_ACTOR_ALLRANGE; - Matrix_RotateY(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (gGameFrameCount * 6.0f) * M_DTOR, MTXF_NEW); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + enemy->obj.pos.x = dest.x; + enemy->obj.pos.y = 2000.0f; + enemy->obj.pos.z = dest.z; - actor->obj.pos.x = sp38.x; - actor->obj.pos.y = 2000.0f; - actor->obj.pos.z = sp38.z; + enemy->rot_0F4.y = gGameFrameCount * 6.0f; + enemy->aiType = i + AI360_ENEMY; + enemy->health = 24; + enemy->drawShadow = enemy->iwork[11] = 1; + enemy->timer_0C2 = 30; - actor->rot_0F4.y = gGameFrameCount * 6.0f; - actor->aiType = i + AI360_10; - actor->health = 24; - actor->drawShadow = actor->iwork[11] = 1; - actor->timer_0C2 = 30; + Object_SetInfo(&enemy->info, enemy->obj.id); - Object_SetInfo(&actor->info, actor->obj.id); - - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, enemy->sfxSource, 4); if ((i + 10) == 10) { - actor->aiIndex = AI360_FOX; - actor->health = 50; + enemy->aiIndex = AI360_FOX; + enemy->health = 50; } else { - actor->aiIndex = -1; - actor->info.action = (ObjectFunc) Training_80199024; + enemy->aiIndex = -1; + enemy->info.action = (ObjectFunc) Training_Enemy_Update; } break; } @@ -241,12 +241,12 @@ void Training_8019949C(void) { } if (gTraining360MsgTimer == 0) { - if (D_i1_8019AE50[gTraining360MsgIndex].msg == 0) { + if (sTrainingMessages[gTraining360MsgIndex].msg == NULL) { gTraining360MsgIndex = 1; } - if (D_i1_8019AE50[gTraining360MsgIndex].unk != 0) { - Radio_PlayMessage(D_i1_8019AE50[gTraining360MsgIndex].msg, RCID_TR); - gTraining360MsgTimer = D_i1_8019AE50[gTraining360MsgIndex].unk; + if (sTrainingMessages[gTraining360MsgIndex].msgTimer != 0) { + Radio_PlayMessage(sTrainingMessages[gTraining360MsgIndex].msg, RCID_TR); + gTraining360MsgTimer = sTrainingMessages[gTraining360MsgIndex].msgTimer; } else { gCallTimer = 80; gTraining360MsgTimer = 320; diff --git a/src/overlays/ovl_i1/fox_ve1.c b/src/overlays/ovl_i1/fox_ve1.c index f87fb53a..117b5330 100644 --- a/src/overlays/ovl_i1/fox_ve1.c +++ b/src/overlays/ovl_i1/fox_ve1.c @@ -308,7 +308,7 @@ void Venom1_BossTrigger4_Update(Ve1BossTrigger4* this) { } } -void Venom1_801924A8(Scenery* scenery) { +void Venom1_Scenery127_Update(Scenery* scenery) { switch (scenery->state) { case 0: if (gPlayer[0].pos.z < scenery->obj.pos.z) { @@ -323,10 +323,10 @@ void Venom1_801924A8(Scenery* scenery) { } } -void Venom1_8019250C(Actor* actor) { +void Venom1_8019250C(Actor* this) { } -void Venom1_80192518(Actor* actor) { +void Venom1_Actor280_Update(Actor280* this) { Scenery* scenery; f32 var_ft4; f32 var_ft5; @@ -336,18 +336,18 @@ void Venom1_80192518(Actor* actor) { f32 temp_fv1_2; Effect* effect; - if (actor->dmgType == DMG_BEAM) { - actor->dmgType = DMG_NONE; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_REFLECT); + if (this->dmgType == DMG_BEAM) { + this->dmgType = DMG_NONE; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } - if ((actor->state == 1) || (actor->state == 2) || (actor->state == 3)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); + if ((this->state == 1) || (this->state == 2) || (this->state == 3)) { + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); } - switch (actor->state) { + switch (this->state) { case 0: case 4: break; @@ -361,8 +361,8 @@ void Venom1_80192518(Actor* actor) { for (i = 0; i < ARRAY_COUNT(gScenery); i++, scenery++) { if ((scenery->obj.id == OBJ_SCENERY_128) || (scenery->obj.id == OBJ_SCENERY_129) || (scenery->obj.id == OBJ_SCENERY_130)) { - if (((actor->obj.pos.z + 1100.0f - scenery->obj.pos.z) < 2200.0f) && - ((actor->obj.pos.z + 1100.0f - scenery->obj.pos.z) > 0.0f)) { + if (((this->obj.pos.z + 1100.0f - scenery->obj.pos.z) < 2200.0f) && + ((this->obj.pos.z + 1100.0f - scenery->obj.pos.z) > 0.0f)) { switch (scenery->obj.id) { case OBJ_SCENERY_128: case OBJ_SCENERY_130: @@ -378,32 +378,32 @@ void Venom1_80192518(Actor* actor) { } } } - actor->fwork[0] = 0.0f; + this->fwork[0] = 0.0f; - if ((actor->obj.pos.x + var_ft4) < 0.0f) { - actor->fwork[1] = 896.0f - (var_ft4 - var_ft5 - actor->obj.pos.x); - actor->obj.pos.x = var_ft4 - var_ft5; + if ((this->obj.pos.x + var_ft4) < 0.0f) { + this->fwork[1] = 896.0f - (var_ft4 - var_ft5 - this->obj.pos.x); + this->obj.pos.x = var_ft4 - var_ft5; } else { - actor->fwork[1] = 896.0f + (var_ft4 + var_ft5 - actor->obj.pos.x); - actor->obj.pos.x = var_ft4 + var_ft5; + this->fwork[1] = 896.0f + (var_ft4 + var_ft5 - this->obj.pos.x); + this->obj.pos.x = var_ft4 + var_ft5; } - actor->timer_0BC = actor->iwork[2]; - AUDIO_PLAY_SFX(NA_SE_OB_POLE_MOVE, actor->sfxSource, 0); - actor->state = 2; + this->timer_0BC = this->iwork[2]; + AUDIO_PLAY_SFX(NA_SE_OB_POLE_MOVE, this->sfxSource, 0); + this->state = 2; case 2: - if (actor->timer_0BC == 0) { - src.x = temp_fv1_2 = Math_SmoothStepToF(&actor->fwork[0], actor->fwork[1], 0.7f, 80.0f, 0.01f); + if (this->timer_0BC == 0) { + src.x = temp_fv1_2 = Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.7f, 80.0f, 0.01f); src.y = 0.0f; src.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &src, &dest); - actor->obj.pos.x += dest.x; - actor->obj.pos.y += dest.y; - actor->obj.pos.z += dest.z; + this->obj.pos.x += dest.x; + this->obj.pos.y += dest.y; + this->obj.pos.z += dest.z; effect = func_effect_8007783C(OBJ_EFFECT_394); @@ -412,9 +412,9 @@ void Venom1_80192518(Actor* actor) { effect->unk_78 = effect->unk_7A; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.x; - effect->obj.pos.y = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.y; - effect->obj.pos.z = RAND_FLOAT_CENTERED(3.0f) + actor->obj.pos.z + 80.0f; + effect->obj.pos.x = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.x; + effect->obj.pos.y = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.y; + effect->obj.pos.z = RAND_FLOAT_CENTERED(3.0f) + this->obj.pos.z + 80.0f; effect->scale2 = 8.0f; @@ -431,78 +431,79 @@ void Venom1_80192518(Actor* actor) { effect->unk_60.z = -effect->unk_60.z; } - if ((actor->iwork[0] % 2) != 0) { + if ((this->iwork[0] % 2) != 0) { effect->vel.y = -effect->vel.y; } } if (fabs(temp_fv1_2) <= 5.0) { - actor->timer_0BE = 30; - actor->state++; - actor->fwork[2] = actor->obj.pos.x; - actor->fwork[3] = actor->obj.pos.y; - actor->fwork[4] = actor->obj.pos.z; + this->timer_0BE = 30; + this->state++; + this->fwork[2] = this->obj.pos.x; + this->fwork[3] = this->obj.pos.y; + this->fwork[4] = this->obj.pos.z; } } break; case 3: - src.x = __sinf((((30 - actor->timer_0BE) % 10) / 10.0f) * M_PI * 2) * 5.0f; + src.x = __sinf((((30 - this->timer_0BE) % 10) / 10.0f) * M_PI * 2) * 5.0f; src.y = 0.0f; src.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &src, &dest); - actor->obj.pos.x = actor->fwork[2] + dest.x; - actor->obj.pos.y = actor->fwork[3] + dest.y; - actor->obj.pos.z = actor->fwork[4] + dest.z; + this->obj.pos.x = this->fwork[2] + dest.x; + this->obj.pos.y = this->fwork[3] + dest.y; + this->obj.pos.z = this->fwork[4] + dest.z; - if (actor->timer_0BE == 0) { - actor->state++; + if (this->timer_0BE == 0) { + this->state++; } break; } - actor->iwork[0]++; + this->iwork[0]++; } -void Venom1_80192AA4(Actor* actor) { +void Venom1_80192AA4(Actor* this) { static Vec3f D_i1_80199FFC = { 0.0f, 460.0f, 0.0f }; Vec3f src; Vec3f dest; f32 y; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); - if ((actor->obj.rot.y <= 30.0f) || (actor->obj.rot.y >= 330.0f)) { + if ((this->obj.rot.y <= 30.0f) || (this->obj.rot.y >= 330.0f)) { for (D_i1_80199FFC.x = -80.0f; D_i1_80199FFC.x <= 80.0f; D_i1_80199FFC.x += 40.0f) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i1_80199FFC, &dest); } } else { src.z = 0.0f; src.x = -80.0f; - if (actor->obj.rot.y > 90.0f) { + if (this->obj.rot.y > 90.0f) { src.x = 80.0f; } for (y = 0.0f; y <= 450.0f; y += 50.0f) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); src.y = y; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); } } } -void Venom1_80192CB0(Actor* actor) { - actor->iwork[0] = actor->obj.rot.x; - actor->obj.rot.x = 0.0f; +void Venom1_80192CB0(Actor* this) { + this->iwork[0] = this->obj.rot.x; + this->obj.rot.x = 0.0f; } -void Venom1_80192CD4(Actor* actor) { +// Actors OBJ_ACTOR_281 & OBJ_ACTOR_282 +void Venom1_Doodad_Update(Actor* actor) { if (actor->dmgType == DMG_BEAM) { actor->dmgType = DMG_NONE; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_REFLECT); } if (actor->iwork[1] > 0) { @@ -543,16 +544,16 @@ void Venom1_80192CD4(Actor* actor) { } } -void Venom1_80192E2C(Actor* actor) { +void Venom1_Actor281_Draw(Actor281* this) { Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_901DA50); } -void Venom1_80192EA4(Actor* actor) { +void Venom1_80192EA4(Actor* this) { } -void Venom1_80192EB0(Actor* actor) { +void Venom1_Actor283_Update(Actor283* this) { Scenery* scenery; Vec3f sp50; Vec3f sp44; @@ -561,14 +562,15 @@ void Venom1_80192EB0(Actor* actor) { s32 i; f32 var_ft4; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); - switch (actor->state) { + switch (this->state) { case 0: case 4: break; + case 1: var_ft4 = 0.0f; scenery = gScenery; @@ -576,37 +578,37 @@ void Venom1_80192EB0(Actor* actor) { for (i = 0; i < ARRAY_COUNT(gScenery); i++, scenery++) { if (((scenery->obj.id == OBJ_SCENERY_128) || (scenery->obj.id == OBJ_SCENERY_129) || (scenery->obj.id == OBJ_SCENERY_130)) && - ((actor->obj.pos.z + 1100.0f - scenery->obj.pos.z) < 2200.0f) && - ((actor->obj.pos.z + 1100.0f - scenery->obj.pos.z) > 0.0f)) { + ((this->obj.pos.z + 1100.0f - scenery->obj.pos.z) < 2200.0f) && + ((this->obj.pos.z + 1100.0f - scenery->obj.pos.z) > 0.0f)) { var_ft4 = scenery->obj.pos.y; break; } } - actor->fwork[0] = 0.0f; - actor->fwork[1] = 1237.0f - (var_ft4 - actor->obj.pos.y); - actor->obj.pos.y = var_ft4 + 1.0f; - actor->timer_0BC = actor->iwork[1]; - AUDIO_PLAY_SFX(NA_SE_OB_POLE_MOVE, actor->sfxSource, 0); - actor->state = 2; + this->fwork[0] = 0.0f; + this->fwork[1] = 1237.0f - (var_ft4 - this->obj.pos.y); + this->obj.pos.y = var_ft4 + 1.0f; + this->timer_0BC = this->iwork[1]; + AUDIO_PLAY_SFX(NA_SE_OB_POLE_MOVE, this->sfxSource, 0); + this->state = 2; case 2: - if (actor->timer_0BC == 0) { - sp50.y = sp40 = Math_SmoothStepToF(&actor->fwork[0], actor->fwork[1], 0.7f, 80.0f, 0.01f); + if (this->timer_0BC == 0) { + sp50.y = sp40 = Math_SmoothStepToF(&this->fwork[0], this->fwork[1], 0.7f, 80.0f, 0.01f); sp50.x = 0.0f; sp50.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &sp50, &sp44); - actor->obj.pos.x += sp44.x; - actor->obj.pos.y += sp44.y; - actor->obj.pos.z += sp44.z; + this->obj.pos.x += sp44.x; + this->obj.pos.y += sp44.y; + this->obj.pos.z += sp44.z; effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { effect->unk_7A = 11; effect->unk_78 = effect->unk_7A; effect->obj.status = OBJ_ACTIVE; - effect->obj.pos.x = actor->obj.pos.x + RAND_FLOAT_CENTERED(3.0f); - effect->obj.pos.y = actor->obj.pos.y + RAND_FLOAT_CENTERED(3.0f); - effect->obj.pos.z = actor->obj.pos.z + RAND_FLOAT_CENTERED(3.0f) + 80.0f; + effect->obj.pos.x = this->obj.pos.x + RAND_FLOAT_CENTERED(3.0f); + effect->obj.pos.y = this->obj.pos.y + RAND_FLOAT_CENTERED(3.0f); + effect->obj.pos.z = this->obj.pos.z + RAND_FLOAT_CENTERED(3.0f) + 80.0f; effect->scale2 = 8.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); effect->vel.x = RAND_FLOAT_CENTERED(5.0f); @@ -617,74 +619,80 @@ void Venom1_80192EB0(Actor* actor) { if (Rand_ZeroOne() < 0.5f) { effect->unk_60.z = -effect->unk_60.z; } - if ((actor->iwork[0] % 2) != 0) { + if ((this->iwork[0] % 2) != 0) { effect->vel.y = -effect->vel.y; } } if (fabs(sp40) <= 5.0) { - actor->timer_0BE = 30; - actor->state++; - actor->fwork[2] = actor->obj.pos.x; - actor->fwork[3] = actor->obj.pos.y; - actor->fwork[4] = actor->obj.pos.z; + this->timer_0BE = 30; + this->state++; + this->fwork[2] = this->obj.pos.x; + this->fwork[3] = this->obj.pos.y; + this->fwork[4] = this->obj.pos.z; } } break; + case 3: sp50.x = 0.0f; - sp50.y = __sinf((((30 - actor->timer_0BE) % 10) / 10.0f) * M_PI * 2) * 5.0f; + sp50.y = __sinf((((30 - this->timer_0BE) % 10) / 10.0f) * M_PI * 2) * 5.0f; sp50.z = 0.0f; + Matrix_MultVec3f(gCalcMatrix, &sp50, &sp44); - actor->obj.pos.x = actor->fwork[2] + sp44.x; - actor->obj.pos.y = actor->fwork[3] + sp44.y; - actor->obj.pos.z = actor->fwork[4] + sp44.z; - if (actor->timer_0BE == 0) { - actor->state++; + + this->obj.pos.x = this->fwork[2] + sp44.x; + this->obj.pos.y = this->fwork[3] + sp44.y; + this->obj.pos.z = this->fwork[4] + sp44.z; + + if (this->timer_0BE == 0) { + this->state++; } break; } - if (actor->dmgType == DMG_BEAM) { - actor->dmgType = DMG_NONE; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_REFLECT); + + if (this->dmgType == DMG_BEAM) { + this->dmgType = DMG_NONE; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } - actor->iwork[0]++; + this->iwork[0]++; } -void Venom1_801933B4(Actor* actor) { - actor->scale = -1.0f; - actor->obj.pos.y += 488.0f; +void Venom1_801933B4(Actor* this) { + this->scale = -1.0f; + this->obj.pos.y += 488.0f; } -void Venom1_801933DC(Actor* actor) { +void Venom1_Actor284_Update(Actor284* this) { f32* hitboxData; - if (actor->dmgType == DMG_BEAM) { - actor->dmgType = DMG_NONE; - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 0); + if (this->dmgType == DMG_BEAM) { + this->dmgType = DMG_NONE; + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 0); } - if ((actor->animFrame == 38) || (actor->animFrame == 58)) { - AUDIO_PLAY_SFX(NA_SE_OB_ARM_SWING, actor->sfxSource, 0); + if ((this->animFrame == 38) || (this->animFrame == 58)) { + AUDIO_PLAY_SFX(NA_SE_OB_ARM_SWING, this->sfxSource, 0); } - Animation_GetFrameData(&D_VE1_900D098, actor->animFrame, actor->vwork); + Animation_GetFrameData(&D_VE1_900D098, this->animFrame, this->vwork); - if (actor->animFrame < (Animation_GetFrameCount(&D_VE1_900D098) - 1)) { - actor->animFrame++; + if (this->animFrame < (Animation_GetFrameCount(&D_VE1_900D098) - 1)) { + this->animFrame++; } else { - actor->animFrame = 0; + this->animFrame = 0; } - hitboxData = actor->info.hitbox; - hitboxData[1 + (10 * 0) + 7] = actor->vwork[3].y; - hitboxData[1 + (10 * 1) + 7] = -actor->vwork[2].y; + + hitboxData = this->info.hitbox; + hitboxData[1 + (10 * 0) + 7] = this->vwork[3].y; + hitboxData[1 + (10 * 1) + 7] = -this->vwork[2].y; } -void Venom1_801934D0(Actor* actor) { +void Venom1_Actor284_Draw(Actor* this) { Matrix_Translate(gGfxMatrix, 0.0f, -488.0f, 0.0f, MTXF_APPLY); - Animation_DrawSkeleton(0, D_VE1_900D164, actor->vwork, NULL, NULL, actor, &gIdentityMatrix); + Animation_DrawSkeleton(0, D_VE1_900D164, this->vwork, NULL, NULL, this, &gIdentityMatrix); } -void Venom1_80193540(Scenery* scenery) { +void Venom1_Scenery52_Update(Scenery* scenery) { if (((gPlayer[0].trueZpos - scenery->obj.pos.z) <= 3500.0f) && ((gGameFrameCount % 4) == 0)) { func_effect_8007C120(scenery->obj.pos.x, scenery->obj.pos.y, scenery->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.2f, 10); } @@ -821,10 +829,13 @@ void Venom1_Boss319_Init(Boss319* this) { s32 j; gGroundClipMode = 1; + D_i1_8019C0B8 = 0; D_i1_8019C0BC = 0; D_i1_8019C0C0 = 0; + gBossActive = true; + this->drawShadow = true; this->fwork[2] = D_i1_8019A04C[this->swork[13]][0]; this->fwork[14] = D_i1_8019A04C[this->swork[13]][1]; @@ -853,12 +864,14 @@ void Venom1_Boss319_Init(Boss319* this) { D_i1_8019B838[i].unk_74 = D_i1_8019B838[i].unk_78 = 0.0f; D_i1_8019B838[i].unk_7C = 0; } + this->fwork[11] = 1.0f; + for (i = 0; i < 33U; i++) { D_i1_8019B7F0[i] = 0; } - var_v0 = 0; - for (i = 0; i < ARRAY_COUNTU(D_i1_8019B838); i++) { + + for (var_v0 = 0, i = 0; i < ARRAY_COUNTU(D_i1_8019B838); i++) { var_v0 += D_i1_8019A820[i].unk_02; } this->swork[29] = this->swork[30] = var_v0 + 100; @@ -886,7 +899,9 @@ bool Venom1_801937F4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t rot->x -= 360.0f; } } + override = false; + for (i = 0; i < 18; i++) { if (limbIndex == D_i1_8019A748[i].limb) { Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); @@ -895,6 +910,7 @@ bool Venom1_801937F4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); + if (!(D_i1_8019B838[D_i1_8019A748[i].index].unk_7C & 1)) { if (D_i1_8019B838[D_i1_8019A748[i].index].unk_00 > 0) { if ((D_i1_8019B838[D_i1_8019A748[i].index].unk_02[2] & 2) == 2) { @@ -1047,8 +1063,10 @@ void Venom1_80193D64(s32 limbIndex, Vec3f* rot, void* thisx) { } break; } + RCP_SetupDL(&gMasterDisp, SETUPDL_64); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); + var_s6 = D_i1_8019A820; var_s7 = D_i1_8019B838; for (spBC = 0; spBC < ARRAY_COUNTU(D_i1_8019B838); spBC++, var_s6++, var_s7++) { @@ -2370,7 +2388,7 @@ void Venom1_80198594(Boss* boss) { } } -void Venom1_Boss_Draw(Boss* boss) { +void Venom1_Boss_Draw(Boss319* boss) { if (boss->swork[26] == 0) { Animation_DrawSkeleton(0, D_VE1_901C0F4, boss->vwork, Venom1_801937F4, Venom1_80193D64, boss, &gIdentityMatrix); } diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 97262c6a..e30a1917 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -43,180 +43,179 @@ Vec3f D_i2_80195610[] = { { -2000.0f, -1000.0f, 0.0f }, }; -void Meteo_80187530(Actor* actor) { - if (actor->dmgType == DMG_BEAM) { - actor->dmgType = DMG_NONE; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_ROCK_REFLECT); +void Meteo_ReflectDamage(Actor* this) { + if (this->dmgType == DMG_BEAM) { + this->dmgType = DMG_NONE; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_ROCK_REFLECT); } } -void Meteo_8018756C(Actor* actor) { +void Meteo_Actor181_Update(Actor181* this) { Vec3f vec; - if (actor->dmgType != DMG_NONE) { - actor->dmgType = DMG_NONE; - actor->health -= actor->damage; - if (actor->health <= 0) { - actor->obj.status = OBJ_DYING; + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + this->health -= this->damage; + if (this->health <= 0) { + this->obj.status = OBJ_DYING; } } - actor->obj.rot.y += 2.0f; - actor->obj.rot.x += 1.3f; + this->obj.rot.y += 2.0f; + this->obj.rot.x += 1.3f; - vec.x = actor->vel.x; - vec.y = actor->vel.y; - vec.z = actor->vel.z; + vec.x = this->vel.x; + vec.y = this->vel.y; + vec.z = this->vel.z; - if ((Object_CheckCollision(actor->index, &actor->obj.pos, &vec, 0) != 0) || - (actor->obj.pos.y < (gGroundHeight + 20.0f))) { - actor->obj.status = OBJ_DYING; + if ((Object_CheckCollision(this->index, &this->obj.pos, &vec, 0) != 0) || + (this->obj.pos.y < (gGroundHeight + 20.0f))) { + this->obj.status = OBJ_DYING; } - Meteo_80187530(actor); + Meteo_ReflectDamage(this); } -void Meteo_80187650(Actor* actor) { +void Meteo_Actor182_Update(Actor182* this) { Vec3f vec; - actor->obj.rot.y += 1.7f; - actor->obj.rot.x += 3.3f; - actor->unk_046 -= 15; + this->obj.rot.y += 1.7f; + this->obj.rot.x += 3.3f; + this->unk_046 -= 15; - if (actor->unk_046 < 0) { - actor->unk_046 = 0; + if (this->unk_046 < 0) { + this->unk_046 = 0; } - actor->unk_048 += 8; - if (actor->unk_048 > 995) { - actor->unk_048 = 995; + this->unk_048 += 8; + if (this->unk_048 > 995) { + this->unk_048 = 995; } - if ((actor->timer_0BC % 4U) == 1) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); + if ((this->timer_0BC % 4U) == 1) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f); } - if (actor->dmgType != DMG_NONE) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); - Object_Kill(&actor->obj, actor->sfxSource); + if (this->dmgType != DMG_NONE) { + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); + Object_Kill(&this->obj, this->sfxSource); } - if (actor->timer_0C2 == 0) { - vec.x = actor->vel.x; - vec.y = actor->vel.y; - vec.z = actor->vel.z; - if ((Object_CheckCollision(actor->index, &actor->obj.pos, &vec, 0) != 0) || - (actor->obj.pos.y < (gGroundHeight + 20.0f))) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); - actor->obj.status = OBJ_DYING; + if (this->timer_0C2 == 0) { + vec.x = this->vel.x; + vec.y = this->vel.y; + vec.z = this->vel.z; + if ((Object_CheckCollision(this->index, &this->obj.pos, &vec, 0) != 0) || + (this->obj.pos.y < (gGroundHeight + 20.0f))) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); + this->obj.status = OBJ_DYING; } } - - Meteo_80187530(actor); + Meteo_ReflectDamage(this); } -void Meteo_801877C4(Actor* actor) { - Vec3f sp44; - Vec3f sp38; +void Meteo_Actor187_Update(Actor187* this) { + Vec3f dest; + Vec3f src; - actor->obj.rot.z += 1.0f; + this->obj.rot.z += 1.0f; - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_NEW); - sp38.x = 0.0f; - sp38.y = -1100.0f; - sp38.z = 0.0f; + src.x = 0.0f; + src.y = -1100.0f; + src.z = 0.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp38, &sp44); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - actor->obj.pos.x = actor->fwork[0] + sp44.x; - actor->obj.pos.y = actor->fwork[1] + sp44.y; + this->obj.pos.x = this->fwork[0] + dest.x; + this->obj.pos.y = this->fwork[1] + dest.y; - if (actor->dmgType != DMG_NONE) { - Actor_Despawn(actor); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z, 5.0f); - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 3.0f, 10); + if (this->dmgType != DMG_NONE) { + Actor_Despawn(this); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 5.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 3.0f, 10); } - if (actor->timer_0BC == 0) { - actor->timer_0BC = 40; - if (actor->obj.pos.z < (gPlayer[0].trueZpos - 1000.0f)) { - func_effect_8007F11C(OBJ_EFFECT_353, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 120.0f); + if (this->timer_0BC == 0) { + this->timer_0BC = 40; + if (this->obj.pos.z < (gPlayer[0].trueZpos - 1000.0f)) { + Effect_EnemyLaser(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 120.0f); } } } -void Meteo_8018795C(Actor* actor) { +void Meteo_Actor186_Update(Actor186* this) { Vec3f vec; s32 pad[2]; - actor->obj.rot.y += 7.0f; - actor->obj.rot.x += 3.3f; + this->obj.rot.y += 7.0f; + this->obj.rot.x += 3.3f; - if (actor->dmgType != DMG_NONE) { - Actor_Despawn(actor); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); - func_effect_8007BFFC(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, + if (this->dmgType != DMG_NONE) { + Actor_Despawn(this); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y, this->obj.pos.z - this->vel.z, 8.0f); + func_effect_8007BFFC(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f, this->obj.pos.z - this->vel.z, 0.0f, 0.0f, 0.0f, 4.0f, 10); } - if (((gGameFrameCount % 8) == 0)) { - Math_Vec3fFromAngles(&vec, actor->obj.rot.x, actor->obj.rot.y, 100.0f); - func_effect_8007F04C(OBJ_EFFECT_353, actor->obj.pos.x + (vec.x * 3.0f), actor->obj.pos.y + (vec.y * 3.0f), - actor->obj.pos.z + (vec.z * 3.0f), actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z, - 0.0f, 0.0f, 0.0f, vec.x, vec.y, vec.z, 1.0f); + if ((gGameFrameCount % 8) == 0) { + Math_Vec3fFromAngles(&vec, this->obj.rot.x, this->obj.rot.y, 100.0f); + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, this->obj.pos.x + (vec.x * 3.0f), + this->obj.pos.y + (vec.y * 3.0f), this->obj.pos.z + (vec.z * 3.0f), this->obj.rot.x, + this->obj.rot.y, this->obj.rot.z, 0.0f, 0.0f, 0.0f, vec.x, vec.y, vec.z, 1.0f); } } -void Meteo_80187B08(Actor* actor) { - actor->obj.rot.y += 7.0f; - actor->obj.rot.x += 3.3f; +void Meteo_80187B08(Actor186* this) { + this->obj.rot.y += 7.0f; + this->obj.rot.x += 3.3f; - actor->unk_046 -= 11; + this->unk_046 -= 11; - if (actor->unk_046 < 0) { - actor->unk_046 = 0; + if (this->unk_046 < 0) { + this->unk_046 = 0; } - actor->unk_048 += 4; - if (actor->unk_048 > 995) { - actor->unk_048 = 995; + this->unk_048 += 4; + if (this->unk_048 > 995) { + this->unk_048 = 995; } - if ((actor->timer_0BC & 3) == 0) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f); + if ((this->timer_0BC % 4) == 0) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f); } - if ((actor->dmgType != DMG_NONE) || (actor->timer_0BC == 0)) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y, actor->obj.pos.z - actor->vel.z, 8.0f); - func_effect_8007BFFC(actor->obj.pos.x - actor->vel.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z - actor->vel.z, + if ((this->dmgType != DMG_NONE) || (this->timer_0BC == 0)) { + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x - this->vel.x, this->obj.pos.y, this->obj.pos.z - this->vel.z, 8.0f); + func_effect_8007BFFC(this->obj.pos.x - this->vel.x, this->obj.pos.y + 30.0f, this->obj.pos.z - this->vel.z, 0.0f, 0.0f, 0.0f, 4.0f, 10); } } -void Meteo_80187C68(Actor* actor, f32 x, f32 y, f32 z, f32 arg4, f32 xRot, f32 yRot, s32 timerBC, s32 arg8, s32 objId) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = objId; +void Meteo_80187C68(Actor* this, f32 x, f32 y, f32 z, f32 arg4, f32 xRot, f32 yRot, s32 timerBC, s32 arg8, s32 objId) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = objId; - actor->obj.pos.x = x; - actor->obj.pos.y = y; - actor->obj.pos.z = z; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; - actor->obj.rot.x = xRot; - actor->obj.rot.y = yRot; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; - actor->timer_0BC = timerBC; - actor->timer_0BE = 20; - actor->eventType = arg8; - actor->fwork[5] = arg4; - Object_SetInfo(&actor->info, actor->obj.id); + this->timer_0BC = timerBC; + this->timer_0BE = 20; + this->eventType = arg8; + this->fwork[5] = arg4; + Object_SetInfo(&this->info, this->obj.id); } void Meteo_80187D08(f32 x, f32 y, f32 z, f32 arg3, f32 xRot, f32 yRot, s32 arg6, s32 arg7, s32 objId) { @@ -230,24 +229,24 @@ void Meteo_80187D08(f32 x, f32 y, f32 z, f32 arg3, f32 xRot, f32 yRot, s32 arg6, } } -void Meteo_80187D98(Effect* effect, f32 x, f32 y, f32 z, f32 arg4, bool arg5) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_369; +void Meteo_80187D98(Effect369* this, f32 x, f32 y, f32 z, f32 arg4, bool arg5) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_369; - effect->obj.pos.x = x; - effect->obj.pos.y = y; - effect->obj.pos.z = z; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; - effect->unk_60.z = arg4; - effect->unk_48 = arg5; - effect->obj.rot.x = 45.0f; + this->unk_60.z = arg4; + this->unk_48 = arg5; + this->obj.rot.x = 45.0f; if (arg5) { - effect->obj.rot.x = -45.0f; + this->obj.rot.x = -45.0f; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void Meteo_80187E38(f32 x, f32 y, f32 z, f32 arg3) { @@ -283,27 +282,27 @@ void Meteo_80187E38(f32 x, f32 y, f32 z, f32 arg3) { } } -void Meteo_80187FF8(Effect* effect, f32 x, f32 y, f32 z) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_371; +void Meteo_80187FF8(Effect371* this, f32 x, f32 y, f32 z) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_371; - effect->obj.pos.x = x; - effect->obj.pos.y = y; - effect->obj.pos.z = z; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; - effect->unk_44 = 128; - effect->vel.z = 50.0f; - effect->scale2 = 1.0f; - Object_SetInfo(&effect->info, effect->obj.id); + this->unk_44 = 128; + this->vel.z = 50.0f; + this->scale2 = 1.0f; + Object_SetInfo(&this->info, this->obj.id); } -void Meteo_80188088(Boss* boss) { +void Meteo_80188088(Boss297* this) { s32 i; for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { - Meteo_80187FF8(&gEffects[i], boss->obj.pos.x + 700.0f, boss->obj.pos.y, boss->obj.pos.z + 1235.0f); + Meteo_80187FF8(&gEffects[i], this->obj.pos.x + 700.0f, this->obj.pos.y, this->obj.pos.z + 1235.0f); AUDIO_PLAY_SFX(NA_SE_EN_RNG_BEAM_SHOT, gEffects[i].sfxSource, 4); break; } @@ -311,25 +310,25 @@ void Meteo_80188088(Boss* boss) { for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { - Meteo_80187FF8(&gEffects[i], boss->obj.pos.x - 700.0f, boss->obj.pos.y, boss->obj.pos.z + 1235.0f); + Meteo_80187FF8(&gEffects[i], this->obj.pos.x - 700.0f, this->obj.pos.y, this->obj.pos.z + 1235.0f); break; } } } -void Meteo_801881A8(Effect* effect, f32 x, f32 y, f32 z, f32 zRot, s32 arg5) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_370; +void Meteo_801881A8(Effect370* this, f32 x, f32 y, f32 z, f32 zRot, s32 arg5) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_370; - effect->obj.pos.x = x; - effect->obj.pos.y = y; - effect->obj.pos.z = z; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; - effect->obj.rot.z = zRot; + this->obj.rot.z = zRot; - effect->state = arg5; - Object_SetInfo(&effect->info, effect->obj.id); + this->state = arg5; + Object_SetInfo(&this->info, this->obj.id); } void Meteo_80188228(f32 x, f32 y, f32 z, f32 zRot) { @@ -355,64 +354,66 @@ void Meteo_80188298(f32 x, f32 y, f32 z, f32 zRot) { } } -void Meteo_80188344(Boss* boss) { +void Meteo_Boss298_Update(Boss298* this) { Vec3f src; Vec3f dest; f32 temp; - if (boss->state < 5) { - boss->obj.pos.x = gBosses[0].obj.pos.x; - boss->obj.pos.y = gBosses[0].obj.pos.y; - boss->obj.pos.z = gBosses[0].obj.pos.z; - boss->obj.rot.x = gBosses[0].obj.rot.x; - boss->obj.rot.y = gBosses[0].obj.rot.y; - boss->obj.rot.z = gBosses[0].obj.rot.z + boss->rot_078.z + 45.0f + 180.0f; + if (this->state < 5) { + this->obj.pos.x = gBosses[0].obj.pos.x; + this->obj.pos.y = gBosses[0].obj.pos.y; + this->obj.pos.z = gBosses[0].obj.pos.z; + this->obj.rot.x = gBosses[0].obj.rot.x; + this->obj.rot.y = gBosses[0].obj.rot.y; + this->obj.rot.z = gBosses[0].obj.rot.z + this->rot_078.z + 45.0f + 180.0f; } - switch (boss->state) { + switch (this->state) { case 0: - boss->timer_050 = 150; - boss->rot_078.z += 2.5f; + this->timer_050 = 150; + this->rot_078.z += 2.5f; break; case 1: - temp = fabsf(90.0f - boss->rot_078.z) * 0.1f; + temp = fabsf(90.0f - this->rot_078.z) * 0.1f; if (temp > 2.5f) { temp = 2.5f; } - boss->rot_078.z += temp; + this->rot_078.z += temp; - if (boss->timer_050 == 0) { - boss->state = 2; - boss->dmgType = DMG_NONE; + if (this->timer_050 == 0) { + this->state = 2; + this->dmgType = DMG_NONE; } break; case 2: - if (boss->dmgType == DMG_BEAM) { - boss->dmgType = DMG_NONE; - boss->timer_054 = 5; - boss->swork[0] += 32; + if (this->dmgType == DMG_BEAM) { + this->dmgType = DMG_NONE; + this->timer_054 = 5; + this->swork[0] += 32; - Audio_SetTransposeAndPlaySfx(boss->sfxSource, NA_SE_EN_GRN_BEAM_CHARGE, boss->unk_04A); + Audio_SetTransposeAndPlaySfx(this->sfxSource, NA_SE_EN_GRN_BEAM_CHARGE, this->unk_04A); - boss->unk_04A++; - if (boss->unk_04A > 7) { - boss->unk_04A = 7; + this->unk_04A++; + if (this->unk_04A > 7) { + this->unk_04A = 7; } - if (boss->swork[0] >= 255) { - boss->unk_04A = 0; - Audio_KillSfxBySource(boss->sfxSource); - if (boss->swork[1] == 0) { - boss->swork[1]++; + if (this->swork[0] >= 255) { + this->unk_04A = 0; + + Audio_KillSfxBySource(this->sfxSource); + + if (this->swork[1] == 0) { + this->swork[1]++; Radio_PlayMessage(gMsg_ID_3315, RCID_PEPPY); } - boss->swork[0] = 0; + this->swork[0] = 0; - Matrix_RotateZ(gCalcMatrix, (boss->obj.rot.z - 45.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, (this->obj.rot.z - 45.0f) * M_DTOR, MTXF_NEW); src.x = 0.0f; src.y = 156.0f; @@ -420,57 +421,57 @@ void Meteo_80188344(Boss* boss) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - Meteo_80188298(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, - boss->obj.rot.z - 45.0f); - Meteo_80188228(boss->obj.pos.x - dest.x, boss->obj.pos.y - dest.y, boss->obj.pos.z + dest.z, - boss->obj.rot.z - 45.0f); - Meteo_80188228(boss->obj.pos.x + dest.y, boss->obj.pos.y - dest.x, boss->obj.pos.z + dest.z, - (boss->obj.rot.z - 45.0f) + 90.0f); + Meteo_80188298(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, + this->obj.rot.z - 45.0f); + Meteo_80188228(this->obj.pos.x - dest.x, this->obj.pos.y - dest.y, this->obj.pos.z + dest.z, + this->obj.rot.z - 45.0f); + Meteo_80188228(this->obj.pos.x + dest.y, this->obj.pos.y - dest.x, this->obj.pos.z + dest.z, + (this->obj.rot.z - 45.0f) + 90.0f); } } break; case 3: - boss->timer_050 = 30; - boss->state = 4; - boss->timer_05C = 15; - boss->swork[0] = 0; + this->timer_050 = 30; + this->state = 4; + this->timer_05C = 15; + this->swork[0] = 0; break; case 4: - if (boss->timer_050 == 0) { - func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 500.0f, 30.0f); - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 500.0f, 0.0f, 0.0f, 0.0f, + if (this->timer_050 == 0) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 500.0f, 30.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 500.0f, 0.0f, 0.0f, 0.0f, 20.0f, 30); - boss->state = 5; + this->state = 5; - boss->info.cullDistance = 1000.0f; + this->info.cullDistance = 1000.0f; - Audio_KillSfxBySourceAndId(boss->sfxSource, NA_SE_EN_GRN_BEAM_CHARGE); - AUDIO_PLAY_SFX(NA_SE_EN_MEBOSS_SHIELD, boss->sfxSource, 4); + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_GRN_BEAM_CHARGE); + AUDIO_PLAY_SFX(NA_SE_EN_MEBOSS_SHIELD, this->sfxSource, 4); } break; case 5: - boss->obj.rot.z -= 3.0f; - if (boss->vel.z < 5.0f) { - boss->vel.z = boss->vel.z + 1.0f; + this->obj.rot.z -= 3.0f; + if (this->vel.z < 5.0f) { + this->vel.z = this->vel.z + 1.0f; } break; } - if (boss->rot_078.z >= 360.0f) { - boss->rot_078.z -= 360.0f; + if (this->rot_078.z >= 360.0f) { + this->rot_078.z -= 360.0f; } - if (boss->rot_078.z < 0.0f) { - boss->rot_078.z += 360.0f; + if (this->rot_078.z < 0.0f) { + this->rot_078.z += 360.0f; } } -void Meteo_801887D0(Boss* boss) { +void Meteo_Boss298_Draw(Boss298* this) { s32 i; - if ((boss->timer_054 % 2) != 0) { + if ((this->timer_054 % 2) != 0) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, 255); } @@ -481,8 +482,8 @@ void Meteo_801887D0(Boss* boss) { RCP_SetupDL_64(); for (i = 1; i < 4; i++) { - if (boss->swork[0] != 0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, boss->swork[0]); + if (this->swork[0] != 0) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->swork[0]); Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, M_DTOR * 90.0f * i, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 156.0f, 930.0f, MTXF_APPLY); @@ -534,24 +535,24 @@ void Meteo_Boss297_Init(Boss297* this) { AUDIO_PLAY_SFX(NA_SE_EN_BURNER_L, this->sfxSource, 4); } -void Meteo_80188B84(Effect* effect, f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 arg6, f32 arg7) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_369; +void Meteo_80188B84(Effect369* this, f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 arg6, f32 arg7) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_369; - effect->obj.pos.x = x; - effect->obj.pos.y = y; - effect->obj.pos.z = z; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; - effect->obj.rot.x = xRot; - effect->obj.rot.y = yRot; - effect->unk_60.z = arg6; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + this->unk_60.z = arg6; - effect->timer_50 = 20; - effect->scale2 = arg7; - effect->state = 1; - effect->unk_44 = 128; - Object_SetInfo(&effect->info, effect->obj.id); + this->timer_50 = 20; + this->scale2 = arg7; + this->state = 1; + this->unk_44 = 128; + Object_SetInfo(&this->info, this->obj.id); } void Meteo_80188C2C(f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 arg5, f32 arg6) { @@ -565,33 +566,33 @@ void Meteo_80188C2C(f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 arg5, f32 arg6) } } -void Meteo_80188CAC(Effect* effect) { +void Meteo_Effect369_Update(Effect369* this) { Vec3f src; Vec3f dest; - if (effect->state == 0) { - switch (effect->unk_48) { + if (this->state == 0) { + switch (this->unk_48) { case 0: - effect->obj.rot.x -= 15.0f; - if (effect->obj.rot.x <= -45.0f) { - effect->unk_48 = 1; + this->obj.rot.x -= 15.0f; + if (this->obj.rot.x <= -45.0f) { + this->unk_48 = 1; } break; case 1: - effect->obj.rot.x += 15.0f; - if (effect->obj.rot.x >= 45.0f) { - effect->unk_48 = 0; + this->obj.rot.x += 15.0f; + if (this->obj.rot.x >= 45.0f) { + this->unk_48 = 0; } break; } - effect->unk_44 = 255; - effect->scale2 = 1.0f; - effect->unk_60.z += 20.0f; + this->unk_44 = 255; + this->scale2 = 1.0f; + this->unk_60.z += 20.0f; - Matrix_RotateZ(gCalcMatrix, effect->unk_60.z * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->unk_60.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -599,36 +600,36 @@ void Meteo_80188CAC(Effect* effect) { Matrix_MultVec3f(gCalcMatrix, &src, &dest); - effect->vel.x = dest.x; - effect->vel.y = dest.y; - effect->vel.z = dest.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - Meteo_80188C2C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, effect->obj.rot.x, effect->obj.rot.y, - effect->unk_60.z, 1.0f); - } else if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + Meteo_80188C2C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->obj.rot.x, this->obj.rot.y, + this->unk_60.z, 1.0f); + } else if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } - func_effect_8007A774(gPlayer, effect, 90.0f); + func_effect_8007A774(gPlayer, this, 90.0f); } -void Meteo_80188E8C(Effect* effect, f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 zRot, f32 scale) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_370; +void Meteo_80188E8C(Effect370* this, f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 zRot, f32 scale) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_370; - effect->obj.pos.x = x; - effect->obj.pos.y = y; - effect->obj.pos.z = z; + this->obj.pos.x = x; + this->obj.pos.y = y; + this->obj.pos.z = z; - effect->obj.rot.x = xRot; - effect->obj.rot.y = yRot; - effect->obj.rot.z = zRot; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + this->obj.rot.z = zRot; - effect->scale2 = scale; - effect->state = 1; - effect->unk_44 = 128; - Object_SetInfo(&effect->info, effect->obj.id); + this->scale2 = scale; + this->state = 1; + this->unk_44 = 128; + Object_SetInfo(&this->info, this->obj.id); } void Meteo_80188F2C(f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 arg5, f32 scale) { @@ -642,16 +643,16 @@ void Meteo_80188F2C(f32 x, f32 y, f32 z, f32 xRot, f32 yRot, f32 arg5, f32 scale } } -void Meteo_80188FAC(Effect* effect) { +void Meteo_Effect370_Update(Effect370* this) { Vec3f src; Vec3f dest; - if (effect->state != 1) { - effect->obj.rot.x = 10.0f; - effect->obj.rot.z += 20.0f; + if (this->state != 1) { + this->obj.rot.x = 10.0f; + this->obj.rot.z += 20.0f; - Matrix_RotateZ(gCalcMatrix, effect->obj.rot.z * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -659,93 +660,93 @@ void Meteo_80188FAC(Effect* effect) { Matrix_MultVec3f(gCalcMatrix, &src, &dest); - effect->vel.x = dest.x; - effect->vel.y = dest.y; - effect->vel.z = dest.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; if (((gGameFrameCount % 2) == 0)) { - Meteo_80188F2C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, effect->obj.rot.x, - effect->obj.rot.y, effect->obj.rot.z, 5.0f); + Meteo_80188F2C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->obj.rot.x, this->obj.rot.y, + this->obj.rot.z, 5.0f); } } else { - effect->unk_44 -= 8; - if (effect->unk_44 < 0) { - Object_Kill(&effect->obj, effect->sfxSource); + this->unk_44 -= 8; + if (this->unk_44 < 0) { + Object_Kill(&this->obj, this->sfxSource); } } - func_effect_8007A774(gPlayer, effect, 60.0f); + func_effect_8007A774(gPlayer, this, 60.0f); } -void Meteo_80189114(Effect* effect) { +void Meteo_Effect371_Update(Effect371* this) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { - Object_Kill(&effect->obj, effect->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } - effect->scale2 += 0.5f; - if (effect->scale2 > 10.0f) { - effect->scale2 = 10.0f; + this->scale2 += 0.5f; + if (this->scale2 > 10.0f) { + this->scale2 = 10.0f; } - effect->obj.rot.z += 35.0f; - if (effect->obj.pos.x < gPlayer[0].pos.x) { - effect->obj.pos.x += 1.5f; - if (effect->vel.x < 40.0f) { - effect->vel.x += 2.0f; + this->obj.rot.z += 35.0f; + if (this->obj.pos.x < gPlayer[0].pos.x) { + this->obj.pos.x += 1.5f; + if (this->vel.x < 40.0f) { + this->vel.x += 2.0f; } } - if (gPlayer[0].pos.x < effect->obj.pos.x) { - effect->obj.pos.x -= 1.5f; - if (effect->vel.x > -40.0f) { - effect->vel.x -= 2.0f; + if (gPlayer[0].pos.x < this->obj.pos.x) { + this->obj.pos.x -= 1.5f; + if (this->vel.x > -40.0f) { + this->vel.x -= 2.0f; } } - if (effect->obj.pos.y < gPlayer[0].pos.y) { - effect->obj.pos.y += 1.5f; - if (effect->vel.y < 40.0f) { - effect->vel.y += 2.0f; + if (this->obj.pos.y < gPlayer[0].pos.y) { + this->obj.pos.y += 1.5f; + if (this->vel.y < 40.0f) { + this->vel.y += 2.0f; } } - if (gPlayer[0].pos.y < effect->obj.pos.y) { - effect->obj.pos.y -= 1.5f; - if (effect->vel.y > -40.0f) { - effect->vel.y -= 2.0f; + if (gPlayer[0].pos.y < this->obj.pos.y) { + this->obj.pos.y -= 1.5f; + if (this->vel.y > -40.0f) { + this->vel.y -= 2.0f; } } - func_effect_8007A774(gPlayer, effect, 100.0f); + func_effect_8007A774(gPlayer, this, 100.0f); } -void Meteo_801892F0(Boss* boss, s32 arg1) { +void Meteo_801892F0(Boss297* this, s32 dmgPart) { Vec3f dest; Vec3f src; - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_M); - if (arg1 == 7) { - func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y + 330.0f, boss->obj.pos.z + 1020.0f, 15.0f); - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y + 330.0f, boss->obj.pos.z + 1020.0f, 0.0f, 0.0f, 0.0f, + if (dmgPart == 7) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y + 330.0f, this->obj.pos.z + 1020.0f, 15.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 330.0f, this->obj.pos.z + 1020.0f, 0.0f, 0.0f, 0.0f, 7.0f, 20); } - if (arg1 == 5) { - func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y - 330.0f, boss->obj.pos.z + 1020.0f, 15.0f); - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y - 330.0f, boss->obj.pos.z + 1020.0f, 0.0f, 0.0f, 0.0f, + if (dmgPart == 5) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y - 330.0f, this->obj.pos.z + 1020.0f, 15.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y - 330.0f, this->obj.pos.z + 1020.0f, 0.0f, 0.0f, 0.0f, 7.0f, 20); } - if (arg1 == 4) { - func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 300.0f, 20.0f); - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 300.0f, 0.0f, 0.0f, 0.0f, 10.0f, 25); + if (dmgPart == 4) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 300.0f, 20.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 300.0f, 0.0f, 0.0f, 0.0f, 10.0f, 25); } - if (arg1 < 4) { - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, M_DTOR * 90.0f * arg1, MTXF_APPLY); + if (dmgPart < 4) { + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, M_DTOR * 90.0f * dmgPart, MTXF_APPLY); src.x = 0.0f; src.y = 200.0f; @@ -753,8 +754,8 @@ void Meteo_801892F0(Boss* boss, s32 arg1) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_effect_8007D2C8(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 10.0f); - func_effect_8007BFFC(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 0.0f, 0.0f, + func_effect_8007D2C8(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 10.0f); + func_effect_8007BFFC(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 0.0f, 0.0f, 0.0f, 5.0f, 15); } } @@ -777,7 +778,7 @@ void Meteo_80189624(void) { } } -void Meteo_8018978C(Boss* boss) { +void Meteo_Boss297_Update(Boss297* this) { f32 sp7C; f32 rand; s32 i; @@ -788,147 +789,147 @@ void Meteo_8018978C(Boss* boss) { gBossFrameCount++; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); if ((gGameFrameCount & 0x10) != 0) { - boss->swork[19] += 32; - if (boss->swork[19] > 128) { - boss->swork[19] = 128; + this->swork[19] += 32; + if (this->swork[19] > 128) { + this->swork[19] = 128; } } else { - boss->swork[19] -= 32; - if (boss->swork[19] < 0) { - boss->swork[19] = 0; + this->swork[19] -= 32; + if (this->swork[19] < 0) { + this->swork[19] = 0; } } if ((gGameFrameCount & 0x38) == 0) { - boss->fwork[3] = D_i2_80195534[gGameFrameCount % 8U]; - boss->fwork[4] = D_i2_80195534[gGameFrameCount % 8U]; - boss->fwork[5] = D_i2_80195534[gGameFrameCount % 8U]; - boss->fwork[6] = D_i2_80195534[gGameFrameCount % 8U]; + this->fwork[3] = D_i2_80195534[gGameFrameCount % 8U]; + this->fwork[4] = D_i2_80195534[gGameFrameCount % 8U]; + this->fwork[5] = D_i2_80195534[gGameFrameCount % 8U]; + this->fwork[6] = D_i2_80195534[gGameFrameCount % 8U]; } if (((gGameFrameCount + 20) & 0x38) == 0) { - boss->fwork[7] = D_i2_80195534[(gGameFrameCount + 20) % 8U]; - boss->fwork[8] = D_i2_80195534[(gGameFrameCount + 20) % 8U]; + this->fwork[7] = D_i2_80195534[(gGameFrameCount + 20) % 8U]; + this->fwork[8] = D_i2_80195534[(gGameFrameCount + 20) % 8U]; } - if (boss->swork[9] != 0) { - boss->swork[9]--; + if (this->swork[9] != 0) { + this->swork[9]--; } - if (boss->swork[10] != 0) { - boss->swork[10]--; + if (this->swork[10] != 0) { + this->swork[10]--; } - if (boss->swork[11] != 0) { - boss->swork[11]--; + if (this->swork[11] != 0) { + this->swork[11]--; } - if (boss->swork[12] != 0) { - boss->swork[12]--; + if (this->swork[12] != 0) { + this->swork[12]--; } - if (boss->swork[13] != 0) { - boss->swork[13]--; + if (this->swork[13] != 0) { + this->swork[13]--; } - if (boss->swork[14] != 0) { - boss->swork[14]--; + if (this->swork[14] != 0) { + this->swork[14]--; } - if (boss->swork[15] != 0) { - boss->swork[15]--; + if (this->swork[15] != 0) { + this->swork[15]--; } - if (boss->swork[0] > 5) { - boss->swork[0]--; - if (boss->swork[0] == 5) { - Audio_KillSfxBySourceAndId(boss->sfxSource, NA_SE_EN_BURNER_L); + if (this->swork[0] > 5) { + this->swork[0]--; + if (this->swork[0] == 5) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_BURNER_L); } } - if (boss->swork[1] > 5) { - boss->swork[1] = boss->swork[1] - 1; - if (boss->swork[1] == 5) { - Audio_KillSfxBySourceAndId(boss->sfxSource, NA_SE_EN_BURNER_L); + if (this->swork[1] > 5) { + this->swork[1] = this->swork[1] - 1; + if (this->swork[1] == 5) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_BURNER_L); } } - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; - if ((boss->dmgPart != 7) && (boss->dmgPart >= 5) && (boss->dmgPart != 5)) { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if ((this->dmgPart != 7) && (this->dmgPart >= 5) && (this->dmgPart != 5)) { + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } - if ((boss->state >= 2) && (boss->state < 20)) { - if ((boss->dmgPart < 5) && (boss[0].fwork[17 + boss->dmgPart] > 0.5f)) { - if (boss[0].swork[boss->dmgPart + 2] != 0) { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, boss->sfxSource, 4); + if ((this->state >= 2) && (this->state < 20)) { + if ((this->dmgPart < 5) && (this[0].fwork[17 + this->dmgPart] > 0.5f)) { + if (this[0].swork[this->dmgPart + 2] != 0) { + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); - boss[0].swork[9 + boss->dmgPart] = 20; - boss[0].swork[2 + boss->dmgPart] -= boss->damage; + this[0].swork[9 + this->dmgPart] = 20; + this[0].swork[2 + this->dmgPart] -= this->damage; - if (boss[0].swork[2 + boss->dmgPart] <= 0) { - boss[0].swork[2 + boss->dmgPart] = 0; - Meteo_801892F0(boss, boss->dmgPart); - boss->swork[20]++; - if (boss->swork[20] == 2) { + if (this[0].swork[2 + this->dmgPart] <= 0) { + this[0].swork[2 + this->dmgPart] = 0; + Meteo_801892F0(this, this->dmgPart); + this->swork[20]++; + if (this->swork[20] == 2) { Radio_PlayMessage(gMsg_ID_17160, RCID_PEPPY); } - if (boss->swork[20] == 3) { + if (this->swork[20] == 3) { Radio_PlayMessage(gMsg_ID_3371, RCID_BOSS_METEO); } - if (boss->swork[20] == 4) { + if (this->swork[20] == 4) { Radio_PlayMessage(gMsg_ID_3320, RCID_BOSS_METEO); } } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - if (boss->state >= 9) { - if (boss->dmgPart == 5) { - if ((boss->swork[7] != 0) && (boss->fwork[22] > 0.8f)) { - AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, boss->sfxSource, 4); - boss->swork[14] = 20; - boss->swork[7] -= boss->damage; - if (boss->swork[7] <= 0) { - boss->swork[7] = 0; - Meteo_801892F0(boss, boss->dmgPart); + if (this->state >= 9) { + if (this->dmgPart == 5) { + if ((this->swork[7] != 0) && (this->fwork[22] > 0.8f)) { + AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); + this->swork[14] = 20; + this->swork[7] -= this->damage; + if (this->swork[7] <= 0) { + this->swork[7] = 0; + Meteo_801892F0(this, this->dmgPart); } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - if (boss->dmgPart == 7) { - if ((boss->swork[8] != 0) && (boss->fwork[23] > 0.8f)) { - AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, boss->sfxSource, 4); - boss->swork[15] = 20; - boss->swork[8] -= boss->damage; - if (boss->swork[8] <= 0) { - boss->swork[8] = 0; - Meteo_801892F0(boss, boss->dmgPart); + if (this->dmgPart == 7) { + if ((this->swork[8] != 0) && (this->fwork[23] > 0.8f)) { + AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); + this->swork[15] = 20; + this->swork[8] -= this->damage; + if (this->swork[8] <= 0) { + this->swork[8] = 0; + Meteo_801892F0(this, this->dmgPart); } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - if (boss->swork[7] <= 0) { - if (boss->swork[8] <= 0) { - Boss_AwardBonus(boss); + if (this->swork[7] <= 0) { + if (this->swork[8] <= 0) { + Boss_AwardBonus(this); - boss->state = 20; - boss->timer_050 = 300; - boss->timer_052 = 260; - boss->vel.x = 0.0f; - boss->vel.y = 0.0f; + this->state = 20; + this->timer_050 = 300; + this->timer_052 = 260; + this->vel.x = 0.0f; + this->vel.y = 0.0f; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { @@ -939,7 +940,7 @@ void Meteo_8018978C(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); gScreenFlashTimer = 8; } } @@ -947,103 +948,103 @@ void Meteo_8018978C(Boss* boss) { } } - sp7C = boss->obj.pos.z + gPathProgress; + sp7C = this->obj.pos.z + gPathProgress; - if (boss->state >= 3) { - if (boss->state < 20) { - Math_SmoothStepToF(&boss->vel.z, -gArwingSpeed, 0.1f, 2.0f, 0.0f); - if ((boss->fwork[9] + 200.0f) < sp7C) { - Math_SmoothStepToF(&boss->vel.z, -60.0f, 0.1f, 4.0f, 0.0f); + if (this->state >= 3) { + if (this->state < 20) { + Math_SmoothStepToF(&this->vel.z, -gArwingSpeed, 0.1f, 2.0f, 0.0f); + if ((this->fwork[9] + 200.0f) < sp7C) { + Math_SmoothStepToF(&this->vel.z, -60.0f, 0.1f, 4.0f, 0.0f); } - if (sp7C < (boss->fwork[9] - 300.0f)) { - Math_SmoothStepToF(&boss->vel.z, 20.0f, 0.1f, 4.0f, 0.0f); + if (sp7C < (this->fwork[9] - 300.0f)) { + Math_SmoothStepToF(&this->vel.z, 20.0f, 0.1f, 4.0f, 0.0f); } } } - if ((boss->state >= 3) && (boss->state < 20)) { - switch (boss->swork[16]) { + if ((this->state >= 3) && (this->state < 20)) { + switch (this->swork[16]) { case 0: - if (boss->vel.y > 0.0f) { - boss->vel.y -= 0.2f; + if (this->vel.y > 0.0f) { + this->vel.y -= 0.2f; } - if (boss->vel.y < 0.0f) { - boss->vel.y += 0.2f; + if (this->vel.y < 0.0f) { + this->vel.y += 0.2f; } - if (boss->timer_054 == 0) { - boss->timer_054 = 20; - boss->fwork[13] = 7.0f; - if (boss->obj.pos.y > 0.0f) { - boss->fwork[13] = -7.0f; + if (this->timer_054 == 0) { + this->timer_054 = 20; + this->fwork[13] = 7.0f; + if (this->obj.pos.y > 0.0f) { + this->fwork[13] = -7.0f; } - boss->timer_054 = RAND_INT(30.0f) + 40.0f; - boss->swork[16] = 1; + this->timer_054 = RAND_INT(30.0f) + 40.0f; + this->swork[16] = 1; } break; case 1: - if (boss->fwork[13] < boss->vel.y) { - boss->vel.y = boss->vel.y - 0.2f; + if (this->fwork[13] < this->vel.y) { + this->vel.y = this->vel.y - 0.2f; } - if (boss->vel.y < boss->fwork[13]) { - boss->vel.y += 0.2f; + if (this->vel.y < this->fwork[13]) { + this->vel.y += 0.2f; } - if (boss->timer_054 == 0) { - boss->swork[16] = 0; - boss->timer_054 = RAND_INT(30.0f) + 40.0f; + if (this->timer_054 == 0) { + this->swork[16] = 0; + this->timer_054 = RAND_INT(30.0f) + 40.0f; } break; } - switch (boss->swork[17]) { + switch (this->swork[17]) { case 0: - if (boss->vel.x > 0.0f) { - boss->vel.x = boss->vel.x - 0.2f; + if (this->vel.x > 0.0f) { + this->vel.x = this->vel.x - 0.2f; } - if (boss->vel.x < 0.0f) { - boss->vel.x += 0.2f; + if (this->vel.x < 0.0f) { + this->vel.x += 0.2f; } - if (boss->timer_056 == 0) { - boss->timer_056 = 20; - boss->fwork[14] = 7.0f; - if (boss->obj.pos.x > 0.0f) { - boss->fwork[14] = -7.0f; + if (this->timer_056 == 0) { + this->timer_056 = 20; + this->fwork[14] = 7.0f; + if (this->obj.pos.x > 0.0f) { + this->fwork[14] = -7.0f; } - boss->timer_056 = RAND_INT(40.0f) + 50.0f; - boss->swork[17] = 1; + this->timer_056 = RAND_INT(40.0f) + 50.0f; + this->swork[17] = 1; } break; case 1: - if (boss->fwork[14] < boss->vel.x) { - boss->vel.x = boss->vel.x - 0.2f; + if (this->fwork[14] < this->vel.x) { + this->vel.x = this->vel.x - 0.2f; } - if (boss->vel.x < boss->fwork[14]) { - boss->vel.x += 0.2f; + if (this->vel.x < this->fwork[14]) { + this->vel.x += 0.2f; } - if (boss->timer_056 == 0) { - boss->swork[17] = 0; - boss->timer_056 = RAND_INT(40.0f) + 50.0f; + if (this->timer_056 == 0) { + this->swork[17] = 0; + this->timer_056 = RAND_INT(40.0f) + 50.0f; } break; } } - if (boss->swork[18] != 0) { + if (this->swork[18] != 0) { s32 objId; - if (func_hud_8008AC54(0) >= 4) { - objId = OBJ_ACTOR_191; + if (Hud_MissileSeekModeCheck(0) >= 4) { + objId = OBJ_MISSILE_SEEK_PLAYER; } else { - objId = OBJ_ACTOR_190; + objId = OBJ_MISSILE_SEEK_TEAM; } - AUDIO_PLAY_SFX(NA_SE_EN_BARREL_SHOT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_BARREL_SHOT, this->sfxSource, 4); src.x = 0.0f; src.y = 330.0f; @@ -1051,11 +1052,11 @@ void Meteo_8018978C(Boss* boss) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - if (boss->swork[18] == 1) { - Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 270.0f, + if (this->swork[18] == 1) { + Meteo_80187D08(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 50.0f, 270.0f, 0.0f, 30, 0, objId); } else { - Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 0.0f, + Meteo_80187D08(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 50.0f, 0.0f, 0.0f, 0, 0, objId); } @@ -1063,14 +1064,14 @@ void Meteo_8018978C(Boss* boss) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - if (boss->swork[18] == 1) { - Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 90.0f, + if (this->swork[18] == 1) { + Meteo_80187D08(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 50.0f, 90.0f, 0.0f, 30, 0, objId); } else { - Meteo_80187D08(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, 50.0f, 0.0f, + Meteo_80187D08(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 50.0f, 0.0f, 0.0f, 0, 0, objId); } - boss->swork[18] = 0; + this->swork[18] = 0; } if ((sp7C < 200.0f) && (sp7C > -1500.0f)) { @@ -1079,158 +1080,158 @@ void Meteo_8018978C(Boss* boss) { gLight2zRotTarget = 0.0f; } - switch (boss->state) { + switch (this->state) { case 0: - boss->swork[0] = 10; - boss->swork[1] = 10; + this->swork[0] = 10; + this->swork[1] = 10; - boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[1]); - boss->vel.z = boss->fwork[0] - gPathVelZ; + this->obj.pos.y += ((0.0f - this->obj.pos.y) * this->fwork[1]); + this->vel.z = this->fwork[0] - gPathVelZ; - if (sp7C < boss->fwork[9]) { - boss->state = 1; - boss->fwork[1] = 0.0f; + if (sp7C < this->fwork[9]) { + this->state = 1; + this->fwork[1] = 0.0f; } if (sp7C < -1000.0f) { - if (boss->fwork[1] < 0.005f) { - boss->fwork[1] = boss->fwork[1] + 0.0001f; + if (this->fwork[1] < 0.005f) { + this->fwork[1] = this->fwork[1] + 0.0001f; } } break; case 1: - boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[1]); - boss->vel.z = boss->fwork[0] - gPathVelZ; + this->obj.pos.y += ((0.0f - this->obj.pos.y) * this->fwork[1]); + this->vel.z = this->fwork[0] - gPathVelZ; - if (boss->fwork[0] < 0.0f) { - boss->fwork[0] += 0.5f; - if (boss->fwork[0] >= 0.0f) { - boss->state = 2; - boss->timer_050 = 50; - gBosses[boss->unk_044].state = 1; + if (this->fwork[0] < 0.0f) { + this->fwork[0] += 0.5f; + if (this->fwork[0] >= 0.0f) { + this->state = 2; + this->timer_050 = 50; + gBosses[this->unk_044].state = 1; } } - if (boss->fwork[1] < 0.005f) { - boss->fwork[1] = boss->fwork[1] + 0.0001f; + if (this->fwork[1] < 0.005f) { + this->fwork[1] = this->fwork[1] + 0.0001f; } break; case 2: - boss->obj.pos.y += ((0.0f - boss->obj.pos.y) * boss->fwork[1]); - boss->vel.z = boss->fwork[0] - gPathVelZ; + this->obj.pos.y += ((0.0f - this->obj.pos.y) * this->fwork[1]); + this->vel.z = this->fwork[0] - gPathVelZ; - if (boss->fwork[1] < 0.05f) { - boss->fwork[1] = boss->fwork[1] + 0.0004f; + if (this->fwork[1] < 0.05f) { + this->fwork[1] = this->fwork[1] + 0.0004f; } - if (boss->timer_050 == 0) { - boss->state = 3; - boss->timer_050 = 50; - boss->timer_058 = 100; + if (this->timer_050 == 0) { + this->state = 3; + this->timer_050 = 50; + this->timer_058 = 100; Radio_PlayMessage(gMsg_ID_3310, RCID_BOSS_METEO); } break; case 3: - if (boss->timer_052 == 0) { + if (this->timer_052 == 0) { rand = Rand_ZeroOne(); - boss->fwork[9] = -3000.0f; + this->fwork[9] = -3000.0f; if (rand < 0.3f) { - boss->fwork[9] = -2000.0f; + this->fwork[9] = -2000.0f; } if (rand > 0.7f) { - boss->fwork[9] = -4000.0f; + this->fwork[9] = -4000.0f; } - boss->timer_052 = 80; - } else if (boss->vel.z < -50.0f) { - if (boss->swork[0] == 5) { - AUDIO_PLAY_SFX(NA_SE_EN_BURNER_L, boss->sfxSource, 4); + this->timer_052 = 80; + } else if (this->vel.z < -50.0f) { + if (this->swork[0] == 5) { + AUDIO_PLAY_SFX(NA_SE_EN_BURNER_L, this->sfxSource, 4); } - if (boss->swork[0] < 10) { - boss->swork[0] += 2; - if (boss->swork[0] > 10) { - boss->swork[0] = 10; + if (this->swork[0] < 10) { + this->swork[0] += 2; + if (this->swork[0] > 10) { + this->swork[0] = 10; } } - if (boss->swork[1] < 10) { - boss->swork[1] += 2; - if (boss->swork[1] > 10) { - boss->swork[1] = 10; + if (this->swork[1] < 10) { + this->swork[1] += 2; + if (this->swork[1] > 10) { + this->swork[1] = 10; } } } - if (gBosses[boss->unk_044].state < 3) { + if (gBosses[this->unk_044].state < 3) { var_v0 = 0; - if (boss->swork[2] == 0) { + if (this->swork[2] == 0) { var_v0 = 1; - boss->obj.rot.z += 0.1f; + this->obj.rot.z += 0.1f; } - if (boss->swork[3] == 0) { + if (this->swork[3] == 0) { var_v0++; - boss->obj.rot.z += 0.1f; + this->obj.rot.z += 0.1f; } - if (boss->swork[4] == 0) { + if (this->swork[4] == 0) { var_v0++; - boss->obj.rot.z += 0.1f; + this->obj.rot.z += 0.1f; } - if (boss->swork[5] == 0) { + if (this->swork[5] == 0) { var_v0++; - boss->obj.rot.z += 0.1f; + this->obj.rot.z += 0.1f; } if (var_v0 == 4) { - gBosses[boss->unk_044].state = 3; - boss->state = 4; - boss->timer_050 = 250; - boss->timer_05A = 30; - boss->fwork[10] = 0; + gBosses[this->unk_044].state = 3; + this->state = 4; + this->timer_050 = 250; + this->timer_05A = 30; + this->fwork[10] = 0; } - if ((boss->timer_050 == 0) && (gBosses[boss->unk_044].state == 2)) { - boss->fwork[2] = 90.0f; - boss->timer_050 = D_i2_80195520[var_v0] + 45; - AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL, boss->sfxSource, 4); + if ((this->timer_050 == 0) && (gBosses[this->unk_044].state == 2)) { + this->fwork[2] = 90.0f; + this->timer_050 = D_i2_80195520[var_v0] + 45; + AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL, this->sfxSource, 4); } - if (boss->fwork[2] > 0.0f) { - boss->fwork[2] -= 2.0f; - gBosses[boss->unk_044].rot_078.z -= 2.0f; + if (this->fwork[2] > 0.0f) { + this->fwork[2] -= 2.0f; + gBosses[this->unk_044].rot_078.z -= 2.0f; } } - if (boss->timer_058 == 0) { - boss->timer_058 = RAND_INT(80.0f) + 180.0f; - boss->swork[18] = 1; + if (this->timer_058 == 0) { + this->timer_058 = RAND_INT(80.0f) + 180.0f; + this->swork[18] = 1; } break; case 4: - boss->fwork[9] = -3000.0f; - if (boss->fwork[10] < 0.02f) { - boss->fwork[10] += 0.0002f; + this->fwork[9] = -3000.0f; + if (this->fwork[10] < 0.02f) { + this->fwork[10] += 0.0002f; } - boss->obj.rot.z += ((0.0f - boss->obj.rot.z) * boss->fwork[10]); - if (boss->timer_050 == 100) { + this->obj.rot.z += ((0.0f - this->obj.rot.z) * this->fwork[10]); + if (this->timer_050 == 100) { Radio_PlayMessage(gMsg_ID_3321, RCID_BOSS_METEO); } - if (boss->timer_050 == 0) { - boss->state = 5; - boss->timer_050 = 70; + if (this->timer_050 == 0) { + this->state = 5; + this->timer_050 = 70; } break; case 5: - boss->obj.rot.z += ((0.0f - boss->obj.rot.z) * 0.02f); + this->obj.rot.z += ((0.0f - this->obj.rot.z) * 0.02f); - if (boss->timer_050 == 1) { - AUDIO_PLAY_SFX(NA_SE_EN_S_BEAM_CHARGE, boss->sfxSource, 4); + if (this->timer_050 == 1) { + AUDIO_PLAY_SFX(NA_SE_EN_S_BEAM_CHARGE, this->sfxSource, 4); } - if (boss->timer_050 == 0) { + if (this->timer_050 == 0) { gLight1xRotTarget = 0.0f; gLight1yRotTarget = 5.0f; gLight1zRotTarget = 0.0f; @@ -1240,76 +1241,76 @@ void Meteo_8018978C(Boss* boss) { gLight1rotStep = 5.0f; gLight2rotStep = 5.0f; - if (boss->fwork[11] < 70.0f) { - boss->fwork[11] += 1.0f; - if (boss->fwork[11] > 20.0f) { - boss->fwork[11] += 1.0f; + if (this->fwork[11] < 70.0f) { + this->fwork[11] += 1.0f; + if (this->fwork[11] > 20.0f) { + this->fwork[11] += 1.0f; } } else { - boss->state = 6; - boss->timer_050 = 75; + this->state = 6; + this->timer_050 = 75; } - if (boss->fwork[11] > 30.0f) { + if (this->fwork[11] > 30.0f) { Meteo_80189624(); } } break; case 6: - boss->obj.rot.z = boss->obj.rot.z + ((0.0f - boss->obj.rot.z) * 0.02f); - Math_SmoothStepToF(&boss->fwork[0x15], 4.0f, 1.0f, 0.1f, 0.0f); + this->obj.rot.z = this->obj.rot.z + ((0.0f - this->obj.rot.z) * 0.02f); + Math_SmoothStepToF(&this->fwork[0x15], 4.0f, 1.0f, 0.1f, 0.0f); if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT) { gFillScreenRed = gFillScreenAlpha = gFillScreenGreen = gFillScreenBlue = 0; - if ((boss->timer_050 == 10) || (boss->timer_050 == 30) || (boss->timer_050 == 50) || - (boss->timer_050 == 70)) { + if ((this->timer_050 == 10) || (this->timer_050 == 30) || (this->timer_050 == 50) || + (this->timer_050 == 70)) { gFillScreenAlpha = 150; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; - Meteo_80187E38(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 1300.0f, - boss->fwork[12] + boss->obj.rot.z); - boss->fwork[12] = RAND_FLOAT(360.0f); + Meteo_80187E38(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 1300.0f, + this->fwork[12] + this->obj.rot.z); + this->fwork[12] = RAND_FLOAT(360.0f); } - if ((boss->timer_050 == 13) || (boss->timer_050 == 33) || (boss->timer_050 == 53) || - (boss->timer_050 == 73)) { + if ((this->timer_050 == 13) || (this->timer_050 == 33) || (this->timer_050 == 53) || + (this->timer_050 == 73)) { gFillScreenAlpha = 150; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; } - if (boss->timer_050 == 0) { - boss->state = 7; - AUDIO_PLAY_SFX(NA_SE_EN_S_BEAM_END, boss->sfxSource, 4); + if (this->timer_050 == 0) { + this->state = 7; + AUDIO_PLAY_SFX(NA_SE_EN_S_BEAM_END, this->sfxSource, 4); } Meteo_80189624(); } break; case 7: - if (boss->fwork[11] > 26.0f) { + if (this->fwork[11] > 26.0f) { Meteo_80189624(); } - if (boss->fwork[11] > 0.0f) { - boss->fwork[11] -= 2.0f; - if (boss->fwork[11] <= 0.0f) { - boss->fwork[11] = 0.0f; - Audio_KillSfxBySource(boss->sfxSource); - if (boss->swork[6] == 0) { - boss->state = 8; + if (this->fwork[11] > 0.0f) { + this->fwork[11] -= 2.0f; + if (this->fwork[11] <= 0.0f) { + this->fwork[11] = 0.0f; + Audio_KillSfxBySource(this->sfxSource); + if (this->swork[6] == 0) { + this->state = 8; - boss->timer_050 = 190; - boss->timer_052 = 230; + this->timer_050 = 190; + this->timer_052 = 230; - boss->fwork[10] = 0.0f; - boss->fwork[22] = 0.0f; - boss->fwork[23] = 0.0f; + this->fwork[10] = 0.0f; + this->fwork[22] = 0.0f; + this->fwork[23] = 0.0f; gCsFrameCount = 0; Radio_PlayMessage(gMsg_ID_3322, RCID_BOSS_METEO); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); } else { - boss->state = 5; - boss->timer_050 = 70; + this->state = 5; + this->timer_050 = 70; } } } @@ -1334,116 +1335,116 @@ void Meteo_8018978C(Boss* boss) { } } - if (boss->timer_050 == 0) { - if (boss->fwork[10] < 0.02f) { - boss->fwork[10] = boss->fwork[10] + 0.0002f; + if (this->timer_050 == 0) { + if (this->fwork[10] < 0.02f) { + this->fwork[10] = this->fwork[10] + 0.0002f; } - boss->obj.rot.x += (-180.0f - boss->obj.rot.x) * boss->fwork[10]; + this->obj.rot.x += (-180.0f - this->obj.rot.x) * this->fwork[10]; - if (boss->timer_052 != 0) { - if (boss->swork[0] == 5) { - AUDIO_PLAY_SFX(NA_SE_EN_BURNER_L, boss->sfxSource, 4); + if (this->timer_052 != 0) { + if (this->swork[0] == 5) { + AUDIO_PLAY_SFX(NA_SE_EN_BURNER_L, this->sfxSource, 4); } - if (boss->swork[0] < 10) { - boss->swork[0] += 2; - if (boss->swork[0] > 10) { - boss->swork[0] = 10; + if (this->swork[0] < 10) { + this->swork[0] += 2; + if (this->swork[0] > 10) { + this->swork[0] = 10; } } } - if (boss->obj.rot.x < -178.0f) { - boss->state = 9; - boss->timer_050 = 0; - boss->fwork[15] = 8.0f; - AUDIO_PLAY_SFX(NA_SE_EN_RNG_BEAM_CHARGE, boss->sfxSource, 4); + if (this->obj.rot.x < -178.0f) { + this->state = 9; + this->timer_050 = 0; + this->fwork[15] = 8.0f; + AUDIO_PLAY_SFX(NA_SE_EN_RNG_BEAM_CHARGE, this->sfxSource, 4); } } break; case 9: - boss->obj.rot.x += (-180.0f - boss->obj.rot.x) * boss->fwork[10]; - if ((boss->timer_050 > 50) && (boss->timer_050 <= 64)) { - boss->fwork[22] -= 0.1f; - if (boss->fwork[22] < 0.0f) { - boss->fwork[22] = 0.0f; + this->obj.rot.x += (-180.0f - this->obj.rot.x) * this->fwork[10]; + if ((this->timer_050 > 50) && (this->timer_050 <= 64)) { + this->fwork[22] -= 0.1f; + if (this->fwork[22] < 0.0f) { + this->fwork[22] = 0.0f; } - boss->fwork[23] -= 0.1f; - if (boss->fwork[23] < 0.0f) { - boss->fwork[23] = 0.0f; + this->fwork[23] -= 0.1f; + if (this->fwork[23] < 0.0f) { + this->fwork[23] = 0.0f; } } - if (boss->timer_050 < 20) { - boss->fwork[22] += 0.1f; - if (boss->fwork[22] > 1.0f) { - boss->fwork[22] = 1.0f; + if (this->timer_050 < 20) { + this->fwork[22] += 0.1f; + if (this->fwork[22] > 1.0f) { + this->fwork[22] = 1.0f; } - boss->fwork[23] += 0.1f; - if (boss->fwork[23] > 1.0f) { - boss->fwork[23] = 1.0f; + this->fwork[23] += 0.1f; + if (this->fwork[23] > 1.0f) { + this->fwork[23] = 1.0f; } } - if (boss->timer_050 == 40) { - boss->swork[18] = 2; + if (this->timer_050 == 40) { + this->swork[18] = 2; } - if (boss->timer_050 == 0) { - boss->fwork[15] -= 0.1f; - if (boss->fwork[15] < -1.0f) { - boss->timer_050 = 40; - boss->state = 10; + if (this->timer_050 == 0) { + this->fwork[15] -= 0.1f; + if (this->fwork[15] < -1.0f) { + this->timer_050 = 40; + this->state = 10; } } break; case 10: - if (boss->timer_050 == 0) { - boss->state = 9; - boss->timer_050 = 70; - boss->fwork[15] = 8.0f; - AUDIO_PLAY_SFX(NA_SE_EN_RNG_BEAM_CHARGE, boss->sfxSource, 4); - } else if ((boss->timer_050 % 2U) == 1) { - Meteo_80188088(boss); + if (this->timer_050 == 0) { + this->state = 9; + this->timer_050 = 70; + this->fwork[15] = 8.0f; + AUDIO_PLAY_SFX(NA_SE_EN_RNG_BEAM_CHARGE, this->sfxSource, 4); + } else if ((this->timer_050 % 2U) == 1) { + Meteo_80188088(this); } break; case 20: - if (boss->timer_052 == 230) { + if (this->timer_052 == 230) { Radio_PlayMessage(gMsg_ID_3370, RCID_BOSS_METEO); } - if (boss->timer_052 == 90) { + if (this->timer_052 == 90) { Radio_PlayMessage(gMsg_ID_3360, RCID_FOX); } if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { - boss->timer_05C = 4; + this->timer_05C = 4; } Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i2_80195430[RAND_INT(19.9f)], &dest); if (((gGameFrameCount % 2) == 0)) { - func_effect_8007C120(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, - boss->vel.x, boss->vel.y, boss->vel.z, 0.3f, 20); + func_effect_8007C120(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, + this->vel.x, this->vel.y, this->vel.z, 0.3f, 20); } if (((gGameFrameCount % 4) == 0)) { - func_effect_8007BFFC(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, - boss->vel.x, boss->vel.y, boss->vel.z, 10.0f, 10); + func_effect_8007BFFC(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, + this->vel.x, this->vel.y, this->vel.z, 10.0f, 10); } - boss->vel.y = -5.0f; - boss->obj.rot.x += 0.2f; - boss->obj.rot.z -= 0.1f; + this->vel.y = -5.0f; + this->obj.rot.x += 0.2f; + this->obj.rot.z -= 0.1f; - if (boss->timer_050 == 0) { - func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f); - Object_Kill(&boss->obj, boss->sfxSource); + if (this->timer_050 == 0) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); + Object_Kill(&this->obj, this->sfxSource); } - if (boss->timer_050 == 20) { - func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 80.0f); - AUDIO_PLAY_SFX(NA_SE_EN_STAR_EXPLOSION, boss->sfxSource, 4); + if (this->timer_050 == 20) { + func_effect_8007A568(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 80.0f); + AUDIO_PLAY_SFX(NA_SE_EN_STAR_EXPLOSION, this->sfxSource, 4); gControllerRumbleTimers[0] = 60; for (i = 0; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.id == OBJ_ACTOR_TEAM_BOSS) { @@ -1452,7 +1453,7 @@ void Meteo_8018978C(Boss* boss) { } } - switch (boss->timer_050) { + switch (this->timer_050) { case 20: gShowBossHealth = false; @@ -1460,23 +1461,23 @@ void Meteo_8018978C(Boss* boss) { case 5: case 10: case 15: - func_effect_8007B344(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 71.0f, 5); + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 71.0f, 5); case 0: for (i = 0; i < ARRAY_COUNT(gEffects); i++) { - func_effect_80079618(RAND_FLOAT_CENTERED(1000.0f) + boss->obj.pos.x, - RAND_FLOAT_CENTERED(1000.0f) + boss->obj.pos.y, - RAND_FLOAT_CENTERED(1000.0f) + boss->obj.pos.z, 3.0f); + func_effect_80079618(RAND_FLOAT_CENTERED(1000.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(1000.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(1000.0f) + this->obj.pos.z, 3.0f); } break; } } - if (boss->obj.rot.z >= 360.0f) { - boss->obj.rot.z = boss->obj.rot.z - 360.0f; + if (this->obj.rot.z >= 360.0f) { + this->obj.rot.z = this->obj.rot.z - 360.0f; } - if (boss->obj.rot.z < 0.0f) { - boss->obj.rot.z += 360.0f; + if (this->obj.rot.z < 0.0f) { + this->obj.rot.z += 360.0f; } if (gBossFrameCount == 250) { @@ -1486,30 +1487,30 @@ void Meteo_8018978C(Boss* boss) { gShowBossHealth = true; } if (gBossFrameCount > 406) { - gBossHealthBar = (boss->swork[2] + boss->swork[3] + boss->swork[4] + boss->swork[5] + boss->swork[7] + - boss->swork[8] + boss->swork[6]) / + gBossHealthBar = (this->swork[2] + this->swork[3] + this->swork[4] + this->swork[5] + this->swork[7] + + this->swork[8] + this->swork[6]) / 2.6274f; // approx 670 / 255 if ((gBossFrameCount > 506) && (gBossFrameCount < 1000)) { - Math_SmoothStepToF(&boss->fwork[17], 3.3f, 1.0f, 0.1f, 0.0f); - Math_SmoothStepToF(&boss->fwork[18], 3.3f, 1.0f, 0.1f, 0.0f); - Math_SmoothStepToF(&boss->fwork[19], 3.3f, 1.0f, 0.1f, 0.0f); - Math_SmoothStepToF(&boss->fwork[20], 3.3f, 1.0f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[17], 3.3f, 1.0f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[18], 3.3f, 1.0f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[19], 3.3f, 1.0f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[20], 3.3f, 1.0f, 0.1f, 0.0f); } } } void Meteo_8018B7C4(s32 arg0) { - f32 effect = arg0 * 0.83333f; // approx 5 / 6 + f32 xScale = arg0 * 0.83333f; // approx 5 / 6 if ((gGameFrameCount % 2) != 0) { - effect *= 1.1f; + xScale *= 1.1f; } gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); RCP_SetupDL_64(); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 10.0f * effect, 10.0f * effect, 10.0f * effect, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 10.0f * xScale, 10.0f * xScale, 10.0f * xScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 70); gSPDisplayList(gMasterDisp++, D_102ED50); @@ -1517,7 +1518,7 @@ void Meteo_8018B7C4(s32 arg0) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 20.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 9.0f * effect, 9.0f * effect, 9.0f * effect, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 9.0f * xScale, 9.0f * xScale, 9.0f * xScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 60); @@ -1526,7 +1527,7 @@ void Meteo_8018B7C4(s32 arg0) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 35.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 7.5f * effect, 7.5f * effect, 7.5f * effect, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 7.5f * xScale, 7.5f * xScale, 7.5f * xScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 50); @@ -1535,7 +1536,7 @@ void Meteo_8018B7C4(s32 arg0) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 40.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 5.0f * effect, 5.0f * effect, 5.0f * effect, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 5.0f * xScale, 5.0f * xScale, 5.0f * xScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 40); @@ -1544,7 +1545,7 @@ void Meteo_8018B7C4(s32 arg0) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } -void Meteo_8018BACC(Boss* boss) { +void Meteo_Boss297_Draw(Boss297* this) { s32 i; f32 var_fs0; f32 var_fs1; @@ -1555,9 +1556,10 @@ void Meteo_8018BACC(Boss* boss) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); for (i = 0; i < 6; i++) { - if ((boss->fwork[i + 3] != 0) && (boss->fwork[11] == 0.0f)) { - var_fs1 = 2.0f * boss->fwork[3 + i]; + if ((this->fwork[i + 3] != 0) && (this->fwork[11] == 0.0f)) { + var_fs1 = 2.0f * this->fwork[3 + i]; Matrix_Push(&gGfxMatrix); + switch (i) { case 0: Matrix_Translate(gGfxMatrix, 746.0f, 741.0f, 680.0f, MTXF_APPLY); @@ -1600,10 +1602,10 @@ void Meteo_8018BACC(Boss* boss) { } for (i = 0; i < 7; i++) { - if (boss->swork[2 + i] != 0) { - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, boss->swork[19], 255); + if (this->swork[2 + i] != 0) { + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, this->swork[19], 255); - if ((boss->swork[9 + i] % 2) != 0) { + if ((this->swork[9 + i] % 2) != 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 80, 0, 0, 255); } @@ -1612,23 +1614,23 @@ void Meteo_8018BACC(Boss* boss) { if (i == 4) { Matrix_Translate(gGfxMatrix, 0.0f, 0, 300.0f, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[21], boss->fwork[21], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[21], this->fwork[21], 1.0f, MTXF_APPLY); } if (i == 5) { Matrix_Translate(gGfxMatrix, 0.0f, 330.0f, -1022.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[22] * 3.2f, 2.0f * boss->fwork[22], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[22] * 3.2f, 2.0f * this->fwork[22], 1.0f, MTXF_APPLY); } if (i == 6) { Matrix_Translate(gGfxMatrix, 0.0f, -330.0f, -1022.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[23] * 3.2f, 2.0f * boss->fwork[23], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[23] * 3.2f, 2.0f * this->fwork[23], 1.0f, MTXF_APPLY); } if (i < 4) { Matrix_RotateZ(gGfxMatrix, M_DTOR * 90.0f * i, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 200.0f, 500.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[17 + i], boss->fwork[17 + i], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[17 + i], this->fwork[17 + i], 1.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); @@ -1643,10 +1645,11 @@ void Meteo_8018BACC(Boss* boss) { } gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, 128); + for (i = 0; i < 4; i++) { - if (boss->fwork[11] != 0) { - var_fs1 = boss->fwork[11]; - if (boss->fwork[11] > 15.0f) { + if (this->fwork[11] != 0) { + var_fs1 = this->fwork[11]; + if (this->fwork[11] > 15.0f) { var_fs1 = 15.0f; } @@ -1698,8 +1701,8 @@ void Meteo_8018BACC(Boss* boss) { } } - if (boss->fwork[11] > 15.0f) { - var_fs1 = boss->fwork[11] - 15.0f; + if (this->fwork[11] > 15.0f) { + var_fs1 = this->fwork[11] - 15.0f; gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, 255); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 1300.0f, MTXF_APPLY); @@ -1713,8 +1716,8 @@ void Meteo_8018BACC(Boss* boss) { Matrix_Pop(&gGfxMatrix); } - if ((boss->state == 9) || (boss->state == 10)) { - var_fs1 = boss->fwork[15]; + if ((this->state == 9) || (this->state == 10)) { + var_fs1 = this->fwork[15]; for (i = 0; i < 10; i++) { var_fs1 += 0.3f; var_fs0 = var_fs1; @@ -1753,125 +1756,128 @@ void Meteo_8018BACC(Boss* boss) { } } - if (boss->swork[0] > 0) { + if (this->swork[0] > 0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, 650.0f, 600.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Meteo_8018B7C4(boss->swork[0] - 1); + Meteo_8018B7C4(this->swork[0] - 1); Matrix_Pop(&gGfxMatrix); } - if (boss->swork[1] > 0) { + if (this->swork[1] > 0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, -650.0f, 600.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Meteo_8018B7C4(boss->swork[1] - 1); + Meteo_8018B7C4(this->swork[1] - 1); Matrix_Pop(&gGfxMatrix); } gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } -void Meteo_8018C77C(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; +void Meteo_8018C77C(ActorCutscene* this, s32 arg1) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i2_80195584[arg1] + gPlayer[0].pos.x; - actor->obj.pos.y = D_i2_80195594[arg1] + gPlayer[0].pos.y; - actor->obj.pos.z = D_i2_801955A4[arg1] + gPlayer[0].trueZpos; + this->obj.pos.x = D_i2_80195584[arg1] + gPlayer[0].pos.x; + this->obj.pos.y = D_i2_80195594[arg1] + gPlayer[0].pos.y; + this->obj.pos.z = D_i2_801955A4[arg1] + gPlayer[0].trueZpos; - actor->animFrame = D_i2_801955B4[arg1]; - actor->obj.rot.y = 180.0f; - Object_SetInfo(&actor->info, actor->obj.id); - actor->info.cullDistance = 200.0f; + this->animFrame = D_i2_801955B4[arg1]; + this->obj.rot.y = 180.0f; + Object_SetInfo(&this->info, this->obj.id); + this->info.cullDistance = 200.0f; - if (actor->animFrame == 0) { - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + if (this->animFrame == 0) { + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); return; } - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, this->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, this->sfxSource, 0); } -void Meteo_8018C8F4(Actor* actor1, Actor* actor2) { - Actor_Initialize(actor1); - actor1->obj.status = OBJ_INIT; - actor1->obj.id = OBJ_ACTOR_182; +void Meteo_8018C8F4(Actor182* actor182, ActorCutscene* actorCs) { + Actor_Initialize(actor182); + actor182->obj.status = OBJ_INIT; + actor182->obj.id = OBJ_ACTOR_182; - actor1->obj.pos.x = RAND_FLOAT_CENTERED_SEEDED(2000.0f) + actor2->obj.pos.x; - actor1->obj.pos.y = RAND_FLOAT_CENTERED_SEEDED(2000.0f) + actor2->obj.pos.y; - actor1->obj.pos.z = (RAND_FLOAT_CENTERED_SEEDED(500.0f) + actor2->obj.pos.z) - 9000.0f; + actor182->obj.pos.x = RAND_FLOAT_CENTERED_SEEDED(2000.0f) + actorCs->obj.pos.x; + actor182->obj.pos.y = RAND_FLOAT_CENTERED_SEEDED(2000.0f) + actorCs->obj.pos.y; + actor182->obj.pos.z = RAND_FLOAT_CENTERED_SEEDED(500.0f) + actorCs->obj.pos.z - 9000.0f; - actor1->obj.rot.y = RAND_FLOAT_SEEDED(360.0f); - actor1->obj.rot.x = RAND_FLOAT_SEEDED(360.0f); + actor182->obj.rot.y = RAND_FLOAT_SEEDED(360.0f); + actor182->obj.rot.x = RAND_FLOAT_SEEDED(360.0f); - actor1->timer_0C2 = 10000; - actor1->vel.z = 30.0f; - Object_SetInfo(&actor1->info, actor1->obj.id); + actor182->timer_0C2 = 10000; + actor182->vel.z = 30.0f; + Object_SetInfo(&actor182->info, actor182->obj.id); } -void Meteo_8018CA10(Actor* actor1, Actor* actor2, f32 x, f32 y, f32 z) { - Actor_Initialize(actor1); - actor1->obj.status = OBJ_INIT; - actor1->obj.id = OBJ_ACTOR_182; +void Meteo_8018CA10(Actor* actor182, ActorCutscene* actorCs, f32 x, f32 y, f32 z) { + Actor_Initialize(actor182); + actor182->obj.status = OBJ_INIT; + actor182->obj.id = OBJ_ACTOR_182; - actor1->obj.pos.x = actor2->obj.pos.x + x; - actor1->obj.pos.y = actor2->obj.pos.y + y; - actor1->obj.pos.z = actor2->obj.pos.x + z; + actor182->obj.pos.x = actorCs->obj.pos.x + x; + actor182->obj.pos.y = actorCs->obj.pos.y + y; + actor182->obj.pos.z = actorCs->obj.pos.x + z; - actor1->obj.rot.y = RAND_FLOAT_SEEDED(360.0f); - actor1->obj.rot.x = RAND_FLOAT_SEEDED(360.0f); + actor182->obj.rot.y = RAND_FLOAT_SEEDED(360.0f); + actor182->obj.rot.x = RAND_FLOAT_SEEDED(360.0f); - actor1->timer_0C2 = 10000; - actor1->vel.z = 30.0f; - Object_SetInfo(&actor1->info, actor1->obj.id); + actor182->timer_0C2 = 10000; + actor182->vel.z = 30.0f; + Object_SetInfo(&actor182->info, actor182->obj.id); } void Meteo_8018CAD8(void) { - Actor* actor = &gActors[50]; + ActorCutscene* actorCs = &gActors[50]; - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.pos.x = 0.0f; - actor->obj.pos.y = 0.0f; - actor->obj.pos.z = 9000.0f; - actor->animFrame = 10; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - Object_SetInfo(&actor->info, actor->obj.id); + Actor_Initialize(actorCs); + actorCs->obj.status = OBJ_INIT; + actorCs->obj.id = OBJ_ACTOR_CUTSCENE; + + actorCs->obj.pos.x = 0.0f; + actorCs->obj.pos.y = 0.0f; + actorCs->obj.pos.z = 9000.0f; + + actorCs->animFrame = 10; + Object_SetInfo(&actorCs->info, actorCs->obj.id); } -void Meteo_8018CB50(Effect* effect, Actor* actor) { - Effect_Initialize(effect); - effect->obj.status = OBJ_ACTIVE; - effect->obj.id = OBJ_EFFECT_346; - effect->timer_50 = RAND_INT(20.0f) + 20.0f; - effect->scale2 = RAND_FLOAT(0.5f) + 0.5f; +void Meteo_8018CB50(Effect346* this, Actor* actor) { + Effect_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_EFFECT_346; - effect->obj.pos.x = actor->obj.pos.x; - effect->obj.pos.y = actor->obj.pos.y; - effect->obj.pos.z = actor->obj.pos.z; + this->timer_50 = RAND_INT(20.0f) + 20.0f; + this->scale2 = RAND_FLOAT(0.5f) + 0.5f; - effect->vel.x = RAND_FLOAT_CENTERED(30.0f); - effect->vel.y = RAND_FLOAT_CENTERED(30.0f); - effect->vel.z = RAND_FLOAT_CENTERED(30.0f); + this->obj.pos.x = actor->obj.pos.x; + this->obj.pos.y = actor->obj.pos.y; + this->obj.pos.z = actor->obj.pos.z; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + this->vel.x = RAND_FLOAT_CENTERED(30.0f); + this->vel.y = RAND_FLOAT_CENTERED(30.0f); + this->vel.z = RAND_FLOAT_CENTERED(30.0f); + + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } -void Meteo_8018CCF8(Actor* actor) { +void Meteo_8018CCF8(ActorEvent* this) { s32 i; s32 j; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); for (i = 0; i < 25; ++i) { for (j = 0; j < ARRAY_COUNT(gEffects); j++) { if (gEffects[j].obj.status == OBJ_FREE) { - Meteo_8018CB50(&gEffects[j], actor); + Meteo_8018CB50(&gEffects[j], this); break; } } @@ -1965,6 +1971,7 @@ void Meteo_LevelStart(Player* player) { D_ctx_80177A48[0] = 0.0f; player->csTimer = 40; } + sp8F = false; if (gCsFrameCount == 190) { player->csEventTimer = 5; @@ -1987,8 +1994,8 @@ void Meteo_LevelStart(Player* player) { sp8F = true; } if (gCsFrameCount == 600) { - Meteo_8018CA10(&gActors[16], &gActors[3], 100.0f, 500.0f, 1500.0f); - Meteo_8018CA10(&gActors[17], &gActors[3], 300.0f, 400.0f, 2000.0f); + Meteo_8018CA10(&gActors[16], actor3, 100.0f, 500.0f, 1500.0f); + Meteo_8018CA10(&gActors[17], actor3, 300.0f, 400.0f, 2000.0f); } if (gCsFrameCount == 660) { for (i = 4; i < 15; i++) { @@ -1999,15 +2006,15 @@ void Meteo_LevelStart(Player* player) { actor3->obj.pos.z += 4000.0f; for (i = 4; i < 9; i++) { - Meteo_8018C8F4(&gActors[i], &gActors[3]); + Meteo_8018C8F4(&gActors[i], actor3); } actor3->obj.pos.x -= 1000.0f; actor3->obj.pos.z -= 4000.0f; - Meteo_8018CA10(&gActors[13], &gActors[3], 1500.0f, 200.0f, 100.0f); - Meteo_8018CA10(&gActors[14], &gActors[3], 1200.0f, -200.0f, -500.0f); - Meteo_8018CA10(&gActors[15], &gActors[3], 2000.0f, -100.0f, -1000.0f); + Meteo_8018CA10(&gActors[13], actor3, 1500.0f, 200.0f, 100.0f); + Meteo_8018CA10(&gActors[14], actor3, 1200.0f, -200.0f, -500.0f); + Meteo_8018CA10(&gActors[15], actor3, 2000.0f, -100.0f, -1000.0f); gActors[50].obj.status = gActors[16].obj.status = gActors[17].obj.status = OBJ_FREE; } @@ -2113,49 +2120,53 @@ void Meteo_LevelStart(Player* player) { Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.0f); } -void Meteo_8018D9EC(Actor* actor) { - switch (actor->state) { +// Actors from OBJ_ACTOR_183 to OBJ_ACTOR_185 +void Meteo_ActorDoodad_Update(Actor* this) { + switch (this->state) { case 0: - actor->fwork[0] = RAND_FLOAT_CENTERED(10.0f); - actor->state = 1; + this->fwork[0] = RAND_FLOAT_CENTERED(10.0f); + this->state = 1; case 1: - actor->obj.rot.z += actor->fwork[0]; + this->obj.rot.z += this->fwork[0]; break; } - Meteo_80187530(actor); + Meteo_ReflectDamage(this); } -void Meteo_8018DA6C(Actor* actor) { +// Little Meteor piece 1 +void Meteo_Actor183_Draw(Actor183* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_ME_6017AD0); } -void Meteo_8018DAEC(Actor* actor) { +// Little Meteor piece 2 +void Meteo_Actor184_Draw(Actor184* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_ME_6016240); } -void Meteo_8018DB6C(Actor* actor) { +// Little Meteor piece 3 +void Meteo_Actor185_Draw(Actor185* this) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_ME_600CD60); } -void Meteo_8018DBEC(Effect* effect) { - if (effect->state == 1) { - Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); +void Meteo_Effect370_Draw(Effect370* this) { + if (this->state == 1) { + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); gSPDisplayList(gMasterDisp++, D_ME_60263F0); } } -void Meteo_8018DCE4(Effect* effect) { - if (effect->state != 0) { - Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2 * 3.0f, MTXF_APPLY); +void Meteo_Effect369_Draw(Effect369* this) { + if (this->state != 0) { + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2 * 3.0f, MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { Matrix_RotateZ(gGfxMatrix, M_PI, MTXF_APPLY); @@ -2163,18 +2174,18 @@ void Meteo_8018DCE4(Effect* effect) { Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, this->unk_44); gSPDisplayList(gMasterDisp++, D_102F5E0); } } -void Meteo_8018DE14(Effect* effect) { - Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); +void Meteo_Effect371_Draw(Effect371* this) { + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale2, this->scale2, this->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, this->unk_44); - switch (effect->unk_4C) { + switch (this->unk_4C) { case 0: gSPDisplayList(gMasterDisp++, D_ME_6023810); case 1: @@ -2182,27 +2193,27 @@ void Meteo_8018DE14(Effect* effect) { } } -void Meteo_8018DF08(Actor* actor, s32 idx) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; +void Meteo_8018DF08(ActorCutscene* this, s32 idx) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i2_801955D0[idx].x + gPlayer[0].pos.x; - actor->obj.pos.y = D_i2_801955D0[idx].y + gPlayer[0].pos.y; - actor->obj.pos.z = D_i2_801955D0[idx].z + gPlayer[0].trueZpos; + this->obj.pos.x = D_i2_801955D0[idx].x + gPlayer[0].pos.x; + this->obj.pos.y = D_i2_801955D0[idx].y + gPlayer[0].pos.y; + this->obj.pos.z = D_i2_801955D0[idx].z + gPlayer[0].trueZpos; - actor->rot_0F4.y = 0.0f; - actor->rot_0F4.z = D_i2_80195600[idx]; + this->rot_0F4.y = 0.0f; + this->rot_0F4.z = D_i2_80195600[idx]; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); if (idx == 3) { - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); - actor->animFrame = 1; + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, this->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, this->sfxSource, 0); + this->animFrame = 1; } else { - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } } @@ -2245,11 +2256,10 @@ void Meteo_LevelComplete(Player* player) { gCsCamEyeX = gBosses[0].obj.pos.x + dest.x; gCsCamEyeY = gBosses[0].obj.pos.y + dest.y; - gCsCamEyeZ = gBosses[0].obj.pos.z + gPathProgress + dest.z; + gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtY = gBosses[0].obj.pos.y; - gCsCamAtZ = gBosses[0].obj.pos.z + gPathProgress; Math_SmoothStepToF(&D_ctx_80177A48[1], 180.0f, 0.05f, 1.0f, 0.0f); @@ -2476,52 +2486,52 @@ void Meteo_LevelComplete(Player* player) { player->rockAngle = SIN_DEG(player->rockPhase); } -void Meteo_8018ED9C(Actor* actor) { - Vec3f sp3C; - Vec3f sp30; +void Meteo_8018ED9C(ActorCutscene* this) { + Vec3f src; + Vec3f dest; - switch (actor->state) { + switch (this->state) { case 0: - actor->vwork[0].x = gPlayer[0].pos.x + D_i2_80195610[actor->index].x; - actor->vwork[0].y = gPlayer[0].pos.y + D_i2_80195610[actor->index].y; - actor->vwork[0].z = gPlayer[0].pos.z + D_i2_80195610[actor->index].z; + this->vwork[0].x = gPlayer[0].pos.x + D_i2_80195610[this->index].x; + this->vwork[0].y = gPlayer[0].pos.y + D_i2_80195610[this->index].y; + this->vwork[0].z = gPlayer[0].pos.z + D_i2_80195610[this->index].z; - Math_SmoothStepToF(&actor->obj.pos.x, actor->vwork[0].x, 0.02f, 50.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->vwork[0].y, 0.02f, 50.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->vwork[0].z, 0.02f, 50.0f, 0.0001f); - Math_SmoothStepToF(&actor->rot_0F4.z, 0.0f, 0.03f, 0.5f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.x, this->vwork[0].x, 0.02f, 50.0f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.y, this->vwork[0].y, 0.02f, 50.0f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.z, this->vwork[0].z, 0.02f, 50.0f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.z, 0.0f, 0.03f, 0.5f, 0.0001f); break; case 1: - actor->state = 2; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->timer_0BC = 150; - actor->fwork[29] = 5.0f; + this->state = 2; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->timer_0BC = 150; + this->fwork[29] = 5.0f; case 2: - actor->iwork[11] = 2; - actor->fwork[0] += 2.0f; - actor->rot_0F4.x += 0.1f; - if (actor->timer_0BC == 0) { - Object_Kill(&actor->obj, actor->sfxSource); + this->iwork[11] = 2; + this->fwork[0] += 2.0f; + this->rot_0F4.x += 0.1f; + if (this->timer_0BC == 0) { + Object_Kill(&this->obj, this->sfxSource); } break; } - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, 0U); - Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), 1U); + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); - sp3C.x = 0.0f; - sp3C.y = 0.0f; - sp3C.z = actor->fwork[0]; + src.x = 0.0f; + src.y = 0.0f; + src.z = this->fwork[0]; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - actor->vel.x = sp30.x; - actor->vel.y = sp30.y; - actor->vel.z = sp30.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y + 180.0f; - actor->obj.rot.z = -actor->rot_0F4.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = +this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index d7a92903..30dde896 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -12,8 +12,8 @@ Vec3f D_i2_80195650 = { 90.0f, 0.0f, 0.0f }; Vec3f D_i2_8019565C = { 73.0f, -102.0f, -80.0f }; Vec3f D_i2_80195668 = { 90.0f, 0.0f, 0.0f }; -bool SectorX_80192AF0(s32, Gfx**, Vec3f*, Vec3f*, void*); -void SectorX_80193208(s32, Vec3f*, void*); +bool SectorX_Boss_OverrideLimbDraw(s32, Gfx**, Vec3f*, Vec3f*, void*); +void SectorX_Boss_PostLimbDraw(s32, Vec3f*, void*); void SectorX_8018F030(void) { s32 i; @@ -38,100 +38,114 @@ void SectorX_8018F030(void) { } } -void SectorX_8018F124(void) { - Actor* actor = &gActors[50]; +void SectorX_SlippyThrowToTitania(void) { + ActorSlippySX* slippy = &gActors[50]; - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_SLIPPY_SX; - actor->animFrame = -1; - actor->obj.pos.x = gPlayer[0].cam.eye.x + 3000.0f; - actor->obj.pos.y = gPlayer[0].cam.eye.y - 3000.0f; - actor->obj.pos.z = gPlayer[0].pos.z + 30000.0f; - Object_SetInfo(&actor->info, actor->obj.id); - actor->info.cullDistance = 100000.0f; + Actor_Initialize(slippy); + slippy->obj.status = OBJ_INIT; + slippy->obj.id = OBJ_ACTOR_SLIPPY_SX; + slippy->animFrame = -1; + + slippy->obj.pos.x = gPlayer[0].cam.eye.x + 3000.0f; + slippy->obj.pos.y = gPlayer[0].cam.eye.y - 3000.0f; + slippy->obj.pos.z = gPlayer[0].pos.z + 30000.0f; + + Object_SetInfo(&slippy->info, slippy->obj.id); + slippy->info.cullDistance = 100000.0f; } -void SectorX_8018F1DC(Actor* actor) { +void SectorX_SlippyShootBoss(ActorSlippySX* this) { Vec3f src; Vec3f dest; src.x = 0.0f; src.y = 0.0f; src.z = 100.0f; - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->rot_0F4.x * M_DTOR, MTXF_APPLY); + + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->rot_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - Actor_SpawnPlayerLaser(actor->index, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), - actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->rot_0F4.x, - actor->rot_0F4.y + 180.0f, 0.0f); + + Actor_SpawnPlayerLaser(this->index, this->obj.pos.x + (dest.x * 1.5), this->obj.pos.y + (dest.y * 1.5), + this->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, this->rot_0F4.x, + this->rot_0F4.y + 180.0f, 0.0f); } -void SectorX_8018F330(Actor* actor) { +void SectorX_Slippy_Update(ActorSlippySX* this) { f32 sp34; - switch (actor->animFrame) { + switch (this->animFrame) { case 0: - actor->obj.rot.x += 7.0f; - actor->obj.rot.y += 5.0f; + this->obj.rot.x += 7.0f; + this->obj.rot.y += 5.0f; break; case 1: - actor->rot_0F4.z += 3.0f; - actor->obj.rot.z = SIN_DEG(actor->rot_0F4.z + 90.0f) * 60.0f; - sp34 = fabsf(actor->obj.pos.z - gBosses[0].obj.pos.z) * 0.1f; - Math_SmoothStepToF(&actor->obj.pos.x, gBosses[0].obj.pos.x + SIN_DEG(actor->rot_0F4.z) * sp34, 0.1f, 20.0f, + this->rot_0F4.z += 3.0f; + this->obj.rot.z = SIN_DEG(this->rot_0F4.z + 90.0f) * 60.0f; + sp34 = fabsf(this->obj.pos.z - gBosses[0].obj.pos.z) * 0.1f; + Math_SmoothStepToF(&this->obj.pos.x, gBosses[0].obj.pos.x + SIN_DEG(this->rot_0F4.z) * sp34, 0.1f, 20.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.y, gBosses[0].obj.pos.y, 0.1f, 20.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, gBosses[0].obj.pos.z, 1.0f, 55.0f, 0); + Math_SmoothStepToF(&this->obj.pos.y, gBosses[0].obj.pos.y, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.z, gBosses[0].obj.pos.z, 1.0f, 55.0f, 0); + if (gBosses[0].state == 20) { - actor->animFrame = 10; + this->animFrame = 10; break; } if (((gGameFrameCount % 4) == 0) && (Rand_ZeroOne() < 0.2f)) { - SectorX_8018F1DC(actor); + SectorX_SlippyShootBoss(this); } if ((gBosses[0].unk_04C == 75) && (gBosses[0].state == 85)) { - actor->animFrame = 2; - actor->vel.x = 10.0f; - actor->vel.y = -10.0f; - actor->vel.z = 30.0f; + this->animFrame = 2; + + this->vel.x = 10.0f; + this->vel.y = -10.0f; + this->vel.z = 30.0f; + Radio_PlayMessage(gMsg_ID_4111, RCID_SLIPPY); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); + gBosses[0].swork[6] = 0; gTeamShields[TEAM_ID_SLIPPY] = -2; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; - actor->timer_0BC = 200; - actor->iwork[14] = 3; - actor->fwork[0] = 0.0f; - actor->fwork[1] = 0.0f; + + this->timer_0BC = 200; + this->iwork[14] = 3; + this->fwork[0] = 0.0f; + this->fwork[1] = 0.0f; + gProjectFar = 30000.0f; - SectorX_8018F124(); + + SectorX_SlippyThrowToTitania(); } break; case 2: - if (actor->timer_0BC == 100) { + if (this->timer_0BC == 100) { Radio_PlayMessage(gMsg_ID_20294, RCID_FOX); } - actor->obj.rot.x += 5.5f; - actor->obj.rot.y += 5.0f; + this->obj.rot.x += 5.5f; + this->obj.rot.y += 5.0f; - if (((gGameFrameCount % 8) == 0)) { - func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); + if ((gGameFrameCount % 8) == 0) { + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); } - Math_SmoothStepToF(&actor->fwork[0], 0.5f, 1.0f, 0.01f, 0); - Math_SmoothStepToF(&actor->fwork[1], 0.1f, 1.0f, 0.01f, 0); - Math_SmoothStepToF(&gPlayer[0].cam.at.x, actor->obj.pos.x, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].cam.at.y, actor->obj.pos.y, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].cam.at.z, actor->obj.pos.z + gPathProgress, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].cam.eye.x, actor->obj.pos.x - 30.0f, actor->fwork[1], 20.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].cam.eye.y, actor->obj.pos.y, actor->fwork[1], 20.0f, 0.0f); - if (actor->timer_0BC == 0) { + Math_SmoothStepToF(&this->fwork[0], 0.5f, 1.0f, 0.01f, 0); + Math_SmoothStepToF(&this->fwork[1], 0.1f, 1.0f, 0.01f, 0); + + Math_SmoothStepToF(&gPlayer[0].cam.at.x, this->obj.pos.x, this->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, this->obj.pos.y, this->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.z, this->obj.pos.z + gPathProgress, this->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.x, this->obj.pos.x - 30.0f, this->fwork[1], 20.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.y, this->obj.pos.y, this->fwork[1], 20.0f, 0.0f); + + if (this->timer_0BC == 0) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; if (gPlayer[0].alternateView) { Camera_UpdateCockpitOnRails(&gPlayer[0], 1); @@ -142,17 +156,17 @@ void SectorX_8018F330(Actor* actor) { break; case 10: - Math_SmoothStepToF(&actor->obj.rot.y, 90.0f, 0.1f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.rot.z, 90.0f, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.x, gBosses[0].obj.pos.x + 10000.0f, 0.1f, 40.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.y, gBosses[0].obj.pos.y + 5000.0f, 0.1f, 10.0f, 0.0f); - Math_SmoothStepToF(&actor->obj.pos.z, gBosses[0].obj.pos.z, 1.0f, 55.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.y, 90.0f, 0.1f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.rot.z, 90.0f, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, gBosses[0].obj.pos.x + 10000.0f, 0.1f, 40.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, gBosses[0].obj.pos.y + 5000.0f, 0.1f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.z, gBosses[0].obj.pos.z, 1.0f, 55.0f, 0.0f); break; } } -void SectorX_8018F884(Actor* actor) { - switch (actor->animFrame) { +void SectorX_Slippy_Draw(ActorSlippySX* this) { + switch (this->animFrame) { case 0: gSPDisplayList(gMasterDisp++, D_SX_6020D20); break; @@ -160,12 +174,12 @@ void SectorX_8018F884(Actor* actor) { case 1: case 2: case 10: - func_edisplay_8005B388(actor); + func_edisplay_8005B388(this); break; case -1: - actor->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); - actor->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); + this->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); + this->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); RCP_SetupDL(&gMasterDisp, SETUPDL_64); gDPSetPrimColor(gMasterDisp++, 0, 0, 220, 70, 30, 255); Matrix_Scale(gGfxMatrix, 70.0f, 70.0f, 1.0f, MTXF_APPLY); @@ -250,37 +264,39 @@ void SectorX_8018FBBC(Vec3f* pos) { } } -void SectorX_8018FE38(Boss* boss) { +void SectorX_Boss304_Update(Boss304* this) { Vec3f sp2C; Vec3f sp20; - if (boss->state == 0) { - Animation_GetFrameData(&D_SX_60206DC, boss->unk_04C, boss->vwork); - Math_Vec3fFromAngles(&sp20, boss->obj.rot.x, boss->obj.rot.y, 20.0f); - boss->vel.x = sp20.x; - boss->vel.y = sp20.y; - boss->vel.z = sp20.z; - boss->state++; + if (this->state == 0) { + Animation_GetFrameData(&D_SX_60206DC, this->unk_04C, this->vwork); + Math_Vec3fFromAngles(&sp20, this->obj.rot.x, this->obj.rot.y, 20.0f); + this->vel.x = sp20.x; + this->vel.y = sp20.y; + this->vel.z = sp20.z; + this->state++; } else { - if (boss->obj.id == OBJ_BOSS_304) { - sp2C.x = boss->fwork[11]; - sp2C.y = boss->fwork[12]; - sp2C.z = boss->fwork[13]; + if (this->obj.id == OBJ_BOSS_304) { + sp2C.x = this->fwork[11]; + sp2C.y = this->fwork[12]; + sp2C.z = this->fwork[13]; } else { - sp2C.x = boss->fwork[8]; - sp2C.y = boss->fwork[9]; - sp2C.z = boss->fwork[10]; + sp2C.x = this->fwork[8]; + sp2C.y = this->fwork[9]; + sp2C.z = this->fwork[10]; } SectorX_8018FBBC(&sp2C); } - if (boss->dmgType == DMG_BEAM) { - boss->dmgType = DMG_NONE; - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_REFLECT); + + if (this->dmgType == DMG_BEAM) { + this->dmgType = DMG_NONE; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } } -void SectorX_8018FF20(Boss* boss) { - SectorX_8018FE38(boss); +// Doors that open when the robot arm hits them? +void SectorX_Boss305_Update(Boss305* this) { + SectorX_Boss304_Update(this); } bool SectorX_8018FF40(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { @@ -291,8 +307,9 @@ bool SectorX_8018FF40(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return 0; } -void SectorX_8018FF84(Boss* boss) { - Animation_DrawSkeleton(3, D_SX_6020C68, boss->vwork, SectorX_8018FF40, SectorX_80193208, boss, gCalcMatrix); +void SectorX_Boss304_Draw(Boss304* this) { + Animation_DrawSkeleton(3, D_SX_6020C68, this->vwork, SectorX_8018FF40, SectorX_Boss_PostLimbDraw, this, + gCalcMatrix); } bool SectorX_8018FFDC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { @@ -303,15 +320,16 @@ bool SectorX_8018FFDC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return 0; } -void SectorX_80190020(Boss* boss) { - Animation_DrawSkeleton(3, D_SX_6020C68, boss->vwork, SectorX_8018FFDC, SectorX_80193208, boss, gCalcMatrix); +void SectorX_Boss305_Draw(Boss305* this) { + Animation_DrawSkeleton(3, D_SX_6020C68, this->vwork, SectorX_8018FFDC, SectorX_Boss_PostLimbDraw, this, + gCalcMatrix); } -void SectorX_80190078(Boss* boss) { +void SectorX_Boss_Update(Spyborg* this) { u8 attack; s32 i; - Vec3f sp80[50]; - Vec3f sp74; + Vec3f frameTable[50]; + Vec3f sfxPos; f32 sp70; f32 sp6C; f32 sp68; @@ -356,727 +374,727 @@ void SectorX_80190078(Boss* boss) { if (gBossFrameCount > 556) { // approximately 700 / 256 - gBossHealthBar = (boss->swork[3] + boss->health) / 2.73f; + gBossHealthBar = (this->swork[3] + this->health) / 2.73f; } - sp68 = gPlayer[0].pos.x - boss->obj.pos.x; - sp64 = gPlayer[0].trueZpos - (boss->obj.pos.z + (-237.0f)); + sp68 = gPlayer[0].pos.x - this->obj.pos.x; + sp64 = gPlayer[0].trueZpos - (this->obj.pos.z + (-237.0f)); - if (boss->swork[7] != 0) { + if (this->swork[7] != 0) { sp70 = Math_RadToDeg(Math_Atan2F(sp68, sp64)); - sp6C = Math_RadToDeg(-Math_Atan2F(gPlayer[0].pos.y - (boss->obj.pos.y + 334.0f), sqrtf(SQ(sp68) + SQ(sp64)))); - Math_SmoothStepToAngle(&boss->fwork[4], sp70, 0.1f, 5.0f, 0.00001f); - Math_SmoothStepToAngle(&boss->fwork[6], sp6C, 0.1f, 5.0f, 0.00001f); + sp6C = Math_RadToDeg(-Math_Atan2F(gPlayer[0].pos.y - (this->obj.pos.y + 334.0f), sqrtf(SQ(sp68) + SQ(sp64)))); + Math_SmoothStepToAngle(&this->fwork[4], sp70, 0.1f, 5.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[6], sp6C, 0.1f, 5.0f, 0.00001f); } else { - Math_SmoothStepToF(&boss->fwork[4], 182.0f, 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToAngle(&boss->fwork[6], 0.0f, 0.1f, 1.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[4], 182.0f, 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[6], 0.0f, 0.1f, 1.0f, 0.00001f); } - boss->fwork[5] = SIN_DEG(boss->timer_054 * 50.0f) * boss->timer_054; - boss->fwork[7] = SIN_DEG(boss->timer_054 * 30.0f) * boss->timer_054 * 0.5f; + this->fwork[5] = SIN_DEG(this->timer_054 * 50.0f) * this->timer_054; + this->fwork[7] = SIN_DEG(this->timer_054 * 30.0f) * this->timer_054 * 0.5f; - Math_SmoothStepToF(&boss->obj.pos.z, gPlayer[0].pos.z + boss->fwork[1], 0.1f, boss->fwork[42], 0); - Math_SmoothStepToF(&boss->obj.pos.y, boss->fwork[2], 0.05f, boss->fwork[43], 0); - Math_SmoothStepToF(&boss->obj.pos.x, boss->fwork[3], 0.05f, boss->fwork[44], 0); - Math_SmoothStepToAngle(&boss->obj.rot.z, boss->fwork[41], 0.05f, 2.0f, 0); + Math_SmoothStepToF(&this->obj.pos.z, gPlayer[0].pos.z + this->fwork[1], 0.1f, this->fwork[42], 0); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[2], 0.05f, this->fwork[43], 0); + Math_SmoothStepToF(&this->obj.pos.x, this->fwork[3], 0.05f, this->fwork[44], 0); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[41], 0.05f, 2.0f, 0); - if (boss->state != 5) { - Math_SmoothStepToF(&boss->fwork[29], 0.f, 0.1f, 50.0f, 0); - Math_SmoothStepToF(&boss->fwork[30], 0.f, 0.1f, 50.0f, 0); - Math_SmoothStepToF(&boss->fwork[31], 0.f, 0.1f, 50.0f, 0); - Math_SmoothStepToF(&boss->fwork[32], 0.f, 0.1f, 50.0f, 0); - Math_SmoothStepToF(&boss->fwork[33], 0.f, 0.1f, 50.0f, 0); - Math_SmoothStepToF(&boss->fwork[34], 0.f, 0.1f, 50.0f, 0); - if (boss->state != 4) { - Math_SmoothStepToF(&boss->fwork[27], 0.0f, 0.1f, 2.0f, 0); - Math_SmoothStepToF(&boss->fwork[28], 0.0f, 0.1f, 2.0f, 0); + if (this->state != 5) { + Math_SmoothStepToF(&this->fwork[29], 0.f, 0.1f, 50.0f, 0); + Math_SmoothStepToF(&this->fwork[30], 0.f, 0.1f, 50.0f, 0); + Math_SmoothStepToF(&this->fwork[31], 0.f, 0.1f, 50.0f, 0); + Math_SmoothStepToF(&this->fwork[32], 0.f, 0.1f, 50.0f, 0); + Math_SmoothStepToF(&this->fwork[33], 0.f, 0.1f, 50.0f, 0); + Math_SmoothStepToF(&this->fwork[34], 0.f, 0.1f, 50.0f, 0); + if (this->state != 4) { + Math_SmoothStepToF(&this->fwork[27], 0.0f, 0.1f, 2.0f, 0); + Math_SmoothStepToF(&this->fwork[28], 0.0f, 0.1f, 2.0f, 0); } } - if (boss->dmgType != DMG_NONE) { - boss->dmgType = DMG_NONE; - if (boss->swork[0] == 1) { - if ((boss->dmgPart == 0) && ((boss->fwork[4] < 45.0f) || (boss->fwork[4] > 315.0f))) { - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, boss->sfxSource, 4); - boss->swork[3] -= boss->damage; - boss->timer_054 = 20; - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y + 334.0f, -237.0f + boss->obj.pos.z, boss->vel.x, - boss->vel.y, boss->vel.z, 0.2f, 20); + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if (this->swork[0] == 1) { + if ((this->dmgPart == 0) && ((this->fwork[4] < 45.0f) || (this->fwork[4] > 315.0f))) { + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); + this->swork[3] -= this->damage; + this->timer_054 = 20; + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y + 334.0f, -237.0f + this->obj.pos.z, this->vel.x, + this->vel.y, this->vel.z, 0.2f, 20); - if (boss->swork[3] <= 0) { - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y + 300.0f, boss->obj.pos.z, 0.0f, 0.0f, 0.0f, + if (this->swork[3] <= 0) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 300.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 10.0f, 50); - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y + 334.0f, -237.0f + boss->obj.pos.z, - boss->vel.x, boss->vel.y, boss->vel.z, 0.15f, 70); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y + 334.0f, -237.0f + this->obj.pos.z, + this->vel.x, this->vel.y, this->vel.z, 0.15f, 70); for (i = 0; i < 10; i++) { - Play_SpawnDebris(4, boss->obj.pos.x, boss->obj.pos.y + 334.0f, -237.0f + boss->obj.pos.z); + Play_SpawnDebris(4, this->obj.pos.x, this->obj.pos.y + 334.0f, -237.0f + this->obj.pos.z); } - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_EXPLOSION_L); - boss->state = 7; - boss->timer_050 = 80; - boss->swork[0] = 0; - boss->timer_05C = 80; - boss->swork[1] = 0; - boss->fwork[0] = 0.0f; - boss->unk_04C = 0; - boss->swork[4] = 1; - boss->health = 1; - boss->swork[7] = 1; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_L); + this->state = 7; + this->timer_050 = 80; + this->swork[0] = 0; + this->timer_05C = 80; + this->swork[1] = 0; + this->fwork[0] = 0.0f; + this->unk_04C = 0; + this->swork[4] = 1; + this->health = 1; + this->swork[7] = 1; Audio_KillSfxBySourceAndId(D_i2_80195D88, NA_SE_EN_SZMIS_ENGINE); Audio_KillSfxBySourceAndId(D_i2_80195D98, NA_SE_EN_SZMIS_ENGINE); - boss->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_603265C); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_603265C); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); - boss->timer_052 = 40; + this->timer_052 = 40; gScreenFlashTimer = 5; } } else { - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } } else { - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } - if (boss->swork[0] == 2) { - if (boss->dmgPart == 0) { - boss->health -= boss->damage; + if (this->swork[0] == 2) { + if (this->dmgPart == 0) { + this->health -= this->damage; - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); - if (boss->health <= 0) { + if (this->health <= 0) { gTeamLowHealthMsgTimer = -1; - boss->obj.rot.y = Math_ModF(boss->obj.rot.y, 360.0f); - boss->state = 20; - boss->timer_050 = 300; - boss->fwork[0] = 0.0f; - boss->unk_04C = 0; + this->obj.rot.y = Math_ModF(this->obj.rot.y, 360.0f); + this->state = 20; + this->timer_050 = 300; + this->fwork[0] = 0.0f; + this->unk_04C = 0; Radio_PlayMessage(gMsg_ID_5499, RCID_BOSS_SECTORX); - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y + 300.0f, boss->obj.pos.z, 0.0f, 0.0f, 0.0f, + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 300.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 10.0f, 50); - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y + 334.0f, -237.0f + boss->obj.pos.z, - boss->vel.x, boss->vel.y, boss->vel.z, 0.15f, 70); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y + 334.0f, -237.0f + this->obj.pos.z, + this->vel.x, this->vel.y, this->vel.z, 0.15f, 70); for (i = 0; i < 10; i++) { - Play_SpawnDebris(4, boss->obj.pos.x, boss->obj.pos.y + 334.0f, -237.0f + boss->obj.pos.z); + Play_SpawnDebris(4, this->obj.pos.x, this->obj.pos.y + 334.0f, -237.0f + this->obj.pos.z); } - boss->swork[4] = 2; + this->swork[4] = 2; - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); gScreenFlashTimer = 8; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); - Boss_AwardBonus(boss); - boss->info.hitbox = gNoHitbox; + Boss_AwardBonus(this); + this->info.hitbox = gNoHitbox; } - boss->timer_054 = 20; - boss->timer_05C = boss->timer_054; - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, - boss->vel.z, 0.2f, 10); + this->timer_054 = 20; + this->timer_05C = this->timer_054; + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.2f, 10); } else { - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_REFLECT); } } } - if (((boss->state != 8) && (boss->state != 20)) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) { - boss->state = 8; - boss->fwork[0] = 0.0f; + if (((this->state != 8) && (this->state != 20)) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) { + this->state = 8; + this->fwork[0] = 0.0f; Audio_KillSfxBySourceAndId(D_i2_80195D88, NA_SE_EN_SZMIS_ENGINE); Audio_KillSfxBySourceAndId(D_i2_80195D98, NA_SE_EN_SZMIS_ENGINE); } - boss->vel.z = -20.0f; + this->vel.z = -20.0f; - switch (boss->state) { + switch (this->state) { case 0: - boss->swork[7] = 1; - boss->obj.pos.x = gPlayer[0].xPath; - boss->swork[0] = 0; - Animation_GetFrameData(&D_SX_60206DC, boss->unk_04C, boss->vwork); - boss->fwork[1] = -2000.0f; - boss->fwork[14] = 300.0f; - boss->fwork[17] = -300.0f; - boss->fwork[16] = 3500.0f; - boss->fwork[19] = 3000.0f; - boss->state = 90; - boss->timer_050 = 450; - boss->swork[3] = 400; - boss->health = 300; - boss->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032550); + this->swork[7] = 1; + this->obj.pos.x = gPlayer[0].xPath; + this->swork[0] = 0; + Animation_GetFrameData(&D_SX_60206DC, this->unk_04C, this->vwork); + this->fwork[1] = -2000.0f; + this->fwork[14] = 300.0f; + this->fwork[17] = -300.0f; + this->fwork[16] = 3500.0f; + this->fwork[19] = 3000.0f; + this->state = 90; + this->timer_050 = 450; + this->swork[3] = 400; + this->health = 300; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032550); gBossActive = true; AUDIO_PLAY_BGM(gBossBgms[gCurrentLevel]); - boss->swork[6] = 1; - boss->fwork[44] = 5.0f; - boss->fwork[43] = 5.0f; - boss->fwork[42] = 30.0f; + this->swork[6] = 1; + this->fwork[44] = 5.0f; + this->fwork[43] = 5.0f; + this->fwork[42] = 30.0f; break; case 90: - if ((boss->timer_050 == 110) || (boss->timer_050 == 66)) { - AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, boss->sfxSource, 4); + if ((this->timer_050 == 110) || (this->timer_050 == 66)) { + AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, this->sfxSource, 4); } - if (fabsf(Math_SmoothStepToF(&boss->fwork[16], 0.0f, 0.1f, 10.0f, 0)) < 8.0f) { - Math_SmoothStepToF(&boss->fwork[14], 0.0f, 0.2f, 10.0f, 0); - if ((boss->timer_050 % 8) == 0) { - func_effect_8007C120(boss->obj.pos.x + 312.0f, boss->obj.pos.y, boss->obj.pos.z - 173.0f, - boss->vel.x, boss->vel.y, boss->vel.z, 0.2f, 8); + if (fabsf(Math_SmoothStepToF(&this->fwork[16], 0.0f, 0.1f, 10.0f, 0)) < 8.0f) { + Math_SmoothStepToF(&this->fwork[14], 0.0f, 0.2f, 10.0f, 0); + if ((this->timer_050 % 8) == 0) { + func_effect_8007C120(this->obj.pos.x + 312.0f, this->obj.pos.y, this->obj.pos.z - 173.0f, + this->vel.x, this->vel.y, this->vel.z, 0.2f, 8); } } - if (fabsf(Math_SmoothStepToF(&boss->fwork[19], 0.0f, 0.1f, 10.0f, 0)) < 8.0f) { - Math_SmoothStepToF(&boss->fwork[17], 0.0f, 0.2f, 10.0f, 0); - if ((boss->timer_050 % 8) == 0) { - func_effect_8007C120(boss->obj.pos.x - 312.0f, boss->obj.pos.y, boss->obj.pos.z - 173.0f, - boss->vel.x, boss->vel.y, boss->vel.z, 0.2f, 8); + if (fabsf(Math_SmoothStepToF(&this->fwork[19], 0.0f, 0.1f, 10.0f, 0)) < 8.0f) { + Math_SmoothStepToF(&this->fwork[17], 0.0f, 0.2f, 10.0f, 0); + if ((this->timer_050 % 8) == 0) { + func_effect_8007C120(this->obj.pos.x - 312.0f, this->obj.pos.y, this->obj.pos.z - 173.0f, + this->vel.x, this->vel.y, this->vel.z, 0.2f, 8); } } - if (boss->timer_050 == 0) { - boss->state = 100; - boss->fwork[0] = 0.0f; - AUDIO_PLAY_SFX(NA_SE_EN_MOTOR_ROLL, boss->sfxSource, 4); + if (this->timer_050 == 0) { + this->state = 100; + this->fwork[0] = 0.0f; + AUDIO_PLAY_SFX(NA_SE_EN_MOTOR_ROLL, this->sfxSource, 4); } - boss->fwork[43] = boss->fwork[44] = 5.0f; - boss->fwork[42] = 30.0f; + this->fwork[43] = this->fwork[44] = 5.0f; + this->fwork[42] = 30.0f; break; case 100: - boss->fwork[1] = -2000.0f; + this->fwork[1] = -2000.0f; - frameData = Animation_GetFrameData(&D_SX_60206DC, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_60206DC, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); + this->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_60206DC)) { - boss->unk_04C = 0; - boss->state = 1; - boss->fwork[0] = 0.0f; - AUDIO_PLAY_SFX(NA_SE_EN_UNIT_COMBINE, boss->sfxSource, 4); + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_60206DC)) { + this->unk_04C = 0; + this->state = 1; + this->fwork[0] = 0.0f; + AUDIO_PLAY_SFX(NA_SE_EN_UNIT_COMBINE, this->sfxSource, 4); } - boss->fwork[43] = boss->fwork[44] = 5.0f; - boss->fwork[42] = 30.0f; + this->fwork[43] = this->fwork[44] = 5.0f; + this->fwork[42] = 30.0f; break; case 1: // Taunt - boss->fwork[1] = -1800.0f; - boss->fwork[3] = gPlayer[0].pos.x; - boss->fwork[2] = gPlayer[0].pos.y; - boss->fwork[42] = 30.0f; - boss->fwork[44] = 5.0f; - boss->fwork[43] = 5.0f; + this->fwork[1] = -1800.0f; + this->fwork[3] = gPlayer[0].pos.x; + this->fwork[2] = gPlayer[0].pos.y; + this->fwork[42] = 30.0f; + this->fwork[44] = 5.0f; + this->fwork[43] = 5.0f; - frameData = Animation_GetFrameData(&D_SX_6016E28, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_6016E28, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_6016E28)) { - boss->unk_04C = 0; - boss->state = 2; - boss->fwork[0] = 0.0f; - boss->swork[1] = 1; - boss->swork[0] = 1; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_6016E28)) { + this->unk_04C = 0; + this->state = 2; + this->fwork[0] = 0.0f; + this->swork[1] = 1; + this->swork[0] = 1; Radio_PlayMessage(gMsg_ID_5494, RCID_BOSS_SECTORX); } break; case 2: // right arm attack attack = true; - boss->fwork[3] = gPlayer[0].pos.x; - boss->fwork[2] = gPlayer[0].pos.y; + this->fwork[3] = gPlayer[0].pos.x; + this->fwork[2] = gPlayer[0].pos.y; - if (boss->unk_04C > 60) { - boss->fwork[1] = -1000.0f; - Math_SmoothStepToF(&boss->fwork[42], 100.0f, 1.0f, 20.0f, 0); - boss->fwork[43] = boss->fwork[44] = 10.0f; + if (this->unk_04C > 60) { + this->fwork[1] = -1000.0f; + Math_SmoothStepToF(&this->fwork[42], 100.0f, 1.0f, 20.0f, 0); + this->fwork[43] = this->fwork[44] = 10.0f; } else { - boss->fwork[1] = -2000.0f; - Math_SmoothStepToF(&boss->fwork[42], 30.0f, 1.0f, 3.0f, 0); - boss->fwork[43] = boss->fwork[44] = 10.0f; + this->fwork[1] = -2000.0f; + Math_SmoothStepToF(&this->fwork[42], 30.0f, 1.0f, 3.0f, 0); + this->fwork[43] = this->fwork[44] = 10.0f; } - if (boss->unk_04C == 60) { - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); - boss->fwork[42] = 0.0f; + if (this->unk_04C == 60) { + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); + this->fwork[42] = 0.0f; } - frameData = Animation_GetFrameData(&D_SX_60123BC, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_60123BC, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_60123BC)) { - boss->unk_04C = 0; - boss->state = 3; - boss->fwork[42] = boss->fwork[43] = boss->fwork[44] = boss->fwork[0] = 0.0f; - boss->swork[7] = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_60123BC)) { + this->unk_04C = 0; + this->state = 3; + this->fwork[42] = this->fwork[43] = this->fwork[44] = this->fwork[0] = 0.0f; + this->swork[7] = 0; } break; case 3: // left arm attack attack = true; - boss->fwork[3] = gPlayer[0].pos.x; - boss->fwork[2] = gPlayer[0].pos.y; + this->fwork[3] = gPlayer[0].pos.x; + this->fwork[2] = gPlayer[0].pos.y; - if (boss->unk_04C > 60) { - boss->fwork[1] = -1000.0f; - Math_SmoothStepToF(&boss->fwork[42], 100.0f, 1.0f, 20.0f, 0); - boss->fwork[44] = 10.0f; - boss->fwork[43] = 10.0f; + if (this->unk_04C > 60) { + this->fwork[1] = -1000.0f; + Math_SmoothStepToF(&this->fwork[42], 100.0f, 1.0f, 20.0f, 0); + this->fwork[44] = 10.0f; + this->fwork[43] = 10.0f; } else { - boss->fwork[1] = -2500.0f; - Math_SmoothStepToF(&boss->fwork[42], 30.0f, 1.0f, 3.0f, 0); - boss->fwork[44] = 10.0f; - boss->fwork[43] = 10.0f; + this->fwork[1] = -2500.0f; + Math_SmoothStepToF(&this->fwork[42], 30.0f, 1.0f, 3.0f, 0); + this->fwork[44] = 10.0f; + this->fwork[43] = 10.0f; } - if (boss->unk_04C == 60) { - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); - boss->fwork[42] = 0.0f; + if (this->unk_04C == 60) { + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); + this->fwork[42] = 0.0f; } - frameData = Animation_GetFrameData(&D_SX_6013798, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_6013798, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_6013798)) { - boss->unk_04C = 0; - boss->fwork[0] = 0.0f; - if (boss->swork[3] <= 250) { - boss->state = 4; - boss->timer_050 = 100; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_6013798)) { + this->unk_04C = 0; + this->fwork[0] = 0.0f; + if (this->swork[3] <= 250) { + this->state = 4; + this->timer_050 = 100; Radio_PlayMessage(gMsg_ID_5495, RCID_BOSS_SECTORX); - boss->fwork[44] = 0.0f; - boss->fwork[43] = 0.0f; - boss->fwork[42] = 0.0f; + this->fwork[44] = 0.0f; + this->fwork[43] = 0.0f; + this->fwork[42] = 0.0f; } else { - boss->state = 1; - boss->swork[1] = 1; - boss->swork[7] = 1; + this->state = 1; + this->swork[1] = 1; + this->swork[7] = 1; } } break; case 4: // Arms launch setup - boss->swork[7] = 0; - boss->fwork[1] = -3000.0f; - boss->fwork[3] = gPlayer[0].pos.x; - boss->fwork[2] = gPlayer[0].pos.y; + this->swork[7] = 0; + this->fwork[1] = -3000.0f; + this->fwork[3] = gPlayer[0].pos.x; + this->fwork[2] = gPlayer[0].pos.y; - Math_SmoothStepToF(&boss->fwork[44], 10.0f, 1.0f, 1.0f, 0); - Math_SmoothStepToF(&boss->fwork[43], 10.0f, 1.0f, 1.0f, 0); - Math_SmoothStepToF(&boss->fwork[42], 50.0f, 1.0f, 3.0f, 0); + Math_SmoothStepToF(&this->fwork[44], 10.0f, 1.0f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[43], 10.0f, 1.0f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[42], 50.0f, 1.0f, 3.0f, 0); - frameData = Animation_GetFrameData(&D_SX_6016E28, 0, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_6016E28, 0, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); - Math_SmoothStepToF(&boss->fwork[27], 30.0f, 0.05f, 1.0f, 0); - Math_SmoothStepToF(&boss->fwork[28], -30.0f, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[27], 30.0f, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[28], -30.0f, 0.05f, 1.0f, 0); - if (boss->timer_050 == 0) { - boss->state = 5; - boss->timer_050 = 100; + if (this->timer_050 == 0) { + this->state = 5; + this->timer_050 = 100; Radio_PlayMessage(gMsg_ID_5496, RCID_FOX); } break; case 5: // arms lauching attack - sp74.x = boss->fwork[8] + boss->obj.pos.x; - sp74.y = boss->fwork[9] + boss->obj.pos.y; - sp74.z = boss->fwork[10] + boss->obj.pos.z; + sfxPos.x = this->fwork[8] + this->obj.pos.x; + sfxPos.y = this->fwork[9] + this->obj.pos.y; + sfxPos.z = this->fwork[10] + this->obj.pos.z; - Object_SetSfxSourceToPos(D_i2_80195D88, &sp74); + Object_SetSfxSourceToPos(D_i2_80195D88, &sfxPos); AUDIO_PLAY_SFX(NA_SE_EN_SZMIS_ENGINE, D_i2_80195D88, 4); - sp74.x = boss->fwork[11] + boss->obj.pos.x; - sp74.y = boss->fwork[12] + boss->obj.pos.y; - sp74.z = boss->fwork[13] + boss->obj.pos.z; + sfxPos.x = this->fwork[11] + this->obj.pos.x; + sfxPos.y = this->fwork[12] + this->obj.pos.y; + sfxPos.z = this->fwork[13] + this->obj.pos.z; - Object_SetSfxSourceToPos(D_i2_80195D98, &sp74); + Object_SetSfxSourceToPos(D_i2_80195D98, &sfxPos); AUDIO_PLAY_SFX(NA_SE_EN_SZMIS_ENGINE, D_i2_80195D98, 4); - Math_SmoothStepToF(&boss->fwork[27], 30.0f, 0.05f, 1.0f, 0); - Math_SmoothStepToF(&boss->fwork[28], -30.0f, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[27], 30.0f, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[28], -30.0f, 0.05f, 1.0f, 0); - sp60 = fabsf(boss->obj.pos.x + boss->fwork[8] - gPlayer[0].pos.x) * 0.1f; + sp60 = fabsf(this->obj.pos.x + this->fwork[8] - gPlayer[0].pos.x) * 0.1f; if (sp60 > 5.0f) { sp60 = 5.0f; } - if ((boss->obj.pos.x + boss->fwork[8]) < gPlayer[0].pos.x) { - boss->fwork[29] += sp60; + if ((this->obj.pos.x + this->fwork[8]) < gPlayer[0].pos.x) { + this->fwork[29] += sp60; } - if (gPlayer[0].pos.x < (boss->obj.pos.x + boss->fwork[8])) { - boss->fwork[29] -= sp60; + if (gPlayer[0].pos.x < (this->obj.pos.x + this->fwork[8])) { + this->fwork[29] -= sp60; } - sp60 = fabsf((boss->obj.pos.y + boss->fwork[9]) - gPlayer[0].pos.y) * 0.1f; + sp60 = fabsf((this->obj.pos.y + this->fwork[9]) - gPlayer[0].pos.y) * 0.1f; if (sp60 > 5.0f) { sp60 = 5.0f; } - if ((boss->obj.pos.y + boss->fwork[9]) < gPlayer[0].pos.y) { - boss->fwork[30] += sp60; + if ((this->obj.pos.y + this->fwork[9]) < gPlayer[0].pos.y) { + this->fwork[30] += sp60; } - if (gPlayer[0].pos.y < (boss->obj.pos.y + boss->fwork[9])) { - boss->fwork[30] -= sp60; + if (gPlayer[0].pos.y < (this->obj.pos.y + this->fwork[9])) { + this->fwork[30] -= sp60; } - sp60 = fabsf((boss->obj.pos.x + boss->fwork[11]) - gPlayer[0].pos.x) * 0.1f; + sp60 = fabsf((this->obj.pos.x + this->fwork[11]) - gPlayer[0].pos.x) * 0.1f; if (sp60 > 5.0f) { sp60 = 5.0f; } - if ((boss->obj.pos.x + boss->fwork[11]) < gPlayer[0].pos.x) { - boss->fwork[32] += sp60; + if ((this->obj.pos.x + this->fwork[11]) < gPlayer[0].pos.x) { + this->fwork[32] += sp60; } - if (gPlayer[0].pos.x < (boss->obj.pos.x + boss->fwork[11])) { - boss->fwork[32] -= sp60; + if (gPlayer[0].pos.x < (this->obj.pos.x + this->fwork[11])) { + this->fwork[32] -= sp60; } - sp60 = fabsf((boss->obj.pos.y + boss->fwork[12]) - gPlayer[0].pos.y) * 0.1f; + sp60 = fabsf((this->obj.pos.y + this->fwork[12]) - gPlayer[0].pos.y) * 0.1f; if (sp60 > 5.0f) { sp60 = 5.0f; } - if ((boss->obj.pos.y + boss->fwork[12]) < gPlayer[0].pos.y) { - boss->fwork[33] += sp60; + if ((this->obj.pos.y + this->fwork[12]) < gPlayer[0].pos.y) { + this->fwork[33] += sp60; } - if (gPlayer[0].pos.y < (boss->obj.pos.y + boss->fwork[12])) { - boss->fwork[33] -= sp60; + if (gPlayer[0].pos.y < (this->obj.pos.y + this->fwork[12])) { + this->fwork[33] -= sp60; } - Math_SmoothStepToF(&boss->fwork[31], 4000.0f, 1.0f, 80.0f, 0); + Math_SmoothStepToF(&this->fwork[31], 4000.0f, 1.0f, 80.0f, 0); - if (boss->timer_050 < 70) { - Math_SmoothStepToF(&boss->fwork[34], 4000.0f, 1.0f, 80.0f, 0); + if (this->timer_050 < 70) { + Math_SmoothStepToF(&this->fwork[34], 4000.0f, 1.0f, 80.0f, 0); } - if (boss->timer_050 == 0) { - boss->state = 6; - boss->timer_050 = 122; + if (this->timer_050 == 0) { + this->state = 6; + this->timer_050 = 122; } break; case 6: // Arms come back to robot - if ((boss->timer_050 == 20) || (boss->timer_050 == 30)) { - AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, boss->sfxSource, 4); + if ((this->timer_050 == 20) || (this->timer_050 == 30)) { + AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, this->sfxSource, 4); } - if (boss->timer_050 == 0) { - boss->unk_04C = 0; - boss->state = 1; - boss->swork[1] = 1; + if (this->timer_050 == 0) { + this->unk_04C = 0; + this->state = 1; + this->swork[1] = 1; Audio_KillSfxBySourceAndId(D_i2_80195D88, NA_SE_EN_SZMIS_ENGINE); Audio_KillSfxBySourceAndId(D_i2_80195D98, NA_SE_EN_SZMIS_ENGINE); - boss->fwork[0] = 0.0f; - boss->fwork[44] = 0.0f; - boss->fwork[43] = 0.0f; - boss->fwork[42] = 0.0f; - boss->swork[7] = 1; + this->fwork[0] = 0.0f; + this->fwork[44] = 0.0f; + this->fwork[43] = 0.0f; + this->fwork[42] = 0.0f; + this->swork[7] = 1; } break; case 7: - if (boss->timer_052 == 1) { + if (this->timer_052 == 1) { Radio_PlayMessage(gMsg_ID_15252, RCID_SLIPPY); } - boss->fwork[41] = 20.0; - boss->fwork[2] = -400.0f; - boss->fwork[42] = 30.0f; + this->fwork[41] = 20.0; + this->fwork[2] = -400.0f; + this->fwork[42] = 30.0f; - frameData = Animation_GetFrameData(&D_SX_601C690, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_601C690, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_601C690)) { - boss->state = 75; - boss->fwork[0] = 0.0f; - boss->unk_04C = 0; - boss->timer_050 = 120; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_601C690)) { + this->state = 75; + this->fwork[0] = 0.0f; + this->unk_04C = 0; + this->timer_050 = 120; } break; case 75: - boss->fwork[41] = 20.0f; - boss->fwork[2] = -400.0f; + this->fwork[41] = 20.0f; + this->fwork[2] = -400.0f; - frameData = Animation_GetFrameData(&D_SX_600A2D4, 0, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 2.5f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_600A2D4, 0, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 2.5f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 0.1f, 1.0f, 0.005f, 0); + Math_SmoothStepToF(&this->fwork[0], 0.1f, 1.0f, 0.005f, 0); - if (boss->timer_050 == 0) { - boss->state = 8; - boss->fwork[0] = 0.0f; - boss->unk_04C = 0; - boss->health = 300; + if (this->timer_050 == 0) { + this->state = 8; + this->fwork[0] = 0.0f; + this->unk_04C = 0; + this->health = 300; Audio_PlaySequenceDistorted(0, gBossBgms[gCurrentLevel], 1121, 25, -1); Radio_PlayMessage(gMsg_ID_19205, RCID_FOX); - boss->timer_052 = 100; + this->timer_052 = 100; } break; case 8: - if (boss->timer_052 == 1) { + if (this->timer_052 == 1) { Radio_PlayMessage(gMsg_ID_5497, RCID_BOSS_SECTORX); } - boss->fwork[41] = 0.0f; - boss->fwork[2] = gPlayer[0].pos.y; - boss->fwork[3] = gPlayer[0].pos.x; - boss->fwork[44] = 5.0f; - boss->fwork[1] = -1800.0f; - boss->fwork[43] = 5.0f; - boss->fwork[42] = 30.0f; + this->fwork[41] = 0.0f; + this->fwork[2] = gPlayer[0].pos.y; + this->fwork[3] = gPlayer[0].pos.x; + this->fwork[44] = 5.0f; + this->fwork[1] = -1800.0f; + this->fwork[43] = 5.0f; + this->fwork[42] = 30.0f; - frameData = Animation_GetFrameData(&D_SX_600F890, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_600F890, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.02f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.02f, 0); - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_600F890)) { - boss->unk_04C = 0; - boss->fwork[0] = 0.0f; - boss->state = 9; - boss->swork[0] = 2; - boss->timer_050 = 30; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_600F890)) { + this->unk_04C = 0; + this->fwork[0] = 0.0f; + this->state = 9; + this->swork[0] = 2; + this->timer_050 = 30; } break; case 85: - boss->fwork[1] = -3000.0f; - boss->fwork[2] = gPlayer[0].pos.y; - boss->fwork[3] = gPlayer[0].pos.x; + this->fwork[1] = -3000.0f; + this->fwork[2] = gPlayer[0].pos.y; + this->fwork[3] = gPlayer[0].pos.x; - frameData = Animation_GetFrameData(&D_SX_60123BC, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 50.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_60123BC, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 50.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.01f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.01f, 0); - if (boss->timer_050 == 0) { - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_60123BC)) { - boss->unk_04C = Animation_GetFrameCount(&D_SX_60123BC) - 1; + if (this->timer_050 == 0) { + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_60123BC)) { + this->unk_04C = Animation_GetFrameCount(&D_SX_60123BC) - 1; if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY) { - boss->unk_04C = 0; - boss->state = 10; - boss->fwork[0] = 0.0f; - boss->fwork[42] = 0.0f; + this->unk_04C = 0; + this->state = 10; + this->fwork[0] = 0.0f; + this->fwork[42] = 0.0f; } } - if (boss->unk_04C == 60) { - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); + if (this->unk_04C == 60) { + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); } - } else if (boss->timer_050 == 1) { + } else if (this->timer_050 == 1) { Radio_PlayMessage(gMsg_ID_20267, RCID_PEPPY); } break; case 9: - if (boss->timer_050 == 1) { + if (this->timer_050 == 1) { Radio_PlayMessage(gMsg_ID_5492, RCID_BOSS_SECTORX); } - boss->fwork[1] = -2000.0f; - boss->fwork[2] = gPlayer[0].pos.y; - boss->fwork[3] = gPlayer[0].pos.x; + this->fwork[1] = -2000.0f; + this->fwork[2] = gPlayer[0].pos.y; + this->fwork[3] = gPlayer[0].pos.x; - frameData = Animation_GetFrameData(&D_SX_601AA28, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 50.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_601AA28, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 50.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.01f, 0); - boss->unk_04C++; + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.01f, 0); + this->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_601AA28)) { - boss->unk_04C = 0; - boss->state = 10; - boss->fwork[0] = 0.0f; - boss->fwork[42] = 0.0f; - if (boss->swork[10] == 0) { + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_601AA28)) { + this->unk_04C = 0; + this->state = 10; + this->fwork[0] = 0.0f; + this->fwork[42] = 0.0f; + if (this->swork[10] == 0) { Radio_PlayMessage(gMsg_ID_5474, RCID_FALCO); } - boss->swork[10] = 1; + this->swork[10] = 1; } - if (boss->unk_04C == 70) { - SectorX_8018FA04(boss->fwork[11] + boss->obj.pos.x, boss->fwork[12] + boss->obj.pos.y, - boss->fwork[13] + boss->obj.pos.z); - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); + if (this->unk_04C == 70) { + SectorX_8018FA04(this->fwork[11] + this->obj.pos.x, this->fwork[12] + this->obj.pos.y, + this->fwork[13] + this->obj.pos.z); + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); } break; case 10: attack = true; - boss->fwork[1] = -1000.0f; - Math_SmoothStepToF(&boss->fwork[42], 50.0f, 1.0f, 3.0f, 0); + this->fwork[1] = -1000.0f; + Math_SmoothStepToF(&this->fwork[42], 50.0f, 1.0f, 3.0f, 0); - frameData = Animation_GetFrameData(&D_SX_60158C4, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_60158C4, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; - if ((boss->unk_04C % 16) == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); + this->unk_04C++; + if ((this->unk_04C % 16) == 0) { + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); } - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_60158C4)) { - boss->unk_04C = 0; - boss->fwork[0] = 0.0f; + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_60158C4)) { + this->unk_04C = 0; + this->fwork[0] = 0.0f; if ((gBossFrameCount < 2200) || (gTeamShields[TEAM_ID_SLIPPY] <= 0)) { - if (boss->health > 150) { - boss->state = 8; + if (this->health > 150) { + this->state = 8; } else { - boss->state = 35; - boss->timer_050 = 400; - boss->fwork[42] = boss->fwork[43] = boss->fwork[44] = boss->rot_078.y = 0.0f; - boss->swork[9] = RAND_INT(1.9f); + this->state = 35; + this->timer_050 = 400; + this->fwork[42] = this->fwork[43] = this->fwork[44] = this->rot_078.y = 0.0f; + this->swork[9] = RAND_INT(1.9f); Radio_PlayMessage(gMsg_ID_5498, RCID_BOSS_SECTORX); } } else { - boss->state = 85; + this->state = 85; SectorX_8018F030(); - boss->timer_050 = 100; + this->timer_050 = 100; } } break; case 35: - if (boss->swork[9] != 0) { - boss->fwork[2] = 500.0f; + if (this->swork[9] != 0) { + this->fwork[2] = 500.0f; } else { - boss->fwork[2] = -500.0f; + this->fwork[2] = -500.0f; } - if (boss->timer_050 > 300) { - boss->fwork[3] = 1000.0f; - boss->fwork[1] = -2000.0f; - } else if (boss->timer_050 > 200) { - boss->fwork[3] = -1000.0f; - boss->fwork[1] = -2500.0f; + if (this->timer_050 > 300) { + this->fwork[3] = 1000.0f; + this->fwork[1] = -2000.0f; + } else if (this->timer_050 > 200) { + this->fwork[3] = -1000.0f; + this->fwork[1] = -2500.0f; if ((gGameFrameCount % 16) == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); } - } else if (boss->timer_050 > 100) { - boss->fwork[3] = 0; - boss->fwork[1] = -500.0f; + } else if (this->timer_050 > 100) { + this->fwork[3] = 0; + this->fwork[1] = -500.0f; if (((gGameFrameCount % 16) == 0)) { - AUDIO_PLAY_SFX(NA_SE_EN_THROW, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_THROW, this->sfxSource, 4); } } else { - boss->fwork[3] = 0; - boss->fwork[1] = -2000.0f; + this->fwork[3] = 0; + this->fwork[1] = -2000.0f; } - Math_SmoothStepToF(&boss->fwork[42], 60.0f, 1.0f, 1.0f, 0); - Math_SmoothStepToF(&boss->fwork[44], 20.0f, 1.0f, 0.5f, 0); - Math_SmoothStepToF(&boss->fwork[43], 20.0f, 1.0f, 0.5f, 0); + Math_SmoothStepToF(&this->fwork[42], 60.0f, 1.0f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[44], 20.0f, 1.0f, 0.5f, 0); + Math_SmoothStepToF(&this->fwork[43], 20.0f, 1.0f, 0.5f, 0); - frameData = Animation_GetFrameData(&D_SX_6009FF8, 0, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 5.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_6009FF8, 0, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 5.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 0.1f, 1.0f, 0.001f, 0); - Math_SmoothStepToF(&boss->rot_078.y, 10.0f, 1.0f, 0.1f, 0); - Math_SmoothStepToF(&boss->obj.rot.y, 2880.0f, 0.1f, boss->rot_078.y, 0.1f); + Math_SmoothStepToF(&this->fwork[0], 0.1f, 1.0f, 0.001f, 0); + Math_SmoothStepToF(&this->rot_078.y, 10.0f, 1.0f, 0.1f, 0); + Math_SmoothStepToF(&this->obj.rot.y, 2880.0f, 0.1f, this->rot_078.y, 0.1f); - if ((boss->timer_050 == 0) && (boss->obj.rot.y == 2880.0f)) { - boss->obj.rot.y = 0.0f; - boss->unk_04C = 0; - boss->fwork[0] = 0.0f; + if ((this->timer_050 == 0) && (this->obj.rot.y == 2880.0f)) { + this->obj.rot.y = 0.0f; + this->unk_04C = 0; + this->fwork[0] = 0.0f; if ((gBossFrameCount < 2200) || (gTeamShields[TEAM_ID_SLIPPY] <= 0)) { - boss->state = 9; + this->state = 9; } else { - boss->state = 85; + this->state = 85; SectorX_8018F030(); - boss->timer_050 = 100; + this->timer_050 = 100; } } break; case 20: - Math_SmoothStepToF(&boss->obj.rot.y, 0.0f, 0.1f, 3.0f, 0.1f); - boss->swork[0] = 0; - boss->fwork[1] = -1800.0f; - boss->fwork[41] = 340.0f; - boss->fwork[2] = -400.0f; + Math_SmoothStepToF(&this->obj.rot.y, 0.0f, 0.1f, 3.0f, 0.1f); + this->swork[0] = 0; + this->fwork[1] = -1800.0f; + this->fwork[41] = 340.0f; + this->fwork[2] = -400.0f; - frameData = Animation_GetFrameData(&D_SX_601C690, boss->unk_04C, sp80); - Math_SmoothStepToVec3fArray(sp80, boss->vwork, 1, frameData, boss->fwork[0], 100.0f, 0.0f); + frameData = Animation_GetFrameData(&D_SX_601C690, this->unk_04C, frameTable); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, frameData, this->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[0], 1.0f, 1.0f, 0.05f, 0); - boss->unk_04C++; + Math_SmoothStepToF(&this->fwork[0], 1.0f, 1.0f, 0.05f, 0); + this->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_601C690)) { - boss->unk_04C = Animation_GetFrameCount(&D_SX_601C690); + if (this->unk_04C >= Animation_GetFrameCount(&D_SX_601C690)) { + this->unk_04C = Animation_GetFrameCount(&D_SX_601C690); } - if ((boss->timer_050 & 3) == 0) { - func_effect_8007D2C8(RAND_FLOAT_CENTERED(500.0f) + boss->obj.pos.x, - RAND_FLOAT_CENTERED(500.0f) + boss->obj.pos.y, boss->obj.pos.z + 100.0f, + if ((this->timer_050 & 3) == 0) { + func_effect_8007D2C8(RAND_FLOAT_CENTERED(500.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(500.0f) + this->obj.pos.y, this->obj.pos.z + 100.0f, RAND_FLOAT(5.0f) + 5.0f); } - if ((((gGameFrameCount % 8) == 0)) && (Rand_ZeroOne() < 0.5f)) { - boss->timer_05C = 4; + if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { + this->timer_05C = 4; } - if ((boss->timer_050 & 3) == 0) { - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, - boss->vel.z, 0.3f, 10); + if ((this->timer_050 & 3) == 0) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.3f, 10); } - if (boss->timer_050 < 230) { - Math_SmoothStepToF(&boss->fwork[14], 10000.0f, 1.0f, 60.0f, 0); - Math_SmoothStepToF(&boss->fwork[17], -10000.0f, 1.0f, 60.0f, 0); + if (this->timer_050 < 230) { + Math_SmoothStepToF(&this->fwork[14], 10000.0f, 1.0f, 60.0f, 0); + Math_SmoothStepToF(&this->fwork[17], -10000.0f, 1.0f, 60.0f, 0); } - if (boss->timer_050 == 230) { + if (this->timer_050 == 230) { gShowBossHealth = 0; - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 0.0f, 0.0f, 0.0f, 30.0f, 40); - func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 30.0f, 40); + func_effect_8007A568(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); } - if (boss->timer_050 == 210) { - boss->swork[5] = 1; - boss->timer_05A = 1000; + if (this->timer_050 == 210) { + this->swork[5] = 1; + this->timer_05A = 1000; } - if (boss->timer_050 == 120) { + if (this->timer_050 == 120) { if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_DOWN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 0; gPlayer[0].draw = true; } - Object_Kill(&boss->obj, boss->sfxSource); - gMissionStatus = boss->swork[6]; + Object_Kill(&this->obj, this->sfxSource); + gMissionStatus = this->swork[6]; } break; @@ -1086,68 +1104,69 @@ void SectorX_80190078(Boss* boss) { D_i2_80195640 = 1; - Animation_DrawSkeleton(1, D_SX_6020C68, boss->vwork, SectorX_80192AF0, SectorX_80193208, boss, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_SX_6020C68, this->vwork, SectorX_Boss_OverrideLimbDraw, SectorX_Boss_PostLimbDraw, this, + &gIdentityMatrix); - if (((boss->swork[1] != 0) && (boss->swork[3] > 0)) && ((boss->fwork[4] < 45.0f) || (boss->fwork[4] > 315.0f))) { - boss->swork[1]++; - if (boss->swork[1] > 40) { - if (boss->swork[1] > 50) { - boss->swork[1] = 0; + if (((this->swork[1] != 0) && (this->swork[3] > 0)) && ((this->fwork[4] < 45.0f) || (this->fwork[4] > 315.0f))) { + this->swork[1]++; + if (this->swork[1] > 40) { + if (this->swork[1] > 50) { + this->swork[1] = 0; } - func_effect_8007F11C(OBJ_EFFECT_377, boss->fwork[20] + boss->obj.pos.x, boss->fwork[21] + boss->obj.pos.y, - boss->fwork[22] + boss->obj.pos.z, 100.0f); - func_effect_8007F11C(OBJ_EFFECT_377, boss->fwork[23] + boss->obj.pos.x, boss->fwork[24] + boss->obj.pos.y, - boss->fwork[25] + boss->obj.pos.z, 100.0f); + Effect_EnemyLaser(OBJ_EFFECT_377, this->fwork[20] + this->obj.pos.x, this->fwork[21] + this->obj.pos.y, + this->fwork[22] + this->obj.pos.z, 100.0f); + Effect_EnemyLaser(OBJ_EFFECT_377, this->fwork[23] + this->obj.pos.x, this->fwork[24] + this->obj.pos.y, + this->fwork[25] + this->obj.pos.z, 100.0f); } } else { - boss->swork[1] = 0; + this->swork[1] = 0; } - if (boss->state != 35) { - boss->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032550); - boss->info.hitbox[43] = -211.0f + boss->fwork[16]; - boss->info.hitbox[45] = -35.0f + boss->fwork[15]; - boss->info.hitbox[47] = 442.0f + boss->fwork[14]; - boss->info.hitbox[49] = -211.0f + boss->fwork[19]; - boss->info.hitbox[51] = -35.0f + boss->fwork[18]; - boss->info.hitbox[53] = -442.0f + boss->fwork[17]; - boss->info.hitbox[55] = boss->fwork[10]; - boss->info.hitbox[57] = boss->fwork[9]; - boss->info.hitbox[59] = boss->fwork[8]; - boss->info.hitbox[61] = boss->fwork[13]; - boss->info.hitbox[63] = boss->fwork[12]; - boss->info.hitbox[65] = boss->fwork[11]; + if (this->state != 35) { + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032550); + this->info.hitbox[43] = -211.0f + this->fwork[16]; + this->info.hitbox[45] = -35.0f + this->fwork[15]; + this->info.hitbox[47] = 442.0f + this->fwork[14]; + this->info.hitbox[49] = -211.0f + this->fwork[19]; + this->info.hitbox[51] = -35.0f + this->fwork[18]; + this->info.hitbox[53] = -442.0f + this->fwork[17]; + this->info.hitbox[55] = this->fwork[10]; + this->info.hitbox[57] = this->fwork[9]; + this->info.hitbox[59] = this->fwork[8]; + this->info.hitbox[61] = this->fwork[13]; + this->info.hitbox[63] = this->fwork[12]; + this->info.hitbox[65] = this->fwork[11]; if (attack) { - boss->info.hitbox[56] = 200.0f; - boss->info.hitbox[58] = 200.0f; - boss->info.hitbox[60] = 100.0f; - boss->info.hitbox[62] = 200.0f; - boss->info.hitbox[64] = 200.0f; - boss->info.hitbox[66] = 100.0f; + this->info.hitbox[56] = 200.0f; + this->info.hitbox[58] = 200.0f; + this->info.hitbox[60] = 100.0f; + this->info.hitbox[62] = 200.0f; + this->info.hitbox[64] = 200.0f; + this->info.hitbox[66] = 100.0f; } else { - boss->info.hitbox[56] = 200.0f; - boss->info.hitbox[58] = 100.0f; - boss->info.hitbox[60] = 70.0f; - boss->info.hitbox[62] = 200.0f; - boss->info.hitbox[64] = 100.0f; - boss->info.hitbox[66] = 70.0f; + this->info.hitbox[56] = 200.0f; + this->info.hitbox[58] = 100.0f; + this->info.hitbox[60] = 70.0f; + this->info.hitbox[62] = 200.0f; + this->info.hitbox[64] = 100.0f; + this->info.hitbox[66] = 70.0f; } } else { - boss->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032768); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SX_6032768); } - if (boss->swork[0] == 1) { - Math_SmoothStepToF(&boss->fwork[45], 1.0f, 1.0f, 0.05f, 0); + if (this->swork[0] == 1) { + Math_SmoothStepToF(&this->fwork[45], 1.0f, 1.0f, 0.05f, 0); } else { - Math_SmoothStepToF(&boss->fwork[45], 0.0f, 1.0f, 0.05f, 0); + Math_SmoothStepToF(&this->fwork[45], 0.0f, 1.0f, 0.05f, 0); } } -bool SectorX_80192AF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Vec3f sp64 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp58; - Boss* boss = (Boss*) data; +bool SectorX_Boss_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + Vec3f src = { 0.0f, 0.0f, 0.0f }; + Vec3f dest; + Spyborg* boss = (Spyborg*) data; if (D_i2_80195640 != 0) { *dList = NULL; @@ -1164,10 +1183,12 @@ bool SectorX_80192AF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* case 1: rot->x += boss->fwork[4] + boss->fwork[5]; rot->z += boss->fwork[6] + boss->fwork[7]; + if ((boss->timer_054 % 2) != 0) { RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0, 0, 64, 64, 255, 255); } + if (boss->swork[4] == 1) { *dList = D_SX_6006810; } else if (boss->swork[4] == 2) { @@ -1182,14 +1203,16 @@ bool SectorX_80192AF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* if (*dList != NULL) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); - Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); - Display_SetSecondLight(&sp58); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + Display_SetSecondLight(&dest); Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); + if (boss->swork[4] == 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_41); - if (((gGameFrameCount % 2) == 0)) { + + if ((gGameFrameCount % 2) == 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); @@ -1262,74 +1285,77 @@ bool SectorX_80192AF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void SectorX_80193208(s32 limbIndex, Vec3f* rot, void* data) { +void SectorX_Boss_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp64 = { 87.0f, -323.0f, 200.0f }; Vec3f sp58 = { 87.0f, -323.0f, -200.0f }; Vec3f sp4C = { 87.0f, -323.0f, 200.0f }; Vec3f sp40 = { 87.0f, -323.0f, -200.0f }; - Vec3f sp34; - Vec3f sp28; + Vec3f src; + Vec3f dest; Boss* boss = (Boss*) data; - sp34.x = 0.0f; - sp34.y = 0.0f; - sp34.z = 0.0f; + src.x = 0.0f; + src.y = 0.0f; + src.z = 0.0f; switch (limbIndex) { case 1: - Matrix_MultVec3f(gCalcMatrix, &sp58, &sp28); - boss->fwork[20] = sp28.x; - boss->fwork[21] = sp28.y; - boss->fwork[22] = sp28.z; - Matrix_MultVec3f(gCalcMatrix, &sp64, &sp28); - boss->fwork[23] = sp28.x; - boss->fwork[24] = sp28.y; - boss->fwork[25] = sp28.z; + Matrix_MultVec3f(gCalcMatrix, &sp58, &dest); + boss->fwork[20] = dest.x; + boss->fwork[21] = dest.y; + boss->fwork[22] = dest.z; + Matrix_MultVec3f(gCalcMatrix, &sp64, &dest); + boss->fwork[23] = dest.x; + boss->fwork[24] = dest.y; + boss->fwork[25] = dest.z; Matrix_MultVec3f(gCalcMatrix, &sp40, &boss->vwork[45]); Matrix_MultVec3f(gCalcMatrix, &sp4C, &boss->vwork[46]); break; case 6: - Matrix_MultVec3f(gCalcMatrix, &sp34, &sp28); - boss->fwork[8] = sp28.x; - boss->fwork[9] = sp28.y; - boss->fwork[10] = sp28.z; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + boss->fwork[8] = dest.x; + boss->fwork[9] = dest.y; + boss->fwork[10] = dest.z; break; case 16: - Matrix_MultVec3f(gCalcMatrix, &sp34, &sp28); - boss->fwork[11] = sp28.x; - boss->fwork[12] = sp28.y; - boss->fwork[13] = sp28.z; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + boss->fwork[11] = dest.x; + boss->fwork[12] = dest.y; + boss->fwork[13] = dest.z; break; case 33: - Matrix_MultVec3f(gCalcMatrix, &sp34, &sp28); - boss->fwork[35] = sp28.x; - boss->fwork[36] = sp28.y; - boss->fwork[37] = sp28.z; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + boss->fwork[35] = dest.x; + boss->fwork[36] = dest.y; + boss->fwork[37] = dest.z; break; case 37: - Matrix_MultVec3f(gCalcMatrix, &sp34, &sp28); - boss->fwork[38] = sp28.x; - boss->fwork[39] = sp28.y; - boss->fwork[40] = sp28.z; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + boss->fwork[38] = dest.x; + boss->fwork[39] = dest.y; + boss->fwork[40] = dest.z; default: break; } } -Vec3f D_i2_801956B0[5] = { - { 0.0f, 2300.0f, -5000.0f }, { -600.0f, 2200.0f, -5000.0f }, { -300.0f, 2270.0f, -5000.0f }, - { 300.0f, 2270.0f, -5000.0f }, { 600.0f, 2200.0f, -5000.0f }, -}; +Vec3f D_i2_801956B0[5] = { { 0.0f, 2300.0f, -5000.0f }, + { -600.0f, 2200.0f, -5000.0f }, + { -300.0f, 2270.0f, -5000.0f }, + { 300.0f, 2270.0f, -5000.0f }, + { 600.0f, 2200.0f, -5000.0f } }; + Vec3f D_i2_801956EC[3] = { { 150.0f, 250.0f, 50.0f }, { -150.0f, -50.0f, 50.0f }, { 150.0f, -50.0f, 50.0f }, }; + f32 D_i2_80195710[4] = { -1200.0f, 1000.0f, 0.0f, 0.0f }; f32 D_i2_80195720[4] = { -300.0f, 400.0f, -400.0f, 0.0f }; f32 D_i2_80195730[4] = { -800.0f, -800.0f, -1000.0f, -8000.0f }; @@ -1339,17 +1365,17 @@ f32 D_i2_80195760[4] = { -250.0f, -200.0f, -400.0f, -8000.0f }; f32 D_i2_80195770[3] = { 120.0f, 180.0f, -150.0f }; s16 D_i2_8019577C[3] = { 2, 3, 4 }; -void SectorX_80193434(Boss* boss) { +void SectorX_Boss_Draw(Spyborg* this) { f32 fwork; - if (boss->swork[5] == 0) { + if (this->swork[5] == 0) { D_i2_80195640 = 0; - Animation_DrawSkeleton(3, D_SX_6020C68, boss->vwork, SectorX_80192AF0, 0, boss, gCalcMatrix); + Animation_DrawSkeleton(3, D_SX_6020C68, this->vwork, SectorX_Boss_OverrideLimbDraw, 0, this, gCalcMatrix); RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 96); - if (boss->fwork[31] > 10.0f) { - fwork = boss->fwork[31] * 0.1f; + if (this->fwork[31] > 10.0f) { + fwork = this->fwork[31] * 0.1f; if (fwork > 50.0f) { fwork = 50.0f; } @@ -1357,15 +1383,15 @@ void SectorX_80193434(Boss* boss) { fwork *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[35], boss->fwork[36], boss->fwork[37], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[35], this->fwork[36], this->fwork[37], MTXF_APPLY); Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); Matrix_Pop(&gGfxMatrix); } - if (boss->fwork[34] > 10.0f) { - fwork = boss->fwork[34] * 0.1f; + if (this->fwork[34] > 10.0f) { + fwork = this->fwork[34] * 0.1f; if (fwork > 50.0f) { fwork = 50.0f; } @@ -1373,7 +1399,7 @@ void SectorX_80193434(Boss* boss) { fwork *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[38], boss->fwork[39], boss->fwork[40], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[38], this->fwork[39], this->fwork[40], MTXF_APPLY); Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); @@ -1383,8 +1409,8 @@ void SectorX_80193434(Boss* boss) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 96); - if (boss->swork[1] != 0) { - fwork = boss->swork[1] * 0.1f; + if (this->swork[1] != 0) { + fwork = this->swork[1] * 0.1f; if (fwork > 4.0f) { fwork = 4.0f; @@ -1393,13 +1419,14 @@ void SectorX_80193434(Boss* boss) { fwork *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[20], boss->fwork[21], boss->fwork[22], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[20], this->fwork[21], this->fwork[22], MTXF_APPLY); Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_600F8A0); Matrix_Pop(&gGfxMatrix); + Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[23], boss->fwork[24], boss->fwork[25], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[23], this->fwork[24], this->fwork[25], MTXF_APPLY); Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_600F8A0); @@ -1408,42 +1435,47 @@ void SectorX_80193434(Boss* boss) { } } -void SectorX_80193800(Actor* actor, s32 arg1) { - Actor_Initialize(actor); +void SectorX_80193800(ActorCutscene* this, s32 index) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i2_801956B0[arg1].x; - actor->obj.pos.y = D_i2_801956B0[arg1].y; - actor->obj.pos.z = D_i2_801956B0[arg1].z; - actor->vel.z = 30.0f; - actor->vel.y = -16.0f; - actor->animFrame = 20; - actor->obj.rot.x = 15.0f; + this->obj.pos.x = D_i2_801956B0[index].x; + this->obj.pos.y = D_i2_801956B0[index].y; + this->obj.pos.z = D_i2_801956B0[index].z; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actor->sfxSource, 4); + this->vel.z = 30.0f; + this->vel.y = -16.0f; + this->animFrame = 20; + this->obj.rot.x = 15.0f; + + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, this->sfxSource, 4); } -void SectorX_801938D8(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = gPlayer[0].cam.eye.x + D_i2_801956EC[arg1].x; - actor->obj.pos.y = gPlayer[0].cam.eye.y + D_i2_801956EC[arg1].y; - actor->obj.pos.z = gPlayer[0].cam.eye.z + D_i2_801956EC[arg1].z; - actor->state = 1; - actor->iwork[11] = 1; - actor->vel.z = -30.0f; - actor->vel.y = 0.0f; - actor->obj.rot.y = 180.0f; - actor->obj.rot.x = 10.0f; - if (arg1 == 2) { - actor->obj.rot.z = -20.0f; +void SectorX_801938D8(ActorCutscene* this, s32 index) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = gPlayer[0].cam.eye.x + D_i2_801956EC[index].x; + this->obj.pos.y = gPlayer[0].cam.eye.y + D_i2_801956EC[index].y; + this->obj.pos.z = gPlayer[0].cam.eye.z + D_i2_801956EC[index].z; + + this->state = 1; + this->iwork[11] = 1; + this->vel.z = -30.0f; + this->vel.y = 0.0f; + this->obj.rot.y = 180.0f; + this->obj.rot.x = 10.0f; + + if (index == 2) { + this->obj.rot.z = -20.0f; } - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); + + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); } void SectorX_LevelStart(Player* player) { @@ -1471,6 +1503,7 @@ void SectorX_LevelStart(Player* player) { player->cam.at.z = gCsCamAtZ = -1000.0f; player->camRoll = -5.0f; player->baseSpeed = 0.0f; + gFillScreenAlpha = 255; /* fallthrough */ case 1: @@ -1478,9 +1511,12 @@ void SectorX_LevelStart(Player* player) { gFillScreenAlpha = 255; } D_ctx_80177A48[0] = 0.5f; + gCsCamAtX = gActors[5].obj.pos.x; gCsCamAtZ = gActors[5].obj.pos.z; + player->camRoll -= 0.1f; + if (gCsFrameCount == 140) { x = gActors[5].obj.pos.x; y = gActors[5].obj.pos.y - (player->cam.eye.y + 50.0f); @@ -1495,6 +1531,7 @@ void SectorX_LevelStart(Player* player) { Actor_SpawnPlayerLaser(CS_SHOT_ID, 0.0f, player->cam.eye.y + 50.0f, player->cam.eye.z + 20.0f, dest.x, dest.y, dest.z, xyzDeg, xzDeg, 0.0f); } + if (gCsFrameCount == 143) { Object_Kill(&gPlayerShots[0].obj, gPlayerShots[0].sfxSource); func_effect_8007BFFC(gActors[5].obj.pos.x, gActors[5].obj.pos.y, gActors[5].obj.pos.z, 0.0f, 0.0f, 0.0f, @@ -1505,7 +1542,7 @@ void SectorX_LevelStart(Player* player) { for (i = 0; i < 20; i++) { func_effect_80079618(gActors[5].obj.pos.x, gActors[5].obj.pos.y, gActors[5].obj.pos.z, 0.5f); } - func_effect_8007A6F0(&gActors[5].obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&gActors[5].obj.pos, NA_SE_EN_EXPLOSION_M); player->csState++; D_ctx_80177A48[0] = 0.1f; } @@ -1627,7 +1664,7 @@ void SectorX_LevelStart(Player* player) { player->trueZpos = player->pos.z + player->camDist; } -void SectorX_801944D4(Actor* actor, s32 arg1) { +void SectorX_801944D4(ActorCutscene* this, s32 index) { Vec3f srcA; Vec3f destA; Vec3f srcB; @@ -1635,41 +1672,43 @@ void SectorX_801944D4(Actor* actor, s32 arg1) { Player* player = &gPlayer[0]; Matrix_RotateY(gCalcMatrix, player->rot.y * M_DTOR, MTXF_NEW); - srcA.x = D_i2_80195710[arg1]; - srcA.y = D_i2_80195720[arg1]; - srcA.z = D_i2_80195730[arg1]; - srcB.x = D_i2_80195740[arg1]; - srcB.y = D_i2_80195750[arg1]; - srcB.z = D_i2_80195760[arg1]; + srcA.x = D_i2_80195710[index]; + srcA.y = D_i2_80195720[index]; + srcA.z = D_i2_80195730[index]; + srcB.x = D_i2_80195740[index]; + srcB.y = D_i2_80195750[index]; + srcB.z = D_i2_80195760[index]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &srcA, &destA); Matrix_MultVec3fNoTranslate(gCalcMatrix, &srcB, &destB); - Actor_Initialize(actor); - actor->obj.pos.x = player->pos.x + destA.x; - actor->obj.pos.y = player->pos.y + destA.y; - actor->obj.pos.z = player->trueZpos + destA.z; - actor->fwork[0] = destB.x; - actor->fwork[1] = destB.y; - actor->fwork[2] = destB.z; - actor->fwork[7] = RAND_FLOAT(360.0f); - actor->fwork[8] = RAND_FLOAT(360.0f); - actor->vel.x = player->vel.x; - actor->vel.y = player->vel.y; - actor->vel.z = player->vel.z; - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - Object_SetInfo(&actor->info, actor->obj.id); - if (arg1 == 3) { - actor->animFrame = 1; - actor->state = 20; - actor->obj.rot.x = -player->rot.x - 10.0f; - actor->obj.rot.y = (player->rot.y + 180.0f) - 10.0f; - actor->fwork[9] = 10.0f; + Actor_Initialize(this); + this->obj.pos.x = player->pos.x + destA.x; + this->obj.pos.y = player->pos.y + destA.y; + this->obj.pos.z = player->trueZpos + destA.z; + this->fwork[0] = destB.x; + this->fwork[1] = destB.y; + this->fwork[2] = destB.z; + this->fwork[7] = RAND_FLOAT(360.0f); + this->fwork[8] = RAND_FLOAT(360.0f); + this->vel.x = player->vel.x; + this->vel.y = player->vel.y; + this->vel.z = player->vel.z; + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + Object_SetInfo(&this->info, this->obj.id); + + if (index == 3) { + this->animFrame = 1; + this->state = 20; + this->obj.rot.x = -player->rot.x - 10.0f; + this->obj.rot.y = (player->rot.y + 180.0f) - 10.0f; + this->fwork[9] = 10.0f; } else { - actor->obj.rot.z = D_i2_80195770[arg1]; - actor->iwork[11] = 1; - actor->iwork[14] = D_i2_8019577C[arg1]; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->obj.rot.z = D_i2_80195770[index]; + this->iwork[11] = 1; + this->iwork[14] = D_i2_8019577C[index]; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } } @@ -1826,6 +1865,7 @@ void SectorX_LevelComplete(Player* player) { player->unk_190 = 5.0f; break; } + if (gTeamShields[TEAM_ID_SLIPPY] != -2) { switch (gCsFrameCount) { case 140: diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index 596b6ab6..a2f1fbbd 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -7,10 +7,10 @@ #include "global.h" #include "assets/ast_area_6.h" -void Area6_8018A1B0(Boss* bossA6, s32 arg1); -void Area6_8018A2C4(Boss* bossA6); -void Area6_8018A464(Boss* bossA6, s32 arg1); -void Area6_8018B9BC(Boss* bossA6); +void Area6_8018A1B0(Boss* this, s32 arg1); +void Area6_8018A2C4(Boss* this); +void Area6_8018A464(Boss* this, s32 arg1); +void Area6_8018B9BC(Boss* this); #define A6_HITBOX_COUNT ((s32) (bossA6)->info.hitbox[0]) #define A6_HIT_0(bossA6) ((Hitbox*) ((bossA6)->info.hitbox + 1)) @@ -222,12 +222,12 @@ typedef enum { } BossA6bsswork; typedef struct { - f32 r[3]; - f32 g[3]; - f32 b[3]; - f32 unk_24; - f32 unk_28[3]; - f32 unk_34; + /* 0x00 */ f32 r[3]; + /* 0x0C */ f32 g[3]; + /* 0x18 */ f32 b[3]; + /* 0x24 */ f32 unk_24; + /* 0x30 */ f32 unk_28[3]; + /* 0x3C */ f32 unk_34; } UnkStruct_1C22F0; typedef struct { @@ -355,49 +355,54 @@ f32 D_i3_801BF494[12] = { -90.0f, 30.0f, 26.0f, 22.0f, 18.0f, 11.0f, 8.0f, 5.0f, 3.0f, 2.0f, 1.0f, 0.0f, }; -void Area6_80187530(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 fwork6, f32 xRot, f32 yRot, s32 timer0BC, +void Area6_80187530(Actor191* this, f32 xPos, f32 yPos, f32 zPos, f32 fwork6, f32 xRot, f32 yRot, s32 timer0BC, s32 unk0B4) { PRINTF("おん\n"); // On PRINTF("おふ\n"); // Off - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_191; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->obj.rot.x = xRot; - actor->obj.rot.y = yRot; - actor->timer_0BC = timer0BC; - actor->timer_0BE = 20; - actor->eventType = unk0B4; - actor->fwork[5] = fwork6; - Object_SetInfo(&actor->info, actor->obj.id); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_BARREL_SHOT); + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_MISSILE_SEEK_PLAYER; + + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + + this->timer_0BC = timer0BC; + this->timer_0BE = 20; + this->eventType = unk0B4; + this->fwork[5] = fwork6; + Object_SetInfo(&this->info, this->obj.id); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_BARREL_SHOT); } void Area6_801875E4(f32 xPos, f32 yPos, f32 zPos, f32 fwork6, f32 xRot, f32 yRot, s32 timer0BC, s32 unk0B4) { s32 i; - Actor* actor; + Actor191* actor191; - for (i = 0, actor = gActors; i < ARRAY_COUNT(gActors); i++, actor++) { - if (actor->obj.status == OBJ_FREE) { - Area6_80187530(actor, xPos, yPos, zPos, fwork6, xRot, yRot, timer0BC, unk0B4); + for (i = 0, actor191 = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor191++) { + if (actor191->obj.status == OBJ_FREE) { + Area6_80187530(actor191, xPos, yPos, zPos, fwork6, xRot, yRot, timer0BC, unk0B4); D_i3_801C2250[A6_BSS_11] = i + 1; break; } } } -void Area6_8018767C(Effect* effect) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_395; - effect->obj.pos.x = gBosses[0].obj.pos.x; - effect->obj.pos.y = gBosses[0].obj.pos.y; - effect->obj.pos.z = gBosses[0].obj.pos.z + 250.0f; - effect->state = 8; - effect->scale2 = 1.0f; - Object_SetInfo(&effect->info, effect->obj.id); +void Area6_8018767C(Effect395* this) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_395; + + this->obj.pos.x = gBosses[0].obj.pos.x; + this->obj.pos.y = gBosses[0].obj.pos.y; + this->obj.pos.z = gBosses[0].obj.pos.z + 250.0f; + + this->state = 8; + this->scale2 = 1.0f; + Object_SetInfo(&this->info, this->obj.id); } void Area6_80187704(void) { @@ -457,7 +462,7 @@ void Area6_BossA6_Init(BossA6* this) { AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_LEVEL, this->sfxSource, 4); } -void Area6_Boss_Update(Boss* bossA6) { +void Area6_Boss_Update(BossA6* this) { s32 i; s32 pad; s32 var_s0; @@ -478,93 +483,92 @@ void Area6_Boss_Update(Boss* bossA6) { gBossFrameCount++; - if ((bossA6->state < 6) || ((bossA6->state >= 8) && (bossA6->state < 12))) { - bossA6->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - bossA6->obj.pos.x, - gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + gPathProgress))); - bossA6->obj.rot.x = - RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - bossA6->obj.pos.y, - sqrtf(SQ(gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + gPathProgress)) + - SQ(gPlayer[0].cam.eye.x - bossA6->obj.pos.x)))); + if ((this->state < 6) || ((this->state >= 8) && (this->state < 12))) { + this->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, + gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress))); + this->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y, + sqrtf(SQ(gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress)) + + SQ(gPlayer[0].cam.eye.x - this->obj.pos.x)))); } - Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); - if ((bossA6->dmgType != DMG_NONE) && (bossA6->health > 0)) { - bossA6->dmgType = DMG_NONE; + if ((this->dmgType != DMG_NONE) && (this->health > 0)) { + this->dmgType = DMG_NONE; - if (bossA6->fwork[A6_FWK_0] > 5.0f) { - if ((bossA6->dmgPart == 0) && (bossA6->swork[A6_SWK_25] == 0) && (bossA6->fwork[A6_FWK_29] < 30.0f)) { - bossA6->timer_05C = 15; - bossA6->health -= bossA6->damage; + if (this->fwork[A6_FWK_0] > 5.0f) { + if ((this->dmgPart == 0) && (this->swork[A6_SWK_25] == 0) && (this->fwork[A6_FWK_29] < 30.0f)) { + this->timer_05C = 15; + this->health -= this->damage; - if (bossA6->health < 390) { - AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, bossA6->sfxSource, 4); + if (this->health < 390) { + AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); } - if (bossA6->health <= 0) { - bossA6->health = 0; - Boss_AwardBonus(bossA6); + if (this->health <= 0) { + this->health = 0; + Boss_AwardBonus(this); Radio_PlayMessage(gMsg_ID_15252, RCID_SLIPPY); gTeamLowHealthMsgTimer = -1; D_bg_8015F984 = (gPathProgress * 0.00004f) + 0.5f; - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); gShowBossHealth = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); - bossA6->fwork[A6_FWK_5] = 5.0f; - bossA6->fwork[A6_FWK_3] = -20000.0f; - bossA6->fwork[A6_FWK_1] = 170.0f; - bossA6->vel.z = -20.0f; + this->fwork[A6_FWK_5] = 5.0f; + this->fwork[A6_FWK_3] = -20000.0f; + this->fwork[A6_FWK_1] = 170.0f; + this->vel.z = -20.0f; Matrix_MultVec3f(gCalcMatrix, &D_i3_801BECE0, &spC8[0]); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BECEC, &spC8[1]); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BECF8, &spC8[2]); for (i = 0; i < 3; i++) { - func_effect_8007D0E0(spC8[i].x + bossA6->obj.pos.x, spC8[i].y + bossA6->obj.pos.y, - spC8[i].z + bossA6->obj.pos.z, 10.0f); + func_effect_8007D0E0(spC8[i].x + this->obj.pos.x, spC8[i].y + this->obj.pos.y, + spC8[i].z + this->obj.pos.z, 10.0f); } - bossA6->timer_052 = 170; + this->timer_052 = 170; D_i3_801C2250[A6_BSS_2_0] = D_i3_801C2250[A6_BSS_2_1] = D_i3_801C2250[A6_BSS_2_2] = - bossA6->swork[A6_SWK_33 + 0] = bossA6->swork[A6_SWK_33 + 1] = bossA6->swork[A6_SWK_33 + 2] = 0; + this->swork[A6_SWK_33 + 0] = this->swork[A6_SWK_33 + 1] = this->swork[A6_SWK_33 + 2] = 0; gScreenFlashTimer = 4; - bossA6->state = 11; + this->state = 11; - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_L, bossA6->sfxSource, 4); - AUDIO_PLAY_SFX(NA_SE_EXPLOSION_DEMO5, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_L, this->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EXPLOSION_DEMO5, this->sfxSource, 4); } } - if (((bossA6->dmgPart == 4) || (bossA6->dmgPart == 5) || (bossA6->dmgPart == 6)) && - (bossA6->swork[A6_SWK_25] != 0)) { - Area6_8018B9BC(bossA6); + if (((this->dmgPart == 4) || (this->dmgPart == 5) || (this->dmgPart == 6)) && + (this->swork[A6_SWK_25] != 0)) { + Area6_8018B9BC(this); } } - if ((bossA6->dmgPart == 1) || (bossA6->dmgPart == 2) || (bossA6->dmgPart == 3)) { - Area6_8018A2C4(bossA6); + if ((this->dmgPart == 1) || (this->dmgPart == 2) || (this->dmgPart == 3)) { + Area6_8018A2C4(this); } - if (bossA6->dmgPart >= 7) { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, bossA6->sfxSource, 4); + if (this->dmgPart >= 7) { + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } for (i = 0; i < 3; i++) { - var_s0 = (bossA6->swork[A6_SWK_15 + i] / 10) - 1; + var_s0 = (this->swork[A6_SWK_15 + i] / 10) - 1; if (var_s0 < 0) { var_s0 = 0; } @@ -573,10 +577,10 @@ void Area6_Boss_Update(Boss* bossA6) { Math_SmoothStepToF(&D_i3_801C22F0.b[i], D_i3_801BECB0[var_s0][2], 1.0f, 10.0f, 0); } - if ((bossA6->swork[A6_SWK_15 + 0] == 0) && (bossA6->swork[A6_SWK_15 + 1] == 0) && - (bossA6->swork[A6_SWK_15 + 2] == 0) && (bossA6->fwork[A6_FWK_0] != 0) && !(gGameFrameCount % 2U)) { - func_effect_8007C120(bossA6->obj.pos.x, bossA6->obj.pos.y, bossA6->obj.pos.z + 200.0f, bossA6->vel.x, - bossA6->vel.y, bossA6->vel.z, 0.3f, 1); + if ((this->swork[A6_SWK_15 + 0] == 0) && (this->swork[A6_SWK_15 + 1] == 0) && (this->swork[A6_SWK_15 + 2] == 0) && + (this->fwork[A6_FWK_0] != 0) && !(gGameFrameCount % 2U)) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 200.0f, this->vel.x, this->vel.y, + this->vel.z, 0.3f, 1); } sp120 = 0.5f; @@ -596,70 +600,69 @@ void Area6_Boss_Update(Boss* bossA6) { } } - if ((bossA6->state >= 3) && (bossA6->state < 5) && (bossA6->fwork[A6_FWK_28] == 0.0f)) { - Math_SmoothStepToAngle(&bossA6->fwork[A6_FWK_9], bossA6->fwork[A6_FWK_32], 0.05f, 0.02f, 0.00001f); - Math_SmoothStepToAngle(&bossA6->obj.rot.z, bossA6->fwork[A6_FWK_8], 0.05f, bossA6->fwork[A6_FWK_9], 0.00001f); - if (bossA6->swork[A6_SWK_25] >= 2) { + if ((this->state >= 3) && (this->state < 5) && (this->fwork[A6_FWK_28] == 0.0f)) { + Math_SmoothStepToAngle(&this->fwork[A6_FWK_9], this->fwork[A6_FWK_32], 0.05f, 0.02f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[A6_FWK_8], 0.05f, this->fwork[A6_FWK_9], 0.00001f); + if (this->swork[A6_SWK_25] >= 2) { if (!(gGameFrameCount % 64U) && (Rand_ZeroOne() < 0.5f)) { - bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].cam.eye.x; + this->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].cam.eye.x; } if (!(gGameFrameCount % 64U) && (Rand_ZeroOne() < 0.5f)) { - bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].cam.eye.y; + this->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].cam.eye.y; } } else { if (!(gGameFrameCount % 32U) && (Rand_ZeroOne() < 0.7f)) { - bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.x; - bossA6->fwork[A6_FWK_30] = 0.0f; + this->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.x; + this->fwork[A6_FWK_30] = 0.0f; } if (!(gGameFrameCount % 32U) && (Rand_ZeroOne() < 0.7f)) { - bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.y; - bossA6->fwork[A6_FWK_31] = 0.0f; + this->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.y; + this->fwork[A6_FWK_31] = 0.0f; } } } - if (bossA6->state != 0) { - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_4], bossA6->fwork[A6_FWK_5], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3], 0.1f, - bossA6->fwork[A6_FWK_4], 0.00001f); - if (bossA6->state < 5) { + if (this->state != 0) { + Math_SmoothStepToF(&this->fwork[A6_FWK_4], this->fwork[A6_FWK_5], 0.1f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + this->fwork[A6_FWK_3], 0.1f, + this->fwork[A6_FWK_4], 0.00001f); + if (this->state < 5) { sp120 = 2.0f; - if (bossA6->swork[A6_SWK_25] == 1) { + if (this->swork[A6_SWK_25] == 1) { sp120 = 50.0f; } - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_30], sp120, 0.1f, 1.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_31], sp120, 0.1f, 1.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->obj.pos.x, bossA6->fwork[A6_FWK_6], 0.2f, bossA6->fwork[A6_FWK_30], 0.00001f); - Math_SmoothStepToF(&bossA6->obj.pos.y, bossA6->fwork[A6_FWK_7], 0.2f, bossA6->fwork[A6_FWK_31], 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_30], sp120, 0.1f, 1.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_31], sp120, 0.1f, 1.0f, 0.00001f); + Math_SmoothStepToF(&this->obj.pos.x, this->fwork[A6_FWK_6], 0.2f, this->fwork[A6_FWK_30], 0.00001f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[A6_FWK_7], 0.2f, this->fwork[A6_FWK_31], 0.00001f); } - Math_SmoothStepToAngle(&bossA6->fwork[A6_FWK_0], bossA6->fwork[A6_FWK_1], 0.2f, bossA6->fwork[A6_FWK_2], - 0.00001f); + Math_SmoothStepToAngle(&this->fwork[A6_FWK_0], this->fwork[A6_FWK_1], 0.2f, this->fwork[A6_FWK_2], 0.00001f); } - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_10 + 0], bossA6->fwork[A6_FWK_13 + 0], 0.1f, bossA6->fwork[A6_FWK_16 + 0], + Math_SmoothStepToF(&this->fwork[A6_FWK_10 + 0], this->fwork[A6_FWK_13 + 0], 0.1f, this->fwork[A6_FWK_16 + 0], 0.0001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_10 + 1], bossA6->fwork[A6_FWK_13 + 1], 0.1f, bossA6->fwork[A6_FWK_16 + 1], + Math_SmoothStepToF(&this->fwork[A6_FWK_10 + 1], this->fwork[A6_FWK_13 + 1], 0.1f, this->fwork[A6_FWK_16 + 1], 0.0001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_10 + 2], bossA6->fwork[A6_FWK_13 + 2], 0.1f, bossA6->fwork[A6_FWK_16 + 2], + Math_SmoothStepToF(&this->fwork[A6_FWK_10 + 2], this->fwork[A6_FWK_13 + 2], 0.1f, this->fwork[A6_FWK_16 + 2], 0.0001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_19 + 0], bossA6->fwork[A6_FWK_22 + 0], 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_19 + 1], bossA6->fwork[A6_FWK_22 + 1], 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_19 + 2], bossA6->fwork[A6_FWK_22 + 2], 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_19 + 0], this->fwork[A6_FWK_22 + 0], 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_19 + 1], this->fwork[A6_FWK_22 + 1], 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_19 + 2], this->fwork[A6_FWK_22 + 2], 0.1f, 10.0f, 0.00001f); - if (bossA6->state > 10) { - bossA6->obj.rot.z += bossA6->fwork[A6_FWK_28]; - bossA6->obj.rot.z = Math_ModF(bossA6->obj.rot.z, 360.0f); + if (this->state > 10) { + this->obj.rot.z += this->fwork[A6_FWK_28]; + this->obj.rot.z = Math_ModF(this->obj.rot.z, 360.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_28], 5.0f, 0.1f, 0.2f, 0.0001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_28], 5.0f, 0.1f, 0.2f, 0.0001f); for (i = 0; i < 10; i++) { - func_effect_80079618(bossA6->obj.pos.x + RAND_FLOAT_CENTERED(500.0f), - bossA6->obj.pos.y + RAND_FLOAT_CENTERED(500.0f), - bossA6->obj.pos.z + RAND_FLOAT_CENTERED(100.0f), RAND_FLOAT(4.0f) + 1.0f); + func_effect_80079618(this->obj.pos.x + RAND_FLOAT_CENTERED(500.0f), + this->obj.pos.y + RAND_FLOAT_CENTERED(500.0f), + this->obj.pos.z + RAND_FLOAT_CENTERED(100.0f), RAND_FLOAT(4.0f) + 1.0f); } - if (bossA6->timer_05C == 0) { - bossA6->timer_05C = 15; + if (this->timer_05C == 0) { + this->timer_05C = 15; } if (((gGameFrameCount % 2) == 0)) { Matrix_MultVec3f(gCalcMatrix, &D_i3_801BED04, &spC8[3]); @@ -673,19 +676,19 @@ void Area6_Boss_Update(Boss* bossA6) { if (i == 3) { var_s0 = RAND_FLOAT_CENTERED(100.0f); } - func_effect_8007D0E0(bossA6->obj.pos.x + var_s0 + spC8[i].x, bossA6->obj.pos.y + var_s0 + spC8[i].y, - bossA6->obj.pos.z + spC8[i].z, 10.0f); + func_effect_8007D0E0(this->obj.pos.x + var_s0 + spC8[i].x, this->obj.pos.y + var_s0 + spC8[i].y, + this->obj.pos.z + spC8[i].z, 10.0f); } } if (!(gGameFrameCount % 32U)) { - func_effect_8007C120(bossA6->obj.pos.x, bossA6->obj.pos.y, bossA6->obj.pos.z + 300.0f, bossA6->vel.x, - bossA6->vel.y, bossA6->vel.z, 0.5f, 70); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 300.0f, this->vel.x, this->vel.y, + this->vel.z, 0.5f, 70); } } if (!(gGameFrameCount % 16U)) { - dz_114 = fabsf(bossA6->fwork[A6_FWK_3] / -1700.0f); + dz_114 = fabsf(this->fwork[A6_FWK_3] / -1700.0f); if (dz_114 < 1.0f) { dz_114 = 1.0f; } @@ -695,29 +698,29 @@ void Area6_Boss_Update(Boss* bossA6) { for (i = 0; i < 3; i++) { sp120 = dz_114; - if (bossA6->swork[A6_SWK_18 + i] != 0) { + if (this->swork[A6_SWK_18 + i] != 0) { sp120 = 1.0f; } - A6_HIT_1_2(bossA6, i)->z.size = 195.0f * sp120; - A6_HIT_1_2(bossA6, i)->y.size = 147.0f * sp120; - A6_HIT_1_2(bossA6, i)->x.size = 153.0f * sp120; + A6_HIT_1_2(this, i)->z.size = 195.0f * sp120; + A6_HIT_1_2(this, i)->y.size = 147.0f * sp120; + A6_HIT_1_2(this, i)->x.size = 153.0f * sp120; } } - switch (bossA6->state) { + switch (this->state) { case 0: - bossA6->info.hitbox[0] = 0; + this->info.hitbox[0] = 0; - dx_11C = gPlayer[0].pos.x - bossA6->obj.pos.x; - dy_118 = gPlayer[0].pos.y - bossA6->obj.pos.y; - dz_114 = gPlayer[0].pos.z - 700.0f - bossA6->obj.pos.z; + dx_11C = gPlayer[0].pos.x - this->obj.pos.x; + dy_118 = gPlayer[0].pos.y - this->obj.pos.y; + dz_114 = gPlayer[0].pos.z - 700.0f - this->obj.pos.z; sp104 = 10.0f; - if ((bossA6->timer_050 != 0) && (bossA6->timer_050 < 200)) { - dx_11C = gPlayer[0].cam.eye.x - bossA6->obj.pos.x; - dy_118 = gPlayer[0].cam.eye.y - bossA6->obj.pos.y; - dz_114 = gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3] - bossA6->obj.pos.z; + if ((this->timer_050 != 0) && (this->timer_050 < 200)) { + dx_11C = gPlayer[0].cam.eye.x - this->obj.pos.x; + dy_118 = gPlayer[0].cam.eye.y - this->obj.pos.y; + dz_114 = gPlayer[0].cam.eye.z - gPathProgress + this->fwork[A6_FWK_3] - this->obj.pos.z; sp104 = 100.0f; } @@ -727,105 +730,105 @@ void Area6_Boss_Update(Boss* bossA6) { pitch_110 = Math_Atan2F(dy_118, sqrtf(SQ(dx_11C) + SQ(dz_114))); pitch_110 = Math_RadToDeg(-pitch_110); - Math_SmoothStepToAngle(&bossA6->rot_078.y, yaw_10C, 1.0f, sp104, 0.00001f); - Math_SmoothStepToAngle(&bossA6->rot_078.x, pitch_110, 1.0f, sp104, 0.00001f); - Matrix_RotateY(gCalcMatrix, bossA6->rot_078.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, bossA6->rot_078.x * M_DTOR, MTXF_APPLY); + Math_SmoothStepToAngle(&this->rot_078.y, yaw_10C, 1.0f, sp104, 0.00001f); + Math_SmoothStepToAngle(&this->rot_078.x, pitch_110, 1.0f, sp104, 0.00001f); + Matrix_RotateY(gCalcMatrix, this->rot_078.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->rot_078.x * M_DTOR, MTXF_APPLY); sp98.x = sp98.y = 0.0f; sp98.z = 30.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp98, &sp8C); - bossA6->vel.x = sp8C.x; - bossA6->vel.y = sp8C.y; + this->vel.x = sp8C.x; + this->vel.y = sp8C.y; sp98.x = sp98.y = 0.0f; sp98.z = 60.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp98, &sp8C); - bossA6->vel.z = sp8C.z; - bossA6->fwork[A6_FWK_33] += 30.0f; + this->vel.z = sp8C.z; + this->fwork[A6_FWK_33] += 30.0f; - if (bossA6->timer_050 == 0) { + if (this->timer_050 == 0) { Math_SmoothStepToF(&D_i3_801C22F0.unk_24, 0.0f, 0.1f, 1.0f, 0); if (D_i3_801C22F0.unk_24 < 1.0f) { D_i3_801C22F0.unk_24 = 0.0f; - Audio_KillSfxBySource(bossA6->sfxSource); + Audio_KillSfxBySource(this->sfxSource); - AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_STOP, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_STOP, this->sfxSource, 4); - bossA6->timer_050 = 20; - bossA6->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3]; - bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].cam.eye.x; - bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y; - bossA6->state = 2; - bossA6->vel.x = 0.0f; - bossA6->vel.y = 0.0f; - bossA6->vel.z = -40.0f; + this->timer_050 = 20; + this->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + this->fwork[A6_FWK_3]; + this->fwork[A6_FWK_6] = this->obj.pos.x = gPlayer[0].cam.eye.x; + this->fwork[A6_FWK_7] = this->obj.pos.y = gPlayer[0].cam.eye.y; + this->state = 2; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = -40.0f; - AUDIO_PLAY_SFX(NA_SE_EN_WARP_OUT, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_WARP_OUT, this->sfxSource, 4); } } break; case 1: Math_SmoothStepToF(D_ctx_801779A8, 10.0f, 1.0f, 5.0f, 0.0f); - bossA6->info.hitbox[0] = 0; - Math_SmoothStepToAngle(&bossA6->obj.rot.z, 0.0f, 1.0f, 10.0f, 0.0001f); + this->info.hitbox[0] = 0; + Math_SmoothStepToAngle(&this->obj.rot.z, 0.0f, 1.0f, 10.0f, 0.0001f); - if (bossA6->obj.rot.z < 1.0f) { + if (this->obj.rot.z < 1.0f) { if (D_i3_801C2250[A6_BSS_27] == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_WARP_IN, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_WARP_IN, this->sfxSource, 4); D_i3_801C2250[A6_BSS_27] = 1; } - bossA6->obj.rot.z = 0.0f; + this->obj.rot.z = 0.0f; Math_SmoothStepToF(&D_i3_801C22F0.unk_24, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_34], 2.0f, 0.1f, 0.1f, 0.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_35], 1.2f, 0.1f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[A6_FWK_34], 2.0f, 0.1f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[A6_FWK_35], 1.2f, 0.1f, 0.1f, 0.0f); if (D_i3_801C22F0.unk_24 < 1.0f) { - bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.x; - bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.y; - bossA6->fwork[A6_FWK_3] = -3700.0f + RAND_FLOAT_CENTERED(3000.0f); - bossA6->fwork[A6_FWK_34] = 2.0f; - bossA6->fwork[A6_FWK_35] = 1.2f; + this->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.x; + this->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.y; + this->fwork[A6_FWK_3] = -3700.0f + RAND_FLOAT_CENTERED(3000.0f); + this->fwork[A6_FWK_34] = 2.0f; + this->fwork[A6_FWK_35] = 1.2f; - if ((bossA6->swork[A6_SWK_37] == 0) && (bossA6->swork[A6_SWK_33 + 0] == 0) && - (bossA6->swork[A6_SWK_33 + 1] == 0) && (bossA6->swork[A6_SWK_33 + 2] == 0) && - (bossA6->swork[A6_SWK_27 + 0] == 0) && (bossA6->swork[A6_SWK_27 + 1] == 0) && - (bossA6->swork[A6_SWK_27 + 2] == 0)) { - bossA6->swork[A6_SWK_37] = 1; + if ((this->swork[A6_SWK_37] == 0) && (this->swork[A6_SWK_33 + 0] == 0) && + (this->swork[A6_SWK_33 + 1] == 0) && (this->swork[A6_SWK_33 + 2] == 0) && + (this->swork[A6_SWK_27 + 0] == 0) && (this->swork[A6_SWK_27 + 1] == 0) && + (this->swork[A6_SWK_27 + 2] == 0)) { + this->swork[A6_SWK_37] = 1; } - if (bossA6->swork[A6_SWK_37] != 0) { - bossA6->swork[A6_SWK_18 + 0] = bossA6->swork[A6_SWK_18 + 1] = bossA6->swork[A6_SWK_18 + 2] = 3; - bossA6->fwork[A6_FWK_3] = -1700.0f; - if ((bossA6->swork[A6_SWK_25] != 1) && (D_i3_801C2250[A6_BSS_0] != 2)) { - bossA6->fwork[A6_FWK_3] = RAND_FLOAT_CENTERED(1000.0f) + -3700.0f; + if (this->swork[A6_SWK_37] != 0) { + this->swork[A6_SWK_18 + 0] = this->swork[A6_SWK_18 + 1] = this->swork[A6_SWK_18 + 2] = 3; + this->fwork[A6_FWK_3] = -1700.0f; + if ((this->swork[A6_SWK_25] != 1) && (D_i3_801C2250[A6_BSS_0] != 2)) { + this->fwork[A6_FWK_3] = RAND_FLOAT_CENTERED(1000.0f) + -3700.0f; } - bossA6->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + bossA6->fwork[A6_FWK_3]; - bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].cam.eye.x; - bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y; + this->obj.pos.z = gPlayer[0].cam.eye.z - gPathProgress + this->fwork[A6_FWK_3]; + this->fwork[A6_FWK_6] = this->obj.pos.x = gPlayer[0].cam.eye.x; + this->fwork[A6_FWK_7] = this->obj.pos.y = gPlayer[0].cam.eye.y; } D_i3_801C22F0.unk_24 = 0.0f; - bossA6->timer_050 = 50; - bossA6->state = 2; + this->timer_050 = 50; + this->state = 2; D_i3_801C2250[A6_BSS_8] = 0; - AUDIO_PLAY_SFX(NA_SE_EN_WARP_OUT, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_WARP_OUT, this->sfxSource, 4); } } break; case 2: Math_SmoothStepToF(D_ctx_801779A8, 10.0f, 1.0f, 5.0f, 0.0f); - if (bossA6->timer_050 == 10) { + if (this->timer_050 == 10) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 0; @@ -833,43 +836,43 @@ void Area6_Boss_Update(Boss* bossA6) { gCameraShake = 50; } - if (bossA6->timer_050 == 0) { + if (this->timer_050 == 0) { if (D_i3_801C2250[A6_BSS_8] == 0) { D_i3_801C2250[A6_BSS_8] = 1; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 0; } Math_SmoothStepToF(&D_i3_801C22F0.unk_24, 255.0f, 0.1f, 10.0f, 0.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_34], 1.0f, 0.1f, 0.1f, 0.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_35], 1.0f, 0.1f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[A6_FWK_34], 1.0f, 0.1f, 0.1f, 0.0f); + Math_SmoothStepToF(&this->fwork[A6_FWK_35], 1.0f, 0.1f, 0.1f, 0.0f); if (D_i3_801C22F0.unk_24 > 254.0f) { D_i3_801C22F0.unk_24 = 255.0f; - bossA6->info.hitbox[0] = 10; - bossA6->fwork[A6_FWK_34] = bossA6->fwork[A6_FWK_35] = 1.0f; + this->info.hitbox[0] = 10; + this->fwork[A6_FWK_34] = this->fwork[A6_FWK_35] = 1.0f; - switch (bossA6->swork[A6_SWK_38]) { + switch (this->swork[A6_SWK_38]) { case 0: - bossA6->timer_050 = 100; + this->timer_050 = 100; break; case 1: - bossA6->timer_050 = 1399; + this->timer_050 = 1399; break; } - bossA6->swork[A6_SWK_38] = 0; + this->swork[A6_SWK_38] = 0; D_i3_801C2250[A6_BSS_28] = 1; - bossA6->state = 4; + this->state = 4; - if (bossA6->swork[A6_SWK_37] != 0) { - bossA6->timer_050 = 30; - bossA6->swork[A6_SWK_37] = 0; - bossA6->fwork[A6_FWK_8] = bossA6->fwork[A6_FWK_9] = 0.0f; - if (bossA6->swork[A6_SWK_36] < 2) { - bossA6->swork[A6_SWK_36]++; + if (this->swork[A6_SWK_37] != 0) { + this->timer_050 = 30; + this->swork[A6_SWK_37] = 0; + this->fwork[A6_FWK_8] = this->fwork[A6_FWK_9] = 0.0f; + if (this->swork[A6_SWK_36] < 2) { + this->swork[A6_SWK_36]++; } - bossA6->state = 3; + this->state = 3; } if (D_i3_801C2250[A6_BSS_6] != 0) { @@ -881,10 +884,10 @@ void Area6_Boss_Update(Boss* bossA6) { } if ((D_i3_801C2250[A6_BSS_6] == 0) || (D_i3_801C2250[A6_BSS_0] == 0)) { - bossA6->fwork[A6_FWK_1] = 90.0f; - bossA6->fwork[A6_FWK_2] = 2.0f; - AUDIO_PLAY_SFX(NA_SE_EN_COVER_OPEN, bossA6->sfxSource, 4); - bossA6->info.hitbox = SEGMENTED_TO_VIRTUAL(D_A6_6028578); + this->fwork[A6_FWK_1] = 90.0f; + this->fwork[A6_FWK_2] = 2.0f; + AUDIO_PLAY_SFX(NA_SE_EN_COVER_OPEN, this->sfxSource, 4); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_A6_6028578); D_i3_801C2250[A6_BSS_7] = 0; } } @@ -892,125 +895,123 @@ void Area6_Boss_Update(Boss* bossA6) { break; case 3: - if (bossA6->timer_050 == 1) { - Audio_KillSfxBySource(bossA6->sfxSource); + if (this->timer_050 == 1) { + Audio_KillSfxBySource(this->sfxSource); if (D_i3_801C2250[A6_BSS_7] == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BALL, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENERGY_BALL, this->sfxSource, 4); D_i3_801C2250[A6_BSS_7] = 1; } } if (D_i3_801C2250[A6_BSS_0] != 0) { - if (bossA6->swork[A6_SWK_25] == 1) { - bossA6->timer_052 = 30; - bossA6->state = 5; - bossA6->fwork[A6_FWK_1] = 90.0f; - bossA6->fwork[A6_FWK_2] = 2.0f; - bossA6->fwork[A6_FWK_37] = 300.0f; + if (this->swork[A6_SWK_25] == 1) { + this->timer_052 = 30; + this->state = 5; + this->fwork[A6_FWK_1] = 90.0f; + this->fwork[A6_FWK_2] = 2.0f; + this->fwork[A6_FWK_37] = 300.0f; } else { - bossA6->timer_052 = 30; - bossA6->state = 8; + this->timer_052 = 30; + this->state = 8; } } else { - if ((bossA6->swork[A6_SWK_36] == 3) && (D_i3_801C2250[A6_BSS_29] == 0)) { + if ((this->swork[A6_SWK_36] == 3) && (D_i3_801C2250[A6_BSS_29] == 0)) { Radio_PlayMessage(gMsg_ID_7084, RCID_PEPPY); - bossA6->swork[A6_SWK_36] = 4; + this->swork[A6_SWK_36] = 4; D_i3_801C2250[A6_BSS_29]++; D_i3_801C2250[A6_BSS_29] &= 1; } - if ((bossA6->swork[A6_SWK_30 + 0] != 0) && (bossA6->swork[A6_SWK_30 + 1] != 0) && - (bossA6->swork[A6_SWK_30 + 2] != 0)) { - bossA6->timer_050 = 1500; - bossA6->fwork[A6_FWK_1] = 0.0f; + if ((this->swork[A6_SWK_30 + 0] != 0) && (this->swork[A6_SWK_30 + 1] != 0) && + (this->swork[A6_SWK_30 + 2] != 0)) { + this->timer_050 = 1500; + this->fwork[A6_FWK_1] = 0.0f; D_i3_801C2250[A6_BSS_28] = 0; - bossA6->state = 4; - bossA6->fwork[A6_FWK_2] = 1.0f; - bossA6->info.hitbox = SEGMENTED_TO_VIRTUAL(D_A6_6028454); + this->state = 4; + this->fwork[A6_FWK_2] = 1.0f; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_A6_6028454); D_i3_801C2250[A6_BSS_6] = 1; - Audio_KillSfxBySource(bossA6->sfxSource); - AUDIO_PLAY_SFX(NA_SE_EN_COVER_CLOSE, bossA6->sfxSource, 4); - bossA6->swork[A6_SWK_30 + 0] = bossA6->swork[A6_SWK_30 + 1] = bossA6->swork[A6_SWK_30 + 2] = 0; - } else if (bossA6->swork[A6_SWK_30 + 0] == 0) { - Area6_8018A1B0(bossA6, 0); - } else if (bossA6->swork[A6_SWK_30 + 1] == 0) { - Area6_8018A1B0(bossA6, 1); - } else if (bossA6->swork[A6_SWK_30 + 2] == 0) { - Area6_8018A1B0(bossA6, 2); + Audio_KillSfxBySource(this->sfxSource); + AUDIO_PLAY_SFX(NA_SE_EN_COVER_CLOSE, this->sfxSource, 4); + this->swork[A6_SWK_30 + 0] = this->swork[A6_SWK_30 + 1] = this->swork[A6_SWK_30 + 2] = 0; + } else if (this->swork[A6_SWK_30 + 0] == 0) { + Area6_8018A1B0(this, 0); + } else if (this->swork[A6_SWK_30 + 1] == 0) { + Area6_8018A1B0(this, 1); + } else if (this->swork[A6_SWK_30 + 2] == 0) { + Area6_8018A1B0(this, 2); } } break; case 4: - if (bossA6->timer_050 == 1400) { - bossA6->swork[A6_SWK_15 + 0] = bossA6->swork[A6_SWK_15 + 1] = bossA6->swork[A6_SWK_15 + 2] = 40; - if (bossA6->swork[A6_SWK_25] == 0) { - bossA6->swork[A6_SWK_25] = 1; + if (this->timer_050 == 1400) { + this->swork[A6_SWK_15 + 0] = this->swork[A6_SWK_15 + 1] = this->swork[A6_SWK_15 + 2] = 40; + if (this->swork[A6_SWK_25] == 0) { + this->swork[A6_SWK_25] = 1; } - bossA6->fwork[A6_FWK_3] = RAND_FLOAT_CENTERED(1000.0f) + -3700.0f; + this->fwork[A6_FWK_3] = RAND_FLOAT_CENTERED(1000.0f) + -3700.0f; if (D_i3_801C2250[A6_BSS_28] == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_COVER_MOVE_STOP, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_COVER_MOVE_STOP, this->sfxSource, 4); } } - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_29], 255.0f, 1.0f, 10.0f, 0.0001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_29], 255.0f, 1.0f, 10.0f, 0.0001f); - if ((bossA6->swork[A6_SWK_36] == 2) && (bossA6->fwork[A6_FWK_0] == 0.0f) && - (D_i3_801C2250[A6_BSS_30] == 0)) { + if ((this->swork[A6_SWK_36] == 2) && (this->fwork[A6_FWK_0] == 0.0f) && (D_i3_801C2250[A6_BSS_30] == 0)) { Radio_PlayMessage(gMsg_ID_7083, RCID_PEPPY); - bossA6->swork[A6_SWK_36] = 3; + this->swork[A6_SWK_36] = 3; D_i3_801C2250[A6_BSS_30]++; D_i3_801C2250[A6_BSS_30] &= 1; } if (!(gGameFrameCount % 64U)) { - bossA6->fwork[A6_FWK_8] = RAND_FLOAT(360.0f); - bossA6->fwork[A6_FWK_9] = 0.0f; + this->fwork[A6_FWK_8] = RAND_FLOAT(360.0f); + this->fwork[A6_FWK_9] = 0.0f; } - if ((bossA6->timer_050 == 0) || - ((bossA6->swork[A6_SWK_33 + 0] == 0) && (bossA6->swork[A6_SWK_33 + 1] == 0) && - (bossA6->swork[A6_SWK_33 + 2] == 0) && (bossA6->swork[A6_SWK_27 + 0] == 0) && - (bossA6->swork[A6_SWK_27 + 1] == 0) && (bossA6->swork[A6_SWK_27 + 2] == 0))) { - bossA6->swork[A6_SWK_37] = 1; + if ((this->timer_050 == 0) || ((this->swork[A6_SWK_33 + 0] == 0) && (this->swork[A6_SWK_33 + 1] == 0) && + (this->swork[A6_SWK_33 + 2] == 0) && (this->swork[A6_SWK_27 + 0] == 0) && + (this->swork[A6_SWK_27 + 1] == 0) && (this->swork[A6_SWK_27 + 2] == 0))) { + this->swork[A6_SWK_37] = 1; if (D_i3_801C2250[A6_BSS_6] != 0) { - bossA6->state = 1; + this->state = 1; D_i3_801C2250[A6_BSS_27] = 0; } else { - bossA6->fwork[A6_FWK_1] = 90.0f; - bossA6->timer_050 = 30; - bossA6->fwork[A6_FWK_8] = bossA6->fwork[A6_FWK_9] = 0; - bossA6->fwork[A6_FWK_2] = 2.0f; + this->fwork[A6_FWK_1] = 90.0f; + this->timer_050 = 30; + this->fwork[A6_FWK_8] = this->fwork[A6_FWK_9] = 0; + this->fwork[A6_FWK_2] = 2.0f; - AUDIO_PLAY_SFX(NA_SE_EN_COVER_OPEN, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_COVER_OPEN, this->sfxSource, 4); - bossA6->info.hitbox = SEGMENTED_TO_VIRTUAL(D_A6_6028578); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_A6_6028578); - D_i3_801C2250[A6_BSS_7] = bossA6->swork[A6_SWK_37] = 0; + D_i3_801C2250[A6_BSS_7] = this->swork[A6_SWK_37] = 0; - bossA6->state = 3; + this->state = 3; if (D_i3_801C2250[A6_BSS_6] == 0) { AUDIO_PLAY_BGM(NA_BGM_BOSS_A6); } } - } else if (bossA6->swork[A6_SWK_38] != 0) { - bossA6->timer_052 = 30; - bossA6->state = 9; - bossA6->fwork[A6_FWK_28] = 0.0f; + } else if (this->swork[A6_SWK_38] != 0) { + this->timer_052 = 30; + this->state = 9; + this->fwork[A6_FWK_28] = 0.0f; D_i3_801C2250[A6_BSS_24] = 0; D_i3_801C2250[A6_BSS_27] = 0; - bossA6->timer_050 = 0; - bossA6->timer_054 = 0; + this->timer_050 = 0; + this->timer_054 = 0; D_i3_801C2250[A6_BSS_34] = 1; } break; case 5: - if (bossA6->timer_050 == 1) { + if (this->timer_050 == 1) { Area6_80187704(); - AUDIO_PLAY_SFX(NA_SE_EN_A6BOSS_CHARGE, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_A6BOSS_CHARGE, this->sfxSource, 4); D_i3_801C2250[A6_BSS_33] = 120; } @@ -1034,10 +1035,10 @@ void Area6_Boss_Update(Boss* bossA6) { break; case 6: - bossA6->obj.pos.z -= bossA6->fwork[A6_FWK_37]; + this->obj.pos.z -= this->fwork[A6_FWK_37]; - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_37], 0.0f, 1.0f, 10.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_3], -6000.0f, 10.0f, 100.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_37], 0.0f, 1.0f, 10.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_3], -6000.0f, 10.0f, 100.0f, 0.00001f); var_s0 = D_i3_801C2250[A6_BSS_9] * 4; @@ -1050,35 +1051,35 @@ void Area6_Boss_Update(Boss* bossA6) { D_i3_801C2250[A6_BSS_9] &= 3; } - if (bossA6->timer_050 == 0) { - bossA6->fwork[A6_FWK_1] = 0.0f; - bossA6->state = 7; + if (this->timer_050 == 0) { + this->fwork[A6_FWK_1] = 0.0f; + this->state = 7; } break; case 7: - effect = &gEffects[bossA6->swork[A6_SWK_39]]; + effect = &gEffects[this->swork[A6_SWK_39]]; Math_SmoothStepToF(&D_i3_801C22F0.unk_28[0], 255.0f, 1.0f, 100.0f, 0.00001f); Math_SmoothStepToF(&D_i3_801C22F0.unk_28[2], 255.0f, 1.0f, 100.0f, 0.00001f); Math_SmoothStepToF(&D_i3_801C22F0.unk_28[1], 255.0f, 1.0f, 100.0f, 0.00001f); - if (bossA6->fwork[A6_FWK_0] < 10.0f) { - effect->unk_60.y = 5.0f - ((10.0f - bossA6->fwork[A6_FWK_0]) * 0.3f); - effect->unk_60.x = 5.0f - ((10.0f - bossA6->fwork[A6_FWK_0]) * 0.3f); + if (this->fwork[A6_FWK_0] < 10.0f) { + effect->unk_60.y = 5.0f - ((10.0f - this->fwork[A6_FWK_0]) * 0.3f); + effect->unk_60.x = 5.0f - ((10.0f - this->fwork[A6_FWK_0]) * 0.3f); } - if (bossA6->fwork[A6_FWK_0] < 1.0f) { + if (this->fwork[A6_FWK_0] < 1.0f) { Math_SmoothStepToF(&effect->unk_60.x, 0.0f, 0.1f, 1.0f, 0.00001f); Math_SmoothStepToF(&effect->unk_60.y, 0.0f, 0.1f, 1.0f, 0.00001f); Math_SmoothStepToF(&effect->unk_60.z, 0.0f, 1.0f, 2.0f, 0.00001f); if (effect->unk_60.z < 0.2f) { D_i3_801C2250[A6_BSS_0] = 2; - bossA6->swork[A6_SWK_37] = 1; - bossA6->timer_050 = 20; + this->swork[A6_SWK_37] = 1; + this->timer_050 = 20; D_i3_801C22F0.unk_28[0] = D_i3_801C22F0.unk_28[2] = D_i3_801C22F0.unk_28[1] = 255.0f; - bossA6->state = 1; + this->state = 1; D_i3_801C2250[A6_BSS_27] = 0; Object_Kill(&effect->obj, effect->sfxSource); } @@ -1086,36 +1087,36 @@ void Area6_Boss_Update(Boss* bossA6) { break; case 8: - if (bossA6->timer_052 == 0) { + if (this->timer_052 == 0) { D_i3_801C2250[A6_BSS_24] = 0; - bossA6->timer_052 = 300; - bossA6->timer_054 = 0; - bossA6->state = 9; - AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_LEVEL, bossA6->sfxSource, 4); + this->timer_052 = 300; + this->timer_054 = 0; + this->state = 9; + AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_LEVEL, this->sfxSource, 4); } break; case 9: - if (bossA6->timer_052 == 0) { - Audio_KillSfxBySource(bossA6->sfxSource); - AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_STOP, bossA6->sfxSource, 4); - bossA6->timer_054 = 0; - bossA6->state = 10; + if (this->timer_052 == 0) { + Audio_KillSfxBySource(this->sfxSource); + AUDIO_PLAY_SFX(NA_SE_EN_SHIELD_ROLL_STOP, this->sfxSource, 4); + this->timer_054 = 0; + this->state = 10; } else { if (D_i3_801C2250[A6_BSS_34] == 0) { - bossA6->obj.rot.z += bossA6->fwork[A6_FWK_28]; - bossA6->obj.rot.z = Math_ModF(bossA6->obj.rot.z, 360.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_28], 20.0f, 0.1f, 0.5f, 0.0001f); + this->obj.rot.z += this->fwork[A6_FWK_28]; + this->obj.rot.z = Math_ModF(this->obj.rot.z, 360.0f); + Math_SmoothStepToF(&this->fwork[A6_FWK_28], 20.0f, 0.1f, 0.5f, 0.0001f); } - if (bossA6->timer_054 == 0) { - bossA6->timer_054 = 10; + if (this->timer_054 == 0) { + this->timer_054 = 10; if (D_i3_801C2250[A6_BSS_34] == 0) { - bossA6->timer_054 = 30; + this->timer_054 = 30; } sp128 = 6; - if (bossA6->swork[A6_SWK_25] == 2) { + if (this->swork[A6_SWK_25] == 2) { sp128 = 12; } @@ -1139,18 +1140,18 @@ void Area6_Boss_Update(Boss* bossA6) { spf124 = 0; } - if ((gActors[spf124].obj.status == OBJ_FREE) || (gActors[spf124].obj.id != OBJ_ACTOR_191) || - (D_i3_801C2250[A6_BSS_24] == 0)) { + if ((gActors[spf124].obj.status == OBJ_FREE) || + (gActors[spf124].obj.id != OBJ_MISSILE_SEEK_PLAYER) || (D_i3_801C2250[A6_BSS_24] == 0)) { D_i3_801C2250[A6_BSS_12_0 + var_s0] = 0; spf124 = 0; - if (bossA6->swork[A6_SWK_25] == 1) { + if (this->swork[A6_SWK_25] == 1) { spf124 = 1; } - Area6_801875E4(bossA6->obj.pos.x + sp8C.x, bossA6->obj.pos.y + sp8C.y, - bossA6->obj.pos.z + sp8C.z, 25.0f, pitch_110, yaw_10C, 10, spf124); + Area6_801875E4(this->obj.pos.x + sp8C.x, this->obj.pos.y + sp8C.y, this->obj.pos.z + sp8C.z, + 25.0f, pitch_110, yaw_10C, 10, spf124); D_i3_801C2250[A6_BSS_12_0 + var_s0] = D_i3_801C2250[A6_BSS_11]; } @@ -1162,47 +1163,47 @@ void Area6_Boss_Update(Boss* bossA6) { case 10: if (D_i3_801C2250[A6_BSS_34] == 0) { - bossA6->obj.rot.z += bossA6->fwork[A6_FWK_28]; - bossA6->obj.rot.z = Math_ModF(bossA6->obj.rot.z, 360.0f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_28], 0.0f, 0.1f, 0.5f, 0.0001f); + this->obj.rot.z += this->fwork[A6_FWK_28]; + this->obj.rot.z = Math_ModF(this->obj.rot.z, 360.0f); + Math_SmoothStepToF(&this->fwork[A6_FWK_28], 0.0f, 0.1f, 0.5f, 0.0001f); } - if (bossA6->fwork[A6_FWK_28] <= 0.1f) { + if (this->fwork[A6_FWK_28] <= 0.1f) { if (D_i3_801C2250[A6_BSS_34] == 0) { - bossA6->fwork[A6_FWK_28] = 0.0f; + this->fwork[A6_FWK_28] = 0.0f; D_i3_801C2250[A6_BSS_0] = 2; - bossA6->swork[A6_SWK_37] = 1; + this->swork[A6_SWK_37] = 1; } - bossA6->timer_050 = 20; + this->timer_050 = 20; D_i3_801C2250[A6_BSS_27] = 0; D_i3_801C2250[A6_BSS_34] = 0; - bossA6->state = 1; + this->state = 1; } break; case 11: - if ((bossA6->timer_052 == 160) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { + if ((this->timer_052 == 160) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 0; } - if (bossA6->timer_052 < 50) { + if (this->timer_052 < 50) { D_ctx_801779A8[0] = 50.0f; } else { D_ctx_801779A8[0] = 20.0f; } - if (bossA6->timer_052 == 0) { + if (this->timer_052 == 0) { gShowBossHealth = 0; - Object_Kill(&bossA6->obj, bossA6->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } break; } - Area6_8018A464(bossA6, 0); - Area6_8018A464(bossA6, 1); - Area6_8018A464(bossA6, 2); + Area6_8018A464(this, 0); + Area6_8018A464(this, 1); + Area6_8018A464(this, 2); for (i = 0; i < 5; i++) { if (!(gGameFrameCount % 4U)) { @@ -1215,15 +1216,15 @@ void Area6_Boss_Update(Boss* bossA6) { Math_SmoothStepToF(&D_i3_801BF250[i], D_i3_801BF2E0[i], 1.0f, 5.0f, 0.001f); } - A6_HIT_4(bossA6, 0)->z.offset = bossA6->vwork[A6_VWK_4].z; - A6_HIT_4(bossA6, 0)->y.offset = bossA6->vwork[A6_VWK_4].y; - A6_HIT_4(bossA6, 0)->x.offset = bossA6->vwork[A6_VWK_4].x; - A6_HIT_4(bossA6, 1)->z.offset = bossA6->vwork[A6_VWK_5].z; - A6_HIT_4(bossA6, 1)->y.offset = bossA6->vwork[A6_VWK_5].y; - A6_HIT_4(bossA6, 1)->x.offset = bossA6->vwork[A6_VWK_5].x; - A6_HIT_4(bossA6, 2)->z.offset = bossA6->vwork[A6_VWK_6].z; - A6_HIT_4(bossA6, 2)->y.offset = bossA6->vwork[A6_VWK_6].y; - A6_HIT_4(bossA6, 2)->x.offset = bossA6->vwork[A6_VWK_6].x; + A6_HIT_4(this, 0)->z.offset = this->vwork[A6_VWK_4].z; + A6_HIT_4(this, 0)->y.offset = this->vwork[A6_VWK_4].y; + A6_HIT_4(this, 0)->x.offset = this->vwork[A6_VWK_4].x; + A6_HIT_4(this, 1)->z.offset = this->vwork[A6_VWK_5].z; + A6_HIT_4(this, 1)->y.offset = this->vwork[A6_VWK_5].y; + A6_HIT_4(this, 1)->x.offset = this->vwork[A6_VWK_5].x; + A6_HIT_4(this, 2)->z.offset = this->vwork[A6_VWK_6].z; + A6_HIT_4(this, 2)->y.offset = this->vwork[A6_VWK_6].y; + A6_HIT_4(this, 2)->x.offset = this->vwork[A6_VWK_6].x; if (gBossFrameCount == 600) { Radio_PlayMessage(gMsg_ID_2225, RCID_SLIPPY); @@ -1232,19 +1233,19 @@ void Area6_Boss_Update(Boss* bossA6) { gShowBossHealth = 1; } if (gBossFrameCount > 756) { - gBossHealthBar = (bossA6->health / 780.0f) * 255.0f; + gBossHealthBar = (this->health / 780.0f) * 255.0f; } for (i = 0; i < 15; i++) { - if (bossA6->swork[A6_SWK_0 + i] != 0) { - bossA6->swork[A6_SWK_0 + i]--; + if (this->swork[A6_SWK_0 + i] != 0) { + this->swork[A6_SWK_0 + i]--; } } - if (bossA6->fwork[A6_FWK_0] > 20.0f) { + if (this->fwork[A6_FWK_0] > 20.0f) { for (i = 0; i < 3; i++) { - if (bossA6->swork[A6_SWK_0 + i] == 0) { - bossA6->swork[A6_SWK_0 + i] = 5; + if (this->swork[A6_SWK_0 + i] == 0) { + this->swork[A6_SWK_0 + i] = 5; } } } @@ -1257,114 +1258,108 @@ void Area6_Boss_Update(Boss* bossA6) { } } -void Area6_8018A1B0(Boss* bossA6, s32 arg1) { +void Area6_8018A1B0(BossA6* this, s32 arg1) { switch (D_i3_801C2250[A6_BSS_2_0 + arg1]) { case 0: - bossA6->swork[A6_SWK_27 + arg1] = 12; + this->swork[A6_SWK_27 + arg1] = 12; D_i3_801C2250[A6_BSS_2_0 + arg1] = 1; break; case 1: - bossA6->fwork[A6_FWK_13 + arg1] = 120.0f; - if (((bossA6->swork[A6_SWK_33 + arg1] == 0) && (D_i3_801C2250[A6_BSS_6] != 0) && - ((bossA6->swork[A6_SWK_15 + 0] != 0) || (bossA6->swork[A6_SWK_15 + 1] != 0) || - (bossA6->swork[A6_SWK_15 + 2] != 0))) || - (bossA6->swork[A6_SWK_25] == 0)) { - bossA6->fwork[A6_FWK_16 + arg1] = 1.0f; + this->fwork[A6_FWK_13 + arg1] = 120.0f; + if (((this->swork[A6_SWK_33 + arg1] == 0) && (D_i3_801C2250[A6_BSS_6] != 0) && + ((this->swork[A6_SWK_15 + 0] != 0) || (this->swork[A6_SWK_15 + 1] != 0) || + (this->swork[A6_SWK_15 + 2] != 0))) || + (this->swork[A6_SWK_25] == 0)) { + this->fwork[A6_FWK_16 + arg1] = 1.0f; } else { - bossA6->fwork[A6_FWK_16 + arg1] = 60.0f; + this->fwork[A6_FWK_16 + arg1] = 60.0f; } - if (bossA6->fwork[A6_FWK_10 + arg1] >= 119.0f) { - bossA6->fwork[A6_FWK_10 + arg1] = 120.0f; - bossA6->swork[A6_SWK_33 + arg1] = 30; - bossA6->fwork[A6_FWK_16 + arg1] = 60.0f; + if (this->fwork[A6_FWK_10 + arg1] >= 119.0f) { + this->fwork[A6_FWK_10 + arg1] = 120.0f; + this->swork[A6_SWK_33 + arg1] = 30; + this->fwork[A6_FWK_16 + arg1] = 60.0f; D_i3_801C2250[A6_BSS_2_0 + arg1] = 0; - bossA6->swork[A6_SWK_6 + arg1] = 0; - bossA6->swork[A6_SWK_9 + arg1] = 0; - bossA6->swork[A6_SWK_30 + arg1] = 1; - bossA6->swork[A6_SWK_18 + arg1] = 0; + this->swork[A6_SWK_6 + arg1] = 0; + this->swork[A6_SWK_9 + arg1] = 0; + this->swork[A6_SWK_30 + arg1] = 1; + this->swork[A6_SWK_18 + arg1] = 0; } break; } } -void Area6_8018A2C4(Boss* bossA6) { +void Area6_8018A2C4(BossA6* this) { s32 i; - Vec3f sp58; - s32 pad1; + Vec3f effectPos; for (i = 0; i < 3; i++) { - if ((bossA6->dmgPart == i + 1) && (bossA6->state == 4) && (bossA6->fwork[A6_FWK_0] < 20.0f)) { - if ((bossA6->swork[A6_SWK_18 + i] != 1) && (bossA6->swork[A6_SWK_18 + i] != 3)) { - bossA6->swork[A6_SWK_0 + i] = 15; - bossA6->swork[A6_SWK_3 + i] = 40; - bossA6->swork[A6_SWK_33 + i] -= bossA6->damage; + if ((this->dmgPart == i + 1) && (this->state == 4) && (this->fwork[A6_FWK_0] < 20.0f)) { + if ((this->swork[A6_SWK_18 + i] != 1) && (this->swork[A6_SWK_18 + i] != 3)) { + this->swork[A6_SWK_0 + i] = 15; + this->swork[A6_SWK_3 + i] = 40; + this->swork[A6_SWK_33 + i] -= this->damage; if (i == 0) { - sp58.x = D_i3_801BF334[0]; - sp58.y = D_i3_801BF3C4[0]; - sp58.z = bossA6->obj.pos.z; - func_effect_8007A6F0(&sp58, NA_SE_OB_DAMAGE_M); + effectPos.x = D_i3_801BF334[0]; + effectPos.y = D_i3_801BF3C4[0]; + effectPos.z = this->obj.pos.z; + Effect_SpawnTimedSfxAtPos(&effectPos, NA_SE_OB_DAMAGE_M); } if (i == 1) { - sp58.x = D_i3_801BF364[0]; - sp58.y = D_i3_801BF3F4[0]; - sp58.z = bossA6->obj.pos.z; - func_effect_8007A6F0(&sp58, NA_SE_OB_DAMAGE_M); + effectPos.x = D_i3_801BF364[0]; + effectPos.y = D_i3_801BF3F4[0]; + effectPos.z = this->obj.pos.z; + Effect_SpawnTimedSfxAtPos(&effectPos, NA_SE_OB_DAMAGE_M); } if (i == 2) { - sp58.x = D_i3_801BF394[0]; - sp58.y = D_i3_801BF424[0]; - sp58.z = bossA6->obj.pos.z; - func_effect_8007A6F0(&sp58, NA_SE_OB_DAMAGE_M); + effectPos.x = D_i3_801BF394[0]; + effectPos.y = D_i3_801BF424[0]; + effectPos.z = this->obj.pos.z; + Effect_SpawnTimedSfxAtPos(&effectPos, NA_SE_OB_DAMAGE_M); } - if (bossA6->swork[A6_SWK_33 + i] < 0) { - bossA6->swork[A6_SWK_33 + i] = 0; + if (this->swork[A6_SWK_33 + i] < 0) { + this->swork[A6_SWK_33 + i] = 0; } } } } } -void Area6_8018A464(Boss* bossA6, s32 arg1) { +void Area6_8018A464(BossA6* this, s32 arg1) { s32 i; s32 j; f32 var_fs0; - Vec3f spE0; - f32 temp1; - f32 temp2; - f32 temp3; - f32 temp4; - f32 temp5; - f32 temp6; - f32 temp7; + Vec3f effectPos; + s32 pad[7]; - A6_HIT_1(bossA6, arg1)->z.offset = bossA6->vwork[A6_VWK_1 + arg1].z; - A6_HIT_1(bossA6, arg1)->y.offset = bossA6->vwork[A6_VWK_1 + arg1].y; - A6_HIT_1(bossA6, arg1)->x.offset = bossA6->vwork[A6_VWK_1 + arg1].x; + A6_HIT_1(this, arg1)->z.offset = this->vwork[A6_VWK_1 + arg1].z; + A6_HIT_1(this, arg1)->y.offset = this->vwork[A6_VWK_1 + arg1].y; + A6_HIT_1(this, arg1)->x.offset = this->vwork[A6_VWK_1 + arg1].x; - if ((D_i3_801C2250[A6_BSS_5] != 0) && (bossA6->timer_056 != 0)) { - bossA6->timer_050 = 202; - bossA6->timer_056 = 0; + if ((D_i3_801C2250[A6_BSS_5] != 0) && (this->timer_056 != 0)) { + this->timer_050 = 202; + this->timer_056 = 0; } - switch (bossA6->swork[A6_SWK_18 + arg1]) { + + switch (this->swork[A6_SWK_18 + arg1]) { case 0: - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_25 + arg1], -90.0f, 0.05f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_22 + arg1], 0.0f, 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_25 + arg1], -90.0f, 0.05f, 2.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_22 + arg1], 0.0f, 0.1f, 10.0f, 0.00001f); switch (arg1) { case 0: - if (bossA6->swork[A6_SWK_33] != 0) { + if (this->swork[A6_SWK_33] != 0) { for (i = 1; i < 12; i++) { D_i3_801BEE90[i] = 3.0f; D_i3_801BEEC0[i] = 3.0f; - if ((bossA6->swork[A6_SWK_6] == 0) && (bossA6->state != 3)) { - bossA6->swork[A6_SWK_6] = 20; + if ((this->swork[A6_SWK_6] == 0) && (this->state != 3)) { + this->swork[A6_SWK_6] = 20; D_i3_801BEE00[0].y = RAND_FLOAT_CENTERED(720.0f); if (D_i3_801BEE00[0].y < -20.0f) { @@ -1374,22 +1369,22 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { D_i3_801BEE00[0].y = 20.0f; } D_i3_801BF3C4[0] = D_i3_801BEE00[0].y; - } else if ((bossA6->swork[A6_SWK_6] & 3) == 0) { + } else if ((this->swork[A6_SWK_6] & 3) == 0) { D_i3_801BF3C4[i] = D_i3_801BEE00[i].y; D_i3_801BEE00[i].y = D_i3_801BF3C4[i - 1]; } - if (bossA6->swork[A6_SWK_9] == 0) { + if (this->swork[A6_SWK_9] == 0) { if ((D_i3_801BEE00[0].y < -20.0f) || (D_i3_801BEE00[0].y > 20.0f)) { for (i = 0; i < 12; i++) { Math_SmoothStepToF(&D_i3_801BEE00[i].x, 0.0f, 0.5f, 100.0f, 0.001f); } } else { - bossA6->swork[A6_SWK_9] = 30; + this->swork[A6_SWK_9] = 30; D_i3_801BEE00[0].x = RAND_FLOAT_CENTERED(30.0f); } D_i3_801BF334[0] = D_i3_801BEE00[0].x; - } else if ((bossA6->swork[A6_SWK_9] % 8) == 0) { + } else if ((this->swork[A6_SWK_9] % 8) == 0) { D_i3_801BF334[i] = D_i3_801BEE00[i].x; D_i3_801BEE00[i].x = D_i3_801BF334[i - 1]; } @@ -1407,13 +1402,13 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { break; case 1: - if (bossA6->swork[A6_SWK_34] != 0) { + if (this->swork[A6_SWK_34] != 0) { for (i = 1; i < 12; i++) { D_i3_801BF010[i] = 3.0f; D_i3_801BF040[i] = 3.0f; - if (bossA6->swork[A6_SWK_7] == 0) { - bossA6->swork[A6_SWK_7] = 20; + if (this->swork[A6_SWK_7] == 0) { + this->swork[A6_SWK_7] = 20; D_i3_801BEF80[0].y = RAND_FLOAT_CENTERED(720.0f); if (D_i3_801BEF80[0].y < -20.0f) { @@ -1423,22 +1418,22 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { D_i3_801BEF80[0].y = 20.0f; } D_i3_801BF3F4[0] = D_i3_801BEF80[0].y; - } else if ((bossA6->swork[A6_SWK_7] & 3) == 0) { + } else if ((this->swork[A6_SWK_7] & 3) == 0) { D_i3_801BF3F4[i] = D_i3_801BEF80[i].y; D_i3_801BEF80[i].y = D_i3_801BF3F4[i - 1]; } - if (bossA6->swork[A6_SWK_10] == 0) { + if (this->swork[A6_SWK_10] == 0) { if ((D_i3_801BEF80[0].y < -20.0f) || (D_i3_801BEF80[0].y > 20.0f)) { for (i = 0; i < 12; i++) { Math_SmoothStepToF(&D_i3_801BEF80[i].x, 0.0f, 0.5f, 50.0f, 0.001f); } } else { - bossA6->swork[A6_SWK_10] = 30; + this->swork[A6_SWK_10] = 30; D_i3_801BEF80[0].x = RAND_FLOAT_CENTERED(30.0f); } D_i3_801BF364[0] = D_i3_801BEF80[0].x; - } else if ((bossA6->swork[A6_SWK_10] % 8) == 0) { + } else if ((this->swork[A6_SWK_10] % 8) == 0) { D_i3_801BF364[i] = D_i3_801BEF80[i].x; D_i3_801BEF80[i].x = D_i3_801BF364[i - 1]; } @@ -1456,13 +1451,13 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { break; case 2: - if (bossA6->swork[A6_SWK_35] != 0) { + if (this->swork[A6_SWK_35] != 0) { for (i = 1; i < 12; i++) { D_i3_801BF190[i] = 3.0f; D_i3_801BF1C0[i] = 3.0f; - if (bossA6->swork[A6_SWK_8] == 0) { - bossA6->swork[A6_SWK_8] = 20; + if (this->swork[A6_SWK_8] == 0) { + this->swork[A6_SWK_8] = 20; D_i3_801BF100[0].y = RAND_FLOAT_CENTERED(720.0f); if (D_i3_801BF100[0].y < -20.0f) { @@ -1472,22 +1467,22 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { D_i3_801BF100[0].y = 20.0f; } D_i3_801BF424[0] = D_i3_801BF100[0].y; - } else if ((bossA6->swork[A6_SWK_8] & 3) == 0) { + } else if ((this->swork[A6_SWK_8] & 3) == 0) { D_i3_801BF424[i] = D_i3_801BF100[i].y; D_i3_801BF100[i].y = D_i3_801BF424[i - 1]; } - if (bossA6->swork[A6_SWK_11] == 0) { + if (this->swork[A6_SWK_11] == 0) { if ((D_i3_801BF100[0].y < -20.0f) || (D_i3_801BF100[0].y > 20.0f)) { for (i = 0; i < 12; i++) { Math_SmoothStepToF(&D_i3_801BF100[i].x, 0.0f, 0.5f, 50.0f, 0.001f); } } else { - bossA6->swork[A6_SWK_11] = 30; + this->swork[A6_SWK_11] = 30; D_i3_801BF100[0].x = RAND_RANGE(-12.0f, 18.0f); } D_i3_801BF394[0] = D_i3_801BF100[0].x; - } else if ((bossA6->swork[A6_SWK_11] % 8) == 0) { + } else if ((this->swork[A6_SWK_11] % 8) == 0) { D_i3_801BF394[i] = D_i3_801BF100[i].x; D_i3_801BF100[i].x = D_i3_801BF394[i - 1]; } @@ -1505,44 +1500,43 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { break; } - if ((bossA6->state >= 3) && (bossA6->fwork[A6_FWK_0] == 0) && - ((bossA6->swork[A6_SWK_33] != 0) || (bossA6->swork[A6_SWK_34] != 0) || - (bossA6->swork[A6_SWK_35] != 0)) && + if ((this->state >= 3) && (this->fwork[A6_FWK_0] == 0) && + ((this->swork[A6_SWK_33] != 0) || (this->swork[A6_SWK_34] != 0) || (this->swork[A6_SWK_35] != 0)) && (D_i3_801C2250[A6_BSS_5] == 0)) { var_fs0 = 0.5f; - if (bossA6->swork[A6_SWK_25] < 2) { + if (this->swork[A6_SWK_25] < 2) { var_fs0 = 0.7f; } if (((gGameFrameCount % 32) == 0) && (Rand_ZeroOne() < var_fs0) && (D_i3_801C2250[A6_BSS_5] == 0) && - (bossA6->swork[A6_SWK_33 + arg1] != 0)) { - if ((Rand_ZeroOne() < 0.2f) || (bossA6->swork[A6_SWK_25] < 2)) { - if (bossA6->swork[A6_SWK_18] == 0) { - bossA6->swork[A6_SWK_18] = 1; + (this->swork[A6_SWK_33 + arg1] != 0)) { + if ((Rand_ZeroOne() < 0.2f) || (this->swork[A6_SWK_25] < 2)) { + if (this->swork[A6_SWK_18] == 0) { + this->swork[A6_SWK_18] = 1; } - if (bossA6->swork[A6_SWK_19] == 0) { - bossA6->swork[A6_SWK_19] = 1; + if (this->swork[A6_SWK_19] == 0) { + this->swork[A6_SWK_19] = 1; } - if (bossA6->swork[A6_SWK_20] == 0) { - bossA6->swork[A6_SWK_20] = 1; + if (this->swork[A6_SWK_20] == 0) { + this->swork[A6_SWK_20] = 1; } - bossA6->swork[A6_SWK_12] = 30; - if (bossA6->swork[A6_SWK_33] != 0) { - bossA6->swork[A6_SWK_13] = bossA6->swork[A6_SWK_12] + 50; + this->swork[A6_SWK_12] = 30; + if (this->swork[A6_SWK_33] != 0) { + this->swork[A6_SWK_13] = this->swork[A6_SWK_12] + 50; } else { - bossA6->swork[A6_SWK_13] = 30; + this->swork[A6_SWK_13] = 30; } - if (bossA6->swork[A6_SWK_34] != 0) { - bossA6->swork[A6_SWK_14] = bossA6->swork[A6_SWK_13] + 50; + if (this->swork[A6_SWK_34] != 0) { + this->swork[A6_SWK_14] = this->swork[A6_SWK_13] + 50; } else { - bossA6->swork[A6_SWK_14] = bossA6->swork[A6_SWK_13]; + this->swork[A6_SWK_14] = this->swork[A6_SWK_13]; } } else { for (i = 0; i < 3; i++) { - if ((i == (gGameFrameCount % 16U)) && (bossA6->swork[A6_SWK_18 + i] == 0)) { - bossA6->swork[A6_SWK_12 + i] = 15; - bossA6->swork[A6_SWK_18 + i] = 1; + if ((i == (gGameFrameCount % 16U)) && (this->swork[A6_SWK_18 + i] == 0)) { + this->swork[A6_SWK_12 + i] = 15; + this->swork[A6_SWK_18 + i] = 1; i = 3; } } @@ -1577,41 +1571,40 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { } } - if (bossA6->swork[A6_SWK_12 + arg1] == 0) { - bossA6->swork[A6_SWK_12 + arg1] = - 40.0f - ((20.0f - ((bossA6->fwork[A6_FWK_3] * -1.0f) / 150.0f)) * 3.0f); + if (this->swork[A6_SWK_12 + arg1] == 0) { + this->swork[A6_SWK_12 + arg1] = 40.0f - ((20.0f - ((this->fwork[A6_FWK_3] * -1.0f) / 150.0f)) * 3.0f); if (arg1 == 0) { - spE0.x = D_i3_801BF334[0]; - spE0.y = D_i3_801BF3C4[0]; - spE0.z = bossA6->obj.pos.z; - func_effect_8007A6F0(&spE0, NA_SE_EN_ARM_SWING); + effectPos.x = D_i3_801BF334[0]; + effectPos.y = D_i3_801BF3C4[0]; + effectPos.z = this->obj.pos.z; + Effect_SpawnTimedSfxAtPos(&effectPos, NA_SE_EN_ARM_SWING); } if (arg1 == 1) { - spE0.x = D_i3_801BF364[0]; - spE0.y = D_i3_801BF3F4[0]; - spE0.z = bossA6->obj.pos.z; - func_effect_8007A6F0(&spE0, NA_SE_EN_ARM_SWING); + effectPos.x = D_i3_801BF364[0]; + effectPos.y = D_i3_801BF3F4[0]; + effectPos.z = this->obj.pos.z; + Effect_SpawnTimedSfxAtPos(&effectPos, NA_SE_EN_ARM_SWING); } if (arg1 == 2) { - spE0.x = D_i3_801BF394[0]; - spE0.y = D_i3_801BF424[0]; - spE0.z = bossA6->obj.pos.z; - func_effect_8007A6F0(&spE0, NA_SE_EN_ARM_SWING); + effectPos.x = D_i3_801BF394[0]; + effectPos.y = D_i3_801BF424[0]; + effectPos.z = this->obj.pos.z; + Effect_SpawnTimedSfxAtPos(&effectPos, NA_SE_EN_ARM_SWING); } - bossA6->swork[A6_SWK_18 + arg1] = 2; + this->swork[A6_SWK_18 + arg1] = 2; } break; case 2: D_i3_801C2250[A6_BSS_5] = 50; - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_25 + arg1], 0.0f, 0.4f, 100.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_22 + arg1], - 420.0f - ((20.0f - ((bossA6->fwork[A6_FWK_3] * -1.0f) / 150.0f)) * 20.0f), 0.3f, 100.0f, + Math_SmoothStepToF(&this->fwork[A6_FWK_25 + arg1], 0.0f, 0.4f, 100.0f, 0.00001f); + Math_SmoothStepToF(&this->fwork[A6_FWK_22 + arg1], + 420.0f - ((20.0f - ((this->fwork[A6_FWK_3] * -1.0f) / 150.0f)) * 20.0f), 0.3f, 100.0f, 0.00001f); - if ((bossA6->swork[A6_SWK_12 + arg1] == 0) || (bossA6->swork[A6_SWK_3 + arg1] != 0)) { - bossA6->swork[A6_SWK_18 + arg1] = 0; + if ((this->swork[A6_SWK_12 + arg1] == 0) || (this->swork[A6_SWK_3 + arg1] != 0)) { + this->swork[A6_SWK_18 + arg1] = 0; for (i = 0; i < 12; i++) { if (arg1 == 0) { D_i3_801BEE90[i] = 0.0f; @@ -1664,15 +1657,15 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { Math_SmoothStepToF(&D_i3_801BF100[i].x, 0.0f, 0.5f, 50.0f, 0.001f); } - bossA6->timer_050 = 0; - bossA6->swork[A6_SWK_18] = bossA6->swork[A6_SWK_19] = bossA6->swork[A6_SWK_20] = 4; - bossA6->fwork[A6_FWK_13] = bossA6->fwork[A6_FWK_14] = bossA6->fwork[A6_FWK_15] = bossA6->fwork[A6_FWK_22] = - bossA6->fwork[A6_FWK_23] = bossA6->fwork[A6_FWK_24] = 0.0f; - bossA6->fwork[A6_FWK_10] = bossA6->fwork[A6_FWK_11] = bossA6->fwork[A6_FWK_12] = bossA6->fwork[A6_FWK_19] = - bossA6->fwork[A6_FWK_20] = bossA6->fwork[A6_FWK_21] = 0.0f; + this->timer_050 = 0; + this->swork[A6_SWK_18] = this->swork[A6_SWK_19] = this->swork[A6_SWK_20] = 4; + this->fwork[A6_FWK_13] = this->fwork[A6_FWK_14] = this->fwork[A6_FWK_15] = this->fwork[A6_FWK_22] = + this->fwork[A6_FWK_23] = this->fwork[A6_FWK_24] = 0.0f; + this->fwork[A6_FWK_10] = this->fwork[A6_FWK_11] = this->fwork[A6_FWK_12] = this->fwork[A6_FWK_19] = + this->fwork[A6_FWK_20] = this->fwork[A6_FWK_21] = 0.0f; - bossA6->fwork[A6_FWK_28] = 0.0f; - bossA6->fwork[A6_FWK_25] = bossA6->fwork[A6_FWK_26] = bossA6->fwork[A6_FWK_27] = -90.0f; + this->fwork[A6_FWK_28] = 0.0f; + this->fwork[A6_FWK_25] = this->fwork[A6_FWK_26] = this->fwork[A6_FWK_27] = -90.0f; for (i = 0; i < 12; i++) { D_i3_801BEE00[i].x = 0.0f; @@ -1699,7 +1692,7 @@ void Area6_8018A464(Boss* bossA6, s32 arg1) { } } -void Area6_8018B9BC(Boss* bossA6) { +void Area6_8018B9BC(BossA6* this) { s32 i; s32 j; Vec3f dest; @@ -1707,52 +1700,51 @@ void Area6_8018B9BC(Boss* bossA6) { if (D_i3_801C2250[A6_BSS_0] == 0) { for (i = 3, j = 15; j < 18; j++, i++) { - if (bossA6->swork[A6_SWK_0 + j] != 0) { + if (this->swork[A6_SWK_0 + j] != 0) { if ((gGroundClipMode != 0) && (gPlayerShots[15].timer > 0)) { - bossA6->swork[A6_SWK_0 + j] -= bossA6->damage; - } else if (i + 1 == bossA6->dmgPart) { - bossA6->swork[A6_SWK_0 + j] -= bossA6->damage; - if ((D_i3_801C2250[A6_BSS_25] == 0) && (bossA6->swork[A6_SWK_25] == 1) && (Rand_ZeroOne() < 0.4f)) { + this->swork[A6_SWK_0 + j] -= this->damage; + } else if (i + 1 == this->dmgPart) { + this->swork[A6_SWK_0 + j] -= this->damage; + if ((D_i3_801C2250[A6_BSS_25] == 0) && (this->swork[A6_SWK_25] == 1) && (Rand_ZeroOne() < 0.4f)) { D_i3_801C2250[A6_BSS_10]++; D_i3_801C2250[A6_BSS_10] &= 1; D_i3_801C2250[A6_BSS_25] = 20; } } - AUDIO_PLAY_SFX(NA_SE_EN_SPARK_DAMAGE_M, bossA6->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SPARK_DAMAGE_M, this->sfxSource, 4); - if (bossA6->swork[A6_SWK_0 + j] <= 0) { - bossA6->swork[A6_SWK_0 + j] = 0; + if (this->swork[A6_SWK_0 + j] <= 0) { + this->swork[A6_SWK_0 + j] = 0; - Matrix_MultVec3f(gCalcMatrix, &bossA6->vwork[A6_VWK_1 + i], &dest); - func_effect_8007D0E0(bossA6->obj.pos.x + dest.x, bossA6->obj.pos.y + dest.y, - bossA6->obj.pos.z + dest.z, 10.0f); + Matrix_MultVec3f(gCalcMatrix, &this->vwork[A6_VWK_1 + i], &dest); + func_effect_8007D0E0(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, + 10.0f); - sfxPos.x = bossA6->obj.pos.x + dest.x; - sfxPos.y = bossA6->obj.pos.y + dest.y; - sfxPos.z = bossA6->obj.pos.z + dest.z; + sfxPos.x = this->obj.pos.x + dest.x; + sfxPos.y = this->obj.pos.y + dest.y; + sfxPos.z = this->obj.pos.z + dest.z; - func_effect_8007A6F0(&sfxPos, NA_SE_EN_EXPLOSION_M); - func_effect_8007C120(bossA6->obj.pos.x, bossA6->obj.pos.y, bossA6->obj.pos.z + 150.0f, - bossA6->vel.x, bossA6->vel.y, bossA6->vel.z, 0.2f, 50); + Effect_SpawnTimedSfxAtPos(&sfxPos, NA_SE_EN_EXPLOSION_M); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 150.0f, this->vel.x, + this->vel.y, this->vel.z, 0.2f, 50); } - if ((bossA6->swork[A6_SWK_15] == 0) && (bossA6->swork[A6_SWK_16] == 0) && - (bossA6->swork[A6_SWK_17] == 0)) { - Audio_KillSfxBySource(bossA6->sfxSource); + if ((this->swork[A6_SWK_15] == 0) && (this->swork[A6_SWK_16] == 0) && (this->swork[A6_SWK_17] == 0)) { + Audio_KillSfxBySource(this->sfxSource); - if (bossA6->swork[A6_SWK_25] != 0) { - bossA6->swork[A6_SWK_25]--; - if (bossA6->swork[A6_SWK_25] != 0) { - bossA6->health -= 60; + if (this->swork[A6_SWK_25] != 0) { + this->swork[A6_SWK_25]--; + if (this->swork[A6_SWK_25] != 0) { + this->health -= 60; } } - if (bossA6->swork[A6_SWK_25] != 0) { - bossA6->timer_058 = 50; + if (this->swork[A6_SWK_25] != 0) { + this->timer_058 = 50; } else { - bossA6->timer_054 = 30; - bossA6->fwork[A6_FWK_32] = 20.0f; + this->timer_054 = 30; + this->fwork[A6_FWK_32] = 20.0f; } } } @@ -1824,7 +1816,7 @@ void Area6_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4) { f32 spAC; f32 var_fs3 = 5.0f; - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { spAC = 0.0f; } else { spAC = 180.0f; @@ -1879,7 +1871,7 @@ void Area6_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4) { Matrix_Pop(&gGfxMatrix); } -void Area6_Boss_Draw(Boss* bossA6) { +void Area6_Boss_Draw(BossA6* this) { Vec3f jointTable[30]; Vec3f spC4; Vec3f spB8; @@ -1887,12 +1879,12 @@ void Area6_Boss_Draw(Boss* bossA6) { s32 i; s32 j; - if (bossA6->state == 0) { + if (this->state == 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_49); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_i3_801C22F0.unk_24); gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 255); Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, bossA6->fwork[A6_FWK_33] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->fwork[A6_FWK_33] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); } else if (D_i3_801C22F0.unk_24 != 0.0f) { @@ -1903,7 +1895,7 @@ void Area6_Boss_Draw(Boss* bossA6) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_i3_801C22F0.unk_24); spAC.x = 0.0f; - if ((gSysFrameCount & 1) == 0) { + if (!(gSysFrameCount & 1)) { spAC.x = 1.0f; if (1) {} spAC.x = 0.0f; @@ -1913,14 +1905,14 @@ void Area6_Boss_Draw(Boss* bossA6) { Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &spAC, &spB8); Matrix_Translate(gGfxMatrix, spB8.x, spB8.y, 0.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, bossA6->scale, bossA6->scale, bossA6->scale, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->scale, this->scale, this->scale, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, bossA6->fwork[A6_FWK_34], bossA6->fwork[A6_FWK_35], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[A6_FWK_34], this->fwork[A6_FWK_35], 1.0f, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, bossA6->fwork[A6_FWK_34], bossA6->fwork[A6_FWK_35], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[A6_FWK_34], this->fwork[A6_FWK_35], 1.0f, MTXF_APPLY); } else { RCP_SetupDL(&gMasterDisp, SETUPDL_27); - if (bossA6->timer_05C & 1) { + if (this->timer_05C & 1) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) D_i3_801C22F0.unk_28[0], (s32) D_i3_801C22F0.unk_28[2], @@ -1928,47 +1920,46 @@ void Area6_Boss_Draw(Boss* bossA6) { } } - jointTable[3].z -= bossA6->fwork[A6_FWK_0]; - jointTable[4].z -= bossA6->fwork[A6_FWK_0]; - jointTable[5].z -= bossA6->fwork[A6_FWK_0]; + jointTable[3].z -= this->fwork[A6_FWK_0]; + jointTable[4].z -= this->fwork[A6_FWK_0]; + jointTable[5].z -= this->fwork[A6_FWK_0]; - Animation_DrawSkeleton(1, D_A6_6018BA0, jointTable, NULL, NULL, &bossA6->index, &gIdentityMatrix); + Animation_DrawSkeleton(1, D_A6_6018BA0, jointTable, NULL, NULL, &this->index, &gIdentityMatrix); - if (bossA6->scale >= 1.0f) { + if (this->scale >= 1.0f) { for (i = 0; i < 3; i++) { - if ((bossA6->swork[A6_SWK_33 + i] == 0) && (bossA6->state != 3) && - (D_i3_801C2250[A6_BSS_2_0 + i] == 0) && ((gGameFrameCount % 4) == 0) && - (bossA6->swork[A6_SWK_27 + i] != 0) && (gPlayState != 100)) { - Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, MTXF_APPLY); + if ((this->swork[A6_SWK_33 + i] == 0) && (this->state != 3) && (D_i3_801C2250[A6_BSS_2_0 + i] == 0) && + ((gGameFrameCount % 4) == 0) && (this->swork[A6_SWK_27 + i] != 0) && (gPlayState != 100)) { + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_MultVec3f(gCalcMatrix, &bossA6->vwork[A6_VWK_1] + i, &spC4); + Matrix_MultVec3f(gCalcMatrix, &this->vwork[A6_VWK_1] + i, &spC4); - func_effect_8007D0E0(bossA6->obj.pos.x + spC4.x, bossA6->obj.pos.y + spC4.y, - bossA6->obj.pos.z + spC4.z, 20.0f); + func_effect_8007D0E0(this->obj.pos.x + spC4.x, this->obj.pos.y + spC4.y, this->obj.pos.z + spC4.z, + 20.0f); - spB8.x = bossA6->obj.pos.x + spC4.x; - spB8.y = bossA6->obj.pos.y + spC4.y; - spB8.z = bossA6->obj.pos.z + spC4.z; + spB8.x = this->obj.pos.x + spC4.x; + spB8.y = this->obj.pos.y + spC4.y; + spB8.z = this->obj.pos.z + spC4.z; - if ((!bossA6) && (!bossA6)) {} // fake + if ((!this) && (!this)) {} // fake if (D_i3_801C2250[A6_BSS_26] == 0) { - func_effect_8007A6F0(&spB8, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&spB8, NA_SE_EN_EXPLOSION_M); } D_i3_801C2250[A6_BSS_26]++; D_i3_801C2250[A6_BSS_26] &= 1; - bossA6->swork[A6_SWK_27 + i]--; + this->swork[A6_SWK_27 + i]--; - if (bossA6->swork[A6_SWK_27 + i] <= 0) { - bossA6->swork[A6_SWK_18 + i] = 4; - bossA6->swork[A6_SWK_38] = 1; - bossA6->fwork[A6_FWK_10 + i] = bossA6->fwork[A6_FWK_19 + i] = bossA6->fwork[A6_FWK_13 + i] = - bossA6->fwork[A6_FWK_22 + i] = 0.0f; - bossA6->fwork[A6_FWK_25 + i] = -90.0f; + if (this->swork[A6_SWK_27 + i] <= 0) { + this->swork[A6_SWK_18 + i] = 4; + this->swork[A6_SWK_38] = 1; + this->fwork[A6_FWK_10 + i] = this->fwork[A6_FWK_19 + i] = this->fwork[A6_FWK_13 + i] = + this->fwork[A6_FWK_22 + i] = 0.0f; + this->fwork[A6_FWK_25 + i] = -90.0f; for (j = 0; j < 12; j++) { if (i == 0) { @@ -1995,74 +1986,74 @@ void Area6_Boss_Draw(Boss* bossA6) { } } } - Area6_8018BCD4(D_i3_801BED70, 0.0f, bossA6->fwork[A6_FWK_25], &bossA6->vwork[A6_VWK_1], - bossA6->swork[A6_SWK_0] & 1, bossA6->fwork[A6_FWK_10] + bossA6->fwork[A6_FWK_19], - bossA6->swork[A6_SWK_27], bossA6->fwork[A6_FWK_0]); - Area6_8018BCD4(D_i3_801BEEF0, -120.0f, bossA6->fwork[A6_FWK_26], &bossA6->vwork[A6_VWK_2], - bossA6->swork[A6_SWK_1] & 1, bossA6->fwork[A6_FWK_11] + bossA6->fwork[A6_FWK_20], - bossA6->swork[A6_SWK_28], bossA6->fwork[A6_FWK_0]); - Area6_8018BCD4(D_i3_801BF070, 120.0f, bossA6->fwork[A6_FWK_27], &bossA6->vwork[A6_VWK_3], - bossA6->swork[A6_SWK_2] & 1, bossA6->fwork[A6_FWK_12] + bossA6->fwork[A6_FWK_21], - bossA6->swork[A6_SWK_29], bossA6->fwork[A6_FWK_0]); + Area6_8018BCD4(D_i3_801BED70, 0.0f, this->fwork[A6_FWK_25], &this->vwork[A6_VWK_1], + this->swork[A6_SWK_0] & 1, this->fwork[A6_FWK_10] + this->fwork[A6_FWK_19], + this->swork[A6_SWK_27], this->fwork[A6_FWK_0]); + Area6_8018BCD4(D_i3_801BEEF0, -120.0f, this->fwork[A6_FWK_26], &this->vwork[A6_VWK_2], + this->swork[A6_SWK_1] & 1, this->fwork[A6_FWK_11] + this->fwork[A6_FWK_20], + this->swork[A6_SWK_28], this->fwork[A6_FWK_0]); + Area6_8018BCD4(D_i3_801BF070, 120.0f, this->fwork[A6_FWK_27], &this->vwork[A6_VWK_3], + this->swork[A6_SWK_2] & 1, this->fwork[A6_FWK_12] + this->fwork[A6_FWK_21], + this->swork[A6_SWK_29], this->fwork[A6_FWK_0]); - if ((bossA6->swork[A6_SWK_15] != 0) && (bossA6->state >= 3) && (D_i3_801C22F0.unk_24 == 255.0f) && + if ((this->swork[A6_SWK_15] != 0) && (this->state >= 3) && (D_i3_801C22F0.unk_24 == 255.0f) && (D_i3_801C2250[A6_BSS_0] == 0)) { - Area6_8018C0D0(D_i3_801BF1F0, 0.0f, &bossA6->vwork[A6_VWK_4], bossA6->fwork[A6_FWK_0], 0); + Area6_8018C0D0(D_i3_801BF1F0, 0.0f, &this->vwork[A6_VWK_4], this->fwork[A6_FWK_0], 0); } - if ((bossA6->swork[A6_SWK_16] != 0) && (bossA6->state >= 3) && (D_i3_801C22F0.unk_24 == 255.0f) && + if ((this->swork[A6_SWK_16] != 0) && (this->state >= 3) && (D_i3_801C22F0.unk_24 == 255.0f) && (D_i3_801C2250[A6_BSS_0] == 0)) { - Area6_8018C0D0(D_i3_801BF220, -120.0f, &bossA6->vwork[A6_VWK_5], bossA6->fwork[A6_FWK_0], 1); + Area6_8018C0D0(D_i3_801BF220, -120.0f, &this->vwork[A6_VWK_5], this->fwork[A6_FWK_0], 1); } - if ((bossA6->swork[A6_SWK_17] != 0) && (bossA6->state >= 3) && (D_i3_801C22F0.unk_24 == 255.0f) && + if ((this->swork[A6_SWK_17] != 0) && (this->state >= 3) && (D_i3_801C22F0.unk_24 == 255.0f) && (D_i3_801C2250[A6_BSS_0] == 0)) { - Area6_8018C0D0(D_i3_801BF250, 120.0f, &bossA6->vwork[A6_VWK_6], bossA6->fwork[A6_FWK_0], 2); + Area6_8018C0D0(D_i3_801BF250, 120.0f, &this->vwork[A6_VWK_6], this->fwork[A6_FWK_0], 2); } - if (bossA6->swork[A6_SWK_25] != 0) { - j = bossA6->swork[A6_SWK_25] - 1; + if (this->swork[A6_SWK_25] != 0) { + j = this->swork[A6_SWK_25] - 1; - if ((bossA6->timer_058 != 0) && !(bossA6->timer_058 & 3)) { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, bossA6->sfxSource, 4); + if ((this->timer_058 != 0) && !(this->timer_058 & 3)) { + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); } - if (bossA6->timer_058 == 1) { - if (bossA6->swork[A6_SWK_25] == 2) { + if (this->timer_058 == 1) { + if (this->swork[A6_SWK_25] == 2) { Radio_PlayMessage(gMsg_ID_7085, RCID_FALCO); - } else if (bossA6->swork[A6_SWK_25] == 1) { + } else if (this->swork[A6_SWK_25] == 1) { Radio_PlayMessage(gMsg_ID_7086, RCID_SLIPPY); } } - if (bossA6->swork[A6_SWK_22] != D_i3_801BF310[j]) { - if (bossA6->swork[A6_SWK_22] < D_i3_801BF310[j]) { - bossA6->swork[A6_SWK_22]++; + if (this->swork[A6_SWK_22] != D_i3_801BF310[j]) { + if (this->swork[A6_SWK_22] < D_i3_801BF310[j]) { + this->swork[A6_SWK_22]++; } else { - bossA6->swork[A6_SWK_22]--; + this->swork[A6_SWK_22]--; } } - if (bossA6->swork[A6_SWK_23] != D_i3_801BF31C[j]) { - if (bossA6->swork[A6_SWK_23] < D_i3_801BF31C[j]) { - bossA6->swork[A6_SWK_23]++; + if (this->swork[A6_SWK_23] != D_i3_801BF31C[j]) { + if (this->swork[A6_SWK_23] < D_i3_801BF31C[j]) { + this->swork[A6_SWK_23]++; } else { - bossA6->swork[A6_SWK_23]--; + this->swork[A6_SWK_23]--; } } - if (bossA6->swork[A6_SWK_24] != D_i3_801BF328[j]) { - if (bossA6->swork[A6_SWK_24] < D_i3_801BF328[j]) { - bossA6->swork[A6_SWK_24]++; + if (this->swork[A6_SWK_24] != D_i3_801BF328[j]) { + if (this->swork[A6_SWK_24] < D_i3_801BF328[j]) { + this->swork[A6_SWK_24]++; } else { - bossA6->swork[A6_SWK_24]--; + this->swork[A6_SWK_24]--; } } } else { - Math_SmoothStepToF(&bossA6->fwork[A6_FWK_29], 0.0f, 1.0f, 10.0f, 0.0001f); - if ((bossA6->timer_054 == 0) && (bossA6->swork[A6_SWK_36] == 4) && (D_i3_801C2250[A6_BSS_31] == 0)) { + Math_SmoothStepToF(&this->fwork[A6_FWK_29], 0.0f, 1.0f, 10.0f, 0.0001f); + if ((this->timer_054 == 0) && (this->swork[A6_SWK_36] == 4) && (D_i3_801C2250[A6_BSS_31] == 0)) { Radio_PlayMessage(gMsg_ID_7087, RCID_PEPPY); - bossA6->swork[A6_SWK_36] = 5; + this->swork[A6_SWK_36] = 5; D_i3_801C2250[A6_BSS_31]++; D_i3_801C2250[A6_BSS_31] &= 1; } @@ -2073,7 +2064,7 @@ void Area6_Boss_Draw(Boss* bossA6) { Matrix_Translate(gGfxMatrix, 0.0f, 2.0f, 70.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, MTXF_APPLY); - if (bossA6->timer_05C & 1) { + if (this->timer_05C & 1) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_i3_801C22F0.unk_24); @@ -2086,11 +2077,11 @@ void Area6_Boss_Draw(Boss* bossA6) { Matrix_Pop(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, SETUPDL_71); if (D_i3_801C22F0.unk_24 != 255.0f) { - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, bossA6->swork[A6_SWK_22], bossA6->swork[A6_SWK_23], - bossA6->swork[A6_SWK_24], (s32) D_i3_801C22F0.unk_28[-1]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, this->swork[A6_SWK_22], this->swork[A6_SWK_23], + this->swork[A6_SWK_24], (s32) D_i3_801C22F0.unk_28[-1]); } else { - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, bossA6->swork[A6_SWK_22], bossA6->swork[A6_SWK_23], - bossA6->swork[A6_SWK_24], (s32) bossA6->fwork[A6_FWK_29]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, this->swork[A6_SWK_22], this->swork[A6_SWK_23], + this->swork[A6_SWK_24], (s32) this->fwork[A6_FWK_29]); } Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 74.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2128,19 +2119,19 @@ void Area6_8018D3CC(s32 arg0, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, } } -void Area6_8018D4E0(Actor* actor) { +void Area6_8018D4E0(Actor* this) { s32 i; - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 20); - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 7.0f); - func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 6.0f, 5); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 20); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 7.0f); + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 6.0f, 5); - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); for (i = 0; i < 15; i++) { - func_effect_800794CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); + func_effect_800794CC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_M); } void Area6_8018D5C8(void) { @@ -2148,9 +2139,11 @@ void Area6_8018D5C8(void) { Actor_Initialize(&gActors[i]); gActors[i].obj.status = OBJ_INIT; + gActors[i].obj.pos.x = 1600.0f; gActors[i].obj.pos.y = 3750.0f; gActors[i].obj.pos.z = 13000.0f; + gActors[i].animFrame = 1; gActors[i].state = 90; gActors[i].fwork[0] = 0.0f; @@ -2159,31 +2152,33 @@ void Area6_8018D5C8(void) { AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, gActors[i].sfxSource, 0); } -void Area6_8018D694(Actor* actor, s32 arg1) { +void Area6_8018D694(ActorCutscene* this, s32 index) { Vec3f sp2C[5] = { { -150.0f, 0.0f, 200.0f }, { 0.0f, 50.0f, 0.0f }, { 150.0f, -50.0f, 100.0f }, { -350.0f, 100.0f, 300.0f }, { 100.0f, -300.0f, 100.0f }, }; - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = sp2C[arg1].x + 100.0f; - actor->obj.pos.y = sp2C[arg1].y + 350.0f; - actor->obj.pos.z = sp2C[arg1].z + 1000.0f; - actor->state = 1; - actor->animFrame = 28; - actor->iwork[11] = 1; - actor->rot_0F4.y = 90.0f; - actor->fwork[0] = 1.5f; - actor->fwork[7] = RAND_FLOAT_SEEDED(360.0f); - actor->fwork[8] = RAND_FLOAT_SEEDED(360.0f); - actor->fwork[9] = RAND_FLOAT_SEEDED(360.0f); - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actor->sfxSource, 4); + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = sp2C[index].x + 100.0f; + this->obj.pos.y = sp2C[index].y + 350.0f; + this->obj.pos.z = sp2C[index].z + 1000.0f; + + this->state = 1; + this->animFrame = 28; + this->iwork[11] = 1; + this->rot_0F4.y = 90.0f; + this->fwork[0] = 1.5f; + this->fwork[7] = RAND_FLOAT_SEEDED(360.0f); + this->fwork[8] = RAND_FLOAT_SEEDED(360.0f); + this->fwork[9] = RAND_FLOAT_SEEDED(360.0f); + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, this->sfxSource, 4); } -void Area6_8018D804(Actor* actor, s32 arg1) { +void Area6_8018D804(ActorCutscene* this, s32 arg1) { Vec3f sp2C[3] = { { -200.0f, 0.0f, -500.0f }, { 200.0f, 30.0f, -600.0f }, @@ -2191,17 +2186,19 @@ void Area6_8018D804(Actor* actor, s32 arg1) { }; Player* player = &gPlayer[0]; - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = sp2C[arg1].x + player->pos.x; - actor->obj.pos.y = sp2C[arg1].y + player->pos.y; - actor->obj.pos.z = sp2C[arg1].z + player->pos.z; - actor->state = 5; - actor->iwork[11] = 1; - actor->fwork[0] = 0.0f; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = sp2C[arg1].x + player->pos.x; + this->obj.pos.y = sp2C[arg1].y + player->pos.y; + this->obj.pos.z = sp2C[arg1].z + player->pos.z; + + this->state = 5; + this->iwork[11] = 1; + this->fwork[0] = 0.0f; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } void Area6_8018D920(Vec3f* pos) { @@ -2224,7 +2221,7 @@ void Area6_8018D920(Vec3f* pos) { Area6_8018D3CC(CS_SHOT_ID, pos->x, pos->y, pos->z, vel.x, vel.y, vel.z, xRot, yRot, 0.0f); } -void Area6_8018DA58(Actor* actor) { +void Area6_8018DA58(ActorCutscene* this) { Vec3f sp5C; Vec3f sp50; f32 sp4C; @@ -2234,41 +2231,41 @@ void Area6_8018DA58(Actor* actor) { f32 sp3C; f32 sp38; - switch (actor->state) { + switch (this->state) { case 1: - actor->fwork[7] += 2.5f; - actor->rot_0F4.z = SIN_DEG(actor->fwork[7]) * 10.0f; - actor->fwork[8] += 1.0f; - actor->obj.pos.y += SIN_DEG(actor->fwork[8]) * 1.5f; - actor->fwork[9] += 1.0f; - actor->obj.pos.z += COS_DEG(actor->fwork[9]) * 1.5f; + this->fwork[7] += 2.5f; + this->rot_0F4.z = SIN_DEG(this->fwork[7]) * 10.0f; + this->fwork[8] += 1.0f; + this->obj.pos.y += SIN_DEG(this->fwork[8]) * 1.5f; + this->fwork[9] += 1.0f; + this->obj.pos.z += COS_DEG(this->fwork[9]) * 1.5f; break; case 2: - Math_SmoothStepToF(&actor->rot_0F4.z, -180.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&this->rot_0F4.z, -180.0f, 0.1f, 3.0f, 0.0f); break; case 3: - Math_SmoothStepToF(&actor->rot_0F4.z, -45.0f, 0.05f, 2.0f, 0.0f); - Math_SmoothStepToAngle(&actor->rot_0F4.y, 340.0f, 0.05f, 2.4f, 0.0f); - Math_SmoothStepToF(&actor->rot_0F4.x, 3.0f, 0.05f, 1.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[0], 30.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&this->rot_0F4.z, -45.0f, 0.05f, 2.0f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.y, 340.0f, 0.05f, 2.4f, 0.0f); + Math_SmoothStepToF(&this->rot_0F4.x, 3.0f, 0.05f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[0], 30.0f, 0.1f, 3.0f, 0.0f); break; case 6: case 11: case 16: - actor->state++; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state++; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 5.0f; /* fallthrough */ case 7: case 12: case 17: - actor->iwork[11] = 2; - Math_SmoothStepToF(&actor->fwork[0], 50.0f, 0.1f, 3.0f, 0.01f); + this->iwork[11] = 2; + Math_SmoothStepToF(&this->fwork[0], 50.0f, 0.1f, 3.0f, 0.01f); - switch (actor->state) { + switch (this->state) { case 7: sp48 = -100.0f; sp4C = 100.0f; @@ -2296,36 +2293,36 @@ void Area6_8018DA58(Actor* actor) { sp40 = 0.0f; } - sp38 = Math_SmoothStepToAngle(&actor->rot_0F4.y, sp3C, 0.5f, 2.0f, 0.0001f) * 30.0f; - Math_SmoothStepToAngle(&actor->rot_0F4.x, sp40, 0.5f, 2.0f, 0.0001f); - Math_SmoothStepToAngle(&actor->rot_0F4.z, sp38, 0.1f, 5.0f, 0.0001f); + sp38 = Math_SmoothStepToAngle(&this->rot_0F4.y, sp3C, 0.5f, 2.0f, 0.0001f) * 30.0f; + Math_SmoothStepToAngle(&this->rot_0F4.x, sp40, 0.5f, 2.0f, 0.0001f); + Math_SmoothStepToAngle(&this->rot_0F4.z, sp38, 0.1f, 5.0f, 0.0001f); break; case 91: - Math_SmoothStepToF(&actor->obj.pos.y, 0.0f, 0.1f, 5.0f, 0.1f); - Math_SmoothStepToF(&actor->obj.pos.z, 0.0f, 1.0f, 20.0f, 20.0f); + Math_SmoothStepToF(&this->obj.pos.y, 0.0f, 0.1f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.z, 0.0f, 1.0f, 20.0f, 20.0f); break; case 90: break; } - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; - sp5C.z = actor->fwork[0]; + sp5C.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp5C, &sp50); - actor->vel.x = sp50.x; - actor->vel.y = sp50.y; - actor->vel.z = sp50.z; + this->vel.x = sp50.x; + this->vel.y = sp50.y; + this->vel.z = sp50.z; - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y + 180.0f; - actor->obj.rot.z = -actor->rot_0F4.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } void Area6_LevelStart(Player* player) { @@ -2569,46 +2566,46 @@ void Area6_LevelStart(Player* player) { Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[1], 50000.0f, 0.001f); } -void Area6_8018EA88(Actor* actor) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = 0.0f; - actor->obj.pos.y = 0.0f; - actor->obj.pos.z = gBosses[0].obj.pos.z + 500.0f; - actor->animFrame = 37; - actor->state = 100; - actor->iwork[0] = 255; - actor->iwork[1] = 255; - actor->iwork[2] = 255; - actor->iwork[3] = 240; - actor->iwork[4] = 0; - actor->iwork[5] = 0; - actor->iwork[6] = 255; - actor->iwork[7] = 100; - actor->fwork[4] = 1.0f; - actor->scale = 1.0f; - Object_SetInfo(&actor->info, actor->obj.id); +void Area6_8018EA88(ActorCutscene* this) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + this->obj.pos.x = 0.0f; + this->obj.pos.y = 0.0f; + this->obj.pos.z = gBosses[0].obj.pos.z + 500.0f; + this->animFrame = 37; + this->state = 100; + this->iwork[0] = 255; + this->iwork[1] = 255; + this->iwork[2] = 255; + this->iwork[3] = 240; + this->iwork[4] = 0; + this->iwork[5] = 0; + this->iwork[6] = 255; + this->iwork[7] = 100; + this->fwork[4] = 1.0f; + this->scale = 1.0f; + Object_SetInfo(&this->info, this->obj.id); } -void Area6_8018EB3C(Actor* actor) { +void Area6_8018EB3C(ActorCutscene* this) { Player* player = &gPlayer[0]; - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = player->pos.x; - actor->obj.pos.y = player->pos.y + 600.0f; - actor->obj.pos.z = player->pos.z + 2800.0f; - actor->animFrame = 1; - actor->state = 100; - actor->fwork[0] = 0.0f; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; + this->obj.pos.x = player->pos.x; + this->obj.pos.y = player->pos.y + 600.0f; + this->obj.pos.z = player->pos.z + 2800.0f; + this->animFrame = 1; + this->state = 100; + this->fwork[0] = 0.0f; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, this->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, this->sfxSource, 0); } -void Area6_8018EC38(Actor* actor, s32 arg1) { +void Area6_8018EC38(ActorCutscene* this, s32 arg1) { Vec3f sp2C[3] = { { -150.0f, 40.0f, 75.0f }, { 150.0f, 40.0f, 150.0f }, @@ -2617,25 +2614,25 @@ void Area6_8018EC38(Actor* actor, s32 arg1) { Player* player = &gPlayer[0]; if (gTeamShields[arg1 + 1] > 0) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = sp2C[arg1].x + player->pos.x; - actor->obj.pos.y = sp2C[arg1].y + player->pos.y; - actor->obj.pos.z = sp2C[arg1].z + player->pos.z; + this->obj.pos.x = sp2C[arg1].x + player->pos.x; + this->obj.pos.y = sp2C[arg1].y + player->pos.y; + this->obj.pos.z = sp2C[arg1].z + player->pos.z; - actor->state = 100; + this->state = 100; - actor->iwork[11] = 1; - actor->fwork[0] = 0.0f; + this->iwork[11] = 1; + this->fwork[0] = 0.0f; if (arg1 + 1 != 3) { - actor->iwork[14] = arg1 + 2; + this->iwork[14] = arg1 + 2; } - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } } diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index 0a883288..ccb70c55 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -12,7 +12,7 @@ const char D_i3_801C1A30[] = "プレイヤーのすべてをクリア \n"; // Clear of all players const char D_i3_801C1A50[] = "i %d\n"; -typedef enum { +typedef enum BossAQLimbs { /* 0 */ AQ_LIMB_0, /* 1 */ AQ_LIMB_1, /* 2 */ AQ_LIMB_2, @@ -44,7 +44,7 @@ typedef enum { /* 28 */ AQ_LIMB_MAX, } BossAQLimbs; -typedef enum { +typedef enum BossAQswork { /* 0 */ AQ_SWK_0, /* 1 */ AQ_SWK_1, /* 2 */ AQ_SWK_2, @@ -88,7 +88,7 @@ typedef enum { /* 40 */ AQ_SWK_MAX, } BossAQswork; -typedef enum { +typedef enum BossAQfwork { /* 0 */ AQ_FWK_0, /* 1 */ AQ_FWK_1, /* 2 */ AQ_FWK_2, @@ -142,7 +142,7 @@ typedef enum { /* 50 */ AQ_FWK_MAX, } BossAQfwork; -typedef enum { +typedef enum BossAQvwork { /* 0 */ AQ_VWK_0, /* 1 */ AQ_VWK_1, /* 2 */ AQ_VWK_2, @@ -1382,7 +1382,7 @@ void Aquas_801AC8A8(f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 unk4E) { } // OBJ_EFFECT_366 action -void Aquas_801AC918(Effect* effect) { +void Aquas_Effect366_Update(Effect* effect) { f32 temp_fs0; if (effect->unk_46 != 0) { @@ -1627,7 +1627,7 @@ void Aquas_801AD688(Actor* actor) { } // OBJ_ACTOR_255 action -void Aquas_801AD6C0(Actor* actor) { +void Aquas_Actor255_Update(Actor* actor) { s32 var_v0 = actor->iwork[2] - 1; f32 sp80; f32 sp7C; @@ -1825,7 +1825,7 @@ void Aquas_801ADF7C(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, } // OBJ_ACTOR_255 draw -void Aquas_801AE168(Actor* actor) { +void Aquas_Actor255_Draw(Actor* actor) { s32 i; f32 xz; f32 yRot; @@ -1875,7 +1875,7 @@ void Aquas_801AE3AC(Actor* actor) { } // OBJ_ACTOR_256 action -void Aquas_801AE3D8(Actor* actor) { +void Aquas_Actor256_Update(Actor* actor) { s32 i; switch (actor->state) { @@ -2027,7 +2027,7 @@ void Aquas_801AE3D8(Actor* actor) { } // OBJ_ACTOR_256 draw -void Aquas_801AEB44(Actor* actor) { +void Aquas_Actor256_Draw(Actor* actor) { f32 var_fv0; u8 var_t1; u8 i; @@ -2156,7 +2156,7 @@ void Aquas_801AF9FC(Actor* actor) { } // OBJ_ACTOR_257 action -void Aquas_801AFA5C(Actor* actor) { +void Aquas_Actor257_Update(Actor* actor) { s32 i; f32 sp70; f32 sp6C; @@ -2402,7 +2402,7 @@ void Aquas_801AFA5C(Actor* actor) { } // OBJ_ACTOR_257 draw -void Aquas_801B099C(Actor* actor) { +void Aquas_Actor257_Draw(Actor* actor) { Matrix_RotateY(gGfxMatrix, (actor->obj.rot.x + actor->fwork[3]) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, (actor->obj.rot.y + actor->fwork[4]) * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, (actor->obj.rot.z + actor->fwork[5]) * M_DTOR, MTXF_APPLY); @@ -2430,7 +2430,7 @@ void Aquas_801B099C(Actor* actor) { } // OBJ_ACTOR_258 action -void Aquas_801B0B60(Actor* actor) { +void Aquas_Actor258_Update(Actor* actor) { Vec3f sp44; Vec3f sp38; @@ -2492,7 +2492,7 @@ void Aquas_801B0B60(Actor* actor) { Object_Kill(&actor->obj, actor->sfxSource); func_effect_800815DC(); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 50.0f, 5.0f); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_SEA_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_SEA_EXPLOSION_S); break; } @@ -2504,7 +2504,7 @@ void Aquas_801B0B60(Actor* actor) { } // OBJ_ACTOR_258 draw -void Aquas_801B0EC0(Actor* actor) { +void Aquas_Actor258_Draw(Actor* actor) { if (actor->timer_0BC == 0) { Graphics_SetScaleMtx(0.8f); RCP_SetupDL(&gMasterDisp, SETUPDL_61); @@ -2973,7 +2973,7 @@ void Aquas_Boss_Update(Boss* bossAQ) { spD4.x = D_i3_801C4308[73]; spD4.y = D_i3_801C4308[74]; spD4.z = D_i3_801C4308[75]; // 74? - func_effect_8007A6F0(&spD4, NA_SE_EN_WT_DISAPPEAR_L); + Effect_SpawnTimedSfxAtPos(&spD4, NA_SE_EN_WT_DISAPPEAR_L); bossAQ->swork[AQ_SWK_10] = 250.0f + RAND_FLOAT(50.0f); } } @@ -2992,7 +2992,7 @@ void Aquas_Boss_Update(Boss* bossAQ) { spD4.x = D_i3_801C4308[76]; spD4.y = D_i3_801C4308[77]; // 76? spD4.z = D_i3_801C4308[78]; - func_effect_8007A6F0(&spD4, NA_SE_EN_WT_DISAPPEAR_L); + Effect_SpawnTimedSfxAtPos(&spD4, NA_SE_EN_WT_DISAPPEAR_L); bossAQ->swork[AQ_SWK_11] = 250.0f + RAND_FLOAT(50.0f); } } @@ -3225,7 +3225,7 @@ void Aquas_Boss_Update(Boss* bossAQ) { spD4.x = D_i3_801C4308[73 + 3 * i7]; spD4.y = D_i3_801C4308[74 + 3 * i7]; spD4.z = D_i3_801C4308[75 + 3 * i7]; - func_effect_8007A6F0(&spD4, NA_SE_EN_P_BALL_SHOT); + Effect_SpawnTimedSfxAtPos(&spD4, NA_SE_EN_P_BALL_SHOT); i2 = 0; for (i3 = 0; i2 <= i && i3 < ARRAY_COUNT(gActors); i3++) { if ((gActors[i3].obj.status == OBJ_FREE) && (i3 < ARRAY_COUNT(gActors))) { @@ -3357,7 +3357,7 @@ void Aquas_Boss_Update(Boss* bossAQ) { spD4.x = D_i3_801C4308[73 + 3 * i3]; spD4.y = D_i3_801C4308[74 + 3 * i3]; spD4.z = D_i3_801C4308[75 + 3 * i3]; - func_effect_8007A6F0(&spD4, NA_SE_EN_P_GUN_APPEAR); + Effect_SpawnTimedSfxAtPos(&spD4, NA_SE_EN_P_GUN_APPEAR); } if ((fabsf(D_i3_801C4308[10]) <= 3.0f) || (bossAQ->swork[AQ_SWK_10 + i3] == 0)) { Math_SmoothStepToF(&D_i3_801C4308[52 + i3], 1.0f, 0.1f, 0.5f, 0.0f); @@ -3753,7 +3753,7 @@ void Aquas_801B4E94(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_261 draw -void Aquas_801B504C(Actor* actor) { +void Aquas_Actor261_Draw(Actor* actor) { Vec3f jointTable[30]; Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); @@ -3767,7 +3767,7 @@ s32 D_i3_801C0264[19] = { }; // OBJ_ACTOR_261 action -void Aquas_801B50E8(Actor* actor) { +void Aquas_Actor261_Update(Actor* actor) { s32 i; Vec3f sp88; Vec3f sp7C; @@ -3781,7 +3781,7 @@ void Aquas_801B50E8(Actor* actor) { } actor->health = 0; actor->state = 7; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); } switch (actor->state) { @@ -4050,7 +4050,7 @@ f32 D_i3_801C02C8[2] = { 255.0f, 68.0f }; s32 D_i3_801C02D0[2] = { 70, 100 }; // OBJ_ACTOR_259 draw -void Aquas_801B619C(Actor* actor) { +void Aquas_Actor259_Draw(Actor* actor) { Vec3f sp40[30]; Matrix_Push(&gCalcMatrix); @@ -4079,7 +4079,7 @@ void Aquas_801B6344(Actor* actor) { } // OBJ_ACTOR_259 action -void Aquas_801B638C(Actor* actor) { +void Aquas_Actor259_Update(Actor* actor) { Actor* var_v0; s32 i; f32 spB4; @@ -4119,7 +4119,7 @@ void Aquas_801B638C(Actor* actor) { Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); AUDIO_PLAY_SFX(NA_SE_OB_MINI_BOMB, actor->sfxSource, 4); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); } actor->fwork[5] = (actor->obj.pos.y * 0.01f) + 2.5f; @@ -4285,7 +4285,7 @@ void Aquas_801B6E54(Actor* actor) { } // OBJ_ACTOR_262 action -void Aquas_801B6FF8(Actor* actor) { +void Aquas_Actor262_Update(Actor* actor) { s32 i; f32 temp_dx; f32 temp_dy; @@ -4305,7 +4305,7 @@ void Aquas_801B6FF8(Actor* actor) { func_effect_8007D0E0(actor->vwork[i].x, actor->vwork[i].y, actor->vwork[i].z + 100.0f, 6.0f); } Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); } switch (actor->state) { @@ -4506,7 +4506,7 @@ void Aquas_801B7754(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_262 draw -void Aquas_801B7A24(Actor* actor) { +void Aquas_Actor262_Draw(Actor* actor) { Vec3f sp30[30]; RCP_SetupDL(&gMasterDisp, SETUPDL_57); @@ -4544,7 +4544,7 @@ void Aquas_801B7AF0(Actor* actor) { } // OBJ_ACTOR_260 action -void Aquas_801B7C78(Actor* actor) { +void Aquas_Actor260_Update(Actor* actor) { s32 i; s32 j; f32 spAC; @@ -4584,7 +4584,7 @@ void Aquas_801B7C78(Actor* actor) { actor->itemDrop = DROP_SILVER_RING_25p; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); } if (actor->state != 6) { @@ -4951,7 +4951,7 @@ void Aquas_801B8D7C(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_260 draw -void Aquas_801B90DC(Actor* actor) { +void Aquas_Actor260_Draw(Actor* actor) { Vec3f sp30[30]; if ((actor->state >= 3) && (actor->state < 5)) { @@ -4965,7 +4965,7 @@ void Aquas_801B90DC(Actor* actor) { } // OBJ_ACTOR_263 action -void Aquas_801B91A4(Actor* actor) { +void Aquas_Actor263_Update(Actor* actor) { Vec3f spDC = { 0.0f, 0.0f, 50.0f }; Vec3f spD0; Vec3f spC4; @@ -5000,7 +5000,7 @@ void Aquas_801B91A4(Actor* actor) { func_effect_800815DC(); func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_AQ_ZAKO_DOWN); } switch (actor->state) { @@ -5085,7 +5085,7 @@ void Aquas_801B91A4(Actor* actor) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &spC4, &spAC); - func_effect_8007F04C(OBJ_EFFECT_353, actor->vwork[26].x + RAND_FLOAT_CENTERED(200.0f), + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, actor->vwork[26].x + RAND_FLOAT_CENTERED(200.0f), actor->vwork[26].y + RAND_FLOAT_CENTERED(200.0f), actor->vwork[26].z, spf98, sp94, 0.0f, 0.0f, 0.0f, 0.0f, spAC.x, spAC.y, spAC.z, 1.0f); } @@ -5121,9 +5121,10 @@ void Aquas_801B91A4(Actor* actor) { actor->vwork[11].y + RAND_FLOAT_CENTERED(50.0f), actor->vwork[11].z + RAND_FLOAT_CENTERED(100.0f), 2.0f, 0); Matrix_MultVec3fNoTranslate(gCalcMatrix, &spDC, &spD0); - func_effect_8007F04C(OBJ_EFFECT_353, actor->vwork[26].x + spD0.x, actor->vwork[26].y + spD0.y, - actor->vwork[26].z + spD0.z, actor->vwork[27].x, actor->fwork[2], - actor->vwork[27].z, 0.0f, 0.0f, 0.0f, spD0.x, spD0.y, spD0.z, 1.0f); + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, actor->vwork[26].x + spD0.x, + actor->vwork[26].y + spD0.y, actor->vwork[26].z + spD0.z, actor->vwork[27].x, + actor->fwork[2], actor->vwork[27].z, 0.0f, 0.0f, 0.0f, spD0.x, spD0.y, spD0.z, + 1.0f); } } break; @@ -5231,7 +5232,7 @@ void Aquas_801B9DB0(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_263 draw -void Aquas_801BA108(Actor* actor) { +void Aquas_Actor263_Draw(Actor* actor) { Vec3f sp40[30]; RCP_SetupDL(&gMasterDisp, SETUPDL_29); @@ -5254,7 +5255,7 @@ void Aquas_801BA108(Actor* actor) { } // OBJ_ACTOR_264 action -void Aquas_801BA26C(Actor* actor) { +void Aquas_Actor264_Update(Actor* actor) { Vec3f sp40[30]; u16 sp3E; @@ -5298,7 +5299,7 @@ void Aquas_801BA26C(Actor* actor) { } // OBJ_ACTOR_264 draw -void Aquas_801BA4E4(Actor* actor) { +void Aquas_Actor264_Draw(Actor* actor) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Animation_DrawSkeleton(1, D_AQ_6020C6C, actor->vwork, NULL, NULL, &actor->index, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -5321,7 +5322,7 @@ void Aquas_801BA57C(Actor* actor) { } // OBJ_ACTOR_265 action -void Aquas_801BA6A4(Actor* actor) { +void Aquas_Actor265_Update(Actor* actor) { s32 i; s32 var_s2; Actor* actor265; @@ -5418,20 +5419,20 @@ void Aquas_801BA6A4(Actor* actor) { func_effect_8007BC7C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 130.0f, actor->scale * 30.0f); func_effect_8007BC7C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 130.0f, actor->scale * 30.0f); Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); } } } // OBJ_ACTOR_265 draw -void Aquas_801BAD7C(Actor* actor) { +void Aquas_Actor265_Draw(Actor* actor) { Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_6014FD0); } // OBJ_ACTOR_266 action -void Aquas_801BADF8(Actor* actor) { +void Aquas_Actor266_Update(Actor* actor) { s32 i; switch (actor->state) { @@ -5501,7 +5502,7 @@ void Aquas_801BB0C4(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_266 draw -void Aquas_801BB204(Actor* actor) { +void Aquas_Actor266_Draw(Actor* actor) { Vec3f sp28[30]; Animation_GetFrameData(&D_AQ_601EC68, 0, sp28); @@ -5636,7 +5637,7 @@ void Aquas_801BB26C(Actor* actor) { } // OBJ_ACTOR_267 action -void Aquas_801BB79C(Actor* actor) { +void Aquas_Actor267_Update(Actor* actor) { s32 i; s32 it0; s32 it1; @@ -5729,7 +5730,7 @@ void Aquas_801BB79C(Actor* actor) { } if (((gGameFrameCount % 8) == 0)) { - func_effect_8007A6F0(&sp70->obj.pos, NA_SE_EN_WT_SPARK_BEAM); + Effect_SpawnTimedSfxAtPos(&sp70->obj.pos, NA_SE_EN_WT_SPARK_BEAM); } Aquas_801A92EC(actor, sp70->obj.pos.x, sp70->obj.pos.y, sp70->obj.pos.z, actor->iwork[13], i); @@ -5763,7 +5764,7 @@ void Aquas_801BB79C(Actor* actor) { } } if (((gGameFrameCount % 4) == 0)) { - func_effect_8007A6F0(&sp6C->obj.pos, NA_SE_EN_WT_SPARK_BEAM); + Effect_SpawnTimedSfxAtPos(&sp6C->obj.pos, NA_SE_EN_WT_SPARK_BEAM); } Aquas_801A92EC(actor, sp6C->obj.pos.x, sp6C->obj.pos.y, sp6C->obj.pos.z, actor->iwork[13] + 1, i); @@ -5799,7 +5800,7 @@ void Aquas_801BB79C(Actor* actor) { } if (((gGameFrameCount % 16) == 0)) { - func_effect_8007A6F0(&sp70->obj.pos, NA_SE_EN_WT_SPARK_BEAM); + Effect_SpawnTimedSfxAtPos(&sp70->obj.pos, NA_SE_EN_WT_SPARK_BEAM); } Aquas_801A92EC(actor, sp70->obj.pos.x, sp70->obj.pos.y, sp70->obj.pos.z, actor->iwork[13] + 2, i); @@ -6010,7 +6011,7 @@ void Aquas_801BC91C(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_267 draw -void Aquas_801BC930(Actor* actor) { +void Aquas_Actor267_Draw(Actor* actor) { Vec3f sp28[30]; Animation_GetFrameData(&D_AQ_6023780, actor->animFrame, sp28); @@ -6023,7 +6024,7 @@ s32 D_i3_801C04C4[9] = { }; // OBJ_ACTOR_269 action -void Aquas_801BC9A0(Actor* actor) { +void Aquas_Actor269_Update(Actor* actor) { s32 j; s32 i; Vec3f spA4; @@ -6148,7 +6149,7 @@ void Aquas_801BC9A0(Actor* actor) { actor->itemDrop = D_i3_801C04C4[actor->iwork[1]]; Actor_Despawn(actor); Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_AQ_PILLAR_BROKE); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_OB_AQ_PILLAR_BROKE); } break; @@ -6164,7 +6165,7 @@ void Aquas_801BC9A0(Actor* actor) { if ((actor->obj.pos.y < (gGroundHeight + 30.0f)) && (actor->iwork[2] == 0)) { actor->iwork[2] = 1; actor->vel.x = actor->vel.y = actor->vel.z = actor->gravity = 0.0f; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_AQ_ROCK_BOUND); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_OB_AQ_ROCK_BOUND); for (j = 0; j < 6; j++) { func_effect_8007B8F8(actor->obj.pos.x + RAND_FLOAT_CENTERED(100.0f), actor->obj.pos.y + RAND_RANGE(-9.0f, 21.0f), @@ -6200,7 +6201,7 @@ void Aquas_801BD17C(s32 limbIndex, Vec3f* rot, void* thisx) { } // OBJ_ACTOR_269 draw -void Aquas_801BD264(Actor* actor) { +void Aquas_Actor269_Draw(Actor* actor) { Vec3f sp40[30]; if (actor->state != 0) { @@ -6259,7 +6260,7 @@ void Aquas_801BD3B0(Actor* actor, f32 x, f32 y, f32 z) { f32 D_i3_801C04F4[4] = { 700.0f, 300.0f, 600.0f, 400.0f }; // OBJ_ACTOR_268 action -void Aquas_801BD54C(Actor* actor) { +void Aquas_Actor268_Update(Actor* actor) { s32 sp6C; s32 sp68; s32 sp64; @@ -6438,7 +6439,7 @@ bool Aquas_801BDDFC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* th } // OBJ_ACTOR_268 draw -void Aquas_801BDE6C(Actor* actor) { +void Aquas_Actor268_Draw(Actor* actor) { Animation_GetFrameData(&D_AQ_60135E0, actor->animFrame, actor->vwork); if (actor->iwork[3] == 0) { Animation_DrawSkeleton(1, D_AQ_60136CC, actor->vwork, Aquas_801BDDFC, NULL, actor, &gIdentityMatrix); @@ -6531,7 +6532,7 @@ void Aquas_801BE0F0(Actor* actor) { } // OBJ_SCENERY_126 draw -void Aquas_801BE1FC(Scenery* scenery) { +void Aquas_Scenery126_Draw(Scenery* scenery) { Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_600EEF0); @@ -6564,7 +6565,7 @@ void Aquas_801BE274(Actor* actor, f32 yRot, f32 xRot) { } // OBJ_ACTOR_270 action -void Aquas_801BE3F8(Actor* actor) { +void Aquas_Actor270_Update(Actor* actor) { s32 i; f32 sp68; f32 sp64; @@ -6666,7 +6667,7 @@ void Aquas_801BE3F8(Actor* actor) { } // OBJ_ACTOR_270 draw -void Aquas_801BEB1C(Actor* actor) { +void Aquas_Actor270_Draw(Actor* actor) { Graphics_SetScaleMtx(3.0f); RCP_SetupDL(&gMasterDisp, SETUPDL_56); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 143, 143, 255); @@ -6691,11 +6692,11 @@ void Aquas_Boss301_Draw(Boss* boss301) { } // OBJ_ACTOR_188 action -void Aquas_801BEC68(Actor* actor) { +void Aquas_Actor188_Update(Actor* actor) { } // OBJ_ACTOR_188 draw -void Aquas_801BEC74(Actor* actor) { +void Aquas_Actor188_Draw(Actor* actor) { } void Aquas_Update360(Player* player) { diff --git a/src/overlays/ovl_i3/fox_so.c b/src/overlays/ovl_i3/fox_so.c index 6cdd7512..2b9f8a5b 100644 --- a/src/overlays/ovl_i3/fox_so.c +++ b/src/overlays/ovl_i3/fox_so.c @@ -8,7 +8,7 @@ #include "assets/ast_bg_planet.h" #include "assets/ast_solar.h" -typedef void (*BossSOfunc)(Boss*); +typedef void (*BossSOfunc)(BossSO*); typedef enum { /* 0 */ SO_SWK_0, @@ -162,36 +162,38 @@ typedef enum { /* 50 */ SO_VWK_MAX, } BossSOvwork; -void Solar_801A239C(Boss* bossSO); -void Solar_801A2C3C(Boss* bossSO); -void Solar_801A3468(Boss* bossSO); -void Solar_801A48B8(Boss* bossSO); -void Solar_801A4EC0(Boss* bossSO); +void Solar_801A239C(BossSO* this); +void Solar_801A2C3C(BossSO* this); +void Solar_801A3468(BossSO* this); +void Solar_801A48B8(BossSO* this); +void Solar_801A4EC0(BossSO* this); void Solar_801A8DB8(Vec3f* pos, u32 sfxId, f32 zVel); s32 D_i3_801C2740[10]; f32 D_i3_801C2768[14]; s32 D_i3_801C27A0[8]; // unused? part of previous? -void Solar_8019E7F0(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { - Effect_Initialize(effect); - effect->obj.status = OBJ_ACTIVE; - effect->obj.id = OBJ_EFFECT_392; - effect->state = 3; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->obj.rot.z = 180.0f; +void Solar_8019E7F0(Effect392* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { + Effect_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_EFFECT_392; + this->state = 3; + + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + + this->obj.rot.z = 180.0f; if (Rand_ZeroOne() < 0.5f) { - effect->obj.rot.y = 180.0f; + this->obj.rot.y = 180.0f; } - effect->unk_44 = 112; - effect->scale2 = scale2; - effect->vel.y = 5.0f; - Object_SetInfo(&effect->info, effect->obj.id); - effect->info.unk_14 = 0; + this->unk_44 = 112; + this->scale2 = scale2; + this->vel.y = 5.0f; + Object_SetInfo(&this->info, this->obj.id); + this->info.unk_14 = 0; } void Solar_8019E8B8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { @@ -205,25 +207,27 @@ void Solar_8019E8B8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void Solar_8019E920(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 state) { - Effect_Initialize(effect); - effect->obj.status = OBJ_ACTIVE; - effect->obj.id = OBJ_EFFECT_392; - effect->state = state; +void Solar_8019E920(Effect392* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, + s32 state) { + Effect_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_EFFECT_392; + + this->state = state; if (state == 2) { - effect->timer_50 = 30; - effect->unk_4C = 3; + this->timer_50 = 30; + this->unk_4C = 3; } - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->vel.x = xVel; - effect->vel.y = yVel; - effect->vel.z = zVel; - effect->obj.rot.z = RAND_FLOAT(360.0f); - effect->unk_44 = 176; - effect->scale2 = scale2; - Object_SetInfo(&effect->info, effect->obj.id); + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->obj.rot.z = RAND_FLOAT(360.0f); + this->unk_44 = 176; + this->scale2 = scale2; + Object_SetInfo(&this->info, this->obj.id); } void Solar_8019E9F4(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale2, s32 unk4E) { @@ -237,106 +241,106 @@ void Solar_8019E9F4(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, } } -void Solar_8019EA7C(Actor* actor) { +void Solar_Actor278_Update(Actor278* this) { f32 sp34; s32 sp30; - if (actor->state == 0) { - actor->vel.z = 20.0f - gPathVelZ; - actor->fwork[0] = 12.0f; + if (this->state == 0) { + this->vel.z = 20.0f - gPathVelZ; + this->fwork[0] = 12.0f; } else { - actor->vel.z = actor->fwork[1] - gPathVelZ; - if (actor->state == 2) { - Math_SmoothStepToF(&actor->obj.pos.x, gPlayer[0].pos.x, 1.0f, 100.0f, 10.0f); + this->vel.z = this->fwork[1] - gPathVelZ; + if (this->state == 2) { + Math_SmoothStepToF(&this->obj.pos.x, gPlayer[0].pos.x, 1.0f, 100.0f, 10.0f); } else { - actor->fwork[0] = 14.0f; + this->fwork[0] = 14.0f; } } - if ((actor->unk_046 == 0) || (actor->unk_046 == 1)) { - actor->unk_046 = 3; - Object_SetSfxSourceToPos(actor->sfxSource, &actor->obj.pos); - AUDIO_PLAY_SFX(NA_SE_OB_MAGMA_WAVE, actor->sfxSource, 0); + if ((this->unk_046 == 0) || (this->unk_046 == 1)) { + this->unk_046 = 3; + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_OB_MAGMA_WAVE, this->sfxSource, 0); } - if (Play_CheckDynaFloorCollision(&sp34, &sp30, actor->obj.pos.x, -100.0f, actor->obj.pos.z)) { - D_ctx_801782EC[sp30] = actor->fwork[0]; - D_ctx_801782EC[sp30 + 1] = actor->fwork[0] * 0.95f; - D_ctx_801782EC[sp30 - 1] = actor->fwork[0] * 0.95f; - D_ctx_801782EC[sp30 + 2] = actor->fwork[0] * 0.9f; - D_ctx_801782EC[sp30 - 2] = actor->fwork[0] * 0.9f; - D_ctx_801782EC[sp30 + 3] = actor->fwork[0] * 0.8f; - D_ctx_801782EC[sp30 - 3] = actor->fwork[0] * 0.8f; + if (Play_CheckDynaFloorCollision(&sp34, &sp30, this->obj.pos.x, -100.0f, this->obj.pos.z)) { + D_ctx_801782EC[sp30] = this->fwork[0]; + D_ctx_801782EC[sp30 + 1] = this->fwork[0] * 0.95f; + D_ctx_801782EC[sp30 - 1] = this->fwork[0] * 0.95f; + D_ctx_801782EC[sp30 + 2] = this->fwork[0] * 0.9f; + D_ctx_801782EC[sp30 - 2] = this->fwork[0] * 0.9f; + D_ctx_801782EC[sp30 + 3] = this->fwork[0] * 0.8f; + D_ctx_801782EC[sp30 - 3] = this->fwork[0] * 0.8f; - if (actor->state != 2) { - D_ctx_801782EC[sp30 + 4] = actor->fwork[0] * 0.65f; - D_ctx_801782EC[sp30 - 4] = actor->fwork[0] * 0.65f; - D_ctx_801782EC[sp30 + 5] = actor->fwork[0] * 0.45f; - D_ctx_801782EC[sp30 - 5] = actor->fwork[0] * 0.45f; - D_ctx_801782EC[sp30 + 6] = actor->fwork[0] * 0.2f; - D_ctx_801782EC[sp30 - 6] = actor->fwork[0] * 0.2f; - D_ctx_801782EC[sp30 + 7] = actor->fwork[0] * 0.1f; - D_ctx_801782EC[sp30 - 7] = actor->fwork[0] * 0.1f; + if (this->state != 2) { + D_ctx_801782EC[sp30 + 4] = this->fwork[0] * 0.65f; + D_ctx_801782EC[sp30 - 4] = this->fwork[0] * 0.65f; + D_ctx_801782EC[sp30 + 5] = this->fwork[0] * 0.45f; + D_ctx_801782EC[sp30 - 5] = this->fwork[0] * 0.45f; + D_ctx_801782EC[sp30 + 6] = this->fwork[0] * 0.2f; + D_ctx_801782EC[sp30 - 6] = this->fwork[0] * 0.2f; + D_ctx_801782EC[sp30 + 7] = this->fwork[0] * 0.1f; + D_ctx_801782EC[sp30 - 7] = this->fwork[0] * 0.1f; } else { - D_ctx_801782EC[sp30 + 4] = actor->fwork[0] * 0.75f; - D_ctx_801782EC[sp30 - 4] = actor->fwork[0] * 0.75f; - D_ctx_801782EC[sp30 + 5] = actor->fwork[0] * 0.7f; - D_ctx_801782EC[sp30 - 5] = actor->fwork[0] * 0.7f; - D_ctx_801782EC[sp30 + 6] = actor->fwork[0] * 0.65f; - D_ctx_801782EC[sp30 - 6] = actor->fwork[0] * 0.65f; - D_ctx_801782EC[sp30 + 7] = actor->fwork[0] * 0.6f; - D_ctx_801782EC[sp30 - 7] = actor->fwork[0] * 0.6f; - D_ctx_801782EC[sp30 + 8] = actor->fwork[0] * 0.55f; - D_ctx_801782EC[sp30 - 8] = actor->fwork[0] * 0.55f; - D_ctx_801782EC[sp30 + 9] = actor->fwork[0] * 0.4f; - D_ctx_801782EC[sp30 - 9] = actor->fwork[0] * 0.4f; - D_ctx_801782EC[sp30 + 10] = actor->fwork[0] * 0.3f; - D_ctx_801782EC[sp30 - 10] = actor->fwork[0] * 0.3f; - D_ctx_801782EC[sp30 + 11] = actor->fwork[0] * 0.2f; - D_ctx_801782EC[sp30 - 11] = actor->fwork[0] * 0.2f; - D_ctx_801782EC[sp30 + 12] = actor->fwork[0] * 0.1f; - D_ctx_801782EC[sp30 - 12] = actor->fwork[0] * 0.1f; + D_ctx_801782EC[sp30 + 4] = this->fwork[0] * 0.75f; + D_ctx_801782EC[sp30 - 4] = this->fwork[0] * 0.75f; + D_ctx_801782EC[sp30 + 5] = this->fwork[0] * 0.7f; + D_ctx_801782EC[sp30 - 5] = this->fwork[0] * 0.7f; + D_ctx_801782EC[sp30 + 6] = this->fwork[0] * 0.65f; + D_ctx_801782EC[sp30 - 6] = this->fwork[0] * 0.65f; + D_ctx_801782EC[sp30 + 7] = this->fwork[0] * 0.6f; + D_ctx_801782EC[sp30 - 7] = this->fwork[0] * 0.6f; + D_ctx_801782EC[sp30 + 8] = this->fwork[0] * 0.55f; + D_ctx_801782EC[sp30 - 8] = this->fwork[0] * 0.55f; + D_ctx_801782EC[sp30 + 9] = this->fwork[0] * 0.4f; + D_ctx_801782EC[sp30 - 9] = this->fwork[0] * 0.4f; + D_ctx_801782EC[sp30 + 10] = this->fwork[0] * 0.3f; + D_ctx_801782EC[sp30 - 10] = this->fwork[0] * 0.3f; + D_ctx_801782EC[sp30 + 11] = this->fwork[0] * 0.2f; + D_ctx_801782EC[sp30 - 11] = this->fwork[0] * 0.2f; + D_ctx_801782EC[sp30 + 12] = this->fwork[0] * 0.1f; + D_ctx_801782EC[sp30 - 12] = this->fwork[0] * 0.1f; } } - switch (actor->dmgType) { + switch (this->dmgType) { case 3: - Solar_801A8DB8(&actor->obj.pos, NA_SE_OB_MAGMA_WAVE, actor->vel.z); + Solar_801A8DB8(&this->obj.pos, NA_SE_OB_MAGMA_WAVE, this->vel.z); /* fallthrough */ case 2: - Object_Kill(&actor->obj, actor->sfxSource); + Object_Kill(&this->obj, this->sfxSource); break; } } -void Solar_8019EF30(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_275; +void Solar_8019EF30(Actor* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_275; if (Rand_ZeroOne() < 0.1f) { - actor->obj.id = OBJ_ACTOR_276; + this->obj.id = OBJ_ACTOR_276; } - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - actor->rot_0F4.x = RAND_FLOAT(360.0f); + this->rot_0F4.x = RAND_FLOAT(360.0f); - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - actor->state = 2; - actor->timer_0C2 = 8; + this->state = 2; + this->timer_0C2 = 8; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); if (gBossActive) { - actor->info.bonus = 0; + this->info.bonus = 0; } - AUDIO_PLAY_SFX(NA_SE_OB_SOROCK_APPEAR, actor->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_OB_SOROCK_APPEAR, this->sfxSource, 0); } void Solar_8019F038(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) { @@ -350,26 +354,27 @@ void Solar_8019F038(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) } } -void Solar_8019F0B0(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_277; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->rot_0F4.x = RAND_FLOAT(360.0f); - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; - actor->state = 2; - actor->timer_0C2 = 8; +void Solar_8019F0B0(Actor277* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_277; - Object_SetInfo(&actor->info, actor->obj.id); + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->rot_0F4.x = RAND_FLOAT(360.0f); + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->state = 2; + this->timer_0C2 = 8; + + Object_SetInfo(&this->info, this->obj.id); if (gBossActive) { - actor->info.bonus = 0; + this->info.bonus = 0; } - AUDIO_PLAY_SFX(NA_SE_OB_SOROCK_APPEAR, actor->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_OB_SOROCK_APPEAR, this->sfxSource, 0); } void Solar_8019F194(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel) { @@ -403,116 +408,119 @@ Vec3f D_i3_801BF95C[3] = { { 180.0f, 0.0f, 240.0f }, }; -void Solar_8019F20C(Actor* actor) { +// Actors OBJ_ACTOR_275 to OBJ_ACTOR_277 +void Solar_Doodad_Update(Actor* this) { f32 sp8C = 0.0f; s32 sp88; s32 i; - if (actor->obj.id == OBJ_ACTOR_277) { - actor->scale = 2.0f; + if (this->obj.id == OBJ_ACTOR_277) { + this->scale = 2.0f; } - if (actor->obj.id == OBJ_ACTOR_276) { - actor->rot_0F4.x -= 6.6f; - actor->rot_0F4.y -= 4.0f; - + if (this->obj.id == OBJ_ACTOR_276) { + this->rot_0F4.x -= 6.6f; + this->rot_0F4.y -= 4.0f; } else { - actor->rot_0F4.x += 3.3f; - actor->rot_0F4.y += 2.0f; + this->rot_0F4.x += 3.3f; + this->rot_0F4.y += 2.0f; } - switch (actor->state) { + switch (this->state) { case 0: - actor->fwork[0] = actor->obj.pos.y * 0.05f; - actor->obj.pos.y = -100.0f; + this->fwork[0] = this->obj.pos.y * 0.05f; + this->obj.pos.y = -100.0f; /* fallthrough */ case 1: - actor->state = 2; - actor->vel.y = actor->fwork[0]; - Play_CheckDynaFloorCollision(&sp8C, &sp88, actor->obj.pos.x, actor->obj.pos.y - 100.0f, actor->obj.pos.z); - actor->obj.pos.y = sp8C; + this->state = 2; + this->vel.y = this->fwork[0]; + Play_CheckDynaFloorCollision(&sp8C, &sp88, this->obj.pos.x, this->obj.pos.y - 100.0f, this->obj.pos.z); + this->obj.pos.y = sp8C; for (i = 0; i < 4; i++) { - Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, D_i3_801BF8E0[i], - RAND_FLOAT(10.0f) + 10.0f, 0.0f, actor->scale * 5.0f, 1); + Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_i3_801BF8E0[i], + RAND_FLOAT(10.0f) + 10.0f, 0.0f, this->scale * 5.0f, 1); } - actor->timer_0C2 = 5; - AUDIO_PLAY_SFX(NA_SE_OB_SOROCK_APPEAR, actor->sfxSource, 0); + this->timer_0C2 = 5; + AUDIO_PLAY_SFX(NA_SE_OB_SOROCK_APPEAR, this->sfxSource, 0); break; case 2: - actor->gravity = 0.5f; - if (Play_CheckDynaFloorCollision(&sp8C, &sp88, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z)) { - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_SOROCK_DISAPPEAR); + this->gravity = 0.5f; + + if (Play_CheckDynaFloorCollision(&sp8C, &sp88, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_SOROCK_DISAPPEAR); for (i = 0; i < 4; i++) { - Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, D_i3_801BF8E0[i], - RAND_FLOAT(10.0f) + 10.0f, 0.0f, actor->scale * 5.0f, 1); + Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_i3_801BF8E0[i], + RAND_FLOAT(10.0f) + 10.0f, 0.0f, this->scale * 5.0f, 1); } } - if (actor->timer_0BC == 0) { - actor->timer_0BC = 5; - Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, - actor->scale * 6.5f, 2); + if (this->timer_0BC == 0) { + this->timer_0BC = 5; + Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, this->scale * 6.5f, + 2); } - if ((actor->dmgType != DMG_NONE) || ((actor->obj.id == OBJ_ACTOR_277) && (actor->vel.y < 0.0f))) { - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, actor->scale * 4.0f); - Object_Kill(&actor->obj, actor->sfxSource); - if (actor->obj.id == OBJ_ACTOR_277) { + if ((this->dmgType != DMG_NONE) || ((this->obj.id == OBJ_ACTOR_277) && (this->vel.y < 0.0f))) { + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale * 4.0f); + Object_Kill(&this->obj, this->sfxSource); + + if (this->obj.id == OBJ_ACTOR_277) { for (i = 0; i < 4; i++) { - Solar_8019F038(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, + Solar_8019F038(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, D_i3_801BF8F0[i].x + RAND_FLOAT_CENTERED(3.0f), D_i3_801BF8F0[i].y + RAND_FLOAT_CENTERED(3.0f), RAND_FLOAT(-10.0f) - 10.0f); } - } else if (actor->obj.id == OBJ_ACTOR_275) { - actor->itemDrop = DROP_SILVER_RING; - } else if (actor->obj.id == OBJ_ACTOR_276) { + } else if (this->obj.id == OBJ_ACTOR_275) { + this->itemDrop = DROP_SILVER_RING; + } else if (this->obj.id == OBJ_ACTOR_276) { if (gGoldRingCount[0] != 4) { - actor->itemDrop = DROP_GOLD_RING_1; + this->itemDrop = DROP_GOLD_RING_1; } else { - actor->itemDrop = DROP_SILVER_STAR; + this->itemDrop = DROP_SILVER_STAR; } } - Actor_Despawn(actor); + Actor_Despawn(this); for (i = 0; i < 3; i++) { - func_effect_800794CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.3f); + func_effect_800794CC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.3f); } for (i = 0; i < 7; i++) { - Solar_8019E9F4(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, RAND_FLOAT_CENTERED(30.0f), - RAND_FLOAT_CENTERED(30.0f), 0.0f, (RAND_FLOAT(2.0f) + 2.0f) * actor->scale, 1); + Solar_8019E9F4(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, RAND_FLOAT_CENTERED(30.0f), + RAND_FLOAT_CENTERED(30.0f), 0.0f, (RAND_FLOAT(2.0f) + 2.0f) * this->scale, 1); } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } break; } - actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); - actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); + this->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + this->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); - if (((gGameFrameCount % 2) == 0)) { - actor->animFrame++; - if (actor->animFrame >= 3) { - actor->animFrame = 0; + if ((gGameFrameCount % 2) == 0) { + this->animFrame++; + if (this->animFrame >= 3) { + this->animFrame = 0; } } } -void Solar_8019F7AC(Actor* actor) { - if (actor->state != 0) { +// Actors OBJ_ACTOR_275 to OBJ_ACTOR_277 +void Solar_Doodad_Draw(Actor* this) { + if (this->state != 0) { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, actor->rot_0F4.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, actor->rot_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->rot_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->rot_0F4.x * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - switch (actor->obj.id) { + switch (this->obj.id) { case OBJ_ACTOR_275: gSPDisplayList(gMasterDisp++, D_SO_6017370); break; case OBJ_ACTOR_276: - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_41); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); } @@ -525,36 +533,37 @@ void Solar_8019F7AC(Actor* actor) { } Matrix_Pop(&gGfxMatrix); - Graphics_SetScaleMtx(actor->scale * 3.5f); + Graphics_SetScaleMtx(this->scale * 3.5f); RCP_SetupDL(&gMasterDisp, SETUPDL_64); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, 160); - gSPDisplayList(gMasterDisp++, D_i3_801BF92C[actor->animFrame]); + gSPDisplayList(gMasterDisp++, D_i3_801BF92C[this->animFrame]); } } -void Solar_8019F99C(Actor* actor, Effect* effect, f32 scale1) { +void Solar_8019F99C(Actor279* this, Effect392* effect, f32 scale1) { Effect_Initialize(effect); effect->obj.status = OBJ_ACTIVE; effect->obj.id = OBJ_EFFECT_392; - effect->obj.pos.x = effect->vel.x = actor->obj.pos.x; + + effect->obj.pos.x = effect->vel.x = this->obj.pos.x; effect->obj.pos.y = -2000.0f; - effect->vel.y = actor->obj.pos.y; - effect->obj.pos.z = effect->vel.z = actor->obj.pos.z; + effect->vel.y = this->obj.pos.y; + effect->obj.pos.z = effect->vel.z = this->obj.pos.z; effect->scale1 = scale1; - effect->unk_60.y = actor->obj.rot.y; + effect->unk_60.y = this->obj.rot.y; effect->obj.rot.z = RAND_FLOAT(360.0f); - effect->unk_44 = 255 - (actor->counter_04E * 8); + effect->unk_44 = 255 - (this->counter_04E * 8); if (effect->unk_44 < 0) { effect->unk_44 = 0; } - effect->scale2 = 20.0f - (actor->counter_04E * 0.5f); + effect->scale2 = 20.0f - (this->counter_04E * 0.5f); effect->unk_48 = 1; Object_SetInfo(&effect->info, effect->obj.id); } -void Solar_8019FAA4(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yVel, f32 hVelMod) { +void Solar_8019FAA4(BossSO* this, Effect392* effect, f32 xPos, f32 yPos, f32 zPos, f32 yVel, f32 hVelMod) { Vec3f sp44; Vec3f sp38; Vec3f sp2C = D_i3_801BF920; @@ -583,19 +592,19 @@ void Solar_8019FAA4(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, effect->vel.x = sp38.x * hVelMod; effect->vel.z = gPlayer[0].vel.z + (sp38.z * hVelMod); } else { - Matrix_RotateZ(gCalcMatrix, bossSO->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, gBosses[0].rot_078.y * M_DTOR, MTXF_APPLY); - sp44.x = effect->obj.pos.x - bossSO->obj.pos.x; - sp44.y = effect->obj.pos.y - bossSO->obj.pos.y; - sp44.z = effect->obj.pos.z - bossSO->obj.pos.z; + sp44.x = effect->obj.pos.x - this->obj.pos.x; + sp44.y = effect->obj.pos.y - this->obj.pos.y; + sp44.z = effect->obj.pos.z - this->obj.pos.z; Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38); - effect->obj.pos.x = bossSO->obj.pos.x + sp38.x; - effect->obj.pos.y = bossSO->obj.pos.y + sp38.y; - effect->obj.pos.z = bossSO->obj.pos.z + sp38.z; + effect->obj.pos.x = this->obj.pos.x + sp38.x; + effect->obj.pos.y = this->obj.pos.y + sp38.y; + effect->obj.pos.z = this->obj.pos.z + sp38.z; effect->vel.z = gPlayer[0].vel.z; effect->vel.y = yVel; @@ -611,7 +620,7 @@ void Solar_8019FAA4(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, effect->vel.x = RAND_FLOAT_CENTERED(30.0f); effect->vel.z = RAND_FLOAT_CENTERED(30.0f); } - effect->unk_60.y = bossSO->obj.rot.y; + effect->unk_60.y = this->obj.rot.y; effect->unk_60.x = 90.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); effect->unk_44 = 255; @@ -621,7 +630,7 @@ void Solar_8019FAA4(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, Object_SetInfo(&effect->info, effect->obj.id); } -void Solar_8019FDE0(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 state) { +void Solar_8019FDE0(BossSO* this, Effect392* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 state) { Effect_Initialize(effect); effect->obj.status = OBJ_ACTIVE; effect->obj.id = OBJ_EFFECT_392; @@ -636,7 +645,7 @@ void Solar_8019FDE0(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, effect->vel.z = gPlayer[0].vel.z + 15.0f; } effect->scale2 = scale2; - effect->unk_60.y = bossSO->obj.rot.y; + effect->unk_60.y = this->obj.rot.y; effect->unk_60.x = 0.0f; effect->obj.rot.z = RAND_FLOAT(360.0f); effect->unk_44 = 255; @@ -646,65 +655,65 @@ void Solar_8019FDE0(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, effect->info.damage = 40; } -void Solar_8019FEE8(Actor* actor, f32 scale1) { +void Solar_8019FEE8(Actor279* this, f32 scale1) { s32 i; for (i = 70; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { - Solar_8019F99C(actor, &gEffects[i], scale1); + Solar_8019F99C(this, &gEffects[i], scale1); break; } } } -void Solar_8019FF44(Boss* bossSO, f32 xPos, f32 yPos, f32 zPos, f32 yVel, f32 hVelMod) { +void Solar_8019FF44(BossSO* this, f32 xPos, f32 yPos, f32 zPos, f32 yVel, f32 hVelMod) { s32 i; for (i = 70; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { - Solar_8019FAA4(bossSO, &gEffects[i], xPos, yPos, zPos, yVel, hVelMod); + Solar_8019FAA4(this, &gEffects[i], xPos, yPos, zPos, yVel, hVelMod); break; } } } -void Solar_8019FFC0(Boss* bossSO, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 unk4E) { +void Solar_8019FFC0(BossSO* this, f32 xPos, f32 yPos, f32 zPos, f32 scale2, s32 unk4E) { s32 i; for (i = 70; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { - Solar_8019FDE0(bossSO, &gEffects[i], xPos, yPos, zPos, scale2, unk4E); + Solar_8019FDE0(this, &gEffects[i], xPos, yPos, zPos, scale2, unk4E); break; } } } -void Solar_801A003C(Actor* actor) { - switch (actor->state) { +void Solar_Actor279_Update(Actor279* this) { + switch (this->state) { case 0: - if (actor->timer_0BE == 0) { - actor->state = 1; - actor->timer_0BE = 50; - } else if (actor->timer_0BC == 0) { - actor->timer_0BC = 2; - Solar_8019FEE8(actor, 1000.0f); - actor->counter_04E++; + if (this->timer_0BE == 0) { + this->state = 1; + this->timer_0BE = 50; + } else if (this->timer_0BC == 0) { + this->timer_0BC = 2; + Solar_8019FEE8(this, 1000.0f); + this->counter_04E++; } break; case 1: - if (actor->timer_0BE == 0) { - actor->state = 0; - actor->timer_0BE = 50; - actor->counter_04E = 0; - Object_SetSfxSourceToPos(actor->sfxSource, &actor->obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, actor->sfxSource, 4); + if (this->timer_0BE == 0) { + this->state = 0; + this->timer_0BE = 50; + this->counter_04E = 0; + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, this->sfxSource, 4); } break; } } -void Solar_801A0120(Effect* effect) { +void Solar_Effect392_Update(Effect392* this) { f32 sp5C; f32 sp58; f32 sp54; @@ -713,165 +722,165 @@ void Solar_801A0120(Effect* effect) { s32 sp48; Vec3f sp3C; - switch (effect->state) { + switch (this->state) { case 0: - Matrix_Translate(gCalcMatrix, effect->vel.x, effect->vel.y, effect->vel.z, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, effect->unk_60.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, effect->unk_60.x * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, this->vel.x, this->vel.y, this->vel.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->unk_60.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->unk_60.x * M_DTOR, MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; - sp3C.z = -effect->scale1; + sp3C.z = -this->scale1; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &effect->obj.pos); + Matrix_MultVec3f(gCalcMatrix, &sp3C, &this->obj.pos); - effect->unk_60.x += 5.0f; + this->unk_60.x += 5.0f; if ((gGameFrameCount % 2) == 0) { - effect->unk_4C++; - if (effect->unk_4C > 2) { - effect->unk_4C = 0; + this->unk_4C++; + if (this->unk_4C > 2) { + this->unk_4C = 0; } } if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { - func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 12.0f); + func_effect_8007A774(&gPlayer[0], this, this->scale2 * 12.0f); } - if (effect->unk_60.x > 190.0f) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->unk_60.x > 190.0f) { + Object_Kill(&this->obj, this->sfxSource); } - sp48 = effect->unk_48; + sp48 = this->unk_48; - if (Play_CheckDynaFloorCollision(&sp5C, &sp4C, effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z)) { - effect->unk_48 = 1; - if (effect->scale2 == 20.0f) { - AUDIO_PLAY_SFX(NA_SE_EN_IN_PROMINENCE, effect->sfxSource, 4); + if (Play_CheckDynaFloorCollision(&sp5C, &sp4C, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + this->unk_48 = 1; + if (this->scale2 == 20.0f) { + AUDIO_PLAY_SFX(NA_SE_EN_IN_PROMINENCE, this->sfxSource, 4); } } else { - effect->unk_48 = 0; + this->unk_48 = 0; } - if (sp48 != effect->unk_48) { - if (effect->unk_48 != 0) { + if (sp48 != this->unk_48) { + if (this->unk_48 != 0) { sp54 = 50.0f; } else { sp54 = -50.0f; } - if ((effect->index % 2) != 0) { + if ((this->index % 2) != 0) { sp58 = 100.0f; } else { sp58 = -100.0f; } - Solar_8019E9F4(effect->obj.pos.x + sp58, effect->obj.pos.y + sp54, effect->obj.pos.z, sp58 * 0.25f, + Solar_8019E9F4(this->obj.pos.x + sp58, this->obj.pos.y + sp54, this->obj.pos.z, sp58 * 0.25f, RAND_FLOAT(10.0f) + 20.0f, sp58 * 0.25f, 20.0f, 1); } break; case 1: - if (effect->timer_50 == 0) { - effect->timer_50 = 4; - effect->unk_4C++; - if (effect->unk_4C >= 6) { - effect->unk_4C = 0; - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + this->timer_50 = 4; + this->unk_4C++; + if (this->unk_4C >= 6) { + this->unk_4C = 0; + Object_Kill(&this->obj, this->sfxSource); } } - if (effect->scale2 > 10.0f) { - effect->vel.y -= 2.5f; - } else if (effect->scale2 > 4.0f) { - effect->vel.y -= 1.0f; + if (this->scale2 > 10.0f) { + this->vel.y -= 2.5f; + } else if (this->scale2 > 4.0f) { + this->vel.y -= 1.0f; } break; case 2: - if (effect->timer_50 == 0) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->timer_50 == 0) { + Object_Kill(&this->obj, this->sfxSource); } - Math_SmoothStepToF(&effect->scale2, 0.0f, 0.1f, 0.2f, 0.0f); - effect->obj.rot.z += 3.0f; - effect->vel.y -= 0.3f; + Math_SmoothStepToF(&this->scale2, 0.0f, 0.1f, 0.2f, 0.0f); + this->obj.rot.z += 3.0f; + this->vel.y -= 0.3f; break; case 3: - Math_SmoothStepToF(&effect->obj.rot.z, -190.0f, 1.0f, 10.0f, 0.0f); - effect->vel.y -= 0.3f; - if (effect->obj.rot.z <= -180.0f) { - Object_Kill(&effect->obj, effect->sfxSource); + Math_SmoothStepToF(&this->obj.rot.z, -190.0f, 1.0f, 10.0f, 0.0f); + this->vel.y -= 0.3f; + if (this->obj.rot.z <= -180.0f) { + Object_Kill(&this->obj, this->sfxSource); } break; case 4: if (gBosses[0].swork[SO_SWK_0] != 7) { - Math_SmoothStepToF(&effect->vel.y, -40.0f, 1.0f, 1.0f, 1.0f); + Math_SmoothStepToF(&this->vel.y, -40.0f, 1.0f, 1.0f, 1.0f); } else { - effect->vel.z = gPlayer[0].vel.z; - Math_SmoothStepToF(&effect->vel.y, -65.0f, 2.0f, 1.0f, 0.5f); + this->vel.z = gPlayer[0].vel.z; + Math_SmoothStepToF(&this->vel.y, -65.0f, 2.0f, 1.0f, 0.5f); } if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { - func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 12.0f); + func_effect_8007A774(&gPlayer[0], this, this->scale2 * 12.0f); } - if (effect->obj.pos.y < -20.0f) { - Object_Kill(&effect->obj, effect->sfxSource); + if (this->obj.pos.y < -20.0f) { + Object_Kill(&this->obj, this->sfxSource); } - effect->obj.rot.z += 6.0f; - if (effect->obj.rot.z >= 360.0f) { - effect->obj.rot.z = 0.0f; + this->obj.rot.z += 6.0f; + if (this->obj.rot.z >= 360.0f) { + this->obj.rot.z = 0.0f; } - sp48 = effect->unk_48; + sp48 = this->unk_48; - if (Play_CheckDynaFloorCollision(&sp5C, &sp4C, effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z)) { - effect->unk_48 = 1; - if (effect->scale2 == 20.0f) { - AUDIO_PLAY_SFX(NA_SE_EN_IN_PROMINENCE, effect->sfxSource, 4); + if (Play_CheckDynaFloorCollision(&sp5C, &sp4C, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + this->unk_48 = 1; + if (this->scale2 == 20.0f) { + AUDIO_PLAY_SFX(NA_SE_EN_IN_PROMINENCE, this->sfxSource, 4); } } else { - effect->unk_48 = 0; + this->unk_48 = 0; } - if ((sp48 != effect->unk_48) && (effect->unk_48 != 0)) { - if ((effect->index % 2) != 0) { + if ((sp48 != this->unk_48) && (this->unk_48 != 0)) { + if ((this->index % 2) != 0) { sp58 = 100.0f; } else { sp58 = -100.0f; } - Solar_8019E9F4(effect->obj.pos.x + sp58, effect->obj.pos.y + -50.0f, effect->obj.pos.z, sp58 * 0.25f, + Solar_8019E9F4(this->obj.pos.x + sp58, this->obj.pos.y + -50.0f, this->obj.pos.z, sp58 * 0.25f, RAND_FLOAT(10.0f) + 20.0f, sp58 * 0.25f, 20.0f, 1); } break; case 5: - effect->unk_4C++; - if (effect->unk_4C > 2) { - effect->unk_4C = 0; + this->unk_4C++; + if (this->unk_4C > 2) { + this->unk_4C = 0; } - if (effect->unk_60.x < 7.5f) { - effect->unk_60.x += 0.25f; + if (this->unk_60.x < 7.5f) { + this->unk_60.x += 0.25f; } - effect->unk_60.z += 10.0f; + this->unk_60.z += 10.0f; - effect->vel.x = SIN_DEG(effect->unk_60.z) * (effect->unk_60.x * 10.0f); - effect->vel.y = COS_DEG(effect->unk_60.z) * (effect->unk_60.x * 10.0f); - effect->vel.z = gPlayer[0].vel.z + 15.0f; + this->vel.x = SIN_DEG(this->unk_60.z) * (this->unk_60.x * 10.0f); + this->vel.y = COS_DEG(this->unk_60.z) * (this->unk_60.x * 10.0f); + this->vel.z = gPlayer[0].vel.z + 15.0f; if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { - func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 18.0f); - if ((effect->unk_4C == 0) && ((effect->scale2 >= 9.8f) || (effect->scale2 <= 4.4f))) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, effect->sfxSource, 4); + func_effect_8007A774(&gPlayer[0], this, this->scale2 * 18.0f); + if ((this->unk_4C == 0) && ((this->scale2 >= 9.8f) || (this->scale2 <= 4.4f))) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, this->sfxSource, 4); } } else { - effect->vel.z += 65.0f; - if (fabsf(gBosses[0].obj.pos.z - effect->obj.pos.z) >= 2000.0f) { - Audio_KillSfxBySourceAndId(effect->sfxSource, NA_SE_EN_SOBOSS_BREATH); + this->vel.z += 65.0f; + if (fabsf(gBosses[0].obj.pos.z - this->obj.pos.z) >= 2000.0f) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_SOBOSS_BREATH); } } break; @@ -880,43 +889,43 @@ void Solar_801A0120(Effect* effect) { sp50 = -1.0f; /* fallthrough */ case 7: - effect->unk_4C++; - if (effect->unk_4C > 2) { - effect->unk_4C = 0; + this->unk_4C++; + if (this->unk_4C > 2) { + this->unk_4C = 0; } - effect->unk_60.z += 20.0f; + this->unk_60.z += 20.0f; - effect->vel.x = SIN_DEG(effect->unk_60.z) * sp50 * 50.0f; - effect->vel.y = COS_DEG(effect->unk_60.z) * sp50 * 50.0f; - effect->vel.z = gPlayer[0].vel.z + 80.0f; + this->vel.x = SIN_DEG(this->unk_60.z) * sp50 * 50.0f; + this->vel.y = COS_DEG(this->unk_60.z) * sp50 * 50.0f; + this->vel.z = gPlayer[0].vel.z + 80.0f; if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { - func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 18.0f); - if ((effect->unk_4C == 0) && ((effect->scale2 >= 9.8f) || (effect->scale2 <= 4.4f))) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, effect->sfxSource, 4); + func_effect_8007A774(&gPlayer[0], this, this->scale2 * 18.0f); + if ((this->unk_4C == 0) && ((this->scale2 >= 9.8f) || (this->scale2 <= 4.4f))) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, this->sfxSource, 4); } - } else if (fabsf(gBosses[0].obj.pos.z - effect->obj.pos.z) >= 2000.0f) { - Audio_KillSfxBySourceAndId(effect->sfxSource, NA_SE_EN_SOBOSS_BREATH); + } else if (fabsf(gBosses[0].obj.pos.z - this->obj.pos.z) >= 2000.0f) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_SOBOSS_BREATH); } break; } } -void Solar_801A0AF0(Effect* effect) { - Graphics_SetScaleMtx(effect->scale2); - switch (effect->state) { +void Solar_Effect392_Draw(Effect392* this) { + Graphics_SetScaleMtx(this->scale2); + switch (this->state) { case 0: - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, effect->unk_44); - gSPDisplayList(gMasterDisp++, D_i3_801BF92C[effect->unk_4C]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, this->unk_44); + gSPDisplayList(gMasterDisp++, D_i3_801BF92C[this->unk_4C]); break; case 1: case 2: - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, effect->unk_44); - gSPDisplayList(gMasterDisp++, D_i3_801BF944[effect->unk_4C]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, this->unk_44); + gSPDisplayList(gMasterDisp++, D_i3_801BF944[this->unk_4C]); break; case 3: - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, effect->unk_44); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, this->unk_44); gSPDisplayList(gMasterDisp++, D_SO_601C820); break; case 4: @@ -924,28 +933,29 @@ void Solar_801A0AF0(Effect* effect) { case 6: case 7: RCP_SetupDL(&gMasterDisp, SETUPDL_53); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, effect->unk_44); - gSPDisplayList(gMasterDisp++, D_i3_801BF92C[effect->unk_4C]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 128, 128, this->unk_44); + gSPDisplayList(gMasterDisp++, D_i3_801BF92C[this->unk_4C]); RCP_SetupDL(&gMasterDisp, SETUPDL_64); break; } } -void Solar_801A0CEC(Actor* actor, f32 xPos, f32 zPos, f32 zVel, s32 unkB8) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_278; - actor->obj.pos.x = xPos; - actor->obj.pos.z = zPos; - actor->unk_046 = 1; - actor->state = unkB8; - actor->vel.z = zVel; - actor->fwork[1] = zVel; +void Solar_801A0CEC(Actor278* this, f32 xPos, f32 zPos, f32 zVel, s32 unkB8) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_278; + + this->obj.pos.x = xPos; + this->obj.pos.z = zPos; + this->unk_046 = 1; + this->state = unkB8; + this->vel.z = zVel; + this->fwork[1] = zVel; if (unkB8 == 2) { - actor->fwork[0] = 18.0f; + this->fwork[0] = 18.0f; } - Object_SetInfo(&actor->info, actor->obj.id); - actor->info.bonus = 0; + Object_SetInfo(&this->info, this->obj.id); + this->info.bonus = 0; } void Solar_801A0D90(f32 xPos, f32 zPos, f32 zVel, s32 unkB8) { @@ -960,69 +970,71 @@ void Solar_801A0D90(f32 xPos, f32 zPos, f32 zVel, s32 unkB8) { } void Solar_801A0DF8(f32 xPos, f32 zPos, f32 yRot, s32 index, f32 yPos) { - s32 sp2C; + s32 actorIndex; switch (index) { case 0: if (D_ctx_80177A10[0] != 0) { - sp2C = 5; + actorIndex = 5; D_ctx_80177A10[1] = RAND_INT(10.0f) + 128; } else { - sp2C = 4; + actorIndex = 4; D_ctx_80177A10[0] = RAND_INT(10.0f) + 128; } break; case 1: case 4: - sp2C = 6; + actorIndex = 6; break; case 2: - sp2C = 4; + actorIndex = 4; break; case 3: - sp2C = 5; + actorIndex = 5; break; } - Actor_Initialize(&gActors[sp2C]); + Actor_Initialize(&gActors[actorIndex]); - gActors[sp2C].obj.status = OBJ_ACTIVE; - gActors[sp2C].obj.id = OBJ_ACTOR_279; + gActors[actorIndex].obj.status = OBJ_ACTIVE; + gActors[actorIndex].obj.id = OBJ_ACTOR_279; - Object_SetInfo(&gActors[sp2C].info, gActors[sp2C].obj.id); + Object_SetInfo(&gActors[actorIndex].info, gActors[actorIndex].obj.id); - gActors[sp2C].state = 0; - gActors[sp2C].obj.pos.x = xPos; - gActors[sp2C].obj.pos.z = zPos; - gActors[sp2C].obj.rot.y = yRot; + gActors[actorIndex].state = 0; + gActors[actorIndex].obj.pos.x = xPos; + gActors[actorIndex].obj.pos.z = zPos; + gActors[actorIndex].obj.rot.y = yRot; if (index != 4) { - gActors[sp2C].obj.pos.y = -80.0f * yPos; + gActors[actorIndex].obj.pos.y = -80.0f * yPos; } else { - gActors[sp2C].timer_0BC = 0; - gActors[sp2C].timer_0BE = 50; - gActors[sp2C].counter_04E = 0; - gActors[sp2C].obj.pos.y = -1.0f * yPos; - Object_SetSfxSourceToPos(gActors[sp2C].sfxSource, &gActors[sp2C].obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, gActors[sp2C].sfxSource, 4); + gActors[actorIndex].timer_0BC = 0; + gActors[actorIndex].timer_0BE = 50; + gActors[actorIndex].counter_04E = 0; + gActors[actorIndex].obj.pos.y = -1.0f * yPos; + Object_SetSfxSourceToPos(gActors[actorIndex].sfxSource, &gActors[actorIndex].obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, gActors[actorIndex].sfxSource, 4); } } -void Solar_801A0FD4(Actor* actor, s32 index) { +void Solar_801A0FD4(ActorCutscene* this, s32 index) { if (gTeamShields[3 - index] > 0) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i3_801BF95C[index].x + gPlayer[0].pos.x; - actor->obj.pos.y = D_i3_801BF95C[index].y + gPlayer[0].pos.y; - actor->obj.pos.z = D_i3_801BF95C[index].z + gPlayer[0].pos.z; - actor->state = 0; - actor->iwork[11] = 1; - actor->vel.z = 0.0f; - actor->vel.y = 0.0f; - actor->obj.rot.x = 0.0f; - actor->obj.rot.y = 180.0f; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = D_i3_801BF95C[index].x + gPlayer[0].pos.x; + this->obj.pos.y = D_i3_801BF95C[index].y + gPlayer[0].pos.y; + this->obj.pos.z = D_i3_801BF95C[index].z + gPlayer[0].pos.z; + + this->state = 0; + this->iwork[11] = 1; + this->vel.z = 0.0f; + this->vel.y = 0.0f; + this->obj.rot.x = 0.0f; + this->obj.rot.y = 180.0f; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } } @@ -1269,36 +1281,37 @@ void Solar_LevelStart(Player* player) { player->trueZpos = player->pos.z + player->camDist; } -void Solar_801A1CD8(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 xVel, f32 yVel, +void Solar_801A1CD8(ActorDebris* this, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 xVel, f32 yVel, f32 zVel, s32 unk46) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_DEBRIS; - actor->state = 40; - actor->unk_046 = unk46; - actor->unk_04A = 3; + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_DEBRIS; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; + this->state = 40; + this->unk_046 = unk46; + this->unk_04A = 3; - actor->obj.rot.x = xRot; - actor->obj.rot.y = yRot; - actor->obj.rot.z = zRot; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; + this->obj.rot.x = xRot; + this->obj.rot.y = yRot; + this->obj.rot.z = zRot; - actor->iwork[0] = 3; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - actor->fwork[0] = RAND_FLOAT_CENTERED(25.0f); - actor->fwork[1] = RAND_FLOAT_CENTERED(25.0f); - actor->fwork[2] = RAND_FLOAT_CENTERED(25.0f); - actor->fwork[5] = 2000.0f; - actor->gravity = 3.5f; - actor->scale = 5.5f; - Object_SetInfo(&actor->info, actor->obj.id); + this->iwork[0] = 3; + + this->fwork[0] = RAND_FLOAT_CENTERED(25.0f); + this->fwork[1] = RAND_FLOAT_CENTERED(25.0f); + this->fwork[2] = RAND_FLOAT_CENTERED(25.0f); + this->fwork[5] = 2000.0f; + this->gravity = 3.5f; + this->scale = 5.5f; + Object_SetInfo(&this->info, this->obj.id); } void Solar_801A1E14(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 xVel, f32 yVel, f32 zVel, @@ -1313,44 +1326,45 @@ void Solar_801A1E14(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, } } -void Solar_801A1EB0(Boss* bossSO, f32 xPos, f32 xOffset, f32 yPos, f32 zPos) { +void Solar_801A1EB0(BossSO* this, f32 xPos, f32 xOffset, f32 yPos, f32 zPos) { Solar_8019E9F4(xPos + xOffset, yPos, zPos, 20.0f, RAND_FLOAT(10.0f) + 20.0f, 0.0f, 20.0f, 1); Solar_8019E9F4(xPos - xOffset, yPos, zPos, -20.0f, RAND_FLOAT(10.0f) + 20.0f, 0.0f, 20.0f, 1); } -void Solar_801A1F80(Boss* bossSO) { +void Solar_801A1F80(BossSO* this) { if (gBossActive) { - bossSO->scale = 5.5f; + this->scale = 5.5f; } - if (bossSO->health == 0) { + if (this->health == 0) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 20); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 20); gBossActive = true; gBossFrameCount = 0; - bossSO->health = 600; + this->health = 600; - bossSO->scale = 0.1f; - bossSO->fwork[SO_FWK_0] = 1.0f; - bossSO->swork[SO_SWK_2] = bossSO->swork[SO_SWK_3] = 400; + this->scale = 0.1f; + this->fwork[SO_FWK_0] = 1.0f; + this->swork[SO_SWK_2] = this->swork[SO_SWK_3] = 400; - bossSO->obj.pos.y = -3000.0f; + this->obj.pos.y = -3000.0f; - Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 2000.0f, 20.0f, 1); + Solar_801A0CEC(&gActors[10], this->obj.pos.x, this->obj.pos.z + 2000.0f, 20.0f, 1); D_ctx_801779A8[gMainController] = 10.0f; + gCameraShake = 120; - bossSO->fwork[SO_FWK_3] = 2400.0f; - bossSO->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SO_60231A4); - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1] = 0; - bossSO->info.hitbox[8] = bossSO->info.hitbox[12] = bossSO->info.hitbox[14] = bossSO->info.hitbox[18] = - bossSO->info.hitbox[20] = bossSO->info.hitbox[24] = bossSO->info.hitbox[26] = bossSO->info.hitbox[30] = - bossSO->info.hitbox[32] = bossSO->info.hitbox[36] = bossSO->info.hitbox[38] = bossSO->info.hitbox[42] = - 220.0f; - bossSO->info.hitbox[10] = bossSO->info.hitbox[28] = 467.5f; - bossSO->info.hitbox[16] = bossSO->info.hitbox[34] = 247.5f; - bossSO->info.hitbox[22] = bossSO->info.hitbox[40] = 715.0f; + + this->fwork[SO_FWK_3] = 2400.0f; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SO_60231A4); + this->unk_04C = 0; + this->swork[SO_SWK_1] = 0; + this->info.hitbox[8] = this->info.hitbox[12] = this->info.hitbox[14] = this->info.hitbox[18] = + this->info.hitbox[20] = this->info.hitbox[24] = this->info.hitbox[26] = this->info.hitbox[30] = + this->info.hitbox[32] = this->info.hitbox[36] = this->info.hitbox[38] = this->info.hitbox[42] = 220.0f; + this->info.hitbox[10] = this->info.hitbox[28] = 467.5f; + this->info.hitbox[16] = this->info.hitbox[34] = 247.5f; + this->info.hitbox[22] = this->info.hitbox[40] = 715.0f; D_i3_801C2740[0] = 255; D_i3_801C2740[1] = 255; @@ -1359,9 +1373,9 @@ void Solar_801A1F80(Boss* bossSO) { D_i3_801C2768[12] = D_i3_801C2768[13] = 0.0f; } - gActors[10].obj.pos.z = bossSO->obj.pos.z + 2000.0f; + gActors[10].obj.pos.z = this->obj.pos.z + 2000.0f; - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 30.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 30.0f, 0.1f); if (gFogRed > 96) { gFogRed--; @@ -1383,17 +1397,17 @@ void Solar_801A1F80(Boss* bossSO) { if (gBossFrameCount == 60) { gActors[10].dmgType = DMG_COLLISION; - AUDIO_PLAY_SFX(NA_SE_EN_OUT_MAGMA, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_MAGMA, this->sfxSource, 4); } - if (bossSO->timer_050 == 100) { - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1] = 1; + if (this->timer_050 == 100) { + this->unk_04C = 0; + this->swork[SO_SWK_1] = 1; } if (gBossFrameCount == 150) { - Solar_801A239C(bossSO); - bossSO->fwork[SO_FWK_0] = 0.01f; + Solar_801A239C(this); + this->fwork[SO_FWK_0] = 0.01f; } if ((gBossFrameCount == 100) && (gTeamShields[TEAM_ID_PEPPY] != 0)) { @@ -1401,106 +1415,106 @@ void Solar_801A1F80(Boss* bossSO) { } } -void Solar_801A239C(Boss* bossSO) { - bossSO->swork[SO_SWK_0] = 1; - if ((bossSO->swork[SO_SWK_2] != 0) || (bossSO->swork[SO_SWK_3] != 0)) { - if (bossSO->swork[SO_SWK_3] != 0) { - bossSO->swork[SO_SWK_1] = 3; +void Solar_801A239C(BossSO* this) { + this->swork[SO_SWK_0] = 1; + if ((this->swork[SO_SWK_2] != 0) || (this->swork[SO_SWK_3] != 0)) { + if (this->swork[SO_SWK_3] != 0) { + this->swork[SO_SWK_1] = 3; } else { - bossSO->swork[SO_SWK_1] = 4; + this->swork[SO_SWK_1] = 4; } } else { - bossSO->swork[SO_SWK_1] = 7; + this->swork[SO_SWK_1] = 7; } - bossSO->unk_04C = 0; + this->unk_04C = 0; } -void Solar_801A23F4(Boss* bossSO) { +void Solar_801A23F4(BossSO* this) { s32 i; Vec3f sp58; Vec3f sp4C; Vec3f sp40; Vec3f sp34; - switch (bossSO->swork[SO_SWK_1]) { + switch (this->swork[SO_SWK_1]) { case 3: - if ((bossSO->unk_04C == 119) || (bossSO->swork[SO_SWK_3] == 0)) { - bossSO->unk_04C = 0; - if (bossSO->swork[SO_SWK_2] != 0) { + if ((this->unk_04C == 119) || (this->swork[SO_SWK_3] == 0)) { + this->unk_04C = 0; + if (this->swork[SO_SWK_2] != 0) { if (Rand_ZeroOne() >= 0.5f) { - bossSO->swork[SO_SWK_1] = 4; + this->swork[SO_SWK_1] = 4; } else { - bossSO->swork[SO_SWK_1] = 2; - bossSO->state = 0; - bossSO->rot_078.y = 0.0f; + this->swork[SO_SWK_1] = 2; + this->state = 0; + this->rot_078.y = 0.0f; } - } else if (bossSO->swork[SO_SWK_3] == 0) { - bossSO->swork[SO_SWK_1] = 7; + } else if (this->swork[SO_SWK_3] == 0) { + this->swork[SO_SWK_1] = 7; } else { - bossSO->swork[SO_SWK_1] = 5; + this->swork[SO_SWK_1] = 5; } } - if (bossSO->unk_04C >= 28) { - bossSO->info.hitbox[38] = 715.0f; - bossSO->info.hitbox[40] = 440.0f; - bossSO->info.hitbox[42] = 110.0f; + if (this->unk_04C >= 28) { + this->info.hitbox[38] = 715.0f; + this->info.hitbox[40] = 440.0f; + this->info.hitbox[42] = 110.0f; } - if (bossSO->unk_04C == 29) { - Object_SetSfxSourceToPos(bossSO->sfxSource, &bossSO->obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, bossSO->sfxSource, 4); + if (this->unk_04C == 29) { + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, this->sfxSource, 4); } - if (bossSO->unk_04C == 80) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, bossSO->sfxSource, 4); + if (this->unk_04C == 80) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, this->sfxSource, 4); } - if (bossSO->unk_04C >= 94) { - bossSO->info.hitbox[38] = 220.0f; - bossSO->info.hitbox[40] = 715.0f; - bossSO->info.hitbox[42] = 220.0f; + if (this->unk_04C >= 94) { + this->info.hitbox[38] = 220.0f; + this->info.hitbox[40] = 715.0f; + this->info.hitbox[42] = 220.0f; } break; case 4: - if ((bossSO->unk_04C == 99) || (bossSO->swork[SO_SWK_2] == 0)) { - bossSO->unk_04C = 0; - if ((bossSO->swork[SO_SWK_3] != 0) || (bossSO->swork[SO_SWK_2] != 0)) { - bossSO->swork[SO_SWK_1] = 5; + if ((this->unk_04C == 99) || (this->swork[SO_SWK_2] == 0)) { + this->unk_04C = 0; + if ((this->swork[SO_SWK_3] != 0) || (this->swork[SO_SWK_2] != 0)) { + this->swork[SO_SWK_1] = 5; } else { - bossSO->swork[SO_SWK_1] = 7; + this->swork[SO_SWK_1] = 7; } } - if (bossSO->unk_04C > 20) { - bossSO->info.hitbox[20] = 715.0f; - bossSO->info.hitbox[22] = 110.0f; - bossSO->info.hitbox[24] = 275.0f; + if (this->unk_04C > 20) { + this->info.hitbox[20] = 715.0f; + this->info.hitbox[22] = 110.0f; + this->info.hitbox[24] = 275.0f; } - if (bossSO->unk_04C == 10) { - Object_SetSfxSourceToPos(bossSO->sfxSource, &bossSO->obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, bossSO->sfxSource, 4); + if (this->unk_04C == 10) { + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, this->sfxSource, 4); } - if (bossSO->unk_04C == 50) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, bossSO->sfxSource, 4); + if (this->unk_04C == 50) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, this->sfxSource, 4); } - if (bossSO->unk_04C >= 85) { - bossSO->info.hitbox[20] = 220.0f; - bossSO->info.hitbox[22] = 715.0f; - bossSO->info.hitbox[24] = 220.0f; + if (this->unk_04C >= 85) { + this->info.hitbox[20] = 220.0f; + this->info.hitbox[22] = 715.0f; + this->info.hitbox[24] = 220.0f; } break; case 5: - bossSO->fwork[SO_FWK_3] = 2600.0f; + this->fwork[SO_FWK_3] = 2600.0f; - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); - if (bossSO->unk_04C == 65) { + if (this->unk_04C == 65) { Matrix_RotateX(gCalcMatrix, D_i3_801C2768[0] * M_DTOR, MTXF_NEW); Matrix_RotateY(gCalcMatrix, D_i3_801C2768[1] * M_DTOR, MTXF_APPLY); sp40.x = 0.0f; @@ -1513,230 +1527,230 @@ void Solar_801A23F4(Boss* bossSO) { sp58.y = RAND_FLOAT_CENTERED(2.0f); sp58.z = RAND_FLOAT(10.0f) + 2.5f; Matrix_MultVec3f(gCalcMatrix, &sp58, &sp4C); - Solar_8019F038(bossSO->fwork[SO_FWK_4] + sp34.x, bossSO->fwork[SO_FWK_5] + sp34.y, - bossSO->fwork[SO_FWK_6] + sp34.z, sp4C.x, sp4C.y, sp4C.z); + Solar_8019F038(this->fwork[SO_FWK_4] + sp34.x, this->fwork[SO_FWK_5] + sp34.y, + this->fwork[SO_FWK_6] + sp34.z, sp4C.x, sp4C.y, sp4C.z); } } - if (bossSO->unk_04C == 99) { - if ((bossSO->swork[SO_SWK_2] != 0) || (bossSO->swork[SO_SWK_3] != 0)) { - Solar_801A2C3C(bossSO); + if (this->unk_04C == 99) { + if ((this->swork[SO_SWK_2] != 0) || (this->swork[SO_SWK_3] != 0)) { + Solar_801A2C3C(this); } else { - Solar_801A4EC0(bossSO); + Solar_801A4EC0(this); } } break; case 7: - if (bossSO->unk_04C < 50) { - if (bossSO->fwork[SO_FWK_31] < 22.0f) { - bossSO->fwork[SO_FWK_31] += 0.5f; + if (this->unk_04C < 50) { + if (this->fwork[SO_FWK_31] < 22.0f) { + this->fwork[SO_FWK_31] += 0.5f; } - bossSO->obj.rot.y += bossSO->fwork[SO_FWK_31]; + this->obj.rot.y += this->fwork[SO_FWK_31]; } - if ((bossSO->unk_04C >= 50) && (bossSO->unk_04C <= 100)) { - if (bossSO->fwork[SO_FWK_31] > 0.0f) { - bossSO->fwork[SO_FWK_31] -= 0.5f; + if ((this->unk_04C >= 50) && (this->unk_04C <= 100)) { + if (this->fwork[SO_FWK_31] > 0.0f) { + this->fwork[SO_FWK_31] -= 0.5f; } - bossSO->obj.rot.y += bossSO->fwork[SO_FWK_31]; + this->obj.rot.y += this->fwork[SO_FWK_31]; } - if (bossSO->obj.rot.y >= 360.0f) { - bossSO->obj.rot.y -= 360.0f; - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, bossSO->sfxSource, 4); + if (this->obj.rot.y >= 360.0f) { + this->obj.rot.y -= 360.0f; + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, this->sfxSource, 4); } - if (bossSO->unk_04C == 1) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, bossSO->sfxSource, 4); + if (this->unk_04C == 1) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, this->sfxSource, 4); } - if (bossSO->unk_04C >= 100) { - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 1.0f, 2.0f, 1.0f); - bossSO->fwork[SO_FWK_31] = 0.0f; + if (this->unk_04C >= 100) { + Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 1.0f, 2.0f, 1.0f); + this->fwork[SO_FWK_31] = 0.0f; } - if (bossSO->unk_04C == 120) { - bossSO->swork[SO_SWK_1] = 5; - bossSO->unk_04C = 0; - bossSO->fwork[SO_FWK_0] = 0.1f; + if (this->unk_04C == 120) { + this->swork[SO_SWK_1] = 5; + this->unk_04C = 0; + this->fwork[SO_FWK_0] = 0.1f; } break; case 2: - if (((bossSO->unk_04C == 89) && (bossSO->state == 2)) || (bossSO->swork[SO_SWK_2] == 0)) { - bossSO->unk_04C = 0; + if (((this->unk_04C == 89) && (this->state == 2)) || (this->swork[SO_SWK_2] == 0)) { + this->unk_04C = 0; - if ((bossSO->swork[SO_SWK_3] != 0) || (bossSO->swork[SO_SWK_2] != 0)) { - bossSO->swork[SO_SWK_1] = 5; + if ((this->swork[SO_SWK_3] != 0) || (this->swork[SO_SWK_2] != 0)) { + this->swork[SO_SWK_1] = 5; } else { - bossSO->swork[SO_SWK_1] = 7; + this->swork[SO_SWK_1] = 7; } } - if (bossSO->unk_04C == 80) { - bossSO->rot_078.y += 15.0f; - bossSO->state++; - if (bossSO->rot_078.y >= 30.0f) { - bossSO->rot_078.y = 0.0f; + if (this->unk_04C == 80) { + this->rot_078.y += 15.0f; + this->state++; + if (this->rot_078.y >= 30.0f) { + this->rot_078.y = 0.0f; } } - Math_SmoothStepToAngle(&bossSO->obj.rot.y, bossSO->rot_078.y, 1.0f, 1.5f, 1.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->rot_078.y, 1.0f, 1.5f, 1.0f); - if (bossSO->unk_04C >= 19) { - bossSO->info.hitbox[20] = 715.0f; - bossSO->info.hitbox[22] = 440.0f; - bossSO->info.hitbox[24] = 110.0f; + if (this->unk_04C >= 19) { + this->info.hitbox[20] = 715.0f; + this->info.hitbox[22] = 440.0f; + this->info.hitbox[24] = 110.0f; } - if (bossSO->unk_04C == 5) { - Object_SetSfxSourceToPos(bossSO->sfxSource, &bossSO->obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, bossSO->sfxSource, 4); + if (this->unk_04C == 5) { + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, this->sfxSource, 4); } - if (bossSO->unk_04C == 20) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, bossSO->sfxSource, 4); + if (this->unk_04C == 20) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, this->sfxSource, 4); } - if (bossSO->unk_04C > 36) { - bossSO->info.hitbox[20] = 220.0f; - bossSO->info.hitbox[22] = 715.0f; - bossSO->info.hitbox[24] = 220.0f; + if (this->unk_04C > 36) { + this->info.hitbox[20] = 220.0f; + this->info.hitbox[22] = 715.0f; + this->info.hitbox[24] = 220.0f; } break; } } -void Solar_801A2C3C(Boss* bossSO) { - bossSO->swork[SO_SWK_0] = 2; - bossSO->swork[SO_SWK_1] = 0; - bossSO->fwork[SO_FWK_0] = 0.05f; - bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; - bossSO->state = 0; - bossSO->swork[SO_SWK_11] = 15; +void Solar_801A2C3C(BossSO* this) { + this->swork[SO_SWK_0] = 2; + this->swork[SO_SWK_1] = 0; + this->fwork[SO_FWK_0] = 0.05f; + this->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; + this->state = 0; + this->swork[SO_SWK_11] = 15; } -void Solar_801A2C98(Boss* bossSO) { +void Solar_801A2C98(BossSO* this) { s32 i; - if (bossSO->swork[SO_SWK_11] != 0) { - bossSO->swork[SO_SWK_11]--; + if (this->swork[SO_SWK_11] != 0) { + this->swork[SO_SWK_11]--; } - if (bossSO->state == 0) { - if (bossSO->swork[SO_SWK_11] == 0) { - bossSO->unk_04C -= 2; + if (this->state == 0) { + if (this->swork[SO_SWK_11] == 0) { + this->unk_04C -= 2; - Math_SmoothStepToF(&bossSO->obj.pos.y, -1000.0f, 0.1f, 10.0f, 0.1f); - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 181.0f, 1.0f, 3.0f, 1.0f); + Math_SmoothStepToF(&this->obj.pos.y, -1000.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToAngle(&this->obj.rot.y, 181.0f, 1.0f, 3.0f, 1.0f); - if (bossSO->unk_04C == 50) { - Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 20.0f, 1); + if (this->unk_04C == 50) { + Solar_801A0CEC(&gActors[10], this->obj.pos.x, this->obj.pos.z + 1000.0f, 20.0f, 1); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 70; } - if (bossSO->unk_04C == 60) { + if (this->unk_04C == 60) { for (i = 0; i < 4; i++) { - Solar_8019F038(bossSO->obj.pos.x + 100.0f, 100.0f, bossSO->obj.pos.z + 1100.0f, + Solar_8019F038(this->obj.pos.x + 100.0f, 100.0f, this->obj.pos.z + 1100.0f, D_i3_801BF8F0[i].x + RAND_FLOAT_CENTERED(2.0f), D_i3_801BF8F0[i].y + 10.0f + RAND_FLOAT_CENTERED(2.0f), RAND_FLOAT(-10.0f) - 10.0f); - Solar_8019F038(bossSO->obj.pos.x - 100.0f, 100.0f, bossSO->obj.pos.z + 1100.0f, + Solar_8019F038(this->obj.pos.x - 100.0f, 100.0f, this->obj.pos.z + 1100.0f, D_i3_801BF8F0[i].x + RAND_FLOAT_CENTERED(2.0f), D_i3_801BF8F0[i].y + 10.0f + RAND_FLOAT_CENTERED(2.0f), RAND_FLOAT(-10.0f) - 10.0f); } } - if (bossSO->unk_04C == 20) { + if (this->unk_04C == 20) { gActors[10].dmgType = DMG_COLLISION; - AUDIO_PLAY_SFX(NA_SE_EN_IN_MAGMA, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_IN_MAGMA, this->sfxSource, 4); } - if (bossSO->unk_04C == 0) { - bossSO->state++; - bossSO->swork[SO_SWK_11] = 100; - bossSO->obj.pos.y = -500.0f; - bossSO->fwork[SO_FWK_3] = 4800.0f; - bossSO->obj.pos.z = gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3]; - bossSO->obj.rot.y = -bossSO->obj.rot.y; + if (this->unk_04C == 0) { + this->state++; + this->swork[SO_SWK_11] = 100; + this->obj.pos.y = -500.0f; + this->fwork[SO_FWK_3] = 4800.0f; + this->obj.pos.z = gPlayer[0].trueZpos - this->fwork[SO_FWK_3]; + this->obj.rot.y = -this->obj.rot.y; } } else { - bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; + this->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; } } else { - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); - if (bossSO->swork[SO_SWK_11] == 80) { - Solar_801A0CEC(&gActors[9], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 20.0f, 1); + if (this->swork[SO_SWK_11] == 80) { + Solar_801A0CEC(&gActors[9], this->obj.pos.x, this->obj.pos.z + 1000.0f, 20.0f, 1); } - if (bossSO->swork[SO_SWK_11] == 0) { - bossSO->swork[SO_SWK_11] = 220; + if (this->swork[SO_SWK_11] == 0) { + this->swork[SO_SWK_11] = 220; } - if (bossSO->swork[SO_SWK_11] == 210) { - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1] = 1; - bossSO->fwork[SO_FWK_0] = 0.05f; + if (this->swork[SO_SWK_11] == 210) { + this->unk_04C = 0; + this->swork[SO_SWK_1] = 1; + this->fwork[SO_FWK_0] = 0.05f; } - if (bossSO->swork[SO_SWK_11] >= 100) { - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); + if (this->swork[SO_SWK_11] >= 100) { + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); } - if (bossSO->swork[SO_SWK_11] == 150) { - Solar_801A3468(bossSO); + if (this->swork[SO_SWK_11] == 150) { + Solar_801A3468(this); } - if (bossSO->swork[SO_SWK_11] == 50) { + if (this->swork[SO_SWK_11] == 50) { gActors[9].dmgType = DMG_COLLISION; - AUDIO_PLAY_SFX(NA_SE_EN_OUT_MAGMA, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_MAGMA, this->sfxSource, 4); } } } -void Solar_801A30CC(Boss* bossSO) { - bossSO->swork[SO_SWK_0] = 3; - bossSO->swork[SO_SWK_1] = 0; - bossSO->fwork[SO_FWK_0] = 0.1f; - bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; - bossSO->state = 0; - bossSO->swork[SO_SWK_11] = 15; +void Solar_801A30CC(BossSO* this) { + this->swork[SO_SWK_0] = 3; + this->swork[SO_SWK_1] = 0; + this->fwork[SO_FWK_0] = 0.1f; + this->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; + this->state = 0; + this->swork[SO_SWK_11] = 15; } -void Solar_801A3128(Boss* bossSO) { - if (bossSO->swork[SO_SWK_11] != 0) { - bossSO->swork[SO_SWK_11]--; +void Solar_801A3128(BossSO* this) { + if (this->swork[SO_SWK_11] != 0) { + this->swork[SO_SWK_11]--; } - if (bossSO->state == 0) { - if (bossSO->swork[SO_SWK_11] == 0) { - bossSO->unk_04C -= 2; + if (this->state == 0) { + if (this->swork[SO_SWK_11] == 0) { + this->unk_04C -= 2; - Math_SmoothStepToF(&bossSO->obj.pos.y, -1000.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, -1000.0f, 0.1f, 10.0f, 0.1f); - if (bossSO->unk_04C == 50) { - Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 2000.0f, 10.0f, 1); + if (this->unk_04C == 50) { + Solar_801A0CEC(&gActors[10], this->obj.pos.x, this->obj.pos.z + 2000.0f, 10.0f, 1); } - if (bossSO->unk_04C == 40) { + if (this->unk_04C == 40) { gActors[10].dmgType = DMG_COLLISION; - AUDIO_PLAY_SFX(NA_SE_EN_IN_MAGMA, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_IN_MAGMA, this->sfxSource, 4); } - if (bossSO->unk_04C == 0) { - bossSO->state++; - bossSO->swork[SO_SWK_11] = 100; - bossSO->obj.pos.y = -500.0f; - bossSO->fwork[SO_FWK_3] = 2400.0f; - bossSO->obj.pos.z = gPlayer[0].trueZpos - 2100.0f; + if (this->unk_04C == 0) { + this->state++; + this->swork[SO_SWK_11] = 100; + this->obj.pos.y = -500.0f; + this->fwork[SO_FWK_3] = 2400.0f; + this->obj.pos.z = gPlayer[0].trueZpos - 2100.0f; } } else { - bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; + this->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 2; } } else { - if (bossSO->swork[SO_SWK_11] == 80) { - Solar_801A0CEC(&gActors[9], bossSO->obj.pos.x, bossSO->obj.pos.z + 850.0f, 20.0f, 1); + if (this->swork[SO_SWK_11] == 80) { + Solar_801A0CEC(&gActors[9], this->obj.pos.x, this->obj.pos.z + 850.0f, 20.0f, 1); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 70; @@ -1756,257 +1770,257 @@ void Solar_801A3128(Boss* bossSO) { } } - if (bossSO->swork[SO_SWK_11] == 0) { - bossSO->swork[SO_SWK_11] = 220; + if (this->swork[SO_SWK_11] == 0) { + this->swork[SO_SWK_11] = 220; } - if (bossSO->swork[SO_SWK_11] == 210) { - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1] = 1; + if (this->swork[SO_SWK_11] == 210) { + this->unk_04C = 0; + this->swork[SO_SWK_1] = 1; } - if (bossSO->swork[SO_SWK_11] >= 100) { - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 20.0f, 0.1f); + if (this->swork[SO_SWK_11] >= 100) { + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 20.0f, 0.1f); } - if (bossSO->swork[SO_SWK_11] == 150) { - Solar_801A239C(bossSO); - bossSO->fwork[SO_FWK_0] = 0.01f; - if ((Rand_ZeroOne() >= 0.4f) && (gTeamShields[TEAM_ID_PEPPY] > 0) && (bossSO->swork[SO_SWK_2] != 0) && - (bossSO->swork[SO_SWK_3] != 0)) { + if (this->swork[SO_SWK_11] == 150) { + Solar_801A239C(this); + this->fwork[SO_FWK_0] = 0.01f; + if ((Rand_ZeroOne() >= 0.4f) && (gTeamShields[TEAM_ID_PEPPY] > 0) && (this->swork[SO_SWK_2] != 0) && + (this->swork[SO_SWK_3] != 0)) { Radio_PlayMessage(gMsg_ID_10320, RCID_PEPPY); } } - if (bossSO->swork[SO_SWK_11] == 50) { + if (this->swork[SO_SWK_11] == 50) { gActors[9].dmgType = DMG_COLLISION; - AUDIO_PLAY_SFX(NA_SE_EN_OUT_MAGMA, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_MAGMA, this->sfxSource, 4); } } } -void Solar_801A3468(Boss* bossSO) { - bossSO->swork[SO_SWK_0] = 4; - bossSO->unk_048 = 0; +void Solar_801A3468(BossSO* this) { + this->swork[SO_SWK_0] = 4; + this->unk_048 = 0; - if ((bossSO->swork[SO_SWK_2] != 0) || (bossSO->swork[SO_SWK_3] != 0)) { - if (bossSO->swork[SO_SWK_3] != 0) { - bossSO->swork[SO_SWK_1] = 3; + if ((this->swork[SO_SWK_2] != 0) || (this->swork[SO_SWK_3] != 0)) { + if (this->swork[SO_SWK_3] != 0) { + this->swork[SO_SWK_1] = 3; } else { - bossSO->swork[SO_SWK_1] = 4; + this->swork[SO_SWK_1] = 4; } } else { if (Rand_ZeroOne() >= 0.5f) { - bossSO->unk_048 = 1; - bossSO->swork[SO_SWK_1] = 5; + this->unk_048 = 1; + this->swork[SO_SWK_1] = 5; } else { - bossSO->timer_050 = 0; - bossSO->swork[SO_SWK_1] = 8; + this->timer_050 = 0; + this->swork[SO_SWK_1] = 8; } } - bossSO->unk_04C = 0; - bossSO->fwork[SO_FWK_0] = 0.01f; + this->unk_04C = 0; + this->fwork[SO_FWK_0] = 0.01f; } -void Solar_801A3510(Boss* bossSO) { +void Solar_801A3510(BossSO* this) { s32 i; - switch (bossSO->swork[SO_SWK_1]) { + switch (this->swork[SO_SWK_1]) { case 3: - if ((bossSO->unk_04C == 119) || (bossSO->swork[SO_SWK_3] == 0)) { - bossSO->unk_04C = 0; - if (bossSO->swork[SO_SWK_2] != 0) { - bossSO->swork[SO_SWK_1] = 4; + if ((this->unk_04C == 119) || (this->swork[SO_SWK_3] == 0)) { + this->unk_04C = 0; + if (this->swork[SO_SWK_2] != 0) { + this->swork[SO_SWK_1] = 4; } else { - bossSO->swork[SO_SWK_1] = 5; + this->swork[SO_SWK_1] = 5; } } - if (bossSO->unk_04C == 29) { - Object_SetSfxSourceToPos(bossSO->sfxSource, &bossSO->obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, bossSO->sfxSource, 4); + if (this->unk_04C == 29) { + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, this->sfxSource, 4); } - if (bossSO->unk_04C == 80) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, bossSO->sfxSource, 4); + if (this->unk_04C == 80) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, this->sfxSource, 4); } - if (bossSO->unk_04C == 94) { - Solar_801A0DF8(bossSO->fwork[SO_FWK_13], bossSO->fwork[SO_FWK_15], RAND_FLOAT_CENTERED(60.0f), 4, 2.0f); - bossSO->timer_050 = 90; + if (this->unk_04C == 94) { + Solar_801A0DF8(this->fwork[SO_FWK_13], this->fwork[SO_FWK_15], RAND_FLOAT_CENTERED(60.0f), 4, 2.0f); + this->timer_050 = 90; } break; case 4: - if ((bossSO->unk_04C == 99) || (bossSO->swork[SO_SWK_2] == 0)) { - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1] = 5; + if ((this->unk_04C == 99) || (this->swork[SO_SWK_2] == 0)) { + this->unk_04C = 0; + this->swork[SO_SWK_1] = 5; } - Math_SmoothStepToAngle(&bossSO->obj.rot.x, 20.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToAngle(&this->obj.rot.x, 20.0f, 0.1f, 10.0f, 0.1f); - if (bossSO->unk_04C == 10) { - Object_SetSfxSourceToPos(bossSO->sfxSource, &bossSO->obj.pos); - AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, bossSO->sfxSource, 4); + if (this->unk_04C == 10) { + Object_SetSfxSourceToPos(this->sfxSource, &this->obj.pos); + AUDIO_PLAY_SFX(NA_SE_EN_OUT_PROMINENCE, this->sfxSource, 4); } - if (bossSO->unk_04C == 50) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, bossSO->sfxSource, 4); + if (this->unk_04C == 50) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_SWING, this->sfxSource, 4); } - if (bossSO->unk_04C == 60) { - Solar_801A0D90(bossSO->obj.pos.x, bossSO->obj.pos.z + 1600.0f, 80.0f, 2); + if (this->unk_04C == 60) { + Solar_801A0D90(this->obj.pos.x, this->obj.pos.z + 1600.0f, 80.0f, 2); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 100; } break; case 5: - Math_SmoothStepToAngle(&bossSO->obj.rot.x, 0.0f, 0.1f, 10.0f, 0.1f); - if (bossSO->unk_04C == 65) { + Math_SmoothStepToAngle(&this->obj.rot.x, 0.0f, 0.1f, 10.0f, 0.1f); + if (this->unk_04C == 65) { for (i = 0; i < 4; i++) { - Solar_8019F194(bossSO->obj.pos.x, bossSO->obj.pos.y + 300.0f, bossSO->obj.pos.z + 1000.0f, + Solar_8019F194(this->obj.pos.x, this->obj.pos.y + 300.0f, this->obj.pos.z + 1000.0f, D_i3_801BF8F0[i].x + RAND_FLOAT_CENTERED(0.25f), D_i3_801BF8F0[i].y + RAND_FLOAT_CENTERED(0.25f), RAND_FLOAT(10.0f) + 100.0f); } } - if ((bossSO->unk_048 != 0) && (bossSO->unk_04C == 68)) { - bossSO->swork[SO_SWK_1] = 9; - bossSO->fwork[SO_FWK_0] = 0.01f; - bossSO->unk_04C = 20; + if ((this->unk_048 != 0) && (this->unk_04C == 68)) { + this->swork[SO_SWK_1] = 9; + this->fwork[SO_FWK_0] = 0.01f; + this->unk_04C = 20; } - if (bossSO->unk_04C == 99) { - Solar_801A30CC(bossSO); + if (this->unk_04C == 99) { + Solar_801A30CC(this); } break; case 8: - if (bossSO->unk_04C == 65) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, bossSO->sfxSource, 4); - bossSO->timer_050 = 30; + if (this->unk_04C == 65) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, this->sfxSource, 4); + this->timer_050 = 30; } - if (bossSO->timer_050 != 0) { - bossSO->unk_04C = 65; + if (this->timer_050 != 0) { + this->unk_04C = 65; } - if ((bossSO->unk_04C == 65) && (gGameFrameCount % 2) == 0) { - Solar_8019FFC0(bossSO, bossSO->fwork[SO_FWK_4], bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 600.0f, (bossSO->timer_050 * 0.2f) + 4.0f, 0); - Solar_801A1EB0(bossSO, bossSO->fwork[SO_FWK_4], 25.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 300.0f); + if ((this->unk_04C == 65) && (gGameFrameCount % 2) == 0) { + Solar_8019FFC0(this, this->fwork[SO_FWK_4], this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 600.0f, (this->timer_050 * 0.2f) + 4.0f, 0); + Solar_801A1EB0(this, this->fwork[SO_FWK_4], 25.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 300.0f); } - if (bossSO->unk_04C == 75) { - Audio_KillSfxBySourceAndId(bossSO->sfxSource, NA_SE_EN_SOBOSS_BREATH); + if (this->unk_04C == 75) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_SOBOSS_BREATH); } - if (bossSO->unk_04C == 99) { - bossSO->swork[SO_SWK_1] = 5; - bossSO->unk_04C = 0; + if (this->unk_04C == 99) { + this->swork[SO_SWK_1] = 5; + this->unk_04C = 0; } break; case 9: - bossSO->unk_04C++; - if (bossSO->unk_04C == 66) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, bossSO->sfxSource, 4); - bossSO->timer_050 = 30; + this->unk_04C++; + if (this->unk_04C == 66) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BREATH, this->sfxSource, 4); + this->timer_050 = 30; } - if (bossSO->timer_050 != 0) { - bossSO->unk_04C = 66; + if (this->timer_050 != 0) { + this->unk_04C = 66; } - if ((bossSO->unk_04C == 66) && ((gGameFrameCount % 2) == 0)) { - Solar_8019FFC0(bossSO, bossSO->fwork[SO_FWK_4] + 125.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 600.0f, (bossSO->timer_050 * 0.2f) + 4.0f, 1); - Solar_8019FFC0(bossSO, bossSO->fwork[SO_FWK_4] - 125.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 600.0f, (bossSO->timer_050 * 0.2f) + 4.0f, 2); - Solar_801A1EB0(bossSO, bossSO->fwork[SO_FWK_4], 25.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 300.0f); + if ((this->unk_04C == 66) && ((gGameFrameCount % 2) == 0)) { + Solar_8019FFC0(this, this->fwork[SO_FWK_4] + 125.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 600.0f, (this->timer_050 * 0.2f) + 4.0f, 1); + Solar_8019FFC0(this, this->fwork[SO_FWK_4] - 125.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 600.0f, (this->timer_050 * 0.2f) + 4.0f, 2); + Solar_801A1EB0(this, this->fwork[SO_FWK_4], 25.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 300.0f); } - if (bossSO->unk_04C == 76) { - Audio_KillSfxBySourceAndId(bossSO->sfxSource, NA_SE_EN_SOBOSS_BREATH); + if (this->unk_04C == 76) { + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_SOBOSS_BREATH); } - if (bossSO->unk_04C >= 99) { - Solar_801A30CC(bossSO); + if (this->unk_04C >= 99) { + Solar_801A30CC(this); } break; } - if (bossSO->timer_050 == 0) { + if (this->timer_050 == 0) { Object_Kill(&gActors[6].obj, gActors[6].sfxSource); } else { Math_SmoothStepToF(&gActors[6].obj.pos.x, gPlayer[0].pos.x, 0.1f, 10.0f, 0.1f); } } -void Solar_801A3C4C(Boss* bossSO) { +void Solar_801A3C4C(BossSO* this) { s32 i; - if ((bossSO->swork[SO_SWK_2] == 0) && (bossSO->swork[SO_SWK_3] == 0) && - ((bossSO->dmgPart == 8) || (bossSO->dmgPart == -1))) { - bossSO->health -= bossSO->damage; - if (bossSO->health < 0) { - bossSO->health = 0; + if ((this->swork[SO_SWK_2] == 0) && (this->swork[SO_SWK_3] == 0) && + ((this->dmgPart == 8) || (this->dmgPart == -1))) { + this->health -= this->damage; + if (this->health < 0) { + this->health = 0; } - bossSO->swork[SO_SWK_10] = 20; - if (bossSO->health > 0.0f) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, bossSO->sfxSource, 4); + this->swork[SO_SWK_10] = 20; + if (this->health > 0.0f) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, this->sfxSource, 4); } - if (bossSO) {} + if (this) {} //! FAKE } - bossSO->timer_058 = 20; + this->timer_058 = 20; - if ((bossSO->dmgPart >= 1) && (bossSO->dmgPart <= 3) && (bossSO->swork[SO_SWK_2] != 0)) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, bossSO->sfxSource, 4); + if ((this->dmgPart >= 1) && (this->dmgPart <= 3) && (this->swork[SO_SWK_2] != 0)) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, this->sfxSource, 4); - bossSO->swork[SO_SWK_2] -= bossSO->damage; - if (bossSO->swork[SO_SWK_2] < 0) { - bossSO->swork[SO_SWK_2] = 0; + this->swork[SO_SWK_2] -= this->damage; + if (this->swork[SO_SWK_2] < 0) { + this->swork[SO_SWK_2] = 0; } - if (bossSO->swork[SO_SWK_2] == 0) { + if (this->swork[SO_SWK_2] == 0) { for (i = 0; i < 6; i++) { - bossSO->info.hitbox[7 + i] = bossSO->info.hitbox[13 + i] = bossSO->info.hitbox[19 + i] = 0.0f; + this->info.hitbox[7 + i] = this->info.hitbox[13 + i] = this->info.hitbox[19 + i] = 0.0f; } - bossSO->swork[SO_SWK_2] = -1; - Solar_801A48B8(bossSO); + this->swork[SO_SWK_2] = -1; + Solar_801A48B8(this); } else { - bossSO->swork[SO_SWK_8] = 20; + this->swork[SO_SWK_8] = 20; } } - if ((bossSO->dmgPart >= 4) && (bossSO->dmgPart <= 6) && (bossSO->swork[SO_SWK_3] != 0)) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, bossSO->sfxSource, 4); + if ((this->dmgPart >= 4) && (this->dmgPart <= 6) && (this->swork[SO_SWK_3] != 0)) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, this->sfxSource, 4); - bossSO->swork[SO_SWK_3] -= bossSO->damage; - if (bossSO->swork[SO_SWK_3] < 0) { - bossSO->swork[SO_SWK_3] = 0; + this->swork[SO_SWK_3] -= this->damage; + if (this->swork[SO_SWK_3] < 0) { + this->swork[SO_SWK_3] = 0; } - if (bossSO->swork[SO_SWK_3] == 0) { + if (this->swork[SO_SWK_3] == 0) { for (i = 0; i < 6; i++) { - bossSO->info.hitbox[25 + i] = bossSO->info.hitbox[31 + i] = bossSO->info.hitbox[37 + i] = 0.0f; + this->info.hitbox[25 + i] = this->info.hitbox[31 + i] = this->info.hitbox[37 + i] = 0.0f; } - bossSO->swork[SO_SWK_3] = -1; - Solar_801A48B8(bossSO); + this->swork[SO_SWK_3] = -1; + Solar_801A48B8(this); } else { - bossSO->swork[SO_SWK_9] = 20; + this->swork[SO_SWK_9] = 20; } } - if (bossSO->health <= 0) { - bossSO->unk_04C = 21; - bossSO->state = 0; - bossSO->swork[SO_SWK_1] = 1; - bossSO->fwork[SO_FWK_0] = 0.01f; - bossSO->info.hitbox = SEGMENTED_TO_VIRTUAL(gNoHitbox); - bossSO->timer_058 = 20000; + if (this->health <= 0) { + this->unk_04C = 21; + this->state = 0; + this->swork[SO_SWK_1] = 1; + this->fwork[SO_FWK_0] = 0.01f; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(gNoHitbox); + this->timer_058 = 20000; gTeamLowHealthMsgTimer = -1; @@ -2024,7 +2038,7 @@ void Solar_801A3C4C(Boss* bossSO) { Audio_KillSfxById(NA_SE_OVERHEAT_ALARM); - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; @@ -2040,31 +2054,31 @@ void Solar_801A3C4C(Boss* bossSO) { } gPlayer[0].yRot_114 = 0.0f; } - bossSO->fwork[SO_FWK_31] = 0.0f; - bossSO->fwork[SO_FWK_3] = 2400.0f; + this->fwork[SO_FWK_31] = 0.0f; + this->fwork[SO_FWK_3] = 2400.0f; Radio_PlayMessage(gMsg_ID_15252, RCID_SLIPPY); } } -void Solar_801A4214(Boss* bossSO) { +void Solar_801A4214(BossSO* this) { s32 i; Vec3f sp50; Vec3f sp44; - if (bossSO->health > 0) { + if (this->health > 0) { return; } - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToAngle(&bossSO->obj.rot.x, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.x, 0.0f, 0.1f, 3.0f, 0.0f); - if ((bossSO->unk_04C == 52) && (bossSO->swork[SO_SWK_1] == 5)) { - bossSO->unk_04C = 38; - bossSO->fwork[SO_FWK_0] = 0.05f; + if ((this->unk_04C == 52) && (this->swork[SO_SWK_1] == 5)) { + this->unk_04C = 38; + this->fwork[SO_FWK_0] = 0.05f; } - Matrix_RotateX(gCalcMatrix, bossSO->fwork[SO_FWK_1] * M_DTOR, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, -bossSO->fwork[SO_FWK_2] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->fwork[SO_FWK_1] * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -this->fwork[SO_FWK_2] * M_DTOR, MTXF_APPLY); sp50.x = 0.0f; sp50.y = 200.0f; @@ -2072,38 +2086,38 @@ void Solar_801A4214(Boss* bossSO) { Matrix_MultVec3f(gCalcMatrix, &sp50, &sp44); - if (bossSO->state >= 2) { + if (this->state >= 2) { Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 30.0f, 1.0f, 2.5f, 0.0f); } - switch (bossSO->state) { + switch (this->state) { case 0: if (D_i3_801C2740[0] >= 33) { D_i3_801C2740[0] -= 3; } - if (bossSO->timer_058 == 19910) { - bossSO->state++; - bossSO->swork[SO_SWK_1] = 5; - bossSO->unk_04C = 0; - bossSO->fwork[SO_FWK_0] = 0.05f; + if (this->timer_058 == 19910) { + this->state++; + this->swork[SO_SWK_1] = 5; + this->unk_04C = 0; + this->fwork[SO_FWK_0] = 0.05f; } - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); break; case 1: - if (bossSO->unk_04C == 51) { - bossSO->unk_04C = 50; - bossSO->state++; + if (this->unk_04C == 51) { + this->unk_04C = 50; + this->state++; gShowBossHealth = false; - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DOWN, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DOWN, this->sfxSource, 4); - Solar_801A1E14(bossSO->fwork[SO_FWK_4], bossSO->fwork[SO_FWK_5] + 300.0f, bossSO->fwork[SO_FWK_6], - bossSO->fwork[SO_FWK_1], bossSO->fwork[SO_FWK_2], 73.0f, RAND_FLOAT_CENTERED(50.0f), - 80.0f, 40.0f, 8); + Solar_801A1E14(this->fwork[SO_FWK_4], this->fwork[SO_FWK_5] + 300.0f, this->fwork[SO_FWK_6], + this->fwork[SO_FWK_1], this->fwork[SO_FWK_2], 73.0f, RAND_FLOAT_CENTERED(50.0f), 80.0f, + 40.0f, 8); D_i3_801C2768[3] = 6.0f; D_i3_801C2768[2] = 100.0f; @@ -2115,11 +2129,11 @@ void Solar_801A4214(Boss* bossSO) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; - Boss_AwardBonus(bossSO); + Boss_AwardBonus(this); - bossSO->swork[SO_SWK_4]++; + this->swork[SO_SWK_4]++; - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); } break; @@ -2128,10 +2142,10 @@ void Solar_801A4214(Boss* bossSO) { D_i3_801C2740[0] -= 3; } if (D_i3_801C2740[1] >= 33) { - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); D_i3_801C2740[1] -= 4; } else { - bossSO->state++; + this->state++; } break; @@ -2176,42 +2190,42 @@ void Solar_801A4214(Boss* bossSO) { } if (gCsFrameCount == 250) { - bossSO->state++; - bossSO->obj.pos.y = -1600.0f; + this->state++; + this->obj.pos.y = -1600.0f; for (i = 0; i < 2; i++) { if (gEffects[i].obj.status != OBJ_FREE) { Object_Kill(&gEffects[i].obj, gEffects[i].sfxSource); } } - bossSO->timer_058 = 100; + this->timer_058 = 100; } break; case 4: - if (bossSO->timer_058 == 1) { + if (this->timer_058 == 1) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 80); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); - Object_Kill(&bossSO->obj, bossSO->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } break; } } -void Solar_801A48B8(Boss* bossSO) { +void Solar_801A48B8(BossSO* this) { s32 i; - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BROKEN, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BROKEN, this->sfxSource, 4); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 10; - if (bossSO->swork[SO_SWK_0] != 6) { - bossSO->swork[SO_SWK_5] = bossSO->swork[SO_SWK_0]; - bossSO->swork[SO_SWK_6] = bossSO->swork[SO_SWK_1]; - bossSO->swork[SO_SWK_7] = bossSO->unk_04C; + if (this->swork[SO_SWK_0] != 6) { + this->swork[SO_SWK_5] = this->swork[SO_SWK_0]; + this->swork[SO_SWK_6] = this->swork[SO_SWK_1]; + this->swork[SO_SWK_7] = this->unk_04C; } - if ((bossSO->swork[SO_SWK_0] == 4) && (bossSO->unk_04C >= 60) && (bossSO->unk_04C < 67)) { + if ((this->swork[SO_SWK_0] == 4) && (this->unk_04C >= 60) && (this->unk_04C < 67)) { for (i = 4; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.id == OBJ_ACTOR_278) { gActors[i].dmgType = DMG_EXPLOSION; @@ -2223,319 +2237,320 @@ void Solar_801A48B8(Boss* bossSO) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 64; - bossSO->swork[SO_SWK_0] = 6; - bossSO->swork[SO_SWK_1] = 6; - bossSO->unk_04C = 0; - bossSO->fwork[SO_FWK_0] = 0.01f; + this->swork[SO_SWK_0] = 6; + this->swork[SO_SWK_1] = 6; + this->unk_04C = 0; + this->fwork[SO_FWK_0] = 0.01f; - if (((bossSO->swork[SO_SWK_2] > 0) || (bossSO->swork[SO_SWK_3] > 0)) && (gTeamShields[TEAM_ID_SLIPPY] > 0)) { + if (((this->swork[SO_SWK_2] > 0) || (this->swork[SO_SWK_3] > 0)) && (gTeamShields[TEAM_ID_SLIPPY] > 0)) { Radio_PlayMessage(gMsg_ID_7086, RCID_SLIPPY); } } -void Solar_801A4A34(Boss* bossSO) { - if (bossSO->swork[SO_SWK_2] < 0) { - bossSO->swork[SO_SWK_2] = 0; - Solar_801A1E14(bossSO->fwork[SO_FWK_28], bossSO->fwork[SO_FWK_29], bossSO->fwork[SO_FWK_30], - bossSO->fwork[SO_FWK_41], bossSO->fwork[SO_FWK_42], bossSO->fwork[SO_FWK_43], - RAND_FLOAT(-25.0f) - 10.0f, RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 0); - Solar_801A1E14(bossSO->fwork[SO_FWK_22], bossSO->fwork[SO_FWK_23], bossSO->fwork[SO_FWK_24], - bossSO->fwork[SO_FWK_47], bossSO->fwork[SO_FWK_48], bossSO->fwork[SO_FWK_49], - RAND_FLOAT(-25.0f) - 10.0f, RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 1); - Solar_801A1E14(bossSO->fwork[SO_FWK_10], bossSO->fwork[SO_FWK_11], bossSO->fwork[SO_FWK_12], - bossSO->fwork[SO_FWK_35], bossSO->fwork[SO_FWK_36], bossSO->fwork[SO_FWK_37], - RAND_FLOAT(-25.0f) - 10.0f, RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 2); +void Solar_801A4A34(BossSO* this) { + if (this->swork[SO_SWK_2] < 0) { + this->swork[SO_SWK_2] = 0; + Solar_801A1E14(this->fwork[SO_FWK_28], this->fwork[SO_FWK_29], this->fwork[SO_FWK_30], this->fwork[SO_FWK_41], + this->fwork[SO_FWK_42], this->fwork[SO_FWK_43], RAND_FLOAT(-25.0f) - 10.0f, + RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 0); + Solar_801A1E14(this->fwork[SO_FWK_22], this->fwork[SO_FWK_23], this->fwork[SO_FWK_24], this->fwork[SO_FWK_47], + this->fwork[SO_FWK_48], this->fwork[SO_FWK_49], RAND_FLOAT(-25.0f) - 10.0f, + RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 1); + Solar_801A1E14(this->fwork[SO_FWK_10], this->fwork[SO_FWK_11], this->fwork[SO_FWK_12], this->fwork[SO_FWK_35], + this->fwork[SO_FWK_36], this->fwork[SO_FWK_37], RAND_FLOAT(-25.0f) - 10.0f, + RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 2); } - if (bossSO->swork[SO_SWK_3] < 0) { - bossSO->swork[SO_SWK_3] = 0; - Solar_801A1E14(bossSO->fwork[SO_FWK_25], bossSO->fwork[SO_FWK_26], bossSO->fwork[SO_FWK_27], - bossSO->fwork[SO_FWK_38], bossSO->fwork[SO_FWK_39], bossSO->fwork[SO_FWK_40], - RAND_FLOAT(25.0f) + 10.0f, RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 5); - Solar_801A1E14(bossSO->fwork[SO_FWK_19], bossSO->fwork[SO_FWK_20], bossSO->fwork[SO_FWK_21], - bossSO->fwork[SO_FWK_44], bossSO->fwork[SO_FWK_45], bossSO->fwork[SO_FWK_46], - RAND_FLOAT(25.0f) + 10.0f, RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 4); - Solar_801A1E14(bossSO->fwork[SO_FWK_7], bossSO->fwork[SO_FWK_8], bossSO->fwork[SO_FWK_9], - bossSO->fwork[SO_FWK_32], bossSO->fwork[SO_FWK_33], bossSO->fwork[SO_FWK_34], - RAND_FLOAT(25.0f) + 10.0f, RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 3); + if (this->swork[SO_SWK_3] < 0) { + this->swork[SO_SWK_3] = 0; + Solar_801A1E14(this->fwork[SO_FWK_25], this->fwork[SO_FWK_26], this->fwork[SO_FWK_27], this->fwork[SO_FWK_38], + this->fwork[SO_FWK_39], this->fwork[SO_FWK_40], RAND_FLOAT(25.0f) + 10.0f, + RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 5); + Solar_801A1E14(this->fwork[SO_FWK_19], this->fwork[SO_FWK_20], this->fwork[SO_FWK_21], this->fwork[SO_FWK_44], + this->fwork[SO_FWK_45], this->fwork[SO_FWK_46], RAND_FLOAT(25.0f) + 10.0f, + RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 4); + Solar_801A1E14(this->fwork[SO_FWK_7], this->fwork[SO_FWK_8], this->fwork[SO_FWK_9], this->fwork[SO_FWK_32], + this->fwork[SO_FWK_33], this->fwork[SO_FWK_34], RAND_FLOAT(25.0f) + 10.0f, + RAND_FLOAT(25.0f) + 30.0f, RAND_FLOAT_CENTERED(25.0f) - 50.0f, 3); } - switch (bossSO->unk_04C) { + switch (this->unk_04C) { case 30: - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_DAMAGE, this->sfxSource, 4); /* fallthrough */ case 35: case 97: - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BROKEN, bossSO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_BROKEN, this->sfxSource, 4); break; } - if (bossSO->unk_04C == 119) { - bossSO->swork[SO_SWK_0] = bossSO->swork[SO_SWK_5]; - bossSO->swork[SO_SWK_1] = bossSO->swork[SO_SWK_6]; - if ((bossSO->swork[SO_SWK_5] == 2) || (bossSO->swork[SO_SWK_5] == 3)) { - bossSO->unk_04C = bossSO->swork[SO_SWK_7]; + if (this->unk_04C == 119) { + this->swork[SO_SWK_0] = this->swork[SO_SWK_5]; + this->swork[SO_SWK_1] = this->swork[SO_SWK_6]; + if ((this->swork[SO_SWK_5] == 2) || (this->swork[SO_SWK_5] == 3)) { + this->unk_04C = this->swork[SO_SWK_7]; } else { - bossSO->unk_04C = 0; + this->unk_04C = 0; } - bossSO->fwork[SO_FWK_0] = 0.01f; + this->fwork[SO_FWK_0] = 0.01f; } } -void Solar_801A4EC0(Boss* bossSO) { - bossSO->swork[SO_SWK_0] = 7; - bossSO->swork[SO_SWK_1] = 5; - bossSO->fwork[SO_FWK_0] = 0.01f; - bossSO->unk_04C = 0; - bossSO->state = 0; - bossSO->fwork[SO_FWK_31] = bossSO->obj.rot.y = 0.0f; +void Solar_801A4EC0(BossSO* this) { + this->swork[SO_SWK_0] = 7; + this->swork[SO_SWK_1] = 5; + this->fwork[SO_FWK_0] = 0.01f; + this->unk_04C = 0; + this->state = 0; + this->fwork[SO_FWK_31] = this->obj.rot.y = 0.0f; } -void Solar_801A4EF8(Boss* bossSO) { +void Solar_801A4EF8(BossSO* this) { s32 i; - if (bossSO->swork[SO_SWK_11] != 0) { - bossSO->swork[SO_SWK_11]--; + if (this->swork[SO_SWK_11] != 0) { + this->swork[SO_SWK_11]--; } - switch (bossSO->state) { + switch (this->state) { case 0: - bossSO->unk_04C = 0; - if (bossSO->fwork[SO_FWK_31] > 20.0f) { - bossSO->state++; - bossSO->swork[SO_SWK_11] = 108; - bossSO->fwork[SO_FWK_0] = 0.01f; - bossSO->unk_04C = 56; + this->unk_04C = 0; + if (this->fwork[SO_FWK_31] > 20.0f) { + this->state++; + this->swork[SO_SWK_11] = 108; + this->fwork[SO_FWK_0] = 0.01f; + this->unk_04C = 56; } - if (bossSO->obj.rot.y == 0.0f) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, bossSO->sfxSource, 4); + if (this->obj.rot.y == 0.0f) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, this->sfxSource, 4); } - bossSO->fwork[SO_FWK_31] += 0.5f; - bossSO->obj.rot.y += bossSO->fwork[SO_FWK_31]; - if (bossSO->obj.rot.y >= 360.0f) { - bossSO->obj.rot.y -= 360.0f; - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, bossSO->sfxSource, 4); + this->fwork[SO_FWK_31] += 0.5f; + + this->obj.rot.y += this->fwork[SO_FWK_31]; + if (this->obj.rot.y >= 360.0f) { + this->obj.rot.y -= 360.0f; + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, this->sfxSource, 4); } - bossSO->rot_078.y = bossSO->obj.rot.y; + this->rot_078.y = this->obj.rot.y; break; case 1: - bossSO->obj.rot.y += bossSO->fwork[SO_FWK_31]; - bossSO->unk_04C = 56; - if (bossSO->obj.rot.y >= 360.0f) { - bossSO->obj.rot.y -= 360.0f; - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, bossSO->sfxSource, 4); + this->obj.rot.y += this->fwork[SO_FWK_31]; + this->unk_04C = 56; + if (this->obj.rot.y >= 360.0f) { + this->obj.rot.y -= 360.0f; + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_ROLL, this->sfxSource, 4); } - if (bossSO->swork[SO_SWK_11] <= 45) { - Math_SmoothStepToF(&bossSO->obj.pos.y, -1000.0f, 0.1f, 20.0f, 0.1f); + if (this->swork[SO_SWK_11] <= 45) { + Math_SmoothStepToF(&this->obj.pos.y, -1000.0f, 0.1f, 20.0f, 0.1f); } - if (bossSO->swork[SO_SWK_11] == 30) { - Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 20.0f, 1); + if (this->swork[SO_SWK_11] == 30) { + Solar_801A0CEC(&gActors[10], this->obj.pos.x, this->obj.pos.z + 1000.0f, 20.0f, 1); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 70; for (i = 0; i < 4; i++) { - Solar_8019F038(bossSO->obj.pos.x + 100.0f, 100.0f, bossSO->obj.pos.z + 1100.0f, + Solar_8019F038(this->obj.pos.x + 100.0f, 100.0f, this->obj.pos.z + 1100.0f, D_i3_801BF8F0[i].x + RAND_FLOAT_CENTERED(2.0f), D_i3_801BF8F0[i].y + 10.0f + RAND_FLOAT_CENTERED(2.0f), RAND_FLOAT(-10.0f) - 10.0f); - Solar_8019F038(bossSO->obj.pos.x - 100.0f, 100.0f, bossSO->obj.pos.z + 1100.0f, + Solar_8019F038(this->obj.pos.x - 100.0f, 100.0f, this->obj.pos.z + 1100.0f, D_i3_801BF8F0[i].x + RAND_FLOAT_CENTERED(2.0f), D_i3_801BF8F0[i].y + 10.0f + RAND_FLOAT_CENTERED(2.0f), RAND_FLOAT(-10.0f) - 10.0f); } } - if (bossSO->swork[SO_SWK_11] == 16) { + if (this->swork[SO_SWK_11] == 16) { gActors[10].dmgType = DMG_EXPLOSION; } - if (bossSO->obj.pos.y <= -900.0f) { - bossSO->state++; - bossSO->swork[SO_SWK_11] = 500; - bossSO->obj.pos.y = -1500.0f; - bossSO->fwork[SO_FWK_3] = 4800.0f; - bossSO->obj.pos.z = gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3]; - bossSO->swork[SO_SWK_1] = 0; - bossSO->rot_078.y = bossSO->obj.rot.y = 0.0f; - bossSO->vel.y = 0.0f; - bossSO->obj.rot.x = 0.0f; + if (this->obj.pos.y <= -900.0f) { + this->state++; + this->swork[SO_SWK_11] = 500; + this->obj.pos.y = -1500.0f; + this->fwork[SO_FWK_3] = 4800.0f; + this->obj.pos.z = gPlayer[0].trueZpos - this->fwork[SO_FWK_3]; + this->swork[SO_SWK_1] = 0; + this->rot_078.y = this->obj.rot.y = 0.0f; + this->vel.y = 0.0f; + this->obj.rot.x = 0.0f; } - bossSO->rot_078.y = bossSO->obj.rot.y; + this->rot_078.y = this->obj.rot.y; break; case 2: - bossSO->unk_04C = 0; + this->unk_04C = 0; - if (bossSO->swork[SO_SWK_11] == 300) { + if (this->swork[SO_SWK_11] == 300) { gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 170; gCameraShake = 130; } - if (bossSO->swork[SO_SWK_11] == 200) { - Solar_801A0CEC(&gActors[9], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 20.0f, 1); + if (this->swork[SO_SWK_11] == 200) { + Solar_801A0CEC(&gActors[9], this->obj.pos.x, this->obj.pos.z + 1000.0f, 20.0f, 1); } - if (bossSO->swork[SO_SWK_11] < 200) { - bossSO->unk_04C = 98; - bossSO->rot_078.y += bossSO->fwork[SO_FWK_31]; + if (this->swork[SO_SWK_11] < 200) { + this->unk_04C = 98; + this->rot_078.y += this->fwork[SO_FWK_31]; - if (bossSO->swork[SO_SWK_11] == 170) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_CRY, bossSO->sfxSource, 4); - bossSO->obj.pos.y = -500.0f; + if (this->swork[SO_SWK_11] == 170) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_CRY, this->sfxSource, 4); + this->obj.pos.y = -500.0f; gActors[9].dmgType = DMG_EXPLOSION; } - if (bossSO->swork[SO_SWK_11] <= 170) { - bossSO->vel.y = COS_DEG(bossSO->obj.rot.x) * 80.0f; - bossSO->vel.z = (SIN_DEG(bossSO->obj.rot.x) * 30.0f) + gPlayer[0].vel.z; + if (this->swork[SO_SWK_11] <= 170) { + this->vel.y = COS_DEG(this->obj.rot.x) * 80.0f; + this->vel.z = (SIN_DEG(this->obj.rot.x) * 30.0f) + gPlayer[0].vel.z; } - if (bossSO->obj.rot.x < 190.0f) { - bossSO->obj.rot.x += 1.0f; + if (this->obj.rot.x < 190.0f) { + this->obj.rot.x += 1.0f; } - if (bossSO->swork[SO_SWK_11] == 50) { - Solar_801A0CEC(&gActors[10], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 80.0f, 2); + if (this->swork[SO_SWK_11] == 50) { + Solar_801A0CEC(&gActors[10], this->obj.pos.x, this->obj.pos.z + 1000.0f, 80.0f, 2); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 100; gCameraShake = 10; } - if (bossSO->obj.pos.y < -1500.0f) { - bossSO->state++; - bossSO->swork[SO_SWK_11] = 100; - bossSO->obj.pos.y = -500.0f; - bossSO->fwork[SO_FWK_3] = 4800.0f; - bossSO->obj.pos.z = gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3]; - bossSO->unk_04C = 0; - bossSO->obj.rot.x = 0.0f; - bossSO->fwork[SO_FWK_31] = bossSO->vel.y = bossSO->vel.z = 0.0f; - bossSO->obj.rot.y = 330.0f; + if (this->obj.pos.y < -1500.0f) { + this->state++; + this->swork[SO_SWK_11] = 100; + this->obj.pos.y = -500.0f; + this->fwork[SO_FWK_3] = 4800.0f; + this->obj.pos.z = gPlayer[0].trueZpos - this->fwork[SO_FWK_3]; + this->unk_04C = 0; + this->obj.rot.x = 0.0f; + this->fwork[SO_FWK_31] = this->vel.y = this->vel.z = 0.0f; + this->obj.rot.y = 330.0f; } } break; case 3: - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); - if (bossSO->swork[SO_SWK_11] == 65) { - Solar_801A0CEC(&gActors[9], bossSO->obj.pos.x, bossSO->obj.pos.z + 1000.0f, 20.0f, 1); + Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); + if (this->swork[SO_SWK_11] == 65) { + Solar_801A0CEC(&gActors[9], this->obj.pos.x, this->obj.pos.z + 1000.0f, 20.0f, 1); } - if (bossSO->swork[SO_SWK_11] == 0) { - bossSO->swork[SO_SWK_11] = 220; + if (this->swork[SO_SWK_11] == 0) { + this->swork[SO_SWK_11] = 220; } - if (bossSO->swork[SO_SWK_11] == 210) { - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1] = 1; + if (this->swork[SO_SWK_11] == 210) { + this->unk_04C = 0; + this->swork[SO_SWK_1] = 1; } - if (bossSO->swork[SO_SWK_11] >= 100) { - Math_SmoothStepToF(&bossSO->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); + if (this->swork[SO_SWK_11] >= 100) { + Math_SmoothStepToF(&this->obj.pos.y, 180.0f, 0.1f, 10.0f, 0.1f); } - if (bossSO->swork[SO_SWK_11] == 150) { - Solar_801A3468(bossSO); - bossSO->fwork[SO_FWK_0] = 0.01f; + if (this->swork[SO_SWK_11] == 150) { + Solar_801A3468(this); + this->fwork[SO_FWK_0] = 0.01f; } - if (bossSO->swork[SO_SWK_11] == 50) { + if (this->swork[SO_SWK_11] == 50) { gActors[9].dmgType = DMG_EXPLOSION; } break; } } -void Solar_801A56B8(Boss* bossSO) { - switch (bossSO->swork[SO_SWK_1]) { +void Solar_801A56B8(BossSO* this) { + switch (this->swork[SO_SWK_1]) { case 2: - if (((bossSO->unk_04C == 89) && (bossSO->state == 2)) || (bossSO->swork[SO_SWK_2] == 0)) { - bossSO->unk_04C = 0; - bossSO->state = 0; - bossSO->rot_078.y = 0.0f; + if (((this->unk_04C == 89) && (this->state == 2)) || (this->swork[SO_SWK_2] == 0)) { + this->unk_04C = 0; + this->state = 0; + this->rot_078.y = 0.0f; } - if (bossSO->unk_04C == 89) { - bossSO->state++; - bossSO->rot_078.y += 15.0f; + if (this->unk_04C == 89) { + this->state++; + this->rot_078.y += 15.0f; } - Math_SmoothStepToAngle(&bossSO->obj.rot.y, bossSO->rot_078.y, 1.0f, 3.0f, 1.0f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->rot_078.y, 1.0f, 3.0f, 1.0f); - if (bossSO->unk_04C > 18) { - bossSO->info.hitbox[20] = 715.0f; - bossSO->info.hitbox[22] = 440.0f; - bossSO->info.hitbox[24] = 110.0f; + if (this->unk_04C > 18) { + this->info.hitbox[20] = 715.0f; + this->info.hitbox[22] = 440.0f; + this->info.hitbox[24] = 110.0f; } - if (bossSO->unk_04C > 36) { - bossSO->info.hitbox[20] = 220.0f; - bossSO->info.hitbox[22] = 715.0f; - bossSO->info.hitbox[24] = 220.0f; + if (this->unk_04C > 36) { + this->info.hitbox[20] = 220.0f; + this->info.hitbox[22] = 715.0f; + this->info.hitbox[24] = 220.0f; } break; case 4: - if ((bossSO->unk_04C == 99) || (bossSO->swork[SO_SWK_2] == 0)) { - bossSO->unk_04C = 0; - if ((bossSO->swork[SO_SWK_3] != 0) || (bossSO->swork[SO_SWK_2] != 0)) { - bossSO->swork[SO_SWK_1] = 5; + if ((this->unk_04C == 99) || (this->swork[SO_SWK_2] == 0)) { + this->unk_04C = 0; + if ((this->swork[SO_SWK_3] != 0) || (this->swork[SO_SWK_2] != 0)) { + this->swork[SO_SWK_1] = 5; } else { - bossSO->swork[SO_SWK_1] = 7; + this->swork[SO_SWK_1] = 7; } } - if (bossSO->unk_04C > 20) { - bossSO->info.hitbox[20] = 715.0f; - bossSO->info.hitbox[22] = 110.0f; - bossSO->info.hitbox[24] = 275.0f; + if (this->unk_04C > 20) { + this->info.hitbox[20] = 715.0f; + this->info.hitbox[22] = 110.0f; + this->info.hitbox[24] = 275.0f; } - if (bossSO->unk_04C > 84) { - bossSO->info.hitbox[20] = 220.0f; - bossSO->info.hitbox[22] = 715.0f; - bossSO->info.hitbox[24] = 220.0f; + if (this->unk_04C > 84) { + this->info.hitbox[20] = 220.0f; + this->info.hitbox[22] = 715.0f; + this->info.hitbox[24] = 220.0f; } break; case 5: - bossSO->fwork[SO_FWK_3] = 4800.0f; + this->fwork[SO_FWK_3] = 4800.0f; - if (bossSO->unk_04C == 65) { - bossSO->timer_050 = 30; + if (this->unk_04C == 65) { + this->timer_050 = 30; } - if (bossSO->timer_050 != 0) { - bossSO->unk_04C = 65; + if (this->timer_050 != 0) { + this->unk_04C = 65; } - if ((bossSO->unk_04C == 65) && ((gGameFrameCount % 4) == 0)) { - Solar_8019FFC0(bossSO, bossSO->fwork[SO_FWK_4] + 125.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 600.0f, ((f32) bossSO->timer_050 * 0.2f) + 4.0f, 1); - Solar_8019FFC0(bossSO, bossSO->fwork[SO_FWK_4] - 125.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 600.0f, ((f32) bossSO->timer_050 * 0.2f) + 4.0f, 2); - Solar_801A1EB0(bossSO, bossSO->fwork[SO_FWK_4], 25.0f, bossSO->fwork[SO_FWK_5] - 100.0f, - bossSO->fwork[SO_FWK_6] + 300.0f); + if ((this->unk_04C == 65) && ((gGameFrameCount % 4) == 0)) { + Solar_8019FFC0(this, this->fwork[SO_FWK_4] + 125.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 600.0f, ((f32) this->timer_050 * 0.2f) + 4.0f, 1); + Solar_8019FFC0(this, this->fwork[SO_FWK_4] - 125.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 600.0f, ((f32) this->timer_050 * 0.2f) + 4.0f, 2); + Solar_801A1EB0(this, this->fwork[SO_FWK_4], 25.0f, this->fwork[SO_FWK_5] - 100.0f, + this->fwork[SO_FWK_6] + 300.0f); } break; case 7: - if (bossSO->unk_04C < 50) { - if (bossSO->fwork[SO_FWK_31] < 22.0f) { - bossSO->fwork[SO_FWK_31] += 0.5f; + if (this->unk_04C < 50) { + if (this->fwork[SO_FWK_31] < 22.0f) { + this->fwork[SO_FWK_31] += 0.5f; } - bossSO->obj.rot.y += bossSO->fwork[SO_FWK_31]; + this->obj.rot.y += this->fwork[SO_FWK_31]; } - if ((bossSO->unk_04C >= 50) && (bossSO->unk_04C <= 100)) { - if (bossSO->fwork[SO_FWK_31] > 0.0f) { - bossSO->fwork[SO_FWK_31] -= 0.5f; + if ((this->unk_04C >= 50) && (this->unk_04C <= 100)) { + if (this->fwork[SO_FWK_31] > 0.0f) { + this->fwork[SO_FWK_31] -= 0.5f; } - bossSO->obj.rot.y += bossSO->fwork[SO_FWK_31]; + this->obj.rot.y += this->fwork[SO_FWK_31]; } - if (bossSO->unk_04C >= 100) { - Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 1.0f, 2.0f, 1.0f); - bossSO->fwork[SO_FWK_31] = 0.0f; + if (this->unk_04C >= 100) { + Math_SmoothStepToAngle(&this->obj.rot.y, 0.0f, 1.0f, 2.0f, 1.0f); + this->fwork[SO_FWK_31] = 0.0f; } - if (bossSO->unk_04C == 120) { - bossSO->swork[SO_SWK_1] = 5; - bossSO->unk_04C = 0; - bossSO->fwork[SO_FWK_0] = 0.1f; + if (this->unk_04C == 120) { + this->swork[SO_SWK_1] = 5; + this->unk_04C = 0; + this->fwork[SO_FWK_0] = 0.1f; } break; } @@ -2546,27 +2561,27 @@ BossSOfunc D_i3_801BF980[9] = { Solar_801A4214, Solar_801A4A34, Solar_801A4EF8, Solar_801A56B8, }; -void Solar_Boss_Update(Boss* bossSO) { +void Solar_Boss_Update(BossSO* this) { f32 sp1CC; f32 sp1C8; f32 sp1C4; f32 sp1C0; s32 sp1BC; s32 sp1B8; - Vec3f sp50[30]; - Vec3f sp44; - Vec3f sp38; + Vec3f frameTable[30]; + Vec3f src; + Vec3f dest; gBossFrameCount++; - if (bossSO->swork[SO_SWK_9] != 0) { - bossSO->swork[SO_SWK_9]--; + if (this->swork[SO_SWK_9] != 0) { + this->swork[SO_SWK_9]--; } - if (bossSO->swork[SO_SWK_8] != 0) { - bossSO->swork[SO_SWK_8]--; + if (this->swork[SO_SWK_8] != 0) { + this->swork[SO_SWK_8]--; } - if (bossSO->swork[SO_SWK_10] != 0) { - bossSO->swork[SO_SWK_10]--; + if (this->swork[SO_SWK_10] != 0) { + this->swork[SO_SWK_10]--; } if ((gBossFrameCount == 200) && (gTeamShields[TEAM_ID_FALCO] != 0)) { @@ -2579,182 +2594,181 @@ void Solar_Boss_Update(Boss* bossSO) { Radio_PlayMessage(gMsg_ID_10320, RCID_PEPPY); } - if (bossSO->health != 0) { - Math_SmoothStepToF(&bossSO->obj.pos.z, gPlayer[0].trueZpos - bossSO->fwork[SO_FWK_3], 1.0f, 60.0f, 1.0f); + if (this->health != 0) { + Math_SmoothStepToF(&this->obj.pos.z, gPlayer[0].trueZpos - this->fwork[SO_FWK_3], 1.0f, 60.0f, 1.0f); } else { - Math_SmoothStepToF(&bossSO->obj.pos.z, -(gPathProgress + 2600.0f), 1.0f, 40.0f, 1.0f); + Math_SmoothStepToF(&this->obj.pos.z, -(gPathProgress + 2600.0f), 1.0f, 40.0f, 1.0f); } - if (bossSO->swork[SO_SWK_2] != 0) { - bossSO->info.hitbox[7] = bossSO->fwork[SO_FWK_12] - bossSO->obj.pos.z; - bossSO->info.hitbox[9] = bossSO->fwork[SO_FWK_11] - bossSO->obj.pos.y; - bossSO->info.hitbox[11] = bossSO->fwork[SO_FWK_10] - bossSO->obj.pos.x; - bossSO->info.hitbox[13] = bossSO->fwork[SO_FWK_24] - bossSO->obj.pos.z; - bossSO->info.hitbox[15] = bossSO->fwork[SO_FWK_23] - bossSO->obj.pos.y; - bossSO->info.hitbox[17] = bossSO->fwork[SO_FWK_22] - bossSO->obj.pos.x; + if (this->swork[SO_SWK_2] != 0) { + this->info.hitbox[7] = this->fwork[SO_FWK_12] - this->obj.pos.z; + this->info.hitbox[9] = this->fwork[SO_FWK_11] - this->obj.pos.y; + this->info.hitbox[11] = this->fwork[SO_FWK_10] - this->obj.pos.x; + this->info.hitbox[13] = this->fwork[SO_FWK_24] - this->obj.pos.z; + this->info.hitbox[15] = this->fwork[SO_FWK_23] - this->obj.pos.y; + this->info.hitbox[17] = this->fwork[SO_FWK_22] - this->obj.pos.x; - Matrix_RotateY(gCalcMatrix, -bossSO->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_NEW); - sp44.x = bossSO->fwork[SO_FWK_28] - bossSO->obj.pos.x; - sp44.y = bossSO->fwork[SO_FWK_29] - bossSO->obj.pos.y; - sp44.z = bossSO->fwork[SO_FWK_30] - bossSO->obj.pos.z; + src.x = this->fwork[SO_FWK_28] - this->obj.pos.x; + src.y = this->fwork[SO_FWK_29] - this->obj.pos.y; + src.z = this->fwork[SO_FWK_30] - this->obj.pos.z; - Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); - bossSO->info.hitbox[19] = sp38.z; - bossSO->info.hitbox[21] = sp38.y; - bossSO->info.hitbox[23] = sp38.x; + this->info.hitbox[19] = dest.z; + this->info.hitbox[21] = dest.y; + this->info.hitbox[23] = dest.x; } - if (bossSO->swork[SO_SWK_3] != 0) { - bossSO->info.hitbox[25] = bossSO->fwork[SO_FWK_9] - bossSO->obj.pos.z; - bossSO->info.hitbox[27] = bossSO->fwork[SO_FWK_8] - bossSO->obj.pos.y; - bossSO->info.hitbox[29] = bossSO->fwork[SO_FWK_7] - bossSO->obj.pos.x; - bossSO->info.hitbox[31] = bossSO->fwork[SO_FWK_21] - bossSO->obj.pos.z; - bossSO->info.hitbox[33] = bossSO->fwork[SO_FWK_20] - bossSO->obj.pos.y; - bossSO->info.hitbox[35] = bossSO->fwork[SO_FWK_19] - bossSO->obj.pos.x; - bossSO->info.hitbox[37] = bossSO->fwork[SO_FWK_27] - bossSO->obj.pos.z; - bossSO->info.hitbox[39] = bossSO->fwork[SO_FWK_26] - bossSO->obj.pos.y; - bossSO->info.hitbox[41] = bossSO->fwork[SO_FWK_25] - bossSO->obj.pos.x; + if (this->swork[SO_SWK_3] != 0) { + this->info.hitbox[25] = this->fwork[SO_FWK_9] - this->obj.pos.z; + this->info.hitbox[27] = this->fwork[SO_FWK_8] - this->obj.pos.y; + this->info.hitbox[29] = this->fwork[SO_FWK_7] - this->obj.pos.x; + this->info.hitbox[31] = this->fwork[SO_FWK_21] - this->obj.pos.z; + this->info.hitbox[33] = this->fwork[SO_FWK_20] - this->obj.pos.y; + this->info.hitbox[35] = this->fwork[SO_FWK_19] - this->obj.pos.x; + this->info.hitbox[37] = this->fwork[SO_FWK_27] - this->obj.pos.z; + this->info.hitbox[39] = this->fwork[SO_FWK_26] - this->obj.pos.y; + this->info.hitbox[41] = this->fwork[SO_FWK_25] - this->obj.pos.x; } - if (((gGameFrameCount % 8) == 0) && (bossSO->fwork[SO_FWK_3] < 4800.0f)) { - if (Play_CheckDynaFloorCollision(&sp1C0, &sp1B8, bossSO->obj.pos.x, bossSO->obj.pos.y - 160.0f, - bossSO->obj.pos.z)) { - Solar_801A1EB0(bossSO, bossSO->obj.pos.x, 50.0f, sp1C0 - 170.0f, bossSO->obj.pos.z + 100.0f); + if (((gGameFrameCount % 8) == 0) && (this->fwork[SO_FWK_3] < 4800.0f)) { + if (Play_CheckDynaFloorCollision(&sp1C0, &sp1B8, this->obj.pos.x, this->obj.pos.y - 160.0f, this->obj.pos.z)) { + Solar_801A1EB0(this, this->obj.pos.x, 50.0f, sp1C0 - 170.0f, this->obj.pos.z + 100.0f); } - if ((bossSO->swork[SO_SWK_2] != 0) && - Play_CheckDynaFloorCollision(&sp1C0, &sp1B8, bossSO->fwork[SO_FWK_16], bossSO->fwork[SO_FWK_17], - bossSO->fwork[SO_FWK_18])) { - Solar_801A1EB0(bossSO, bossSO->fwork[SO_FWK_16], 50.0f, sp1C0 - 150.f, bossSO->fwork[SO_FWK_18] + 150.0f); + if ((this->swork[SO_SWK_2] != 0) && + Play_CheckDynaFloorCollision(&sp1C0, &sp1B8, this->fwork[SO_FWK_16], this->fwork[SO_FWK_17], + this->fwork[SO_FWK_18])) { + Solar_801A1EB0(this, this->fwork[SO_FWK_16], 50.0f, sp1C0 - 150.f, this->fwork[SO_FWK_18] + 150.0f); } - if ((bossSO->swork[SO_SWK_3] != 0) && - Play_CheckDynaFloorCollision(&sp1C0, &sp1B8, bossSO->fwork[SO_FWK_13], bossSO->fwork[SO_FWK_14], - bossSO->fwork[SO_FWK_15])) { - Solar_801A1EB0(bossSO, bossSO->fwork[SO_FWK_13], 50.0f, sp1C0 - 150.0f, bossSO->fwork[SO_FWK_15] + 150.0f); + if ((this->swork[SO_SWK_3] != 0) && + Play_CheckDynaFloorCollision(&sp1C0, &sp1B8, this->fwork[SO_FWK_13], this->fwork[SO_FWK_14], + this->fwork[SO_FWK_15])) { + Solar_801A1EB0(this, this->fwork[SO_FWK_13], 50.0f, sp1C0 - 150.0f, this->fwork[SO_FWK_15] + 150.0f); } } - if ((((gGameFrameCount % 4) == 0) || (bossSO->fwork[SO_FWK_31] != 0.0f)) && - ((bossSO->swork[SO_SWK_0] != 7) || ((gGameFrameCount % 2) == 0))) { - if ((bossSO->swork[SO_SWK_2] == 0) && ((bossSO->health > 0) || (bossSO->state < 2))) { - Solar_8019FF44(bossSO, bossSO->fwork[SO_FWK_10], bossSO->fwork[SO_FWK_11], bossSO->fwork[SO_FWK_12], - bossSO->fwork[SO_FWK_31] - 20.0f, -1.0f); + if ((((gGameFrameCount % 4) == 0) || (this->fwork[SO_FWK_31] != 0.0f)) && + ((this->swork[SO_SWK_0] != 7) || ((gGameFrameCount % 2) == 0))) { + if ((this->swork[SO_SWK_2] == 0) && ((this->health > 0) || (this->state < 2))) { + Solar_8019FF44(this, this->fwork[SO_FWK_10], this->fwork[SO_FWK_11], this->fwork[SO_FWK_12], + this->fwork[SO_FWK_31] - 20.0f, -1.0f); } - if ((bossSO->swork[SO_SWK_3] == 0) && ((bossSO->health > 0) || (bossSO->state < 2))) { - Solar_8019FF44(bossSO, bossSO->fwork[SO_FWK_7], bossSO->fwork[SO_FWK_8], bossSO->fwork[SO_FWK_9], - bossSO->fwork[SO_FWK_31] - 20.0f, 1.0f); + if ((this->swork[SO_SWK_3] == 0) && ((this->health > 0) || (this->state < 2))) { + Solar_8019FF44(this, this->fwork[SO_FWK_7], this->fwork[SO_FWK_8], this->fwork[SO_FWK_9], + this->fwork[SO_FWK_31] - 20.0f, 1.0f); } } - Math_SmoothStepToF(&bossSO->fwork[0], 1.0f, 0.01f, 0.01f, 0.0f); + Math_SmoothStepToF(&this->fwork[0], 1.0f, 0.01f, 0.01f, 0.0f); - if ((bossSO->health > 0) || (bossSO->swork[SO_SWK_0] == 0)) { - D_i3_801BF980[bossSO->swork[SO_SWK_0]](bossSO); + if ((this->health > 0) || (this->swork[SO_SWK_0] == 0)) { + D_i3_801BF980[this->swork[SO_SWK_0]](this); } - if (bossSO->timer_058 != 0) { - Solar_801A4214(bossSO); + if (this->timer_058 != 0) { + Solar_801A4214(this); } - switch (bossSO->swork[SO_SWK_1]) { + switch (this->swork[SO_SWK_1]) { case 0: - bossSO->unk_04C++; - if (bossSO->unk_04C == 75) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_CRY, bossSO->sfxSource, 4); + this->unk_04C++; + if (this->unk_04C == 75) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_CRY, this->sfxSource, 4); } - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_601388C)) { - if (bossSO->health != 0) { - bossSO->unk_04C = 0; - bossSO->swork[SO_SWK_1]++; - bossSO->fwork[SO_FWK_0] = 0.01f; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_601388C)) { + if (this->health != 0) { + this->unk_04C = 0; + this->swork[SO_SWK_1]++; + this->fwork[SO_FWK_0] = 0.01f; } else { - bossSO->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 1; + this->unk_04C = Animation_GetFrameCount(&D_SO_601388C) - 1; } } - sp1BC = Animation_GetFrameData(&D_SO_601388C, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_601388C, this->unk_04C, frameTable); break; case 1: - bossSO->unk_04C++; - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_600D3DC)) { - bossSO->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_600D3DC)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_600D3DC, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_600D3DC, this->unk_04C, frameTable); break; case 2: - bossSO->unk_04C++; - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_600E2C4)) { - bossSO->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_600E2C4)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_600E2C4, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_600E2C4, this->unk_04C, frameTable); break; case 3: - bossSO->unk_04C++; - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_600F744)) { - bossSO->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_600F744)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_600F744, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_600F744, this->unk_04C, frameTable); break; case 4: - bossSO->unk_04C++; - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_600C15C)) { - bossSO->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_600C15C)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_600C15C, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_600C15C, this->unk_04C, frameTable); break; case 5: case 8: case 9: - bossSO->unk_04C++; - if ((bossSO->unk_04C == 45) && (bossSO->health != 0)) { - AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_CRY, bossSO->sfxSource, 4); + this->unk_04C++; + if ((this->unk_04C == 45) && (this->health != 0)) { + AUDIO_PLAY_SFX(NA_SE_EN_SOBOSS_CRY, this->sfxSource, 4); } - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_6012C00)) { - bossSO->unk_04C = 0; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_6012C00)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_6012C00, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_6012C00, this->unk_04C, frameTable); break; case 6: - bossSO->unk_04C++; - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_600B1B4)) { - bossSO->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_600B1B4)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_600B1B4, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_600B1B4, this->unk_04C, frameTable); break; case 7: - bossSO->unk_04C++; - if (bossSO->unk_04C >= Animation_GetFrameCount(&D_SO_6009D30)) { - bossSO->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SO_6009D30)) { + this->unk_04C = 0; } - sp1BC = Animation_GetFrameData(&D_SO_6009D30, bossSO->unk_04C, sp50); + sp1BC = Animation_GetFrameData(&D_SO_6009D30, this->unk_04C, frameTable); break; } - Matrix_RotateZ(gCalcMatrix, -bossSO->vwork[SO_VWK_29].z * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -bossSO->vwork[SO_VWK_29].x * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -bossSO->vwork[SO_VWK_29].y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -this->vwork[SO_VWK_29].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -this->vwork[SO_VWK_29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->vwork[SO_VWK_29].y * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -bossSO->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, -bossSO->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -bossSO->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_APPLY); - if ((bossSO->health > 0) && (bossSO->swork[SO_SWK_0] == 1)) { - sp44.x = gPlayer[0].pos.x - bossSO->obj.pos.x; - sp44.y = gPlayer[0].pos.y - bossSO->obj.pos.y; - sp44.z = gPlayer[0].pos.z - bossSO->obj.pos.z; + if ((this->health > 0) && (this->swork[SO_SWK_0] == 1)) { + src.x = gPlayer[0].pos.x - this->obj.pos.x; + src.y = gPlayer[0].pos.y - this->obj.pos.y; + src.z = gPlayer[0].pos.z - this->obj.pos.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - sp1C4 = Math_RadToDeg(Math_Atan2F(sp38.x, sp38.z)); - sp1CC = sqrtf(SQ(sp38.x) + SQ(sp38.z)); - sp1C8 = Math_RadToDeg(-Math_Atan2F(sp38.y, sp1CC)); + sp1C4 = Math_RadToDeg(Math_Atan2F(dest.x, dest.z)); + sp1CC = sqrtf(SQ(dest.x) + SQ(dest.z)); + sp1C8 = Math_RadToDeg(-Math_Atan2F(dest.y, sp1CC)); if ((sp1C8 > 30.0f) && (sp1C8 <= 180.0f)) { sp1C8 = 30.0f; @@ -2775,26 +2789,27 @@ void Solar_Boss_Update(Boss* bossSO) { Math_SmoothStepToAngle(&D_i3_801C2768[0], 0.0f, 0.2f, 4.0f, 0.1f); } - Math_SmoothStepToVec3fArray(sp50, bossSO->vwork, 1, sp1BC, bossSO->fwork[SO_FWK_0], 100.0f, 0.0f); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, sp1BC, this->fwork[SO_FWK_0], 100.0f, 0.0f); - if ((bossSO->dmgType != DMG_NONE) && (bossSO->health > 0)) { - bossSO->dmgType = DMG_NONE; - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, bossSO->sfxSource, 4); - if (!((bossSO->swork[SO_SWK_0] == 0) || (bossSO->swork[SO_SWK_0] == 2) || (bossSO->swork[SO_SWK_0] == 3) || - (bossSO->swork[SO_SWK_0] == 6) || ((bossSO->swork[SO_SWK_0] == 7) && (bossSO->state == 2)))) { - Solar_801A3C4C(bossSO); + if ((this->dmgType != DMG_NONE) && (this->health > 0)) { + this->dmgType = DMG_NONE; + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); + if (!((this->swork[SO_SWK_0] == 0) || (this->swork[SO_SWK_0] == 2) || (this->swork[SO_SWK_0] == 3) || + (this->swork[SO_SWK_0] == 6) || ((this->swork[SO_SWK_0] == 7) && (this->state == 2)))) { + Solar_801A3C4C(this); } } + if (gBossFrameCount == 400) { gShowBossHealth = true; } if (gBossFrameCount >= 400) { - gBossHealthBar = (bossSO->health + bossSO->swork[SO_SWK_2] + bossSO->swork[SO_SWK_3]) * (255.0f / 1400.0f); + gBossHealthBar = (this->health + this->swork[SO_SWK_2] + this->swork[SO_SWK_3]) * (255.0f / 1400.0f); } } bool Solar_801A68A8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { - Boss* this = (Boss*) thisx; + BossSO* this = (BossSO*) thisx; Vec3f sp58 = { 0.0f, 0.0f, 0.0f }; Vec3f sp4C = { 10.0f, 0.0f, 0.0f }; Vec3f sp40 = { -10.0f, 0.0f, 0.0f }; @@ -2862,7 +2877,7 @@ bool Solar_801A68A8(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* th } void Solar_801A6BDC(s32 limbIndex, Vec3f* rot, void* thisx) { - Boss* this = thisx; + BossSO* this = (BossSO*) thisx; Vec3f spA0 = { 90.0f, 0.0f, -10.0f }; Vec3f sp94 = { 135.0f, 0.0f, -40.0f }; Vec3f sp88 = { 106.0f, 0.0f, 0.0f }; @@ -3003,7 +3018,7 @@ void Solar_801A6BDC(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Solar_Boss_Draw(Boss* bossSO) { +void Solar_Boss_Draw(BossSO* this) { s32 i; Vec3f spE8[9] = { { 150.0f, 300.0f, 100.0f }, { -100.0f, 200.0f, 100.0f }, { 50.0f, 100.0f, 100.0f }, @@ -3017,19 +3032,19 @@ void Solar_Boss_Draw(Boss* bossSO) { -89.0f, -90.0f, -88.0f, -36.0f, -73.0f, -95.0f, -91.0f, -83.0f, -91.0f, }; - Matrix_Scale(gCalcMatrix, bossSO->scale, bossSO->scale, bossSO->scale, MTXF_APPLY); + Matrix_Scale(gCalcMatrix, this->scale, this->scale, this->scale, MTXF_APPLY); if (gBossActive) { - Animation_DrawSkeleton(2, D_SO_600E470, bossSO->vwork, Solar_801A68A8, Solar_801A6BDC, bossSO, gCalcMatrix); + Animation_DrawSkeleton(2, D_SO_600E470, this->vwork, Solar_801A68A8, Solar_801A6BDC, this, gCalcMatrix); } - if (bossSO->health <= 0) { + if (this->health <= 0) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 192, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y, bossSO->obj.pos.z - 500.0f + gPathProgress, + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z - 500.0f + gPathProgress, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[3], D_i3_801C2768[2], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3038,8 +3053,8 @@ void Solar_Boss_Draw(Boss* bossSO) { for (i = 0; i < 9; i++) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x + spE8[i].x, bossSO->obj.pos.y + spE8[i].y, - bossSO->obj.pos.z + gPathProgress + spE8[i].z, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x + spE8[i].x, this->obj.pos.y + spE8[i].y, + this->obj.pos.z + gPathProgress + spE8[i].z, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, spC4[i] * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, spA0[i] * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[4 + i], 100.0f, 1.0f, MTXF_APPLY); @@ -3051,8 +3066,8 @@ void Solar_Boss_Draw(Boss* bossSO) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 192, 64, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 230.0f, - bossSO->obj.pos.z - 300.0f + gPathProgress, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + 230.0f, + this->obj.pos.z - 300.0f + gPathProgress, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * 5.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3062,8 +3077,8 @@ void Solar_Boss_Draw(Boss* bossSO) { gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 270.0f, - (bossSO->obj.pos.z - 300.0f) + gPathProgress, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + 270.0f, + (this->obj.pos.z - 300.0f) + gPathProgress, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, -3.0f * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3087,7 +3102,7 @@ Vec3f D_i3_801BFB30[3] = { }; void Solar_801A7750(void) { - Actor* actor = gActors; + ActorCutscene* actor = &gActors[0]; s32 i; Rand_SetSeed(1, 29100, 9786); @@ -3125,7 +3140,7 @@ void Solar_LevelComplete(Player* player) { f32 dz; Vec3f sp60; Vec3f sp54; - Boss* bossSO = &gBosses[0]; + BossSO* boss = &gBosses[0]; switch (player->csState) { case 0: @@ -3171,8 +3186,8 @@ void Solar_LevelComplete(Player* player) { Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 200.0f, 0.05f, 10.0f, 0.0f); - dx = player->pos.x - bossSO->obj.pos.x; - dz = (player->pos.z - bossSO->obj.pos.z) * 0.05f; + dx = player->pos.x - boss->obj.pos.x; + dz = (player->pos.z - boss->obj.pos.z) * 0.05f; sp78 = Math_RadToDeg(-Math_Atan2F(dx, dz)); Math_SmoothStepToF(&gCsCamEyeY, 300.0f, 1.0f, 20.0f, 0.0f); @@ -3511,45 +3526,45 @@ void Solar_LevelComplete(Player* player) { player->rockAngle = SIN_DEG(player->rockPhase); } -void Solar_801A8BE8(Actor* actor) { +void Solar_801A8BE8(ActorCutscene* this) { Vec3f src; Vec3f dest; - switch (actor->state) { + switch (this->state) { case 4: break; case 1: - if ((actor->animFrame != 0) && ((((s32) (actor->index % 8U) * 10) + 1030) < gCsFrameCount)) { - actor->state = 4; + if ((this->animFrame != 0) && ((((s32) (this->index % 8U) * 10) + 1030) < gCsFrameCount)) { + this->state = 4; } break; case 2: - actor->state = 3; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 3; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 5.0f; /* fallthrough */ case 3: - actor->iwork[11] = 2; - actor->fwork[0] += 2.0f; - actor->rot_0F4.x += 0.2f; + this->iwork[11] = 2; + this->fwork[0] += 2.0f; + this->rot_0F4.x += 0.2f; break; } - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; - src.z = actor->fwork[0]; + src.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - actor->vel.x = dest.x; - actor->vel.y = dest.y; - actor->vel.z = dest.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y + 180.0f; - actor->obj.rot.z = -actor->rot_0F4.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } void Solar_801A8DB8(Vec3f* pos, u32 sfxId, f32 zVel) { @@ -3557,7 +3572,7 @@ void Solar_801A8DB8(Vec3f* pos, u32 sfxId, f32 zVel) { for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.status == OBJ_FREE) { - func_effect_8007A5F8(&gEffects[i], pos, sfxId); + Effect_SetupTimedSfxAtPos(&gEffects[i], pos, sfxId); gEffects[i].vel.z = zVel; break; } diff --git a/src/overlays/ovl_i3/fox_zo.c b/src/overlays/ovl_i3/fox_zo.c index 81080d1a..49d20d51 100644 --- a/src/overlays/ovl_i3/fox_zo.c +++ b/src/overlays/ovl_i3/fox_zo.c @@ -30,17 +30,17 @@ typedef struct { #define ZO_HIT_12(bossZO) ((Hitbox*) (ZO_HIT_10(bossZO, 0) + 2)) void Solar_801A7750(void); -void Zoness_801986FC(Boss* bossZO, s32 arg1, f32 xOff, f32 yOff, f32 zOff, f32 yRot); -void Zoness_801989FC(Boss* bossZO); -void Zoness_80198BE8(Boss* bossZO, s32 arg1); -void Zoness_80198ECC(Boss* bossZO); -void Zoness_80198F3C(Boss* bossZO, s32 arg1, s32 arg2); -void Zoness_8019907C(Boss* bossZO); -void Zoness_8019914C(Boss* bossZO, s32 arg1); -void Zoness_801991D0(Boss* bossZO, s32 arg1); -void Zoness_80199394(Boss* bossZO, s32 arg1); -void Zoness_80199470(Boss* bossZO, s32 arg1); -void Zoness_8019962C(Boss* bossZO, f32 arg1); +void Zoness_801986FC(Boss* this, s32 arg1, f32 xOff, f32 yOff, f32 zOff, f32 yRot); +void Zoness_801989FC(Boss* this); +void Zoness_80198BE8(Boss* this, s32 arg1); +void Zoness_80198ECC(Boss* this); +void Zoness_80198F3C(Boss* this, s32 arg1, s32 arg2); +void Zoness_8019907C(Boss* this); +void Zoness_8019914C(Boss* this, s32 arg1); +void Zoness_801991D0(Boss* this, s32 arg1); +void Zoness_80199394(Boss* this, s32 arg1); +void Zoness_80199470(Boss* this, s32 arg1); +void Zoness_8019962C(Boss* this, f32 arg1); typedef enum { /* 0 */ ZO_LIMB_0, @@ -470,34 +470,34 @@ s32 sZoLimbTimers[ZO_LIMB_MAX]; s32 sZoSwork[ZO_BSS_MAX]; f32 sZoFwork[ZO_BSF_MAX]; -void Zoness_8018FF50(Actor* actor) { +void Zoness_8018FF50(Actor* this) { f32 temp; - (void) " Enm->hitNO %d\n"; // Unclear where this goes. hitNO can't be info.bonus. Damage related? - actor->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - actor->obj.pos.x, - gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress))); - temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (actor->obj.pos.z + gPathProgress)) + - SQ(gPlayer[0].cam.eye.x - actor->obj.pos.x)); - actor->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - actor->obj.pos.y, temp)); + this->obj.rot.y = RAD_TO_DEG( + Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress))); + temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress)) + + SQ(gPlayer[0].cam.eye.x - this->obj.pos.x)); + this->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y, temp)); } -void Zoness_SetupDebris(Actor* actor, Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 state, f32 scale, +void Zoness_SetupDebris(ActorDebris* this, Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 state, f32 scale, s32 timerBC, s32 unk48) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_DEBRIS; - actor->state = state; - actor->scale = scale; - actor->unk_048 = unk48; - actor->obj.pos = *pos; - actor->obj.rot = *rot; - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; - actor->timer_0BC = timerBC; - actor->gravity = 0.5f; + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_DEBRIS; - Object_SetInfo(&actor->info, actor->obj.id); + this->state = state; + this->scale = scale; + this->unk_048 = unk48; + this->obj.pos = *pos; + this->obj.rot = *rot; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->timer_0BC = timerBC; + this->gravity = 0.5f; + + Object_SetInfo(&this->info, this->obj.id); } void Zoness_SpawnDebris(Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 state, f32 scale, s32 timerBC, @@ -522,7 +522,7 @@ bool Zoness_8019019C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t void Zoness_80190204(s32 limbIndex, Vec3f* rot, void* thisx) { Vec3f sp24 = { 0.0f, 0.0f, 0.0f }; - Actor* this = thisx; + Actor* this = (Actor*) thisx; if (this->state == 1) { switch (limbIndex) { @@ -574,64 +574,68 @@ void Zoness_80190204(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_80190430(Actor* actor) { - Vec3f sp30[30]; +void Zoness_Actor235_Draw(Actor235* this) { + Vec3f frameTable[30]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); - Animation_GetFrameData(&D_ZO_600E5EC, actor->animFrame, sp30); - Animation_DrawSkeleton(3, D_ZO_600E7D8, sp30, Zoness_8019019C, Zoness_80190204, actor, gCalcMatrix); + Matrix_Scale(gCalcMatrix, this->scale, this->scale, this->scale, MTXF_APPLY); + Animation_GetFrameData(&D_ZO_600E5EC, this->animFrame, frameTable); + Animation_DrawSkeleton(3, D_ZO_600E7D8, frameTable, Zoness_8019019C, Zoness_80190204, this, gCalcMatrix); } -void Zoness_801904CC(Actor* actor) { - Vec3f spA4; - Vec3f sp98; +void Zoness_Actor235_Update(Actor235* this) { + Vec3f src; + Vec3f dest; s32 i; - switch (actor->state) { + switch (this->state) { case 0: - actor->health = 20; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); - spA4.x = spA4.y = 0.0f; - spA4.z = actor->fwork[10]; - Matrix_MultVec3f(gCalcMatrix, &spA4, &sp98); - actor->vel.x = sp98.x; - actor->vel.y = sp98.y; - actor->vel.z = sp98.z; - actor->state = 5; + this->health = 20; + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + src.x = src.y = 0.0f; + src.z = this->fwork[10]; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; + this->state = 5; break; + case 1: for (i = 0; i < 11; i++) { - Zoness_SpawnDebris(&actor->vwork[i], &actor->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), - RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 41, actor->scale, 200, i); + Zoness_SpawnDebris(&this->vwork[i], &this->vwork[i + 11], RAND_FLOAT_CENTERED(20.0f), + RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 41, this->scale, 200, i); } - actor->itemDrop = DROP_NONE; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 4.0f); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_BIRD_DOWN); + this->itemDrop = DROP_NONE; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 4.0f); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_BIRD_DOWN); break; } - actor->animFrame++; - if (Animation_GetFrameCount(&D_ZO_600E5EC) < actor->animFrame) { - actor->animFrame = 0; + + this->animFrame++; + + if (Animation_GetFrameCount(&D_ZO_600E5EC) < this->animFrame) { + this->animFrame = 0; } - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - if (actor->state > 0) { - actor->timer_0C6 = 15; - actor->health -= actor->damage; - AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DAMAGE, actor->sfxSource, 4); - if (actor->health <= 0) { - actor->health = 0; - actor->state = 1; + + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + if (this->state > 0) { + this->timer_0C6 = 15; + this->health -= this->damage; + AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DAMAGE, this->sfxSource, 4); + if (this->health <= 0) { + this->health = 0; + this->state = 1; } } } } -void Zoness_80190790(Actor* actor) { +void Zoness_80190790(Actor* this) { s32 pad[2]; f32 temp1; PosRot* temp2; @@ -640,63 +644,64 @@ void Zoness_80190790(Actor* actor) { s32 i; Actor* otherActor; - actor->counter_04E++; - if (actor->counter_04E >= 200) { - actor->counter_04E = 0; + this->counter_04E++; + if (this->counter_04E >= 200) { + this->counter_04E = 0; } - actor->fwork[0] += 4.0f; - actor->vel.y = SIN_DEG(actor->fwork[0]) * 20.0f; - actor->rot_0F4.x = -actor->vel.y * 2.5f; - actor->fwork[1] += 5.0f; - actor->rot_0F4.z = SIN_DEG(actor->fwork[1]) * 30.0f; + this->fwork[0] += 4.0f; + this->vel.y = SIN_DEG(this->fwork[0]) * 20.0f; + this->rot_0F4.x = -this->vel.y * 2.5f; + this->fwork[1] += 5.0f; + this->rot_0F4.z = SIN_DEG(this->fwork[1]) * 30.0f; + for (i = 0, otherActor = gActors; i < ARRAY_COUNT(gActors); i++, otherActor++) { if ((otherActor->obj.status == OBJ_ACTIVE) && (otherActor->obj.id == OBJ_ACTOR_239) && - (otherActor->iwork[0] == actor->iwork[0])) { + (otherActor->iwork[0] == this->iwork[0])) { temp1 = Math_RadToDeg( - Math_Atan2F(otherActor->obj.pos.x - actor->obj.pos.x, otherActor->obj.pos.z - actor->obj.pos.z)); - Math_SmoothStepToAngle(&actor->rot_0F4.y, temp1, 0.2f, 3.0f, 0.0f); - if ((fabsf(actor->obj.pos.x - otherActor->obj.pos.x) < 500.0f) && - (fabsf(actor->obj.pos.z - otherActor->obj.pos.z) < 500.0f)) { + Math_Atan2F(otherActor->obj.pos.x - this->obj.pos.x, otherActor->obj.pos.z - this->obj.pos.z)); + Math_SmoothStepToAngle(&this->rot_0F4.y, temp1, 0.2f, 3.0f, 0.0f); + if ((fabsf(this->obj.pos.x - otherActor->obj.pos.x) < 500.0f) && + (fabsf(this->obj.pos.z - otherActor->obj.pos.z) < 500.0f)) { otherActor->obj.status = OBJ_FREE; - actor->iwork[0]++; + this->iwork[0]++; } break; } } - Matrix_RotateY(gCalcMatrix, actor->rot_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->rot_0F4.y * M_DTOR, MTXF_NEW); sp44.x = 0.f; sp44.y = 0.f; sp44.z = 20.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); - actor->vel.x = sp38.x; - actor->vel.z = sp38.z; - temp2 = &gZOSnakePosRots[actor->counter_04E]; - temp2->pos.x = actor->obj.pos.x; - temp2->pos.y = actor->obj.pos.y; - temp2->pos.z = actor->obj.pos.z; - temp2->rot.x = actor->rot_0F4.x; - temp2->rot.y = actor->rot_0F4.y; - temp2->rot.z = actor->rot_0F4.z; + this->vel.x = sp38.x; + this->vel.z = sp38.z; + temp2 = &gZOSnakePosRots[this->counter_04E]; + temp2->pos.x = this->obj.pos.x; + temp2->pos.y = this->obj.pos.y; + temp2->pos.z = this->obj.pos.z; + temp2->rot.x = this->rot_0F4.x; + temp2->rot.y = this->rot_0F4.y; + temp2->rot.z = this->rot_0F4.z; } -void Zoness_80190A00(Actor* actor) { +void Zoness_Actor236_Update(Actor* this) { f32 sp2C; s32 sp28; - if ((actor->timer_0C0 == 0) && - Play_CheckDynaFloorCollision(&sp2C, &sp28, actor->obj.pos.x, actor->obj.pos.y - 50.0f, actor->obj.pos.z)) { - func_effect_8008377C(actor->obj.pos.x, sp2C, actor->obj.pos.z + 150.0f, 0.0f, 1.7f); - if (actor->vel.y >= 0.0f) { - AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, actor->sfxSource, 4); + if ((this->timer_0C0 == 0) && + Play_CheckDynaFloorCollision(&sp2C, &sp28, this->obj.pos.x, this->obj.pos.y - 50.0f, this->obj.pos.z)) { + func_effect_8008377C(this->obj.pos.x, sp2C, this->obj.pos.z + 150.0f, 0.0f, 1.7f); + if (this->vel.y >= 0.0f) { + AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, this->sfxSource, 4); } - actor->timer_0C0 = 30; + this->timer_0C0 = 30; } - Zoness_80190790(actor); - if (actor->dmgType != DMG_NONE) { - actor->dmgType = DMG_NONE; - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 4); + Zoness_80190790(this); + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } @@ -730,35 +735,35 @@ typedef struct { Hitbox boxes[1]; } JntHitbox; -void Zoness_80190D0C(Actor* actor) { +void Zoness_80190D0C(Actor* this) { Hitbox* var_s2 = (((JntHitbox*) SEGMENTED_TO_VIRTUAL(D_ZO_602BC58))->boxes); s32 i; s32 k; PosRot* temp_s0; - actor->unk_04A = 0; - for (i = actor->unk_04A; i < 20; i++, var_s2++) { - k = (D_i3_801BF56C[i] + actor->counter_04E) % 200; + this->unk_04A = 0; + for (i = this->unk_04A; i < 20; i++, var_s2++) { + k = (D_i3_801BF56C[i] + this->counter_04E) % 200; temp_s0 = &gZOSnakePosRots[k]; - var_s2->z.offset = temp_s0->pos.z - actor->obj.pos.z; - var_s2->y.offset = temp_s0->pos.y - actor->obj.pos.y; - var_s2->x.offset = temp_s0->pos.x - actor->obj.pos.x; + var_s2->z.offset = temp_s0->pos.z - this->obj.pos.z; + var_s2->y.offset = temp_s0->pos.y - this->obj.pos.y; + var_s2->x.offset = temp_s0->pos.x - this->obj.pos.x; Zoness_80190B4C(temp_s0->pos.x, temp_s0->pos.y, temp_s0->pos.z, temp_s0->rot.x, temp_s0->rot.y, temp_s0->rot.z, - D_i3_801BF594[i], actor->timer_0C6 % 2U); + D_i3_801BF594[i], this->timer_0C6 % 2U); if (gPlayState != PLAY_PAUSE) { - Math_SmoothStepToF(&temp_s0->pos.y, actor->fwork[2], 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&temp_s0->pos.y, this->fwork[2], 1.0f, 10.0f, 0.0f); } } } -void Zoness_80190F08(Actor* actor) { - Zoness_80190D0C(actor); +void Zoness_Actor236_Draw(Actor236* this) { + Zoness_80190D0C(this); } void Zoness_80190F28(s32 limbIndex, Vec3f* rot, void* thisx) { Vec3f sp2C = { 0.0f, 0.0f, 0.0f }; - Actor* this = thisx; + Actor* this = (Actor*) thisx; if (this->state == 3) { switch (limbIndex) { @@ -778,131 +783,141 @@ void Zoness_80190F28(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_80191010(Actor* actor) { - Vec3f sp8C; - Vec3f sp80; +void Zoness_Actor238_Update(Actor238* this) { + Vec3f src; + Vec3f dest; f32 sp7C; s32 i; f32 var_fs0; s32 sp70; - switch (actor->state) { + switch (this->state) { case 0: - actor->fwork[3] = actor->obj.rot.x; - actor->fwork[1] = RAND_FLOAT_CENTERED(1000.0f); - actor->health = 10; - actor->timer_0BC = 30; - actor->scale = 5.0f; - actor->gravity = 1.0f; - actor->obj.rot.x = 315.0f; - actor->state++; + this->fwork[3] = this->obj.rot.x; + this->fwork[1] = RAND_FLOAT_CENTERED(1000.0f); + this->health = 10; + this->timer_0BC = 30; + this->scale = 5.0f; + this->gravity = 1.0f; + this->obj.rot.x = 315.0f; + this->state++; break; + case 1: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); - sp8C.x = 0.0f; - sp8C.y = 0.0f; - sp8C.z = (actor->fwork[3] * 10.0f) + 30.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp8C, &sp80); - actor->vel.x = sp80.x; - actor->vel.y = sp80.y; - actor->vel.z = sp80.z; - actor->state++; + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + src.x = 0.0f; + src.y = 0.0f; + src.z = (this->fwork[3] * 10.0f) + 30.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; + this->state++; break; + case 2: - if (actor->timer_0BC == 0) { - actor->obj.rot.z += 30.0f; - if (actor->animFrame > 0) { - actor->animFrame--; + if (this->timer_0BC == 0) { + this->obj.rot.z += 30.0f; + if (this->animFrame > 0) { + this->animFrame--; } } else { - if (actor->animFrame < Animation_GetFrameCount(&D_ZO_601AA48)) { - actor->animFrame++; + if (this->animFrame < Animation_GetFrameCount(&D_ZO_601AA48)) { + this->animFrame++; } } + var_fs0 = 5.0f; - if (actor->obj.rot.x < 90.0f) { + if (this->obj.rot.x < 90.0f) { var_fs0 = 1.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.x, 45.0f, 0.1f, var_fs0, 0.01f); - if (actor->obj.pos.y < -500.0f) { - actor->obj.rot.x = 0.0f; - actor->gravity = 0.0f; - actor->vel.y = 0.0f; - Object_Kill(&actor->obj, actor->sfxSource); + + Math_SmoothStepToAngle(&this->obj.rot.x, 45.0f, 0.1f, var_fs0, 0.01f); + + if (this->obj.pos.y < -500.0f) { + this->obj.rot.x = 0.0f; + this->gravity = 0.0f; + this->vel.y = 0.0f; + Object_Kill(&this->obj, this->sfxSource); } - if (Play_CheckDynaFloorCollision(&sp7C, &sp70, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z) && - (actor->iwork[0] < 2) && (actor->timer_0C0 == 0)) { + + if (Play_CheckDynaFloorCollision(&sp7C, &sp70, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z) && + (this->iwork[0] < 2) && (this->timer_0C0 == 0)) { if (var_fs0 == 5.0f) { - AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, this->sfxSource, 4); } - actor->timer_0C0 = 10; - actor->iwork[0]++; - func_effect_8008377C(actor->obj.pos.x, sp7C, actor->obj.pos.z, 0.0f, 0.7f); + this->timer_0C0 = 10; + this->iwork[0]++; + func_effect_8008377C(this->obj.pos.x, sp7C, this->obj.pos.z, 0.0f, 0.7f); } break; + case 3: for (i = 0; i < 3; i++) { - Zoness_SpawnDebris(&actor->vwork[i], &actor->vwork[3 + i], RAND_FLOAT_CENTERED(20.0f), - RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 42, actor->scale, 200, i); + Zoness_SpawnDebris(&this->vwork[i], &this->vwork[3 + i], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), + RAND_FLOAT(10.0f), 42, this->scale, 200, i); } - actor->itemDrop = DROP_SILVER_RING_25p; - Actor_Despawn(actor); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_S, actor->sfxSource, 4); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_BIRD_DOWN); + this->itemDrop = DROP_SILVER_RING_25p; + Actor_Despawn(this); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f); + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_S, this->sfxSource, 4); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_BIRD_DOWN); break; } - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - actor->timer_0C6 = 15; - actor->health -= actor->damage; - if (actor->health <= 0) { - actor->health = 0; - actor->state = 3; + + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + this->timer_0C6 = 15; + this->health -= this->damage; + if (this->health <= 0) { + this->health = 0; + this->state = 3; } } } -void Zoness_801914C4(Actor* actor) { - Vec3f sp38[20]; +void Zoness_Actor238_Draw(Actor238* this) { + Vec3f frameTable[20]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); + Matrix_Scale(gCalcMatrix, this->scale, this->scale, this->scale, MTXF_APPLY); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Animation_GetFrameData(&D_ZO_601AA48, actor->animFrame, sp38); - Animation_DrawSkeleton(3, D_ZO_601AB14, sp38, NULL, Zoness_80190F28, actor, gCalcMatrix); + Animation_GetFrameData(&D_ZO_601AA48, this->animFrame, frameTable); + Animation_DrawSkeleton(3, D_ZO_601AB14, frameTable, NULL, Zoness_80190F28, this, gCalcMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } -void Zoness_801915A4(Actor* actor) { +void Zoness_801915A4(Actor* this) { s32 i; Actor* actor241; - actor->health = 50; - actor->fwork[0] = actor->obj.pos.z - 10000.0f; - for (i = 0, actor241 = gActors; i < ARRAY_COUNT(gActors); i++, actor241++) { + this->health = 50; + this->fwork[0] = this->obj.pos.z - 10000.0f; + + for (i = 0, actor241 = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor241++) { if (actor241->obj.status == OBJ_FREE) { Actor_Initialize(actor241); actor241->obj.status = OBJ_INIT; actor241->obj.id = OBJ_ACTOR_241; - actor241->obj.pos.x = actor->obj.pos.x; - actor241->obj.pos.y = actor->obj.pos.y; - actor241->obj.pos.z = actor->obj.pos.z; - actor241->iwork[0] = actor->index + 1; + actor241->obj.pos.x = this->obj.pos.x; + actor241->obj.pos.y = this->obj.pos.y; + actor241->obj.pos.z = this->obj.pos.z; + actor241->iwork[0] = this->index + 1; Object_SetInfo(&actor241->info, actor241->obj.id); - actor->iwork[0] = i; + this->iwork[0] = i; break; } } + if (i >= ARRAY_COUNT(gActors)) { actor241->obj.status = OBJ_FREE; } } -void Zoness_80191680(Actor* actor) { +void Zoness_Actor240_Update(Actor240* this) { f32 sp64; f32 sp60; f32 sp5C; @@ -912,75 +927,92 @@ void Zoness_80191680(Actor* actor) { Vec3f sp3C; Actor* otherActor; - if (actor->obj.pos.z < actor->fwork[0]) { - actor->state = 1; + if (this->obj.pos.z < this->fwork[0]) { + this->state = 1; } - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - actor->timer_0C6 = 15; - actor->health -= actor->damage; - AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DAMAGE, actor->sfxSource, 4); - if (actor->health <= 0) { - actor->health = actor->itemDrop = 0; - Actor_Despawn(actor); - actor->state = 1; - AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DOWN, actor->sfxSource, 4); + + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + this->timer_0C6 = 15; + this->health -= this->damage; + AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DAMAGE, this->sfxSource, 4); + if (this->health <= 0) { + this->health = this->itemDrop = 0; + Actor_Despawn(this); + this->state = 1; + AUDIO_PLAY_SFX(NA_SE_EN_BIRD_DOWN, this->sfxSource, 4); } } - actor->animFrame++; - if (actor->animFrame >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { - actor->animFrame = 0; + + this->animFrame++; + + if (this->animFrame >= Animation_GetFrameCount(&D_ENMY_PLANET_40057AC)) { + this->animFrame = 0; } - if (actor->timer_0BC == 0) { - actor->timer_0BC = 30; - actor->fwork[1] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(1000.0f); - actor->fwork[2] = gPlayer[0].pos.y + 50.0f + RAND_FLOAT(200.0f); - actor->fwork[3] = gPlayer[0].trueZpos - 1500.0f; + + if (this->timer_0BC == 0) { + this->timer_0BC = 30; + this->fwork[1] = gPlayer[0].pos.x + RAND_FLOAT_CENTERED(1000.0f); + this->fwork[2] = gPlayer[0].pos.y + 50.0f + RAND_FLOAT(200.0f); + this->fwork[3] = gPlayer[0].trueZpos - 1500.0f; } - actor->fwork[3] += gPlayer[0].vel.z; - sp64 = actor->fwork[1] - actor->obj.pos.x; - sp60 = actor->fwork[2] - actor->obj.pos.y; - sp5C = actor->fwork[3] - actor->obj.pos.z; + + this->fwork[3] += gPlayer[0].vel.z; + + sp64 = this->fwork[1] - this->obj.pos.x; + sp60 = this->fwork[2] - this->obj.pos.y; + sp5C = this->fwork[3] - this->obj.pos.z; + sp54 = Math_RadToDeg(Math_Atan2F(sp64, sp5C)); - otherActor = &gActors[actor->iwork[0]]; - if ((actor->state != 0) || (otherActor->obj.status == OBJ_FREE)) { - actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->info.targetOffset = 0.0f; + + otherActor = &gActors[this->iwork[0]]; + + if ((this->state != 0) || (otherActor->obj.status == OBJ_FREE)) { + this->lockOnTimers[TEAM_ID_FOX] = 0; + this->info.targetOffset = 0.0f; sp54 += 180.0f; if (sp54 > 360.0f) { sp54 -= 360.0f; } - if (actor->timer_0C6 == 0) { - actor->timer_0C6 = 15; + if (this->timer_0C6 == 0) { + this->timer_0C6 = 15; } } + sp58 = sqrtf(SQ(sp64) + SQ(sp5C)); sp58 = Math_RadToDeg(-Math_Atan2F(sp60, sp58)); - sp60 = Math_SmoothStepToAngle(&actor->obj.rot.y, sp54, 0.2f, 4.0f, 0.0f); - Math_SmoothStepToAngle(&actor->obj.rot.x, sp58, 0.2f, 4.0f, 0.0f); + sp60 = Math_SmoothStepToAngle(&this->obj.rot.y, sp54, 0.2f, 4.0f, 0.0f); + + Math_SmoothStepToAngle(&this->obj.rot.x, sp58, 0.2f, 4.0f, 0.0f); + sp5C = 330.0f; if (sp60 < 0.0f) { sp5C = 30.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, sp5C, 0.2f, 4.0f, 0.0f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + + Math_SmoothStepToAngle(&this->obj.rot.z, sp5C, 0.2f, 4.0f, 0.0f); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + sp48.x = sp48.y = 0.0f; sp48.z = 30.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp48, &sp3C); - actor->vel.x = sp3C.x; - actor->vel.y = sp3C.y; - actor->vel.z = sp3C.z - 20.0f; - if (otherActor->iwork[0] == (actor->index + 1)) { - if (actor->state == 0) { - otherActor->obj.pos.x = actor->obj.pos.x; - otherActor->obj.pos.y = actor->obj.pos.y - 50.0f; - otherActor->obj.pos.z = actor->obj.pos.z; - actor->fwork[4] = otherActor->obj.pos.x; - actor->fwork[5] = otherActor->obj.pos.y; - actor->fwork[6] = otherActor->obj.pos.z; - if (((gGameFrameCount % 16) == 0) && (fabsf(gPlayer[0].pos.x - actor->obj.pos.x) < 100.0f)) { - func_effect_80081BEC(actor->fwork[4], actor->fwork[5], actor->fwork[6], 1.0f, 0); + + this->vel.x = sp3C.x; + this->vel.y = sp3C.y; + this->vel.z = sp3C.z - 20.0f; + + if (otherActor->iwork[0] == (this->index + 1)) { + if (this->state == 0) { + otherActor->obj.pos.x = this->obj.pos.x; + otherActor->obj.pos.y = this->obj.pos.y - 50.0f; + otherActor->obj.pos.z = this->obj.pos.z; + this->fwork[4] = otherActor->obj.pos.x; + this->fwork[5] = otherActor->obj.pos.y; + this->fwork[6] = otherActor->obj.pos.z; + if (((gGameFrameCount % 16) == 0) && (fabsf(gPlayer[0].pos.x - this->obj.pos.x) < 100.0f)) { + func_effect_80081BEC(this->fwork[4], this->fwork[5], this->fwork[6], 1.0f, 0); } } else { otherActor->vel.y -= 1.0f; @@ -988,45 +1020,48 @@ void Zoness_80191680(Actor* actor) { } } -void Zoness_80191B4C(Actor* actor) { - Animation_GetFrameData(&D_ENMY_PLANET_40057AC, actor->animFrame, actor->vwork); - Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, actor->vwork, NULL, NULL, &actor->index, &gIdentityMatrix); +void Zoness_Actor240_Draw(Actor240* this) { + Animation_GetFrameData(&D_ENMY_PLANET_40057AC, this->animFrame, this->vwork); + Animation_DrawSkeleton(1, D_ENMY_PLANET_40058B8, this->vwork, NULL, NULL, &this->index, &gIdentityMatrix); } -void Zoness_80191BB8(Actor* actor) { +void Zoness_80191BB8(Actor* this) { } -void Zoness_80191BC4(Actor* actor) { +void Zoness_Actor241_Update(Actor241* this) { f32 sp4C; s32 sp48; - if ((actor->vel.y != 0.0f) && (actor->iwork[1] == 0)) { - actor->iwork[1] = 1; - AUDIO_PLAY_SFX(NA_SE_EN_FALLING_DOWN, actor->sfxSource, 4); + if ((this->vel.y != 0.0f) && (this->iwork[1] == 0)) { + this->iwork[1] = 1; + AUDIO_PLAY_SFX(NA_SE_EN_FALLING_DOWN, this->sfxSource, 4); } - if (Play_CheckDynaFloorCollision(&sp4C, &sp48, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z) && - (actor->state == 0)) { - func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 20.0f, 7); - func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.5f, 50); - Object_Kill(&actor->obj, actor->sfxSource); - actor->iwork[0] = 0; - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_MINI_BOMB); + + if (Play_CheckDynaFloorCollision(&sp4C, &sp48, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z) && + (this->state == 0)) { + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 20.0f, 7); + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.5f, 50); + Object_Kill(&this->obj, this->sfxSource); + this->iwork[0] = 0; + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_MINI_BOMB); } - actor->fwork[0] += 10.0f; - Zoness_8018FF50(actor); + + this->fwork[0] += 10.0f; + + Zoness_8018FF50(this); + if (((gGameFrameCount % 2) == 0)) { - func_effect_8007C484(RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.x, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, + func_effect_8007C484(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, RAND_FLOAT(0.05f) + 0.05f, 0); } } -void Zoness_80191DB0(Actor* actor) { +void Zoness_Actor241_Draw(Actor241* this) { RCP_SetupDL_40(); gSPDisplayList(gMasterDisp++, D_ZO_6019EB0); - Matrix_RotateY(gGfxMatrix, actor->fwork[0] * 0.7f * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, actor->fwork[0] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->fwork[0] * 0.7f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->fwork[0] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6023D50); } @@ -1065,20 +1100,20 @@ void Zoness_80191E94(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_80191FFC(Actor* actor) { - Vec3f sp30[20]; +void Zoness_Actor242_Draw(Actor242* this) { + Vec3f jointTable[20]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); - Animation_GetFrameData(&D_ZO_60195EC, actor->animFrame, sp30); - Animation_DrawSkeleton(3, D_ZO_6019738, sp30, NULL, Zoness_80191E94, actor, gCalcMatrix); + Matrix_Scale(gCalcMatrix, this->scale, this->scale, this->scale, MTXF_APPLY); + Animation_GetFrameData(&D_ZO_60195EC, this->animFrame, jointTable); + Animation_DrawSkeleton(3, D_ZO_6019738, jointTable, NULL, Zoness_80191E94, this, gCalcMatrix); } -void Zoness_80192094(Actor* actor) { +void Zoness_Actor242_Update(Actor242* this) { s32 i; f32 spB8; - f32 temp_fs0; - f32 spB0; - f32 temp_fs1; + f32 x; + f32 y; + f32 z; f32 temp_fs0_2; f32 spA4; s32 spA0; @@ -1087,116 +1122,128 @@ void Zoness_80192094(Actor* actor) { Vec3f sp7C = { 0.0f, 0.0f, 0.0f }; Vec3f sp70; - temp_fs0 = gPlayer[0].pos.x - actor->obj.pos.x; - spB0 = gPlayer[0].pos.y - actor->obj.pos.y; - temp_fs1 = gPlayer[0].trueZpos - actor->obj.pos.z; - spA4 = Math_RadToDeg(Math_Atan2F(temp_fs0, temp_fs1)); - temp_fs0_2 = sqrtf(SQ(temp_fs0) + SQ(temp_fs1)); - temp_fs0_2 = Math_RadToDeg(-Math_Atan2F(spB0, temp_fs0_2)); - Math_SmoothStepToAngle(&actor->obj.rot.x, temp_fs0_2, 0.1f, 10.0f, 0.00001f); - Math_SmoothStepToAngle(&actor->obj.rot.y, spA4, 0.1f, 10.0f, 0.00001f); - if ((actor->iwork[0] == 0) && - (Play_CheckDynaFloorCollision(&spB8, &spA0, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z) != 0)) { - func_effect_8008377C(actor->obj.pos.x, spB8, actor->obj.pos.z + 100.0f, 0.0f, 1.5f); - actor->iwork[0]++; - if (actor->vel.y >= 0.0f) { - AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, actor->sfxSource, 4); + x = gPlayer[0].pos.x - this->obj.pos.x; + y = gPlayer[0].pos.y - this->obj.pos.y; + z = gPlayer[0].trueZpos - this->obj.pos.z; + + spA4 = Math_RadToDeg(Math_Atan2F(x, z)); + temp_fs0_2 = sqrtf(SQ(x) + SQ(z)); + temp_fs0_2 = Math_RadToDeg(-Math_Atan2F(y, temp_fs0_2)); + + Math_SmoothStepToAngle(&this->obj.rot.x, temp_fs0_2, 0.1f, 10.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, spA4, 0.1f, 10.0f, 0.00001f); + + if ((this->iwork[0] == 0) && + (Play_CheckDynaFloorCollision(&spB8, &spA0, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z) != 0)) { + func_effect_8008377C(this->obj.pos.x, spB8, this->obj.pos.z + 100.0f, 0.0f, 1.5f); + + this->iwork[0]++; + + if (this->vel.y >= 0.0f) { + AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, this->sfxSource, 4); } } - switch (actor->state) { + + switch (this->state) { case 0: - actor->state++; - actor->vel.y = 20.0f; - actor->scale = 2.0f; + this->state++; + this->vel.y = 20.0f; + this->scale = 2.0f; break; + case 1: - actor->animFrame++; - if (actor->animFrame >= Animation_GetFrameCount(&D_ZO_60195EC)) { - actor->animFrame = 64; - Math_SmoothStepToF(&actor->vel.z, 0.0f, 1.0f, 100.0f, 0.00001f); - if (actor->obj.pos.y < -500.0f) { - Object_Kill(&actor->obj, actor->sfxSource); + this->animFrame++; + if (this->animFrame >= Animation_GetFrameCount(&D_ZO_60195EC)) { + this->animFrame = 64; + Math_SmoothStepToF(&this->vel.z, 0.0f, 1.0f, 100.0f, 0.00001f); + if (this->obj.pos.y < -500.0f) { + Object_Kill(&this->obj, this->sfxSource); } } - if (actor->animFrame == 25) { - actor->fwork[2] = 0.0f; - actor->vel.y = 0.0f; - actor->iwork[1] = 0; - actor->fwork[3] = 150.0f; - actor->state++; + + if (this->animFrame == 25) { + this->fwork[2] = 0.0f; + this->vel.y = 0.0f; + this->iwork[1] = 0; + this->fwork[3] = 150.0f; + this->state++; } break; + case 2: - if (actor->iwork[1] > 20) { - actor->iwork[0] = 0; - actor->state = 3; - actor->vel.y = 50.0f; - if (actor->animFrame == 51) { - actor->state = 1; - actor->vel.y = -20.0f; + if (this->iwork[1] > 20) { + this->iwork[0] = 0; + this->state = 3; + this->vel.y = 50.0f; + if (this->animFrame == 51) { + this->state = 1; + this->vel.y = -20.0f; } } else { - Math_SmoothStepToF(&actor->vel.z, -40.0f, 0.1f, 1.0f, 0.00001f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, actor->fwork[2] * M_DTOR, MTXF_APPLY); + Math_SmoothStepToF(&this->vel.z, -40.0f, 0.1f, 1.0f, 0.00001f); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->fwork[2] * M_DTOR, MTXF_APPLY); sp70.x = 0.0f; - sp70.y = actor->fwork[3]; + sp70.y = this->fwork[3]; sp70.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp70, &sp94); - sp94.x += actor->obj.pos.x; - sp94.y += actor->obj.pos.y; - sp94.z = actor->obj.pos.z - 200.0f; + sp94.x += this->obj.pos.x; + sp94.y += this->obj.pos.y; + sp94.z = this->obj.pos.z - 200.0f; sp70.x = 0.0f; sp70.y = 0.0f; sp70.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp70, &sp88); func_effect_8007EE68(OBJ_EFFECT_355, &sp94, &sp7C, &sp7C, &sp88, 1.0f); - actor->fwork[2] += 40.0f; - actor->fwork[2] = Math_ModF(actor->fwork[2], 360.0f); - Math_SmoothStepToF(&actor->fwork[3], 0.0f, 1.0f, 5.0f, 0.0001f); - actor->iwork[1]++; + this->fwork[2] += 40.0f; + this->fwork[2] = Math_ModF(this->fwork[2], 360.0f); + Math_SmoothStepToF(&this->fwork[3], 0.0f, 1.0f, 5.0f, 0.0001f); + this->iwork[1]++; } break; + case 3: - Math_SmoothStepToF(&actor->vel.z, -60.0f, 0.1f, 100.0f, 0.00001f); - Math_SmoothStepToF(&actor->vel.y, -30.0f, 0.1f, 100.0f, 0.00001f); - actor->animFrame++; - if (actor->animFrame == 51) { - actor->fwork[2] = 0.0f; - actor->vel.y = 0.0f; - actor->iwork[1] = 0; - actor->state = 2; - actor->fwork[3] = 150.0f; + Math_SmoothStepToF(&this->vel.z, -60.0f, 0.1f, 100.0f, 0.00001f); + Math_SmoothStepToF(&this->vel.y, -30.0f, 0.1f, 100.0f, 0.00001f); + this->animFrame++; + if (this->animFrame == 51) { + this->fwork[2] = 0.0f; + this->vel.y = 0.0f; + this->iwork[1] = 0; + this->state = 2; + this->fwork[3] = 150.0f; } break; + case 4: for (i = 0; i < 6; i++) { - Zoness_SpawnDebris(&actor->vwork[i], &actor->vwork[i + 6], RAND_FLOAT_CENTERED(40.0f), - RAND_FLOAT(-10.0f), RAND_FLOAT(20.0f), 44, actor->scale, 200, i); + Zoness_SpawnDebris(&this->vwork[i], &this->vwork[i + 6], RAND_FLOAT_CENTERED(40.0f), RAND_FLOAT(-10.0f), + RAND_FLOAT(20.0f), 44, this->scale, 200, i); } - actor->itemDrop = DROP_BOMB; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); + this->itemDrop = DROP_BOMB; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); break; } - if ((actor->dmgType != DMG_NONE) && (actor->state < 3)) { - if (actor->dmgType != DMG_BEAM) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5); + + if ((this->dmgType != DMG_NONE) && (this->state < 3)) { + if (this->dmgType != DMG_BEAM) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 200.0f, 5); gHitCount += 6; D_ctx_80177850 = 15; - actor->state = 4; + this->state = 4; } - actor->dmgType = DMG_NONE; + this->dmgType = DMG_NONE; } } void Zoness_801926F4(s32 limbIndex, Vec3f* rot, void* thisx) { Vec3f sp24 = { 0.0f, 0.0f, 0.0f }; - Actor* this = thisx; + Actor* this = (Actor*) thisx; if (this->state == 2) { switch (limbIndex) { @@ -1224,90 +1271,96 @@ void Zoness_801926F4(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_80192834(Actor* actor) { - Vec3f sp84; - Vec3f sp78; +void Zoness_Actor243_Update(Actor243* this) { + Vec3f src; + Vec3f dest; f32 sp74; s32 sp70; s32 i; - switch (actor->state) { + switch (this->state) { case 0: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, 5.497787f, MTXF_APPLY); - sp84.y = 0.0f; - sp84.x = 0.0f; - sp84.z = (actor->obj.rot.x * 10.0f) + 15.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp84, &sp78); - actor->vel.x = sp78.x; - actor->vel.y = sp78.y; - actor->vel.z = sp78.z; - actor->health = 10; - actor->state++; + src.y = 0.0f; + src.x = 0.0f; + src.z = (this->obj.rot.x * 10.0f) + 15.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; + this->health = 10; + this->state++; break; + case 1: - Math_SmoothStepToF(&actor->vel.y, -30.0f, 0.1f, 1.0f, 0.01f); - if (actor->obj.pos.y < 0.0f) { - actor->iwork[0] = 0; + Math_SmoothStepToF(&this->vel.y, -30.0f, 0.1f, 1.0f, 0.01f); + + if (this->obj.pos.y < 0.0f) { + this->iwork[0] = 0; } - if (actor->obj.pos.y < -50.0f) { - Object_Kill(&actor->obj, actor->sfxSource); + if (this->obj.pos.y < -50.0f) { + Object_Kill(&this->obj, this->sfxSource); } - if (actor->vel.y > 0.0f) { - if (actor->animFrame < 17) { - actor->animFrame++; + + if (this->vel.y > 0.0f) { + if (this->animFrame < 17) { + this->animFrame++; } } else { - if (actor->animFrame < Animation_GetFrameCount(&D_ZO_6021ABC)) { - actor->animFrame++; + if (this->animFrame < Animation_GetFrameCount(&D_ZO_6021ABC)) { + this->animFrame++; } } - actor->obj.rot.x += 20.0f; - actor->obj.rot.x = Math_ModF(actor->obj.rot.x, 360.0f); - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - actor->health -= actor->damage; - if (actor->health <= 0) { - actor->health = 0; - actor->state++; + + this->obj.rot.x += 20.0f; + this->obj.rot.x = Math_ModF(this->obj.rot.x, 360.0f); + + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + this->health -= this->damage; + if (this->health <= 0) { + this->health = 0; + this->state++; } } break; + case 2: for (i = 0; i < 5; i++) { - Zoness_SpawnDebris(&actor->vwork[i], &actor->vwork[5 + i], RAND_FLOAT_CENTERED(20.0f), - RAND_FLOAT(-10.0f), RAND_FLOAT(10.0f), 43, actor->scale, 200, i); + Zoness_SpawnDebris(&this->vwork[i], &this->vwork[5 + i], RAND_FLOAT_CENTERED(20.0f), RAND_FLOAT(-10.0f), + RAND_FLOAT(10.0f), 43, this->scale, 200, i); } - actor->itemDrop = DROP_NONE; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_BIRD_DOWN); + this->itemDrop = DROP_NONE; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3.0f); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_BIRD_DOWN); break; } - if ((actor->iwork[0] == 0) && - (Play_CheckDynaFloorCollision(&sp74, &sp70, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z) != 0)) { - actor->iwork[0]++; - func_effect_8008377C(actor->obj.pos.x, sp74, actor->obj.pos.z, 0.0f, 0.7f); - if (actor->vel.y >= 0.0f) { - AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, actor->sfxSource, 4); + if ((this->iwork[0] == 0) && + (Play_CheckDynaFloorCollision(&sp74, &sp70, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z) != 0)) { + this->iwork[0]++; + func_effect_8008377C(this->obj.pos.x, sp74, this->obj.pos.z, 0.0f, 0.7f); + if (this->vel.y >= 0.0f) { + AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, this->sfxSource, 4); } } } -void Zoness_80192C18(Actor* actor) { - Vec3f sp28[20]; +void Zoness_Actor243_Draw(Actor243* this) { + Vec3f frameTable[20]; - Animation_GetFrameData(&D_ZO_6021ABC, actor->animFrame, sp28); - Animation_DrawSkeleton(3, D_ZO_6021B88, sp28, NULL, Zoness_801926F4, actor, gCalcMatrix); + Animation_GetFrameData(&D_ZO_6021ABC, this->animFrame, frameTable); + Animation_DrawSkeleton(3, D_ZO_6021B88, frameTable, NULL, Zoness_801926F4, this, gCalcMatrix); } void Zoness_80192C84(s32 limbIndex, Vec3f* rot, void* thisx) { Vec3f sp24 = { 0.0f, 0.0f, 0.0f }; - Actor* this = thisx; + Actor* this = (Actor*) thisx; if (this->state == 3) { switch (limbIndex) { @@ -1351,76 +1404,81 @@ void Zoness_80192C84(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_80192E64(Actor* actor) { +void Zoness_Actor244_Update(Actor244* this) { s32 i; - Vec3f sp80; - Vec3f sp74; + Vec3f src; + Vec3f dest; f32 sp70; s32 sp6C; - switch (actor->state) { + switch (this->state) { case 0: - actor->obj.pos.y = 380.0f; - actor->state = 1; + this->obj.pos.y = 380.0f; + this->state = 1; break; + case 1: - Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.1f, 1.0f, 0.0001); - Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.1f, 1.0f, 0.0001f); - if (actor->timer_0BC == 0) { - actor->animFrame++; - if (actor->animFrame == 5) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - sp80.x = 0.0f; - sp80.y = 0.0f; - sp80.z = 50.0f; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp80, &sp74); - actor->vel.x = sp74.x; - actor->vel.z = sp74.z; - actor->state = 2; + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.1f, 1.0f, 0.0001); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.1f, 1.0f, 0.0001f); + if (this->timer_0BC == 0) { + this->animFrame++; + if (this->animFrame == 5) { + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + src.x = 0.0f; + src.y = 0.0f; + src.z = 50.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.z = dest.z; + this->state = 2; } } break; + case 2: - Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.1f, 1.0f, 0.0001f); - Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.1f, 1.0f, 0.0001f); - if (actor->animFrame < Animation_GetFrameCount(&D_ZO_601AFB8)) { - actor->animFrame++; + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.1f, 1.0f, 0.0001f); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.1f, 1.0f, 0.0001f); + if (this->animFrame < Animation_GetFrameCount(&D_ZO_601AFB8)) { + this->animFrame++; } else { - actor->animFrame = 0; - actor->timer_0BC = 30; - actor->state = 1; + this->animFrame = 0; + this->timer_0BC = 30; + this->state = 1; } break; + case 3: for (i = 0; i < 9; i++) { - Zoness_SpawnDebris(&actor->vwork[i], &actor->vwork[9 + i], RAND_FLOAT_CENTERED(40.0f), - RAND_FLOAT(-10.0f), RAND_FLOAT(20.0f), 59, actor->scale, 200, i); + Zoness_SpawnDebris(&this->vwork[i], &this->vwork[9 + i], RAND_FLOAT_CENTERED(40.0f), RAND_FLOAT(-10.0f), + RAND_FLOAT(20.0f), 59, this->scale, 200, i); } - actor->itemDrop = DROP_BOMB_33p; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); + this->itemDrop = DROP_BOMB_33p; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); break; } - if (actor->dmgType != DMG_NONE) { - if (actor->dmgType != DMG_BEAM) { - if ((actor->state != 0) && (actor->state != 3)) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2); + + if (this->dmgType != DMG_NONE) { + if (this->dmgType != DMG_BEAM) { + if ((this->state != 0) && (this->state != 3)) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 200.0f, 2); gHitCount += 3; D_ctx_80177850 = 15; - actor->state = 3; + this->state = 3; } } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } - actor->dmgType = DMG_NONE; + this->dmgType = DMG_NONE; } - if (Play_CheckDynaFloorCollision(&sp70, &sp6C, actor->obj.pos.x, actor->obj.pos.y - 1000.0f, actor->obj.pos.z)) { - Math_SmoothStepToF(&actor->obj.pos.y, sp70 + 300.0f, 0.1f, 20.0f, 0); + + if (Play_CheckDynaFloorCollision(&sp70, &sp6C, this->obj.pos.x, this->obj.pos.y - 1000.0f, this->obj.pos.z)) { + Math_SmoothStepToF(&this->obj.pos.y, sp70 + 300.0f, 0.1f, 20.0f, 0); } } -void Zoness_80193240(Actor* actor) { +void Zoness_Actor244_Draw(Actor* actor) { Vec3f sp28[30]; Animation_GetFrameData(&D_ZO_601AFB8, actor->animFrame, sp28); @@ -1440,6 +1498,7 @@ void Zoness_BossZo_Init(BossZO* this) { gBossActive = true; gBossFrameCount = 0; this->vel.z = -40.0f; + for (i = 0; i < ZO_LIMB_MAX; i++) { sZoLimbTimers[i] = 0; } @@ -1471,6 +1530,7 @@ void Zoness_BossZo_Init(BossZO* this) { sZoSwork[ZO_BSS_11] = 20; sZoSwork[ZO_BSS_12] = 20; sZoSwork[ZO_BSS_13] = 61; + this->health = 300; this->obj.pos.y = -1800.0f; this->obj.rot.y = 180.0f; @@ -1485,9 +1545,12 @@ void Zoness_BossZo_Init(BossZO* this) { sZoSwork[ZO_BSS_43] = 255; sZoSwork[ZO_BSS_44] = 255; sZoFwork[ZO_BSF_25] = 0.0f; + this->timer_050 = 200; this->timer_052 = 280; + sZoSwork[ZO_BSS_37] = 255; + for (i = 0; i < 2; i++) { Actor_Initialize(&gActors[i]); gActors[i].obj.status = OBJ_INIT; @@ -1512,44 +1575,44 @@ void Zoness_BossZo_Init(BossZO* this) { } void Zoness_80193628(Object* obj, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { - Vec3f sp54 = { 0.0f, 0.0f, 40.0f }; - Vec3f sp48; + Vec3f src = { 0.0f, 0.0f, 40.0f }; + Vec3f dest; Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, M_DTOR * arg5, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, M_DTOR * arg4, MTXF_APPLY); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - func_effect_8007F04C(OBJ_EFFECT_353, arg1 + sp48.x + arg6, arg2 + sp48.y, arg3 + sp48.z, arg4, arg5, 0.0f, - obj->rot.x, obj->rot.y, obj->rot.z, sp48.x + arg6, sp48.y, sp48.z, 1.0f); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, arg1 + dest.x + arg6, arg2 + dest.y, arg3 + dest.z, arg4, arg5, 0.0f, + obj->rot.x, obj->rot.y, obj->rot.z, dest.x + arg6, dest.y, dest.z, 1.0f); } -void Zoness_801937D8(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { - Vec3f sp2C; - Vec3f sp20; +void Zoness_801937D8(Effect394* this, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { + Vec3f src; + Vec3f dest; - Effect_Initialize(effect); + Effect_Initialize(this); Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); - sp2C.x = 0.0f; - sp2C.y = 0.0f; - sp2C.z = 10.0f; - Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); - effect->vel.x = sp20.x; - effect->vel.y = sp20.y; - effect->vel.z = sp20.z; - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_394; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->unk_44 = 100; - effect->scale2 = 3.0f; - effect->scale1 = RAND_FLOAT_CENTERED(20.0f); - effect->unk_78 = 100; - effect->unk_7A = 14; - effect->obj.rot.z = RAND_FLOAT(360.0f); - Object_SetInfo(&effect->info, effect->obj.id); + src.x = 0.0f; + src.y = 0.0f; + src.z = 10.0f; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_394; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->unk_44 = 100; + this->scale2 = 3.0f; + this->scale1 = RAND_FLOAT_CENTERED(20.0f); + this->unk_78 = 100; + this->unk_7A = 14; + this->obj.rot.z = RAND_FLOAT(360.0f); + Object_SetInfo(&this->info, this->obj.id); } void Zoness_80193908(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { @@ -1563,30 +1626,30 @@ void Zoness_80193908(f32 xPos, f32 yPos, f32 zPos, f32 yRot) { } } -void Zoness_80193970(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot, s32 arg5) { - Vec3f sp2C; - Vec3f sp20; +void Zoness_80193970(Effect394* this, f32 xPos, f32 yPos, f32 zPos, f32 yRot, s32 arg5) { + Vec3f src; + Vec3f dest; - Effect_Initialize(effect); + Effect_Initialize(this); Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); - sp2C.x = 0.0f; - sp2C.y = 0.0f; - sp2C.z = 20.0f; - Matrix_MultVec3f(gCalcMatrix, &sp2C, &sp20); - effect->vel.x = sp20.x; - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_394; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->scale2 = 8.0f; - effect->unk_44 = arg5; - effect->scale1 = RAND_FLOAT_CENTERED(200.0f); - effect->obj.rot.z = RAND_FLOAT(360.0f); - effect->state = 1; - effect->unk_78 = 100; - effect->unk_7A = 13; - Object_SetInfo(&effect->info, effect->obj.id); + src.x = 0.0f; + src.y = 0.0f; + src.z = 20.0f; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_394; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->scale2 = 8.0f; + this->unk_44 = arg5; + this->scale1 = RAND_FLOAT_CENTERED(200.0f); + this->obj.rot.z = RAND_FLOAT(360.0f); + this->state = 1; + this->unk_78 = 100; + this->unk_7A = 13; + Object_SetInfo(&this->info, this->obj.id); } void Zoness_80193A98(f32 xPos, f32 yPos, f32 zPos, f32 yRot, s32 arg5) { @@ -1600,31 +1663,31 @@ void Zoness_80193A98(f32 xPos, f32 yPos, f32 zPos, f32 yRot, s32 arg5) { } } -void Zoness_80193B08(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale) { - f32 temp_ft2; +void Zoness_80193B08(Effect394* this, f32 xPos, f32 yPos, f32 zPos, f32 scale) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_394; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->vel.x = RAND_FLOAT_CENTERED(5.0f); + this->vel.y = RAND_FLOAT_CENTERED(3.0f); - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_394; - effect->obj.pos.x = xPos; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->vel.x = RAND_FLOAT_CENTERED(5.0f); - effect->vel.y = RAND_FLOAT_CENTERED(3.0f); - effect->unk_48 = 3; + this->unk_48 = 3; if (Rand_ZeroOne() < 0.5f) { - effect->unk_48 = -effect->unk_48; + this->unk_48 = -this->unk_48; } - effect->unk_4A = 180; - effect->unk_46 = 8; - effect->unk_78 = 101; - effect->unk_7A = 15; - effect->scale2 = scale * 0.25f; - effect->obj.rot.z = RAND_FLOAT(360.0f); + this->unk_4A = 180; + this->unk_46 = 8; + this->unk_78 = 101; + this->unk_7A = 15; + this->scale2 = scale * 0.25f; + this->obj.rot.z = RAND_FLOAT(360.0f); + if (scale == 6.0f) { - effect->vel.z = gPlayer[0].vel.z * 0.6f; + this->vel.z = gPlayer[0].vel.z * 0.6f; } - Object_SetInfo(&effect->info, effect->obj.id); + Object_SetInfo(&this->info, this->obj.id); } void Zoness_80193C5C(f32 xPos, f32 yPos, f32 zPos, f32 scale) { @@ -1648,13 +1711,14 @@ f32 Zoness_80193CC8(s32 arg0) { } bool Zoness_80193D08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { - Boss* this = thisx; - f32 temp; + Boss* this = (Boss*) thisx; if (sZoLimbTimers[limbIndex] == LIMB_DESTROYED) { *dList = NULL; } + gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); + if (sZoSwork[ZO_BSS_37] != 255) { RCP_SetupDL_46(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, sZoSwork[ZO_BSS_37], sZoSwork[ZO_BSS_37]); @@ -1664,6 +1728,7 @@ bool Zoness_80193D08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t RCP_SetupDL_27(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } + switch (limbIndex) { case ZO_LIMB_1: if (sZoFwork[ZO_BSF_0] == 0.0f) { @@ -1793,7 +1858,7 @@ bool Zoness_80193D08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { Vec3f spB4; - Boss* this = thisx; + Boss* this = (Boss*) thisx; Vec3f spA4 = { 96.0f, 199.0f, -9.0f }; Vec3f sp98 = { 50.0f, 150.0f, -20.0f }; Vec3f sp8C = { 50.0f, 150.0f, 20.0f }; @@ -1815,12 +1880,14 @@ void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { sZoFwork[ZO_BSF_32_Y] = spB4.y; sZoFwork[ZO_BSF_32_Z] = spB4.z; break; + case ZO_LIMB_4: Matrix_MultVec3f(gCalcMatrix, &sp38, &spB4); sZoFwork[ZO_BSF_99_X] = spB4.x; sZoFwork[ZO_BSF_99_Y] = spB4.y; sZoFwork[ZO_BSF_99_Z] = spB4.z; break; + case ZO_LIMB_5: var_fv1 = -1.0f; if (sZoFwork[ZO_BSF_4] < 0.0f) { @@ -1832,54 +1899,63 @@ void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { sZoFwork[ZO_BSF_60_Y] = spB4.y; sZoFwork[ZO_BSF_60_Z] = spB4.z; break; + case ZO_LIMB_6: Matrix_MultVec3f(gCalcMatrix, &sp80, &spB4); sZoFwork[ZO_BSF_52_X] = spB4.x; sZoFwork[ZO_BSF_52_Y] = spB4.y; sZoFwork[ZO_BSF_52_Z] = spB4.z; break; + case ZO_LIMB_7: Matrix_MultVec3f(gCalcMatrix, &sp2C, &spB4); sZoFwork[ZO_BSF_106_X] = spB4.x; sZoFwork[ZO_BSF_106_Y] = spB4.y; sZoFwork[ZO_BSF_106_Z] = spB4.z; break; + case ZO_LIMB_8: Matrix_MultVec3f(gCalcMatrix, &sp44, &spB4); sZoFwork[ZO_BSF_93_X] = spB4.x; sZoFwork[ZO_BSF_93_Y] = spB4.y; sZoFwork[ZO_BSF_93_Z] = spB4.z; break; + case ZO_LIMB_9: Matrix_MultVec3f(gCalcMatrix, &sp44, &spB4); sZoFwork[ZO_BSF_96_X] = spB4.x; sZoFwork[ZO_BSF_96_Y] = spB4.y; sZoFwork[ZO_BSF_96_Z] = spB4.z; break; + case ZO_LIMB_10: Matrix_MultVec3f(gCalcMatrix, &spA4, &spB4); sZoFwork[ZO_BSF_29_X] = spB4.x; sZoFwork[ZO_BSF_29_Y] = spB4.y; sZoFwork[ZO_BSF_29_Z] = spB4.z; break; + case ZO_LIMB_11: Matrix_MultVec3f(gCalcMatrix, &sp20, &spB4); sZoFwork[ZO_BSF_109_X] = spB4.x; sZoFwork[ZO_BSF_109_Y] = spB4.y; sZoFwork[ZO_BSF_109_Z] = spB4.z; break; + case ZO_LIMB_14: Matrix_MultVec3f(gCalcMatrix, &sp80, &spB4); sZoFwork[ZO_BSF_43_X] = spB4.x; sZoFwork[ZO_BSF_43_Y] = spB4.y; sZoFwork[ZO_BSF_43_Z] = spB4.z; break; + case ZO_LIMB_16: Matrix_MultVec3f(gCalcMatrix, &sp38, &spB4); sZoFwork[ZO_BSF_102_X] = spB4.x; sZoFwork[ZO_BSF_102_Y] = spB4.y; sZoFwork[ZO_BSF_102_Z] = spB4.z; break; + case ZO_LIMB_22: Matrix_MultVec3f(gCalcMatrix, &sp98, &spB4); sZoFwork[ZO_BSF_37_X] = spB4.x; @@ -1894,6 +1970,7 @@ void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { sZoFwork[ZO_BSF_68_Y] = spB4.y; sZoFwork[ZO_BSF_68_Z] = spB4.z; break; + case ZO_LIMB_24: Matrix_MultVec3f(gCalcMatrix, &sp8C, &spB4); sZoFwork[ZO_BSF_40_X] = spB4.x; @@ -1908,12 +1985,14 @@ void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { sZoFwork[ZO_BSF_71_Y] = spB4.y; sZoFwork[ZO_BSF_71_Z] = spB4.z; break; + case ZO_LIMB_25: Matrix_MultVec3f(gCalcMatrix, &sp68, &spB4); sZoFwork[ZO_BSF_65_X] = spB4.x; sZoFwork[ZO_BSF_65_Y] = spB4.y; sZoFwork[ZO_BSF_65_Z] = spB4.z; break; + case ZO_LIMB_36: Matrix_MultVec3f(gCalcMatrix, &sp80, &spB4); sZoFwork[ZO_BSF_55_X] = spB4.x; @@ -1923,10 +2002,10 @@ void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_Boss_Draw(Boss* bossZO) { - Matrix_Translate(gCalcMatrix, 0.0f, bossZO->fwork[ZO_FWK_3], 0.0f, MTXF_APPLY); +void Zoness_Boss_Draw(BossZO* this) { + Matrix_Translate(gCalcMatrix, 0.0f, this->fwork[ZO_FWK_3], 0.0f, MTXF_APPLY); Matrix_Scale(gCalcMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); - Animation_DrawSkeleton(3, D_ZO_6019E18, bossZO->vwork, Zoness_80193D08, Zoness_80194394, bossZO, gCalcMatrix); + Animation_DrawSkeleton(3, D_ZO_6019E18, this->vwork, Zoness_80193D08, Zoness_80194394, this, gCalcMatrix); } f32 D_i3_801BF6BC[2] = { -600.0f, -3400.0f }; @@ -1935,7 +2014,7 @@ f32 D_i3_801BF6CC[2] = { 250.0f, -250.0f }; f32 D_i3_801BF6D4[2] = { 330.0f, 30.0f }; // OBJ_BOSS_ZO action -void Zoness_Boss_Update(Boss* bossZO) { +void Zoness_Boss_Update(BossZO* this) { f32 sp134; s32 sp130; s32 i; @@ -1967,19 +2046,24 @@ void Zoness_Boss_Update(Boss* bossZO) { Vec3f sp6C; Vec3f sp60 = { 0.0f, 0.0f, 40.0f }; + PRINTF(" Enm->hitNO %d\n", this->dmgPart); + gBossFrameCount++; - if ((bossZO->state != 0) || ((bossZO->state == 0) && (bossZO->timer_050 < 50))) { + + if ((this->state != 0) || ((this->state == 0) && (this->timer_050 < 50))) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_24], sZoFwork[ZO_BSF_23], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossZO->obj.pos.y, sZoFwork[ZO_BSF_25], 0.1f, sZoFwork[ZO_BSF_24], 0.00001f); + Math_SmoothStepToF(&this->obj.pos.y, sZoFwork[ZO_BSF_25], 0.1f, sZoFwork[ZO_BSF_24], 0.00001f); } + if (sZoSwork[ZO_BSS_24] == 0) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_27], sZoFwork[ZO_BSF_26], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossZO->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + sZoFwork[ZO_BSF_28], 0.1f, + Math_SmoothStepToF(&this->obj.pos.z, gPlayer[0].cam.eye.z - gPathProgress + sZoFwork[ZO_BSF_28], 0.1f, sZoFwork[ZO_BSF_27], 0.00001f); } + if ((gGameFrameCount % 4U) == 0) { - if ((bossZO->obj.rot.y <= 90.0f) || (bossZO->obj.rot.y >= 270.0f)) { - sZoSwork[ZO_BSS_43] = bossZO->obj.rot.y; + if ((this->obj.rot.y <= 90.0f) || (this->obj.rot.y >= 270.0f)) { + sZoSwork[ZO_BSS_43] = this->obj.rot.y; if (sZoSwork[ZO_BSS_43] > 270) { sZoSwork[ZO_BSS_43] = 360 - sZoSwork[ZO_BSS_43]; } @@ -1988,11 +2072,11 @@ void Zoness_Boss_Update(Boss* bossZO) { if (sZoSwork[ZO_BSS_43] < 0) { sZoSwork[ZO_BSS_43] = 0; } - Zoness_80193A98(sZoFwork[ZO_BSF_102_X], sZoFwork[ZO_BSF_102_Y], sZoFwork[ZO_BSF_102_Z], bossZO->obj.rot.y, + Zoness_80193A98(sZoFwork[ZO_BSF_102_X], sZoFwork[ZO_BSF_102_Y], sZoFwork[ZO_BSF_102_Z], this->obj.rot.y, sZoSwork[ZO_BSS_43]); sZoSwork[ZO_BSS_44] = 255; } else { - sZoSwork[ZO_BSS_44] = (s32) bossZO->obj.rot.y - 180.0f; + sZoSwork[ZO_BSS_44] = (s32) this->obj.rot.y - 180.0f; if (sZoSwork[ZO_BSS_44] < 0) { sZoSwork[ZO_BSS_44] = -sZoSwork[ZO_BSS_44]; } @@ -2001,58 +2085,61 @@ void Zoness_Boss_Update(Boss* bossZO) { if (sZoSwork[ZO_BSS_44] < 0) { sZoSwork[ZO_BSS_44] = 0; } - Zoness_80193A98(sZoFwork[ZO_BSF_99_X], sZoFwork[ZO_BSF_99_Y], sZoFwork[ZO_BSF_99_Z], bossZO->obj.rot.y, + Zoness_80193A98(sZoFwork[ZO_BSF_99_X], sZoFwork[ZO_BSF_99_Y], sZoFwork[ZO_BSF_99_Z], this->obj.rot.y, sZoSwork[ZO_BSS_44]); sZoSwork[ZO_BSS_43] = 255; } } - if (((bossZO->state == 2) || (bossZO->state == 3) || (bossZO->state == 8)) && (gPlayer[0].radioDamageTimer == 2)) { - if (bossZO->swork[ZO_SWK_8] == 0) { + + if (((this->state == 2) || (this->state == 3) || (this->state == 8)) && (gPlayer[0].radioDamageTimer == 2)) { + if (this->swork[ZO_SWK_8] == 0) { Radio_PlayMessage(gMsg_ID_6068, RCID_BOSS_ZONESS); } - bossZO->swork[ZO_SWK_8]++; - if (bossZO->swork[ZO_SWK_8] >= 5) { - bossZO->swork[ZO_SWK_8] = 0; + this->swork[ZO_SWK_8]++; + if (this->swork[ZO_SWK_8] >= 5) { + this->swork[ZO_SWK_8] = 0; } } - if ((bossZO->swork[ZO_SWK_9] == 0) && (bossZO->state >= 2) && (bossZO->health != 0)) { - if (bossZO->swork[ZO_SWK_10] == 0) { - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 50.0f, 0.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 46.0f, 19.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 35.0f, 35.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 19.0f, 46.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 0.0f, 50.0f, 5.0f); + + if ((this->swork[ZO_SWK_9] == 0) && (this->state >= 2) && (this->health != 0)) { + if (this->swork[ZO_SWK_10] == 0) { + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 50.0f, 0.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 46.0f, 19.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 35.0f, 35.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 19.0f, 46.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 0.0f, 50.0f, 5.0f); } else { - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -50.0f, 0.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -46.0f, 19.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -35.0f, 35.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -19.0f, 46.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 0.0f, 50.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -50.0f, 0.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -46.0f, 19.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -35.0f, 35.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -19.0f, 46.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 0.0f, 50.0f, 5.0f); } + this->swork[ZO_SWK_11]++; + this->swork[ZO_SWK_11] &= 1; + this->swork[ZO_SWK_9] = 20; - bossZO->swork[ZO_SWK_11]++; - bossZO->swork[ZO_SWK_11] &= 1; - bossZO->swork[ZO_SWK_9] = 20; - if (bossZO->swork[ZO_SWK_11] == 0) { - - bossZO->swork[ZO_SWK_10]++; - bossZO->swork[ZO_SWK_10] &= 1; - bossZO->swork[ZO_SWK_9] = 100; + if (this->swork[ZO_SWK_11] == 0) { + this->swork[ZO_SWK_10]++; + this->swork[ZO_SWK_10] &= 1; + this->swork[ZO_SWK_9] = 100; } } - if (bossZO->swork[ZO_SWK_9] != 0) { - bossZO->swork[ZO_SWK_9]--; + + if (this->swork[ZO_SWK_9] != 0) { + this->swork[ZO_SWK_9]--; } - switch (bossZO->state) { + + switch (this->state) { case 0: - if ((((gGameFrameCount % 8) == 0) || (bossZO->timer_050 == 43)) && (bossZO->swork[ZO_SWK_13] == 0) && - ((bossZO->swork[ZO_SWK_12] < 7) || (bossZO->timer_050 == 43))) { + if ((((gGameFrameCount % 8) == 0) || (this->timer_050 == 43)) && (this->swork[ZO_SWK_13] == 0) && + ((this->swork[ZO_SWK_12] < 7) || (this->timer_050 == 43))) { D_ctx_801779A8[0] = 20; if (Play_CheckDynaFloorCollision(&sp134, &sp130, sZoFwork[ZO_BSF_43_X], sZoFwork[ZO_BSF_43_Y] - 300.0f, sZoFwork[ZO_BSF_43_Z])) { sp100 = 1.5f; spFC = 2.0f; - if (bossZO->timer_050 == 43) { + if (this->timer_050 == 43) { sp100 = 5.0f; spFC = 3.0f; if (sZoSwork[ZO_BSS_55] == 0) { @@ -2063,52 +2150,58 @@ void Zoness_Boss_Update(Boss* bossZO) { func_effect_8008377C(sZoFwork[ZO_BSF_43_X], sp134, sZoFwork[ZO_BSF_43_Z] + 100.0f, 5.0f, 3.0f); } func_effect_8008377C(sZoFwork[ZO_BSF_43_X], sp134, sZoFwork[ZO_BSF_43_Z] + 100.0f, sp100, spFC); - if (bossZO->timer_050 == 43) { - AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, bossZO->sfxSource, 4); + if (this->timer_050 == 43) { + AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, bossZO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, this->sfxSource, 4); } - bossZO->swork[ZO_SWK_12]++; + this->swork[ZO_SWK_12]++; } } - if ((bossZO->timer_050 < 43) && (bossZO->timer_050 >= 31)) { + + if ((this->timer_050 < 43) && (this->timer_050 >= 31)) { D_ctx_801779A8[0] = 20; } - Math_SmoothStepToF(&bossZO->fwork[ZO_FWK_4], 1.0f, 0.1f, 10.0f, 0.0f); - if (bossZO->timer_050 == 0) { - if (bossZO->swork[ZO_SWK_3] == 0) { + + Math_SmoothStepToF(&this->fwork[ZO_FWK_4], 1.0f, 0.1f, 10.0f, 0.0f); + + if (this->timer_050 == 0) { + if (this->swork[ZO_SWK_3] == 0) { Radio_PlayMessage(gMsg_ID_6069, RCID_BOSS_ZONESS); - bossZO->swork[ZO_SWK_3]++; + this->swork[ZO_SWK_3]++; } Math_SmoothStepToF(&sZoFwork[ZO_BSF_1], sZoFwork[ZO_BSF_74], 0.1f, 2.0f, 0.00001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_11], sZoFwork[ZO_BSF_75], 0.1f, 2.0f, 0.00001f); - if (bossZO->timer_052 == 0) { - bossZO->swork[ZO_SWK_12] = 0; + if (this->timer_052 == 0) { + this->swork[ZO_SWK_12] = 0; sZoFwork[ZO_BSF_77] = 0.0f; - bossZO->swork[ZO_SWK_13] = 1; - bossZO->state = 1; + this->swork[ZO_SWK_13] = 1; + this->state = 1; } } break; + case 1: - Math_SmoothStepToF(&bossZO->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f); - Zoness_8019962C(bossZO, 0.0f); + Math_SmoothStepToF(&this->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f); + Zoness_8019962C(this, 0.0f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_1], sZoFwork[ZO_BSF_74], 0.1f, 2.0f, 0.00001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_11], sZoFwork[ZO_BSF_75], 0.1f, 2.0f, 0.00001f); - if ((bossZO->timer_050 == 0) && ((gGameFrameCount % 4) == 0)) { + + if ((this->timer_050 == 0) && ((gGameFrameCount % 4) == 0)) { if (sZoSwork[ZO_BSS_9] != 0) { Zoness_80193908(sZoFwork[ZO_BSF_29_X], sZoFwork[ZO_BSF_29_Y], sZoFwork[ZO_BSF_29_Z], - bossZO->obj.rot.y); + this->obj.rot.y); } if (sZoSwork[ZO_BSS_10] != 0) { Zoness_80193908(sZoFwork[ZO_BSF_32_X], sZoFwork[ZO_BSF_32_Y], sZoFwork[ZO_BSF_32_Z], - bossZO->obj.rot.y); + this->obj.rot.y); } + sZoSwork[ZO_BSS_6]++; if (sZoSwork[ZO_BSS_6] > 10) { sZoSwork[ZO_BSS_6] = 0; sZoSwork[ZO_BSS_7]++; - bossZO->timer_050 = 30; + this->timer_050 = 30; if ((sZoSwork[ZO_BSS_7] == 1) && (sZoSwork[ZO_BSS_19] == 0)) { sZoFwork[ZO_BSF_74] = 230.0f; sZoFwork[ZO_BSF_75] = -230.0f; @@ -2126,57 +2219,61 @@ void Zoness_Boss_Update(Boss* bossZO) { } if (sZoSwork[ZO_BSS_7] >= 2) { sZoSwork[ZO_BSS_7] = 0; - bossZO->timer_050 = 0; + this->timer_050 = 0; sZoFwork[ZO_BSF_77] = 0.0f; - bossZO->swork[ZO_SWK_4] = 1000; - bossZO->state = 3; + this->swork[ZO_SWK_4] = 1000; + this->state = 3; if (sZoSwork[ZO_BSS_19] == 0) { - bossZO->timer_050 = 30; - bossZO->swork[ZO_SWK_4] = 0; - bossZO->state = 2; + this->timer_050 = 30; + this->swork[ZO_SWK_4] = 0; + this->state = 2; } } } } break; + case 2: - if (bossZO->timer_050 == 1) { + if (this->timer_050 == 1) { sZoSwork[ZO_BSS_20]++; sZoFwork[ZO_BSF_77] = 0.0f; } - if (bossZO->timer_050 == 0) { - Math_SmoothStepToF(&bossZO->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f); + if (this->timer_050 == 0) { + Math_SmoothStepToF(&this->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_1], sZoFwork[ZO_BSF_74], 0.2f, 4.0f, 0.00001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_11], sZoFwork[ZO_BSF_75], 0.2f, 4.0f, 0.00001f); if ((sZoSwork[ZO_BSS_20] == 0) && (sZoFwork[ZO_BSF_1] == 0.0f)) { - bossZO->swork[ZO_SWK_4] = 1000; - bossZO->state = 3; + this->swork[ZO_SWK_4] = 1000; + this->state = 3; } } break; + case 3: - if (ZO_HIT_12(bossZO)->z.offset != -883.99994f) { - ZO_HIT_12(bossZO)->z.offset = -883.99994f; // 13 * 68.0 - ZO_HIT_12(bossZO)->z.size = 244.4f; // 13 * 18.8 - ZO_HIT_12(bossZO)->y.offset = 863.19995f; // 13 * 66.4 - ZO_HIT_12(bossZO)->y.size = 171.59999f; // 13 * 13.2 - ZO_HIT_12(bossZO)->x.offset = 0.0f; - ZO_HIT_12(bossZO)->x.size = 93.6f; // 13 * 7.2 + if (ZO_HIT_12(this)->z.offset != -883.99994f) { + ZO_HIT_12(this)->z.offset = -883.99994f; // 13 * 68.0 + ZO_HIT_12(this)->z.size = 244.4f; // 13 * 18.8 + ZO_HIT_12(this)->y.offset = 863.19995f; // 13 * 66.4 + ZO_HIT_12(this)->y.size = 171.59999f; // 13 * 13.2 + ZO_HIT_12(this)->x.offset = 0.0f; + ZO_HIT_12(this)->x.size = 93.6f; // 13 * 7.2 } - Math_SmoothStepToF(&bossZO->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f); - if (bossZO->timer_058 != 0) { + + Math_SmoothStepToF(&this->fwork[ZO_FWK_4], 100.0f, 0.1f, 1.0f, 0.0f); + + if (this->timer_058 != 0) { if ((sZoSwork[ZO_BSS_11] != 0) || (sZoSwork[ZO_BSS_12] != 0)) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_21], sZoFwork[ZO_BSF_20], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossZO->obj.pos.x, D_i3_801BF6CC[sZoSwork[ZO_BSS_21]], 0.1f, - sZoFwork[ZO_BSF_21], 0.00001f); + Math_SmoothStepToF(&this->obj.pos.x, D_i3_801BF6CC[sZoSwork[ZO_BSS_21]], 0.1f, sZoFwork[ZO_BSF_21], + 0.00001f); } if (sZoSwork[ZO_BSS_24] == 0) { Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_79], sZoFwork[ZO_BSF_78], 0.1f, 2.0f, 0.0001f); - Math_SmoothStepToAngle(&bossZO->obj.rot.y, D_i3_801BF6D4[sZoSwork[ZO_BSS_21]], 0.1f, + Math_SmoothStepToAngle(&this->obj.rot.y, D_i3_801BF6D4[sZoSwork[ZO_BSS_21]], 0.1f, sZoFwork[ZO_BSF_79], 0.00001f); } } else { - bossZO->timer_058 = 100; + this->timer_058 = 100; sZoFwork[ZO_BSF_20] = 5.0f; sZoFwork[ZO_BSF_21] = sZoFwork[ZO_BSF_79] = 0.0f; sZoFwork[ZO_BSF_78] = 2.0f; @@ -2185,8 +2282,9 @@ void Zoness_Boss_Update(Boss* bossZO) { sZoSwork[ZO_BSS_21] = 0; } } - if ((bossZO->swork[ZO_SWK_4] == 0) && ((sZoSwork[ZO_BSS_9] != 0) || (sZoSwork[ZO_BSS_10] != 0))) { - Zoness_80198ECC(bossZO); + + if ((this->swork[ZO_SWK_4] == 0) && ((sZoSwork[ZO_BSS_9] != 0) || (sZoSwork[ZO_BSS_10] != 0))) { + Zoness_80198ECC(this); } if ((sZoSwork[ZO_BSS_32] == 0) && (sZoSwork[ZO_BSS_34] == 1) && (sZoSwork[ZO_BSS_24] == 0)) { Radio_PlayMessage(gMsg_ID_6080, RCID_PEPPY); @@ -2194,47 +2292,45 @@ void Zoness_Boss_Update(Boss* bossZO) { } if (sZoSwork[ZO_BSS_4] == 0) { sZoSwork[ZO_BSS_4] = 100; - Zoness_801989FC(bossZO); + Zoness_801989FC(this); } if (sZoSwork[ZO_BSS_24] != 0) { sZoSwork[ZO_BSS_20] = 1; - if (bossZO->swork[ZO_SWK_7] == 0) { - bossZO->swork[ZO_SWK_7]++; - bossZO->swork[ZO_SWK_7] &= 1; + if (this->swork[ZO_SWK_7] == 0) { + this->swork[ZO_SWK_7]++; + this->swork[ZO_SWK_7] &= 1; Radio_PlayMessage(gMsg_ID_6078, RCID_BOSS_ZONESS); } - if (bossZO->timer_056 == 0) { - bossZO->swork[ZO_SWK_1]++; - bossZO->swork[ZO_SWK_1] &= 1; - bossZO->timer_056 = 100; + if (this->timer_056 == 0) { + this->swork[ZO_SWK_1]++; + this->swork[ZO_SWK_1] &= 1; + this->timer_056 = 100; } - bossZO->fwork[ZO_FWK_5] += 4.0f; - bossZO->vel.x = COS_DEG(bossZO->fwork[ZO_FWK_5]) * 40.0f; - padF4 = Math_Atan2F(bossZO->fwork[ZO_FWK_6] - bossZO->obj.pos.x, - gPlayer[0].cam.eye.z - gPathProgress + D_i3_801BF6BC[bossZO->swork[ZO_SWK_1]] - - bossZO->obj.pos.z); + this->fwork[ZO_FWK_5] += 4.0f; + this->vel.x = COS_DEG(this->fwork[ZO_FWK_5]) * 40.0f; + padF4 = Math_Atan2F(this->fwork[ZO_FWK_6] - this->obj.pos.x, gPlayer[0].cam.eye.z - gPathProgress + + D_i3_801BF6BC[this->swork[ZO_SWK_1]] - + this->obj.pos.z); padF4 = Math_RadToDeg(padF4); - Math_SmoothStepToAngle(&bossZO->fwork[ZO_FWK_7], padF4, 0.1f, 100.0f, 0.001f); - Matrix_RotateY(gCalcMatrix, bossZO->fwork[ZO_FWK_7] * M_DTOR, MTXF_NEW); + Math_SmoothStepToAngle(&this->fwork[ZO_FWK_7], padF4, 0.1f, 100.0f, 0.001f); + Matrix_RotateY(gCalcMatrix, this->fwork[ZO_FWK_7] * M_DTOR, MTXF_NEW); spE4.x = spE4.y = 0.0f; spE4.z = 20.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spCC); var_s0 = 0; - bossZO->vel.z = spCC.z - gPathVelZ; - if (bossZO->vel.x > 0.0f) { + this->vel.z = spCC.z - gPathVelZ; + if (this->vel.x > 0.0f) { var_s0 = 1; } - if (var_s0 != bossZO->swork[ZO_SWK_2]) { - bossZO->swork[ZO_SWK_2] = var_s0; - bossZO->fwork[ZO_FWK_8] = 0.0f; + if (var_s0 != this->swork[ZO_SWK_2]) { + this->swork[ZO_SWK_2] = var_s0; + this->fwork[ZO_FWK_8] = 0.0f; } - Math_SmoothStepToF(&bossZO->fwork[ZO_FWK_8], 10.0f, 0.01f, 0.1f, 0.0f); - Math_SmoothStepToAngle(&bossZO->obj.rot.z, D_i3_801BF6C4[var_s0], 0.1f, bossZO->fwork[ZO_FWK_8], - 0.00001f); - Math_SmoothStepToAngle(&bossZO->obj.rot.y, D_i3_801BF6D4[var_s0], 0.1f, bossZO->fwork[ZO_FWK_8], - 0.00001f); - Matrix_RotateX(gCalcMatrix, -bossZO->obj.rot.x * M_DTOR, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); + Math_SmoothStepToF(&this->fwork[ZO_FWK_8], 10.0f, 0.01f, 0.1f, 0.0f); + Math_SmoothStepToAngle(&this->obj.rot.z, D_i3_801BF6C4[var_s0], 0.1f, this->fwork[ZO_FWK_8], 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.y, D_i3_801BF6D4[var_s0], 0.1f, this->fwork[ZO_FWK_8], 0.00001f); + Matrix_RotateX(gCalcMatrix, -this->obj.rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_APPLY); spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_93_X]; spE4.y = gPlayer[0].pos.y - sZoFwork[ZO_BSF_93_Y]; spE4.z = gPlayer[0].trueZpos - sZoFwork[ZO_BSF_93_Z]; @@ -2279,59 +2375,61 @@ void Zoness_Boss_Update(Boss* bossZO) { Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_7], sp110, 0.2f, 2.0f, 0.0f); Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_10], sp104, 0.2f, 2.0f, 0.0f); Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_9], sp108, 0.2f, 2.0f, 0.0f); - Zoness_80198BE8(bossZO, 0); - Zoness_80198BE8(bossZO, 1); + Zoness_80198BE8(this, 0); + Zoness_80198BE8(this, 1); } break; + case 4: - if (bossZO->swork[ZO_SWK_15] == 0) { + if (this->swork[ZO_SWK_15] == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 0; } - Math_SmoothStepToAngle(&bossZO->obj.rot.z, bossZO->fwork[ZO_FWK_9], 0.1f, 100.0f, 0.00001f); - Math_SmoothStepToAngle(&bossZO->fwork[ZO_FWK_9], 0.0f, 0.1f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[ZO_FWK_9], 0.1f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[ZO_FWK_9], 0.0f, 0.1f, 100.0f, 0.00001f); if ((sZoSwork[ZO_BSS_11] == 0) && (sZoLimbTimers[ZO_LIMB_7] != LIMB_DESTROYED)) { - Zoness_80198F3C(bossZO, 0, 46); + Zoness_80198F3C(this, 0, 46); if (sZoFwork[ZO_BSF_17] > -400.0f) { sZoFwork[ZO_BSF_17] -= 10.0f; } else { - Audio_KillSfxBySource(bossZO->sfxSource); - if (bossZO->obj.rot.z > 359.0f) { + Audio_KillSfxBySource(this->sfxSource); + if (this->obj.rot.z > 359.0f) { if (sZoSwork[ZO_BSS_13] != 0) { - Zoness_8019907C(bossZO); + Zoness_8019907C(this); } else { - Zoness_8019914C(bossZO, 0); + Zoness_8019914C(this, 0); } } } } if ((sZoSwork[ZO_BSS_12] == 0) && (sZoLimbTimers[ZO_LIMB_11] != LIMB_DESTROYED)) { - Zoness_80198F3C(bossZO, 1, 49); + Zoness_80198F3C(this, 1, 49); if (sZoFwork[ZO_BSF_18] > -400.0f) { sZoFwork[ZO_BSF_18] -= 10.0f; } else { - Audio_KillSfxBySource(bossZO->sfxSource); - if (bossZO->obj.rot.z < 1.0f) { + Audio_KillSfxBySource(this->sfxSource); + if (this->obj.rot.z < 1.0f) { if (sZoSwork[ZO_BSS_13] != 0) { - Zoness_8019907C(bossZO); + Zoness_8019907C(this); } else { - Zoness_8019914C(bossZO, 1); + Zoness_8019914C(this, 1); } } } } break; + case 5: - Math_SmoothStepToAngle(&bossZO->obj.rot.z, bossZO->fwork[ZO_FWK_9], 0.1f, 100.0f, 0.00001f); - Math_SmoothStepToAngle(&bossZO->fwork[ZO_FWK_9], 0.0f, 0.1f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[ZO_FWK_9], 0.1f, 100.0f, 0.00001f); + Math_SmoothStepToAngle(&this->fwork[ZO_FWK_9], 0.0f, 0.1f, 100.0f, 0.00001f); switch (sZoSwork[ZO_BSS_16]) { case 0: if (sZoSwork[ZO_BSS_13] != 0) { - Zoness_8019962C(bossZO, 180.0f); - if (bossZO->obj.rot.y == 180.0f) { + Zoness_8019962C(this, 180.0f); + if (this->obj.rot.y == 180.0f) { if ((sZoSwork[ZO_BSS_11] == 0) && (sZoLimbTimers[ZO_LIMB_7] != LIMB_DESTROYED)) { - Zoness_801991D0(bossZO, 0); + Zoness_801991D0(this, 0); } else { - Zoness_801991D0(bossZO, 1); + Zoness_801991D0(this, 1); } } } else { @@ -2339,34 +2437,37 @@ void Zoness_Boss_Update(Boss* bossZO) { sZoSwork[ZO_BSS_36]++; sZoFwork[ZO_BSF_77] = 0.0f; } - Zoness_8019962C(bossZO, 0.0f); - if (bossZO->obj.rot.y == 0.0f) { + Zoness_8019962C(this, 0.0f); + if (this->obj.rot.y == 0.0f) { if (sZoSwork[ZO_BSS_11] == 0) { - Zoness_8019914C(bossZO, 0); + Zoness_8019914C(this, 0); } if (sZoSwork[ZO_BSS_12] == 0) { - Zoness_8019914C(bossZO, 1); + Zoness_8019914C(this, 1); } } } break; + case 1: - Zoness_80199470(bossZO, 0); + Zoness_80199470(this, 0); break; + case 2: - Zoness_80199470(bossZO, 1); + Zoness_80199470(this, 1); break; + case 3: if (sZoSwork[ZO_BSS_13] != 0) { - if (bossZO->timer_050 == 0) { + if (this->timer_050 == 0) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_4], 0.0f, 1.0f, 5.0f, 0.001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_3], 0.0f, 1.0f, 3.0f, 0.001f); if (sZoFwork[ZO_BSF_3] == 0.0f) { - Zoness_8019962C(bossZO, 0.0f); - if (bossZO->obj.rot.y == 0.0f) { + Zoness_8019962C(this, 0.0f); + if (this->obj.rot.y == 0.0f) { sZoSwork[ZO_BSS_16] = 0; - bossZO->swork[ZO_SWK_4] = 1000; - bossZO->state = 3; + this->swork[ZO_SWK_4] = 1000; + this->state = 3; } } } @@ -2375,20 +2476,22 @@ void Zoness_Boss_Update(Boss* bossZO) { sZoSwork[ZO_BSS_36]++; sZoFwork[ZO_BSF_77] = 0.0f; } - Zoness_8019962C(bossZO, 0.0f); - if (bossZO->obj.rot.y == 0.0f) { + Zoness_8019962C(this, 0.0f); + if (this->obj.rot.y == 0.0f) { sZoSwork[ZO_BSS_16] = 0; sZoSwork[ZO_BSS_36] = 0; sZoFwork[ZO_BSF_77] = 0.0f; - bossZO->swork[ZO_SWK_4] = 1000; - bossZO->state = 3; + this->swork[ZO_SWK_4] = 1000; + this->state = 3; } } break; } break; + case 6: D_ctx_801779A8[0] = 20; + if (gCameraShake == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlpha = gFillScreenAlphaTarget = 255; @@ -2399,38 +2502,41 @@ void Zoness_Boss_Update(Boss* bossZO) { if (gCameraShake == 29) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 0; } + if ((gGameFrameCount % 4U) == 0) { - spE4.x = RAND_FLOAT_CENTERED(300.0f) + bossZO->obj.pos.x; - spE4.y = RAND_FLOAT_CENTERED(200.0f) + (bossZO->obj.pos.y + 600.0f); - spE4.z = bossZO->obj.pos.z - 50.0f; - spD8.x = bossZO->obj.rot.x; + spE4.x = RAND_FLOAT_CENTERED(300.0f) + this->obj.pos.x; + spE4.y = RAND_FLOAT_CENTERED(200.0f) + (this->obj.pos.y + 600.0f); + spE4.z = this->obj.pos.z - 50.0f; + spD8.x = this->obj.rot.x; spD8.y = Math_ModF(RAND_FLOAT_CENTERED(60.0f) + 360.0f, 360.0f); - spD8.z = bossZO->obj.rot.z; + spD8.z = this->obj.rot.z; for (i = 0; i < 5; i++) { Zoness_SpawnDebris(&spE4, &spD8, RAND_FLOAT_CENTERED(30.0f), RAND_FLOAT_CENTERED(20.0f), - RAND_FLOAT_CENTERED(30.0f), 4, 1.0f, RAND_FLOAT(15.0f) + (bossZO->scale * 10.0f), + RAND_FLOAT_CENTERED(30.0f), 4, 1.0f, RAND_FLOAT(15.0f) + (this->scale * 10.0f), 0); } } - bossZO->vel.x = 0.0f; - Math_SmoothStepToF(&bossZO->obj.pos.x, 0.0f, 0.1f, 5.0f, 0.00001f); + + this->vel.x = 0.0f; + Math_SmoothStepToF(&this->obj.pos.x, 0.0f, 0.1f, 5.0f, 0.00001f); + if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { sZoLimbTimers[ZO_LIMB_36] = 15; sZoLimbTimers[ZO_LIMB_25] = 15; } - func_effect_8007C120(sZoFwork[ZO_BSF_55_X], sZoFwork[ZO_BSF_55_Y], sZoFwork[ZO_BSF_55_Z], bossZO->vel.x, - bossZO->vel.y, bossZO->vel.z, 0.2f, 10); + func_effect_8007C120(sZoFwork[ZO_BSF_55_X], sZoFwork[ZO_BSF_55_Y], sZoFwork[ZO_BSF_55_Z], this->vel.x, + this->vel.y, this->vel.z, 0.2f, 10); func_effect_8007D0E0(sZoFwork[ZO_BSF_55_X] + RAND_FLOAT_CENTERED(200.0f), sZoFwork[ZO_BSF_55_Y] + RAND_RANGE(-160.0f, 640.0f), sZoFwork[ZO_BSF_55_Z], 10.0f); - if (bossZO->timer_050 == 30) { + if (this->timer_050 == 30) { Radio_PlayMessage(gMsg_ID_6079, RCID_BOSS_ZONESS); } - if (bossZO->timer_050 == 0) { + if (this->timer_050 == 0) { gEffects[99].obj.status = gEffects[98].obj.status = OBJ_FREE; sZoFwork[ZO_BSF_25] = -1000.0f; sZoFwork[ZO_BSF_23] = 10.0f; gShowBossHealth = 0; - func_effect_8007A568(bossZO->obj.pos.x, bossZO->obj.pos.y, bossZO->obj.pos.z, 80.0f); + func_effect_8007A568(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 80.0f); if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsFrameCount = 0; @@ -2444,45 +2550,47 @@ void Zoness_Boss_Update(Boss* bossZO) { gPlayer[0].rot.y += 360.0f; } gPlayer[0].yRot_114 = 0.0f; - Boss_CompleteLevel(&gPlayer[0], bossZO->obj.pos.x, 0.0f, bossZO->obj.pos.z); + Boss_CompleteLevel(&gPlayer[0], this->obj.pos.x, 0.0f, this->obj.pos.z); } - bossZO->timer_050 = 70; + this->timer_050 = 70; sZoSwork[ZO_BSS_5] = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = gFillScreenAlpha = 0; - Boss_AwardBonus(bossZO); - bossZO->state = 7; + Boss_AwardBonus(this); + this->state = 7; } break; + case 7: D_ctx_801779A8[0] = 20; if (((gGameFrameCount % 8) == 0) && - (Play_CheckDynaFloorCollision(&sp134, &sp130, bossZO->obj.pos.x, -300.0f, bossZO->obj.pos.z) != 0)) { - func_effect_8008377C(RAND_FLOAT_CENTERED(500.0f) + bossZO->obj.pos.x, sp134 - 300.0f, - RAND_FLOAT_CENTERED(3000.0f) + bossZO->obj.pos.z, 5.0f, 2.0f); + (Play_CheckDynaFloorCollision(&sp134, &sp130, this->obj.pos.x, -300.0f, this->obj.pos.z) != 0)) { + func_effect_8008377C(RAND_FLOAT_CENTERED(500.0f) + this->obj.pos.x, sp134 - 300.0f, + RAND_FLOAT_CENTERED(3000.0f) + this->obj.pos.z, 5.0f, 2.0f); } - if ((bossZO->timer_050 == 0) || (bossZO->obj.pos.y < -800.0f)) { - Object_Kill(&bossZO->obj, bossZO->sfxSource); + if ((this->timer_050 == 0) || (this->obj.pos.y < -800.0f)) { + Object_Kill(&this->obj, this->sfxSource); } break; + case 8: if (sZoSwork[ZO_BSS_18] != 0) { - if ((sZoSwork[ZO_BSS_27] != 2) && (bossZO->swork[ZO_SWK_5] == 0) && (bossZO->swork[ZO_SWK_6] < 2) && + if ((sZoSwork[ZO_BSS_27] != 2) && (this->swork[ZO_SWK_5] == 0) && (this->swork[ZO_SWK_6] < 2) && ((sZoSwork[ZO_BSS_33] == 0) || (sZoSwork[ZO_BSS_33] >= 30))) { sZoSwork[ZO_BSS_18]--; } - Zoness_8019962C(bossZO, 0.0f); + Zoness_8019962C(this, 0.0f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_1], -130.0f, 0.1f, 2.0f, 0.00001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_11], 130.0f, 0.1f, 2.0f, 0.00001f); if (sZoSwork[ZO_BSS_18] < 331) { if (sZoSwork[ZO_BSS_8] != 0) { - if ((sZoSwork[ZO_BSS_20] == 0) && (bossZO->swork[ZO_SWK_6] == 1)) { + if ((sZoSwork[ZO_BSS_20] == 0) && (this->swork[ZO_SWK_6] == 1)) { sZoSwork[ZO_BSS_20] = 1; sZoSwork[ZO_BSS_27]++; if (sZoSwork[ZO_BSS_27] >= 3) { sZoSwork[ZO_BSS_27] = 3; } } - } else if ((bossZO->swork[ZO_SWK_5] == 0) && (bossZO->swork[ZO_SWK_6] < 2)) { + } else if ((this->swork[ZO_SWK_5] == 0) && (this->swork[ZO_SWK_6] < 2)) { if (sZoSwork[ZO_BSS_33] == 0) { Radio_PlayMessage(gMsg_ID_6077, RCID_BOSS_ZONESS); sZoSwork[ZO_BSS_27] = 3; @@ -2499,18 +2607,18 @@ void Zoness_Boss_Update(Boss* bossZO) { if ((sZoSwork[ZO_BSS_27] == 0) && (sZoSwork[ZO_BSS_18] == 400) && (sZoSwork[ZO_BSS_8] != 0)) { Radio_PlayMessage(gMsg_ID_6074, RCID_BOSS_ZONESS); sZoSwork[ZO_BSS_27] = 1; - bossZO->swork[ZO_SWK_6] = 30; + this->swork[ZO_SWK_6] = 30; } if ((sZoSwork[ZO_BSS_26] == 0) && (sZoSwork[ZO_BSS_18] == 200) && (sZoSwork[ZO_BSS_27] == 3)) { Radio_PlayMessage(gMsg_ID_6075, RCID_BOSS_ZONESS); sZoSwork[ZO_BSS_26]++; - bossZO->timer_050 = 100; + this->timer_050 = 100; } - if ((bossZO->timer_050 == 0) && (sZoSwork[ZO_BSS_26] != 0)) { - bossZO->timer_050 = 50; + if ((this->timer_050 == 0) && (sZoSwork[ZO_BSS_26] != 0)) { + this->timer_050 = 50; sZoFwork[ZO_BSF_37_X] = RAND_RANGE(-330.0f, 770.0f); sZoFwork[ZO_BSF_40_X] = RAND_RANGE(-560.0f, 240.0f); - Zoness_801989FC(bossZO); + Zoness_801989FC(this); } } else { if (sZoSwork[ZO_BSS_28] == 0) { @@ -2519,25 +2627,26 @@ void Zoness_Boss_Update(Boss* bossZO) { } sZoFwork[ZO_BSF_25] = 0.0f; sZoFwork[ZO_BSF_23] = 3.0f; - bossZO->timer_054 = 0; + this->timer_054 = 0; sZoSwork[ZO_BSS_5] = 0; sZoFwork[ZO_BSF_28] = -2600.0f; sZoFwork[ZO_BSF_15] = sZoFwork[ZO_BSF_16] = 0.0f; sZoSwork[ZO_BSS_18] = 0; for (i = 0; i < 2; i++) { - Zoness_80199394(bossZO, i); + Zoness_80199394(this, i); } - bossZO->timer_050 = 100; - bossZO->state = 0; + this->timer_050 = 100; + this->state = 0; } break; } sZoFwork[ZO_BSF_2] += 20.0f; - spE4.x = gPlayer[0].pos.x - bossZO->obj.pos.x; - spE4.z = gPlayer[0].trueZpos - bossZO->obj.pos.z; + spE4.x = gPlayer[0].pos.x - this->obj.pos.x; + spE4.z = gPlayer[0].trueZpos - this->obj.pos.z; Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_14], Math_RadToDeg(Math_Atan2F(spE4.x, spE4.z)), 0.5f, 100.0f, 0.001f); Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_0], sZoFwork[ZO_BSF_76], 0.2f, 4.0f, 0.0001f); + if ((((gGameFrameCount % 64) == 0) || (sZoSwork[ZO_BSS_22] != 0)) && ((Rand_ZeroOne() < 0.5f) || (sZoSwork[ZO_BSS_22] != 0)) && (sZoSwork[ZO_BSS_23] == 0)) { sZoSwork[ZO_BSS_23] = D_i3_801BF5F0[sZoSwork[ZO_BSS_22]]; @@ -2553,26 +2662,27 @@ void Zoness_Boss_Update(Boss* bossZO) { spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_65_X]; spE4.z = gPlayer[0].trueZpos - sZoFwork[ZO_BSF_65_Z]; Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_19], Math_RadToDeg(Math_Atan2F(spE4.x, spE4.z)), 0.1f, 5.0f, 0.0f); - if ((bossZO->state >= 3) && (bossZO->state < 6)) { - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); + + if ((this->state >= 3) && (this->state < 6)) { + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &spA8, &spD8); Matrix_MultVec3f(gCalcMatrix, &sp9C, &spCC); sp78 = spD8; sp6C = spCC; - Matrix_RotateX(gCalcMatrix, -bossZO->obj.rot.x * M_DTOR, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); - spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spD8.x); - spE4.y = gPlayer[0].pos.y - (bossZO->obj.pos.y + spD8.y); - spE4.z = gPlayer[0].trueZpos - (bossZO->obj.pos.z + spD8.z); + Matrix_RotateX(gCalcMatrix, -this->obj.rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_APPLY); + spE4.x = gPlayer[0].pos.x - (this->obj.pos.x + spD8.x); + spE4.y = gPlayer[0].pos.y - (this->obj.pos.y + spD8.y); + spE4.z = gPlayer[0].trueZpos - (this->obj.pos.z + spD8.z); Matrix_MultVec3f(gCalcMatrix, &spE4, &spD8); sp11C = Math_Atan2F(spD8.x, spD8.z); sp11C = Math_RadToDeg(sp11C); sp120 = Math_Atan2F(spD8.y, sqrtf(SQ(spD8.x) + SQ(spD8.z))); sp120 = Math_RadToDeg(-sp120); - spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spCC.x); - spE4.y = gPlayer[0].pos.y - (bossZO->obj.pos.y + spCC.y); - spE4.z = gPlayer[0].trueZpos - (bossZO->obj.pos.z + spCC.z); + spE4.x = gPlayer[0].pos.x - (this->obj.pos.x + spCC.x); + spE4.y = gPlayer[0].pos.y - (this->obj.pos.y + spCC.y); + spE4.z = gPlayer[0].trueZpos - (this->obj.pos.z + spCC.z); Matrix_MultVec3f(gCalcMatrix, &spE4, &spCC); sp114 = Math_Atan2F(spCC.x, spCC.z); sp114 = Math_RadToDeg(sp114); @@ -2582,13 +2692,13 @@ void Zoness_Boss_Update(Boss* bossZO) { Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_5], sp120, 0.2f, 2.0f, 0.0f); Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_16], sp114, 0.2f, 2.0f, 0.0f); Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_12], sp118, 0.2f, 2.0f, 0.0f); - if ((bossZO->obj.rot.y >= 330.0f) || (bossZO->obj.rot.y <= 30.0f) || - ((bossZO->obj.rot.y <= 200.0f) && (bossZO->obj.rot.y >= 160.0f))) { + if ((this->obj.rot.y >= 330.0f) || (this->obj.rot.y <= 30.0f) || + ((this->obj.rot.y <= 200.0f) && (this->obj.rot.y >= 160.0f))) { if ((sZoFwork[ZO_BSF_15] > 315.0f) || (sZoFwork[ZO_BSF_15] < 215.0f)) { - Zoness_801986FC(bossZO, 0, sp78.x, sp78.y, sp78.z, sZoFwork[ZO_BSF_5]); + Zoness_801986FC(this, 0, sp78.x, sp78.y, sp78.z, sZoFwork[ZO_BSF_5]); } if ((sZoFwork[ZO_BSF_16] < 45.0f) || (sZoFwork[ZO_BSF_16] > 145.0f)) { - Zoness_801986FC(bossZO, 1, sp6C.x, sp6C.y, sp6C.z, sZoFwork[ZO_BSF_12]); + Zoness_801986FC(this, 1, sp6C.x, sp6C.y, sp6C.z, sZoFwork[ZO_BSF_12]); } Math_SmoothStepToF(&sZoFwork[ZO_BSF_35], 0.0f, 1.0f, 2.0f, 0.00001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_36], 0.0f, 1.0f, 2.0f, 0.00001f); @@ -2596,6 +2706,7 @@ void Zoness_Boss_Update(Boss* bossZO) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_13], sZoFwork[ZO_BSF_36], 0.4f, 100.0f, 0.00001f); } } + if ((sZoSwork[ZO_BSS_8] == 0) && (sZoLimbTimers[ZO_LIMB_15] != LIMB_DESTROYED)) { if ((sZoFwork[ZO_BSF_87] < -570.0f) || (sZoFwork[ZO_BSF_88] > 1600.0f)) { sZoLimbTimers[ZO_LIMB_1] = sZoLimbTimers[ZO_LIMB_14] = sZoLimbTimers[ZO_LIMB_15] = LIMB_DESTROYED; @@ -2614,10 +2725,11 @@ void Zoness_Boss_Update(Boss* bossZO) { } } } + if ((sZoSwork[ZO_BSS_9] == 0) && (sZoLimbTimers[ZO_LIMB_10] != LIMB_DESTROYED)) { if ((sZoFwork[ZO_BSF_81] > 700.0f) || (sZoFwork[ZO_BSF_82] < -400.0f)) { sZoLimbTimers[ZO_LIMB_10] = LIMB_DESTROYED; - ZO_HIT_3(bossZO)->b.z.offset = 100000.0f; + ZO_HIT_3(this)->b.z.offset = 100000.0f; } else { sZoFwork[ZO_BSF_80] -= 5.0f; sZoFwork[ZO_BSF_81] += 12.0f; @@ -2631,10 +2743,11 @@ void Zoness_Boss_Update(Boss* bossZO) { } } } + if ((sZoSwork[ZO_BSS_10] == 0) && (sZoLimbTimers[ZO_LIMB_2] != LIMB_DESTROYED)) { if ((sZoFwork[ZO_BSF_84] > 700.0f) || (sZoFwork[ZO_BSF_85] < -400.0f)) { sZoLimbTimers[ZO_LIMB_2] = LIMB_DESTROYED; - ZO_HIT_4(bossZO)->b.z.offset = 100000.0f; + ZO_HIT_4(this)->b.z.offset = 100000.0f; } else { sZoFwork[ZO_BSF_83] -= 5.0f; sZoFwork[ZO_BSF_84] += 12.0f; @@ -2648,6 +2761,7 @@ void Zoness_Boss_Update(Boss* bossZO) { } } } + if ((sZoSwork[ZO_BSS_13] < 2) && (sZoLimbTimers[ZO_LIMB_5] != LIMB_DESTROYED)) { D_ctx_801779A8[0] = 20; if (((gGameFrameCount % 2) == 0)) { @@ -2655,7 +2769,7 @@ void Zoness_Boss_Update(Boss* bossZO) { sZoFwork[ZO_BSF_52_Y] + RAND_FLOAT_CENTERED(200.0f), sZoFwork[ZO_BSF_52_Z] + RAND_FLOAT_CENTERED(100.0f), 5.0f); } - if (bossZO->swork[ZO_SWK_14] != 0) { + if (this->swork[ZO_SWK_14] != 0) { if (sZoLimbTimers[ZO_LIMB_5] == 0) { sZoLimbTimers[ZO_LIMB_5] = sZoLimbTimers[ZO_LIMB_6] = 15; } @@ -2681,135 +2795,142 @@ void Zoness_Boss_Update(Boss* bossZO) { } } } - if (bossZO->dmgType != DMG_NONE) { - dmgType = bossZO->dmgType; - bossZO->dmgType = DMG_NONE; + + if (this->dmgType != DMG_NONE) { + dmgType = this->dmgType; + this->dmgType = DMG_NONE; if (dmgType == DMG_BEAM) { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, bossZO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } - switch (bossZO->dmgPart) { + + switch (this->dmgPart) { case 0: - if ((sZoSwork[ZO_BSS_8] != 0) && (dmgType == DMG_BOMB) && - ((bossZO->state == 3) || (bossZO->state == 8))) { + if ((sZoSwork[ZO_BSS_8] != 0) && (dmgType == DMG_BOMB) && ((this->state == 3) || (this->state == 8))) { sZoLimbTimers[ZO_LIMB_1] = sZoLimbTimers[ZO_LIMB_14] = sZoLimbTimers[ZO_LIMB_15] = 15; sZoSwork[ZO_BSS_49] = 60; - sZoSwork[ZO_BSS_8] -= bossZO->damage; + sZoSwork[ZO_BSS_8] -= this->damage; if (sZoSwork[ZO_BSS_8] <= 0) { sZoSwork[ZO_BSS_49] = sZoSwork[ZO_BSS_8] = 0; - bossZO->swork[ZO_SWK_5] = 30; + this->swork[ZO_SWK_5] = 30; } } break; + case 3: - if ((sZoSwork[ZO_BSS_9] != 0) && (bossZO->state == 3) && (dmgType == DMG_BOMB) && + if ((sZoSwork[ZO_BSS_9] != 0) && (this->state == 3) && (dmgType == DMG_BOMB) && (sZoSwork[ZO_BSS_50] == 0)) { sZoLimbTimers[ZO_LIMB_10] = 15; sZoSwork[ZO_BSS_50] = 50; - sZoSwork[ZO_BSS_9] -= bossZO->damage; + sZoSwork[ZO_BSS_9] -= this->damage; if (sZoSwork[ZO_BSS_9] <= 0) { sZoSwork[ZO_BSS_50] = sZoSwork[ZO_BSS_9] = 0; spD8.x = sZoFwork[ZO_BSF_29_X]; spD8.y = sZoFwork[ZO_BSF_29_Y]; spD8.z = sZoFwork[ZO_BSF_29_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_EXPLOSION_S); } } break; + case 4: - if ((sZoSwork[ZO_BSS_10] != 0) && (bossZO->state == 3) && (dmgType == DMG_BOMB) && + if ((sZoSwork[ZO_BSS_10] != 0) && (this->state == 3) && (dmgType == DMG_BOMB) && (sZoSwork[ZO_BSS_51] == 0)) { sZoLimbTimers[ZO_LIMB_2] = 15; sZoSwork[ZO_BSS_51] = 50; - sZoSwork[ZO_BSS_10] -= bossZO->damage; + sZoSwork[ZO_BSS_10] -= this->damage; if (sZoSwork[ZO_BSS_10] <= 0) { sZoSwork[ZO_BSS_51] = sZoSwork[ZO_BSS_10] = 0; spD8.x = sZoFwork[ZO_BSF_32_X]; spD8.y = sZoFwork[ZO_BSF_32_Y]; spD8.z = sZoFwork[ZO_BSF_32_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_EXPLOSION_S); } } break; + case 5: - if ((sZoSwork[ZO_BSS_9] != 0) && (bossZO->state == 3) && (dmgType == DMG_BOMB) && + if ((sZoSwork[ZO_BSS_9] != 0) && (this->state == 3) && (dmgType == DMG_BOMB) && (sZoSwork[ZO_BSS_50] == 0)) { sZoLimbTimers[ZO_LIMB_10] = 15; sZoSwork[ZO_BSS_50] = 50; - sZoSwork[ZO_BSS_9] -= bossZO->damage; + sZoSwork[ZO_BSS_9] -= this->damage; if (sZoSwork[ZO_BSS_9] <= 0) { sZoSwork[ZO_BSS_50] = sZoSwork[ZO_BSS_9] = 0; spD8.x = sZoFwork[ZO_BSF_29_X]; spD8.y = sZoFwork[ZO_BSF_29_Y]; spD8.z = sZoFwork[ZO_BSF_29_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_EXPLOSION_S); } } - if ((sZoSwork[ZO_BSS_10] != 0) && (bossZO->state == 3) && (dmgType == DMG_BOMB) && + + if ((sZoSwork[ZO_BSS_10] != 0) && (this->state == 3) && (dmgType == DMG_BOMB) && (sZoSwork[ZO_BSS_51] == 0)) { sZoLimbTimers[ZO_LIMB_2] = 15; sZoSwork[ZO_BSS_51] = 50; - sZoSwork[ZO_BSS_10] -= bossZO->damage; + sZoSwork[ZO_BSS_10] -= this->damage; if (sZoSwork[ZO_BSS_10] <= 0) { sZoSwork[ZO_BSS_51] = sZoSwork[ZO_BSS_10] = 0; spD8.x = sZoFwork[ZO_BSF_32_X]; spD8.y = sZoFwork[ZO_BSF_32_Y]; spD8.z = sZoFwork[ZO_BSF_32_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_EXPLOSION_S); } } /* fallthrough */ case 6: - if ((bossZO->health != 0) && (sZoSwork[ZO_BSS_9] == 0) && (sZoSwork[ZO_BSS_10] == 0) && + if ((this->health != 0) && (sZoSwork[ZO_BSS_9] == 0) && (sZoSwork[ZO_BSS_10] == 0) && (sZoSwork[ZO_BSS_11] == 0) && (sZoSwork[ZO_BSS_12] == 0) && (sZoSwork[ZO_BSS_13] == 0) && - (bossZO->state == 3)) { + (this->state == 3)) { sZoLimbTimers[ZO_LIMB_25] = sZoLimbTimers[ZO_LIMB_36] = 15; - bossZO->health -= bossZO->damage; - if (bossZO->health < 150) { - AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, bossZO->sfxSource, 4); + this->health -= this->damage; + if (this->health < 150) { + AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, bossZO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); } - if (bossZO->health <= 0) { + if (this->health <= 0) { gTeamLowHealthMsgTimer = -1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 40); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 40); - Audio_KillSfxBySource(bossZO->sfxSource); - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, bossZO->sfxSource, 4); - sZoSwork[ZO_BSS_8] = bossZO->health = sZoSwork[ZO_BSS_24] = 0; - bossZO->timer_050 = 100; - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, bossZO->sfxSource, 4); + Audio_KillSfxBySource(this->sfxSource); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); + sZoSwork[ZO_BSS_8] = this->health = sZoSwork[ZO_BSS_24] = 0; + this->timer_050 = 100; + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); sZoFwork[ZO_BSF_27] = 20.0f; sZoFwork[ZO_BSF_26] = 50.0f; sZoFwork[ZO_BSF_28] = -2600.0f; - bossZO->state = 6; - bossZO->fwork[ZO_FWK_4] = 1.0f; + this->state = 6; + this->fwork[ZO_FWK_4] = 1.0f; } } break; + case 7: case 12: - if ((sZoSwork[ZO_BSS_13] >= 2) && (bossZO->state == 5) && (dmgType == DMG_BOMB)) { + if ((sZoSwork[ZO_BSS_13] >= 2) && (this->state == 5) && (dmgType == DMG_BOMB)) { sZoLimbTimers[ZO_LIMB_5] = sZoLimbTimers[ZO_LIMB_6] = 15; sZoSwork[ZO_BSS_52] = 30; - sZoSwork[ZO_BSS_13] -= bossZO->damage; + sZoSwork[ZO_BSS_13] -= this->damage; if (sZoSwork[ZO_BSS_13] < 2) { - bossZO->swork[ZO_SWK_14] = 30; + this->swork[ZO_SWK_14] = 30; sZoSwork[ZO_BSS_13] = 1; Radio_PlayMessage(gMsg_ID_6090, RCID_BOSS_ZONESS); spD8.x = sZoFwork[ZO_BSF_52_X]; spD8.y = sZoFwork[ZO_BSF_52_Y]; spD8.z = sZoFwork[ZO_BSF_52_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_SINK_PARTS); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_SINK_PARTS); } } break; + case 8 + 0: case 10 + 0: - if ((sZoSwork[ZO_BSS_11] != 0) && (bossZO->state == 3) && (dmgType == DMG_BOMB) && + if ((sZoSwork[ZO_BSS_11] != 0) && (this->state == 3) && (dmgType == DMG_BOMB) && (sZoSwork[ZO_BSS_53] == 0)) { sZoLimbTimers[ZO_LIMB_7] = sZoLimbTimers[ZO_LIMB_21] = sZoLimbTimers[ZO_LIMB_22] = 15; sZoSwork[ZO_BSS_53] = 50; - sZoSwork[ZO_BSS_11] -= bossZO->damage; + sZoSwork[ZO_BSS_11] -= this->damage; if (sZoSwork[ZO_BSS_11] <= 0) { sZoSwork[ZO_BSS_11] = 0; gCameraShake = 30; @@ -2817,25 +2938,26 @@ void Zoness_Boss_Update(Boss* bossZO) { gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 25; - bossZO->swork[ZO_SWK_15] = 3; + this->swork[ZO_SWK_15] = 3; spD8.x = sZoFwork[ZO_BSF_106_X]; spD8.y = sZoFwork[ZO_BSF_106_Y]; spD8.z = sZoFwork[ZO_BSF_106_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_SINK_PARTS); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_SINK_PARTS); sZoSwork[ZO_BSS_16] = 0; - ZO_HIT_8(bossZO, 0)->z.offset = ZO_HIT_10(bossZO, 0)->z.offset = 100000.0f; - bossZO->state = 4; - bossZO->fwork[ZO_FWK_9] = 330.0f; + ZO_HIT_8(this, 0)->z.offset = ZO_HIT_10(this, 0)->z.offset = 100000.0f; + this->state = 4; + this->fwork[ZO_FWK_9] = 330.0f; } } break; + case 8 + 1: case 10 + 1: - if ((sZoSwork[ZO_BSS_12] != 0) && (bossZO->state == 3) && (dmgType == DMG_BOMB) && + if ((sZoSwork[ZO_BSS_12] != 0) && (this->state == 3) && (dmgType == DMG_BOMB) && (sZoSwork[ZO_BSS_54] == 0)) { sZoLimbTimers[ZO_LIMB_11] = sZoLimbTimers[ZO_LIMB_23] = sZoLimbTimers[ZO_LIMB_24] = 15; sZoSwork[ZO_BSS_54] = 50; - sZoSwork[ZO_BSS_12] -= bossZO->damage; + sZoSwork[ZO_BSS_12] -= this->damage; if (sZoSwork[ZO_BSS_12] <= 0) { sZoSwork[ZO_BSS_12] = 0; gCameraShake = 30; @@ -2843,20 +2965,21 @@ void Zoness_Boss_Update(Boss* bossZO) { gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 25; - bossZO->swork[ZO_SWK_15] = 3; + this->swork[ZO_SWK_15] = 3; spCC.x = sZoFwork[ZO_BSF_109_X]; spCC.y = sZoFwork[ZO_BSF_109_Y]; spCC.z = sZoFwork[ZO_BSF_109_Z]; - func_effect_8007A6F0(&spCC, NA_SE_EN_SINK_PARTS); + Effect_SpawnTimedSfxAtPos(&spCC, NA_SE_EN_SINK_PARTS); sZoSwork[ZO_BSS_16] = 0; - ZO_HIT_8(bossZO, 1)->z.offset = ZO_HIT_10(bossZO, 1)->z.offset = 100000.0f; - bossZO->state = 4; - bossZO->fwork[ZO_FWK_9] = 30.0f; + ZO_HIT_8(this, 1)->z.offset = ZO_HIT_10(this, 1)->z.offset = 100000.0f; + this->state = 4; + this->fwork[ZO_FWK_9] = 30.0f; } } break; } } + if (sZoSwork[ZO_BSS_0] != 0) { sZoSwork[ZO_BSS_0]--; } @@ -2887,32 +3010,35 @@ void Zoness_Boss_Update(Boss* bossZO) { if (sZoSwork[ZO_BSS_40] != 0) { sZoSwork[ZO_BSS_40]--; } - if (bossZO->swork[ZO_SWK_14] != 0) { - bossZO->swork[ZO_SWK_14]--; + if (this->swork[ZO_SWK_14] != 0) { + this->swork[ZO_SWK_14]--; } - if (bossZO->swork[ZO_SWK_4] != 0) { - bossZO->swork[ZO_SWK_4]--; + if (this->swork[ZO_SWK_4] != 0) { + this->swork[ZO_SWK_4]--; } - if (bossZO->swork[ZO_SWK_5] != 0) { - bossZO->swork[ZO_SWK_5]--; + if (this->swork[ZO_SWK_5] != 0) { + this->swork[ZO_SWK_5]--; } - if (bossZO->swork[ZO_SWK_15] != 0) { - bossZO->swork[ZO_SWK_15]--; + if (this->swork[ZO_SWK_15] != 0) { + this->swork[ZO_SWK_15]--; } - if (bossZO->swork[ZO_SWK_6] > 1) { - bossZO->swork[ZO_SWK_6]--; + if (this->swork[ZO_SWK_6] > 1) { + this->swork[ZO_SWK_6]--; } + for (sp124 = 0; sp124 < ZO_LIMB_MAX; sp124++) { if ((sZoLimbTimers[sp124] > 0) && (sZoLimbTimers[sp124] < 200)) { sZoLimbTimers[sp124]--; } } + for (i = ZO_BSS_49, sp124 = 0; sp124 < 6; sp124++, i++) { if (sZoSwork[i] != 0) { sZoSwork[i]--; } } - if (bossZO->state < 4) { + + if (this->state < 4) { spD8.x = sZoFwork[ZO_BSF_106_X]; spD8.y = sZoFwork[ZO_BSF_106_Y]; spD8.z = sZoFwork[ZO_BSF_106_Z]; @@ -2920,50 +3046,52 @@ void Zoness_Boss_Update(Boss* bossZO) { spCC.y = sZoFwork[ZO_BSF_109_Y]; spCC.z = sZoFwork[ZO_BSF_109_Z]; if (((sZoSwork[ZO_BSS_53] % 2) != 0) && (sZoSwork[ZO_BSS_11] != 0)) { - func_effect_8007A6F0(&spD8, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_OB_DAMAGE_M); } if (((sZoSwork[ZO_BSS_54] % 2) != 0) && (sZoSwork[ZO_BSS_12] != 0)) { - func_effect_8007A6F0(&spCC, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&spCC, NA_SE_OB_DAMAGE_M); } } + if ((sZoSwork[ZO_BSS_50] % 2) != 0) { spD8.x = sZoFwork[ZO_BSF_29_X]; spD8.y = sZoFwork[ZO_BSF_29_Y]; spD8.z = sZoFwork[ZO_BSF_29_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_DAMAGE_S); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_DAMAGE_S); } if ((sZoSwork[ZO_BSS_51] % 2) != 0) { spD8.x = sZoFwork[ZO_BSF_32_X]; spD8.y = sZoFwork[ZO_BSF_32_Y]; spD8.z = sZoFwork[ZO_BSF_32_Z]; - func_effect_8007A6F0(&spD8, NA_SE_EN_DAMAGE_S); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_EN_DAMAGE_S); } if ((sZoSwork[ZO_BSS_52] % 2) != 0) { spD8.x = sZoFwork[ZO_BSF_52_X]; spD8.y = sZoFwork[ZO_BSF_52_Y]; spD8.z = sZoFwork[ZO_BSF_52_Z]; - func_effect_8007A6F0(&spD8, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&spD8, NA_SE_OB_DAMAGE_M); } - if (Play_CheckDynaFloorCollision(&sp134, &sp130, bossZO->obj.pos.x, bossZO->obj.pos.y - 500.0f, - bossZO->obj.pos.z) != 0) { - Math_SmoothStepToF(&bossZO->obj.pos.y, sp134 - 20.0f, 0.1f, bossZO->fwork[ZO_FWK_4], 0.0f); - bossZO->fwork[ZO_FWK_1] = SIN_DEG(gGameFrameCount * 7.0f) * 12.0f; - bossZO->fwork[ZO_FWK_2] = COS_DEG(gGameFrameCount * 9.0f) * 12.0f; - bossZO->fwork[ZO_FWK_3] = SIN_DEG(gGameFrameCount * 10.0f) * 30.0f; - if ((bossZO->timer_054 == 0) && (sZoSwork[ZO_BSS_5] < 2)) { - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 50.0f, 0.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 46.0f, 19.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 35.0f, 35.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 19.0f, 46.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, 0.0f, 50.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -50.0f, 0.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -46.0f, 19.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -35.0f, 35.0f, 5.0f); - func_effect_8007AFD0(bossZO->obj.pos.x, bossZO->obj.pos.z, -19.0f, 46.0f, 5.0f); - bossZO->timer_054 = 20; + + if (Play_CheckDynaFloorCollision(&sp134, &sp130, this->obj.pos.x, this->obj.pos.y - 500.0f, this->obj.pos.z) != 0) { + Math_SmoothStepToF(&this->obj.pos.y, sp134 - 20.0f, 0.1f, this->fwork[ZO_FWK_4], 0.0f); + this->fwork[ZO_FWK_1] = SIN_DEG(gGameFrameCount * 7.0f) * 12.0f; + this->fwork[ZO_FWK_2] = COS_DEG(gGameFrameCount * 9.0f) * 12.0f; + this->fwork[ZO_FWK_3] = SIN_DEG(gGameFrameCount * 10.0f) * 30.0f; + if ((this->timer_054 == 0) && (sZoSwork[ZO_BSS_5] < 2)) { + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 50.0f, 0.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 46.0f, 19.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 35.0f, 35.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 19.0f, 46.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, 0.0f, 50.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -50.0f, 0.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -46.0f, 19.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -35.0f, 35.0f, 5.0f); + func_effect_8007AFD0(this->obj.pos.x, this->obj.pos.z, -19.0f, 46.0f, 5.0f); + this->timer_054 = 20; sZoSwork[ZO_BSS_5]++; } } + if (gBossFrameCount == 530) { Radio_PlayMessage(gMsg_ID_2225, RCID_SLIPPY); } @@ -2971,18 +3099,21 @@ void Zoness_Boss_Update(Boss* bossZO) { gShowBossHealth = true; } if (gBossFrameCount > 686) { - gBossHealthBar = bossZO->health / 300.0f * 64.0f; + gBossHealthBar = this->health / 300.0f * 64.0f; gBossHealthBar += (s32) ((sZoSwork[ZO_BSS_11] / 20.0f) * 64.0f); gBossHealthBar += (s32) ((sZoSwork[ZO_BSS_12] / 20.0f) * 64.0f); gBossHealthBar += (s32) ((sZoSwork[ZO_BSS_9] / (20.0f * 2)) * 16.0f); gBossHealthBar += (s32) ((sZoSwork[ZO_BSS_10] / (20.0f * 2)) * 16.0f); gBossHealthBar += (s32) ((sZoSwork[ZO_BSS_13] / 61.0f) * 31.0f); } - ZO_HIT_0(bossZO)->z.offset = sZoFwork[ZO_BSF_43_Z] - bossZO->obj.pos.z; - ZO_HIT_0(bossZO)->x.offset = sZoFwork[ZO_BSF_43_X] - bossZO->obj.pos.x; - ZO_HIT_1(bossZO)->z.offset = sZoFwork[ZO_BSF_43_Z] - bossZO->obj.pos.z; - ZO_HIT_1(bossZO)->x.offset = sZoFwork[ZO_BSF_43_X] - bossZO->obj.pos.x; - Animation_GetFrameData(&D_ZO_601996C, 0, bossZO->vwork); + + ZO_HIT_0(this)->z.offset = sZoFwork[ZO_BSF_43_Z] - this->obj.pos.z; + ZO_HIT_0(this)->x.offset = sZoFwork[ZO_BSF_43_X] - this->obj.pos.x; + ZO_HIT_1(this)->z.offset = sZoFwork[ZO_BSF_43_Z] - this->obj.pos.z; + ZO_HIT_1(this)->x.offset = sZoFwork[ZO_BSF_43_X] - this->obj.pos.x; + + Animation_GetFrameData(&D_ZO_601996C, 0, this->vwork); + if (sZoSwork[ZO_BSS_38] != 0) { sZoSwork[ZO_BSS_37] -= 10; if (sZoSwork[ZO_BSS_37] < 0) { @@ -3000,84 +3131,92 @@ void Zoness_Boss_Update(Boss* bossZO) { } } -void Zoness_801986FC(Boss* bossZO, s32 arg1, f32 xOff, f32 yOff, f32 zOff, f32 yRot) { - Actor* newActor; - Vec3f sp60 = { 0.0f, 0.0f, 50.0f }; - Vec3f sp54; - s32 sp50; +void Zoness_801986FC(BossZO* this, s32 arg1, f32 xOff, f32 yOff, f32 zOff, f32 yRot) { + Actor245* actor245; + Vec3f src = { 0.0f, 0.0f, 50.0f }; + Vec3f dest; + s32 i; if ((sZoSwork[ZO_BSS_0 + arg1] == 0) && (sZoSwork[ZO_BSS_11 + arg1] != 0)) { sZoSwork[ZO_BSS_0 + arg1] = 70; - sp50 = arg1; + i = arg1; if (arg1 != 0) { - sp50 = -1; + i = -1; } - if (sZoSwork[ZO_BSS_12 + sp50] == 0) { + + if (sZoSwork[ZO_BSS_12 + i] == 0) { sZoSwork[ZO_BSS_0 + arg1] = 40; } - for (sp50 = 0, newActor = gActors; sp50 < ARRAY_COUNT(gActors); sp50++, newActor++) { - if (newActor->obj.status == OBJ_FREE) { - D_ctx_801779A8[0] = 20.0f; - Actor_Initialize(newActor); - newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_245; - newActor->obj.pos.x = bossZO->obj.pos.x + xOff; - newActor->obj.pos.y = bossZO->obj.pos.y + yOff; - newActor->obj.pos.z = bossZO->obj.pos.z + zOff; - newActor->health = 10; - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); + for (i = 0, actor245 = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor245++) { + if (actor245->obj.status == OBJ_FREE) { + D_ctx_801779A8[0] = 20.0f; + Actor_Initialize(actor245); + actor245->obj.status = OBJ_INIT; + actor245->obj.id = OBJ_ACTOR_245; + + actor245->obj.pos.x = this->obj.pos.x + xOff; + actor245->obj.pos.y = this->obj.pos.y + yOff; + actor245->obj.pos.z = this->obj.pos.z + zOff; + + actor245->health = 10; + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateY(gCalcMatrix, sZoFwork[ZO_BSF_15 + arg1] * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, M_DTOR * yRot, MTXF_APPLY); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp60, &sp54); - newActor->vel.x = sp54.x; - newActor->vel.y = sp54.y; - newActor->vel.z = bossZO->vel.z + sp54.z; - Object_SetInfo(&newActor->info, newActor->obj.id); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + actor245->vel.x = dest.x; + actor245->vel.y = dest.y; + actor245->vel.z = this->vel.z + dest.z; + Object_SetInfo(&actor245->info, actor245->obj.id); sZoFwork[ZO_BSF_35 + arg1] = 40.0f; - AUDIO_PLAY_SFX(NA_SE_EN_S_BALL_SHOT, bossZO->sfxSource, 4); - for (sp50 = 0; sp50 < 4; sp50++) { - Zoness_80193C5C(newActor->obj.pos.x + (sp54.x * 4.3f), newActor->obj.pos.y + (sp54.y * 4.3f), - newActor->obj.pos.z + (sp54.z * 4.3f) + 100.0f, 30.0f); + + AUDIO_PLAY_SFX(NA_SE_EN_S_BALL_SHOT, this->sfxSource, 4); + + for (i = 0; i < 4; i++) { + Zoness_80193C5C(actor245->obj.pos.x + (dest.x * 4.3f), actor245->obj.pos.y + (dest.y * 4.3f), + actor245->obj.pos.z + (dest.z * 4.3f) + 100.0f, 30.0f); } break; } } } - if (sp50 >= ARRAY_COUNT(gActors)) { - newActor->obj.status = OBJ_FREE; + + if (i >= ARRAY_COUNT(gActors)) { + actor245->obj.status = OBJ_FREE; } } -void Zoness_801989FC(Boss* bossZO) { +void Zoness_801989FC(BossZO* this) { s32 i; Vec3f sp70 = { 0.0f, 0.0f, 20.0f }; Vec3f sp64; - Actor* newActor; + Actor246* actor246; s32 j; for (i = 0; i < 2; i++) { if (sZoSwork[ZO_BSS_11 + i] != 0) { - for (j = 0, newActor = gActors; j < ARRAY_COUNT(gActors); j++, newActor++) { - if (newActor->obj.status == OBJ_FREE) { - Actor_Initialize(newActor); - newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_246; - newActor->obj.pos.x = sZoFwork[ZO_BSF_37_X + 3 * i]; - newActor->obj.pos.y = sZoFwork[ZO_BSF_37_Y + 3 * i]; - newActor->obj.pos.z = sZoFwork[ZO_BSF_37_Z + 3 * i]; - newActor->obj.rot.y = bossZO->obj.rot.y; - newActor->timer_0BC = 300; - newActor->health = 10; + for (j = 0, actor246 = gActors; j < ARRAY_COUNT(gActors); j++, actor246++) { + if (actor246->obj.status == OBJ_FREE) { + Actor_Initialize(actor246); + actor246->obj.status = OBJ_INIT; + actor246->obj.id = OBJ_ACTOR_246; - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); + actor246->obj.pos.x = sZoFwork[ZO_BSF_37_X + 3 * i]; + actor246->obj.pos.y = sZoFwork[ZO_BSF_37_Y + 3 * i]; + actor246->obj.pos.z = sZoFwork[ZO_BSF_37_Z + 3 * i]; + + actor246->obj.rot.y = this->obj.rot.y; + actor246->timer_0BC = 300; + actor246->health = 10; + + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp70, &sp64); - newActor->vel.x = sp64.x; - newActor->vel.z = bossZO->vel.z + sp64.z; - Object_SetInfo(&newActor->info, newActor->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_MISSILE_SHOT, bossZO->sfxSource, 4); + actor246->vel.x = sp64.x; + actor246->vel.z = this->vel.z + sp64.z; + Object_SetInfo(&actor246->info, actor246->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_MISSILE_SHOT, this->sfxSource, 4); break; } } @@ -3085,15 +3224,15 @@ void Zoness_801989FC(Boss* bossZO) { } } -void Zoness_80198BE8(Boss* bossZO, s32 arg1) { +void Zoness_80198BE8(BossZO* this, s32 arg1) { s32 var_s1; - Effect* effect; - Vec3f sp3C = { 0.0f, 0.0f, 100.0f }; - Vec3f sp30; + Effect398* effect398; + Vec3f src = { 0.0f, 0.0f, 100.0f }; + Vec3f dest; if ((sZoSwork[ZO_BSS_2 + arg1] == 0) && (sZoSwork[ZO_BSS_39 + arg1] == 0)) { if ((arg1 == 0) && (sZoSwork[ZO_BSS_41] == 0)) { - AUDIO_PLAY_SFX(NA_SE_EN_ZOBOSS_BEAM, bossZO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ZOBOSS_BEAM, this->sfxSource, 4); } sZoSwork[ZO_BSS_2 + arg1] = 2; sZoSwork[ZO_BSS_41 + arg1]++; @@ -3101,67 +3240,68 @@ void Zoness_80198BE8(Boss* bossZO, s32 arg1) { sZoSwork[ZO_BSS_41 + arg1] = 0; sZoSwork[ZO_BSS_39 + arg1] = 30; if (arg1 == 1) { - Audio_KillSfxBySourceAndId(bossZO->sfxSource, NA_SE_EN_ZOBOSS_BEAM); + Audio_KillSfxBySourceAndId(this->sfxSource, NA_SE_EN_ZOBOSS_BEAM); } } - for (var_s1 = 0, effect = gEffects; var_s1 < 100; var_s1++, effect++) { - if (effect->obj.status == OBJ_FREE) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_398; - effect->timer_50 = 100; - effect->state = 1; - effect->scale2 = 1.0f; - effect->obj.rot.z = 30.0f; - effect->obj.pos.x = sZoFwork[ZO_BSF_93_X + 3 * arg1]; - effect->obj.pos.y = sZoFwork[ZO_BSF_93_Y + 3 * arg1]; - effect->obj.pos.z = sZoFwork[ZO_BSF_93_Z + 3 * arg1]; + + for (var_s1 = 0, effect398 = &gEffects[0]; var_s1 < 100; var_s1++, effect398++) { + if (effect398->obj.status == OBJ_FREE) { + Effect_Initialize(effect398); + effect398->obj.status = OBJ_INIT; + effect398->obj.id = OBJ_EFFECT_398; + effect398->timer_50 = 100; + effect398->state = 1; + effect398->scale2 = 1.0f; + effect398->obj.rot.z = 30.0f; + effect398->obj.pos.x = sZoFwork[ZO_BSF_93_X + 3 * arg1]; + effect398->obj.pos.y = sZoFwork[ZO_BSF_93_Y + 3 * arg1]; + effect398->obj.pos.z = sZoFwork[ZO_BSF_93_Z + 3 * arg1]; Matrix_RotateY(gCalcMatrix, sZoFwork[ZO_BSF_8 + 2 * arg1] * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, sZoFwork[ZO_BSF_7 + 2 * arg1] * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, bossZO->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30); - effect->vel.x = sp30.x; - effect->vel.y = sp30.y; - effect->vel.z = sp30.z - gPathVelZ; - Object_SetInfo(&effect->info, effect->obj.id); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + effect398->vel.x = dest.x; + effect398->vel.y = dest.y; + effect398->vel.z = dest.z - gPathVelZ; + Object_SetInfo(&effect398->info, effect398->obj.id); break; } } if (var_s1 >= ARRAY_COUNT(gActors)) { - effect->obj.status = OBJ_FREE; + effect398->obj.status = OBJ_FREE; } } } -void Zoness_80198ECC(Boss* bossZO) { +void Zoness_80198ECC(BossZO* this) { sZoSwork[ZO_BSS_18] = 500; - bossZO->timer_050 = 100; - bossZO->timer_054 = 0; + this->timer_050 = 100; + this->timer_054 = 0; sZoSwork[ZO_BSS_5] = 0; sZoFwork[ZO_BSF_25] = -1200.0f; sZoFwork[ZO_BSF_23] = 15.0f; sZoFwork[ZO_BSF_28] = -3500.0f; sZoFwork[ZO_BSF_77] = 0.0f; - bossZO->state = 8; - bossZO->fwork[ZO_FWK_4] = 1.0f; + this->state = 8; + this->fwork[ZO_FWK_4] = 1.0f; } -void Zoness_80198F3C(Boss* bossZO, s32 arg1, s32 arg2) { - if ((((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f))) { +void Zoness_80198F3C(BossZO* this, s32 arg1, s32 arg2) { + if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { sZoLimbTimers[ZO_LIMB_7 + 4 * arg1] = sZoLimbTimers[ZO_LIMB_21 + 2 * arg1] = sZoLimbTimers[ZO_LIMB_22 + 2 * arg1] = 15; } func_effect_8007D0E0(sZoFwork[ZO_BSF_0 + arg2] + RAND_FLOAT_CENTERED(400.0f), sZoFwork[ZO_BSF_1 + arg2] + RAND_RANGE(-160.0f, 640.0f), sZoFwork[ZO_BSF_2 + arg2], 7.0f); - if (((gGameFrameCount % 2) == 0)) { + if ((gGameFrameCount % 2) == 0) { func_effect_8007C120(sZoFwork[ZO_BSF_0 + arg2], sZoFwork[ZO_BSF_1 + arg2], sZoFwork[ZO_BSF_2 + arg2], - bossZO->vel.x, bossZO->vel.y, bossZO->vel.z, 0.2f, 10); + this->vel.x, this->vel.y, this->vel.z, 0.2f, 10); } } -void Zoness_8019907C(Boss* bossZO) { +void Zoness_8019907C(BossZO* this) { if ((sZoSwork[ZO_BSS_9] == 0) && (sZoSwork[ZO_BSS_10] == 0)) { if ((sZoSwork[ZO_BSS_31] == 0) && (sZoSwork[ZO_BSS_30] != 0)) { Radio_PlayMessage(gMsg_ID_6082, RCID_PEPPY); @@ -3173,34 +3313,33 @@ void Zoness_8019907C(Boss* bossZO) { sZoSwork[ZO_BSS_30]++; } sZoFwork[ZO_BSF_77] = 0.0f; - bossZO->state = 5; - + this->state = 5; } else { - Zoness_80198ECC(bossZO); + Zoness_80198ECC(this); } } -void Zoness_8019914C(Boss* bossZO, s32 arg1) { +void Zoness_8019914C(BossZO* this, s32 arg1) { sZoLimbTimers[ZO_LIMB_7 + 4 * arg1] = sZoLimbTimers[ZO_LIMB_21 + arg1 * 2] = sZoLimbTimers[ZO_LIMB_22 + arg1 * 2] = LIMB_DESTROYED; sZoFwork[ZO_BSF_77] = 0.0f; sZoSwork[ZO_BSS_36] = sZoSwork[ZO_BSS_16] = 0; - bossZO->swork[ZO_SWK_4] = 1000; - bossZO->state = 3; + this->swork[ZO_SWK_4] = 1000; + this->state = 3; if ((sZoSwork[ZO_BSS_11] == 0) && (sZoSwork[ZO_BSS_12] == 0)) { - bossZO->fwork[ZO_FWK_6] = bossZO->obj.pos.x; + this->fwork[ZO_FWK_6] = this->obj.pos.x; sZoSwork[ZO_BSS_20] = sZoSwork[ZO_BSS_24] = 1; } } f32 D_i3_801BF73C[2] = { -80.0f, 80.0f }; -void Zoness_801991D0(Boss* bossZO, s32 arg1) { +void Zoness_801991D0(Boss* this, s32 arg1) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_4], D_i3_801BF73C[arg1], 1.0f, 5.0f, 0.001f); if (sZoFwork[ZO_BSF_4] == D_i3_801BF73C[arg1]) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_3], -30.0f, 1.0f, 3.0f, 0.001f); if (sZoFwork[ZO_BSF_3] == -30.0f) { - bossZO->timer_052 = 60; + this->timer_052 = 60; sZoSwork[ZO_BSS_36] = 0; sZoSwork[ZO_BSS_16] = arg1 + 1; sZoFwork[ZO_BSF_77] = 0.0f; @@ -3208,37 +3347,37 @@ void Zoness_801991D0(Boss* bossZO, s32 arg1) { } if (arg1 == 0) { // all divisible by 13 - ZO_HIT_12(bossZO)->z.offset = -556.39996f; - ZO_HIT_12(bossZO)->z.size = 130.0f; - ZO_HIT_12(bossZO)->y.offset = 663.0f; - ZO_HIT_12(bossZO)->y.size = 171.59999f; - ZO_HIT_12(bossZO)->x.offset = 395.19998f; - ZO_HIT_12(bossZO)->x.size = 241.79999f; + ZO_HIT_12(this)->z.offset = -556.39996f; + ZO_HIT_12(this)->z.size = 130.0f; + ZO_HIT_12(this)->y.offset = 663.0f; + ZO_HIT_12(this)->y.size = 171.59999f; + ZO_HIT_12(this)->x.offset = 395.19998f; + ZO_HIT_12(this)->x.size = 241.79999f; } else { - ZO_HIT_12(bossZO)->z.offset = -556.39996f; - ZO_HIT_12(bossZO)->z.size = 130.0f; - ZO_HIT_12(bossZO)->y.offset = 663.0f; - ZO_HIT_12(bossZO)->y.size = 171.59999f; - ZO_HIT_12(bossZO)->x.offset = -395.19998f; - ZO_HIT_12(bossZO)->x.size = 241.79999f; + ZO_HIT_12(this)->z.offset = -556.39996f; + ZO_HIT_12(this)->z.size = 130.0f; + ZO_HIT_12(this)->y.offset = 663.0f; + ZO_HIT_12(this)->y.size = 171.59999f; + ZO_HIT_12(this)->x.offset = -395.19998f; + ZO_HIT_12(this)->x.size = 241.79999f; } } #define ZO_HIT_8_2(bossZO, index) ((Hitbox*) (ZO_HIT_7(bossZO) + 1) + (index)) #define ZO_HIT_10_2(bossZO, index) ((Hitbox*) (ZO_HIT_8(bossZO, 0) + 2) + (index)) -void Zoness_80199394(Boss* bossZO, s32 arg1) { +void Zoness_80199394(BossZO* this, s32 arg1) { sZoSwork[ZO_BSS_11 + arg1] = 20; - ZO_HIT_8(bossZO, arg1)->z.offset = -213.2f; - ZO_HIT_10(bossZO, arg1)->z.offset = -351.0f; - bossZO->timer_050 = 20; + ZO_HIT_8(this, arg1)->z.offset = -213.2f; + ZO_HIT_10(this, arg1)->z.offset = -351.0f; + this->timer_050 = 20; sZoFwork[ZO_BSF_17 + arg1] = sZoFwork[ZO_BSF_77] = 0.0f; sZoSwork[ZO_BSS_16] = 3; - AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, bossZO->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, this->sfxSource, 4); } -void Zoness_80199470(Boss* bossZO, s32 arg1) { +void Zoness_80199470(BossZO* this, s32 arg1) { if (sZoSwork[ZO_BSS_13] == 0) { if (sZoFwork[ZO_BSF_17 + arg1] > -400.0f) { sZoFwork[ZO_BSF_17 + arg1] -= 4.0f; @@ -3247,59 +3386,59 @@ void Zoness_80199470(Boss* bossZO, s32 arg1) { sZoSwork[ZO_BSS_36]++; sZoFwork[ZO_BSF_77] = 0.0f; } - Zoness_8019962C(bossZO, 0.0f); - if (bossZO->obj.rot.y == 0.0f) { + Zoness_8019962C(this, 0.0f); + if (this->obj.rot.y == 0.0f) { sZoSwork[ZO_BSS_36] = sZoSwork[ZO_BSS_16] = 0; sZoFwork[ZO_BSF_77] = 0; - bossZO->swork[ZO_SWK_4] = 1000; - bossZO->state = 3; + this->swork[ZO_SWK_4] = 1000; + this->state = 3; if ((sZoSwork[ZO_BSS_11] == 0) && (sZoSwork[ZO_BSS_12] == 0)) { sZoSwork[ZO_BSS_20] = sZoSwork[ZO_BSS_24] = 1; } - Zoness_8019914C(bossZO, arg1); + Zoness_8019914C(this, arg1); } } - } else if ((sZoSwork[ZO_BSS_13] != 1) && (bossZO->timer_052 == 0)) { + } else if ((sZoSwork[ZO_BSS_13] != 1) && (this->timer_052 == 0)) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_17 + arg1], 0.0f, 1.0f, 5.0f, 0.001f); Math_SmoothStepToF(&sZoFwork[ZO_BSF_3], -30.0f, 1.0f, 3.0f, 0.001f); if (sZoFwork[ZO_BSF_17 + arg1] == 0.0f) { - Zoness_80199394(bossZO, arg1); + Zoness_80199394(this, arg1); } } } -void Zoness_8019962C(Boss* bossZO, f32 arg1) { +void Zoness_8019962C(BossZO* this, f32 arg1) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_77], 2.0f, 0.1f, 0.5f, 0.0001f); - Math_SmoothStepToAngle(&bossZO->obj.rot.y, arg1, 1.0f, sZoFwork[ZO_BSF_77], 0.0001f); + Math_SmoothStepToAngle(&this->obj.rot.y, arg1, 1.0f, sZoFwork[ZO_BSF_77], 0.0001f); } -void Zoness_8019969C(Actor* actor) { +void Zoness_Actor245_Update(Actor245* this) { s32 i; - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->health -= actor->damage; - if (actor->health <= 0) { - actor->health = 0; + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->health -= this->damage; + if (this->health <= 0) { + this->health = 0; for (i = 0; i < 5; i++) { - func_effect_80079618(RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.x, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.z, 1.0f); + func_effect_80079618(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 1.0f); } - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 5.0f); - actor->itemDrop = DROP_BOMB; - actor->dmgSource = DMG_SRC_2; - actor->obj.pos.z -= 100.0f; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 200.0f, 5.0f); + this->itemDrop = DROP_BOMB; + this->dmgSource = DMG_SRC_2; + this->obj.pos.z -= 100.0f; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_S); } - actor->dmgType = DMG_NONE; + this->dmgType = DMG_NONE; } - actor->fwork[0] += 10.0f; - Zoness_8018FF50(actor); + this->fwork[0] += 10.0f; + Zoness_8018FF50(this); } -void Zoness_8019983C(Actor* actor) { +void Zoness_Actor245_Draw(Actor245* this) { RCP_SetupDL(&gMasterDisp, SETUPDL_70); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); @@ -3307,20 +3446,21 @@ void Zoness_8019983C(Actor* actor) { gSPDisplayList(gMasterDisp++, D_ZO_6017950); } -void Zoness_801998E0(Effect* effect, f32 xPos, f32 yPos, f32 zPos) { - Effect_Initialize(effect); - effect->obj.status = OBJ_INIT; - effect->obj.id = OBJ_EFFECT_374; - effect->state = 1; - effect->timer_50 = 30; - effect->unk_44 = 192; - effect->obj.pos.y = yPos; - effect->obj.pos.z = zPos; - effect->obj.pos.x = xPos; - effect->scale1 = effect->scale2 = 2.5f; +void Zoness_801998E0(Effect374* this, f32 xPos, f32 yPos, f32 zPos) { + Effect_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_EFFECT_374; + + this->state = 1; + this->timer_50 = 30; + this->unk_44 = 192; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->obj.pos.x = xPos; + this->scale1 = this->scale2 = 2.5f; func_effect_8007D0E0(xPos, yPos + 30.0f, zPos, 7.0f); - func_effect_8007BFFC(effect->obj.pos.x, effect->obj.pos.y + 30.0f, effect->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); - Object_SetInfo(&effect->info, effect->obj.id); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 30.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 4.0f, 5); + Object_SetInfo(&this->info, this->obj.id); } void Zoness_801999CC(f32 xPos, f32 yPos, f32 zPos) { @@ -3334,165 +3474,174 @@ void Zoness_801999CC(f32 xPos, f32 yPos, f32 zPos) { } } -void Zoness_80199A28(Actor* actor) { +void Zoness_Actor246_Update(Actor246* this) { f32 sp3C; f32 sp38; s32 sp34; - actor->obj.rot.x += 5.0f; - switch (actor->state) { /* irregular */ + this->obj.rot.x += 5.0f; + + switch (this->state) { case 0: - if (actor->health == 0) { - actor->iwork[0]++; - actor->health = 10; - actor->iwork[1] = 1; - actor->state = 2; - actor->fwork[0] = -50.0f; + if (this->health == 0) { + this->iwork[0]++; + this->health = 10; + this->iwork[1] = 1; + this->state = 2; + this->fwork[0] = -50.0f; } else { - actor->vel.y = 60.0f; - actor->gravity = 1.0f; + this->vel.y = 60.0f; + this->gravity = 1.0f; if (gBosses[0].obj.pos.y < 0.0f) { - actor->obj.pos.y = -100.0f; + this->obj.pos.y = -100.0f; } - actor->state++; + this->state++; } break; + case 1: - if ((Play_CheckDynaFloorCollision(&sp3C, &sp34, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z) != - 0) && - (actor->iwork[1] == 0)) { - func_effect_8008377C(actor->obj.pos.x, sp3C, actor->obj.pos.z, 0.0f, 0.5f); - actor->iwork[1]++; - AUDIO_PLAY_SFX(NA_SE_ON_SPLASH_S, actor->sfxSource, 4); + if ((Play_CheckDynaFloorCollision(&sp3C, &sp34, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z) != 0) && + (this->iwork[1] == 0)) { + func_effect_8008377C(this->obj.pos.x, sp3C, this->obj.pos.z, 0.0f, 0.5f); + this->iwork[1]++; + AUDIO_PLAY_SFX(NA_SE_ON_SPLASH_S, this->sfxSource, 4); } - Math_SmoothStepToF(&actor->vel.y, -60.0f, 0.5f, 5.0f, 0.00001f); - if (actor->obj.pos.y < -30.0f) { - actor->state++; - actor->vel.y = 0.0f; - actor->gravity = 0.0f; - actor->fwork[0] = 0.0f; + + Math_SmoothStepToF(&this->vel.y, -60.0f, 0.5f, 5.0f, 0.00001f); + + if (this->obj.pos.y < -30.0f) { + this->state++; + this->vel.y = 0.0f; + this->gravity = 0.0f; + this->fwork[0] = 0.0f; } break; + case 2: - actor->gravity = 1.0f; - if (Play_CheckDynaFloorCollision(&sp3C, &sp34, actor->obj.pos.x, actor->fwork[0] + actor->obj.pos.y, - actor->obj.pos.z) != 0) { - actor->gravity = 0.0f; - Math_SmoothStepToF(&actor->fwork[0], -50.0f, 0.1f, 2.0f, 0.001f); + this->gravity = 1.0f; + if (Play_CheckDynaFloorCollision(&sp3C, &sp34, this->obj.pos.x, this->fwork[0] + this->obj.pos.y, + this->obj.pos.z) != 0) { + this->gravity = 0.0f; + Math_SmoothStepToF(&this->fwork[0], -50.0f, 0.1f, 2.0f, 0.001f); sp38 = 10.0f; - if (Math_SmoothStepToF(&actor->obj.pos.y, sp3C, 0.1f, 5.0f, 0) >= 0.0f) { + if (Math_SmoothStepToF(&this->obj.pos.y, sp3C, 0.1f, 5.0f, 0) >= 0.0f) { sp38 = 350.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, sp38, 0.1f, 1.0f, 0); + Math_SmoothStepToAngle(&this->obj.rot.z, sp38, 0.1f, 1.0f, 0); } - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - actor->itemDrop = DROP_SILVER_RING_50p; - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); - actor->dmgSource = DMG_SRC_2; - actor->obj.pos.y += 200.0f; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_EXPLOSION_S); + + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + this->itemDrop = DROP_SILVER_RING_50p; + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y + 100.0f, this->obj.pos.z, 7.0f); + this->dmgSource = DMG_SRC_2; + this->obj.pos.y += 200.0f; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_EXPLOSION_S); } else { - if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 800.0f) || (actor->dmgType != DMG_NONE)) { - Zoness_801999CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + if ((fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 800.0f) || (this->dmgType != DMG_NONE)) { + Zoness_801999CC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_EXPLOSION_M); } } break; } - if ((actor->timer_0BC == 0) && (actor->iwork[0] == 0)) { - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 100.0f, actor->obj.pos.z, 7.0f); - actor->itemDrop = DROP_SILVER_RING_50p; - actor->dmgSource = DMG_SRC_2; - actor->obj.pos.y += 200.0f; - Actor_Despawn(actor); - Object_Kill(&actor->obj, actor->sfxSource); + + if ((this->timer_0BC == 0) && (this->iwork[0] == 0)) { + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y + 100.0f, this->obj.pos.z, 7.0f); + this->itemDrop = DROP_SILVER_RING_50p; + this->dmgSource = DMG_SRC_2; + this->obj.pos.y += 200.0f; + Actor_Despawn(this); + Object_Kill(&this->obj, this->sfxSource); } } -void Zoness_80199E24(Actor* actor) { +void Zoness_Actor246_Draw(Actor246* this) { Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6025E60); } -void Zoness_80199E9C(Actor* actor, f32 arg1, f32 arg2) { - actor->obj.pos.x = sZoFwork[ZO_BSF_60_X]; - Math_SmoothStepToF(&actor->fwork[0], arg1, 1.0f, arg2, 0.001f); - actor->obj.pos.y = sZoFwork[ZO_BSF_60_Y] + actor[0].fwork[0]; - actor->obj.pos.z = sZoFwork[ZO_BSF_60_Z]; +void Zoness_80199E9C(Actor248* this, f32 arg1, f32 arg2) { + this->obj.pos.x = sZoFwork[ZO_BSF_60_X]; + Math_SmoothStepToF(&this->fwork[0], arg1, 1.0f, arg2, 0.001f); + this->obj.pos.y = sZoFwork[ZO_BSF_60_Y] + this[0].fwork[0]; + this->obj.pos.z = sZoFwork[ZO_BSF_60_Z]; } -void Zoness_80199F10(Actor* actor) { +void Zoness_Actor248_Update(Actor248* this) { if (sZoSwork[ZO_BSS_13] == 0) { - actor->state = 3; - actor->vel.y = -50.0f; - actor->obj.pos.x = sZoFwork[ZO_BSF_60_X]; - Math_SmoothStepToF(&actor->fwork[0], -500.0f, 1.0f, 100.0f, 0.00001f); - actor->obj.pos.z = sZoFwork[ZO_BSF_60_Z]; - if (actor->obj.pos.y < -400.0f) { - Object_Kill(&actor->obj, actor->sfxSource); + this->state = 3; + this->vel.y = -50.0f; + this->obj.pos.x = sZoFwork[ZO_BSF_60_X]; + Math_SmoothStepToF(&this->fwork[0], -500.0f, 1.0f, 100.0f, 0.00001f); + this->obj.pos.z = sZoFwork[ZO_BSF_60_Z]; + if (this->obj.pos.y < -400.0f) { + Object_Kill(&this->obj, this->sfxSource); } } - switch (actor->state) { /* irregular */ + + switch (this->state) { case 0: - actor->obj.rot.y += 2.0f; - Zoness_80199E9C(actor, 0.0f, 20.0f); - switch (sZoSwork[ZO_BSS_16]) { /* switch 1; irregular */ + this->obj.rot.y += 2.0f; + Zoness_80199E9C(this, 0.0f, 20.0f); + switch (sZoSwork[ZO_BSS_16]) { case 1: - actor->fwork[1] = sZoFwork[ZO_BSF_68_Y] - sZoFwork[ZO_BSF_60_Y]; - AUDIO_PLAY_SFX(NA_SE_EN_PULL_CHAIN1, actor->sfxSource, 4); - actor->state++; + this->fwork[1] = sZoFwork[ZO_BSF_68_Y] - sZoFwork[ZO_BSF_60_Y]; + AUDIO_PLAY_SFX(NA_SE_EN_PULL_CHAIN1, this->sfxSource, 4); + this->state++; break; case 2: - actor->fwork[1] = sZoFwork[ZO_BSF_71_Y] - sZoFwork[ZO_BSF_60_Y]; - AUDIO_PLAY_SFX(NA_SE_EN_PULL_CHAIN1, actor->sfxSource, 4); - actor->state++; + this->fwork[1] = sZoFwork[ZO_BSF_71_Y] - sZoFwork[ZO_BSF_60_Y]; + AUDIO_PLAY_SFX(NA_SE_EN_PULL_CHAIN1, this->sfxSource, 4); + this->state++; break; } break; + case 1: if (gBosses[0].timer_052 != 0) { - actor->obj.rot.y += 2.0f; - Zoness_80199E9C(actor, actor->fwork[1], 20.0f); + this->obj.rot.y += 2.0f; + Zoness_80199E9C(this, this->fwork[1], 20.0f); } else { switch (sZoSwork[ZO_BSS_16]) { case 1: - actor->fwork[1] = sZoFwork[ZO_BSF_68_Y] - sZoFwork[ZO_BSF_60_Y]; - Zoness_80199E9C(actor, actor->fwork[1], 20.0f); + this->fwork[1] = sZoFwork[ZO_BSF_68_Y] - sZoFwork[ZO_BSF_60_Y]; + Zoness_80199E9C(this, this->fwork[1], 20.0f); break; case 2: - actor->fwork[1] = sZoFwork[ZO_BSF_71_Y] - sZoFwork[ZO_BSF_60_Y]; - Zoness_80199E9C(actor, actor->fwork[1], 20.0f); + this->fwork[1] = sZoFwork[ZO_BSF_71_Y] - sZoFwork[ZO_BSF_60_Y]; + Zoness_80199E9C(this, this->fwork[1], 20.0f); break; case 3: - actor->obj.rot.y += 2.0f; + this->obj.rot.y += 2.0f; if (gBosses[0].timer_050 != 0) { - Zoness_80199E9C(actor, 0.0f, 10.0f); + Zoness_80199E9C(this, 0.0f, 10.0f); } else { - actor->state = 0; - Audio_KillSfxBySource(actor->sfxSource); + this->state = 0; + Audio_KillSfxBySource(this->sfxSource); } break; } } break; } - if (actor->dmgType != DMG_NONE) { - if (actor->dmgType == DMG_BEAM) { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 4); + + if (this->dmgType != DMG_NONE) { + if (this->dmgType == DMG_BEAM) { + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } - actor->dmgType = DMG_NONE; + this->dmgType = DMG_NONE; } } -void Zoness_8019A1FC(Actor* actor) { +void Zoness_Actor248_Draw(Actor248* this) { f32 var_fv0; - s32 var_s0; - s32 var_s1; + s32 i; + s32 j; Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3500,21 +3649,25 @@ void Zoness_8019A1FC(Actor* actor) { gSPDisplayList(gMasterDisp++, D_ZO_601C590); RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - if (((actor->state == 1) && (gBosses[0].timer_052 != 0)) || (actor->state == 0)) { + + if (((this->state == 1) && (gBosses[0].timer_052 != 0)) || (this->state == 0)) { Matrix_RotateY(gGfxMatrix, gGameFrameCount * M_DTOR, MTXF_APPLY); } - var_fv0 = sZoFwork[ZO_BSF_60_Y] + -1.0f * actor->fwork[0] - actor->obj.pos.y; - for (var_s1 = 1; var_fv0 >= 0.0f; var_s1++) { + var_fv0 = sZoFwork[ZO_BSF_60_Y] + -1.0f * this->fwork[0] - this->obj.pos.y; + + for (i = 1; var_fv0 >= 0.0f; i++) { var_fv0 -= 117.0f; } - if (var_s1 > 30) { - var_s1 = 30; + + if (i > 30) { + i = 30; } - if ((var_s1 <= 0) || (actor->fwork[0] == 0)) { - var_s1 = 1; + if ((i <= 0) || (this->fwork[0] == 0)) { + i = 1; } - for (var_s0 = 0; var_s0 < var_s1; var_s0++) { + + for (j = 0; j < i; j++) { Matrix_Translate(gGfxMatrix, 0.0f, 30.0f, 0.0f, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_Push(&gGfxMatrix); @@ -3525,29 +3678,32 @@ void Zoness_8019A1FC(Actor* actor) { } } -void Zoness_8019A4E0(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { - f32 sp4C = xPos - actor->obj.pos.x; - f32 sp48 = yPos - actor->obj.pos.y; - f32 sp44 = zPos - actor->obj.pos.z; - f32 sp40; - f32 sp3C; - Vec3f sp30; - Vec3f sp24; +void Zoness_8019A4E0(Actor* this, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { + f32 x = xPos - this->obj.pos.x; + f32 y = yPos - this->obj.pos.y; + f32 z = zPos - this->obj.pos.z; + f32 xAngle; + f32 yAngle; + Vec3f src; + Vec3f dest; - sp3C = Math_Atan2F(sp4C, sp44); - sp40 = -Math_Atan2F(sp48, sqrtf(SQ(sp4C) + SQ(sp44))); - Matrix_RotateY(gCalcMatrix, sp3C, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, sp40, MTXF_APPLY); - sp30.x = 0.0f; - sp30.y = 0.0f; - sp30.z = arg4; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp30, &sp24); - actor->vel.x = sp24.x; - actor->vel.y = sp24.y; - actor->vel.z = sp24.z; + yAngle = +Math_Atan2F(x, z); + xAngle = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z))); + + Matrix_RotateY(gCalcMatrix, yAngle, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, xAngle, MTXF_APPLY); + + src.x = 0.0f; + src.y = 0.0f; + src.z = arg4; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; } -void Zoness_8019A5D4(Actor* actor) { +void Zoness_Actor249_Update(Actor249* this) { f32 sp4C; f32 sp48; f32 sp44; @@ -3556,18 +3712,19 @@ void Zoness_8019A5D4(Actor* actor) { f32 var_fv1; if ((gBosses[0].state == 6) || (gBosses[0].state == 7)) { - Audio_KillSfxBySource(actor->sfxSource); - actor->state = 10; - actor->vel.z = 40.0f; + Audio_KillSfxBySource(this->sfxSource); + this->state = 10; + this->vel.z = 40.0f; } - actor->fwork[3] += 10.0f; - actor->fwork[1] = 70.0f; - switch (actor->state) { + this->fwork[3] += 10.0f; + this->fwork[1] = 70.0f; + + switch (this->state) { case 0: - actor->obj.pos.x = sZoFwork[ZO_BSF_65_X]; - actor->obj.pos.y = sZoFwork[ZO_BSF_65_Y]; - actor->obj.pos.z = sZoFwork[ZO_BSF_65_Z]; - if ((sZoSwork[ZO_BSS_20] != 0) && (actor->timer_0BC == 0)) { + this->obj.pos.x = sZoFwork[ZO_BSF_65_X]; + this->obj.pos.y = sZoFwork[ZO_BSF_65_Y]; + this->obj.pos.z = sZoFwork[ZO_BSF_65_Z]; + if ((sZoSwork[ZO_BSS_20] != 0) && (this->timer_0BC == 0)) { if ((sZoSwork[ZO_BSS_8] == 0) && (gBosses[0].state == 8)) { var_fv1 = RAND_FLOAT_CENTERED(3000.0f); var_fa0 = 0.0f; @@ -3575,94 +3732,99 @@ void Zoness_8019A5D4(Actor* actor) { var_fv1 = 0.0f; var_fa0 = 100.0f; } - Zoness_8019A4E0(actor, gPlayer[0].pos.x + var_fv1, gPlayer[0].pos.y + var_fa0, gPlayer[0].pos.z, 80.0f); - actor->vel.z -= gPathVelZ; + Zoness_8019A4E0(this, gPlayer[0].pos.x + var_fv1, gPlayer[0].pos.y + var_fa0, gPlayer[0].pos.z, 80.0f); + this->vel.z -= gPathVelZ; Zoness_80193C5C(sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y], sZoFwork[ZO_BSF_65_Z], 30.0f); Zoness_80193C5C(sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y], sZoFwork[ZO_BSF_65_Z], 30.0f); Zoness_80193C5C(sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y], sZoFwork[ZO_BSF_65_Z], 30.0f); - actor->timer_0BC = (s32) ((fabsf(sZoFwork[ZO_BSF_28] - -2600.0f) / 100.0f) + 30.0f); - actor->timer_0C0 = 3; - AUDIO_PLAY_SFX(NA_SE_EN_M_BALL_SHOT, actor->sfxSource, 4); - actor->state++; + this->timer_0BC = (s32) ((fabsf(sZoFwork[ZO_BSF_28] - -2600.0f) / 100.0f) + 30.0f); + this->timer_0C0 = 3; + AUDIO_PLAY_SFX(NA_SE_EN_M_BALL_SHOT, this->sfxSource, 4); + this->state++; } break; + case 1: - if (actor->timer_0C0 != 0) { + if (this->timer_0C0 != 0) { D_ctx_801779A8[0] = 40.0f; } - actor->iwork[0] = 0; - if (actor->timer_0BC == 0) { - actor->vel.x = 0.0f; - actor->vel.z = -gPathVelZ; - actor->gravity = 5.0f; - actor->fwork[5] = actor->vel.y * -3.0f; - if (actor->obj.pos.y < -150.0f) { - actor->gravity = 0.0f; - AUDIO_PLAY_SFX(NA_SE_EN_PULL_CHAIN0, actor->sfxSource, 4); - actor->state++; + this->iwork[0] = 0; + if (this->timer_0BC == 0) { + this->vel.x = 0.0f; + this->vel.z = -gPathVelZ; + this->gravity = 5.0f; + this->fwork[5] = this->vel.y * -3.0f; + if (this->obj.pos.y < -150.0f) { + this->gravity = 0.0f; + AUDIO_PLAY_SFX(NA_SE_EN_PULL_CHAIN0, this->sfxSource, 4); + this->state++; } } break; + case 2: if ((sZoSwork[ZO_BSS_8] == 0) && (gBosses[0].state == 8)) { - actor->fwork[5] = 0.0f; - actor->obj.pos.x = sZoFwork[ZO_BSF_65_X]; - actor->obj.pos.y = sZoFwork[ZO_BSF_65_Y]; - actor->obj.pos.z = sZoFwork[ZO_BSF_65_Z]; + this->fwork[5] = 0.0f; + this->obj.pos.x = sZoFwork[ZO_BSF_65_X]; + this->obj.pos.y = sZoFwork[ZO_BSF_65_Y]; + this->obj.pos.z = sZoFwork[ZO_BSF_65_Z]; sp48 = sp4C = 30.0f; } else { - Math_SmoothStepToF(&actor->fwork[5], 0.0f, 1.0f, 30.0f, 0.0f); - sp4C = fabsf(actor->obj.pos.x - sZoFwork[ZO_BSF_65_X]); - sp48 = fabsf(actor->obj.pos.z - sZoFwork[ZO_BSF_65_Z]); + Math_SmoothStepToF(&this->fwork[5], 0.0f, 1.0f, 30.0f, 0.0f); + sp4C = fabsf(this->obj.pos.x - sZoFwork[ZO_BSF_65_X]); + sp48 = fabsf(this->obj.pos.z - sZoFwork[ZO_BSF_65_Z]); var_fa0 = sqrtf(SQ(sp4C) + SQ(sp48)) * 0.5f; - Zoness_8019A4E0(actor, sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y] - var_fa0, sZoFwork[ZO_BSF_65_Z], + Zoness_8019A4E0(this, sZoFwork[ZO_BSF_65_X], sZoFwork[ZO_BSF_65_Y] - var_fa0, sZoFwork[ZO_BSF_65_Z], 30.0f); - actor->vel.z -= gPathVelZ; + this->vel.z -= gPathVelZ; } - if (Object_CheckHitboxCollision(&actor->obj.pos, gBosses[0].info.hitbox, &gBosses[0].obj, 0.0f, 0.0f, + + if (Object_CheckHitboxCollision(&this->obj.pos, gBosses[0].info.hitbox, &gBosses[0].obj, 0.0f, 0.0f, 0.0f) != 0) { - actor->fwork[6] = 50.0f; - AUDIO_PLAY_SFX(NA_SE_OB_METAL_BOUND_M, actor->sfxSource, 4); + this->fwork[6] = 50.0f; + AUDIO_PLAY_SFX(NA_SE_OB_METAL_BOUND_M, this->sfxSource, 4); } - actor->vel.z += actor->fwork[6] * 0.8f; - actor->vel.y += actor->fwork[6] * 1.4f; - actor->fwork[6] -= 8.0f; - if (actor->fwork[6] < 0.0f) { - actor->fwork[6] = 0.0f; + this->vel.z += this->fwork[6] * 0.8f; + this->vel.y += this->fwork[6] * 1.4f; + + this->fwork[6] -= 8.0f; + if (this->fwork[6] < 0.0f) { + this->fwork[6] = 0.0f; } if ((sp4C <= 30.0f) && (sp48 <= 30.0f)) { - actor->state = 0; - Audio_KillSfxBySource(actor->sfxSource); - AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, actor->sfxSource, 4); - actor->timer_0BC = 40; + this->state = 0; + Audio_KillSfxBySource(this->sfxSource); + AUDIO_PLAY_SFX(NA_SE_EN_COMBINE, this->sfxSource, 4); + this->timer_0BC = 40; sZoFwork[ZO_BSF_74] = sZoFwork[ZO_BSF_75] = 0.0f; sZoSwork[ZO_BSS_19] = 1; - sZoSwork[ZO_BSS_20] = actor->iwork[0] = sZoSwork[ZO_BSS_20] = 0; + sZoSwork[ZO_BSS_20] = this->iwork[0] = sZoSwork[ZO_BSS_20] = 0; } break; } - Zoness_8018FF50(actor); - if (actor->dmgType != DMG_NONE) { - if (actor->dmgType == DMG_BEAM) { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 4); + Zoness_8018FF50(this); + + if (this->dmgType != DMG_NONE) { + if (this->dmgType == DMG_BEAM) { + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } - actor->dmgType = DMG_NONE; + this->dmgType = DMG_NONE; } - if (((gGameFrameCount % 8) == 0) && (actor->state != 0) && (actor->iwork[0] < 8) && - (Play_CheckDynaFloorCollision(&sp44, &sp40, actor->obj.pos.x, actor->obj.pos.y - 100.0f, actor->obj.pos.z) != - 0)) { - func_effect_8008377C(actor->obj.pos.x, sp44, actor->obj.pos.z, 0.0f, 0.7f); - actor->iwork[0]++; - if (actor->vel.y >= 0.0f) { - AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, actor->sfxSource, 4); + + if (((gGameFrameCount % 8) == 0) && (this->state != 0) && (this->iwork[0] < 8) && + (Play_CheckDynaFloorCollision(&sp44, &sp40, this->obj.pos.x, this->obj.pos.y - 100.0f, this->obj.pos.z) != 0)) { + func_effect_8008377C(this->obj.pos.x, sp44, this->obj.pos.z, 0.0f, 0.7f); + this->iwork[0]++; + if (this->vel.y >= 0.0f) { + AUDIO_PLAY_SFX(NA_SE_OUT_SPLASH_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_IN_SPLASH_L, this->sfxSource, 4); } } } -void Zoness_8019ACCC(Actor* actor) { +void Zoness_Actor249_Draw(Actor249* this) { f32 temp_fa0; f32 temp_fa1; f32 temp_fs0; @@ -3671,21 +3833,21 @@ void Zoness_8019ACCC(Actor* actor) { f32 temp_fs0_2; f32 temp_fs1_2; f32 temp_fs0_4; - f32 var_fs5; + f32 var_fs5 = 90.0f; s32 i; f32 sp94; s32 var_s4; - var_fs5 = 90.0f; Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); + if ((gBosses[0].state != 6) && (gBosses[0].state != 7)) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - temp_fa0 = sZoFwork[ZO_BSF_65_X] - actor->obj.pos.x; - temp_fs0 = sZoFwork[ZO_BSF_65_Y] - actor->obj.pos.y; - temp_fa1 = sZoFwork[ZO_BSF_65_Z] - actor->obj.pos.z; + temp_fa0 = sZoFwork[ZO_BSF_65_X] - this->obj.pos.x; + temp_fs0 = sZoFwork[ZO_BSF_65_Y] - this->obj.pos.y; + temp_fa1 = sZoFwork[ZO_BSF_65_Z] - this->obj.pos.z; temp_fs3 = sqrtf(SQ(temp_fa0) + SQ(temp_fs0) + SQ(temp_fa1)); temp_fs4 = Math_Atan2F(temp_fa0, temp_fa1); @@ -3697,15 +3859,17 @@ void Zoness_8019ACCC(Actor* actor) { if (var_s4 < 0) { var_s4 = 0; } - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, temp_fs4, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, temp_fs0_2, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, MTXF_APPLY); + sp94 = (180.0f / var_s4) + 1.0f; + for (i = 0; i < var_s4; i++) { - temp_fs1_2 = SIN_DEG(i * sp94) * actor->fwork[5]; - temp_fs0_4 = COS_DEG(i * sp94) * actor->fwork[5] * -0.25f; - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, actor->fwork[1], MTXF_APPLY); + temp_fs1_2 = SIN_DEG(i * sp94) * this->fwork[5]; + temp_fs0_4 = COS_DEG(i * sp94) * this->fwork[5] * -0.25f; + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, this->fwork[1], MTXF_APPLY); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, temp_fs1_2, 0.0f, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * temp_fs0_4, MTXF_APPLY); @@ -3722,17 +3886,17 @@ void Zoness_8019ACCC(Actor* actor) { } Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + gPathProgress, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, actor->obj.rot.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, SETUPDL_70); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gSPDisplayList(gMasterDisp++, D_ZO_6004380); Matrix_RotateY(gGfxMatrix, sZoFwork[ZO_BSF_19] * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, actor->fwork[2] * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, actor->fwork[3] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->fwork[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->fwork[3] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_55(); gSPDisplayList(gMasterDisp++, D_ZO_601BCC0); @@ -3786,6 +3950,7 @@ void Zoness_8019B1F0(Actor* actor) { } else { Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF768[var_s3], &sp84); } + Actor_Initialize(&gActors[i]); gActors[i].obj.status = OBJ_INIT; if (actor->state == 0) { @@ -3803,6 +3968,7 @@ void Zoness_8019B1F0(Actor* actor) { gActors[i].iwork[1] = actor->index; gActors[i].iwork[2] = var_s3; Object_SetInfo(&gActors[i].info, gActors[i].obj.id); + if (actor->state != 0) { gActors[i].state = 3; if (D_i3_801BF804[actor->iwork[3]] >= 361.0f) { @@ -3821,56 +3987,59 @@ void Zoness_8019B1F0(Actor* actor) { AUDIO_PLAY_SFX(NA_SE_EN_SHIP_ENGINE_L, actor->sfxSource, 4); } -void Zoness_8019B548(Actor* actor) { +void Zoness_Actor250_Update(Actor* this) { f32 sp6C; s32 sp68; s32 i; Vec3f sp58; Actor* otherActor; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - switch (actor->state) { + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + + switch (this->state) { case 0: for (i = 1; i < 3; i++) { - otherActor = &gActors[actor->iwork[i]]; - if ((otherActor->obj.status != OBJ_FREE) && (otherActor->iwork[1] == actor->index) && + otherActor = &gActors[this->iwork[i]]; + if ((otherActor->obj.status != OBJ_FREE) && (otherActor->iwork[1] == this->index) && (otherActor->obj.id == OBJ_ACTOR_251)) { Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF744[i], &sp58); - otherActor->obj.pos.x = actor->obj.pos.x + sp58.x; - otherActor->obj.pos.y = actor->obj.pos.y + sp58.y; - otherActor->obj.pos.z = actor->obj.pos.z + sp58.z; + otherActor->obj.pos.x = this->obj.pos.x + sp58.x; + otherActor->obj.pos.y = this->obj.pos.y + sp58.y; + otherActor->obj.pos.z = this->obj.pos.z + sp58.z; } } break; + case 1: for (i = 1; i < 3; i++) { - otherActor = &gActors[actor->iwork[i]]; + otherActor = &gActors[this->iwork[i]]; if ((otherActor->obj.status != OBJ_FREE) && (otherActor->obj.id == OBJ_ACTOR_253) && - (otherActor->iwork[1] == actor->index)) { + (otherActor->iwork[1] == this->index)) { Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF768[i], &sp58); - otherActor->obj.pos.x = actor->obj.pos.x + sp58.x; - otherActor->obj.pos.y = actor->obj.pos.y + sp58.y; - otherActor->obj.pos.z = actor->obj.pos.z + sp58.z; + otherActor->obj.pos.x = this->obj.pos.x + sp58.x; + otherActor->obj.pos.y = this->obj.pos.y + sp58.y; + otherActor->obj.pos.z = this->obj.pos.z + sp58.z; } } break; } - if ((fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f) && - Play_CheckDynaFloorCollision(&sp6C, &sp68, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z)) { - Math_SmoothStepToF(&actor->obj.pos.y, sp6C, 0.1f, 4.0f, 0.0f); + + if ((fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f) && + Play_CheckDynaFloorCollision(&sp6C, &sp68, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z)) { + Math_SmoothStepToF(&this->obj.pos.y, sp6C, 0.1f, 4.0f, 0.0f); } } -void Zoness_8019B7DC(Actor* actor) { +void Zoness_Actor250_Draw(Actor* this) { gSPDisplayList(gMasterDisp++, D_ZO_6006360); } -void Zoness_8019B810(Actor* actor) { - if (actor->iwork[3] == 0) { - actor->iwork[0] = actor->obj.rot.z / 10.0f; - actor->obj.rot.z = 0.0f; +void Zoness_8019B810(Actor* this) { + if (this->iwork[3] == 0) { + this->iwork[0] = this->obj.rot.z / 10.0f; + this->obj.rot.z = 0.0f; } - actor->health = 30; + this->health = 30; } s32 D_i3_801BF824[10] = { DROP_SILVER_RING, DROP_BOMB, DROP_LASERS, DROP_GOLD_RING_1, DROP_GOLD_RING_2, @@ -3880,73 +4049,76 @@ Vec3f D_i3_801BF84C[6] = { { -5.0f, -10.0f, 0.0f }, { -10.0f, 0.0f, 0.0f }, { -5.0f, 10.0f, 0.0f }, }; -void Zoness_8019B854(Actor* actor) { +void Zoness_Actor251_Update(Actor251* this) { s32 i; s32 j; Vec3f spB4; Vec3f spA8 = { 0.0f, 0.0f, 0.0f }; Vec3f sp9C; - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - actor->timer_0C6 = 15; - actor->health -= actor->damage; - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, actor->sfxSource, 4); + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + this->timer_0C6 = 15; + this->health -= this->damage; + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); } - switch (actor->state) { + + switch (this->state) { case 0: - if (actor->health <= 0) { - actor->health = 0; - actor->state++; + if (this->health <= 0) { + this->health = 0; + this->state++; } break; + case 1: for (i = 0; i < 6; i++) { - Zoness_SpawnDebris(&actor->vwork[i], &actor->vwork[6 + i], RAND_FLOAT_CENTERED(50.0f), - RAND_FLOAT(10.0f) + 20.0f, RAND_FLOAT_CENTERED(50.0f), 39, actor->scale, - RAND_FLOAT(15.0f) + (actor->scale * 10.0f), i); + Zoness_SpawnDebris(&this->vwork[i], &this->vwork[6 + i], RAND_FLOAT_CENTERED(50.0f), + RAND_FLOAT(10.0f) + 20.0f, RAND_FLOAT_CENTERED(50.0f), 39, this->scale, + RAND_FLOAT(15.0f) + (this->scale * 10.0f), i); } for (i = 0; i < 10; i++) { - func_effect_80079618(RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.x, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.y, - RAND_FLOAT_CENTERED(50.0f) + actor->obj.pos.z, 2.0f); + func_effect_80079618(RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.x, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.y, + RAND_FLOAT_CENTERED(50.0f) + this->obj.pos.z, 2.0f); } for (i = 0; i < 3; i++) { - func_effect_8007D0E0(actor->obj.pos.x + RAND_FLOAT_CENTERED(50.0f), - actor->obj.pos.y + RAND_FLOAT_CENTERED(50.0f) + 20.0f, - actor->obj.pos.z + RAND_FLOAT_CENTERED(30.0f), 10.0f + 2 * i); + func_effect_8007D0E0(this->obj.pos.x + RAND_FLOAT_CENTERED(50.0f), + this->obj.pos.y + RAND_FLOAT_CENTERED(50.0f) + 20.0f, + this->obj.pos.z + RAND_FLOAT_CENTERED(30.0f), 10.0f + 2 * i); } - actor->obj.pos.y += 100.0f; - if (D_i3_801BF824[actor->iwork[0]] < 1000) { - actor->itemDrop = D_i3_801BF824[actor->iwork[0]]; - Actor_Despawn(actor); + this->obj.pos.y += 100.0f; + + if (D_i3_801BF824[this->iwork[0]] < 1000) { + this->itemDrop = D_i3_801BF824[this->iwork[0]]; + Actor_Despawn(this); } else { - if (D_i3_801BF824[actor->iwork[0]] == 1000) { + if (D_i3_801BF824[this->iwork[0]] == 1000) { for (i = 0, j = 0; i < 10; i++, j++) { if (j > 5) { j = 0; } - spB4.x = D_i3_801BF84C[j].x + actor->obj.pos.x; - spB4.y = D_i3_801BF84C[j].y + actor->obj.pos.y; - spB4.z = D_i3_801BF84C[j].z + actor->obj.pos.z; + spB4.x = D_i3_801BF84C[j].x + this->obj.pos.x; + spB4.y = D_i3_801BF84C[j].y + this->obj.pos.y; + spB4.z = D_i3_801BF84C[j].z + this->obj.pos.z; sp9C.x = RAND_FLOAT_CENTERED(10.0f); sp9C.y = RAND_FLOAT_CENTERED(10.0f); sp9C.z = 50.0f; - func_effect_8007EE68(OBJ_EFFECT_353, &spB4, &spA8, &spA8, &sp9C, 1.0f); + func_effect_8007EE68(OBJ_EFFECT_ENEMY_LASER_1, &spB4, &spA8, &spA8, &sp9C, 1.0f); } } - actor->itemDrop = DROP_NONE; - Actor_Despawn(actor); + this->itemDrop = DROP_NONE; + Actor_Despawn(this); } - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_BROKEN_BOX); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_BROKEN_BOX); break; } } void Zoness_8019BC78(s32 limbIndex, Vec3f* rot, void* thisx) { Vec3f sp24 = { 0.0f, 0.0f, 0.0f }; - Actor* this = thisx; + Actor* this = (Actor*) thisx; if (this->state != 0) { switch (limbIndex) { @@ -3978,220 +4150,238 @@ void Zoness_8019BC78(s32 limbIndex, Vec3f* rot, void* thisx) { } } -void Zoness_8019BDE0(Actor* actor) { - Vec3f sp28[20]; +void Zoness_Actor251_Draw(Actor* this) { + Vec3f frameTable[20]; - Animation_GetFrameData(&D_ZO_6018550, 0, sp28); - Animation_DrawSkeleton(3, D_ZO_601863C, sp28, NULL, Zoness_8019BC78, actor, gCalcMatrix); + Animation_GetFrameData(&D_ZO_6018550, 0, frameTable); + Animation_DrawSkeleton(3, D_ZO_601863C, frameTable, NULL, Zoness_8019BC78, this, gCalcMatrix); } -void Zoness_8019BE48(Actor* actor) { - Actor* pad; +void Zoness_Actor252_Update(Actor252* this) { + s32 pad; f32 sp40; f32 sp3C; s32 sp38; s32 i; - Actor* newActor; + Actor254* actor254; - switch (actor->state) { /* irregular */ + switch (this->state) { case 0: - for (i = 0, newActor = gActors; i < ARRAY_COUNT(gActors); i++, newActor++) { - if (newActor->obj.status == OBJ_FREE) { - Actor_Initialize(newActor); - newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_254; - newActor->obj.pos.x = actor->obj.pos.x; - newActor->obj.pos.y = actor->obj.pos.y; - newActor->obj.pos.z = actor->obj.pos.z + 30.0f; - newActor->fwork[0] = 230.0f; - newActor->fwork[1] = 0.8f; - newActor->fwork[2] = 1.0f; - newActor->fwork[3] = 1.0f; - newActor->iwork[0] = actor->index + 1; - Object_SetInfo(&newActor->info, newActor->obj.id); - actor->iwork[0] = i; + for (i = 0, actor254 = gActors; i < ARRAY_COUNT(gActors); i++, actor254++) { + if (actor254->obj.status == OBJ_FREE) { + Actor_Initialize(actor254); + actor254->obj.status = OBJ_INIT; + actor254->obj.id = OBJ_ACTOR_254; + actor254->obj.pos.x = this->obj.pos.x; + actor254->obj.pos.y = this->obj.pos.y; + actor254->obj.pos.z = this->obj.pos.z + 30.0f; + actor254->fwork[0] = 230.0f; + actor254->fwork[1] = 0.8f; + actor254->fwork[2] = 1.0f; + actor254->fwork[3] = 1.0f; + actor254->iwork[0] = this->index + 1; + Object_SetInfo(&actor254->info, actor254->obj.id); + this->iwork[0] = i; break; } } if (i >= ARRAY_COUNT(gActors)) { - newActor->obj.status = OBJ_FREE; + actor254->obj.status = OBJ_FREE; } - actor->health = 10; - actor->state++; + this->health = 10; + this->state++; break; + case 1: - if ((actor->dmgType != DMG_NONE) && (actor->health != 0)) { - actor->dmgType = DMG_NONE; - actor->timer_0C6 = 15; - actor->health -= actor->damage; - if (actor->health <= 0) { + if ((this->dmgType != DMG_NONE) && (this->health != 0)) { + this->dmgType = DMG_NONE; + this->timer_0C6 = 15; + this->health -= this->damage; + if (this->health <= 0) { if (!gMissedZoSearchlight) { - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + 200.0f, 2); + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 200.0f, 2); gHitCount += 2; } - actor->health = actor->itemDrop = 0; - Actor_Despawn(actor); - actor->state++; + this->health = this->itemDrop = 0; + Actor_Despawn(this); + this->state++; } } break; - case 2: - actor->timer_0C2 = 30000; - newActor = &gActors[actor->iwork[0]]; - newActor->iwork[0] = 777; - func_effect_8008377C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5.0f, 0.7f); - func_effect_8007D0E0(actor->obj.pos.x, actor->obj.pos.y + 50.0f, actor->obj.pos.z, 5.0f); - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_WT_EXPLOSION_S); + case 2: + this->timer_0C2 = 30000; + actor254 = &gActors[this->iwork[0]]; + + actor254->iwork[0] = 777; + func_effect_8008377C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 5.0f, 0.7f); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y + 50.0f, this->obj.pos.z, 5.0f); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_WT_EXPLOSION_S); break; } - if ((actor->state < 2) && (Play_CheckDynaFloorCollision(&sp40, &sp38, actor->obj.pos.x, actor->obj.pos.y - 60.0f, - actor->obj.pos.z) != 0)) { - actor->gravity = 0.0f; + + if ((this->state < 2) && + (Play_CheckDynaFloorCollision(&sp40, &sp38, this->obj.pos.x, this->obj.pos.y - 60.0f, this->obj.pos.z) != 0)) { + this->gravity = 0.0f; sp3C = 10.0f; - if (Math_SmoothStepToF(&actor->obj.pos.y, sp40 - 20.0f, 0.1f, 5.0f, 0) >= 0.0f) { + if (Math_SmoothStepToF(&this->obj.pos.y, sp40 - 20.0f, 0.1f, 5.0f, 0) >= 0.0f) { sp3C = 350.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, sp3C, 0.1f, 1.0f, 0); - newActor = &gActors[actor->iwork[0]]; - Math_SmoothStepToAngle(&newActor->obj.rot.z, sp3C, 0.1f, 1.0f, 0); - newActor->obj.pos.y = actor->obj.pos.y; + Math_SmoothStepToAngle(&this->obj.rot.z, sp3C, 0.1f, 1.0f, 0); + actor254 = &gActors[this->iwork[0]]; + Math_SmoothStepToAngle(&actor254->obj.rot.z, sp3C, 0.1f, 1.0f, 0); + actor254->obj.pos.y = this->obj.pos.y; } } -void Zoness_8019C1CC(Actor* actor) { +void Zoness_Actor252_Draw(Actor* this) { gSPDisplayList(gMasterDisp++, D_ZO_6002E10); } Vec3f D_i3_801BF8AC = { 230.0f, -50.0f, 0.0f }; Vec3f D_i3_801BF8B8 = { 230.0f, -250.0f, 0.0f }; -void Zoness_8019C200(Actor* actor) { +void Zoness_8019C200(Actor* this) { s32 i; s32 sp38; - Vec3f sp2C; - Actor* newActor; + Vec3f dest; + Actor251* actor251; - actor->scale = -1.0f; - if (actor->state != 3) { - actor->iwork[4] = fabsf(Math_ModF(actor->obj.rot.z, 10.0f)); - sp38 = fabsf(actor->obj.rot.z / 10.0f); + this->scale = -1.0f; + + if (this->state != 3) { + this->iwork[4] = fabsf(Math_ModF(this->obj.rot.z, 10.0f)); + sp38 = fabsf(this->obj.rot.z / 10.0f); } else { - sp38 = actor->iwork[0]; - actor->state = 0; + sp38 = this->iwork[0]; + this->state = 0; } - actor->fwork[5] = actor->obj.rot.x; - actor->obj.rot.x = 0.0f; - actor->obj.rot.z = 0.0f; - if (actor->iwork[4] == 2) { - actor->fwork[0] = -20.0f; - actor->fwork[3] = actor->obj.pos.y * 0.5f * -1.0f; + + this->fwork[5] = this->obj.rot.x; + this->obj.rot.x = 0.0f; + this->obj.rot.z = 0.0f; + + if (this->iwork[4] == 2) { + this->fwork[0] = -20.0f; + this->fwork[3] = this->obj.pos.y * 0.5f * -1.0f; } else { - actor->fwork[0] = 30.0f; + this->fwork[0] = 30.0f; } - Matrix_RotateZ(gCalcMatrix, actor->fwork[0] * M_DTOR, MTXF_NEW); - Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8AC, &sp2C); - actor->fwork[1] = sp2C.x; - actor->fwork[2] = actor->fwork[3] + sp2C.y; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8B8, &sp2C); - for (i = 0, newActor = gActors; i < ARRAY_COUNT(gActors); i++, newActor++) { - if (newActor->obj.status == OBJ_FREE) { - Actor_Initialize(newActor); - newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_251; - newActor->obj.pos.x = actor->obj.pos.x + sp2C.x; - newActor->obj.pos.y = actor->obj.pos.y + sp2C.y + actor->fwork[2]; - newActor->obj.pos.z = actor->obj.pos.z + sp2C.z + actor->fwork[0]; - newActor->obj.rot.y = actor->obj.rot.y; - newActor->iwork[0] = sp38; - newActor->iwork[3] = 777; - Object_SetInfo(&newActor->info, newActor->obj.id); - actor->iwork[3] = i; + + Matrix_RotateZ(gCalcMatrix, this->fwork[0] * M_DTOR, MTXF_NEW); + Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8AC, &dest); + + this->fwork[1] = dest.x; + this->fwork[2] = this->fwork[3] + dest.y; + + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8B8, &dest); + + for (i = 0, actor251 = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor251++) { + if (actor251->obj.status == OBJ_FREE) { + Actor_Initialize(actor251); + actor251->obj.status = OBJ_INIT; + actor251->obj.id = OBJ_ACTOR_251; + actor251->obj.pos.x = this->obj.pos.x + dest.x; + actor251->obj.pos.y = this->obj.pos.y + dest.y + this->fwork[2]; + actor251->obj.pos.z = this->obj.pos.z + dest.z + this->fwork[0]; + actor251->obj.rot.y = this->obj.rot.y; + actor251->iwork[0] = sp38; + actor251->iwork[3] = 777; + Object_SetInfo(&actor251->info, actor251->obj.id); + this->iwork[3] = i; break; } } if (i >= ARRAY_COUNT(gActors)) { - newActor->obj.status = OBJ_FREE; + actor251->obj.status = OBJ_FREE; } } -void Zoness_8019C454(Actor* actor) { +void Zoness_Actor253_Update(Actor* this) { Vec3f sp34; Actor* otherActor; - if ((actor->fwork[0] == 30.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 2500.0f)) { - Math_SmoothStepToAngle(&actor->fwork[6], 10.0f, 0.1f, 1.0f, 0.01f); - Math_SmoothStepToAngle(&actor->obj.rot.y, actor->fwork[5], 1.0f, actor->fwork[6], 0.01f); - if (actor->fwork[5] != actor->obj.rot.y) { - AUDIO_PLAY_SFX(NA_SE_OB_CRAME_MOTOR, actor->sfxSource, 4); + if ((this->fwork[0] == 30.0f) && (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 2500.0f)) { + Math_SmoothStepToAngle(&this->fwork[6], 10.0f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToAngle(&this->obj.rot.y, this->fwork[5], 1.0f, this->fwork[6], 0.01f); + if (this->fwork[5] != this->obj.rot.y) { + AUDIO_PLAY_SFX(NA_SE_OB_CRAME_MOTOR, this->sfxSource, 4); } if (1) {} } - Matrix_RotateZ(gCalcMatrix, actor->fwork[0] * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, this->fwork[0] * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8AC, &sp34); - actor->fwork[1] = sp34.x; - actor->fwork[2] = actor->fwork[3] + sp34.y; - otherActor = &gActors[actor->iwork[3]]; - switch (actor->state) { + + this->fwork[1] = sp34.x; + this->fwork[2] = this->fwork[3] + sp34.y; + + otherActor = &gActors[this->iwork[3]]; + + switch (this->state) { case 0: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8B8, &sp34); + if ((otherActor->obj.status != OBJ_FREE) && (otherActor->obj.id == OBJ_ACTOR_251)) { - otherActor->obj.pos.x = actor->obj.pos.x + sp34.x; - otherActor->obj.pos.y = actor->obj.pos.y + sp34.y + actor->fwork[2]; - otherActor->obj.pos.z = actor->obj.pos.z + sp34.z; + otherActor->obj.pos.x = this->obj.pos.x + sp34.x; + otherActor->obj.pos.y = this->obj.pos.y + sp34.y + this->fwork[2]; + otherActor->obj.pos.z = this->obj.pos.z + sp34.z; } else { - actor->state = 1; + this->state = 1; } - switch (actor->iwork[4]) { + + switch (this->iwork[4]) { case 1: - if ((actor->fwork[5] == actor->obj.rot.y) && - (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { + if ((this->fwork[5] == this->obj.rot.y) && + (fabsf(this->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { if (otherActor->obj.id == OBJ_ACTOR_251) { otherActor->gravity = 1.0f; } - actor->state = 1; + this->state = 1; } break; + case 2: - Math_SmoothStepToF(&actor->fwork[3], 0.0f, 1.0f, 5.0f, 0.01f); - if (actor->fwork[3] == 0.0f) { - Math_SmoothStepToF(&actor->fwork[0], 30.0f, 1.0f, 5.0f, 0.01f); - if (actor->fwork[0] == 30.0f) { - actor->iwork[4] = 0; + Math_SmoothStepToF(&this->fwork[3], 0.0f, 1.0f, 5.0f, 0.01f); + if (this->fwork[3] == 0.0f) { + Math_SmoothStepToF(&this->fwork[0], 30.0f, 1.0f, 5.0f, 0.01f); + if (this->fwork[0] == 30.0f) { + this->iwork[4] = 0; } } break; } break; + case 1: - actor->fwork[4] += 10.0f; - actor->fwork[4] = Math_ModF(actor->fwork[4], 360.0f); + this->fwork[4] += 10.0f; + this->fwork[4] = Math_ModF(this->fwork[4], 360.0f); break; } - if (actor->fwork[0] >= 30.0f) { - actor->fwork[0] = 30.0f; + + if (this->fwork[0] >= 30.0f) { + this->fwork[0] = 30.0f; } - if (actor->fwork[0] <= -20.0f) { - actor->fwork[0] = -20.0f; + if (this->fwork[0] <= -20.0f) { + this->fwork[0] = -20.0f; } - if (actor->fwork[3] >= 0) { - actor->fwork[3] = 0.0f; + if (this->fwork[3] >= 0) { + this->fwork[3] = 0.0f; } - if (actor->fwork[3] <= -450.0f) { - actor->fwork[3] = -450.0f; + if (this->fwork[3] <= -450.0f) { + this->fwork[3] = -450.0f; } } -void Zoness_8019C83C(Actor* actor) { +void Zoness_Actor253_Draw(Actor253* this) { f32 var_fv1; s32 i; s32 var_s1; Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, actor->fwork[0] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->fwork[0] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601A340); Matrix_Pop(&gGfxMatrix); @@ -4207,15 +4397,15 @@ void Zoness_8019C83C(Actor* actor) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601D680); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[1], actor->fwork[2], 0.0f, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, actor->fwork[4] * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[1], this->fwork[2], 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->fwork[4] * M_DTOR, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.75f, 0.75f, 0.75f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601C590); RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); Matrix_RotateY(gGfxMatrix, gGameFrameCount * M_DTOR, MTXF_APPLY); - var_fv1 = (fabsf(actor->fwork[3]) * 1.3f) + 50.0f; + var_fv1 = (fabsf(this->fwork[3]) * 1.3f) + 50.0f; for (var_s1 = 0; var_fv1 > 0.0f; var_s1++) { var_fv1 -= 9.3f; } @@ -4226,6 +4416,7 @@ void Zoness_8019C83C(Actor* actor) { if (var_s1 <= 0) { var_s1 = 1; } + for (i = 0; i < var_s1; i++) { Matrix_Translate(gGfxMatrix, 0.0f, 9.3f, 0.0f, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY); @@ -4240,71 +4431,68 @@ void Zoness_8019C83C(Actor* actor) { f32 D_i3_801BF8C4[2] = { 46.0f, 314.0f }; f32 D_i3_801BF8CC[2] = { 23.0f, 337.0f }; -void Zoness_8019CBEC(Actor* actor) { - actor->timer_0C2 = 30000; - switch (actor->state) { +void Zoness_Actor254_Update(Actor254* this) { + this->timer_0C2 = 30000; + + switch (this->state) { case 0: - actor->fwork[5] = D_i3_801BF8CC[gGameFrameCount % 2U]; + this->fwork[5] = D_i3_801BF8CC[gGameFrameCount % 2U]; if (gMissedZoSearchlight) { - actor->fwork[5] = D_i3_801BF8C4[gGameFrameCount % 2U]; - actor->iwork[1] = 1; + this->fwork[5] = D_i3_801BF8C4[gGameFrameCount % 2U]; + this->iwork[1] = 1; } - actor->state++; + this->state++; break; + case 1: - Math_SmoothStepToF(&actor->fwork[6], 10.0f, 0.1f, 1.0f, 0.001f); - if (actor->iwork[0] == 0) { - Math_SmoothStepToAngle(&actor->obj.rot.z, actor->fwork[5], 0.1f, actor->fwork[6], 0.0001f); + Math_SmoothStepToF(&this->fwork[6], 10.0f, 0.1f, 1.0f, 0.001f); + if (this->iwork[0] == 0) { + Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[5], 0.1f, this->fwork[6], 0.0001f); } else { - Math_SmoothStepToAngle(&actor->fwork[4], actor->fwork[5], 0.1f, actor->fwork[6], 0.0001f); + Math_SmoothStepToAngle(&this->fwork[4], this->fwork[5], 0.1f, this->fwork[6], 0.0001f); } - if (gMissedZoSearchlight && (actor->iwork[1] == 0)) { - if (actor->fwork[5] < 300.0f) { - actor->fwork[5] = D_i3_801BF8C4[0]; + + if (gMissedZoSearchlight && (this->iwork[1] == 0)) { + if (this->fwork[5] < 300.0f) { + this->fwork[5] = D_i3_801BF8C4[0]; } else { - actor->fwork[5] = D_i3_801BF8C4[1]; + this->fwork[5] = D_i3_801BF8C4[1]; } - actor->iwork[1] = 1; + this->iwork[1] = 1; } - if (actor->timer_0BC == 0) { - actor->timer_0BC = 45; - actor->fwork[5] = 360.0f - actor->fwork[5]; - actor->fwork[6] = 0.0f; + + if (this->timer_0BC == 0) { + this->timer_0BC = 45; + this->fwork[5] = 360.0f - this->fwork[5]; + this->fwork[6] = 0.0f; } - if (actor->iwork[0] == 777) { - actor->state++; + + if (this->iwork[0] == 777) { + this->state++; } break; + case 2: - Math_SmoothStepToF(&actor->fwork[1], 0.0f, 0.2f, 1.0f, 0.01f); - if (actor->fwork[1] < 0.6f) { - Math_SmoothStepToF(&actor->fwork[2], 0.0f, 0.5f, 5.0f, 0.01f); - if (actor->fwork[2] == 0.0f) { - Object_Kill(&actor->obj, actor->sfxSource); + Math_SmoothStepToF(&this->fwork[1], 0.0f, 0.2f, 1.0f, 0.01f); + if (this->fwork[1] < 0.6f) { + Math_SmoothStepToF(&this->fwork[2], 0.0f, 0.5f, 5.0f, 0.01f); + if (this->fwork[2] == 0.0f) { + Object_Kill(&this->obj, this->sfxSource); } } break; } - Zoness_8018FF50(actor); - actor->obj.rot.x = 0.0f; + Zoness_8018FF50(this); + this->obj.rot.x = 0.0f; } -void Zoness_8019CE58(Actor* actor) { - Gfx* temp_v0; - Gfx* temp_v0_2; - Gfx* temp_v0_3; - Gfx* temp_v0_4; - Gfx* temp_v0_5; - Gfx* temp_v0_6; - Gfx* temp_v0_7; - Gfx* temp_v0_8; - Gfx* temp_v0_9; - +void Zoness_Actor254_Draw(Actor254* this) { RCP_SetupDL(&gMasterDisp, SETUPDL_72); - if (actor->iwork[0] != 0) { - Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[0], 0.0f, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, (actor->fwork[4] + actor->obj.rot.z) * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, actor->fwork[1], actor->fwork[2], actor->fwork[3], MTXF_APPLY); + + if (this->iwork[0] != 0) { + Matrix_Translate(gGfxMatrix, 0.0f, this->fwork[0], 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (this->fwork[4] + this->obj.rot.z) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[1], this->fwork[2], this->fwork[3], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gMissedZoSearchlight) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 191, 43, 255); @@ -4346,41 +4534,44 @@ void Zoness_Actor247_Init(Actor247* this) { } } -void Zoness_8019D15C(Actor* actor) { +void Zoness_Actor247_Update(Actor247* this) { Actor* otherActor; - if (actor->state == 0) { - if (actor->dmgType != DMG_NONE) { - actor->dmgType = DMG_NONE; - if (actor->dmgPart < 2) { - AUDIO_PLAY_SFX(NA_SE_OB_WT_WHEEL_ROLL, actor->sfxSource, 4); - if ((actor->obj.pos.y + 268.0f) < actor->hitPos.y) { - actor->fwork[1] = 20.0f; + if (this->state == 0) { + if (this->dmgType != DMG_NONE) { + this->dmgType = DMG_NONE; + if (this->dmgPart < 2) { + AUDIO_PLAY_SFX(NA_SE_OB_WT_WHEEL_ROLL, this->sfxSource, 4); + if ((this->obj.pos.y + 268.0f) < this->hitPos.y) { + this->fwork[1] = 20.0f; } else { - actor->fwork[1] = -20.0f; + this->fwork[1] = -20.0f; } - AUDIO_PLAY_SFX(NA_SE_OB_WALL_UP, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_OB_WALL_UP, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } } - if (actor->unk_046 != 0) { - otherActor = &gActors[actor->unk_046 - 1]; - otherActor->obj.pos.y += actor->fwork[1] * 0.3f; - if (otherActor->obj.pos.y > actor->fwork[2] + 370.0f) { - otherActor->obj.pos.y = actor->fwork[2] + 370.0f; + + if (this->unk_046 != 0) { + otherActor = &gActors[this->unk_046 - 1]; + otherActor->obj.pos.y += this->fwork[1] * 0.3f; + if (otherActor->obj.pos.y > this->fwork[2] + 370.0f) { + otherActor->obj.pos.y = this->fwork[2] + 370.0f; } } - actor->fwork[0] += actor->fwork[1]; - Math_SmoothStepToF(&actor->fwork[1], 0.0f, 1.0f, 1.0f, 0.0f); - if (actor->fwork[1] == 0.0f) { - Audio_KillSfxBySource(actor->sfxSource); + + this->fwork[0] += this->fwork[1]; + Math_SmoothStepToF(&this->fwork[1], 0.0f, 1.0f, 1.0f, 0.0f); + + if (this->fwork[1] == 0.0f) { + Audio_KillSfxBySource(this->sfxSource); } } } bool Zoness_8019D340(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { - Actor* this = thisx; + Actor* this = (Actor*) thisx; switch (this->state) { case 0: @@ -4392,6 +4583,7 @@ bool Zoness_8019D340(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t *dList = NULL; } break; + case 1: if (limbIndex != 3) { *dList = NULL; @@ -4401,20 +4593,21 @@ bool Zoness_8019D340(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t return false; } -void Zoness_8019D3C4(Actor* actor) { - Vec3f sp28[10]; +void Zoness_Actor247_Draw(Actor* this) { + Vec3f frameTable[10]; - Animation_GetFrameData(&D_ZO_601FBC4, 0, sp28); - Animation_DrawSkeleton(1, D_ZO_601FC90, sp28, Zoness_8019D340, NULL, actor, &gIdentityMatrix); + Animation_GetFrameData(&D_ZO_601FBC4, 0, frameTable); + Animation_DrawSkeleton(1, D_ZO_601FC90, frameTable, Zoness_8019D340, NULL, this, &gIdentityMatrix); } void Zoness_LevelStart(Player* player) { - s32 sp2C; + s32 buttonSave; player->bobPhase += 10.0f; player->yBob = -SIN_DEG(player->bobPhase) * 0.5f; player->rockPhase += 3.0f; player->rockAngle = SIN_DEG(player->rockPhase) * 1.5f; + switch (player->csState) { case 0: gCsFrameCount = 0; @@ -4430,20 +4623,26 @@ void Zoness_LevelStart(Player* player) { case 1: Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 48.0f, 0); Math_SmoothStepToF(&player->cam.at.y, (player->pos.y * player->unk_148) + 20.0f, 0.1f, 1.0f, 0.0f); + if (gCsFrameCount >= 230) { Math_SmoothStepToF(&player->cam.at.z, player->trueZpos, 0.2f, 20000.0f, 0.0f); } - sp2C = gControllerHold[gMainController].button; + + buttonSave = gControllerHold[gMainController].button; gControllerHold[gMainController].button = gBoostButton[gMainController]; + player->csTimer = 60; player->boostMeter = 1.0f; Player_ArwingBoost(player); + if (gCsFrameCount > 195) { D_ctx_801779A8[0] = 50.0f; } else { D_ctx_801779A8[0] = 0.0f; } - gControllerHold[gMainController].button = sp2C; + + gControllerHold[gMainController].button = buttonSave; + if (gCsFrameCount >= 270) { AUDIO_PLAY_BGM(NA_BGM_STAGE_ZO); gLevelStartStatusScreenTimer = 80; @@ -4459,13 +4658,13 @@ void Zoness_LevelStart(Player* player) { } void Zoness_LevelComplete(Player* player) { - f32 temp_fa0; - f32 temp_ft5; + f32 zRot; + f32 yRot; f32 dx; f32 dz; s32 i; - Vec3f sp58; - Vec3f sp4C; + Vec3f src; + Vec3f dest; Boss* boss = &gBosses[0]; switch (player->csState) { @@ -4478,12 +4677,14 @@ void Zoness_LevelComplete(Player* player) { player->draw = true; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->zRotBarrelRoll = player->zRotBank = player->boostSpeed = 0.0f; + gCsCamEyeX = player->cam.eye.x; gCsCamEyeY = player->cam.eye.y; gCsCamEyeZ = player->cam.eye.z; gCsCamAtX = player->cam.at.x; gCsCamAtY = player->cam.at.y; gCsCamAtZ = player->cam.at.z; + for (i = 10; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].animFrame == 0) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -4492,31 +4693,38 @@ void Zoness_LevelComplete(Player* player) { Object_Kill(&gActors[2].obj, gActors[2].sfxSource); Object_Kill(&gActors[3].obj, gActors[3].sfxSource); Object_Kill(&gActors[4].obj, gActors[4].sfxSource); + player->csState = 1; + D_ctx_80177A48[0] = 0.05f; + if (Rand_ZeroOne() > 0.5f) { D_ctx_80177A48[9] = -1.0f; } else { D_ctx_80177A48[9] = 1.0f; } break; + case 1: gPathTexScroll += 30.0f; Math_SmoothStepToF(&player->rot.x, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 200.0f, 0.05f, 10.0f, 0.0f); Math_SmoothStepToF(&gCsCamEyeY, 250.0f, 1.0f, 20.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, 240.0f, 1.0f, 20.0f, 0.0f); + dx = player->pos.x - boss->obj.pos.x; dz = (player->pos.z - boss->obj.pos.z) * 0.05f; - temp_ft5 = Math_RadToDeg(-Math_Atan2F(dx, dz)); - temp_fa0 = Math_SmoothStepToAngle(&player->rot.y, temp_ft5, 0.5f, 2.0f, 0.0001f) * 30.0f; + yRot = Math_RadToDeg(-Math_Atan2F(dx, dz)); + zRot = Math_SmoothStepToAngle(&player->rot.y, yRot, 0.5f, 2.0f, 0.0001f) * 30.0f; + if (gCsFrameCount >= 14) { - Math_SmoothStepToAngle(&player->rot.z, temp_fa0, 0.1f, 5.0f, 0.0001f); - } else if (temp_fa0 < 0.0f) { + Math_SmoothStepToAngle(&player->rot.z, zRot, 0.1f, 5.0f, 0.0001f); + } else if (zRot < 0.0f) { player->rot.z -= 30.0f; } else { player->rot.z += 30.0f; } + if (gCsFrameCount >= 140) { gFillScreenAlphaTarget = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -4535,8 +4743,10 @@ void Zoness_LevelComplete(Player* player) { player->rot.z = 0.0f; } break; + case 2: gPathTexScroll += 60.0f; + if (player->csTimer == 0) { player->pos.x = 0.0f; player->pos.y = 200.0f; @@ -4549,6 +4759,7 @@ void Zoness_LevelComplete(Player* player) { Solar_801A7750(); D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; + if (!gMissedZoSearchlight) { D_ctx_80177A48[1] = 330.0f; player->cam.eye.x = 1350.0f; @@ -4571,20 +4782,23 @@ void Zoness_LevelComplete(Player* player) { D_ctx_80177A48[0] = 0.0f; } break; + case 3: gPathTexScroll += 60.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; D_ctx_80177A48[1] += D_ctx_80177A48[2]; + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); - sp58.x = 0.0f; - sp58.y = 0.0f; - sp58.z = D_ctx_80177A48[3]; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); + src.x = 0.0f; + src.y = 0.0f; + src.z = D_ctx_80177A48[3]; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + if (gCsFrameCount < 1180) { - gCsCamEyeX = sp4C.x; - gCsCamEyeY = 200.0f + sp4C.y; - gCsCamEyeZ = player->pos.z + gPathProgress + sp4C.z; + gCsCamEyeX = dest.x; + gCsCamEyeY = 200.0f + dest.y; + gCsCamEyeZ = player->pos.z + gPathProgress + dest.z; gCsCamAtX = 0.0f; gCsCamAtY = player->pos.y; gCsCamAtZ = D_ctx_80177A48[5] + (player->pos.z + gPathProgress); @@ -4594,11 +4808,13 @@ void Zoness_LevelComplete(Player* player) { gCsCamAtY = player->pos.y; gCsCamAtZ = player->pos.z + gPathProgress; } + if (gCsFrameCount > 1180) { player->baseSpeed += 2.0f; player->rot.x += 0.1f; Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 1.0f, 0.001f, 0); player->unk_190 = 2.0f; + if (!gMissedZoSearchlight) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 1.0f, 0.025f, 0.0f); } @@ -4606,6 +4822,7 @@ void Zoness_LevelComplete(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[2], D_ctx_80177A48[4], 1.0f, 0.001f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[0], 0.05f, 1.0f, 0.00005f, 0.0f); } + if (gCsFrameCount == 1300) { Play_ClearObjectData(); } @@ -4624,7 +4841,9 @@ void Zoness_LevelComplete(Player* player) { } break; } - (void) "Demo_Time %d\n"; + + PRINTF("Demo_Time %d\n"); + switch (gCsFrameCount) { case 320: if (!gMissedZoSearchlight) { @@ -4632,9 +4851,11 @@ void Zoness_LevelComplete(Player* player) { } gLevelClearScreenTimer = 100; break; + case 380: Radio_PlayMessage(gMsg_ID_20010, RCID_FOX); break; + case 468: switch (gTeamShields[TEAM_ID_SLIPPY]) { case 0: @@ -4648,6 +4869,7 @@ void Zoness_LevelComplete(Player* player) { break; } break; + case 603: switch (gTeamShields[TEAM_ID_PEPPY]) { case 0: @@ -4665,6 +4887,7 @@ void Zoness_LevelComplete(Player* player) { break; } break; + case 738: switch (gTeamShields[TEAM_ID_FALCO]) { case 0: @@ -4678,36 +4901,44 @@ void Zoness_LevelComplete(Player* player) { break; } break; + case 906: gShowLevelClearStatusScreen = 1; break; + case 1106: gShowLevelClearStatusScreen = 0; break; + case 1180: AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, player->sfxSource, 0); player->unk_190 = player->unk_194 = 5.0f; break; + case 1240: SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); break; + case 1120: if (gTeamShields[TEAM_ID_PEPPY] > 0) { gActors[0].state = 2; } break; + case 1140: if (gTeamShields[TEAM_ID_SLIPPY] > 0) { gActors[1].state = 2; } break; + case 1160: if (gTeamShields[TEAM_ID_FALCO] > 0) { gActors[2].state = 2; } break; } + if (gCsFrameCount >= 1180) { player->contrailScale += 0.02f; if (player->contrailScale > 0.6f) { @@ -4716,13 +4947,13 @@ void Zoness_LevelComplete(Player* player) { } Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -((player->xRot_120 + player->rot.x) * M_DTOR), MTXF_APPLY); - sp58.x = 0.0f; - sp58.y = 0.0f; - sp58.z = player->baseSpeed; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - player->vel.x = sp4C.x; - player->vel.z = sp4C.z; - player->vel.y = sp4C.y; + src.x = 0.0f; + src.y = 0.0f; + src.z = player->baseSpeed; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + player->vel.x = dest.x; + player->vel.z = dest.z; + player->vel.y = dest.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; player->trueZpos = player->pos.z += player->vel.z; @@ -4739,11 +4970,11 @@ void Zoness_LevelComplete(Player* player) { player->rockAngle = SIN_DEG(player->rockPhase); } -void Zoness_8019E5F0(Actor* actor) { - Vec3f sp34; - Vec3f sp28; +void Zoness_8019E5F0(ActorCutscene* this) { + Vec3f src; + Vec3f dest; - switch (actor->state) { + switch (this->state) { case 4: case 5: case 6: @@ -4753,36 +4984,36 @@ void Zoness_8019E5F0(Actor* actor) { case 10: break; case 1: - if ((actor->animFrame != 0) && ((((s32) (actor->index % 8U) * 10) + 1030) < gCsFrameCount)) { - actor->state = 4; + if ((this->animFrame != 0) && ((((s32) (this->index % 8U) * 10) + 1030) < gCsFrameCount)) { + this->state = 4; } break; case 2: - actor->state = 3; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 3; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 5.0f; /* fallthrough */ case 3: - actor->iwork[11] = 2; - actor->fwork[0] += 2.0f; - actor->rot_0F4.x += 0.1f; - actor->fwork[21] += 0.2f; - if (actor->fwork[21] > 0.6f) { - actor->fwork[21] = 0.6f; + this->iwork[11] = 2; + this->fwork[0] += 2.0f; + this->rot_0F4.x += 0.1f; + this->fwork[21] += 0.2f; + if (this->fwork[21] > 0.6f) { + this->fwork[21] = 0.6f; } break; } - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), MTXF_APPLY); - sp34.x = 0.0f; - sp34.y = 0.0f; - sp34.z = actor->fwork[0]; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp34, &sp28); - actor->vel.x = sp28.x; - actor->vel.y = sp28.y; - actor->vel.z = sp28.z; + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); + src.x = 0.0f; + src.y = 0.0f; + src.z = this->fwork[0]; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y + 180.0f; - actor->obj.rot.z = -actor->rot_0F4.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index b8afe00b..f625ee21 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -127,7 +127,7 @@ void Bolse_8018BD60(Actor* this) { } } ActorAllRange_UpdateStarWolfEvents(this); - ActorAllRange_UpdateEvemyEvents(this); + ActorAllRange_UpdateEnemyEvents(this); } f32 D_i4_8019EEE4[] = { -200.0f, -100.0f, -0.0f, 100.0f, 200.0f }; @@ -136,7 +136,7 @@ void Bolse_SpawnEnemies(Actor* this, s32 count) { s32 i; Actor* enemy; - for (i = AI360_10, enemy = &gActors[AI360_10]; i < count + AI360_10; i++, enemy++) { + for (i = AI360_ENEMY, enemy = &gActors[AI360_ENEMY]; i < count + AI360_ENEMY; i++, enemy++) { if (enemy->obj.status == OBJ_FREE) { Actor_Initialize(enemy); enemy->obj.status = OBJ_ACTIVE; @@ -160,26 +160,26 @@ void Bolse_SpawnEnemies(Actor* this, s32 count) { enemy->aiType = i; enemy->aiIndex = -1; - if (i < AI360_10 + 3) { + if (i < AI360_ENEMY + 3) { enemy->aiIndex = AI360_SLIPPY; gActors[AI360_SLIPPY].aiIndex = -1; } - if ((i == AI360_10 + 7) || (i == AI360_10 + 8)) { + if ((i == AI360_ENEMY + 7) || (i == AI360_ENEMY + 8)) { enemy->aiIndex = AI360_FOX; } - if ((i == AI360_10 + 10) || (i == AI360_10 + 11)) { + if ((i == AI360_ENEMY + 10) || (i == AI360_ENEMY + 11)) { enemy->aiIndex = AI360_PEPPY; gActors[AI360_PEPPY].aiIndex = -1; } - if (i == AI360_10 + 12) { + if (i == AI360_ENEMY + 12) { enemy->aiIndex = AI360_FALCO; gActors[AI360_FALCO].aiIndex = -1; } - if ((D_i4_801A0530 > 16000) && ((i == AI360_10 + 13) || (i == AI360_10 + 14))) { + if ((D_i4_801A0530 > 16000) && ((i == AI360_ENEMY + 13) || (i == AI360_ENEMY + 14))) { enemy->aiIndex = AI360_FOX; } @@ -342,7 +342,7 @@ void Bolse_UpdateEventHandler(Actor* this) { if ((gControllerPress->button & START_BUTTON) || ((gAllRangeSpawnEvent + 300) == gAllRangeEventTimer)) { this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; D_hud_80161708 = 0; } @@ -391,7 +391,7 @@ void Bolse_UpdateEventHandler(Actor* this) { gAllRangeEventTimer = 3000; this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; Audio_KillSfxBySource(gBosses[1].sfxSource); this->iwork[1] = gHitCount; @@ -604,7 +604,7 @@ void Bolse_8018D124(Actor* actor) { src.z = gEnemyShotSpeed; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_effect_8007F04C(OBJ_EFFECT_353, actor->obj.pos.x + dest.x, actor->obj.pos.y + 180.0f + dest.y, + func_effect_8007F04C(OBJ_EFFECT_ENEMY_LASER_1, actor->obj.pos.x + dest.x, actor->obj.pos.y + 180.0f + dest.y, actor->obj.pos.z + dest.z, -actor->rot_0F4.x, actor->rot_0F4.y + actor->obj.rot.y, 0.0f, 0.0f, 0.0f, 0.0f, dest.x, dest.y, dest.z, 1.0f); } @@ -627,7 +627,7 @@ bool Bolse_8018D278(Actor* actor) { } } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); actor->itemDrop = DROP_SILVER_RING; @@ -733,7 +733,7 @@ bool Bolse_8018D584(Actor* actor) { Audio_KillSfxBySourceAndId(actor->sfxSource, NA_SE_OB_SPARK_BEAM); AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, actor->sfxSource, 0); } else { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_REFLECT); } return true; @@ -1724,7 +1724,7 @@ void Bolse_LevelComplete(Player* player) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); } - Camera_Update360(player, 0); + Camera_Update360(player, false); player->cam.eye.x += player->vel.x * 0.1f; player->cam.eye.y += player->vel.y * 0.1f; @@ -1806,7 +1806,7 @@ void Bolse_80190FE8(f32 x, f32 y, f32 z, f32 scale) { } } -void Bolse_80191054(Effect* effect) { +void Bolse_Effect397_Update(Effect* effect) { switch (effect->state) { case 0: if (gPlayer[0].barrelRollAlpha == 0) { @@ -1835,7 +1835,7 @@ void Bolse_80191054(Effect* effect) { } } -void Bolse_80191180(Effect* effect) { +void Bolse_Effect397_Draw(Effect* effect) { switch (effect->state) { case 0: gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 192); @@ -1858,7 +1858,7 @@ void Bolse_80191180(Effect* effect) { f32 D_i4_8019F09C[12] = { 0.0f, 0.0f, 60.0f, 60.0f, 120.0f, 120.0f, 180.0f, 180.0f, 240.0f, 240.0f, 300.0f, 300.0f }; -void Bolse_801912FC(Boss* boss) { +void Bolse_Boss311_Update(Boss* boss) { s32 i; Vec3f src; Vec3f dest; @@ -2036,7 +2036,7 @@ void Bolse_80191A6C(s32 index, Vec3f* vec, void* ptr) { } } -void Bolse_80191AFC(Boss* boss) { +void Bolse_Boss311_Draw(Boss* boss) { Animation_GetFrameData(&D_BO_6001C64, 0, boss->vwork); if (boss->state >= 2) { Animation_DrawSkeleton(3, D_BO_6001FB0, boss->vwork, Bolse_801918E4, Bolse_80191A6C, boss, gCalcMatrix); diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index d2d6b630..6d452b64 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -7,104 +7,111 @@ #include "global.h" #include "assets/ast_fortuna.h" -void Fortuna_801875F0(Actor* actor) { +// Spawns up to 10 enemies from the center base. +void Fortuna_SpawnEnemies(ActorEvent* this) { s32 i; - s32 counter; - Actor* actorPtr = &gActors[10]; - f32 D_i4_8019EDE0[] = { 180.0f, 60.0f, 300.0f }; + s32 enemyCount; + ActorAllRange* enemy = &gActors[10]; + f32 sEnemySpawnAngle[] = { 180.0f, 60.0f, 300.0f }; - for (counter = 0, i = 0; i < 10; i++, actorPtr++) { - if (actorPtr->obj.status != OBJ_FREE) { - counter++; + for (enemyCount = 0, i = 0; i < 10; i++, enemy++) { + if (enemy->obj.status != OBJ_FREE) { + enemyCount++; } } - if ((counter < 10) && (actor->timer_0C0 == 0)) { + if ((enemyCount < 10) && (this->timer_0C0 == 0)) { if (gAllRangeEventTimer < (gAllRangeSpawnEvent - 500)) { - actor->timer_0C0 = 40; + this->timer_0C0 = 40; - actor->counter_04E++; - if (actor->counter_04E >= 3) { - actor->counter_04E = 0; + this->counter_04E++; + if (this->counter_04E >= 3) { + this->counter_04E = 0; } - for (i = 0, actorPtr = &gActors[10]; i < 10; i++, actorPtr++) { - if (actorPtr->obj.status == OBJ_FREE) { - Actor_Initialize(actorPtr); - actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; - actorPtr->obj.pos.x = gBosses[0].obj.pos.x; - actorPtr->obj.pos.y = gBosses[0].obj.pos.y + 20.0f; - actorPtr->obj.pos.z = gBosses[0].obj.pos.z; - actorPtr->state = 1; - actorPtr->timer_0BC = 100; - actorPtr->aiType = i + AI360_10; - actorPtr->aiIndex = -1; + for (i = 0, enemy = &gActors[AI360_ENEMY]; i < 10; i++, enemy++) { + if (enemy->obj.status == OBJ_FREE) { + Actor_Initialize(enemy); + enemy->obj.status = OBJ_ACTIVE; + enemy->obj.id = OBJ_ACTOR_ALLRANGE; + enemy->obj.pos.x = gBosses[0].obj.pos.x; + enemy->obj.pos.y = gBosses[0].obj.pos.y + 20.0f; + enemy->obj.pos.z = gBosses[0].obj.pos.z; + enemy->state = 1; + enemy->timer_0BC = 100; + enemy->aiType = i + AI360_ENEMY; + enemy->aiIndex = -1; if ((i == 3) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->aiIndex = AI360_SLIPPY; + enemy->aiIndex = AI360_SLIPPY; } if ((i == 4) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->aiIndex = AI360_PEPPY; + enemy->aiIndex = AI360_PEPPY; } if ((i == 5) && (Rand_ZeroOne() < 0.3f)) { - actorPtr->aiIndex = AI360_FALCO; + enemy->aiIndex = AI360_FALCO; } - actorPtr->rot_0F4.x = 3.0f; - actorPtr->rot_0F4.y = D_i4_8019EDE0[actor->counter_04E]; - actorPtr->health = 24; - actorPtr->drawShadow = actorPtr->iwork[11] = 1; - actorPtr->itemDrop = DROP_SILVER_RING_50p; - Object_SetInfo(&actorPtr->info, actorPtr->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actorPtr->sfxSource, 4); + enemy->rot_0F4.x = 3.0f; + enemy->rot_0F4.y = sEnemySpawnAngle[this->counter_04E]; + enemy->health = 24; + enemy->drawShadow = enemy->iwork[11] = 1; + enemy->itemDrop = DROP_SILVER_RING_50p; + Object_SetInfo(&enemy->info, enemy->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, enemy->sfxSource, 4); break; } } } } - ActorAllRange_UpdateStarWolfEvents(actor); + ActorAllRange_UpdateStarWolfEvents(this); } -f32 D_8019EDEC[] = { 0.0f, 700.0f, 12000.0f }; +void Fortuna_SetupStarWolfFlee(ActorAllRange* this, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { + s32 health = this->health; -void Fortuna_80187884(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { - s32 health = actor->health; - PRINTF("Enm->work[0]=%d\n"); - PRINTF("tim %d\n"); - - Actor_Initialize(actor); - actor->health = health; - actor->obj.status = OBJ_ACTIVE; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->obj.id = OBJ_ACTOR_ALLRANGE; - actor->aiType = AI360_WOLF; - actor->drawShadow = true; - actor->state = 0; - actor->timer_0BC = 10000; - actor->rot_0F4.y = arg4; - actor->iwork[11] = 1; - actor->rot_0F4.x = 0.0f; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_WOLF_ENGINE, actor->sfxSource, 4); + Actor_Initialize(this); + this->health = health; + this->obj.status = OBJ_ACTIVE; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->obj.id = OBJ_ACTOR_ALLRANGE; + this->aiType = AI360_WOLF; + this->drawShadow = true; + this->state = 0; + this->timer_0BC = 10000; + this->rot_0F4.y = yRot; + this->iwork[11] = 1; + this->rot_0F4.x = 0.0f; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_WOLF_ENGINE, this->sfxSource, 4); } -Vec3f D_i4_8019EDF8[] = { { -300.0f, 1000.0f, 13000.0f }, { 300.0f, 700.0f, 14000.0f }, { 1000.0f, 300.0f, 0.0f } }; -Vec3f D_i4_8019EE1C[] = { { -1000.0f, 300.0f, 0 }, { 0.0f, 500.0f, 0 } }; +Vec3f sCsTeamInitialPos[] = { + { 0.0f, 700.0f, 12000.0f }, + { -300.0f, 1000.0f, 13000.0f }, + { 300.0f, 700.0f, 14000.0f }, +}; +Vec3f sTeamInitialPos[] = { + { 1000.0f, 300.0f, 0.0f }, + { -1000.0f, 300.0f, 0 }, + { 0.0f, 500.0f, 0 }, +}; -void Fortuna_UpdateEvents(Actor* actor) { +void Fortuna_UpdateEvents(ActorEvent* this) { s32 i; Player* player = &gPlayer[0]; - Actor* actorPtr; - Actor* actor0 = &gActors[0]; - Actor* actor1 = &gActors[1]; - Actor* actor2 = &gActors[2]; - Actor* actor3 = &gActors[3]; - Actor* actor4 = &gActors[4]; - Actor* actor19 = &gActors[19]; - s32 pad[2]; + ActorAllRange* team; + ActorAllRange* falco = &gActors[AI360_FALCO]; + ActorAllRange* slippy = &gActors[AI360_SLIPPY]; + ActorAllRange* peppy = &gActors[AI360_PEPPY]; + ActorAllRange* wolf = &gActors[AI360_WOLF]; + ActorAllRange* greatFox = &gActors[19]; + s32 pad2[3]; + + PRINTF("Enm->work[0]=%d\n", this->iwork[0]); + PRINTF("tim %d\n", gAllRangeEventTimer); if ((player->state_1C8 == PLAYERSTATE_1C8_DOWN) || (player->state_1C8 == PLAYERSTATE_1C8_NEXT)) { gAllRangeEventTimer = 20000; @@ -170,11 +177,11 @@ void Fortuna_UpdateEvents(Actor* actor) { } if (gAllRangeEventTimer == 9206) { - gShowAllRangeCountdown = 0; - actor->state = 5; + gShowAllRangeCountdown = false; + this->state = 5; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; - actor->iwork[0] = 0; - actor->fwork[0] = 0.0f; + this->iwork[0] = 0; + this->fwork[0] = 0.0f; AllRange_ClearRadio(); for (i = 4; i < 8; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -188,8 +195,8 @@ void Fortuna_UpdateEvents(Actor* actor) { if (gAllRangeEventTimer == 10100) { gShowAllRangeCountdown = 0; - actor->iwork[0] = 0; - actor->state = 6; + this->iwork[0] = 0; + this->state = 6; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 0; gPlayer[0].unk_000 = 0.0f; @@ -216,51 +223,56 @@ void Fortuna_UpdateEvents(Actor* actor) { } } - switch (actor->state) { + switch (this->state) { case 0: - gAllRangeSpawnEvent = 2880; + gAllRangeSpawnEvent = TIME_IN_SECONDS(96); + for (i = 0; i < 6; i++) { - gSavedStarWolfTeamAlive[i] = 1; - gStarWolfTeamAlive[i] = 1; + gSavedStarWolfTeamAlive[i] = true; + gStarWolfTeamAlive[i] = true; } + gAllRangeEventTimer = 0; gStarWolfMsgTimer = 0; + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - actor->state = 2; + this->state = 2; player->pos.x = 0.0f; player->pos.z = 8000.0f; player->pos.y = 670.0f; + gAllRangeEventTimer = 200; if (gAllRangeCheckpoint != 0) { gAllRangeEventTimer = gAllRangeSpawnEvent - 1; gHitCount = gSavedHitCount; } } else { - actor->state = 1; + this->state = 1; player->pos.x = 0.0f; player->pos.z = 15000.0f; player->pos.y = 670.0f; player->yRot_114 = 0.0f; - for (actorPtr = &gActors[1], i = 0; i < 3; i++, actorPtr++) { - actorPtr->obj.pos.x = D_i4_8019EDF8[i - 1].x; - actorPtr->obj.pos.y = D_i4_8019EDF8[i - 1].y; - actorPtr->obj.pos.z = D_i4_8019EDF8[i - 1].z; + for (team = &gActors[AI360_FALCO], i = AI360_FALCO; i <= AI360_PEPPY; i++, team++) { + team->obj.pos.x = sCsTeamInitialPos[i - 1].x; + team->obj.pos.y = sCsTeamInitialPos[i - 1].y; + team->obj.pos.z = sCsTeamInitialPos[i - 1].z; } } - Camera_UpdateArwing360(player, 1); + Camera_UpdateArwing360(player, true); break; case 1: - for (actorPtr = actor0 + 1, i = 0; i < 3; i++, actorPtr++) { - actorPtr->fwork[4] = D_i4_8019EE1C[i - 1].x; - actorPtr->fwork[5] = D_i4_8019EE1C[i - 1].y; - actorPtr->fwork[6] = D_i4_8019EE1C[i - 1].z; - actorPtr->state = 3; - actorPtr->timer_0BC = 3; + for (team = &gActors[AI360_FALCO], i = AI360_FALCO; i <= AI360_PEPPY; i++, team++) { + team->fwork[4] = sTeamInitialPos[i - 1].x; + team->fwork[5] = sTeamInitialPos[i - 1].y; + team->fwork[6] = sTeamInitialPos[i - 1].z; + team->state = 3; + team->timer_0BC = 3; + if (gCsFrameCount == 264) { - actorPtr->state = 2; - actor->state = 2; + team->state = 2; + this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0001f; AUDIO_PLAY_BGM(gBgmSeqId); @@ -270,17 +282,19 @@ void Fortuna_UpdateEvents(Actor* actor) { break; case 2: - Fortuna_801875F0(actor); + Fortuna_SpawnEnemies(this); break; case 3: - player->cam.eye.x += actor4->vel.x * 0.23f; - player->cam.eye.y += actor4->vel.y * 0.23f; - player->cam.eye.z += actor4->vel.z * 0.23f; - Math_SmoothStepToF(&player->cam.at.x, actor4->obj.pos.x, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.y, actor4->obj.pos.y, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.z, actor4->obj.pos.z, 1.0f, 20000.0f, 0.0f); + player->cam.eye.x += wolf->vel.x * 0.23f; + player->cam.eye.y += wolf->vel.y * 0.23f; + player->cam.eye.z += wolf->vel.z * 0.23f; + + Math_SmoothStepToF(&player->cam.at.x, wolf->obj.pos.x, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, wolf->obj.pos.y, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, wolf->obj.pos.z, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 1.0f, 1000.0f, 0.0f); + if (gAllRangeEventTimer == (gAllRangeSpawnEvent + 2)) { gStarWolfMsgTimer = 883; gAllRangeCheckpoint = 1; @@ -293,9 +307,9 @@ void Fortuna_UpdateEvents(Actor* actor) { } if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (gAllRangeSpawnEvent + 440))) { - actor->state = 2; + this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; D_hud_80161708 = 0; } @@ -304,50 +318,53 @@ void Fortuna_UpdateEvents(Actor* actor) { case 5: gAllRangeEventTimer = 9207; - actor->iwork[0]++; - actor->fwork[0] += 10.0f; + this->iwork[0]++; + this->fwork[0] += 10.0f; player->cam.eye.x = 300.0f; player->cam.eye.y = 300.0f; player->cam.eye.z = -1000.0f; - player->cam.at.x = actor->fwork[0] + 300.0f; - player->cam.at.y = actor->fwork[0] + 500.0f; + player->cam.at.x = this->fwork[0] + 300.0f; + player->cam.at.y = this->fwork[0] + 500.0f; player->cam.at.z = -15000.0f; player->camRoll = 0.0f; - if ((actor->iwork[0] == 50) && (gStarWolfTeamAlive[0] != 0)) { + if ((this->iwork[0] == 50) && (gStarWolfTeamAlive[0] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9431, RCID_WOLF); } - Fortuna_80187884(&gActors[4], player->cam.eye.x - 200.0f, player->cam.eye.y, player->cam.eye.z, 160.0f); + Fortuna_SetupStarWolfFlee(&gActors[AI360_WOLF], player->cam.eye.x - 200.0f, player->cam.eye.y, + player->cam.eye.z, 160.0f); } - if ((actor->iwork[0] == 70) && (gStarWolfTeamAlive[1] != 0)) { + if ((this->iwork[0] == 70) && (gStarWolfTeamAlive[1] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9432, RCID_LEON); } - Fortuna_80187884(&gActors[5], player->cam.eye.x, player->cam.eye.y + 50.0f, player->cam.eye.z, 160.0f); + Fortuna_SetupStarWolfFlee(&gActors[AI360_LEON], player->cam.eye.x, player->cam.eye.y + 50.0f, + player->cam.eye.z, 160.0f); } - if ((actor->iwork[0] == 90) && (gStarWolfTeamAlive[2] != 0)) { + if ((this->iwork[0] == 90) && (gStarWolfTeamAlive[2] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9433, RCID_PIGMA); } - Fortuna_80187884(gActors + 6, player->cam.eye.x - 200.0f, player->cam.eye.y + 200.0f, player->cam.eye.z, - 160.0f); + Fortuna_SetupStarWolfFlee(&gActors[AI360_PIGMA], player->cam.eye.x - 200.0f, player->cam.eye.y + 200.0f, + player->cam.eye.z, 160.0f); } - if ((actor->iwork[0] == 110) && (gStarWolfTeamAlive[3] != 0)) { + if ((this->iwork[0] == 110) && (gStarWolfTeamAlive[3] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9434, RCID_ANDREW); } - Fortuna_80187884(gActors + 7, player->cam.eye.x - 300.0f, player->cam.eye.y, player->cam.eye.z, 160.0f); + Fortuna_SetupStarWolfFlee(&gActors[AI360_ANDREW], player->cam.eye.x - 300.0f, player->cam.eye.y, + player->cam.eye.z, 160.0f); } - if (actor->iwork[0] == 250) { - actor->state = 2; + if (this->iwork[0] == 250) { + this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; D_hud_80161708 = 0; @@ -362,32 +379,32 @@ void Fortuna_UpdateEvents(Actor* actor) { break; case 6: - actor->iwork[0]++; + this->iwork[0]++; if (gMissionStatus == MISSION_COMPLETE) { - actor1->aiIndex = AI360_FOX; - actor1->state = 2; - actor2->aiIndex = AI360_FOX; - actor2->state = 2; - actor3->aiIndex = AI360_FOX; - actor3->state = 2; - if (actor->iwork[0] == 130) { + falco->aiIndex = AI360_FOX; + falco->state = 2; + slippy->aiIndex = AI360_FOX; + slippy->state = 2; + peppy->aiIndex = AI360_FOX; + peppy->state = 2; + if (this->iwork[0] == 130) { Vec3f sp50 = { 0.0f, 0.0f, -10000 }; - Actor_Initialize(actor19); + Actor_Initialize(greatFox); Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->trueZpos, MTXF_NEW); Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gCalcMatrix, player->rot.x * M_DTOR, MTXF_APPLY); - Matrix_MultVec3f(gCalcMatrix, &sp50, &actor19->obj.pos); + Matrix_MultVec3f(gCalcMatrix, &sp50, &greatFox->obj.pos); - actor19->obj.status = OBJ_ACTIVE; - actor19->obj.id = OBJ_ACTOR_ALLRANGE; - actor19->state = 4; - actor19->rot_0F4.y = player->rot.y + player->yRot_114 + 180.0f; - actor19->rot_0F4.x = 15.0f; - actor19->aiType = AI360_GREAT_FOX; - actor19->fwork[1] = 90.0f; - actor19->fwork[0] = 90.0f; - Object_SetInfo(&actor19->info, actor19->obj.id); + greatFox->obj.status = OBJ_ACTIVE; + greatFox->obj.id = OBJ_ACTOR_ALLRANGE; + greatFox->state = 4; + greatFox->rot_0F4.y = player->rot.y + player->yRot_114 + 180.0f; + greatFox->rot_0F4.x = 15.0f; + greatFox->aiType = AI360_GREAT_FOX; + greatFox->fwork[1] = 90.0f; + greatFox->fwork[0] = 90.0f; + Object_SetInfo(&greatFox->info, greatFox->obj.id); } } gSceneSetup = 1; @@ -440,23 +457,23 @@ void Fortuna_UpdateEvents(Actor* actor) { } } -void Fortuna_SetupDebris(Actor* actor, Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 state) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_DEBRIS; - actor->state = state; +void Fortuna_SetupDebris(ActorDebris* this, Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 state) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_DEBRIS; + this->state = state; - actor->obj.pos = *pos; - actor->obj.rot = *rot; + this->obj.pos = *pos; + this->obj.rot = *rot; - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; - actor->scale = 2.5f; - actor->timer_0BC = RAND_INT(15.0f) + 25.0f; - actor->gravity = 0.5f; - Object_SetInfo(&actor->info, actor->obj.id); + this->scale = 2.5f; + this->timer_0BC = RAND_INT(15.0f) + 25.0f; + this->gravity = 0.5f; + Object_SetInfo(&this->info, this->obj.id); } void Fortuna_SpawnDebris(Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 state) { @@ -470,39 +487,39 @@ void Fortuna_SpawnDebris(Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s } } -void Fortuna_80188AD0(Actor* actor) { - actor->fwork[0] += 2.0f; - if (actor->state == 2) { - actor->state = 3; - Fortuna_SpawnDebris(actor->vwork, &actor->vwork[6], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, +void Fortuna_Radar_Update(FoRadar* this) { + this->fwork[0] += 2.0f; + if (this->state == 2) { + this->state = 3; + Fortuna_SpawnDebris(this->vwork, &this->vwork[6], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, RAND_FLOAT_CENTERED(50.0f), 36); - Fortuna_SpawnDebris(&actor->vwork[1], &actor->vwork[7], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, + Fortuna_SpawnDebris(&this->vwork[1], &this->vwork[7], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, RAND_FLOAT_CENTERED(50.0f), 36); - Fortuna_SpawnDebris(&actor->vwork[2], &actor->vwork[8], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, + Fortuna_SpawnDebris(&this->vwork[2], &this->vwork[8], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, RAND_FLOAT_CENTERED(50.0f), 35); - Fortuna_SpawnDebris(&actor->vwork[3], &actor->vwork[9], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, + Fortuna_SpawnDebris(&this->vwork[3], &this->vwork[9], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT(10.0f) + 10.0f, RAND_FLOAT_CENTERED(50.0f), 35); - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y + 180.0f, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 10); - actor->itemDrop = DROP_SILVER_RING; - actor->obj.pos.y += 230.0f; - Actor_Despawn(actor); - actor->obj.pos.y -= 230.0f; + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y + 180.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 10); + this->itemDrop = DROP_SILVER_RING; + this->obj.pos.y += 230.0f; + Actor_Despawn(this); + this->obj.pos.y -= 230.0f; } - if ((actor->dmgType != DMG_NONE) && (actor->state == 0)) { - actor->dmgType = DMG_NONE; - actor->state = 1; - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_FO_600FF64); - actor->info.targetOffset = 0.0f; - actor->lockOnTimers[TEAM_ID_FOX] = 0; - actor->info.bonus = 0; - AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, actor->sfxSource, 4); + if ((this->dmgType != DMG_NONE) && (this->state == 0)) { + this->dmgType = DMG_NONE; + this->state = 1; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_FO_600FF64); + this->info.targetOffset = 0.0f; + this->lockOnTimers[TEAM_ID_FOX] = 0; + this->info.bonus = 0; + AUDIO_PLAY_SFX(NA_SE_EN_EXPLOSION_M, this->sfxSource, 4); } } -void Fortuna_80188DA0(s32 limbIndex, Vec3f* rot, void* ptr) { +void Fortuna_Radar_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* ptr) { Vec3f vec = { 0.0f, 0.0f, 0.0f }; - Actor* actor = (Actor*) ptr; + FoRadar* actor = (FoRadar*) ptr; if (actor->state == 1) { switch (limbIndex) { @@ -539,8 +556,8 @@ void Fortuna_80188DA0(s32 limbIndex, Vec3f* rot, void* ptr) { } } -bool Fortuna_80188F08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* ptr) { - Actor* actor = (Actor*) ptr; +bool Fortuna_Radar_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* ptr) { + FoRadar* actor = (FoRadar*) ptr; gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -570,19 +587,21 @@ bool Fortuna_80188F08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Fortuna_80188FE4(Actor* actor) { - Vec3f vec[20]; +void Fortuna_Radar_Draw(FoRadar* this) { + Vec3f frameTable[20]; - Animation_GetFrameData(&D_FO_6007854, 0, vec); - Animation_DrawSkeleton(3, D_FO_6007980, vec, Fortuna_80188F08, Fortuna_80188DA0, actor, gCalcMatrix); + Animation_GetFrameData(&D_FO_6007854, 0, frameTable); + Animation_DrawSkeleton(3, D_FO_6007980, frameTable, Fortuna_Radar_OverrideLimbDraw, Fortuna_Radar_PostLimbDraw, + this, gCalcMatrix); - if (actor->state == 1) { - actor->state = 2; + if (this->state == 1) { + this->state = 2; } } -void Fortuna_8018906C(void) { - Actor* actor = &gActors[50]; +// Explosion seen from space if the mission fails. +void Fortuna_CsExplosion(void) { + ActorCutscene* actor = &gActors[50]; Actor_Initialize(actor); actor->obj.status = OBJ_INIT; @@ -595,31 +614,32 @@ void Fortuna_8018906C(void) { Object_SetInfo(&actor->info, actor->obj.id); } -f32 D_i4_8019EE4C[] = { -200.0f, 200.0f, -50.0f, -2000.0f }; -f32 D_i4_8019EE5C[] = { 0.0f, 30.0f, -90.0f, 0.0f }; -f32 D_i4_8019EE6C[] = { -100.0f, -200.0f, -300.0f, 0.0f }; +f32 sLevelCompleteCsActorInitPosX[] = { -200.0f, 200.0f, -50.0f, -2000.0f }; +f32 sLevelCompleteCsActorInitPosY[] = { 0.0f, 30.0f, -90.0f, 0.0f }; +f32 sLevelCompleteCsActorInitPosZ[] = { -100.0f, -200.0f, -300.0f, 0.0f }; -void Fortuna_801890EC(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i4_8019EE4C[arg1] + gPlayer[0].pos.x; - actor->obj.pos.y = D_i4_8019EE5C[arg1] + gPlayer[0].pos.y; - actor->obj.pos.z = D_i4_8019EE6C[arg1] + gPlayer[0].trueZpos; - actor->vel.z = gPlayer[0].baseSpeed; +void Fortuna_LevelCompleteCsSpawnTeam(ActorCutscene* this, s32 actorIdx) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; - Object_SetInfo(&actor->info, actor->obj.id); + this->obj.pos.x = sLevelCompleteCsActorInitPosX[actorIdx] + gPlayer[0].pos.x; + this->obj.pos.y = sLevelCompleteCsActorInitPosY[actorIdx] + gPlayer[0].pos.y; + this->obj.pos.z = sLevelCompleteCsActorInitPosZ[actorIdx] + gPlayer[0].trueZpos; - if (arg1 < 3) { - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->vel.z = gPlayer[0].baseSpeed; + + Object_SetInfo(&this->info, this->obj.id); + + if (actorIdx < 3) { + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } else { - actor->obj.pos.z = -9500.0f; - actor->animFrame = 1; - actor->vel.z = 22.0f; - - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); + this->obj.pos.z = -9500.0f; + this->animFrame = 1; + this->vel.z = 22.0f; + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, this->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, this->sfxSource, 0); } } @@ -627,10 +647,10 @@ void Fortuna_LevelComplete(Player* player) { s32 i; Vec3f src; Vec3f dest; - Actor* actor0 = &gActors[0]; - Actor* actor1 = &gActors[1]; - Actor* actor2 = &gActors[2]; - Actor* actor3 = &gActors[3]; + ActorCutscene* greatFox = &gActors[0]; + ActorCutscene* slippy = &gActors[1]; + ActorCutscene* peppy = &gActors[2]; + ActorCutscene* falco = &gActors[3]; s32 pad[3]; if ((player->csState < 10) && (player->csState >= 0)) { @@ -638,6 +658,7 @@ void Fortuna_LevelComplete(Player* player) { Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 20.0f, 0.0f); + if (gMissionStatus == MISSION_COMPLETE) { if (player->pos.y < 700.0f) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); @@ -645,7 +666,8 @@ void Fortuna_LevelComplete(Player* player) { } else if (player->pos.y < 500.0f) { Math_SmoothStepToF(&player->pos.y, 500.0f, 0.1f, 5.0f, 0.0f); } - Camera_Update360(player, 0); + + Camera_Update360(player, false); player->cam.eye.x += player->vel.x * 0.1f; player->cam.eye.y += player->vel.y * 0.1f; player->cam.eye.z += player->vel.z * 0.1f; @@ -728,6 +750,7 @@ void Fortuna_LevelComplete(Player* player) { Math_SmoothStepToF(&player->rot.x, 15.0f, 0.1f, 0.4f, 0.0f); Math_SmoothStepToF(&player->rot.z, -40.0f, 0.2f, 5.0f, 0.0f); Math_SmoothStepToF(&player->rot.y, -120.0f, 0.1f, 2.0f, 0.0f); + player->baseSpeed += 1.0f; if (player->baseSpeed >= 70.0f) { player->baseSpeed = 70.0f; @@ -736,6 +759,7 @@ void Fortuna_LevelComplete(Player* player) { player->contrailScale = 0.6f; } } + if (player->csTimer == 0) { player->csState = 2; player->csTimer = 1000; @@ -804,7 +828,7 @@ void Fortuna_LevelComplete(Player* player) { player->baseSpeed = 0.0f; player->yRot_114 = 0.0f; player->rot.y = 180.0f; - Fortuna_8018906C(); + Fortuna_CsExplosion(); } else { player->pos.x = 0.0f; player->rot.x = 0.0f; @@ -821,9 +845,11 @@ void Fortuna_LevelComplete(Player* player) { player->wingPosition = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 100); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 100); + Audio_StartPlayerNoise(0); + if (gMissionStatus == MISSION_COMPLETE) { - Fortuna_801890EC(actor0, 3); + Fortuna_LevelCompleteCsSpawnTeam(greatFox, 3); } } break; @@ -835,20 +861,20 @@ void Fortuna_LevelComplete(Player* player) { player->cam.eye.x = 400.0f; player->cam.eye.y = 0; player->cam.eye.z = 0.0f; - player->cam.at.x = actor0->obj.pos.x; - player->cam.at.y = actor0->obj.pos.y; - player->cam.at.z = actor0->obj.pos.z; + player->cam.at.x = greatFox->obj.pos.x; + player->cam.at.y = greatFox->obj.pos.y; + player->cam.at.z = greatFox->obj.pos.z; if (gCsFrameCount == 100) { player->baseSpeed = 30.0f; if (gTeamShields[TEAM_ID_FALCO] > 0) { - Fortuna_801890EC(actor3, 0); + Fortuna_LevelCompleteCsSpawnTeam(falco, 0); } if (gTeamShields[TEAM_ID_SLIPPY] > 0) { - Fortuna_801890EC(actor1, 1); + Fortuna_LevelCompleteCsSpawnTeam(slippy, 1); } if (gTeamShields[TEAM_ID_PEPPY] > 0) { - Fortuna_801890EC(actor2, 2); + Fortuna_LevelCompleteCsSpawnTeam(peppy, 2); } } @@ -858,9 +884,9 @@ void Fortuna_LevelComplete(Player* player) { D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = -400.0f; D_ctx_80177A48[3] = 0.0f; - actor3->iwork[14] = 2; - actor1->iwork[14] = 3; - actor2->iwork[14] = 4; + falco->iwork[14] = 2; + slippy->iwork[14] = 3; + peppy->iwork[14] = 4; } if (gCsFrameCount == 200) { @@ -903,10 +929,10 @@ void Fortuna_LevelComplete(Player* player) { Math_SmoothStepToF(&player->baseSpeed, 0.0f, 0.05f, 2.0f, 0); - Math_SmoothStepToF(&actor3->vel.z, 0.0f, 0.05f, 2.0f, 0); - Math_SmoothStepToF(&actor1->vel.z, 0.0f, 0.05f, 2.0f, 0); - Math_SmoothStepToF(&actor2->vel.z, 0.0f, 0.05f, 2.0f, 0); - Math_SmoothStepToF(&actor0->vel.z, 0.0f, 0.05f, 2.0f, 0); + Math_SmoothStepToF(&falco->vel.z, 0.0f, 0.05f, 2.0f, 0); + Math_SmoothStepToF(&slippy->vel.z, 0.0f, 0.05f, 2.0f, 0); + Math_SmoothStepToF(&peppy->vel.z, 0.0f, 0.05f, 2.0f, 0); + Math_SmoothStepToF(&greatFox->vel.z, 0.0f, 0.05f, 2.0f, 0); if (gCsFrameCount == 500) { Radio_PlayMessage(gMsg_ID_20010, RCID_FOX); @@ -1012,8 +1038,8 @@ void Fortuna_LevelComplete(Player* player) { player->csState = 12; player->csTimer = 1000; D_ctx_80177A48[4] = 1.0f; - actor2->vel.y = 0.1f; - actor1->vel.y = 0.1f; + peppy->vel.y = 0.1f; + slippy->vel.y = 0.1f; AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, player->sfxSource, 0); player->unk_194 = 5.0f; player->unk_190 = 5.0f; @@ -1034,56 +1060,56 @@ void Fortuna_LevelComplete(Player* player) { if (gTeamShields[TEAM_ID_FALCO] > 0) { if (player->csTimer == 980) { - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor3->sfxSource, 0); - actor3->vel.y = 1.0f; - actor3->fwork[29] = 5.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, falco->sfxSource, 0); + falco->vel.y = 1.0f; + falco->fwork[29] = 5.0f; } if (player->csTimer < 980) { - actor3->vel.z += 1.0f; - actor3->vel.z *= 1.15f; - actor3->vel.y *= 1.19f; - actor3->iwork[11] = 2; + falco->vel.z += 1.0f; + falco->vel.z *= 1.15f; + falco->vel.y *= 1.19f; + falco->iwork[11] = 2; } } if ((gTeamShields[TEAM_ID_PEPPY] > 0) && (player->csTimer == 960)) { - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor2->sfxSource, 0); - actor2->vel.y = 1.0f; - actor2->fwork[29] = 5.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, peppy->sfxSource, 0); + peppy->vel.y = 1.0f; + peppy->fwork[29] = 5.0f; } if (player->csTimer < 960) { - actor2->vel.z += 1.0f; - actor2->vel.z *= 1.15f; - actor2->vel.y *= 1.19f; - actor2->iwork[11] = 2; + peppy->vel.z += 1.0f; + peppy->vel.z *= 1.15f; + peppy->vel.y *= 1.19f; + peppy->iwork[11] = 2; } if (gTeamShields[TEAM_ID_SLIPPY] > 0) { if (player->csTimer == 940) { - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor1->sfxSource, 0); - actor1->vel.y = 1.0f; - actor1->fwork[29] = 5.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, slippy->sfxSource, 0); + slippy->vel.y = 1.0f; + slippy->fwork[29] = 5.0f; } if (player->csTimer < 940) { - actor1->vel.z += 1.0f; - actor1->vel.z *= 1.15f; - actor1->vel.y *= 1.19f; - actor1->iwork[11] = 2; + slippy->vel.z += 1.0f; + slippy->vel.z *= 1.15f; + slippy->vel.y *= 1.19f; + slippy->iwork[11] = 2; } } if (player->csTimer == 910) { - actor0->vel.y = 1.0f; - actor0->obj.rot.x = -2.0f; + greatFox->vel.y = 1.0f; + greatFox->obj.rot.x = -2.0f; } if (player->csTimer < 910) { - actor0->vel.z += 1.0f; - actor0->vel.z *= 1.02f; - actor0->vel.y *= 1.06f; - actor0->obj.rot.x *= 1.03f; + greatFox->vel.z += 1.0f; + greatFox->vel.z *= 1.02f; + greatFox->vel.y *= 1.06f; + greatFox->obj.rot.x *= 1.03f; } if (gCsFrameCount == 1382) { @@ -1100,30 +1126,30 @@ void Fortuna_LevelComplete(Player* player) { case 20: if (gTeamShields[TEAM_ID_FALCO] > 0) { - Fortuna_801890EC(actor3, 0); - actor3->obj.pos.x = (player->pos.x - 100.0f) - 400.0f; - actor3->obj.pos.y = player->pos.y + 400.0f; - actor3->obj.pos.z = player->trueZpos - 150.0f; - actor3->obj.rot.z = 90.0f; + Fortuna_LevelCompleteCsSpawnTeam(falco, 0); + falco->obj.pos.x = (player->pos.x - 100.0f) - 400.0f; + falco->obj.pos.y = player->pos.y + 400.0f; + falco->obj.pos.z = player->trueZpos - 150.0f; + falco->obj.rot.z = 90.0f; } if (gTeamShields[TEAM_ID_SLIPPY] > 0) { - Fortuna_801890EC(actor1, 1); - actor1->obj.pos.x = player->pos.x + 100.0f + 400.0f; - actor1->obj.pos.y = player->pos.y + 400.0f; - actor1->obj.pos.z = player->trueZpos - 150.0f; - actor1->obj.rot.z = -90.0f; + Fortuna_LevelCompleteCsSpawnTeam(slippy, 1); + slippy->obj.pos.x = player->pos.x + 100.0f + 400.0f; + slippy->obj.pos.y = player->pos.y + 400.0f; + slippy->obj.pos.z = player->trueZpos - 150.0f; + slippy->obj.rot.z = -90.0f; } if (gTeamShields[TEAM_ID_PEPPY] > 0) { - Fortuna_801890EC(actor2, 2); - actor2->obj.pos.x = player->pos.x; - actor2->obj.pos.y = player->pos.y + 100.0f + 400.0f; - actor2->obj.pos.z = player->trueZpos - 250.0f; + Fortuna_LevelCompleteCsSpawnTeam(peppy, 2); + peppy->obj.pos.x = player->pos.x; + peppy->obj.pos.y = player->pos.y + 100.0f + 400.0f; + peppy->obj.pos.z = player->trueZpos - 250.0f; } - Fortuna_801890EC(actor0, 3); + Fortuna_LevelCompleteCsSpawnTeam(greatFox, 3); - actor0->obj.pos.z = player->pos.z + 400.0f; - actor0->vel.z = 0.0f; - actor0->info.bonus = 1; + greatFox->obj.pos.z = player->pos.z + 400.0f; + greatFox->vel.z = 0.0f; + greatFox->info.bonus = 1; gCsFrameCount = 0; player->csState = 21; player->draw = true; @@ -1149,23 +1175,23 @@ void Fortuna_LevelComplete(Player* player) { if (gCsFrameCount == 140) { player->baseSpeed = 30.0f; - actor3->vel.z = 30.0f; - actor1->vel.z = 30.0f; - actor2->vel.z = 30.0f; - actor0->vel.z = 30.0f; + falco->vel.z = 30.0f; + slippy->vel.z = 30.0f; + peppy->vel.z = 30.0f; + greatFox->vel.z = 30.0f; } if (gCsFrameCount > 140) { - Math_SmoothStepToF(&actor3->obj.rot.z, 0.0f, 0.03f, 1.2f, 0.0001f); - Math_SmoothStepToF(&actor3->obj.pos.x, -100.0f, 0.03f, 1000.0f, 0.0001f); - Math_SmoothStepToF(&actor3->obj.pos.y, 40.0f, 0.03f, 1000.0f, 0.0001f); + Math_SmoothStepToF(&falco->obj.rot.z, 0.0f, 0.03f, 1.2f, 0.0001f); + Math_SmoothStepToF(&falco->obj.pos.x, -100.0f, 0.03f, 1000.0f, 0.0001f); + Math_SmoothStepToF(&falco->obj.pos.y, 40.0f, 0.03f, 1000.0f, 0.0001f); } if (gCsFrameCount > 180) { - Math_SmoothStepToF(&actor1->obj.rot.z, 0.0f, 0.03f, 1.2f, 0.0001f); - Math_SmoothStepToF(&actor1->obj.pos.x, 100.0f, 0.03f, 1000.0f, 0.0001f); - Math_SmoothStepToF(&actor1->obj.pos.y, 40.0f, 0.03f, 1000.0f, 0.0001f); + Math_SmoothStepToF(&slippy->obj.rot.z, 0.0f, 0.03f, 1.2f, 0.0001f); + Math_SmoothStepToF(&slippy->obj.pos.x, 100.0f, 0.03f, 1000.0f, 0.0001f); + Math_SmoothStepToF(&slippy->obj.pos.y, 40.0f, 0.03f, 1000.0f, 0.0001f); } if (gCsFrameCount > 220) { - Math_SmoothStepToF(&actor2->obj.pos.y, 90.0f, 0.03f, 1000.0f, 0.0001f); + Math_SmoothStepToF(&peppy->obj.pos.y, 90.0f, 0.03f, 1000.0f, 0.0001f); } if (gCsFrameCount > 340) { Math_SmoothStepToF(&player->pos.y, -10.0f, 0.03f, 1000.0f, 0.0001f); @@ -1173,13 +1199,13 @@ void Fortuna_LevelComplete(Player* player) { if (gCsFrameCount > 530) { Radio_PlayMessage(gMsg_ID_20010, RCID_FOX); player->pos.y = -10.0f; - actor3->obj.rot.z = 0.0f; - actor3->obj.pos.x = -100.0f; - actor3->obj.pos.y = 40.0f; - actor1->obj.rot.z = 0.0f; - actor1->obj.pos.x = 100.0f; - actor1->obj.pos.y = 40.0f; - actor2->obj.pos.y = 90.0f; + falco->obj.rot.z = 0.0f; + falco->obj.pos.x = -100.0f; + falco->obj.pos.y = 40.0f; + slippy->obj.rot.z = 0.0f; + slippy->obj.pos.x = 100.0f; + slippy->obj.pos.y = 40.0f; + peppy->obj.pos.y = 90.0f; player->csState = 22; } @@ -1209,17 +1235,17 @@ void Fortuna_LevelComplete(Player* player) { case 22: if ((gCsFrameCount >= 1110) && (gCsFrameCount < 1240)) { Math_SmoothStepToF(&player->baseSpeed, 0.0f, 0.02f, 1000.0f, 0.001f); - Math_SmoothStepToF(&actor3->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); - Math_SmoothStepToF(&actor1->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); - Math_SmoothStepToF(&actor2->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); - Math_SmoothStepToF(&actor0->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); + Math_SmoothStepToF(&falco->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); + Math_SmoothStepToF(&slippy->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); + Math_SmoothStepToF(&peppy->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); + Math_SmoothStepToF(&greatFox->vel.z, 0.0f, 0.02f, 1000.0f, 0.001f); } if (gCsFrameCount == 1239) { player->baseSpeed = 0.0f; - actor3->vel.z = 0.0f; - actor1->vel.z = 0.0f; - actor2->vel.z = 0.0f; - actor0->vel.z = 0.0f; + falco->vel.z = 0.0f; + slippy->vel.z = 0.0f; + peppy->vel.z = 0.0f; + greatFox->vel.z = 0.0f; } switch (gCsFrameCount) { @@ -1271,25 +1297,25 @@ void Fortuna_LevelComplete(Player* player) { case 1240: if (gTeamShields[TEAM_ID_FALCO] > 0) { - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor3->sfxSource, 0); - actor3->fwork[29] = 5.0f; - actor3->iwork[11] = 2; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, falco->sfxSource, 0); + falco->fwork[29] = 5.0f; + falco->iwork[11] = 2; } break; case 1260: if (gTeamShields[TEAM_ID_SLIPPY] > 0) { - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor1->sfxSource, 0); - actor1->fwork[29] = 5.0f; - actor1->iwork[11] = 2; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, slippy->sfxSource, 0); + slippy->fwork[29] = 5.0f; + slippy->iwork[11] = 2; } break; case 1280: if (gTeamShields[TEAM_ID_PEPPY] > 0) { - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor2->sfxSource, 0); - actor2->fwork[29] = 5.0f; - actor2->iwork[11] = 2; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, peppy->sfxSource, 0); + peppy->fwork[29] = 5.0f; + peppy->iwork[11] = 2; } gShowLevelClearStatusScreen = 0; break; @@ -1376,17 +1402,17 @@ void Fortuna_LevelComplete(Player* player) { } if (gCsFrameCount >= 1240) { - Math_SmoothStepToF(&actor3->vel.z, 50.0f, 0.1f, 1000.0f, 0.001f); + Math_SmoothStepToF(&falco->vel.z, 50.0f, 0.1f, 1000.0f, 0.001f); } if (gCsFrameCount >= 1260) { - Math_SmoothStepToF(&actor1->vel.z, 50.0f, 0.1f, 1000.0f, 0.001f); + Math_SmoothStepToF(&slippy->vel.z, 50.0f, 0.1f, 1000.0f, 0.001f); } if (gCsFrameCount >= 1280) { - Math_SmoothStepToF(&actor2->vel.z, 50.0f, 0.1f, 1000.0f, 0.001f); + Math_SmoothStepToF(&peppy->vel.z, 50.0f, 0.1f, 1000.0f, 0.001f); } if (gCsFrameCount >= 1300) { Math_SmoothStepToF(&player->baseSpeed, 50.0f, 0.1f, 1000.0f, 0.001f); - Math_SmoothStepToF(&actor0->vel.z, 40.0f, 0.1f, 1000.0f, 0.001f); + Math_SmoothStepToF(&greatFox->vel.z, 40.0f, 0.1f, 1000.0f, 0.001f); } Math_SmoothStepToF(&gCsCamAtY, player->pos.y, 0.005f, 1000.0f, 0.0001f); @@ -1426,12 +1452,12 @@ void Fortuna_LevelComplete(Player* player) { player->bankAngle = player->rot.z + player->zRotBank + player->zRotBarrelRoll; } -void Fortuna_8018BA2C(void) { +void Fortuna_LoadLevelObjects(void) { s32 i; Actor* actor; Sprite* sprite; Scenery360* scenery360; - Boss* boss = &gBosses[0]; + BossFO* boss = &gBosses[0]; gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[gCurrentLevel]); @@ -1483,6 +1509,7 @@ void Fortuna_8018BA2C(void) { sprite++; } } + Boss_Initialize(boss); boss->obj.status = OBJ_INIT; boss->obj.pos.x = 0.0f; diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index 39a46533..c2864824 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -18,40 +18,40 @@ u8 D_i4_8019F198[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; s32 sEnemySpawnTargets[] = { -1, - AI360_10 + 1, + AI360_ENEMY + 1, -1, - AI360_10 + 3, + AI360_ENEMY + 3, -1, - AI360_10 + 5, + AI360_ENEMY + 5, -1, - AI360_10 + 7, + AI360_ENEMY + 7, -1, - AI360_10 + 9, - AI360_10, - AI360_10 + 1, - AI360_10 + 2, - AI360_10 + 3, - AI360_10 + 4, - AI360_10 + 5, - AI360_10 + 6, - AI360_10 + 7, - AI360_10 + 8, - AI360_10 + 9, - AI360_10, - AI360_10 + 1, - AI360_10 + 2, - AI360_10 + 3, - AI360_10 + 4, - AI360_10 + 5, - AI360_10 + 6, - AI360_10 + 7, - AI360_10 + 8, - AI360_10 + 9, - AI360_10, - AI360_10 + 1, - AI360_10 + 2, - AI360_10 + 3, - AI360_10 + 4, + AI360_ENEMY + 9, + AI360_ENEMY, + AI360_ENEMY + 1, + AI360_ENEMY + 2, + AI360_ENEMY + 3, + AI360_ENEMY + 4, + AI360_ENEMY + 5, + AI360_ENEMY + 6, + AI360_ENEMY + 7, + AI360_ENEMY + 8, + AI360_ENEMY + 9, + AI360_ENEMY, + AI360_ENEMY + 1, + AI360_ENEMY + 2, + AI360_ENEMY + 3, + AI360_ENEMY + 4, + AI360_ENEMY + 5, + AI360_ENEMY + 6, + AI360_ENEMY + 7, + AI360_ENEMY + 8, + AI360_ENEMY + 9, + AI360_ENEMY, + AI360_ENEMY + 1, + AI360_ENEMY + 2, + AI360_ENEMY + 3, + AI360_ENEMY + 4, AI360_SLIPPY, AI360_SLIPPY, 4, @@ -495,7 +495,7 @@ void Katina_LevelStart(Player* player) { func_effect_800794CC(gActors[5].obj.pos.x, gActors[5].obj.pos.y, gActors[5].obj.pos.z, 1.0f); } - func_effect_8007A6F0(&gActors[5].obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&gActors[5].obj.pos, NA_SE_EN_EXPLOSION_M); break; case 47: @@ -569,7 +569,7 @@ void Katina_BaseUpdate(Frontlinebase* this) { } // Kill all active enemy and ally actors - for (actor = &gActors[AI360_10], i = 10; i < ARRAY_COUNT(gActors); i++, actor++) { + for (actor = &gActors[AI360_ENEMY], i = 10; i < ARRAY_COUNT(gActors); i++, actor++) { if (actor->obj.status == OBJ_ACTIVE) { actor->obj.status = OBJ_DYING; actor->timer_0BC = 30; @@ -638,7 +638,7 @@ void Katina_Hatch_Destroy(Saucerer* this, s32 hatchIdx) { pos.y = this->obj.pos.y + (this->vwork[hatchIdx + 1].y * 1.3f); pos.z = this->obj.pos.z + (this->vwork[hatchIdx + 1].z * 1.3f); - func_effect_8007A6F0(&pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&pos, NA_SE_EN_EXPLOSION_M); this->swork[BOSS_HATCH_DESTROY_COUNT]++; @@ -676,7 +676,7 @@ void Katina_BossHandleDamage(Saucerer* this) { sfxSource.y = (this->vwork[1 + this->dmgPart].y * 1.3f) + this->obj.pos.y; sfxSource.z = (this->vwork[1 + this->dmgPart].z * 1.3f) + this->obj.pos.z; - func_effect_8007A6F0(&sfxSource, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&sfxSource, NA_SE_OB_DAMAGE_M); if (this->swork[10 + this->dmgPart] <= 0) { this->swork[10 + this->dmgPart] = 0; @@ -694,9 +694,9 @@ void Katina_BossHandleDamage(Saucerer* this) { this->swork[BOSS_CORE_HP] -= this->damage; if (this->swork[BOSS_CORE_HP] < 100) { - func_effect_8007A6F0(&this->obj.pos, NA_SE_EN_KNOCK_DOWN); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_KNOCK_DOWN); } else { - func_effect_8007A6F0(&this->obj.pos, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_DAMAGE_M); } if (this->swork[BOSS_CORE_HP] <= 0) { @@ -791,7 +791,7 @@ void Katina_BossSpawnEnemies(Saucerer* this, Vec3f* pos, f32 arg2) { actor->rot_0F4.y = arg2; actor->rot_0F4.x = -30.0f; - actor->aiType = i + AI360_10; + actor->aiType = i + AI360_ENEMY; actor->animFrame = D_i4_8019F198[i - 10]; actor->aiIndex = sEnemySpawnTargets[i - 10]; @@ -1045,7 +1045,7 @@ void Katina_BossUpdate(Saucerer* this) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(&gPlayer[0], 1); + Camera_Update360(&gPlayer[0], true); } gPlayer[0].unk_014 = 0.0f; @@ -2170,7 +2170,7 @@ void Katina_801981F8(Actor* this) { } // Spawn actors 10 to 20 as Cornerian Fighters, 20 to 29 as enemies. - for (i = 0, actor = &gActors[AI360_10]; i < 20; i++, actor++) { + for (i = 0, actor = &gActors[AI360_ENEMY]; i < 20; i++, actor++) { if (actor->obj.status == OBJ_FREE) { Actor_Initialize(actor); @@ -2189,7 +2189,7 @@ void Katina_801981F8(Actor* this) { actor->rot_0F4.y = this->counter_04E * 18.0f; actor->state = 1; - actor->aiType = i + AI360_10; + actor->aiType = i + AI360_ENEMY; actor->aiIndex = D_i4_8019F444[i]; actor->rot_0F4.x = 3.0f; actor->health = 24; @@ -2233,7 +2233,7 @@ void Katina_BillFighterInit(void) { actor->obj.pos.y = 1000.0f; actor->state = 1; actor->aiType = AI360_BILL; - actor->aiIndex = AI360_10 + 17; + actor->aiIndex = AI360_ENEMY + 17; actor->animFrame = 2; actor->health = 1000; actor->iwork[KA_ACTOR_IWORK_11] = 1; @@ -2425,7 +2425,7 @@ void Katina_EnemyUpdate(ActorAllRange* this) { if (this->aiIndex <= -1) { this->state = 3; } else { - if (this->aiType >= AI360_10) { + if (this->aiType >= AI360_ENEMY) { xPos = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; yPos = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 200.0f; zPos = SIN_DEG((this->index * 45) + gGameFrameCount) * 200.0f; diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index e1844221..5eb40225 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -7,59 +7,78 @@ #include "global.h" #include "assets/ast_sector_z.h" -s32 D_i4_801A0560; -s32 D_i4_801A0564; +#define MISSILE_TARGET_X (4) +#define MISSILE_TARGET_Y (5) +#define MISSILE_TARGET_Z (6) -Vec3f D_i4_8019F4C0[] = { +typedef enum SzActors { + /* 0 */ SZ_GREAT_FOX, + /* 10 */ SZ_MISSILE_CENTER = AI360_ENEMY, + /* 11 */ SZ_MISSILE_LEFT, + /* 12 */ SZ_MISSILE_RIGHT, + /* 13 */ SZ_ESCORT_1, + /* 14 */ SZ_ESCORT_2, + /* 15 */ SZ_ESCORT_3, + /* 16 */ SZ_ESCORT_4, +} SzActors; + +s32 sMissileDestroyCount; +bool sKattEnabled; + +Vec3f sMissileWaveInitPos[] = { { 0.0f, 0.0f, 35000.0f }, { -2000.0f, 0.0f, 35000.0f }, { 2000.0f, 0.0f, 35000.0f }, }; -Vec3f D_i4_8019F4E4[] = { + +// Relative to the missile +Vec3f sMissileEscortOffsetPos[] = { { -700.0f, -200.0f, 200.0f }, { 500.0f, 200.0f, -300.0f }, { 300.0f, -300.0f, -200.0f }, { 200.0f, 400.0f, 500.0f }, }; -void SectorZ_80199900(Actor* actor, s32 arg1) { +void SectorZ_MissileExplode(ActorAllRange* this, bool shotDown) { s32 i; gScreenFlashTimer = 8; - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_MS_EXPLOSION_S); + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_EN_MS_EXPLOSION_S); for (i = 0; i < 20; i++) { - func_effect_800794CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); - func_effect_80079618(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); + func_effect_800794CC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); + func_effect_80079618(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); } - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 20.0f, 30); - func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 20.0f, 5); + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 20.0f, 30); + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 20.0f, 5); - if (arg1 != 0) { - D_i4_801A0560++; - if ((D_i4_801A0560 >= 6) && + if (shotDown) { + sMissileDestroyCount++; + if ((sMissileDestroyCount >= 6) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gCsFrameCount = 0; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 1000; - gActors[0].state = 6; + gActors[SZ_GREAT_FOX].state = 6; gPlayer[0].csTimer = 30; - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, gActors[0].sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, gActors[0].sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, gActors[SZ_GREAT_FOX].sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, gActors[SZ_GREAT_FOX].sfxSource, 0); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); } - if ((D_i4_801A0560 == 3) && (gLeveLClearStatus[LEVEL_ZONESS] != 0)) { + // Check for Katt's appearance + if ((sMissileDestroyCount == 3) && (gLeveLClearStatus[LEVEL_ZONESS] != 0)) { gAllRangeSpawnEvent = gAllRangeEventTimer + 110; } } } -void SectorZ_80199B18(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale) { +void SectorZ_FireSmokeEffectSetup(EffectFireSmoke* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, + f32 scale) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; effect->obj.id = OBJ_EFFECT_FIRE_SMOKE; @@ -84,23 +103,24 @@ void SectorZ_80199B18(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f3 effect->unk_46 = 2; } -void SectorZ_80199BDC(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale) { +void SectorZ_FireSmokeEffectSpawn(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 scale) { s32 i; for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { if (gEffects[i].obj.status == 0) { - SectorZ_80199B18(&gEffects[i], xPos, yPos, zPos, xVel, yVel, zVel, scale); + SectorZ_FireSmokeEffectSetup(&gEffects[i], xPos, yPos, zPos, xVel, yVel, zVel, scale); break; } } } -void SectorZ_Missile_Update(Actor* this) { - f32 sp2C; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; +void SectorZ_Missile_Update(ActorAllRange* this) { + // clang-format off + f32 x; + f32 y; + f32 z; + f32 xPitch; + f32 yPitch; this->iwork[9]++; @@ -120,132 +140,141 @@ void SectorZ_Missile_Update(Actor* this) { break; } - sp2C = gBosses[0].obj.pos.x - this->obj.pos.x; - - if (0) {} //! FAKE - - sp24 = gBosses[0].obj.pos.z - this->obj.pos.z; - - SIN_DEG(gGameFrameCount); // Leftover from a test or commented out code? - - if (sp2C) {} //! FAKE - if (sp24) {} //! FAKE + /* Leftover from a test or commented out code? */ + /* =========================================== */ + x = gBosses[SZ_GREAT_FOX].obj.pos.x - this->obj.pos.x; + y = gBosses[SZ_GREAT_FOX].obj.pos.y - this->obj.pos.y; // Optimized out? + z = gBosses[SZ_GREAT_FOX].obj.pos.z - this->obj.pos.z; + SIN_DEG(gGameFrameCount); + if (x && z) {} //! FAKE + /* =========================================== */ if (this->aiType < 100) { - if (sp24) {} //! FAKE - sp2C = fabsf(this->fwork[4] - this->obj.pos.x); //! FAKE - sp20 = SIN_DEG((this->index * 45) + gGameFrameCount) * 5000.0f; - sp1C = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 5000.0f; + if (x && z) {} //! FAKE + z = fabsf(this->fwork[6] - this->obj.pos.z); //! FAKE + + // Escorts wooble movement + xPitch = SIN_DEG((this->index * 45) + gGameFrameCount) * 5000.0f; + yPitch = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 5000.0f; } else { - sp20 = sp1C = 0.0f; + // For missile + xPitch = yPitch = 0.0f; } - this->fwork[4] = gBosses->obj.pos.x + sp20 + 400.0f; - this->fwork[5] = gBosses->obj.pos.y + sp1C + 100.0f; - this->fwork[6] = gBosses->obj.pos.z; + this->fwork[MISSILE_TARGET_X] = gBosses[SZ_GREAT_FOX].obj.pos.x + xPitch + 400.0f; + this->fwork[MISSILE_TARGET_Y] = gBosses[SZ_GREAT_FOX].obj.pos.y + yPitch + 100.0f; + this->fwork[MISSILE_TARGET_Z] = gBosses[SZ_GREAT_FOX].obj.pos.z; + this->fwork[3] = 1.4f; - if (((fabsf(this->fwork[4] - this->obj.pos.x) < 800.0f) && (fabsf(this->fwork[5] - this->obj.pos.y) < 800.0f)) && - (fabsf(this->fwork[6] - this->obj.pos.z) < 800.0f)) { - SectorZ_80199900(this, 0); + // Missile hit check + if ((fabsf(this->fwork[MISSILE_TARGET_X] - this->obj.pos.x) < 800.0f) && + (fabsf(this->fwork[MISSILE_TARGET_Y] - this->obj.pos.y) < 800.0f) && + (fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 800.0f)) { + SectorZ_MissileExplode(this, false); gCameraShake = 25; - gBosses->dmgType = DMG_UNK_100; + gBosses[SZ_GREAT_FOX].dmgType = DMG_MISSILE; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 0; - gActors->state = -31072; + gActors[SZ_GREAT_FOX].state = -31072; return; } } - if (((fabsf(this->fwork[6] - this->obj.pos.z) < 2000.0f) && + // Level complete trigger check + if (((fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 2000.0f) && (((gPlayer[0].cam.eye.z < 0.0f) || (D_edisplay_801615D0.y < 0.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR))) && (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 100; - gActors->state = -31072; + gActors[SZ_GREAT_FOX].state = -31072; } + // clang-format on } -void SectorZ_80199FCC(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_ALLRANGE; - actor->aiType = AI360_MISSILE; +void SectorZ_SpawnMissile(ActorAllRange* this, s32 missileWaveIdx) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_ALLRANGE; + this->aiType = AI360_MISSILE; - actor->obj.pos.x = D_i4_8019F4C0[arg1].x; - actor->obj.pos.y = D_i4_8019F4C0[arg1].y; - actor->obj.pos.z = D_i4_8019F4C0[arg1].z; + this->obj.pos.x = sMissileWaveInitPos[missileWaveIdx].x; + this->obj.pos.y = sMissileWaveInitPos[missileWaveIdx].y; + this->obj.pos.z = sMissileWaveInitPos[missileWaveIdx].z; - actor->state = 5; - actor->rot_0F4.y = 180.0f; + this->state = 5; + this->rot_0F4.y = 180.0f; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); - actor->health = 250; - actor->info.drawType = 2; - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SZ_6009230); - actor->fwork[1] = 25.0f; - actor->fwork[29] = 2.0f; + this->health = 250; + this->info.drawType = 2; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(aSZMissileHitbox); + this->fwork[1] = 25.0f; + this->fwork[29] = 2.0f; - AUDIO_PLAY_SFX(NA_SE_EN_PUNCH_ENGINE, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_PUNCH_ENGINE, this->sfxSource, 4); } -void SectorZ_8019A0F8(Actor* actor, s32 arg1) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_ALLRANGE; - actor->aiType = arg1 + AI360_10 + 3; +// Enemies that follow the missile +void SectorZ_SpawnMissileEscort(ActorAllRange* this, s32 enemyIndex) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_ALLRANGE; + this->aiType = enemyIndex + AI360_ENEMY + 3; - actor->obj.pos.x = gActors[10].obj.pos.x + D_i4_8019F4E4[arg1].x; - actor->obj.pos.y = gActors[10].obj.pos.y + D_i4_8019F4E4[arg1].y; - actor->obj.pos.z = gActors[10].obj.pos.z + D_i4_8019F4E4[arg1].z; + this->obj.pos.x = gActors[SZ_MISSILE_CENTER].obj.pos.x + sMissileEscortOffsetPos[enemyIndex].x; + this->obj.pos.y = gActors[SZ_MISSILE_CENTER].obj.pos.y + sMissileEscortOffsetPos[enemyIndex].y; + this->obj.pos.z = gActors[SZ_MISSILE_CENTER].obj.pos.z + sMissileEscortOffsetPos[enemyIndex].z; - actor->state = 5; - actor->rot_0F4.y = 180.0f; + this->state = 5; + this->rot_0F4.y = 180.0f; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); - actor->fwork[1] = gActors[10].fwork[1]; - actor->iwork[11] = 1; + this->fwork[1] = gActors[SZ_MISSILE_CENTER].fwork[1]; + this->iwork[11] = 1; } -void SectorZ_8019A1D0(void) { - Actor* actor = &gActors[8]; +void SectorZ_Katt_Init(void) { + ActorAllRange* katt = &gActors[AI360_KATT]; - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_ALLRANGE; + Actor_Initialize(katt); + katt->obj.status = OBJ_ACTIVE; + katt->obj.id = OBJ_ACTOR_ALLRANGE; - actor->obj.pos.x = 0.0f; - actor->obj.pos.y = 4500.0f; - actor->obj.pos.z = 30000.0f; + katt->obj.pos.x = 0.0f; + katt->obj.pos.y = 4500.0f; + katt->obj.pos.z = 30000.0f; - actor->aiType = AI360_KATT; - actor->aiIndex = AI360_10 + 2; - actor->health = 10000; - actor->rot_0F4.y = 180.0f; - actor->state = 0; - actor->timer_0BC = 250; - actor->rot_0F4.x = -20.0f; - actor->iwork[11] = 1; - actor->obj.rot.z = 90.0f; + katt->aiType = AI360_KATT; + katt->aiIndex = AI360_ENEMY + 2; + katt->health = 10000; + katt->rot_0F4.y = 180.0f; + katt->state = 0; + katt->timer_0BC = 250; + katt->rot_0F4.x = -20.0f; + katt->iwork[11] = 1; + katt->obj.rot.z = 90.0f; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&katt->info, katt->obj.id); - actor->info.targetOffset = 0.0f; + katt->info.targetOffset = 0.0f; - AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actor->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, katt->sfxSource, 4); } -void SectorZ_8019A2F4(Actor* actor) { +void SectorZ_KattCutscene(ActorCutscene* this) { if (gAllRangeEventTimer == gAllRangeSpawnEvent) { - SectorZ_8019A1D0(); + SectorZ_Katt_Init(); gCsFrameCount = 0; - actor->timer_0BC = 400; - actor->state = 3; + + this->timer_0BC = 400; + this->state = 3; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; Audio_PlayFanfare(NA_BGM_KATT, 20, 10, 10); @@ -258,26 +287,27 @@ void SectorZ_8019A2F4(Actor* actor) { gPlayer[0].cam.at.x = gActors[8].obj.pos.x; gPlayer[0].cam.at.y = gActors[8].obj.pos.y; gPlayer[0].cam.at.z = gActors[8].obj.pos.z; - D_i4_801A0564 = 1; + + sKattEnabled = true; } } -void SectorZ_8019A3E8(Actor* actor) { +void SectorZ_EnemyUpdate(ActorAllRange* this) { s32 i; - Vec3f sp40; - Vec3f sp34; - Actor* actorPtr; + Vec3f src; + Vec3f dest; + ActorAllRange* actor; if (gAllRangeEventTimer >= 0) { if (gTeamShields[AI360_FALCO] > 0) { if (gActors[AI360_FALCO].iwork[2] == AI360_FOX) { - if (gActors[AI360_10].obj.status == 2) { - if (gActors[1].aiIndex != AI360_10) { + if (gActors[AI360_ENEMY].obj.status == 2) { + if (gActors[AI360_FALCO].aiIndex != AI360_ENEMY) { Radio_PlayMessage(gMsg_ID_16040, RCID_FALCO); } - gActors[AI360_FALCO].aiIndex = AI360_10; + gActors[AI360_FALCO].aiIndex = AI360_ENEMY; } else { - gActors[AI360_FALCO].aiIndex = AI360_10 + 3; + gActors[AI360_FALCO].aiIndex = AI360_ENEMY + 3; } } else { gActors[AI360_FALCO].aiIndex = -1; @@ -286,37 +316,37 @@ void SectorZ_8019A3E8(Actor* actor) { if (gTeamShields[AI360_PEPPY] > 0) { if (gActors[AI360_PEPPY].iwork[2] == AI360_FOX) { - if (gActors[AI360_10 + 2].obj.status == 2) { - if (gActors[AI360_PEPPY].aiIndex != AI360_10 + 2) { + if (gActors[AI360_ENEMY + 2].obj.status == 2) { + if (gActors[AI360_PEPPY].aiIndex != AI360_ENEMY + 2) { Radio_PlayMessage(gMsg_ID_16046, RCID_PEPPY); } - gActors[AI360_PEPPY].aiIndex = AI360_10 + 2; + gActors[AI360_PEPPY].aiIndex = AI360_ENEMY + 2; } else { - gActors[AI360_PEPPY].aiIndex = AI360_10 + 5; + gActors[AI360_PEPPY].aiIndex = AI360_ENEMY + 5; } } else { gActors[AI360_PEPPY].aiIndex = -1; } } - if (D_i4_801A0564 != 0) { - if (gActors[11].obj.status == 2) { - if (gActors[8].aiIndex != AI360_10 + 1) { + if (sKattEnabled) { + if (gActors[SZ_MISSILE_LEFT].obj.status == 2) { + if (gActors[8].aiIndex != AI360_ENEMY + 1) { Radio_PlayMessage(gMsg_ID_16135, RCID_KATT); } - gActors[AI360_KATT].aiIndex = AI360_10 + 1; + gActors[AI360_KATT].aiIndex = AI360_ENEMY + 1; } else { gActors[AI360_KATT].aiIndex = -1; } } else if (gTeamShields[AI360_SLIPPY] > 0) { if (gActors[AI360_SLIPPY].iwork[2] == AI360_FOX) { - if (gActors[11].obj.status == 2) { - if (gActors[AI360_SLIPPY].aiIndex != AI360_10 + 1) { + if (gActors[SZ_MISSILE_LEFT].obj.status == 2) { + if (gActors[AI360_SLIPPY].aiIndex != AI360_ENEMY + 1) { Radio_PlayMessage(gMsg_ID_16047, RCID_SLIPPY); } - gActors[AI360_SLIPPY].aiIndex = AI360_10 + 1; + gActors[AI360_SLIPPY].aiIndex = AI360_ENEMY + 1; } else { - gActors[AI360_SLIPPY].aiIndex = AI360_10 + 4; + gActors[AI360_SLIPPY].aiIndex = AI360_ENEMY + 4; } } else { gActors[AI360_SLIPPY].aiIndex = -1; @@ -328,56 +358,60 @@ void SectorZ_8019A3E8(Actor* actor) { Radio_PlayMessage(gMsg_ID_16030, RCID_FALCO); } - if (((actor->timer_0C0 == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) && + if (((this->timer_0C0 == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) && ((gAllRangeEventTimer < 200) || ((gAllRangeEventTimer > 4000) && (gAllRangeEventTimer < 4200)))) { - actor->timer_0C0 = 5; - actorPtr = &gActors[13]; - sp40.x = 0.0f; - sp40.y = 0.0f; - sp40.z = -17000.0f; + this->timer_0C0 = 5; - for (i = 0; i < 20; i++, actorPtr++) { - if (actorPtr->obj.status == 0) { - Actor_Initialize(actorPtr); - actorPtr->obj.status = OBJ_ACTIVE; - actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; - Matrix_RotateY(gCalcMatrix, (actor->counter_04E * 18.0f) * M_DTOR, MTXF_NEW); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); + actor = &gActors[SZ_ESCORT_1]; - actorPtr->obj.pos.x = sp34.x; - actorPtr->obj.pos.y = RAND_FLOAT(1000.0f) + 300.0f; - actorPtr->obj.pos.z = sp34.z; + src.x = 0.0f; + src.y = 0.0f; + src.z = -17000.0f; - actorPtr->rot_0F4.y = actor->counter_04E * 18.0f; - actorPtr->state = 3; - actorPtr->aiType = i + AI360_10 + 3; - actorPtr->aiIndex = -1; + for (i = 0; i < 20; i++, actor++) { + if (actor->obj.status == 0) { + Actor_Initialize(actor); + + actor->obj.status = OBJ_ACTIVE; + actor->obj.id = OBJ_ACTOR_ALLRANGE; + + Matrix_RotateY(gCalcMatrix, (this->counter_04E * 18.0f) * M_DTOR, MTXF_NEW); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + + actor->obj.pos.x = dest.x; + actor->obj.pos.y = RAND_FLOAT(1000.0f) + 300.0f; + actor->obj.pos.z = dest.z; + + actor->rot_0F4.y = this->counter_04E * 18.0f; + actor->state = 3; + actor->aiType = i + AI360_ENEMY + 3; + actor->aiIndex = -1; if (gAllRangeEventTimer >= 0) { if (((i + 13) == 23) || ((i + 13) == 24)) { - actorPtr->aiIndex = AI360_SLIPPY; - actorPtr->state = 2; + actor->aiIndex = AI360_SLIPPY; + actor->state = 2; } if ((i + 13) == 25) { - actorPtr->aiIndex = AI360_FOX; - actorPtr->state = 2; + actor->aiIndex = AI360_FOX; + actor->state = 2; } if (((i + 13) == 26) || ((i + 13) == 27)) { - actorPtr->aiIndex = AI360_PEPPY; - actorPtr->state = 2; + actor->aiIndex = AI360_PEPPY; + actor->state = 2; } if ((i + 13) == 28) { - actorPtr->aiIndex = AI360_FALCO; - actorPtr->state = 2; + actor->aiIndex = AI360_FALCO; + actor->state = 2; } } - actorPtr->health = 24; - actorPtr->iwork[11] = 1; - actorPtr->itemDrop = DROP_SILVER_RING_50p; - actorPtr->timer_0C2 = 30; - Object_SetInfo(&actorPtr->info, actorPtr->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actorPtr->sfxSource, 4); - actor->counter_04E++; + actor->health = 24; + actor->iwork[11] = 1; + actor->itemDrop = DROP_SILVER_RING_50p; + actor->timer_0C2 = 30; + Object_SetInfo(&actor->info, actor->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actor->sfxSource, 4); + this->counter_04E++; break; } } @@ -389,9 +423,9 @@ void SectorZ_8019A3E8(Actor* actor) { break; case 6000: - SectorZ_80199FCC(&gActors[12], 2); - SectorZ_80199FCC(&gActors[11], 1); - SectorZ_80199FCC(&gActors[10], 0); + SectorZ_SpawnMissile(&gActors[SZ_MISSILE_RIGHT], 2); + SectorZ_SpawnMissile(&gActors[SZ_MISSILE_LEFT], 1); + SectorZ_SpawnMissile(&gActors[SZ_MISSILE_CENTER], 0); D_hud_80161710 = 580; break; @@ -400,88 +434,96 @@ void SectorZ_8019A3E8(Actor* actor) { break; case 4000: - SectorZ_80199FCC(&gActors[11], 1); - SectorZ_80199FCC(&gActors[10], 0); + SectorZ_SpawnMissile(&gActors[SZ_MISSILE_LEFT], 1); + SectorZ_SpawnMissile(&gActors[SZ_MISSILE_CENTER], 0); D_hud_80161710 = 580; break; case 2000: D_hud_80161710 = 490; - SectorZ_80199FCC(&gActors[10], 0); + SectorZ_SpawnMissile(&gActors[SZ_MISSILE_CENTER], 0); - gActors[10].fwork[1] = 10.0f; - gActors[10].obj.pos.z = 25000.0f; + gActors[SZ_MISSILE_CENTER].fwork[1] = 10.0f; + gActors[SZ_MISSILE_CENTER].obj.pos.z = 25000.0f; - SectorZ_8019A0F8(&gActors[13], 0); - SectorZ_8019A0F8(&gActors[14], 1); - SectorZ_8019A0F8(&gActors[15], 2); - SectorZ_8019A0F8(&gActors[16], 3); + SectorZ_SpawnMissileEscort(&gActors[SZ_ESCORT_1], 0); + SectorZ_SpawnMissileEscort(&gActors[SZ_ESCORT_2], 1); + SectorZ_SpawnMissileEscort(&gActors[SZ_ESCORT_3], 2); + SectorZ_SpawnMissileEscort(&gActors[SZ_ESCORT_4], 3); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; - actor->state = 10; - actor->fwork[10] = 0.0f; + + this->state = 10; + this->fwork[10] = 0.0f; + gPlayer[0].camRoll = 15.0f; - gPlayer[0].cam.eye.x = gActors[10].obj.pos.x - 25000.0f; - gPlayer[0].cam.eye.y = gActors[10].obj.pos.y; - gPlayer[0].cam.eye.z = gActors[10].obj.pos.z; + gPlayer[0].cam.eye.x = gActors[SZ_MISSILE_CENTER].obj.pos.x - 25000.0f; + gPlayer[0].cam.eye.y = gActors[SZ_MISSILE_CENTER].obj.pos.y; + gPlayer[0].cam.eye.z = gActors[SZ_MISSILE_CENTER].obj.pos.z; - gPlayer[0].cam.at.x = gActors[10].obj.pos.x; - gPlayer[0].cam.at.y = gActors[10].obj.pos.y; - gPlayer[0].cam.at.z = gActors[10].obj.pos.z; + gPlayer[0].cam.at.x = gActors[SZ_MISSILE_CENTER].obj.pos.x; + gPlayer[0].cam.at.y = gActors[SZ_MISSILE_CENTER].obj.pos.y; + gPlayer[0].cam.at.z = gActors[SZ_MISSILE_CENTER].obj.pos.z; - actor->timer_0BC = 10000; + this->timer_0BC = 10000; gFillScreenAlpha = gFillScreenAlphaTarget = 255; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; AUDIO_PLAY_BGM(NA_BGM_BOSS_SZ); break; } - ActorAllRange_UpdateEvemyEvents(actor); - SectorZ_8019A2F4(actor); + ActorAllRange_UpdateEnemyEvents(this); + SectorZ_KattCutscene(this); } -bool SectorZ_8019AA9C(Player* player) { +bool SectorZ_GFoxArwingRepair(Player* player) { + // clang-format off if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { - if ((player->yRot_114 > 30.0f) && (player->yRot_114 < 150.0f) && (fabsf(player->pos.x - 1270.0f) < 450.0f) && - (fabsf(player->pos.y - 265.0f) < 100.0f) && (fabsf(player->trueZpos) < 172.0f)) { + if ((player->yRot_114 > 30.0f) && + (player->yRot_114 < 150.0f) && + (fabsf(player->pos.x - 1270.0f) < 450.0f) && + (fabsf(player->pos.y - 265.0f) < 100.0f) && + (fabsf(player->trueZpos) < 172.0f)) { player->state_1C8 = PLAYERSTATE_1C8_GFOX_REPAIR; player->csState = 0; - gActors[0].state = 20; + gActors[SZ_GREAT_FOX].state = 20; gAllRangeEventTimer--; return true; } } return false; + // clang-format on } -void SectorZ_UpdateEvents(Actor* actor) { +void SectorZ_UpdateEvents(ActorAllRange* this) { s32 i; Player* player; - Actor* actor8; + ActorCutscene* katt; s32 pad; - f32 D_i4_8019F514[5] = { -200.0f, -100.0f, -0.0f, 100.0f, 200.0f }; + f32 D_i4_8019F514[5] = { -200.0f, -100.0f, -0.0f, 100.0f, 200.0f }; // unused player = &gPlayer[0]; - switch ((s32) actor->state) { + switch ((s32) this->state) { case 0: - D_i4_801A0564 = D_i4_801A0560 = 0; + sKattEnabled = sMissileDestroyCount = 0; gSzMissileR = 63.0f; gSzMissileG = 255.0f; gSzMissileB = 158.0f; gProjectFar = 30000.0f; gAllRangeEventTimer = 0; - actor->state = 2; + this->state = 2; if (gAllRangeCheckpoint != 0) { gHitCount = gSavedHitCount; } gAllRangeSpawnEvent = 1000000; case 2: - if (SectorZ_8019AA9C(player) == 0) { - SectorZ_8019A3E8(actor); - switch (actor->timer_0BE) { + if (!SectorZ_GFoxArwingRepair(player)) { + SectorZ_EnemyUpdate(this); + + switch (this->timer_0BE) { case 548: Radio_PlayMessage(gMsg_ID_16050, RCID_ROB64); break; @@ -505,21 +547,22 @@ void SectorZ_UpdateEvents(Actor* actor) { break; case 3: - actor8 = &gActors[8]; + katt = &gActors[AI360_KATT]; + gCsFrameCount++; if (gCsFrameCount == 3) { - func_effect_80078E50(actor8->obj.pos.x, actor8->obj.pos.y, actor8->obj.pos.z, 30.0f); + func_effect_80078E50(katt->obj.pos.x, katt->obj.pos.y, katt->obj.pos.z, 30.0f); } - player->cam.eye.x += actor8->vel.x * 0.23f; - player->cam.eye.y += actor8->vel.y * 0.23f; - player->cam.eye.z += actor8->vel.z * 0.23f; + player->cam.eye.x += katt->vel.x * 0.23f; + player->cam.eye.y += katt->vel.y * 0.23f; + player->cam.eye.z += katt->vel.z * 0.23f; - Math_SmoothStepToF(&player->cam.at.x, actor8->obj.pos.x, 1.0f, 20000.0f, 0); - Math_SmoothStepToF(&player->cam.at.y, actor8->obj.pos.y, 1.0f, 20000.0f, 0); - Math_SmoothStepToF(&player->cam.at.z, actor8->obj.pos.z, 1.0f, 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, katt->obj.pos.x, 1.0f, 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, katt->obj.pos.y, 1.0f, 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, katt->obj.pos.z, 1.0f, 20000.0f, 0); Math_SmoothStepToF(&player->camRoll, 0, 1.0f, 1000.0f, 0); - switch (actor->timer_0BC) { + switch (this->timer_0BC) { case 370: Radio_PlayMessage(gMsg_ID_16120, RCID_KATT); break; @@ -534,20 +577,20 @@ void SectorZ_UpdateEvents(Actor* actor) { break; case 260: - actor8->fwork[7] = 360.0f; - actor8->fwork[8] = 0.0f; + katt->fwork[7] = 360.0f; + katt->fwork[8] = 0.0f; break; case 230: - actor8->fwork[7] = 0.0f; - actor8->fwork[8] = 359.999f; + katt->fwork[7] = 0.0f; + katt->fwork[8] = 359.999f; break; } - if (actor->timer_0BC == 70) { - actor->state = 2; + if (this->timer_0BC == 70) { + this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; } break; @@ -568,59 +611,60 @@ void SectorZ_UpdateEvents(Actor* actor) { case 10: gFillScreenAlpha = gFillScreenAlphaTarget = 0; - switch (actor->timer_0BC) { + switch (this->timer_0BC) { case 9800: - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, gActors[10].sfxSource, 0); - gActors[10].fwork[29] = 12.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, gActors[SZ_MISSILE_CENTER].sfxSource, 0); + gActors[SZ_MISSILE_CENTER].fwork[29] = 12.0f; break; case 9780: - gActors[13].aiIndex = -1; - gActors[13].state = 3; + gActors[SZ_ESCORT_1].aiIndex = -1; + gActors[SZ_ESCORT_1].state = 3; break; case 9740: - gActors[14].aiIndex = -1; - gActors[14].state = 3; + gActors[SZ_ESCORT_2].aiIndex = -1; + gActors[SZ_ESCORT_2].state = 3; break; case 9730: - gActors[15].aiIndex = -1; - gActors[15].state = 3; + gActors[SZ_ESCORT_3].aiIndex = -1; + gActors[SZ_ESCORT_3].state = 3; break; case 9710: - gActors[16].aiIndex = -1; - gActors[16].state = 3; + gActors[SZ_ESCORT_4].aiIndex = -1; + gActors[SZ_ESCORT_4].state = 3; break; } - Math_SmoothStepToF(&player->cam.at.x, gActors[10].obj.pos.x, 0.2, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.y, gActors[10].obj.pos.y, 0.2, 500.0f, 0.0f); - Math_SmoothStepToF(&player->cam.at.z, gActors[10].obj.pos.z, 0.2, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gActors[SZ_MISSILE_CENTER].obj.pos.x, 0.2, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gActors[SZ_MISSILE_CENTER].obj.pos.y, 0.2, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gActors[SZ_MISSILE_CENTER].obj.pos.z, 0.2, 500.0f, 0.0f); - if (actor->timer_0BC < 9800) { - Math_SmoothStepToF(&gActors[10].fwork[1], 80.0f, 0.1, 10.0f, 0); - Math_SmoothStepToF(&gActors[10].fwork[29], 3.0f, 0.1, 1.0f, 0); + if (this->timer_0BC < 9800) { + Math_SmoothStepToF(&gActors[SZ_MISSILE_CENTER].fwork[1], 80.0f, 0.1, 10.0f, 0); + Math_SmoothStepToF(&gActors[SZ_MISSILE_CENTER].fwork[29], 3.0f, 0.1, 1.0f, 0); } else { - Math_SmoothStepToF(&actor->fwork[10], 700.0f, 1, 5.0f, 0.0f); - Math_SmoothStepToF(&player->cam.eye.x, gActors[10].obj.pos.x - 300.0f, 0.07f, actor->fwork[10], 0); - Math_SmoothStepToF(&player->cam.eye.y, gActors[10].obj.pos.y, 0.07f, actor->fwork[10], 0); - Math_SmoothStepToF(&player->cam.eye.z, gActors[10].obj.pos.z + 500.0f, 0.05f, 50.0f, 0); - Math_SmoothStepToF(&gActors[10].fwork[29], 2.0f, 0.1f, 1.0f, 0); + Math_SmoothStepToF(&this->fwork[10], 700.0f, 1, 5.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gActors[SZ_MISSILE_CENTER].obj.pos.x - 300.0f, 0.07f, + this->fwork[10], 0); + Math_SmoothStepToF(&player->cam.eye.y, gActors[SZ_MISSILE_CENTER].obj.pos.y, 0.07f, this->fwork[10], 0); + Math_SmoothStepToF(&player->cam.eye.z, gActors[SZ_MISSILE_CENTER].obj.pos.z + 500.0f, 0.05f, 50.0f, 0); + Math_SmoothStepToF(&gActors[SZ_MISSILE_CENTER].fwork[29], 2.0f, 0.1f, 1.0f, 0); } - if (actor->timer_0BC < 9680) { - actor->state = 2; + if (this->timer_0BC < 9680) { + this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; - gActors[10].fwork[1] = 25.0f; - gActors[10].fwork[29] = 5.0f; - gActors[10].obj.pos.z = 35000.0f; - gActors[10].iwork[9] = 0; + gActors[SZ_MISSILE_CENTER].fwork[1] = 25.0f; + gActors[SZ_MISSILE_CENTER].fwork[29] = 5.0f; + gActors[SZ_MISSILE_CENTER].obj.pos.z = 35000.0f; + gActors[SZ_MISSILE_CENTER].iwork[9] = 0; gPlayer[0].camRoll = 0.0f; - actor->timer_0BE = 550; + this->timer_0BE = 550; } break; @@ -639,129 +683,136 @@ void SectorZ_UpdateEvents(Actor* actor) { } } -Vec3f D_i4_8019F528[] = { +Vec3f sInitialCsObjectPos[] = { { 1000.0f, 1000.0f, 1000.0f }, { 0.0f, -700.0f, 1500.0f }, { 2000.0f, -500.0f, 2500.0f }, { -500.0f, 500.0f, -3000.0f }, { -2000.0f, -1000.0f, -1000.0f }, { -1000.0f, 1700.0f, -1500.0f }, { 2000.0f, 2500.0f, -2500.0f }, }; -void SectorZ_8019B48C(void) { - Actor* actor = &gActors[1]; +// Objects around the great fox during the initial cutscene +void SectorZ_CsObjectInit(void) { + ActorCutscene* actor = &gActors[1]; s32 i; - for (i = 0; i < ARRAY_COUNT(D_i4_8019F528); i++, actor++) { + for (i = 0; i < ARRAY_COUNT(sInitialCsObjectPos); i++, actor++) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_CUTSCENE; actor->animFrame = 25; - actor->obj.pos.x = D_i4_8019F528[i].x; - actor->obj.pos.y = D_i4_8019F528[i].y; - actor->obj.pos.z = D_i4_8019F528[i].z; + actor->obj.pos.x = sInitialCsObjectPos[i].x; + actor->obj.pos.y = sInitialCsObjectPos[i].y; + actor->obj.pos.z = sInitialCsObjectPos[i].z; actor->obj.rot.y = RAND_FLOAT(360.0f); actor->vel.x = 5.0f; Object_SetInfo(&actor->info, actor->obj.id); } } -void SectorZ_8019B568(void) { - Actor* actor = &gActors[0]; +void SectorZ_CsGreatFoxInit(void) { + ActorCutscene* greatFox = &gActors[SZ_GREAT_FOX]; - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - - actor->obj.pos.x = 5000.0f; - actor->obj.pos.y = 0.0f; - actor->obj.pos.z = 0.0f; - - actor->obj.rot.y = 270.0f; - actor->animFrame = 1; - actor->vel.x = -20.0f; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); + Actor_Initialize(greatFox); + greatFox->obj.status = OBJ_INIT; + greatFox->obj.id = OBJ_ACTOR_CUTSCENE; + greatFox->obj.pos.x = 5000.0f; + greatFox->obj.pos.y = 0.0f; + greatFox->obj.pos.z = 0.0f; + greatFox->obj.rot.y = 270.0f; + greatFox->animFrame = 1; + greatFox->vel.x = -20.0f; + Object_SetInfo(&greatFox->info, greatFox->obj.id); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, greatFox->sfxSource, 0); } -Vec3f D_i4_8019F57C[] = { + +Vec3f sInitialCsEnemyPos[] = { { 150.0f, 150.0f, 50.0f }, { -150.0f, -150.0f, 50.0f }, { -150.0f, 150.0f, 50.0f }, { 150.0f, -150.0f, 50.0f } }; -f32 D_i4_8019F5AC[] = { -30.0f, 20.0f, 30.0f, -40.0f }; +f32 sInitialCsEnemyZrot[] = { -30.0f, 20.0f, 30.0f, -40.0f }; -void SectorZ_8019B630(Actor* actor, s32 index) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; +// Enemies during the initial cutscene +void SectorZ_CsEnemies(ActorCutscene* this, s32 index) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = gPlayer[0].cam.eye.x + D_i4_8019F57C[index].x; - actor->obj.pos.y = gPlayer[0].cam.eye.y + D_i4_8019F57C[index].y; - actor->obj.pos.z = gPlayer[0].cam.eye.z + D_i4_8019F57C[index].z; + this->obj.pos.x = gPlayer[0].cam.eye.x + sInitialCsEnemyPos[index].x; + this->obj.pos.y = gPlayer[0].cam.eye.y + sInitialCsEnemyPos[index].y; + this->obj.pos.z = gPlayer[0].cam.eye.z + sInitialCsEnemyPos[index].z; - actor->vel.z = -30.0f; - actor->vel.y = -10.0f; + this->vel.z = -30.0f; + this->vel.y = -10.0f; - actor->obj.rot.y = 180.0f; - actor->obj.rot.x = 10.0f; - actor->obj.rot.z = D_i4_8019F5AC[index]; + this->obj.rot.y = 180.0f; + this->obj.rot.x = 10.0f; + this->obj.rot.z = sInitialCsEnemyZrot[index]; - actor->animFrame = 26; - actor->iwork[11] = 1; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, actor->sfxSource, 4); + this->animFrame = 26; + this->iwork[11] = 1; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_EN_ENGINE_01, this->sfxSource, 4); } -Vec3f D_i4_8019F5BC[] = { +Vec3f sTeamCsOffsetPos[] = { { 200.0f, 0.0f, 0.0f }, { 200.0f, 0.0f, 0.0f }, { 200.0f, 0.0f, 0.0f }, { 200.0f, 0.0f, 0.0f } }; -void SectorZ_8019B75C(Actor* actor, s32 arg1) { - Actor* newActor = &gActors[0]; +void SectorZ_CsTeamInit(ActorCutscene* this, s32 index) { + ActorCutscene* greatFox = &gActors[SZ_GREAT_FOX]; - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i4_8019F5BC[arg1].x + newActor->obj.pos.x; - actor->obj.pos.y = newActor->obj.pos.y - 500.0f; - actor->obj.pos.z = D_i4_8019F5BC[arg1].z + newActor->obj.pos.z; + this->obj.pos.x = greatFox->obj.pos.x + sTeamCsOffsetPos[index].x; + this->obj.pos.y = greatFox->obj.pos.y - 500.0f; + this->obj.pos.z = greatFox->obj.pos.z + sTeamCsOffsetPos[index].z; - actor->vel.x = -gArwingSpeed; - actor->obj.rot.y = 270.0f; + this->vel.x = -gArwingSpeed; + this->obj.rot.y = 270.0f; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + + this->fwork[29] = 5.0f; } -Vec3f D_i4_8019F5EC[] = { +// Relative to the player +Vec3f sTeamSetupOffsetPos[] = { { 0.0f, 20000.0f, 0.0f }, { -1000.0f, 100.0f, 500.0f }, { -1300.0f, -50.0f, 0.0f }, { -1600.0f, 50.0f, -500.0f } }; -void SectorZ_8019B888(void) { - s32 i; - Actor* actor; +void SectorZ_TeamSetup(void) { + TeamId i; + ActorAllRange* team; - for (i = 0, actor = &gActors[0]; i <= TEAM_ID_PEPPY; i++, actor++) { - if ((i <= 0) || (gTeamShields[i] > 0)) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_ALLRANGE; - Object_SetInfo(&actor->info, actor->obj.id); - if (i == 0) { - actor->aiType = AI360_EVENT_HANDLER; + for (i = TEAM_ID_FOX, team = &gActors[0]; i <= TEAM_ID_PEPPY; i++, team++) { + if ((i <= TEAM_ID_FOX) || (gTeamShields[i] > 0)) { + Actor_Initialize(team); + team->obj.status = OBJ_ACTIVE; + team->obj.id = OBJ_ACTOR_ALLRANGE; + + Object_SetInfo(&team->info, team->obj.id); + + if (i == TEAM_ID_FOX) { + team->aiType = AI360_EVENT_HANDLER; } else { - actor->obj.pos.x = gPlayer[0].pos.x + D_i4_8019F5EC[i].x; - actor->obj.pos.y = gPlayer[0].pos.y + D_i4_8019F5EC[i].y; - actor->obj.pos.z = gPlayer[0].pos.z + D_i4_8019F5EC[i].z; - actor->aiType = i; - actor->state = 2; - actor->rot_0F4.y = 270.0f; - actor->health = 255; - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); - actor->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); - actor->info.unk_16 = 0; - actor->info.targetOffset = 0.0f; + team->obj.pos.x = gPlayer[0].pos.x + sTeamSetupOffsetPos[i].x; + team->obj.pos.y = gPlayer[0].pos.y + sTeamSetupOffsetPos[i].y; + team->obj.pos.z = gPlayer[0].pos.z + sTeamSetupOffsetPos[i].z; + team->aiType = i; + team->state = 2; + team->rot_0F4.y = 270.0f; + team->health = 255; + team->iwork[11] = 1; + + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, team->sfxSource, 4); + + team->info.hitbox = SEGMENTED_TO_VIRTUAL(gTeamHitbox); + team->info.unk_16 = 0; + team->info.targetOffset = 0.0f; } } } @@ -770,9 +821,9 @@ void SectorZ_8019B888(void) { void SectorZ_LevelStart(Player* player) { s32 i; s32 j; - Vec3f sp74; - Vec3f sp68; - Actor* actor = gActors; + Vec3f src; + Vec3f dest; + ActorCutscene* greatFox = &gActors[SZ_GREAT_FOX]; gAllRangeEventTimer = 0; @@ -782,8 +833,8 @@ void SectorZ_LevelStart(Player* player) { player->csState++; - SectorZ_8019B568(); - SectorZ_8019B48C(); + SectorZ_CsGreatFoxInit(); + SectorZ_CsObjectInit(); gCsCamEyeX = 0.0f; gCsCamEyeY = 0.0f; @@ -808,10 +859,9 @@ void SectorZ_LevelStart(Player* player) { gCsCamEyeZ -= 7.0f; if (gCsFrameCount == 320) { - actor = &actor[0]; player->csState = 2; - actor->vel.x = -10.0f; - actor->obj.pos.x = 1000.0f; + greatFox->vel.x = -10.0f; + greatFox->obj.pos.x = 1000.0f; gCsCamEyeX = 0.0f; gCsCamEyeY = 0.0f; gCsCamEyeZ = 17000.0f; @@ -838,21 +888,21 @@ void SectorZ_LevelStart(Player* player) { player->csState++; - actor->vel.x = 0.0f; + greatFox->vel.x = 0.0f; - actor->obj.pos.z = 0.0f; - actor->obj.pos.y = 0.0f; - actor->obj.pos.x = 0.0f; + greatFox->obj.pos.z = 0.0f; + greatFox->obj.pos.y = 0.0f; + greatFox->obj.pos.x = 0.0f; player->camRoll = 0.0f; - player->cam.eye.x = gCsCamEyeX = actor->obj.pos.x - 2800.0f; - player->cam.eye.y = gCsCamEyeY = actor->obj.pos.y + 1400.0f; - player->cam.eye.z = gCsCamEyeZ = actor->obj.pos.z + 700.0f; + player->cam.eye.x = gCsCamEyeX = greatFox->obj.pos.x - 2800.0f; + player->cam.eye.y = gCsCamEyeY = greatFox->obj.pos.y + 1400.0f; + player->cam.eye.z = gCsCamEyeZ = greatFox->obj.pos.z + 700.0f; - player->cam.at.x = gCsCamAtX = actor->obj.pos.x - 1000.0f; - player->cam.at.y = gCsCamAtY = actor->obj.pos.y; - player->cam.at.z = gCsCamAtZ = actor->obj.pos.z; + player->cam.at.x = gCsCamAtX = greatFox->obj.pos.x - 1000.0f; + player->cam.at.y = gCsCamAtY = greatFox->obj.pos.y; + player->cam.at.z = gCsCamAtZ = greatFox->obj.pos.z; D_ctx_80177A48[0] = 0.0f; gFillScreenAlpha = 255; @@ -861,9 +911,9 @@ void SectorZ_LevelStart(Player* player) { Object_Kill(&gActors[i + 30].obj, gActors[i + 30].sfxSource); } - player->pos.x = actor->obj.pos.x + 200.0f; - player->pos.y = actor->obj.pos.y - 480.0f; - player->pos.z = actor->obj.pos.z; + player->pos.x = greatFox->obj.pos.x + 200.0f; + player->pos.y = greatFox->obj.pos.y - 480.0f; + player->pos.z = greatFox->obj.pos.z; AUDIO_PLAY_BGM(NA_BGM_SZ_START_DEMO); } @@ -914,8 +964,8 @@ void SectorZ_LevelStart(Player* player) { for (i = 0; i < ARRAY_COUNT(gActors); i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } - SectorZ_8019EA68(); - SectorZ_8019B888(); + SectorZ_LoadLevelObjects(); + SectorZ_TeamSetup(); } if (gCsFrameCount == 820) { @@ -941,19 +991,19 @@ void SectorZ_LevelStart(Player* player) { break; case 370: - SectorZ_8019B630(&gActors[30], 0); + SectorZ_CsEnemies(&gActors[30], 0); break; case 390: - SectorZ_8019B630(&gActors[31], 1); + SectorZ_CsEnemies(&gActors[31], 1); break; case 405: - SectorZ_8019B630(&gActors[32], 2); + SectorZ_CsEnemies(&gActors[32], 2); break; case 425: - SectorZ_8019B630(&gActors[33], 3); + SectorZ_CsEnemies(&gActors[33], 3); break; case 560: @@ -962,19 +1012,19 @@ void SectorZ_LevelStart(Player* player) { case 700: if (gTeamShields[TEAM_ID_SLIPPY] > 0) { - SectorZ_8019B75C(&gActors[30], 0); + SectorZ_CsTeamInit(&gActors[30], 0); } break; case 720: if (gTeamShields[TEAM_ID_FALCO] > 0) { - SectorZ_8019B75C(&gActors[31], 1); + SectorZ_CsTeamInit(&gActors[31], 1); } break; case 740: if (gTeamShields[TEAM_ID_PEPPY] > 0) { - SectorZ_8019B75C(&gActors[32], 2); + SectorZ_CsTeamInit(&gActors[32], 2); } break; @@ -991,15 +1041,15 @@ void SectorZ_LevelStart(Player* player) { Matrix_RotateY(gCalcMatrix, (player->rot.y + player->yRot_114 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -(player->rot.x * M_DTOR), MTXF_APPLY); - sp74.x = 0.0f; - sp74.y = 0.0f; - sp74.z = player->baseSpeed; + src.x = 0.0f; + src.y = 0.0f; + src.z = player->baseSpeed; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp74, &sp68); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - player->vel.x = sp68.x; - player->vel.z = sp68.z; - player->vel.y = sp68.y; + player->vel.x = dest.x; + player->vel.z = dest.z; + player->vel.y = dest.y; player->pos.x += player->vel.x; player->pos.y += player->vel.y; @@ -1016,90 +1066,91 @@ void SectorZ_LevelStart(Player* player) { Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } -f32 D_i4_8019F61C[] = { -300.0f, 350.0f, -50.0f, 800.0f }; +f32 sCsTeamXpos[] = { -300.0f, 350.0f, -50.0f, 800.0f }; -f32 D_i4_8019F62C[] = { 0.0f, -30.0f, -90.0f, -550.0f }; +f32 sCsTeamYpos[] = { 0.0f, -30.0f, -90.0f, -550.0f }; -f32 D_i4_8019F63C[] = { -200.0f, -250.0f, -500.0f, 5000.0f }; +f32 sCsTeamZpos[] = { -200.0f, -250.0f, -500.0f, 5000.0f }; -void SectorZ_8019C574(Actor* actor, s32 index) { - f32 var_fv0 = 1.0f; +void SectorZ_CsLevelCompleteTeamInit(ActorCutscene* this, s32 index) { + f32 direction; + direction = 1.0f; if (!gGreatFoxIntact) { - var_fv0 = -1.0f; + direction = -1.0f; } - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i4_8019F61C[index] * var_fv0; - actor->obj.pos.y = D_i4_8019F62C[index]; - actor->obj.pos.z = D_i4_8019F63C[index]; + this->obj.pos.x = sCsTeamXpos[index] * direction; + this->obj.pos.y = sCsTeamYpos[index]; + this->obj.pos.z = sCsTeamZpos[index]; - actor->fwork[0] = gPlayer[0].baseSpeed; - actor->rot_0F4.y = gPlayer[0].rot.y; + this->fwork[0] = gPlayer[0].baseSpeed; + this->rot_0F4.y = gPlayer[0].rot.y; - Object_SetInfo(&actor->info, actor->obj.id); + Object_SetInfo(&this->info, this->obj.id); if (index < 3) { - actor->iwork[11] = 1; - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + this->iwork[11] = 1; + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } else { - actor->animFrame = 1; - actor->fwork[0] = 20.0f; - - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, actor->sfxSource, 0); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, actor->sfxSource, 0); + this->animFrame = 1; + this->fwork[0] = 20.0f; + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, this->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, this->sfxSource, 0); } } -void SectorZ_8019C70C(void) { - Actor* actor = &gActors[8]; +void SectorZ_CsLevelCompleteKattInit(void) { + ActorCutscene* katt = &gActors[AI360_KATT]; - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_CUTSCENE; + Actor_Initialize(katt); + katt->obj.status = OBJ_INIT; + katt->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = gBosses[0].obj.pos.x + 700.0f; - actor->obj.pos.y = gBosses[0].obj.pos.y - 1000.0f; - actor->obj.pos.z = gBosses[0].obj.pos.z - 1000.0f; + katt->obj.pos.x = gBosses[SZ_GREAT_FOX].obj.pos.x + 700.0f; + katt->obj.pos.y = gBosses[SZ_GREAT_FOX].obj.pos.y - 1000.0f; + katt->obj.pos.z = gBosses[SZ_GREAT_FOX].obj.pos.z - 1000.0f; - actor->rot_0F4.y = 180.0f; - actor->rot_0F4.x = 20.0f; + katt->rot_0F4.y = 180.0f; + katt->rot_0F4.x = 20.0f; - actor->obj.rot.x = -20.0f; - actor->obj.rot.y = 180.0f; - actor->obj.rot.y = 2.0f * actor->obj.rot.y; - actor->obj.rot.z = -actor->rot_0F4.z; + katt->obj.rot.x = -20.0f; + katt->obj.rot.y = 180.0f; + katt->obj.rot.y *= 2.0f; + katt->obj.rot.z = -katt->rot_0F4.z; - actor->fwork[0] = 30.0f; - actor->animFrame = 24; - actor->iwork[11] = 1; - actor->state = 10; - actor->timer_0BC = 130; + katt->fwork[0] = 30.0f; + katt->animFrame = 24; + katt->iwork[11] = 1; + katt->state = 10; + katt->timer_0BC = 130; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); + Object_SetInfo(&katt->info, katt->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, katt->sfxSource, 4); } void SectorZ_LevelComplete(Player* player) { s32 i; Vec3f src; Vec3f dest; - Actor* actor0 = &gActors[0]; - Actor* actor1 = &gActors[1]; - Actor* actor2 = &gActors[2]; - Actor* actor3 = &gActors[3]; - Boss* boss0 = &gBosses[0]; - f32 var_fv1 = 1.0f; + ActorCutscene* greatFoxCs = &gActors[SZ_GREAT_FOX]; + ActorCutscene* falco = &gActors[1]; + ActorCutscene* peppy = &gActors[2]; + ActorCutscene* slippy = &gActors[3]; + GreatFoxSZ* greatFox = &gBosses[SZ_GREAT_FOX]; + f32 direction; PRINTF("Enm->time0 %d\n"); PRINTF("time0 %d\n"); PRINTF("Demo_Time=%d\n"); + direction = 1.0f; if (!gGreatFoxIntact) { - var_fv1 = -1.0f; + direction = -1.0f; } Math_SmoothStepToF(&player->boostSpeed, 0.0f, 0.1f, 1.5f, 0.0f); @@ -1137,13 +1188,13 @@ void SectorZ_LevelComplete(Player* player) { break; case 100: - gCsCamEyeX = boss0->obj.pos.x; - gCsCamEyeY = boss0->obj.pos.y; - gCsCamEyeZ = boss0->obj.pos.z + 4000.0f; + gCsCamEyeX = greatFox->obj.pos.x; + gCsCamEyeY = greatFox->obj.pos.y; + gCsCamEyeZ = greatFox->obj.pos.z + 4000.0f; - gCsCamAtX = boss0->obj.pos.x; - gCsCamAtY = boss0->obj.pos.y; - gCsCamAtZ = boss0->obj.pos.z; + gCsCamAtX = greatFox->obj.pos.x; + gCsCamAtY = greatFox->obj.pos.y; + gCsCamAtZ = greatFox->obj.pos.z; D_ctx_80177A48[0] = 1.0f; gProjectFar = 30000.0f; @@ -1152,7 +1203,7 @@ void SectorZ_LevelComplete(Player* player) { player->baseSpeed = 0.0f; player->camRoll = 0.0f; - if (boss0->state != 0) { + if (greatFox->state != 0) { player->csState = 0; } break; @@ -1162,9 +1213,9 @@ void SectorZ_LevelComplete(Player* player) { player->draw = false; - gCsCamEyeX = boss0->obj.pos.x; - gCsCamEyeY = boss0->obj.pos.y; - gCsCamEyeZ = boss0->obj.pos.z + 4000.0f; + gCsCamEyeX = greatFox->obj.pos.x; + gCsCamEyeY = greatFox->obj.pos.y; + gCsCamEyeZ = greatFox->obj.pos.z + 4000.0f; D_ctx_80177A48[0] = 1.0f; @@ -1182,20 +1233,20 @@ void SectorZ_LevelComplete(Player* player) { for (i = 0; i < ARRAY_COUNT(gActors); i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } - AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, boss0->sfxSource, 0); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_BURNER, greatFox->sfxSource, 0); break; case 1: gFillScreenAlphaTarget = 0; gFillScreenAlpha = 0; - Math_SmoothStepToAngle(&boss0->rot_078.x, 20.0f, 0.03f, boss0->fwork[1], 0.0f); - Math_SmoothStepToAngle(&boss0->rot_078.y, 180.0f, 0.03f, boss0->fwork[2], 0.0f); - Math_SmoothStepToAngle(&boss0->rot_078.z, 30.0f, 0.03f, boss0->fwork[3], 0.0f); - Math_SmoothStepToF(&boss0->fwork[0], 20.0f, 0.05f, 0.3f, 0.0f); - Math_SmoothStepToF(&boss0->fwork[1], 0.07f, 1.0f, 0.07f, 0.0f); - Math_SmoothStepToF(&boss0->fwork[2], 0.5f, 1.0f, 0.05f, 0.0f); - Math_SmoothStepToF(&boss0->fwork[3], 0.7f, 1.0f, 0.7f, 0.0f); + Math_SmoothStepToAngle(&greatFox->rot_078.x, 20.0f, 0.03f, greatFox->fwork[1], 0.0f); + Math_SmoothStepToAngle(&greatFox->rot_078.y, 180.0f, 0.03f, greatFox->fwork[2], 0.0f); + Math_SmoothStepToAngle(&greatFox->rot_078.z, 30.0f, 0.03f, greatFox->fwork[3], 0.0f); + Math_SmoothStepToF(&greatFox->fwork[0], 20.0f, 0.05f, 0.3f, 0.0f); + Math_SmoothStepToF(&greatFox->fwork[1], 0.07f, 1.0f, 0.07f, 0.0f); + Math_SmoothStepToF(&greatFox->fwork[2], 0.5f, 1.0f, 0.05f, 0.0f); + Math_SmoothStepToF(&greatFox->fwork[3], 0.7f, 1.0f, 0.7f, 0.0f); if ((gCsFrameCount == 100) && gGreatFoxIntact) { AUDIO_PLAY_BGM(NA_BGM_COURSE_CLEAR); @@ -1206,13 +1257,13 @@ void SectorZ_LevelComplete(Player* player) { gMissionStatus = MISSION_ACCOMPLISHED; } - if ((gCsFrameCount == 230) && (D_i4_801A0564 != 0)) { - SectorZ_8019C70C(); + if ((gCsFrameCount == 230) && sKattEnabled) { + SectorZ_CsLevelCompleteKattInit(); } - gCsCamAtX = boss0->obj.pos.x; - gCsCamAtY = boss0->obj.pos.y + (2.0f * gCameraShakeY); - gCsCamAtZ = boss0->obj.pos.z; + gCsCamAtX = greatFox->obj.pos.x; + gCsCamAtY = greatFox->obj.pos.y + (gCameraShakeY * 2.0f); + gCsCamAtZ = greatFox->obj.pos.z; if (player->csTimer == 0) { player->csState = 2; @@ -1250,7 +1301,7 @@ void SectorZ_LevelComplete(Player* player) { player->aerobaticPitch = 0.0f; player->baseSpeed = 40.0f; - gCsCamEyeX = 0.0f - (200.0f * var_fv1); + gCsCamEyeX = 0.0f - (200.0f * direction); gCsCamEyeY = player->pos.y; gCsCamEyeZ = player->pos.z + 12000.0f; gCsCamAtX = player->pos.x; @@ -1258,15 +1309,15 @@ void SectorZ_LevelComplete(Player* player) { gCsCamAtZ = player->pos.z; if (gTeamShields[TEAM_ID_FALCO] > 0) { - SectorZ_8019C574(actor1, 0); + SectorZ_CsLevelCompleteTeamInit(falco, 0); } if (gTeamShields[TEAM_ID_SLIPPY] > 0) { - SectorZ_8019C574(actor3, 1); + SectorZ_CsLevelCompleteTeamInit(slippy, 1); } if (gTeamShields[TEAM_ID_PEPPY] > 0) { - SectorZ_8019C574(actor2, 2); + SectorZ_CsLevelCompleteTeamInit(peppy, 2); } - SectorZ_8019C574(actor0, 3); + SectorZ_CsLevelCompleteTeamInit(greatFoxCs, 3); gFillScreenAlpha = gFillScreenAlphaTarget = 255; } break; @@ -1292,19 +1343,19 @@ void SectorZ_LevelComplete(Player* player) { case 11: Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); - D_ctx_80177A48[1] += D_ctx_80177A48[2] * var_fv1; + D_ctx_80177A48[1] += D_ctx_80177A48[2] * direction; - src.x = -800.0f * var_fv1; + src.x = -800.0f * direction; src.y = D_ctx_80177A48[3]; src.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); Math_SmoothStepToF(&player->baseSpeed, 0, 0.05f, 1.0f, 0); - Math_SmoothStepToF(&actor1->fwork[0], 0, 0.05f, 1.0f, 0); - Math_SmoothStepToF(&actor3->fwork[0], 0, 0.05f, 1.0f, 0); - Math_SmoothStepToF(&actor2->fwork[0], 0.0f, 0.05f, 1.0f, 0); - Math_SmoothStepToF(&actor0->fwork[0], 0.0f, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&falco->fwork[0], 0, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&slippy->fwork[0], 0, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&peppy->fwork[0], 0.0f, 0.05f, 1.0f, 0); + Math_SmoothStepToF(&greatFoxCs->fwork[0], 0.0f, 0.05f, 1.0f, 0); Math_SmoothStepToF(D_ctx_80177A48, 0.02f, 1.0f, 0.001f, 0); if (gCsFrameCount > 2000) { @@ -1326,14 +1377,14 @@ void SectorZ_LevelComplete(Player* player) { if (gCsFrameCount > 2550) { Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.005f, 0); } else { - gCsCamEyeX = actor0->obj.pos.x - (800.0f * var_fv1) + dest.x; - gCsCamEyeY = actor0->obj.pos.y + 550.0f + dest.y; - gCsCamEyeZ = actor0->obj.pos.z + 2430.0f + dest.z; + gCsCamEyeX = greatFoxCs->obj.pos.x - (800.0f * direction) + dest.x; + gCsCamEyeY = greatFoxCs->obj.pos.y + 550.0f + dest.y; + gCsCamEyeZ = greatFoxCs->obj.pos.z + 2430.0f + dest.z; } - gCsCamAtX = actor0->obj.pos.x - (800.0f * var_fv1); - gCsCamAtY = actor0->obj.pos.y + 550.0f; - gCsCamAtZ = actor0->obj.pos.z + 2430.0f - 250.0f; + gCsCamAtX = greatFoxCs->obj.pos.x - (800.0f * direction); + gCsCamAtY = greatFoxCs->obj.pos.y + 550.0f; + gCsCamAtZ = greatFoxCs->obj.pos.z + 2430.0f - 250.0f; if (gCsFrameCount == 2660) { Audio_FadeOutAll(50); @@ -1405,10 +1456,8 @@ void SectorZ_LevelComplete(Player* player) { Radio_PlayMessage(gMsg_ID_16280, RCID_SLIPPY); break; } - break; } - } else { switch (gCsFrameCount) { case 1729: @@ -1464,17 +1513,18 @@ void SectorZ_LevelComplete(Player* player) { break; } } + switch (gCsFrameCount) { case 1640: Radio_PlayMessage(gMsg_ID_16200, RCID_FOX); break; case 2277: - gShowLevelClearStatusScreen = 1; + gShowLevelClearStatusScreen = true; break; case 2477: - gShowLevelClearStatusScreen = 0; + gShowLevelClearStatusScreen = false; break; case 1370: @@ -1497,15 +1547,15 @@ void SectorZ_LevelComplete(Player* player) { break; case 2450: - actor2->state = 1; + peppy->state = 1; break; case 2470: - actor3->state = 1; + slippy->state = 1; break; case 2490: - gActors[1].state = 1; + falco->state = 1; break; case 2510: @@ -1514,11 +1564,11 @@ void SectorZ_LevelComplete(Player* player) { break; case 2550: - gActors[0].state = 1; + greatFoxCs->state = 1; break; } - Matrix_RotateY(gCalcMatrix, ((player->yRot_114 + player->rot.y) + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->yRot_114 + player->rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -(((player->xRot_120 + player->rot.x) + player->aerobaticPitch) * M_DTOR), MTXF_APPLY); src.x = 0.0f; @@ -1547,7 +1597,7 @@ void SectorZ_LevelComplete(Player* player) { if (player->pos.y < 700.0f) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); } - Camera_Update360(player, 0); + Camera_Update360(player, false); player->cam.eye.x += player->vel.x * 0.1f; player->cam.eye.y += player->vel.y * 0.1f; player->cam.eye.z += player->vel.z * 0.1f; @@ -1566,47 +1616,47 @@ void SectorZ_LevelComplete(Player* player) { player->rockAngle = SIN_DEG(player->rockPhase); } -void SectorZ_8019DD20(Actor* actor) { +void SectorZ_LevelCompleteCsUpdate(ActorCutscene* this) { Vec3f src; Vec3f dest; - switch (actor->state) { + switch (this->state) { case 1: - actor->state = 2; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 2; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 5.0f; case 2: - actor->iwork[11] = 2; - actor->fwork[0] += 2.0f; - actor->rot_0F4.x += actor->fwork[1]; - Math_SmoothStepToF(&actor->fwork[1], 0.1f, 1.0f, 0.01f, 0.0f); + this->iwork[11] = 2; + this->fwork[0] += 2.0f; + this->rot_0F4.x += this->fwork[1]; + Math_SmoothStepToF(&this->fwork[1], 0.1f, 1.0f, 0.01f, 0.0f); break; case 10: - if (actor->timer_0BC == 0) { - actor->state = 11; + if (this->timer_0BC == 0) { + this->state = 11; } break; case 11: - Math_SmoothStepToF(&actor->rot_0F4.x, 215.0f, 0.1f, 7.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[0], 10.0f, 0.1f, 1.5f, 0.0f); - Math_SmoothStepToAngle(&actor->rot_0F4.y, 140.0f, 0.1f, 1.0f, 0.0f); - if (actor->rot_0F4.x > 180.0f) { - actor->state = 12; + Math_SmoothStepToF(&this->rot_0F4.x, 215.0f, 0.1f, 7.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[0], 10.0f, 0.1f, 1.5f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.y, 140.0f, 0.1f, 1.0f, 0.0f); + if (this->rot_0F4.x > 180.0f) { + this->state = 12; } break; case 12: - Math_SmoothStepToAngle(&actor->rot_0F4.x, 218.0f, 0.1f, 7.0f, 0.0f); - Math_SmoothStepToAngle(&actor->rot_0F4.y, 147.0f, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToF(&actor->rot_0F4.z, 170.0f, 0.03f, 3.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[0], 20.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.x, 218.0f, 0.1f, 7.0f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.y, 147.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->rot_0F4.z, 170.0f, 0.03f, 3.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[0], 20.0f, 0.1f, 1.0f, 0.0f); break; } - if (actor->animFrame == 24) { + if (this->animFrame == 24) { switch (gCsFrameCount) { case 290: if (gTeamShields[TEAM_ID_FALCO] > 0) { @@ -1615,8 +1665,8 @@ void SectorZ_8019DD20(Actor* actor) { break; case 430: - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 8.0f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 8.0f; break; case 400: @@ -1629,82 +1679,86 @@ void SectorZ_8019DD20(Actor* actor) { } if (gCsFrameCount > 430) { - actor->fwork[29] = 3.0f; - Math_SmoothStepToF(&actor->rot_0F4.z, 500.0f, 0.1f, 20.0f, 0.0f); - Math_SmoothStepToF(&actor->fwork[0], 40.0f, 0.1f, 3.0f, 0.0f); + this->fwork[29] = 3.0f; + Math_SmoothStepToF(&this->rot_0F4.z, 500.0f, 0.1f, 20.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[0], 40.0f, 0.1f, 3.0f, 0.0f); if ((gCsFrameCount < 460) && ((gCsFrameCount & 3) == 0)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 70.0f; src.z = -70.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_effect_80078E50(actor->obj.pos.x + dest.x, actor->obj.pos.y + dest.y, actor->obj.pos.z + dest.z, + func_effect_80078E50(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, 3.1f); } } } - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; - src.z = actor->fwork[0]; + src.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - actor->vel.x = dest.x; - actor->vel.y = dest.y; - actor->vel.z = dest.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y + 180.0f; - actor->obj.rot.z = -actor->rot_0F4.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } -void SectorZ_8019E234(Actor* actor) { +void SectorZ_SpaceJunkUpdate(ActorSpaceJunk* this) { s32 i; - actor->obj.rot.x += actor->rot_0F4.x; - actor->obj.rot.y += actor->rot_0F4.y; + this->obj.rot.x += this->rot_0F4.x; + this->obj.rot.y += this->rot_0F4.y; + + if (this->dmgType != DMG_NONE) { + this->timer_0C6 = 20; + this->dmgType = DMG_NONE; + this->health -= this->damage; + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); + + if (this->health <= 0) { + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 10); + Actor_Despawn(this); + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2); - if (actor->dmgType != DMG_NONE) { - actor->timer_0C6 = 20; - actor->dmgType = DMG_NONE; - actor->health -= actor->damage; - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, actor->sfxSource, 4); - if (actor->health <= 0) { - func_effect_8007BFFC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0.0f, 0.0f, 0.0f, 5.0f, 10); - Actor_Despawn(actor); - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 2); gHitCount += 3; D_ctx_80177850 = 15; + for (i = 0; i < 6; i++) { - func_effect_800794CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); + func_effect_800794CC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.0f); } - Object_Kill(&actor->obj, actor->sfxSource); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_EXPLOSION_S); + + Object_Kill(&this->obj, this->sfxSource); + Effect_SpawnTimedSfxAtPos(&this->obj.pos, NA_SE_OB_EXPLOSION_S); } } } -void SectorZ_8019E3A8(Actor* actor) { - gSPDisplayList(gMasterDisp++, D_SZ_6001A10); +void SectorZ_SpaceJunkDraw(ActorSpaceJunk* this) { + gSPDisplayList(gMasterDisp++, aSzSpaceJunk2DL); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); RCP_SetupDL(&gMasterDisp, SETUPDL_57); - gSPDisplayList(gMasterDisp++, D_SZ_60045E0); + gSPDisplayList(gMasterDisp++, aSZSpaceJunk4DL); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); } -Vec3f D_i4_8019F64C[] = { { 612.0f, 409.0f, 386.0f }, { 1027.0f, 141.0f, 383.0f }, { 375.0f, 292.0f, 380.0f }, - { -4.0f, 80.0f, 380.0f }, { 314.0f, 80.0f, 385.0f }, { 565.0f, 300.0f, 385.0f }, - { 600.0f, 385.0f, 380.0f }, { 776.0f, 245.0f, 384.0f }, { 376.0f, 123.0f, 384.0f }, - { 428.0f, 174.0f, 383.0f }, { 722.0f, 306.0f, 383.0f }, { 530.0f, 380.0f, 385.0f } }; +Vec3f sFireSmokeOffsetPos[] = { { 612.0f, 409.0f, 386.0f }, { 1027.0f, 141.0f, 383.0f }, { 375.0f, 292.0f, 380.0f }, + { -4.0f, 80.0f, 380.0f }, { 314.0f, 80.0f, 385.0f }, { 565.0f, 300.0f, 385.0f }, + { 600.0f, 385.0f, 380.0f }, { 776.0f, 245.0f, 384.0f }, { 376.0f, 123.0f, 384.0f }, + { 428.0f, 174.0f, 383.0f }, { 722.0f, 306.0f, 383.0f }, { 530.0f, 380.0f, 385.0f } }; -void SectorZ_Boss_Update(Boss* boss) { +void SectorZ_GreatFoxUpdate(GreatFoxSZ* this) { s32 i; s32 j; f32 x; @@ -1713,23 +1767,24 @@ void SectorZ_Boss_Update(Boss* boss) { Vec3f src; Vec3f dest; - if (boss->dmgType == DMG_UNK_100) { - boss->dmgType = DMG_NONE; - boss->timer_050 = 10; - boss->timer_052 = 60; - boss->state = 1; - AUDIO_PLAY_SFX(NA_SE_OB_BROKEN_SPARK_L, boss->sfxSource, 0); + if (this->dmgType == DMG_MISSILE) { + this->dmgType = DMG_NONE; + this->timer_050 = 10; + this->timer_052 = 60; + this->state = 1; + AUDIO_PLAY_SFX(NA_SE_OB_BROKEN_SPARK_L, this->sfxSource, 0); } - if (boss->timer_050 == 1) { + if (this->timer_050 == 1) { gGreatFoxIntact = false; } - if (boss->timer_050 == 5) { - x = boss->obj.pos.x + 400.0f; - y = boss->obj.pos.y + 200.0f; - z = boss->obj.pos.z + 1000.0f; + if (this->timer_050 == 5) { + x = this->obj.pos.x + 400.0f; + y = this->obj.pos.y + 200.0f; + z = this->obj.pos.z + 1000.0f; + // Effects for broken pieces for (i = 0; i < 25; i++) { func_effect_800794CC(x + RAND_FLOAT_CENTERED(300.0f), y + RAND_FLOAT_CENTERED(100.0f), z, 2.0f); func_effect_80079618(x + RAND_FLOAT_CENTERED(300.0f), y + RAND_FLOAT_CENTERED(100.0f), z, 2.0f); @@ -1737,57 +1792,59 @@ void SectorZ_Boss_Update(Boss* boss) { func_effect_8007BFFC(x, y, z, 0.0f, 0.0f, 0.0f, 20.0f, 30); } - if (boss->timer_052 != 0) { + if (this->timer_052 != 0) { for (j = 0; j < 1; j++) { i = RAND_INT(11.99f); - SectorZ_80199BDC(D_i4_8019F64C[i].x + boss->obj.pos.x, D_i4_8019F64C[i].y + boss->obj.pos.y, - D_i4_8019F64C[i].z + boss->obj.pos.z, RAND_FLOAT_CENTERED(5.0f), RAND_FLOAT_CENTERED(5.0f), - 10.0f, RAND_FLOAT(2.0f) + 4.0f); + SectorZ_FireSmokeEffectSpawn(sFireSmokeOffsetPos[i].x + this->obj.pos.x, + sFireSmokeOffsetPos[i].y + this->obj.pos.y, + sFireSmokeOffsetPos[i].z + this->obj.pos.z, RAND_FLOAT_CENTERED(5.0f), + RAND_FLOAT_CENTERED(5.0f), 10.0f, RAND_FLOAT(2.0f) + 4.0f); } } - Matrix_RotateY(gCalcMatrix, (boss->rot_078.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(boss->rot_078.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (this->rot_078.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_078.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; - src.z = boss->fwork[0]; + src.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - boss->vel.x = dest.x; - boss->vel.y = dest.y; - boss->vel.z = dest.z; + this->vel.x = dest.x; + this->vel.y = dest.y; + this->vel.z = dest.z; - boss->obj.rot.x = -boss->rot_078.x; - boss->obj.rot.y = boss->rot_078.y + 180.0f; - boss->obj.rot.z = -boss->rot_078.z; + this->obj.rot.x = -this->rot_078.x; + this->obj.rot.y = this->rot_078.y + 180.0f; + this->obj.rot.z = -this->rot_078.z; if (!gGreatFoxIntact) { - Matrix_RotateY(gCalcMatrix, (boss->obj.rot.y - 270.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F64C[RAND_INT(11.99f)], &dest); - func_effect_8007C484(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, boss->vel.x, - boss->vel.y, boss->vel.z, RAND_FLOAT(0.1f) + 0.15f, 0); + Matrix_RotateY(gCalcMatrix, (this->obj.rot.y - 270.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sFireSmokeOffsetPos[RAND_INT(11.99f)], &dest); + func_effect_8007C484(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, this->vel.x, + this->vel.y, this->vel.z, RAND_FLOAT(0.1f) + 0.15f, 0); + if (((gGameFrameCount % 7) == 0) && (Rand_ZeroOne() < 0.5f)) { - SectorZ_80199BDC(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, boss->vel.x, - boss->vel.y, boss->vel.z + 5.0f, RAND_FLOAT(2.0f) + 4.0f); + SectorZ_FireSmokeEffectSpawn(this->obj.pos.x + dest.x, this->obj.pos.y + dest.y, this->obj.pos.z + dest.z, + this->vel.x, this->vel.y, this->vel.z + 5.0f, RAND_FLOAT(2.0f) + 4.0f); } } } -void SectorZ_Boss_Draw(Boss* boss) { +void SectorZ_GreatFoxDraw(GreatFoxSZ* this) { gSPFogPosition(gMasterDisp++, gFogNear, 1005); Cutscene_DrawGreatFox(); } -void SectorZ_8019EA68(void) { +void SectorZ_LoadLevelObjects(void) { s32 i; s32 j; Actor* actor; Scenery360* scenery360; - Boss* boss = &gBosses[0]; + GreatFoxSZ* greatFox = &gBosses[SZ_GREAT_FOX]; gLevelObjects = SEGMENTED_TO_VIRTUAL(gLevelObjectInits[gCurrentLevel]); @@ -1836,20 +1893,20 @@ void SectorZ_8019EA68(void) { } } - Boss_Initialize(boss); - boss->obj.status = OBJ_INIT; + Boss_Initialize(greatFox); + greatFox->obj.status = OBJ_INIT; - boss->obj.pos.x = 0.0f; - boss->obj.pos.y = 0.0f; - boss->obj.pos.z = 0.0f; + greatFox->obj.pos.x = 0.0f; + greatFox->obj.pos.y = 0.0f; + greatFox->obj.pos.z = 0.0f; - boss->rot_078.y = 90.0f; + greatFox->rot_078.y = 90.0f; - boss->obj.rot.x = -boss->rot_078.x; - boss->obj.rot.y = boss->rot_078.y + 180.0f; - boss->obj.rot.z = -boss->rot_078.z; + greatFox->obj.rot.x = -greatFox->rot_078.x; + greatFox->obj.rot.y = greatFox->rot_078.y + 180.0f; + greatFox->obj.rot.z = -greatFox->rot_078.z; - boss->obj.id = OBJ_BOSS_SZ; - Object_SetInfo(&boss->info, boss->obj.id); - AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, boss->sfxSource, 0); + greatFox->obj.id = OBJ_BOSS_SZ_GREAT_FOX; + Object_SetInfo(&greatFox->info, greatFox->obj.id); + AUDIO_PLAY_SFX(NA_SE_GREATFOX_ENGINE, greatFox->sfxSource, 0); } diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index dda93b69..0312825d 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -725,7 +725,7 @@ void Macbeth_8019BE50(Actor* actor) { RAND_FLOAT(360.0f), RAND_FLOAT_CENTERED(30.0f), RAND_FLOAT_CENTERED(30.0f), RAND_FLOAT_CENTERED(30.0f), (s32) (RAND_FLOAT(50.0f) + 70.0f), 0, RAND_FLOAT(0.8f) + 0.3f); } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_L); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_L); gHitCount++; } @@ -785,7 +785,7 @@ void Macbeth_8019C6C4(Actor* actor) { D_ctx_80177850 = 15; } -void Macbeth_8019C778(Actor* actor) { +void Macbeth_Actor205_Update(Actor* actor) { if (actor->vel.z < -3.0f) { Macbeth_8019A128(); } @@ -932,7 +932,7 @@ void Macbeth_8019C778(Actor* actor) { } } -void Macbeth_8019CE88(Actor* actor) { +void Macbeth_Actor210_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -1069,7 +1069,7 @@ void Macbeth_8019D670(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 zVel, f32 zRot } } -void Macbeth_8019D700(Actor* actor) { +void Macbeth_Actor209_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -1235,7 +1235,7 @@ void Macbeth_8019D910(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 } } -void Macbeth_8019E410(Actor* actor) { +void Macbeth_Actor211_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -1348,7 +1348,7 @@ void Macbeth_8019E624(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 } } -void Macbeth_8019EA60(Actor* actor) { +void Macbeth_Actor208_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -1426,7 +1426,7 @@ void Macbeth_8019EBF8(Actor* actor, s32* arg1, s32* arg2, s32 arg3, f32 arg4, f3 } } -void Macbeth_8019EE68(Actor* actor) { +void Macbeth_Actor213_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -1683,7 +1683,7 @@ void Macbeth_8019FC54(Actor* actor, s32* arg1, s32* arg2, s32 arg3, s32 arg4, f3 } } -void Macbeth_8019FF9C(Actor* actor) { +void Macbeth_Actor212_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -1936,7 +1936,7 @@ bool Macbeth_801A0B20(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Macbeth_801A0BD8(Scenery* scenery) { +void Macbeth_Scenery104_Update(Scenery* scenery) { switch (scenery->state) { case 0: scenery->vel.y = 0.0f; @@ -2047,7 +2047,8 @@ void Macbeth_801A1268(s32 limbIndex, Vec3f* rot, void* data) { } } -void Macbeth_801A12C4(Actor* actor) { +// Actors 205, 206, 208, 209, 210, 211, 212, 213 +void Macbeth_ActorDoodad_Draw(Actor* actor) { Vec3f spD0[50]; s32 id; @@ -2295,7 +2296,8 @@ void Macbeth_801A12C4(Actor* actor) { } } -void Macbeth_801A23AC(Scenery* scenery) { +// Scenery 92 to 105 +void Macbeth_SceneryDoodad_Draw(Scenery* scenery) { Vec3f sp78[50]; RCP_SetupDL(&gMasterDisp, SETUPDL_57); @@ -2398,7 +2400,7 @@ void Macbeth_801A23AC(Scenery* scenery) { RCP_SetupDL(&gMasterDisp, SETUPDL_29); } -void Macbeth_801A2A78(Scenery* scenery) { +void Macbeth_Scenery61_Draw(Scenery* scenery) { RCP_SetupDL(&gMasterDisp, SETUPDL_57); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_MA_60253E0); @@ -2407,7 +2409,8 @@ void Macbeth_801A2A78(Scenery* scenery) { RCP_SetupDL(&gMasterDisp, SETUPDL_29); } -void Macbeth_801A2B24(Scenery* scenery) { +// Scenery 77 to 82, and 84 to 91 +void Macbeth_SceneryDoodad2_Draw(Scenery* scenery) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { Object_Kill(&scenery->obj, scenery->sfxSource); } @@ -2459,7 +2462,7 @@ void Macbeth_801A2B24(Scenery* scenery) { RCP_SetupDL(&gMasterDisp, SETUPDL_29); } -void Macbeth_801A2DD8(Scenery* scenery) { +void Macbeth_Scenery83_Update(Scenery* scenery) { s16 i; switch (scenery->state) { @@ -2469,7 +2472,7 @@ void Macbeth_801A2DD8(Scenery* scenery) { } break; case 1: - func_effect_8007A6F0(&scenery->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&scenery->obj.pos, NA_SE_EN_EXPLOSION_M); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 15; for (i = 0; i < 6; i++) { @@ -2521,7 +2524,7 @@ void Macbeth_801A30B8(s32 limbIndex, Vec3f* rot, void* data) { } } -void Macbeth_801A3240(Scenery* scenery) { +void Macbeth_Scenery83_Draw(Scenery* scenery) { Vec3f sp38[50]; RCP_SetupDL(&gMasterDisp, SETUPDL_29); @@ -2776,7 +2779,7 @@ void Macbeth_801A3E70(Actor* actor) { D_i5_801BA1D8++; } -void Macbeth_801A3E98(Actor* actor) { +void Macbeth_Actor214_Update(Actor* actor) { if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -2847,7 +2850,7 @@ bool Macbeth_801A41B0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Macbeth_801A43BC(Actor* actor) { +void Macbeth_Actor214_Draw(Actor* actor) { Vec3f sp50[50]; Matrix_Push(&gGfxMatrix); @@ -2884,7 +2887,7 @@ void Macbeth_801A4660(Actor* actor) { } } -void Macbeth_801A46A0(Actor* actor) { +void Macbeth_Actor215_Update(Actor* actor) { if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -2951,7 +2954,7 @@ void Macbeth_801A49B8(Actor* actor) { actor->timer_0C6 = 15; actor->health -= actor->damage; if (actor->health <= 0) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); gHitCount++; actor->state = 2; } @@ -2959,7 +2962,7 @@ void Macbeth_801A49B8(Actor* actor) { } } -void Macbeth_801A4A64(Actor* actor) { +void Macbeth_Actor215_Draw(Actor* actor) { if (actor->state < 2) { if (actor->scale != 1.0f) { Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); @@ -2975,7 +2978,7 @@ void Macbeth_801A4AF8(Actor* actor) { D_i5_801BE318 = actor->index; } -void Macbeth_801A4B24(Actor* actor) { +void Macbeth_Actor223_Update(Actor* actor) { s32 pad[2]; s32 i; ObjectInit* objInit; @@ -3120,7 +3123,7 @@ bool Macbeth_801A54AC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Macbeth_801A54E8(Actor* actor) { +void Macbeth_Actor223_Draw(Actor* actor) { Vec3f sp28[50]; Matrix_Push(&gGfxMatrix); @@ -3164,7 +3167,7 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { return 0; } -void Macbeth_801A57D0(Effect* effect) { +void Macbeth_Effect378_Update(Effect* effect) { u8 i; Vec3f sp50; Vec3f sp44; @@ -3220,13 +3223,13 @@ void Macbeth_801A57D0(Effect* effect) { } } -void Macbeth_801A5AF0(Effect* effect) { +void Macbeth_Effect378_Draw(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_60); gSPDisplayList(gMasterDisp++, D_MA_601A840); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void Macbeth_801A5B4C(Effect* effect) { +void Macbeth_Effect380_Update(Effect380* effect) { if ((gPlayer[0].trueZpos - effect->obj.pos.z) < -2000.0f) { Object_Kill(&effect->obj, effect->sfxSource); } @@ -3260,7 +3263,7 @@ void Macbeth_801A5B4C(Effect* effect) { } } -void Macbeth_801A5D68(Effect* effect) { +void Macbeth_Effect380_Draw(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_67); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 112, 255, 243, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 255, 255, 255, effect->unk_44); @@ -3276,7 +3279,7 @@ void Macbeth_801A5E2C(Actor* actor) { actor->obj.rot.z = 0.0f; } -void Macbeth_801A5E54(Actor* actor) { +void Macbeth_Actor216_Update(Actor* actor) { if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -3293,14 +3296,14 @@ void Macbeth_801A5E54(Actor* actor) { } } -void Macbeth_801A5F90(Actor* actor) { +void Macbeth_Actor216_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_MA_60251A0); } void Macbeth_801A5FC4(s32 arg0) { } -void Macbeth_801A5FD0(Actor* actor) { +void Macbeth_Actor217_Update(Actor* actor) { if (gPlayer[0].trueZpos - actor->obj.pos.z < -500.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -3317,7 +3320,7 @@ void Macbeth_801A5FD0(Actor* actor) { } } -void Macbeth_801A6100(Actor* actor) { +void Macbeth_Actor217_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_MA_6025850); } @@ -3325,7 +3328,7 @@ void Macbeth_801A6134(Actor* actor) { actor->health = 30; } -void Macbeth_801A6144(Actor* actor) { +void Macbeth_Actor218_Update(Actor* actor) { s16 i; if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { @@ -3370,7 +3373,7 @@ void Macbeth_801A6144(Actor* actor) { } } -void Macbeth_801A6540(Actor* actor) { +void Macbeth_Actor218_Draw(Actor* actor) { RCP_SetupDL(&gMasterDisp, SETUPDL_57); if ((actor->timer_0C6 % 2) != 0) { RCP_SetupDL(&gMasterDisp, SETUPDL_58); @@ -3387,7 +3390,7 @@ void Macbeth_801A65E0(Scenery* scenery) { scenery->obj.rot.z = 0.0f; } -void Macbeth_801A6608(Scenery* scenery) { +void Macbeth_Scenery65_Draw(Scenery* scenery) { if ((gPlayer[0].trueZpos - scenery->obj.pos.z) < scenery->vel.z) { if (gPlayState != PLAY_PAUSE) { Math_SmoothStepToF(&scenery->vel.x, 30, 0.5f, 30.0f, 0.0f); @@ -3406,7 +3409,7 @@ void Macbeth_801A6608(Scenery* scenery) { void Macbeth_801A67BC(s32 arg0) { } -void Macbeth_801A67C8(Actor* actor) { +void Macbeth_Actor219_Update(Actor* actor) { if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -300.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -3424,7 +3427,7 @@ void Macbeth_801A67C8(Actor* actor) { } } -void Macbeth_801A68EC(Actor* actor) { +void Macbeth_Actor219_Draw(Actor* actor) { } void Macbeth_801A68F8(Actor* actor, s16 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { @@ -3785,7 +3788,7 @@ void Macbeth_801A7D98(Actor* actor) { static Vec3f D_i5_801BA744 = { 0.0f, 0.0f, 0.0f }; static Vec3f D_i5_801BA750 = { 0.0f, 0.0f, 30.0f }; -void Macbeth_801A7E7C(Actor* actor) { +void Macbeth_Actor207_Update(Actor* actor) { s32 pad; f32 temp; f32 sp374; @@ -4837,7 +4840,7 @@ void Macbeth_801AC1C0(s32 limbIndex, Vec3f* rot, void* data) { } } -void Macbeth_801AC294(Actor* actor) { +void Macbeth_Actor207_Draw(Actor* actor) { if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (((gPlayer[0].trueZpos - actor->obj.pos.z) > 7000.0f) || ((gPlayer[0].trueZpos - actor->obj.pos.z) < -1000.0f)) { @@ -4862,7 +4865,7 @@ void Macbeth_801AC294(Actor* actor) { void Macbeth_801AC42C(s32 arg0) { } -void Macbeth_801AC438(Actor* actor) { +void Macbeth_Actor206_Update(Actor* actor) { switch (actor->state) { case 0: Macbeth_8019A198(actor); @@ -5016,9 +5019,9 @@ void Macbeth_LevelStart(Player* player) { player->csState = player->csTimer = player->csEventTimer = player->hideShadow = 0; player->gravity = 3.0f; player->unk_014 = 0.0f; - D_ctx_8017782C = 1; + D_ctx_8017782C = true; Play_InitEnvironment(); - D_ctx_8017782C = 0; + D_ctx_8017782C = false; gObjectLoadIndex = 40; player->csState = 4; break; @@ -5051,7 +5054,7 @@ void Macbeth_801ACE40(Effect* effect) { effect->obj.pos.x = gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(600.0f); effect->obj.pos.y = gPlayer[0].cam.eye.y - 1000.0f; effect->obj.pos.z = gPlayer[0].trueZpos - 2000.0f; - effect->obj.id = OBJ_EFFECT_352; + effect->obj.id = OBJ_EFFECT_CLOUDS; effect->timer_50 = 80; effect->unk_46 = 144; effect->vel.x = 10.0f; @@ -5200,7 +5203,7 @@ void Macbeth_801AD624(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel void Macbeth_801AD6E8(void) { } -void Macbeth_801AD6F0(Actor* actor) { +void Macbeth_Actor220_Update(Actor* actor) { Vec3f sp4C = { 0.0f, -10.0f, 0.0f }; if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -500.0f) { @@ -5256,7 +5259,7 @@ void Macbeth_801AD6F0(Actor* actor) { } } -void Macbeth_801ADAC8(Actor* actor) { +void Macbeth_Actor220_Draw(Actor* actor) { switch (actor->state) { case 0: Graphics_SetScaleMtx(actor->scale); @@ -5307,7 +5310,7 @@ void Macbeth_801ADCEC(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel } } -void Macbeth_801ADD68(Actor* actor) { +void Macbeth_Actor221_Update(Actor* actor) { Vec3f sp3C = { 0.0f, -10.0f, 0.0f }; s32 var_v0; @@ -5382,7 +5385,7 @@ void Macbeth_801ADD68(Actor* actor) { actor->health -= actor->damage; if (actor->health <= 0) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); func_effect_8007D2C8(actor->obj.pos.x + RAND_FLOAT_CENTERED(20.0f), actor->obj.pos.y - 200.0f, actor->obj.pos.z, 8.0f); func_effect_8007D2C8(actor->obj.pos.x + RAND_FLOAT_CENTERED(20.0f), actor->obj.pos.y, @@ -5406,7 +5409,7 @@ static Vec3f D_i5_801BA784[8] = { { -40.0f, 10.0f, 30.0f }, { -41.0f, 10.0f, 10.0f }, { -43.0f, 10.0f, -10.0f }, { -45.0f, 10.0f, -30.0f }, }; // unused? -void Macbeth_801AE2C0(Actor* actor) { +void Macbeth_Actor221_Draw(Actor* actor) { if (actor->state < 2) { Graphics_SetScaleMtx(actor->scale); if (actor->iwork[0] >= 128) { @@ -5513,7 +5516,7 @@ void Macbeth_801AE800(f32 xPos, f32 yPos, f32 zPos, f32 arg3, f32 arg4, f32 arg5 } } -void Macbeth_801AE87C(Effect* effect) { +void Macbeth_Effect379_Update(Effect* effect) { f32 sp34; f32 sp30; f32 sp2C; @@ -5557,7 +5560,7 @@ void Macbeth_801AE87C(Effect* effect) { } } -void Macbeth_801AEAA0(Effect* effect) { +void Macbeth_Effect379_Draw(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_67); if (effect->scale2 >= 3.0f) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, effect->unk_44); @@ -5572,7 +5575,7 @@ void Macbeth_801AEAA0(Effect* effect) { RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void Macbeth_801AEC04(Actor* actor) { +void Macbeth_Actor222_Update(Actor* actor) { if ((gPlayer[0].trueZpos - actor->obj.pos.z) < -300.0f) { Object_Kill(&actor->obj, actor->sfxSource); } @@ -5623,14 +5626,14 @@ void Macbeth_801AEC04(Actor* actor) { actor->health -= actor->damage; actor->timer_0C6 = 15; if (actor->health <= 0) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EXPLOSION_S); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f); Object_Kill(&actor->obj, actor->sfxSource); } } } -void Macbeth_801AEEFC(Actor* actor) { +void Macbeth_Actor222_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_MA_6015510); Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[2], 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index 62931d6c..3f82e728 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -79,7 +79,7 @@ void Titania_80188F30(void) { D_MA_801BA1E8 = 99; } -void Titania_80188F60(Effect* effect) { +void Titania_Effect368_Update(Effect* effect) { if (effect->timer_50 == 0) { effect->unk_44 -= 16; if (effect->unk_44 < 17) { @@ -88,7 +88,7 @@ void Titania_80188F60(Effect* effect) { } } -void Titania_80188FA8(Effect* effect) { +void Titania_Effect368_Draw(Effect* effect) { Matrix_Scale(gGfxMatrix, effect->scale2 * 0.5f, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90), MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -122,7 +122,7 @@ void Titania_80189120(f32 xPos, f32 yPos, f32 zPos, f32 yRot, f32 scale2) { } } -void Titania_80189194(Actor* actor) { +void Titania_Actor224_Update(Actor* actor) { Ground_801B49D0(actor); } @@ -209,15 +209,15 @@ void Titania_80189380(Actor* actor) { sp5C.y = 0.0f; sp5C.z = 70.0f; - func_effect_8007EE68(OBJ_EFFECT_353, &sp80, &sp74, &sp68, &sp5C, 1.0f); + func_effect_8007EE68(OBJ_EFFECT_ENEMY_LASER_1, &sp80, &sp74, &sp68, &sp5C, 1.0f); sp80.y += 20.0f; - func_effect_8007EE68(OBJ_EFFECT_353, &sp80, &sp74, &sp68, &sp5C, 1.0f); + func_effect_8007EE68(OBJ_EFFECT_ENEMY_LASER_1, &sp80, &sp74, &sp68, &sp5C, 1.0f); } static Vec3f D_i5_801B752C = { -50.0f, 0.0f, -20.0f }; static Vec3f D_i5_801B7538 = { 50.0f, 0.0f, -20.0f }; -void Titania_801895B8(Actor* actor) { +void Titania_Actor226_Update(Actor* actor) { Vec3f sp54; Vec3f sp48; f32 sp44; @@ -315,12 +315,12 @@ void Titania_801895B8(Actor* actor) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z, 8.0f); func_effect_8007C120(actor->obj.pos.x, actor->obj.pos.y + 30.0f, actor->obj.pos.z, actor->vel.x, actor->vel.y, actor->vel.z, 0.1f, 30); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); Object_Kill(&actor->obj, actor->sfxSource); } } -void Titania_80189AFC(Actor* actor) { +void Titania_Actor226_Draw(Actor* actor) { Animation_GetFrameData(&D_TI1_700C8D8, 0, actor->vwork); actor->vwork[3].z = actor->fwork[5] + 270.0f; Animation_DrawSkeleton(1, D_TI1_700C964, actor->vwork, NULL, Titania_801891B4, actor, &gIdentityMatrix); @@ -343,7 +343,7 @@ void Titania_80189B80(Actor* actor) { actor->fwork[2] += actor->obj.pos.z; } -void Titania_80189CC8(Actor* actor) { +void Titania_Actor233_Update(Actor* actor) { static Vec3f D_i5_801B7550 = { 0.0f, -50.0f, 178.0f }; static Vec3f D_i5_801B755C = { 0.0f, 0.0f, 90.0f }; Vec3f sp64; @@ -412,8 +412,8 @@ void Titania_80189CC8(Actor* actor) { sp40.z = 0.0f; if ((actor->timer_0BC < 15) && ((actor->timer_0BC % 7) == 0)) { - func_effect_8007EE68(OBJ_EFFECT_353, (Vec3f*) &actor->fwork[0], &sp40, &actor->obj.rot, &D_i5_801B755C, - 1.0f); + func_effect_8007EE68(OBJ_EFFECT_ENEMY_LASER_1, (Vec3f*) &actor->fwork[0], &sp40, &actor->obj.rot, + &D_i5_801B755C, 1.0f); if (actor->timer_0BC == 0) { actor->timer_0BC = 90; } @@ -425,7 +425,7 @@ void Titania_80189CC8(Actor* actor) { } } -void Titania_8018A1C0(Actor* actor) { +void Titania_Actor233_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_TI1_700C4B0); Matrix_Translate(gGfxMatrix, 0.0f, -50.0f, 178.0f, MTXF_APPLY); Matrix_RotateY(gGfxMatrix, actor->fwork[4] * M_DTOR, MTXF_APPLY); @@ -484,7 +484,7 @@ void Titania_8018A474(Actor* actor) { } } -void Titania_8018A544(Actor* actor) { +void Titania_Actor230_Update(Actor* actor) { f32 temp_fv0; f32 temp_fv1; f32 sp4C; @@ -503,7 +503,7 @@ void Titania_8018A544(Actor* actor) { actor->health += actor->damage; if (actor->scale == 1.0f) { if (actor->health >= 10) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_OB_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_OB_EXPLOSION_S); if ((Actor*) actor->iwork[0] != NULL) { ((Actor*) actor->iwork[0])->iwork[actor->iwork[1]] = 0; } @@ -592,7 +592,7 @@ void Titania_8018A544(Actor* actor) { } } -void Titania_8018AABC(Actor* actor) { +void Titania_Actor230_Draw(Actor* actor) { if (actor->scale != 1.0f) { Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -600,7 +600,7 @@ void Titania_8018AABC(Actor* actor) { gSPDisplayList(gMasterDisp++, D_TI1_700E3F0); } -void Titania_8018AB44(Actor* actor) { +void Titania_Actor225_Update(Actor* actor) { f32 sp3C; f32 sp38; f32 sp34; @@ -634,12 +634,12 @@ void Titania_8018AB44(Actor* actor) { Actor_Despawn(actor); actor->info.bonus = 0; func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 10.0f, actor->obj.pos.z, 6.0f); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); Object_Kill(&actor->obj, actor->sfxSource); break; case 3: - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y + 50.0f, actor->obj.pos.z, (10.0f / 3.0f)); gPlayer[0].vel.y = 20.0f; gPlayer[0].pos.y += 15.0f; @@ -768,7 +768,7 @@ void Titania_8018B1B4(s32 limbIndex, Vec3f* rot, void* data) { } } -void Titania_8018B268(Actor* actor) { +void Titania_Actor232_Update(Actor* actor) { Vec3f src; Vec3f dest; Actor* sp3C = actor->iwork[0]; @@ -871,7 +871,7 @@ void Titania_8018B268(Actor* actor) { } } -void Titania_8018B6AC(Actor* actor) { +void Titania_Actor232_Draw(Actor* actor) { Animation_GetFrameData(&D_TI1_700D534, actor->animFrame, actor->vwork); Animation_DrawSkeleton(0, D_TI1_700D700, actor->vwork, Titania_8018AFF0, Titania_8018B144, actor, &gIdentityMatrix); } @@ -933,7 +933,7 @@ void Titania_Actor231_Init(Actor* actor) { actor->obj.pos.y -= 20.0f; } -void Titania_8018B9D0(Actor* actor) { +void Titania_Actor231_Update(Actor* actor) { f32 var_fa0; f32 sp50; f32 sp4C; @@ -995,7 +995,7 @@ void Titania_8018B9D0(Actor* actor) { if (actor->vel.y <= 0.0f) { actor->itemDrop = DROP_NONE; Actor_Despawn(actor); - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); Object_Kill(&actor->obj, actor->sfxSource); } @@ -1045,7 +1045,7 @@ Gfx* D_TI_801B7608[10] = { D_TI1_7003A90, D_TI1_7005420, D_TI1_7003FC0, D_TI1_7002930, D_TI1_7002490, }; -void Titania_8018BE84(Actor* actor) { +void Titania_Actor231_Draw(Actor* actor) { s32 index; RCP_SetupDL(&gMasterDisp, SETUPDL_30); @@ -1263,7 +1263,7 @@ void Titania_8018C72C(Actor* actor) { static Vec3f D_i5_801B766C = { 0.0f, 0.0f, 15.0f }; -void Titania_8018C8A8(Actor* actor) { +void Titania_Actor229_Update(Actor* actor) { s32 i; f32 sp170; f32 temp_fs0; @@ -1323,7 +1323,7 @@ void Titania_8018C8A8(Actor* actor) { AUDIO_PLAY_SFX(NA_SE_EN_SNAKE_DAMAGE, actor->sfxSource, 4); } } else if (actor->dmgType == DMG_BEAM) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_REFLECT); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_REFLECT); } actor->dmgType = DMG_NONE; } @@ -1686,7 +1686,7 @@ void Titania_8018C8A8(Actor* actor) { actor->dmgType = DMG_NONE; } -void Titania_8018E2D8(Actor* actor) { +void Titania_Actor229_Draw(Actor* actor) { f32 sp34; if ((actor->iwork[6] % 2) != 0) { @@ -1743,7 +1743,7 @@ void Titania_8018E3CC(Actor* actor) { } } -void Titania_8018E54C(Actor* actor) { +void Titania_Actor227_Update(Actor* actor) { actor->iwork[1]++; if ((actor->iwork[0] == (uintptr_t) NULL) && ((actor->iwork[1] & 3) == 0)) { @@ -1751,7 +1751,7 @@ void Titania_8018E54C(Actor* actor) { } } -void Titania_8018E5B4(Actor* actor) { +void Titania_Actor227_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_TI1_70098E0); } @@ -1759,7 +1759,7 @@ void Titania_8018E5E8(Actor* actor) { actor->health = 100; } -void Titania_8018E5F8(Actor* actor) { +void Titania_Actor228_Update(Actor* actor) { f32 spA4; f32 spA0; f32 sp9C; @@ -1949,7 +1949,7 @@ void Titania_8018E5F8(Actor* actor) { } temp_v0_3 = actor->iwork[5]; if (temp_v0_3 == NULL) { - temp_v0_4 = func_effect_8007783C(OBJ_EFFECT_373); + temp_v0_4 = func_effect_8007783C(OBJ_EFFECT_TIMED_SFX); if (temp_v0_4 != NULL) { temp_v0_4->obj.status = OBJ_ACTIVE; temp_v0_4->obj.pos.x = sp5C; @@ -1974,7 +1974,7 @@ void Titania_8018E5F8(Actor* actor) { } } -void Titania_8018EF14(Actor* actor) { +void Titania_Actor228_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_TI1_7008930); if ((actor->timer_0C6 % 2) == 0) { @@ -2002,7 +2002,7 @@ void Titania_Cactus_Update(Sprite* sprite) { if (sprite->destroy != 0) { func_effect_8007D074(sprite->obj.pos.x, sprite->obj.pos.y + 96.0f, sprite->obj.pos.z, 4.0f); sprite->obj.status = OBJ_FREE; - func_effect_8007A6F0(&sprite->obj.pos, NA_SE_OB_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&sprite->obj.pos, NA_SE_OB_EXPLOSION_S); } } @@ -2076,7 +2076,7 @@ void Titania_8018F134(Scenery* scenery) { } } -void Titania_8018F4D8(Scenery* scenery) { +void Titania_Scenery57_Update(Scenery* scenery) { f32 temp; switch (scenery->state) { @@ -2147,7 +2147,7 @@ void Titania_8018F4D8(Scenery* scenery) { } } -void Titania_8018F8B8(Scenery* scenery) { +void Titania_Scenery57_Draw(Scenery* scenery) { switch (scenery->unk_44) { case 0: @@ -3196,7 +3196,7 @@ void Titania_80192118(Boss* boss) { sp54.x = (boss->obj.pos.x + D_i5_801BBEF4[39]) + D_i5_801BBEF4[68]; sp54.y = 0.0f; sp54.z = (boss->obj.pos.z + D_i5_801BBEF4[41]) + D_i5_801BBEF4[70]; - func_effect_8007A6F0(&sp54, NA_SE_EN_BOSS_ATTACK); + Effect_SpawnTimedSfxAtPos(&sp54, NA_SE_EN_BOSS_ATTACK); boss->swork[39] = 5; gCameraShake = 5; } @@ -3204,7 +3204,7 @@ void Titania_80192118(Boss* boss) { sp54.x = (boss->obj.pos.x + D_i5_801BBEF4[42]) + D_i5_801BBEF4[71]; sp54.y = 0.0f; sp54.z = (boss->obj.pos.z + D_i5_801BBEF4[44]) + D_i5_801BBEF4[73]; - func_effect_8007A6F0(&sp54, NA_SE_EN_BOSS_ATTACK); + Effect_SpawnTimedSfxAtPos(&sp54, NA_SE_EN_BOSS_ATTACK); boss->swork[39] = 5; gCameraShake = 5; } @@ -4242,7 +4242,8 @@ void Titania_80193DF0(Boss* boss) { sp84.x = -boss->fwork[28]; sp84.y = boss->fwork[27] + 90.0f; sp84.z = 0.0f; - func_effect_8007EE68(OBJ_EFFECT_353, &sp90, &sp84, &D_tank_800C9F2C, &D_i5_801B8D48, 1.0f); + func_effect_8007EE68(OBJ_EFFECT_ENEMY_LASER_1, &sp90, &sp84, &D_tank_800C9F2C, &D_i5_801B8D48, + 1.0f); } } } @@ -4255,7 +4256,8 @@ void Titania_80193DF0(Boss* boss) { sp84.x = -boss->fwork[34]; sp84.y = boss->fwork[33] + 90.0f; sp84.z = 0.0f; - func_effect_8007EE68(OBJ_EFFECT_353, &sp90, &sp84, &D_tank_800C9F2C, &D_i5_801B8D48, 1.0f); + func_effect_8007EE68(OBJ_EFFECT_ENEMY_LASER_1, &sp90, &sp84, &D_tank_800C9F2C, &D_i5_801B8D48, + 1.0f); } } } @@ -4313,7 +4315,7 @@ void Titania_80193DF0(Boss* boss) { func_effect_8007A900(spD4.x, 0.0f, spD4.z, 10.0f, 255, 8, 0); } if (boss->unk_04C == 38) { - func_effect_8007A6F0(&spD4, NA_SE_EN_BOSS_ATTACK); + Effect_SpawnTimedSfxAtPos(&spD4, NA_SE_EN_BOSS_ATTACK); boss->swork[39] = 5; gCameraShake = 20; } @@ -4326,7 +4328,7 @@ void Titania_80193DF0(Boss* boss) { func_effect_8007A900(spD4.x, 0.0f, spD4.z, 10.0f, 255, 8, 0); } if (boss->unk_04C == 98) { - func_effect_8007A6F0(&spD4, NA_SE_EN_BOSS_ATTACK); + Effect_SpawnTimedSfxAtPos(&spD4, NA_SE_EN_BOSS_ATTACK); boss->swork[39] = 5; gCameraShake = 20; } @@ -4905,7 +4907,7 @@ void Titania_Boss_Update(Boss* boss) { sp3C.x = boss->fwork[29] + boss->obj.pos.x; sp3C.y = boss->fwork[30] + boss->obj.pos.y; sp3C.z = boss->fwork[31] + boss->obj.pos.z; - func_effect_8007A6F0(&sp3C, NA_SE_ARWING_DASH); + Effect_SpawnTimedSfxAtPos(&sp3C, NA_SE_ARWING_DASH); D_i5_801BBEF0[49] = D_i5_801B8D54[RAND_INT(4.0f)]; D_i5_801BBEF4[74] = RAND_FLOAT(0.4f) + 0.9f; D_i5_801BBEF4[75] = 0.6f; diff --git a/src/overlays/ovl_i5/fox_ti_cs.c b/src/overlays/ovl_i5/fox_ti_cs.c index 6a0cbe17..5425912f 100644 --- a/src/overlays/ovl_i5/fox_ti_cs.c +++ b/src/overlays/ovl_i5/fox_ti_cs.c @@ -225,9 +225,9 @@ void Titania_LevelStart(Player* player) { player->csState = player->csTimer = player->csEventTimer = player->hideShadow = 0; player->gravity = 3.0f; player->unk_014 = 0.0f; - D_ctx_8017782C = 1; + D_ctx_8017782C = true; Play_InitEnvironment(); - D_ctx_8017782C = 0; + D_ctx_8017782C = false; if ((gControllerHold[player->num].button & Z_TRIG) && (gControllerHold[player->num].button & R_TRIG)) { Audio_KillSfxBySourceAndId(player->sfxSource, NA_SE_TANK_GO_UP); } diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index 0017f88d..314ec180 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -237,7 +237,7 @@ void Andross_80187C5C(void) { } } -void Andross_801880E4(Actor* actor) { +void Andross_Actor199_Update(Actor* actor) { s32 i; f32 xDisplacement; f32 yDisplacement; @@ -301,7 +301,7 @@ void Andross_801880E4(Actor* actor) { actor->vel.z = vel.z; } -void Andross_80188448(Actor* actor) { +void Andross_Actor199_Draw(Actor* actor) { func_edisplay_8005B388(actor); } @@ -320,12 +320,12 @@ void Andross_80188468(void) { AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); } -void Andross_80188528(Actor* actor) { +void Andross_Actor286_Update(Actor* actor) { Math_SmoothStepToF(&actor->vel.x, 0.0f, 0.2f, 0.5f, 0.0f); Math_SmoothStepToF(&actor->vel.y, 0.0f, 0.2f, 0.5f, 0.0f); Math_SmoothStepToF(&actor->vel.z, 0.0f, 0.2f, 0.5f, 0.0f); if (actor->dmgType != DMG_NONE) { - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); Object_Kill(&actor->obj, actor->sfxSource); func_effect_8007B344(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f, 5); } else if (actor->timer_0BC == 0) { @@ -336,7 +336,7 @@ void Andross_80188528(Actor* actor) { actor->rot_0F4.z += actor->fwork[0]; } -void Andross_80188660(Actor* actor) { +void Andross_Actor286_Draw(Actor* actor) { RCP_SetupDL(&gMasterDisp, SETUPDL_61); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); Matrix_RotateZ(gGfxMatrix, actor->rot_0F4.z * M_DTOR, MTXF_APPLY); @@ -394,7 +394,7 @@ void Andross_801888F4(Actor* actor) { func_effect_800794CC(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.0f); } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_M); Object_Kill(&actor->obj, actor->sfxSource); BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 5); gHitCount += 6; @@ -536,7 +536,7 @@ void Andross_80189098(Boss* boss) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_ALLRANGE; - actor->aiType = AI360_10; + actor->aiType = AI360_ENEMY; actor->aiIndex = AI360_FOX; actor->health = 200; actor->obj.pos.x = 200.0f; @@ -550,7 +550,7 @@ void Andross_80189098(Boss* boss) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_ALLRANGE; - actor->aiType = AI360_10; + actor->aiType = AI360_ENEMY; actor->aiIndex = AI360_FOX; actor->health = 200; actor->obj.pos.x = -200.0f; @@ -594,7 +594,7 @@ void Andross_80189214(void) { Camera_UpdateArwingOnRails(player); } -void Andross_8018933C(Actor* actor) { +void Andross_Actor290_Update(Actor* actor) { if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].trueZpos) < 1000.0f)) { gStartAndrossFightTimer = 50; @@ -602,7 +602,7 @@ void Andross_8018933C(Actor* actor) { } } -void Andross_801893B8(Actor* actor) { +void Andross_Actor288_Update(Actor* actor) { if (gAllRangeCheckpoint == 0) { actor->counter_04E++; @@ -623,7 +623,7 @@ void Andross_801893B8(Actor* actor) { } } -void Andross_80189470(Actor* actor) { +void Andross_Actor289_Update(Actor* actor) { s32 i; Player* player = &gPlayer[0]; @@ -663,7 +663,7 @@ void Andross_80189470(Actor* actor) { } Andross_80193710(); - D_ctx_8017782C = 1; + D_ctx_8017782C = true; Play_InitEnvironment(); gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; @@ -673,7 +673,7 @@ void Andross_80189470(Actor* actor) { } } -void Andross_80189724(Actor* actor) { +void Andross_Actor287_Update(Actor* actor) { s32 i; Vec3f vec; Vec3f displacement; @@ -745,7 +745,7 @@ void Andross_80189B00(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } } -void Andross_80189B70(Boss* boss) { +void Andross_Boss321_Update(Boss* boss) { s32 i; s32 sp98; s32 frameCountMask; @@ -1018,7 +1018,7 @@ void Andross_80189B70(Boss* boss) { Andross_80188468(); Andross_80187C5C(); gPlayer[0].unk_014 = 1.0f; - Camera_Update360(gPlayer, 1); + Camera_Update360(gPlayer, true); Audio_StartPlayerNoise(0); AUDIO_PLAY_BGM(gBossBgms[gCurrentLevel]); AUDIO_PLAY_SFX(NA_SE_OB_ROUTE_EXPLOSION1, gDefaultSfxSource, 0); @@ -1192,7 +1192,7 @@ bool Andross_8018B47C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Andross_8018B8C0(Boss* boss) { +void Andross_Boss321_Draw(Boss* boss) { s32 j; s32 i; f32 temp; @@ -1426,7 +1426,7 @@ void Andross_8018CA50(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel } } -void Andross_8018CAD4(Effect* effect) { +void Andross_Effect396_Update(Effect* effect) { s32 i; Item* item; Vec3f vec; @@ -1478,7 +1478,7 @@ void Andross_8018CAD4(Effect* effect) { func_effect_8007A774(&gPlayer[0], effect, 100.0f); if (effect->unk_44 != 0) { func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 10.0f); - func_effect_8007A6F0(&effect->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&effect->obj.pos, NA_SE_EN_EXPLOSION_S); Object_Kill(&effect->obj, effect->sfxSource); } } @@ -1488,7 +1488,7 @@ void Andross_8018CAD4(Effect* effect) { func_effect_8007A774(&gPlayer[0], effect, 100.0f); if (effect->unk_44 != 0) { func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 10.0f); - func_effect_8007A6F0(&effect->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&effect->obj.pos, NA_SE_EN_EXPLOSION_S); Object_Kill(&effect->obj, effect->sfxSource); if (Rand_ZeroOne() < 0.1f) { item = gItems; @@ -1531,7 +1531,7 @@ static Gfx* D_i6_801A6790[10] = { D_ANDROSS_C001880, D_ANDROSS_C001880, D_ANDROSS_C001880, D_arwing_3016660, D_arwing_3015D80, }; -void Andross_8018CF98(Effect* effect) { +void Andross_Effect396_Draw(Effect* effect) { if (effect->state == 10) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, effect->unk_44); @@ -1678,9 +1678,9 @@ void Andross_8018D2B0(Boss* boss) { RAND_FLOAT(1.0f) + 1.0f); } func_effect_8007B344(boss->vwork[0].x, boss->vwork[0].y, boss->vwork[0].z, 20.0f, 5); - func_effect_8007A6F0(&sp68, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&sp68, NA_SE_EN_EXPLOSION_M); } else { - func_effect_8007A6F0(&sp68, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&sp68, NA_SE_OB_DAMAGE_M); } } else { sp68.x = boss->vwork[1].x; @@ -1698,9 +1698,9 @@ void Andross_8018D2B0(Boss* boss) { RAND_FLOAT(1.0f) + 1.0f); } func_effect_8007B344(boss->vwork[1].x, boss->vwork[1].y, boss->vwork[1].z, 20.0f, 5); - func_effect_8007A6F0(&sp68, NA_SE_EN_EXPLOSION_M); + Effect_SpawnTimedSfxAtPos(&sp68, NA_SE_EN_EXPLOSION_M); } else { - func_effect_8007A6F0(&sp68, NA_SE_OB_DAMAGE_M); + Effect_SpawnTimedSfxAtPos(&sp68, NA_SE_OB_DAMAGE_M); } } } @@ -1763,7 +1763,7 @@ void Andross_8018DA94(Boss* boss, Vec3f* arg1) { static f32 D_i6_801A67B8[] = { 0.0f, 0.0f, 0.0f }; -void Andross_8018DBF0(Boss* boss) { +void Andross_Boss320_Update(Boss* boss) { s32 i; s32 frameCountMask; Vec3f spD0[100]; @@ -2729,7 +2729,7 @@ void Andross_8018DBF0(Boss* boss) { Andross_8018DA94(boss, &boss->vwork[17]); break; case 173: - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_EXPLOSION_L); + Effect_SpawnTimedSfxAtPos(&boss->obj.pos, NA_SE_EN_EXPLOSION_L); func_effect_8007B344(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 100.0f, 4); break; case 180: @@ -3124,7 +3124,7 @@ void Andross_801924B4(s32 limbIndex, Vec3f* rot, void* data) { } } -void Andross_801928C8(Boss* boss) { +void Andross_Boss320_Draw(Boss* boss) { if (boss->timer_058 == 0) { // FAKE @@ -3195,7 +3195,7 @@ void Andross_801928C8(Boss* boss) { } } -void Andross_80192E94(Actor* actor) { +void Andross_Actor285_Update(Actor* actor) { Actor* otherActor; s32 i; @@ -3252,15 +3252,15 @@ void Andross_80192E94(Actor* actor) { RAND_FLOAT_CENTERED(10.0f) + actor->obj.pos.y, actor->obj.pos.z, RAND_FLOAT(0.5f) + 0.5f); } - func_effect_8007A6F0(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); + Effect_SpawnTimedSfxAtPos(&actor->obj.pos, NA_SE_EN_EXPLOSION_S); Object_Kill(&actor->obj, actor->sfxSource); } } } -void Andross_80193244(Actor* actor) { - +void Andross_Actor285_Draw(Actor* actor) { gSPDisplayList(gMasterDisp++, D_VE2_6007E20); + if (actor->timer_0BC != 0) { f32 scale; u8 alpha; @@ -3281,7 +3281,7 @@ void Andross_80193244(Actor* actor) { } } -void Andross_80193380(Scenery* scenery) { +void Andross_Scenery132_Update(Scenery* scenery) { switch (scenery->state) { case 0: @@ -3310,14 +3310,14 @@ bool Andross_801934EC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Andross_8019350C(Scenery* scenery) { +void Andross_Scenery132_Draw(Scenery* scenery) { Vec3f frameTable[20]; Animation_GetFrameData(&D_VE2_6014658, scenery->unk_44, frameTable); Animation_DrawSkeleton(1, D_VE2_6014844, frameTable, Andross_801934EC, NULL, NULL, &gIdentityMatrix); } -void Andross_8019356C(Scenery* scenery) { +void Andross_Scenery131_Update(Scenery* scenery) { scenery->obj.rot.z = D_Andross_801A7F68; scenery->obj.pos.z += scenery->effectVel.z; if (scenery->timer_4C == 1) { @@ -3332,7 +3332,7 @@ bool Andross_801935B4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void Andross_801935D4(Scenery* scenery) { +void Andross_Scenery131_Draw(Scenery* scenery) { Vec3f frameTable[20]; Animation_GetFrameData(&D_VE2_6014658, scenery->unk_44, frameTable); @@ -3519,7 +3519,7 @@ void Andross_80193C4C(Player* player) { switch (gCsFrameCount) { case 80: func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f); - func_effect_8007A6F0(&boss->obj.pos, NA_SE_EN_EXPLOSION_L); + Effect_SpawnTimedSfxAtPos(&boss->obj.pos, NA_SE_EN_EXPLOSION_L); /* fallthrough */ case 85: case 90: @@ -3657,7 +3657,7 @@ void Andross_80193C4C(Player* player) { gScenery360[i].obj.status = OBJ_FREE; } Andross_80193710(); - D_ctx_8017782C = 1; + D_ctx_8017782C = true; Play_InitEnvironment(); gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 7c39ed0e..f87aa39a 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -1,3 +1,9 @@ +/* + * File: fox_sy.c + * System: SectorY + * Description: Level: Sector Y + */ + #include "global.h" #include "assets/ast_sector_y.h" @@ -23,41 +29,47 @@ void SectorY_SpawnDebris(f32, f32, f32, f32, f32, f32, s32); f32 D_i6_801A8440[3]; -void SectorY_80197B30(Actor* actor, s32 timer) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = gPlayer[0].pos.x; - actor->obj.pos.y = gPlayer[0].pos.y; - actor->obj.pos.z = gPlayer[0].pos.z; - actor->fwork[0] = gPlayer[0].baseSpeed; - actor->vel.x = gPlayer[0].vel.x; - actor->vel.y = gPlayer[0].vel.y; - actor->vel.z = gPlayer[0].vel.z; - actor->obj.rot.x = gPlayer[0].xRot_120 + gPlayer[0].rot.x + gPlayer[0].aerobaticPitch; - actor->obj.rot.y = gPlayer[0].yRot_114 + gPlayer[0].rot.y + 180.0f; - actor->obj.rot.z = gPlayer[0].rot.z; - actor->state = 5; - actor->timer_04C = timer; - actor->iwork[11] = 1; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); +void SectorY_80197B30(ActorCutscene* this, s32 timer) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = gPlayer[0].pos.x; + this->obj.pos.y = gPlayer[0].pos.y; + this->obj.pos.z = gPlayer[0].pos.z; + + this->fwork[0] = gPlayer[0].baseSpeed; + + this->vel.x = gPlayer[0].vel.x; + this->vel.y = gPlayer[0].vel.y; + this->vel.z = gPlayer[0].vel.z; + + this->obj.rot.x = gPlayer[0].xRot_120 + gPlayer[0].rot.x + gPlayer[0].aerobaticPitch; + this->obj.rot.y = gPlayer[0].yRot_114 + gPlayer[0].rot.y + 180.0f; + this->obj.rot.z = gPlayer[0].rot.z; + + this->state = 5; + this->timer_04C = timer; + this->iwork[11] = 1; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); } -void SectorY_80197C64(Effect* effect) { +void SectorY_Effect354_Draw(Effect354* this) { RCP_SetupDL_21(); gSPDisplayList(gMasterDisp++, D_SY_6014A40); RCP_SetupDL(&gMasterDisp, SETUPDL_64); } -void SectorY_80197CB8(Scenery* scenery) { +void SectorY_Scenery156_Draw(Scenery* scenery) { } -void SectorY_Boss314_Init(Boss314* this) { +void SectorY_Boss314_Init(BossSY* this) { this->fwork[9] = 0.0f; this->swork[33] = 5500; this->timer_050 = 10; this->timer_058 = 0; + D_ctx_80177A10[8] = 0; if (this->index == 0) { @@ -106,146 +118,147 @@ void SectorY_Boss314_Init(Boss314* this) { } } -void SectorY_80197F18(Boss* boss) { - boss->swork[20] = 0; - boss->swork[21] = 3; - boss->fwork[9] = 0.0f; - boss->timer_050 = RAND_INT(100.0f) + 60; - if (boss->index != 0) { - boss->timer_050 += 60; +void SectorY_80197F18(Boss* this) { + this->swork[20] = 0; + this->swork[21] = 3; + this->fwork[9] = 0.0f; + this->timer_050 = RAND_INT(100.0f) + 60; + if (this->index != 0) { + this->timer_050 += 60; } } -void SectorY_80197F84(Boss* boss) { +void SectorY_80197F84(Boss* this) { f32 yaw; - Math_SmoothStepToF(&boss->obj.pos.y, 0.0f, 0.5f, 15.0f, 0.1f); - Math_SmoothStepToF(&boss->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); - Math_SmoothStepToF(&boss->vel.z, 0.0f, 0.1f, 0.2f, 0.1f); - Math_SmoothStepToF(&boss->vel.x, 0.0f, 0.1f, 0.2f, 0.1f); - Math_SmoothStepToAngle(&boss->rot_078.x, 0.0f, 0.1f, 4.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 0.0f, 0.5f, 15.0f, 0.1f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToF(&this->vel.z, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.x, 0.0f, 0.1f, 4.0f, 0.1f); - if (SectorY_8019B5CC(boss)) { - Math_SmoothStepToF(&boss->obj.pos.y, 1000.0f, 0.1f, 30.0f, 0.1f); + if (SectorY_8019B5CC(this)) { + Math_SmoothStepToF(&this->obj.pos.y, 1000.0f, 0.1f, 30.0f, 0.1f); } else { - Math_SmoothStepToF(&boss->obj.pos.y, 0.0f, 0.1f, 10.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 0.0f, 0.1f, 10.0f, 0.1f); } - SectorY_8019B6E8(boss); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); + SectorY_8019B6E8(this); + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - yaw = Math_RadToDeg(Math_Atan2F(boss->fwork[18] - boss->obj.pos.x, boss->fwork[20] - boss->obj.pos.z)); + yaw = Math_RadToDeg(Math_Atan2F(this->fwork[18] - this->obj.pos.x, this->fwork[20] - this->obj.pos.z)); - Math_SmoothStepToAngle(&boss->rot_078.y, yaw, 0.1f, 8.0f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.y, yaw, 0.1f, 8.0f, 0.1f); - if (boss->timer_050 == 0) { - SectorY_80198244(boss); + if (this->timer_050 == 0) { + SectorY_80198244(this); } - if (boss->swork[22] == 1) { - if (ABS(boss->vel.x) <= 1.0f && (ABS(boss->vel.z) <= 1.0f) && - (fabsf(boss->fwork[18] - boss->obj.pos.x) <= 400.0f) && - (fabsf(boss->fwork[20] - boss->obj.pos.z) <= 1400.0f)) { - if ((Rand_ZeroOne() < 0.2f) && (boss->rot_078.x == 0.0f)) { - SectorY_8019AA08(boss); + if (this->swork[22] == 1) { + if (ABS(this->vel.x) <= 1.0f && (ABS(this->vel.z) <= 1.0f) && + (fabsf(this->fwork[18] - this->obj.pos.x) <= 400.0f) && + (fabsf(this->fwork[20] - this->obj.pos.z) <= 1400.0f)) { + if ((Rand_ZeroOne() < 0.2f) && (this->rot_078.x == 0.0f)) { + SectorY_8019AA08(this); } if (Rand_ZeroOne() < 0.2f) { - SectorY_80198244(boss); + SectorY_80198244(this); } } } - if (SectorY_8019B528(boss)) { - SectorY_80198ABC(boss); + if (SectorY_8019B528(this)) { + SectorY_80198ABC(this); } } -void SectorY_80198238(Boss* boss) { +void SectorY_80198238(Boss* this) { } -void SectorY_80198244(Boss* boss) { +void SectorY_80198244(Boss* this) { f32 speed; - boss->swork[20] = 3; - boss->swork[21] = 1; - boss->timer_056 = (s32) (RAND_FLOAT(500.0f) + 100.0f); - boss->fwork[11] = SIN_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->fwork[13] = COS_DEG(boss->rot_078.y) * boss->fwork[45]; - speed = ABS(boss->vel.x); + this->swork[20] = 3; + this->swork[21] = 1; + this->timer_056 = (s32) (RAND_FLOAT(500.0f) + 100.0f); + this->fwork[11] = SIN_DEG(this->rot_078.y) * this->fwork[45]; + this->fwork[13] = COS_DEG(this->rot_078.y) * this->fwork[45]; + + speed = ABS(this->vel.x); if (speed < 5.0f) { - Math_SmoothStepToF(&boss->vel.x, boss->fwork[11], 0.1f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->vel.x, this->fwork[11], 0.1f, 5.0f, 0.1f); } - speed = ABS(boss->vel.z); + speed = ABS(this->vel.z); if (speed < 5.0f) { - Math_SmoothStepToF(&boss->vel.z, boss->fwork[13], 0.1f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->vel.z, this->fwork[13], 0.1f, 5.0f, 0.1f); } - boss->fwork[10] = 181.0f; - boss->fwork[34] = 2.8f; - AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, boss->sfxSource, 4); + this->fwork[10] = 181.0f; + this->fwork[34] = 2.8f; + AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, this->sfxSource, 4); } -void SectorY_801983E4(Boss* boss) { +void SectorY_801983E4(Boss* this) { f32 yAngle; f32 xSpeed; f32 zSpeed; - SectorY_8019B6E8(boss); + SectorY_8019B6E8(this); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - Math_SmoothStepToAngle(&boss->rot_078.z, 0.0f, 0.1f, 2.0f, 0.1f); - Math_SmoothStepToAngle(&boss->rot_078.x, 0.0f, 0.1f, 2.0f, 0.1f); - Math_SmoothStepToF(&boss->vel.x, boss->fwork[11], 0.1f, 0.5f, 0.1f); - Math_SmoothStepToF(&boss->vel.z, boss->fwork[13], 0.1f, 0.5f, 0.1f); - Math_SmoothStepToF(&boss->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.z, 0.0f, 0.1f, 2.0f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.x, 0.0f, 0.1f, 2.0f, 0.1f); + Math_SmoothStepToF(&this->vel.x, this->fwork[11], 0.1f, 0.5f, 0.1f); + Math_SmoothStepToF(&this->vel.z, this->fwork[13], 0.1f, 0.5f, 0.1f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); - xSpeed = ABS(boss->fwork[18] - boss->obj.pos.x); - zSpeed = ABS(boss->fwork[20] - boss->obj.pos.z); + xSpeed = ABS(this->fwork[18] - this->obj.pos.x); + zSpeed = ABS(this->fwork[20] - this->obj.pos.z); - if (boss->rot_078.x != 0.0f) { - Math_SmoothStepToAngle(&boss->rot_078.x, boss->fwork[10], 0.1f, 6.0f, 0.1f); - if (boss->rot_078.x < 200.0f) { - boss->swork[21] = 1; - boss->fwork[10] = 0.0f; - boss->rot_078.x = 0.0f; - boss->rot_078.y -= 180.0f; - boss->rot_078.z -= 180.0f; - if (boss->rot_078.y < 0.0f) { - boss->rot_078.y += 360.0f; + if (this->rot_078.x != 0.0f) { + Math_SmoothStepToAngle(&this->rot_078.x, this->fwork[10], 0.1f, 6.0f, 0.1f); + if (this->rot_078.x < 200.0f) { + this->swork[21] = 1; + this->fwork[10] = 0.0f; + this->rot_078.x = 0.0f; + this->rot_078.y -= 180.0f; + this->rot_078.z -= 180.0f; + if (this->rot_078.y < 0.0f) { + this->rot_078.y += 360.0f; } - if (boss->rot_078.z < 0.0f) { - boss->rot_078.z += 360.0f; + if (this->rot_078.z < 0.0f) { + this->rot_078.z += 360.0f; } - boss->fwork[11] = SIN_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->fwork[13] = COS_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->fwork[34] = 2.8f; + this->fwork[11] = SIN_DEG(this->rot_078.y) * this->fwork[45]; + this->fwork[13] = COS_DEG(this->rot_078.y) * this->fwork[45]; + this->fwork[34] = 2.8f; } } - SectorY_8019C194(boss, zSpeed, xSpeed); + SectorY_8019C194(this, zSpeed, xSpeed); - if (boss->swork[22] == 1) { + if (this->swork[22] == 1) { yAngle = gPlayer[0].yRot_114 - 180.0f; if (yAngle < 0.0f) { yAngle += 360.0f; } - yAngle = boss->rot_078.y - yAngle; + yAngle = this->rot_078.y - yAngle; if (yAngle < 0.0f) { yAngle += 360.0f; } if ((zSpeed <= 1300.0f) && (xSpeed <= 800.0f) && (yAngle < 260.0f) && (yAngle > 100.0f) && - (boss->rot_078.x == 0.0f) && (boss->fwork[34] <= 2.0f)) { + (this->rot_078.x == 0.0f) && (this->fwork[34] <= 2.0f)) { if (Rand_ZeroOne() < 0.2f) { - SectorY_8019AA08(boss); + SectorY_8019AA08(this); } } @@ -253,77 +266,77 @@ void SectorY_801983E4(Boss* boss) { if (((yAngle >= 60.0f) && (yAngle <= 100.0f)) || ((yAngle <= 300.0f) && (yAngle >= 260.0f))) { if (Rand_ZeroOne() < 0.3f) { if (Rand_ZeroOne() < 0.4f) { - SectorY_80197F18(boss); + SectorY_80197F18(this); } else { - SectorY_80199D64(boss); + SectorY_80199D64(this); } } } - if (((yAngle > 300.0f) || (yAngle < 60.0f)) && (boss->rot_078.x == 0.0f)) { + if (((yAngle > 300.0f) || (yAngle < 60.0f)) && (this->rot_078.x == 0.0f)) { if (Rand_ZeroOne() < 0.3f) { if (Rand_ZeroOne() < 0.4f) { - SectorY_80197F18(boss); + SectorY_80197F18(this); } else { - SectorY_80199D64(boss); + SectorY_80199D64(this); } } else if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_U_TURN) { - Math_SmoothStepToAngle(&boss->rot_078.x, 181.0f, 0.1f, 6.0f, 0.1f); - boss->swork[21] = 3; - boss->fwork[11] = SIN_DEG(boss->rot_078.y) * (boss->fwork[45] + 10.0f); - boss->fwork[13] = COS_DEG(boss->rot_078.y) * (boss->fwork[45] + 10.0f); - boss->fwork[34] = 2.8f; + Math_SmoothStepToAngle(&this->rot_078.x, 181.0f, 0.1f, 6.0f, 0.1f); + this->swork[21] = 3; + this->fwork[11] = SIN_DEG(this->rot_078.y) * (this->fwork[45] + 10.0f); + this->fwork[13] = COS_DEG(this->rot_078.y) * (this->fwork[45] + 10.0f); + this->fwork[34] = 2.8f; } } } } - if (SectorY_8019B5CC(boss)) { - Math_SmoothStepToF(&boss->obj.pos.y, 1000.0f, 0.1f, 30.0f, 0.1f); + if (SectorY_8019B5CC(this)) { + Math_SmoothStepToF(&this->obj.pos.y, 1000.0f, 0.1f, 30.0f, 0.1f); } else { - Math_SmoothStepToF(&boss->obj.pos.y, 0.0f, 0.1f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 0.0f, 0.1f, 5.0f, 0.1f); } - if (boss->timer_056 == 0) { + if (this->timer_056 == 0) { if (Rand_ZeroOne() <= 0.7f) { - SectorY_80199D64(boss); + SectorY_80199D64(this); } else { - SectorY_80197F18(boss); + SectorY_80197F18(this); } } - if (SectorY_8019B528(boss)) { - SectorY_80198ABC(boss); + if (SectorY_8019B528(this)) { + SectorY_80198ABC(this); } } -void SectorY_80198ABC(Boss* boss) { - f32 yAngle; +void SectorY_80198ABC(Boss* this) { + f32 yAngle = Math_RadToDeg(Math_Atan2F(-this->obj.pos.x, -300.0f - this->obj.pos.z)) - this->rot_078.y; - yAngle = Math_RadToDeg(Math_Atan2F(-boss->obj.pos.x, -300.0f - boss->obj.pos.z)) - boss->rot_078.y; if (yAngle < 0.0f) { yAngle += 360.0f; } - boss->swork[20] = 4; - boss->swork[21] = 3; - boss->fwork[34] = 4.5f; + this->swork[20] = 4; + this->swork[21] = 3; + this->fwork[34] = 4.5f; - boss->timer_056 = (s32) (RAND_FLOAT(100.0f) + 100.0f); - boss->timer_050 = 0; + this->timer_056 = (s32) (RAND_FLOAT(100.0f) + 100.0f); + this->timer_050 = 0; if (yAngle > 180.0f) { - boss->fwork[27] = 40.0f; - if (boss->index == 0) { - boss->fwork[42] = 1.8f; + this->fwork[27] = 40.0f; + if (this->index == 0) { + this->fwork[42] = 1.8f; } } else { - boss->fwork[27] = 320.0f; - if (boss->index == 0) { - boss->fwork[41] = 1.8f; + this->fwork[27] = 320.0f; + if (this->index == 0) { + this->fwork[41] = 1.8f; } } - AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, boss->sfxSource, 4); + + AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, this->sfxSource, 4); switch (D_ctx_80177A10[8]) { case 0: @@ -350,78 +363,78 @@ void SectorY_80198ABC(Boss* boss) { D_ctx_80177A10[8] %= 4U; } -void SectorY_80198CE4(Boss* boss) { +void SectorY_80198CE4(Boss* this) { f32 yAngle; - SectorY_8019B6E8(boss); + SectorY_8019B6E8(this); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - Math_SmoothStepToAngle(&boss->rot_078.z, boss->fwork[27], 0.1f, 0.5f, 0.1f); - Math_SmoothStepToAngle(&boss->rot_078.x, 0.0f, 0.1f, 4.0f, 0.1f); - yAngle = Math_RadToDeg(Math_Atan2F(-boss->obj.pos.x, -300.0f - boss->obj.pos.z)); + Math_SmoothStepToAngle(&this->rot_078.z, this->fwork[27], 0.1f, 0.5f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.x, 0.0f, 0.1f, 4.0f, 0.1f); + yAngle = Math_RadToDeg(Math_Atan2F(-this->obj.pos.x, -300.0f - this->obj.pos.z)); - if (boss->index != 0) { - Math_SmoothStepToAngle(&boss->rot_078.y, yAngle, 0.1f, 1.0f, 0.1f); + if (this->index != 0) { + Math_SmoothStepToAngle(&this->rot_078.y, yAngle, 0.1f, 1.0f, 0.1f); } else { - Math_SmoothStepToAngle(&boss->rot_078.y, yAngle, 0.1f, 2.0f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.y, yAngle, 0.1f, 2.0f, 0.1f); } - if (boss->index == 0) { - boss->vel.x = SIN_DEG(boss->rot_078.y) * (boss->fwork[45] + 20.0f); - boss->vel.z = COS_DEG(boss->rot_078.y) * (boss->fwork[45] + 20.0f); + if (this->index == 0) { + this->vel.x = SIN_DEG(this->rot_078.y) * (this->fwork[45] + 20.0f); + this->vel.z = COS_DEG(this->rot_078.y) * (this->fwork[45] + 20.0f); } else { - boss->vel.x = SIN_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->vel.z = COS_DEG(boss->rot_078.y) * boss->fwork[45]; + this->vel.x = SIN_DEG(this->rot_078.y) * this->fwork[45]; + this->vel.z = COS_DEG(this->rot_078.y) * this->fwork[45]; } - if (SectorY_8019B5CC(boss)) { - Math_SmoothStepToF(&boss->obj.pos.y, 1000.0f, 0.1f, 30.0f, 0.1f); + if (SectorY_8019B5CC(this)) { + Math_SmoothStepToF(&this->obj.pos.y, 1000.0f, 0.1f, 30.0f, 0.1f); } else { - Math_SmoothStepToF(&boss->obj.pos.y, 0.0f, 0.1f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 0.0f, 0.1f, 5.0f, 0.1f); } - Math_SmoothStepToF(&boss->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); - yAngle -= boss->rot_078.y; + yAngle -= this->rot_078.y; if (yAngle < 0.0f) { yAngle += 360.0f; } - if (!SectorY_8019B528(boss) && ((yAngle <= 20.0f) || (yAngle >= 320.0f))) { - SectorY_80198244(boss); + if (!SectorY_8019B528(this) && ((yAngle <= 20.0f) || (yAngle >= 320.0f))) { + SectorY_80198244(this); } } -void SectorY_80198F5C(Boss* boss) { +void SectorY_80198F5C(Boss* this) { Vec3f vec; Vec3f sp48; f32 xDisplacement; f32 zDisplacement; s32 i; - boss->timer_05C = 20; - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, boss->vel.z, 0.1f, + this->timer_05C = 20; + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, this->vel.z, 0.1f, 10); - boss->health -= boss->damage; + this->health -= this->damage; - if (boss->health < 0) { - boss->health = 0; + if (this->health < 0) { + this->health = 0; } - boss->timer_058 = 20; + this->timer_058 = 20; - if (boss->health <= 0) { - boss->unk_04C = 0; - boss->swork[36] = 0; - boss->swork[21] = 9; - boss->info.hitbox = SEGMENTED_TO_VIRTUAL(gNoHitbox); + if (this->health <= 0) { + this->unk_04C = 0; + this->swork[36] = 0; + this->swork[21] = 9; + this->info.hitbox = SEGMENTED_TO_VIRTUAL(gNoHitbox); - if (boss->index == 0) { - boss->timer_058 = 20000; - boss->vel.x = boss->vel.y = boss->vel.z = 0.0f; + if (this->index == 0) { + this->timer_058 = 20000; + this->vel.x = this->vel.y = this->vel.z = 0.0f; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsFrameCount = 0; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; @@ -436,7 +449,7 @@ void SectorY_80198F5C(Boss* boss) { } gPlayer[0].yRot_114 = 0.0f; } - AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_DOWN_IMPACT, this->sfxSource, 4); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30); return; @@ -449,34 +462,34 @@ void SectorY_80198F5C(Boss* boss) { for (i = 4; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.status == OBJ_FREE) { - SectorY_80197B30(&gActors[i], boss->index); + SectorY_80197B30(&gActors[i], this->index); D_ctx_80177A10[9] = i; break; } } - boss->timer_058 = 2000; - boss->vel.z = 0.0f; - boss->vel.y = 0.0f; - boss->vel.x = 0.0f; + this->timer_058 = 2000; + this->vel.z = 0.0f; + this->vel.y = 0.0f; + this->vel.x = 0.0f; if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { - boss->timer_058 = 100; + this->timer_058 = 100; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; gCsFrameCount = 0; - xDisplacement = gPlayer[0].cam.eye.x - boss->obj.pos.x; - zDisplacement = gPlayer[0].cam.eye.z - boss->obj.pos.z; + xDisplacement = gPlayer[0].cam.eye.x - this->obj.pos.x; + zDisplacement = gPlayer[0].cam.eye.z - this->obj.pos.z; D_ctx_80177A48[8] = Math_RadToDeg(Math_Atan2F(xDisplacement, zDisplacement)); Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; vec.z = 900.0f; Matrix_MultVec3f(gCalcMatrix, &vec, &sp48); - gCsCamEyeX = boss->obj.pos.x + sp48.x; - gCsCamEyeY = boss->obj.pos.y + 400.0f; - gCsCamEyeZ = boss->obj.pos.z + sp48.z; - gCsCamAtX = boss->obj.pos.x; - gCsCamAtY = boss->obj.pos.y; - gCsCamAtZ = boss->obj.pos.z; + gCsCamEyeX = this->obj.pos.x + sp48.x; + gCsCamEyeY = this->obj.pos.y + 400.0f; + gCsCamEyeZ = this->obj.pos.z + sp48.z; + gCsCamAtX = this->obj.pos.x; + gCsCamAtY = this->obj.pos.y; + gCsCamAtZ = this->obj.pos.z; D_ctx_80177A48[0] = 0.1f; if (Rand_ZeroOne() > 0.5f) { D_ctx_80177A48[9] = -3.0f; @@ -485,12 +498,12 @@ void SectorY_80198F5C(Boss* boss) { D_ctx_80177A48[9] = 3.0f; } } else { - if (boss->index != 0) { - AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, boss->sfxSource, 4); - } else if (boss->health > 70) { - AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, boss->sfxSource, 4); + if (this->index != 0) { + AUDIO_PLAY_SFX(NA_SE_EN_DAMAGE_S, this->sfxSource, 4); + } else if (this->health > 70) { + AUDIO_PLAY_SFX(NA_SE_OB_DAMAGE_M, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_KNOCK_DOWN, this->sfxSource, 4); } if ((gBosses[1].obj.status == OBJ_FREE) && (gBosses[2].obj.status == OBJ_FREE)) { @@ -499,24 +512,24 @@ void SectorY_80198F5C(Boss* boss) { } } -void SectorY_80199438(Boss* boss) { +void SectorY_80199438(Boss* this) { s32 i; s32 j; Vec3f vec; Vec3f sp68; - if (boss->health <= 0) { - if (boss->index == 0) { - boss->vel.x = boss->vel.y = boss->vel.z = 0.0f; + if (this->health <= 0) { + if (this->index == 0) { + this->vel.x = this->vel.y = this->vel.z = 0.0f; if (gCsFrameCount < 61) { - boss->fwork[0] = 0.0f; + this->fwork[0] = 0.0f; } if (gCsFrameCount == 61) { Radio_PlayMessage(gMsg_ID_14360, RCID_BOSS_SECTORY); } if (gCsFrameCount >= 80) { - boss->fwork[0] = 1.0f; + this->fwork[0] = 1.0f; } } else { D_ctx_80177A48[8] += D_ctx_80177A48[9]; @@ -528,36 +541,39 @@ void SectorY_80199438(Boss* boss) { Matrix_MultVec3f(gCalcMatrix, &vec, &sp68); - gCsCamEyeX = boss->obj.pos.x + sp68.x; - gCsCamEyeZ = boss->obj.pos.z + sp68.z; + gCsCamEyeX = this->obj.pos.x + sp68.x; + gCsCamEyeZ = this->obj.pos.z + sp68.z; - if ((boss->timer_058 == 40) && gBosses[1].obj.status == OBJ_FREE && gBosses[2].obj.status == OBJ_FREE) { + if ((this->timer_058 == 40) && (gBosses[1].obj.status == OBJ_FREE) && (gBosses[2].obj.status == OBJ_FREE)) { Radio_PlayMessage(gMsg_ID_14360, RCID_BOSS_SECTORY); } - if (boss->timer_058 > 85) { - boss->fwork[0] = 0.0f; + if (this->timer_058 > 85) { + this->fwork[0] = 0.0f; } - if (boss->timer_058 < 67) { - boss->fwork[0] = 1.0f; + if (this->timer_058 < 67) { + this->fwork[0] = 1.0f; } - if ((boss->timer_058 == 60) && (boss->swork[19] == 0)) { - BonusText_Display(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 3); + if ((this->timer_058 == 60) && (this->swork[19] == 0)) { + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 3); gHitCount += 4; } - if (boss->timer_058 == 50) { - AUDIO_PLAY_SFX(NA_SE_EN_MS_EXPLOSION_S, boss->sfxSource, 4); + if (this->timer_058 == 50) { + AUDIO_PLAY_SFX(NA_SE_EN_MS_EXPLOSION_S, this->sfxSource, 4); gControllerRumbleFlags[gMainController] = 1; gControllerRumbleTimers[gMainController] = 20; + D_ctx_80177850 = 15; - boss->swork[36]++; - func_effect_8007BFFC(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, - boss->vel.z, 8.0f, 10); - func_effect_8007B344(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 8.0f, 5); + this->swork[36]++; + + func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 8.0f, 10); + func_effect_8007B344(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 8.0f, 5); + for (i = 10; i < 24; i++) { if (i != 15) { - SectorY_SpawnDebris(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, + SectorY_SpawnDebris(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT_CENTERED(50.0f), - RAND_FLOAT_CENTERED(50.0f) + boss->vel.z, i); + RAND_FLOAT_CENTERED(50.0f) + this->vel.z, i); } } } @@ -569,14 +585,14 @@ void SectorY_80199438(Boss* boss) { Math_SmoothStepToF(&gPlayer[0].cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); } - if (((gGameFrameCount % 4) == 0) && (boss->swork[36] == 0)) { - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, - boss->vel.z, 0.1f, 5); + if (((gGameFrameCount % 4) == 0) && (this->swork[36] == 0)) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.1f, 5); } - if ((gCsFrameCount == 120) && (boss->swork[36] == 0) && (boss->index == 0)) { - if (boss->swork[19] == 0) { - Boss_AwardBonus(boss); + if ((gCsFrameCount == 120) && (this->swork[36] == 0) && (this->index == 0)) { + if (this->swork[19] == 0) { + Boss_AwardBonus(this); } for (i = 0; i < 2; i++) { @@ -585,26 +601,26 @@ void SectorY_80199438(Boss* boss) { } } - Audio_KillSfxBySource(boss->sfxSource); + Audio_KillSfxBySource(this->sfxSource); gShowBossHealth = 0; - func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f); - func_effect_8007D0E0(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 30.0f); - func_enmy_80062B60(boss->obj.pos.x, boss->obj.pos.z, 0, 120.0f); + func_effect_8007A568(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 40.0f); + func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 30.0f); + func_enmy_80062B60(this->obj.pos.x, this->obj.pos.z, 0, 120.0f); gCameraShake = 25; - boss->swork[36]++; + this->swork[36]++; for (i = 10; i < 24; i++) { if (i != 15) { - SectorY_SpawnDebris(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, RAND_FLOAT_CENTERED(50.0f), - RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT_CENTERED(50.0f) + boss->vel.z, i); + SectorY_SpawnDebris(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, RAND_FLOAT_CENTERED(50.0f), + RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT_CENTERED(50.0f) + this->vel.z, i); } } - boss->timer_058 = 100; - boss->vel.x = boss->vel.y = boss->vel.z = 0.0f; + this->timer_058 = 100; + this->vel.x = this->vel.y = this->vel.z = 0.0f; } - if (boss->timer_058 == 1) { - if (boss->index != 0) { + if (this->timer_058 == 1) { + if (this->index != 0) { Object_Kill(&gActors[D_ctx_80177A10[9]].obj, gActors[D_ctx_80177A10[9]].sfxSource); if ((gBosses[1].obj.status == OBJ_FREE) || (gBosses[2].obj.status == OBJ_FREE)) { gBosses[0].unk_04A = 1; @@ -612,203 +628,205 @@ void SectorY_80199438(Boss* boss) { gScenery360[0].info.drawType = 0; } else { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_UpdateArwing360(&gPlayer[0], 1); + Camera_UpdateArwing360(&gPlayer[0], true); gPlayer[0].unk_014 = 0.0f; if (gTeamShields[TEAM_ID_PEPPY] > 0) { AllRange_PlayMessage(gMsg_ID_14230, RCID_PEPPY); } } } - Object_Kill(&boss->obj, boss->sfxSource); + Object_Kill(&this->obj, this->sfxSource); } } else { - if (boss->health < 80) { - if (boss->swork[25] == 0) { - boss->swork[25] = 1; + if (this->health < 80) { + if (this->swork[25] == 0) { + this->swork[25] = 1; for (j = ARRAY_COUNT(gActors) - 1; j >= 0; j--) { if (gActors[j].obj.status == OBJ_FREE) { - SectorY_SetupDebris(&gActors[j], boss->fwork[28], boss->fwork[29], boss->fwork[30], + SectorY_SetupDebris(&gActors[j], this->fwork[28], this->fwork[29], this->fwork[30], RAND_FLOAT_CENTERED(50.0f), RAND_FLOAT_CENTERED(50.0f), - RAND_FLOAT_CENTERED(50.0f) + boss->vel.z, 15); + RAND_FLOAT_CENTERED(50.0f) + this->vel.z, 15); break; } } - func_effect_8007D2C8(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z + 30.0f, 4.0f); - boss->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SY_6034304); - AUDIO_PLAY_SFX(NA_SE_EN_MS_SHIELD_BROKEN, boss->sfxSource, 4); + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 30.0f, 4.0f); + this->info.hitbox = SEGMENTED_TO_VIRTUAL(D_SY_6034304); + AUDIO_PLAY_SFX(NA_SE_EN_MS_SHIELD_BROKEN, this->sfxSource, 4); } } - if (boss->health <= 80) { - boss->swork[33] = 3500; + if (this->health <= 80) { + this->swork[33] = 3500; } - if (boss->health <= 70) { - boss->swork[29] = 31; + if (this->health <= 70) { + this->swork[29] = 31; } - if (boss->health <= 50) { - boss->swork[29] = 15; + if (this->health <= 50) { + this->swork[29] = 15; } - if (boss->health <= 30) { - boss->swork[29] = 7; + if (this->health <= 30) { + this->swork[29] = 7; } - if (boss->health <= 10) { - boss->swork[29] = 3; + if (this->health <= 10) { + this->swork[29] = 3; } } } -void SectorY_80199D64(Boss* boss) { - if (boss->swork[34] >= 2) { - boss->swork[20] = 6; - boss->swork[21] = 1; - boss->fwork[12] = 1000.0f; - boss->fwork[34] = 2.8f; - boss->timer_056 = 0; - boss->vel.y = 0.0f; +void SectorY_80199D64(Boss* this) { + if (this->swork[34] >= 2) { + this->swork[20] = 6; + this->swork[21] = 1; + this->fwork[12] = 1000.0f; + this->fwork[34] = 2.8f; + this->timer_056 = 0; + this->vel.y = 0.0f; } } -void SectorY_80199DAC(Boss* boss) { +void SectorY_80199DAC(Boss* this) { f32 sp34; f32 zSpeed; f32 xSpeed; f32 yAngle; - SectorY_8019B6E8(boss); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); + SectorY_8019B6E8(this); + + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - sp34 = Math_RadToDeg(Math_Atan2F(0.0f - boss->obj.pos.x, -300.0f - boss->obj.pos.z)); + sp34 = Math_RadToDeg(Math_Atan2F(0.0f - this->obj.pos.x, -300.0f - this->obj.pos.z)); - boss->fwork[11] = SIN_DEG(sp34) * (boss->fwork[45] + 10.0f); - boss->fwork[13] = COS_DEG(sp34) * (boss->fwork[45] + 10.0f); - boss->fwork[10] = sp34; + this->fwork[11] = SIN_DEG(sp34) * (this->fwork[45] + 10.0f); + this->fwork[13] = COS_DEG(sp34) * (this->fwork[45] + 10.0f); + this->fwork[10] = sp34; - Math_SmoothStepToAngle(&boss->rot_078.z, 0.0f, 0.1f, 4.0f, 0.1f); - Math_SmoothStepToAngle(&boss->rot_078.y, boss->fwork[10], 0.1f, 6.0f, 0.1f); - Math_SmoothStepToF(&boss->obj.pos.y, boss->fwork[12], 1.0f, 15.0f, 1.0f); + Math_SmoothStepToAngle(&this->rot_078.z, 0.0f, 0.1f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.y, this->fwork[10], 0.1f, 6.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[12], 1.0f, 15.0f, 1.0f); - if (((ABS(boss->obj.pos.y) - boss->fwork[12]) <= 1800.0f) && (ABS(boss->obj.pos.x) <= 1800.0f) && - (ABS(boss->obj.pos.z + 300.0f) <= 1800.0f)) { + if (((ABS(this->obj.pos.y) - this->fwork[12]) <= 1800.0f) && (ABS(this->obj.pos.x) <= 1800.0f) && + (ABS(this->obj.pos.z + 300.0f) <= 1800.0f)) { - boss->vel.x = 0.0f; - boss->vel.z = 0.0f; + this->vel.x = 0.0f; + this->vel.z = 0.0f; - Math_SmoothStepToF(&boss->obj.pos.x, 0.0f, 0.1f, ABS(boss->fwork[11]), 0.1f); - Math_SmoothStepToF(&boss->obj.pos.z, -300.0f, 0.1f, ABS(boss->fwork[13]), 0.1f); - Math_SmoothStepToAngle(&boss->rot_078.x, 0.0f, 0.1f, 4.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.x, 0.0f, 0.1f, ABS(this->fwork[11]), 0.1f); + Math_SmoothStepToF(&this->obj.pos.z, -300.0f, 0.1f, ABS(this->fwork[13]), 0.1f); + Math_SmoothStepToAngle(&this->rot_078.x, 0.0f, 0.1f, 4.0f, 0.1f); - boss->fwork[10] = 0.0f; + this->fwork[10] = 0.0f; - if (((ABS(boss->obj.pos.y) - boss->fwork[12]) <= 300.0f) && (ABS(boss->obj.pos.x) <= 300.0f) && - (ABS(boss->obj.pos.z + 300.0f) <= 300.0f)) { - Math_SmoothStepToF(&boss->fwork[43], 3.0f, 0.1f, 0.1f, 0.1f); - boss->swork[21] = 6; - boss->unk_04C = 27; - boss->fwork[12] = 320.0f; - if (boss->timer_056 == 0) { - boss->timer_056 = 51; - AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, boss->sfxSource, 4); + if (((ABS(this->obj.pos.y) - this->fwork[12]) <= 300.0f) && (ABS(this->obj.pos.x) <= 300.0f) && + (ABS(this->obj.pos.z + 300.0f) <= 300.0f)) { + Math_SmoothStepToF(&this->fwork[43], 3.0f, 0.1f, 0.1f, 0.1f); + this->swork[21] = 6; + this->unk_04C = 27; + this->fwork[12] = 320.0f; + if (this->timer_056 == 0) { + this->timer_056 = 51; + AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, this->sfxSource, 4); } } } else { - Math_SmoothStepToF(&boss->vel.x, boss->fwork[11], 0.1f, 0.5f, 0.1f); - Math_SmoothStepToF(&boss->vel.z, boss->fwork[13], 0.1f, 0.5f, 0.1f); + Math_SmoothStepToF(&this->vel.x, this->fwork[11], 0.1f, 0.5f, 0.1f); + Math_SmoothStepToF(&this->vel.z, this->fwork[13], 0.1f, 0.5f, 0.1f); yAngle = gPlayer[0].yRot_114 - 180.0f; if (yAngle < 0.0f) { yAngle += 360.0f; } - yAngle = boss->rot_078.y - yAngle; + yAngle = this->rot_078.y - yAngle; if (yAngle < 0.0f) { yAngle += 360.0f; } - zSpeed = ABS(boss->fwork[20] - boss->obj.pos.z); - xSpeed = ABS(boss->fwork[18] - boss->obj.pos.x); + zSpeed = ABS(this->fwork[20] - this->obj.pos.z); + xSpeed = ABS(this->fwork[18] - this->obj.pos.x); - if (boss->rot_078.x != 0.0f) { + if (this->rot_078.x != 0.0f) { if ((yAngle > 300.0f) || (yAngle < 60.0f)) { - Math_SmoothStepToAngle(&boss->rot_078.x, 181.0f, 0.1f, 6.0f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.x, 181.0f, 0.1f, 6.0f, 0.1f); } else { - Math_SmoothStepToAngle(&boss->rot_078.x, 0.0f, 0.1f, 6.0f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.x, 0.0f, 0.1f, 6.0f, 0.1f); } - } else if ((boss->swork[22] == 1) && ((yAngle > 300.0f) || (yAngle < 60.0f)) && (Rand_ZeroOne() > 0.2f)) { - Math_SmoothStepToAngle(&boss->rot_078.x, 181.0f, 0.1f, 6.0f, 0.1f); - boss->swork[21] = 3; - boss->fwork[34] = 2.8f; + } else if ((this->swork[22] == 1) && ((yAngle > 300.0f) || (yAngle < 60.0f)) && (Rand_ZeroOne() > 0.2f)) { + Math_SmoothStepToAngle(&this->rot_078.x, 181.0f, 0.1f, 6.0f, 0.1f); + this->swork[21] = 3; + this->fwork[34] = 2.8f; } - if (!SectorY_8019B5CC(boss)) { - SectorY_8019C194(boss, zSpeed, xSpeed); + if (!SectorY_8019B5CC(this)) { + SectorY_8019C194(this, zSpeed, xSpeed); } } - if (boss->timer_056 == 1) { + if (this->timer_056 == 1) { sp34 = Rand_ZeroOne(); if (sp34 >= 0.3f) { - SectorY_8019A82C(boss); + SectorY_8019A82C(this); } if (sp34 < 0.2f) { - SectorY_8019A434(boss); + SectorY_8019A434(this); } if ((sp34 < 0.3f) && (sp34 >= 0.2f)) { - SectorY_8019A640(boss); + SectorY_8019A640(this); } } } -void SectorY_8019A434(Boss* boss) { - boss->swork[20] = 7; - boss->swork[21] = 5; - boss->timer_056 = (s32) (RAND_FLOAT(130.0f) + 60.0f); - boss->fwork[11] = SIN_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->fwork[13] = COS_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->fwork[12] = 30.0f; - boss->fwork[10] = 181.0f; - AUDIO_PLAY_SFX(NA_SE_EN_MS_LAND, boss->sfxSource, 4); +void SectorY_8019A434(Boss* this) { + this->swork[20] = 7; + this->swork[21] = 5; + this->timer_056 = (s32) (RAND_FLOAT(130.0f) + 60.0f); + this->fwork[11] = SIN_DEG(this->rot_078.y) * this->fwork[45]; + this->fwork[13] = COS_DEG(this->rot_078.y) * this->fwork[45]; + this->fwork[12] = 30.0f; + this->fwork[10] = 181.0f; + AUDIO_PLAY_SFX(NA_SE_EN_MS_LAND, this->sfxSource, 4); } -void SectorY_8019A520(Boss* boss) { - SectorY_8019B6E8(boss); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); +void SectorY_8019A520(Boss* this) { + SectorY_8019B6E8(this); + + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - Math_SmoothStepToAngle(&boss->rot_078.y, 0.0f, 0.1f, 2.0f, 0.1f); - Math_SmoothStepToF(&boss->vel.x, 0.0f, 0.1f, 0.2f, 0.1f); - Math_SmoothStepToF(&boss->vel.z, 6.0f, 0.1f, 0.2f, 0.1f); - Math_SmoothStepToF(&boss->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToAngle(&this->rot_078.y, 0.0f, 0.1f, 2.0f, 0.1f); + Math_SmoothStepToF(&this->vel.x, 0.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToF(&this->vel.z, 6.0f, 0.1f, 0.2f, 0.1f); + Math_SmoothStepToF(&this->vel.y, 0.0f, 0.1f, 0.2f, 0.1f); - if (boss->timer_056 == 0) { - SectorY_8019A640(boss); + if (this->timer_056 == 0) { + SectorY_8019A640(this); } else { - boss->fwork[0] = 1.0f; + this->fwork[0] = 1.0f; } - if ((boss->unk_04C == 0) || (boss->unk_04C == 27)) { - AUDIO_PLAY_SFX(NA_SE_EN_HEAVY_WALK, boss->sfxSource, 4); + if ((this->unk_04C == 0) || (this->unk_04C == 27)) { + AUDIO_PLAY_SFX(NA_SE_EN_HEAVY_WALK, this->sfxSource, 4); } } -void SectorY_8019A640(Boss* boss) { - boss->swork[20] = 8; - boss->swork[21] = 0; - boss->vel.x = 0.0f; - boss->vel.y = 0.0f; - boss->vel.z = 0.0f; - boss->timer_056 = 80; +void SectorY_8019A640(Boss* this) { + this->swork[20] = 8; + this->swork[21] = 0; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->timer_056 = 80; } -void SectorY_8019A66C(Boss* boss) { +void SectorY_8019A66C(Boss* this) { + SectorY_8019B6E8(this); - SectorY_8019B6E8(boss); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - if (boss->timer_056 == 60) { - AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, boss->sfxSource, 4); - boss->fwork[34] = 4.5f; + if (this->timer_056 == 60) { + AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, this->sfxSource, 4); + this->fwork[34] = 4.5f; if (Rand_ZeroOne() > 0.5f) { AllRange_PlayMessage(gMsg_ID_14330, RCID_BOSS_SECTORY); } else { @@ -816,64 +834,64 @@ void SectorY_8019A66C(Boss* boss) { } } - if (boss->timer_056 <= 60) { - boss->fwork[11] = SIN_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->fwork[13] = COS_DEG(boss->rot_078.y) * boss->fwork[45]; - boss->swork[21] = 1; - Math_SmoothStepToF(&boss->fwork[43], 0.0f, 0.1f, 0.1f, 0.1f); - Math_SmoothStepToF(&boss->vel.z, boss->fwork[13], 0.1f, 0.5f, 0.5f); - Math_SmoothStepToF(&boss->vel.x, boss->fwork[11], 0.1f, 0.5f, 0.5f); - Math_SmoothStepToF(&boss->vel.y, 10.0f, 0.1f, 0.5f, 0.5f); + if (this->timer_056 <= 60) { + this->fwork[11] = SIN_DEG(this->rot_078.y) * this->fwork[45]; + this->fwork[13] = COS_DEG(this->rot_078.y) * this->fwork[45]; + this->swork[21] = 1; + Math_SmoothStepToF(&this->fwork[43], 0.0f, 0.1f, 0.1f, 0.1f); + Math_SmoothStepToF(&this->vel.z, this->fwork[13], 0.1f, 0.5f, 0.5f); + Math_SmoothStepToF(&this->vel.x, this->fwork[11], 0.1f, 0.5f, 0.5f); + Math_SmoothStepToF(&this->vel.y, 10.0f, 0.1f, 0.5f, 0.5f); } - if (boss->timer_056 == 0) { - SectorY_80198244(boss); + if (this->timer_056 == 0) { + SectorY_80198244(this); } } -void SectorY_8019A82C(Boss* boss) { - boss->swork[20] = 9; - boss->fwork[9] = 0.0f; - boss->timer_050 = RAND_INT(150.0f) + 340; - boss->timer_056 = 0; +void SectorY_8019A82C(Boss* this) { + this->swork[20] = 9; + this->fwork[9] = 0.0f; + this->timer_050 = RAND_INT(150.0f) + 340; + this->timer_056 = 0; AllRange_PlayMessage(gMsg_ID_14340, RCID_BOSS_SECTORY); } -void SectorY_8019A898(Boss* boss) { +void SectorY_8019A898(Boss* this) { f32 yAngle1; f32 yAngle2; - SectorY_8019B6E8(boss); - if (boss->timer_052 == 0) { - SectorY_8019BC14(boss); + SectorY_8019B6E8(this); + if (this->timer_052 == 0) { + SectorY_8019BC14(this); } - yAngle1 = Math_RadToDeg(Math_Atan2F(boss->fwork[18] - boss->obj.pos.x, boss->fwork[20] - boss->obj.pos.z)); - yAngle2 = yAngle1 - boss->rot_078.y; + yAngle1 = Math_RadToDeg(Math_Atan2F(this->fwork[18] - this->obj.pos.x, this->fwork[20] - this->obj.pos.z)); + yAngle2 = yAngle1 - this->rot_078.y; if (yAngle2 < 0.0f) { yAngle2 += 360.0f; } - boss->swork[21] = 6; + this->swork[21] = 6; - if (((yAngle2 >= 30.0f) && (yAngle2 <= 330.0f)) || ((boss->unk_04C != 0)) && (boss->unk_04C != 27)) { - boss->swork[21] = 5; - Math_SmoothStepToAngle(&boss->rot_078.y, yAngle1, 0.1f, 2.0f, 0.1f); - boss->fwork[0] = 1.0f; - if ((boss->unk_04C == 0) || (boss->unk_04C == 27)) { - AUDIO_PLAY_SFX(NA_SE_EN_HEAVY_WALK, boss->sfxSource, 4); + if (((yAngle2 >= 30.0f) && (yAngle2 <= 330.0f)) || ((this->unk_04C != 0)) && (this->unk_04C != 27)) { + this->swork[21] = 5; + Math_SmoothStepToAngle(&this->rot_078.y, yAngle1, 0.1f, 2.0f, 0.1f); + this->fwork[0] = 1.0f; + if ((this->unk_04C == 0) || (this->unk_04C == 27)) { + AUDIO_PLAY_SFX(NA_SE_EN_HEAVY_WALK, this->sfxSource, 4); } } else { - boss->timer_056 = 0; + this->timer_056 = 0; } - if (boss->timer_050 == 0) { - SectorY_8019A434(boss); + if (this->timer_050 == 0) { + SectorY_8019A434(this); } } -void SectorY_8019AA08(Boss* boss) { - if (SectorY_8019B5CC(boss)) { +void SectorY_8019AA08(Boss* this) { + if (SectorY_8019B5CC(this)) { return; } @@ -882,25 +900,25 @@ void SectorY_8019AA08(Boss* boss) { } if (Rand_ZeroOne() >= 0.5f) { - boss->swork[21] = 7; - boss->swork[31] = 11; - boss->swork[32] = Animation_GetFrameCount(&D_SY_602645C) - 1; + this->swork[21] = 7; + this->swork[31] = 11; + this->swork[32] = Animation_GetFrameCount(&D_SY_602645C) - 1; - } else if (boss->index == 0) { - boss->swork[21] = 8; - boss->swork[31] = 13; - boss->swork[32] = Animation_GetFrameCount(&D_SY_60258A0) - 1; + } else if (this->index == 0) { + this->swork[21] = 8; + this->swork[31] = 13; + this->swork[32] = Animation_GetFrameCount(&D_SY_60258A0) - 1; } else { return; } - boss->swork[20] = 10; - boss->unk_04C = 0; - boss->fwork[34] = 2.8f; + this->swork[20] = 10; + this->unk_04C = 0; + this->fwork[34] = 2.8f; } -void SectorY_8019AAF0(Boss* boss) { +void SectorY_8019AAF0(Boss* this) { f32 var_fv1; f32 xAngle; f32 yAngle; @@ -908,199 +926,198 @@ void SectorY_8019AAF0(Boss* boss) { Vec3f vec; Vec3f vel; - SectorY_8019BBBC(boss); + SectorY_8019BBBC(this); - yAngle = Math_Atan2F(boss->fwork[18] - boss->obj.pos.x, boss->fwork[20] - boss->obj.pos.z); + yAngle = Math_Atan2F(this->fwork[18] - this->obj.pos.x, this->fwork[20] - this->obj.pos.z); var_fv1 = 500.0f; - if (boss->health != 0) { + if (this->health != 0) { var_fv1 += 200.0f; } - if ((boss->swork[31] >= boss->unk_04C) && (fabsf(boss->obj.pos.z - boss->fwork[20]) < (var_fv1 + 1000.0f)) && - (fabsf(boss->obj.pos.x - boss->fwork[18]) < var_fv1)) { - boss->unk_04C++; + if ((this->swork[31] >= this->unk_04C) && (fabsf(this->obj.pos.z - this->fwork[20]) < (var_fv1 + 1000.0f)) && + (fabsf(this->obj.pos.x - this->fwork[18]) < var_fv1)) { + this->unk_04C++; } - if (boss->unk_04C >= boss->swork[32] - 29) { - if (boss->unk_04C == boss->swork[32] - 29) { - if (boss->swork[31] == 11) { - AUDIO_PLAY_SFX(NA_SE_EN_MS_PUNCH, boss->sfxSource, 4); + if (this->unk_04C >= this->swork[32] - 29) { + if (this->unk_04C == this->swork[32] - 29) { + if (this->swork[31] == 11) { + AUDIO_PLAY_SFX(NA_SE_EN_MS_PUNCH, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_MS_KICK, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_MS_KICK, this->sfxSource, 4); } } - if (boss->unk_04C >= (boss->swork[32] - 5)) { - SectorY_80198244(boss); + if (this->unk_04C >= (this->swork[32] - 5)) { + SectorY_80198244(this); } } else { - Math_SmoothStepToF(&boss->fwork[9], boss->fwork[45] + 10.0f, 0.1f, 2.0f, 0.1f); + Math_SmoothStepToF(&this->fwork[9], this->fwork[45] + 10.0f, 0.1f, 2.0f, 0.1f); - var_ft5 = ABS(boss->fwork[18] - boss->obj.pos.x) + ABS(boss->fwork[20] - boss->obj.pos.z); - xAngle = -Math_Atan2F(boss->fwork[19] - boss->obj.pos.y, var_ft5); + var_ft5 = ABS(this->fwork[18] - this->obj.pos.x) + ABS(this->fwork[20] - this->obj.pos.z); + xAngle = -Math_Atan2F(this->fwork[19] - this->obj.pos.y, var_ft5); Matrix_RotateY(gCalcMatrix, yAngle, MTXF_NEW); Matrix_RotateX(gCalcMatrix, xAngle, MTXF_APPLY); vec.x = 0.0f; vec.y = 0.0f; - vec.z = boss->fwork[9]; + vec.z = this->fwork[9]; Matrix_MultVec3f(gCalcMatrix, &vec, &vel); - boss->vel.z = vel.z; - boss->vel.x = vel.x; - Math_SmoothStepToAngle(&boss->rot_078.y, Math_RadToDeg(yAngle), 0.1f, 6.0f, 0.1f); + this->vel.z = vel.z; + this->vel.x = vel.x; + Math_SmoothStepToAngle(&this->rot_078.y, Math_RadToDeg(yAngle), 0.1f, 6.0f, 0.1f); } - if (boss->swork[31] != 11) { + if (this->swork[31] != 11) { - if ((boss->rot_078.z <= 90.0f) || (boss->rot_078.z >= 270.0f)) { - boss->fwork[19] += 70.0f; + if ((this->rot_078.z <= 90.0f) || (this->rot_078.z >= 270.0f)) { + this->fwork[19] += 70.0f; } else { - boss->fwork[19] -= 50.0f; + this->fwork[19] -= 50.0f; } } - Math_SmoothStepToF(&boss->obj.pos.y, boss->fwork[19], 0.1f, 40.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, this->fwork[19], 0.1f, 40.0f, 0.1f); if (D_edisplay_801615D0.z > 0.0f) { - boss->swork[32] = 0; + this->swork[32] = 0; } - if (SectorY_8019B528(boss)) { - SectorY_80198ABC(boss); + if (SectorY_8019B528(this)) { + SectorY_80198ABC(this); } - if (boss->swork[20] == 10) { - boss->fwork[0] = 0.25f; + if (this->swork[20] == 10) { + this->fwork[0] = 0.25f; } - if ((boss->swork[20] == 10) && (boss->unk_04C >= 12)) { - boss->fwork[0] = 1.0f; + if ((this->swork[20] == 10) && (this->unk_04C >= 12)) { + this->fwork[0] = 1.0f; } } -void SectorY_8019AEC0(Boss* boss) { - boss->swork[20] = 11; - boss->swork[21] = 8; - boss->vel.x = 0.0f; - boss->vel.y = 0.0f; - boss->vel.z = 0.0f; - boss->unk_044 = 0; +void SectorY_8019AEC0(Boss* this) { + this->swork[20] = 11; + this->swork[21] = 8; + this->vel.x = 0.0f; + this->vel.y = 0.0f; + this->vel.z = 0.0f; + this->unk_044 = 0; } -void SectorY_8019AEEC(Boss* boss) { - if ((boss->obj.pos.y != 365.0f) && (boss->swork[21] != 1)) { - if (boss->unk_04A != 0) { - if (boss->unk_04A == 1) { +void SectorY_8019AEEC(Boss* this) { + if ((this->obj.pos.y != 365.0f) && (this->swork[21] != 1)) { + if (this->unk_04A != 0) { + if (this->unk_04A == 1) { Audio_PlaySequence(SEQ_PLAYER_BGM, NA_BGM_REAL_BOSS, 0, 0); - boss->unk_04A++; + this->unk_04A++; gPlayer[0].cam.eye.x = 0.0f; gPlayer[0].cam.eye.y = 200.0f; gPlayer[0].cam.eye.z = -20000.0f; gPlayer[0].cam.at.x = 0.0f; gPlayer[0].cam.at.y = 300.0f; - gPlayer[0].cam.at.z = boss->obj.pos.z; + gPlayer[0].cam.at.z = this->obj.pos.z; gPlayer[0].camRoll = 0.0f; Radio_PlayMessage(gMsg_ID_14300, RCID_BOSS_SECTORY); SectorY_801A0510(&gActors[59], 7); - gActors[59].obj.pos.y = boss->obj.pos.y - 202.0f; - gActors[59].obj.pos.x = boss->obj.pos.x; - gActors[59].obj.pos.z = boss->obj.pos.z - 30.0f; + gActors[59].obj.pos.y = this->obj.pos.y - 202.0f; + gActors[59].obj.pos.x = this->obj.pos.x; + gActors[59].obj.pos.z = this->obj.pos.z - 30.0f; gActors[59].state = 6; } - if (boss->obj.pos.y == 0.0f) { + if (this->obj.pos.y == 0.0f) { AUDIO_PLAY_SFX(NA_SE_LIFT_UP, gDefaultSfxSource, 4); } - Math_SmoothStepToF(&boss->obj.pos.y, 365.0f, 0.1f, 5.0f, 0.1f); + Math_SmoothStepToF(&this->obj.pos.y, 365.0f, 0.1f, 5.0f, 0.1f); Math_SmoothStepToF(&gActors[59].obj.pos.y, 153.0f, 0.1f, 5.0f, 0.1f); Math_SmoothStepToF(&gPlayer[0].cam.eye.z, -28300.0f, 1.0f, 100.0f, 1.0f); if (gPlayer[0].cam.eye.z == -28300.0f) { - Math_SmoothStepToF(&boss->fwork[46], 128.0f, 1.0f, 16.0f, 1.0f); - gBossHealthBar = boss->health * 1.7f; + Math_SmoothStepToF(&this->fwork[46], 128.0f, 1.0f, 16.0f, 1.0f); + gBossHealthBar = this->health * 1.7f; } - if (boss->obj.pos.y == 365.0f) { + if (this->obj.pos.y == 365.0f) { AUDIO_PLAY_SFX(NA_SE_LIFT_UP_END, gDefaultSfxSource, 4); - boss->timer_050 = 20; - boss->timer_056 = 135; + this->timer_050 = 20; + this->timer_056 = 135; } } } else { - gPlayer[0].cam.at.z = boss->obj.pos.z; + gPlayer[0].cam.at.z = this->obj.pos.z; Math_SmoothStepToF(&gPlayer[0].cam.eye.z, -29000.0f, 1.0f, 5.0f, 1.0f); Math_SmoothStepToF(&gPlayer[0].cam.eye.x, 2000.0f, 1.0f, 8.0f, 1.0f); - Math_SmoothStepToF(&boss->fwork[46], 0.0f, 1.0f, 16.0f, 1.0f); + Math_SmoothStepToF(&this->fwork[46], 0.0f, 1.0f, 16.0f, 1.0f); - if (boss->timer_050 == 0) { - boss->swork[21] = 0; + if (this->timer_050 == 0) { + this->swork[21] = 0; } - if (boss->timer_056 == 95) { + if (this->timer_056 == 95) { AUDIO_PLAY_SFX(NA_SE_EN_BURNER_L, gActors[59].sfxSource, 4); } - if (boss->timer_056 < 96) { + if (this->timer_056 < 96) { Math_SmoothStepToF(&gActors[59].fwork[0], 0.0f, 0.1f, 0.2f, 0.05f); - if (boss->timer_056 > 55) { - Math_SmoothStepToF(&boss->vel.z, 80.0f, 0.1f, 2.0f, 0.5f); + if (this->timer_056 > 55) { + Math_SmoothStepToF(&this->vel.z, 80.0f, 0.1f, 2.0f, 0.5f); Math_SmoothStepToF(&gActors[59].vel.z, 80.0f, 0.1f, 2.0f, 0.5f); - if (((gGameFrameCount % 2) == 0)) { - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y - 150.0f, boss->obj.pos.z, 0.0f, 0.0f, 0.0f, + if ((gGameFrameCount % 2) == 0) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y - 150.0f, this->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.1f, 5); } } } - if (boss->timer_056 == 55) { - D_i6_801A8440[0] = boss->sfxSource[0]; - D_i6_801A8440[1] = boss->sfxSource[1]; + if (this->timer_056 == 55) { + D_i6_801A8440[0] = this->sfxSource[0]; + D_i6_801A8440[1] = this->sfxSource[1]; D_i6_801A8440[2] = -500.0f; AUDIO_PLAY_SFX(NA_SE_EN_MS_DASH, D_i6_801A8440, 4); Audio_KillSfxBySource(gActors[59].sfxSource); - boss->fwork[34] = 4.5f; + this->fwork[34] = 4.5f; gActors[59].vel.z = -40.0f; - boss->vel.z = 120.0f; + this->vel.z = 120.0f; } - if (boss->timer_056 <= 55) { - boss->swork[21] = 1; - Math_SmoothStepToF(&boss->fwork[43], 0.0f, 0.1f, 0.1f, 0.1f); - Math_SmoothStepToF(&boss->vel.y, 20.0f, 0.1f, 5.0f, 0.5f); + if (this->timer_056 <= 55) { + this->swork[21] = 1; + Math_SmoothStepToF(&this->fwork[43], 0.0f, 0.1f, 0.1f, 0.1f); + Math_SmoothStepToF(&this->vel.y, 20.0f, 0.1f, 5.0f, 0.5f); Math_SmoothStepToF(&gActors[59].vel.z, 0.0f, 0.1f, 1.0f, 0.5f); } - if (boss->timer_056 == 0.0f) { - SectorY_80198244(boss); - boss->vel.z = 80.0f; - boss->fwork[13] = 80.0f; - boss->obj.pos.z = -12000.0f; + if (this->timer_056 == 0.0f) { + SectorY_80198244(this); + this->vel.z = 80.0f; + this->fwork[13] = 80.0f; + this->obj.pos.z = -12000.0f; gScenery360[0].obj.pos.z = -20000.0f; - boss->fwork[43] = 0.0f; - boss->vel.y = 0.0f; + this->fwork[43] = 0.0f; + this->vel.y = 0.0f; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_UpdateArwing360(&gPlayer[0], 1); + Camera_UpdateArwing360(&gPlayer[0], true); gPlayer[0].unk_014 = 0.0f; - boss->swork[34]++; + this->swork[34]++; Radio_PlayMessage(gMsg_ID_14310, RCID_BOSS_SECTORY); gBossFrameCount = 0; } } } -bool SectorY_8019B528(Boss* boss) { - - if (boss->timer_050 != 0) { +bool SectorY_8019B528(Boss* this) { + if (this->timer_050 != 0) { return false; } - if (boss->swork[33] <= ABS(boss->obj.pos.x)) { + if (this->swork[33] <= ABS(this->obj.pos.x)) { return true; } - if (boss->swork[33] <= ABS(boss->obj.pos.z)) { + if (this->swork[33] <= ABS(this->obj.pos.z)) { return true; } return false; } -bool SectorY_8019B5CC(Boss* boss) { +bool SectorY_8019B5CC(Boss* this) { f32 pad; Vec3f pos; @@ -1112,86 +1129,86 @@ bool SectorY_8019B5CC(Boss* boss) { return false; } - Math_Vec3fFromAngles(&pos, boss->rot_078.x, boss->rot_078.y, 700.0f); + Math_Vec3fFromAngles(&pos, this->rot_078.x, this->rot_078.y, 700.0f); - if ((fabsf(gScenery360[0].obj.pos.x - (boss->obj.pos.x + pos.x)) < 2500.0f) && - (fabsf(gScenery360[0].obj.pos.z - (boss->obj.pos.z + pos.z)) < 5000.0f) && - (fabsf(gScenery360[0].obj.pos.y - (boss->obj.pos.y + pos.y)) < 1800.0f)) { + if ((fabsf(gScenery360[0].obj.pos.x - (this->obj.pos.x + pos.x)) < 2500.0f) && + (fabsf(gScenery360[0].obj.pos.z - (this->obj.pos.z + pos.z)) < 5000.0f) && + (fabsf(gScenery360[0].obj.pos.y - (this->obj.pos.y + pos.y)) < 1800.0f)) { return true; } return false; } -void SectorY_8019B6E8(Boss* boss) { +void SectorY_8019B6E8(Boss* this) { f32 var4; f32 var3; f32 var2; f32 var; - var = ABS(ABS(gPlayer[0].pos.x - boss->obj.pos.x) + ABS(gPlayer[0].pos.y - boss->obj.pos.y) + - ABS(gPlayer[0].pos.z - 1000.0f - boss->obj.pos.z)); + var = ABS(ABS(gPlayer[0].pos.x - this->obj.pos.x) + ABS(gPlayer[0].pos.y - this->obj.pos.y) + + ABS(gPlayer[0].pos.z - 1000.0f - this->obj.pos.z)); - var2 = ABS(gActors[2].obj.pos.x - boss->obj.pos.x) + ABS(gActors[2].obj.pos.y - boss->obj.pos.y) + - ABS(gActors[2].obj.pos.z - boss->obj.pos.z); + var2 = ABS(gActors[2].obj.pos.x - this->obj.pos.x) + ABS(gActors[2].obj.pos.y - this->obj.pos.y) + + ABS(gActors[2].obj.pos.z - this->obj.pos.z); - var3 = ABS(gActors[3].obj.pos.x - boss->obj.pos.x) + ABS(gActors[3].obj.pos.y - boss->obj.pos.y) + - ABS(gActors[3].obj.pos.z - boss->obj.pos.z); + var3 = ABS(gActors[3].obj.pos.x - this->obj.pos.x) + ABS(gActors[3].obj.pos.y - this->obj.pos.y) + + ABS(gActors[3].obj.pos.z - this->obj.pos.z); - var4 = ABS(gActors[4].obj.pos.x - boss->obj.pos.x) + ABS(gActors[4].obj.pos.y - boss->obj.pos.y) + - ABS(gActors[4].obj.pos.z - boss->obj.pos.z); + var4 = ABS(gActors[4].obj.pos.x - this->obj.pos.x) + ABS(gActors[4].obj.pos.y - this->obj.pos.y) + + ABS(gActors[4].obj.pos.z - this->obj.pos.z); - boss->swork[22] = 1; - boss->fwork[18] = gPlayer[0].pos.x; - boss->fwork[19] = gPlayer[0].pos.y; - boss->fwork[20] = gPlayer[0].pos.z; - boss->fwork[24] = gPlayer[0].vel.x; - boss->fwork[25] = gPlayer[0].vel.y; - boss->fwork[26] = gPlayer[0].vel.z; + this->swork[22] = 1; + this->fwork[18] = gPlayer[0].pos.x; + this->fwork[19] = gPlayer[0].pos.y; + this->fwork[20] = gPlayer[0].pos.z; + this->fwork[24] = gPlayer[0].vel.x; + this->fwork[25] = gPlayer[0].vel.y; + this->fwork[26] = gPlayer[0].vel.z; if (var2 < var) { var = var2; - boss->swork[22]++; - boss->fwork[18] = gActors[2].obj.pos.x; - boss->fwork[19] = gActors[2].obj.pos.y; - boss->fwork[20] = gActors[2].obj.pos.z; - boss->fwork[24] = gActors[2].vel.x; - boss->fwork[25] = gActors[2].vel.y; - boss->fwork[26] = gActors[2].vel.z; + this->swork[22]++; + this->fwork[18] = gActors[2].obj.pos.x; + this->fwork[19] = gActors[2].obj.pos.y; + this->fwork[20] = gActors[2].obj.pos.z; + this->fwork[24] = gActors[2].vel.x; + this->fwork[25] = gActors[2].vel.y; + this->fwork[26] = gActors[2].vel.z; } if (var3 < var) { - boss->swork[22] = 3; - boss->fwork[18] = gActors[3].obj.pos.x; - boss->fwork[19] = gActors[3].obj.pos.y; - boss->fwork[20] = gActors[3].obj.pos.z; - boss->fwork[24] = gActors[3].vel.x; - boss->fwork[25] = gActors[3].vel.y; - boss->fwork[26] = gActors[3].vel.z; + this->swork[22] = 3; + this->fwork[18] = gActors[3].obj.pos.x; + this->fwork[19] = gActors[3].obj.pos.y; + this->fwork[20] = gActors[3].obj.pos.z; + this->fwork[24] = gActors[3].vel.x; + this->fwork[25] = gActors[3].vel.y; + this->fwork[26] = gActors[3].vel.z; var = var3; } if (var4 < var) { - boss->fwork[18] = gActors[4].obj.pos.x; - boss->fwork[19] = gActors[4].obj.pos.y; - boss->fwork[20] = gActors[4].obj.pos.z; - boss->fwork[24] = gActors[4].vel.x; - boss->fwork[25] = gActors[4].vel.y; - boss->fwork[26] = gActors[4].vel.z; - boss->swork[22] = 4; + this->fwork[18] = gActors[4].obj.pos.x; + this->fwork[19] = gActors[4].obj.pos.y; + this->fwork[20] = gActors[4].obj.pos.z; + this->fwork[24] = gActors[4].vel.x; + this->fwork[25] = gActors[4].vel.y; + this->fwork[26] = gActors[4].vel.z; + this->swork[22] = 4; } } -void SectorY_8019BBBC(Boss* boss) { - boss->fwork[18] = gPlayer[0].pos.x; - boss->fwork[19] = gPlayer[0].pos.y; - boss->fwork[20] = gPlayer[0].pos.z; - boss->fwork[24] = gPlayer[0].vel.x; - boss->fwork[25] = gPlayer[0].vel.y; - boss->fwork[26] = gPlayer[0].vel.z; +void SectorY_8019BBBC(Boss* this) { + this->fwork[18] = gPlayer[0].pos.x; + this->fwork[19] = gPlayer[0].pos.y; + this->fwork[20] = gPlayer[0].pos.z; + this->fwork[24] = gPlayer[0].vel.x; + this->fwork[25] = gPlayer[0].vel.y; + this->fwork[26] = gPlayer[0].vel.z; } -void SectorY_8019BC14(Boss* boss) { +void SectorY_8019BC14(Boss* this) { f32 sp4C; f32 sp48; f32 sp44; @@ -1200,34 +1217,34 @@ void SectorY_8019BC14(Boss* boss) { f32 sp38; f32 var_fa0; - if ((ABS(boss->obj.pos.x) >= 11000.0f) || (ABS(boss->obj.pos.z) >= 11000.0f)) { - boss->timer_052 = 2; + if ((ABS(this->obj.pos.x) >= 11000.0f) || (ABS(this->obj.pos.z) >= 11000.0f)) { + this->timer_052 = 2; return; } - if ((boss->swork[0x16] == 1) && (D_edisplay_801615D0.z > 0.0f)) { - boss->timer_052 = 2; + if ((this->swork[0x16] == 1) && (D_edisplay_801615D0.z > 0.0f)) { + this->timer_052 = 2; return; } - if (boss->swork[0x16] != 1) { - var_fa0 = ((ABS(boss->fwork[0x12] - boss->fwork[1]) + ABS(boss->fwork[0x14] - boss->fwork[3]) + - ABS(boss->fwork[0x13] - boss->fwork[2])) / + if (this->swork[0x16] != 1) { + var_fa0 = ((ABS(this->fwork[0x12] - this->fwork[1]) + ABS(this->fwork[0x14] - this->fwork[3]) + + ABS(this->fwork[0x13] - this->fwork[2])) / 140.0f) - 2.0f; - boss->fwork[0x12] = boss->fwork[0x12] + boss->fwork[0x18] * var_fa0; - boss->fwork[0x13] = boss->fwork[0x13] + boss->fwork[0x19] * var_fa0; - boss->fwork[0x14] = boss->fwork[0x14] + boss->fwork[0x1A] * var_fa0; + this->fwork[0x12] = this->fwork[0x12] + this->fwork[0x18] * var_fa0; + this->fwork[0x13] = this->fwork[0x13] + this->fwork[0x19] * var_fa0; + this->fwork[0x14] = this->fwork[0x14] + this->fwork[0x1A] * var_fa0; } - if ((fabsf(boss->fwork[3] - boss->fwork[0x14]) > 300.0f) || (fabsf(boss->fwork[1] - boss->fwork[0x12]) > 300.0f)) { + if ((fabsf(this->fwork[3] - this->fwork[0x14]) > 300.0f) || (fabsf(this->fwork[1] - this->fwork[0x12]) > 300.0f)) { sp3C = Math_RadToDeg( - Math_Atan2F(boss->fwork[0x12] - boss->fwork[1] - boss->rot_078.x, boss->fwork[0x14] - boss->fwork[3])); - sp40 = ABS(boss->fwork[0x12] - boss->fwork[1]) + ABS(boss->fwork[0x14] - boss->fwork[3]); - sp40 = Math_RadToDeg(-Math_Atan2F(boss->fwork[0x13] - boss->fwork[2], sp40)); - sp38 = Math_RadToDeg(Math_Atan2F(boss->fwork[1] - boss->fwork[0x15], boss->fwork[3] - boss->fwork[0x17])); - var_fa0 = ABS(boss->fwork[1] - boss->fwork[0x15]) + ABS(boss->fwork[3] - boss->fwork[0x17]); - var_fa0 = Math_RadToDeg(-Math_Atan2F(boss->fwork[2] - boss->fwork[0x16], var_fa0)); + Math_Atan2F(this->fwork[0x12] - this->fwork[1] - this->rot_078.x, this->fwork[0x14] - this->fwork[3])); + sp40 = ABS(this->fwork[0x12] - this->fwork[1]) + ABS(this->fwork[0x14] - this->fwork[3]); + sp40 = Math_RadToDeg(-Math_Atan2F(this->fwork[0x13] - this->fwork[2], sp40)); + sp38 = Math_RadToDeg(Math_Atan2F(this->fwork[1] - this->fwork[0x15], this->fwork[3] - this->fwork[0x17])); + var_fa0 = ABS(this->fwork[1] - this->fwork[0x15]) + ABS(this->fwork[3] - this->fwork[0x17]); + var_fa0 = Math_RadToDeg(-Math_Atan2F(this->fwork[2] - this->fwork[0x16], var_fa0)); sp38 = sp3C - sp38; var_fa0 = sp40 - var_fa0; @@ -1239,43 +1256,43 @@ void SectorY_8019BC14(Boss* boss) { } if (((sp38 < 41.0f) || (sp38 > 319.0f)) && ((var_fa0 < 41.0f) || (var_fa0 > 319.0f))) { - boss->timer_054 = 4; - boss->fwork[4] = 30.0f; + this->timer_054 = 4; + this->fwork[4] = 30.0f; sp4C = gPlayer[0].pos.x; sp48 = gPlayer[0].pos.y; sp44 = gPlayer[0].pos.z; - gPlayer[0].pos.x = boss->fwork[0x12]; - gPlayer[0].pos.y = boss->fwork[0x13]; - gPlayer[0].trueZpos = gPlayer[0].pos.z = boss->fwork[0x14]; + gPlayer[0].pos.x = this->fwork[0x12]; + gPlayer[0].pos.y = this->fwork[0x13]; + gPlayer[0].trueZpos = gPlayer[0].pos.z = this->fwork[0x14]; - func_effect_8007F11C(OBJ_EFFECT_354, boss->fwork[1], boss->fwork[2], boss->fwork[3], 100.0f); + Effect_EnemyLaser(OBJ_EFFECT_354, this->fwork[1], this->fwork[2], this->fwork[3], 100.0f); gPlayer[0].pos.x = sp4C; gPlayer[0].pos.y = sp48; gPlayer[0].trueZpos = gPlayer[0].pos.z = sp44; - if (boss->index == 0) { - AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_L, boss->sfxSource, 4); + if (this->index == 0) { + AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_L, this->sfxSource, 4); } else { - AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_S, boss->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_S, this->sfxSource, 4); } } } - if (boss->index == 0) { - boss->timer_052 = RAND_INT(20.0f) + 15; + if (this->index == 0) { + this->timer_052 = RAND_INT(20.0f) + 15; } else { - boss->timer_052 = RAND_INT(20.0f) + 25; + this->timer_052 = RAND_INT(20.0f) + 25; } } -void SectorY_8019C194(Boss* boss, f32 zSpeed, f32 xSpeed) { +void SectorY_8019C194(Boss* this, f32 zSpeed, f32 xSpeed) { f32 sp2C; f32 sp28; - if ((gBossFrameCount > 250) && (boss->fwork[34] == 2.8f)) { + if ((gBossFrameCount > 250) && (this->fwork[34] == 2.8f)) { switch (D_ctx_80177A10[8]) { case 0: if (gTeamShields[TEAM_ID_FALCO] > 0) { @@ -1301,68 +1318,68 @@ void SectorY_8019C194(Boss* boss, f32 zSpeed, f32 xSpeed) { } if ((xSpeed > 800.0f) || (zSpeed > 300.0f)) { - boss->fwork[44] += 8.0f; - if (boss->fwork[44] >= 360.0f) { - boss->fwork[44] = 0.0f; + this->fwork[44] += 8.0f; + if (this->fwork[44] >= 360.0f) { + this->fwork[44] = 0.0f; } - if (boss->index == 0) { - sp2C = SIN_DEG(boss->fwork[44]) * ABS(boss->vel.z * 1.5f); - boss->obj.pos.x += sp2C; + if (this->index == 0) { + sp2C = SIN_DEG(this->fwork[44]) * ABS(this->vel.z * 1.5f); + this->obj.pos.x += sp2C; - sp28 = SIN_DEG(boss->fwork[44]) * ABS(boss->vel.x * 1.5f); - boss->obj.pos.z += sp28; + sp28 = SIN_DEG(this->fwork[44]) * ABS(this->vel.x * 1.5f); + this->obj.pos.z += sp28; } else { - sp2C = SIN_DEG(boss->fwork[44]) * ABS(boss->vel.z * 1.2f); - boss->obj.pos.x += sp2C; + sp2C = SIN_DEG(this->fwork[44]) * ABS(this->vel.z * 1.2f); + this->obj.pos.x += sp2C; - sp28 = SIN_DEG(boss->fwork[44]) * ABS(boss->vel.x * 1.2f); - boss->obj.pos.z += sp28; + sp28 = SIN_DEG(this->fwork[44]) * ABS(this->vel.x * 1.2f); + this->obj.pos.z += sp28; } - if (!SectorY_8019B5CC(boss)) { - if (boss->index == 0) { - boss->obj.pos.y += SIN_DEG(boss->fwork[44]) * 30.0f; + if (!SectorY_8019B5CC(this)) { + if (this->index == 0) { + this->obj.pos.y += SIN_DEG(this->fwork[44]) * 30.0f; } else { - boss->obj.pos.y += SIN_DEG(boss->fwork[44]) * 10.0f; + this->obj.pos.y += SIN_DEG(this->fwork[44]) * 10.0f; } } - if (boss->index == 0) { - if (ABS(boss->vel.z) < ABS(boss->vel.x)) { + if (this->index == 0) { + if (ABS(this->vel.z) < ABS(this->vel.x)) { sp2C = sp28; - if ((boss->obj.rot.z <= 90.0f) || (boss->obj.rot.z >= 270.0f)) { - if ((boss->obj.rot.y >= 45.0f) && (boss->obj.rot.y <= 135.0f)) { + if ((this->obj.rot.z <= 90.0f) || (this->obj.rot.z >= 270.0f)) { + if ((this->obj.rot.y >= 45.0f) && (this->obj.rot.y <= 135.0f)) { sp2C = -sp28; } } else { - if ((boss->obj.rot.y >= 225.0f) && (boss->obj.rot.y <= 315.0f)) { + if ((this->obj.rot.y >= 225.0f) && (this->obj.rot.y <= 315.0f)) { sp2C = -sp28; } } } else { - if ((boss->obj.rot.z <= 90.0f) || (boss->obj.rot.z >= 270.0f)) { - if ((boss->obj.rot.y >= 135.0f) && (boss->obj.rot.y <= 225.0f)) { + if ((this->obj.rot.z <= 90.0f) || (this->obj.rot.z >= 270.0f)) { + if ((this->obj.rot.y >= 135.0f) && (this->obj.rot.y <= 225.0f)) { sp2C = -sp2C; } } else { - if ((boss->obj.rot.y <= 45.0f) || (boss->obj.rot.y >= 315.0f)) { + if ((this->obj.rot.y <= 45.0f) || (this->obj.rot.y >= 315.0f)) { sp2C = -sp2C; } } } if (sp2C == 0.0f) { - boss->fwork[41] = ABS(sp2C * 0.01f) + 0.8f; + this->fwork[41] = ABS(sp2C * 0.01f) + 0.8f; } if (sp2C > 0.0f) { - if (boss->fwork[41] == 0.0f) { - boss->fwork[41] = ABS(sp2C * 0.01f) + 0.8f; - AUDIO_PLAY_SFX(NA_SE_ARWING_BRAKE, boss->sfxSource, 4); + if (this->fwork[41] == 0.0f) { + this->fwork[41] = ABS(sp2C * 0.01f) + 0.8f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BRAKE, this->sfxSource, 4); } - } else if (boss->fwork[42] == 0.0f) { - boss->fwork[42] = ABS(sp2C * 0.01f) + 0.8f; - AUDIO_PLAY_SFX(NA_SE_ARWING_BRAKE, boss->sfxSource, 4); + } else if (this->fwork[42] == 0.0f) { + this->fwork[42] = ABS(sp2C * 0.01f) + 0.8f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BRAKE, this->sfxSource, 4); } } } @@ -1373,7 +1390,7 @@ static BossFuncs D_i6_801A6910[] = { SectorY_80199DAC, SectorY_8019A520, SectorY_8019A66C, SectorY_8019A898, SectorY_8019AAF0, SectorY_8019AEEC, }; -void SectorY_Boss_Update(Boss* boss) { +void SectorY_Boss_Update(BossSY* this) { s32 i; f32 sp1E8; f32 sp1E4; @@ -1383,135 +1400,142 @@ void SectorY_Boss_Update(Boss* boss) { f32 sp1D4; s32 sp1D0; RadarMark* radarMark; - Vec3f sp64[30]; - Vec3f sp58; - Vec3f sp4C; + Vec3f frameTable[30]; + Vec3f src; + Vec3f dest; s32 pad; if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { - if (boss->swork[34] == 1) { - if (boss->health > 0) { + if (this->swork[34] == 1) { + if (this->health > 0) { gScenery360[0].obj.pos.z += 20.0f; } if (gScenery360[0].obj.pos.z == 0.0f) { - boss->swork[34]++; + this->swork[34]++; } } - if (boss->index == 2) { - if ((ABS(boss->obj.pos.x - gBosses[1].obj.pos.x) < 800.0f) && - (ABS(boss->obj.pos.z - gBosses[1].obj.pos.z) < 800.0f) && boss->health > 0 && gBosses[1].health > 0) { - if (ABS(boss->obj.pos.y - gBosses[1].obj.pos.y) <= 800.0f) { - boss->obj.pos.y += 20.0f; + + if (this->index == 2) { + if ((ABS(this->obj.pos.x - gBosses[1].obj.pos.x) < 800.0f) && + (ABS(this->obj.pos.z - gBosses[1].obj.pos.z) < 800.0f) && (this->health > 0) && + (gBosses[1].health > 0)) { + if (ABS(this->obj.pos.y - gBosses[1].obj.pos.y) <= 800.0f) { + this->obj.pos.y += 20.0f; gBosses[1].obj.pos.y -= 20.0f; } } } - if ((boss->fwork[34] <= 1.0f) && (boss->fwork[34] > 0.5f)) { - Audio_KillSfxBySource(boss->sfxSource); + if ((this->fwork[34] <= 1.0f) && (this->fwork[34] > 0.5f)) { + Audio_KillSfxBySource(this->sfxSource); } gBossFrameCount++; - boss->fwork[0] = 0.1f; - if (boss->swork[24] != 0) { - boss->swork[24]--; - } - if (boss->health > 0) { - D_i6_801A6910[boss->swork[20]](boss); - } - if (boss->timer_058 != 0) { - SectorY_80199438(boss); + this->fwork[0] = 0.1f; + + if (this->swork[24] != 0) { + this->swork[24]--; } - if ((boss->swork[29] != 0) && !(boss->swork[29] & gGameFrameCount)) { - func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, - boss->vel.z, 0.1f, 5); + if (this->health > 0) { + D_i6_801A6910[this->swork[20]](this); } - switch (boss->swork[21]) { + if (this->timer_058 != 0) { + SectorY_80199438(this); + } + + if ((this->swork[29] != 0) && !(this->swork[29] & gGameFrameCount)) { + func_effect_8007C120(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, + this->vel.z, 0.1f, 5); + } + + switch (this->swork[21]) { case 0: - boss->unk_04C = Animation_GetFrameCount(&D_SY_602B778) - 1; - sp1D0 = Animation_GetFrameData(&D_SY_602B778, boss->unk_04C, sp64); + this->unk_04C = Animation_GetFrameCount(&D_SY_602B778) - 1; + sp1D0 = Animation_GetFrameData(&D_SY_602B778, this->unk_04C, frameTable); break; case 1: - boss->unk_04C = Animation_GetFrameCount(&D_SY_60265B4) - 1; - sp1D0 = Animation_GetFrameData(&D_SY_60265B4, boss->unk_04C, sp64); + this->unk_04C = Animation_GetFrameCount(&D_SY_60265B4) - 1; + sp1D0 = Animation_GetFrameData(&D_SY_60265B4, this->unk_04C, frameTable); break; case 2: - boss->unk_04C = Animation_GetFrameCount(&D_SY_6029B48) - 1; - sp1D0 = Animation_GetFrameData(&D_SY_6029B48, boss->unk_04C, sp64); + this->unk_04C = Animation_GetFrameCount(&D_SY_6029B48) - 1; + sp1D0 = Animation_GetFrameData(&D_SY_6029B48, this->unk_04C, frameTable); break; case 3: - boss->unk_04C = Animation_GetFrameCount(&D_SY_602B8DC) - 1; - sp1D0 = Animation_GetFrameData(&D_SY_602B8DC, boss->unk_04C, sp64); + this->unk_04C = Animation_GetFrameCount(&D_SY_602B8DC) - 1; + sp1D0 = Animation_GetFrameData(&D_SY_602B8DC, this->unk_04C, frameTable); break; case 4: - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SY_6003348)) { - boss->unk_04C = Animation_GetFrameCount(&D_SY_6003348) - 1; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SY_6003348)) { + this->unk_04C = Animation_GetFrameCount(&D_SY_6003348) - 1; } - sp1D0 = Animation_GetFrameData(&D_SY_6003348, boss->unk_04C, sp64); + sp1D0 = Animation_GetFrameData(&D_SY_6003348, this->unk_04C, frameTable); break; case 5: - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SY_602738C)) { - boss->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SY_602738C)) { + this->unk_04C = 0; } - sp1D0 = Animation_GetFrameData(&D_SY_602738C, boss->unk_04C, sp64); + sp1D0 = Animation_GetFrameData(&D_SY_602738C, this->unk_04C, frameTable); break; case 6: - sp1D0 = Animation_GetFrameData(&D_SY_602738C, boss->unk_04C, sp64); + sp1D0 = Animation_GetFrameData(&D_SY_602738C, this->unk_04C, frameTable); break; case 7: - if (boss->unk_04C < (Animation_GetFrameCount(&D_SY_602645C) - 1)) { - boss->unk_04C++; + if (this->unk_04C < (Animation_GetFrameCount(&D_SY_602645C) - 1)) { + this->unk_04C++; } - sp1D0 = Animation_GetFrameData(&D_SY_602645C, boss->unk_04C, sp64); + sp1D0 = Animation_GetFrameData(&D_SY_602645C, this->unk_04C, frameTable); break; case 8: - if (boss->unk_04C < (Animation_GetFrameCount(&D_SY_60258A0) - 1)) { - boss->unk_04C++; + if (this->unk_04C < (Animation_GetFrameCount(&D_SY_60258A0) - 1)) { + this->unk_04C++; } - sp1D0 = Animation_GetFrameData(&D_SY_60258A0, boss->unk_04C, sp64); + sp1D0 = Animation_GetFrameData(&D_SY_60258A0, this->unk_04C, frameTable); break; case 9: - boss->unk_04C++; - if (boss->unk_04C >= Animation_GetFrameCount(&D_SY_60034C4)) { - boss->unk_04C = 0; + this->unk_04C++; + if (this->unk_04C >= Animation_GetFrameCount(&D_SY_60034C4)) { + this->unk_04C = 0; } - sp1D0 = Animation_GetFrameData(&D_SY_60034C4, boss->unk_04C, sp64); + sp1D0 = Animation_GetFrameData(&D_SY_60034C4, this->unk_04C, frameTable); break; } - boss->obj.rot.x = boss->rot_078.x; - boss->obj.rot.y = boss->rot_078.y; - boss->obj.rot.z = boss->rot_078.z; + this->obj.rot.x = this->rot_078.x; + this->obj.rot.y = this->rot_078.y; + this->obj.rot.z = this->rot_078.z; - Matrix_RotateZ(gCalcMatrix, -boss->vwork[29].z * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -boss->vwork[29].x * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -boss->vwork[29].y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -this->vwork[29].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_APPLY); - if ((boss->health > 0) && (boss->swork[20] < 10)) { - sp58.x = boss->fwork[18] - boss->obj.pos.x; - sp58.y = boss->fwork[19] - boss->obj.pos.y; - sp58.z = boss->fwork[20] - boss->obj.pos.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - sp1E4 = Math_RadToDeg(Math_Atan2F(sp4C.x, sp4C.z)); - sp1E8 = Math_RadToDeg(-Math_Atan2F(sp4C.y, sqrtf(SQ(sp4C.x) + SQ(sp4C.z)))); + if ((this->health > 0) && (this->swork[20] < 10)) { + src.x = this->fwork[18] - this->obj.pos.x; + src.y = this->fwork[19] - this->obj.pos.y; + src.z = this->fwork[20] - this->obj.pos.z; + + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + + sp1E4 = Math_RadToDeg(Math_Atan2F(dest.x, dest.z)); + sp1E8 = Math_RadToDeg(-Math_Atan2F(dest.y, sqrtf(SQ(dest.x) + SQ(dest.z)))); if ((sp1E8 > 30.0f) && (sp1E8 <= 180.0f)) { sp1E8 = 30.0f; @@ -1526,16 +1550,16 @@ void SectorY_Boss_Update(Boss* boss) { sp1E4 = 280.0f; } - Math_SmoothStepToAngle(&boss->fwork[6], sp1E4, 0.2f, 4.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[5], sp1E8, 0.2f, 4.0f, 0.1f); - Matrix_RotateX(gCalcMatrix, -boss->fwork[5] * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -boss->fwork[6] * M_DTOR, MTXF_APPLY); - sp58.x = boss->fwork[18] - boss->obj.pos.x; - sp58.y = (boss->fwork[19] - boss->obj.pos.y) + 20.0f; - sp58.z = boss->fwork[20] - boss->obj.pos.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - sp1E0 = Math_RadToDeg(Math_Atan2F(sp4C.x, sp4C.z)); - sp1DC = Math_RadToDeg(-Math_Atan2F(sp4C.y, sqrtf(SQ(sp4C.x) + SQ(sp4C.z)))); + Math_SmoothStepToAngle(&this->fwork[6], sp1E4, 0.2f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[5], sp1E8, 0.2f, 4.0f, 0.1f); + Matrix_RotateX(gCalcMatrix, -this->fwork[5] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->fwork[6] * M_DTOR, MTXF_APPLY); + src.x = this->fwork[18] - this->obj.pos.x; + src.y = (this->fwork[19] - this->obj.pos.y) + 20.0f; + src.z = this->fwork[20] - this->obj.pos.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + sp1E0 = Math_RadToDeg(Math_Atan2F(dest.x, dest.z)); + sp1DC = Math_RadToDeg(-Math_Atan2F(dest.y, sqrtf(SQ(dest.x) + SQ(dest.z)))); if ((sp1DC > 30.0f) && (sp1DC <= 180.0f)) { sp1DC = 30.0f; @@ -1550,14 +1574,14 @@ void SectorY_Boss_Update(Boss* boss) { sp1E0 = 280.0f; } - Math_SmoothStepToAngle(&boss->fwork[8], sp1E0, 0.4f, 8.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[7], sp1DC, 0.4f, 8.0f, 0.1f); - sp58.x = (boss->fwork[18] - boss->obj.pos.x) + (COS_DEG(boss->obj.rot.y) * 100.0f); - sp58.y = (boss->fwork[19] - boss->obj.pos.y) - 80.0f; - sp58.z = boss->fwork[20] - boss->obj.pos.z; - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - sp1D8 = Math_RadToDeg(Math_Atan2F(sp4C.x, sp4C.z)); - sp1D4 = Math_RadToDeg(-Math_Atan2F(sp4C.y, sqrtf(SQ(sp4C.x) + SQ(sp4C.z)))); + Math_SmoothStepToAngle(&this->fwork[8], sp1E0, 0.4f, 8.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[7], sp1DC, 0.4f, 8.0f, 0.1f); + src.x = (this->fwork[18] - this->obj.pos.x) + (COS_DEG(this->obj.rot.y) * 100.0f); + src.y = (this->fwork[19] - this->obj.pos.y) - 80.0f; + src.z = this->fwork[20] - this->obj.pos.z; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + sp1D8 = Math_RadToDeg(Math_Atan2F(dest.x, dest.z)); + sp1D4 = Math_RadToDeg(-Math_Atan2F(dest.y, sqrtf(SQ(dest.x) + SQ(dest.z)))); if ((sp1D4 > 80.0f) && (sp1D4 <= 180.0f)) { sp1D4 = 80.0f; @@ -1572,16 +1596,16 @@ void SectorY_Boss_Update(Boss* boss) { sp1D8 = 350.0f; } - Math_SmoothStepToAngle(&boss->fwork[15], sp1D8, 0.2f, 4.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[14], sp1D4, 0.2f, 4.0f, 0.1f); - Matrix_RotateX(gCalcMatrix, -boss->fwork[14] * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gCalcMatrix, -boss->fwork[15] * M_DTOR, MTXF_APPLY); - sp58.x = boss->fwork[18] - boss->obj.pos.x; - sp58.y = (boss->fwork[19] - boss->obj.pos.y) + (COS_DEG(boss->obj.rot.z) * 40.0f); - sp58.z = (boss->fwork[20] - boss->obj.pos.z) - (COS_DEG(boss->obj.rot.y) * 60.0f); - Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - sp1E4 = Math_RadToDeg(Math_Atan2F(sp4C.x, sp4C.z)); - sp1E8 = Math_RadToDeg(-Math_Atan2F(sp4C.y, sqrtf(SQ(sp4C.x) + SQ(sp4C.z)))); + Math_SmoothStepToAngle(&this->fwork[15], sp1D8, 0.2f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[14], sp1D4, 0.2f, 4.0f, 0.1f); + Matrix_RotateX(gCalcMatrix, -this->fwork[14] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->fwork[15] * M_DTOR, MTXF_APPLY); + src.x = this->fwork[18] - this->obj.pos.x; + src.y = (this->fwork[19] - this->obj.pos.y) + (COS_DEG(this->obj.rot.z) * 40.0f); + src.z = (this->fwork[20] - this->obj.pos.z) - (COS_DEG(this->obj.rot.y) * 60.0f); + Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); + sp1E4 = Math_RadToDeg(Math_Atan2F(dest.x, dest.z)); + sp1E8 = Math_RadToDeg(-Math_Atan2F(dest.y, sqrtf(SQ(dest.x) + SQ(dest.z)))); if ((sp1E8 > 80.0f) && (sp1E8 <= 180.0f)) { sp1E8 = 80.0f; @@ -1596,52 +1620,52 @@ void SectorY_Boss_Update(Boss* boss) { sp1E4 = 270.0f; } - Math_SmoothStepToAngle(&boss->fwork[17], sp1E4, 0.2f, 4.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[16], sp1E8, 0.2f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[17], sp1E4, 0.2f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[16], sp1E8, 0.2f, 4.0f, 0.1f); } else { - Math_SmoothStepToAngle(&boss->fwork[6], 0.0f, 0.2f, 4.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[5], 0.0f, 0.2f, 4.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[8], 0.0f, 0.4f, 8.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[7], 0.0f, 0.4f, 8.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[15], 0.0f, 0.4f, 8.0f, 0.1f); - Math_SmoothStepToAngle(&boss->fwork[14], 0.0f, 0.4f, 8.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[6], 0.0f, 0.2f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[5], 0.0f, 0.2f, 4.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[8], 0.0f, 0.4f, 8.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[7], 0.0f, 0.4f, 8.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[15], 0.0f, 0.4f, 8.0f, 0.1f); + Math_SmoothStepToAngle(&this->fwork[14], 0.0f, 0.4f, 8.0f, 0.1f); } - Math_SmoothStepToF(&boss->fwork[4], 0.0f, 0.2f, 10.0f, 0.0f); - Math_SmoothStepToF(&boss->fwork[34], 0.0f, 0.1f, 0.2f, 0.05f); - Math_SmoothStepToF(&boss->fwork[41], 0.0f, 0.1f, 0.05f, 0.05f); - Math_SmoothStepToF(&boss->fwork[42], 0.0f, 0.1f, 0.05f, 0.05f); - Math_SmoothStepToVec3fArray(sp64, boss->vwork, 1, sp1D0, boss->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[4], 0.0f, 0.2f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->fwork[34], 0.0f, 0.1f, 0.2f, 0.05f); + Math_SmoothStepToF(&this->fwork[41], 0.0f, 0.1f, 0.05f, 0.05f); + Math_SmoothStepToF(&this->fwork[42], 0.0f, 0.1f, 0.05f, 0.05f); + Math_SmoothStepToVec3fArray(frameTable, this->vwork, 1, sp1D0, this->fwork[0], 100.0f, 0.0f); - if ((boss->dmgType != DMG_NONE) && (boss->health > 0)) { - boss->dmgType = DMG_NONE; - if (boss->dmgPart == 0) { - if (boss->swork[25] == 0) { - boss->swork[24] = 15; - AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, boss->sfxSource, 4); + if ((this->dmgType != DMG_NONE) && (this->health > 0)) { + this->dmgType = DMG_NONE; + if (this->dmgPart == 0) { + if (this->swork[25] == 0) { + this->swork[24] = 15; + AUDIO_PLAY_SFX(NA_SE_EN_REFLECT, this->sfxSource, 4); } else { - SectorY_80198F5C(boss); + SectorY_80198F5C(this); } } else { - SectorY_80198F5C(boss); + SectorY_80198F5C(this); } } - if (boss->index == 0) { - radarMark = &gRadarMarks[boss->index + 1]; + if (this->index == 0) { + radarMark = &gRadarMarks[this->index + 1]; radarMark->status = 1; radarMark->type = 102; - radarMark->pos.x = boss->obj.pos.x; - radarMark->pos.y = boss->obj.pos.y; - radarMark->pos.z = boss->obj.pos.z; - radarMark->yRot = boss->rot_078.y + 180.0f; + radarMark->pos.x = this->obj.pos.x; + radarMark->pos.y = this->obj.pos.y; + radarMark->pos.z = this->obj.pos.z; + radarMark->yRot = this->rot_078.y + 180.0f; } else { - radarMark = &gRadarMarks[boss->index + 4]; + radarMark = &gRadarMarks[this->index + 4]; radarMark->status = 1; radarMark->type = 10; - radarMark->pos.x = boss->obj.pos.x; - radarMark->pos.y = boss->obj.pos.y; - radarMark->pos.z = boss->obj.pos.z; - radarMark->yRot = boss->rot_078.y + 180.0f; + radarMark->pos.x = this->obj.pos.x; + radarMark->pos.y = this->obj.pos.y; + radarMark->pos.z = this->obj.pos.z; + radarMark->yRot = this->rot_078.y + 180.0f; } if (gBossFrameCount == 250) { @@ -1651,31 +1675,31 @@ void SectorY_Boss_Update(Boss* boss) { } } } - if ((gBossFrameCount == 250) && (gTeamShields[TEAM_ID_SLIPPY] != 0) && (boss->swork[34] == 0)) { + if ((gBossFrameCount == 250) && (gTeamShields[TEAM_ID_SLIPPY] != 0) && (this->swork[34] == 0)) { Radio_PlayMessage(gMsg_ID_2225, RCID_SLIPPY); } - if ((gBossFrameCount == 620) && (boss->swork[34] == 0)) { + if ((gBossFrameCount == 620) && (this->swork[34] == 0)) { gShowBossHealth = 1; } - if ((gBossFrameCount >= 350) || (boss->swork[34] != 0)) { - if (boss->swork[34] != 0) { - gBossHealthBar = boss->health * 1.7f; + if ((gBossFrameCount >= 350) || (this->swork[34] != 0)) { + if (this->swork[34] != 0) { + gBossHealthBar = this->health * 1.7f; } else if (gBosses[0].unk_04A == 0) { gBossHealthBar = (gBosses[1].health + gBosses[2].health) * 1.275f; } } if (D_edisplay_801615D0.z > 0.0f) { - boss->swork[30]++; - if (boss->swork[30] > 300 && ((ABS(D_edisplay_801615D0.z) + ABS(D_edisplay_801615D0.x)) < 3500.0f) && + this->swork[30]++; + if (this->swork[30] > 300 && ((ABS(D_edisplay_801615D0.z) + ABS(D_edisplay_801615D0.x)) < 3500.0f) && (gRadioState == 0)) { if (gTeamShields[TEAM_ID_PEPPY] > 0) { Radio_PlayMessage(gMsg_ID_2282, RCID_PEPPY); } - boss->swork[30] = 150; + this->swork[30] = 150; } - if (boss->swork[30] > 100) { + if (this->swork[30] > 100) { if ((((ABS(D_edisplay_801615D0.z) + ABS(D_edisplay_801615D0.x)) < 500.0f) && gTeamShields[TEAM_ID_FALCO] > 0)) { Radio_PlayMessage(gMsg_ID_2233, RCID_FALCO); @@ -1689,7 +1713,7 @@ void SectorY_Boss_Update(Boss* boss) { } } else { - boss->swork[30] = 0; + this->swork[30] = 0; } } } @@ -1739,7 +1763,7 @@ bool SectorY_8019DC4C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -bool SectorY_8019DE10(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool SectorY_Boss_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Boss* boss = (Boss*) data; Vec3f sp38 = { 0.0f, 0.0f, 0.0f }; @@ -1791,7 +1815,7 @@ bool SectorY_8019DE10(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void SectorY_8019E014(s32 limbIndex, Vec3f* rot, void* data) { +void SectorY_Boss_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp7C = { 40.0f, -30.0f, 0.0f }; Vec3f sp70 = { -40.0f, -30.0f, 0.0f }; Vec3f sp64 = { 0.0f, 0.0f, 0.0f }; @@ -1862,7 +1886,7 @@ void SectorY_8019E014(s32 limbIndex, Vec3f* rot, void* data) { static f32 D_i6_801A69AC[20] = { 0.3f, 0.7f, 1.3f, 0.7f, 0.3f, 0.0f, 10.0f, 20.0f, 300.0f, 100.0f, 200.0f, 100.0f, 60.0f, -260.0f, 80.0f, 100.0f, 80.0f, 262.0f, 285.0f, 252.0f }; -void SectorY_Boss_Draw(Boss* boss) { +void SectorY_Boss_Draw(Boss* this) { f32 sp9C; f32 sp98; f32 sp94; @@ -1870,40 +1894,41 @@ void SectorY_Boss_Draw(Boss* boss) { f32 sp8C; f32 sp88; - if ((boss->index != 0) || ((boss->swork[24] % 2) != 0) || ((boss->timer_05C % 2) != 0)) { + if ((this->index != 0) || ((this->swork[24] % 2) != 0) || ((this->timer_05C % 2) != 0)) { RCP_SetupDL_30(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } - if ((boss->health > 0) || (boss->swork[36] == 0)) { - Animation_DrawSkeleton(2, D_SY_602D140, boss->vwork, SectorY_8019DE10, SectorY_8019E014, boss, gCalcMatrix); - if (boss->timer_054 != 0) { - sp9C = D_i6_801A69AC[boss->timer_054]; + if ((this->health > 0) || (this->swork[36] == 0)) { + Animation_DrawSkeleton(2, D_SY_602D140, this->vwork, SectorY_Boss_OverrideLimbDraw, SectorY_Boss_PostLimbDraw, + this, gCalcMatrix); + if (this->timer_054 != 0) { + sp9C = D_i6_801A69AC[this->timer_054]; RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[1], boss->fwork[2], boss->fwork[3], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[1], this->fwork[2], this->fwork[3], MTXF_APPLY); Matrix_Scale(gGfxMatrix, sp9C, sp9C, sp9C, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } - if (boss->fwork[34] != 0.0f) { + if (this->fwork[34] != 0.0f) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[31], boss->fwork[32], boss->fwork[33], MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[34], boss->fwork[34], boss->fwork[34], MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); - sp98 = gPlayer[0].cam.eye.x - boss->obj.pos.x; - sp94 = gPlayer[0].cam.eye.y - boss->obj.pos.y; - sp90 = gPlayer[0].cam.eye.z - (boss->obj.pos.z + gPathProgress); + Matrix_Translate(gGfxMatrix, this->fwork[31], this->fwork[32], this->fwork[33], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[34], this->fwork[34], this->fwork[34], MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -this->obj.rot.z * M_DTOR, MTXF_APPLY); + sp98 = gPlayer[0].cam.eye.x - this->obj.pos.x; + sp94 = gPlayer[0].cam.eye.y - this->obj.pos.y; + sp90 = gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress); sp8C = -Math_Atan2F(sp98, sp90); sp9C = sqrtf(SQ(sp90) + SQ(sp98)); sp88 = Math_Atan2F(sp94, sp9C); @@ -1913,59 +1938,59 @@ void SectorY_Boss_Draw(Boss* boss) { gSPDisplayList(gMasterDisp++, D_1024AC0); } - if (boss->index == 0) { - if (boss->fwork[41] != 0.0f) { + if (this->index == 0) { + if (this->fwork[41] != 0.0f) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[35], boss->fwork[36], boss->fwork[37], MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, boss->obj.rot.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[41] * 2.0f, boss->fwork[41], boss->fwork[41] * 2.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[35], this->fwork[36], this->fwork[37], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[41] * 2.0f, this->fwork[41], this->fwork[41] * 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } - if (boss->fwork[42] != 0.0f) { + if (this->fwork[42] != 0.0f) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[38], boss->fwork[39], boss->fwork[40], MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, boss->obj.rot.y * M_DTOR, MTXF_APPLY); - Matrix_RotateX(gGfxMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[42] * 2.0f, boss->fwork[42], boss->fwork[42] * 2.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->fwork[38], this->fwork[39], this->fwork[40], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[42] * 2.0f, this->fwork[42], this->fwork[42] * 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } } - if (boss->fwork[43] != 0.0f) { + if (this->fwork[43] != 0.0f) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->obj.pos.x, 157.0f, boss->obj.pos.z, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, 157.0f, this->obj.pos.z, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, boss->fwork[43], boss->fwork[43], boss->fwork[43], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[43], this->fwork[43], this->fwork[43], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } - if (boss->fwork[46] != 0.0f) { + if (this->fwork[46] != 0.0f) { RCP_SetupDL_49(); - gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) boss->fwork[46], (s32) boss->fwork[46], 0, - (s32) boss->fwork[46]); + gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[46], (s32) this->fwork[46], 0, + (s32) this->fwork[46]); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->obj.pos.x + 10.0f, boss->obj.pos.y + 70.0f, boss->obj.pos.z + 60.0f, + Matrix_Translate(gGfxMatrix, this->obj.pos.x + 10.0f, this->obj.pos.y + 70.0f, this->obj.pos.z + 60.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 0.4f, 0.2f, 0.2f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -1985,18 +2010,19 @@ static Vec3f D_i6_801A69FC[10] = { }; void SectorY_8019EB80(void) { - Actor* actor = gActors; + ActorCutscene* actor = &gActors[0]; s32 i; - s32 var_s1; + s32 actorCount; if (gHitCount >= 100) { - var_s1 = 9; + actorCount = 9; } else { - var_s1 = 2; + actorCount = 2; } + Rand_SetSeed(1, 29100, 9786); - for (i = 0; i <= (var_s1); i++, actor++) { + for (i = 0; i <= actorCount; i++, actor++) { if (((i == 0) && (gTeamShields[TEAM_ID_PEPPY] <= 0.0f)) || ((i == 1) && (gTeamShields[TEAM_ID_SLIPPY] <= 0.0f)) || ((i == 2) && (gTeamShields[TEAM_ID_FALCO] <= 0.0f))) { @@ -2005,13 +2031,17 @@ void SectorY_8019EB80(void) { Actor_Initialize(actor); actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_CUTSCENE; + actor->obj.pos.x = (D_i6_801A69FC[i].x * 0.5f) + gPlayer[0].pos.x + RAND_FLOAT_CENTERED_SEEDED(2000.0f); actor->obj.pos.y = D_i6_801A69FC[i].y + gPlayer[0].pos.y + RAND_FLOAT_SEEDED(1000.0f); actor->obj.pos.z = D_i6_801A69FC[i].z + gPlayer[0].pos.z + RAND_FLOAT_SEEDED(1000.0f); + actor->rot_0F4.z = RAND_FLOAT_CENTERED_SEEDED(200.0f); + actor->vwork[0].x = (D_i6_801A69FC[i].x * 0.5f) + gPlayer[0].pos.x; actor->vwork[0].y = D_i6_801A69FC[i].y + gPlayer[0].pos.y; actor->vwork[0].z = D_i6_801A69FC[i].z + gPlayer[0].pos.z; + actor->state = 1; Object_SetInfo(&actor->info, actor->obj.id); @@ -2365,106 +2395,105 @@ void SectorY_LevelComplete(Player* player) { player->rockAngle = SIN_DEG(player->rockPhase); } -void SectorY_8019FF00(Actor* actor) { +void SectorY_8019FF00(Actor* this) { Vec3f sp4C; Vec3f sp40; - f32 temp1; - f32 temp2; + f32 x; + f32 z; - switch (actor->state) { + switch (this->state) { case 1: - Math_SmoothStepToF(&actor->obj.pos.x, actor->vwork[0].x, 0.02f, 2.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.y, actor->vwork[0].y, 0.02f, 2.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.z, actor->vwork[0].z, 0.02f, 2.0f, 0.0001f); - Math_SmoothStepToF(&actor->rot_0F4.z, 0.0f, 0.02f, 0.2f, 0.0001f); - if ((actor->animFrame != 0) && ((((s32) (actor->index % 8U) * 10) + 1030) < gCsFrameCount)) { - actor->state = 4; + Math_SmoothStepToF(&this->obj.pos.x, this->vwork[0].x, 0.02f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.y, this->vwork[0].y, 0.02f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->obj.pos.z, this->vwork[0].z, 0.02f, 2.0f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.z, 0.0f, 0.02f, 0.2f, 0.0001f); + if ((this->animFrame != 0) && ((((s32) (this->index % 8U) * 10) + 1030) < gCsFrameCount)) { + this->state = 4; } break; case 2: - actor->state = 3; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); - actor->fwork[29] = 5.0f; + this->state = 3; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); + this->fwork[29] = 5.0f; /* fallthrough */ case 3: - actor->iwork[11] = 2; - actor->fwork[0] += 2.0f; - actor->rot_0F4.x += 0.1f; + this->iwork[11] = 2; + this->fwork[0] += 2.0f; + this->rot_0F4.x += 0.1f; break; case 5: - Math_SmoothStepToF(&actor->rot_0F4.x, 0.0f, 0.1f, 5.0f, 0.0f); - temp1 = actor->obj.pos.x - gBosses[actor->timer_04C].obj.pos.x; - temp2 = actor->obj.pos.z - gBosses[actor->timer_04C].obj.pos.z; - Math_SmoothStepToAngle(&actor->rot_0F4.z, - Math_SmoothStepToAngle(&actor->rot_0F4.y, Math_RadToDeg(Math_Atan2F(temp1, temp2)), - 0.5f, 2.0f, 0.0001f) * - 30.0f, - 0.1f, 5.0f, 0.0001f); + Math_SmoothStepToF(&this->rot_0F4.x, 0.0f, 0.1f, 5.0f, 0.0f); + x = this->obj.pos.x - gBosses[this->timer_04C].obj.pos.x; + z = this->obj.pos.z - gBosses[this->timer_04C].obj.pos.z; + Math_SmoothStepToAngle( + &this->rot_0F4.z, + Math_SmoothStepToAngle(&this->rot_0F4.y, Math_RadToDeg(Math_Atan2F(x, z)), 0.5f, 2.0f, 0.0001f) * 30.0f, + 0.1f, 5.0f, 0.0001f); break; case 7: - actor->rot_0F4.y = gPlayer[0].rot.y; - actor->rot_0F4.z = gPlayer[0].rot.z; - Math_SmoothStepToF(&actor->obj.pos.y, 50.0f, 0.1f, 1.0f, 0.0f); + this->rot_0F4.y = gPlayer[0].rot.y; + this->rot_0F4.z = gPlayer[0].rot.z; + Math_SmoothStepToF(&this->obj.pos.y, 50.0f, 0.1f, 1.0f, 0.0f); if (gPlayer[0].rot.y == 0.0f) { - Math_SmoothStepToF(&actor->obj.pos.x, 1300.0f, 1.0f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, 1300.0f, 1.0f, 2.0f, 0.0f); } else { if (gCsFrameCount == 540) { - actor->fwork[29] = 3.8f; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); + this->fwork[29] = 3.8f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); } - Math_SmoothStepToF(&actor->obj.pos.x, 230.0f, 1.0f, 13.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, 230.0f, 1.0f, 13.0f, 0.0f); } break; case 8: - Math_SmoothStepToF(&actor->obj.pos.y, -100.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, -100.0f, 0.1f, 1.0f, 0.0f); if (gCsFrameCount >= 535) { if (gCsFrameCount == 535) { - actor->fwork[29] = 3.8f; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); + this->fwork[29] = 3.8f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); } - Math_SmoothStepToF(&actor->obj.pos.x, -1000.0f, 1.0f, 20.0f, 0.0f); - Math_SmoothStepToAngle(&actor->rot_0F4.z, 45.0f, 1.0f, 4.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, -1000.0f, 1.0f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.z, 45.0f, 1.0f, 4.0f, 0.0f); } else { - actor->rot_0F4.y = gPlayer[0].rot.y; - actor->rot_0F4.z = gPlayer[0].rot.z; - Math_SmoothStepToF(&actor->obj.pos.x, -230.0f, 1.0f, 13.0f, 0.0f); + this->rot_0F4.y = gPlayer[0].rot.y; + this->rot_0F4.z = gPlayer[0].rot.z; + Math_SmoothStepToF(&this->obj.pos.x, -230.0f, 1.0f, 13.0f, 0.0f); } break; case 9: - Math_SmoothStepToF(&actor->obj.pos.y, -50.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.y, -50.0f, 0.1f, 1.0f, 0.0f); if (gCsFrameCount >= 525) { if (gCsFrameCount == 525) { - actor->fwork[29] = 3.8f; - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); + this->fwork[29] = 3.8f; + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); } - Math_SmoothStepToF(&actor->obj.pos.x, 1500.0f, 1.0f, 20.0f, 0.0f); - Math_SmoothStepToAngle(&actor->rot_0F4.z, 315.0f, 1.0f, 2.0f, 0.0f); + Math_SmoothStepToF(&this->obj.pos.x, 1500.0f, 1.0f, 20.0f, 0.0f); + Math_SmoothStepToAngle(&this->rot_0F4.z, 315.0f, 1.0f, 2.0f, 0.0f); } else { - actor->rot_0F4.y = gPlayer[0].rot.y; - actor->rot_0F4.z = gPlayer[0].rot.z; - Math_SmoothStepToF(&actor->obj.pos.x, 150.0f, 1.0f, 13.0f, 0.0f); + this->rot_0F4.y = gPlayer[0].rot.y; + this->rot_0F4.z = gPlayer[0].rot.z; + Math_SmoothStepToF(&this->obj.pos.x, 150.0f, 1.0f, 13.0f, 0.0f); } break; } - if (actor->state != 6) { - Matrix_RotateY(gCalcMatrix, (actor->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); - Matrix_RotateX(gCalcMatrix, -(actor->rot_0F4.x * M_DTOR), MTXF_APPLY); + if (this->state != 6) { + Matrix_RotateY(gCalcMatrix, (this->rot_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(this->rot_0F4.x * M_DTOR), MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = 0.0f; - sp4C.z = actor->fwork[0]; + sp4C.z = this->fwork[0]; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp4C, &sp40); - actor->vel.x = sp40.x; - actor->vel.y = sp40.y; - actor->vel.z = sp40.z; - actor->obj.rot.x = -actor->rot_0F4.x; - actor->obj.rot.y = actor->rot_0F4.y + 180.0f; - actor->obj.rot.z = -actor->rot_0F4.z; + this->vel.x = sp40.x; + this->vel.y = sp40.y; + this->vel.z = sp40.z; + this->obj.rot.x = -this->rot_0F4.x; + this->obj.rot.y = this->rot_0F4.y + 180.0f; + this->obj.rot.z = -this->rot_0F4.z; } } @@ -2474,56 +2503,56 @@ static Vec3f D_i6_801A6A74[10] = { { -10100.0f, -300.0f, -600.0f }, { -10300.0f { -200.0f, -2400.0f, -12650.0f }, { 0.0f, 4000.0f, -600.0f }, { -10800.0f, 900.0f, -600.0f }, { -2750.0f, 900.0f, -9150.0f } }; -void SectorY_801A0510(Actor* actor, s32 arg1) { +void SectorY_801A0510(ActorCutscene* this, s32 arg1) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = D_i6_801A6A74[arg1].x; - actor->obj.pos.y = D_i6_801A6A74[arg1].y; - actor->obj.pos.z = D_i6_801A6A74[arg1].z; + this->obj.pos.x = D_i6_801A6A74[arg1].x; + this->obj.pos.y = D_i6_801A6A74[arg1].y; + this->obj.pos.z = D_i6_801A6A74[arg1].z; switch (arg1) { case 0: case 1: case 2: case 8: - actor->animFrame = 38; - actor->obj.rot.y = 90.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->animFrame = 38; + this->obj.rot.y = 90.0f; + Object_SetInfo(&this->info, this->obj.id); break; case 3: - actor->animFrame = 36; - actor->vel.z = -5.0f; - actor->scale = 1.0f; - actor->obj.rot.y = 180.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->animFrame = 36; + this->vel.z = -5.0f; + this->scale = 1.0f; + this->obj.rot.y = 180.0f; + Object_SetInfo(&this->info, this->obj.id); break; case 4: - actor->animFrame = 37; - actor->obj.rot.y = 90.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->animFrame = 37; + this->obj.rot.y = 90.0f; + Object_SetInfo(&this->info, this->obj.id); break; case 5: case 9: - actor->animFrame = 39; - actor->obj.rot.y = 180.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->animFrame = 39; + this->obj.rot.y = 180.0f; + Object_SetInfo(&this->info, this->obj.id); break; case 6: - actor->animFrame = 36; - actor->obj.rot.y = 180.0f; - actor->scale = 1.0f; - Object_SetInfo(&actor->info, actor->obj.id); + this->animFrame = 36; + this->obj.rot.y = 180.0f; + this->scale = 1.0f; + Object_SetInfo(&this->info, this->obj.id); break; case 7: - actor->animFrame = 40; - Object_SetInfo(&actor->info, actor->obj.id); + this->animFrame = 40; + Object_SetInfo(&this->info, this->obj.id); break; default: @@ -2536,74 +2565,76 @@ static Vec3f D_i6_801A6AEC[5] = { { 0.0f, 345.0f, 350.0f }, { 90.0f, 87.0f, 93.0f }, }; -void SectorY_801A06A4(Actor* actor, s32 arg1) { - +void SectorY_801A06A4(ActorCutscene* this, s32 arg1) { if (gTeamShields[1 + arg1] > 0) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->obj.pos.x = gPlayer[0].pos.x + D_i6_801A6AEC[arg1].x; - actor->obj.pos.y = gPlayer[0].pos.y + D_i6_801A6AEC[arg1].y; - actor->obj.pos.z = gPlayer[0].pos.z + D_i6_801A6AEC[arg1].z; - actor->fwork[0] = gPlayer[0].baseSpeed; - actor->rot_0F4.y = gPlayer[0].rot.y; - actor->rot_0F4.z = gPlayer[0].rot.z; - actor->state = arg1 + 7; - actor->iwork[11] = 1; - Object_SetInfo(&actor->info, actor->obj.id); - AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, actor->sfxSource, 4); - AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, actor->sfxSource, 0); + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->obj.pos.x = gPlayer[0].pos.x + D_i6_801A6AEC[arg1].x; + this->obj.pos.y = gPlayer[0].pos.y + D_i6_801A6AEC[arg1].y; + this->obj.pos.z = gPlayer[0].pos.z + D_i6_801A6AEC[arg1].z; + + this->fwork[0] = gPlayer[0].baseSpeed; + this->rot_0F4.y = gPlayer[0].rot.y; + this->rot_0F4.z = gPlayer[0].rot.z; + this->state = arg1 + 7; + this->iwork[11] = 1; + Object_SetInfo(&this->info, this->obj.id); + AUDIO_PLAY_SFX(NA_SE_ARWING_ENGINE_FG, this->sfxSource, 4); + AUDIO_PLAY_SFX(NA_SE_ARWING_BOOST, this->sfxSource, 0); } } -void SectorY_801A07FC(Actor* actor0, Actor* actor1) { - Vec3f sp3C; - Vec3f sp30; +void SectorY_801A07FC(Actor* actor0, ActorCutscene* actor1) { + Vec3f src; + Vec3f dest; Actor_Initialize(actor1); actor1->obj.status = OBJ_ACTIVE; actor1->obj.id = OBJ_ACTOR_CUTSCENE; actor0->fwork[6] = 1.8f; - sp3C.x = -40.0f; - sp3C.y = 0.0f; - sp3C.z = 80.0f; + src.x = -40.0f; + src.y = 0.0f; + src.z = 80.0f; Matrix_RotateY(gCalcMatrix, actor0->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, actor0->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, actor0->obj.rot.z * M_DTOR, MTXF_APPLY); - Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); - actor1->obj.pos.x = actor0->obj.pos.x + sp30.x; - actor1->obj.pos.y = actor0->obj.pos.y + sp30.y; - actor1->obj.pos.z = actor0->obj.pos.z + sp30.z; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + actor1->obj.pos.x = actor0->obj.pos.x + dest.x; + actor1->obj.pos.y = actor0->obj.pos.y + dest.y; + actor1->obj.pos.z = actor0->obj.pos.z + dest.z; Object_SetInfo(&actor1->info, actor1->obj.id); Matrix_RotateY(gCalcMatrix, actor0->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, actor0->obj.rot.x * M_DTOR, MTXF_APPLY); - sp3C.x = 0.0f; - sp3C.y = 0.0f; - sp3C.z = 160.0f; - Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); + src.x = 0.0f; + src.y = 0.0f; + src.z = 160.0f; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); actor1->timer_0BC = 100; - actor1->vel.x = sp30.x; - actor1->vel.y = sp30.y; - actor1->vel.z = sp30.z; + actor1->vel.x = dest.x; + actor1->vel.y = dest.y; + actor1->vel.z = dest.z; actor1->obj.rot.x = actor0->obj.rot.x; actor1->obj.rot.y = actor0->obj.rot.y; actor1->animFrame = 42; AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_S, actor1->sfxSource, 4); } -void SectorY_801A0A08(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { - Actor_Initialize(actor); - actor->obj.status = OBJ_ACTIVE; - actor->obj.id = OBJ_ACTOR_CUTSCENE; - actor->fwork[0] = arg4; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - Object_SetInfo(&actor->info, actor->obj.id); - actor->timer_0BC = 35; - actor->iwork[0] = 255; - actor->animFrame = 43; - AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_S, actor->sfxSource, 4); +void SectorY_801A0A08(ActorCutscene* this, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { + Actor_Initialize(this); + this->obj.status = OBJ_ACTIVE; + this->obj.id = OBJ_ACTOR_CUTSCENE; + + this->fwork[0] = arg4; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + Object_SetInfo(&this->info, this->obj.id); + this->timer_0BC = 35; + this->iwork[0] = 255; + this->animFrame = 43; + AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_S, this->sfxSource, 4); } void SectorY_801A0AC0(Player* player) { @@ -2648,7 +2679,7 @@ void SectorY_801A0AC0(Player* player) { } if ((gGameFrameCount & 12) && ((gGameFrameCount % 4) == 0)) { - spB0 = (((gGameFrameCount & 12) >> 2) + 4); + spB0 = ((gGameFrameCount & 12) >> 2) + 4; for (i = 10; i < ARRAY_COUNT(gActors); i++) { if (gActors[i].obj.status == OBJ_FREE) { SectorY_801A07FC(&gActors[spB0], &gActors[i]); @@ -2656,7 +2687,7 @@ void SectorY_801A0AC0(Player* player) { } } } - if (((gGameFrameCount % 4) == 0)) { + if ((gGameFrameCount % 4) == 0) { spB0 = ((s32) (gGameFrameCount % 16U) >> 2) + 4; if (spB0 == 4) { if (gCsFrameCount < 140) { @@ -3346,21 +3377,28 @@ void SectorY_801A0AC0(Player* player) { gActors[7].obj.pos.z = -7100.0f; gActors[8].obj.pos.z = -8100.0f; gActors[9].obj.pos.z = -7100.0f; + D_ctx_80177A48[0] = 1.0f; + player->pos.z = player->trueZpos = 0.0f; player->baseSpeed = gArwingSpeed; + AUDIO_PLAY_BGM(NA_BGM_STAGE_SY); + gLevelStartStatusScreenTimer = 100; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->csState = 0; player->csTimer = 0; player->csEventTimer = 0; + gCsCamEyeX = player->pos.x; gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; gCsCamEyeZ = 400.0f; gCsCamAtX = player->pos.x; gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; gCsCamAtZ = player->trueZpos; + player->cam.eye.x = player->pos.x; player->cam.eye.y = player->pos.y * player->unk_148; player->cam.eye.y += 50.0f; @@ -3397,20 +3435,21 @@ void SectorY_801A0AC0(Player* player) { player->trueZpos = player->pos.z + player->camDist; } -void SectorY_SetupDebris(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, s32 state) { - Actor_Initialize(actor); - actor->obj.status = OBJ_INIT; - actor->obj.id = OBJ_ACTOR_DEBRIS; - actor->state = state; - actor->obj.pos.x = xPos; - actor->obj.pos.y = yPos; - actor->obj.pos.z = zPos; - actor->vel.x = xVel; - actor->vel.y = yVel; - actor->vel.z = zVel; - actor->scale = 2.5f; - actor->timer_0BC = RAND_INT(15.0f) + 15.0f; - Object_SetInfo(&actor->info, actor->obj.id); +void SectorY_SetupDebris(ActorDebris* this, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, s32 state) { + Actor_Initialize(this); + this->obj.status = OBJ_INIT; + this->obj.id = OBJ_ACTOR_DEBRIS; + + this->state = state; + this->obj.pos.x = xPos; + this->obj.pos.y = yPos; + this->obj.pos.z = zPos; + this->vel.x = xVel; + this->vel.y = yVel; + this->vel.z = zVel; + this->scale = 2.5f; + this->timer_0BC = RAND_INT(15.0f) + 15.0f; + Object_SetInfo(&this->info, this->obj.id); } void SectorY_SpawnDebris(f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, s32 state) { @@ -3555,7 +3594,7 @@ void SectorY_Actor204_Update(Actor204* this) { gPlayer[0].pos.x += RAND_FLOAT_CENTERED(300.0f); gPlayer[0].pos.y += RAND_FLOAT_CENTERED(300.0f); } - func_effect_8007F11C(OBJ_EFFECT_354, this->fwork[16], this->fwork[17], this->fwork[18], 100.0f); + Effect_EnemyLaser(OBJ_EFFECT_354, this->fwork[16], this->fwork[17], this->fwork[18], 100.0f); gPlayer[0].pos.x = sp1E4; gPlayer[0].pos.y = sp1E0; AUDIO_PLAY_SFX(NA_SE_EN_MS_SHOT_S, this->sfxSource, 4); @@ -3749,7 +3788,7 @@ static s32 D_i6_801A6B28[3] = { 255, 150, 150 }; static s32 D_i6_801A6B34[3] = { 150, 255, 150 }; static s32 D_i6_801A6B40[6] = { 150, 150, 255 }; -bool SectorY_801A4A18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { +bool SectorY_Actor204_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { Actor* actor = (Actor*) data; if (limbIndex == 4) { @@ -3786,7 +3825,7 @@ bool SectorY_801A4A18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } -void SectorY_801A4C34(s32 limbIndex, Vec3f* rot, void* data) { +void SectorY_Actor204_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { Vec3f sp2C = { 40.0f, -30.0f, 0.0f }; Vec3f sp20; Actor* actor = (Actor*) data; @@ -3807,7 +3846,8 @@ void SectorY_Actor204_Draw(Actor204* this) { f32 scale; RCP_SetupDL_30(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - Animation_DrawSkeleton(2, D_SY_602D140, this->vwork, SectorY_801A4A18, SectorY_801A4C34, this, gCalcMatrix); + Animation_DrawSkeleton(2, D_SY_602D140, this->vwork, SectorY_Actor204_OverrideLimbDraw, + SectorY_Actor204_PostLimbDraw, this, gCalcMatrix); if (this->timer_0C4 != 0) { scale = D_i6_801A6B64[this->timer_0C4]; @@ -3824,69 +3864,70 @@ void SectorY_Actor204_Draw(Actor204* this) { } } -void SectorY_801A4E44(Scenery* scenery) { - Vec3f sp3C; - Vec3f sp30; +void SectorY_Scenery109_Update(Scenery* scenery) { + Vec3f src; + Vec3f dest; if (scenery->state == 0) { AUDIO_PLAY_SFX(NA_SE_OB_BROKEN_SPARK_L, scenery->sfxSource, 4); scenery->state++; } - if (((gGameFrameCount % 4) == 0)) { + + if ((gGameFrameCount % 4) == 0) { Matrix_RotateY(gCalcMatrix, scenery->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, scenery->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, scenery->obj.rot.z * M_DTOR, MTXF_APPLY); - sp3C.x = RAND_FLOAT_CENTERED(100.0f) + 500.0f; - sp3C.y = RAND_FLOAT_CENTERED(900.0f) + -150.0f; - sp3C.z = 90.0f - RAND_FLOAT(50.0f); - Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); - func_effect_8007C120(scenery->obj.pos.x + sp30.x, scenery->obj.pos.y + sp30.y, scenery->obj.pos.z + sp30.z, + src.x = RAND_FLOAT_CENTERED(100.0f) + 500.0f; + src.y = RAND_FLOAT_CENTERED(900.0f) + -150.0f; + src.z = 90.0f - RAND_FLOAT(50.0f); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + func_effect_8007C120(scenery->obj.pos.x + dest.x, scenery->obj.pos.y + dest.y, scenery->obj.pos.z + dest.z, scenery->effectVel.x, scenery->effectVel.y, scenery->effectVel.z, 0.2f, 5); - sp3C.x = RAND_FLOAT_CENTERED(100.0f) + -500.0f; - sp3C.y = RAND_FLOAT_CENTERED(900.0f); - sp3C.z = 80.0f - RAND_FLOAT(50.0f); - Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); - func_effect_8007C120(scenery->obj.pos.x + sp30.x, scenery->obj.pos.y + sp30.y, scenery->obj.pos.z + sp30.z, + src.x = RAND_FLOAT_CENTERED(100.0f) + -500.0f; + src.y = RAND_FLOAT_CENTERED(900.0f); + src.z = 80.0f - RAND_FLOAT(50.0f); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + func_effect_8007C120(scenery->obj.pos.x + dest.x, scenery->obj.pos.y + dest.y, scenery->obj.pos.z + dest.z, scenery->effectVel.x, scenery->effectVel.y, scenery->effectVel.z, 0.2f, 5); - sp3C.x = RAND_FLOAT_CENTERED(100.0f) + 500.0f; - sp3C.y = RAND_FLOAT_CENTERED(900.0f) + -50.0f; - sp3C.z = 1900.0f - RAND_FLOAT(50.0f); - Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); - func_effect_8007C120(scenery->obj.pos.x + sp30.x, scenery->obj.pos.y + sp30.y, scenery->obj.pos.z + sp30.z, + src.x = RAND_FLOAT_CENTERED(100.0f) + 500.0f; + src.y = RAND_FLOAT_CENTERED(900.0f) + -50.0f; + src.z = 1900.0f - RAND_FLOAT(50.0f); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + func_effect_8007C120(scenery->obj.pos.x + dest.x, scenery->obj.pos.y + dest.y, scenery->obj.pos.z + dest.z, scenery->effectVel.x, scenery->effectVel.y, scenery->effectVel.z, 0.2f, 5); - sp3C.x = RAND_FLOAT_CENTERED(100.0f) + -1000.0f; - sp3C.y = RAND_FLOAT_CENTERED(900.0f) + -250.0f; - sp3C.z = 1100.0f - RAND_FLOAT(50.0f); - Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); - func_effect_8007C120(scenery->obj.pos.x + sp30.x, scenery->obj.pos.y + sp30.y, scenery->obj.pos.z + sp30.z, + src.x = RAND_FLOAT_CENTERED(100.0f) + -1000.0f; + src.y = RAND_FLOAT_CENTERED(900.0f) + -250.0f; + src.z = 1100.0f - RAND_FLOAT(50.0f); + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + func_effect_8007C120(scenery->obj.pos.x + dest.x, scenery->obj.pos.y + dest.y, scenery->obj.pos.z + dest.z, scenery->effectVel.x, scenery->effectVel.y, scenery->effectVel.z, 0.2f, 5); } } -void SectorY_801A52B8(Scenery* scenery) { - Vec3f sp44; - Vec3f sp38; +void SectorY_Scenery112_Update(Scenery* scenery) { + Vec3f src; + Vec3f dest; if (scenery->state == 0) { AUDIO_PLAY_SFX(NA_SE_OB_BROKEN_SPARK_L, scenery->sfxSource, 4); scenery->state++; } - if (((gGameFrameCount % 4) == 0)) { + if ((gGameFrameCount % 4) == 0) { Matrix_RotateY(gCalcMatrix, scenery->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, scenery->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_RotateZ(gCalcMatrix, scenery->obj.rot.z * M_DTOR, MTXF_APPLY); - sp44.x = RAND_FLOAT_CENTERED(100.0f) + -800.0f; - sp44.y = RAND_FLOAT_CENTERED(300.0f) + -100.0f; - sp44.z = RAND_FLOAT_CENTERED(5000.0f) + 500.0f; - Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38); - func_effect_8007C120(scenery->obj.pos.x + sp38.x, scenery->obj.pos.y + sp38.y, scenery->obj.pos.z + sp38.z, + src.x = RAND_FLOAT_CENTERED(100.0f) + -800.0f; + src.y = RAND_FLOAT_CENTERED(300.0f) + -100.0f; + src.z = RAND_FLOAT_CENTERED(5000.0f) + 500.0f; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + func_effect_8007C120(scenery->obj.pos.x + dest.x, scenery->obj.pos.y + dest.y, scenery->obj.pos.z + dest.z, scenery->effectVel.x, scenery->effectVel.y, scenery->effectVel.z, 0.3f, 5); - sp44.x = RAND_FLOAT_CENTERED(100.0f) + -600.0f; - sp44.y = RAND_FLOAT_CENTERED(250.0f) + 300.0f; - sp44.z = RAND_FLOAT_CENTERED(1500.0f) + -1650.0f; - Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38); - func_effect_8007C120(scenery->obj.pos.x + sp38.x, scenery->obj.pos.y + sp38.y, scenery->obj.pos.z + sp38.z, + src.x = RAND_FLOAT_CENTERED(100.0f) + -600.0f; + src.y = RAND_FLOAT_CENTERED(250.0f) + 300.0f; + src.z = RAND_FLOAT_CENTERED(1500.0f) + -1650.0f; + Matrix_MultVec3f(gCalcMatrix, &src, &dest); + func_effect_8007C120(scenery->obj.pos.x + dest.x, scenery->obj.pos.y + dest.y, scenery->obj.pos.z + dest.z, scenery->effectVel.x, scenery->effectVel.y, scenery->effectVel.z, 0.2f, 5); } } diff --git a/src/overlays/ovl_i6/fox_ve2.c b/src/overlays/ovl_i6/fox_ve2.c index 86c3713a..70d1f6a0 100644 --- a/src/overlays/ovl_i6/fox_ve2.c +++ b/src/overlays/ovl_i6/fox_ve2.c @@ -1,12 +1,18 @@ +/* + * File: fox_ve2.c + * System: Venom2 + * Description: Level: Venom 2 + */ + #include "global.h" #include "assets/ast_venom_2.h" -void Venom2_Boss_Update(Boss* boss) { +void Venom2_Boss_Update(BossVE2* boss) { Math_SmoothStepToF(&boss->fwork[0], boss->fwork[1], 0.5f, 5.0f, 0.0f); } -bool Venom2_8019624C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { - Boss* boss = (Boss*) data; +bool Venom2_Boss_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { + BossVE2* boss = (BossVE2*) data; if ((limbIndex == 1) || (limbIndex == 2)) { pos->x -= boss->fwork[0]; @@ -15,25 +21,25 @@ bool Venom2_8019624C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* d return false; } -void Venom2_Boss_Draw(Boss* boss) { +void Venom2_Boss_Draw(BossVE2* boss) { Animation_GetFrameData(&D_VE2_6014904, 0, boss->vwork); - Animation_DrawSkeleton(3, D_VE2_60149D0, boss->vwork, Venom2_8019624C, NULL, boss, gCalcMatrix); + Animation_DrawSkeleton(3, D_VE2_60149D0, boss->vwork, Venom2_Boss_OverrideLimbDraw, NULL, boss, gCalcMatrix); } -void Venom2_801962F4(Actor* actor) { +void Venom2_UpdateStarWolfEvents(ActorAllRange* actor) { ActorAllRange_UpdateStarWolfEvents(actor); } -static Vec3f D_i6_801A68B0[6] = { +static Vec3f sTeamInitPos[6] = { { 0.0f, 4030.0f, 18000.0f }, { -500.0f, 3820.0f, 17200.0f }, { 550.0f, 3750.0f, 17000.0f }, { 1000.0f, 300.0f, 0.0f }, { -1000.0f, 300.0f, 0.0f }, { 0.0f, 500.0f, 0.0f }, }; -static f32 D_i6_801A68F8[3] = { 300.0f, 70.0f, 280.0f }; +static f32 sTeamInitRot[3] = { 300.0f, 70.0f, 280.0f }; -void Venom2_UpdateEvents(Actor* this) { - Actor* team; - Actor* wolf = &gActors[4]; +void Venom2_UpdateEvents(ActorAllRange* this) { + ActorAllRange* team; + ActorAllRange* wolf = &gActors[4]; Player* player = &gPlayer[0]; s32 i; @@ -64,20 +70,19 @@ void Venom2_UpdateEvents(Actor* this) { player->rot.x = -20.0f; player->yRot_114 = 0.0f; this->timer_0BC = 210; - for (team = &gActors[1], i = 1; i < 4; i++, team++) { - team->obj.pos.x = D_i6_801A68B0[i - 1].x; - team->obj.pos.y = D_i6_801A68B0[i - 1].y + 750.f; - team->obj.pos.z = D_i6_801A68B0[i - 1].z; - team->obj.rot.z = D_i6_801A68F8[i - 1]; + for (team = &gActors[AI360_FALCO], i = AI360_FALCO; i <= AI360_PEPPY; i++, team++) { + team->obj.pos.x = sTeamInitPos[i - 1].x; + team->obj.pos.y = sTeamInitPos[i - 1].y + 750.f; + team->obj.pos.z = sTeamInitPos[i - 1].z; + team->obj.rot.z = sTeamInitRot[i - 1]; team->rot_0F4.x = 340.0f; } gFillScreenAlpha = gFillScreenAlphaTarget = 255; } - Camera_UpdateArwing360(player, 1); + Camera_UpdateArwing360(player, true); /* fallthrough */ case 1: - for (team = &gActors[1], i = 1; i < 4; i++, team++) { team->state = 0; team->timer_0BC = 3; @@ -93,13 +98,15 @@ void Venom2_UpdateEvents(Actor* this) { Radio_PlayMessage(gMsg_ID_19010, RCID_FOX); } break; + case 2: - Venom2_801962F4(this); + Venom2_UpdateStarWolfEvents(this); if (((gAllRangeSpawnEvent + 100) < gAllRangeEventTimer) && (gActors[4].obj.status == OBJ_FREE) && (gActors[5].obj.status == OBJ_FREE) && (gActors[6].obj.status == OBJ_FREE) && (gActors[7].obj.status == OBJ_FREE) && (this->timer_0BE == 0)) { this->timer_0BE = 80; } + if ((this->timer_0BE == 1) && (player->state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { for (i = 1; i < ARRAY_COUNT(gTeamShields); i++) { gPrevPlanetTeamShields[i] = gSavedTeamShields[i]; @@ -119,6 +126,7 @@ void Venom2_UpdateEvents(Actor* this) { D_ctx_80177CC4 = gLeftWingHealth[0]; } break; + case 3: gPauseEnabled = false; if (gStarWolfMsgTimer < 600) { @@ -126,19 +134,22 @@ void Venom2_UpdateEvents(Actor* this) { player->cam.eye.y += wolf->vel.y * 0.23f; player->cam.eye.z += wolf->vel.z * 0.23f; } + Math_SmoothStepToF(&player->cam.at.x, wolf->obj.pos.x, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.y, wolf->obj.pos.y, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->cam.at.z, wolf->obj.pos.z, 1.0f, 20000.0f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0, 0.1f, 0.2f, 0.0f); + if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (gAllRangeSpawnEvent + 300))) { this->state = 2; player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; - Camera_Update360(player, 1); + Camera_Update360(player, true); player->unk_014 = 0.0f; D_hud_80161708 = 0; } break; } + if (gStarWolfMsgTimer != 0) { gStarWolfMsgTimer--; @@ -165,9 +176,9 @@ void Venom2_UpdateEvents(Actor* this) { } } -void Venom2_80196968(void) { +void Venom2_LoadLevelObjects(void) { Actor* actor; - Boss* boss; + BossVE2* boss; Scenery360* scenery360; s32 i; @@ -300,11 +311,14 @@ void Venom2_LevelComplete(Player* player) { player->csState++; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f; player->wings.modelId = 1; + D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.1f; D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[4] = 0.0f; + player->csTimer = 0; + if ((fabsf(sp94) < 4000.0f) && (fabsf(sp8C) < 4000.0f)) { player->csTimer = 250; sp64.x = 0.0f; @@ -315,6 +329,7 @@ void Venom2_LevelComplete(Player* player) { D_ctx_80177A48[5] = sp58.x; D_ctx_80177A48[6] = sp58.z; } + if (gLevelPhase == 2) { player->csEventTimer = 240; } else { @@ -329,8 +344,10 @@ void Venom2_LevelComplete(Player* player) { gFillScreenAlphaTarget = 0; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; } + Math_SmoothStepToF(&D_ctx_80177A48[1], 0.8f, 1.0f, 0.05f, 0.0f); Math_SmoothStepToF(&player->zRotBank, 0.0f, 0.1f, 15.0f, 0.0f); + if (player->csTimer == 1) { D_ctx_80177A48[4] = 0.0f; } @@ -339,6 +356,7 @@ void Venom2_LevelComplete(Player* player) { sp90 = player->pos.y - (gBosses[0].obj.pos.y + 700.0f); sp8C = player->pos.z - (gBosses[0].obj.pos.z + D_ctx_80177A48[6]); } + sp84 = Math_RadToDeg(Math_Atan2F(sp94, sp8C)); sp8C = sqrtf(SQ(sp94) + SQ(sp8C)); pad88 = Math_RadToDeg(-Math_Atan2F(sp90, sp8C)); @@ -348,16 +366,22 @@ void Venom2_LevelComplete(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[4], 3.0f, 1.0f, 0.1f, 0.0f); Matrix_RotateX(gCalcMatrix, -(D_PI / 9), MTXF_NEW); Matrix_RotateY(gCalcMatrix, (D_ctx_80177A48[3] + player->yRot_114) * M_DTOR, MTXF_APPLY); + D_ctx_80177A48[3] += 1.0f; + sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = 400.0f; + Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); + gCsCamEyeX = player->pos.x + sp58.x; gCsCamEyeY = player->pos.y + sp58.y; gCsCamEyeZ = player->pos.z + sp58.z; + Math_SmoothStepToF(D_ctx_80177A48, 0.5f, 1.0f, 0.01f, 0.0f); Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); + if ((player->csTimer == 0) && (fabsf(sp94) < 50.0f) && (fabsf(sp8C) < 50.0f)) { player->csState++; D_ctx_80177A48[2] = 0.75f; @@ -374,10 +398,13 @@ void Venom2_LevelComplete(Player* player) { Audio_SetBgmParam(0); } break; + case 2: player->unk_190 = 2.0f; + Math_SmoothStepToF(&player->xRot_120, 270.0f, 0.1f, D_ctx_80177A48[2], 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 4.0f, 1.0f, 0.05f, 0.0f); + if (player->xRot_120 > 80.0f) { Math_SmoothStepToF(&player->zRotBank, 10000.0f, 0.1f, 8.0f, 0.0f); } @@ -414,6 +441,7 @@ void Venom2_LevelComplete(Player* player) { gNextGameState = GSTATE_PLAY; gNextLevel = LEVEL_VENOM_ANDROSS; + if (gLeveLClearStatus[gCurrentLevel] != 0) { gNextLevelPhase = 1; } @@ -430,6 +458,7 @@ void Venom2_LevelComplete(Player* player) { } break; } + if (player->csEventTimer == 150) { Radio_PlayMessage(gMsg_ID_8215, RCID_FOX); AUDIO_PLAY_BGM(NA_BGM_DASH_INTO_BASE); diff --git a/src/overlays/ovl_menu/fox_map.c b/src/overlays/ovl_menu/fox_map.c index 84f51d3d..5d675202 100644 --- a/src/overlays/ovl_menu/fox_map.c +++ b/src/overlays/ovl_menu/fox_map.c @@ -8,9 +8,9 @@ #include "global.h" #include "fox_map.h" #include "fox_option.h" -// #include "prevent_bss_reordering.h" -// #include "prevent_bss_reordering2.h" -// #include "prevent_bss_reordering3.h" +#include "prevent_bss_reordering.h" +#include "prevent_bss_reordering2.h" +#include "prevent_bss_reordering3.h" #include "assets/ast_map.h" #include "assets/ast_text.h" #include "assets/ast_font_3d.h" @@ -4285,7 +4285,7 @@ void Map_801A6628(void) { gSavedObjectLoadIndex = 0; gSavedPathProgress = 0.0f; - D_ctx_8017782C = 1; + D_ctx_8017782C = true; } void Map_801A6694(void) { diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 64566083..f89be570 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -29,14 +29,14 @@ extern f32 D_menu_801CD818[]; s32 D_menu_801B9090; s32 D_menu_801B9094; -s32 D_menu_801B9098; // gap -s32 D_menu_801B90A0[3]; // gap -s32 D_menu_801B90B0[3]; // gap -f32 D_menu_801B90C0[3]; // gap -f32 D_menu_801B90D0[3]; // gap -f32 D_menu_801B90E0[3]; // gap -f32 D_menu_801B90F0[3]; // gap -f32 D_menu_801B9100[3]; // gap +s32 D_menu_801B9098; +s32 D_menu_801B90A0[3]; +s32 D_menu_801B90B0[3]; +f32 D_menu_801B90C0[3]; +f32 D_menu_801B90D0[3]; +f32 D_menu_801B90E0[3]; +f32 D_menu_801B90F0[3]; +f32 D_menu_801B9100[3]; f32 D_menu_801B9110[3]; f32 D_menu_801B911C; f32 D_menu_801B9120; @@ -54,7 +54,7 @@ s32 D_menu_801B9158; UnkStruct_D_menu_801B9250 D_menu_801B9160[3]; s32 D_menu_801B9178; s32 D_menu_801B917C; -UnkStruct_D_menu_801B9250 D_menu_801B9180; // gap +UnkStruct_D_menu_801B9250 D_menu_801B9180; UnkStruct_D_menu_801B9250 D_menu_801B9188; UnkStruct_D_menu_801B9250 D_menu_801B9190; UnkStruct_D_menu_801B9250 D_menu_801B9198; @@ -803,7 +803,7 @@ void Option_TrainingUpdate(void) { Play_Setup(); gSavedObjectLoadIndex = 0; gSavedPathProgress = 0.0f; - D_ctx_8017782C = 1; + D_ctx_8017782C = true; gControllerLock = 3; AUDIO_SET_SPEC(SFXCHAN_0, AUDIOSPEC_28); } else { @@ -1182,7 +1182,9 @@ void Option_VersusUpdate(void) { case 1: // clang-format off - if (Option_8019C418(&D_menu_801B91A8, 2, 1, 0, 20, 5, 4, gMainController, &D_menu_801B9188)) { AUDIO_PLAY_SFX(NA_SE_ARWING_CURSOR, gDefaultSfxSource, 4); } + if (Option_8019C418(&D_menu_801B91A8, 2, 1, 0, 20, 5, 4, gMainController, &D_menu_801B9188)) {\ + AUDIO_PLAY_SFX(NA_SE_ARWING_CURSOR, gDefaultSfxSource, 4);\ + } // clang-format on if (gControllerPress[gMainController].button & (A_BUTTON | START_BUTTON)) { @@ -3412,23 +3414,23 @@ void Option_8019B3DC(void) { void Option_8019B5AC(void) { s32 pad[2]; s32 colorGB; - s32 var_v0; + s32 bitmask; Option_8019C824(&D_menu_801B91E8); colorGB = D_menu_801B91E8; - var_v0 = 0xFFFFFFFF; + bitmask = 0xFFFFFFFF; if (D_menu_801B91EC != 0) { colorGB = 255; - var_v0 = 1; + bitmask = 0x00000001; D_menu_801B91EC--; if (D_menu_801B91EC == 0) { D_menu_801B91F0 = 1; } } - if ((gGameFrameCount & var_v0) != 0) { + if (gGameFrameCount & bitmask) { RCP_SetupDL(&gMasterDisp, SETUPDL_83); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, colorGB, colorGB, 255); TextureRect_IA8(&gMasterDisp, D_VS_MENU_7003650, 40, 12, 143.0f, 210.0f, 1.0f, 1.0f); @@ -4041,7 +4043,7 @@ void Option_8019D118(void) { f32 dirX; f32 dirY; f32 dirZ; - s32 mask[3]; + s32 bitmask[3]; s32 i; static f32 D_menu_801AF30C[6] = { 51.0f, 138.0f, 118.0f, 166.0f, 138.0f, 267.0f }; static f32 D_menu_801AF324[6] = { 29.0f, 49.0f, 145.0f, 155.0f, 87.0f, 127.0f }; @@ -4060,7 +4062,9 @@ void Option_8019D118(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); Graphics_DisplaySmallText(D_menu_801AF30C[1], D_menu_801AF324[1], 1.0f, 1.0f, "RANK"); Graphics_DisplaySmallText(D_menu_801AF30C[2], D_menu_801AF324[2], 1.0f, 1.0f, "TOTAL HITS"); - (void) "p:%d x:%f y:%f\n"; + + PRINTF("p:%d x:%f y:%f\n"); + if (D_menu_801B9138 == 1) { if ((gGameFrameCount & 0x10) != 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); @@ -4088,10 +4092,10 @@ void Option_8019D118(void) { D_menu_801B9100[i] = 0.0f; } - mask[i] = 0xFFFFFFFF; + bitmask[i] = 0xFFFFFFFF; if (D_menu_801B9140[i] != 0) { - mask[i] = 0x1; + bitmask[i] = 0x00000001; D_menu_801B9100[i] = 0.0f; } } @@ -4107,7 +4111,7 @@ void Option_8019D118(void) { Matrix_SetGfxMtx(&gMasterDisp); for (i = 0; i < 3; i++) { - if (gGameFrameCount & mask[i]) { + if (gGameFrameCount & bitmask[i]) { Option_8019DB20(D_menu_801B9150[i][0], D_menu_801AF300[i], 18.0f, -455.0f, 1.0f, D_menu_801B90C0[i] + D_menu_801B90F0[i], D_menu_801B90D0[i] + D_menu_801B9100[i], D_menu_801B90E0[i] + D_menu_801B9110[i]); @@ -4322,8 +4326,8 @@ void Option_8019DD44(void) { void Option_8019DE74(void) { Option_8019715C(); - if (gControllerPress[gMainController].button & (START_BUTTON | A_BUTTON | B_BUTTON | D_CBUTTONS | L_CBUTTONS | - U_CBUTTONS)) { // START, A, B, C-UP, C-LEFT, C-DOWN + if (gControllerPress[gMainController].button & + (START_BUTTON | A_BUTTON | B_BUTTON | D_CBUTTONS | L_CBUTTONS | U_CBUTTONS)) { AUDIO_PLAY_SFX(NA_SE_DECIDE, gDefaultSfxSource, 4); gDrawMode = DRAW_NONE; diff --git a/src/overlays/ovl_menu/fox_title.c b/src/overlays/ovl_menu/fox_title.c index a0eade0d..7ef95caf 100644 --- a/src/overlays/ovl_menu/fox_title.c +++ b/src/overlays/ovl_menu/fox_title.c @@ -149,7 +149,6 @@ typedef struct { /* 0x08 */ Limb** skeleton; } TitleAnimation; // size = 0x0C -//! TODO: Symbols for segmented addresses TitleAnimation D_menu_801ADA00[4] = { { &D_TITLE_602F8E0, &D_TITLE_6035024, D_TITLE_602FBAC }, { &D_TITLE_60305C0, &D_TITLE_60338DC, D_TITLE_603088C }, diff --git a/src/sys/sys_fault.c b/src/sys/sys_fault.c index 56bdc7ed..35477807 100644 --- a/src/sys/sys_fault.c +++ b/src/sys/sys_fault.c @@ -50,7 +50,7 @@ const char* sFloatExceptions[6] = { "Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", "Inexact operation", }; -void Fault_FillRectange(s32 xPos, s32 yPos, s32 width, s32 height) { +void Fault_FillRectangle(s32 xPos, s32 yPos, s32 width, s32 height) { u16* pixel; s32 i; s32 j; @@ -167,7 +167,7 @@ void Fault_DisplayDebugInfo(OSThread* thread) { causeIndex = 17; } Fault_Wait(3000); - Fault_FillRectange(15, 15, SCREEN_WIDTH - 30, SCREEN_HEIGHT - 30); + Fault_FillRectangle(15, 15, SCREEN_WIDTH - 30, SCREEN_HEIGHT - 30); Fault_Printf(30, 40, "THREAD:%d (%s)", thread->id, sFaultCauses[causeIndex]); Fault_Printf(30, 50, "PC:%08XH SR:%08XH\tVA:%08XH", context->pc, context->sr, context->badvaddr); osWritebackDCacheAll(); diff --git a/src/sys/sys_joybus.c b/src/sys/sys_joybus.c index cbdbf1ce..46ba7fb2 100644 --- a/src/sys/sys_joybus.c +++ b/src/sys/sys_joybus.c @@ -63,7 +63,7 @@ void Controller_UpdateInput(void) { s32 i; for (i = 0; i < 4; i++) { - if (gControllerPlugged[i] == 1 && sNextController[i].errno == 0) { + if ((gControllerPlugged[i] == 1) && (sNextController[i].errno == 0)) { sPrevController[i] = gControllerHold[i]; gControllerHold[i] = sNextController[i]; gControllerPress[i].button =