A retro style homage to 80s dungeon crawlers hand crafted in C++.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
|
#include "rituals.hpp"
|
|
|
|
#include "ai_debug.hpp"
|
|
|
|
|
|
|
|
namespace combat {
|
|
|
|
void RitualAI::reset() {
|
|
|
|
start = original;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RitualAI::will_do(std::string name) {
|
|
|
|
ai::check_valid_action(name, "RitualAI::is_able_to");
|
|
|
|
return plan.script[0].name == name;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RitualAI::set_state(std::string name, bool setting) {
|
|
|
|
ai::set(start, name, setting);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* BUG: I don't like this, maybe an iterator is better?
|
|
|
|
*/
|
|
|
|
ai::Action RitualAI::pop() {
|
|
|
|
auto result = plan.script.front();
|
|
|
|
plan.script.pop_front();
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RitualAI::update() {
|
|
|
|
plan = ai::plan(script, start, goal);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RitualAI::dump() {
|
|
|
|
ai::dump_script(script, start, plan.script);
|
|
|
|
}
|
|
|
|
}
|