From 1afb74e5700ce6e54a5b9515261ff772007a0395 Mon Sep 17 00:00:00 2001 From: Edward Cree Date: Tue, 11 Jan 2022 03:23:11 +0000 Subject: [PATCH] HP regen softcoding for all other bundled rulesets civ1 doesn't need HP regen, because all units have hitpoints=1. stub is meant to be minimal, so don't add it there either. Rulesets that previously used 34% for 1/3 on some airbase extras now use 33%, because we changed the rounding behaviour. --- data/alien/effects.ruleset | 39 +++++++++++++++++++++++ data/civ2/effects.ruleset | 44 ++++++++++++++++++++++++++ data/civ2civ3/effects.ruleset | 51 ++++++++++++++++++++++++++++-- data/classic/effects.ruleset | 2 +- data/experimental/effects.ruleset | 45 ++++++++++++++++++++++++++ data/granularity/effects.ruleset | 39 +++++++++++++++++++++++ data/multiplayer/effects.ruleset | 45 ++++++++++++++++++++++++++ data/royale/effects.ruleset | 48 ++++++++++++++++++++++++++-- data/sandbox/effects.ruleset | 51 ++++++++++++++++++++++++++++-- data/webperimental/effects.ruleset | 44 ++++++++++++++++++++++++++ 10 files changed, 401 insertions(+), 7 deletions(-) diff --git a/data/alien/effects.ruleset b/data/alien/effects.ruleset index 02e2c33fca..9b73468a6e 100644 --- a/data/alien/effects.ruleset +++ b/data/alien/effects.ruleset @@ -594,6 +594,45 @@ reqs = type = "Pollu_Pop_Pct" value = -100 +; Basic HP regen. +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = {} + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = {} + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_hospital] type = "HP_Regen" value = 50 diff --git a/data/civ2/effects.ruleset b/data/civ2/effects.ruleset index 13f8b758c4..7b573634c6 100644 --- a/data/civ2/effects.ruleset +++ b/data/civ2/effects.ruleset @@ -369,6 +369,33 @@ reqs = "OutputType", "gold", "Local" } +; Basic HP regen. Not for helis, as they have hp_loss_pct=10 +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } ; Fortress HP regen [effect_fortress_hp_regen] @@ -380,6 +407,23 @@ reqs = "UnitClass", "Land", "Local" } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + ; Base vision range - radius of vision is sqrt(5) = 2.24 [effect_city_vision] type = "City_Vision_Radius_Sq" diff --git a/data/civ2civ3/effects.ruleset b/data/civ2civ3/effects.ruleset index 59211c6431..2eb5aa36a3 100644 --- a/data/civ2civ3/effects.ruleset +++ b/data/civ2civ3/effects.ruleset @@ -245,6 +245,36 @@ reqs = "Extra", "Airbase", "Local" } +; Basic HP regen. Not for helis or planes, as they have hp_loss_pct=10 +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Air", "Local", FALSE + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Air", "Local", FALSE + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + ; Fortress HP regen (Every Land units) [effect_fortress_hp_regen] type = "HP_Regen" @@ -263,6 +293,23 @@ reqs = "UnitClass", "Missile", "Local", FALSE } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_fort_defense] type = "Defend_Bonus" value = 50 @@ -309,11 +356,11 @@ reqs = } ; Airbase HP regen: cumulative with airstrip -; 10 + 24 = 34% (this approximation to 1/3 is exact for units <50HP; +; 10 + 23 = 33% (this approximation to 1/3 is exact for units <100HP; ; 1/3 is equivalent to a city without Airport) [effect_airbase_hp_regen] type = "HP_Regen" -value = 24 +value = 23 reqs = { "type", "name", "range", "present" "Extra", "Airbase", "Local", TRUE diff --git a/data/classic/effects.ruleset b/data/classic/effects.ruleset index a43c2c913f..1b6e975654 100644 --- a/data/classic/effects.ruleset +++ b/data/classic/effects.ruleset @@ -140,7 +140,7 @@ reqs = ; Units in cities regenerate at least 1/3 of their HP regardless [effect_hp_regen_min_city] type = "HP_Regen_Min" -value = 34 +value = 33 reqs = { "type", "name", "range" "CityTile", "Center", "Local" diff --git a/data/experimental/effects.ruleset b/data/experimental/effects.ruleset index 47eb735411..39195318b9 100644 --- a/data/experimental/effects.ruleset +++ b/data/experimental/effects.ruleset @@ -132,6 +132,34 @@ reqs = type = "Tech_Upkeep_Free" value = 3 +; Basic HP regen. Not for helis, as they have hp_loss_pct=10 +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + ; Fortress HP regen [effect_fortress_hp_regen_land] type = "HP_Regen" @@ -151,6 +179,23 @@ reqs = "UnitClass", "Big Land", "Local" } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_fortified] type = "Fortify_Defense_Bonus" value = 50 diff --git a/data/granularity/effects.ruleset b/data/granularity/effects.ruleset index 8ecdce5266..705dfcd8b1 100644 --- a/data/granularity/effects.ruleset +++ b/data/granularity/effects.ruleset @@ -112,6 +112,28 @@ reqs = "Building", "Throne", "City" } +; Basic HP regen. +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = {} + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = {} + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + [effect_fortified] type = "Fortify_Defense_Bonus" value = 50 @@ -120,6 +142,23 @@ reqs = "Activity", "Fortified", "Local" } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_city_fortified] type = "Fortify_Defense_Bonus" value = 50 diff --git a/data/multiplayer/effects.ruleset b/data/multiplayer/effects.ruleset index 987733f0bd..65bcfdb7b3 100644 --- a/data/multiplayer/effects.ruleset +++ b/data/multiplayer/effects.ruleset @@ -118,6 +118,34 @@ reqs = type = "Tech_Upkeep_Free" value = 3 +; Basic HP regen. Not for helis, as they have hp_loss_pct=10 +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + ; Fortress HP regen [effect_fortress_hp_regen] type = "HP_Regen" @@ -136,6 +164,23 @@ reqs = "Activity", "Fortified", "Local" } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_city_fortified] type = "Fortify_Defense_Bonus" value = 50 diff --git a/data/royale/effects.ruleset b/data/royale/effects.ruleset index ac1b2b2628..59945d4840 100644 --- a/data/royale/effects.ruleset +++ b/data/royale/effects.ruleset @@ -214,6 +214,33 @@ reqs = "Extra", "Airbase", "Local" } +; Basic HP regen. Not for helis, as they have hp_loss_pct=10 +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + ; Fortress HP regen (Every Land units) [effect_fortress_hp_regen] type = "HP_Regen" @@ -233,6 +260,23 @@ reqs = "UnitClass", "Missile", "Local", FALSE } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + ; No defense bonus from Pre-Fortress, Fortress only helps against Land and Sea units [effect_fort_defense] type = "Defend_Bonus" @@ -254,11 +298,11 @@ reqs = -; Airbase HP regen: 34% (this approximation to 1/3 is exact for units <50HP; +; Airbase HP regen: 33% (this approximation to 1/3 is exact for units <100HP; ; 1/3 is equivalent to a city without Airport) [effect_airbase_hp_regen] type = "HP_Regen" -value = 34 +value = 33 reqs = { "type", "name", "range", "present" "Extra", "Airbase", "Local", TRUE diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index c237c9e3c1..76174cc3dc 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -245,6 +245,36 @@ reqs = "Extra", "Airbase", "Local" } +; Basic HP regen. Not for helis or planes, as they have hp_loss_pct=10 +; All unit-types' hitpoints are divisible by 10, so no need to worry about rounding +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Air", "Local", FALSE + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Air", "Local", FALSE + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + ; Fortress HP regen (Every Land units) [effect_fortress_hp_regen] type = "HP_Regen" @@ -263,6 +293,23 @@ reqs = "UnitClass", "Missile", "Local", FALSE } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_fort_defense] type = "Defend_Bonus" value = 50 @@ -309,11 +356,11 @@ reqs = } ; Airbase HP regen: cumulative with airstrip -; 10 + 24 = 34% (this approximation to 1/3 is exact for units <50HP; +; 10 + 24 = 33% (this approximation to 1/3 is exact for units <100HP; ; 1/3 is equivalent to a city without Airport) [effect_airbase_hp_regen] type = "HP_Regen" -value = 24 +value = 23 reqs = { "type", "name", "range", "present" "Extra", "Airbase", "Local", TRUE diff --git a/data/webperimental/effects.ruleset b/data/webperimental/effects.ruleset index 220b80826d..19f4bff71c 100644 --- a/data/webperimental/effects.ruleset +++ b/data/webperimental/effects.ruleset @@ -118,6 +118,33 @@ reqs = type = "Tech_Upkeep_Free" value = 3 +; Basic HP regen. Not for helis, as they have hp_loss_pct=10 +[effect_hp_regen_base] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; When hardcoded, effect_hp_regen_base was applied after the HP_Regen_Min +[effect_hp_regen_min_base] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range", "present" + "UnitClass", "Helicopter", "Local", FALSE + } + +; Units in cities regenerate at least 1/3 of their HP regardless +[effect_hp_regen_min_city] +type = "HP_Regen_Min" +value = 33 +reqs = + { "type", "name", "range" + "CityTile", "Center", "Local" + } + ; Fortress HP regen [effect_fortress_hp_regen] type = "HP_Regen" @@ -136,6 +163,23 @@ reqs = "Activity", "Fortified", "Local" } +[effect_fortified_hp_regen] +type = "HP_Regen" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + +; When hardcoded, effect_fortified_hp_regen was applied after the HP_Regen_Min +[effect_fortified_hp_regen_min] +type = "HP_Regen_Min" +value = 10 +reqs = + { "type", "name", "range" + "Activity", "Fortified", "Local" + } + [effect_city_fortified] type = "Fortify_Defense_Bonus" value = 50