Initial ElitePirate imps

This commit is contained in:
Phillip Stephens 2020-03-11 05:25:45 -07:00 committed by Luke Street
parent e5df609673
commit 566c356612
2 changed files with 38 additions and 7 deletions

View File

@ -2,6 +2,7 @@
#include "Runtime/Collision/CCollisionActorManager.hpp"
#include "Runtime/CSimplePool.hpp"
#include "Runtime/CStateManager.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/World/CPatternedInfo.hpp"
#include "Runtime/World/ScriptLoader.hpp"
@ -39,6 +40,7 @@ CElitePirateData::CElitePirateData(CInputStream& in, u32 propCount)
, xec_(zeus::degToRad(in.readFloatBig()))
, xf0_(in.readUint32Big())
, xf4_(CSfxManager::TranslateSFXID(in.readUint32Big()))
, xf6_(CSfxManager::TranslateSFXID(in.readUint32Big()))
, xf8_(in)
, xfc_(in)
, x118_(in)
@ -71,6 +73,36 @@ CElitePirate::CElitePirate(TUniqueId uid, std::string_view name, const CEntityIn
void CElitePirate::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CElitePirate::Think(float dt, CStateManager& mgr) { CPatterned::Think(dt, mgr); }
void CElitePirate::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
switch (msg) {
case EScriptObjectMessage::Activate: {
if (V179())
x730_->SetActive(mgr, true);
if (CEntity* ent = mgr.ObjectById(x772_))
ent->SetActive(true);
break;
}
case EScriptObjectMessage::Deactivate: {
if (V179())
x730_->SetActive(mgr, false);
x5d4_->SetActive(mgr, false);
if (CEntity* ent = mgr.ObjectById(x772_))
ent->SetActive(false);
break;
}
case EScriptObjectMessage::Alert:
x988_28_ = true;
break;
case EScriptObjectMessage::Touched:
break;
case EScriptObjectMessage::Registered:
x450_bodyController->Activate(mgr);
SetupCollisionManager(mgr);
default:
break;
}
CPatterned::AcceptScriptMsg(msg, uid, mgr);
}
void CElitePirate::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { CPatterned::PreRender(mgr, frustum); }
@ -91,16 +123,14 @@ void CElitePirate::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node
const CCollisionPrimitive* CElitePirate::GetCollisionPrimitive() const {
return CPhysicsActor::GetCollisionPrimitive();
}
void CElitePirate::KnockBack(const zeus::CVector3f& pos, CStateManager& mgr, const CDamageInfo& info, EKnockBackType type,
bool inDeferred, float magnitude) {
void CElitePirate::KnockBack(const zeus::CVector3f& pos, CStateManager& mgr, const CDamageInfo& info,
EKnockBackType type, bool inDeferred, float magnitude) {
CPatterned::KnockBack(pos, mgr, info, type, inDeferred, magnitude);
}
void CElitePirate::TakeDamage(const zeus::CVector3f& pos, float arg) { CPatterned::TakeDamage(pos, arg); }
void CElitePirate::Patrol(CStateManager& mgr, EStateMsg msg, float dt) { CPatterned::Patrol(mgr, msg, dt); }
void CElitePirate::PathFind(CStateManager& mgr, EStateMsg msg, float dt) { CPatterned::PathFind(mgr, msg, dt); }
void CElitePirate::TargetPatrol(CStateManager& mgr, EStateMsg msg, float dt) {
CPatterned::TargetPatrol(mgr, msg, dt);
}
void CElitePirate::TargetPatrol(CStateManager& mgr, EStateMsg msg, float dt) { CPatterned::TargetPatrol(mgr, msg, dt); }
void CElitePirate::Halt(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Halt(mgr, msg, dt); }
void CElitePirate::Run(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Run(mgr, msg, dt); }
void CElitePirate::Generate(CStateManager& mgr, EStateMsg msg, float dt) { CAi::Generate(mgr, msg, dt); }

View File

@ -40,7 +40,8 @@ class CElitePirateData {
float xe8_;
float xec_;
u32 xf0_;
u32 xf4_;
u16 xf4_;
u16 xf6_;
CAssetId xf8_;
CDamageInfo xfc_;
CAssetId x118_;
@ -170,7 +171,7 @@ public:
virtual bool V180() { return true; }
virtual void V181(CStateManager& mgr);
virtual void v182(CStateManager& mgr, bool b);
virtual SUnknownStruct2 V182() const {return {x5d8_.GetXF8(), x5d8_.GetXFC(), x5d8_.GetX118(), x5d8_.GetX11C()}; }
virtual SUnknownStruct2 V183() const {return {x5d8_.GetXF8(), x5d8_.GetXFC(), x5d8_.GetX118(), x5d8_.GetX11C()}; }
};
} // namespace MP1
} // namespace urde