3#include <Tempest/Matrix4x4>
4#include <zenkit/vobs/MovableObject.hh>
37 void tick(uint64_t dt);
40 std::string_view
tag()
const;
50 auto bBox() const -> const Tempest::Vec3*;
54 bool setMobState(std::string_view scheme,int32_t st)
override;
56 void emitSoundEffect(std::string_view sound,
float range,
bool freeSlot);
89 Tempest::Matrix4x4
nodeTranform(std::string_view nodeName)
const;
95 enum Phase : uint8_t {
104 Phase started = NotStarted;
105 bool attachMode =
false;
108 Tempest::Matrix4x4 pos;
110 std::string_view posTag()
const;
111 bool isAttachPoint()
const;
112 bool isDistPos()
const;
115 void setVisual(
const zenkit::VirtualObject& vob);
116 void invokeStateFunc(
Npc &npc);
117 void implTick(Pos &p);
118 void implQuitInteract(Pos &p);
119 bool setPos(
Npc& npc,
const Tempest::Vec3& pos);
120 void setDir(
Npc& npc,
const Tempest::Matrix4x4& mt);
122 void implAddItem(std::string_view name);
123 void autoDetachNpc();
124 void implChState(
bool next);
125 bool checkUseConditions(
Npc& npc);
128 bool setAnim(
Npc* npc,
Anim dir);
129 void setState(
int st);
131 template<
class P,
class Inter>
132 static P* findNearest(Inter& in,
const Npc& to);
134 const Pos* findNearest(
const Npc& to)
const;
135 Pos* findNearest(
const Npc& to);
136 const Pos* findFreePos()
const;
138 auto worldPos(
const Pos &to)
const -> Tempest::Vec3;
139 float qDistTo(
const Npc &npc,
const Pos &to)
const;
141 auto nodePosition(
const Npc &npc,
const Pos &p)
const -> Tempest::Vec3;
145 std::string mdlVisual;
146 Tempest::Vec3 bbox[2]={};
149 bool showVisual=
true;
150 Tempest::Vec3 displayOffset;
153 std::string triggerTarget;
154 std::string useWithItem;
155 std::string conditionFunc;
156 std::string onStateFunc;
160 std::string keyInstance;
161 std::string pickLockStr;
167 bool reverseState =
false;
168 bool loopState =
false;
169 bool isLockCracked =
false;
171 uint64_t waitAnim = 0;
172 bool animChanged =
false;
174 std::vector<Pos> attPos;
bool setMobState(std::string_view scheme, int32_t st) override
bool canSeeNpc(const Npc &npc, bool freeLos) const
float extendedSearchRadius() const override
int32_t stateCount() const
std::string_view pickLockCode() const
std::string_view tag() const
bool checkMobName(std::string_view dest) const
std::string_view ownerName() const
Tempest::Vec3 nearestPoint(const Npc &to) const
std::string_view posSchemeName() const
Tempest::Matrix4x4 nodeTranform(std::string_view nodeName) const
bool canQuitAtState(const Npc &npc, int32_t state) const
bool isDetachState(const Npc &npc) const
virtual void onStateChanged()
void resetPositionToTA(int32_t state)
bool overrideFocus() const
void setSlotItem(MeshObjects::Mesh &&itm, std::string_view slot)
bool isTrueDoor(const Npc &npc) const
void emitSoundEffect(std::string_view sound, float range, bool freeSlot)
void onKeyInput(KeyCodec::Action act)
void emitTriggerEvent(TriggerEvent::Type type) const
bool detach(Npc &npc, bool quick)
uint32_t stateMask() const
std::string_view schemeName() const
auto animNpc(const AnimationSolver &solver, Anim t) const -> const Animation::Sequence *
bool isStaticState() const
std::string_view focusName() const
void setAsCracked(bool c)
Tempest::Vec3 displayPosition() const
void load(Serialize &fin) override
bool isAttached(const Npc &to)
void save(Serialize &fout) const override
void updateAnimation(uint64_t dt)
std::string_view displayName() const
void moveEvent() override
bool needToLockpick(const Npc &pl) const
auto bBox() const -> const Tempest::Vec3 *
void marchInteractives(DbgPainter &p) const