Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#6970) Wishlist: tririemes lost near arctic
Home

[Freeciv-Dev] Re: (PR#6970) Wishlist: tririemes lost near arctic

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6970) Wishlist: tririemes lost near arctic
From: "Jason Short" <jshort@xxxxxxxxxxxxxx>
Date: Tue, 6 Jan 2004 17:24:57 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6970 >

Marcelo Burda wrote:

>  If i begin implementing a TER_UNSAFE this is more work and we need 
> touch the generators too! More comment about your idea instead get a 
> blocked status make me more happy.

Here's an example of how your idea could be implemented via an 
UnsafeCoast flag.

It's questionable how much the flags should be tied together. 
UnsafeCoast and UnsafeLand may be associated with the same terrain, but 
should they be the same land?  Should they both be tied to the Polar flag?

I do think mapgen flags (like Polar/Arctic) should be kept separate from 
game-rules flags.  But this is a long-term goal.  In the short-term I 
just want more use of flags instead of hard-coding terrain types.

jason

Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.153
diff -u -r1.153 map.c
--- common/map.c        2003/12/08 19:19:56     1.153
+++ common/map.c        2004/01/07 01:21:25
@@ -422,7 +422,8 @@
   enum terrain_flag_id flag;
   const char *flag_names[] = {
     /* Must match terrain flags in terrain.h. */
-    "NoBarbs"
+    "NoBarbs",
+    "UnsafeCoast"
   };
 
   assert(ARRAY_SIZE(flag_names) == TER_COUNT);
@@ -485,7 +486,8 @@
 {
   adjc_iterate(x, y, x1, y1) {
     enum tile_terrain_type ter = map_get_terrain(x1, y1);
-    if (!is_ocean(ter) && ter != T_UNKNOWN) {
+    if (!(is_ocean(ter) || terrain_has_flag(ter, TER_UNSAFE_COAST))
+       && ter != T_UNKNOWN) {
       return TRUE;
     }
   } adjc_iterate_end;
Index: common/terrain.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/terrain.h,v
retrieving revision 1.7
diff -u -r1.7 terrain.h
--- common/terrain.h    2003/11/19 15:02:29     1.7
+++ common/terrain.h    2004/01/07 01:21:25
@@ -73,6 +73,7 @@
 
 enum terrain_flag_id {
   TER_NO_BARBS, /* No barbarians summoned on this terrain. */
+  TER_UNSAFE_COAST, /* Coast is not safe for tririemes. */
   TER_LAST
 };
 #define TER_FIRST (TER_NO_BARBS)
Index: data/default/terrain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/terrain.ruleset,v
retrieving revision 1.18
diff -u -r1.18 terrain.ruleset
--- data/default/terrain.ruleset        2003/10/02 17:54:57     1.18
+++ data/default/terrain.ruleset        2004/01/07 01:21:25
@@ -179,7 +179,7 @@
 mining_time          = 10
 transform_result     = "Tundra"
 transform_time       = 24
-flags                = "NoBarbs"
+flags                = "NoBarbs", "UnsafeCoast"
 helptext            = _("\
 Glaciers are found only in the most northerly or southerly\
  reaches of the world.  They are very cold, and hence difficult to\

[Prev in Thread] Current Thread [Next in Thread]