mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #98 from lioncash/alpha
CAtomicAlpha/CAtomicBeta: Minor changes
This commit is contained in:
commit
6422eec3ce
|
@ -1,14 +1,21 @@
|
||||||
#include "CAtomicAlpha.hpp"
|
#include "Runtime/MP1/World/CAtomicAlpha.hpp"
|
||||||
#include "World/CWorld.hpp"
|
|
||||||
#include "World/CGameArea.hpp"
|
#include <array>
|
||||||
#include "World/CPlayer.hpp"
|
|
||||||
#include "World/CPatternedInfo.hpp"
|
#include "Runtime/CStateManager.hpp"
|
||||||
#include "Weapon/CPlayerGun.hpp"
|
#include "Runtime/Weapon/CPlayerGun.hpp"
|
||||||
|
#include "Runtime/World/CGameArea.hpp"
|
||||||
|
#include "Runtime/World/CPatternedInfo.hpp"
|
||||||
|
#include "Runtime/World/CPlayer.hpp"
|
||||||
|
#include "Runtime/World/CWorld.hpp"
|
||||||
|
|
||||||
#include "CStateManager.hpp"
|
|
||||||
namespace urde::MP1 {
|
namespace urde::MP1 {
|
||||||
const std::string_view CAtomicAlpha::skBombLocators[4] = {"bomb1_LCTR"sv, "bomb2_LCTR"sv, "bomb3_LCTR"sv,
|
constexpr std::array skBombLocators{
|
||||||
"bomb4_LCTR"sv};
|
"bomb1_LCTR"sv,
|
||||||
|
"bomb2_LCTR"sv,
|
||||||
|
"bomb3_LCTR"sv,
|
||||||
|
"bomb4_LCTR"sv,
|
||||||
|
};
|
||||||
|
|
||||||
CAtomicAlpha::CAtomicAlpha(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
CAtomicAlpha::CAtomicAlpha(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
||||||
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo,
|
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo,
|
||||||
|
@ -27,8 +34,7 @@ CAtomicAlpha::CAtomicAlpha(TUniqueId uid, std::string_view name, const CEntityIn
|
||||||
, x690_bombModel(CStaticRes(cmdl, GetModelData()->GetScale())) {
|
, x690_bombModel(CStaticRes(cmdl, GetModelData()->GetScale())) {
|
||||||
x668_bombProjectile.Token().Lock();
|
x668_bombProjectile.Token().Lock();
|
||||||
for (u32 i = 0; i < skBombCount; ++i) {
|
for (u32 i = 0; i < skBombCount; ++i) {
|
||||||
x6dc_bombLocators.push_back(
|
x6dc_bombLocators.emplace_back(skBombLocators[i], pas::ELocomotionType(u32(pas::ELocomotionType::Internal10) + i));
|
||||||
SBomb(skBombLocators[i], pas::ELocomotionType(u32(pas::ELocomotionType::Internal10) + i)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,13 @@
|
||||||
|
|
||||||
namespace urde::MP1 {
|
namespace urde::MP1 {
|
||||||
class CAtomicAlpha : public CPatterned {
|
class CAtomicAlpha : public CPatterned {
|
||||||
static const std::string_view skBombLocators[4];
|
|
||||||
static constexpr u32 skBombCount = 4;
|
static constexpr u32 skBombCount = 4;
|
||||||
struct SBomb {
|
struct SBomb {
|
||||||
std::string x0_locatorName;
|
std::string x0_locatorName;
|
||||||
pas::ELocomotionType x10_locomotionType;
|
pas::ELocomotionType x10_locomotionType;
|
||||||
float x14_scaleTime = FLT_MAX;
|
float x14_scaleTime = FLT_MAX;
|
||||||
SBomb(const std::string_view locator, pas::ELocomotionType locomotionType)
|
SBomb(const std::string_view locator, pas::ELocomotionType locomotionType)
|
||||||
: x0_locatorName(locator.data()), x10_locomotionType(locomotionType) {}
|
: x0_locatorName(locator), x10_locomotionType(locomotionType) {}
|
||||||
};
|
};
|
||||||
bool x568_24_inRange : 1;
|
bool x568_24_inRange : 1;
|
||||||
bool x568_25_invisible : 1;
|
bool x568_25_invisible : 1;
|
||||||
|
|
|
@ -1,14 +1,21 @@
|
||||||
#include "CAtomicBeta.hpp"
|
#include "Runtime/MP1/World/CAtomicBeta.hpp"
|
||||||
#include "Particle/CWeaponDescription.hpp"
|
|
||||||
#include "Weapon/CPlayerGun.hpp"
|
#include <array>
|
||||||
#include "Weapon/CElectricBeamProjectile.hpp"
|
|
||||||
#include "World/CPlayer.hpp"
|
#include "Runtime/CSimplePool.hpp"
|
||||||
#include "GameGlobalObjects.hpp"
|
#include "Runtime/CStateManager.hpp"
|
||||||
#include "CStateManager.hpp"
|
#include "Runtime/GameGlobalObjects.hpp"
|
||||||
#include "CSimplePool.hpp"
|
#include "Runtime/Particle/CWeaponDescription.hpp"
|
||||||
|
#include "Runtime/Weapon/CElectricBeamProjectile.hpp"
|
||||||
|
#include "Runtime/Weapon/CPlayerGun.hpp"
|
||||||
|
#include "Runtime/World/CPlayer.hpp"
|
||||||
|
|
||||||
namespace urde::MP1 {
|
namespace urde::MP1 {
|
||||||
const std::string_view CAtomicBeta::skBombLocators[3] = {"bomb2_LCTR"sv, "bomb3_LCTR"sv, "bomb4_LCTR"sv};
|
constexpr std::array skBombLocators{
|
||||||
|
"bomb2_LCTR"sv,
|
||||||
|
"bomb3_LCTR"sv,
|
||||||
|
"bomb4_LCTR"sv,
|
||||||
|
};
|
||||||
|
|
||||||
CAtomicBeta::CAtomicBeta(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
CAtomicBeta::CAtomicBeta(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
||||||
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo,
|
CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo,
|
||||||
|
@ -42,7 +49,7 @@ CAtomicBeta::CAtomicBeta(TUniqueId uid, std::string_view name, const CEntityInfo
|
||||||
void CAtomicBeta::CreateBeams(CStateManager& mgr) {
|
void CAtomicBeta::CreateBeams(CStateManager& mgr) {
|
||||||
const SElectricBeamInfo beamInfo{x600_electricWeapon, 50.f, x634_beamRadius, 10.f, x62c_beamParticle, x630_, x638_};
|
const SElectricBeamInfo beamInfo{x600_electricWeapon, 50.f, x634_beamRadius, 10.f, x62c_beamParticle, x630_, x638_};
|
||||||
|
|
||||||
for (u32 i = 0; i < kBombCount; ++i) {
|
for (size_t i = 0; i < kBombCount; ++i) {
|
||||||
x568_projectileIds.push_back(mgr.AllocateUniqueId());
|
x568_projectileIds.push_back(mgr.AllocateUniqueId());
|
||||||
mgr.AddObject(new CElectricBeamProjectile(x608_, EWeaponType::AI, beamInfo, {}, EMaterialTypes::Character,
|
mgr.AddObject(new CElectricBeamProjectile(x608_, EWeaponType::AI, beamInfo, {}, EMaterialTypes::Character,
|
||||||
x610_projectileDamage, x568_projectileIds[i], GetAreaIdAlways(),
|
x610_projectileDamage, x568_projectileIds[i], GetAreaIdAlways(),
|
||||||
|
@ -51,17 +58,19 @@ void CAtomicBeta::CreateBeams(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAtomicBeta::UpdateBeams(CStateManager& mgr, bool fireBeam) {
|
void CAtomicBeta::UpdateBeams(CStateManager& mgr, bool fireBeam) {
|
||||||
if (x574_beamFired == fireBeam)
|
if (x574_beamFired == fireBeam) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < kBombCount; ++i) {
|
for (size_t i = 0; i < kBombCount; ++i) {
|
||||||
//zeus::CTransform xf = GetTransform() * GetScaledLocatorTransform(skBombLocators[i]);
|
//zeus::CTransform xf = GetTransform() * GetScaledLocatorTransform(skBombLocators[i]);
|
||||||
//zeus::CTransform newXf = zeus::lookAt(xf.origin, xf.origin + xf.basis[1], zeus::skUp);
|
//zeus::CTransform newXf = zeus::lookAt(xf.origin, xf.origin + xf.basis[1], zeus::skUp);
|
||||||
if (CElectricBeamProjectile* proj = static_cast<CElectricBeamProjectile*>(mgr.ObjectById(x568_projectileIds[i]))) {
|
if (auto* const proj = static_cast<CElectricBeamProjectile*>(mgr.ObjectById(x568_projectileIds[i]))) {
|
||||||
if (fireBeam)
|
if (fireBeam) {
|
||||||
proj->Fire(GetTransform() * GetScaledLocatorTransform(skBombLocators[i]), mgr, false);
|
proj->Fire(GetTransform() * GetScaledLocatorTransform(skBombLocators[i]), mgr, false);
|
||||||
else
|
} else {
|
||||||
proj->ResetBeam(mgr, false);
|
proj->ResetBeam(mgr, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x574_beamFired = fireBeam;
|
x574_beamFired = fireBeam;
|
||||||
|
@ -126,11 +135,13 @@ void CAtomicBeta::Think(float dt, CStateManager& mgr) {
|
||||||
UpdateOrCreateEmitter(x64c_, x644_, GetTranslation(), 96 / 127.f);
|
UpdateOrCreateEmitter(x64c_, x644_, GetTranslation(), 96 / 127.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < kBombCount; ++i) {
|
for (size_t i = 0; i < kBombCount; ++i) {
|
||||||
if (CElectricBeamProjectile* proj = static_cast<CElectricBeamProjectile*>(mgr.ObjectById(x568_projectileIds[i]))) {
|
if (auto* const proj = static_cast<CElectricBeamProjectile*>(mgr.ObjectById(x568_projectileIds[i]))) {
|
||||||
if (!proj->GetActive())
|
if (!proj->GetActive()) {
|
||||||
continue;
|
continue;
|
||||||
zeus::CTransform xf = GetTransform() * GetScaledLocatorTransform(skBombLocators[i]);
|
}
|
||||||
|
|
||||||
|
const zeus::CTransform xf = GetTransform() * GetScaledLocatorTransform(skBombLocators[i]);
|
||||||
proj->UpdateFx(zeus::lookAt(xf.origin, xf.origin + xf.basis[1], zeus::skUp), dt, mgr);
|
proj->UpdateFx(zeus::lookAt(xf.origin, xf.origin + xf.basis[1], zeus::skUp), dt, mgr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ class CWeaponDescription;
|
||||||
|
|
||||||
namespace urde::MP1 {
|
namespace urde::MP1 {
|
||||||
class CAtomicBeta final : public CPatterned {
|
class CAtomicBeta final : public CPatterned {
|
||||||
static const std::string_view skBombLocators[3];
|
|
||||||
static constexpr u32 kBombCount = 3;
|
static constexpr u32 kBombCount = 3;
|
||||||
rstl::reserved_vector<TUniqueId, kBombCount> x568_projectileIds;
|
rstl::reserved_vector<TUniqueId, kBombCount> x568_projectileIds;
|
||||||
bool x574_beamFired = false;
|
bool x574_beamFired = false;
|
||||||
|
|
Loading…
Reference in New Issue