Added the ritual belt first cut.
This commit is contained in:
parent
17d30e2ed2
commit
31b35b43eb
3 changed files with 26 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -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…
Add table
Add a link
Reference in a new issue