From 89e3ed1e3011e2c266011856104ddc25b3e6db9f Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 7 Jan 2024 03:55:50 +0200
Subject: [PATCH 33/33] Fake Generalize terrain transformative actions

See RM #134

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/actions.c                    | 39 +++++++++++++++++++++++++++++
 doc/README.actions                  | 12 +++++++++
 gen_headers/enums/actions_enums.def |  3 +++
 3 files changed, 54 insertions(+)

diff --git a/common/actions.c b/common/actions.c
index c22b9987ca..d5611ebdca 100644
--- a/common/actions.c
+++ b/common/actions.c
@@ -527,14 +527,26 @@ static void hard_code_actions(void)
       unit_action_new(ACTION_TRANSFORM_TERRAIN, ACTRES_TRANSFORM_TERRAIN,
                       TRUE, FALSE,
                       MAK_STAYS, 0, 0, FALSE);
+  actions[ACTION_TRANSFORM_TERRAIN2] =
+      unit_action_new(ACTION_TRANSFORM_TERRAIN2, ACTRES_TRANSFORM_TERRAIN,
+                      TRUE, FALSE,
+                      MAK_STAYS, 0, 0, FALSE);
   actions[ACTION_CULTIVATE] =
       unit_action_new(ACTION_CULTIVATE, ACTRES_CULTIVATE,
                       TRUE, FALSE,
                       MAK_STAYS, 0, 0, FALSE);
+  actions[ACTION_CULTIVATE2] =
+      unit_action_new(ACTION_CULTIVATE2, ACTRES_CULTIVATE,
+                      TRUE, FALSE,
+                      MAK_STAYS, 0, 0, FALSE);
   actions[ACTION_PLANT] =
       unit_action_new(ACTION_PLANT, ACTRES_PLANT,
                       TRUE, FALSE,
                       MAK_STAYS, 0, 0, FALSE);
+  actions[ACTION_PLANT2] =
+      unit_action_new(ACTION_PLANT2, ACTRES_PLANT,
+                      TRUE, FALSE,
+                      MAK_STAYS, 0, 0, FALSE);
   actions[ACTION_PILLAGE] =
       unit_action_new(ACTION_PILLAGE, ACTRES_PILLAGE,
                       TRUE, FALSE,
@@ -5798,10 +5810,16 @@ const char *action_ui_name_ruleset_var_name(int act)
     return "ui_name_heal_unit_2";
   case ACTION_TRANSFORM_TERRAIN:
     return "ui_name_transform_terrain";
+  case ACTION_TRANSFORM_TERRAIN2:
+    return "ui_name_transform_terrain_2";
   case ACTION_CULTIVATE:
     return "ui_name_cultivate";
+  case ACTION_CULTIVATE2:
+    return "ui_name_cultivate_2";
   case ACTION_PLANT:
     return "ui_name_plant";
+  case ACTION_PLANT2:
+    return "ui_name_plant_2";
   case ACTION_PILLAGE:
     return "ui_name_pillage";
   case ACTION_CLEAN:
@@ -6128,12 +6146,15 @@ const char *action_ui_name_default(int act)
     /* TRANS: Heal _Unit (3% chance of success). */
     return N_("Heal %sUnit%s");
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
     /* TRANS: _Transform Terrain (3% chance of success). */
     return N_("%sTransform Terrain%s");
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
     /* TRANS: Transform by _Cultivating (3% chance of success). */
     return N_("Transform by %sCultivating%s");
   case ACTION_PLANT:
+  case ACTION_PLANT2:
     /* TRANS: Transform by _Planting (3% chance of success). */
     return N_("Transform by %sPlanting%s");
   case ACTION_PILLAGE:
@@ -6319,8 +6340,11 @@ const char *action_min_range_ruleset_var_name(int act)
   case ACTION_HEAL_UNIT:
   case ACTION_HEAL_UNIT2:
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
   case ACTION_PLANT:
+  case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
@@ -6476,8 +6500,11 @@ const char *action_max_range_ruleset_var_name(int act)
   case ACTION_HEAL_UNIT:
   case ACTION_HEAL_UNIT2:
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
   case ACTION_PLANT:
+  case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
@@ -6648,8 +6675,11 @@ const char *action_target_kind_ruleset_var_name(int act)
   case ACTION_HEAL_UNIT:
   case ACTION_HEAL_UNIT2:
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
   case ACTION_PLANT:
+  case ACTION_PLANT2:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
   case ACTION_ROAD:
@@ -7103,8 +7133,11 @@ const char *action_actor_consuming_always_ruleset_var_name(action_id act)
   case ACTION_HEAL_UNIT:
   case ACTION_HEAL_UNIT2:
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
   case ACTION_PLANT:
+  case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
@@ -7307,8 +7340,11 @@ const char *action_blocked_by_ruleset_var_name(const struct action *act)
   case ACTION_HEAL_UNIT:
   case ACTION_HEAL_UNIT2:
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
   case ACTION_PLANT:
+  case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
@@ -7460,8 +7496,11 @@ action_post_success_forced_ruleset_var_name(const struct action *act)
   case ACTION_HEAL_UNIT:
   case ACTION_HEAL_UNIT2:
   case ACTION_TRANSFORM_TERRAIN:
+  case ACTION_TRANSFORM_TERRAIN2:
   case ACTION_CULTIVATE:
+  case ACTION_CULTIVATE2:
   case ACTION_PLANT:
+  case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
diff --git a/doc/README.actions b/doc/README.actions
index 4496ce045b..f0d1c489ab 100644
--- a/doc/README.actions
+++ b/doc/README.actions
@@ -1162,16 +1162,28 @@ Actions done by a unit against a tile
  * the actor unit has "Workers" flag (!)
  * terrain type must be one that can be transformed
 
+"Transform Terrain 2" - Transform tile terrain type.
+ * UI name can be set using ui_name_transform_terrain_2
+ * See "Transform Terrain" for everything else.
+
 "Cultivate"         - Transform tile terrain type by cultivating
  * UI name can be set using ui_name_cultivate
  * the actor unit has "Workers" flag (!)
  * terrain type must be one that can be cultivated
 
+"Cultivate 2"       - Transform tile terrain type by cultivating
+ * UI name can be set using ui_name_cultivate_2
+ * See "Cultivate" for everything else.
+
 "Plant"             - Transform tile terrain type by planting
  * UI name can be set using ui_name_plant
  * the actor unit has "Workers" flag (!)
  * terrain type must be one on which units can plant
 
+"Plant 2"           - Transform tile terrain type by planting
+ * UI name can be set using ui_name_plant_2
+ * See "Plant" for everything else.
+
 "Pillage"           - Pillage extra from tile
  * UI name can be set using ui_name_pillage
  * target kind can be changed with pillage_target_kind
diff --git a/gen_headers/enums/actions_enums.def b/gen_headers/enums/actions_enums.def
index 19a6745e52..9ba6fd0671 100644
--- a/gen_headers/enums/actions_enums.def
+++ b/gen_headers/enums/actions_enums.def
@@ -126,8 +126,11 @@ values
   ACTION_COLLECT_RANSOM                   "Collect Ransom"
   ACTION_FORTIFY                          "Fortify"
   ACTION_CULTIVATE                        "Cultivate"
+  ACTION_CULTIVATE2                       "Cultivate 2"
   ACTION_PLANT                            "Plant"
+  ACTION_PLANT2                           "Plant 2"
   ACTION_TRANSFORM_TERRAIN                "Transform Terrain"
+  ACTION_TRANSFORM_TERRAIN2               "Transform Terrain 2"
 
   # Enabler checks only
   ACTION_GAIN_VETERANCY                   "Gain Veterancy"
-- 
2.43.0

