Author: sveinung
Date: Thu Nov 10 10:40:27 2016
New Revision: 34474

URL: http://svn.gna.org/viewcvs/freeciv?rev=34474&view=rev
Log:
Conquer City: make !animal hard req obligatory.

See patch #7966

Modified:
    trunk/common/actions.c
    trunk/doc/README.actions
    trunk/fc_version

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34474&r1=34473&r2=34474&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Thu Nov 10 10:40:27 2016
@@ -154,8 +154,9 @@
 }
 
 /**************************************************************************
-  Hard code the obligatory hard requirements. They are sorted by
-  requirement to make it easy to read, modify and explain them.
+  Hard code the obligatory hard requirements that don't depend on the rest
+  of the ruleset. They are sorted by requirement to make it easy to read,
+  modify and explain them.
 **************************************************************************/
 static void hard_code_oblig_hard_reqs(void)
 {
@@ -289,6 +290,27 @@
                           "All action enablers for %s must require that "
                           "the actor isn't transporting another unit.",
                           ACTION_PARADROP, ACTION_AIRLIFT, ACTION_NONE);
+}
+
+/**************************************************************************
+  Hard code the obligatory hard requirements that needs access to the
+  ruleset before they can be generated.
+**************************************************************************/
+static void hard_code_oblig_hard_reqs_ruleset(void)
+{
+  /* Why this is a hard requirement: the "animal can't conquer a city"
+   * rule. Assumed in unit_can_take_over(). */
+  nations_iterate(pnation) {
+    if (nation_barbarian_type(pnation) == ANIMAL_BARBARIAN) {
+      oblig_hard_req_register(req_from_values(VUT_NATION, REQ_RANGE_PLAYER,
+                                              FALSE, TRUE, TRUE,
+                                              nation_number(pnation)),
+                              TRUE,
+                              "All action enablers for %s must require a "
+                              "non animal player actor.",
+                              ACTION_CONQUER_CITY, ACTION_NONE);
+    }
+  } nations_iterate_end;
 }
 
 /**************************************************************************
@@ -507,6 +529,9 @@
 **************************************************************************/
 void actions_rs_pre_san_gen(void)
 {
+  /* Some obligatory hard requirements needs access to the rest of the
+   * ruleset. */
+  hard_code_oblig_hard_reqs_ruleset();
 }
 
 /**************************************************************************
@@ -1549,15 +1574,6 @@
 
     break;
 
-  case ACTION_CONQUER_CITY:
-    /* Reason: the "animal can't conquer a city" rule. */
-    /* Info leak: The player knows what he is. */
-    if (actor_player->ai_common.barbarian_type == ANIMAL_BARBARIAN) {
-      return TRI_NO;
-    }
-
-    break;
-
   case ACTION_AIRLIFT:
     {
       const struct city *psrc_city = tile_city(actor_tile);
@@ -1617,6 +1633,7 @@
   case ACTION_HOME_CITY:
   case ACTION_UPGRADE_UNIT:
   case ACTION_ATTACK:
+  case ACTION_CONQUER_CITY:
   case ACTION_HEAL_UNIT:
     /* No hard unit type requirements. */
     break;

Modified: trunk/doc/README.actions
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.actions?rev=34474&r1=34473&r2=34474&view=diff
==============================================================================
--- trunk/doc/README.actions    (original)
+++ trunk/doc/README.actions    Thu Nov 10 10:40:27 2016
@@ -293,7 +293,7 @@
  * if force_explode_nuclear is true "Explode Nuclear" must be impossible
  * "Attack" must be impossible
  * the actor unit must be on a tile next to the target.
- * the actor player can't be an animal barbarian.
+ * the actor player's nation can't be an animal barbarian. (!)
  * the actor unit must, if transported, be able to disembark from its
    transport.
  * the actor unit doesn't have the "CoastStrict" unit type flag or the

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=34474&r1=34473&r2=34474&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Thu Nov 10 10:40:27 2016
@@ -56,7 +56,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Nov.07"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Nov.10"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to