Skip to content

Commit

Permalink
HP regen softcoding for all other bundled rulesets
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ec429 authored and jwrober committed Feb 3, 2022
1 parent 40dd5d3 commit 1afb74e
Show file tree
Hide file tree
Showing 10 changed files with 401 additions and 7 deletions.
39 changes: 39 additions & 0 deletions data/alien/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions data/civ2/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
Expand Down
51 changes: 49 additions & 2 deletions data/civ2civ3/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/classic/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
45 changes: 45 additions & 0 deletions data/experimental/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
39 changes: 39 additions & 0 deletions data/granularity/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
45 changes: 45 additions & 0 deletions data/multiplayer/effects.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
Loading

0 comments on commit 1afb74e

Please sign in to comment.