From e087f2cb1b0b69ac1e1b11b2bbfe4aa2b3d461bf Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 13 Aug 2024 05:52:16 +0300
Subject: [PATCH 15/15] civ1: Replace "UnitFlag" with "UnitTypeFlag"

See RM #635

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 data/civ1/actions.ruleset | 180 +++++++++++++++++++-------------------
 data/civ1/effects.ruleset |  28 +++---
 data/civ1/terrain.ruleset |  28 +++---
 3 files changed, 118 insertions(+), 118 deletions(-)

diff --git a/data/civ1/actions.ruleset b/data/civ1/actions.ruleset
index c5a3a01824..47e27958f6 100644
--- a/data/civ1/actions.ruleset
+++ b/data/civ1/actions.ruleset
@@ -28,7 +28,7 @@ if_attacker =
       "DiplRel",      "War",     "Local", TRUE
       "MinMoveFrags", "1",       "Local", TRUE
       ; Not a good idea to nuke our own area.
-      "UnitFlag",     "Nuclear", "Local", FALSE
+      "UnitTypeFlag", "Nuclear", "Local", FALSE
     }
 
 attack_actions = "Collect Ransom", "Attack", "Suicide Attack"
@@ -368,18 +368,18 @@ quiet_actions = "Enter Hut 2", "Unit Move"
 [enabler_sabotage_city]
 action        = "Sabotage City"
 actor_reqs    =
-    { "type",   "name", "range"
-      "UnitFlag", "Diplomat", "Local"
-      "DiplRel", "War", "Local"
-      "UnitState", "OnLivableTile", "Local"
-      "MinMoveFrags", "1", "Local"
+    { "type",         "name",          "range"
+      "UnitTypeFlag", "Diplomat",      "Local"
+      "DiplRel",      "War",           "Local"
+      "UnitState",    "OnLivableTile", "Local"
+      "MinMoveFrags", "1",             "Local"
     }
 
 [enabler_establish_embassy]
 action        = "Establish Embassy Stay"
 actor_reqs    =
     { "type",         "name",             "range", "present"
-      "UnitFlag",     "Diplomat",         "Local", TRUE
+      "UnitTypeFlag", "Diplomat",         "Local", TRUE
       "UnitState",    "OnLivableTile",    "Local", TRUE
       "MinMoveFrags", "1",                "Local", TRUE
       "DiplRel",      "Foreign",          "Local", TRUE
@@ -393,21 +393,21 @@ target_reqs   =
 [enabler_investigate_city]
 action        = "Investigate City Spend Unit"
 actor_reqs    =
-    { "type",   "name", "range"
-      "UnitFlag", "Diplomat", "Local"
-      "UnitState", "OnLivableTile", "Local"
-      "MinMoveFrags", "1", "Local"
-      "DiplRel", "Foreign", "Local"
+    { "type",         "name",          "range"
+      "UnitTypeFlag", "Diplomat",      "Local"
+      "UnitState",    "OnLivableTile", "Local"
+      "MinMoveFrags", "1",             "Local"
+      "DiplRel",      "Foreign",       "Local"
     }
 
 [enabler_steal_tech_random]
 action        = "Steal Tech"
 actor_reqs    =
-    { "type",   "name", "range"
-      "UnitFlag", "Diplomat", "Local"
-      "UnitState", "OnLivableTile", "Local"
-      "MinMoveFrags", "1", "Local"
-      "DiplRel", "Foreign", "Local"
+    { "type",         "name",          "range"
+      "UnitTypeFlag", "Diplomat",      "Local"
+      "UnitState",    "OnLivableTile", "Local"
+      "MinMoveFrags", "1",             "Local"
+      "DiplRel",      "Foreign",       "Local"
     }
 target_reqs   =
     { "type",   "name", "range", "present"
@@ -417,13 +417,13 @@ target_reqs   =
 [enabler_incite_city]
 action        = "Incite City"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "Diplomat", "Local", TRUE
-      "DiplRel", "Alliance", "Local", FALSE
-      "DiplRel", "Team", "Local", FALSE
-      "UnitState", "OnLivableTile", "Local", TRUE
-      "MinMoveFrags", "1", "Local", TRUE
-      "DiplRel", "Foreign", "Local", TRUE
+    { "type",         "name",          "range", "present"
+      "UnitTypeFlag", "Diplomat",      "Local", TRUE
+      "DiplRel",      "Alliance",      "Local", FALSE
+      "DiplRel",      "Team",          "Local", FALSE
+      "UnitState",    "OnLivableTile", "Local", TRUE
+      "MinMoveFrags", "1",             "Local", TRUE
+      "DiplRel",      "Foreign",       "Local", TRUE
     }
 target_reqs   =
     { "type",   "name", "range", "present"
@@ -434,13 +434,13 @@ target_reqs   =
 [enabler_bribe_unit]
 action        = "Bribe Unit"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "Diplomat", "Local", TRUE
-      "DiplRel", "Alliance", "Local", FALSE
-      "DiplRel", "Team", "Local", FALSE
-      "UnitState", "OnLivableTile", "Local", TRUE
-      "MinMoveFrags", "1", "Local", TRUE
-      "DiplRel", "Foreign", "Local", TRUE
+    { "type",         "name",          "range", "present"
+      "UnitTypeFlag", "Diplomat",      "Local", TRUE
+      "DiplRel",      "Alliance",      "Local", FALSE
+      "DiplRel",      "Team",          "Local", FALSE
+      "UnitState",    "OnLivableTile", "Local", TRUE
+      "MinMoveFrags", "1",             "Local", TRUE
+      "DiplRel",      "Foreign",       "Local", TRUE
     }
 target_reqs   =
     { "type",   "name", "range", "present"
@@ -452,25 +452,25 @@ target_reqs   =
 [enabler_trade_route]
 action        = "Establish Trade Route"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "TradeRoute", "Local", TRUE
-      "UnitState", "HasHomeCity", "Local", TRUE
+    { "type",         "name",        "range", "present"
+      "UnitTypeFlag", "TradeRoute",  "Local", TRUE
+      "UnitState",    "HasHomeCity", "Local", TRUE
     }
 
 [enabler_marketplace]
 action        = "Enter Marketplace"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "TradeRoute", "Local", TRUE
-      "UnitState", "HasHomeCity", "Local", TRUE
+    { "type",         "name",        "range", "present"
+      "UnitTypeFlag", "TradeRoute",  "Local", TRUE
+      "UnitState",    "HasHomeCity", "Local", TRUE
     }
 
 [enabler_help_build_wonder]
 action        = "Help Wonder"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "HelpWonder", "Local", TRUE
-      "DiplRel", "Foreign", "Local", FALSE
+    { "type",         "name",       "range", "present"
+      "UnitTypeFlag", "HelpWonder", "Local", TRUE
+      "DiplRel",      "Foreign",    "Local", FALSE
     }
 target_reqs   =
     { "type",   "name", "range"
@@ -493,10 +493,10 @@ action        = "Disband Unit"
 [enabler_build_city_pioneer]
 action        = "Found City"
 actor_reqs    =
-    { "type",   "name", "range"
-      "UnitFlag", "Cities", "Local"
-      "UnitState", "OnLivableTile", "Local"
-      "MinMoveFrags", "1", "Local"
+    { "type",         "name",          "range"
+      "UnitTypeFlag", "Cities",        "Local"
+      "UnitState",    "OnLivableTile", "Local"
+      "MinMoveFrags", "1",             "Local"
     }
 target_reqs   =
     { "type",   "name", "range", "present"
@@ -507,11 +507,11 @@ target_reqs   =
 [enabler_build_city_domestic]
 action        = "Found City"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "Cities", "Local", TRUE
-      "UnitState", "OnLivableTile", "Local", TRUE
-      "MinMoveFrags", "1", "Local", TRUE
-      "DiplRel", "Foreign", "Local", FALSE
+    { "type",         "name",          "range", "present"
+      "UnitTypeFlag", "Cities",        "Local", TRUE
+      "UnitState",    "OnLivableTile", "Local", TRUE
+      "MinMoveFrags", "1",             "Local", TRUE
+      "DiplRel",      "Foreign",       "Local", FALSE
     }
 target_reqs   =
     { "type",        "name",     "range", "present"
@@ -522,24 +522,24 @@ target_reqs   =
 [enabler_join_city]
 action        = "Join City"
 actor_reqs    =
-    { "type",   "name", "range", "present"
-      "UnitFlag", "AddToCity", "Local", TRUE
-      "DiplRel", "Foreign", "Local", FALSE
-      "MinMoveFrags", "1", "Local", TRUE
+    { "type",         "name",      "range", "present"
+      "UnitTypeFlag", "AddToCity", "Local", TRUE
+      "DiplRel",      "Foreign",   "Local", FALSE
+      "MinMoveFrags", "1",         "Local", TRUE
     }
 
 [enabler_nuke]
 action        = "Explode Nuclear"
 actor_reqs    =
-    { "type",     "name",    "range", "present"
-      "UnitFlag", "Nuclear", "Local", TRUE
+    { "type",         "name",    "range", "present"
+      "UnitTypeFlag", "Nuclear", "Local", TRUE
     }
 
 [enabler_nuke_city]
 action        = "Nuke City"
 actor_reqs    =
     { "type",         "name",    "range"
-      "UnitFlag",     "Nuclear", "Local"
+      "UnitTypeFlag", "Nuclear", "Local"
       "MinMoveFrags", "1",       "Local"
       "DiplRel",      "War",     "Local"
     }
@@ -548,7 +548,7 @@ actor_reqs    =
 action        = "Nuke Units"
 actor_reqs    =
     { "type",         "name",    "range"
-      "UnitFlag",     "Nuclear", "Local"
+      "UnitTypeFlag", "Nuclear", "Local"
       "MinMoveFrags", "1",       "Local"
       "DiplRel",      "War",     "Local"
     }
@@ -561,7 +561,7 @@ target_reqs   =
 action        = "Attack"
 actor_reqs    =
     { "type",          "name",         "range", "present"
-      "UnitFlag",      "NonMil",       "Local", FALSE
+      "UnitTypeFlag",  "NonMil",       "Local", FALSE
       "UnitClassFlag", "Missile",      "Local", FALSE
       "MinMoveFrags",  "1",            "Local", TRUE
       "UnitState",     "OnNativeTile", "Local", TRUE
@@ -572,7 +572,7 @@ actor_reqs    =
 action        = "Attack"
 actor_reqs    =
     { "type",          "name",    "range", "present"
-      "UnitFlag",      "NonMil",  "Local", FALSE
+      "UnitTypeFlag",  "NonMil",  "Local", FALSE
       "UnitClassFlag", "Missile", "Local", FALSE
       "MinMoveFrags",  "1",       "Local", TRUE
       "UnitClass",     "Sea",     "Local", TRUE
@@ -583,7 +583,7 @@ actor_reqs    =
 action        = "Collect Ransom"
 actor_reqs    =
     { "type",          "name",         "range", "present"
-      "UnitFlag",      "NonMil",       "Local", FALSE
+      "UnitTypeFlag",  "NonMil",       "Local", FALSE
       "UnitClassFlag", "Missile",      "Local", FALSE
       "MinMoveFrags",  "1",            "Local", TRUE
       "UnitState",     "OnNativeTile", "Local", TRUE
@@ -598,7 +598,7 @@ target_reqs   =
 action        = "Collect Ransom"
 actor_reqs    =
     { "type",          "name",         "range", "present"
-      "UnitFlag",      "NonMil",       "Local", FALSE
+      "UnitTypeFlag",  "NonMil",       "Local", FALSE
       "UnitClassFlag", "Missile",      "Local", FALSE
       "MinMoveFrags",  "1",            "Local", TRUE
       "UnitClass",     "Sea",          "Local", TRUE
@@ -613,7 +613,7 @@ target_reqs   =
 action        = "Suicide Attack"
 actor_reqs    =
     { "type",          "name",    "range", "present"
-      "UnitFlag",      "NonMil",  "Local", FALSE
+      "UnitTypeFlag",  "NonMil",  "Local", FALSE
       "UnitClassFlag", "Missile", "Local", TRUE
       "MinMoveFrags",  "1",       "Local", TRUE
       "DiplRel",       "War",     "Local", TRUE
@@ -622,12 +622,12 @@ actor_reqs    =
 [enabler_conquer_city_native]
 action        = "Conquer City Shrink"
 actor_reqs    =
-    { "type",           "name",          "range", "present"
-      "UnitClassFlag",  "CanOccupyCity", "Local", TRUE
-      "UnitFlag",       "NonMil",        "Local", FALSE
-      "DiplRel",        "War",           "Local", TRUE
-      "MinMoveFrags",   "1",             "Local", TRUE
-      "UnitState",      "OnLivableTile", "Local", TRUE
+    { "type",          "name",          "range", "present"
+      "UnitClassFlag", "CanOccupyCity", "Local", TRUE
+      "UnitTypeFlag",  "NonMil",        "Local", FALSE
+      "DiplRel",       "War",           "Local", TRUE
+      "MinMoveFrags",  "1",             "Local", TRUE
+      "UnitState",     "OnLivableTile", "Local", TRUE
     }
 target_reqs   =
     { "type",           "name",          "range", "present"
@@ -645,15 +645,15 @@ actor_reqs    =
 [enabler_cultivate]
 action        = "Cultivate"
 actor_reqs    =
-    { "type",          "name",         "range", "present"
-      "UnitFlag",      "Workers",      "Local", TRUE
+    { "type",         "name",    "range", "present"
+      "UnitTypeFlag", "Workers", "Local", TRUE
     }
 
 [enabler_plant]
 action        = "Plant"
 actor_reqs    =
-    { "type",          "name",         "range", "present"
-      "UnitFlag",      "Workers",      "Local", TRUE
+    { "type",         "name",    "range", "present"
+      "UnitTypeFlag", "Workers", "Local", TRUE
     }
 target_reqs   =
     { "type",          "name",         "range",  "present"
@@ -670,8 +670,8 @@ actor_reqs    =
 [enabler_clean]
 action        = "Clean"
 actor_reqs    =
-    { "type",          "name",         "range", "present"
-      "UnitFlag",      "Workers",      "Local", TRUE
+    { "type",         "name",    "range", "present"
+      "UnitTypeFlag", "Workers", "Local", TRUE
     }
 
 [enabler_fortify_terrain]
@@ -679,7 +679,7 @@ action        = "Fortify"
 actor_reqs    =
     { "type",          "name",         "range", "present"
       "UnitClassFlag", "CanFortify",   "Local", TRUE
-      "UnitFlag",      "Cant_Fortify", "Local", FALSE
+      "UnitTypeFlag",  "Cant_Fortify", "Local", FALSE
       "TerrainFlag",   "NoFortify",    "Tile",  FALSE
       "Activity",      "Fortified",    "Local", FALSE
     }
@@ -689,7 +689,7 @@ action        = "Fortify"
 actor_reqs    =
     { "type",          "name",         "range", "present"
       "UnitClassFlag", "CanFortify",   "Local", TRUE
-      "UnitFlag",      "Cant_Fortify", "Local", FALSE
+      "UnitTypeFlag",  "Cant_Fortify", "Local", FALSE
       "CityTile",      "Center",       "Tile",  TRUE
       "Activity",      "Fortified",    "Local", FALSE
     }
@@ -697,8 +697,8 @@ actor_reqs    =
 [enabler_road]
 action        = "Build Road"
 actor_reqs    =
-    { "type",          "name",         "range"
-      "UnitFlag",      "Workers",      "Local"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
     }
 target_reqs   =
     { "type",         "name",    "range"
@@ -708,8 +708,8 @@ target_reqs   =
 [enabler_base]
 action        = "Build Base"
 actor_reqs    =
-    { "type",          "name",         "range"
-      "UnitFlag",      "Workers",      "Local"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
     }
 target_reqs   =
     { "type",         "name",    "range"
@@ -719,8 +719,8 @@ target_reqs   =
 [enabler_mining]
 action        = "Build Mine"
 actor_reqs    =
-    { "type",          "name",         "range"
-      "UnitFlag",      "Workers",      "Local"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
     }
 target_reqs   =
     { "type",         "name",    "range"
@@ -730,8 +730,8 @@ target_reqs   =
 [enabler_irrigate_src_ocean]
 action        = "Build Irrigation"
 actor_reqs    =
-    { "type",          "name",         "range"
-      "UnitFlag",      "Workers",      "Local"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
     }
 target_reqs   =
     { "type",         "name",        "range"
@@ -742,8 +742,8 @@ target_reqs   =
 [enabler_irrigate_src_river]
 action        = "Build Irrigation"
 actor_reqs    =
-    { "type",          "name",         "range"
-      "UnitFlag",      "Workers",      "Local"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
     }
 target_reqs   =
     { "type",         "name",        "range"
@@ -754,8 +754,8 @@ target_reqs   =
 [enabler_irrigate_src_irrigation]
 action        = "Build Irrigation"
 actor_reqs    =
-    { "type",          "name",         "range"
-      "UnitFlag",      "Workers",      "Local"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
     }
 target_reqs   =
     { "type",         "name",        "range"
@@ -854,6 +854,6 @@ actor_reqs    =
 [enabler_gain_veterancy]
 action        = "Gain Veterancy"
 actor_reqs    =
-    { "type",        "name",        "range", "present"
-      "UnitFlag",    "NoVeteran",   "Local", FALSE
+    { "type",         "name",      "range", "present"
+      "UnitTypeFlag", "NoVeteran", "Local", FALSE
     }
diff --git a/data/civ1/effects.ruleset b/data/civ1/effects.ruleset
index 14f888aa9e..8e598427e6 100644
--- a/data/civ1/effects.ruleset
+++ b/data/civ1/effects.ruleset
@@ -1412,8 +1412,8 @@ reqs    =
 type	= "Unit_Bribe_Cost_Pct"
 value	= -50
 reqs	=
-    { "type", "name", "range"
-      "UnitFlag", "Cities", "Local"
+    { "type",         "name",   "range"
+      "UnitTypeFlag", "Cities", "Local"
     }
 
 [effect_illegal_action_move_cost_base]
@@ -1558,36 +1558,36 @@ reqs    =
 type    = "Action_Success_Actor_Move_Cost"
 value   = 65535
 reqs    =
-    { "type",     "name",      "range", "quiet"
-      "Action",   "Attack",    "Local", TRUE
-      "UnitFlag", "OneAttack", "Local", TRUE
+    { "type",         "name",      "range", "quiet"
+      "Action",       "Attack",    "Local", TRUE
+      "UnitTypeFlag", "OneAttack", "Local", TRUE
     }
 
 [effect_action_success_attack_normal]
 type    = "Action_Success_Actor_Move_Cost"
 value   = 3
 reqs    =
-    { "type",     "name",      "range", "present"
-      "Action",   "Attack",    "Local", TRUE
-      "UnitFlag", "OneAttack", "Local", FALSE
+    { "type",         "name",      "range", "present"
+      "Action",       "Attack",    "Local", TRUE
+      "UnitTypeFlag", "OneAttack", "Local", FALSE
     }
 
 [effect_action_success_ransom_one_attack]
 type    = "Action_Success_Actor_Move_Cost"
 value   = 65535
 reqs    =
-    { "type",     "name",           "range", "quiet"
-      "Action",   "Collect Ransom", "Local", TRUE
-      "UnitFlag", "OneAttack",      "Local", TRUE
+    { "type",         "name",           "range", "quiet"
+      "Action",       "Collect Ransom", "Local", TRUE
+      "UnitTypeFlag", "OneAttack",      "Local", TRUE
     }
 
 [effect_action_success_ransom]
 type    = "Action_Success_Actor_Move_Cost"
 value   = 3
 reqs    =
-    { "type",     "name",           "range", "present"
-      "Action",   "Collect Ransom", "Local", TRUE
-      "UnitFlag", "OneAttack",      "Local", FALSE
+    { "type",         "name",           "range", "present"
+      "Action",       "Collect Ransom", "Local", TRUE
+      "UnitTypeFlag", "OneAttack",      "Local", FALSE
     }
 
 [effect_unit_shield_value_recycle]
diff --git a/data/civ1/terrain.ruleset b/data/civ1/terrain.ruleset
index 4534fb0de5..f627906891 100644
--- a/data/civ1/terrain.ruleset
+++ b/data/civ1/terrain.ruleset
@@ -1138,11 +1138,11 @@ rmact_gfx      = "None"
 rmact_gfx_alt  = "-"
 rmact_gfx_alt2 = "-"
 reqs           =
-    { "type", "name", "range", "present", "quiet"
-      "Tech", "Construction", "Player", TRUE, FALSE
-      "TerrainClass", "Land", "Tile", TRUE, FALSE
-      "UnitFlag", "Workers", "Local", TRUE, FALSE
-      "CityTile", "Center", "Tile", FALSE, TRUE
+    { "type",         "name",         "range",  "present", "quiet"
+      "Tech",         "Construction", "Player", TRUE,      FALSE
+      "TerrainClass", "Land",         "Tile",   TRUE,      FALSE
+      "UnitTypeFlag", "Workers",      "Local",  TRUE,      FALSE
+      "CityTile",     "Center",       "Tile",   FALSE,     TRUE
     }
 build_time     = 3
 removal_time   = 0
@@ -1172,9 +1172,9 @@ rmact_gfx      = "None"
 rmact_gfx_alt  = "-"
 rmact_gfx_alt2 = "-"
 reqs           =
-    { "type", "name", "range"
-      "UnitFlag", "Workers", "Local"
-      "TerrainClass", "Land", "Tile"
+    { "type",         "name",    "range"
+      "UnitTypeFlag", "Workers", "Local"
+      "TerrainClass", "Land",    "Tile"
     }
 build_time     = 0
 removal_time   = 0
@@ -1205,12 +1205,12 @@ rmact_gfx      = "None"
 rmact_gfx_alt  = "-"
 rmact_gfx_alt2 = "-"
 reqs           =
-    { "type", "name", "range", "present"
-      "Tech", "Railroad", "Player", TRUE
-      "Extra", "Road", "Tile", TRUE
-      "UnitFlag", "Workers", "Local", TRUE
-      "TerrainClass", "Land", "Tile", TRUE
-      "CityTile", "Center", "Tile", FALSE
+    { "type",         "name",     "range",  "present"
+      "Tech",         "Railroad", "Player", TRUE
+      "Extra",        "Road",     "Tile",   TRUE
+      "UnitTypeFlag", "Workers",  "Local",  TRUE
+      "TerrainClass", "Land",     "Tile",   TRUE
+      "CityTile",     "Center",   "Tile",   FALSE
     }
 build_time     = 3
 removal_time   = 0
-- 
2.43.0

