AI engine is working and I have a little BattleEngine going but the AI is working better than it should in systems.cpp. Need to find out why then make the BattleEngine avoid running entities that have END in action lists.
This commit is contained in:
parent
da273cbee6
commit
47c6bfd531
13 changed files with 131 additions and 27 deletions
12
ai.cpp
12
ai.cpp
|
@ -171,10 +171,22 @@ namespace ai {
|
|||
return plan.script[0].name == name;
|
||||
}
|
||||
|
||||
bool EntityAI::active() {
|
||||
if(plan.script.size() == 1) {
|
||||
return plan.script[0] != FINAL_ACTION;
|
||||
} else {
|
||||
return plan.script.size() == 0;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityAI::set_state(std::string name, bool setting) {
|
||||
ai::set(start, name, setting);
|
||||
}
|
||||
|
||||
bool EntityAI::get_state(std::string name) {
|
||||
return ai::test(start, name);
|
||||
}
|
||||
|
||||
void EntityAI::update() {
|
||||
plan = ai::plan(script, start, goal);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue