2017-01-18 22:30:02 +00:00
|
|
|
#include "World/CScriptTargetingPoint.hpp"
|
|
|
|
#include "World/CActorParameters.hpp"
|
|
|
|
#include "TCastTo.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown),
|
|
|
|
CActorParameters::None(), kInvalidUniqueId)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CScriptTargetingPoint::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
|
|
|
|
|
|
|
void CScriptTargetingPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr)
|
|
|
|
{
|
|
|
|
CActor::AcceptScriptMsg(msg, uid, mgr);
|
|
|
|
|
|
|
|
if (msg == EScriptObjectMessage::Deactivate || msg == EScriptObjectMessage::Activate)
|
|
|
|
CEntity::SendScriptMsgs(EScriptObjectState::Attack, mgr, EScriptObjectMessage::None);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CScriptTargetingPoint::Think(float dt, CStateManager&)
|
|
|
|
{
|
|
|
|
if (xec_time <= 0.f)
|
|
|
|
return;
|
|
|
|
|
|
|
|
xec_time -= dt;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CScriptTargetingPoint::GetLocked() const { return !x20_conns.empty(); }
|
|
|
|
}
|