mirror of https://github.com/AxioDL/metaforce.git
CFlaahgraProjectile: Implement AcceptScriptMsg
This commit is contained in:
parent
ab3b9ca803
commit
232619a7d3
|
@ -1,13 +1,15 @@
|
|||
#include "Runtime/MP1/World/CFlaahgraProjectile.hpp"
|
||||
|
||||
#include "Runtime/CStateManager.hpp"
|
||||
#include "Runtime/World/CPlayer.hpp"
|
||||
|
||||
namespace urde::MP1 {
|
||||
|
||||
CFlaahgraProjectile::CFlaahgraProjectile(bool bigStrike, const TToken<CWeaponDescription>& desc,
|
||||
const zeus::CTransform& xf, const CDamageInfo& damage, TUniqueId uid,
|
||||
TAreaId aid, TUniqueId owner)
|
||||
: CEnergyProjectile(true, desc, EWeaponType::AI, xf, EMaterialTypes::Character, damage, uid, aid, owner,
|
||||
kInvalidUniqueId, EProjectileAttrib::BigProjectile, false, zeus::skOne3f, {}, 0xffff,
|
||||
false)
|
||||
kInvalidUniqueId, EProjectileAttrib::BigProjectile, false, zeus::skOne3f, {}, 0xffff, false)
|
||||
, x3d8_bigStrike(bigStrike) {
|
||||
if (x3d8_bigStrike) {
|
||||
xe8_projectileAttribs |= EProjectileAttrib::BigStrike;
|
||||
|
@ -15,4 +17,13 @@ CFlaahgraProjectile::CFlaahgraProjectile(bool bigStrike, const TToken<CWeaponDes
|
|||
}
|
||||
}
|
||||
|
||||
void CFlaahgraProjectile::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) {
|
||||
CEnergyProjectile::AcceptScriptMsg(msg, sender, mgr);
|
||||
if (x3d8_bigStrike && msg == EScriptObjectMessage::Deleted && mgr.GetPlayer().GetUniqueId() == x2c2_lastResolvedObj) {
|
||||
if (auto* ent = mgr.ObjectById(GetOwnerId())) {
|
||||
mgr.SendScriptMsg(ent, GetUniqueId(), EScriptObjectMessage::Action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde::MP1
|
||||
|
|
|
@ -10,6 +10,8 @@ class CFlaahgraProjectile : public CEnergyProjectile {
|
|||
public:
|
||||
CFlaahgraProjectile(bool bigStrike, const TToken<CWeaponDescription>& desc, const zeus::CTransform& xf,
|
||||
const CDamageInfo& damage, TUniqueId uid, TAreaId aid, TUniqueId owner);
|
||||
|
||||
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager &mgr) override;
|
||||
};
|
||||
|
||||
} // namespace urde::MP1
|
||||
|
|
Loading…
Reference in New Issue