From f349784c0b00a5ac6c17f1450cf65cb6b7fa2561 Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Tue, 29 Oct 2024 00:35:00 +0000 Subject: [PATCH] prevent health figures continuously rising --- objects/obj_p_assra/Alarm_0.gml | 2 +- scripts/scr_marine_struct/scr_marine_struct.gml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/objects/obj_p_assra/Alarm_0.gml b/objects/obj_p_assra/Alarm_0.gml index 11cd8c6fa2..23ae341891 100644 --- a/objects/obj_p_assra/Alarm_0.gml +++ b/objects/obj_p_assra/Alarm_0.gml @@ -33,7 +33,7 @@ for (o=1;o<=20;o++){ if (obj_fleet.capital+obj_fleet.frigate+obj_fleet.escort>0) then obj_controller.gene_seed+=seed_max; }else if (apothecary>0){ - unit.update_health(unit.hp()+irandom(10)+2); + unit.add_or_sub_health(irandom_range(9,14)); apothecary-=0.5; } } diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index d70ad711d6..b5167b962b 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -827,7 +827,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) var new_health; if (apoth){ if (base_group == "astartes"){ - if (gene_seed_mutations[$ "ossmodula"]==1){ + if (gene_seed_mutations[$ "ossmodula"]){ health_portion=6; }else{ health_portion=4; @@ -838,7 +838,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) } else { if (base_group == "astartes"){ health_portion = 8; - if (gene_seed_mutations[$ "ossmodula"]==1){ + if (gene_seed_mutations[$ "ossmodula"]){ health_portion = 10; } } @@ -847,9 +847,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data={}) if (new_health>m_health) then new_health=m_health; update_health(new_health); } - static update_health = function(new_health){ - unit_health = new_health; - }; + static update_health = function(new_health){ + unit_health = min(new_health, max_health()); + }; static hp_portion = function(){ return (hp()/max_health());