metaforce/Runtime/MP1/World/CFlaahgraProjectile.cpp

30 lines
1.2 KiB
C++
Raw Permalink Normal View History

#include "Runtime/MP1/World/CFlaahgraProjectile.hpp"
2018-02-11 05:27:00 +00:00
#include "Runtime/CStateManager.hpp"
#include "Runtime/World/CPlayer.hpp"
2021-04-10 08:42:06 +00:00
namespace metaforce::MP1 {
2018-02-11 05:27:00 +00:00
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)
2018-12-08 05:30:43 +00:00
, x3d8_bigStrike(bigStrike) {
if (x3d8_bigStrike) {
xe8_projectileAttribs |= EProjectileAttrib::BigStrike;
x150_damageDuration = 2.f;
}
2018-02-11 05:27:00 +00:00
}
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);
}
}
}
2021-04-10 08:42:06 +00:00
} // namespace metaforce::MP1