2017-09-17 13:43:13 +02:00
|
|
|
#include "Hero.h"
|
|
|
|
#include "BehaviourTree.h"
|
|
|
|
#include "BehaviourTreeSelector.h"
|
|
|
|
#include "WanderNode.h"
|
|
|
|
#include "ExploreNode.h"
|
|
|
|
#include "AttackEnemyNode.h"
|
|
|
|
#include "IfHealthBelow.h"
|
|
|
|
#include "RestNode.h"
|
|
|
|
#include "FleeNode.h"
|
|
|
|
|
2018-01-09 21:59:05 +01:00
|
|
|
Hero::Hero(vec2i pos) : Actor(pos) {
|
2017-09-24 00:15:28 +02:00
|
|
|
name = "Hero";
|
2017-09-17 13:43:13 +02:00
|
|
|
alive = true;
|
2017-12-30 20:15:39 +01:00
|
|
|
player_controlled = true;
|
2017-09-17 13:43:13 +02:00
|
|
|
health = 6;
|
2017-09-26 15:49:11 +02:00
|
|
|
health_max = 6;
|
2017-09-17 13:43:13 +02:00
|
|
|
strength = 2;
|
2017-09-26 15:49:11 +02:00
|
|
|
sprite_id = '@';
|
2017-10-18 12:22:28 +02:00
|
|
|
faction = FACTION_PLAYER;
|
|
|
|
sprite_color = Color(0.1f, 0.4f, 0.9f, 1);
|
2017-09-23 18:55:41 +02:00
|
|
|
/*
|
2017-09-17 13:43:13 +02:00
|
|
|
BehaviourTreeSelector* root = new BehaviourTreeSelector(nullptr);
|
|
|
|
bt = new BehaviourTree(root);
|
|
|
|
{
|
|
|
|
IfHealthBelow* hpBelow = new IfHealthBelow(root, 4);
|
|
|
|
new FleeNode(hpBelow);
|
|
|
|
|
|
|
|
new AttackEnemyNode(root);
|
|
|
|
new RestNode(root);
|
2017-09-21 22:17:06 +02:00
|
|
|
//new ExploreNode(root);
|
2017-09-17 13:43:13 +02:00
|
|
|
new WanderNode(root);
|
|
|
|
}
|
2017-09-23 18:55:41 +02:00
|
|
|
*/
|
2017-09-17 13:43:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-10-18 12:22:28 +02:00
|
|
|
Hero::~Hero() = default;
|