#include #include #include "rituals.hpp" using namespace combat; TEST_CASE("prototype combat system ideas", "[combat]") { RitualEngine re("assets/rituals.json"); auto ritual = re.start(); re.set_state(ritual, "has_spikes", true); re.plan(ritual); fmt::println("\n\n------------ TEST WILL DO PIERCE"); ritual.dump(); REQUIRE(ritual.will_do("pierce_type")); REQUIRE(ritual.start != ritual.original); re.reset(ritual); REQUIRE(ritual.start == ritual.original); re.set_state(ritual, "has_magick", true); re.set_state(ritual, "has_spikes", true); re.plan(ritual); fmt::println("\n\n------------ TEST WILL DO MAGICK TOO"); ritual.dump(); REQUIRE(ritual.will_do("magick_type")); ritual.pop(); REQUIRE(ritual.will_do("pierce_type")); re.reset(ritual); re.set_state(ritual, "has_magick", true); re.set_state(ritual, "has_spikes", true); re.set_state(ritual, "shiny_bauble", true); re.plan(ritual); fmt::println("\n\n------------ TEST WILL DO DAMAGE BOOST"); ritual.dump(); re.reset(ritual); re.set_state(ritual, "has_magick", true); re.set_state(ritual, "cursed_item", true); re.set_state(ritual, "shiny_bauble", true); re.plan(ritual); fmt::println("\n\n------------ TEST WILL DO LARGE DAMAGE BOOST"); ritual.dump(); } TEST_CASE("confirm that cycles are avoided/detected", "[combat]") { RitualEngine re("assets/rituals.json"); auto ritual = re.start(); re.set_state(ritual, "has_magick", true); re.set_state(ritual, "cursed_item", true); re.set_state(ritual, "shiny_bauble", true); fmt::println("\n\n------------ CYCLES AVOIDED"); ritual.dump(); }