Autowalker AI now knows when it has items, and knows it should find healing, but it's not working quite yet.
This commit is contained in:
parent
d15c9b12fd
commit
0623170dbc
6 changed files with 97 additions and 49 deletions
4
ai.cpp
4
ai.cpp
|
@ -27,12 +27,12 @@ namespace ai {
|
|||
fmt::format("config_action: no 'effects' field", result.name));
|
||||
|
||||
for(auto& [name_key, value] : config["needs"].items()) {
|
||||
check(profile.contains(name_key), fmt::format("config_action: profile does not have name {}", result.name, name_key));
|
||||
check(profile.contains(name_key), fmt::format("config_action({}): profile does not have need named {}", result.name, name_key));
|
||||
result.needs(profile.at(name_key), bool(value));
|
||||
}
|
||||
|
||||
for(auto& [name_key, value] : config["effects"].items()) {
|
||||
check(profile.contains(name_key), fmt::format("config_action: profile does not have name {}", result.name, name_key));
|
||||
check(profile.contains(name_key), fmt::format("config_action({}): profile does not have effect named {}", result.name, name_key));
|
||||
|
||||
result.effect(profile.at(name_key), bool(value));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue