Added the ritual belt first cut.

master
Zed A. Shaw 3 days ago
parent 17d30e2ed2
commit 31b35b43eb
  1. 2
      Makefile
  2. 4
      rituals.hpp
  3. 22
      tests/rituals.cpp

@ -22,7 +22,7 @@ tracy_build:
meson compile -j 10 -C builddir
test: build
./builddir/runtests "[rituals-finalize]"
./builddir/runtests "[rituals-belt]"
run: build test
powershell "cp ./builddir/zedcaster.exe ."

@ -60,4 +60,8 @@ namespace combat {
void plan(RitualAI& ritual);
RitualAction finalize(RitualAI& ritual);
};
struct RitualBelt {
std::vector<RitualAction> equipped;
};
}

@ -49,7 +49,7 @@ TEST_CASE("RitualEngine basic tests", "[rituals]") {
ritual.dump();
}
TEST_CASE("rituals can be finalized for the end result", "[rituals-finalize]") {
TEST_CASE("rituals can be finalized for the end result", "[rituals]") {
RitualEngine re("assets/rituals.json");
auto plan = re.start();
@ -64,3 +64,23 @@ TEST_CASE("rituals can be finalized for the end result", "[rituals-finalize]") {
auto action = re.finalize(plan);
action.dump();
}
TEST_CASE("the ritual belt works", "[rituals-belt]") {
RitualBelt the_belt;
RitualEngine re("assets/rituals.json");
auto plan = re.start();
re.set_state(plan, "has_magick", true);
re.plan(plan);
{
auto action = re.finalize(plan);
the_belt.equipped.push_back(action);
}
{
auto action = the_belt.equipped.at(0);
action.dump();
}
}

Loading…
Cancel
Save