CGrenadeLauncher implementation

This commit is contained in:
Luke Street 2020-03-29 23:45:55 -04:00
parent 4ada5a00cb
commit fbbd73db48
4 changed files with 261 additions and 54 deletions

View File

@ -173,7 +173,7 @@ void CElitePirate::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta
} }
break; break;
} }
if (!x988_31_) { // TODO is this right? if (x988_31_) {
if (x420_curDamageRemTime <= 0.f) { if (x420_curDamageRemTime <= 0.f) {
CDamageInfo info = GetContactDamage(); CDamageInfo info = GetContactDamage();
info.SetDamage(0.5f * info.GetDamage()); info.SetDamage(0.5f * info.GetDamage());
@ -783,16 +783,13 @@ bool CElitePirate::IsArmClawCollider(TUniqueId uid, const rstl::reserved_vector<
void CElitePirate::AddCollisionList(const SJointInfo* joints, size_t count, void CElitePirate::AddCollisionList(const SJointInfo* joints, size_t count,
std::vector<CJointCollisionDescription>& outJoints) const { std::vector<CJointCollisionDescription>& outJoints) const {
const CAnimData* animData = GetModelData()->GetAnimationData(); const CAnimData* animData = GetModelData()->GetAnimationData();
for (size_t i = 0; i < count; ++i) { for (size_t i = 0; i < count; ++i) {
const auto& joint = joints[i]; const auto& joint = joints[i];
const CSegId from = animData->GetLocatorSegId(joint.from); const CSegId from = animData->GetLocatorSegId(joint.from);
const CSegId to = animData->GetLocatorSegId(joint.to); const CSegId to = animData->GetLocatorSegId(joint.to);
if (to.IsInvalid() || from.IsInvalid()) { if (to.IsInvalid() || from.IsInvalid()) {
continue; continue;
} }
outJoints.emplace_back(CJointCollisionDescription::SphereSubdivideCollision( outJoints.emplace_back(CJointCollisionDescription::SphereSubdivideCollision(
to, from, joint.radius, joint.separation, CJointCollisionDescription::EOrientationType::One, joint.from, 10.f)); to, from, joint.radius, joint.separation, CJointCollisionDescription::EOrientationType::One, joint.from, 10.f));
} }
@ -801,15 +798,12 @@ void CElitePirate::AddCollisionList(const SJointInfo* joints, size_t count,
void CElitePirate::AddSphereCollisionList(const SSphereJointInfo* joints, size_t count, void CElitePirate::AddSphereCollisionList(const SSphereJointInfo* joints, size_t count,
std::vector<CJointCollisionDescription>& outJoints) const { std::vector<CJointCollisionDescription>& outJoints) const {
const CAnimData* animData = GetModelData()->GetAnimationData(); const CAnimData* animData = GetModelData()->GetAnimationData();
for (size_t i = 0; i < count; ++i) { for (size_t i = 0; i < count; ++i) {
const auto& joint = joints[i]; const auto& joint = joints[i];
const CSegId seg = animData->GetLocatorSegId(joint.name); const CSegId seg = animData->GetLocatorSegId(joint.name);
if (seg.IsInvalid()) { if (seg.IsInvalid()) {
continue; continue;
} }
outJoints.emplace_back(CJointCollisionDescription::SphereCollision(seg, joint.radius, joint.name, 10.f)); outJoints.emplace_back(CJointCollisionDescription::SphereCollision(seg, joint.radius, joint.name, 10.f));
} }
} }
@ -891,7 +885,7 @@ bool CElitePirate::IsArmClawCollider(std::string_view name, std::string_view loc
} }
void CElitePirate::CreateGrenadeLauncher(CStateManager& mgr, TUniqueId uid) { void CElitePirate::CreateGrenadeLauncher(CStateManager& mgr, TUniqueId uid) {
CAnimationParameters& params = x5d8_data.x90_launcherAnimParams; const CAnimationParameters& params = x5d8_data.x90_launcherAnimParams;
if (!params.GetACSFile().IsValid()) { if (!params.GetACSFile().IsValid()) {
return; return;
} }
@ -1068,24 +1062,22 @@ void CElitePirate::ExtendTouchBounds(CStateManager& mgr, const rstl::reserved_ve
} }
bool CElitePirate::ShouldFireFromLauncher(CStateManager& mgr, TUniqueId launcherId) { bool CElitePirate::ShouldFireFromLauncher(CStateManager& mgr, TUniqueId launcherId) {
if (x7b8_attackTimer <= 0.f && launcherId != kInvalidUniqueId) { if (x7b8_attackTimer > 0.f || launcherId == kInvalidUniqueId)
return false;
const CActor* launcher = static_cast<const CActor*>(mgr.GetObjectById(launcherId)); const CActor* launcher = static_cast<const CActor*>(mgr.GetObjectById(launcherId));
if (launcher != nullptr) { if (launcher == nullptr)
return false;
const zeus::CVector3f& aim = mgr.GetPlayer().GetAimPosition(mgr, 0.f); const zeus::CVector3f& aim = mgr.GetPlayer().GetAimPosition(mgr, 0.f);
if (x300_maxAttackRange * x300_maxAttackRange <= (aim - GetTranslation()).magSquared() && !ShouldTurn(mgr, 0.f)) { if (x300_maxAttackRange * x300_maxAttackRange > (aim - GetTranslation()).magSquared() || ShouldTurn(mgr, 0.f))
return false;
const zeus::CVector3f& origin = sub_80228864(launcher); const zeus::CVector3f& origin = sub_80228864(launcher);
if (!IsPatternObstructed(mgr, origin, aim)) { if (IsPatternObstructed(mgr, origin, aim))
return false;
const zeus::CVector3f& target = CGrenadeLauncher::GrenadeTarget(mgr); const zeus::CVector3f& target = CGrenadeLauncher::GrenadeTarget(mgr);
float angleOut = x5d8_data.xe0_trajectoryInfo.x8_angleMin, velocityOut = x5d8_data.xe0_trajectoryInfo.x0_; float angleOut = x5d8_data.xe0_trajectoryInfo.x8_angleMin, velocityOut = x5d8_data.xe0_trajectoryInfo.x0_;
CGrenadeLauncher::CalculateGrenadeTrajectory(target, origin, x5d8_data.xe0_trajectoryInfo, angleOut, CGrenadeLauncher::CalculateGrenadeTrajectory(target, origin, x5d8_data.xe0_trajectoryInfo, angleOut, velocityOut);
velocityOut);
const zeus::CVector3f& rot = GetTransform().rotate({0.f, std::cos(angleOut), std::sin(angleOut)}); const zeus::CVector3f& rot = GetTransform().rotate({0.f, std::cos(angleOut), std::sin(angleOut)});
return !CPatterned::IsPatternObstructed(mgr, target, target + (7.5f * rot)); return !CPatterned::IsPatternObstructed(mgr, target, target + (7.5f * rot));
}
}
}
}
return false;
} }
bool CElitePirate::ShouldCallForBackupFromLauncher(CStateManager& mgr, TUniqueId uid) { bool CElitePirate::ShouldCallForBackupFromLauncher(CStateManager& mgr, TUniqueId uid) {

View File

@ -144,9 +144,9 @@ public:
void Attack(CStateManager& mgr, EStateMsg msg, float dt) override; void Attack(CStateManager& mgr, EStateMsg msg, float dt) override;
void Taunt(CStateManager& mgr, EStateMsg msg, float dt) override; void Taunt(CStateManager& mgr, EStateMsg msg, float dt) override;
void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float dt) override; void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float dt) override;
void Cover(CStateManager& mgr, EStateMsg msg, float dt) override;
void SpecialAttack(CStateManager& mgr, EStateMsg msg, float dt) override; void SpecialAttack(CStateManager& mgr, EStateMsg msg, float dt) override;
void CallForBackup(CStateManager& mgr, EStateMsg msg, float dt) override; void CallForBackup(CStateManager& mgr, EStateMsg msg, float dt) override;
void Cover(CStateManager& mgr, EStateMsg msg, float dt) override;
bool TooClose(CStateManager& mgr, float arg) override; bool TooClose(CStateManager& mgr, float arg) override;
bool InDetectionRange(CStateManager& mgr, float arg) override; bool InDetectionRange(CStateManager& mgr, float arg) override;
bool SpotPlayer(CStateManager& mgr, float arg) override; bool SpotPlayer(CStateManager& mgr, float arg) override;

View File

@ -5,6 +5,9 @@
#include "Runtime/CSimplePool.hpp" #include "Runtime/CSimplePool.hpp"
#include "Runtime/CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Runtime/GameGlobalObjects.hpp" #include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Weapon/CGameProjectile.hpp"
#include "Runtime/World/CExplosion.hpp"
#include "Runtime/World/CPatterned.hpp"
#include "Runtime/World/CPlayer.hpp" #include "Runtime/World/CPlayer.hpp"
namespace urde { namespace urde {
@ -12,19 +15,21 @@ namespace MP1 {
CGrenadeLauncher::CGrenadeLauncher(TUniqueId uid, std::string_view name, const CEntityInfo& info, CGrenadeLauncher::CGrenadeLauncher(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& bounds, const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& bounds,
const CHealthInfo& healthInfo, const CDamageVulnerability& vulnerability, const CHealthInfo& healthInfo, const CDamageVulnerability& vulnerability,
const CActorParameters& actParams, TUniqueId otherId, const CActorParameters& actParams, TUniqueId parentId,
const CGrenadeLauncherData& data, float f1) const CGrenadeLauncherData& data, float f1)
: CPhysicsActor(uid, true, name, info, xf, std::move(mData), {EMaterialTypes::Character, EMaterialTypes::Solid}, bounds, : CPhysicsActor(uid, true, name, info, xf, std::move(mData), {EMaterialTypes::Character, EMaterialTypes::Solid}, bounds,
{1000.f}, actParams, 0.3f, 0.1f) {1000.f}, actParams, 0.3f, 0.1f)
, x25c_(healthInfo) , x25c_healthInfo(healthInfo)
, x264_vulnerability(vulnerability) , x264_vulnerability(vulnerability)
, x2cc_otherId(otherId) , x2cc_parentId(parentId)
, x2d0_data(data) , x2d0_data(data)
, x328_cSphere({{}, mData.GetScale().z()}, {EMaterialTypes::Character, EMaterialTypes::Solid}) , x328_cSphere({{}, mData.GetScale().z()}, {EMaterialTypes::Character, EMaterialTypes::Solid})
, x350_actParms(actParams) , x350_actParms(actParams)
, x3c0_particleGenDesc(g_SimplePool->GetObj({SBIG('PART'), data.x40_})) , x3e8_thermalMag(actParams.GetThermalMag())
, x3d8_(actParams.GetThermalMag())
, x3f8_(f1) { , x3f8_(f1) {
if (data.x40_.IsValid()) {
x3b8_particleGenDesc = g_SimplePool->GetObj({SBIG('PART'), data.x40_});
}
GetModelData()->EnableLooping(true); GetModelData()->EnableLooping(true);
const CPASDatabase& pasDatabase = GetModelData()->GetAnimationData()->GetCharacterInfo().GetPASDatabase(); const CPASDatabase& pasDatabase = GetModelData()->GetAnimationData()->GetCharacterInfo().GetPASDatabase();
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
@ -81,5 +86,215 @@ void CGrenadeLauncher::CalculateGrenadeTrajectory(const zeus::CVector3f& target,
angleOut = angle; angleOut = angle;
velocityOut = velocity; velocityOut = velocity;
} }
void CGrenadeLauncher::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
CActor::AcceptScriptMsg(msg, uid, mgr);
switch (msg) {
case EScriptObjectMessage::Start:
if (x2cc_parentId == uid && x258_started != 1) {
x258_started = 1;
sub_80230438();
}
break;
case EScriptObjectMessage::Stop:
if (x2cc_parentId == uid && x258_started != 0) {
x258_started = 0;
sub_80230438();
}
break;
case EScriptObjectMessage::Action:
if (x2cc_parentId == uid && x258_started == 1) {
x3fc_launchGrenade = true;
}
break;
case EScriptObjectMessage::Registered:
sub_80230438();
break;
case EScriptObjectMessage::Damage:
x3ec_damageTimer = 0.33f;
break;
default:
break;
}
}
void CGrenadeLauncher::AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const {
CActor::AddToRenderer(frustum, mgr);
}
std::optional<zeus::CAABox> CGrenadeLauncher::GetTouchBounds() const {
return x328_cSphere.CalculateAABox(GetTransform());
}
void CGrenadeLauncher::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
if (x3f4_color3.a() == 1.f) {
xb4_drawFlags = {2, 0, 3, {x3f4_color3, 1.f}};
} else {
xb4_drawFlags = {5, 0, 3, x3f4_color3};
}
CActor::PreRender(mgr, frustum);
}
void CGrenadeLauncher::Render(const CStateManager& mgr) const {
if (x3fd_visible) {
CPhysicsActor::Render(mgr);
}
}
void CGrenadeLauncher::Think(float dt, CStateManager& mgr) {
if (GetActive()) {
if (x3fc_launchGrenade) {
LaunchGrenade(mgr);
x3fc_launchGrenade = false;
}
UpdateCollision();
UpdateColor(dt);
sub_8022f9e0(mgr, dt);
sub_8022f69c(dt);
const SAdvancementDeltas& deltas = CActor::UpdateAnimation(dt, mgr, true);
MoveToOR(deltas.x0_posDelta, dt);
RotateToOR(deltas.xc_rotDelta, dt);
TCastToPtr<CPatterned> parent = mgr.ObjectById(x2cc_parentId);
if (parent == nullptr || !parent->IsAlive() || parent->HealthInfo(mgr)->GetHP() <= 0.f) {
mgr.SendScriptMsg(parent, GetUniqueId(), EScriptObjectMessage::Damage);
CreateExplosion(mgr);
mgr.FreeScriptObject(GetUniqueId());
}
}
}
void CGrenadeLauncher::Touch(CActor& act, CStateManager& mgr) {
if (TCastToPtr<CGameProjectile> projectile = act) {
if (projectile->GetOwnerId() == mgr.GetPlayer().GetUniqueId() &&
GetDamageVulnerability()->WeaponHurts(CWeaponMode{projectile->GetType()}, false)) {
x348_shotTimer = 0.5f;
CEntity* parent = mgr.ObjectById(x2cc_parentId);
if (parent != nullptr) {
mgr.SendScriptMsg(parent, GetUniqueId(), EScriptObjectMessage::Touched);
}
}
}
}
void CGrenadeLauncher::UpdateCollision() {
x328_cSphere.SetSphereCenter(GetLocatorTransform("lockon_target_LCTR"sv).origin);
}
void CGrenadeLauncher::UpdateColor(float arg) {
if (x348_shotTimer > 0.f) {
x348_shotTimer = std::max(0.f, x348_shotTimer - arg);
x34c_color1 = zeus::CColor::lerp(zeus::skWhite, zeus::skRed, x348_shotTimer);
}
}
void CGrenadeLauncher::sub_8022f69c(float arg) {
if (x3ec_damageTimer <= 0.f) {
xd0_damageMag = x3e8_thermalMag;
} else {
x3ec_damageTimer = std::max(0.f, x3ec_damageTimer - arg);
x3f4_color3 = zeus::CColor::lerp(zeus::skBlack, x3f0_color2, std::clamp(x3ec_damageTimer / 0.33f, 0.f, 1.f));
xd0_damageMag = 5.f * x3ec_damageTimer + x3e8_thermalMag;
}
}
void CGrenadeLauncher::CreateExplosion(CStateManager& mgr) {
if (!x3b8_particleGenDesc)
return;
mgr.AddObject(new CExplosion(*x3b8_particleGenDesc, mgr.AllocateUniqueId(), true,
{GetAreaIdAlways(), CEntity::NullConnectionList}, "Grenade Launcher Explode Fx"sv,
GetTransform(), 0, GetModelData()->GetScale(), zeus::skWhite));
CSfxManager::SfxStart(x2d0_data.x44_launcherExplodeSfx, 1.f, 1.f, false, 0x7f, false, kInvalidAreaId);
}
void CGrenadeLauncher::sub_8022f9e0(CStateManager& mgr, float dt) {
CModelData* modelData = GetModelData();
CAnimData* animData;
if (modelData != nullptr && (animData = modelData->GetAnimationData()) != nullptr && x258_started == 1 && x3fe_) {
const zeus::CVector3f& target = mgr.GetPlayer().GetAimPosition(mgr, 0.f) - GetTranslation();
const zeus::CVector3f& rot = GetTransform().rotate({target.x(), target.y(), 0.f}); // TODO double check
if (rot.canBeNormalized()) {
constexpr float p36d = zeus::degToRad(36.476f);
constexpr float n45d = zeus::degToRad(-45.f);
constexpr float p45d = zeus::degToRad(45.f);
float l84 = p36d * std::clamp(std::atan2(rot.x(), rot.y()), n45d, p45d);
float l88 = std::clamp((0.25f * (l84 - x3d8_)) / dt, -3.f, 3.f);
float l8c = std::clamp((l88 - x3dc_) / dt, -10.f, 10.f);
x3dc_ += dt * l8c;
float l90 = p36d * std::clamp(std::atan2(rot.z(), rot.toVec2f().magnitude()), n45d, p45d);
l88 = std::clamp((0.25f * (l90 - x3e0_)) / dt, -3.f, 3.f);
l8c = std::clamp((l88 - x3e4_) / dt, -10.f, 10.f);
x3e4_ += dt * l8c;
float dVar7 = std::clamp(dt * x3dc_ + x3d8_, -0.5f, 0.5f);
float dVar8 = std::clamp(dt * x3e4_ + x3e0_, -0.5f, 0.5f);
if (dVar7 != x3d8_) {
if (std::abs(x3d8_) > 0.f && x3d8_ * dVar7 <= 0.f) {
animData->DelAdditiveAnimation(x3c8_animIds[x3d8_ >= 0.f ? 1 : 0]);
}
float weight = std::abs(dVar7);
if (weight > 0.f) {
animData->AddAdditiveAnimation(x3c8_animIds[dVar7 >= 0.f ? 1 : 0], weight, false, false);
}
}
if (dVar8 != x3e0_) {
if (std::abs(x3e0_) > 0.f && x3e0_ * dVar8 <= 0.f) {
animData->DelAdditiveAnimation(x3c8_animIds[x3e0_ <= 0.f ? 3 : 2]);
}
float weight = std::abs(dVar8);
if (weight > 0.f) {
animData->AddAdditiveAnimation(x3c8_animIds[dVar8 <= 0.f ? 3 : 2], weight, false, false);
}
}
x3d8_ = dVar7;
x3e0_ = dVar8;
}
} else {
if (x3d8_ != 0.f) {
animData->DelAdditiveAnimation(x3c8_animIds[x3d8_ >= 0.f ? 1 : 0]);
x3d8_ = 0.f;
}
if (x3e0_ != 0.f) {
animData->DelAdditiveAnimation(x3c8_animIds[x3e0_ <= 0.f ? 3 : 2]);
x3e0_ = 0.f;
}
}
}
void CGrenadeLauncher::sub_80230438() {
CModelData* modelData = GetModelData();
CAnimData* animData;
if (modelData == nullptr || (animData = modelData->GetAnimationData()) == nullptr || x258_started <= -1 ||
x258_started >= 2)
return;
constexpr std::array arr = {0, 3};
const auto& anim = animData->GetCharacterInfo().GetPASDatabase().FindBestAnimation(
{5, CPASAnimParm::FromEnum(0), CPASAnimParm::FromEnum(arr[x258_started])}, -1);
if (anim.first > 0.f) {
animData->SetAnimation({anim.second, -1, 1.f, true}, false);
modelData->EnableLooping(true);
}
}
void CGrenadeLauncher::LaunchGrenade(CStateManager& mgr) {
CModelData* modelData = GetModelData();
CAnimData* animData;
if (modelData == nullptr || (animData = modelData->GetAnimationData()) == nullptr)
return;
const auto& anim = animData->GetCharacterInfo().GetPASDatabase().FindBestAnimation({24}, -1);
if (anim.first > 0.f) {
animData->AddAdditiveAnimation(anim.second, 1.f, false, true);
// TODO
}
}
} // namespace MP1 } // namespace MP1
} // namespace urde } // namespace urde

View File

@ -63,57 +63,56 @@ public:
SBouncyGrenadeData x0_; SBouncyGrenadeData x0_;
CAssetId x3c_; CAssetId x3c_;
CAssetId x40_; CAssetId x40_;
u16 x44_sfx; u16 x44_launcherExplodeSfx;
SGrenadeTrajectoryInfo x48_trajectoryInfo; SGrenadeTrajectoryInfo x48_trajectoryInfo;
CGrenadeLauncherData(const SBouncyGrenadeData& data, CAssetId w1, CAssetId w2, u16 sfx, CGrenadeLauncherData(const SBouncyGrenadeData& data, CAssetId w1, CAssetId w2, u16 sfx,
const SGrenadeTrajectoryInfo& trajectoryInfo) const SGrenadeTrajectoryInfo& trajectoryInfo)
: x0_(data), x3c_(w1), x40_(w2), x44_sfx(sfx), x48_trajectoryInfo(trajectoryInfo){}; : x0_(data), x3c_(w1), x40_(w2), x44_launcherExplodeSfx(sfx), x48_trajectoryInfo(trajectoryInfo){};
}; };
class CGrenadeLauncher : public CPhysicsActor { class CGrenadeLauncher : public CPhysicsActor {
public: public:
int x258_ = 0; int x258_started = 0;
CHealthInfo x25c_; CHealthInfo x25c_healthInfo;
CDamageVulnerability x264_vulnerability; CDamageVulnerability x264_vulnerability;
TUniqueId x2cc_otherId; TUniqueId x2cc_parentId;
CGrenadeLauncherData x2d0_data; CGrenadeLauncherData x2d0_data;
CCollidableSphere x328_cSphere; CCollidableSphere x328_cSphere;
float x348_ = -1.f; float x348_shotTimer = -1.f;
zeus::CColor x34c_color1{1.f}; zeus::CColor x34c_color1{1.f};
CActorParameters x350_actParms; CActorParameters x350_actParms;
// was TToken<CGenDescription> std::optional<TLockedToken<CGenDescription>> x3b8_particleGenDesc;
TLockedToken<CGenDescription> x3c0_particleGenDesc;
std::array<s32, 4> x3c8_animIds; std::array<s32, 4> x3c8_animIds;
float x3d8_ = 0.f; float x3d8_ = 0.f;
float x3dc_ = 0.f; float x3dc_ = 0.f;
float x3e0_ = 0.f; float x3e0_ = 0.f;
float x3e4_ = 0.f; float x3e4_ = 0.f;
float x3e8_thermalMag; float x3e8_thermalMag;
float x3ec_ = 0.f; float x3ec_damageTimer = 0.f;
zeus::CColor x3f0_color2{0.5f, 0.f, 0.f}; zeus::CColor x3f0_color2{0.5f, 0.f, 0.f};
zeus::CColor x3f4_color3{0.f}; zeus::CColor x3f4_color3{0.f};
float x3f8_; float x3f8_;
bool x3fc_ = false; bool x3fc_launchGrenade = false;
bool x3fd_ = true; bool x3fd_visible = true;
bool x3fe_ = true; bool x3fe_ = true;
CGrenadeLauncher(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CGrenadeLauncher(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const zeus::CAABox& bounds, const CHealthInfo& healthInfo, CModelData&& mData, const zeus::CAABox& bounds, const CHealthInfo& healthInfo,
const CDamageVulnerability& vulnerability, const CActorParameters& actParams, TUniqueId otherId, const CDamageVulnerability& vulnerability, const CActorParameters& actParams, TUniqueId parentId,
const CGrenadeLauncherData& data, float f1); const CGrenadeLauncherData& data, float f1);
void Accept(IVisitor& visitor) override { visitor.Visit(this); } void Accept(IVisitor& visitor) override { visitor.Visit(this); }
// void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
// void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const override; void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const override;
const CCollisionPrimitive* GetCollisionPrimitive() const override { return &x328_cSphere; } const CCollisionPrimitive* GetCollisionPrimitive() const override { return &x328_cSphere; }
const CDamageVulnerability* GetDamageVulnerability() const override { return &x264_vulnerability; } const CDamageVulnerability* GetDamageVulnerability() const override { return &x264_vulnerability; }
// std::optional<zeus::CAABox> GetTouchBounds() const override; std::optional<zeus::CAABox> GetTouchBounds() const override;
// CHealthInfo* HealthInfo(CStateManager& mgr) override; CHealthInfo* HealthInfo(CStateManager& mgr) override { return &x25c_healthInfo; }
// void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override; void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
// void Render(const CStateManager& mgr) const override; void Render(const CStateManager& mgr) const override;
// void Think(float dt, CStateManager& mgr) override; void Think(float dt, CStateManager& mgr) override;
// void Touch(CActor& act, CStateManager& mgr) override; void Touch(CActor& act, CStateManager& mgr) override;
static zeus::CVector3f GrenadeTarget(const CStateManager& mgr); static zeus::CVector3f GrenadeTarget(const CStateManager& mgr);
static void CalculateGrenadeTrajectory(const zeus::CVector3f& target, const zeus::CVector3f& origin, static void CalculateGrenadeTrajectory(const zeus::CVector3f& target, const zeus::CVector3f& origin,
@ -123,9 +122,10 @@ protected:
void UpdateCollision(); void UpdateCollision();
void UpdateColor(float arg); void UpdateColor(float arg);
void sub_8022f69c(float arg); void sub_8022f69c(float arg);
void sub_8022f770(CStateManager& mgr); void CreateExplosion(CStateManager& mgr);
void sub_8022f9e0(CStateManager& mgr, float arg); void sub_8022f9e0(CStateManager& mgr, float dt);
void sub_80230438(); void sub_80230438();
void LaunchGrenade(CStateManager& mgr);
}; };
} // namespace MP1 } // namespace MP1
} // namespace urde } // namespace urde