Author: sveinung
Date: Mon Jul 20 10:04:25 2015
New Revision: 29228

URL: http://svn.gna.org/viewcvs/freeciv?rev=29228&view=rev
Log:
Unhardcode the "ocean tiles can't be bombarded" rule

Requested by Jacob Nevins <jtn>

See bug #22713

Modified:
    trunk/client/helpdata.c
    trunk/common/actions.c
    trunk/data/alien/game.ruleset
    trunk/data/civ2civ3/game.ruleset
    trunk/doc/README.actions
    trunk/server/rscompat.c

Modified: trunk/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=29228&r1=29227&r2=29228&view=diff
==============================================================================
--- trunk/client/helpdata.c     (original)
+++ trunk/client/helpdata.c     Mon Jul 20 10:04:25 2015
@@ -4076,8 +4076,6 @@
                        utype_pop_value(utype));
           break;
         case ACTION_BOMBARD:
-            /* FIXME: also they only happen against land units. We leave the
-             * ruleset author to document this. */
             cat_snprintf(buf, bufsz,
                          _("* Can do the action \'%s\' (%d per turn)."
                            " These attacks will only damage (never kill)"

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=29228&r1=29227&r2=29228&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Mon Jul 20 10:04:25 2015
@@ -636,11 +636,6 @@
     }
 
     /* TODO: Move to the ruleset. */
-    if (is_ocean_tile(target_tile)) {
-      return FALSE;
-    }
-
-    /* TODO: Move to the ruleset. */
     if (!pplayers_at_war(unit_owner(target_unit), actor_player)) {
       return FALSE;
     }

Modified: trunk/data/alien/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/game.ruleset?rev=29228&r1=29227&r2=29228&view=diff
==============================================================================
--- trunk/data/alien/game.ruleset       (original)
+++ trunk/data/alien/game.ruleset       Mon Jul 20 10:04:25 2015
@@ -337,6 +337,10 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Bombarder", "Local", TRUE
+    }
+target_reqs    =
+    { "type",   "name", "range", "present"
+      "TerrainClass", "Oceanic", "Local", FALSE
     }
 
 [actionenabler_build_city]

Modified: trunk/data/civ2civ3/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/game.ruleset?rev=29228&r1=29227&r2=29228&view=diff
==============================================================================
--- trunk/data/civ2civ3/game.ruleset    (original)
+++ trunk/data/civ2civ3/game.ruleset    Mon Jul 20 10:04:25 2015
@@ -434,6 +434,10 @@
 actor_reqs    =
     { "type",   "name", "range", "present"
       "Unitflag", "Bombarder", "Local", TRUE
+    }
+target_reqs    =
+    { "type",   "name", "range", "present"
+      "TerrainClass", "Oceanic", "Local", FALSE
     }
 
 [actionenabler_build_city]

Modified: trunk/doc/README.actions
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.actions?rev=29228&r1=29227&r2=29228&view=diff
==============================================================================
--- trunk/doc/README.actions    (original)
+++ trunk/doc/README.actions    Mon Jul 20 10:04:25 2015
@@ -240,7 +240,6 @@
  * actor can't be transported.
  * actor must have at least 1 move fragment left.
  * target can't be in a city the actor player isn't at war with.
- * target can't be on an ocean tile.
  * target must be foreign.
  * target owner must be at war with actor.
 

Modified: trunk/server/rscompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/rscompat.c?rev=29228&r1=29227&r2=29228&view=diff
==============================================================================
--- trunk/server/rscompat.c     (original)
+++ trunk/server/rscompat.c     Mon Jul 20 10:04:25 2015
@@ -315,6 +315,11 @@
                               req_from_str("UnitFlag", "Local", FALSE,
                                            TRUE, "Bombarder"));
 
+    /* The target can't be on an ocean tile. */
+    requirement_vector_append(&enabler->target_reqs,
+                              req_from_str("TerrainClass", "Local", FALSE,
+                                           FALSE, "Oceanic"));
+
     action_enabler_add(enabler);
   }
 


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

Reply via email to