2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:44:56 +00:00

Initial round of CMorphBall implementations

This commit is contained in:
Jack Andersen
2017-09-10 16:18:49 -10:00
parent 1022e4819c
commit 10092821c8
26 changed files with 1192 additions and 436 deletions

View File

@@ -253,9 +253,7 @@ void CAuxWeapon::CreateFlameThrower(const zeus::CTransform& xf, CStateManager& m
mgr.AddObject(ft);
ft->Think(dt, mgr);
ft->StartFiring(xf, mgr);
x24_muzzleFxGen = std::make_unique<CElementGen>(xc_flameMuzzle,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x24_muzzleFxGen = std::make_unique<CElementGen>(xc_flameMuzzle);
x7c_comboSfx = NWeaponTypes::play_sfx(1842, false, true, 0.165f);
mgr.GetCameraManager()->AddCameraShaker(skHardShake, false);
mgr.GetPlayerState()->SetFiringComboBeam(true);
@@ -286,9 +284,7 @@ void CAuxWeapon::CreateWaveBusterBeam(CWeapon::EProjectileAttrib attribs, TUniqu
CGunWeapon::GetShotDamageInfo(g_tweakPlayerGun->GetComboShotInfo(2), mgr), x70_waveBusterId,
kInvalidAreaId, x6c_playerId, homingTarget, attribs);
mgr.AddObject(wb);
x24_muzzleFxGen = std::make_unique<CElementGen>(x18_busterMuzzle,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x24_muzzleFxGen = std::make_unique<CElementGen>(x18_busterMuzzle);
x7c_comboSfx = NWeaponTypes::play_sfx(1847, false, true, 0.165f);
mgr.GetCameraManager()->AddCameraShaker(CCameraShakeData::skChargedShotCameraShakeData, false);
mgr.GetPlayerState()->SetFiringComboBeam(true);

View File

@@ -16,8 +16,7 @@ CFlameThrower::CFlameThrower(const TToken<CWeaponDescription>& wDesc, const std:
zeus::CVector3f(1.f), {}, -1, false)
, x2e8_(xf)
, x33c_flameDesc(g_SimplePool->GetObj({FOURCC('PART'), flameInfo.GetFlameFxId()}))
, x348_flameGen(new CElementGen(x33c_flameDesc, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One))
, x348_flameGen(new CElementGen(x33c_flameDesc))
{
}

View File

@@ -29,18 +29,10 @@ CGrappleArm::CGrappleArm(const zeus::CVector3f& scale)
x36c_grappleHitDesc(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->xbc_grappleHit})),
x378_grappleMuzzleDesc(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->xc0_grappleMuzzle})),
x384_grappleSwooshDesc(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->xc4_grappleSwoosh})),
x390_grappleSegmentGen(std::make_unique<CElementGen>(x354_grappleSegmentDesc,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One)),
x394_grappleClawGen(std::make_unique<CElementGen>(x360_grappleClawDesc,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One)),
x398_grappleHitGen(std::make_unique<CElementGen>(x36c_grappleHitDesc,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One)),
x39c_grappleMuzzleGen(std::make_unique<CElementGen>(x378_grappleMuzzleDesc,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One)),
x390_grappleSegmentGen(std::make_unique<CElementGen>(x354_grappleSegmentDesc)),
x394_grappleClawGen(std::make_unique<CElementGen>(x360_grappleClawDesc)),
x398_grappleHitGen(std::make_unique<CElementGen>(x36c_grappleHitDesc)),
x39c_grappleMuzzleGen(std::make_unique<CElementGen>(x378_grappleMuzzleDesc)),
x3a0_grappleSwooshGen(std::make_unique<CParticleSwoosh>(x384_grappleSwooshDesc, 0)),
x3a4_rainSplashGenerator(std::make_unique<CRainSplashGenerator>(scale, 20, 2, 0.f, 0.125f))
{
@@ -280,12 +272,8 @@ void CGrappleArm::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node,
case EUserEventType::Projectile:
if (x3b2_27_armMoving)
return;
x398_grappleHitGen = std::make_unique<CElementGen>(x36c_grappleHitDesc,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x39c_grappleMuzzleGen = std::make_unique<CElementGen>(x378_grappleMuzzleDesc,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x398_grappleHitGen = std::make_unique<CElementGen>(x36c_grappleHitDesc);
x39c_grappleMuzzleGen = std::make_unique<CElementGen>(x378_grappleMuzzleDesc);
x338_beamT = 0.f;
x33c_beamDist = 0.f;
x340_anglePhase = 0.f;

View File

@@ -270,17 +270,13 @@ void CGunWeapon::EnableFrozenEffect(EFrozenFxType type)
case EFrozenFxType::Thawed:
if (x204_frozenEffect == EFrozenFxType::Thawed)
break;
x1b8_frozenGenerator = std::make_unique<CElementGen>(x188_frozenEffects[1],
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x1b8_frozenGenerator = std::make_unique<CElementGen>(x188_frozenEffects[1]);
x1b8_frozenGenerator->SetGlobalScale(x4_scale);
break;
case EFrozenFxType::Frozen:
if (x204_frozenEffect == EFrozenFxType::Frozen)
break;
x1b8_frozenGenerator = std::make_unique<CElementGen>(x188_frozenEffects[0],
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x1b8_frozenGenerator = std::make_unique<CElementGen>(x188_frozenEffects[0]);
x1b8_frozenGenerator->SetGlobalScale(x4_scale);
break;
default:
@@ -296,9 +292,7 @@ void CGunWeapon::ActivateCharge(bool enable, bool resetEffect)
if (enable || resetEffect)
{
x1a4_muzzleGenerators[x208_muzzleEffectIdx] =
std::make_unique<CElementGen>(x16c_muzzleEffects[x208_muzzleEffectIdx],
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
std::make_unique<CElementGen>(x16c_muzzleEffects[x208_muzzleEffectIdx]);
}
}
@@ -434,8 +428,7 @@ void CGunWeapon::LoadMuzzleFx(float dt)
{
for (int i=0 ; i<2 ; ++i)
{
x1a4_muzzleGenerators.push_back(std::make_unique<CElementGen>(x16c_muzzleEffects[i],
CElementGen::EModelOrientationType::Normal, CElementGen::EOptionalSystemFlags::One));
x1a4_muzzleGenerators.push_back(std::make_unique<CElementGen>(x16c_muzzleEffects[i]));
x1a4_muzzleGenerators.back()->SetParticleEmission(false);
x1a4_muzzleGenerators.back()->Update(dt);
}

View File

@@ -101,16 +101,14 @@ void CIceBeam::EnableSecondaryFx(ESecondaryFxType type)
case ESecondaryFxType::CancelCharge:
if (!x248_25_inEndFx)
{
x244_chargeFx = std::make_unique<CElementGen>(x234_ice2nd2, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x244_chargeFx = std::make_unique<CElementGen>(x234_ice2nd2);
x244_chargeFx->SetGlobalScale(x4_scale);
x248_25_inEndFx = true;
x1cc_enabledSecondaryEffect = ESecondaryFxType::CancelCharge;
}
break;
case ESecondaryFxType::Charge:
x244_chargeFx = std::make_unique<CElementGen>(x228_ice2nd1, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x244_chargeFx = std::make_unique<CElementGen>(x228_ice2nd1);
x244_chargeFx->SetGlobalScale(x4_scale);
x248_25_inEndFx = false;
x1cc_enabledSecondaryEffect = type;
@@ -129,8 +127,7 @@ void CIceBeam::Update(float dt, CStateManager& mgr)
x248_24_loaded = x21c_iceSmoke.IsLoaded() && x228_ice2nd1.IsLoaded() && x234_ice2nd2.IsLoaded();
if (x248_24_loaded)
{
x240_smokeGen = std::make_unique<CElementGen>(x21c_iceSmoke, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x240_smokeGen = std::make_unique<CElementGen>(x21c_iceSmoke);
x240_smokeGen->SetGlobalScale(x4_scale);
x240_smokeGen->SetParticleEmission(false);
}

View File

@@ -60,21 +60,11 @@ void CNewFlameThrower::CreateLightObjects(CStateManager& mgr)
void CNewFlameThrower::EnableFx(CStateManager& mgr)
{
DeleteProjectileLight(mgr);
x358_mainFireGen = std::make_unique<CElementGen>(x304_mainFire,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x35c_mainSmokeGen = std::make_unique<CElementGen>(x310_mainSmoke,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x360_secondarySmokeGen = std::make_unique<CElementGen>(x31c_secondarySmoke,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x364_secondaryFireGen = std::make_unique<CElementGen>(x328_secondaryFire,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x368_secondarySparksGen = std::make_unique<CElementGen>(x334_secondarySparks,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x358_mainFireGen = std::make_unique<CElementGen>(x304_mainFire);
x35c_mainSmokeGen = std::make_unique<CElementGen>(x310_mainSmoke);
x360_secondarySmokeGen = std::make_unique<CElementGen>(x31c_secondarySmoke);
x364_secondaryFireGen = std::make_unique<CElementGen>(x328_secondaryFire);
x368_secondarySparksGen = std::make_unique<CElementGen>(x334_secondarySparks);
x36c_swooshCenterGen = std::make_unique<CParticleSwoosh>(x340_swooshCenter, 0);
x36c_swooshCenterGen->SetRenderGaps(true);
x370_swooshFireGen = std::make_unique<CParticleSwoosh>(x34c_swooshFire, 0);

View File

@@ -50,8 +50,7 @@ void CPhazonBeam::UpdateBeam(float dt, const zeus::CTransform& targetXf,
void CPhazonBeam::CreateBeam(CStateManager& mgr)
{
x234_chargeFxGen = std::make_unique<CElementGen>(x228_phazon2nd1, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x234_chargeFxGen = std::make_unique<CElementGen>(x228_phazon2nd1);
if (x234_chargeFxGen)
{
x234_chargeFxGen->SetGlobalScale(x4_scale);

View File

@@ -109,8 +109,7 @@ void CPlasmaBeam::EnableSecondaryFx(ESecondaryFxType type)
x228_chargeFx->SetParticleEmission(false);
break;
case ESecondaryFxType::Charge:
x228_chargeFx = std::make_unique<CElementGen>(x21c_plasma2nd1, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x228_chargeFx = std::make_unique<CElementGen>(x21c_plasma2nd1);
x228_chargeFx->SetGlobalScale(x4_scale);
default:
break;

View File

@@ -53,8 +53,7 @@ CPlayerGun::CPlayerGun(TUniqueId playerId)
x75c_phazonBeam = std::make_unique<CPhazonBeam>(g_tweakGunRes->x20_phazonBeam, EWeaponType::Phazon,
playerId, EMaterialTypes::Player, sGunScale);
x774_holoTransitionGen = std::make_unique<CElementGen>(
g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->x24_holoTransition}),
CElementGen::EModelOrientationType::Normal, CElementGen::EOptionalSystemFlags::One);
g_SimplePool->GetObj(SObjectTag{FOURCC('PART'), g_tweakGunRes->x24_holoTransition}));
x82c_shadow = std::make_unique<CWorldShadow>(32, 32, true);
x832_31_inRestPose = true;
@@ -112,9 +111,7 @@ void CPlayerGun::InitMuzzleData()
{
x7c0_auxMuzzleEffects.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('PART'),
g_tweakGunRes->xa4_auxMuzzle[i]}));
x800_auxMuzzleGenerators.emplace_back(new CElementGen(x7c0_auxMuzzleEffects.back(),
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One));
x800_auxMuzzleGenerators.emplace_back(new CElementGen(x7c0_auxMuzzleEffects.back()));
x800_auxMuzzleGenerators.back()->SetParticleEmission(false);
}
}
@@ -1241,9 +1238,7 @@ void CPlayerGun::EnableChargeFx(EChargeState state, CStateManager& mgr)
x833_30_canShowAuxMuzzleEffect = true;
x800_auxMuzzleGenerators[int(x320_currentAuxBeam)] =
std::make_unique<CElementGen>(x7c0_auxMuzzleEffects[int(x320_currentAuxBeam)],
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
std::make_unique<CElementGen>(x7c0_auxMuzzleEffects[int(x320_currentAuxBeam)]);
x800_auxMuzzleGenerators[int(x320_currentAuxBeam)]->SetParticleEmission(true);
}
@@ -1584,8 +1579,7 @@ void CPlayerGun::ActivateCombo(CStateManager& mgr)
if (xferEffect.IsLoaded())
{
x77c_comboXferGen =
std::make_unique<CElementGen>(xferEffect, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
std::make_unique<CElementGen>(xferEffect);
x77c_comboXferGen->SetGlobalScale(sGunScale);
}
x72c_currentBeam->EnableCharge(true);

View File

@@ -99,9 +99,7 @@ void CPowerBeam::EnableSecondaryFx(ESecondaryFxType type)
x1cc_enabledSecondaryEffect = ESecondaryFxType::None;
break;
case ESecondaryFxType::Charge:
x238_power2ndGen = std::make_unique<CElementGen>(x228_power2nd1,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x238_power2ndGen = std::make_unique<CElementGen>(x228_power2nd1);
x238_power2ndGen->SetGlobalScale(x4_scale);
x1cc_enabledSecondaryEffect = type;
break;
@@ -120,9 +118,7 @@ void CPowerBeam::Update(float dt, CStateManager& mgr)
x244_25_loaded = x21c_shotSmoke.IsLoaded() && x228_power2nd1.IsLoaded();
if (x244_25_loaded)
{
x234_shotSmokeGen = std::make_unique<CElementGen>(x21c_shotSmoke,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x234_shotSmokeGen = std::make_unique<CElementGen>(x21c_shotSmoke);
x234_shotSmokeGen->SetParticleEmission(false);
}
}

View File

@@ -128,8 +128,7 @@ void CWaveBeam::EnableSecondaryFx(ESecondaryFxType type)
}
break;
case ESecondaryFxType::ToCombo:
x254_chargeFx = std::make_unique<CElementGen>(x240_wave2nd3, CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x254_chargeFx = std::make_unique<CElementGen>(x240_wave2nd3);
x254_chargeFx->SetGlobalScale(x4_scale);
x24c_effectTimer = 0.f;
x258_25_effectTimerActive = true;

View File

@@ -23,12 +23,8 @@ CWaveBuster::CWaveBuster(const TToken<CWeaponDescription>& desc, EWeaponType typ
x378_busterLight.GetObj();
x384_busterSwoosh1Gen = std::make_unique<CParticleSwoosh>(x354_busterSwoosh1, 0);
x388_busterSwoosh2Gen = std::make_unique<CParticleSwoosh>(x360_busterSwoosh2, 0);
x38c_busterSparksGen = std::make_unique<CElementGen>(x36c_busterSparks,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x390_busterLightGen = std::make_unique<CElementGen>(x378_busterLight,
CElementGen::EModelOrientationType::Normal,
CElementGen::EOptionalSystemFlags::One);
x38c_busterSparksGen = std::make_unique<CElementGen>(x36c_busterSparks);
x390_busterLightGen = std::make_unique<CElementGen>(x378_busterLight);
x3d0_24_firing = true;
x3d0_25_ = true;
x3d0_26_ = false;