From a5ac54a181261717447bd264c3dc93587d723bca Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 27 Sep 2023 20:38:06 +0300 Subject: [PATCH 49/49] civ2civ3/sandbox: Add "Aerial" unit class flag Simplifies effect requirement lists. See osdn #47737 Signed-off-by: Marko Lindqvist --- data/civ2civ3/effects.ruleset | 78 +++++++++-------------------------- data/civ2civ3/units.ruleset | 8 ++-- data/sandbox/effects.ruleset | 76 +++++++++------------------------- data/sandbox/units.ruleset | 8 ++-- 4 files changed, 49 insertions(+), 121 deletions(-) diff --git a/data/civ2civ3/effects.ruleset b/data/civ2civ3/effects.ruleset index 06029f9241..4df71d409e 100644 --- a/data/civ2civ3/effects.ruleset +++ b/data/civ2civ3/effects.ruleset @@ -274,17 +274,9 @@ reqs = type = "Defend_Bonus" value = 50 reqs = - { "type", "name", "range", "present" - "Extra", "Fort", "Tile", TRUE -; "UnitClass", "Land", "Local", FALSE -; "UnitClass", "Small Land", "Local", FALSE -; "UnitClass", "Big Land", "Local", FALSE -; "UnitClass", "Merchant", "Local", FALSE -; "UnitClass", "Sea", "Local", FALSE -; "UnitClass", "Trireme", "Local", FALSE - "UnitClass", "Helicopter", "Local", FALSE - "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Fort", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", FALSE } ; Cumulative with fort @@ -297,22 +289,15 @@ reqs = "Extra", "Fortress", "Tile", TRUE } -; Airstrip HP regen (Every Air unit) +; Airstrip HP regen (All Air units except Missiles) [effect_airstrip_hp_regen] type = "HP_Regen" value = 10 reqs = - { "type", "name", "range", "present" - "Extra", "Airstrip", "Tile", TRUE - "UnitClass", "Land", "Local", FALSE - "UnitClass", "Small Land", "Local", FALSE - "UnitClass", "Big Land", "Local", FALSE - "UnitClass", "Merchant", "Local", FALSE - "UnitClass", "Sea", "Local", FALSE - "UnitClass", "Trireme", "Local", FALSE -; "UnitClass", "Helicopter", "Local", FALSE -; "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Airstrip", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", TRUE + "UnitClassFlag", "Missile", "Local", FALSE } ; Airbase HP regen: cumulative with airstrip @@ -322,34 +307,19 @@ reqs = type = "HP_Regen" value = 24 reqs = - { "type", "name", "range", "present" - "Extra", "Airbase", "Tile", TRUE - "UnitClass", "Land", "Local", FALSE - "UnitClass", "Small Land", "Local", FALSE - "UnitClass", "Big Land", "Local", FALSE - "UnitClass", "Merchant", "Local", FALSE - "UnitClass", "Sea", "Local", FALSE - "UnitClass", "Trireme", "Local", FALSE -; "UnitClass", "Helicopter", "Local", FALSE -; "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Airbase", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", TRUE + "UnitClassFlag", "Missile", "Local", FALSE } [effect_airstrip_defense] type = "Defend_Bonus" value = 50 reqs = - { "type", "name", "range", "present" - "Extra", "Airstrip", "Tile", TRUE - "UnitClass", "Land", "Local", FALSE - "UnitClass", "Small Land", "Local", FALSE - "UnitClass", "Big Land", "Local", FALSE - "UnitClass", "Merchant", "Local", FALSE - "UnitClass", "Sea", "Local", FALSE - "UnitClass", "Trireme", "Local", FALSE -; "UnitClass", "Helicopter", "Local", FALSE -; "UnitClass", "Air", "Local", FALSE -; "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range" + "Extra", "Airstrip", "Tile" + "UnitClassFlag", "Aerial", "Local" } ; Cumulative with airstrip @@ -1880,23 +1850,15 @@ reqs = "CityTile", "Center", "Tile" } -; Every Land, Sea, Trireme +; All Ground and Naval units [effect_city_defense_1] type = "Defend_Bonus" value = 50 reqs = - { "type", "name", "range", "present" - "MinSize", "9", "City", TRUE - "CityTile", "Center", "Tile", TRUE -; "UnitClass", "Land", "Local", FALSE -; "UnitClass", "Small Land", "Local", FALSE -; "UnitClass", "Big Land", "Local", FALSE -; "UnitClass", "Merchant", "Local", FALSE -; "UnitClass", "Sea", "Local", FALSE -; "UnitClass", "Trireme", "Local", FALSE - "UnitClass", "Helicopter", "Local", FALSE - "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "MinSize", "9", "City", TRUE + "CityTile", "Center", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", FALSE } ; Every Land diff --git a/data/civ2civ3/units.ruleset b/data/civ2civ3/units.ruleset index 55e2ef92c7..0bb825ecad 100644 --- a/data/civ2civ3/units.ruleset +++ b/data/civ2civ3/units.ruleset @@ -64,6 +64,7 @@ class_flags = _("Gets a 50% defensive bonus while in cities.") _("Barracks"), _("Benefits from barracks") _("Ground"), _("Ground units") + _("Aerial"), _("Aerial units") } [veteran_system] @@ -151,7 +152,7 @@ name = _("?unitclass:Missile") min_speed = 0 hp_loss_pct = 0 flags = "Missile", "Unreachable", "DoesntOccupyTile", "Airliftable", - "HutFrighten" + "HutFrighten", "Aerial" [unitclass_land] ; /* TRANS: Unit class: used adjectivally */ @@ -209,7 +210,8 @@ flags = "ZOC", "DamageSlows", "AttFromNonNative" name = _("?unitclass:Helicopter") min_speed = 1 hp_loss_pct = 10 -flags = "Unreachable", "DoesntOccupyTile", "CanOccupyCity", "CollectRansom", "Airliftable" +flags = "Unreachable", "DoesntOccupyTile", "CanOccupyCity", "CollectRansom", "Airliftable", + "Aerial" [unitclass_air] ; /* TRANS: Unit class: used adjectivally */ @@ -217,7 +219,7 @@ name = _("?unitclass:Air") min_speed = 1 hp_loss_pct = 10 flags = "Unreachable", "DoesntOccupyTile", "CanPillage", - "Airliftable", "HutFrighten" + "Airliftable", "HutFrighten", "Aerial" ; /* <-- avoid gettext warnings ; diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index a1b2418f53..823935a761 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -274,17 +274,9 @@ reqs = type = "Defend_Bonus" value = 50 reqs = - { "type", "name", "range", "present" - "Extra", "Fort", "Tile", TRUE -; "UnitClass", "Land", "Local", FALSE -; "UnitClass", "Small Land", "Local", FALSE -; "UnitClass", "Big Land", "Local", FALSE -; "UnitClass", "Merchant", "Local", FALSE -; "UnitClass", "Sea", "Local", FALSE -; "UnitClass", "Trireme", "Local", FALSE - "UnitClass", "Helicopter", "Local", FALSE - "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Fort", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", FALSE } ; Cumulative with fort @@ -297,22 +289,15 @@ reqs = "Extra", "Fortress", "Tile", TRUE } -; Airstrip HP regen (Every Air unit) +; Airstrip HP regen (All Aerial units) [effect_airstrip_hp_regen] type = "HP_Regen" value = 10 reqs = - { "type", "name", "range", "present" - "Extra", "Airstrip", "Tile", TRUE - "UnitClass", "Land", "Local", FALSE - "UnitClass", "Small Land", "Local", FALSE - "UnitClass", "Big Land", "Local", FALSE - "UnitClass", "Merchant", "Local", FALSE - "UnitClass", "Sea", "Local", FALSE - "UnitClass", "Trireme", "Local", FALSE -; "UnitClass", "Helicopter", "Local", FALSE -; "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Airstrip", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", TRUE + "UnitClassFlag", "Missile", "Local", FALSE } ; Airbase HP regen: cumulative with airstrip @@ -322,34 +307,19 @@ reqs = type = "HP_Regen" value = 24 reqs = - { "type", "name", "range", "present" - "Extra", "Airbase", "Tile", TRUE - "UnitClass", "Land", "Local", FALSE - "UnitClass", "Small Land", "Local", FALSE - "UnitClass", "Big Land", "Local", FALSE - "UnitClass", "Merchant", "Local", FALSE - "UnitClass", "Sea", "Local", FALSE - "UnitClass", "Trireme", "Local", FALSE -; "UnitClass", "Helicopter", "Local", FALSE -; "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "Extra", "Airbase", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", TRUE + "UnitClassFlag", "Missile", "Local", FALSE } [effect_airstrip_defense] type = "Defend_Bonus" value = 50 reqs = - { "type", "name", "range", "present" - "Extra", "Airstrip", "Tile", TRUE - "UnitClass", "Land", "Local", FALSE - "UnitClass", "Small Land", "Local", FALSE - "UnitClass", "Big Land", "Local", FALSE - "UnitClass", "Merchant", "Local", FALSE - "UnitClass", "Sea", "Local", FALSE - "UnitClass", "Trireme", "Local", FALSE -; "UnitClass", "Helicopter", "Local", FALSE -; "UnitClass", "Air", "Local", FALSE -; "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range" + "Extra", "Airstrip", "Tile" + "UnitClassFlag", "Aerial", "Local" } ; Cumulative with airstrip @@ -2001,18 +1971,10 @@ reqs = type = "Defend_Bonus" value = 50 reqs = - { "type", "name", "range", "present" - "MinSize", "9", "City", TRUE - "CityTile", "Center", "Tile", TRUE -; "UnitClass", "Land", "Local", FALSE -; "UnitClass", "Small Land", "Local", FALSE -; "UnitClass", "Big Land", "Local", FALSE -; "UnitClass", "Merchant", "Local", FALSE -; "UnitClass", "Sea", "Local", FALSE -; "UnitClass", "Trireme", "Local", FALSE - "UnitClass", "Helicopter", "Local", FALSE - "UnitClass", "Air", "Local", FALSE - "UnitClass", "Missile", "Local", FALSE + { "type", "name", "range", "present" + "MinSize", "9", "City", TRUE + "CityTile", "Center", "Tile", TRUE + "UnitClassFlag", "Aerial", "Local", FALSE } ; All Ground units diff --git a/data/sandbox/units.ruleset b/data/sandbox/units.ruleset index cda6821223..6f5fc32b4a 100644 --- a/data/sandbox/units.ruleset +++ b/data/sandbox/units.ruleset @@ -74,6 +74,7 @@ class_flags = _("Gets a 50% defensive bonus while in cities.") _("Barracks"), _("Benefits from barracks") _("Ground"), _("Ground units") + _("Aerial"), _("Aerial units") } [veteran_system] @@ -161,7 +162,7 @@ name = _("?unitclass:Missile") min_speed = 0 hp_loss_pct = 0 flags = "Missile", "Unreachable", "DoesntOccupyTile", - "MediumWeight", "HutFrighten" + "MediumWeight", "HutFrighten", "Aerial" [unitclass_land] ; /* TRANS: Unit class: used adjectivally */ @@ -222,7 +223,8 @@ flags = "ZOC", "DamageSlows", "AttFromNonNative", "MediumWeight" name = _("?unitclass:Helicopter") min_speed = 1 hp_loss_pct = 10 -flags = "Unreachable", "DoesntOccupyTile", "CanOccupyCity", "CollectRansom", "MediumWeight" +flags = "Unreachable", "DoesntOccupyTile", "CanOccupyCity", "CollectRansom", "MediumWeight", + "Aerial" [unitclass_air] ; /* TRANS: Unit class: used adjectivally */ @@ -230,7 +232,7 @@ name = _("?unitclass:Air") min_speed = 1 hp_loss_pct = 10 flags = "Unreachable", "DoesntOccupyTile", "CanPillage", - "MediumWeight", "HutFrighten" + "MediumWeight", "HutFrighten", "Aerial" ; /* <-- avoid gettext warnings ; -- 2.40.1