...
 
Commits (2)
......@@ -45,6 +45,7 @@ CCameraShakeData::CCameraShakeData(CInputStream& in) {
in.readFloatBig();
in.readFloatBig();
in.readFloatBig();
in.readFloatBig();
in.readBool();
BuildProjectileCameraShake(0.5f, 0.75f);
}
......
......@@ -71,6 +71,16 @@ bool CModelData::IsLoaded(int shaderIdx) const {
return true;
}
u32 CModelData::GetNumMaterialSets() const {
if (x10_animData)
return x10_animData->GetModelData()->GetModel()->GetNumMaterialSets();
if (x1c_normalModel)
return x1c_normalModel->GetNumMaterialSets();
return 1;
}
CModelData::EWhichModel CModelData::GetRenderingModel(const CStateManager& stateMgr) {
switch (stateMgr.GetPlayerState()->GetActiveVisor(stateMgr)) {
case CPlayerState::EPlayerVisor::XRay:
......
......@@ -142,6 +142,7 @@ public:
const TLockedToken<CModel>& GetXRayModel() const { return x2c_xrayModel; }
const TLockedToken<CModel>& GetThermalModel() const { return x3c_infraModel; }
bool IsNull() const { return !x10_animData && !x1c_normalModel; }
u32 GetNumMaterialSets() const;
const zeus::CVector3f& GetScale() const { return x0_scale; }
void SetScale(const zeus::CVector3f& scale) { x0_scale = scale; }
......
......@@ -20,6 +20,12 @@ struct SOBBJointInfo {
zeus::CVector3f bounds;
};
struct SOBBRadiiJointInfo {
const char* from;
const char* to;
float radius;
};
struct SSphereJointInfo {
const char* name;
float radius;
......
......@@ -295,6 +295,7 @@ public:
const CBooModel& GetInstance() const { return *x28_modelInst; }
std::unique_ptr<CBooModel> MakeNewInstance(int shaderIdx, int subInsts, bool lockParent = true);
void UpdateLastFrame() const { const_cast<CModel&>(*this).x38_lastFrame = CGraphics::GetFrameCounter(); }
u32 GetNumMaterialSets() const { return x18_matSets.size(); }
size_t GetPoolVertexOffset(size_t idx) const;
zeus::CVector3f GetPoolVertex(size_t idx) const;
......
This diff is collapsed.
......@@ -3,13 +3,19 @@
#include <string_view>
#include "Runtime/Camera/CCameraShakeData.hpp"
#include "Runtime/Character/CBoneTracking.hpp"
#include "Runtime/Collision/CCollisionActorManager.hpp"
#include "Runtime/Weapon/CBeamInfo.hpp"
#include "Runtime/Weapon/CProjectileInfo.hpp"
#include "Runtime/World/CDamageInfo.hpp"
#include "Runtime/World/CPatterned.hpp"
#include "Runtime/World/CProjectedShadow.hpp"
namespace urde {
class CParticleElectric;
namespace MP1 {
class CRidleyData {
friend class CRidley;
CAssetId x0_;
CAssetId x4_;
CAssetId x8_;
......@@ -58,12 +64,186 @@ public:
};
class CRidley : public CPatterned {
CRidleyData x568_;
CRidleyData x568_data;
std::unique_ptr<CCollisionActorManager> x980_;
std::unique_ptr<CCollisionActorManager> x984_;
TUniqueId x988_headId = kInvalidUniqueId;
TUniqueId x98a_breastPlateId = kInvalidUniqueId;
TToken<CGenDescription> x98c_;
CModelData x998_;
CModelData x9e4_;
CSegId xa30_breastPlateSegId;
bool xa31_24_ : 1;
bool xa31_25_ : 1;
bool xa31_26_ : 1;
bool xa31_27_ : 1;
bool xa31_28_ : 1;
bool xa31_29_ : 1;
bool xa31_30_ : 1;
bool xa31_31_ : 1;
bool xa32_24_ : 1;
bool xa32_25_ : 1;
bool xa32_26_ : 1;
bool xa32_27_ : 1;
bool xa32_28_ : 1;
bool xa32_29_ : 1;
bool xa32_30_ : 1;
bool xa32_31_ : 1;
bool xa33_24_ : 1;
bool xa33_25_ : 1;
bool xa33_26_ : 1;
bool xa33_27_ : 1;
bool xa33_28_ : 1;
bool xa33_29_ : 1;
bool xa33_30_ : 1;
bool xa33_31_ : 1;
bool xa34_24_ : 1;
bool xa34_25_ : 1;
bool xa34_26_ : 1;
CModelData xa38_;
zeus::CTransform xa84_;
float xab4_ = 20.f;
float xab8_ = 12.f;
float xabc_ = 40.f;
float xac0_ = 10;
zeus::CAABox xac4_ = zeus::skInvertedBox;
float xadc_;
float xae0_;
u32 xae4_;
float xae8_;
zeus::CVector3f xaec_;
zeus::CVector3f xaf8_;
u32 xb04_ = 2;
u32 xb08_;
u32 xb0c_ = 0;
float xb10_ = 0.f;
float xb14_;
float xb18_;
float xb1c_;
float xb20_ = 0.f;
float xb24_ = 0.f;
CSegId xb28_;
CBoneTracking xb2c_;
TUniqueId xb64_ = kInvalidUniqueId;
CProjectileInfo xb68_;
CSegId xb90_headSegId;
CSegId xb91_mouthSegId;
u8 xb92_;
u8 xb93_;
zeus::CTransform xb94_;
zeus::CVector3f xbc4_;
zeus::CVector3f xbd0_;
u32 xbdc_;
u32 xbe0_;
zeus::CVector3f xbe4_;
zeus::CVector3f xbf0_ = zeus::skForward;
float xc08_ = 0.f;
float xc0c_ = 0.f;
float xc10_ = 120.f;
CProjectileInfo xc14_;
CProjectileInfo xc3c_;
u32 xc64_aiStage = 2;
zeus::CVector3f xc68_;
u32 xc74_ = 0;
float xc78_ = 0.f;
float xc7c_ = 0.f;
float xc80_ = 0.f;
u32 xc84_;
u32 xc88_ = 4;
CDamageInfo xc8c_;
u32 xca8_ = 0;
u32 xcac_ = 0;
u32 xcb0_ = 0;
u32 xcb4_ = 0;
float xcb8_ = 0.f;
float xcbc_ = 0.f;
u32 xcc0_ = 1;
u32 xcc4_ = 1;
float xcc8_ = 0.f;
TLockedToken<CElectricDescription> xcd0_;
bool xcdc_;
std::unique_ptr<CParticleElectric> xce0_;
std::vector<CSegId> xce4_; // was rstl::reserved_vector<CSegId, 30>
float xd08_;
CSfxHandle xd0c_;
std::unique_ptr<CProjectedShadow> xd10_;
u32 xd14_;
void SetupCollisionActorManager(CStateManager& mgr);
void SetupCollisionActors(CStateManager& mgr);
void sub80257650(CStateManager& mgr);
void sub80256914(float f1, bool r4);
void sub802560d0(float dt);
void sub802563a8(float dt);
void sub80256b14(float dt, CStateManager& mgr);
void sub80256624(float dt, CStateManager& mgr);
public:
DEFINE_PATTERNED(Ridley)
CRidley(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&, const CPatternedInfo&,
const CActorParameters&, CInputStream&, u32);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
void Think(float dt, CStateManager& mgr) override;
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
void Render(const CStateManager& mgr) const override;
void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const override;
const CDamageVulnerability* GetDamageVulnerability() const override {
return &CDamageVulnerability::ImmuneVulnerabilty();
}
zeus::CVector3f GetAimPosition(const CStateManager& mgr, float dt) const override {
return GetLctrTransform((xc64_aiStage == 3 && !xa32_28_) ? xb90_headSegId : xa30_breastPlateSegId).origin;
}
float GetGravityConstant() const override { return 50.f; }
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&,
const CWeaponMode&, EProjectileAttrib) const override {
return EWeaponCollisionResponseTypes::EnemyNormal;
}
void Patrol(CStateManager& mgr, EStateMsg msg, float arg) override;
void Dead(CStateManager& mgr, EStateMsg msg, float arg) override;
void Generate(CStateManager& mgr, EStateMsg msg, float arg) override;
void Attack(CStateManager& mgr, EStateMsg msg, float arg) override;
void LoopedAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void JumpBack(CStateManager& mgr, EStateMsg msg, float arg) override;
void DoubleSnap(CStateManager& mgr, EStateMsg msg, float arg) override;
void CoverAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void FadeOut(CStateManager& mgr, EStateMsg msg, float arg) override;
void Taunt(CStateManager& mgr, EStateMsg msg, float arg) override;
void Flee(CStateManager& mgr, EStateMsg msg, float arg) override;
void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void Flinch(CStateManager& mgr, EStateMsg msg, float arg) override;
void Hurled(CStateManager& mgr, EStateMsg msg, float arg) override;
void TelegraphAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void Jump(CStateManager& mgr, EStateMsg msg, float arg) override;
void Explode(CStateManager& mgr, EStateMsg msg, float arg) override;
void Dodge(CStateManager& mgr, EStateMsg msg, float arg) override;
void Retreat(CStateManager& mgr, EStateMsg msg, float arg) override;
void Approach(CStateManager& mgr, EStateMsg msg, float arg) override;
void Enraged(CStateManager& mgr, EStateMsg msg, float arg) override;
void SpecialAttack(CStateManager& mgr, EStateMsg msg, float arg) override;
void Land(CStateManager& mgr, EStateMsg msg, float arg) override;
bool Attacked(CStateManager& mgr, float arg) override;
bool TooClose(CStateManager& mgr, float arg) override;
bool InRange(CStateManager& mgr, float arg) override;
bool ShouldAttack(CStateManager& mgr, float arg) override;
bool ShouldDoubleSnap(CStateManager& mgr, float arg) override;
bool ShouldTurn(CStateManager& mgr, float arg) override;
bool HitSomething(CStateManager& mgr, float arg) override;
bool AttackOver(CStateManager& mgr, float arg) override;
bool ShouldTaunt(CStateManager& mgr, float arg) override;
bool ShouldFire(CStateManager& mgr, float arg) override;
bool ShouldDodge(CStateManager& mgr, float arg) override;
bool ShouldRetreat(CStateManager& mgr, float arg) override;
bool ShouldCrouch(CStateManager& mgr, float arg) override;
bool ShotAt(CStateManager& mgr, float arg) override;
bool SetAIStage(CStateManager& mgr, float arg) override;
bool AIStage(CStateManager& mgr, float arg) override;
bool ShouldStrafe(CStateManager& mgr, float arg) override;
bool IsDizzy(CStateManager& mgr, float arg) override;
};
} // namespace MP1
} // namespace urde
......@@ -421,13 +421,13 @@ void CActor::AddMaterial(EMaterialTypes type, CStateManager& mgr) {
void CActor::AddMaterial(const CMaterialList& l) { x68_material.Add(l); }
void CActor::CreateShadow(bool b) {
if (b) {
void CActor::CreateShadow(bool enabled) {
if (enabled) {
_CreateShadow();
if (!xe5_24_shadowEnabled && x94_simpleShadow)
xe5_25_shadowDirty = true;
}
xe5_24_shadowEnabled = b;
xe5_24_shadowEnabled = enabled;
}
void CActor::_CreateShadow() {
......
......@@ -36,11 +36,8 @@ class CDamageVulnerability {
EVulnerability x58_flamethrower;
EDeflectType x5c_deflected;
/* The following two values are hard coded to bizarre values on purpose to more closely reflect the behavior seen
* in-game.
*/
EDeflectType x60_chargedDeflected = EDeflectType(6);
EDeflectType x64_comboDeflected = EDeflectType(0x3e666666);
EDeflectType x60_chargedDeflected;
EDeflectType x64_comboDeflected;
void ConstructNew(CInputStream& in, int propCount);
......
......@@ -570,8 +570,11 @@ public:
bool IsNewScanScanning() const { return x9c6_30_newScanScanning; }
float GetThreatOverride() const { return xa1c_threatOverride; }
bool IsOverrideRadarRadius() const { return x9c6_31_overrideRadarRadius; }
void SetIsOverrideRadarRadius(bool override) { x9c6_31_overrideRadarRadius = override; }
float GetRadarXYRadiusOverride() const { return xa20_radarXYRadiusOverride; }
void SetRadarXYRadiusOverride(float xyOverride) { xa20_radarXYRadiusOverride = xyOverride; }
float GetRadarZRadiusOverride() const { return xa24_radarZRadiusOverride; }
void SetRadarZRadiusOverride(float zOverride) { xa24_radarZRadiusOverride = zOverride; }
bool ObjectInScanningRange(TUniqueId id, const CStateManager& mgr) const;
float GetMorphTime() const { return x574_morphTime; }
float GetMorphDuration() const { return x578_morphDuration; }
......
......@@ -411,7 +411,7 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
case Phase::Done:
return true;
default:
return false;
break;
}
return false;
......