feat: implemented enemy wretched patrol and chase states
This commit is contained in:
parent
1b0e4384b9
commit
9517588415
12 changed files with 224 additions and 17 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "wave_survival/enemy_body.h"
|
||||
#include "wave_survival/state.h"
|
||||
class PatrolPath;
|
||||
class NpcUnit;
|
||||
|
||||
class EnemyWretched : public EnemyBody {
|
||||
GDCLASS(EnemyWretched, EnemyBody);
|
||||
|
|
@ -23,9 +24,13 @@ class WretchedState : public State {
|
|||
public:
|
||||
virtual void set_target(Node *node) override;
|
||||
EnemyWretched *get_target() const;
|
||||
NpcUnit *get_unit() const;
|
||||
NavigationAgent3D *get_nav() const;
|
||||
|
||||
private:
|
||||
NpcUnit *unit{ nullptr };
|
||||
EnemyWretched *target{ nullptr };
|
||||
NavigationAgent3D *nav{ nullptr };
|
||||
};
|
||||
|
||||
class WretchedPatrolState : public WretchedState {
|
||||
|
|
@ -35,11 +40,29 @@ class WretchedPatrolState : public WretchedState {
|
|||
public:
|
||||
virtual void enter_state() override;
|
||||
virtual void process(double delta) override;
|
||||
virtual String get_next_state() const override;
|
||||
|
||||
private:
|
||||
NavigationAgent3D *nav{ nullptr };
|
||||
int path_point{ 0 };
|
||||
PatrolPath *path{ nullptr };
|
||||
};
|
||||
|
||||
class WretchedChaseState : public WretchedState {
|
||||
GDCLASS(WretchedChaseState, WretchedState);
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual void enter_state() override;
|
||||
virtual void process(double delta) override;
|
||||
virtual String get_next_state() const override;
|
||||
};
|
||||
|
||||
class WretchedAttackState : public WretchedState {
|
||||
GDCLASS(WretchedAttackState, WretchedState);
|
||||
static void _bind_methods() {}
|
||||
|
||||
public:
|
||||
virtual String get_next_state() const override;
|
||||
};
|
||||
|
||||
#endif // !ENEMY_WRETCHED_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue