metaforce/Runtime/MP1/World/CMagdolite.cpp

54 lines
1.9 KiB
C++
Raw Normal View History

#include "Runtime/MP1/World/CMagdolite.hpp"
2018-10-11 22:57:05 +00:00
2018-12-08 05:30:43 +00:00
namespace urde::MP1 {
2018-10-11 22:57:05 +00:00
CMagdolite::CMagdoliteData::CMagdoliteData(CInputStream& in)
: x0_propertyCount(in.readUint32Big())
, x4_(in.readUint32Big())
, x8_(in)
, xc_(in.readUint32Big())
, x10_(in.readFloatBig())
, x18_(in.readFloatBig())
2018-12-08 05:30:43 +00:00
, x1c_(in.readFloatBig()) {}
2018-10-11 22:57:05 +00:00
CMagdolite::CMagdolite(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
2018-12-08 05:30:43 +00:00
CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, float f1,
float f2, const CDamageInfo& dInfo1, const CDamageInfo& dInfo2,
const CDamageVulnerability& dVuln1, const CDamageVulnerability& dVuln2, CAssetId modelId,
CAssetId skinId, float f3, float f4, float f5, float f6,
2019-05-14 22:30:15 +00:00
const CMagdolite::CMagdoliteData& magData, float f7, float f8, float f9)
2018-10-11 22:57:05 +00:00
: CPatterned(ECharacter::Magdolite, uid, name, EFlavorType::Zero, info, xf, std::move(mData), pInfo,
2019-05-14 22:30:15 +00:00
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) {
2019-05-14 22:30:15 +00:00
switch (msg) {
case EScriptObjectMessage::Damage:
case EScriptObjectMessage::InvulnDamage:
/* TODO Implement */
return;
case EScriptObjectMessage::Registered:
x450_bodyController->Activate(mgr);
RemoveMaterial(EMaterialTypes::Solid, mgr);
AddMaterial(EMaterialTypes::NonSolidDamageable, mgr);
2019-05-14 22:30:15 +00:00
x584_boneTracker.SetActive(false);
CreateShadow(false);
/* TODO Finish */
2019-02-18 05:47:46 +00:00
break;
default:
break;
}
CPatterned::AcceptScriptMsg(msg, uid, mgr);
}
2018-12-08 05:30:43 +00:00
} // namespace urde::MP1