46 lines
980 B
C++
46 lines
980 B
C++
#ifndef ENEMY_WRETCHED_H
|
|
#define ENEMY_WRETCHED_H
|
|
|
|
#include "wave_survival/enemy_body.h"
|
|
#include "wave_survival/state.h"
|
|
class PatrolPath;
|
|
|
|
class EnemyWretched : public EnemyBody {
|
|
GDCLASS(EnemyWretched, EnemyBody);
|
|
static void _bind_methods();
|
|
void ready();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
};
|
|
|
|
/* ============================== STATES ============================== */
|
|
|
|
class WretchedState : public State {
|
|
GDCLASS(WretchedState, State);
|
|
static void _bind_methods() {}
|
|
|
|
public:
|
|
virtual void set_target(Node *node) override;
|
|
EnemyWretched *get_target() const;
|
|
|
|
private:
|
|
EnemyWretched *target{ nullptr };
|
|
};
|
|
|
|
class WretchedPatrolState : public WretchedState {
|
|
GDCLASS(WretchedPatrolState, WretchedState);
|
|
static void _bind_methods() {}
|
|
|
|
public:
|
|
virtual void enter_state() override;
|
|
virtual void process(double delta) override;
|
|
|
|
private:
|
|
NavigationAgent3D *nav{ nullptr };
|
|
int path_point{ 0 };
|
|
PatrolPath *path{ nullptr };
|
|
};
|
|
|
|
#endif // !ENEMY_WRETCHED_H
|