Prep for the next cleaning quality cycle.

master
Zed A. Shaw 2 weeks ago
parent 15bb69624b
commit 8368d2e751
  1. 3
      Makefile
  2. 4
      autowalker.cpp
  3. 137
      tests/cyclic_rituals.json

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

@ -109,14 +109,11 @@ bool Autowalker::path_player(Pathing& paths, Point& target_out) {
bool found = paths.random_walk(target_out, false, PATHING_TOWARD, 4, 8);
if(!found) {
fmt::println("4/8 NOT FOUND");
// failed to find a linear path, try diagonal
if(!paths.random_walk(target_out, false, PATHING_TOWARD, 8, 8)) {
path_fail(paths.$paths, target_out);
return false;
}
} else {
fmt::println("4/8 YES FOUND");
}
if(!fsm.$level.map->can_move(target_out)) {
@ -222,7 +219,6 @@ void Autowalker::handle_boss_fight() {
void Autowalker::handle_player_walk(ai::State& start, ai::State& goal) {
start = update_state(start);
auto a_plan = ai::plan("Walker::actions", start, goal);
ai::dump_script("\n\n\n-----WALKER SCRIPT", start, a_plan.script);
auto action = a_plan.script.front();
if(action.name == "find_enemy") {

@ -0,0 +1,137 @@
{
"profile": {
"has_spikes": 0,
"has_magick": 1,
"shiny_bauble": 2,
"cursed_item": 3,
"$does_physical": 4,
"$does_magick": 5,
"$does_damage": 6,
"$user_cursed": 7,
"$does_healing": 8,
"$damage_boost": 9,
"$large_boost": 10,
"$is_complete": 11
},
"actions": [
{
"name": "pierce_type",
"cost": 100,
"needs": {
"has_spikes": true,
"$is_complete": false
},
"effects": {
"$does_physical": true,
"$does_damage": true
}
},
{
"name": "magick_type",
"cost": 100,
"needs": {
"$is_complete": false,
"has_magick": true
},
"effects": {
"$does_magick": true,
"$does_damage": true
}
},
{
"name": "combined",
"cost": 0,
"needs": {
"$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": {
"cursed_item": true,
"$is_complete": false,
"$does_damage": true
},
"effects": {
"$large_boost": true
}
},
{
"name": "curses_user",
"cost": 0,
"needs": {
"cursed_item": true
},
"effects": {
"$user_cursed": true
}
},
{
"name": "heals_user",
"cost": 0,
"needs": {
"cursed_item": true,
"$does_damage": false
},
"effects": {
"$does_healing": true,
"$is_complete": true
}
}
],
"states": {
"initial": {
"shiny_bauble": false,
"cursed_item": false,
"has_spikes": false,
"has_magick": false,
"$user_cursed": false,
"$does_damage": false,
"$is_complete": false,
"$does_healing": false,
"$does_magick": false,
"$does_physical": false,
"$large_boost": false,
"$damage_boost": false
},
"final": {
"$user_cursed": true,
"$does_damage": true,
"$is_complete": true,
"$does_healing": true,
"$does_magick": true,
"$does_physical": true,
"$large_boost": true,
"$damage_boost": true
}
},
"scripts": {
"actions": [
"boost_magick",
"pierce_type",
"magick_type",
"heals_user",
"curses_user",
"boost_damage_large",
"combined"
]
}
}
Loading…
Cancel
Save