From 728abda9dc6fc8e65c7c0e0240a2e7d61a43a583 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sun, 5 Sep 2021 22:36:13 +0200 Subject: tech tostring, all sprites, heal and convert --- game/load.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'game/load.cpp') 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()); 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 -- cgit v1.2.3-54-g00ecf