From 588250fe1235978e606a91e412357374b83823c3 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 2 Apr 2024 19:47:34 +0300
Subject: [PATCH 56/56] Granularity: Add Monarchy

- Add tech Monarchy
- Add government type Monarchy
- Make it possible to acquire only ten cities under Despotism

See RM #395

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 data/granularity/actions.ruleset     | 31 ++++++++++++++++++++++++++++
 data/granularity/governments.ruleset | 24 ++++++++++++++++++---
 data/granularity/techs.ruleset       |  9 ++++++++
 3 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/data/granularity/actions.ruleset b/data/granularity/actions.ruleset
index 374601d374..7610afd6c2 100644
--- a/data/granularity/actions.ruleset
+++ b/data/granularity/actions.ruleset
@@ -307,6 +307,21 @@ actor_reqs    =
       "UnitState",    "OnLivableTile", "Local",  TRUE
       "MinMoveFrags", "5",             "Local",  TRUE
       "Gov",          "Despotism",     "Player", TRUE
+      "MinCities",    "10",            "Player", FALSE
+    }
+target_reqs   =
+    { "type",        "name",     "range", "present"
+      "TerrainFlag", "NoCities", "Tile",  FALSE
+    }
+
+[actionenabler_found_city_monarchy]
+action        = "Found City"
+actor_reqs    =
+    { "type",         "name",          "range",  "present"
+      "UnitFlag",     "Cities",        "Local",  TRUE
+      "UnitState",    "OnLivableTile", "Local",  TRUE
+      "MinMoveFrags", "5",             "Local",  TRUE
+      "Gov",          "Monarchy",      "Player", TRUE
     }
 target_reqs   =
     { "type",        "name",     "range", "present"
@@ -475,6 +490,22 @@ actor_reqs    =
       "DiplRel",       "War",           "Local",  TRUE
       "MinMoveFrags",  "1",             "Local",  TRUE
       "Gov",           "Despotism",     "Player", TRUE
+      "MinCities",     "10",            "Player", FALSE
+    }
+target_reqs   =
+    { "type",           "name", "range", "present"
+      "MaxUnitsOnTile", "0",    "Tile",  TRUE
+    }
+
+[actionenabler_conquer_city_monarchy]
+action        = "Conquer City"
+actor_reqs    =
+    { "type",          "name",          "range",  "present"
+      "UnitClassFlag", "CanOccupyCity", "Local",  TRUE
+      "UnitFlag",      "NonMil",        "Local",  FALSE
+      "DiplRel",       "War",           "Local",  TRUE
+      "MinMoveFrags",  "1",             "Local",  TRUE
+      "Gov",           "Monarchy",      "Player", TRUE
     }
 target_reqs   =
     { "type",           "name", "range", "present"
diff --git a/data/granularity/governments.ruleset b/data/granularity/governments.ruleset
index 8d9faa0646..92be0fc6bc 100644
--- a/data/granularity/governments.ruleset
+++ b/data/granularity/governments.ruleset
@@ -71,7 +71,7 @@ ruler_female_title = _("?female:Usurper %s")
 
 helptext = _("\
 Anarchy happens between government changes. \
-No new cities can be aqcuired during anarchy.\
+No new cities can be acquired during anarchy.\
 ")
 
 ;------------------------------------------------------------------------
@@ -98,7 +98,7 @@ Under tribalism the maximum nation size is five cities.\
 
 name        = _("Despotism")
 reqs =
-   { "type", "name", "range"
+   { "type", "name",       "range"
      "Tech", "Government", "Player"
    }
 graphic     = "gov.despotism"
@@ -109,7 +109,25 @@ ruler_female_title = _("?female:Chief %s")
 
 helptext = _("\
 Compared to tribalism, despotism gives some more power to the leader. \
-It's possible to control more than five cities.\
+It's possible acquire up to ten cities.\
+")
+
+;------------------------------------------------------------------------
+[government_monarchy]
+
+name        = _("Monarchy")
+reqs =
+   { "type", "name",     "range"
+     "Tech", "Monarchy", "Player"
+   }
+graphic     = "gov.monarchy"
+graphic_alt = "-"
+
+ruler_male_title = _("King %s")
+ruler_female_title = _("?female:Queen %s")
+
+helptext = _("\
+It's possible to acquire more than ten cities.\
 ")
 
 ; /* <-- avoid gettext warnings
diff --git a/data/granularity/techs.ruleset b/data/granularity/techs.ruleset
index 2147c66c31..5660ca7f27 100644
--- a/data/granularity/techs.ruleset
+++ b/data/granularity/techs.ruleset
@@ -433,6 +433,15 @@ graphic     = "a.mining"
 graphic_alt = "-"
 ;helptext    =
 
+[advance_monarchy]
+name        = _("Monarchy")
+req1        = "Diplomacy"
+req2        = "Currency"
+flags       = ""
+graphic     = "a.monarchy"
+graphic_alt = "-"
+;helptext    =
+
 [advance_plow]
 name        = _("Plow")
 req1        = "Agriculture"
-- 
2.43.0

