From fa1e0fa0994e33336b7d49b881b99eac40df4306 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 22 Jan 2023 18:17:44 +0200 Subject: [PATCH 51/51] Simplify Barracks effects by using BuildingFlag requirement See osdn #46480 Signed-off-by: Marko Lindqvist --- data/civ1/buildings.ruleset | 10 ++- data/civ1/effects.ruleset | 25 +----- data/civ2/buildings.ruleset | 10 ++- data/civ2/effects.ruleset | 66 +++------------ data/civ2civ3/buildings.ruleset | 10 ++- data/civ2civ3/effects.ruleset | 120 +++++---------------------- data/classic/buildings.ruleset | 10 ++- data/classic/effects.ruleset | 60 +++----------- data/goldkeep/buildings.ruleset | 10 ++- data/goldkeep/effects.ruleset | 120 +++++---------------------- data/multiplayer/buildings.ruleset | 10 ++- data/multiplayer/effects.ruleset | 60 +++----------- data/sandbox/buildings.ruleset | 10 ++- data/sandbox/effects.ruleset | 120 +++++---------------------- data/webperimental/buildings.ruleset | 10 ++- data/webperimental/effects.ruleset | 60 +++----------- 16 files changed, 159 insertions(+), 552 deletions(-) diff --git a/data/civ1/buildings.ruleset b/data/civ1/buildings.ruleset index 52bea956d0..4b3ab60a7c 100644 --- a/data/civ1/buildings.ruleset +++ b/data/civ1/buildings.ruleset @@ -23,9 +23,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; Below: The individual buildings, one per section. ; (Buildings = City Improvements and Wonders) @@ -138,6 +139,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new unit built in a city will\ @@ -166,6 +168,7 @@ upkeep = 2 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new unit built in a city will\ @@ -193,6 +196,7 @@ upkeep = 3 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new unit built in a city will\ diff --git a/data/civ1/effects.ruleset b/data/civ1/effects.ruleset index d30775aa90..44c8a4f792 100644 --- a/data/civ1/effects.ruleset +++ b/data/civ1/effects.ruleset @@ -562,31 +562,12 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_veteran] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "Building", "Barracks II", "City", FALSE - "Building", "Barracks III", "City", FALSE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "Building", "Barracks III", "City", FALSE - } - -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE } [effect_cathedral] diff --git a/data/civ2/buildings.ruleset b/data/civ2/buildings.ruleset index 277188984a..ed9e72dab8 100644 --- a/data/civ2/buildings.ruleset +++ b/data/civ2/buildings.ruleset @@ -23,9 +23,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -167,6 +168,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -195,6 +197,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -222,6 +225,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/civ2/effects.ruleset b/data/civ2/effects.ruleset index 3f1043a545..519e9f803e 100644 --- a/data/civ2/effects.ruleset +++ b/data/civ2/effects.ruleset @@ -989,70 +989,24 @@ reqs = "OutputType", "luxury", "local" } -[effect_barracks] +[effect_barracks_veteran] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - "Building", "Barracks II", "City", FALSE - "Building", "Barracks III", "City", FALSE - } - -[effect_barracks_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "Building", "Barracks II", "City", FALSE - "Building", "Barracks III", "City", FALSE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - "Building", "Barracks III", "City", FALSE - } - -[effect_barracks_ii_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "Building", "Barracks III", "City", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_1] +[effect_barracks_regen] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } [effect_cathedral] diff --git a/data/civ2civ3/buildings.ruleset b/data/civ2civ3/buildings.ruleset index 761651bca8..685357493a 100644 --- a/data/civ2civ3/buildings.ruleset +++ b/data/civ2civ3/buildings.ruleset @@ -23,9 +23,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -259,6 +260,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -288,6 +290,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -315,6 +318,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/civ2civ3/effects.ruleset b/data/civ2civ3/effects.ruleset index 7bd3732f4a..bbb9b4ee1a 100644 --- a/data/civ2civ3/effects.ruleset +++ b/data/civ2civ3/effects.ruleset @@ -1848,124 +1848,44 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_land] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_b] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_b_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_ii_b] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_ii_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_ii_b_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - } - -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_b] +[effect_barracks_bland] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Big Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_iii_hp] +[effect_barracks_regen_land] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } -[effect_barracks_iii_b_hp] +[effect_barracks_regen_bland] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Big Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Big Land", "Local", TRUE } [effect_cathedral] diff --git a/data/classic/buildings.ruleset b/data/classic/buildings.ruleset index b19ca9ab65..9a1500a711 100644 --- a/data/classic/buildings.ruleset +++ b/data/classic/buildings.ruleset @@ -23,9 +23,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -171,6 +172,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -200,6 +202,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -227,6 +230,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/classic/effects.ruleset b/data/classic/effects.ruleset index c6caefd8f2..d0062f3ca8 100644 --- a/data/classic/effects.ruleset +++ b/data/classic/effects.ruleset @@ -879,64 +879,24 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_veteran] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_ii_1] +[effect_barracks_regen] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } [effect_cathedral] diff --git a/data/goldkeep/buildings.ruleset b/data/goldkeep/buildings.ruleset index 6975885a30..74af5e5a30 100644 --- a/data/goldkeep/buildings.ruleset +++ b/data/goldkeep/buildings.ruleset @@ -25,9 +25,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -176,6 +177,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -205,6 +207,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -232,6 +235,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/goldkeep/effects.ruleset b/data/goldkeep/effects.ruleset index b48e1a3494..7ca13951e8 100644 --- a/data/goldkeep/effects.ruleset +++ b/data/goldkeep/effects.ruleset @@ -975,124 +975,44 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_land] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_bl] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_bl_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_ii_bl] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_ii_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_ii_bl_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_bl] +[effect_barracks_bland] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Big Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_iii_1] +[effect_barracks_regen_land] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } -[effect_barracks_iii_bl_1] +[effect_barracks_regen_bland] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Big Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Big Land", "Local", TRUE } [effect_cathedral] diff --git a/data/multiplayer/buildings.ruleset b/data/multiplayer/buildings.ruleset index e9a8924f6e..265d15dc24 100644 --- a/data/multiplayer/buildings.ruleset +++ b/data/multiplayer/buildings.ruleset @@ -22,9 +22,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -197,6 +198,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -226,6 +228,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -253,6 +256,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/multiplayer/effects.ruleset b/data/multiplayer/effects.ruleset index 1677600def..3402096283 100644 --- a/data/multiplayer/effects.ruleset +++ b/data/multiplayer/effects.ruleset @@ -884,64 +884,24 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_veteran] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_ii_1] +[effect_barracks_regen] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } [effect_cathedral] diff --git a/data/sandbox/buildings.ruleset b/data/sandbox/buildings.ruleset index 798a262875..881d2f98e9 100644 --- a/data/sandbox/buildings.ruleset +++ b/data/sandbox/buildings.ruleset @@ -23,9 +23,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -262,6 +263,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -291,6 +293,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -318,6 +321,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index 0b2e4e2d8d..aecc7aa272 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -1964,124 +1964,44 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_land] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_b] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_b_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_ii_b] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_ii_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_ii_b_hp] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - } - -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_b] +[effect_barracks_bland] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Big Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Big Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_iii_hp] +[effect_barracks_regen_land] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } -[effect_barracks_iii_b_hp] +[effect_barracks_regen_bland] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Big Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Big Land", "Local", TRUE } [effect_cathedral] diff --git a/data/webperimental/buildings.ruleset b/data/webperimental/buildings.ruleset index e42e41c140..85bf98e304 100644 --- a/data/webperimental/buildings.ruleset +++ b/data/webperimental/buildings.ruleset @@ -23,9 +23,10 @@ format_version = 30 ; and sensible. ; helptxt = displayed in the help for building types with this flag ; (optional) -;building_flags = -; { "name", "helptxt" -; } +building_flags = + { "name", "helptxt" + "Barracks" + } ; /* <-- avoid gettext warnings ; @@ -175,6 +176,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_i" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -205,6 +207,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_ii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ @@ -233,6 +236,7 @@ upkeep = 1 sabotage = 100 sound = "b_barracks_iii" sound_alt = "b_generic" +flags = "Barracks" ; /* xgettext:no-c-format */ helptext = _("\ With a Barracks, each new land unit built in a city will\ diff --git a/data/webperimental/effects.ruleset b/data/webperimental/effects.ruleset index 45bfdf2ddc..826d205214 100644 --- a/data/webperimental/effects.ruleset +++ b/data/webperimental/effects.ruleset @@ -897,64 +897,24 @@ reqs = "OutputType", "Luxury", "Local" } -[effect_barracks] +[effect_barracks_veteran] type = "Veteran_Build" value = 1 reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_ii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE + "UnitFlag", "NonMil", "Local", FALSE + "UnitFlag", "NoVeteran", "Local", FALSE } -[effect_barracks_ii_1] +[effect_barracks_regen] type = "HP_Regen" value = 100 reqs = - { "type", "name", "range", "present" - "Building", "Barracks II", "City", TRUE - "UnitClass", "Land", "Local", TRUE - } - -[effect_barracks_iii] -type = "Veteran_Build" -value = 1 -reqs = - { "type", "name", "range", "present" - "Building", "Barracks III", "City", TRUE - "UnitClass", "Land", "Local", TRUE - "UnitFlag", "NonMil", "Local", FALSE - "UnitFlag", "NoVeteran", "Local", FALSE - } - -[effect_barracks_iii_1] -type = "HP_Regen" -value = 100 -reqs = - { "type", "name", "range" - "Building", "Barracks III", "City" - "UnitClass", "Land", "Local" + { "type", "name", "range", "present" + "BuildingFlag", "Barracks", "City", TRUE + "UnitClass", "Land", "Local", TRUE } [effect_cathedral] -- 2.39.0