Rituals now work mostly how I want, and even prototyped the idea of a cursed item giving you a debuff and also boosting damage more.

master
Zed A. Shaw 3 weeks ago
parent eeea3c794f
commit 15bb69624b
  1. 125
      assets/rituals.json
  2. 21
      tests/combat.cpp

@ -1,65 +1,138 @@
{ {
"profile": { "profile": {
"does_damage": 0, "has_spikes": 0,
"has_spikes": 1, "has_magick": 1,
"has_magick": 2, "shiny_bauble": 2,
"does_physical": 3, "cursed_item": 3,
"does_magick": 4, "$does_physical": 4,
"is_complete": 5 "$does_magick": 5,
"$does_damage": 6,
"$user_cursed": 7,
"$does_healing": 8,
"$damage_boost": 9,
"$large_boost": 10,
"$is_complete": 11
}, },
"actions": [ "actions": [
{ {
"name": "pierce_type", "name": "pierce_type",
"cost": 0, "cost": 100,
"needs": { "needs": {
"is_complete": false, "has_spikes": true,
"has_spikes": true "$is_complete": false
}, },
"effects": { "effects": {
"does_physical": true, "$does_physical": true,
"does_damage": true "$does_damage": true
} }
}, },
{ {
"name": "magick_type", "name": "magick_type",
"cost": 0, "cost": 100,
"needs": { "needs": {
"is_complete": false, "$is_complete": false,
"has_magick": true "has_magick": true
}, },
"effects": { "effects": {
"does_magick": true, "$does_magick": true,
"does_damage": true "$does_damage": true
} }
}, },
{ {
"name": "combined", "name": "combined",
"cost": 0, "cost": 0,
"needs": { "needs": {
"does_damage": true "$does_damage": true
},
"effects": {
"$is_complete": true
}
},
{
"name": "boost_magick",
"cost": 0,
"needs": {
"shiny_bauble": true,
"$does_magick": true,
"$does_damage": true,
"$is_complete": false,
"$user_cursed": false
},
"effects": {
"$damage_boost": true
}
},
{
"name": "boost_damage_large",
"cost": 0,
"needs": {
"$user_cursed": true,
"$is_complete": false,
"$does_damage": true
},
"effects": {
"$large_boost": true
}
},
{
"name": "curses_user",
"cost": 1000,
"needs": {
"$is_complete": false,
"cursed_item": true
},
"effects": {
"$user_cursed": true
}
},
{
"name": "heals_user",
"cost": 0,
"needs": {
"cursed_item": true,
"$does_damage": false
}, },
"effects": { "effects": {
"is_complete": true "$does_healing": true,
"$is_complete": true
} }
} }
], ],
"states": { "states": {
"initial": { "initial": {
"shiny_bauble": false,
"cursed_item": false,
"has_spikes": false, "has_spikes": false,
"has_magick": false, "has_magick": false,
"does_damage": false, "$user_cursed": false,
"is_complete": false, "$does_damage": false,
"does_magick": false, "$is_complete": false,
"does_physical": false "$does_healing": false,
"$does_magick": false,
"$does_physical": false,
"$large_boost": false,
"$damage_boost": false
}, },
"final": { "final": {
"does_magick": true, "$user_cursed": true,
"does_physical": true, "$does_damage": true,
"does_damage": true, "$is_complete": true,
"is_complete": true "$does_healing": true,
"$does_magick": true,
"$does_physical": true,
"$large_boost": true,
"$damage_boost": true
} }
}, },
"scripts": { "scripts": {
"actions": ["pierce_type", "magick_type", "combined"] "actions": [
"boost_magick",
"pierce_type",
"magick_type",
"heals_user",
"curses_user",
"boost_damage_large",
"combined"
]
} }
} }

@ -50,7 +50,7 @@ TEST_CASE("prototype combat system ideas", "[combat]") {
ritual.set_state("has_spikes", true); ritual.set_state("has_spikes", true);
ritual.update(); ritual.update();
fmt::println("------------ TEST WILL DO PIERCE"); fmt::println("\n\n------------ TEST WILL DO PIERCE");
ritual.dump(); ritual.dump();
REQUIRE(ritual.will_do("pierce_type")); REQUIRE(ritual.will_do("pierce_type"));
@ -58,10 +58,27 @@ TEST_CASE("prototype combat system ideas", "[combat]") {
ritual.set_state("has_magick", true); ritual.set_state("has_magick", true);
ritual.set_state("has_spikes", true); ritual.set_state("has_spikes", true);
ritual.update(); ritual.update();
fmt::println("------------ TEST WILL DO MAGICK TOO"); fmt::println("\n\n------------ TEST WILL DO MAGICK TOO");
ritual.dump(); ritual.dump();
REQUIRE(ritual.will_do("magick_type")); REQUIRE(ritual.will_do("magick_type"));
ritual.plan.script.pop_front(); ritual.plan.script.pop_front();
REQUIRE(ritual.will_do("pierce_type")); REQUIRE(ritual.will_do("pierce_type"));
ritual.reset();
ritual.set_state("has_magick", true);
ritual.set_state("has_spikes", true);
ritual.set_state("shiny_bauble", true);
ritual.update();
fmt::println("\n\n------------ TEST WILL DO DAMAGE BOOST");
ritual.dump();
ritual.reset();
ritual.set_state("has_magick", true);
ritual.set_state("cursed_item", true);
ritual.set_state("shiny_bauble", true);
ritual.update();
fmt::println("\n\n------------ TEST WILL DO LARGE DAMAGE BOOST");
ritual.dump();
} }

Loading…
Cancel
Save