2019-12-22 20:04:07 +00:00
|
|
|
#include "Runtime/World/CScriptTargetingPoint.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/World/CActorParameters.hpp"
|
|
|
|
|
2019-09-21 13:07:13 +00:00
|
|
|
#include "TCastTo.hpp" // Generated file, do not modify include path
|
2017-01-18 22:30:02 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2017-01-18 22:30:02 +00:00
|
|
|
|
2017-11-13 06:19:18 +00:00
|
|
|
CScriptTargetingPoint::CScriptTargetingPoint(TUniqueId uid, std::string_view name, const CEntityInfo& info,
|
2017-01-18 22:30:02 +00:00
|
|
|
const zeus::CTransform& xf, bool active)
|
2017-12-19 03:05:50 +00:00
|
|
|
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic),
|
2020-04-20 04:57:50 +00:00
|
|
|
CActorParameters::None(), kInvalidUniqueId) {}
|
2017-01-18 22:30:02 +00:00
|
|
|
|
|
|
|
void CScriptTargetingPoint::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CScriptTargetingPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
|
|
|
|
CActor::AcceptScriptMsg(msg, uid, mgr);
|
2017-01-18 22:30:02 +00:00
|
|
|
|
2020-05-07 15:47:59 +00:00
|
|
|
if (msg == EScriptObjectMessage::Deactivate || msg == EScriptObjectMessage::Activate) {
|
2018-12-08 05:30:43 +00:00
|
|
|
CEntity::SendScriptMsgs(EScriptObjectState::Attack, mgr, EScriptObjectMessage::None);
|
2020-05-07 15:47:59 +00:00
|
|
|
}
|
2017-01-18 22:30:02 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CScriptTargetingPoint::Think(float dt, CStateManager&) {
|
2020-05-07 15:47:59 +00:00
|
|
|
if (xec_time <= 0.f) {
|
2018-12-08 05:30:43 +00:00
|
|
|
return;
|
2020-05-07 15:47:59 +00:00
|
|
|
}
|
2017-01-18 22:30:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
xec_time -= dt;
|
2017-01-18 22:30:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CScriptTargetingPoint::GetLocked() const { return !x20_conns.empty(); }
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|