From 5228409a7f43c8c4ab0727c89c62bc7b4cbdaa36 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Wed, 31 Jan 2024 02:27:41 +0200
Subject: [PATCH 24/24] Fake Generalize Fortify action

See RM #210

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

diff --git a/common/actions.c b/common/actions.c
index c78a9cc0a8..067bce095b 100644
--- a/common/actions.c
+++ b/common/actions.c
@@ -559,6 +559,10 @@ static void hard_code_actions(void)
       unit_action_new(ACTION_FORTIFY, ACTRES_FORTIFY,
                       TRUE, FALSE,
                       MAK_STAYS, 0, 0, FALSE);
+  actions[ACTION_FORTIFY2] =
+      unit_action_new(ACTION_FORTIFY2, ACTRES_FORTIFY,
+                      TRUE, FALSE,
+                      MAK_STAYS, 0, 0, FALSE);
   actions[ACTION_ROAD] =
       unit_action_new(ACTION_ROAD, ACTRES_ROAD,
                       TRUE, FALSE,
@@ -5855,6 +5859,8 @@ const char *action_ui_name_ruleset_var_name(int act)
     return "ui_name_clean";
   case ACTION_FORTIFY:
     return "ui_name_fortify";
+  case ACTION_FORTIFY2:
+    return "ui_name_fortify_2";
   case ACTION_ROAD:
     return "ui_name_build_road";
   case ACTION_ROAD2:
@@ -6201,6 +6207,7 @@ const char *action_ui_name_default(int act)
     /* TRANS: Clean (100% chance of success). */
     return N_("%sClean%s");
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
     /* TRANS: _Fortify (100% chance of success). */
     return N_("%sFortify%s");
   case ACTION_ROAD:
@@ -6397,6 +6404,7 @@ const char *action_min_range_ruleset_var_name(int act)
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
   case ACTION_ROAD:
   case ACTION_ROAD2:
   case ACTION_CONVERT:
@@ -6565,6 +6573,7 @@ const char *action_max_range_ruleset_var_name(int act)
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
   case ACTION_ROAD:
   case ACTION_ROAD2:
   case ACTION_CONVERT:
@@ -6747,6 +6756,7 @@ const char *action_target_kind_ruleset_var_name(int act)
   case ACTION_PLANT2:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
   case ACTION_ROAD:
   case ACTION_ROAD2:
   case ACTION_CONVERT:
@@ -7117,6 +7127,7 @@ const char *action_actor_consuming_always_ruleset_var_name(action_id act)
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
   case ACTION_ROAD:
   case ACTION_ROAD2:
   case ACTION_CONVERT:
@@ -7336,6 +7347,7 @@ const char *action_blocked_by_ruleset_var_name(const struct action *act)
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
   case ACTION_ROAD:
   case ACTION_ROAD2:
   case ACTION_CONVERT:
@@ -7492,6 +7504,7 @@ action_post_success_forced_ruleset_var_name(const struct action *act)
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
   case ACTION_FORTIFY:
+  case ACTION_FORTIFY2:
   case ACTION_ROAD:
   case ACTION_ROAD2:
   case ACTION_CONVERT:
diff --git a/doc/README.actions b/doc/README.actions
index fce16f7612..27f2ad3baa 100644
--- a/doc/README.actions
+++ b/doc/README.actions
@@ -1658,6 +1658,10 @@ Actions done by a unit to it self
  * UI name can be set using ui_name_fortify
  * the actor unit can't already be fortified (!)
 
+"Fortify 2"         - Fortify at tile
+ * UI name can be set using ui_name_fortify_2
+ * See "Fortify" for everything else.
+
 "Convert Unit" - Convert the unit to another unit type.
  * UI name can be set using ui_name_convert_unit
  * actor unit must have a type to convert to (convert_to).
diff --git a/gen_headers/enums/actions_enums.def b/gen_headers/enums/actions_enums.def
index 4940bb3193..ecbb5a72a9 100644
--- a/gen_headers/enums/actions_enums.def
+++ b/gen_headers/enums/actions_enums.def
@@ -129,6 +129,7 @@ values
   ACTION_CLEAN                            "Clean"
   ACTION_COLLECT_RANSOM                   "Collect Ransom"
   ACTION_FORTIFY                          "Fortify"
+  ACTION_FORTIFY2                         "Fortify 2"
   ACTION_CULTIVATE                        "Cultivate"
   ACTION_CULTIVATE2                       "Cultivate 2"
   ACTION_PLANT                            "Plant"
-- 
2.43.0

