Link CPowerBomb

Former-commit-id: 4c907ad21fbc652e5720d37b4e9ea56c3d7723e2
This commit is contained in:
Luke Street 2023-10-11 22:21:41 -04:00
parent e4c947d2ad
commit 9a52da8ba6
9 changed files with 24 additions and 29 deletions

View File

@ -298,7 +298,7 @@ StartSamusVoiceSfx__7CPlayerFUssi = .text:0x80010C60; // type:function size:0xD0
PostUpdate__7CPlayerFfR13CStateManager = .text:0x80010D30; // type:function size:0x1D4 scope:global PostUpdate__7CPlayerFfR13CStateManager = .text:0x80010D30; // type:function size:0x1D4 scope:global
__ct__16CPlayerCameraBobFRC16CPlayerCameraBob = .text:0x80010F04; // type:function size:0x270 scope:global __ct__16CPlayerCameraBobFRC16CPlayerCameraBob = .text:0x80010F04; // type:function size:0x270 scope:global
SetPlayerHitWallDuringMove__7CPlayerFv = .text:0x80011174; // type:function size:0x18 scope:global SetPlayerHitWallDuringMove__7CPlayerFv = .text:0x80011174; // type:function size:0x18 scope:global
ApplySubmergedPitchBend__7CPlayerFR10CSfxHandle = .text:0x8001118C; // type:function size:0x48 scope:global DoSfxEffects__7CPlayerF10CSfxHandle = .text:0x8001118C; // type:function size:0x48 scope:global
UpdatePhazonDamage__7CPlayerFfR13CStateManager = .text:0x800111D4; // type:function size:0x578 scope:global UpdatePhazonDamage__7CPlayerFfR13CStateManager = .text:0x800111D4; // type:function size:0x578 scope:global
__dt__17CCollidableSphere = .text:0x8001174C; // type:function size:0x5C scope:global __dt__17CCollidableSphere = .text:0x8001174C; // type:function size:0x5C scope:global
__dt__19CCollisionPrimitiveFv = .text:0x800117A8; // type:function size:0x48 scope:global __dt__19CCollisionPrimitiveFv = .text:0x800117A8; // type:function size:0x48 scope:global
@ -17143,7 +17143,7 @@ lbl_803D014D = .rodata:0x803D014D; // type:object size:0xD data:string
lbl_803D015A = .rodata:0x803D015A; // type:object size:0x16 lbl_803D015A = .rodata:0x803D015A; // type:object size:0x16
lbl_803D0170 = .rodata:0x803D0170; // type:object size:0xF data:string lbl_803D0170 = .rodata:0x803D0170; // type:object size:0xF data:string
lbl_803D017F = .rodata:0x803D017F; // type:object size:0x21 lbl_803D017F = .rodata:0x803D017F; // type:object size:0x21
lbl_803D01A0 = .rodata:0x803D01A0; // type:object size:0x18 @stringBase0 = .rodata:0x803D01A0; // type:object size:0x11 scope:local data:string_table
lbl_803D01B8 = .rodata:0x803D01B8; // type:object size:0x18 lbl_803D01B8 = .rodata:0x803D01B8; // type:object size:0x18
lbl_803D01D0 = .rodata:0x803D01D0; // type:object size:0x20 lbl_803D01D0 = .rodata:0x803D01D0; // type:object size:0x20
lbl_803D01F0 = .rodata:0x803D01F0; // type:object size:0x8 lbl_803D01F0 = .rodata:0x803D01F0; // type:object size:0x8
@ -18331,7 +18331,7 @@ __vt__11CBSScripted = .data:0x803E24A8; // type:object size:0x38 scope:global
lbl_803E24E0 = .data:0x803E24E0; // type:object size:0x2D0 lbl_803E24E0 = .data:0x803E24E0; // type:object size:0x2D0
__vt__18CScriptDistanceFog = .data:0x803E27B0; // type:object size:0x20 scope:global __vt__18CScriptDistanceFog = .data:0x803E27B0; // type:object size:0x20 scope:global
__vt__19CBSProjectileAttack = .data:0x803E27D0; // type:object size:0x38 scope:global __vt__19CBSProjectileAttack = .data:0x803E27D0; // type:object size:0x38 scope:global
lbl_803E2808 = .data:0x803E2808; // type:object size:0x70 __vt__10CPowerBomb = .data:0x803E2808; // type:object size:0x6C scope:global
__vt__8CMetaree = .data:0x803E2878; // type:object size:0x2D0 scope:global __vt__8CMetaree = .data:0x803E2878; // type:object size:0x2D0 scope:global
__vt__21CScriptDockAreaChange = .data:0x803E2B48; // type:object size:0x20 scope:global __vt__21CScriptDockAreaChange = .data:0x803E2B48; // type:object size:0x20 scope:global
lbl_803E2B68 = .data:0x803E2B68; // type:object size:0x6C lbl_803E2B68 = .data:0x803E2B68; // type:object size:0x6C
@ -20270,7 +20270,7 @@ lbl_805A77E0 = .sdata:0x805A77E0; // type:object size:0x4 data:4byte
lbl_805A77E4 = .sdata:0x805A77E4; // type:object size:0x4 data:4byte lbl_805A77E4 = .sdata:0x805A77E4; // type:object size:0x4 data:4byte
lbl_805A77E8 = .sdata:0x805A77E8; // type:object size:0x4 data:4byte lbl_805A77E8 = .sdata:0x805A77E8; // type:object size:0x4 data:4byte
lbl_805A77EC = .sdata:0x805A77EC; // type:object size:0x4 data:4byte lbl_805A77EC = .sdata:0x805A77EC; // type:object size:0x4 data:4byte
lbl_805A77F0 = .sdata:0x805A77F0; // type:object size:0x8 data:4byte lbl_805A77F0 = .sdata:0x805A77F0; // type:object size:0x4 data:4byte
lbl_805A77F8 = .sdata:0x805A77F8; // type:object size:0x4 data:4byte lbl_805A77F8 = .sdata:0x805A77F8; // type:object size:0x4 data:4byte
lbl_805A77FC = .sdata:0x805A77FC; // type:object size:0x4 data:4byte lbl_805A77FC = .sdata:0x805A77FC; // type:object size:0x4 data:4byte
lbl_805A7800 = .sdata:0x805A7800; // type:object size:0x8 data:4byte lbl_805A7800 = .sdata:0x805A7800; // type:object size:0x8 data:4byte
@ -23270,7 +23270,7 @@ lbl_805AAC80 = .sdata2:0x805AAC80; // type:object size:0x4 data:float
lbl_805AAC84 = .sdata2:0x805AAC84; // type:object size:0x4 data:float lbl_805AAC84 = .sdata2:0x805AAC84; // type:object size:0x4 data:float
lbl_805AAC88 = .sdata2:0x805AAC88; // type:object size:0x4 lbl_805AAC88 = .sdata2:0x805AAC88; // type:object size:0x4
lbl_805AAC8C = .sdata2:0x805AAC8C; // type:object size:0x4 data:float lbl_805AAC8C = .sdata2:0x805AAC8C; // type:object size:0x4 data:float
lbl_805AAC90 = .sdata2:0x805AAC90; // type:object size:0x8 data:float lbl_805AAC90 = .sdata2:0x805AAC90; // type:object size:0x4 data:float
lbl_805AAC98 = .sdata2:0x805AAC98; // type:object size:0x4 lbl_805AAC98 = .sdata2:0x805AAC98; // type:object size:0x4
lbl_805AAC9C = .sdata2:0x805AAC9C; // type:object size:0x4 data:float lbl_805AAC9C = .sdata2:0x805AAC9C; // type:object size:0x4 data:float
lbl_805AACA0 = .sdata2:0x805AACA0; // type:object size:0x4 data:float lbl_805AACA0 = .sdata2:0x805AACA0; // type:object size:0x4 data:float

View File

@ -298,7 +298,7 @@ StartSamusVoiceSfx__7CPlayerFUssi = .text:0x80010CDC; // type:function size:0xD0
PostUpdate__7CPlayerFfR13CStateManager = .text:0x80010DAC; // type:function size:0x1D4 scope:global PostUpdate__7CPlayerFfR13CStateManager = .text:0x80010DAC; // type:function size:0x1D4 scope:global
__ct__16CPlayerCameraBobFRC16CPlayerCameraBob = .text:0x80010F80; // type:function size:0x270 scope:global __ct__16CPlayerCameraBobFRC16CPlayerCameraBob = .text:0x80010F80; // type:function size:0x270 scope:global
SetPlayerHitWallDuringMove__7CPlayerFv = .text:0x800111F0; // type:function size:0x18 scope:global SetPlayerHitWallDuringMove__7CPlayerFv = .text:0x800111F0; // type:function size:0x18 scope:global
ApplySubmergedPitchBend__7CPlayerFR10CSfxHandle = .text:0x80011208; // type:function size:0x48 scope:global DoSfxEffects__7CPlayerF10CSfxHandle = .text:0x80011208; // type:function size:0x48 scope:global
UpdatePhazonDamage__7CPlayerFfR13CStateManager = .text:0x80011250; // type:function size:0x578 scope:global UpdatePhazonDamage__7CPlayerFfR13CStateManager = .text:0x80011250; // type:function size:0x578 scope:global
__dt__17CCollidableSphere = .text:0x800117C8; // type:function size:0x5C scope:global __dt__17CCollidableSphere = .text:0x800117C8; // type:function size:0x5C scope:global
__dt__19CCollisionPrimitiveFv = .text:0x80011824; // type:function size:0x48 scope:global __dt__19CCollisionPrimitiveFv = .text:0x80011824; // type:function size:0x48 scope:global

View File

@ -449,7 +449,7 @@ config.libs = [
Object(NonMatching, "MetroidPrime/Enemies/CPuddleToadGamma.cpp"), Object(NonMatching, "MetroidPrime/Enemies/CPuddleToadGamma.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptDistanceFog.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptDistanceFog.cpp"),
Object(Matching, "MetroidPrime/BodyState/CBSProjectileAttack.cpp"), Object(Matching, "MetroidPrime/BodyState/CBSProjectileAttack.cpp"),
Object(NonMatching, "MetroidPrime/Weapons/CPowerBomb.cpp"), Object(Matching, "MetroidPrime/Weapons/CPowerBomb.cpp"),
Object(NonMatching, "MetroidPrime/Enemies/CMetaree.cpp"), Object(NonMatching, "MetroidPrime/Enemies/CMetaree.cpp"),
Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptDockAreaChange.cpp"), Object(NonMatching, "MetroidPrime/ScriptObjects/CScriptDockAreaChange.cpp"),
Object( Object(

View File

@ -198,8 +198,7 @@ public:
void AddOrbitDisableSource(CStateManager& mgr, TUniqueId addId); void AddOrbitDisableSource(CStateManager& mgr, TUniqueId addId);
void RemoveOrbitDisableSource(TUniqueId uid); void RemoveOrbitDisableSource(TUniqueId uid);
void ResetAimTargetPrediction(TUniqueId target); void ResetAimTargetPrediction(TUniqueId target);
void DoSfxEffects(CSfxHandle sfx);
void ApplySubmergedPitchBend(CSfxHandle& sfx);
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(); }

View File

@ -23,7 +23,7 @@ public:
CTweakGunRes(CInputStream& in); CTweakGunRes(CInputStream& in);
~CTweakGunRes() override; ~CTweakGunRes() override;
#if 0
ResId x4_gunMotion; ResId x4_gunMotion;
ResId x8_grappleArm; ResId x8_grappleArm;
ResId xc_rightHand; ResId xc_rightHand;
@ -51,8 +51,7 @@ public:
ResId xbc_grappleHit; ResId xbc_grappleHit;
ResId xc0_grappleMuzzle; ResId xc0_grappleMuzzle;
ResId xc4_grappleSwoosh; ResId xc4_grappleSwoosh;
#endif
char cls[0xc4];
const WeaponResourcePair* GetWeaponResourcePair(int beam) const; /* { const WeaponResourcePair* GetWeaponResourcePair(int beam) const; /* {
const int b = int(beam); const int b = int(beam);
if (b < 0 || b > 4) { if (b < 0 || b > 4) {

View File

@ -23,6 +23,7 @@ public:
void Touch(CActor&, CStateManager&) override; void Touch(CActor&, CStateManager&) override;
float GetCurTime() const { return x15c_curTime; } float GetCurTime() const { return x15c_curTime; }
bool IsEnding() const { return x15c_curTime > kEndingTime; }
void ApplyDynamicDamage(const CVector3f&, CStateManager&); void ApplyDynamicDamage(const CVector3f&, CStateManager&);
private: private:

View File

@ -741,7 +741,7 @@ void CPlayerGun::UpdateWeaponFire(float dt, CPlayerState& playerState, CStateMan
if (x53a_powerBomb != kInvalidUniqueId && if (x53a_powerBomb != kInvalidUniqueId &&
!mgr.CanCreateProjectile(x538_playerId, kWT_PowerBomb, 1)) { !mgr.CanCreateProjectile(x538_playerId, kWT_PowerBomb, 1)) {
const CPowerBomb* pb = static_cast< const CPowerBomb* >(mgr.GetObjectById(x53a_powerBomb)); const CPowerBomb* pb = static_cast< const CPowerBomb* >(mgr.GetObjectById(x53a_powerBomb));
if (pb && pb->GetCurTime() <= 4.25f) { if (pb && !pb->IsEnding()) {
x835_28_bombReady = false; x835_28_bombReady = false;
} else { } else {
x53a_powerBomb = kInvalidUniqueId; x53a_powerBomb = kInvalidUniqueId;

View File

@ -2,11 +2,10 @@
#include "MetroidPrime/SFX/Weapons.h" #include "MetroidPrime/SFX/Weapons.h"
#include "MetaRender/CCubeRenderer.hpp" #include "Kyoto/Audio/CSfxHandle.hpp"
#include "Kyoto/Graphics/CGraphics.hpp" #include "Kyoto/Graphics/CGraphics.hpp"
#include "Kyoto/Particles/CElementGen.hpp" #include "Kyoto/Particles/CElementGen.hpp"
#include "Kyoto/Audio/CSfxHandle.hpp" #include "MetaRender/CCubeRenderer.hpp"
CPowerBeam::CPowerBeam(CAssetId characterId, EWeaponType type, TUniqueId playerId, CPowerBeam::CPowerBeam(CAssetId characterId, EWeaponType type, TUniqueId playerId,
EMaterialTypes playerMaterial, const CVector3f& scale) EMaterialTypes playerMaterial, const CVector3f& scale)
@ -16,8 +15,7 @@ CPowerBeam::CPowerBeam(CAssetId characterId, EWeaponType type, TUniqueId playerI
, x23c_smokeTimer(0.f) , x23c_smokeTimer(0.f)
, x240_smokeState(kSS_Inactive) , x240_smokeState(kSS_Inactive)
, x244_24(false) , x244_24(false)
, x244_25_loaded(false) { , x244_25_loaded(false) {}
}
CPowerBeam::~CPowerBeam() {} CPowerBeam::~CPowerBeam() {}
@ -70,7 +68,8 @@ void CPowerBeam::UpdateGunFx(bool shotSmoke, float dt, const CStateManager& mgr,
// [[fallthrough]]; // [[fallthrough]];
case kSS_Done: case kSS_Done:
if (!x234_shotSmokeGen.null()) { if (!x234_shotSmokeGen.null()) {
CTransform4f locator = x10_solidModelData->GetScaledLocatorTransform(rstl::string_l(CGunWeapon::skMuzzleLocator)); CTransform4f locator = x10_solidModelData->GetScaledLocatorTransform(
rstl::string_l(CGunWeapon::skMuzzleLocator));
x234_shotSmokeGen->SetGlobalTranslation(locator.GetTranslation()); x234_shotSmokeGen->SetGlobalTranslation(locator.GetTranslation());
x234_shotSmokeGen->Update(dt); x234_shotSmokeGen->Update(dt);
if (x240_smokeState == kSS_Done && x234_shotSmokeGen->GetSystemCount() == 0) if (x240_smokeState == kSS_Done && x234_shotSmokeGen->GetSystemCount() == 0)
@ -89,7 +88,6 @@ void CPowerBeam::UpdateGunFx(bool shotSmoke, float dt, const CStateManager& mgr,
CGunWeapon::UpdateGunFx(shotSmoke, dt, mgr, xf); CGunWeapon::UpdateGunFx(shotSmoke, dt, mgr, xf);
} }
void CPowerBeam::Update(float dt, CStateManager& mgr) { void CPowerBeam::Update(float dt, CStateManager& mgr) {
CGunWeapon::Update(dt, mgr); CGunWeapon::Update(dt, mgr);
if (IsLoaded()) if (IsLoaded())
@ -98,15 +96,15 @@ void CPowerBeam::Update(float dt, CStateManager& mgr) {
if (CGunWeapon::IsLoaded() && !x244_25_loaded) { if (CGunWeapon::IsLoaded() && !x244_25_loaded) {
x244_25_loaded = x21c_shotSmoke.IsLoaded() && x228_power2nd1.IsLoaded(); x244_25_loaded = x21c_shotSmoke.IsLoaded() && x228_power2nd1.IsLoaded();
if (x244_25_loaded) { if (x244_25_loaded) {
x234_shotSmokeGen = NEW CElementGen (x21c_shotSmoke); x234_shotSmokeGen = NEW CElementGen(x21c_shotSmoke);
x234_shotSmokeGen->SetParticleEmission(false); x234_shotSmokeGen->SetParticleEmission(false);
} }
} }
} }
void CPowerBeam::Fire(bool underwater, float dt, CPlayerState::EChargeStage chargeState, const CTransform4f& xf, void CPowerBeam::Fire(bool underwater, float dt, CPlayerState::EChargeStage chargeState,
CStateManager& mgr, TUniqueId homingTarget, float chargeFactor1, const CTransform4f& xf, CStateManager& mgr, TUniqueId homingTarget,
float chargeFactor2) { float chargeFactor1, float chargeFactor2) {
static const ushort skSoundId[] = { static const ushort skSoundId[] = {
SFXwpn_fire_power_normal, SFXwpn_fire_power_normal,
SFXwpn_fire_power_charged, SFXwpn_fire_power_charged,
@ -123,7 +121,6 @@ void CPowerBeam::Load(CStateManager& mgr, bool subtypeBasePose) {
x228_power2nd1.Lock(); x228_power2nd1.Lock();
} }
void CPowerBeam::Unload(CStateManager& mgr) { void CPowerBeam::Unload(CStateManager& mgr) {
CGunWeapon::Unload(mgr); CGunWeapon::Unload(mgr);
x228_power2nd1.Unlock(); x228_power2nd1.Unlock();

View File

@ -16,7 +16,7 @@ const float CPowerBomb::kEndingTime = 4.25f;
CPowerBomb::CPowerBomb(TToken< CGenDescription > particle, TUniqueId uid, TAreaId aid, CPowerBomb::CPowerBomb(TToken< CGenDescription > particle, TUniqueId uid, TAreaId aid,
TUniqueId playerId, const CTransform4f& xf, const CDamageInfo& dInfo) TUniqueId playerId, const CTransform4f& xf, const CDamageInfo& dInfo)
: 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_Solid, kMT_Immovable, kMT_Trigger), 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, kPA_PowerBombs,
CModelData::CModelDataNull()) CModelData::CModelDataNull())
@ -104,8 +104,7 @@ void CPowerBomb::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
CSfxManager::AddEmitter(SFXsfx0710, GetTranslation(), CVector3f::Zero(), true, false); CSfxManager::AddEmitter(SFXsfx0710, GetTranslation(), CVector3f::Zero(), true, false);
mgr.InformListeners(GetTranslation(), kLNT_BombExplode); mgr.InformListeners(GetTranslation(), kLNT_BombExplode);
} else { } else {
CSfxHandle handle = CSfxManager::SfxStart(SFXsfx073F, 0x7f, 0x40, false); mgr.Player()->DoSfxEffects(CSfxManager::SfxStart(SFXsfx073F, 0x7f, 0x40, false));
mgr.Player()->ApplySubmergedPitchBend(handle);
} }
break; break;