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/tech.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 6 deletions(-) (limited to 'game/tech.h') diff --git a/game/tech.h b/game/tech.h index cb5e769..b22b173 100644 --- a/game/tech.h +++ b/game/tech.h @@ -5,6 +5,10 @@ #include #include +#include + +#include + #include "../umath/vec2.h" class TechBonus { @@ -17,14 +21,14 @@ class TechBonus { std::vector cost { 0, 0 }; std::vector cost_abs { 0, 0 }; std::vector prod { 0, 0 }; - int trade; - int improved_heal; - int improved_convert; + int trade { 0 } ; + int improved_heal { 0 }; + int improved_convert { 0 }; int req_range { 999 }; std::vector aff_id; std::vector aff_class; - int aff_level; + int aff_level { -1 }; int aff_all { 0 }; TechBonus operator+(const TechBonus &rhs) { @@ -33,7 +37,7 @@ class TechBonus { b.defence = defence + rhs.defence; b.sight = sight + rhs.sight; b.move = move + rhs.move; - for (int i=0; i 0) { + str += "of entitiy "; + for (int id : aff_id) str += std::to_string(id) + " "; + str += "\n"; + } + if (aff_class.size() > 0) { + str += "of class "; + for (int c : aff_class) str += std::to_string(c) + " "; + str += "\n"; + } + if (aff_level != -1) { + str += "of level " + std::to_string(aff_level) + "\n"; + } + return str; + } }; class TechLookup { -- cgit v1.2.3-54-g00ecf