More CPlayer progress

This commit is contained in:
Luke Street 2024-09-30 00:02:23 -06:00
parent a6a73af8d7
commit 24c42469fb
47 changed files with 1590 additions and 691 deletions

View File

@ -25,7 +25,7 @@ RegisterResourceTweaks__5CMainFv = .text:0x8000367C; // type:function size:0x24
ResetGameState__5CMainFv = .text:0x800036A0; // type:function size:0x100 scope:global ResetGameState__5CMainFv = .text:0x800036A0; // type:function size:0x100 scope:global
__as__12CGameOptionsFRC12CGameOptions = .text:0x800037A0; // type:function size:0x130 scope:global __as__12CGameOptionsFRC12CGameOptions = .text:0x800037A0; // type:function size:0x130 scope:global
__as__Q24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator>FRCQ24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator> = .text:0x800038D0; // type:function size:0xFC scope:global __as__Q24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator>FRCQ24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator> = .text:0x800038D0; // type:function size:0xFC scope:global
__as__14CSystemOptionsFRC14CSystemOptions = .text:0x800039CC; // type:function size:0x1C0 scope:global __as__12CSystemStateFRC12CSystemState = .text:0x800039CC; // type:function size:0x1C0 scope:global
__as__Q24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator>FRCQ24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator> = .text:0x80003B8C; // type:function size:0xFC scope:global __as__Q24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator>FRCQ24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator> = .text:0x80003B8C; // type:function size:0xFC scope:global
__as__Q24rstl24single_ptr<10CGameState>FP10CGameState = .text:0x80003C88; // type:function size:0x48 scope:global __as__Q24rstl24single_ptr<10CGameState>FP10CGameState = .text:0x80003C88; // type:function size:0x48 scope:global
__dt__10CGameStateFv = .text:0x80003CD0; // type:function size:0x190 scope:global __dt__10CGameStateFv = .text:0x80003CD0; // type:function size:0x190 scope:global
@ -33,8 +33,8 @@ __dt__Q24rstl48vector<11CWorldState,Q24rstl17rmemory_allocator>Fv = .text:0x8000
deallocate<11CWorldState>__Q24rstl17rmemory_allocatorFP11CWorldState = .text:0x80003EEC; // type:function size:0x98 scope:global deallocate<11CWorldState>__Q24rstl17rmemory_allocatorFP11CWorldState = .text:0x80003EEC; // type:function size:0x98 scope:global
__dt__12CGameOptionsFv = .text:0x80003F84; // type:function size:0xF0 scope:global __dt__12CGameOptionsFv = .text:0x80003F84; // type:function size:0xF0 scope:global
__ct__12CGameOptionsFRC12CGameOptions = .text:0x80004074; // type:function size:0x164 scope:global __ct__12CGameOptionsFRC12CGameOptions = .text:0x80004074; // type:function size:0x164 scope:global
__dt__14CSystemOptionsFv = .text:0x800041D8; // type:function size:0x14C scope:global __dt__12CSystemStateFv = .text:0x800041D8; // type:function size:0x14C scope:global
__ct__14CSystemOptionsFRC14CSystemOptions = .text:0x80004324; // type:function size:0x180 scope:global __ct__12CSystemStateFRC12CSystemState = .text:0x80004324; // type:function size:0x180 scope:global
StreamNewGameState__5CMainFR12CInputStreami = .text:0x800044A4; // type:function size:0xEC scope:global StreamNewGameState__5CMainFR12CInputStreami = .text:0x800044A4; // type:function size:0xEC scope:global
RefreshGameState__5CMainFv = .text:0x80004590; // type:function size:0x21C scope:global RefreshGameState__5CMainFv = .text:0x80004590; // type:function size:0x21C scope:global
__dt__15CMemoryInStreamFv = .text:0x800047AC; // type:function size:0x60 scope:global __dt__15CMemoryInStreamFv = .text:0x800047AC; // type:function size:0x60 scope:global
@ -359,15 +359,15 @@ UpdateMorphBallState__7CPlayerFfRC11CFinalInputR13CStateManager = .text:0x80014B
ProcessInput__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x80014D5C; // type:function size:0x9B0 scope:global ProcessInput__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x80014D5C; // type:function size:0x9B0 scope:global
GetMaterial__19CCollisionPrimitiveCFv = .text:0x8001570C; // type:function size:0x8 scope:global GetMaterial__19CCollisionPrimitiveCFv = .text:0x8001570C; // type:function size:0x8 scope:global
StartLandingControlFreeze__7CPlayerFv = .text:0x80015714; // type:function size:0x14 scope:global StartLandingControlFreeze__7CPlayerFv = .text:0x80015714; // type:function size:0x14 scope:global
ProcessFrozenInput__7CPlayerFfR13CStateManager = .text:0x80015728; // type:function size:0xC0 scope:global UpdateControlLostState__7CPlayerFfR13CStateManager = .text:0x80015728; // type:function size:0xC0 scope:global
EndLandingControlFreeze__7CPlayerFv = .text:0x800157E8; // type:function size:0x14 scope:global EndLandingControlFreeze__7CPlayerFv = .text:0x800157E8; // type:function size:0x14 scope:global
UpdateFrozenState__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x800157FC; // type:function size:0x1F4 scope:global UpdateFrozenState__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x800157FC; // type:function size:0x1F4 scope:global
wstring_l__4rstlFPCw = .text:0x800159F0; // type:function size:0x3C scope:global wstring_l__4rstlFPCw = .text:0x800159F0; // type:function size:0x3C scope:global
UnFreeze__7CPlayerFR13CStateManager = .text:0x80015A2C; // type:function size:0x2D0 scope:global BreakFrozenState__7CPlayerFR13CStateManager = .text:0x80015A2C; // type:function size:0x2D0 scope:global
GetFrozenState__7CPlayerCFv = .text:0x80015CFC; // type:function size:0x18 scope:global GetFrozenState__7CPlayerCFv = .text:0x80015CFC; // type:function size:0x18 scope:global
Freeze__7CPlayerFR13CStateManagerUiUsUi = .text:0x80015D14; // type:function size:0x19C scope:global SetFrozenState__7CPlayerFR13CStateManagerUiUsUi = .text:0x80015D14; // type:function size:0x19C scope:global
Think__7CPlayerFfR13CStateManager = .text:0x80015EB0; // type:function size:0x59C scope:global Think__7CPlayerFfR13CStateManager = .text:0x80015EB0; // type:function size:0x59C scope:global
UpdateWaterSurfaceCameraBias__7CPlayerFR13CStateManager = .text:0x8001644C; // type:function size:0xF4 scope:global AdjustEyeOffset__7CPlayerFR13CStateManager = .text:0x8001644C; // type:function size:0xF4 scope:global
PreThink__7CPlayerFfR13CStateManager = .text:0x80016540; // type:function size:0x38 scope:global PreThink__7CPlayerFfR13CStateManager = .text:0x80016540; // type:function size:0x38 scope:global
AcceptScriptMsg__7CPlayerF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x80016578; // type:function size:0x824 scope:global AcceptScriptMsg__7CPlayerF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x80016578; // type:function size:0x824 scope:global
UpdateCameraTimers__7CPlayerFfRC11CFinalInput = .text:0x80016D9C; // type:function size:0x148 scope:global UpdateCameraTimers__7CPlayerFfRC11CFinalInput = .text:0x80016D9C; // type:function size:0x148 scope:global
@ -5686,7 +5686,7 @@ __ct__22CCompoundTargetReticleFRC13CStateManager = .text:0x800C132C; // type:fun
__ct__Q222CCompoundTargetReticle14SOuterItemInfoFPCc = .text:0x800C1A68; // type:function size:0x7C scope:global __ct__Q222CCompoundTargetReticle14SOuterItemInfoFPCc = .text:0x800C1A68; // type:function size:0x7C scope:global
calculate_premultiplied_overshoot_offset__Ff = .text:0x800C1AE4; // type:function size:0x3C scope:global calculate_premultiplied_overshoot_offset__Ff = .text:0x800C1AE4; // type:function size:0x3C scope:global
offshoot_func__Ffff = .text:0x800C1B20; // type:function size:0x48 scope:global offshoot_func__Ffff = .text:0x800C1B20; // type:function size:0x48 scope:global
IsDamageOrbit__F19EPlayerOrbitRequest = .text:0x800C1B68; // type:function size:0x2C scope:global IsDamageOrbit__FQ27CPlayer16EOrbitBrokenType = .text:0x800C1B68; // type:function size:0x2C scope:global
reserve__Q24rstl77vector<Q222CCompoundTargetReticle14SOuterItemInfo,Q24rstl17rmemory_allocator>Fi = .text:0x800C1B94; // type:function size:0x12C scope:global reserve__Q24rstl77vector<Q222CCompoundTargetReticle14SOuterItemInfo,Q24rstl17rmemory_allocator>Fi = .text:0x800C1B94; // type:function size:0x12C scope:global
__sinit_CTargetReticles_cpp = .text:0x800C1CC0; // type:function size:0x68 scope:local __sinit_CTargetReticles_cpp = .text:0x800C1CC0; // type:function size:0x68 scope:local
GetNumActive__10CWeaponMgrCF9TUniqueId11EWeaponType = .text:0x800C1D28; // type:function size:0xC0 scope:global GetNumActive__10CWeaponMgrCF9TUniqueId11EWeaponType = .text:0x800C1D28; // type:function size:0xC0 scope:global
@ -6201,7 +6201,7 @@ UpdateHalfPipeStatus__10CMorphBallFR13CStateManagerf = .text:0x800F19DC; // type
RenderDamageEffects__10CMorphBallCFRC13CStateManagerRC12CTransform4f = .text:0x800F1B8C; // type:function size:0x1C0 scope:global RenderDamageEffects__10CMorphBallCFRC13CStateManagerRC12CTransform4f = .text:0x800F1B8C; // type:function size:0x1C0 scope:global
RenderIceBreakEffect__10CMorphBallCFRC13CStateManager = .text:0x800F1D4C; // type:function size:0x38 scope:global RenderIceBreakEffect__10CMorphBallCFRC13CStateManager = .text:0x800F1D4C; // type:function size:0x38 scope:global
UpdateIceBreakEffect__10CMorphBallFf = .text:0x800F1D84; // type:function size:0x1D0 scope:global UpdateIceBreakEffect__10CMorphBallFf = .text:0x800F1D84; // type:function size:0x1D0 scope:global
Stop__10CMorphBallFv = .text:0x800F1F54; // type:function size:0x58 scope:global ResetMorphBallIceBreak__10CMorphBallFv = .text:0x800F1F54; // type:function size:0x58 scope:global
IsMorphBallTransitionFlashValid__10CMorphBallCFv = .text:0x800F1FAC; // type:function size:0x14 scope:global IsMorphBallTransitionFlashValid__10CMorphBallCFv = .text:0x800F1FAC; // type:function size:0x14 scope:global
RenderMorphBallTransitionFlash__10CMorphBallCFRC13CStateManager = .text:0x800F1FC0; // type:function size:0x90 scope:global RenderMorphBallTransitionFlash__10CMorphBallCFRC13CStateManager = .text:0x800F1FC0; // type:function size:0x90 scope:global
UpdateMorphBallTransitionFlash__10CMorphBallFf = .text:0x800F2050; // type:function size:0x1D0 scope:global UpdateMorphBallTransitionFlash__10CMorphBallFf = .text:0x800F2050; // type:function size:0x1D0 scope:global
@ -6359,7 +6359,7 @@ FluidFXThink__7CWeaponFQ26CActor11EFluidStateR12CScriptWaterR13CStateManager = .
Think__7CWeaponFfR13CStateManager = .text:0x801020D8; // type:function size:0x140 scope:global Think__7CWeaponFfR13CStateManager = .text:0x801020D8; // type:function size:0x140 scope:global
SetDamageFalloffSpeed__7CWeaponFf = .text:0x80102218; // type:function size:0x1C scope:global SetDamageFalloffSpeed__7CWeaponFf = .text:0x80102218; // type:function size:0x1C scope:global
__dt__7CWeaponFv = .text:0x80102234; // type:function size:0x60 scope:global __dt__7CWeaponFv = .text:0x80102234; // type:function size:0x60 scope:global
__ct__7CWeaponF9TUniqueId7TAreaIdb9TUniqueId11EWeaponTypeRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC12CTransform4fRC15CMaterialFilterRC13CMaterialListRC11CDamageInfo17EProjectileAttribRC10CModelData = .text:0x80102294; // type:function size:0x1FC scope:global __ct__7CWeaponF9TUniqueId7TAreaIdb9TUniqueId11EWeaponTypeRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC12CTransform4fRC15CMaterialFilterRC13CMaterialListRC11CDamageInfoiRC10CModelData = .text:0x80102294; // type:function size:0x1FC scope:global
GetDeflectionType__20CDamageVulnerabilityCFRC11CWeaponMode = .text:0x80102490; // type:function size:0x2C scope:global GetDeflectionType__20CDamageVulnerabilityCFRC11CWeaponMode = .text:0x80102490; // type:function size:0x2C scope:global
GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x801024BC; // type:function size:0xC8 scope:global GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x801024BC; // type:function size:0xC8 scope:global
WeaponHits__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x80102584; // type:function size:0x184 scope:global WeaponHits__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x80102584; // type:function size:0x184 scope:global
@ -6935,7 +6935,7 @@ fn_8012E90C = .text:0x8012E90C; // type:function size:0x4
AddRipple__11CFluidPlaneFRC7CRippleRC12CScriptWaterR13CStateManager = .text:0x8012E910; // type:function size:0x54 scope:global AddRipple__11CFluidPlaneFRC7CRippleRC12CScriptWaterR13CStateManager = .text:0x8012E910; // type:function size:0x54 scope:global
AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fRC9CVector3fRC12CScriptWaterR13CStateManagerRC9CVector3f = .text:0x8012E964; // type:function size:0xC4 scope:global AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fRC9CVector3fRC12CScriptWaterR13CStateManagerRC9CVector3f = .text:0x8012E964; // type:function size:0xC4 scope:global
AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fR13CStateManager = .text:0x8012EA28; // type:function size:0xA0 scope:global AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fR13CStateManager = .text:0x8012EA28; // type:function size:0xA0 scope:global
ProjectRippleVelocity__11CFluidPlaneCFff = .text:0x8012EAC8; // type:function size:0x50 scope:global GetRippleScaleFromKineticEnergy__11CFluidPlaneFff = .text:0x8012EAC8; // type:function size:0x50 scope:global
CalculateRippleIntensity__11CFluidPlaneCFf = .text:0x8012EB18; // type:function size:0xC4 scope:global CalculateRippleIntensity__11CFluidPlaneCFf = .text:0x8012EB18; // type:function size:0xC4 scope:global
__dt__11CFluidPlaneFv = .text:0x8012EBDC; // type:function size:0x158 scope:global __dt__11CFluidPlaneFv = .text:0x8012EBDC; // type:function size:0x158 scope:global
__ct__11CFluidPlaneFUiUiUifQ211CFluidPlane10EFluidTypefRC14CFluidUVMotion = .text:0x8012ED34; // type:function size:0x364 scope:global __ct__11CFluidPlaneFUiUiUifQ211CFluidPlane10EFluidTypefRC14CFluidUVMotion = .text:0x8012ED34; // type:function size:0x364 scope:global
@ -7181,7 +7181,7 @@ ResolveCollisionWithActor__21CTargetableProjectileFRC14CRayCastResultR6CActorR13
GetAimPosition__21CTargetableProjectileCFRC13CStateManagerf = .text:0x8013BABC; // type:function size:0x184 scope:global GetAimPosition__21CTargetableProjectileCFRC13CStateManagerf = .text:0x8013BABC; // type:function size:0x184 scope:global
Explode__21CTargetableProjectileFRC9CVector3fRC9CVector3f29EWeaponCollisionResponseTypesR13CStateManagerRC20CDamageVulnerability9TUniqueId = .text:0x8013BC40; // type:function size:0x27C scope:global Explode__21CTargetableProjectileFRC9CVector3fRC9CVector3f29EWeaponCollisionResponseTypesR13CStateManagerRC20CDamageVulnerability9TUniqueId = .text:0x8013BC40; // type:function size:0x27C scope:global
Accept__21CTargetableProjectileFR8IVisitor = .text:0x8013BEBC; // type:function size:0x38 scope:global Accept__21CTargetableProjectileFR8IVisitor = .text:0x8013BEBC; // type:function size:0x38 scope:global
__ct__21CTargetableProjectileFRC28TToken<18CWeaponDescription>11EWeaponTypeRC12CTransform4f14EMaterialTypesRC11CDamageInfoRC11CDamageInfo9TUniqueId7TAreaId9TUniqueIdRC34TLockedToken<18CWeaponDescription>9TUniqueId17EProjectileAttribRCQ24rstl50optional_object<31TLockedToken<15CGenDescription>>Usb = .text:0x8013BEF4; // type:function size:0x154 scope:global __ct__21CTargetableProjectileFRC28TToken<18CWeaponDescription>11EWeaponTypeRC12CTransform4f14EMaterialTypesRC11CDamageInfoRC11CDamageInfo9TUniqueId7TAreaId9TUniqueIdRC34TLockedToken<18CWeaponDescription>9TUniqueIdQ27CWeapon17EProjectileAttribRCQ24rstl50optional_object<31TLockedToken<15CGenDescription>>Usb = .text:0x8013BEF4; // type:function size:0x154 scope:global
__dt__15CBSLoopReactionFv = .text:0x8013C048; // type:function size:0x5C scope:global __dt__15CBSLoopReactionFv = .text:0x8013C048; // type:function size:0x5C scope:global
GetBodyStateTransition__15CBSLoopReactionFfR15CBodyController = .text:0x8013C0A4; // type:function size:0x1B0 scope:global GetBodyStateTransition__15CBSLoopReactionFfR15CBodyController = .text:0x8013C0A4; // type:function size:0x1B0 scope:global
PlayExitAnimation__15CBSLoopReactionCFR15CBodyControllerR13CStateManager = .text:0x8013C254; // type:function size:0x210 scope:global PlayExitAnimation__15CBSLoopReactionCFR15CBodyControllerR13CStateManager = .text:0x8013C254; // type:function size:0x210 scope:global
@ -7968,7 +7968,7 @@ MakeBillboardEffect__17CPlasmaProjectileFRCQ24rstl44optional_object<25TToken<15C
UpdateBeamState__17CPlasmaProjectileFfR13CStateManager = .text:0x80178A68; // type:function size:0x184 scope:global UpdateBeamState__17CPlasmaProjectileFfR13CStateManager = .text:0x80178A68; // type:function size:0x184 scope:global
Touch__17CPlasmaProjectileFR6CActorR13CStateManager = .text:0x80178BEC; // type:function size:0x4 scope:global Touch__17CPlasmaProjectileFR6CActorR13CStateManager = .text:0x80178BEC; // type:function size:0x4 scope:global
Accept__17CPlasmaProjectileFR8IVisitor = .text:0x80178BF0; // type:function size:0x38 scope:global Accept__17CPlasmaProjectileFR8IVisitor = .text:0x80178BF0; // type:function size:0x38 scope:global
__ct__17CPlasmaProjectileFRC28TToken<18CWeaponDescription>RCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>11EWeaponTypeRC9CBeamInfoRC12CTransform4f14EMaterialTypesRC11CDamageInfo9TUniqueId7TAreaId9TUniqueIdRCQ217CPlasmaProjectile21PlayerEffectResourcesb17EProjectileAttrib = .text:0x80178C28; // type:function size:0x758 scope:global __ct__17CPlasmaProjectileFRC28TToken<18CWeaponDescription>RCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>11EWeaponTypeRC9CBeamInfoRC12CTransform4f14EMaterialTypesRC11CDamageInfo9TUniqueId7TAreaId9TUniqueIdRCQ217CPlasmaProjectile21PlayerEffectResourcesbQ27CWeapon17EProjectileAttrib = .text:0x80178C28; // type:function size:0x758 scope:global
__sinit_CPlasmaProjectile_cpp = .text:0x80179380; // type:function size:0xC scope:local __sinit_CPlasmaProjectile_cpp = .text:0x80179380; // type:function size:0xC scope:local
UpdateGrappleArmTransform__7CPlayerFRC9CVector3fR13CStateManagerf = .text:0x8017938C; // type:function size:0x320 scope:global UpdateGrappleArmTransform__7CPlayerFRC9CVector3fR13CStateManagerf = .text:0x8017938C; // type:function size:0x320 scope:global
ApplyGrappleForces__7CPlayerFRC11CFinalInputR13CStateManagerf = .text:0x801796AC; // type:function size:0xCCC scope:global ApplyGrappleForces__7CPlayerFRC11CFinalInputR13CStateManagerf = .text:0x801796AC; // type:function size:0xCCC scope:global
@ -7976,9 +7976,9 @@ ValidateFPPosition__7CPlayerF9CVector3fR13CStateManager = .text:0x8017A378; // t
UpdateGrappleState__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x8017A668; // type:function size:0x784 scope:global UpdateGrappleState__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x8017A668; // type:function size:0x784 scope:global
ApplyGrappleJump__7CPlayerFR13CStateManager = .text:0x8017ADEC; // type:function size:0x234 scope:global ApplyGrappleJump__7CPlayerFR13CStateManager = .text:0x8017ADEC; // type:function size:0x234 scope:global
BeginGrapple__7CPlayerFR9CVector3fR13CStateManager = .text:0x8017B020; // type:function size:0xA4 scope:global BeginGrapple__7CPlayerFR9CVector3fR13CStateManager = .text:0x8017B020; // type:function size:0xA4 scope:global
BreakGrapple__7CPlayerF19EPlayerOrbitRequestR13CStateManager = .text:0x8017B0C4; // type:function size:0xD8 scope:global BreakGrapple__7CPlayerFQ27CPlayer16EOrbitBrokenTypeR13CStateManager = .text:0x8017B0C4; // type:function size:0xD8 scope:global
SetOrbitRequest__7CPlayerF19EPlayerOrbitRequestR13CStateManager = .text:0x8017B19C; // type:function size:0xB8 scope:global BreakOrbit__7CPlayerFQ27CPlayer16EOrbitBrokenTypeR13CStateManager = .text:0x8017B19C; // type:function size:0xB8 scope:global
SetOrbitRequestForTarget__7CPlayerF9TUniqueId19EPlayerOrbitRequestR13CStateManager = .text:0x8017B254; // type:function size:0x54 scope:global TryToBreakOrbit__7CPlayerF9TUniqueIdQ27CPlayer16EOrbitBrokenTypeR13CStateManager = .text:0x8017B254; // type:function size:0x54 scope:global
CheckPostGrapple__7CPlayerCFv = .text:0x8017B2A8; // type:function size:0x38 scope:global CheckPostGrapple__7CPlayerCFv = .text:0x8017B2A8; // type:function size:0x38 scope:global
PreventFallingCameraPitch__7CPlayerFv = .text:0x8017B2E0; // type:function size:0x1C scope:global PreventFallingCameraPitch__7CPlayerFv = .text:0x8017B2E0; // type:function size:0x1C scope:global
OrbitCarcass__7CPlayerFR13CStateManager = .text:0x8017B2FC; // type:function size:0x3C scope:global OrbitCarcass__7CPlayerFR13CStateManager = .text:0x8017B2FC; // type:function size:0x3C scope:global
@ -8330,7 +8330,7 @@ Touch__15CBeamProjectileFR6CActorR13CStateManager = .text:0x80199350; // type:fu
Accept__15CBeamProjectileFR8IVisitor = .text:0x80199354; // type:function size:0x38 scope:global Accept__15CBeamProjectileFR8IVisitor = .text:0x80199354; // type:function size:0x38 scope:global
CalculateRenderBounds__15CBeamProjectileFv = .text:0x8019938C; // type:function size:0x68 scope:global CalculateRenderBounds__15CBeamProjectileFv = .text:0x8019938C; // type:function size:0x68 scope:global
GetTouchBounds__15CBeamProjectileCFv = .text:0x801993F4; // type:function size:0x98 scope:global GetTouchBounds__15CBeamProjectileCFv = .text:0x801993F4; // type:function size:0x98 scope:global
__ct__15CBeamProjectileFRC28TToken<18CWeaponDescription>RCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>11EWeaponTypeRC12CTransform4fiff14EMaterialTypesRC11CDamageInfo9TUniqueId7TAreaId9TUniqueId17EProjectileAttribb = .text:0x8019948C; // type:function size:0x408 scope:global __ct__15CBeamProjectileFRC28TToken<18CWeaponDescription>RCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>11EWeaponTypeRC12CTransform4fiff14EMaterialTypesRC11CDamageInfo9TUniqueId7TAreaId9TUniqueIdQ27CWeapon17EProjectileAttribb = .text:0x8019948C; // type:function size:0x408 scope:global
RenderCleanup__14CFluidPlaneCPUCFv = .text:0x80199894; // type:function size:0x1D4 scope:global RenderCleanup__14CFluidPlaneCPUCFv = .text:0x80199894; // type:function size:0x1D4 scope:global
Render__14CFluidPlaneCPUCFRC13CStateManagerRC6CAABoxRC12CTransform4fRC12CTransform4fbRC14CFrustumPlanesRCQ24rstl33optional_object<14CRippleManager>9TUniqueIdPCbiiRC9CVector3f = .text:0x80199A68; // type:function size:0x840 scope:global Render__14CFluidPlaneCPUCFRC13CStateManagerRC6CAABoxRC12CTransform4fRC12CTransform4fbRC14CFrustumPlanesRCQ24rstl33optional_object<14CRippleManager>9TUniqueIdPCbiiRC9CVector3f = .text:0x80199A68; // type:function size:0x840 scope:global
__ct__Q220CFluidPlaneCPURender10SPatchInfoFRC9CVector3fRC9CVector3fRC9CVector3fffb = .text:0x8019A2A8; // type:function size:0x188 scope:global __ct__Q220CFluidPlaneCPURender10SPatchInfoFRC9CVector3fRC9CVector3fRC9CVector3fffb = .text:0x8019A2A8; // type:function size:0x188 scope:global
@ -9000,8 +9000,8 @@ StateForWorld__10CGameStateFUi = .text:0x801D39D8; // type:function size:0x104 s
__ct__11CWorldStateFRC11CWorldState = .text:0x801D3ADC; // type:function size:0xD8 scope:global __ct__11CWorldStateFRC11CWorldState = .text:0x801D3ADC; // type:function size:0xD8 scope:global
WriteBackupBuf__10CGameStateFv = .text:0x801D3BB4; // type:function size:0x68 scope:global WriteBackupBuf__10CGameStateFv = .text:0x801D3BB4; // type:function size:0x68 scope:global
resize__Q24rstl37vector<Uc,Q24rstl17rmemory_allocator>FiRCUc = .text:0x801D3C1C; // type:function size:0xEC scope:global resize__Q24rstl37vector<Uc,Q24rstl17rmemory_allocator>FiRCUc = .text:0x801D3C1C; // type:function size:0xEC scope:global
ExportPersistentOptions__10CGameStateFR14CSystemOptions = .text:0x801D3D08; // type:function size:0x1C4 scope:global ExportPersistentOptions__10CGameStateFR12CSystemState = .text:0x801D3D08; // type:function size:0x1C4 scope:global
ImportPersistentOptions__10CGameStateFRC14CSystemOptions = .text:0x801D3ECC; // type:function size:0x150 scope:global ImportPersistentOptions__10CGameStateFRC12CSystemState = .text:0x801D3ECC; // type:function size:0x150 scope:global
WriteSystemOptions__10CGameStateFR13COutputStream = .text:0x801D401C; // type:function size:0x24 scope:global WriteSystemOptions__10CGameStateFR13COutputStream = .text:0x801D401C; // type:function size:0x24 scope:global
ReadSystemOptions__10CGameStateFR12CInputStream = .text:0x801D4040; // type:function size:0x48 scope:global ReadSystemOptions__10CGameStateFR12CInputStream = .text:0x801D4040; // type:function size:0x48 scope:global
PutTo__10CGameStateCFR13COutputStream = .text:0x801D4088; // type:function size:0x1CC scope:global PutTo__10CGameStateCFR13COutputStream = .text:0x801D4088; // type:function size:0x1CC scope:global
@ -9024,28 +9024,28 @@ GetWorldAssetId__11CWorldStateCFv = .text:0x801D4D90; // type:function size:0x8
PutTo__11CWorldStateFR16CMemoryStreamOut = .text:0x801D4D98; // type:function size:0xA0 scope:global PutTo__11CWorldStateFR16CMemoryStreamOut = .text:0x801D4D98; // type:function size:0xA0 scope:global
__ct__11CWorldStateFR12CInputStreamPCvR18CWorldSaveGameInfo = .text:0x801D4E38; // type:function size:0x238 scope:global __ct__11CWorldStateFR12CInputStreamPCvR18CWorldSaveGameInfo = .text:0x801D4E38; // type:function size:0x238 scope:global
__ct__11CWorldStateFUi = .text:0x801D5070; // type:function size:0x138 scope:global __ct__11CWorldStateFUi = .text:0x801D5070; // type:function size:0x138 scope:global
SetAutoMapperKeyState__14CSystemOptionsFi = .text:0x801D51A8; // type:function size:0x8 scope:global SetAutoMapperKeyState__12CSystemStateFi = .text:0x801D51A8; // type:function size:0x8 scope:global
SetAllItemsCollected__14CSystemOptionsFb = .text:0x801D51B0; // type:function size:0x10 scope:global SetAllItemsCollected__12CSystemStateFb = .text:0x801D51B0; // type:function size:0x10 scope:global
SetHasFusion__14CSystemOptionsFb = .text:0x801D51C0; // type:function size:0x10 scope:global SetHasFusion__12CSystemStateFb = .text:0x801D51C0; // type:function size:0x10 scope:global
fn_801D51D0 = .text:0x801D51D0; // type:function size:0x10 fn_801D51D0 = .text:0x801D51D0; // type:function size:0x10
SetHardModeBeat__14CSystemOptionsFb = .text:0x801D51E0; // type:function size:0x10 scope:global SetHardModeBeat__12CSystemStateFb = .text:0x801D51E0; // type:function size:0x10 scope:global
SetHasHardMode__14CSystemOptionsFb = .text:0x801D51F0; // type:function size:0x10 scope:global SetHasHardMode__12CSystemStateFb = .text:0x801D51F0; // type:function size:0x10 scope:global
SetLogScanCount__14CSystemOptionsFi = .text:0x801D5200; // type:function size:0x8 scope:global SetLogScanCount__12CSystemStateFi = .text:0x801D5200; // type:function size:0x8 scope:global
GetLogScanCount__14CSystemOptionsFv = .text:0x801D5208; // type:function size:0x8 scope:global GetLogScanCount__12CSystemStateFv = .text:0x801D5208; // type:function size:0x8 scope:global
fn_801D5210 = .text:0x801D5210; // type:function size:0x10 fn_801D5210 = .text:0x801D5210; // type:function size:0x10
IncrementPowerBombAmmoCount__14CSystemOptionsFv = .text:0x801D5220; // type:function size:0x34 scope:global IncrementPowerBombAmmoCount__12CSystemStateFv = .text:0x801D5220; // type:function size:0x34 scope:global
GetShowPowerBombAmmoMessage__14CSystemOptionsCFv = .text:0x801D5254; // type:function size:0x1C scope:global GetShowPowerBombAmmoMessage__12CSystemStateCFv = .text:0x801D5254; // type:function size:0x1C scope:global
IncrementFrozenBallCount__14CSystemOptionsFv = .text:0x801D5270; // type:function size:0x34 scope:global IncrementFrozenBallCount__12CSystemStateFv = .text:0x801D5270; // type:function size:0x34 scope:global
GetShowFrozenBallMessage__14CSystemOptionsCFv = .text:0x801D52A4; // type:function size:0x1C scope:global GetShowFrozenBallMessage__12CSystemStateCFv = .text:0x801D52A4; // type:function size:0x1C scope:global
IncrementFrozenFpsCount__14CSystemOptionsFv = .text:0x801D52C0; // type:function size:0x34 scope:global IncNumFreezeInstructionsPrintedFirstPerson__12CSystemStateFv = .text:0x801D52C0; // type:function size:0x34 scope:global
GetShowFrozenFpsMessage__14CSystemOptionsCFv = .text:0x801D52F4; // type:function size:0x1C scope:global GetShowFrozenFpsMessage__12CSystemStateCFv = .text:0x801D52F4; // type:function size:0x1C scope:global
SetCinematicState__14CSystemOptionsFUi9TEditorIdb = .text:0x801D5310; // type:function size:0x130 scope:global SetCinematicState__12CSystemStateFUi9TEditorIdb = .text:0x801D5310; // type:function size:0x130 scope:global
fn_801D5440 = .text:0x801D5440; // type:function size:0x4C fn_801D5440 = .text:0x801D5440; // type:function size:0x4C
fn_801D548C = .text:0x801D548C; // type:function size:0x9C fn_801D548C = .text:0x801D548C; // type:function size:0x9C
GetCinematicState__14CSystemOptionsCFQ24rstl19pair<Ui,9TEditorId> = .text:0x801D5528; // type:function size:0x68 scope:global GetCinematicState__12CSystemStateCFQ24rstl19pair<Ui,9TEditorId> = .text:0x801D5528; // type:function size:0x68 scope:global
PutTo__14CSystemOptionsFR13COutputStream = .text:0x801D5590; // type:function size:0x3D8 scope:global PutTo__12CSystemStateFR13COutputStream = .text:0x801D5590; // type:function size:0x3D8 scope:global
__ct__14CSystemOptionsFR12CInputStream = .text:0x801D5968; // type:function size:0x5A0 scope:global __ct__12CSystemStateFR12CInputStream = .text:0x801D5968; // type:function size:0x5A0 scope:global
__ct__14CSystemOptionsFv = .text:0x801D5F08; // type:function size:0x1A8 scope:global __ct__12CSystemStateFv = .text:0x801D5F08; // type:function size:0x1A8 scope:global
fn_801D60B0 = .text:0x801D60B0; // type:function size:0x20 fn_801D60B0 = .text:0x801D60B0; // type:function size:0x20
Clamp<d>__5CMathFRCdRCdRCd = .text:0x801D60D0; // type:function size:0x2C scope:global Clamp<d>__5CMathFRCdRCdRCd = .text:0x801D60D0; // type:function size:0x2C scope:global
fn_801D60FC = .text:0x801D60FC; // type:function size:0x100 fn_801D60FC = .text:0x801D60FC; // type:function size:0x100
@ -10681,7 +10681,7 @@ AddToRenderer__23CElectricBeamProjectileCFRC14CFrustumPlanesRC13CStateManager =
UpdateFx__23CElectricBeamProjectileFRC12CTransform4ffR13CStateManager = .text:0x80251E84; // type:function size:0x47C scope:global UpdateFx__23CElectricBeamProjectileFRC12CTransform4ffR13CStateManager = .text:0x80251E84; // type:function size:0x47C scope:global
Touch__23CElectricBeamProjectileFR6CActorR13CStateManager = .text:0x80252300; // type:function size:0x4 scope:global Touch__23CElectricBeamProjectileFR6CActorR13CStateManager = .text:0x80252300; // type:function size:0x4 scope:global
Accept__23CElectricBeamProjectileFR8IVisitor = .text:0x80252304; // type:function size:0x38 scope:global Accept__23CElectricBeamProjectileFR8IVisitor = .text:0x80252304; // type:function size:0x38 scope:global
__ct__23CElectricBeamProjectileFRC28TToken<18CWeaponDescription>11EWeaponTypeRC17SElectricBeamInfoRC12CTransform4f14EMaterialTypesRC11CDamageInfo9TUniqueId7TAreaId9TUniqueId17EProjectileAttrib = .text:0x8025233C; // type:function size:0x25C scope:global __ct__23CElectricBeamProjectileFRC28TToken<18CWeaponDescription>11EWeaponTypeRC17SElectricBeamInfoRC12CTransform4f14EMaterialTypesRC11CDamageInfo9TUniqueId7TAreaId9TUniqueIdQ27CWeapon17EProjectileAttrib = .text:0x8025233C; // type:function size:0x25C scope:global
__dt__7CRidleyFv = .text:0x80252598; // type:function size:0x21C scope:global __dt__7CRidleyFv = .text:0x80252598; // type:function size:0x21C scope:global
fn_802527B4 = .text:0x802527B4; // type:function size:0x10C fn_802527B4 = .text:0x802527B4; // type:function size:0x10C
GetGravityConstant__7CRidleyCFv = .text:0x802528C0; // type:function size:0x8 scope:global GetGravityConstant__7CRidleyCFv = .text:0x802528C0; // type:function size:0x8 scope:global
@ -19424,7 +19424,7 @@ lbl_8057194C = .bss:0x8057194C; // type:object size:0x40 data:byte
lbl_8057198C = .bss:0x8057198C; // type:object size:0x40 data:byte lbl_8057198C = .bss:0x8057198C; // type:object size:0x40 data:byte
lbl_805719CC = .bss:0x805719CC; // type:object size:0x4 lbl_805719CC = .bss:0x805719CC; // type:object size:0x4
lbl_805719DC = .bss:0x805719DC; // type:object size:0xC data:float lbl_805719DC = .bss:0x805719DC; // type:object size:0xC data:float
skChargedShotCameraShakeData__16CCameraShakeData = .bss:0x805719E8; // type:object size:0xD4 scope:global skHardRecoil__16CCameraShakeData = .bss:0x805719E8; // type:object size:0xD4 scope:global
lbl_80571B90 = .bss:0x80571B90; // type:object size:0xD4 lbl_80571B90 = .bss:0x80571B90; // type:object size:0xD4
lbl_80571C64 = .bss:0x80571C64; // type:object size:0x68 lbl_80571C64 = .bss:0x80571C64; // type:object size:0x68
lbl_80571E6C = .bss:0x80571E6C; // type:object size:0x68 lbl_80571E6C = .bss:0x80571E6C; // type:object size:0x68
@ -21496,8 +21496,8 @@ lbl_805A8C68 = .sbss:0x805A8C68; // type:object size:0x4 data:4byte
lbl_805A8C6C = .sbss:0x805A8C6C; // type:object size:0x1 data:byte lbl_805A8C6C = .sbss:0x805A8C6C; // type:object size:0x1 data:byte
lbl_805A8C70 = .sbss:0x805A8C70; // type:object size:0x4 data:4byte lbl_805A8C70 = .sbss:0x805A8C70; // type:object size:0x4 data:4byte
lbl_805A8C74 = .sbss:0x805A8C74; // type:object size:0x1 data:byte lbl_805A8C74 = .sbss:0x805A8C74; // type:object size:0x1 data:byte
lbl_805A8C78 = .sbss:0x805A8C78; // type:object size:0x1 data:byte gUseSurfaceHack = .sbss:0x805A8C78; // type:object size:0x1 data:byte
lbl_805A8C7C = .sbss:0x805A8C7C; // type:object size:0x4 data:4byte gSR_Hack = .sbss:0x805A8C7C; // type:object size:0x4 data:4byte
lbl_805A8C80 = .sbss:0x805A8C80; // type:object size:0x1 data:byte lbl_805A8C80 = .sbss:0x805A8C80; // type:object size:0x1 data:byte
lbl_805A8C81 = .sbss:0x805A8C81; // type:object size:0x1 data:byte lbl_805A8C81 = .sbss:0x805A8C81; // type:object size:0x1 data:byte
lbl_805A8C84 = .sbss:0x805A8C84; // type:object size:0x4 data:float lbl_805A8C84 = .sbss:0x805A8C84; // type:object size:0x4 data:float

View File

@ -25,7 +25,7 @@ RegisterResourceTweaks__5CMainFv = .text:0x8000367C; // type:function size:0x24
ResetGameState__5CMainFv = .text:0x800036A0; // type:function size:0x100 scope:global ResetGameState__5CMainFv = .text:0x800036A0; // type:function size:0x100 scope:global
__as__12CGameOptionsFRC12CGameOptions = .text:0x800037A0; // type:function size:0x130 scope:global __as__12CGameOptionsFRC12CGameOptions = .text:0x800037A0; // type:function size:0x130 scope:global
__as__Q24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator>FRCQ24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator> = .text:0x800038D0; // type:function size:0xFC scope:global __as__Q24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator>FRCQ24rstl55vector<Q24rstl11pair<Ui,Ui>,Q24rstl17rmemory_allocator> = .text:0x800038D0; // type:function size:0xFC scope:global
__as__14CSystemOptionsFRC14CSystemOptions = .text:0x800039CC; // type:function size:0x1C0 scope:global __as__12CSystemStateFRC12CSystemState = .text:0x800039CC; // type:function size:0x1C0 scope:global
__as__Q24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator>FRCQ24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator> = .text:0x80003B8C; // type:function size:0xFC scope:global __as__Q24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator>FRCQ24rstl63vector<Q24rstl19pair<Ui,9TEditorId>,Q24rstl17rmemory_allocator> = .text:0x80003B8C; // type:function size:0xFC scope:global
__as__Q24rstl24single_ptr<10CGameState>FP10CGameState = .text:0x80003C88; // type:function size:0x48 scope:global __as__Q24rstl24single_ptr<10CGameState>FP10CGameState = .text:0x80003C88; // type:function size:0x48 scope:global
__dt__10CGameStateFv = .text:0x80003CD0; // type:function size:0x190 scope:global __dt__10CGameStateFv = .text:0x80003CD0; // type:function size:0x190 scope:global
@ -33,8 +33,8 @@ fn_80003E60 = .text:0x80003E60; // type:function size:0x8C scope:global
fn_80003EEC = .text:0x80003EEC; // type:function size:0x98 scope:global fn_80003EEC = .text:0x80003EEC; // type:function size:0x98 scope:global
__dt__12CGameOptionsFv = .text:0x80003F84; // type:function size:0xF0 scope:global __dt__12CGameOptionsFv = .text:0x80003F84; // type:function size:0xF0 scope:global
__ct__12CGameOptionsFRC12CGameOptions = .text:0x80004074; // type:function size:0x164 scope:global __ct__12CGameOptionsFRC12CGameOptions = .text:0x80004074; // type:function size:0x164 scope:global
__dt__14CSystemOptionsFv = .text:0x800041D8; // type:function size:0x14C scope:global __dt__12CSystemStateFv = .text:0x800041D8; // type:function size:0x14C scope:global
__ct__14CSystemOptionsFRC14CSystemOptions = .text:0x80004324; // type:function size:0x180 scope:global __ct__12CSystemStateFRC12CSystemState = .text:0x80004324; // type:function size:0x180 scope:global
StreamNewGameState__5CMainFR12CInputStreami = .text:0x800044A4; // type:function size:0xEC scope:global StreamNewGameState__5CMainFR12CInputStreami = .text:0x800044A4; // type:function size:0xEC scope:global
RefreshGameState__5CMainFv = .text:0x80004590; // type:function size:0x21C scope:global RefreshGameState__5CMainFv = .text:0x80004590; // type:function size:0x21C scope:global
__dt__15CMemoryInStreamFv = .text:0x800047AC; // type:function size:0x60 scope:global __dt__15CMemoryInStreamFv = .text:0x800047AC; // type:function size:0x60 scope:global
@ -359,15 +359,15 @@ UpdateMorphBallState__7CPlayerFfRC11CFinalInputR13CStateManager = .text:0x80014B
ProcessInput__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x80014DD8; // type:function size:0x9B0 scope:global ProcessInput__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x80014DD8; // type:function size:0x9B0 scope:global
GetMaterial__19CCollisionPrimitiveCFv = .text:0x80015788; // type:function size:0x8 scope:global GetMaterial__19CCollisionPrimitiveCFv = .text:0x80015788; // type:function size:0x8 scope:global
StartLandingControlFreeze__7CPlayerFv = .text:0x80015790; // type:function size:0x14 scope:global StartLandingControlFreeze__7CPlayerFv = .text:0x80015790; // type:function size:0x14 scope:global
ProcessFrozenInput__7CPlayerFfR13CStateManager = .text:0x800157A4; // type:function size:0xC0 scope:global UpdateControlLostState__7CPlayerFfR13CStateManager = .text:0x800157A4; // type:function size:0xC0 scope:global
EndLandingControlFreeze__7CPlayerFv = .text:0x80015864; // type:function size:0x14 scope:global EndLandingControlFreeze__7CPlayerFv = .text:0x80015864; // type:function size:0x14 scope:global
UpdateFrozenState__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x80015878; // type:function size:0x1F4 scope:global UpdateFrozenState__7CPlayerFRC11CFinalInputR13CStateManager = .text:0x80015878; // type:function size:0x1F4 scope:global
wstring_l__4rstlFPCw = .text:0x80015A6C; // type:function size:0x3C scope:global wstring_l__4rstlFPCw = .text:0x80015A6C; // type:function size:0x3C scope:global
UnFreeze__7CPlayerFR13CStateManager = .text:0x80015AA8; // type:function size:0x2D0 scope:global BreakFrozenState__7CPlayerFR13CStateManager = .text:0x80015AA8; // type:function size:0x2D0 scope:global
GetFrozenState__7CPlayerCFv = .text:0x80015D78; // type:function size:0x18 scope:global GetFrozenState__7CPlayerCFv = .text:0x80015D78; // type:function size:0x18 scope:global
Freeze__7CPlayerFR13CStateManagerUiUsUi = .text:0x80015D90; // type:function size:0x19C scope:global SetFrozenState__7CPlayerFR13CStateManagerUiUsUi = .text:0x80015D90; // type:function size:0x19C scope:global
Think__7CPlayerFfR13CStateManager = .text:0x80015F2C; // type:function size:0x59C scope:global Think__7CPlayerFfR13CStateManager = .text:0x80015F2C; // type:function size:0x59C scope:global
UpdateWaterSurfaceCameraBias__7CPlayerFR13CStateManager = .text:0x800164C8; // type:function size:0xF4 scope:global AdjustEyeOffset__7CPlayerFR13CStateManager = .text:0x800164C8; // type:function size:0xF4 scope:global
PreThink__7CPlayerFfR13CStateManager = .text:0x800165BC; // type:function size:0x38 scope:global PreThink__7CPlayerFfR13CStateManager = .text:0x800165BC; // type:function size:0x38 scope:global
AcceptScriptMsg__7CPlayerF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800165F4; // type:function size:0x824 scope:global AcceptScriptMsg__7CPlayerF20EScriptObjectMessage9TUniqueIdR13CStateManager = .text:0x800165F4; // type:function size:0x824 scope:global
UpdateCameraTimers__7CPlayerFfRC11CFinalInput = .text:0x80016E18; // type:function size:0x148 scope:global UpdateCameraTimers__7CPlayerFfRC11CFinalInput = .text:0x80016E18; // type:function size:0x148 scope:global
@ -6203,7 +6203,7 @@ UpdateHalfPipeStatus__10CMorphBallFR13CStateManagerf = .text:0x800F1A58; // type
RenderDamageEffects__10CMorphBallCFRC13CStateManagerRC12CTransform4f = .text:0x800F1C08; // type:function size:0x1C0 scope:global RenderDamageEffects__10CMorphBallCFRC13CStateManagerRC12CTransform4f = .text:0x800F1C08; // type:function size:0x1C0 scope:global
RenderIceBreakEffect__10CMorphBallCFRC13CStateManager = .text:0x800F1DC8; // type:function size:0x38 scope:global RenderIceBreakEffect__10CMorphBallCFRC13CStateManager = .text:0x800F1DC8; // type:function size:0x38 scope:global
UpdateIceBreakEffect__10CMorphBallFf = .text:0x800F1E00; // type:function size:0x1D0 scope:global UpdateIceBreakEffect__10CMorphBallFf = .text:0x800F1E00; // type:function size:0x1D0 scope:global
Stop__10CMorphBallFv = .text:0x800F1FD0; // type:function size:0x58 scope:global ResetMorphBallIceBreak__10CMorphBallFv = .text:0x800F1FD0; // type:function size:0x58 scope:global
IsMorphBallTransitionFlashValid__10CMorphBallCFv = .text:0x800F2028; // type:function size:0x14 scope:global IsMorphBallTransitionFlashValid__10CMorphBallCFv = .text:0x800F2028; // type:function size:0x14 scope:global
RenderMorphBallTransitionFlash__10CMorphBallCFRC13CStateManager = .text:0x800F203C; // type:function size:0x90 scope:global RenderMorphBallTransitionFlash__10CMorphBallCFRC13CStateManager = .text:0x800F203C; // type:function size:0x90 scope:global
UpdateMorphBallTransitionFlash__10CMorphBallFf = .text:0x800F20CC; // type:function size:0x1D0 scope:global UpdateMorphBallTransitionFlash__10CMorphBallFf = .text:0x800F20CC; // type:function size:0x1D0 scope:global
@ -6361,7 +6361,7 @@ FluidFXThink__7CWeaponFQ26CActor11EFluidStateR12CScriptWaterR13CStateManager = .
Think__7CWeaponFfR13CStateManager = .text:0x80102154; // type:function size:0x140 scope:global Think__7CWeaponFfR13CStateManager = .text:0x80102154; // type:function size:0x140 scope:global
SetDamageFalloffSpeed__7CWeaponFf = .text:0x80102294; // type:function size:0x1C scope:global SetDamageFalloffSpeed__7CWeaponFf = .text:0x80102294; // type:function size:0x1C scope:global
__dt__7CWeaponFv = .text:0x801022B0; // type:function size:0x60 scope:global __dt__7CWeaponFv = .text:0x801022B0; // type:function size:0x60 scope:global
__ct__7CWeaponF9TUniqueId7TAreaIdb9TUniqueId11EWeaponTypeRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC12CTransform4fRC15CMaterialFilterRC13CMaterialListRC11CDamageInfo17EProjectileAttribRC10CModelData = .text:0x80102310; // type:function size:0x1FC scope:global __ct__7CWeaponF9TUniqueId7TAreaIdb9TUniqueId11EWeaponTypeRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>RC12CTransform4fRC15CMaterialFilterRC13CMaterialListRC11CDamageInfoiRC10CModelData = .text:0x80102310; // type:function size:0x1FC scope:global
GetDeflectionType__20CDamageVulnerabilityCFRC11CWeaponMode = .text:0x8010250C; // type:function size:0x2C scope:global GetDeflectionType__20CDamageVulnerabilityCFRC11CWeaponMode = .text:0x8010250C; // type:function size:0x2C scope:global
GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x80102538; // type:function size:0xC8 scope:global GetVulnerability__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x80102538; // type:function size:0xC8 scope:global
WeaponHits__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x80102600; // type:function size:0x184 scope:global WeaponHits__20CDamageVulnerabilityCFRC11CWeaponModei = .text:0x80102600; // type:function size:0x184 scope:global
@ -6937,7 +6937,7 @@ nullsub_209 = .text:0x8012E988; // type:function size:0x4 scope:global
AddRipple__11CFluidPlaneFRC7CRippleRC12CScriptWaterR13CStateManager = .text:0x8012E98C; // type:function size:0x54 scope:global AddRipple__11CFluidPlaneFRC7CRippleRC12CScriptWaterR13CStateManager = .text:0x8012E98C; // type:function size:0x54 scope:global
AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fRC9CVector3fRC12CScriptWaterR13CStateManagerRC9CVector3f = .text:0x8012E9E0; // type:function size:0xC4 scope:global AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fRC9CVector3fRC12CScriptWaterR13CStateManagerRC9CVector3f = .text:0x8012E9E0; // type:function size:0xC4 scope:global
AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fR13CStateManager = .text:0x8012EAA4; // type:function size:0xA0 scope:global AddRipple__11CFluidPlaneFf9TUniqueIdRC9CVector3fR13CStateManager = .text:0x8012EAA4; // type:function size:0xA0 scope:global
ProjectRippleVelocity__11CFluidPlaneCFff = .text:0x8012EB44; // type:function size:0x50 scope:global GetRippleScaleFromKineticEnergy__11CFluidPlaneFff = .text:0x8012EB44; // type:function size:0x50 scope:global
CalculateRippleIntensity__11CFluidPlaneCFf = .text:0x8012EB94; // type:function size:0xC4 scope:global CalculateRippleIntensity__11CFluidPlaneCFf = .text:0x8012EB94; // type:function size:0xC4 scope:global
__dt__11CFluidPlaneFv = .text:0x8012EC58; // type:function size:0x158 scope:global __dt__11CFluidPlaneFv = .text:0x8012EC58; // type:function size:0x158 scope:global
__ct__11CFluidPlaneFUiUiUifQ211CFluidPlane10EFluidTypefRC14CFluidUVMotion = .text:0x8012EDB0; // type:function size:0x364 scope:global __ct__11CFluidPlaneFUiUiUifQ211CFluidPlane10EFluidTypefRC14CFluidUVMotion = .text:0x8012EDB0; // type:function size:0x364 scope:global
@ -9006,8 +9006,8 @@ StateForWorld__10CGameStateFUi = .text:0x801D3A54; // type:function size:0x104 s
__ct__11CWorldStateFRC11CWorldState = .text:0x801D3B58; // type:function size:0xD8 scope:global __ct__11CWorldStateFRC11CWorldState = .text:0x801D3B58; // type:function size:0xD8 scope:global
WriteBackupBuf__10CGameStateFv = .text:0x801D3C30; // type:function size:0x68 scope:global WriteBackupBuf__10CGameStateFv = .text:0x801D3C30; // type:function size:0x68 scope:global
resize__Q24rstl37vector<Uc,Q24rstl17rmemory_allocator>FiRCUc = .text:0x801D3C98; // type:function size:0xEC scope:global resize__Q24rstl37vector<Uc,Q24rstl17rmemory_allocator>FiRCUc = .text:0x801D3C98; // type:function size:0xEC scope:global
ExportPersistentOptions__10CGameStateFR14CSystemOptions = .text:0x801D3D84; // type:function size:0x1C4 scope:global ExportPersistentOptions__10CGameStateFR12CSystemState = .text:0x801D3D84; // type:function size:0x1C4 scope:global
ImportPersistentOptions__10CGameStateFRC14CSystemOptions = .text:0x801D3F48; // type:function size:0x150 scope:global ImportPersistentOptions__10CGameStateFRC12CSystemState = .text:0x801D3F48; // type:function size:0x150 scope:global
WriteSystemOptions__10CGameStateFR13COutputStream = .text:0x801D4098; // type:function size:0x24 scope:global WriteSystemOptions__10CGameStateFR13COutputStream = .text:0x801D4098; // type:function size:0x24 scope:global
ReadSystemOptions__10CGameStateFR12CInputStream = .text:0x801D40BC; // type:function size:0x48 scope:global ReadSystemOptions__10CGameStateFR12CInputStream = .text:0x801D40BC; // type:function size:0x48 scope:global
PutTo__10CGameStateCFR13COutputStream = .text:0x801D4104; // type:function size:0x1CC scope:global PutTo__10CGameStateCFR13COutputStream = .text:0x801D4104; // type:function size:0x1CC scope:global
@ -9030,28 +9030,28 @@ GetWorldAssetId__11CWorldStateCFv = .text:0x801D4E0C; // type:function size:0x8
PutTo__11CWorldStateFR16CMemoryStreamOut = .text:0x801D4E14; // type:function size:0xA0 scope:global PutTo__11CWorldStateFR16CMemoryStreamOut = .text:0x801D4E14; // type:function size:0xA0 scope:global
__ct__11CWorldStateFR12CInputStreamPCvR18CWorldSaveGameInfo = .text:0x801D4EB4; // type:function size:0x238 scope:global __ct__11CWorldStateFR12CInputStreamPCvR18CWorldSaveGameInfo = .text:0x801D4EB4; // type:function size:0x238 scope:global
__ct__11CWorldStateFUi = .text:0x801D50EC; // type:function size:0x138 scope:global __ct__11CWorldStateFUi = .text:0x801D50EC; // type:function size:0x138 scope:global
SetAutoMapperKeyState__14CSystemOptionsFi = .text:0x801D5224; // type:function size:0x8 scope:global SetAutoMapperKeyState__12CSystemStateFi = .text:0x801D5224; // type:function size:0x8 scope:global
SetAllItemsCollected__14CSystemOptionsFb = .text:0x801D522C; // type:function size:0x10 scope:global SetAllItemsCollected__12CSystemStateFb = .text:0x801D522C; // type:function size:0x10 scope:global
SetHasFusion__14CSystemOptionsFb = .text:0x801D523C; // type:function size:0x10 scope:global SetHasFusion__12CSystemStateFb = .text:0x801D523C; // type:function size:0x10 scope:global
fn_801D51D0 = .text:0x801D524C; // type:function size:0x10 scope:global fn_801D51D0 = .text:0x801D524C; // type:function size:0x10 scope:global
SetHardModeBeat__14CSystemOptionsFb = .text:0x801D525C; // type:function size:0x10 scope:global SetHardModeBeat__12CSystemStateFb = .text:0x801D525C; // type:function size:0x10 scope:global
SetHasHardMode__14CSystemOptionsFb = .text:0x801D526C; // type:function size:0x10 scope:global SetHasHardMode__12CSystemStateFb = .text:0x801D526C; // type:function size:0x10 scope:global
SetLogScanCount__14CSystemOptionsFi = .text:0x801D527C; // type:function size:0x8 scope:global SetLogScanCount__12CSystemStateFi = .text:0x801D527C; // type:function size:0x8 scope:global
GetLogScanCount__14CSystemOptionsFv = .text:0x801D5284; // type:function size:0x8 scope:global GetLogScanCount__12CSystemStateFv = .text:0x801D5284; // type:function size:0x8 scope:global
fn_801D5210 = .text:0x801D528C; // type:function size:0x10 scope:global fn_801D5210 = .text:0x801D528C; // type:function size:0x10 scope:global
IncrementPowerBombAmmoCount__14CSystemOptionsFv = .text:0x801D529C; // type:function size:0x34 scope:global IncrementPowerBombAmmoCount__12CSystemStateFv = .text:0x801D529C; // type:function size:0x34 scope:global
GetShowPowerBombAmmoMessage__14CSystemOptionsCFv = .text:0x801D52D0; // type:function size:0x1C scope:global GetShowPowerBombAmmoMessage__12CSystemStateCFv = .text:0x801D52D0; // type:function size:0x1C scope:global
IncrementFrozenBallCount__14CSystemOptionsFv = .text:0x801D52EC; // type:function size:0x34 scope:global IncrementFrozenBallCount__12CSystemStateFv = .text:0x801D52EC; // type:function size:0x34 scope:global
GetShowFrozenBallMessage__14CSystemOptionsCFv = .text:0x801D5320; // type:function size:0x1C scope:global GetShowFrozenBallMessage__12CSystemStateCFv = .text:0x801D5320; // type:function size:0x1C scope:global
IncrementFrozenFpsCount__14CSystemOptionsFv = .text:0x801D533C; // type:function size:0x34 scope:global IncNumFreezeInstructionsPrintedFirstPerson__12CSystemStateFv = .text:0x801D533C; // type:function size:0x34 scope:global
GetShowFrozenFpsMessage__14CSystemOptionsCFv = .text:0x801D5370; // type:function size:0x1C scope:global GetShowFrozenFpsMessage__12CSystemStateCFv = .text:0x801D5370; // type:function size:0x1C scope:global
SetCinematicState__14CSystemOptionsFUi9TEditorIdb = .text:0x801D538C; // type:function size:0x130 scope:global SetCinematicState__12CSystemStateFUi9TEditorIdb = .text:0x801D538C; // type:function size:0x130 scope:global
fn_801D5440 = .text:0x801D54BC; // type:function size:0x4C scope:global fn_801D5440 = .text:0x801D54BC; // type:function size:0x4C scope:global
fn_801D548C = .text:0x801D5508; // type:function size:0x9C scope:global fn_801D548C = .text:0x801D5508; // type:function size:0x9C scope:global
GetCinematicState__14CSystemOptionsCFQ24rstl19pair<Ui,9TEditorId> = .text:0x801D55A4; // type:function size:0x68 scope:global GetCinematicState__12CSystemStateCFQ24rstl19pair<Ui,9TEditorId> = .text:0x801D55A4; // type:function size:0x68 scope:global
PutTo__14CSystemOptionsFR13COutputStream = .text:0x801D560C; // type:function size:0x3D8 scope:global PutTo__12CSystemStateFR13COutputStream = .text:0x801D560C; // type:function size:0x3D8 scope:global
__ct__14CSystemOptionsFR12CInputStream = .text:0x801D59E4; // type:function size:0x5A0 scope:global __ct__12CSystemStateFR12CInputStream = .text:0x801D59E4; // type:function size:0x5A0 scope:global
__ct__14CSystemOptionsFv = .text:0x801D5F84; // type:function size:0x1A8 scope:global __ct__12CSystemStateFv = .text:0x801D5F84; // type:function size:0x1A8 scope:global
fn_801D60B0 = .text:0x801D612C; // type:function size:0x20 scope:global fn_801D60B0 = .text:0x801D612C; // type:function size:0x20 scope:global
Clamp<d>__5CMathFRCdRCdRCd = .text:0x801D614C; // type:function size:0x2C scope:global Clamp<d>__5CMathFRCdRCdRCd = .text:0x801D614C; // type:function size:0x2C scope:global
fn_801D60FC = .text:0x801D6178; // type:function size:0x100 scope:global fn_801D60FC = .text:0x801D6178; // type:function size:0x100 scope:global
@ -19446,7 +19446,7 @@ lbl_8057194C = .bss:0x80571B2C; // type:object size:0x40 scope:global data:byte
lbl_8057198C = .bss:0x80571B6C; // type:object size:0x40 scope:global data:byte lbl_8057198C = .bss:0x80571B6C; // type:object size:0x40 scope:global data:byte
lbl_805719CC = .bss:0x80571BAC; // type:object size:0x10 scope:global lbl_805719CC = .bss:0x80571BAC; // type:object size:0x10 scope:global
lbl_805719DC = .bss:0x80571BBC; // type:object size:0xC scope:global data:float lbl_805719DC = .bss:0x80571BBC; // type:object size:0xC scope:global data:float
skChargedShotCameraShakeData__16CCameraShakeData = .bss:0x80571BC8; // type:object size:0x27C scope:global skHardRecoil__16CCameraShakeData = .bss:0x80571BC8; // type:object size:0x27C scope:global
lbl_80571ABC = .bss:0x80571C9C; // type:object size:0xD4 scope:global lbl_80571ABC = .bss:0x80571C9C; // type:object size:0xD4 scope:global
lbl_80571B90 = .bss:0x80571D70; // type:object size:0xD4 scope:global lbl_80571B90 = .bss:0x80571D70; // type:object size:0xD4 scope:global
lbl_80571C64 = .bss:0x80571E44; // type:object size:0x3A8 scope:global lbl_80571C64 = .bss:0x80571E44; // type:object size:0x3A8 scope:global

View File

@ -210,7 +210,7 @@ public:
static void SetDuration(CSfxHandle handle, float duration); static void SetDuration(CSfxHandle handle, float duration);
static ushort GetReverbAmount(); static ushort GetReverbAmount();
static CSfxHandle SfxStart(const ushort id, const short vol = 127, const short pan = 64, static CSfxHandle SfxStart(ushort id, const short vol = 127, const short pan = 64,
const bool useAcoustics = false, const short prio = kMedPriority, const bool useAcoustics = false, const short prio = kMedPriority,
const bool looped = false, const int areaId = kAllAreas); const bool looped = false, const int areaId = kAllAreas);
static void SfxStop(CSfxHandle handle); static void SfxStop(CSfxHandle handle);

View File

@ -19,7 +19,7 @@ public:
template < typename T > template < typename T >
static const T& Clamp(const T& min, const T& val, const T& max); static const T& Clamp(const T& min, const T& val, const T& max);
static float SqrtF(float v); static float SqrtF(float v);
static inline float Limit(float v, float h) { return fabs(v) > h ? h * Sign(v) : v; } static inline float Limit(float v, float h) { if (fabs(v) > h) return h * Sign(v); return v; }
static inline float Sign(float v) { return FastFSel(v, 1.f, -1.f); } static inline float Sign(float v) { return FastFSel(v, 1.f, -1.f); }
#ifdef __MWERKS__ #ifdef __MWERKS__
static inline float FastFSel(register float v, register float h, register float l) { static inline float FastFSel(register float v, register float h, register float l) {
@ -72,7 +72,16 @@ public:
static CVector3f BaryToWorld(const CVector3f& p0, const CVector3f& p1, const CVector3f& p2, static CVector3f BaryToWorld(const CVector3f& p0, const CVector3f& p1, const CVector3f& p2,
const CVector3f& bary); const CVector3f& bary);
// GetCatmullRomSplinePoint__5CMathFRC9CVector3fRC9CVector3fRC9CVector3fRC9CVector3ff global // GetCatmullRomSplinePoint__5CMathFRC9CVector3fRC9CVector3fRC9CVector3fRC9CVector3ff global
// FastSqrtF__5CMathFf weak #ifdef __MWERKS__
static inline float FastSqrtF(register float x) {
if (x == 0.f) {
return 0.f;
}
return x * __frsqrte(x);
}
#else
static inline float FastSqrtF(float x) { return sqrtf(x); }
#endif
static double SqrtD(double x); static double SqrtD(double x);
// IsEpsilon__5CMathFfff global // IsEpsilon__5CMathFfff global
// FastMin__5CMathFff weak // FastMin__5CMathFff weak

View File

@ -97,27 +97,6 @@ enum EWeaponCollisionResponseTypes {
kWCR_AtomicBetaReflect, kWCR_AtomicBetaReflect,
kWCR_AtomicAlphaReflect, kWCR_AtomicAlphaReflect,
}; };
enum EProjectileAttrib {
kPA_None = 0,
kPA_PartialCharge = (1 << 0),
kPA_PlasmaProjectile = (1 << 1),
kPA_Charged = (1 << 2),
kPA_Ice = (1 << 3),
kPA_Wave = (1 << 4),
kPA_Plasma = (1 << 5),
kPA_Phazon = (1 << 6),
kPA_ComboShot = (1 << 7),
kPA_Bombs = (1 << 8),
kPA_PowerBombs = (1 << 9),
kPA_BigProjectile = (1 << 10),
kPA_ArmCannon = (1 << 11),
kPA_BigStrike = (1 << 12),
kPA_DamageFalloff = (1 << 13),
kPA_StaticInterference = (1 << 14),
kPA_PlayerUnFreeze = (1 << 15),
kPA_ParticleOPTS = (1 << 16),
kPA_KeepInCinematic = (1 << 17),
};
enum EUserEventType { enum EUserEventType {
kUE_Projectile = 0, kUE_Projectile = 0,
kUE_EggLay = 1, kUE_EggLay = 1,

View File

@ -82,7 +82,7 @@ public:
virtual CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const; virtual CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const;
virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, virtual EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&, const CWeaponMode&,
int /*EProjectileAttrib?*/) const; int) const;
virtual void FluidFXThink(EFluidState, CScriptWater&, CStateManager&); virtual void FluidFXThink(EFluidState, CScriptWater&, CStateManager&);
virtual void OnScanStateChange(EScanState, CStateManager&); virtual void OnScanStateChange(EScanState, CStateManager&);
virtual CAABox GetSortingBounds(const CStateManager&) const; virtual CAABox GetSortingBounds(const CStateManager&) const;

View File

@ -45,7 +45,7 @@ public:
CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const override; CVector3f GetScanObjectIndicatorPosition(const CStateManager&) const override;
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&, const CWeaponMode&,
int /*EProjectileAttrib?*/) const override; int) const override;
void OnScanStateChange(EScanState, CStateManager&) override; void OnScanStateChange(EScanState, CStateManager&) override;
// CPhysicsActor // CPhysicsActor

View File

@ -25,7 +25,12 @@ public:
class CFluidPlane { class CFluidPlane {
public: public:
enum EFluidType { enum EFluidType {
// TODO kFT_NormalWater,
kFT_PoisonWater,
kFT_Lava,
kFT_PhazonFluid,
kFT_Four,
kFT_ThickLava
}; };
CFluidPlane(uint, uint, uint, CFluidPlane::EFluidType, float, const CFluidUVMotion&); CFluidPlane(uint, uint, uint, CFluidPlane::EFluidType, float, const CFluidUVMotion&);
@ -37,6 +42,8 @@ public:
const CVector3f& upVec); const CVector3f& upVec);
// Update__11CFluidPlaneFv // Update__11CFluidPlaneFv
float GetRippleScaleFromKineticEnergy(float baseI, float velDot);
float GetAlpha() const { return x40_alpha; } float GetAlpha() const { return x40_alpha; }
EFluidType GetFluidType() const { return x44_fluidType; } EFluidType GetFluidType() const { return x44_fluidType; }
const CFluidUVMotion& GetUVMotion() const { return x4c_uvMotion; } const CFluidUVMotion& GetUVMotion() const { return x4c_uvMotion; }

View File

@ -192,6 +192,7 @@ public:
const CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; } const CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
CWorldTransManager* WorldTransManager() { return x8c4_worldTransManager.GetPtr(); } CWorldTransManager* WorldTransManager() { return x8c4_worldTransManager.GetPtr(); }
const CWorldTransManager* GetWorldTransManager() const { return x8c4_worldTransManager.GetPtr(); } const CWorldTransManager* GetWorldTransManager() const { return x8c4_worldTransManager.GetPtr(); }
EGameState GetGameState() const { return x904_gameState; }
CRandom16* Random() const { return x900_random; } CRandom16* Random() const { return x900_random; }
uint GetUpdateFrameIndex() const { return x8d8_updateFrameIdx; } uint GetUpdateFrameIndex() const { return x8d8_updateFrameIdx; }

View File

@ -87,6 +87,7 @@ public:
void DeleteCameraHint(TUniqueId uid, CStateManager& mgr); void DeleteCameraHint(TUniqueId uid, CStateManager& mgr);
void ReallyRemoveCameraHint(TUniqueId uid, CStateManager& mgr); void ReallyRemoveCameraHint(TUniqueId uid, CStateManager& mgr);
// SetSpecialCameras__14CCameraManagerFR18CFirstPersonCameraR11CBallCamera // SetSpecialCameras__14CCameraManagerFR18CFirstPersonCameraR11CBallCamera
void ResetCameraHint(CStateManager& mgr);
void SetCurrentFov(float fov) { x3bc_curFov = fov; } void SetCurrentFov(float fov) { x3bc_curFov = fov; }
@ -105,6 +106,9 @@ public:
void SetSpindleCamera(TUniqueId id, CStateManager& mgr); void SetSpindleCamera(TUniqueId id, CStateManager& mgr);
TUniqueId GetSpindleCameraId() const; TUniqueId GetSpindleCameraId() const;
CBallCamera* BallCamera() const { return x80_ballCamera; }
const CBallCamera* GetBallCamera() const { return x80_ballCamera; }
static float GetDefaultThirdPersonVerticalFOV(); static float GetDefaultThirdPersonVerticalFOV();
static float GetDefaultFirstPersonVerticalFOV(); static float GetDefaultFirstPersonVerticalFOV();
static float GetDefaultFirstPersonNearClipDistance(); static float GetDefaultFirstPersonNearClipDistance();

View File

@ -68,14 +68,36 @@ public:
float GetSomething() const; float GetSomething() const;
float GetSomething2() const; float GetSomething2() const;
float GetDuration() const { return x0_duration; } // From MP1R
float GetAttenuatedMagnitude() const;
float GetMaxAmplitude() const;
float GetMaxSeverity() const;
bool IsSingleDirection() const;
void ResetTime();
void SetAttenuation(float, CVector3f);
void SetTranslation(const CVector3f&);
static CCameraShakeData HardBothAxesShake(float duration, float);
static CCameraShakeData HardHorizShake(float duration, float);
static CCameraShakeData HardHorizShakeDistance(float duration, float, float, CVector3f);
static CCameraShakeData HardVertShake(float duration, float);
static CCameraShakeData HardVertShakeDistance(float duration, float, float, CVector3f);
static CCameraShakeData SoftBothAxesShake(float duration, float);
static CCameraShakeData SoftHorizShake(float duration, float);
static CCameraShakeData SoftHorizShakeDistance(float duration, float, float, CVector3f);
static CCameraShakeData SoftVertShake(float duration, float);
static CCameraShakeData SoftVertShakeDistance(float duration, float, float, CVector3f);
static CCameraShakeData VerticalOverrideShake(float duration);
float GetDuration() const { return x0_duration; } // In MP1R, returns either x0 or xec?
float GetCurTime() const { return x4_curTime; } float GetCurTime() const { return x4_curTime; }
CVector3f GetPoint() const; // { return xc4_sfxPos; } CVector3f GetPoint() const; // { return xc4_sfxPos; }
bool Done() const { return x4_curTime >= x0_duration; } bool Done() const { return x4_curTime >= x0_duration; } // Finished in MP1R
uint GetFlags() const { return xc0_flags; } uint GetFlags() const { return xc0_flags; }
const CVector3f& GetSfxPos() const { return xc4_sfxPos; } const CVector3f& GetSfxPos() const { return xc4_sfxPos; }
static CCameraShakeData skChargedShotCameraShakeData; static CCameraShakeData skSoftRecoil;
static CCameraShakeData skHardRecoil;
private: private:
float x0_duration; float x0_duration;

View File

@ -168,7 +168,7 @@ public:
CVector3f GetAimPosition(const CStateManager&, float) const override; CVector3f GetAimPosition(const CStateManager&, float) const override;
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&, const CWeaponMode&,
int /*EProjectileAttrib?*/) const override; int) const override;
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type,
float dt) override; float dt) override;

View File

@ -10,6 +10,9 @@
class CSamusHud { class CSamusHud {
public: public:
static void DisplayHudMemo(const rstl::wstring& text, const CHUDMemoParms& info); static void DisplayHudMemo(const rstl::wstring& text, const CHUDMemoParms& info);
static void ClearHudMemo() {
DisplayHudMemo(rstl::wstring_l(L""), CHUDMemoParms(0.f, true, true, true));
}
}; };
#endif // _CSAMUSHUD #endif // _CSAMUSHUD

View File

@ -6,7 +6,7 @@
#include "MetroidPrime/Player/CGameOptions.hpp" #include "MetroidPrime/Player/CGameOptions.hpp"
#include "MetroidPrime/Player/CHintOptions.hpp" #include "MetroidPrime/Player/CHintOptions.hpp"
#include "MetroidPrime/Player/CPlayerState.hpp" #include "MetroidPrime/Player/CPlayerState.hpp"
#include "MetroidPrime/Player/CSystemOptions.hpp" #include "MetroidPrime/Player/CSystemState.hpp"
#include "MetroidPrime/Player/CWorldState.hpp" #include "MetroidPrime/Player/CWorldState.hpp"
#include "MetroidPrime/Player/CWorldTransManager.hpp" #include "MetroidPrime/Player/CWorldTransManager.hpp"
#include "MetroidPrime/TGameTypes.hpp" #include "MetroidPrime/TGameTypes.hpp"
@ -32,10 +32,10 @@ public:
CWorldState& CurrentWorldState(); CWorldState& CurrentWorldState();
void ImportPersistentOptions(const CSystemOptions&); void ImportPersistentOptions(const CSystemState&);
void ExportPersistentOptions(CSystemOptions&); void ExportPersistentOptions(CSystemState&);
CSystemOptions& SystemOptions() { return xa8_systemOptions; } CSystemState& SystemState() { return xa8_systemState; }
CGameOptions& GameOptions() { return x17c_gameOptions; } CGameOptions& GameOptions() { return x17c_gameOptions; }
CHintOptions& HintOptions() { return x1f8_hintOptions; } CHintOptions& HintOptions() { return x1f8_hintOptions; }
uint& SaveIdx() { return x20c_saveIdx; } uint& SaveIdx() { return x20c_saveIdx; }
@ -68,7 +68,7 @@ private:
rstl::rc_ptr< CPlayerState > x98_playerState; rstl::rc_ptr< CPlayerState > x98_playerState;
rstl::rc_ptr< CWorldTransManager > x9c_transManager; rstl::rc_ptr< CWorldTransManager > x9c_transManager;
double xa0_playTime; double xa0_playTime;
CSystemOptions xa8_systemOptions; CSystemState xa8_systemState;
CGameOptions x17c_gameOptions; CGameOptions x17c_gameOptions;
CHintOptions x1f8_hintOptions; CHintOptions x1f8_hintOptions;
uint x20c_saveIdx; uint x20c_saveIdx;

View File

@ -30,14 +30,103 @@ public:
float GetBallRadius() const; float GetBallRadius() const;
EBallBoostState GetBallBoostState() const; // { return x1e3c_boostState; } EBallBoostState GetBallBoostState() const;
void SetBallBoostState(EBallBoostState state); void SetBallBoostState(EBallBoostState state);
EBombJumpState GetBombJumpState() const; // { return x1e40_bombJumpState; } EBombJumpState GetBombJumpState() const;
void SetBombJumpState(EBombJumpState state); void SetBombJumpState(EBombJumpState state);
void LoadMorphBallModel(CStateManager& mgr); void LoadMorphBallModel(CStateManager& mgr);
void Update(float dt, CStateManager& mgr); void Update(float dt, CStateManager& mgr);
void StopSounds(); void StopSounds();
void UpdateEffects(float dt, CStateManager& mgr); void UpdateEffects(float dt, CStateManager& mgr);
void SetBallLightActive(CStateManager& mgr, const bool active);
// GetBallToWorld__10CMorphBallCFv global
// GetBallRadius__10CMorphBallCFv global
// TakeDamage__10CMorphBallFf global
// IsProjectile__10CMorphBallCFv weak
// LeaveMorphBallState__10CMorphBallFR13CStateManager global
// LeaveBoosting__10CMorphBallFv global
// CancelBoosting__10CMorphBallFv global
// InSpiderMode__10CMorphBallCFv weak
// SetAsProjectile__10CMorphBallFRC11CDamageInfoRC11CDamageInfo global
// CollidedWith__10CMorphBallFRC9TUniqueIdRC18CCollisionInfoListR13CStateManager global
// SwitchToMarble__10CMorphBallFv global
bool GetIsInHalfPipeMode() const;
// DampLinearAndAngularVelocities__10CMorphBallFff global
// IsClimbable__10CMorphBallCFRC14CCollisionInfo global
// FluidFXThink__10CMorphBallFQ26CActor11EFluidStateR12CScriptWaterR13CStateManager global
// GetCollidableSphere__10CMorphBallCFv weak
// DrawCollisionPrimitive__10CMorphBallCFv global
// GetPrimitiveTransform__10CMorphBallCFv global
// TouchModel__10CMorphBallCFRC13CStateManager global
// Render__10CMorphBallCFRC13CStateManagerPC12CActorLights global
// RenderDamageEffects__10CMorphBallCFRC13CStateManagerRC12CTransform4f global
// RenderSpiderBallElectricalEffects__10CMorphBallCFv global
// RenderEnergyDrainEffects__10CMorphBallCFRC13CStateManager global
// RenderMorphBallTransitionFlash__10CMorphBallCFRC13CStateManager global
// GetModel__10CMorphBallCFv weak
// GetBallContactSurfaceNormal__10CMorphBallCFv weak
// PreRender__10CMorphBallFR13CStateManagerRC14CFrustumPlanes global
// IsInFrustum__10CMorphBallCFRC14CFrustumPlanes global
// GetBallTouchRadius__10CMorphBallCFv global
// Touch__10CMorphBallFR6CActorR13CStateManager global
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
// DeleteLight__10CMorphBallFR13CStateManager global
// EnterMorphBallState__10CMorphBallFR13CStateManager
// GetSwooshToWorld__10CMorphBallCFv global
// IsMorphBallTransitionFlashValid__10CMorphBallCFv global
// AddSpiderBallElectricalEffect__10CMorphBallFv global
// UpdateSpiderBallElectricalEffects__10CMorphBallFv global
// UpdateMorphBallTransitionFlash__10CMorphBallFf global
// DisableHalfPipeStatus__10CMorphBallFv global
// SetIsInHalfPipeMode__10CMorphBallFb global
// SetIsInHalfPipeModeInAir__10CMorphBallFb global
// SetTouchedHalfPipeRecently__10CMorphBallFb global
// ResetMorphBallTransitionFlash__10CMorphBallFv global
// CreateSpiderBallParticles__10CMorphBallFRC9CVector3fRC9CVector3f global
ESpiderBallState GetSpiderBallState() const { return x187c_spiderBallState; }
// GetMorphBallModel__10CMorphBallFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>f global
// LoadAnimationTokens__10CMorphBallFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator> global
// IsBoosting__10CMorphBallCFv weak
// GetBoostChargeTimer__10CMorphBallCFv weak
// GetWallBumpCounter__10CMorphBallCFv weak
// GetBallContactMaterials__10CMorphBallCFv weak
void ComputeBallMovement(const CFinalInput&, CStateManager&, float);
// ComputeBoostBallMovement__10CMorphBallFRC11CFinalInputRC13CStateManagerf global
// IsMovementAllowed__10CMorphBallCFv global
// EnterBoosting__10CMorphBallFv global
// SwitchToTire__10CMorphBallFv global
// ComputeMarioMovement__10CMorphBallFRC11CFinalInputR13CStateManagerf global
// SetSpiderBallState__10CMorphBallFQ210CMorphBall16ESpiderBallState weak
// UpdateSpiderBall__10CMorphBallFRC11CFinalInputR13CStateManagerf global
// CheckForSwitchToSpiderBallSwinging__10CMorphBallCFR13CStateManager global
// FindClosestSpiderBallWaypoint__10CMorphBallCFR13CStateManagerRC9CVector3fR9CVector3fR9CVector3fR9CVector3fRfR9CVector3fRbR12CTransform4f global
// SetSpiderBallSwingingState__10CMorphBallFb global
// ResetSpiderBallSwingControllerMovementTimer__10CMorphBallFv global
// ApplySpiderBallSwingingForces__10CMorphBallFRC11CFinalInputR13CStateManagerf global
// GetSpiderBallControllerMovement__10CMorphBallCFRC11CFinalInputbb global
// UpdateSpiderBallSwingControllerMovementTimer__10CMorphBallFff global
// GetSpiderBallSwingControllerMovementScalar__10CMorphBallCFv global
// ApplySpiderBallRollForces__10CMorphBallFRC11CFinalInputR13CStateManagerf global
// CalculateSpiderBallAttractionSurfaceForces__10CMorphBallCFRC11CFinalInputR13CStateManagerRC12CTransform4f global
// ForwardInput__10CMorphBallCFRC11CFinalInput global
// BallTurnInput__10CMorphBallCFRC11CFinalInput global
// ComputeMaxSpeed__10CMorphBallCFv global
bool GetIsInHalfPipeModeInAir() const;
// GetTouchedHalfPipeRecently__10CMorphBallCFv global
// ComputeLiftForces__10CMorphBallFRC9CVector3fRC9CVector3fRC13CStateManager global
void UpdateBallDynamics(CStateManager&, float);
// BallCloseToCollision__10CMorphBallCFRC13CStateManagerf global
// UpdateHalfPipeStatus__10CMorphBallFR13CStateManagerf global
// CalculateSurfaceToWorld__10CMorphBallCFRC9CVector3fRC9CVector3fRC9CVector3f global
// UpdateMarbleDynamics__10CMorphBallFR13CStateManagerfRC9CVector3f global
// SpinToSpeed__10CMorphBallFfRC9CVector3ff global
// GetMinimumAlignmentSpeed__10CMorphBallCFv global
// CalculateBallContactInfo__10CMorphBallCFR9CVector3fR9CVector3f global
// CalculateSurfaceFriction__10CMorphBallCFv global
// ApplyFriction__10CMorphBallFf global
// ApplyGravity__10CMorphBallFR13CStateManager global
void Land();
void ResetMorphBallIceBreak();
private: private:
struct CSpiderBallElectricityManager { struct CSpiderBallElectricityManager {

View File

@ -28,22 +28,6 @@ enum EPlayerMovementState {
}; };
}; };
enum EPlayerOrbitRequest {
kOR_StopOrbit,
kOR_Respawn,
kOR_EnterMorphBall,
kOR_Default,
kOR_Four,
kOR_Five,
kOR_InvalidateTarget,
kOR_BadVerticalAngle,
kOR_ActivateOrbitSource,
kOR_ProjectileCollide,
kOR_Freeze,
kOR_DamageOnGrapple,
kOR_LostGrappleLineOfSight,
};
class CPlayer : public CPhysicsActor, public TOneStatic< CPlayer > { class CPlayer : public CPhysicsActor, public TOneStatic< CPlayer > {
struct CVisorSteam { struct CVisorSteam {
float x0_curTargetAlpha; float x0_curTargetAlpha;
@ -156,6 +140,21 @@ public:
kGH_Drawn, kGH_Drawn,
kGH_Holstering, kGH_Holstering,
}; };
enum EOrbitBrokenType {
kOB_StopOrbit,
kOB_Respawn,
kOB_EnterMorphBall,
kOB_Default,
kOB_Four,
kOB_Five,
kOB_InvalidateTarget,
kOB_BadVerticalAngle,
kOB_ActivateOrbitSource,
kOB_ProjectileCollide,
kOB_Freeze,
kOB_DamageOnGrapple,
kOB_LostGrappleLineOfSight,
};
CPlayer(TUniqueId uid, const CTransform4f& xf, const CAABox& aabb, CAssetId resId, CPlayer(TUniqueId uid, const CTransform4f& xf, const CAABox& aabb, CAssetId resId,
const CVector3f& playerScale, float mass, float stepUp, float stepDown, float ballRadius, const CVector3f& playerScale, float mass, float stepUp, float stepDown, float ballRadius,
@ -213,12 +212,16 @@ public:
void DecrementPhazon(); void DecrementPhazon();
// GetMovementDirection2D__7CPlayerCFv ?? // GetMovementDirection2D__7CPlayerCFv ??
void SetOrbitTargetId(TUniqueId id, CStateManager& mgr); void SetOrbitTargetId(TUniqueId id, CStateManager& mgr);
void SetOrbitRequestForTarget(TUniqueId id, EPlayerOrbitRequest req, CStateManager& mgr); void TryToBreakOrbit(TUniqueId id, EOrbitBrokenType type, CStateManager& mgr);
void BreakOrbit(EOrbitBrokenType type, CStateManager& mgr);
void BreakGrapple(EOrbitBrokenType type, CStateManager& mgr);
void AddOrbitDisableSource(CStateManager& mgr, TUniqueId addId); void AddOrbitDisableSource(CStateManager& mgr, TUniqueId addId);
void RemoveOrbitDisableSource(TUniqueId uid); void RemoveOrbitDisableSource(TUniqueId uid);
void SetAimTargetId(TUniqueId target); void SetAimTargetId(TUniqueId target);
void DoSfxEffects(CSfxHandle sfx); void DoSfxEffects(CSfxHandle sfx);
void UnFreeze(CStateManager& mgr); bool GetFrozenState() const;
void SetFrozenState(CStateManager& stateMgr, CAssetId steamTxtr, ushort sfx, CAssetId iceTxtr);
void BreakFrozenState(CStateManager& mgr);
void UpdateCinematicState(CStateManager& mgr); void UpdateCinematicState(CStateManager& mgr);
bool IsMorphBallTransitioning() const; bool IsMorphBallTransitioning() const;
void InitialiseAnimation(); void InitialiseAnimation();
@ -260,6 +263,35 @@ public:
float GetActualFirstPersonMaxVelocity(float dt) const; float GetActualFirstPersonMaxVelocity(float dt) const;
const CScriptWater* GetVisorRunoffEffect(const CStateManager& mgr) const; const CScriptWater* GetVisorRunoffEffect(const CStateManager& mgr) const;
void SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr); void SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr);
bool CanLeaveMorphBallState(CStateManager& mgr, CVector3f& pos) const;
void LeaveMorphBallState(CStateManager& mgr);
void EnterMorphBallState(CStateManager& mgr);
void ResetBallCamera(CStateManager& mgr);
void UpdateCameraState(CStateManager& mgr);
void UpdateFreeLookState(const CFinalInput& input, float dt, CStateManager& mgr);
void UpdateCameraTimers(float dt, const CFinalInput& input);
void UpdateSubmerged(const CStateManager& mgr);
bool CheckSubmerged();
void SetMoveState(NPlayer::EPlayerMovementState state, CStateManager& mgr);
void StartLandingControlFreeze(); // name?
void EndLandingControlFreeze(); // name?
void AdjustEyeOffset(CStateManager& mgr);
void SetEyeOffset(float bias);
float GetEyeOffset() const { return x9c8_eyeZBias; }
void UpdateStepUpSmoothing(float dt);
void UpdateEnvironmentDamageCameraShake(float dt, CStateManager& mgr);
void UpdatePhazonDamage(float dt, CStateManager& mgr);
void UpdateFreeLook(float dt);
void UpdatePlayerHints(CStateManager& mgr);
void UpdateBombJumpStuff();
void UpdateTransitionFilter(float dt, CStateManager& mgr);
void CalculatePlayerMovementDirection(float dt);
void UpdatePlayerControlDirection(float dt, CStateManager& mgr);
void UpdateFrozenState(const CFinalInput& input, CStateManager& mgr);
void UpdateControlLostState(float dt, CStateManager& mgr);
void ComputeMovement(const CFinalInput& input, CStateManager& mgr, float dt);
void ProcessInput(const CFinalInput& input, CStateManager& mgr);
void UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float dt);
CPlayerGun* PlayerGun() { return x490_gun.get(); } CPlayerGun* PlayerGun() { return x490_gun.get(); }
const CPlayerGun* GetPlayerGun() const { return x490_gun.get(); } const CPlayerGun* GetPlayerGun() const { return x490_gun.get(); }
@ -287,6 +319,8 @@ public:
EGunHolsterState GetGunHolsterState() const { return x498_gunHolsterState; } EGunHolsterState GetGunHolsterState() const { return x498_gunHolsterState; }
NPlayer::EPlayerMovementState GetPlayerMovementState() const { return x258_movementState; } NPlayer::EPlayerMovementState GetPlayerMovementState() const { return x258_movementState; }
const CVector3f& GetAssistedTargetAim() const { return x480_assistedTargetAim; } const CVector3f& GetAssistedTargetAim() const { return x480_assistedTargetAim; }
// CPlayer::GetFlipSpiderBallControlY() const weak
// CPlayer::GetFlipSpiderBallControlX() const weak
bool IsInsideFluid() const { return x9c4_31_inWaterMovement; } bool IsInsideFluid() const { return x9c4_31_inWaterMovement; }
@ -320,13 +354,13 @@ private:
float x28c_sjTimer; float x28c_sjTimer;
float x290_minJumpTimeout; float x290_minJumpTimeout;
float x294_jumpCameraTimer; float x294_jumpCameraTimer;
uint x298_jumpPresses; int x298_jumpPresses;
float x29c_fallCameraTimer; float x29c_fallCameraTimer;
float x2a0_; float x2a0_;
bool x2a4_cancelCameraPitch; bool x2a4_cancelCameraPitch;
float x2a8_timeSinceJump; float x2a8_timeSinceJump;
ESurfaceRestraints x2ac_surfaceRestraint; ESurfaceRestraints x2ac_surfaceRestraint;
uint x2b0_outOfWaterTicks; int x2b0_outOfWaterTicks;
rstl::reserved_vector< float, 6 > x2b4_accelerationTable; rstl::reserved_vector< float, 6 > x2b4_accelerationTable;
uint x2d0_curAcceleration; uint x2d0_curAcceleration;
float x2d4_accelerationChangeTimer; float x2d4_accelerationChangeTimer;
@ -338,7 +372,7 @@ private:
float x300_fallingTime; float x300_fallingTime;
EPlayerOrbitState x304_orbitState; EPlayerOrbitState x304_orbitState;
EPlayerOrbitType x308_orbitType; EPlayerOrbitType x308_orbitType;
EPlayerOrbitRequest x30c_orbitRequest; EOrbitBrokenType x30c_orbitBrokenType;
TUniqueId x310_orbitTargetId; TUniqueId x310_orbitTargetId;
CVector3f x314_orbitPoint; CVector3f x314_orbitPoint;
CVector3f x320_orbitVector; CVector3f x320_orbitVector;

View File

@ -1,5 +1,5 @@
#ifndef _CSYSTEMOPTIONS #ifndef _CSYSTEMSTATE
#define _CSYSTEMOPTIONS #define _CSYSTEMSTATE
#include "types.h" #include "types.h"
@ -9,11 +9,11 @@
#include "rstl/reserved_vector.hpp" #include "rstl/reserved_vector.hpp"
#include "rstl/vector.hpp" #include "rstl/vector.hpp"
class CSystemOptions { class CSystemState {
public: public:
CSystemOptions(); CSystemState();
explicit CSystemOptions(CInputStream&); explicit CSystemState(CInputStream&);
~CSystemOptions(); ~CSystemState();
void PutTo(COutputStream&) const; void PutTo(COutputStream&) const;
void SetHasFusion(bool v); void SetHasFusion(bool v);
@ -28,6 +28,11 @@ public:
bool GetAllItemsCollected() const { return xd0_29_allItemsCollected; } bool GetAllItemsCollected() const { return xd0_29_allItemsCollected; }
void SetAllItemsCollected(bool); void SetAllItemsCollected(bool);
// MP1R
bool AreFreezeInstructionsStillEnabledFirstPerson() const;
bool AreFreezeInstructionsStillEnabledMorphBall() const;
void IncNumFreezeInstructionsPrintedFirstPerson();
private: private:
rstl::reserved_vector< uchar, 98 > x0_nesState; rstl::reserved_vector< uchar, 98 > x0_nesState;
rstl::reserved_vector< bool, 64 > x68_; rstl::reserved_vector< bool, 64 > x68_;
@ -45,4 +50,4 @@ private:
bool xd0_29_allItemsCollected : 1; bool xd0_29_allItemsCollected : 1;
}; };
#endif // _CSYSTEMOPTIONS #endif // _CSYSTEMSTATE

View File

@ -28,7 +28,7 @@ public:
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override; void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&, const CWeaponMode&,
int /*EProjectileAttrib?*/) const override; int) const override;
void Render(const CStateManager& mgr) const override; void Render(const CStateManager& mgr) const override;
void AddToRenderer(const CFrustumPlanes& frustum, const CStateManager& mgr) const override; void AddToRenderer(const CFrustumPlanes& frustum, const CStateManager& mgr) const override;
void PreRender(CStateManager& mgr, const CFrustumPlanes& frustum) override; void PreRender(CStateManager& mgr, const CFrustumPlanes& frustum) override;

View File

@ -49,7 +49,7 @@ public:
void Touch(CActor&, CStateManager&) override; void Touch(CActor&, CStateManager&) override;
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&, const CWeaponMode&,
int /*EProjectileAttrib?*/) const override; int) const override;
CAABox GetSortingBounds(const CStateManager&) const override; CAABox GetSortingBounds(const CStateManager&) const override;
bool CanRippleAtPoint(const CVector3f&) const; bool CanRippleAtPoint(const CVector3f&) const;

View File

@ -3,6 +3,7 @@
#include "types.h" #include "types.h"
#include "MetroidPrime/Player/CPlayer.hpp"
#include "MetroidPrime/Tweaks/ITweakObject.hpp" #include "MetroidPrime/Tweaks/ITweakObject.hpp"
#include "Kyoto/TOneStatic.hpp" #include "Kyoto/TOneStatic.hpp"
@ -16,310 +17,316 @@ class CTweakPlayer : public ITweakObject, public TOneStatic< CTweakPlayer > {
public: public:
CTweakPlayer(CInputStream&); CTweakPlayer(CInputStream&);
// TODO CPlayer::ESurfaceRestraints float GetMaxTranslationalAcceleration(CPlayer::ESurfaceRestraints s) const {
float GetMaxTranslationalAcceleration(int s) const { return x4_maxTranslationalAcceleration[s]; } return mMaxTranslationalAcceleration[s];
float GetMaxRotationalAcceleration(int s) const { return x24_maxRotationalAcceleration[s]; }
float GetPlayerTranslationFriction(int s) const { return x44_translationFriction[s]; }
float GetPlayerRotationFriction(int s) const { return x64_rotationFriction[s]; }
float GetPlayerRotationMaxSpeed(int s) const { return x84_rotationMaxSpeed[s]; }
float GetPlayerTranslationMaxSpeed(int s) const { return xa4_translationMaxSpeed[s]; }
float GetNormalGravAccel() const { return xc4_normalGravAccel; }
float GetFluidGravAccel() const { return xc8_fluidGravAccel; }
float GetVerticalJumpAccel() const { return xcc_verticalJumpAccel; }
float GetHorizontalJumpAccel() const { return xd0_horizontalJumpAccel; }
float GetVerticalDoubleJumpAccel() const { return xd4_verticalDoubleJumpAccel; }
float GetHorizontalDoubleJumpAccel() const { return xd8_horizontalDoubleJumpAccel; }
float GetWaterJumpFactor() const { return xdc_waterJumpFactor; }
float GetWaterBallJumpFactor() const { return xe0_waterBallJumpFactor; }
float GetLavaJumpFactor() const { return xe4_lavaJumpFactor; }
float GetLavaBallJumpFactor() const { return xe8_lavaBallJumpFactor; }
float GetPhazonJumpFactor() const { return xec_phazonJumpFactor; }
float GetPhazonBallJumpFactor() const { return xf0_phazonBallJumpFactor; }
float GetAllowedJumpTime() const { return xf4_allowedJumpTime; }
float GetAllowedDoubleJumpTime() const { return xf8_allowedDoubleJumpTime; }
float GetMinDoubleJumpWindow() const { return xfc_minDoubleJumpWindow; }
float GetMaxDoubleJumpWindow() const { return x100_maxDoubleJumpWindow; }
float GetMinJumpTime() const { return x108_minJumpTime; }
float GetMinDoubleJumpTime() const { return x10c_minDoubleJumpTime; }
float GetAllowedLedgeTime() const { return x110_allowedLedgeTime; }
float GetDoubleJumpImpulse() const { return x114_doubleJumpImpulse; }
float GetBackwardsForceMultiplier() const { return x118_backwardsForceMultiplier; }
float GetBombJumpRadius() const { return x11c_bombJumpRadius; }
float GetBombJumpHeight() const { return x120_bombJumpHeight; }
float GetEyeOffset() const { return x124_eyeOffset; }
float GetTurnSpeedMultiplier() const { return x128_turnSpeedMultiplier; }
float GetFreeLookTurnSpeedMultiplier() const { return x12c_freeLookTurnSpeedMultiplier; }
float GetFreeLookSpeed() const { return x138_freeLookSpeed; }
float GetFreeLookSnapSpeed() const { return x13c_freeLookSnapSpeed; }
float GetFreeLookCenteredThresholdAngle() const { return x144_freeLookCenteredThresholdAngle; }
float GetFreeLookCenteredTime() const { return x148_freeLookCenteredTime; }
float GetOrbitModeTimer() const { return x180_orbitModeTimer; }
float GetOrbitUpperAngle() const { return x188_orbitUpperAngle; }
float GetOrbitLowerAngle() const { return x18c_orbitLowerAngle; }
float GetOrbitHorizAngle() const { return x190_orbitHorizAngle; }
float GetOrbitMaxTargetDistance() const { return x19c_orbitMaxTargetDistance; }
float GetOrbitMaxLockDistance() const { return x1a0_orbitMaxLockDistance; }
float GetOrbitDistanceThreshold() const { return x1a4_orbitDistanceThreshold; }
uint GetOrbitScreenBoxHalfExtentX(int zone) const { return x1a8_orbitScreenBoxHalfExtentX[zone]; }
uint GetOrbitScreenBoxHalfExtentY(int zone) const { return x1b0_orbitScreenBoxHalfExtentY[zone]; }
uint GetOrbitScreenBoxCenterX(int zone) const { return x1b8_orbitScreenBoxCenterX[zone]; }
uint GetOrbitScreenBoxCenterY(int zone) const { return x1c0_orbitScreenBoxCenterY[zone]; }
uint GetOrbitZoneIdealX(int zone) const { return x1c8_orbitZoneIdealX[zone]; }
uint GetOrbitZoneIdealY(int zone) const { return x1d0_orbitZoneIdealY[zone]; }
float GetOrbitNearX() const { return x1d8_orbitNearX; }
float GetOrbitNearZ() const { return x1dc_orbitNearZ; }
float GetOrbitFixedOffsetZDiff() const { return x1e8_orbitFixedOffsetZDiff; }
float GetOrbitZRange() const { return x1ec_orbitZRange; }
bool GetDashEnabled() const { return x200_24_dashEnabled; }
bool GetDashOnButtonRelease() const { return x200_25_dashOnButtonRelease; }
float GetDashButtonHoldCancelTime() const { return x204_dashButtonHoldCancelTime; }
float GetDashStrafeInputThreshold() const { return x208_dashStrafeInputThreshold; }
float GetSidewaysDoubleJumpImpulse() const { return x20c_sidewaysDoubleJumpImpulse; }
float GetSidewaysVerticalDoubleJumpAccel() const { return x210_sidewaysVerticalDoubleJumpAccel; }
float GetSidewaysHorizontalDoubleJumpAccel() const {
return x214_sidewaysHorizontalDoubleJumpAccel;
} }
float GetScanningRange() const { return x218_scanningRange; } float GetMaxRotationalAcceleration(CPlayer::ESurfaceRestraints s) const {
bool GetScanRetention() const { return x21c_24_scanRetention; } return mMaxRotationalAcceleration[s];
bool GetScanFreezesGame() const { return x21c_25_scanFreezesGame; }
bool GetOrbitWhileScanning() const { return x21c_26_orbitWhileScanning; }
float GetScanMaxTargetDistance() const { return x220_scanMaxTargetDistance; }
float GetScanMaxLockDistance() const { return x224_scanMaxLockDistance; }
bool GetMoveDuringFreeLook() const { return x228_27_moveDuringFreeLook; }
bool GetHoldButtonsForFreeLook() const { return x228_28_holdButtonsForFreeLook; }
bool GetTwoButtonsForFreeLook() const { return x228_29_twoButtonsForFreeLook; }
bool GetAimWhenOrbitingPoint() const { return x229_25_aimWhenOrbitingPoint; }
bool GetStayInFreeLookWhileFiring() const { return x229_26_stayInFreeLookWhileFiring; }
bool GetOrbitFixedOffset() const { return x229_29_orbitFixedOffset; }
bool GetGunButtonTogglesHolster() const { return x229_30_gunButtonTogglesHolster; }
bool GetGunNotFiringHolstersGun() const { return x229_31_gunNotFiringHolstersGun; }
bool GetFallingDoubleJump() const { return x22a_24_fallingDoubleJump; }
bool GetImpulseDoubleJump() const { return x22a_25_impulseDoubleJump; }
bool GetFiringCancelsCameraPitch() const { return x22a_26_firingCancelsCameraPitch; }
bool GetAssistedAimingIgnoreHorizontal() const { return x22a_27_assistedAimingIgnoreHorizontal; }
bool GetAssistedAimingIgnoreVertical() const { return x22a_28_assistedAimingIgnoreVertical; }
float GetAimMaxDistance() const { return x234_aimMaxDistance; }
float GetAimThresholdDistance() const { return x24c_aimThresholdDistance; }
float GetAimBoxWidth() const { return x258_aimBoxWidth; }
float GetAimBoxHeight() const { return x25c_aimBoxHeight; }
float GetAimTargetTimer() const { return x260_aimTargetTimer; }
float GetAimAssistHorizontalAngle() const { return x264_aimAssistHorizontalAngle; }
float GetAimAssistVerticalAngle() const { return x268_aimAssistVerticalAngle; }
float GetPlayerHeight() const { return x26c_playerHeight; }
float GetPlayerXYHalfExtent() const { return x270_playerXYHalfExtent; }
float GetStepUpHeight() const { return x274_stepUpHeight; }
float GetStepDownHeight() const { return x278_stepDownHeight; }
float GetPlayerBallHalfExtent() const { return x27c_playerBallHalfExtent; }
float GetOrbitDistanceMax() const { return x2a0_orbitDistanceMax; }
float GetGrappleSwingLength() const { return x2a4_grappleSwingLength; }
float GetGrappleSwingPeriod() const { return x2a8_grappleSwingPeriod; }
float GetGrapplePullSpeedMin() const { return x2ac_grapplePullSpeedMin; }
float GetMaxGrappleLockedTurnAlignDistance() const {
return x2b4_maxGrappleLockedTurnAlignDistance;
} }
float GetGrapplePullSpeedProportion() const { return x2b8_grapplePullSpeedProportion; } float GetPlayerTranslationFriction(CPlayer::ESurfaceRestraints s) const {
float GetGrapplePullSpeedMax() const { return x2bc_grapplePullSpeedMax; } return mTranslationFriction[s];
float GetGrappleLookCenterSpeed() const { return x2c0_grappleLookCenterSpeed; } }
float GetMaxGrappleTurnSpeed() const { return x2c4_maxGrappleTurnSpeed; } float GetPlayerRotationFriction(CPlayer::ESurfaceRestraints s) const {
float GetGrappleJumpForce() const { return x2c8_grappleJumpForce; } return mRotationFriction[s];
float GetGrappleReleaseTime() const { return x2cc_grappleReleaseTime; } }
uint GetGrappleJumpMode() const { return x2d0_grappleJumpMode; } float GetPlayerRotationMaxSpeed(CPlayer::ESurfaceRestraints s) const {
bool GetOrbitReleaseBreaksGrapple() const { return x2d4_orbitReleaseBreaksGrapple; } return mRotationMaxSpeed[s];
bool GetInvertGrappleTurn() const { return x2d5_invertGrappleTurn; } }
float GetGrappleBeamSpeed() const { return x2d8_grappleBeamSpeed; } float GetPlayerTranslationMaxSpeed(CPlayer::ESurfaceRestraints s) const {
float GetGrappleBeamXWaveAmplitude() const { return x2dc_grappleBeamXWaveAmplitude; } return mTranslationMaxSpeed[s];
float GetGrappleBeamZWaveAmplitude() const { return x2e0_grappleBeamZWaveAmplitude; } }
float GetGrappleBeamAnglePhaseDelta() const { return x2e4_grappleBeamAnglePhaseDelta; } float GetNormalGravAccel() const { return mNormalGravAccel; }
float GetHorizontalFreeLookAngleVel() const { return x130_horizontalFreeLookAngleVel; } float GetFluidGravAccel() const { return mFluidGravAccel; }
float GetVerticalFreeLookAngleVel() const { return x134_verticalFreeLookAngleVel; } float GetVerticalJumpAccel() const { return mVerticalJumpAccel; }
float GetOrbitCameraSpeed() const { return x184_orbitCameraSpeed; } float GetHorizontalJumpAccel() const { return mHorizontalJumpAccel; }
float GetOrbitPreventionTime() const { return x1fc_orbitPreventionTime; } float GetVerticalDoubleJumpAccel() const { return mVerticalDoubleJumpAccel; }
bool GetFreeLookTurnsPlayer() const { return x228_24_freelookTurnsPlayer; } float GetHorizontalDoubleJumpAccel() const { return mHorizontalDoubleJumpAccel; }
float GetJumpCameraPitchDownStart() const { return x288_jumpCameraPitchDownStart; } float GetWaterJumpFactor() const { return mWaterJumpFactor; }
float GetJumpCameraPitchDownFull() const { return x28c_jumpCameraPitchDownFull; } float GetWaterBallJumpFactor() const { return mWaterBallJumpFactor; }
float GetJumpCameraPitchDownAngle() const { return x290_jumpCameraPitchDownAngle; } float GetLavaJumpFactor() const { return mLavaJumpFactor; }
float GetFallCameraPitchDownStart() const { return x294_fallCameraPitchDownStart; } float GetLavaBallJumpFactor() const { return mLavaBallJumpFactor; }
float GetFallCameraPitchDownFull() const { return x298_fallCameraPitchDownFull; } float GetPhazonJumpFactor() const { return mPhazonJumpFactor; }
float GetFallCameraPitchDownAngle() const { return x29c_fallCameraPitchDownAngle; } float GetPhazonBallJumpFactor() const { return mPhazonBallJumpFactor; }
float GetFirstPersonCameraSpeed() const { return x280_firstPersonCameraSpeed; } float GetAllowedJumpTime() const { return mAllowedJumpTime; }
float GetGrappleCameraSpeed() const { return x2b0_grappleCameraSpeed; } float GetAllowedDoubleJumpTime() const { return mAllowedDoubleJumpTime; }
float GetFreeLookDampenFactor() const { return x14c_freeLookDampenFactor; } float GetMinDoubleJumpWindow() const { return mMinDoubleJumpWindow; }
float GetLeftAnalogMax() const { return x150_leftDiv; } float GetMaxDoubleJumpWindow() const { return mMaxDoubleJumpWindow; }
float GetRightAnalogMax() const { return x154_rightDiv; } float GetMinJumpTime() const { return mMinJumpTime; }
float GetOrbitMinDistance(int type) const { return x158_orbitMinDistance[type]; } float GetMinDoubleJumpTime() const { return mMinDoubleJumpTime; }
float GetOrbitNormalDistance(int type) const { return x164_orbitNormalDistance[type]; } float GetAllowedLedgeTime() const { return mAllowedLedgeTime; }
float GetOrbitMaxDistance(int type) const { return x170_orbitMaxDistance[type]; } float GetDoubleJumpImpulse() const { return mDoubleJumpImpulse; }
float GetFrozenTimeout() const { return x2f8_frozenTimeout; } float GetBackwardsForceMultiplier() const { return mBackwardsForceMultiplier; }
uint GetIceBreakJumpCount() const { return x2fc_iceBreakJumpCount; } float GetBombJumpRadius() const { return mBombJumpRadius; }
float GetVariaDamageReduction() const { return x300_variaDamageReduction; } float GetBombJumpHeight() const { return mBombJumpHeight; }
float GetGravityDamageReduction() const { return x304_gravityDamageReduction; } float GetEyeOffset() const { return mEyeOffset; }
float GetPhazonDamageReduction() const { return x308_phazonDamageReduction; } float GetTurnSpeedMultiplier() const { return mTurnSpeedMultiplier; }
float GetFreeLookTurnSpeedMultiplier() const { return mFreeLookTurnSpeedMultiplier; }
float GetFreeLookSpeed() const { return mFreeLookSpeed; }
float GetFreeLookSnapSpeed() const { return mFreeLookSnapSpeed; }
float GetFreeLookCenteredThresholdAngle() const { return mFreeLookCenteredThresholdAngle; }
float GetFreeLookCenteredTime() const { return mFreeLookCenteredTime; }
float GetOrbitModeTimer() const { return mOrbitModeTimer; }
float GetOrbitUpperAngle() const { return mOrbitUpperAngle; }
float GetOrbitLowerAngle() const { return mOrbitLowerAngle; }
float GetOrbitHorizAngle() const { return mOrbitHorizAngle; }
float GetOrbitMaxTargetDistance() const { return mOrbitMaxTargetDistance; }
float GetOrbitMaxLockDistance() const { return mOrbitMaxLockDistance; }
float GetOrbitDistanceThreshold() const { return mOrbitDistanceThreshold; }
uint GetOrbitScreenBoxHalfExtentX(int zone) const { return mOrbitScreenBoxHalfExtentX[zone]; }
uint GetOrbitScreenBoxHalfExtentY(int zone) const { return mOrbitScreenBoxHalfExtentY[zone]; }
uint GetOrbitScreenBoxCenterX(int zone) const { return mOrbitScreenBoxCenterX[zone]; }
uint GetOrbitScreenBoxCenterY(int zone) const { return mOrbitScreenBoxCenterY[zone]; }
uint GetOrbitZoneIdealX(int zone) const { return mOrbitZoneIdealX[zone]; }
uint GetOrbitZoneIdealY(int zone) const { return mOrbitZoneIdealY[zone]; }
float GetOrbitNearX() const { return mOrbitNearX; }
float GetOrbitNearZ() const { return mOrbitNearZ; }
float GetOrbitFixedOffsetZDiff() const { return mOrbitFixedOffsetZDiff; }
float GetOrbitZRange() const { return mOrbitZRange; }
bool GetDashEnabled() const { return mDashEnabled; }
bool GetDashOnButtonRelease() const { return mDashOnButtonRelease; }
float GetDashButtonHoldCancelTime() const { return mDashButtonHoldCancelTime; }
float GetDashStrafeInputThreshold() const { return mDashStrafeInputThreshold; }
float GetSidewaysDoubleJumpImpulse() const { return mSidewaysDoubleJumpImpulse; }
float GetSidewaysVerticalDoubleJumpAccel() const { return mSidewaysVerticalDoubleJumpAccel; }
float GetSidewaysHorizontalDoubleJumpAccel() const { return mSidewaysHorizontalDoubleJumpAccel; }
float GetScanningRange() const { return mScanningRange; }
bool GetScanRetention() const { return mScanRetention; }
bool GetScanFreezesGame() const { return mScanFreezesGame; }
bool GetOrbitWhileScanning() const { return mOrbitWhileScanning; }
float GetScanMaxTargetDistance() const { return mScanMaxTargetDistance; }
float GetScanMaxLockDistance() const { return mScanMaxLockDistance; }
bool GetMoveDuringFreeLook() const { return mMoveDuringFreeLook; }
bool GetHoldButtonsForFreeLook() const { return mHoldButtonsForFreeLook; }
bool GetTwoButtonsForFreeLook() const { return mTwoButtonsForFreeLook; }
bool GetAimWhenOrbitingPoint() const { return mAimWhenOrbitingPoint; }
bool GetStayInFreeLookWhileFiring() const { return mStayInFreeLookWhileFiring; }
bool GetOrbitFixedOffset() const { return mOrbitFixedOffset; }
bool GetGunButtonTogglesHolster() const { return mGunButtonTogglesHolster; }
bool GetGunNotFiringHolstersGun() const { return mGunNotFiringHolstersGun; }
bool GetFallingDoubleJump() const { return mFallingDoubleJump; }
bool GetImpulseDoubleJump() const { return mImpulseDoubleJump; }
bool GetFiringCancelsCameraPitch() const { return mFiringCancelsCameraPitch; }
bool GetAssistedAimingIgnoreHorizontal() const { return mAssistedAimingIgnoreHorizontal; }
bool GetAssistedAimingIgnoreVertical() const { return mAssistedAimingIgnoreVertical; }
float GetAimMaxDistance() const { return mAimMaxDistance; }
float GetAimThresholdDistance() const { return mAimThresholdDistance; }
float GetAimBoxWidth() const { return mAimBoxWidth; }
float GetAimBoxHeight() const { return mAimBoxHeight; }
float GetAimTargetTimer() const { return mAimTargetTimer; }
float GetAimAssistHorizontalAngle() const { return mAimAssistHorizontalAngle; }
float GetAimAssistVerticalAngle() const { return mAimAssistVerticalAngle; }
float GetPlayerHeight() const { return mPlayerHeight; }
float GetPlayerXYHalfExtent() const { return mPlayerXYHalfExtent; }
float GetStepUpHeight() const { return mStepUpHeight; }
float GetStepDownHeight() const { return mStepDownHeight; }
float GetPlayerBallHalfExtent() const { return mPlayerBallHalfExtent; }
float GetOrbitDistanceMax() const { return mOrbitDistanceMax; }
float GetGrappleSwingLength() const { return mGrappleSwingLength; }
float GetGrappleSwingPeriod() const { return mGrappleSwingPeriod; }
float GetGrapplePullSpeedMin() const { return mGrapplePullSpeedMin; }
float GetMaxGrappleLockedTurnAlignDistance() const { return mMaxGrappleLockedTurnAlignDistance; }
float GetGrapplePullSpeedProportion() const { return mGrapplePullSpeedProportion; }
float GetGrapplePullSpeedMax() const { return mGrapplePullSpeedMax; }
float GetGrappleLookCenterSpeed() const { return mGrappleLookCenterSpeed; }
float GetMaxGrappleTurnSpeed() const { return mMaxGrappleTurnSpeed; }
float GetGrappleJumpForce() const { return mGrappleJumpForce; }
float GetGrappleReleaseTime() const { return mGrappleReleaseTime; }
uint GetGrappleJumpMode() const { return mGrappleJumpMode; }
bool GetOrbitReleaseBreaksGrapple() const { return mOrbitReleaseBreaksGrapple; }
bool GetInvertGrappleTurn() const { return mInvertGrappleTurn; }
float GetGrappleBeamSpeed() const { return mGrappleBeamSpeed; }
float GetGrappleBeamXWaveAmplitude() const { return mGrappleBeamXWaveAmplitude; }
float GetGrappleBeamZWaveAmplitude() const { return mGrappleBeamZWaveAmplitude; }
float GetGrappleBeamAnglePhaseDelta() const { return mGrappleBeamAnglePhaseDelta; }
float GetHorizontalFreeLookAngleVel() const { return mHorizontalFreeLookAngleVel; }
float GetVerticalFreeLookAngleVel() const { return mVerticalFreeLookAngleVel; }
float GetOrbitCameraSpeed() const { return mOrbitCameraSpeed; }
float GetOrbitPreventionTime() const { return mOrbitPreventionTime; }
bool GetFreeLookTurnsPlayer() const { return mFreelookTurnsPlayer; }
float GetJumpCameraPitchDownStart() const { return mJumpCameraPitchDownStart; }
float GetJumpCameraPitchDownFull() const { return mJumpCameraPitchDownFull; }
float GetJumpCameraPitchDownAngle() const { return mJumpCameraPitchDownAngle; }
float GetFallCameraPitchDownStart() const { return mFallCameraPitchDownStart; }
float GetFallCameraPitchDownFull() const { return mFallCameraPitchDownFull; }
float GetFallCameraPitchDownAngle() const { return mFallCameraPitchDownAngle; }
float GetFirstPersonCameraSpeed() const { return mFirstPersonCameraSpeed; }
float GetGrappleCameraSpeed() const { return mGrappleCameraSpeed; }
float GetFreeLookDampenFactor() const { return mFreeLookDampenFactor; }
float GetLeftAnalogMax() const { return mLeftDiv; }
float GetRightAnalogMax() const { return mRightDiv; }
float GetOrbitMinDistance(int type) const { return mOrbitMinDistance[type]; }
float GetOrbitNormalDistance(int type) const { return mOrbitNormalDistance[type]; }
float GetOrbitMaxDistance(int type) const { return mOrbitMaxDistance[type]; }
float GetFrozenTimeout() const { return mFrozenTimeout; }
uint GetIceBreakJumpCount() const { return mIceBreakJumpCount; }
float GetVariaDamageReduction() const { return mVariaDamageReduction; }
float GetGravityDamageReduction() const { return mGravityDamageReduction; }
float GetPhazonDamageReduction() const { return mPhazonDamageReduction; }
// private: float mMaxTranslationalAcceleration[8];
float x4_maxTranslationalAcceleration[8]; float mMaxRotationalAcceleration[8];
float x24_maxRotationalAcceleration[8]; float mTranslationFriction[8];
float x44_translationFriction[8]; float mRotationFriction[8];
float x64_rotationFriction[8]; float mRotationMaxSpeed[8];
float x84_rotationMaxSpeed[8]; float mTranslationMaxSpeed[8];
float xa4_translationMaxSpeed[8]; float mNormalGravAccel;
float xc4_normalGravAccel; float mFluidGravAccel;
float xc8_fluidGravAccel; float mVerticalJumpAccel;
float xcc_verticalJumpAccel; float mHorizontalJumpAccel;
float xd0_horizontalJumpAccel; float mVerticalDoubleJumpAccel;
float xd4_verticalDoubleJumpAccel; float mHorizontalDoubleJumpAccel;
float xd8_horizontalDoubleJumpAccel; float mWaterJumpFactor;
float xdc_waterJumpFactor; float mWaterBallJumpFactor;
float xe0_waterBallJumpFactor; float mLavaJumpFactor;
float xe4_lavaJumpFactor; float mLavaBallJumpFactor;
float xe8_lavaBallJumpFactor; float mPhazonJumpFactor;
float xec_phazonJumpFactor; float mPhazonBallJumpFactor;
float xf0_phazonBallJumpFactor; float mAllowedJumpTime;
float xf4_allowedJumpTime; float mAllowedDoubleJumpTime;
float xf8_allowedDoubleJumpTime; float mMinDoubleJumpWindow;
float xfc_minDoubleJumpWindow; float mMaxDoubleJumpWindow;
float x100_maxDoubleJumpWindow;
float x104_; float x104_;
float x108_minJumpTime; float mMinJumpTime;
float x10c_minDoubleJumpTime; float mMinDoubleJumpTime;
float x110_allowedLedgeTime; float mAllowedLedgeTime;
float x114_doubleJumpImpulse; float mDoubleJumpImpulse;
float x118_backwardsForceMultiplier; float mBackwardsForceMultiplier;
float x11c_bombJumpRadius; float mBombJumpRadius;
float x120_bombJumpHeight; float mBombJumpHeight;
float x124_eyeOffset; float mEyeOffset;
float x128_turnSpeedMultiplier; float mTurnSpeedMultiplier;
float x12c_freeLookTurnSpeedMultiplier; float mFreeLookTurnSpeedMultiplier;
float x130_horizontalFreeLookAngleVel; float mHorizontalFreeLookAngleVel;
float x134_verticalFreeLookAngleVel; float mVerticalFreeLookAngleVel;
float x138_freeLookSpeed; float mFreeLookSpeed;
float x13c_freeLookSnapSpeed; float mFreeLookSnapSpeed;
float x140_; float x140_;
float x144_freeLookCenteredThresholdAngle; float mFreeLookCenteredThresholdAngle;
float x148_freeLookCenteredTime; float mFreeLookCenteredTime;
float x14c_freeLookDampenFactor; float mFreeLookDampenFactor;
float x150_leftDiv; float mLeftDiv;
float x154_rightDiv; float mRightDiv;
float x158_orbitMinDistance[3]; float mOrbitMinDistance[3];
float x164_orbitNormalDistance[3]; float mOrbitNormalDistance[3];
float x170_orbitMaxDistance[3]; float mOrbitMaxDistance[3];
float x17c_; float x17c_;
float x180_orbitModeTimer; float mOrbitModeTimer;
float x184_orbitCameraSpeed; float mOrbitCameraSpeed;
float x188_orbitUpperAngle; float mOrbitUpperAngle;
float x18c_orbitLowerAngle; float mOrbitLowerAngle;
float x190_orbitHorizAngle; float mOrbitHorizAngle;
float x194_; float x194_;
float x198_; float x198_;
float x19c_orbitMaxTargetDistance; float mOrbitMaxTargetDistance;
float x1a0_orbitMaxLockDistance; float mOrbitMaxLockDistance;
float x1a4_orbitDistanceThreshold; float mOrbitDistanceThreshold;
uint x1a8_orbitScreenBoxHalfExtentX[2]; uint mOrbitScreenBoxHalfExtentX[2];
uint x1b0_orbitScreenBoxHalfExtentY[2]; uint mOrbitScreenBoxHalfExtentY[2];
uint x1b8_orbitScreenBoxCenterX[2]; uint mOrbitScreenBoxCenterX[2];
uint x1c0_orbitScreenBoxCenterY[2]; uint mOrbitScreenBoxCenterY[2];
uint x1c8_orbitZoneIdealX[2]; uint mOrbitZoneIdealX[2];
uint x1d0_orbitZoneIdealY[2]; uint mOrbitZoneIdealY[2];
float x1d8_orbitNearX; float mOrbitNearX;
float x1dc_orbitNearZ; float mOrbitNearZ;
float x1e0_; float x1e0_;
float x1e4_; float x1e4_;
float x1e8_orbitFixedOffsetZDiff; float mOrbitFixedOffsetZDiff;
float x1ec_orbitZRange; float mOrbitZRange;
float x1f0_; float x1f0_;
float x1f4_; float x1f4_;
float x1f8_; float x1f8_;
float x1fc_orbitPreventionTime; float mOrbitPreventionTime;
bool x200_24_dashEnabled : 1; bool mDashEnabled : 1;
bool x200_25_dashOnButtonRelease : 1; bool mDashOnButtonRelease : 1;
float x204_dashButtonHoldCancelTime; float mDashButtonHoldCancelTime;
float x208_dashStrafeInputThreshold; float mDashStrafeInputThreshold;
float x20c_sidewaysDoubleJumpImpulse; float mSidewaysDoubleJumpImpulse;
float x210_sidewaysVerticalDoubleJumpAccel; float mSidewaysVerticalDoubleJumpAccel;
float x214_sidewaysHorizontalDoubleJumpAccel; float mSidewaysHorizontalDoubleJumpAccel;
float x218_scanningRange; float mScanningRange;
bool x21c_24_scanRetention : 1; bool mScanRetention : 1;
bool x21c_25_scanFreezesGame : 1; bool mScanFreezesGame : 1;
bool x21c_26_orbitWhileScanning : 1; bool mOrbitWhileScanning : 1;
float x220_scanMaxTargetDistance; float mScanMaxTargetDistance;
float x224_scanMaxLockDistance; float mScanMaxLockDistance;
bool x228_24_freelookTurnsPlayer : 1; bool mFreelookTurnsPlayer : 1;
bool x228_25_ : 1; bool x228_25_ : 1;
bool x228_26_ : 1; bool x228_26_ : 1;
bool x228_27_moveDuringFreeLook : 1; bool mMoveDuringFreeLook : 1;
bool x228_28_holdButtonsForFreeLook : 1; bool mHoldButtonsForFreeLook : 1;
bool x228_29_twoButtonsForFreeLook : 1; bool mTwoButtonsForFreeLook : 1;
bool x228_30_ : 1; bool x228_30_ : 1;
bool x228_31_ : 1; bool x228_31_ : 1;
bool x229_24_ : 1; bool x229_24_ : 1;
bool x229_25_aimWhenOrbitingPoint : 1; bool mAimWhenOrbitingPoint : 1;
bool x229_26_stayInFreeLookWhileFiring : 1; bool mStayInFreeLookWhileFiring : 1;
bool x229_27_ : 1; bool x229_27_ : 1;
bool x229_28_ : 1; bool x229_28_ : 1;
bool x229_29_orbitFixedOffset : 1; bool mOrbitFixedOffset : 1;
bool x229_30_gunButtonTogglesHolster : 1; bool mGunButtonTogglesHolster : 1;
bool x229_31_gunNotFiringHolstersGun : 1; bool mGunNotFiringHolstersGun : 1;
bool x22a_24_fallingDoubleJump : 1; bool mFallingDoubleJump : 1;
bool x22a_25_impulseDoubleJump : 1; bool mImpulseDoubleJump : 1;
bool x22a_26_firingCancelsCameraPitch : 1; bool mFiringCancelsCameraPitch : 1;
bool x22a_27_assistedAimingIgnoreHorizontal : 1; bool mAssistedAimingIgnoreHorizontal : 1;
bool x22a_28_assistedAimingIgnoreVertical : 1; bool mAssistedAimingIgnoreVertical : 1;
float x22c_; float x22c_;
float x230_; float x230_;
float x234_aimMaxDistance; float mAimMaxDistance;
float x238_; float x238_;
float x23c_; float x23c_;
float x240_; float x240_;
float x244_; float x244_;
float x248_; float x248_;
float x24c_aimThresholdDistance; float mAimThresholdDistance;
float x250_; float x250_;
float x254_; float x254_;
float x258_aimBoxWidth; float mAimBoxWidth;
float x25c_aimBoxHeight; float mAimBoxHeight;
float x260_aimTargetTimer; float mAimTargetTimer;
float x264_aimAssistHorizontalAngle; float mAimAssistHorizontalAngle;
float x268_aimAssistVerticalAngle; float mAimAssistVerticalAngle;
float x26c_playerHeight; float mPlayerHeight;
float x270_playerXYHalfExtent; float mPlayerXYHalfExtent;
float x274_stepUpHeight; float mStepUpHeight;
float x278_stepDownHeight; float mStepDownHeight;
float x27c_playerBallHalfExtent; float mPlayerBallHalfExtent;
float x280_firstPersonCameraSpeed; float mFirstPersonCameraSpeed;
float x284_; float x284_;
float x288_jumpCameraPitchDownStart; float mJumpCameraPitchDownStart;
float x28c_jumpCameraPitchDownFull; float mJumpCameraPitchDownFull;
float x290_jumpCameraPitchDownAngle; float mJumpCameraPitchDownAngle;
float x294_fallCameraPitchDownStart; float mFallCameraPitchDownStart;
float x298_fallCameraPitchDownFull; float mFallCameraPitchDownFull;
float x29c_fallCameraPitchDownAngle; float mFallCameraPitchDownAngle;
float x2a0_orbitDistanceMax; float mOrbitDistanceMax;
float x2a4_grappleSwingLength; float mGrappleSwingLength;
float x2a8_grappleSwingPeriod; float mGrappleSwingPeriod;
float x2ac_grapplePullSpeedMin; float mGrapplePullSpeedMin;
float x2b0_grappleCameraSpeed; float mGrappleCameraSpeed;
float x2b4_maxGrappleLockedTurnAlignDistance; float mMaxGrappleLockedTurnAlignDistance;
float x2b8_grapplePullSpeedProportion; float mGrapplePullSpeedProportion;
float x2bc_grapplePullSpeedMax; float mGrapplePullSpeedMax;
float x2c0_grappleLookCenterSpeed; float mGrappleLookCenterSpeed;
float x2c4_maxGrappleTurnSpeed; float mMaxGrappleTurnSpeed;
float x2c8_grappleJumpForce; float mGrappleJumpForce;
float x2cc_grappleReleaseTime; float mGrappleReleaseTime;
uint x2d0_grappleJumpMode; uint mGrappleJumpMode;
bool x2d4_orbitReleaseBreaksGrapple; bool mOrbitReleaseBreaksGrapple;
bool x2d5_invertGrappleTurn; bool mInvertGrappleTurn;
float x2d8_grappleBeamSpeed; float mGrappleBeamSpeed;
float x2dc_grappleBeamXWaveAmplitude; float mGrappleBeamXWaveAmplitude;
float x2e0_grappleBeamZWaveAmplitude; float mGrappleBeamZWaveAmplitude;
float x2e4_grappleBeamAnglePhaseDelta; float mGrappleBeamAnglePhaseDelta;
float x2e8_; float x2e8_;
float x2ec_; float x2ec_;
float x2f0_; float x2f0_;
bool x2f4_; bool x2f4_;
float x2f8_frozenTimeout; float mFrozenTimeout;
uint x2fc_iceBreakJumpCount; int mIceBreakJumpCount;
float x300_variaDamageReduction; float mVariaDamageReduction;
float x304_gravityDamageReduction; float mGravityDamageReduction;
float x308_phazonDamageReduction; float mPhazonDamageReduction;
}; };
extern CTweakPlayer* gpTweakPlayer; extern CTweakPlayer* gpTweakPlayer;

View File

@ -14,7 +14,7 @@ public:
kDT_Actor, kDT_Actor,
kDT_World, kDT_World,
}; };
CBeamProjectile(const TToken<CWeaponDescription>& wDesc, const rstl::string& name, EWeaponType wType, CBeamProjectile(const TToken<CWeaponDescription>& wDesc, const rstl::string& name, EWeaponType wType,
const CTransform4f& xf, int maxLength, float beamRadius, float travelSpeed, const CTransform4f& xf, int maxLength, float beamRadius, float travelSpeed,
EMaterialTypes matType, const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner, EMaterialTypes matType, const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner,

View File

@ -96,7 +96,7 @@ public:
rstl::optional_object< CModelData >& SolidModelData() { return x10_solidModelData; } rstl::optional_object< CModelData >& SolidModelData() { return x10_solidModelData; }
const CModelData& GetSolidModelData() const { return x10_solidModelData.data(); } const CModelData& GetSolidModelData() const { return x10_solidModelData.data(); }
EWeaponType GetWeaponType() const { return x1c0_weaponType; } EWeaponType GetType() const { return x1c0_weaponType; }
TUniqueId GetPlayerId() const { return x1c4_playerId; } TUniqueId GetPlayerId() const { return x1c4_playerId; }
EMaterialTypes GetPlayerMaterial() const { return x1c8_playerMaterial; } EMaterialTypes GetPlayerMaterial() const { return x1c8_playerMaterial; }

View File

@ -9,9 +9,31 @@
class CWeapon : public CActor { class CWeapon : public CActor {
public: public:
enum EProjectileAttrib {
kPA_None = 0,
kPA_PartialCharge = (1 << 0),
kPA_PlasmaProjectile = (1 << 1),
kPA_Charged = (1 << 2),
kPA_Ice = (1 << 3),
kPA_Wave = (1 << 4),
kPA_Plasma = (1 << 5),
kPA_Phazon = (1 << 6),
kPA_ComboShot = (1 << 7),
kPA_Bombs = (1 << 8),
kPA_PowerBombs = (1 << 9),
kPA_BigProjectile = (1 << 10),
kPA_ArmCannon = (1 << 11),
kPA_BigStrike = (1 << 12),
kPA_DamageFalloff = (1 << 13),
kPA_StaticInterference = (1 << 14),
kPA_PlayerUnFreeze = (1 << 15),
kPA_ParticleOPTS = (1 << 16),
kPA_KeepInCinematic = (1 << 17),
};
CWeapon(TUniqueId uid, TAreaId areaId, bool active, TUniqueId owner, EWeaponType type, CWeapon(TUniqueId uid, TAreaId areaId, bool active, TUniqueId owner, EWeaponType type,
const rstl::string& name, const CTransform4f& xf, const CMaterialFilter& filter, const rstl::string& name, const CTransform4f& xf, const CMaterialFilter& filter,
const CMaterialList& mList, const CDamageInfo& dInfo, EProjectileAttrib attribs, const CMaterialList& mList, const CDamageInfo& dInfo, int attribs,
const CModelData& mData); const CModelData& mData);
// CEntity // CEntity
@ -21,20 +43,27 @@ public:
// CActor // CActor
void Render(const CStateManager&) const override; void Render(const CStateManager&) const override;
EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&, EWeaponCollisionResponseTypes GetCollisionResponseType(const CVector3f&, const CVector3f&,
const CWeaponMode&, const CWeaponMode&, int) const override;
int /*EProjectileAttrib?*/) const override;
void FluidFXThink(EFluidState, CScriptWater&, CStateManager&) override; void FluidFXThink(EFluidState, CScriptWater&, CStateManager&) override;
void SetDamageFalloffSpeed(float d); void SetDamageFalloffSpeed(float d);
EProjectileAttrib GetAttribField() const { return xe8_projectileAttribs; } int GetAttribField() const { return xe8_projectileAttribs; }
bool HasAttrib(EProjectileAttrib attrib) const {
return (xe8_projectileAttribs & attrib) == attrib; // maybe wrong
}
TUniqueId GetOwnerId() const { return xec_ownerId; } TUniqueId GetOwnerId() const { return xec_ownerId; }
EWeaponType GetWeaponType() const { return xf0_weaponType; } EWeaponType GetType() const { return xf0_weaponType; }
CMaterialFilter GetFilter() const { return xf8_filter; } CMaterialFilter GetFilter() const { return xf8_filter; }
CDamageInfo& OrigDamageInfo() { return x110_origDamageInfo; } CDamageInfo& OrigDamageInfo() { return x110_origDamageInfo; }
float GetInterferenceDuration() const { return x154_interferenceDuration; }
void SetOwnerId(TUniqueId id) { xec_ownerId = id; }
void SetDamageInfo(const CDamageInfo& dInfo) { x12c_curDamageInfo = dInfo; }
void SetFilter(const CMaterialFilter& filter) { xf8_filter = filter; }
protected: protected:
EProjectileAttrib xe8_projectileAttribs; int xe8_projectileAttribs;
TUniqueId xec_ownerId; TUniqueId xec_ownerId;
EWeaponType xf0_weaponType; EWeaponType xf0_weaponType;
CMaterialFilter xf8_filter; CMaterialFilter xf8_filter;

View File

@ -47,17 +47,16 @@ public:
basic_string() : x0_ptr(&mNull), x4_cow(nullptr), x8_size(0) {} basic_string() : x0_ptr(&mNull), x4_cow(nullptr), x8_size(0) {}
basic_string(literal_t, const _CharTp* data); basic_string(literal_t, const _CharTp* data) {
// { x0_ptr = data;
// x0_ptr = data; x4_cow = nullptr;
// x4_cow = nullptr;
// const _CharTp* it = data; const _CharTp* it = data;
// while (*it) while (*it)
// ++it; ++it;
// x8_size = uint((it - data) / sizeof(_CharTp)); x8_size = static_cast< uint >(it - data);
// } }
basic_string(const basic_string& str); basic_string(const basic_string& str);
// { // {
@ -139,10 +138,7 @@ bool basic_string< _CharTp, Traits, Alloc >::operator<(const basic_string& other
typedef basic_string< wchar_t > wstring; typedef basic_string< wchar_t > wstring;
typedef basic_string< char > string; typedef basic_string< char > string;
wstring wstring_l(const wchar_t* data); wstring wstring_l(const wchar_t* data) { return wstring(wstring::literal_t(), data); }
// {
// return wstring(wstring::literal_t(), data);
// }
string string_l(const char* data); string string_l(const char* data);
// { // {

View File

@ -0,0 +1,8 @@
#include "Kyoto/Math/CQuaternion.hpp"
CQuaternion CQuaternion::operator*(const CQuaternion& rhs) const {
float w = this->w * rhs.w - CVector3f::Dot(imaginary, rhs.imaginary);
CVector3f imag =
rhs.w * imaginary + this->w * rhs.imaginary + CVector3f::Cross(imaginary, rhs.imaginary);
return CQuaternion(w, imag);
}

View File

@ -0,0 +1,11 @@
#include "MetroidPrime/CFluidPlane.hpp"
#include "Kyoto/Math/CMath.hpp"
float CFluidPlane::GetRippleScaleFromKineticEnergy(float baseI, float velDot) {
float tmp = CMath::FastSqrtF(0.5f * baseI * velDot * velDot);
if (tmp >= 160.f) {
return 1.f;
}
return tmp * (1.f / 160.f);
}

View File

@ -582,8 +582,8 @@ void CMemoryCardDriver::StartFileCreate() {
} }
x194_fileIdx = 0; x194_fileIdx = 0;
x198_fileInfo = x198_fileInfo = rs_new CMemoryCardSys::CCardFileInfo(
rs_new CMemoryCardSys::CCardFileInfo(x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx])); x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx]));
InitializeFileInfo(); InitializeFileInfo();
ECardResult result = x198_fileInfo->CreateFile(); ECardResult result = x198_fileInfo->CreateFile();
if (result != kCR_READY) if (result != kCR_READY)
@ -616,8 +616,8 @@ void CMemoryCardDriver::StartFileCreateTransactional() {
} }
x194_fileIdx = altFileIdx; x194_fileIdx = altFileIdx;
x198_fileInfo = x198_fileInfo = rs_new CMemoryCardSys::CCardFileInfo(
rs_new CMemoryCardSys::CCardFileInfo(x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx])); x0_cardPort, rstl::string_l(skSaveFileNames[x194_fileIdx]));
InitializeFileInfo(); InitializeFileInfo();
ECardResult result = x198_fileInfo->CreateFile(); ECardResult result = x198_fileInfo->CreateFile();
if (result != kCR_READY) if (result != kCR_READY)
@ -661,8 +661,8 @@ void CMemoryCardDriver::InitializeFileInfo() {
char nameBuffer[36]; char nameBuffer[36];
sprintf(nameBuffer, "%02d.%02d.%02d %02d:%02d", time.mon + 1, time.mday, sprintf(nameBuffer, "%02d.%02d.%02d %02d:%02d", time.mon + 1, time.mday, time.year % 100,
time.year % 100, time.hour, time.min); time.hour, time.min);
fileInfo.SetComment(rstl::string_l(nameConstant) + nameBuffer); fileInfo.SetComment(rstl::string_l(nameConstant) + nameBuffer);
fileInfo.LockBannerToken(x4_saveBanner, *gpSimplePool); fileInfo.LockBannerToken(x4_saveBanner, *gpSimplePool);
@ -722,7 +722,7 @@ void CMemoryCardDriver::ReadFinished() {
void CMemoryCardDriver::EraseFileSlot(int saveIdx) { xe4_fileSlots[saveIdx] = nullptr; } void CMemoryCardDriver::EraseFileSlot(int saveIdx) { xe4_fileSlots[saveIdx] = nullptr; }
void CMemoryCardDriver::BuildNewFileSlot(int saveIdx) { void CMemoryCardDriver::BuildNewFileSlot(int saveIdx) {
bool fusionBackup = gpGameState->SystemOptions().GetHasFusion(); bool fusionBackup = gpGameState->SystemState().GetHasFusion();
gpGameState->SetFileIdx(saveIdx); gpGameState->SetFileIdx(saveIdx);
rstl::auto_ptr< SGameFileSlot >& slot = xe4_fileSlots[saveIdx]; rstl::auto_ptr< SGameFileSlot >& slot = xe4_fileSlots[saveIdx];
@ -738,7 +738,7 @@ void CMemoryCardDriver::BuildNewFileSlot(int saveIdx) {
ImportPersistentOptions(); ImportPersistentOptions();
gpGameState->SetCardSerial(x28_cardSerial); gpGameState->SetCardSerial(x28_cardSerial);
gpGameState->SystemOptions().SetHasFusion(fusionBackup); gpGameState->SystemState().SetHasFusion(fusionBackup);
} }
void CMemoryCardDriver::BuildExistingFileSlot(int saveIdx) { void CMemoryCardDriver::BuildExistingFileSlot(int saveIdx) {
@ -756,18 +756,18 @@ void CMemoryCardDriver::BuildExistingFileSlot(int saveIdx) {
void CMemoryCardDriver::ImportPersistentOptions() { void CMemoryCardDriver::ImportPersistentOptions() {
CMemoryInStream r(x30_systemData.data(), x30_systemData.capacity()); CMemoryInStream r(x30_systemData.data(), x30_systemData.capacity());
CSystemOptions opts(r); CSystemState state(r);
gpGameState->ImportPersistentOptions(opts); gpGameState->ImportPersistentOptions(state);
} }
void CMemoryCardDriver::ExportPersistentOptions() { void CMemoryCardDriver::ExportPersistentOptions() {
u8* data = x30_systemData.data(); u8* data = x30_systemData.data();
CMemoryInStream r(data, x30_systemData.capacity()); CMemoryInStream r(data, x30_systemData.capacity());
CSystemOptions opts(r); CSystemState state(r);
gpGameState->ExportPersistentOptions(opts); gpGameState->ExportPersistentOptions(state);
CMemoryStreamOut w(data, x30_systemData.capacity()); CMemoryStreamOut w(data, x30_systemData.capacity());
w.Put(opts); w.Put(state);
} }
SSaveHeader::SSaveHeader(int i) : x0_version(i) {} SSaveHeader::SSaveHeader(int i) : x0_version(i) {}

View File

@ -309,7 +309,7 @@ void CBallCamera::UpdateColliders(const CTransform4f& xf,
if (idx < colliderList.size()) { if (idx < colliderList.size()) {
const CPlayer& player = *mgr.GetPlayer(); const CPlayer& player = *mgr.GetPlayer();
x310_idealLookVec = CVector3f(0.f, gpTweakBall->GetBallCameraOffset().GetY(), x310_idealLookVec = CVector3f(0.f, gpTweakBall->GetBallCameraOffset().GetY(),
gpTweakPlayer->GetPlayerBallHalfExtent()); gpTweakPlayer->mPlayerBallHalfExtent);
x310_idealLookVec.SetY(x310_idealLookVec.GetY() * x308_speedFactor); x310_idealLookVec.SetY(x310_idealLookVec.GetY() * x308_speedFactor);
x31c_predictedLookPos = player.GetMovementDirection() * x310_idealLookVec.GetY(); x31c_predictedLookPos = player.GetMovementDirection() * x310_idealLookVec.GetY();
x31c_predictedLookPos.SetZ(x310_idealLookVec.GetZ()); x31c_predictedLookPos.SetZ(x310_idealLookVec.GetZ());

View File

@ -81,7 +81,7 @@ void CCameraManager::CreateCameras(CStateManager& mgr) {
TUniqueId fpId = mgr.AllocateUniqueId(); TUniqueId fpId = mgr.AllocateUniqueId();
x7c_fpCamera = rs_new CFirstPersonCamera( x7c_fpCamera = rs_new CFirstPersonCamera(
fpId, xf, plId, gpTweakPlayer->GetOrbitCameraSpeed(), GetDefaultFirstPersonVerticalFOV(), fpId, xf, plId, gpTweakPlayer->mOrbitCameraSpeed, GetDefaultFirstPersonVerticalFOV(),
GetDefaultFirstPersonNearClipDistance(), GetDefaultFirstPersonFarClipDistance(), GetDefaultFirstPersonNearClipDistance(), GetDefaultFirstPersonFarClipDistance(),
GetDefaultAspectRatio()); GetDefaultAspectRatio());
mgr.AddObject(x7c_fpCamera); mgr.AddObject(x7c_fpCamera);
@ -337,7 +337,7 @@ void CCameraManager::RemoveCinemaCamera(TUniqueId uid, CStateManager& mgr) {
// TODO nonmatching: regswap // TODO nonmatching: regswap
void CCameraManager::EnterCinematic(CStateManager& mgr) { void CCameraManager::EnterCinematic(CStateManager& mgr) {
mgr.Player()->PlayerGun()->CancelFiring(mgr); mgr.Player()->PlayerGun()->CancelFiring(mgr);
mgr.Player()->UnFreeze(mgr); mgr.Player()->BreakFrozenState(mgr);
CObjectList& objList = mgr.ObjectListById(kOL_All); CObjectList& objList = mgr.ObjectListById(kOL_All);
int idx = objList.GetFirstObjectIndex(); int idx = objList.GetFirstObjectIndex();
@ -345,8 +345,8 @@ void CCameraManager::EnterCinematic(CStateManager& mgr) {
if (CExplosion* explosion = TCastToPtr< CExplosion >(objList[idx])) { if (CExplosion* explosion = TCastToPtr< CExplosion >(objList[idx])) {
mgr.DeleteObjectRequest(explosion->GetUniqueId()); mgr.DeleteObjectRequest(explosion->GetUniqueId());
} else if (CWeapon* weapon = TCastToPtr< CWeapon >(objList[idx])) { } else if (CWeapon* weapon = TCastToPtr< CWeapon >(objList[idx])) {
if (weapon->GetActive() && if (weapon->GetActive() && (weapon->GetAttribField() & CWeapon::kPA_KeepInCinematic) !=
(weapon->GetAttribField() & kPA_KeepInCinematic) != kPA_KeepInCinematic) { CWeapon::kPA_KeepInCinematic) {
CPatterned* patterned = TCastToPtr< CPatterned >(mgr.ObjectById(weapon->GetOwnerId())); CPatterned* patterned = TCastToPtr< CPatterned >(mgr.ObjectById(weapon->GetOwnerId()));
CPlayer* player = TCastToPtr< CPlayer >(mgr.ObjectById(weapon->GetOwnerId())); CPlayer* player = TCastToPtr< CPlayer >(mgr.ObjectById(weapon->GetOwnerId()));
if (patterned || player) { if (patterned || player) {

View File

@ -70,7 +70,7 @@ CVector3f CBurstFire::GetError(float xMag, float zMag) const {
CVector3f result = CVector3f::Zero(); CVector3f result = CVector3f::Zero();
if (x14_24_shouldFire && x18_curBursts) { if (x14_24_shouldFire && x18_curBursts) {
int r0 = x18_curBursts->x4_shotAngles[x4_angleIdx]; int r0 = x18_curBursts->x4_shotAngles[x4_angleIdx];
if (x14_25_avoidAccuracy && (r0 == 4 || r0 == 12)) { if (x14_25_avoidAccuracy && (r0 == 4 || r0 == 12)) {
r0 = x18_curBursts->x4_shotAngles[x4_angleIdx > 0 ? x4_angleIdx - 1 : x4_angleIdx + 1]; r0 = x18_curBursts->x4_shotAngles[x4_angleIdx > 0 ? x4_angleIdx - 1 : x4_angleIdx + 1];
@ -96,7 +96,7 @@ CVector3f CBurstFire::GetDistanceCompensatedError(float dist, float maxErrDist)
} }
float CBurstFire::GetMaxXError() const { float CBurstFire::GetMaxXError() const {
return gpTweakPlayer->GetPlayerXYHalfExtent() * 3.625f + 0.2f; return gpTweakPlayer->mPlayerXYHalfExtent * 3.625f + 0.2f;
} }
float CBurstFire::GetMaxZError() const { return gpTweakPlayer->GetEyeOffset(); } float CBurstFire::GetMaxZError() const { return gpTweakPlayer->mEyeOffset; }

View File

@ -2,14 +2,21 @@
#include "MetroidPrime/CActorParameters.hpp" #include "MetroidPrime/CActorParameters.hpp"
#include "MetroidPrime/CControlMapper.hpp" #include "MetroidPrime/CControlMapper.hpp"
#include "MetroidPrime/CFluidPlaneCPU.hpp"
#include "MetroidPrime/CGameCollision.hpp"
#include "MetroidPrime/CRumbleManager.hpp"
#include "MetroidPrime/CWorld.hpp" #include "MetroidPrime/CWorld.hpp"
#include "MetroidPrime/Cameras/CBallCamera.hpp"
#include "MetroidPrime/Cameras/CCameraManager.hpp" #include "MetroidPrime/Cameras/CCameraManager.hpp"
#include "MetroidPrime/Cameras/CCinematicCamera.hpp" #include "MetroidPrime/Cameras/CCinematicCamera.hpp"
#include "MetroidPrime/Cameras/CFirstPersonCamera.hpp" #include "MetroidPrime/Cameras/CFirstPersonCamera.hpp"
#include "MetroidPrime/HUD/CSamusHud.hpp"
#include "MetroidPrime/Player/CGameState.hpp"
#include "MetroidPrime/Player/CGrappleArm.hpp" #include "MetroidPrime/Player/CGrappleArm.hpp"
#include "MetroidPrime/Player/CMorphBall.hpp" #include "MetroidPrime/Player/CMorphBall.hpp"
#include "MetroidPrime/Player/CPlayerCameraBob.hpp" #include "MetroidPrime/Player/CPlayerCameraBob.hpp"
#include "MetroidPrime/Player/CPlayerGun.hpp" #include "MetroidPrime/Player/CPlayerGun.hpp"
#include "MetroidPrime/SFX/IceCrack.h"
#include "MetroidPrime/SFX/LavaWorld.h" #include "MetroidPrime/SFX/LavaWorld.h"
#include "MetroidPrime/SFX/MiscSamus.h" #include "MetroidPrime/SFX/MiscSamus.h"
#include "MetroidPrime/ScriptObjects/CHUDBillboardEffect.hpp" #include "MetroidPrime/ScriptObjects/CHUDBillboardEffect.hpp"
@ -17,16 +24,21 @@
#include "MetroidPrime/Tweaks/CTweakPlayer.hpp" #include "MetroidPrime/Tweaks/CTweakPlayer.hpp"
#include "MetroidPrime/Tweaks/CTweakPlayerGun.hpp" #include "MetroidPrime/Tweaks/CTweakPlayerGun.hpp"
#include "MetroidPrime/Tweaks/CTweakPlayerRes.hpp" #include "MetroidPrime/Tweaks/CTweakPlayerRes.hpp"
#include "MetroidPrime/Weapons/CEnergyProjectile.hpp"
#include "Kyoto/Audio/CSfxManager.hpp" #include "Kyoto/Audio/CSfxManager.hpp"
#include "Kyoto/Audio/CStreamAudioManager.hpp" #include "Kyoto/Audio/CStreamAudioManager.hpp"
#include "Kyoto/CSimplePool.hpp" #include "Kyoto/CSimplePool.hpp"
#include "Kyoto/Input/CRumbleVoice.hpp"
#include "Kyoto/Math/CRelAngle.hpp" #include "Kyoto/Math/CRelAngle.hpp"
#include "Kyoto/Math/CloseEnough.hpp" #include "Kyoto/Math/CloseEnough.hpp"
#include "Kyoto/Text/CStringTable.hpp"
#include "Collision/CCollisionInfo.hpp" #include "Collision/CCollisionInfo.hpp"
#include "Collision/CRayCastResult.hpp" #include "Collision/CRayCastResult.hpp"
#include "WorldFormat/CMetroidAreaCollider.hpp"
#include "rstl/math.hpp" #include "rstl/math.hpp"
static CVector3f testRayStart(0.f, 0.f, 0.f); static CVector3f testRayStart(0.f, 0.f, 0.f);
@ -152,6 +164,9 @@ static const ushort skRightStepSounds[24] = {
static const char* const kGunLocator = "GUN_LCTR"; static const char* const kGunLocator = "GUN_LCTR";
static bool gUseSurfaceHack;
static CPlayer::ESurfaceRestraints gSR_Hack;
CAnimRes MakePlayerAnimres(CAssetId resId, const CVector3f& scale) { CAnimRes MakePlayerAnimres(CAssetId resId, const CVector3f& scale) {
return CAnimRes(resId, CAnimRes::kDefaultCharIdx, scale, 0, true); return CAnimRes(resId, CAnimRes::kDefaultCharIdx, scale, 0, true);
} }
@ -190,7 +205,7 @@ CPlayer::CPlayer(TUniqueId uid, const CTransform4f& xf, const CAABox& aabb, CAss
, x300_fallingTime(0.f) , x300_fallingTime(0.f)
, x304_orbitState(kOS_NoOrbit) , x304_orbitState(kOS_NoOrbit)
, x308_orbitType(kOT_Close) , x308_orbitType(kOT_Close)
, x30c_orbitRequest(kOR_Default) , x30c_orbitBrokenType(kOB_Default)
, x310_orbitTargetId(kInvalidUniqueId) , x310_orbitTargetId(kInvalidUniqueId)
, x314_orbitPoint(0.f, 0.f, 0.f) , x314_orbitPoint(0.f, 0.f, 0.f)
, x320_orbitVector(0.f, 0.f, 0.f) , x320_orbitVector(0.f, 0.f, 0.f)
@ -455,13 +470,13 @@ void CPlayer::UpdateGunState(const CFinalInput& input, CStateManager& mgr) {
switch (x498_gunHolsterState) { switch (x498_gunHolsterState) {
case kGH_Drawn: { case kGH_Drawn: {
bool needsHolster = false; bool needsHolster = false;
if (gpTweakPlayer->GetGunButtonTogglesHolster()) { if (gpTweakPlayer->mGunButtonTogglesHolster) {
if (ControlMapper::GetPressInput(ControlMapper::kC_ToggleHolster, input)) { if (ControlMapper::GetPressInput(ControlMapper::kC_ToggleHolster, input)) {
needsHolster = true; needsHolster = true;
} }
if (!ControlMapper::GetDigitalInput(ControlMapper::kC_FireOrBomb, input) && if (!ControlMapper::GetDigitalInput(ControlMapper::kC_FireOrBomb, input) &&
!ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input) && !ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input) &&
gpTweakPlayer->x229_31_gunNotFiringHolstersGun) { gpTweakPlayer->mGunNotFiringHolstersGun) {
x49c_gunHolsterRemTime -= dt; x49c_gunHolsterRemTime -= dt;
if (x49c_gunHolsterRemTime <= 0.f) { if (x49c_gunHolsterRemTime <= 0.f) {
needsHolster = true; needsHolster = true;
@ -471,7 +486,7 @@ void CPlayer::UpdateGunState(const CFinalInput& input, CStateManager& mgr) {
if (!ControlMapper::GetDigitalInput(ControlMapper::kC_FireOrBomb, input) && if (!ControlMapper::GetDigitalInput(ControlMapper::kC_FireOrBomb, input) &&
!ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input) && !ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input) &&
x490_gun->IsFidgeting()) { x490_gun->IsFidgeting()) {
if (gpTweakPlayer->x229_31_gunNotFiringHolstersGun) { if (gpTweakPlayer->mGunNotFiringHolstersGun) {
x49c_gunHolsterRemTime -= dt; x49c_gunHolsterRemTime -= dt;
} }
} else { } else {
@ -499,7 +514,7 @@ void CPlayer::UpdateGunState(const CFinalInput& input, CStateManager& mgr) {
ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input) || ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input) ||
x3b8_grappleState == kGS_None) { x3b8_grappleState == kGS_None) {
needsDraw = true; needsDraw = true;
} else if (gpTweakPlayer->x229_30_gunButtonTogglesHolster && } else if (gpTweakPlayer->mGunButtonTogglesHolster &&
ControlMapper::GetPressInput(ControlMapper::kC_ToggleHolster, input)) { ControlMapper::GetPressInput(ControlMapper::kC_ToggleHolster, input)) {
needsDraw = true; needsDraw = true;
} }
@ -582,14 +597,14 @@ void CPlayer::UpdateAssistedAiming(const CTransform4f& xf, CStateManager& mgr) {
float vAngleDelta = az1 - az2; float vAngleDelta = az1 - az2;
bool hasVAngleDelta = true; bool hasVAngleDelta = true;
if (!x9c6_27_aimingAtProjectile && if (!x9c6_27_aimingAtProjectile &&
fabsf(vAngleDelta) > gpTweakPlayer->x268_aimAssistVerticalAngle) { fabsf(vAngleDelta) > gpTweakPlayer->mAimAssistVerticalAngle) {
if (gpTweakPlayer->x22a_28_assistedAimingIgnoreVertical) { if (gpTweakPlayer->mAssistedAimingIgnoreVertical) {
vAngleDelta = 0.f; vAngleDelta = 0.f;
hasVAngleDelta = false; hasVAngleDelta = false;
} else if (vAngleDelta > 0.f) { } else if (vAngleDelta > 0.f) {
vAngleDelta = gpTweakPlayer->x268_aimAssistVerticalAngle; vAngleDelta = gpTweakPlayer->mAimAssistVerticalAngle;
} else { } else {
vAngleDelta = -gpTweakPlayer->x268_aimAssistVerticalAngle; vAngleDelta = -gpTweakPlayer->mAimAssistVerticalAngle;
} }
} }
@ -597,9 +612,9 @@ void CPlayer::UpdateAssistedAiming(const CTransform4f& xf, CStateManager& mgr) {
float hAngleDelta = acosf(CMath::Limit(CVector3f::Dot(gunToTargetFlat, gunDirFlat), 1.f)); float hAngleDelta = acosf(CMath::Limit(CVector3f::Dot(gunToTargetFlat, gunDirFlat), 1.f));
bool hasHAngleDelta = true; bool hasHAngleDelta = true;
if (!x9c6_27_aimingAtProjectile && if (!x9c6_27_aimingAtProjectile &&
fabsf(hAngleDelta) > gpTweakPlayer->x264_aimAssistHorizontalAngle) { fabsf(hAngleDelta) > gpTweakPlayer->mAimAssistHorizontalAngle) {
hAngleDelta = gpTweakPlayer->x264_aimAssistHorizontalAngle; hAngleDelta = gpTweakPlayer->mAimAssistHorizontalAngle;
if (gpTweakPlayer->x22a_27_assistedAimingIgnoreHorizontal) { if (gpTweakPlayer->mAssistedAimingIgnoreHorizontal) {
hAngleDelta = 0.f; hAngleDelta = 0.f;
hasHAngleDelta = false; hasHAngleDelta = false;
} }
@ -1106,31 +1121,645 @@ void CPlayer::SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr)
} }
} }
// void CPlayer::SetSpawnedMorphBallState(EPlayerMorphBallState state, CStateManager& mgr) { void CPlayer::SetSpawnedMorphBallState(EPlayerMorphBallState state, CStateManager& mgr) {
// x2fc_spawnedMorphBallState = state; x2fc_spawnedMorphBallState = state;
// SetCameraState(kCS_Spawned, mgr); SetCameraState(kCS_Spawned, mgr);
// if (x2fc_spawnedMorphBallState != x2f8_morphBallState) { if (x2fc_spawnedMorphBallState != x2f8_morphBallState) {
// CPhysicsActor::Stop(); CPhysicsActor::Stop();
// SetOrbitRequest(kOR_Respawn, mgr); BreakOrbit(kOB_Respawn, mgr);
// switch (x2fc_spawnedMorphBallState) { switch (x2fc_spawnedMorphBallState) {
// case kMS_Unmorphed: { case kMS_Unmorphed: {
// CVector3f pos; CVector3f pos = CVector3f::Zero();
// if (CanLeaveMorphBallState(mgr, pos)) { if (CanLeaveMorphBallState(mgr, pos)) {
// SetTranslation(GetTranslation() + pos); SetTranslation(GetTranslation() + pos);
// LeaveMorphBallState(mgr); LeaveMorphBallState(mgr);
// ForceGunOrientation(GetTransform(), mgr); ForceGunOrientation(GetTransform(), mgr);
// DrawGun(mgr); DrawGun(mgr);
// } }
// break; break;
// } }
// case kMS_Morphed: case kMS_Morphed:
// EnterMorphBallState(mgr); EnterMorphBallState(mgr);
// ResetBallCAmera(mgr); ResetBallCamera(mgr);
// mgr.GetCameraManager()->ResetCameraHint(mgr); mgr.CameraManager()->ResetCameraHint(mgr);
// mgr.GetCameraManager()->GetBallCamera()->Reset(CreateTransformFromMovementDirection(), mgr); mgr.CameraManager()->BallCamera()->Reset(CreateTransformFromMovementDirection(), mgr);
// break; break;
// default: default:
// break; break;
// } }
// } }
// } }
void CPlayer::UpdateCinematicState(CStateManager& mgr) {
if (mgr.GetCameraManager()->IsInCinematicCamera()) {
if (x2f4_cameraState != kCS_Spawned) {
x2fc_spawnedMorphBallState = x2f8_morphBallState;
if (x2fc_spawnedMorphBallState == kMS_Unmorphing) {
x2fc_spawnedMorphBallState = kMS_Unmorphed;
}
if (x2fc_spawnedMorphBallState == kMS_Morphing) {
x2fc_spawnedMorphBallState = kMS_Morphed;
}
SetCameraState(kCS_Spawned, mgr);
}
} else {
if (x2f4_cameraState == kCS_Spawned) {
if (x2fc_spawnedMorphBallState == x2f8_morphBallState) {
switch (x2fc_spawnedMorphBallState) {
case kMS_Morphed:
SetCameraState(kCS_Ball, mgr);
break;
case kMS_Unmorphed:
SetCameraState(kCS_FirstPerson, mgr);
if (mgr.GetPlayerState()->GetCurrentVisor() != CPlayerState::kPV_Scan) {
ForceGunOrientation(GetTransform(), mgr);
DrawGun(mgr);
}
break;
default:
break;
}
} else {
CPhysicsActor::Stop();
BreakOrbit(kOB_Respawn, mgr);
switch (x2fc_spawnedMorphBallState) {
case kMS_Unmorphed: {
CVector3f vec = CVector3f::Zero();
if (CanLeaveMorphBallState(mgr, vec)) {
SetTranslation(GetTranslation() + vec);
LeaveMorphBallState(mgr);
SetCameraState(kCS_FirstPerson, mgr);
ForceGunOrientation(GetTransform(), mgr);
DrawGun(mgr);
}
break;
}
case kMS_Morphed:
EnterMorphBallState(mgr);
ResetBallCamera(mgr);
mgr.CameraManager()->ResetCameraHint(mgr);
mgr.CameraManager()->BallCamera()->Reset(CreateTransformFromMovementDirection(), mgr);
break;
default:
break;
}
}
}
}
}
void CPlayer::UpdateCameraState(CStateManager& mgr) { UpdateCinematicState(mgr); }
void CPlayer::SetCameraState(EPlayerCameraState camState, CStateManager& mgr) {
if (x2f4_cameraState == camState) {
return;
}
x2f4_cameraState = camState;
CCameraManager* camMgr = mgr.CameraManager();
switch (camState) {
case kCS_FirstPerson:
camMgr->SetCurrentCameraId(camMgr->GetFirstPersonCamera()->GetUniqueId());
x768_morphball->SetBallLightActive(mgr, false);
break;
case kCS_Ball:
camMgr->SetCurrentCameraId(camMgr->GetBallCamera()->GetUniqueId());
x768_morphball->SetBallLightActive(mgr, true);
break;
case kCS_Transitioning:
camMgr->SetCurrentCameraId(camMgr->GetBallCamera()->GetUniqueId());
x768_morphball->SetBallLightActive(mgr, true);
break;
case kCS_Two:
break;
case kCS_Spawned: {
bool ballLight = false;
if (const CCinematicCamera* cineCam =
TCastToConstPtr< CCinematicCamera >(camMgr->GetCurrentCamera(mgr))) {
ballLight = x2f8_morphBallState == kMS_Morphed && cineCam->GetFlags() & 0x40;
}
x768_morphball->SetBallLightActive(mgr, ballLight);
break;
}
}
}
void CPlayer::UpdateFreeLookState(const CFinalInput& input, float dt, CStateManager& mgr) {
if (x304_orbitState == kOS_ForcedOrbitObject || IsMorphBallTransitioning() ||
x2f8_morphBallState != kMS_Unmorphed ||
(x3b8_grappleState != kGS_None && x3b8_grappleState != kGS_Firing)) {
x3dc_inFreeLook = false;
x3dd_lookButtonHeld = false;
x3de_lookAnalogHeld = false;
x3e8_horizFreeLookAngleVel = 0.f;
x3f0_vertFreeLookAngleVel = 0.f;
x9c4_25_showCrosshairs = false;
return;
}
if (gpTweakPlayer->mHoldButtonsForFreeLook) {
if ((gpTweakPlayer->mTwoButtonsForFreeLook &&
(ControlMapper::GetDigitalInput(ControlMapper::kC_LookHold1, input) &&
ControlMapper::GetDigitalInput(ControlMapper::kC_LookHold2, input))) ||
(!gpTweakPlayer->mTwoButtonsForFreeLook &&
(ControlMapper::GetDigitalInput(ControlMapper::kC_LookHold1, input) ||
ControlMapper::GetDigitalInput(ControlMapper::kC_LookHold2, input)))) {
if (!x3dd_lookButtonHeld) {
CVector3f lookDir =
mgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform().GetColumn(kDY);
CVector3f lookDirFlat = lookDir;
lookDirFlat.SetZ(0.f);
x3e4_freeLookYawAngle = 0.f;
if (lookDirFlat.CanBeNormalized()) {
lookDirFlat.Normalize();
x3ec_freeLookPitchAngle = acosf(CMath::Limit(CVector3f::Dot(lookDir, lookDirFlat), 1.f));
if (lookDir.GetZ() < 0.f) {
x3ec_freeLookPitchAngle = -x3ec_freeLookPitchAngle;
}
}
}
x3dc_inFreeLook = true;
x3dd_lookButtonHeld = true;
if (ControlMapper::GetAnalogInput(ControlMapper::kC_LookLeft, input) >= 0.1f ||
ControlMapper::GetAnalogInput(ControlMapper::kC_LookRight, input) >= 0.1f ||
ControlMapper::GetAnalogInput(ControlMapper::kC_LookDown, input) >= 0.1f ||
ControlMapper::GetAnalogInput(ControlMapper::kC_LookUp, input) >= 0.1f) {
x3de_lookAnalogHeld = true;
} else {
x3de_lookAnalogHeld = false;
}
} else {
x3dc_inFreeLook = false;
x3dd_lookButtonHeld = false;
x3de_lookAnalogHeld = false;
x3e8_horizFreeLookAngleVel = 0.f;
x3f0_vertFreeLookAngleVel = 0.f;
}
} else {
if (ControlMapper::GetAnalogInput(ControlMapper::kC_LookLeft, input) >= 0.1f ||
ControlMapper::GetAnalogInput(ControlMapper::kC_LookRight, input) >= 0.1f ||
ControlMapper::GetAnalogInput(ControlMapper::kC_LookDown, input) >= 0.1f ||
ControlMapper::GetAnalogInput(ControlMapper::kC_LookUp, input) >= 0.1f) {
x3de_lookAnalogHeld = true;
} else {
x3de_lookAnalogHeld = false;
}
x3dd_lookButtonHeld = false;
if (fabsf(x3e4_freeLookYawAngle) < gpTweakPlayer->mFreeLookCenteredThresholdAngle &&
fabsf(x3ec_freeLookPitchAngle) < gpTweakPlayer->mFreeLookCenteredThresholdAngle) {
if (x3e0_curFreeLookCenteredTime > gpTweakPlayer->mFreeLookCenteredTime) {
x3dc_inFreeLook = false;
x3e8_horizFreeLookAngleVel = 0.f;
x3f0_vertFreeLookAngleVel = 0.f;
} else {
x3e0_curFreeLookCenteredTime += dt;
}
} else {
x3dc_inFreeLook = true;
x3e0_curFreeLookCenteredTime = 0.f;
}
}
UpdateCrosshairsState(input);
}
void CPlayer::UpdateCameraTimers(float dt, const CFinalInput& input) {
if (x3dc_inFreeLook || x3dd_lookButtonHeld) {
x294_jumpCameraTimer = 0.f;
x29c_fallCameraTimer = 0.f;
return;
}
if (gpTweakPlayer->mFiringCancelsCameraPitch) {
if (ControlMapper::GetDigitalInput(ControlMapper::kC_FireOrBomb, input) ||
ControlMapper::GetDigitalInput(ControlMapper::kC_MissileOrPowerBomb, input)) {
if (x288_startingJumpTimeout > 0.f) {
x2a4_cancelCameraPitch = true;
return;
}
}
}
if (ControlMapper::GetPressInput(ControlMapper::kC_JumpOrBoost, input)) {
++x298_jumpPresses;
}
if (ControlMapper::GetDigitalInput(ControlMapper::kC_JumpOrBoost, input) &&
x294_jumpCameraTimer > 0.f && !x2a4_cancelCameraPitch && x298_jumpPresses <= 2) {
x294_jumpCameraTimer += dt;
}
if (x29c_fallCameraTimer > 0.f && !x2a4_cancelCameraPitch) {
x29c_fallCameraTimer += dt;
}
}
void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) {
switch (msg) {
case kSM_OnFloor:
if (x258_movementState != NPlayer::kMS_OnGround && x2f8_morphBallState != kMS_Morphed &&
x300_fallingTime > 0.3f) {
if (x258_movementState != NPlayer::kMS_Falling) {
float hardThres = CMath::FastSqrtF(-gpTweakPlayer->mNormalGravAccel * 2.f * 30.f);
uchar landVol =
CCast::ToUint8(CMath::Clamp(95.f, -x794_lastVelocity.GetZ() * 1.6f + 95.f, 127.f));
ushort landSfx;
if (-x794_lastVelocity.GetZ() < hardThres) {
landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxSoft,
ARRAY_SIZE(skPlayerLandSfxSoft), 0xffff);
} else {
landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxHard,
ARRAY_SIZE(skPlayerLandSfxHard), 0xffff);
StartSamusVoiceSfx(SFXsam_voxland_02, 127, 5);
x55c_damageAmt = 0.f;
x560_prevDamageAmt = 10.f;
x564_damageLocation = GetTranslation();
x558_wasDamaged = true;
mgr.CameraManager()->AddCameraShaker(CCameraShakeData::HardBothAxesShake(0.3f, 1.25f),
false);
StartLandingControlFreeze();
}
DoSfxEffects(CSfxManager::SfxStart(landSfx, landVol, 64, true));
float rumbleMag = -x794_lastVelocity.GetZ() * (1.f / 110.f);
if (rumbleMag > 0.f) {
mgr.GetRumbleManager()->Rumble(mgr, kRFX_PlayerLand, CMath::Limit(rumbleMag, 0.8f),
kRP_One);
}
x2a0_ = 0.f;
}
} else if (x258_movementState != NPlayer::kMS_OnGround && x2f8_morphBallState == kMS_Morphed) {
if (GetVelocityWR().GetZ() < -40.f && !x768_morphball->GetIsInHalfPipeMode() &&
x258_movementState == NPlayer::kMS_ApplyJump && x300_fallingTime > 0.75f) {
SetCoefficientOfRestitutionModifier(0.2f);
}
x768_morphball->Land();
if (GetVelocityWR().GetZ() < -5.f) {
mgr.GetRumbleManager()->Rumble(
mgr, kRFX_PlayerLand,
CMath::Limit(-GetVelocityWR().GetZ() * (1.f / 110.f) * 0.5f, 0.8f), kRP_One);
x2a0_ = 0.f;
}
if (GetVelocityWR().GetZ() < -30.f) {
mgr.GetRumbleManager()->Rumble(mgr, kRFX_PlayerLand,
CMath::Limit(-GetVelocityWR().GetZ() * (1.f / 110.f), 0.8f),
kRP_One);
x2a0_ = 0.f;
}
}
x300_fallingTime = 0.f;
SetMoveState(NPlayer::kMS_OnGround, mgr);
break;
case kSM_Falling:
if (x2f8_morphBallState == kMS_Morphed) {
if (x768_morphball->GetSpiderBallState() == CMorphBall::kSBS_Active) {
break;
}
}
if (x2f8_morphBallState != kMS_Morphed) {
SetMoveState(NPlayer::kMS_Falling, mgr);
} else if (x258_movementState == NPlayer::kMS_OnGround) {
SetMoveState(NPlayer::kMS_FallingMorphed, mgr);
}
break;
case kSM_LandOnNotFloor:
if (x2f8_morphBallState == kMS_Morphed &&
x768_morphball->GetSpiderBallState() == CMorphBall::kSBS_Active &&
x258_movementState != NPlayer::kMS_ApplyJump) {
SetMoveState(NPlayer::kMS_ApplyJump, mgr);
}
break;
case kSM_OnIceSurface:
x2ac_surfaceRestraint = kSR_Ice;
break;
case kSM_OnMudSlowSurface:
x2ac_surfaceRestraint = kSR_Organic;
break;
case kSM_OnNormalSurface:
x2ac_surfaceRestraint = kSR_Normal;
break;
case kSM_InSnakeWeed:
x2ac_surfaceRestraint = kSR_Shrubbery;
break;
case kSM_AddSplashInhabitant: {
SetInFluid(true, sender);
UpdateSubmerged(mgr);
float length = 0.5f * GetEyeHeight();
CMaterialFilter filter = CMaterialFilter::MakeInclude(CMaterialList(kMT_Solid));
CVector3f dir(0.f, 0.f, -1.f);
const CRayCastResult result = mgr.RayStaticIntersection(GetTranslation(), dir, length, filter);
if (result.IsInvalid()) {
SetVelocityWR(GetVelocityWR() * 0.095f);
SetConstantForceWR(GetConstantForceWR() * 0.095f);
}
break;
}
case kSM_UpdateSplashInhabitant:
UpdateSubmerged(mgr);
if (CheckSubmerged() && !mgr.GetPlayerState()->HasPowerUp(CPlayerState::kIT_GravitySuit)) {
if (const CScriptWater* water =
TCastToConstPtr< CScriptWater >(mgr.ObjectById(InFluidId()))) {
switch (water->GetFluidPlane().GetFluidType()) {
case CFluidPlane::kFT_NormalWater:
x2b0_outOfWaterTicks = 0;
break;
case CFluidPlane::kFT_Lava:
case CFluidPlane::kFT_ThickLava:
x2ac_surfaceRestraint = kSR_Lava;
break;
case CFluidPlane::kFT_PoisonWater:
x2b0_outOfWaterTicks = 0;
break;
case CFluidPlane::kFT_PhazonFluid:
x2ac_surfaceRestraint = kSR_Phazon;
break;
default:
break;
}
}
}
x9c5_25_splashUpdated = true;
break;
case kSM_RemoveSplashInhabitant:
SetInFluid(false, kInvalidUniqueId);
UpdateSubmerged(mgr);
break;
case kSM_ProjectileCollide:
x378_orbitPreventionTimer = gpTweakPlayer->mOrbitPreventionTime;
BreakOrbit(kOB_ProjectileCollide, mgr);
break;
case kSM_AddPlatformRider:
x82e_ridingPlatform = sender;
break;
case kSM_Damage:
if (const CEnergyProjectile* energ =
TCastToConstPtr< CEnergyProjectile >(mgr.ObjectById(sender))) {
if ((energ->GetAttribField() & CWeapon::kPA_StaticInterference) ==
CWeapon::kPA_StaticInterference) {
mgr.PlayerState()->StaticInterference().AddSource(GetUniqueId(), 0.3f,
energ->GetInterferenceDuration());
}
}
break;
case kSM_Deleted:
mgr.PlayerState()->ResetVisor();
x730_transitionModels.clear();
break;
default:
break;
}
x490_gun->AcceptScriptMsg(msg, sender, mgr);
x768_morphball->AcceptScriptMsg(msg, sender, mgr);
CActor::AcceptScriptMsg(msg, sender, mgr);
}
void CPlayer::PreThink(float dt, CStateManager& mgr) {
x558_wasDamaged = false;
x55c_damageAmt = 0.f;
x560_prevDamageAmt = 0.f;
x564_damageLocation = CVector3f::Zero();
xa04_preThinkDt = dt;
}
void CPlayer::AdjustEyeOffset(CStateManager& mgr) {
const CScriptWater* water = TCastToConstPtr< CScriptWater >(mgr.GetObjectById(InFluidId()));
if (!water) {
return;
}
CVector3f bounds = water->GetTriggerBoundsWR().GetMaxPoint();
CVector3f eyePos = GetEyePosition();
eyePos[kDZ] -= GetEyeOffset();
float waterToDeltaDelta = eyePos.GetZ() - bounds.GetZ();
if (eyePos.GetZ() >= bounds.GetZ() && waterToDeltaDelta <= 0.25f) {
SetEyeOffset(GetEyeOffset() + bounds.GetZ() + 0.25f - eyePos.GetZ());
} else if (eyePos.GetZ() < bounds.GetZ() && waterToDeltaDelta >= -0.2f) {
SetEyeOffset(GetEyeOffset() + bounds.GetZ() - 0.2f - eyePos.GetZ());
}
}
void CPlayer::Think(float dt, CStateManager& mgr) {
UpdateStepUpSmoothing(dt);
AdjustEyeOffset(mgr);
UpdateEnvironmentDamageCameraShake(dt, mgr);
UpdatePhazonDamage(dt, mgr);
UpdateFreeLook(dt);
UpdatePlayerHints(mgr);
if (x2b0_outOfWaterTicks < 2) {
x2b0_outOfWaterTicks += 1;
}
x9c5_24_ = x9c4_31_inWaterMovement;
x9c4_31_inWaterMovement = x9c5_25_splashUpdated;
x9c5_25_splashUpdated = false;
UpdateBombJumpStuff();
if (0.f < x288_startingJumpTimeout) {
x288_startingJumpTimeout -= dt;
if (0.f >= x288_startingJumpTimeout) {
SetMoveState(NPlayer::kMS_ApplyJump, mgr);
}
}
if (x2a0_ > 0.f) {
x2a0_ += dt;
}
if (x774_samusVoiceTimeout > 0.f) {
x774_samusVoiceTimeout -= dt;
}
if (0.f < x28c_sjTimer) {
x28c_sjTimer -= dt;
}
x300_fallingTime += dt;
if (x258_movementState == NPlayer::kMS_FallingMorphed && x300_fallingTime > 0.4f) {
SetMoveState(NPlayer::kMS_ApplyJump, mgr);
}
if (x570_immuneTimer > 0.f) {
x570_immuneTimer -= dt;
}
Update(dt, mgr);
UpdateTransitionFilter(dt, mgr);
CalculatePlayerMovementDirection(dt);
UpdatePlayerControlDirection(dt, mgr);
if (gUseSurfaceHack) {
if (gSR_Hack == kSR_Water) {
x2b0_outOfWaterTicks = 0;
} else {
x2ac_surfaceRestraint = gSR_Hack;
}
}
if (x2f8_morphBallState == kMS_Unmorphed && x9c5_27_camSubmerged &&
mgr.GetCameraManager()->GetFluidCounter() == 0) {
if (const CScriptWater* water = GetVisorRunoffEffect(mgr)) {
if (water->GetVisorRunoffEffect()) {
mgr.AddObject(rs_new CHUDBillboardEffect(
rstl::optional_object< TToken< CGenDescription > >(*water->GetVisorRunoffEffect()),
rstl::optional_object_null(), mgr.AllocateUniqueId(), true,
rstl::string_l("WaterSheets"), CHUDBillboardEffect::GetNearClipDistance(mgr),
CHUDBillboardEffect::GetScaleForPOV(mgr), CColor(1.f, 1.f, 1.f, 1.f),
CVector3f(1.f, 1.f, 1.f), CVector3f(0.f, 0.f, 0.f)));
}
DoSfxEffects(CSfxManager::SfxStart(water->GetVisorRunoffSfx()));
}
}
x9c5_27_camSubmerged = mgr.GetCameraManager()->GetFluidCounter() != 0;
if (x2f8_morphBallState != kMS_Morphed) {
if (fabsf(GetTransform().GetColumn(kDX).GetZ()) > FLT_EPSILON ||
fabsf(GetTransform().GetColumn(kDY).GetZ()) > FLT_EPSILON) {
CVector3f backupTranslation = GetTranslation();
CVector3f lookDirFlat = GetTransform().GetColumn(kDY);
lookDirFlat.SetZ(0.f);
if (lookDirFlat.CanBeNormalized()) {
SetTransform(CTransform4f::LookAt(CUnitVector3f(CVector3f::Zero()),
CUnitVector3f(lookDirFlat.AsNormalized())));
} else {
SetTransform(CTransform4f::Identity());
}
SetTranslation(backupTranslation);
}
}
x794_lastVelocity = GetVelocityWR();
}
void CPlayer::SetFrozenState(CStateManager& stateMgr, CAssetId steamTxtr, ushort sfx,
CAssetId iceTxtr) {
if (!stateMgr.GetCameraManager()->IsInCinematicCamera() && !GetFrozenState()) {
bool showMsg;
CSystemState& systemState = gpGameState->SystemState();
if (x2f8_morphBallState == kMS_Unmorphed) {
showMsg = systemState.AreFreezeInstructionsStillEnabledFirstPerson();
} else {
showMsg = systemState.AreFreezeInstructionsStillEnabledMorphBall();
}
if (showMsg) {
int msgIdx = x2f8_morphBallState != kMS_Morphed ? 19 : 20;
CSamusHud::DisplayHudMemo(rstl::wstring_l(gpStringTable->GetString(msgIdx)),
CHUDMemoParms(5.f, true, false, false));
}
x750_frozenTimeout = x758_frozenTimeoutBias + gpTweakPlayer->mFrozenTimeout;
x754_iceBreakJumps = -x75c_additionalIceBreakJumps;
CPhysicsActor::Stop();
ClearForcesAndTorques();
if (x3b8_grappleState != kGS_None) {
BreakGrapple(kOB_Freeze, stateMgr);
} else {
BreakOrbit(kOB_Freeze, stateMgr);
}
AddMaterial(kMT_Immovable, stateMgr);
IsMorphBallTransitioning();
xa08_steamTextureId = steamTxtr;
xa0c_iceTextureId = iceTxtr;
DoSfxEffects(CSfxManager::SfxStart(sfx));
EndLandingControlFreeze();
}
}
bool CPlayer::GetFrozenState() const { return x750_frozenTimeout > 0.f; }
void CPlayer::BreakFrozenState(CStateManager& stateMgr) {
if (!GetFrozenState()) {
return;
}
x750_frozenTimeout = 0.f;
x754_iceBreakJumps = 0;
CPhysicsActor::Stop();
ClearForcesAndTorques();
RemoveMaterial(kMT_Immovable, stateMgr);
if (!stateMgr.GetCameraManager()->IsInCinematicCamera() && xa0c_iceTextureId != kInvalidAssetId) {
stateMgr.AddObject(rs_new CHUDBillboardEffect(
rstl::optional_object< TToken< CGenDescription > >(
gpSimplePool->GetObj(SObjectTag('PART', xa0c_iceTextureId))),
rstl::optional_object_null(), stateMgr.AllocateUniqueId(), true,
rstl::string_l("FrostExplosion"), CHUDBillboardEffect::GetNearClipDistance(stateMgr),
CHUDBillboardEffect::GetScaleForPOV(stateMgr), CColor(1.f, 1.f, 1.f, 1.f),
CVector3f(1.f, 1.f, 1.f), CVector3f(0.f, 0.f, 0.f)));
DoSfxEffects(CSfxManager::SfxStart(SFXcrk_break_final));
}
x768_morphball->ResetMorphBallIceBreak();
SetVisorSteam(0.f, 6.f / 14.f, 1.f / 14.f, xa08_steamTextureId, false);
}
void CPlayer::UpdateFrozenState(const CFinalInput& input, CStateManager& mgr) {
x750_frozenTimeout -= input.Time();
if (x750_frozenTimeout > 0.f) {
SetVisorSteam(0.7f, 6.f / 14.f, 1.f / 14.f, xa08_steamTextureId, false);
} else {
BreakFrozenState(mgr);
return;
}
if (x258_movementState == NPlayer::kMS_OnGround ||
x258_movementState == NPlayer::kMS_FallingMorphed) {
Stop();
ClearForcesAndTorques();
}
x7a0_visorSteam.Update(input.Time());
switch (x2f8_morphBallState) {
case kMS_Morphed:
x490_gun->ProcessInput(input, mgr);
break;
case kMS_Unmorphed:
case kMS_Morphing:
case kMS_Unmorphing:
if (ControlMapper::GetPressInput(ControlMapper::kC_JumpOrBoost, input)) {
if (x754_iceBreakJumps != 0) {
/* Subsequent Breaks */
DoSfxEffects(CSfxManager::SfxStart(SFXcrk_break_subsequent));
} else {
/* Initial Break */
DoSfxEffects(CSfxManager::SfxStart(SFXcrk_break_initial));
}
int max = gpTweakPlayer->mIceBreakJumpCount;
if (++x754_iceBreakJumps > max) {
gpGameState->SystemState().IncNumFreezeInstructionsPrintedFirstPerson();
CSamusHud::ClearHudMemo();
BreakFrozenState(mgr);
}
}
break;
}
}
void CPlayer::EndLandingControlFreeze() {
x760_controlsFrozen = false;
x764_controlsFrozenTimeout = 0.f;
}
void CPlayer::UpdateControlLostState(float dt, CStateManager& mgr) {
x764_controlsFrozenTimeout -= dt;
if (x764_controlsFrozenTimeout <= 0.f) {
EndLandingControlFreeze();
} else {
const CFinalInput dummy;
if (x2f8_morphBallState == kMS_Morphed) {
x768_morphball->ComputeBallMovement(dummy, mgr, dt);
x768_morphball->UpdateBallDynamics(mgr, dt);
} else {
ComputeMovement(dummy, mgr, dt);
}
}
}
void CPlayer::StartLandingControlFreeze() {
x760_controlsFrozen = true;
x764_controlsFrozenTimeout = 0.75f;
}

View File

@ -8,7 +8,7 @@
#include "rstl/math.hpp" #include "rstl/math.hpp"
static CAABox calculate_ball_aabox() { static CAABox calculate_ball_aabox() {
const float extent = 0.33f * gpTweakPlayer->GetPlayerBallHalfExtent(); const float extent = 0.33f * gpTweakPlayer->mPlayerBallHalfExtent;
return CAABox(CVector3f(-extent, -extent, -extent), CVector3f(extent, extent, extent)); return CAABox(CVector3f(-extent, -extent, -extent), CVector3f(extent, extent, extent));
} }

View File

@ -24,7 +24,7 @@ void CScriptBeam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CSt
x138_damageInfo.GetWeaponMode().GetType(), xf4_beamInfo, GetTransform(), kMT_Projectile, x138_damageInfo.GetWeaponMode().GetType(), xf4_beamInfo, GetTransform(), kMT_Projectile,
x138_damageInfo, x154_projectileId, GetCurrentAreaId(), GetUniqueId(), x138_damageInfo, x154_projectileId, GetCurrentAreaId(), GetUniqueId(),
CPlasmaProjectile::PlayerEffectResources(), false, CPlasmaProjectile::PlayerEffectResources(), false,
kPA_KeepInCinematic // TODO: wrong attrib definition? CWeapon::kPA_KeepInCinematic // TODO: wrong attrib definition?
)); ));
} break; } break;

View File

@ -92,8 +92,8 @@ void CScriptEMPulse::Touch(CActor& act, CStateManager& mgr) {
if (dur > pl->GetStaticTimer()) { if (dur > pl->GetStaticTimer()) {
pl->SetHudDisable(dur); pl->SetHudDisable(dur);
pl->SetOrbitRequestForTarget(mgr.GetPlayer()->GetOrbitTargetId(), kOR_ActivateOrbitSource, pl->TryToBreakOrbit(mgr.GetPlayer()->GetOrbitTargetId(), CPlayer::kOB_ActivateOrbitSource,
mgr); mgr);
} }
mgr.PlayerState()->StaticInterference().AddSource(GetUniqueId(), mag, dur); mgr.PlayerState()->StaticInterference().AddSource(GetUniqueId(), mag, dur);
} }

View File

@ -171,21 +171,21 @@ void CScriptPickup::Touch(CActor& act, CStateManager& mgr) {
int total = playerState->GetTotalPickupCount(); int total = playerState->GetTotalPickupCount();
int colRate = playerState->CalculateItemCollectionRate(); int colRate = playerState->CalculateItemCollectionRate();
if (colRate == total) { if (colRate == total) {
CSystemOptions& opts = gpGameState->SystemOptions(); CSystemState& state = gpGameState->SystemState();
CAssetId id = CAssetId id =
gpResourceFactory gpResourceFactory
->GetResourceIdByName(opts.GetAllItemsCollected() ? "STRG_AllPickupsFound_2" ->GetResourceIdByName(state.GetAllItemsCollected() ? "STRG_AllPickupsFound_2"
: "STRG_AllPickupsFound_1") : "STRG_AllPickupsFound_1")
->GetId(); ->GetId();
mgr.QueueMessage(mgr.GetHUDMessageFrameCount() + 1, id, 0.f); mgr.QueueMessage(mgr.GetHUDMessageFrameCount() + 1, id, 0.f);
opts.SetAllItemsCollected(true); state.SetAllItemsCollected(true);
} }
} }
if (itemType == CPlayerState::kIT_PowerBombs) { if (itemType == CPlayerState::kIT_PowerBombs) {
CSystemOptions& opts = gpGameState->SystemOptions(); CSystemState& state = gpGameState->SystemState();
if (opts.GetShowPowerBombAmmoMessage()) { if (state.GetShowPowerBombAmmoMessage()) {
opts.IncrementPowerBombAmmoCount(); state.IncrementPowerBombAmmoCount();
CSamusHud::DisplayHudMemo(rstl::wstring_l(gpStringTable->GetString(109)), CSamusHud::DisplayHudMemo(rstl::wstring_l(gpStringTable->GetString(109)),
CHUDMemoParms(5.f, true, false, false)); CHUDMemoParms(5.f, true, false, false));
} }

View File

@ -303,7 +303,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
if (msg == kSM_Action) { if (msg == kSM_Action) {
CPlayerState& pState = *mgr.PlayerState(); CPlayerState& pState = *mgr.PlayerState();
pState.SetPickup(CPlayerState::kIT_Missiles, pState.SetPickup(CPlayerState::kIT_Missiles,
pState.GetItemCapacity(CPlayerState::kIT_Missiles)); pState.GetItemCapacity(CPlayerState::kIT_Missiles));
} }
break; break;
} }
@ -311,7 +311,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
if (msg == kSM_Action) { if (msg == kSM_Action) {
CPlayerState& pState = *mgr.PlayerState(); CPlayerState& pState = *mgr.PlayerState();
pState.SetPickup(CPlayerState::kIT_PowerBombs, pState.SetPickup(CPlayerState::kIT_PowerBombs,
pState.GetItemCapacity(CPlayerState::kIT_PowerBombs)); pState.GetItemCapacity(CPlayerState::kIT_PowerBombs));
} }
break; break;
} }
@ -436,7 +436,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
} }
} else if (msg == kSM_Decrement) { } else if (msg == kSM_Decrement) {
mgr.SetCinematicSkipObject(kInvalidUniqueId); mgr.SetCinematicSkipObject(kInvalidUniqueId);
gpGameState->SystemOptions().SetCinematicState( gpGameState->SystemState().SetCinematicState(
rstl::pair< CAssetId, TEditorId >(mgr.GetWorld()->GetWorldAssetId(), GetEditorId()), rstl::pair< CAssetId, TEditorId >(mgr.GetWorld()->GetWorldAssetId(), GetEditorId()),
true); true);
} }
@ -607,7 +607,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
bool CScriptSpecialFunction::ShouldSkipCinematic(CStateManager& mgr) const { bool CScriptSpecialFunction::ShouldSkipCinematic(CStateManager& mgr) const {
CAssetId mlvlId = mgr.GetWorld()->GetWorldAssetId(); CAssetId mlvlId = mgr.GetWorld()->GetWorldAssetId();
TEditorId cineId = GetEditorId(); TEditorId cineId = GetEditorId();
return gpGameState->SystemOptions().GetCinematicState( return gpGameState->SystemState().GetCinematicState(
rstl::pair< CAssetId, TEditorId >(mlvlId, cineId)); rstl::pair< CAssetId, TEditorId >(mlvlId, cineId));
} }

View File

@ -65,9 +65,9 @@ void CScriptTrigger::Touch(CActor& act, CStateManager& mgr) {
kTFL_DetectProjectiles4 | kTFL_DetectProjectiles5 | kTFL_DetectProjectiles6 | kTFL_DetectProjectiles4 | kTFL_DetectProjectiles5 | kTFL_DetectProjectiles6 |
kTFL_DetectProjectiles7; kTFL_DetectProjectiles7;
} else if (const CWeapon* weap = TCastToConstPtr< CWeapon >(act)) { } else if (const CWeapon* weap = TCastToConstPtr< CWeapon >(act)) {
if ((weap->GetAttribField() & kPA_Bombs) == kPA_Bombs) { if ((weap->GetAttribField() & CWeapon::kPA_Bombs) == CWeapon::kPA_Bombs) {
testFlags |= kTFL_DetectBombs; testFlags |= kTFL_DetectBombs;
} else if ((weap->GetAttribField() & kPA_PowerBombs) == kPA_PowerBombs) { } else if ((weap->GetAttribField() & CWeapon::kPA_PowerBombs) == CWeapon::kPA_PowerBombs) {
testFlags |= kTFL_DetectPowerBombs; testFlags |= kTFL_DetectPowerBombs;
} }
} }

View File

@ -4,199 +4,199 @@
#include "Kyoto/Streams/CInputStream.hpp" #include "Kyoto/Streams/CInputStream.hpp"
CTweakPlayer::CTweakPlayer(CInputStream& in) CTweakPlayer::CTweakPlayer(CInputStream& in)
: x2d8_grappleBeamSpeed(0.0) : mGrappleBeamSpeed(0.0)
, x2dc_grappleBeamXWaveAmplitude(0.0) , mGrappleBeamXWaveAmplitude(0.0)
, x2e0_grappleBeamZWaveAmplitude(0.0) , mGrappleBeamZWaveAmplitude(0.0)
, x2e4_grappleBeamAnglePhaseDelta(0.0) { , mGrappleBeamAnglePhaseDelta(0.0) {
int i; int i;
for (i = 0; i < ARRAY_SIZE(x4_maxTranslationalAcceleration); ++i) { for (i = 0; i < ARRAY_SIZE(mMaxTranslationalAcceleration); ++i) {
x4_maxTranslationalAcceleration[i] = in.ReadFloat(); mMaxTranslationalAcceleration[i] = in.ReadFloat();
} }
for (i = 0; i < ARRAY_SIZE(x24_maxRotationalAcceleration); ++i) { for (i = 0; i < ARRAY_SIZE(mMaxRotationalAcceleration); ++i) {
x24_maxRotationalAcceleration[i] = in.ReadFloat(); mMaxRotationalAcceleration[i] = in.ReadFloat();
} }
for (i = 0; i < ARRAY_SIZE(x44_translationFriction); ++i) { for (i = 0; i < ARRAY_SIZE(mTranslationFriction); ++i) {
x44_translationFriction[i] = in.ReadFloat(); mTranslationFriction[i] = in.ReadFloat();
} }
for (i = 0; i < ARRAY_SIZE(x64_rotationFriction); ++i) { for (i = 0; i < ARRAY_SIZE(mRotationFriction); ++i) {
x64_rotationFriction[i] = in.ReadFloat(); mRotationFriction[i] = in.ReadFloat();
} }
for (i = 0; i < ARRAY_SIZE(x84_rotationMaxSpeed); ++i) { for (i = 0; i < ARRAY_SIZE(mRotationMaxSpeed); ++i) {
x84_rotationMaxSpeed[i] = in.ReadFloat(); mRotationMaxSpeed[i] = in.ReadFloat();
} }
for (i = 0; i < ARRAY_SIZE(xa4_translationMaxSpeed); ++i) { for (i = 0; i < ARRAY_SIZE(mTranslationMaxSpeed); ++i) {
xa4_translationMaxSpeed[i] = in.ReadFloat(); mTranslationMaxSpeed[i] = in.ReadFloat();
} }
xc4_normalGravAccel = in.ReadFloat(); mNormalGravAccel = in.ReadFloat();
xc8_fluidGravAccel = in.ReadFloat(); mFluidGravAccel = in.ReadFloat();
xcc_verticalJumpAccel = in.ReadFloat(); mVerticalJumpAccel = in.ReadFloat();
xd0_horizontalJumpAccel = in.ReadFloat(); mHorizontalJumpAccel = in.ReadFloat();
xd4_verticalDoubleJumpAccel = in.ReadFloat(); mVerticalDoubleJumpAccel = in.ReadFloat();
xd8_horizontalDoubleJumpAccel = in.ReadFloat(); mHorizontalDoubleJumpAccel = in.ReadFloat();
xdc_waterJumpFactor = in.ReadFloat(); mWaterJumpFactor = in.ReadFloat();
xe0_waterBallJumpFactor = in.ReadFloat(); mWaterBallJumpFactor = in.ReadFloat();
xe4_lavaJumpFactor = in.ReadFloat(); mLavaJumpFactor = in.ReadFloat();
xe8_lavaBallJumpFactor = in.ReadFloat(); mLavaBallJumpFactor = in.ReadFloat();
xec_phazonJumpFactor = in.ReadFloat(); mPhazonJumpFactor = in.ReadFloat();
xf0_phazonBallJumpFactor = in.ReadFloat(); mPhazonBallJumpFactor = in.ReadFloat();
xf4_allowedJumpTime = in.ReadFloat(); mAllowedJumpTime = in.ReadFloat();
xf8_allowedDoubleJumpTime = in.ReadFloat(); mAllowedDoubleJumpTime = in.ReadFloat();
xfc_minDoubleJumpWindow = in.ReadFloat(); mMinDoubleJumpWindow = in.ReadFloat();
x100_maxDoubleJumpWindow = in.ReadFloat(); mMaxDoubleJumpWindow = in.ReadFloat();
x104_ = in.ReadFloat(); x104_ = in.ReadFloat();
x108_minJumpTime = in.ReadFloat(); mMinJumpTime = in.ReadFloat();
x10c_minDoubleJumpTime = in.ReadFloat(); mMinDoubleJumpTime = in.ReadFloat();
x110_allowedLedgeTime = in.ReadFloat(); mAllowedLedgeTime = in.ReadFloat();
x114_doubleJumpImpulse = in.ReadFloat(); mDoubleJumpImpulse = in.ReadFloat();
x118_backwardsForceMultiplier = in.ReadFloat(); mBackwardsForceMultiplier = in.ReadFloat();
x11c_bombJumpRadius = in.ReadFloat(); mBombJumpRadius = in.ReadFloat();
x120_bombJumpHeight = in.ReadFloat(); mBombJumpHeight = in.ReadFloat();
x124_eyeOffset = in.ReadFloat(); mEyeOffset = in.ReadFloat();
x128_turnSpeedMultiplier = in.ReadFloat(); mTurnSpeedMultiplier = in.ReadFloat();
x12c_freeLookTurnSpeedMultiplier = in.ReadFloat(); mFreeLookTurnSpeedMultiplier = in.ReadFloat();
x130_horizontalFreeLookAngleVel = in.ReadFloat() * (M_PIF / 180.f); mHorizontalFreeLookAngleVel = in.ReadFloat() * (M_PIF / 180.f);
x134_verticalFreeLookAngleVel = in.ReadFloat() * (M_PIF / 180.f); mVerticalFreeLookAngleVel = in.ReadFloat() * (M_PIF / 180.f);
x138_freeLookSpeed = in.ReadFloat() * (M_PIF / 180.f); mFreeLookSpeed = in.ReadFloat() * (M_PIF / 180.f);
x13c_freeLookSnapSpeed = in.ReadFloat() * (M_PIF / 180.f); mFreeLookSnapSpeed = in.ReadFloat() * (M_PIF / 180.f);
x140_ = in.ReadFloat() * (M_PIF / 180.f); x140_ = in.ReadFloat() * (M_PIF / 180.f);
x144_freeLookCenteredThresholdAngle = in.ReadFloat() * (M_PIF / 180.f); mFreeLookCenteredThresholdAngle = in.ReadFloat() * (M_PIF / 180.f);
x148_freeLookCenteredTime = in.ReadFloat(); mFreeLookCenteredTime = in.ReadFloat();
x14c_freeLookDampenFactor = in.ReadFloat(); mFreeLookDampenFactor = in.ReadFloat();
x150_leftDiv = in.ReadFloat(); mLeftDiv = in.ReadFloat();
x154_rightDiv = in.ReadFloat(); mRightDiv = in.ReadFloat();
x228_24_freelookTurnsPlayer = in.ReadBool(); mFreelookTurnsPlayer = in.ReadBool();
x228_25_ = in.ReadBool(); x228_25_ = in.ReadBool();
x228_26_ = in.ReadBool(); x228_26_ = in.ReadBool();
x228_27_moveDuringFreeLook = in.ReadBool(); mMoveDuringFreeLook = in.ReadBool();
x228_28_holdButtonsForFreeLook = in.ReadBool(); mHoldButtonsForFreeLook = in.ReadBool();
x228_29_twoButtonsForFreeLook = in.ReadBool(); mTwoButtonsForFreeLook = in.ReadBool();
x228_30_ = in.ReadBool(); x228_30_ = in.ReadBool();
x228_31_ = in.ReadBool(); x228_31_ = in.ReadBool();
x229_24_ = in.ReadBool(); x229_24_ = in.ReadBool();
x229_25_aimWhenOrbitingPoint = in.ReadBool(); mAimWhenOrbitingPoint = in.ReadBool();
x229_26_stayInFreeLookWhileFiring = in.ReadBool(); mStayInFreeLookWhileFiring = in.ReadBool();
x229_27_ = in.ReadBool(); x229_27_ = in.ReadBool();
x229_28_ = in.ReadBool(); x229_28_ = in.ReadBool();
x229_29_orbitFixedOffset = in.ReadBool(); mOrbitFixedOffset = in.ReadBool();
x229_30_gunButtonTogglesHolster = in.ReadBool(); mGunButtonTogglesHolster = in.ReadBool();
x229_31_gunNotFiringHolstersGun = in.ReadBool(); mGunNotFiringHolstersGun = in.ReadBool();
x22a_24_fallingDoubleJump = in.ReadBool(); mFallingDoubleJump = in.ReadBool();
x22a_25_impulseDoubleJump = in.ReadBool(); mImpulseDoubleJump = in.ReadBool();
x22a_26_firingCancelsCameraPitch = in.ReadBool(); mFiringCancelsCameraPitch = in.ReadBool();
x22a_27_assistedAimingIgnoreHorizontal = in.ReadBool(); mAssistedAimingIgnoreHorizontal = in.ReadBool();
x22a_28_assistedAimingIgnoreVertical = in.ReadBool(); mAssistedAimingIgnoreVertical = in.ReadBool();
x22c_ = in.ReadFloat(); x22c_ = in.ReadFloat();
x230_ = in.ReadFloat(); x230_ = in.ReadFloat();
x234_aimMaxDistance = in.ReadFloat(); mAimMaxDistance = in.ReadFloat();
x238_ = in.ReadFloat() * (M_PIF / 180.f); x238_ = in.ReadFloat() * (M_PIF / 180.f);
x23c_ = in.ReadFloat() * (M_PIF / 180.f); x23c_ = in.ReadFloat() * (M_PIF / 180.f);
x240_ = in.ReadFloat() * (M_PIF / 180.f); x240_ = in.ReadFloat() * (M_PIF / 180.f);
x244_ = in.ReadFloat() * (M_PIF / 180.f); x244_ = in.ReadFloat() * (M_PIF / 180.f);
x248_ = in.ReadFloat() * (M_PIF / 180.f); x248_ = in.ReadFloat() * (M_PIF / 180.f);
x24c_aimThresholdDistance = in.ReadFloat(); mAimThresholdDistance = in.ReadFloat();
x250_ = in.ReadFloat() * (M_PIF / 180.f); x250_ = in.ReadFloat() * (M_PIF / 180.f);
x254_ = in.ReadFloat(); x254_ = in.ReadFloat();
x258_aimBoxWidth = in.ReadFloat(); mAimBoxWidth = in.ReadFloat();
x25c_aimBoxHeight = in.ReadFloat(); mAimBoxHeight = in.ReadFloat();
x260_aimTargetTimer = in.ReadFloat(); mAimTargetTimer = in.ReadFloat();
x264_aimAssistHorizontalAngle = in.ReadFloat() * (M_PIF / 180.f); mAimAssistHorizontalAngle = in.ReadFloat() * (M_PIF / 180.f);
x268_aimAssistVerticalAngle = in.ReadFloat() * (M_PIF / 180.f); mAimAssistVerticalAngle = in.ReadFloat() * (M_PIF / 180.f);
for (i = 0; i < 3; ++i) { for (i = 0; i < 3; ++i) {
x158_orbitMinDistance[i] = in.ReadFloat(); mOrbitMinDistance[i] = in.ReadFloat();
x164_orbitNormalDistance[i] = in.ReadFloat(); mOrbitNormalDistance[i] = in.ReadFloat();
x170_orbitMaxDistance[i] = in.ReadFloat(); mOrbitMaxDistance[i] = in.ReadFloat();
} }
x17c_ = in.ReadFloat() * (M_PIF / 180.f); x17c_ = in.ReadFloat() * (M_PIF / 180.f);
x180_orbitModeTimer = in.ReadFloat(); mOrbitModeTimer = in.ReadFloat();
x184_orbitCameraSpeed = in.ReadFloat() * (M_PIF / 180.f); mOrbitCameraSpeed = in.ReadFloat() * (M_PIF / 180.f);
x188_orbitUpperAngle = in.ReadFloat() * (M_PIF / 180.f); mOrbitUpperAngle = in.ReadFloat() * (M_PIF / 180.f);
x18c_orbitLowerAngle = in.ReadFloat() * (M_PIF / 180.f); mOrbitLowerAngle = in.ReadFloat() * (M_PIF / 180.f);
x190_orbitHorizAngle = in.ReadFloat() * (M_PIF / 180.f); mOrbitHorizAngle = in.ReadFloat() * (M_PIF / 180.f);
x194_ = in.ReadFloat() * (M_PIF / 180.f); x194_ = in.ReadFloat() * (M_PIF / 180.f);
x198_ = in.ReadFloat() * (M_PIF / 180.f); x198_ = in.ReadFloat() * (M_PIF / 180.f);
x19c_orbitMaxTargetDistance = in.ReadFloat(); mOrbitMaxTargetDistance = in.ReadFloat();
x1a0_orbitMaxLockDistance = in.ReadFloat(); mOrbitMaxLockDistance = in.ReadFloat();
x1a4_orbitDistanceThreshold = in.ReadFloat(); mOrbitDistanceThreshold = in.ReadFloat();
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
x1a8_orbitScreenBoxHalfExtentX[i] = in.ReadLong(); mOrbitScreenBoxHalfExtentX[i] = in.ReadLong();
x1b0_orbitScreenBoxHalfExtentY[i] = in.ReadLong(); mOrbitScreenBoxHalfExtentY[i] = in.ReadLong();
x1b8_orbitScreenBoxCenterX[i] = in.ReadLong(); mOrbitScreenBoxCenterX[i] = in.ReadLong();
x1c0_orbitScreenBoxCenterY[i] = in.ReadLong(); mOrbitScreenBoxCenterY[i] = in.ReadLong();
x1c8_orbitZoneIdealX[i] = in.ReadLong(); mOrbitZoneIdealX[i] = in.ReadLong();
x1d0_orbitZoneIdealY[i] = in.ReadLong(); mOrbitZoneIdealY[i] = in.ReadLong();
} }
x1d8_orbitNearX = in.ReadFloat(); mOrbitNearX = in.ReadFloat();
x1dc_orbitNearZ = in.ReadFloat(); mOrbitNearZ = in.ReadFloat();
x1e0_ = in.ReadFloat(); x1e0_ = in.ReadFloat();
x1e4_ = in.ReadFloat(); x1e4_ = in.ReadFloat();
x1e8_orbitFixedOffsetZDiff = in.ReadFloat(); mOrbitFixedOffsetZDiff = in.ReadFloat();
x1ec_orbitZRange = in.ReadFloat(); mOrbitZRange = in.ReadFloat();
x1f0_ = in.ReadFloat() * (M_PIF / 180.f); x1f0_ = in.ReadFloat() * (M_PIF / 180.f);
x1f4_ = in.ReadFloat() * (M_PIF / 180.f); x1f4_ = in.ReadFloat() * (M_PIF / 180.f);
x1f8_ = in.ReadFloat(); x1f8_ = in.ReadFloat();
x1fc_orbitPreventionTime = in.ReadFloat(); mOrbitPreventionTime = in.ReadFloat();
x200_24_dashEnabled = in.ReadBool(); mDashEnabled = in.ReadBool();
x200_25_dashOnButtonRelease = in.ReadBool(); mDashOnButtonRelease = in.ReadBool();
x204_dashButtonHoldCancelTime = in.ReadFloat(); mDashButtonHoldCancelTime = in.ReadFloat();
x208_dashStrafeInputThreshold = in.ReadFloat(); mDashStrafeInputThreshold = in.ReadFloat();
x20c_sidewaysDoubleJumpImpulse = in.ReadFloat(); mSidewaysDoubleJumpImpulse = in.ReadFloat();
x210_sidewaysVerticalDoubleJumpAccel = in.ReadFloat(); mSidewaysVerticalDoubleJumpAccel = in.ReadFloat();
x214_sidewaysHorizontalDoubleJumpAccel = in.ReadFloat(); mSidewaysHorizontalDoubleJumpAccel = in.ReadFloat();
x218_scanningRange = in.ReadFloat(); mScanningRange = in.ReadFloat();
x21c_24_scanRetention = in.ReadBool(); mScanRetention = in.ReadBool();
x21c_25_scanFreezesGame = in.ReadBool(); mScanFreezesGame = in.ReadBool();
x21c_26_orbitWhileScanning = in.ReadBool(); mOrbitWhileScanning = in.ReadBool();
x220_scanMaxTargetDistance = in.ReadFloat(); mScanMaxTargetDistance = in.ReadFloat();
x224_scanMaxLockDistance = in.ReadFloat(); mScanMaxLockDistance = in.ReadFloat();
x2a0_orbitDistanceMax = in.ReadFloat(); mOrbitDistanceMax = in.ReadFloat();
x2a4_grappleSwingLength = in.ReadFloat(); mGrappleSwingLength = in.ReadFloat();
x2a8_grappleSwingPeriod = in.ReadFloat(); mGrappleSwingPeriod = in.ReadFloat();
x2ac_grapplePullSpeedMin = in.ReadFloat(); mGrapplePullSpeedMin = in.ReadFloat();
x2b0_grappleCameraSpeed = in.ReadFloat() * (M_PIF / 180.f); mGrappleCameraSpeed = in.ReadFloat() * (M_PIF / 180.f);
x2b4_maxGrappleLockedTurnAlignDistance = in.ReadFloat(); mMaxGrappleLockedTurnAlignDistance = in.ReadFloat();
x2b8_grapplePullSpeedProportion = in.ReadFloat(); mGrapplePullSpeedProportion = in.ReadFloat();
x2bc_grapplePullSpeedMax = in.ReadFloat(); mGrapplePullSpeedMax = in.ReadFloat();
x2c0_grappleLookCenterSpeed = in.ReadFloat() * (M_PIF / 180.f); mGrappleLookCenterSpeed = in.ReadFloat() * (M_PIF / 180.f);
x2c4_maxGrappleTurnSpeed = in.ReadFloat(); mMaxGrappleTurnSpeed = in.ReadFloat();
x2c8_grappleJumpForce = in.ReadFloat(); mGrappleJumpForce = in.ReadFloat();
x2cc_grappleReleaseTime = in.ReadFloat(); mGrappleReleaseTime = in.ReadFloat();
x2d0_grappleJumpMode = in.ReadLong(); mGrappleJumpMode = in.ReadLong();
x2d4_orbitReleaseBreaksGrapple = in.ReadBool(); mOrbitReleaseBreaksGrapple = in.ReadBool();
x2d5_invertGrappleTurn = in.ReadBool(); mInvertGrappleTurn = in.ReadBool();
x2d8_grappleBeamSpeed = in.ReadFloat(); mGrappleBeamSpeed = in.ReadFloat();
x2dc_grappleBeamXWaveAmplitude = in.ReadFloat(); mGrappleBeamXWaveAmplitude = in.ReadFloat();
x2e0_grappleBeamZWaveAmplitude = in.ReadFloat(); mGrappleBeamZWaveAmplitude = in.ReadFloat();
x2e4_grappleBeamAnglePhaseDelta = in.ReadFloat(); mGrappleBeamAnglePhaseDelta = in.ReadFloat();
x26c_playerHeight = in.ReadFloat(); mPlayerHeight = in.ReadFloat();
x270_playerXYHalfExtent = in.ReadFloat(); mPlayerXYHalfExtent = in.ReadFloat();
x274_stepUpHeight = in.ReadFloat(); mStepUpHeight = in.ReadFloat();
x278_stepDownHeight = in.ReadFloat(); mStepDownHeight = in.ReadFloat();
x27c_playerBallHalfExtent = in.ReadFloat(); mPlayerBallHalfExtent = in.ReadFloat();
x280_firstPersonCameraSpeed = in.ReadFloat() * (M_PIF / 180.f); mFirstPersonCameraSpeed = in.ReadFloat() * (M_PIF / 180.f);
x284_ = in.ReadFloat() * (M_PIF / 180.f); x284_ = in.ReadFloat() * (M_PIF / 180.f);
x288_jumpCameraPitchDownStart = in.ReadFloat(); mJumpCameraPitchDownStart = in.ReadFloat();
x28c_jumpCameraPitchDownFull = in.ReadFloat(); mJumpCameraPitchDownFull = in.ReadFloat();
x290_jumpCameraPitchDownAngle = in.ReadFloat() * (M_PIF / 180.f); mJumpCameraPitchDownAngle = in.ReadFloat() * (M_PIF / 180.f);
x294_fallCameraPitchDownStart = in.ReadFloat(); mFallCameraPitchDownStart = in.ReadFloat();
x298_fallCameraPitchDownFull = in.ReadFloat(); mFallCameraPitchDownFull = in.ReadFloat();
x29c_fallCameraPitchDownAngle = in.ReadFloat() * (M_PIF / 180.f); mFallCameraPitchDownAngle = in.ReadFloat() * (M_PIF / 180.f);
x2e8_ = in.ReadFloat(); x2e8_ = in.ReadFloat();
x2ec_ = in.ReadFloat(); x2ec_ = in.ReadFloat();
x2f0_ = in.ReadFloat(); x2f0_ = in.ReadFloat();
x2f4_ = in.ReadBool(); x2f4_ = in.ReadBool();
x2f8_frozenTimeout = in.ReadFloat(); mFrozenTimeout = in.ReadFloat();
x2fc_iceBreakJumpCount = in.ReadLong(); mIceBreakJumpCount = in.ReadLong();
x300_variaDamageReduction = in.ReadFloat(); mVariaDamageReduction = in.ReadFloat();
x304_gravityDamageReduction = in.ReadFloat(); mGravityDamageReduction = in.ReadFloat();
x308_phazonDamageReduction = in.ReadFloat(); mPhazonDamageReduction = in.ReadFloat();
} }

View File

@ -110,7 +110,7 @@ void CElectricBeamProjectile::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueI
CStateManager& mgr) { CStateManager& mgr) {
switch (msg) { switch (msg) {
case kSM_Registered: case kSM_Registered:
mgr.AddWeaponId(GetOwnerId(), GetWeaponType()); mgr.AddWeaponId(GetOwnerId(), GetType());
CauseDamage(true); CauseDamage(true);
break; break;
case kSM_Deleted: case kSM_Deleted:

View File

@ -400,11 +400,11 @@ void CGunWeapon::Fire(bool underwater, float dt, CPlayerState::EChargeStage char
uint particleChargeAttribs = 0; uint particleChargeAttribs = 0;
if (partialCharge) if (partialCharge)
particleChargeAttribs = kPA_PartialCharge; particleChargeAttribs = CWeapon::kPA_PartialCharge;
uint attribs = kPA_ArmCannon; uint attribs = CWeapon::kPA_ArmCannon;
if (chargeState != CPlayerState::kCS_Normal) if (chargeState != CPlayerState::kCS_Normal)
attribs = kPA_ArmCannon | kPA_Charged; attribs = CWeapon::kPA_ArmCannon | CWeapon::kPA_Charged;
CEnergyProjectile* proj = rs_new CEnergyProjectile( CEnergyProjectile* proj = rs_new CEnergyProjectile(
true, x144_weapons[chargeState], x1c0_weaponType, xf, x1c8_playerMaterial, dInfo, true, x144_weapons[chargeState], x1c0_weaponType, xf, x1c8_playerMaterial, dInfo,
@ -418,7 +418,7 @@ void CGunWeapon::Fire(bool underwater, float dt, CPlayerState::EChargeStage char
if (chargeState != CPlayerState::kCS_Normal) { if (chargeState != CPlayerState::kCS_Normal) {
x218_25_enableCharge = true; x218_25_enableCharge = true;
mgr.CameraManager()->AddCameraShaker(CCameraShakeData::skChargedShotCameraShakeData, false); mgr.CameraManager()->AddCameraShaker(CCameraShakeData::skHardRecoil, false);
} }
x10_solidModelData->AnimationData()->EnableLooping(false); x10_solidModelData->AnimationData()->EnableLooping(false);

View File

@ -18,7 +18,7 @@ CPowerBomb::CPowerBomb(TToken< CGenDescription > particle, TUniqueId uid, TAreaI
: CWeapon(uid, aid, true, playerId, kWT_PowerBomb, rstl::string_l("PowerBomb"), xf, : CWeapon(uid, aid, true, playerId, kWT_PowerBomb, rstl::string_l("PowerBomb"), xf,
CMaterialFilter::MakeIncludeExclude(CMaterialList(kMT_Trigger, kMT_Immovable, kMT_Solid), CMaterialFilter::MakeIncludeExclude(CMaterialList(kMT_Trigger, kMT_Immovable, kMT_Solid),
CMaterialList(kMT_Projectile, kMT_PowerBomb)), CMaterialList(kMT_Projectile, kMT_PowerBomb)),
CMaterialList(kMT_Projectile, kMT_PowerBomb), dInfo, kPA_PowerBombs, CMaterialList(kMT_Projectile, kMT_PowerBomb), dInfo, CWeapon::kPA_PowerBombs,
CModelData::CModelDataNull()) CModelData::CModelDataNull())
, x158_24_canStartFilter(true) , x158_24_canStartFilter(true)
@ -98,7 +98,7 @@ void CPowerBomb::Accept(IVisitor& visitor) { visitor.Visit(*this); }
void CPowerBomb::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { void CPowerBomb::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
switch (msg) { switch (msg) {
case kSM_Registered: case kSM_Registered:
mgr.AddWeaponId(GetOwnerId(), GetWeaponType()); mgr.AddWeaponId(GetOwnerId(), GetType());
OrigDamageInfo().SetRadius(0.f); OrigDamageInfo().SetRadius(0.f);
if (mgr.GetPlayerState()->IsAlive()) { if (mgr.GetPlayerState()->IsAlive()) {
CSfxManager::AddEmitter(SFXsfx0710, GetTranslation(), CVector3f::Zero(), true, false); CSfxManager::AddEmitter(SFXsfx0710, GetTranslation(), CVector3f::Zero(), true, false);
@ -113,7 +113,7 @@ void CPowerBomb::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
if (x15c_curTime <= 7.0f) { if (x15c_curTime <= 7.0f) {
mgr.CameraFilterPass(CStateManager::kCFS_Six).DisableFilter(0.f); mgr.CameraFilterPass(CStateManager::kCFS_Six).DisableFilter(0.f);
} }
mgr.RemoveWeaponId(GetOwnerId(), GetWeaponType()); mgr.RemoveWeaponId(GetOwnerId(), GetType());
break; break;
default: default:

View File

@ -12,7 +12,7 @@ CTargetableProjectile::CTargetableProjectile(
const rstl::optional_object< TLockedToken< CGenDescription > >& visorParticle, ushort visorSfx, const rstl::optional_object< TLockedToken< CGenDescription > >& visorParticle, ushort visorSfx,
bool sendCollideMsg) bool sendCollideMsg)
: CEnergyProjectile(true, desc, type, xf, materials, damage, uid, aid, owner, homingTarget, : CEnergyProjectile(true, desc, type, xf, materials, damage, uid, aid, owner, homingTarget,
attribs | kPA_BigProjectile | kPA_PartialCharge | kPA_PlasmaProjectile, false, attribs | CWeapon::kPA_BigProjectile | CWeapon::kPA_PartialCharge | CWeapon::kPA_PlasmaProjectile, false,
CVector3f(1.f, 1.f, 1.f), visorParticle, visorSfx, sendCollideMsg) CVector3f(1.f, 1.f, 1.f), visorParticle, visorSfx, sendCollideMsg)
, x3d8_weaponDesc(weapDesc) , x3d8_weaponDesc(weapDesc)
, x3e0_damage(damage2) { , x3e0_damage(damage2) {
@ -36,10 +36,10 @@ bool CTargetableProjectile::Explode(const CVector3f& pos, const CVector3f& norma
CVector3f aimPosition = act->GetAimPosition(mgr, 0.f); CVector3f aimPosition = act->GetAimPosition(mgr, 0.f);
CEnergyProjectile* projectile = rs_new CEnergyProjectile( CEnergyProjectile* projectile = rs_new CEnergyProjectile(
true, x3d8_weaponDesc, GetWeaponType(), true, x3d8_weaponDesc, GetType(),
CTransform4f::LookAt(x170_projectile.GetTranslation(), aimPosition, CVector3f::Up()), CTransform4f::LookAt(x170_projectile.GetTranslation(), aimPosition, CVector3f::Up()),
kMT_Player, x3e0_damage, uid, GetCurrentAreaId(), GetHitProjectileOwner(), GetOwnerId(), kMT_Player, x3e0_damage, uid, GetCurrentAreaId(), GetHitProjectileOwner(), GetOwnerId(),
kPA_None, false, CVector3f(1.f, 1.f, 1.f), rstl::optional_object_null(), CWeapon::kPA_None, false, CVector3f(1.f, 1.f, 1.f), rstl::optional_object_null(),
CSfxManager::kInternalInvalidSfxId, false); CSfxManager::kInternalInvalidSfxId, false);
mgr.AddObject(projectile); mgr.AddObject(projectile);
projectile->AddMaterial(kMT_Orbit, mgr); projectile->AddMaterial(kMT_Orbit, mgr);

View File

@ -102,9 +102,9 @@ void CWaveBeam::Fire(bool underwater, float dt, CPlayerState::EChargeStage charg
CTransform4f shotXf = CTransform4f shotXf =
xf * CTransform4f::RotateY(CRelAngle::FromDegrees((randAng + i) * skShotAnglePitch)); xf * CTransform4f::RotateY(CRelAngle::FromDegrees((randAng + i) * skShotAnglePitch));
CEnergyProjectile* proj = rs_new CEnergyProjectile( CEnergyProjectile* proj = rs_new CEnergyProjectile(
true, x144_weapons[chargeState], GetWeaponType(), shotXf, GetPlayerMaterial(), true, x144_weapons[chargeState], GetType(), shotXf, GetPlayerMaterial(),
GetDamageInfo(mgr, chargeState, chargeFactor1), mgr.AllocateUniqueId(), kInvalidAreaId, GetDamageInfo(mgr, chargeState, chargeFactor1), mgr.AllocateUniqueId(), kInvalidAreaId,
GetPlayerId(), homingTarget, kPA_ArmCannon, underwater, CVector3f(1.f, 1.f, 1.f), GetPlayerId(), homingTarget, CWeapon::kPA_ArmCannon, underwater, CVector3f(1.f, 1.f, 1.f),
rstl::optional_object_null(), CSfxManager::kInternalInvalidSfxId, false); rstl::optional_object_null(), CSfxManager::kInternalInvalidSfxId, false);
mgr.AddObject(proj); mgr.AddObject(proj);
proj->Think(dt, mgr); proj->Think(dt, mgr);

View File

@ -9,7 +9,7 @@
CWeapon::CWeapon(TUniqueId uid, TAreaId areaId, bool active, TUniqueId owner, EWeaponType type, CWeapon::CWeapon(TUniqueId uid, TAreaId areaId, bool active, TUniqueId owner, EWeaponType type,
const rstl::string& name, const CTransform4f& xf, const CMaterialFilter& filter, const rstl::string& name, const CTransform4f& xf, const CMaterialFilter& filter,
const CMaterialList& mList, const CDamageInfo& dInfo, EProjectileAttrib attribs, const CMaterialList& mList, const CDamageInfo& dInfo, int attribs,
const CModelData& mData) const CModelData& mData)
: CActor(uid, active, name, CEntityInfo(areaId, CEntity::NullConnectionList), xf, mData, mList, : CActor(uid, active, name, CEntityInfo(areaId, CEntity::NullConnectionList), xf, mData, mList,
CActorParameters::None().HotInThermal(true), kInvalidUniqueId) CActorParameters::None().HotInThermal(true), kInvalidUniqueId)
@ -34,14 +34,15 @@ void CWeapon::SetDamageFalloffSpeed(float speed) {
void CWeapon::Think(float dt, CStateManager& mgr) { void CWeapon::Think(float dt, CStateManager& mgr) {
x148_curTime += dt; x148_curTime += dt;
if ((xe8_projectileAttribs & kPA_DamageFalloff) == kPA_DamageFalloff) { if ((xe8_projectileAttribs & CWeapon::kPA_DamageFalloff) == CWeapon::kPA_DamageFalloff) {
float max = 1.f - x148_curTime * x14c_damageFalloffSpeed; float max = 1.f - x148_curTime * x14c_damageFalloffSpeed;
float scale = CMath::Max(0.f, max); float scale = CMath::Max(0.f, max);
float damage = scale * x110_origDamageInfo.GetDamage(); float damage = scale * x110_origDamageInfo.GetDamage();
float radius = scale * x110_origDamageInfo.GetRadius(); float radius = scale * x110_origDamageInfo.GetRadius();
float knockback = scale * x110_origDamageInfo.GetKnockBackPower(); float knockback = scale * x110_origDamageInfo.GetKnockBackPower();
x12c_curDamageInfo = x12c_curDamageInfo =
CDamageInfo(x110_origDamageInfo.GetWeaponMode(), damage, (double)(scale * x110_origDamageInfo.GetDamage()), radius, knockback); CDamageInfo(x110_origDamageInfo.GetWeaponMode(), damage,
(double)(scale * x110_origDamageInfo.GetDamage()), radius, knockback);
} else { } else {
x12c_curDamageInfo = x110_origDamageInfo; x12c_curDamageInfo = x110_origDamageInfo;
} }
@ -75,11 +76,11 @@ void CWeapon::FluidFXThink(EFluidState state, CScriptWater& water, CStateManager
break; break;
} }
if ((xe8_projectileAttribs & kPA_ComboShot) != 0 && state != kFS_InFluid) { if ((xe8_projectileAttribs & CWeapon::kPA_ComboShot) != 0 && state != kFS_InFluid) {
mag += 0.5f; mag += 0.5f;
} }
if ((xe8_projectileAttribs & kPA_Charged) != 0) { if ((xe8_projectileAttribs & CWeapon::kPA_Charged) != 0) {
mag += 0.25f; mag += 0.25f;
} }
@ -89,7 +90,7 @@ void CWeapon::FluidFXThink(EFluidState state, CScriptWater& water, CStateManager
if (doRipple) { if (doRipple) {
CVector3f pos(GetTranslation().GetX(), GetTranslation().GetY(), water.GetSurfaceZ()); CVector3f pos(GetTranslation().GetX(), GetTranslation().GetY(), water.GetSurfaceZ());
if ((xe8_projectileAttribs & kPA_ComboShot) != 0) { if ((xe8_projectileAttribs & CWeapon::kPA_ComboShot) != 0) {
if (!water.CanRippleAtPoint(pos)) { if (!water.CanRippleAtPoint(pos)) {
doRipple = false; doRipple = false;
} }

View File

@ -49,7 +49,7 @@
#include "MetroidPrime/Player/CGameOptions.hpp" #include "MetroidPrime/Player/CGameOptions.hpp"
#include "MetroidPrime/Player/CGameState.hpp" #include "MetroidPrime/Player/CGameState.hpp"
#include "MetroidPrime/Player/CPlayerState.hpp" #include "MetroidPrime/Player/CPlayerState.hpp"
#include "MetroidPrime/Player/CSystemOptions.hpp" #include "MetroidPrime/Player/CSystemState.hpp"
#include "MetroidPrime/ScriptObjects/CScriptMazeNode.hpp" #include "MetroidPrime/ScriptObjects/CScriptMazeNode.hpp"
#include "MetroidPrime/Tweaks/CTweakGame.hpp" #include "MetroidPrime/Tweaks/CTweakGame.hpp"
#include "MetroidPrime/Tweaks/CTweakPlayer.hpp" #include "MetroidPrime/Tweaks/CTweakPlayer.hpp"
@ -306,19 +306,19 @@ CGameArchitectureSupport::~CGameArchitectureSupport() {
// 800044A4 // 800044A4
void CMain::StreamNewGameState(CInputStream& in, int saveIdx) { void CMain::StreamNewGameState(CInputStream& in, int saveIdx) {
bool hasFusion = gpGameState->SystemOptions().GetHasFusion(); bool hasFusion = gpGameState->SystemState().GetHasFusion();
x128_gameGlobalObjects->GameState() = nullptr; x128_gameGlobalObjects->GameState() = nullptr;
gpGameState = nullptr; gpGameState = nullptr;
x128_gameGlobalObjects->GameState() = rs_new CGameState(in, saveIdx); x128_gameGlobalObjects->GameState() = rs_new CGameState(in, saveIdx);
gpGameState = x128_gameGlobalObjects->GameState().get(); gpGameState = x128_gameGlobalObjects->GameState().get();
gpGameState->SystemOptions().SetHasFusion(hasFusion); gpGameState->SystemState().SetHasFusion(hasFusion);
gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemOptions().GetHasFusion()); gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemState().GetHasFusion());
gpGameState->HintOptions().SetHintNextTime(); gpGameState->HintOptions().SetHintNextTime();
} }
// 80004590 // 80004590
void CMain::RefreshGameState() { void CMain::RefreshGameState() {
CSystemOptions systemOptions = gpGameState->SystemOptions(); CSystemState systemState = gpGameState->SystemState();
uint saveIdx = gpGameState->SaveIdx(); uint saveIdx = gpGameState->SaveIdx();
u64 cardSerial = gpGameState->CardSerial(); u64 cardSerial = gpGameState->CardSerial();
rstl::vector< uchar > backupBuf = gpGameState->BackupBuf(); rstl::vector< uchar > backupBuf = gpGameState->BackupBuf();
@ -330,11 +330,11 @@ void CMain::RefreshGameState() {
x128_gameGlobalObjects->GameState() = rs_new CGameState(stream, saveIdx); x128_gameGlobalObjects->GameState() = rs_new CGameState(stream, saveIdx);
} }
gpGameState = x128_gameGlobalObjects->GameState().get(); gpGameState = x128_gameGlobalObjects->GameState().get();
gpGameState->SystemOptions() = systemOptions; gpGameState->SystemState() = systemState;
gpGameState->GameOptions() = gameOptions; gpGameState->GameOptions() = gameOptions;
gpGameState->GameOptions().EnsureOptions(); gpGameState->GameOptions().EnsureOptions();
gpGameState->CardSerial() = cardSerial; gpGameState->CardSerial() = cardSerial;
gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemOptions().GetHasFusion()); gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemState().GetHasFusion());
} }
// 8000487C // 8000487C
@ -548,16 +548,16 @@ void CMain::EnsureWorldPakReady(CAssetId id) {
// 800036A0 // 800036A0
void CMain::ResetGameState() { void CMain::ResetGameState() {
CSystemOptions persistentOptions = gpGameState->SystemOptions(); CSystemState systemState = gpGameState->SystemState();
CGameOptions gameOptions = gpGameState->GameOptions(); CGameOptions gameOptions = gpGameState->GameOptions();
x128_gameGlobalObjects->GameState() = nullptr; x128_gameGlobalObjects->GameState() = nullptr;
gpGameState = nullptr; gpGameState = nullptr;
x128_gameGlobalObjects->GameState() = rs_new CGameState(); x128_gameGlobalObjects->GameState() = rs_new CGameState();
gpGameState = x128_gameGlobalObjects->GameState().get(); gpGameState = x128_gameGlobalObjects->GameState().get();
gpGameState->SystemOptions() = persistentOptions; gpGameState->SystemState() = systemState;
gpGameState->GameOptions() = gameOptions; gpGameState->GameOptions() = gameOptions;
gpGameState->GameOptions().EnsureOptions(); gpGameState->GameOptions().EnsureOptions();
gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemOptions().GetHasFusion()); gpGameState->PlayerState()->SetIsFusionEnabled(gpGameState->SystemState().GetHasFusion());
} }
// 8000367C // 8000367C

View File

@ -101,10 +101,11 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Internal(const CAreaOctTree::Node
} }
case CAreaOctTree::Node::kTT_Leaf: { case CAreaOctTree::Node::kTT_Leaf: {
CAreaOctTree::TriListReference list = node.GetTriangleArray(); CAreaOctTree::TriListReference list = node.GetTriangleArray();
int size = list.GetSize();
const CAreaOctTree& owner = node.GetOwner(); const CAreaOctTree& owner = node.GetOwner();
const CMaterialFilter& filter = cache.x8_filter; const CMaterialFilter& filter = cache.x8_filter;
const CPlane* planes = cache.x4_planes; const CPlane* planes = cache.x4_planes;
for (int j = 0; j < list.GetSize(); ++j) { for (int j = 0; j < size; ++j) {
++gTrianglesProcessed; ++gTrianglesProcessed;
ushort triIdx = list.GetAt(j); ushort triIdx = list.GetAt(j);
if (sDupPrimitiveCheckCount == sDupTriangleList[triIdx]) { if (sDupPrimitiveCheckCount == sDupTriangleList[triIdx]) {
@ -119,9 +120,9 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Internal(const CAreaOctTree::Node
CAABox aabb = CAABox::MakeMaxInvertedBox(); CAABox aabb = CAABox::MakeMaxInvertedBox();
if (ConvexPolyCollision(planes, &surf.GetVert(0), aabb)) { if (ConvexPolyCollision(planes, &surf.GetVert(0), aabb)) {
CPlane plane = surf.GetPlane(); CPlane plane = surf.GetPlane();
CCollisionInfo collision(aabb, cache.xc_material, material, plane.GetNormal(), cache.x10_collisionList.Add(CCollisionInfo(aabb, cache.xc_material, material,
-plane.GetNormal()); plane.GetNormal(), -plane.GetNormal()),
cache.x10_collisionList.Add(collision, false); false);
ret = true; ret = true;
} }
} }
@ -147,12 +148,9 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Cached(const COctreeLeafCache& le
const CUnitVector3f forward(0.f, 1.f, 0.f, CUnitVector3f::kN_No); const CUnitVector3f forward(0.f, 1.f, 0.f, CUnitVector3f::kN_No);
const CUnitVector3f up(0.f, 0.f, 1.f, CUnitVector3f::kN_No); const CUnitVector3f up(0.f, 0.f, 1.f, CUnitVector3f::kN_No);
const CPlane planes[6] = { const CPlane planes[6] = {
CPlane(aabb.GetMinPoint(), right), CPlane(aabb.GetMinPoint(), right), CPlane(aabb.GetMaxPoint(), -right),
CPlane(aabb.GetMaxPoint(), -right), CPlane(aabb.GetMinPoint(), forward), CPlane(aabb.GetMaxPoint(), -forward),
CPlane(aabb.GetMinPoint(), forward), CPlane(aabb.GetMinPoint(), up), CPlane(aabb.GetMaxPoint(), -up),
CPlane(aabb.GetMaxPoint(), -forward),
CPlane(aabb.GetMinPoint(), up),
CPlane(aabb.GetMaxPoint(), -up),
}; };
ResetInternalCounters(); ResetInternalCounters();

View File

@ -19,10 +19,17 @@ _LITERAL_REPLACEMENTS = [
("zeus::lookAt", "CTransform4f::LookAt"), ("zeus::lookAt", "CTransform4f::LookAt"),
("zeus::radToDeg", "CMath::Rad2Deg"), ("zeus::radToDeg", "CMath::Rad2Deg"),
("zeus::degToRad", "CMath::Deg2Rad"), ("zeus::degToRad", "CMath::Deg2Rad"),
("zeus::skUp", "CVector3f::Up()"),
("zeus::skDown", "CVector3f::Down()"),
("zeus::skRight", "CVector3f::Right()"),
("zeus::skLeft", "CVector3f::Left()"),
("zeus::skForward", "CVector3f::Forward()"),
("zeus::skBack", "CVector3f::Back()"),
("zeus::", ""), ("zeus::", ""),
("u32 ", "uint "), ("u32 ", "uint "),
("s32 ", "int "), ("s32 ", "int "),
("u16 ", "ushort "), ("u16 ", "ushort "),
("char16_t", "wchar_t"),
("std::min(", "rstl::min_val("), ("std::min(", "rstl::min_val("),
("std::max(", "rstl::max_val("), ("std::max(", "rstl::max_val("),
@ -32,10 +39,16 @@ _LITERAL_REPLACEMENTS = [
("g_SimplePool", "gpSimplePool"), ("g_SimplePool", "gpSimplePool"),
("g_Renderer", "gpRender"), ("g_Renderer", "gpRender"),
("g_ResFactory", "gpResourceFactory"), ("g_ResFactory", "gpResourceFactory"),
("g_GameState", "gpGameState"),
("g_MainStringTable", "gpStringTable"),
# Vector # Vector
(".magnitude()", ".Magnitude()"), (".magnitude()", ".Magnitude()"),
(".normalized()", ".AsNormalized()"), (".normalized()", ".AsNormalized()"),
(".canBeNormalized()", ".CanBeNormalized()"),
(".normalize()", ".Normalize()"),
(".basis[1]", ".GetColumn(kDY)"),
# Transform # Transform
(".frontVector()", ".GetForward()"), (".frontVector()", ".GetForward()"),
@ -46,12 +59,24 @@ _LITERAL_REPLACEMENTS = [
("EMaterialTypes::", "kMT_"), ("EMaterialTypes::", "kMT_"),
("EScriptObjectState::", "kSS_"), ("EScriptObjectState::", "kSS_"),
("EScriptObjectMessage::", "kSM_"), ("EScriptObjectMessage::", "kSM_"),
("EPlayerOrbitState::", "CPlayer::kOS_"),
("ESurfaceRestraints::", "kSR_"),
("EPlayerCameraState::", "kCS_"),
("EPlayerMorphBallState::", "kMS_"),
("EPlayerOrbitType::", "kOT_"),
("EPlayerOrbitRequest::", "kOB_"),
("EPlayerZoneInfo::", "kZI_"),
("EPlayerZoneType::", "kZT_"),
("EPlayerScanState::", "kSS_"),
("EGrappleState::", "kGS_"),
("EFootstepSfx::", "kFS_"),
("EGunHolsterState::", "kGH_"),
("CPlayer::EPlayerOrbitState::", "CPlayer::kOS_"), ("CPlayer::EPlayerOrbitState::", "CPlayer::kOS_"),
("CPlayer::ESurfaceRestraints::", "CPlayer::kSR_"), ("CPlayer::ESurfaceRestraints::", "CPlayer::kSR_"),
("CPlayer::EPlayerCameraState::", "CPlayer::kCS_"), ("CPlayer::EPlayerCameraState::", "CPlayer::kCS_"),
("CPlayer::EPlayerMorphBallState::", "CPlayer::kMS_"), ("CPlayer::EPlayerMorphBallState::", "CPlayer::kMS_"),
("CPlayer::EPlayerOrbitType::", "CPlayer::kOT_"), ("CPlayer::EPlayerOrbitType::", "CPlayer::kOT_"),
("CPlayer::EPlayerOrbitRequest::", "CPlayer::kOR_"), ("CPlayer::EPlayerOrbitRequest::", "CPlayer::kOB_"),
("CPlayer::EPlayerZoneInfo::", "CPlayer::kZI_"), ("CPlayer::EPlayerZoneInfo::", "CPlayer::kZI_"),
("CPlayer::EPlayerZoneType::", "CPlayer::kZT_"), ("CPlayer::EPlayerZoneType::", "CPlayer::kZT_"),
("CPlayer::EPlayerScanState::", "CPlayer::kSS_"), ("CPlayer::EPlayerScanState::", "CPlayer::kSS_"),
@ -62,9 +87,51 @@ _LITERAL_REPLACEMENTS = [
("CPlayerState::EPlayerSuit::", "CPlayerState::kPS_"), ("CPlayerState::EPlayerSuit::", "CPlayerState::kPS_"),
("CPlayerState::EBeamId::", "CPlayerState::kBI_"), ("CPlayerState::EBeamId::", "CPlayerState::kBI_"),
("CPlayerState::EItemType::", "CPlayerState::kIT_"), ("CPlayerState::EItemType::", "CPlayerState::kIT_"),
("ControlMapper::ECommands::", "ControlMapper::kC_"),
("EFluidType::", "CFluidPlane::kFT_"),
("EPlayerMovementState::", "NPlayer::kMS_"),
("CMorphBall::ESpiderBallState::", "CMorphBall::kSBS_"),
("EProjectileAttrib::", "kPA_"),
("ERumbleFxId::", "kRFX_"),
("ERumblePriority::", "kRP_"),
# CActor
("x34_transform.origin", "GetTranslation()"),
("x34_transform", "GetTransform()"),
("xc4_fluidId", "InFluidId()"),
# CPhysicsActor
("x138_velocity", "GetVelocityWR()"),
# CPlayer
("SetOrbitRequest", "BreakOrbit"),
("ActivateMorphBallCamera", "ResetBallCamera"),
("ApplySubmergedPitchBend", "DoSfxEffects"),
# CCameraManager
("SetupBallCamera", "ResetCameraHint"),
# Math
("std::acos", "acosf"),
("std::fabs", "fabsf"),
("std::sqrt", "sqrtf"),
("clamp(", "CMath::Clamp("),
] ]
_RE_REPLACEMENTS = [ _RE_REPLACEMENTS = [
# SObjectTag{FOURCC('...'), ...} -> SObjectTag('...', ...)
(re.compile(r"SObjectTag{FOURCC\('(.*)'\),\s*(.*)}"), r"SObjectTag('\1', \2)"), (re.compile(r"SObjectTag{FOURCC\('(.*)'\),\s*(.*)}"), r"SObjectTag('\1', \2)"),
# const TCastToConstPtr<...> ... = ...) { -> const ...* = TCastToConstPtr<...>(...)) {
(re.compile(r"const TCastToConstPtr<([A-z0-9]+)> ([A-z0-9]+) = (.*)\) {"), r"const \1* \2 = TCastToConstPtr<\1>(\3)) {"),
# const TCastToConstPtr<...> ... = ...; -> const ...* = TCastToConstPtr<...>(...);
(re.compile(r"const TCastToConstPtr<([A-z0-9]+)> ([A-z0-9]+) = (.*);"), r"const \1* \2 = TCastToConstPtr<\1>(\3);"),
# g_tweakFoo->GetBar() -> gpTweakFoo->mBar
(re.compile(r"g_tweak([A-z0-9]+)->Get([A-z0-9]+)\(\)"), r"gpTweak\1->m\2"),
# vec.xyz() = ... -> vec.SetXYZ(...)
(re.compile(r"([A-z0-9]+)\.([xyz])\(\) = (.*);"), lambda m: f"{m.group(1)}.Set{m.group(2).upper()}({m.group(3)});"),
# vec.xyz() -> vec.GetXYZ()
(re.compile(r"\.([xyz])\(\)"), lambda m: f".Get{m.group(1).upper()}()"),
# lhs.dot(rhs) -> CVector3f::Dot(lhs, rhs)
(re.compile(r"([A-z0-9]+)\.dot\(([A-z0-9]+)\)([,;])"), r"CVector3f::Dot(\1, \2)\3"),
] ]