summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-01-08 00:59:29 +0100
committerAki <please@ignore.pl>2023-01-08 00:59:29 +0100
commit85e4741a6b39e436befacaf9778619696c9c5a33 (patch)
tree02c2f2c4b4d49711daac92a2aa772d3e2daea25b
parent30865a57fb3f52607c14b9d210a256b3be3ddcb8 (diff)
downloadkurator-85e4741a6b39e436befacaf9778619696c9c5a33.zip
kurator-85e4741a6b39e436befacaf9778619696c9c5a33.tar.gz
kurator-85e4741a6b39e436befacaf9778619696c9c5a33.tar.bz2
Renamed health to structure points where applicable
-rw-r--r--sim/include/kurator/sim/HitPoints.h2
-rw-r--r--sim/src/Builder.cpp2
-rw-r--r--sim/src/HitPoints.cpp6
-rw-r--r--universe/include/kurator/universe/ShipType.h2
-rw-r--r--universe/resources/universe/ship_types.json6
-rw-r--r--universe/src/JsonRepository.cpp2
6 files changed, 10 insertions, 10 deletions
diff --git a/sim/include/kurator/sim/HitPoints.h b/sim/include/kurator/sim/HitPoints.h
index 96b54b0..d63620d 100644
--- a/sim/include/kurator/sim/HitPoints.h
+++ b/sim/include/kurator/sim/HitPoints.h
@@ -9,7 +9,7 @@ namespace sim
struct HitPoints
{
- double health;
+ double structure;
void deal(double damage);
bool is_alive() const;
double total() const;
diff --git a/sim/src/Builder.cpp b/sim/src/Builder.cpp
index 053ae93..f1e4762 100644
--- a/sim/src/Builder.cpp
+++ b/sim/src/Builder.cpp
@@ -39,7 +39,7 @@ Builder::operator()(const universe::ShipType& ship_type, const int team) const
ship_type.max_speed * 2.0,
ship_type.max_speed * 3.0);
registry.emplace<AIState>(entity, 6000.0, Point{0.0, 0.0});
- registry.emplace<HitPoints>(entity, ship_type.base_health_points);
+ registry.emplace<HitPoints>(entity, ship_type.base_structure_points);
return entity;
}
diff --git a/sim/src/HitPoints.cpp b/sim/src/HitPoints.cpp
index 28cf7f7..bcb7e97 100644
--- a/sim/src/HitPoints.cpp
+++ b/sim/src/HitPoints.cpp
@@ -10,21 +10,21 @@ namespace sim
void
HitPoints::deal(double damage)
{
- health -= damage;
+ structure -= damage;
}
bool
HitPoints::is_alive() const
{
- return health > 0.0;
+ return structure > 0.0;
}
double
HitPoints::total() const
{
- return health;
+ return structure;
}
diff --git a/universe/include/kurator/universe/ShipType.h b/universe/include/kurator/universe/ShipType.h
index fccf970..fdbb8af 100644
--- a/universe/include/kurator/universe/ShipType.h
+++ b/universe/include/kurator/universe/ShipType.h
@@ -12,7 +12,7 @@ namespace universe
struct ShipType
{
std::string name;
- double base_health_points;
+ double base_structure_points;
double max_speed;
};
diff --git a/universe/resources/universe/ship_types.json b/universe/resources/universe/ship_types.json
index d5bc1e8..cc2d892 100644
--- a/universe/resources/universe/ship_types.json
+++ b/universe/resources/universe/ship_types.json
@@ -1,17 +1,17 @@
[
{
"name": "Anvil",
- "base_health_points": 600.0,
+ "base_structure_points": 600.0,
"max_speed": 218.0
},
{
"name": "Eclipse",
- "base_health_points": 600.0,
+ "base_structure_points": 600.0,
"max_speed": 263.0
},
{
"name": "Warbringer",
- "base_health_points": 600.0,
+ "base_structure_points": 600.0,
"max_speed": 336.0
}
]
diff --git a/universe/src/JsonRepository.cpp b/universe/src/JsonRepository.cpp
index a4abfe5..40b0b70 100644
--- a/universe/src/JsonRepository.cpp
+++ b/universe/src/JsonRepository.cpp
@@ -26,7 +26,7 @@ void
from_json(const json& item, ShipType& ship)
{
item.at("name").get_to(ship.name);
- item.at("base_health_points").get_to(ship.base_health_points);
+ item.at("base_structure_points").get_to(ship.base_structure_points);
item.at("max_speed").get_to(ship.max_speed);
}