From 0c8e918535bb8632ba1a621a5b2d4e7e13bf0638 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 4 Feb 2024 20:06:11 +0200
Subject: [PATCH 32/32] Fake Generalize "Clean"

See RM #230

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

diff --git a/common/actions.c b/common/actions.c
index 155edf6455..158bb931d5 100644
--- a/common/actions.c
+++ b/common/actions.c
@@ -552,6 +552,10 @@ static void hard_code_actions(void)
       unit_action_new(ACTION_CLEAN, ACTRES_CLEAN,
                       TRUE, FALSE,
                       MAK_STAYS, 0, 0, FALSE);
+  actions[ACTION_CLEAN2] =
+      unit_action_new(ACTION_CLEAN2, ACTRES_CLEAN,
+                      TRUE, FALSE,
+                      MAK_STAYS, 0, 0, FALSE);
   actions[ACTION_FORTIFY] =
       unit_action_new(ACTION_FORTIFY, ACTRES_FORTIFY,
                       TRUE, FALSE,
@@ -5854,6 +5858,8 @@ const char *action_ui_name_ruleset_var_name(int act)
     return "ui_name_pillage";
   case ACTION_CLEAN:
     return "ui_name_clean";
+  case ACTION_CLEAN2:
+    return "ui_name_clean_2";
   case ACTION_FORTIFY:
     return "ui_name_fortify";
   case ACTION_FORTIFY2:
@@ -6201,6 +6207,7 @@ const char *action_ui_name_default(int act)
     /* TRANS: Pilla_ge (100% chance of success). */
     return N_("Pilla%sge%s");
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
     /* TRANS: Clean (100% chance of success). */
     return N_("%sClean%s");
   case ACTION_FORTIFY:
@@ -6400,6 +6407,7 @@ const char *action_min_range_ruleset_var_name(int act)
   case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
   case ACTION_FORTIFY:
   case ACTION_FORTIFY2:
   case ACTION_ROAD:
@@ -6569,6 +6577,7 @@ const char *action_max_range_ruleset_var_name(int act)
   case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
   case ACTION_FORTIFY:
   case ACTION_FORTIFY2:
   case ACTION_ROAD:
@@ -6752,6 +6761,7 @@ const char *action_target_kind_ruleset_var_name(int act)
   case ACTION_PLANT:
   case ACTION_PLANT2:
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
   case ACTION_FORTIFY:
   case ACTION_FORTIFY2:
   case ACTION_ROAD:
@@ -7026,6 +7036,7 @@ const char *action_actor_consuming_always_ruleset_var_name(action_id act)
   case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
   case ACTION_FORTIFY:
   case ACTION_FORTIFY2:
   case ACTION_ROAD:
@@ -7246,6 +7257,7 @@ const char *action_blocked_by_ruleset_var_name(const struct action *act)
   case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
   case ACTION_FORTIFY:
   case ACTION_FORTIFY2:
   case ACTION_ROAD:
@@ -7404,6 +7416,7 @@ action_post_success_forced_ruleset_var_name(const struct action *act)
   case ACTION_PLANT2:
   case ACTION_PILLAGE:
   case ACTION_CLEAN:
+  case ACTION_CLEAN2:
   case ACTION_FORTIFY:
   case ACTION_FORTIFY2:
   case ACTION_ROAD:
diff --git a/doc/README.actions b/doc/README.actions
index 27f2ad3baa..ca9a7e2324 100644
--- a/doc/README.actions
+++ b/doc/README.actions
@@ -1202,7 +1202,7 @@ Actions done by a unit against a tile
  * the target extra must be the rule chosen extra if the civstyle section's
    pillage_select is FALSE
 
-"Clean"             - clean extra from the target tile.
+"Clean"             - Clean extra from the target tile.
  * UI name can be set using ui_name_clean
  * actor must be on the same tile as the target.
  * the actor unit has the "Workers" unit type flag (!)
@@ -1217,6 +1217,10 @@ Actions done by a unit against a tile
  * the target extra can't have the AutoOnCityCenter extra flag if the
    target tile has a city and the city's owner can rebuild it
 
+"Clean 2"           - Clean extra from the target tile.
+ * UI name can be set using ui_name_clean_2
+ * See "Clean" for everything else.
+
 "Build Road"        - Build road at the target tile.
  * UI name can be set using ui_name_build_road
  * actor must be on the same tile as the target.
diff --git a/gen_headers/enums/actions_enums.def b/gen_headers/enums/actions_enums.def
index ecbb5a72a9..1cd1b871db 100644
--- a/gen_headers/enums/actions_enums.def
+++ b/gen_headers/enums/actions_enums.def
@@ -127,6 +127,7 @@ values
   ACTION_TELEPORT_ENTER                   "Teleport Unit Enter"
   ACTION_TELEPORT_ENTER_CONQUER           "Teleport Unit Enter Conquer"
   ACTION_CLEAN                            "Clean"
+  ACTION_CLEAN2                           "Clean 2"
   ACTION_COLLECT_RANSOM                   "Collect Ransom"
   ACTION_FORTIFY                          "Fortify"
   ACTION_FORTIFY2                         "Fortify 2"
-- 
2.43.0

