...
 
Commits (16)
This diff is collapsed.
......@@ -94,9 +94,9 @@ enum class EGetupType { Invalid = -1, Zero = 0, One = 1, Two = 2 };
enum class ELoopState { Invalid = -1, Begin, Loop, End };
enum class ELoopAttackType { Invalid = -1 };
enum class ELoopAttackType { Invalid = -1, Zero, One, Two, Three };
enum class EGenerateType { Invalid = -1, Zero, One, Two, Three, Four, Five };
enum class EGenerateType { Invalid = -1, Zero, One, Two, Three, Four, Five, Six, Seven };
enum class ESlideType { Invalid = -1, Zero = 0 };
......
......@@ -183,7 +183,7 @@ void CBabygoth::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateM
CrackShell(mgr, xa38_intermediateCrackParticle, xf, x570_babyData.GetShellCrackSfx(), false);
}
}
KnockBack(GetTransform().frontVector(), mgr, wp->GetDamageInfo(), EKnockBackType::Radius, false,
KnockBack(GetTransform().frontVector(), mgr, wp->GetDamageInfo(), EKnockBackType::Direct, false,
wp->GetDamageInfo().GetKnockBackPower());
}
}
......
......@@ -299,13 +299,15 @@ void CChozoGhost::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node,
void CChozoGhost::KnockBack(const zeus::CVector3f& dir, CStateManager& mgr, const CDamageInfo& info,
EKnockBackType type, bool inDeferred, float magnitude) {
if (!IsAlive())
if (!IsAlive()) {
x460_knockBackController.SetAvailableState(EKnockBackAnimationState::Hurled, false);
else if (!x460_knockBackController.TestAvailableState(EKnockBackAnimationState::KnockBack) &&
info.GetWeaponMode().IsCharged())
} else if (!x460_knockBackController.TestAvailableState(EKnockBackAnimationState::KnockBack) &&
info.GetWeaponMode().IsCharged()) {
x460_knockBackController.SetAnimationStateRange(EKnockBackAnimationState::Hurled, EKnockBackAnimationState::Fall);
}
CPatterned::KnockBack(dir, mgr, info, type, inDeferred, magnitude);
x460_knockBackController.SetAnimationStateRange(EKnockBackAnimationState::Flinch, EKnockBackAnimationState::Fall);
if (!IsAlive()) {
Stop();
x150_momentum.zeroOut();
......
......@@ -235,7 +235,7 @@ void CElitePirate::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta
x428_damageCooldownTimer = 0.33f;
const auto& damageInfo = projectile->GetDamageInfo();
KnockBack(projectile->GetTranslation() - projectile->GetPreviousPos(), mgr, damageInfo,
EKnockBackType::Radius, false, damageInfo.GetKnockBackPower());
EKnockBackType::Direct, false, damageInfo.GetKnockBackPower());
CPatterned::AcceptScriptMsg(msg, uid, mgr);
} else if (uid == x79c_energyAttractorId && x760_energyAbsorbDesc->IsLoaded()) {
CreateEnergyAbsorb(mgr, projectile->GetTransform());
......
This diff is collapsed.
This diff is collapsed.
......@@ -79,6 +79,7 @@ void CMetroidBeta::Think(float dt, CStateManager& mgr) {
// sub801c0da4(dt, mgr);
// sub801c21b4(dt, mgr);
}
void CMetroidBeta::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
CPatterned::AcceptScriptMsg(msg, uid, mgr);
switch (msg) {
......@@ -117,7 +118,7 @@ void CMetroidBeta::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta
x840_31_ = true;
x83c_ += 1.f;
}
KnockBack(proj->GetTranslation() - proj->GetPreviousPos(), mgr, dInfo, EKnockBackType::Radius, false,
KnockBack(proj->GetTranslation() - proj->GetPreviousPos(), mgr, dInfo, EKnockBackType::Direct, false,
dInfo.GetKnockBackPower());
}
if (x840_25_)
......
......@@ -13,7 +13,7 @@ namespace urde {
class CCollisionActorManager;
class CElementGen;
class CParticleSwoosh;
}
} // namespace urde
namespace urde::MP1 {
......@@ -40,6 +40,7 @@ class CMetroidBetaData {
public:
explicit CMetroidBetaData(CInputStream&);
};
class CMetroidBeta : public CPatterned {
s32 x568_progState = -1;
CMetroidBetaData x56c_metroidBetaData;
......@@ -89,12 +90,14 @@ class CMetroidBeta : public CPatterned {
void SetCollisionActorHealthAndVulnerability(CStateManager& mgr);
void RemoveFromTeam(CStateManager& mgr);
void AddToTeam(CStateManager& mgr);
public:
DEFINE_PATTERNED(MetroidBeta)
CMetroidBeta(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& aParms,
const CMetroidBetaData& metroidData);
void Accept(IVisitor& visitor) override { visitor.Visit(this); }
void Think(float dt, CStateManager& mgr) override;
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
......
......@@ -525,7 +525,7 @@ void CRidley::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMan
if (!dontKnockback) {
if (TCastToConstPtr<CGameProjectile> proj = mgr.GetObjectById(colAct->GetLastTouchedObject())) {
KnockBack(proj->GetTranslation() - proj->GetPreviousPos(), mgr, proj->GetDamageInfo(), EKnockBackType::Radius,
KnockBack(proj->GetTranslation() - proj->GetPreviousPos(), mgr, proj->GetDamageInfo(), EKnockBackType::Direct,
false, proj->GetDamageInfo().GetKnockBackPower());
}
}
......
......@@ -821,7 +821,7 @@ void CSpacePirate::Think(float dt, CStateManager& mgr) {
x400_27_fadeToDeath = true;
AddMaterial(EMaterialTypes::ProjectilePassthrough, mgr);
x3e8_alphaDelta = -0.333333f;
x638_30_ragdollOver = true;
x638_30_allEnergyDrained = true;
SetMomentumWR(zeus::skZero3f);
CPhysicsActor::Stop();
}
......@@ -1070,7 +1070,7 @@ void CSpacePirate::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node
switch (type) {
case EUserEventType::BeginAction:
RemoveMaterial(EMaterialTypes::Solid, mgr);
x638_30_ragdollOver = true;
x638_30_allEnergyDrained = true;
handled = true;
break;
case EUserEventType::EndAction:
......@@ -2360,7 +2360,7 @@ bool CSpacePirate::ShouldDodge(CStateManager& mgr, float arg) {
}
if (!ret) {
if (const CMetroid* metroid = CPatterned::CastTo<CMetroid>(mgr.GetObjectById(x7c0_targetId))) {
if (metroid->GetX9BF_29() &&
if (metroid->IsAttacking() &&
(GetTranslation() - metroid->GetTranslation()).dot(metroid->GetTransform().basis[1]) > 0.f) {
ret = true;
}
......
......@@ -136,7 +136,7 @@ private:
bool x638_27_coverCheck : 1 = false;
bool x638_28_enableDodge : 1 = false;
bool x638_29_noPlayerDodge : 1 = false;
bool x638_30_ragdollOver : 1 = false;
bool x638_30_allEnergyDrained : 1 = false;
bool x638_31_mayStartAttack : 1 = false;
bool x639_24_ : 1 = false;
bool x639_25_useJumpBackJump : 1 = false;
......@@ -329,5 +329,8 @@ public:
float GetGravityConstant() const override;
CProjectileInfo* GetProjectileInfo() override;
bool GetEnableAim() const { return x637_25_enableAim; }
bool AllEnergyDrained() const { return x638_30_allEnergyDrained; }
TUniqueId GetAttachedActor() const { return x7b4_attachedActor; }
bool IsTrooper() const { return x636_24_trooper; }
};
} // namespace urde::MP1
......@@ -12,7 +12,7 @@ CDamageInfo::CDamageInfo(const DataSpec::SShotParam& other)
, xc_radiusDamage(other.radiusDamage)
, x10_radius(other.radius)
, x14_knockback(other.knockback)
, x18_noImmunity(other.noImmunity) {}
, x18_24_noImmunity(other.noImmunity) {}
CDamageInfo& CDamageInfo::operator=(const DataSpec::SShotParam& other) {
x0_weaponMode = CWeaponMode(EWeaponType(other.weaponType), other.charged, other.combo, other.instaKill);
......@@ -20,7 +20,7 @@ CDamageInfo& CDamageInfo::operator=(const DataSpec::SShotParam& other) {
xc_radiusDamage = other.radiusDamage;
x10_radius = other.radius;
x14_knockback = other.knockback;
x18_noImmunity = other.noImmunity;
x18_24_noImmunity = other.noImmunity;
return *this;
}
......@@ -52,6 +52,6 @@ CDamageInfo::CDamageInfo(const CDamageInfo& other, float dt) {
xc_radiusDamage = x8_damage;
x10_radius = other.x10_radius;
x14_knockback = other.x14_knockback;
x18_noImmunity = true;
x18_24_noImmunity = true;
}
} // namespace urde
......@@ -16,7 +16,7 @@ class CDamageInfo {
float xc_radiusDamage = 0.f;
float x10_radius = 0.f;
float x14_knockback = 0.f;
bool x18_noImmunity = false;
bool x18_24_noImmunity : 1 = false;
public:
constexpr CDamageInfo() = default;
......@@ -53,8 +53,8 @@ public:
float GetRadiusDamage() const { return xc_radiusDamage; }
void SetRadiusDamage(float r) { xc_radiusDamage = r; }
float GetRadiusDamage(const CDamageVulnerability& dVuln) const;
bool NoImmunity() const { return x18_noImmunity; }
void SetNoImmunity(bool b) { x18_noImmunity = b; }
bool NoImmunity() const { return x18_24_noImmunity; }
void SetNoImmunity(bool b) { x18_24_noImmunity = b; }
void MultiplyDamage(float m) {
x8_damage *= m;
xc_radiusDamage *= m;
......
......@@ -34,8 +34,9 @@ constexpr CDamageVulnerability CDamageVulnerability::sPassThroughVulnerability(
EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough,
EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EDeflectType::None);
static constexpr bool is_not_immune(EVulnerability vuln) {
return vuln != EVulnerability::Immune && vuln != EVulnerability::DirectImmune;
static constexpr bool is_not_deflect_direct(EVulnerability vuln) {
return vuln != EVulnerability::Deflect && vuln != EVulnerability::DirectWeak &&
vuln != EVulnerability::DirectNormal && vuln != EVulnerability::DirectImmune;
}
static constexpr bool is_normal_or_weak(EVulnerability vuln) {
......@@ -145,34 +146,40 @@ bool CDamageVulnerability::WeaponHurts(const CWeaponMode& mode, bool ignoreDirec
}
bool CDamageVulnerability::WeaponHits(const CWeaponMode& mode, bool checkDirect) const {
if (mode.GetType() == EWeaponType::None || mode.GetType() > EWeaponType::OrangePhazon)
if (mode.GetType() <= EWeaponType::None || mode.GetType() > EWeaponType::OrangePhazon) {
return false;
if (mode.IsInstantKill())
}
if (mode.IsInstantKill()) {
return true;
}
bool normalVuln;
if (!checkDirect)
normalVuln = (&x0_power)[u32(mode.GetType())] != EVulnerability::Immune;
else
normalVuln = is_not_immune((&x0_power)[u32(mode.GetType())]);
if (!checkDirect) {
normalVuln = (&x0_power)[u32(mode.GetType())] != EVulnerability::Deflect;
} else {
normalVuln = is_not_deflect_direct((&x0_power)[u32(mode.GetType())]);
}
bool chargedVuln = true;
bool comboedVuln = true;
if (mode.GetType() < EWeaponType::Bomb) {
const EVulnerability chargedPowerVuln = (&x3c_chargedPower)[u32(mode.GetType())];
const EVulnerability superMissileVuln = (&x4c_superMissile)[u32(mode.GetType())];
if (!checkDirect) {
chargedVuln = (&x3c_chargedPower)[u32(mode.GetType())] != EVulnerability::Immune;
comboedVuln = (&x4c_superMissile)[u32(mode.GetType())] != EVulnerability::Immune;
chargedVuln = chargedPowerVuln != EVulnerability::Deflect;
comboedVuln = superMissileVuln != EVulnerability::Deflect;
} else {
chargedVuln = is_not_immune((&x3c_chargedPower)[u32(mode.GetType())]);
comboedVuln = is_not_immune((&x4c_superMissile)[u32(mode.GetType())]);
chargedVuln = is_not_deflect_direct(chargedPowerVuln);
comboedVuln = is_not_deflect_direct(superMissileVuln);
}
}
if (normalVuln && !mode.IsCharged() && !mode.IsComboed())
if (normalVuln && !mode.IsCharged() && !mode.IsComboed()) {
return true;
if (chargedVuln && mode.IsCharged())
}
if (chargedVuln && mode.IsCharged()) {
return true;
}
return comboedVuln && mode.IsComboed();
}
......
......@@ -417,16 +417,14 @@ void CKnockBackController::ValidateState(const CPatterned& parent) {
x80_availableStates.test(1) && x4_activeParms.x0_animState >= EKnockBackAnimationState::Flinch) {
useState = EKnockBackAnimationState::Flinch;
}
} else {
if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Fall) && x80_availableStates.test(4) &&
(x4_activeParms.x0_animState >= EKnockBackAnimationState::Fall ||
(!parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled))) {
useState = EKnockBackAnimationState::Fall;
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled) {
useState = EKnockBackAnimationState::Hurled;
}
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Fall) && x80_availableStates.test(4) &&
(x4_activeParms.x0_animState >= EKnockBackAnimationState::Fall ||
(!parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled))) {
useState = EKnockBackAnimationState::Fall;
} else if (parent.GetBodyController()->HasBodyState(pas::EAnimationState::Hurled) && x80_availableStates.test(3) &&
x4_activeParms.x0_animState >= EKnockBackAnimationState::Hurled) {
useState = EKnockBackAnimationState::Hurled;
}
x4_activeParms.x0_animState =
......@@ -444,8 +442,6 @@ void CKnockBackController::ValidateState(const CPatterned& parent) {
disableFollowup = !x81_27_enableBurn;
break;
case EKnockBackAnimationFollowUp::ExplodeDeath:
disableFollowup = !x81_29_enableExplodeDeath;
break;
case EKnockBackAnimationFollowUp::IceDeath:
disableFollowup = !x81_29_enableExplodeDeath;
break;
......@@ -514,16 +510,17 @@ void CKnockBackController::DoKnockBackAnimation(const zeus::CVector3f& backVec,
void CKnockBackController::ResetKnockBackImpulse(const CPatterned& parent, const zeus::CVector3f& backVec,
float magnitude) {
if (x81_24_autoResetImpulse && x4_activeParms.x0_animState == EKnockBackAnimationState::KnockBack &&
x4_activeParms.x4_animFollowup != EKnockBackAnimationFollowUp::Freeze) {
x50_impulseDir = backVec.canBeNormalized() ? backVec.normalized() : -parent.GetTransform().basis[1];
if (x60_impulseRemTime <= 0.f) {
x5c_impulseMag = magnitude;
} else {
x5c_impulseMag += magnitude * (1.f - x60_impulseRemTime / ImpulseDurationTable[x20_impulseDurationIdx]);
}
x60_impulseRemTime = ImpulseDurationTable[x20_impulseDurationIdx];
if (!x81_24_autoResetImpulse || x4_activeParms.x0_animState != EKnockBackAnimationState::KnockBack ||
x4_activeParms.x4_animFollowup == EKnockBackAnimationFollowUp::Freeze) {
return;
}
x50_impulseDir = backVec.canBeNormalized() ? backVec.normalized() : -parent.GetTransform().frontVector();
if (x60_impulseRemTime <= 0.f) {
x5c_impulseMag = magnitude;
} else {
x5c_impulseMag += magnitude * (1.f - x60_impulseRemTime / ImpulseDurationTable[x20_impulseDurationIdx]);
}
x60_impulseRemTime = ImpulseDurationTable[x20_impulseDurationIdx];
}
void CKnockBackController::DoDeferredKnockBack(CStateManager& mgr, CPatterned& parent) {
......@@ -537,7 +534,7 @@ void CKnockBackController::DoDeferredKnockBack(CStateManager& mgr, CPatterned& p
ResetKnockBackImpulse(parent, backVec, 2.f);
x82_25_inDeferredKnockBack = true;
parent.KnockBack(backVec, mgr, CDamageInfo(CWeaponMode{x14_deferWeaponType, false, true, false}, 0.f, 0.f, 10.f),
EKnockBackType::Radius, x82_25_inDeferredKnockBack, 10.f);
EKnockBackType::Direct, x82_25_inDeferredKnockBack, 10.f);
x82_25_inDeferredKnockBack = false;
}
}
......@@ -584,15 +581,11 @@ EKnockBackWeaponType CKnockBackController::GetKnockBackWeaponType(const CDamageI
stacking = 2;
}
if (wType > EWeaponType::Phazon) {
return EKnockBackWeaponType::Invalid;
}
switch (wType) {
case EWeaponType::Power:
return EKnockBackWeaponType(type != EKnockBackType::Direct ? stacking : stacking + 1);
return EKnockBackWeaponType(type != EKnockBackType::Radius ? stacking : stacking + 1);
case EWeaponType::Ice:
return EKnockBackWeaponType(type != EKnockBackType::Direct ? stacking + 8 : stacking + 9);
return EKnockBackWeaponType(type != EKnockBackType::Radius ? stacking + 8 : stacking + 9);
case EWeaponType::Wave:
return EKnockBackWeaponType(stacking + 4);
case EWeaponType::Plasma:
......@@ -632,7 +625,7 @@ void CKnockBackController::KnockBack(const zeus::CVector3f& backVec, CStateManag
zeus::CVector3f vec(backVec.toVec2f());
if (!vec.isMagnitudeSafe()) {
vec = -parent.GetTransform().basis[1];
vec = -parent.GetTransform().frontVector();
}
SelectDamageState(parent, info, info.GetWeaponMode().GetType(), type);
......
......@@ -13,7 +13,7 @@ namespace urde {
class CDamageInfo;
class CPatterned;
enum class EKnockBackType { Direct, Radius };
enum class EKnockBackType { Radius, Direct };
enum class EKnockBackVariant { Small, Medium, Large };
......
......@@ -72,7 +72,7 @@ CPatterned::CPatterned(ECharacter character, TUniqueId uid, std::string_view nam
x458_iceShatterSfx = pInfo.x134_iceShatterSfx;
x4f4_intoFreezeDur = pInfo.x100_intoFreezeDur;
x4f8_outofFreezeDur = pInfo.x104_outofFreezeDur;
x4fc_ = pInfo.x108_;
x4fc_freezeDur = pInfo.x108_freezeDur;
x508_colliderType = colliderType;
x50c_baseDamageMag = actorParms.GetThermalMag();
x514_deathExplosionOffset = pInfo.x110_particle1Scale;
......@@ -151,19 +151,22 @@ void CPatterned::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
if (TCastToConstPtr<CGameProjectile> proj = mgr.GetObjectById(uid)) {
const CDamageInfo& info = proj->GetDamageInfo();
if (info.GetWeaponMode().GetType() == EWeaponType::Wave) {
if (x460_knockBackController.x81_26_enableShock && info.GetWeaponMode().IsComboed() && HealthInfo(mgr)) {
if (x460_knockBackController.x81_26_enableShock && info.GetWeaponMode().IsComboed() &&
HealthInfo(mgr) != nullptr) {
x401_31_nextPendingShock = true;
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::Radius, false, info.GetKnockBackPower());
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::Direct, false, info.GetKnockBackPower());
x460_knockBackController.DeferKnockBack(EWeaponType::Wave);
}
} else if (info.GetWeaponMode().GetType() == EWeaponType::Plasma) {
if (x460_knockBackController.x81_27_enableBurn && info.GetWeaponMode().IsCharged() && HealthInfo(mgr)) {
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::Radius, false, info.GetKnockBackPower());
if (x460_knockBackController.x81_27_enableBurn && info.GetWeaponMode().IsCharged() &&
HealthInfo(mgr) != nullptr) {
KnockBack(GetTransform().frontVector(), mgr, info, EKnockBackType::Direct, false, info.GetKnockBackPower());
x460_knockBackController.DeferKnockBack(EWeaponType::Plasma);
}
}
if (mgr.GetPlayer().GetUniqueId() == proj->GetOwnerId())
if (mgr.GetPlayer().GetUniqueId() == proj->GetOwnerId()) {
x400_24_hitByPlayerProjectile = true;
}
}
break;
}
......@@ -1724,5 +1727,4 @@ bool CPatterned::ApplyBoneTracking() const {
return false;
}
} // namespace urde
......@@ -214,7 +214,7 @@ protected:
float x4f0_predictedLeashTime = 0.f;
float x4f4_intoFreezeDur;
float x4f8_outofFreezeDur;
float x4fc_;
float x4fc_freezeDur;
float x500_preThinkDt = 0.f;
float x504_damageDur = 0.f;
EColliderType x508_colliderType;
......
......@@ -35,7 +35,7 @@ CPatternedInfo::CPatternedInfo(CInputStream& in, u32 pcount)
, xfc_stateMachineId(in.readUint32Big())
, x100_intoFreezeDur(in.readFloatBig())
, x104_outofFreezeDur(in.readFloatBig())
, x108_(in.readFloatBig())
, x108_freezeDur(in.readFloatBig())
, x10c_pathfindingIndex(in.readUint32Big())
, x110_particle1Scale(zeus::CVector3f::ReadBig(in))
, x11c_particle1(in)
......
......@@ -42,7 +42,7 @@ class CPatternedInfo {
CAssetId xfc_stateMachineId;
float x100_intoFreezeDur;
float x104_outofFreezeDur;
float x108_;
float x108_freezeDur;
u32 x10c_pathfindingIndex;
......@@ -69,5 +69,6 @@ public:
const CAnimationParameters& GetAnimationParameters() const { return xec_animParams; }
u32 GetPathfindingIndex() const { return x10c_pathfindingIndex; }
bool GetActive() const { return xf8_active; }
void SetActive(bool active) { xf8_active = active; }
};
} // namespace urde
......@@ -584,6 +584,7 @@ public:
float GetStaticTimer() const { return x740_staticTimer; }
float GetDeathTime() const { return x9f4_deathTime; }
const CPlayerEnergyDrain& GetEnergyDrain() const { return x274_energyDrain; }
CPlayerEnergyDrain& GetEnergyDrain() { return x274_energyDrain; }
EPlayerZoneInfo GetOrbitZone() const { return x330_orbitZoneMode; }
EPlayerZoneType GetOrbitType() const { return x334_orbitType; }
const zeus::CTransform& GetFirstPersonCameraTransform(const CStateManager& mgr) const;
......@@ -618,5 +619,6 @@ public:
const zeus::CVector3f& GetOrbitPoint() const { return x314_orbitPoint; }
float GetAverageSpeed() const;
bool IsInWaterMovement() const { return x9c4_31_inWaterMovement; }
void SetNoDamageLoopSfx(bool val) { x9c7_24_noDamageLoopSfx = val; }
};
} // namespace urde
......@@ -26,7 +26,8 @@ private:
zeus::CVector3f x1c_position;
public:
CTeamAiRole(TUniqueId ownerId, ETeamAiRole a, ETeamAiRole b, ETeamAiRole c)
CTeamAiRole(TUniqueId ownerId, ETeamAiRole a = ETeamAiRole::Invalid, ETeamAiRole b = ETeamAiRole::Invalid,
ETeamAiRole c = ETeamAiRole::Invalid)
: x0_ownerId(ownerId), x4_roleA(a), x8_roleB(b), xc_roleC(c) {}
TUniqueId GetOwnerId() const { return x0_ownerId; }
bool HasTeamAiRole() const { return false; }
......@@ -103,7 +104,9 @@ public:
void RemoveRangedAttacker(TUniqueId aiId);
bool HasMeleeAttackers() const { return !x68_meleeAttackers.empty(); }
const std::vector<TUniqueId>& GetMeleeAttackers() const { return x68_meleeAttackers; }
bool HasRangedAttackers() const { return !x78_rangedAttackers.empty(); }
const std::vector<TUniqueId>& GetRangedAttackers() const { return x78_rangedAttackers; }
s32 GetNumRoles() const { return x58_roles.size(); }
const std::vector<CTeamAiRole>& GetRoles() const { return x58_roles; }
s32 GetMaxMeleeAttackerCount() const { return x34_data.x10_maxMeleeAttackerCount; }
......
......@@ -2010,7 +2010,7 @@ CEntity* ScriptLoader::LoadDrone(CStateManager& mgr, CInputStream& in, int propC
CEntity* ScriptLoader::LoadMetroid(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {
if (!EnsurePropertyCount(propCount, MP1::CMetroidData::GetNumProperties(), "Metroid"))
return nullptr;
#if 0
std::string name = mgr.HashInstanceName(in);
CPatterned::EFlavorType flavor = CPatterned::EFlavorType(in.readUint32Big());
zeus::CTransform xf = LoadEditorTransform(in);
......@@ -2028,12 +2028,8 @@ CEntity* ScriptLoader::LoadMetroid(CStateManager& mgr, CInputStream& in, int pro
CModelData mData(
CAnimRes(animParms.GetACSFile(), animParms.GetCharacter(), scale, animParms.GetInitialAnimation(), true));
return new MP1::CMetroid(mgr.AllocateUniqueId(), name, flavor, info, xf, std::move(mData), pInfo, actParms,
metData,
kInvalidUniqueId);
#else
return nullptr;
#endif
return new MP1::CMetroid(mgr.AllocateUniqueId(), name, flavor, info, xf, std::move(mData), pInfo, actParms, metData,
kInvalidUniqueId);
}
CEntity* ScriptLoader::LoadDebrisExtended(CStateManager& mgr, CInputStream& in, int propCount,
......
......@@ -172,10 +172,10 @@ private:
destroy(Tp& t, std::enable_if_t<!std::is_destructible_v<Tp> || std::is_trivially_destructible_v<Tp>>* = nullptr) {}
public:
reserved_vector() noexcept(std::is_nothrow_constructible_v<T>) : x0_size(0) {}
constexpr reserved_vector() noexcept(std::is_nothrow_constructible_v<T>) : x0_size(0) {}
template <size_t LN>
reserved_vector(const T (&l)[LN]) noexcept(std::is_nothrow_copy_constructible_v<T>) : x0_size(LN) {
constexpr reserved_vector(const T (&l)[LN]) noexcept(std::is_nothrow_copy_constructible_v<T>) : x0_size(LN) {
static_assert(LN <= N, "initializer array too large for reserved_vector");
for (size_t i = 0; i < LN; ++i) {
::new (static_cast<void*>(std::addressof(_value(i)))) T(l[i]);
......