summaryrefslogtreecommitdiffstats
path: root/src/Entities/Compoments/AIAggressiveComponent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities/Compoments/AIAggressiveComponent.h')
-rw-r--r--src/Entities/Compoments/AIAggressiveComponent.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Entities/Compoments/AIAggressiveComponent.h b/src/Entities/Compoments/AIAggressiveComponent.h
new file mode 100644
index 000000000..a99fa2693
--- /dev/null
+++ b/src/Entities/Compoments/AIAggressiveComponent.h
@@ -0,0 +1,25 @@
+#pragma once
+#include "AIComponent.h"
+
+class cAIAggressiveComponent : public cAIComponent {
+ typedef cAIComponent super;
+protected:
+ enum MState{ATTACKING, IDLE, CHASING, ESCAPING} m_EMState;
+ cEntity * m_Target;
+public:
+ cAIAggressiveComponent(cMonster * a_Monster) : cAIComponent(a_Monster), m_Target(NULL){}
+
+ virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
+ virtual void InStateChasing(float a_Dt);
+
+ virtual void Attack(float a_Dt);
+
+protected:
+ virtual void CheckEventLostPlayer(void);
+ virtual void CheckEventSeePlayer(void);
+ virtual void EventLosePlayer(void);
+ virtual void EventSeePlayer(cEntity *);
+
+ bool IsMovingToTargetPosition();
+ bool ReachedFinalDestination();
+};