From b80de5dc09943d071e2f591fcb15dd48d9e7aa5b Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Mon, 8 Jan 2024 19:54:43 +0200
Subject: [PATCH 36/36] Granularity: Add Rituals morale boost

- Add tech Rituals, depending on Cave Painting and Spirits
- Make Rituals to provide both attack and defense bonus
- Add tech Counting, and make Alphabet to depend on it
  instead of Spirits. That way Rituals and Alphabet have
  different dependencies
- Add 50% base tax penalty, that gets cancelled by
  the Counting tech. Thus Counting is not an useless tech
- Make also Calendar to depend on Counting

See RM #146

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 data/granularity/README.granularity |  2 ++
 data/granularity/effects.ruleset    | 25 +++++++++++++++++++++++++
 data/granularity/techs.ruleset      | 26 ++++++++++++++++++++++++--
 3 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/data/granularity/README.granularity b/data/granularity/README.granularity
index e7351b9759..f3408bad72 100644
--- a/data/granularity/README.granularity
+++ b/data/granularity/README.granularity
@@ -20,3 +20,5 @@ movement costs is 1/6 points.
  * Cities are protected a bit from rapid shrinking due to
    continuous famine by the fact that when city shrinks,
    its granary is set to 10% full, not empty
+ * Initially there's a 50% penalty to collecting taxes. This is
+   removed by the Counting tech.
diff --git a/data/granularity/effects.ruleset b/data/granularity/effects.ruleset
index 6b1a47790b..d4513d9b03 100644
--- a/data/granularity/effects.ruleset
+++ b/data/granularity/effects.ruleset
@@ -246,6 +246,22 @@ reqs	=
       "UnitClass", "Land",       "Local"
     }
 
+[effect_morale_boost_attack]
+type    = "Attack_Bonus"
+value	= 20
+reqs	=
+    { "type", "name",    "range"
+      "Tech", "Rituals", "Player"
+    }
+
+[effect_morale_boost_defense]
+type    = "Defend_Bonus"
+value	= 20
+reqs	=
+    { "type", "name",    "range"
+      "Tech", "Rituals", "Player"
+    }
+
 [effect_action_success_move_cost_from_non_native]
 type    = "Action_Success_Actor_Move_Cost"
 value   = 65535
@@ -281,6 +297,15 @@ reqs    =
       "OutputType", "Shield", "Local",  TRUE
     }
 
+[effect_no_counting]
+type    = "Output_Bonus"
+value   = -50
+reqs    =
+    { "type",       "name",     "range", "present"
+      "Tech",       "Counting", "Player", FALSE
+      "OutputType", "Gold",     "Local",  TRUE
+    }
+
 [effect_irrigation]
 type    = "Irrigation_Pct"
 value   = 100
diff --git a/data/granularity/techs.ruleset b/data/granularity/techs.ruleset
index aff0aef5a6..4c470551af 100644
--- a/data/granularity/techs.ruleset
+++ b/data/granularity/techs.ruleset
@@ -126,7 +126,7 @@ helptext    = _("Agriculture allows placing irrigation.")
 [advance_alphabet]
 name        = _("Alphabet")
 req1        = "Cave Painting"
-req2        = "Spirits"
+req2        = "Counting"
 flags       = ""
 graphic     = "a.alphabet"
 graphic_alt = "-"
@@ -165,7 +165,7 @@ graphic_alt = "-"
 [advance_calendar]
 name        = _("Calendar")
 req1        = "Agriculture"
-req2        = "None"
+req2        = "Counting"
 flags       = ""
 graphic     = "a.calendar"
 graphic_alt = "-"
@@ -191,6 +191,17 @@ graphic     = "a.cave_painting"
 graphic_alt = "-"
 helptext    = _("Cave Paintings record hunting and fights.")
 
+[advance_counting]
+name        = _("Counting")
+req1        = "None"
+req2        = "None"
+flags       = ""
+graphic     = "a.counting"
+graphic_alt = "-"
+helptext    = _("\
+Allows collecting taxes without miscalculation penalties.\
+")
+
 [advance_diplomacy]
 name        = _("Diplomacy")
 req1        = "Government"
@@ -317,6 +328,17 @@ graphic     = "a.road_building"
 graphic_alt = "-"
 helptext    = _("Allows build actual roads.")
 
+[advance_rituals]
+name        = _("Rituals")
+req1        = "Cave Painting"
+req2        = "Spirits"
+flags       = ""
+graphic     = "a.rituals"
+graphic_alt = "-"
+helptext    = _("\
+Provides a morale boost increasing both attack and defense values of units buy 20%.\
+")
+
 [advance_spirits]
 name        = _("Spirits")
 req1        = "None"
-- 
2.43.0

