Initial CMagdolite imps

This commit is contained in:
Phillip Stephens 2019-05-14 15:30:15 -07:00
parent 7e5af6ad42
commit b18576cf58
5 changed files with 28 additions and 10 deletions

View File

@ -56,4 +56,5 @@ public:
void SetTargetPosition(const zeus::CVector3f& pos); void SetTargetPosition(const zeus::CVector3f& pos);
void SetNoHorizontalAim(bool b); void SetNoHorizontalAim(bool b);
}; };
} // namespace urde } // namespace urde

View File

@ -49,12 +49,12 @@ void CBloodFlower::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta
if (x450_bodyController->IsFrozen()) { if (x450_bodyController->IsFrozen()) {
x450_bodyController->FrozenBreakout(); x450_bodyController->FrozenBreakout();
} }
sub80119364(mgr); CalculateAttackTime(mgr);
UpdateFire(mgr); UpdateFire(mgr);
} }
} }
void CBloodFlower::sub80119364(CStateManager& mgr) { void CBloodFlower::CalculateAttackTime(CStateManager& mgr) {
x584_curAttackTime = x308_attackTimeVariation * -mgr.GetActiveRandom()->Float(); x584_curAttackTime = x308_attackTimeVariation * -mgr.GetActiveRandom()->Float();
} }
@ -114,7 +114,6 @@ void CBloodFlower::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node
} }
void CBloodFlower::LaunchPollenProjectile(const zeus::CTransform& xf, CStateManager& mgr, float var_f1, s32 w1) { void CBloodFlower::LaunchPollenProjectile(const zeus::CTransform& xf, CStateManager& mgr, float var_f1, s32 w1) {
static float tickPeriod = CProjectileWeapon::GetTickPeriod();
CProjectileInfo* proj = GetProjectileInfo(); CProjectileInfo* proj = GetProjectileInfo();
TLockedToken<CWeaponDescription> projToken = proj->Token(); TLockedToken<CWeaponDescription> projToken = proj->Token();
@ -174,7 +173,7 @@ bool CBloodFlower::ShouldTurn(CStateManager& mgr, float) {
void CBloodFlower::Active(CStateManager& mgr, EStateMsg msg, float arg) { void CBloodFlower::Active(CStateManager& mgr, EStateMsg msg, float arg) {
if (msg == EStateMsg::Activate) { if (msg == EStateMsg::Activate) {
x32c_animState = EAnimState::Ready; x32c_animState = EAnimState::Ready;
sub80119364(mgr); CalculateAttackTime(mgr);
} else if (msg == EStateMsg::Update) { } else if (msg == EStateMsg::Update) {
TryCommand(mgr, pas::EAnimationState::LoopReaction, &CPatterned::TryLoopReaction, 0); TryCommand(mgr, pas::EAnimationState::LoopReaction, &CPatterned::TryLoopReaction, 0);
x450_bodyController->GetCommandMgr().DeliverCmd(CBCAdditiveAimCmd()); x450_bodyController->GetCommandMgr().DeliverCmd(CBCAdditiveAimCmd());

View File

@ -33,7 +33,7 @@ class CBloodFlower : public CPatterned {
CAssetId x620_; CAssetId x620_;
void ActivateTriggers(CStateManager& mgr, bool activate); void ActivateTriggers(CStateManager& mgr, bool activate);
void sub80119364(CStateManager&); void CalculateAttackTime(CStateManager&);
void UpdateFire(CStateManager& mgr); void UpdateFire(CStateManager& mgr);
void TurnEffectsOn(u32, CStateManager&); void TurnEffectsOn(u32, CStateManager&);
void TurnEffectsOff(u32, CStateManager&); void TurnEffectsOff(u32, CStateManager&);
@ -52,6 +52,7 @@ public:
void Think(float dt, CStateManager& mgr); void Think(float dt, CStateManager& mgr);
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt); void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt);
void Render(const CStateManager& mgr) const; void Render(const CStateManager& mgr) const;
void Touch(CActor&, CStateManager&) {}
CProjectileInfo* GetProjectileInfo() { return &x590_projectileInfo; } CProjectileInfo* GetProjectileInfo() { return &x590_projectileInfo; }
bool ShouldAttack(CStateManager&, float); bool ShouldAttack(CStateManager&, float);

View File

@ -16,13 +16,23 @@ CMagdolite::CMagdolite(TUniqueId uid, std::string_view name, const CEntityInfo&
float f2, const CDamageInfo& dInfo1, const CDamageInfo& dInfo2, float f2, const CDamageInfo& dInfo1, const CDamageInfo& dInfo2,
const CDamageVulnerability& dVuln1, const CDamageVulnerability& dVuln2, CAssetId modelId, const CDamageVulnerability& dVuln1, const CDamageVulnerability& dVuln2, CAssetId modelId,
CAssetId skinId, float f3, float f4, float f5, float f6, CAssetId skinId, float f3, float f4, float f5, float f6,
const urde::MP1::CMagdolite::CMagdoliteData& magData, float f7, float f8, float f9) const CMagdolite::CMagdoliteData& magData, float f7, float f8, float f9)
: CPatterned(ECharacter::Magdolite, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo, : CPatterned(ECharacter::Magdolite, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
EMovementType::Flyer, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Large) {} EMovementType::Flyer, EColliderType::One, EBodyType::BiPedal, actParms, EKnockBackVariant::Large)
, x568_(f4)
, x56c_(f5)
, x570_(f6)
, x574_(f3)
, x578_(std::cos(zeus::degToRad(f2)))
, x57c_(f1)
, x584_boneTracker(*GetModelData()->GetAnimationData(), "head"sv, zeus::degToRad(f1), zeus::degToRad(90.f),
EBoneTrackingFlags::ParentIk) {
}
void CMagdolite::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { void CMagdolite::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
switch(msg) { switch (msg) {
case EScriptObjectMessage::Damage: case EScriptObjectMessage::Damage:
case EScriptObjectMessage::InvulnDamage: case EScriptObjectMessage::InvulnDamage:
/* TODO Implement */ /* TODO Implement */
@ -31,7 +41,7 @@ void CMagdolite::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
x450_bodyController->Activate(mgr); x450_bodyController->Activate(mgr);
RemoveMaterial(EMaterialTypes::Solid, mgr); RemoveMaterial(EMaterialTypes::Solid, mgr);
AddMaterial(EMaterialTypes::NonSolidDamageable, mgr); AddMaterial(EMaterialTypes::NonSolidDamageable, mgr);
//x584_boneTracker.SetActive(false); x584_boneTracker.SetActive(false);
CreateShadow(false); CreateShadow(false);
/* TODO Finish */ /* TODO Finish */
break; break;

View File

@ -20,7 +20,14 @@ public:
}; };
private: private:
//CBoneTracking x584_boneTracker; float x568_;
float x56c_;
float x570_;
float x574_;
float x578_;
float x57c_;
u32 x580_;
CBoneTracking x584_boneTracker;
public: public:
DEFINE_PATTERNED(Magdolite) DEFINE_PATTERNED(Magdolite)
CMagdolite(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&, CMagdolite(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&,