Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11311) death to smallpox?
Home

[Freeciv-Dev] (PR#11311) death to smallpox?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11311) death to smallpox?
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Dec 2004 18:35:59 -0800
Reply-to: rt@xxxxxxxxxxx

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

Seems like over the years everyone has made their own anti-smallpox 
patch.  Well, here's mine ;-).

This is quite experimental for now.  The ruleset needs to be balanced, 
the AI needs to be fixed, and most importantly the user interface needs 
to be updated.

The game design is based on ideas from MoM.

1.  No free city center, of course.  I didn't take Mike Jing's patch but 
just hard-coded this.  (Tile workers are still allowed, unlike in MoM, 
but without a free city center and with reduced tile inequities this is 
more of a micromanagement issue than a fairness issue.)  Unlike the 
Mike/James patch there is no free per-city food given.

2.  Some tiles give free added output to cities that cover them.  Wheat 
for instance has been changed to give a flat +2 food.  This free output 
is given to the city whether or not the tile is worked, and thus in part 
substitutes for the free city center.  The difference is that the free 
output is divided amongst all cities that cover the tile, so if 2 cities 
cover the wheat each of them gets +1.  Other examples: mountains/gold 
give +2 gold, hills/wine gives +2 luxury.  No terrain gives free shields 
or science (though I think one may give free trade).  This is all 
defined in the ruleset of course and needs heavy tweaking.  The effect 
of adding more free output is that smallpox is hurt, but it does not 
directly benefit large cities (so ICS is unharmed as a strategy).

3.  Tiles give bonus output to cities that cover them.  Hills for 
instance give +5% shield output.  This is an overall city bonus, so if 
you have 5 hills within range you get +25% shields in your city 
regardless of which tiles you are actually working.  Some of the rarer 
specials give larger bonuses: mountains/gold gives +30% gold, hills/iron 
gives +20% shields.  Again this is all defined in the ruleset.  Adding 
more bonus output hurts smallpox and benefits large cities more or less 
evenly - so I believe this will hurt ICS as a strategy as well.

4.  To follow #2 and #3 I attempted to balance the tiles.  Instead of 
having wheat at 3/1 I changed it to 2/1 base output with 2 free food. 
This is just a general balance since tiles shouldn't be too powerful; it 
also benefits large cities I think since different tile types are more 
balanced.

I think in conjunction #2,#3,#4 give a great bonus to large cities.  The 
main problem is complexity of the system.  It's no more complex than 
MoM, but it needs a good interface to show all the information to the user.

-jason

? diff
Index: ai/aisettler.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aisettler.c,v
retrieving revision 1.11
diff -u -r1.11 aisettler.c
--- ai/aisettler.c      22 Nov 2004 19:14:41 -0000      1.11
+++ ai/aisettler.c      3 Dec 2004 02:00:19 -0000
@@ -136,7 +136,7 @@
 
   city_map_checked_iterate(result->tile, i, j, ptile) {
     int reserved = citymap_read(ptile);
-    bool city_center = is_city_center(i, j);
+    bool city_center = my_is_city_center(i, j);
 
     if (reserved < 0
         || (handicap && !map_is_known(ptile, pplayer))
@@ -150,13 +150,13 @@
       /* We cannot read city center from cache */
 
       /* Food */
-      result->citymap[i][j].food = base_city_get_food_tile(i, j, pcity, FALSE);
+      result->citymap[i][j].food = base_city_get_food_tile(i, j, pcity, FALSE) 
+ 4 * get_tile_output_add(ptile, O_FOOD);
 
       /* Shields */
-      result->citymap[i][j].shield =base_city_get_shields_tile(i, j, pcity, 
FALSE);
+      result->citymap[i][j].shield =base_city_get_shields_tile(i, j, pcity, 
FALSE) + 4 * get_tile_output_add(ptile, O_SHIELD);
 
       /* Trade */
-      result->citymap[i][j].trade = base_city_get_trade_tile(i, j, pcity, 
FALSE);
+      result->citymap[i][j].trade = base_city_get_trade_tile(i, j, pcity, 
FALSE) + 4 * (get_tile_output_add(ptile, O_TRADE) + get_tile_output_add(ptile, 
O_GOLD) + get_tile_output_add(ptile, O_LUXURY) + get_tile_output_add(ptile, 
O_SCIENCE));
 
       sum = result->citymap[i][j].food * ai->food_priority
             + result->citymap[i][j].trade * ai->science_priority
@@ -164,7 +164,8 @@
 
       /* Balance perfection */
       sum *= PERFECTION / 2;
-      if (result->citymap[i][j].food >= 2) {
+      if (result->citymap[i][j].food >= 2
+         || get_tile_output_add(ptile, O_FOOD) > 0) {
         sum *= 2; /* we need this to grow */
       }
 
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.429
diff -u -r1.429 packhand.c
--- client/packhand.c   2 Dec 2004 10:14:53 -0000       1.429
+++ client/packhand.c   3 Dec 2004 02:00:21 -0000
@@ -514,6 +514,9 @@
       set_worker_city(pcity, x, y, packet->city_map[i]);
     }
   }
+  city_map_checked_iterate(pcity->tile, x, y, tile1) {
+    tile1->covered = packet->covered[x + y * CITY_MAP_SIZE];
+  } city_map_checked_iterate_end;
   
   impr_type_iterate(i) {
     if (pcity->improvements[i] == I_NONE && packet->improvements[i] == '1'
@@ -2513,6 +2516,14 @@
   t->output[O_FOOD] = p->food;
   t->output[O_SHIELD] = p->shield;
   t->output[O_TRADE] = p->trade;
+  output_type_iterate(o) {
+    t->bonus[o] = p->bonus[o];
+    t->add[o] = p->add[o];
+    t->special[0].bonus[o] = p->bonus_special_1[o];
+    t->special[0].add[o] = p->add_special_1[o];
+    t->special[1].bonus[o] = p->bonus_special_2[o];
+    t->special[1].add[o] = p->add_special_2[o];
+  } output_type_iterate_end;
   sz_strlcpy(t->special[0].name_orig, p->special_1_name);
   t->special[0].name = t->special[0].name_orig;
   memset(t->special[0].output, 0, O_COUNT * sizeof(*t->special[0].output));
Index: client/agents/cma_core.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/cma_core.c,v
retrieving revision 1.68
diff -u -r1.68 cma_core.c
--- client/agents/cma_core.c    29 Nov 2004 16:19:55 -0000      1.68
+++ client/agents/cma_core.c    3 Dec 2004 02:00:21 -0000
@@ -80,7 +80,7 @@
 
 #define my_city_map_iterate(pcity, cx, cy) {                           \
   city_map_checked_iterate(pcity->tile, cx, cy, _ptile) { \
-    if(!is_city_center(cx, cy)) {
+    if(!is_free_worked_tile(cx, cy)) {
 
 #define my_city_map_iterate_end \
     }                                \
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.265
diff -u -r1.265 city.c
--- common/city.c       2 Dec 2004 10:20:30 -0000       1.265
+++ common/city.c       3 Dec 2004 02:00:21 -0000
@@ -104,7 +104,6 @@
 {
   int x, y;
 
-  assert(is_valid_city_coords(city_map_x, city_map_y));
   x = city_tile->x + city_map_x - CITY_MAP_SIZE / 2;
   y = city_tile->y + city_map_y - CITY_MAP_SIZE / 2;
 
@@ -622,7 +621,7 @@
     s -= (s * terrain_control.fallout_shield_penalty) / 100;
   }
 
-  if (pcity && is_city_center(city_x, city_y)) {
+  if (pcity && my_is_city_center(city_x, city_y)) {
     s = MAX(s, game.rgame.min_city_center_output[O_SHIELD]);
   }
 
@@ -726,7 +725,7 @@
     t -= (t * terrain_control.fallout_trade_penalty) / 100;
   }
 
-  if (pcity && is_city_center(city_x, city_y)) {
+  if (pcity && my_is_city_center(city_x, city_y)) {
     t = MAX(t, game.rgame.min_city_center_output[O_TRADE]);
   }
 
@@ -785,7 +784,7 @@
   struct tile_type *type = get_tile_type(tile_t);
   struct tile tile;
   int f = get_tile_output_base(ptile, O_FOOD);
-  const bool auto_water = (pcity && is_city_center(city_x, city_y)
+  const bool auto_water = (pcity && my_is_city_center(city_x, city_y)
                           && tile_t == type->irrigation_result
                           && terrain_control.may_irrigate);
 
@@ -838,7 +837,7 @@
     f -= (f * terrain_control.fallout_food_penalty) / 100;
   }
 
-  if (pcity && is_city_center(city_x, city_y)) {
+  if (pcity && my_is_city_center(city_x, city_y)) {
     f = MAX(f, game.rgame.min_city_center_output[O_FOOD]);
   }
 
@@ -1598,12 +1597,34 @@
   return content;
 }
 
+static int get_city_terrain_bonus(const struct city *pcity,
+                                 Output_type_id output)
+{
+  const int factor = 420; /* To save rounding until the end: lcm(2..7) */
+  int bonus = 0;
+
+  if (terrain_control.terrain_bonuses[output]) {
+    map_city_radius_iterate(pcity->tile, ptile) {
+      bonus
+       += get_tile_output_bonus(ptile, output) * factor / ptile->covered;
+    } map_city_radius_iterate_end;
+
+    bonus /= factor;
+  }
+
+  return bonus;
+}
+
 /**************************************************************************
  Return the factor (in %) by which the shield should be multiplied.
 **************************************************************************/
 int get_city_shield_bonus(const struct city *pcity)
 {
-  return (100 + get_city_bonus(pcity, EFT_PROD_BONUS));
+  int bonus = 100 + get_city_bonus(pcity, EFT_PROD_BONUS);
+
+  bonus += get_city_terrain_bonus(pcity, O_SHIELD);
+
+  return bonus;
 }
 
 /**************************************************************************
@@ -1611,7 +1632,11 @@
 **************************************************************************/
 int get_city_tax_bonus(const struct city *pcity)
 {
-  return (100 + get_city_bonus(pcity, EFT_TAX_BONUS));
+  int bonus = 100 + get_city_bonus(pcity, EFT_TAX_BONUS);
+
+  bonus += get_city_terrain_bonus(pcity, O_GOLD);
+
+  return bonus;
 }
 
 /**************************************************************************
@@ -1619,7 +1644,11 @@
 **************************************************************************/
 int get_city_luxury_bonus(const struct city *pcity)
 {
-  return (100 + get_city_bonus(pcity, EFT_LUXURY_BONUS));
+  int bonus = 100 + get_city_bonus(pcity, EFT_LUXURY_BONUS);
+
+  bonus += get_city_terrain_bonus(pcity, O_LUXURY);
+
+  return bonus;
 }
 
 /**************************************************************************
@@ -1646,15 +1675,15 @@
 **************************************************************************/
 int get_city_science_bonus(const struct city *pcity)
 {
-  int science_bonus;
+  int bonus = 100 + get_city_bonus(pcity, EFT_SCIENCE_BONUS);
 
-  science_bonus = 100 + get_city_bonus(pcity, EFT_SCIENCE_BONUS);
+  bonus += get_city_terrain_bonus(pcity, O_SCIENCE);
 
   if (government_has_flag(get_gov_pcity(pcity), G_REDUCED_RESEARCH)) {
-    science_bonus /= 2;
+    bonus /= 2;
   }
 
-  return science_bonus;
+  return bonus;
 }
 
 /**************************************************************************
@@ -1707,9 +1736,17 @@
 **************************************************************************/
 static inline void set_tax_income(struct city *pcity)
 {
+  int free[O_COUNT];
+
+  get_free_output(pcity, free);
+
   get_tax_income(city_owner(pcity), pcity->surplus[O_TRADE], 
&pcity->science_total, 
                  &pcity->luxury_total, &pcity->tax_total);
 
+  pcity->science_total += free[O_SCIENCE];
+  pcity->luxury_total += free[O_LUXURY];
+  pcity->tax_total += free[O_GOLD];
+
   specialist_type_iterate(sp) {
     int *bonus = game.rgame.specialists[sp].bonus;
     int count = pcity->specialists[sp];
@@ -1987,18 +2024,35 @@
   return pollution;
 }
 
+void get_free_output(const struct city *pcity, int *output)
+{
+  const int factor = 420; /* lcm(2..7) */
+
+  memset(output, 0, O_COUNT * sizeof(*output));
+  map_city_radius_iterate(pcity->tile, ptile) {
+    output_type_iterate(o) {
+      output[o] += factor * get_tile_output_add(ptile, o) / ptile->covered;
+    } output_type_iterate_end;
+  } map_city_radius_iterate_end;
+  output_type_iterate(o) {
+    output[o] /= factor;
+  } output_type_iterate_end;
+}
+
 /**************************************************************************
   Calculate food, trade and shields generated by a city, and set
-  associated variables given to us.
+  associated variables given to us.  This includes the "free" output.
 **************************************************************************/
 void get_food_trade_shields(const struct city *pcity, int *food, int *trade,
                             int *shields)
 {
   bool is_celebrating = base_city_celebrating(pcity);
+  int free[O_COUNT];
 
-  *food = 0;
-  *trade = 0;
-  *shields = 0;
+  get_free_output(pcity, free);
+  *food = free[O_FOOD];
+  *trade = free[O_TRADE];
+  *shields = free[O_SHIELD];
   
   city_map_iterate(x, y) {
     if (get_worker_city(pcity, x, y) == C_TILE_WORKER) {
Index: common/city.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.h,v
retrieving revision 1.173
diff -u -r1.173 city.h
--- common/city.h       2 Dec 2004 10:20:30 -0000       1.173
+++ common/city.h       3 Dec 2004 02:00:21 -0000
@@ -522,6 +522,7 @@
 void city_styles_alloc(int num);
 void city_styles_free(void);
 
+void get_free_output(const struct city *pcity, int *output);
 void get_food_trade_shields(const struct city *pcity, int *food, int *trade,
                             int *shields);
 void get_tax_income(struct player *pplayer, int trade, int *sci,
@@ -557,7 +558,12 @@
   Return TRUE iff the given city coordinate pair is the center tile of
   the citymap.
 **************************************************************************/
-static inline bool is_city_center(int city_x, int city_y)
+static inline bool is_free_worked_tile(int city_x, int city_y)
+{
+  return FALSE; /* TODO: ruleset-controlled */
+}
+
+static inline bool my_is_city_center(int city_x, int city_y)
 {
   return CITY_MAP_RADIUS == city_x && CITY_MAP_RADIUS == city_y;
 }
Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.208
diff -u -r1.208 map.c
--- common/map.c        30 Nov 2004 05:39:12 -0000      1.208
+++ common/map.c        3 Dec 2004 02:00:22 -0000
@@ -358,6 +358,7 @@
   ptile->known    = 0;
   ptile->continent = 0;
   ptile->city     = NULL;
+  ptile->covered = 0;
   unit_list_init(&ptile->units);
   ptile->worked   = NULL; /* pointer to city working tile */
   ptile->assigned = 0; /* bitvector */
@@ -738,6 +739,26 @@
     return tile_types[ptile->terrain].output[output];
 }
 
+int get_tile_output_bonus(const struct tile *ptile, Output_type_id output)
+{
+  if (tile_has_special(ptile, S_SPECIAL_1)) 
+    return tile_types[ptile->terrain].special[0].bonus[output];
+  else if (tile_has_special(ptile, S_SPECIAL_2))
+    return tile_types[ptile->terrain].special[1].bonus[output];
+  else
+    return tile_types[ptile->terrain].bonus[output];
+}
+
+int get_tile_output_add(const struct tile *ptile, Output_type_id output)
+{
+  if (tile_has_special(ptile, S_SPECIAL_1)) 
+    return tile_types[ptile->terrain].special[0].add[output];
+  else if (tile_has_special(ptile, S_SPECIAL_2))
+    return tile_types[ptile->terrain].special[1].add[output];
+  else
+    return tile_types[ptile->terrain].add[output];
+}
+
 /***************************************************************
   Return a (static) string with special(s) name(s);
   eg: "Mine"
Index: common/map.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.h,v
retrieving revision 1.229
diff -u -r1.229 map.h
--- common/map.h        30 Nov 2004 05:39:12 -0000      1.229
+++ common/map.h        3 Dec 2004 02:00:22 -0000
@@ -49,6 +49,7 @@
                           Player_no is index */
   int assigned; /* these can save a lot of CPU usage -- Syela */
   struct city *worked;      /* city working tile, or NULL if none */
+  int covered; /* Number of cities whose citymaps cover the tile. */
   Continent_id continent;
   signed char move_cost[8]; /* don't know if this helps! */
   struct player *owner;     /* Player owning this tile, or NULL. */
@@ -79,12 +80,16 @@
   int defense_bonus;
 
   int output[O_MAX];
+  int bonus[O_MAX];
+  int add[O_MAX];
 
 #define MAX_NUM_SPECIALS 2
   struct {
     const char *name; /* Translated string - doesn't need freeing. */
     char name_orig[MAX_LEN_NAME];
     int output[O_MAX];
+    int bonus[O_MAX];
+    int add[O_MAX];
     char graphic_str[MAX_LEN_NAME];
     char graphic_alt[MAX_LEN_NAME];
   } special[MAX_NUM_SPECIALS];
@@ -387,6 +392,8 @@
 bool is_cardinally_adj_to_ocean(const struct tile *ptile);
 bool is_sea_usable(const struct tile *ptile);
 int get_tile_output_base(const struct tile *ptile, Output_type_id output);
+int get_tile_output_bonus(const struct tile *ptile, Output_type_id output);
+int get_tile_output_add(const struct tile *ptile, Output_type_id output);
 enum tile_special_type get_tile_infrastructure_set(const struct tile *ptile);
 const char *map_get_infrastructure_text(enum tile_special_type spe);
 enum tile_special_type map_get_infrastructure_prerequisite(enum 
tile_special_type spe);
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.61
diff -u -r1.61 packets.def
--- common/packets.def  30 Nov 2004 06:54:06 -0000      1.61
+++ common/packets.def  3 Dec 2004 02:00:22 -0000
@@ -423,6 +423,7 @@
 
   BIT_STRING improvements[B_LAST+1];
   CITY_MAP city_map[CITY_MAP_SIZE * CITY_MAP_SIZE];
+  UINT8 covered[CITY_MAP_SIZE * CITY_MAP_SIZE];
 
   BOOL did_buy, did_sell, was_happy, airlift, diplomat_investigate;
 
@@ -1087,6 +1088,7 @@
   BOOL may_irrigate;   /* may build irrigation/farmland */
   BOOL may_mine;       /* may build mines */
   BOOL may_transform;  /* may transform terrain */
+  BOOL terrain_bonuses[O_MAX];
 
   /* parameters */
   UINT8 ocean_reclaim_requirement_pct; /* # adjacent land tiles for reclaim */
@@ -1179,11 +1181,15 @@
   UINT8 food;
   UINT8 shield;
   UINT8 trade;
+  SINT8 bonus[O_MAX];
+  SINT8 add[O_MAX];
 
   STRING special_1_name[MAX_LEN_NAME];
   UINT8 food_special_1;
   UINT8 shield_special_1;
   UINT8 trade_special_1;
+  SINT8 bonus_special_1[O_MAX];
+  SINT8 add_special_1[O_MAX];
   STRING graphic_str_special_1[MAX_LEN_NAME];
   STRING graphic_alt_special_1[MAX_LEN_NAME];
 
@@ -1191,6 +1197,8 @@
   UINT8 food_special_2;
   UINT8 shield_special_2;
   UINT8 trade_special_2;
+  SINT8 bonus_special_2[O_MAX];
+  SINT8 add_special_2[O_MAX];
   STRING graphic_str_special_2[MAX_LEN_NAME];
   STRING graphic_alt_special_2[MAX_LEN_NAME];
 
Index: common/aicore/cm.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/cm.c,v
retrieving revision 1.50
diff -u -r1.50 cm.c
--- common/aicore/cm.c  2 Dec 2004 10:20:30 -0000       1.50
+++ common/aicore/cm.c  3 Dec 2004 02:00:23 -0000
@@ -632,7 +632,7 @@
    * the city center). */
   memset(&pcity->specialists, 0, sizeof(pcity->specialists));
   city_map_iterate(x, y) {
-    if (is_city_center(x, y)) {
+    if (is_free_worked_tile(x, y)) {
       continue;
     }
     if (pcity->city_map[x][y] == C_TILE_WORKER) {
@@ -1117,7 +1117,7 @@
     if (pcity->city_map[x][y] == C_TILE_UNAVAILABLE) {
       continue;
     }
-    if (!is_city_center(x, y)) {
+    if (!is_free_worked_tile(x, y)) {
       compute_tile_production(pcity, x, y, &type); /* clobbers type */
       tile_type_lattice_add(lattice, &type, x, y); /* copy type if needed */
     }
@@ -1883,7 +1883,7 @@
   int count = 0;
 
   city_map_iterate(x, y) {
-    if(result->worker_positions_used[x][y] && !is_city_center(x, y)) {
+    if(result->worker_positions_used[x][y] && !is_free_worked_tile(x, y)) {
       count++;
     }
   } city_map_iterate_end;
@@ -2106,7 +2106,7 @@
     for (x = 0; x < CITY_MAP_SIZE; x++) {
       if (!is_valid_city_coords(x, y)) {
         line[x] = '-';
-      } else if (is_city_center(x, y)) {
+      } else if (is_free_worked_tile(x, y)) {
         line[x] = 'c';
       } else if (result->worker_positions_used[x][y]) {
         line[x] = 'w';
Index: data/default/terrain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/terrain.ruleset,v
retrieving revision 1.36
diff -u -r1.36 terrain.ruleset
--- data/default/terrain.ruleset        30 Nov 2004 05:46:34 -0000      1.36
+++ data/default/terrain.ruleset        3 Dec 2004 02:00:23 -0000
@@ -195,12 +195,15 @@
 graphic_special_1a   = "-"
 food_special_1       = 1
 shield_special_1     = 1
-trade_special_1      = 4
+trade_special_1      = 2
+gold_special_1_bonus = 5
+luxury_special_1_bonus = 5
 special_2_name       = _("Oil")
 graphic_special_2    = "ts.arctic_oil"
 graphic_special_2a   = "ts.oil"
 food_special_2       = 0
-shield_special_2     = 4
+shield_special_2     = 2
+shield_special_2_bonus = 10
 trade_special_2      = 0
 road_trade_incr      = 0
 road_time            = 4
@@ -238,17 +241,22 @@
 food                 = 0
 shield               = 1
 trade                = 0
+shield_bonus         = 1
+gold_bonus           = 1
 special_1_name       = _("Oasis")
 graphic_special_1    = "ts.oasis"
 graphic_special_1a   = "-"
-food_special_1       = 3
+food_special_1       = 2
 shield_special_1     = 1
 trade_special_1      = 0
+food_special_1_add   = 1
+luxury_special_1_bonus = 5
 special_2_name       = _("Oil")
 graphic_special_2    = "ts.oil"
 graphic_special_2a   = "-"
 food_special_2       = 0
-shield_special_2     = 4
+shield_special_2     = 3
+shield_special_2_bonus = 5
 trade_special_2      = 0
 road_trade_incr      = 1
 road_time            = 2
@@ -285,18 +293,25 @@
 food                 = 1
 shield               = 2
 trade                = 0
+shield_bonus         = 3
 special_1_name       = _("Pheasant")
 graphic_special_1    = "ts.pheasant"
 graphic_special_1a   = "-"
-food_special_1       = 3
-shield_special_1     = 2
+food_special_1       = 2
+shield_special_1     = 1
+shield_special_1_bonus = 10
+food_special_1_add   = 1
 trade_special_1      = 0
 special_2_name       = _("Silk")
 graphic_special_2    = "ts.silk"
 graphic_special_2a   = "-"
 food_special_2       = 1
 shield_special_2     = 2
-trade_special_2      = 3
+trade_special_2      = 1
+luxury_special_1_bonus = 7
+gold_special_1_bonus = 7
+science_special_1_bonus = 7
+trade_special_2_add  = 1
 road_trade_incr      = 0
 road_time            = 4
 irrigation_result    = "Plains"
@@ -378,18 +393,22 @@
 food                 = 1
 shield               = 0
 trade                = 0
+shield_bonus         = 5
 special_1_name       = _("Coal")
 graphic_special_1    = "ts.coal"
 graphic_special_1a   = "-"
 food_special_1       = 1
-shield_special_1     = 2
+shield_special_1     = 1
+shield_special_1_bonus = 15
 trade_special_1      = 0
 special_2_name       = _("Wine")
 graphic_special_2    = "ts.wine"
 graphic_special_2a   = "-"
 food_special_2       = 1
 shield_special_2     = 0
-trade_special_2      = 4
+trade_special_2      = 1
+luxury_special_1_bonus = 20
+luxury_special_1_add = 2
 road_trade_incr      = 0
 road_time            = 4
 irrigation_result    = "yes"
@@ -430,13 +449,17 @@
 graphic_special_1a   = "-"
 food_special_1       = 1
 shield_special_1     = 0
-trade_special_1      = 4
+trade_special_1      = 1
+gold_special_1_add   = 2
+gold_special_1_bonus = 10
+luxury_special_1_bonus = 12
 special_2_name       = _("Fruit")
 graphic_special_2    = "ts.fruit"
 graphic_special_2a   = "-"
-food_special_2       = 4
+food_special_2       = 3
 shield_special_2     = 0
 trade_special_2      = 1
+food_special_2_add   = 1
 road_trade_incr      = 0
 road_time            = 4
 irrigation_result    = "Grassland"
@@ -472,17 +495,22 @@
 food                 = 0
 shield               = 1
 trade                = 0
+shield_bonus         = 7
 special_1_name       = _("Gold")
 graphic_special_1    = "ts.gold"
 graphic_special_1a   = "-"
 food_special_1       = 0
 shield_special_1     = 1
-trade_special_1      = 6
+trade_special_1      = 2
+gold_special_1_add   = 2
+gold_special_1_bonus = 30
+luxury_special_1_bonus = 20
 special_2_name       = _("Iron")
 graphic_special_2    = "ts.iron"
 graphic_special_2a   = "-"
 food_special_2       = 0
-shield_special_2     = 4
+shield_special_2     = 2
+shield_special_2_bonus = 20
 trade_special_2      = 0
 road_trade_incr      = 0
 road_time            = 6
@@ -519,18 +547,23 @@
 food                 = 1
 shield               = 0
 trade                = 2
+gold_bonus           = 1
+science_bonus        = 1
+luxury_bonus         = 1
 special_1_name       = _("Fish")
 graphic_special_1    = "ts.fish"
 graphic_special_1a   = "-"
 food_special_1       = 3
 shield_special_1     = 0
 trade_special_1      = 2
+food_special_1_add   = 1
 special_2_name       = _("Whales")
 graphic_special_2    = "ts.whales"
 graphic_special_2a   = "-"
 food_special_2       = 2
 shield_special_2     = 1
 trade_special_2      = 2
+shield_special_2_bonus = 10
 road_trade_incr      = 0
 road_time            = 0
 irrigation_result    = "no"
@@ -572,14 +605,16 @@
 graphic_special_1    = "ts.buffalo"
 graphic_special_1a   = "-"
 food_special_1       = 1
-shield_special_1     = 3
+shield_special_1     = 2
 trade_special_1      = 0
+shield_special_1_bonus = 10
 special_2_name       = _("Wheat")
 graphic_special_2    = "ts.wheat"
 graphic_special_2a   = "-"
-food_special_2       = 3
+food_special_2       = 2
 shield_special_2     = 1
 trade_special_2      = 0
+food_special_2_add   = 2
 road_trade_incr      = 1
 road_time            = 2
 irrigation_result    = "yes"
@@ -619,14 +654,19 @@
 graphic_special_1    = "ts.peat"
 graphic_special_1a   = "-"
 food_special_1       = 1
-shield_special_1     = 4
+shield_special_1     = 2
 trade_special_1      = 0
+shield_special_1_bonus = 15
 special_2_name       = _("Spice")
 graphic_special_2    = "ts.spice"
 graphic_special_2a   = "-"
 food_special_2       = 3
 shield_special_2     = 0
-trade_special_2      = 4
+trade_special_2      = 2
+food_special_2_add   = 1
+gold_special_2_bonus = 10
+science_special_2_bonus = 10
+luxury_special_2_bonus = 10
 road_trade_incr      = 0
 road_time            = 4
 irrigation_result    = "Grassland"
@@ -667,13 +707,15 @@
 graphic_special_1a   = "-"
 food_special_1       = 3
 shield_special_1     = 1
+food_special_1_add   = 1
 trade_special_1      = 0
 special_2_name       = _("Furs")
 graphic_special_2    = "ts.furs"
 graphic_special_2a   = "-"
 food_special_2       = 2
 shield_special_2     = 0
-trade_special_2      = 3
+trade_special_2      = 2
+trade_special_2_add  = 1
 road_trade_incr      = 0
 road_time            = 2
 irrigation_result    = "yes"
Index: data/default/units.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/units.ruleset,v
retrieving revision 1.64
diff -u -r1.64 units.ruleset
--- data/default/units.ruleset  29 Nov 2004 22:22:25 -0000      1.64
+++ data/default/units.ruleset  3 Dec 2004 02:00:24 -0000
@@ -257,9 +257,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 0
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Settlers", "NonMil", "Airbase", "NoVeteran"
 roles         = "Settlers"
 helptext      = _("\
@@ -298,9 +298,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 0
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Settlers", "NonMil", "Transform", "Airbase", "NoVeteran"
 roles         = "Settlers"
 helptext      = _("\
@@ -339,9 +339,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "DefendOk", "FirstBuild"
 helptext      = _("\
@@ -371,9 +371,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "DefendGood", "FirstBuild"
 
@@ -399,9 +399,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "DefendOk"
 
@@ -427,9 +427,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "DefendOk", "Hut", "BarbarianBuild", "BarbarianSea"
 
@@ -455,9 +455,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Pikemen"
 roles         = "DefendGood", "FirstBuild"
 
@@ -483,9 +483,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "DefendGood", "FirstBuild", "HutTech",
                 "BarbarianTech", "BarbarianBuildTech", "BarbarianSeaTech"
@@ -512,9 +512,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "IgTer", "IgZOC"
 roles         = "DefendGood", "Partisan", "BarbarianTech"
 helptext      = _("\
@@ -552,9 +552,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "IgTer"
 roles         = "DefendGood"
 
@@ -580,9 +580,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "DefendGood", "FirstBuild"
 
@@ -608,9 +608,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Marines"
 roles         = "DefendOk", "BarbarianSeaTech"
 
@@ -636,9 +636,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Paratroopers"
 roles         = "DefendOk"
 
@@ -668,9 +668,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = ""
 roles         = "DefendGood"
 helptext      = _("\
@@ -701,9 +701,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Horse"
 roles         = "AttackFast", "Hut", "Barbarian"
 
@@ -729,9 +729,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Horse"
 roles         = "AttackFast", "Hut"
 
@@ -757,9 +757,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Horse"
 roles         = "AttackFast", "HutTech", "BarbarianTech",
                 "BarbarianBuildTech", "BarbarianSeaTech"
@@ -786,9 +786,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Horse"
 roles         = "AttackFast", "BarbarianBuildTech", "BarbarianSeaTech"
 
@@ -814,9 +814,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "AttackFast"
 
@@ -842,9 +842,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = ""
 roles         = "AttackFast"
 
@@ -870,9 +870,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "AttackStrong"
 
@@ -898,9 +898,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "AttackStrong", "BarbarianTech", "BarbarianBuildTech"
 
@@ -926,9 +926,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "AttackStrong"
 
@@ -954,9 +954,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "IgWall"
 roles         = "AttackStrong"
 
@@ -982,9 +982,9 @@
 transport_cap = 0
 fuel          = 1
 uk_happy      = 0
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "Fighter"
 roles         = ""
 
@@ -1010,9 +1010,9 @@
 transport_cap = 0
 fuel          = 2
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "FieldUnit", "OneAttack"
 roles         = ""
 
@@ -1038,9 +1038,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "FieldUnit", "OneAttack"
 roles         = ""
 helptext      = _("\
@@ -1072,9 +1072,9 @@
 transport_cap = 0
 fuel          = 1
 uk_happy      = 0
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "Partial_Invis", "Fighter"
 roles         = ""
 helptext      = _("\
@@ -1104,9 +1104,9 @@
 transport_cap = 0
 fuel          = 2
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "Partial_Invis", "FieldUnit", "OneAttack"
 roles         = ""
 helptext      = _("\
@@ -1136,9 +1136,9 @@
 transport_cap = 2
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "Trireme"
 roles         = "Ferryboat"
 
@@ -1164,9 +1164,9 @@
 transport_cap = 3
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "Ferryboat", "BarbarianBoat"
 
@@ -1192,9 +1192,9 @@
 transport_cap = 4
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "Ferryboat", "BarbarianBoat"
 
@@ -1220,9 +1220,9 @@
 transport_cap = 2
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = ""
 roles         = ""
 
@@ -1248,9 +1248,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = ""
 roles         = ""
 
@@ -1276,9 +1276,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = ""
 roles         = ""
 helptext      = _("\
@@ -1308,9 +1308,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = ""
 roles         = "DefendGood"
 
@@ -1336,9 +1336,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "AEGIS"
 roles         = "DefendGood"
 
@@ -1364,9 +1364,9 @@
 transport_cap = 0
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 3
 flags         = ""
 roles         = ""
 
@@ -1392,9 +1392,9 @@
 transport_cap = 8
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "Partial_Invis", 
                "Missile_Carrier", "No_Land_Attack"
 roles         = ""
@@ -1425,9 +1425,9 @@
 transport_cap = 8
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 4
 flags         = "Carrier"
 roles         = ""
 helptext      = _("\
@@ -1458,9 +1458,9 @@
 transport_cap = 8
 fuel          = 0
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = "Ferryboat"
 
@@ -1486,9 +1486,9 @@
 transport_cap = 0
 fuel          = 1
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = "FieldUnit", "OneAttack", "Missile"
 roles         = ""
 helptext      = _("\
@@ -1518,9 +1518,9 @@
 transport_cap = 0
 fuel          = 1
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 2
 flags         = "FieldUnit", "OneAttack", "Missile", "Nuclear"
 roles         = ""
 helptext      = _("\
@@ -1789,9 +1789,9 @@
 transport_cap = 0
 fuel          = 2
 uk_happy      = 1
-uk_shield     = 1
+uk_shield     = 0
 uk_food       = 0
-uk_gold       = 0
+uk_gold       = 1
 flags         = ""
 roles         = ""
 helptext      = _("\
Index: server/cityhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityhand.c,v
retrieving revision 1.137
diff -u -r1.137 cityhand.c
--- server/cityhand.c   29 Sep 2004 02:24:23 -0000      1.137
+++ server/cityhand.c   3 Dec 2004 02:00:25 -0000
@@ -99,7 +99,7 @@
   if (!pcity) {
     return;
   }
-  if (is_city_center(worker_x, worker_y)) {
+  if (is_free_worked_tile(worker_x, worker_y)) {
     auto_arrange_workers(pcity);
     sync_cities();
     return;
@@ -135,7 +135,7 @@
     return;
   }
 
-  if (is_city_center(worker_x, worker_y)) {
+  if (is_free_worked_tile(worker_x, worker_y)) {
     auto_arrange_workers(pcity);
     sync_cities();
     return;
Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.283
diff -u -r1.283 citytools.c
--- server/citytools.c  2 Dec 2004 10:20:30 -0000       1.283
+++ server/citytools.c  3 Dec 2004 02:00:25 -0000
@@ -991,6 +991,12 @@
 
   city_list_insert(&pplayer->cities, pcity);
 
+  /* Increment all tiles that the citymap covers.  Note that this ignores
+   * borders. */
+  map_city_radius_iterate(pcity->tile, ptile) {
+    ptile->covered++;
+  } map_city_radius_iterate_end;
+
   /* it is possible to build a city on a tile that is already worked
    * this will displace the worker on the newly-built city's tile -- Syela */
   for (y_itr = 0; y_itr < CITY_MAP_SIZE; y_itr++) {
@@ -1007,7 +1013,11 @@
    * status and so must be done after the above. */
   map_update_borders_city_change(pcity);
 
-  server_set_tile_city(pcity, CITY_MAP_SIZE/2, CITY_MAP_SIZE/2, C_TILE_WORKER);
+  city_map_checked_iterate(pcity->tile, x, y, ptile) {
+    if (is_free_worked_tile(x, y)) {
+      server_set_tile_city(pcity, x, y, C_TILE_WORKER);
+    }
+  } city_map_checked_iterate_end;
   auto_arrange_workers(pcity);
 
   city_refresh(pcity);
@@ -1171,6 +1181,8 @@
 
   /* Update available tiles in adjacent cities. */
   map_city_radius_iterate(ptile, tile1) {
+    assert(tile1->covered > 0);
+    tile1->covered--;
     /* For every tile the city could have used. */
     map_city_radius_iterate(tile1, tile2) {
       /* We see what cities are inside reach of the tile. */
@@ -1624,7 +1636,15 @@
   packet->was_happy = pcity->was_happy;
   for (y = 0; y < CITY_MAP_SIZE; y++) {
     for (x = 0; x < CITY_MAP_SIZE; x++) {
-      packet->city_map[x + y * CITY_MAP_SIZE] = get_worker_city(pcity, x, y);
+      int index = x + y * CITY_MAP_SIZE;
+      struct tile *ptile = city_map_to_map(pcity, x, y);
+
+      packet->city_map[index] = get_worker_city(pcity, x, y);
+      if (ptile) {
+       packet->covered[index] = ptile->covered;
+      } else {
+       packet->covered[index] = 0;
+      }
     }
   }
 
@@ -1904,7 +1924,7 @@
   }
   
   if (is_enemy_unit_tile(ptile, city_owner(pcity))
-      && !is_city_center(city_x, city_y)) {
+      && !my_is_city_center(city_x, city_y)) {
     return FALSE;
   }
 
Index: server/cityturn.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v
retrieving revision 1.276
diff -u -r1.276 cityturn.c
--- server/cityturn.c   30 Nov 2004 08:37:03 -0000      1.276
+++ server/cityturn.c   3 Dec 2004 02:00:26 -0000
@@ -158,12 +158,12 @@
   /* Now apply results */
   city_map_checked_iterate(pcity->tile, x, y, ptile) {
     if (pcity->city_map[x][y] == C_TILE_WORKER
-        && !is_city_center(x, y)
+        && !is_free_worked_tile(x, y)
         && !cmr->worker_positions_used[x][y]) {
       server_remove_worker_city(pcity, x, y);
     }
     if (pcity->city_map[x][y] != C_TILE_WORKER
-        && !is_city_center(x, y)
+        && !is_free_worked_tile(x, y)
         && cmr->worker_positions_used[x][y]) {
       server_set_worker_city(pcity, x, y);
     }
@@ -422,7 +422,7 @@
     /* Take it out on workers */
     city_map_iterate(x, y) {
       if (get_worker_city(pcity, x, y) == C_TILE_WORKER
-          && !is_city_center(x, y) && pop_loss > 0) {
+          && !is_free_worked_tile(x, y) && pop_loss > 0) {
         server_remove_worker_city(pcity, x, y);
         pop_loss--;
       }
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.206
diff -u -r1.206 ruleset.c
--- server/ruleset.c    2 Dec 2004 10:14:54 -0000       1.206
+++ server/ruleset.c    3 Dec 2004 02:00:26 -0000
@@ -1588,6 +1588,9 @@
 
   /* terrain details */
 
+  output_type_iterate(o) {
+    terrain_control.terrain_bonuses[o] = FALSE;
+  } output_type_iterate_end;
   terrain_type_iterate(i) {
       struct tile_type *t = &(tile_types[i]);
       char **slist;
@@ -1620,6 +1623,12 @@
       output_type_iterate(o) {
        t->output[o] = secfile_lookup_int_default(file, 0, "%s.%s", sec[i],
                                                  get_output_identifier(o));
+       t->add[o] = secfile_lookup_int_default(file, 0, "%s.%s_add", sec[i],
+                                              get_output_identifier(o));
+       t->bonus[o] = secfile_lookup_int_default(file, 0, "%s.%s_bonus",
+                                                sec[i],
+                                                get_output_identifier(o));
+       terrain_control.terrain_bonuses[o] |= (t->bonus[o] > 0);
       } output_type_iterate_end;
 
       for (j = 0; j < MAX_NUM_SPECIALS; j++) {
@@ -1635,6 +1644,15 @@
          t->special[j].output[o]
            = secfile_lookup_int_default(file, 0, "%s.%s_special_%d", sec[i],
                                         get_output_identifier(o), j + 1);
+         t->special[j].add[o]
+           = secfile_lookup_int_default(file, 0, "%s.%s_special_%d_add",
+                                        sec[i],
+                                        get_output_identifier(o), j + 1);
+         t->special[j].bonus[o]
+           = secfile_lookup_int_default(file, 0, "%s.%s_special_%d_bonus",
+                                        sec[i],
+                                        get_output_identifier(o), j + 1);
+         terrain_control.terrain_bonuses[o] |= (t->special[j].bonus[o] > 0);
        } output_type_iterate_end;
 
        sz_strlcpy(t->special[j].graphic_str,
@@ -2945,6 +2963,15 @@
       packet.shield = t->output[O_SHIELD];
       packet.trade = t->output[O_TRADE];
 
+      output_type_iterate(o) {
+       packet.bonus[o] = t->bonus[o];
+       packet.add[o] = t->add[o];
+       packet.bonus_special_1[o] = t->special[0].bonus[o];
+       packet.add_special_1[o] = t->special[0].add[o];
+       packet.bonus_special_2[o] = t->special[1].bonus[o];
+       packet.add_special_2[o] = t->special[1].add[o];
+      } output_type_iterate_end;
+
       sz_strlcpy(packet.special_1_name, t->special[0].name_orig);
       packet.food_special_1 = t->special[0].output[O_FOOD];
       packet.shield_special_1 = t->special[0].output[O_SHIELD];
Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.55
diff -u -r1.55 sanitycheck.c
--- server/sanitycheck.c        22 Nov 2004 07:12:39 -0000      1.55
+++ server/sanitycheck.c        3 Dec 2004 02:00:26 -0000
@@ -253,11 +253,12 @@
 
   /* Sanity check city size versus worker and specialist counts. */
   city_map_iterate(x, y) {
-    if (get_worker_city(pcity, x, y) == C_TILE_WORKER) {
+    if (get_worker_city(pcity, x, y) == C_TILE_WORKER
+       && !is_free_worked_tile(x, y)) {
       workers++;
     }
   } city_map_iterate_end;
-  if (workers + city_specialists(pcity) != pcity->size + 1) {
+  if (workers + city_specialists(pcity) != pcity->size) {
     die("%s is illegal (size%d w%d e%d t%d s%d) in %s line %d",
         pcity->name, pcity->size, workers, pcity->specialists[SP_ELVIS],
         pcity->specialists[SP_TAXMAN], pcity->specialists[SP_SCIENTIST], file, 
line);
Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.210
diff -u -r1.210 savegame.c
--- server/savegame.c   30 Nov 2004 08:37:03 -0000      1.210
+++ server/savegame.c   3 Dec 2004 02:00:27 -0000
@@ -1946,6 +1946,9 @@
     pcity->id=secfile_lookup_int(file, "player%d.c%d.id", plrno, i);
     alloc_id(pcity->id);
     idex_register_city(pcity);
+    map_city_radius_iterate(ptile, tile1) {
+      tile1->covered++;
+    } map_city_radius_iterate_end;
     
     if (section_file_lookup(file, "player%d.c%d.original", plrno, i))
       pcity->original = secfile_lookup_int(file, "player%d.c%d.original", 
Index: server/settlers.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v
retrieving revision 1.212
diff -u -r1.212 settlers.c
--- server/settlers.c   22 Nov 2004 19:14:42 -0000      1.212
+++ server/settlers.c   3 Dec 2004 02:00:27 -0000
@@ -106,6 +106,7 @@
   int num = MORT - 1;
   int denom;
   int s = 1;
+
   assert(delay >= 0);
   if (benefit < 0) { s = -1; benefit *= s; }
   while (delay > 0 && benefit != 0) {
@@ -1202,7 +1203,7 @@
   int best = 0;
 
   city_map_iterate(x, y) {
-    if (is_city_center(x, y) 
+    if (is_free_worked_tile(x, y) 
        || get_worker_city(pcity, x, y) == C_TILE_WORKER 
        || get_worker_city(pcity, x, y) == C_TILE_EMPTY) {
       int tmp = city_tile_value(pcity, x, y, 0, 0);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11311) death to smallpox?, Jason Short <=