technologies in posession improve unit abilities

This commit is contained in:
devZoGok
2024-02-25 15:19:10 +02:00
parent 309f967b2d
commit bce93977bd
14 changed files with 142 additions and 29 deletions
+3 -1
View File
@@ -16,7 +16,9 @@ namespace battleship{
using namespace gameBase;
Engineer::Engineer(Player *player, int id, Vector3 pos, Quaternion rot, Unit::State state) : Vehicle(player, id, pos, rot, state){
hackRange = generateView()["units"][id + 1]["hackRange"];
Game *game = Game::getSingleton();
vector<int> currTechs = player->getTechnologies();
hackRange = generateView()["units"][id + 1]["hackRange"]; hackRange += game->calcAbilFromTech(Ability::Type::HACK_RANGE, currTechs, (int)GameObject::type, id);
Vector2 size = Vector2(lenHpBar, 10);
hackStatusBackground = Unit::createBar(Vector2::VEC_ZERO, size, Vector4(0, 0, 0, 1));