aboutsummaryrefslogtreecommitdiff
path: root/game/load.cpp
diff options
context:
space:
mode:
authorjacopograndi <jak.sk8@hotmail.it>2021-09-05 22:36:13 +0200
committerjacopograndi <jak.sk8@hotmail.it>2021-09-05 22:36:13 +0200
commit728abda9dc6fc8e65c7c0e0240a2e7d61a43a583 (patch)
tree545187ed3d634792af1082ce021665d3ef4934fc /game/load.cpp
parentc298eb988874bc2cf3adb39c2532419ec76a24bc (diff)
tech tostring, all sprites, heal and convert
Diffstat (limited to 'game/load.cpp')
-rw-r--r--game/load.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/game/load.cpp b/game/load.cpp
index 16f0911..4b58ff0 100644
--- a/game/load.cpp
+++ b/game/load.cpp
@@ -79,6 +79,9 @@ void load_json (Gst &gst) {
for (auto ad : it["adjacent"]) {
ent.adjacent.push_back(ad);
}
+ for (auto ad : it["diagonal"]) {
+ ent.diagonal.push_back(ad);
+ }
ent.ent_class = (EntityInfo::Class) EntityClass::from_string(
it["class"].get<std::string>());
for (auto ab : it["abilities"]) {
@@ -118,13 +121,16 @@ void load_json (Gst &gst) {
tech.bonus.req_range = b["req_range"];
}
if (b.contains("improved_heal")) {
- tech.bonus.attack = b["improved_heal"];
+ tech.bonus.improved_heal = b["improved_heal"];
}
if (b.contains("improved_convert")) {
- tech.bonus.attack = b["improved_convert"];
+ tech.bonus.improved_convert = b["improved_convert"];
}
+ if (b.contains("cost")) tech.bonus.cost.clear();
for (auto v : b["cost"]) { tech.bonus.cost.push_back(v); }
+ if (b.contains("cost_abs")) tech.bonus.cost_abs.clear();
for (auto v : b["cost_abs"]) { tech.bonus.cost_abs.push_back(v); }
+ if (b.contains("prod")) tech.bonus.prod.clear();
for (auto v : b["prod"]) { tech.bonus.prod.push_back(v); }
for (auto v : b["aff_id"]) { tech.bonus.aff_id.push_back(v); }
@@ -139,6 +145,8 @@ void load_json (Gst &gst) {
tech.bonus.aff_all = b["aff_all"];
}
}
+
+ std::cout << tech.id << tech.bonus.to_string() << std::endl;
gst.techs.push_back(tech);
}
} \ No newline at end of file