From 209648a39c98ccddc622703554912a21c2471531 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 8 Jan 2023 15:38:00 +0100 Subject: Implemented naive armour and shield without parametrized resits --- sim/include/kurator/sim/HitPoints.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sim/include') diff --git a/sim/include/kurator/sim/HitPoints.h b/sim/include/kurator/sim/HitPoints.h index b9a8523..0004999 100644 --- a/sim/include/kurator/sim/HitPoints.h +++ b/sim/include/kurator/sim/HitPoints.h @@ -9,8 +9,18 @@ namespace sim struct HitPoints { - double structure; - double structure_resists = 0.7; + HitPoints(double base_shield, double base_armour, double base_structure); + + struct Layer + { + double points; + double resists = 0.7; + double consume(double& damage); + }; + + Layer structure; + Layer armour; + Layer shield; double deal(double damage); bool is_alive() const; double total() const; -- cgit v1.1