From 423611fe6fe432c7da90c1cd783ed6bdaaca0082 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 20 Feb 2024 19:45:37 +0200
Subject: [PATCH 30/30] Granularity: Add Trireme

- Add tech Seafaring
- Add unit Trireme
- Make Boats able to sail tiles next to coast only
- Rename unit class Sea as ShallowSea
- Add terrain Deep Ocean, that ShallowSea units are not able to enter

See RM #270

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 data/granularity/techs.ruleset   |  9 ++++++
 data/granularity/terrain.ruleset | 52 ++++++++++++++++++++++++++++++--
 data/granularity/units.ruleset   | 48 ++++++++++++++++++++++++++---
 3 files changed, 102 insertions(+), 7 deletions(-)

diff --git a/data/granularity/techs.ruleset b/data/granularity/techs.ruleset
index f391d9c573..1046ee4ee1 100644
--- a/data/granularity/techs.ruleset
+++ b/data/granularity/techs.ruleset
@@ -396,6 +396,15 @@ graphic     = "a.rope"
 graphic_alt = "-"
 ;helptext    =
 
+[advance_seafaring]
+name        = _("Seafaring")
+req1        = "Carving"
+req2        = "Rope"
+flags       = ""
+graphic     = "a.seafaring"
+graphic_alt = "-"
+;helptext    =
+
 [advance_siege_engines]
 name        = _("Siege Engines")
 req1        = "Rope"
diff --git a/data/granularity/terrain.ruleset b/data/granularity/terrain.ruleset
index dd7895e49d..c35ff56e3e 100644
--- a/data/granularity/terrain.ruleset
+++ b/data/granularity/terrain.ruleset
@@ -397,14 +397,62 @@ warmer_wetter_result = "no"
 warmer_drier_result  = "no"
 cooler_wetter_result = "no"
 cooler_drier_result  = "no"
-native_to            = "Sea"
+native_to            = "ShallowSea"
 ;flags                =
 property_ocean_depth = 10
 color.r              = 50
 color.g              = 50
 color.b              = 230
 helptext	     = _("\
-This is only possible oceanic terrain.\
+Shallow Ocean usually exist only next to land.\
+")
+
+[terrain_deep_ocean]
+name                 = _("Deep Ocean")
+graphic              = "deep_ocean"
+graphic_alt	     = "floor"
+graphic_alt2         = "coast"
+identifier	     = ":"
+class                = "Oceanic"
+movement_cost        = 5
+defense_bonus        = 0
+food                 = 100
+shield               = 100
+trade                = 0
+resources            = "Generic Resource"
+road_food_incr_pct   = 0
+road_shield_incr_pct = 0
+road_trade_incr_pct  = 100
+base_time            = 0
+road_time            = 0
+cultivate_result     = "no"
+cultivate_time       = 0
+plant_result         = "no"
+plant_time           = 0
+irrigation_food_incr = 100
+irrigation_time      = 5
+mining_shield_incr   = 0
+mining_time          = 0
+transform_result     = "no"
+transform_time       = 0
+placing_time         = 1
+pillage_time         = 1
+extra_settings       =
+    { "extra", "removal_time"
+    }
+animal               = "None"
+warmer_wetter_result = "no"
+warmer_drier_result  = "no"
+cooler_wetter_result = "no"
+cooler_drier_result  = "no"
+;native_to            = ""
+;flags                =
+property_ocean_depth = 85
+color.r              = 0
+color.g              = 33
+color.b              = 129
+helptext	     = _("\
+Deep Ocean usually exist further away from the land.\
 ")
 
 ; /* <-- avoid gettext warnings
diff --git a/data/granularity/units.ruleset b/data/granularity/units.ruleset
index b1cd1a318c..c1e8cbeb48 100644
--- a/data/granularity/units.ruleset
+++ b/data/granularity/units.ruleset
@@ -130,8 +130,8 @@ min_speed     = 5
 hp_loss_pct   = 0
 flags         = "TerrainSpeed", "NonNatBombardTgt", "CanOccupyCity"
 
-[unitclass_sea]
-name          = _("Sea")
+[unitclass_shallow_sea]
+name          = _("ShallowSea")
 min_speed     = 5
 hp_loss_pct   = 0
 flags         = "TerrainSpeed"
@@ -785,12 +785,12 @@ and plants.\
 
 [unit_boat]
 name          = _("Boats")
-class         = "Sea"
+class         = "ShallowSea"
 reqs          =
   { "type", "name", "range"
     "Tech", "Carving", "Player"
   }
-obsolete_by   = "None"
+obsolete_by   = "Trireme"
 graphic       = "u.boats"
 graphic_alt   = "u.trireme"
 sound_move    = "m_boats"
@@ -813,10 +813,48 @@ uk_food       = 0
 uk_gold       = 0
 cargo         = "Land"
 tp_defense    = "Alight"
+flags         = "CoastStrict"
+roles         = "Ferryboat", "BarbarianBoat"
+helptext      = _("\
+Boats carved from logs. \
+They cannot sail off the coast.\
+")
+
+[unit_trireme]
+name          = _("Trireme")
+class         = "ShallowSea"
+reqs          =
+  { "type", "name", "range"
+    "Tech", "Seafaring", "Player"
+  }
+obsolete_by   = "None"
+graphic       = "u.trireme"
+graphic_alt   = "-"
+sound_move    = "m_trireme"
+sound_move_alt = "m_generic"
+sound_fight   = "f_trireme"
+sound_fight_alt = "f_generic"
+build_cost    = 2800
+pop_cost      = 0
+attack        = 20
+defense       = 20
+hitpoints     = 10
+firepower     = 1
+move_rate     = 150
+vision_radius_sq = 2
+transport_cap = 2
+fuel          = 0
+uk_happy      = 0
+uk_shield     = 0
+uk_food       = 0
+uk_gold       = 0
+cargo         = "Land"
+tp_defense    = "Alight"
 flags         = ""
 roles         = "Ferryboat", "BarbarianBoat"
 helptext      = _("\
-Boats carved from logs.\
+First boat type able to leave the coastline, but still restricted \
+to sail on shallow oceans only.\
 ")
 
 [unit_emissary]
-- 
2.43.0

