Index: ai/advdiplomacy.c
===================================================================
--- ai/advdiplomacy.c	(revision 12298)
+++ ai/advdiplomacy.c	(working copy)
@@ -657,7 +657,12 @@
 {
   int want = 0, fear = 0, distance = 0, settlers = 0, cities = 0;
   struct player_spaceship *ship = &target->spaceship;
+  int enemy_trade = 0;
 
+  /* Calculate average distances to other player's empire. */
+  distance = player_distance_to_player(pplayer, target);
+  ai->diplomacy.player_intel[target->player_no].distance = distance;
+
   city_list_iterate(target->cities, pcity) {
     want += 100; /* base city want */
     want += pcity->size * 20;
@@ -675,7 +680,10 @@
         want += impr_build_shield_cost(id);
       }
     } built_impr_iterate_end;
+
+    enemy_trade += pcity->prod[O_TRADE];
   } city_list_iterate_end;
+
   unit_list_iterate(target->units, punit) {
     fear += ATTACK_POWER(punit);
 
@@ -703,15 +711,31 @@
     cities++;
   } city_list_iterate_end;
 
+  /* We must consider enemy's ability of quickly mobilizing, even though
+   * it may be almost completely unmilitarized so far */
+  {
+    struct unit_type *attacker = best_role_unit_for_player(target,
+		                                           L_ATTACK_STRONG);
+    int attacker_power = TYPE_ATTACK_POWER(attacker);
+    /* We implicitly give the potential units less weight as we compute
+     * the cost based on an almost-empty shield stock. */
+    int attacker_cost = unit_buy_gold_cost(attacker, 1);
+    int gold_bonus = enemy_trade * get_player_bonus(target, EFT_MAX_RATES) / 100;
+    int gold_boost = 0, enemy_gold = target->economic.gold;
+    int i;
+
+    for (i = 1; i <= distance; i++)
+      gold_boost += amortize(gold_bonus, i);
+    enemy_gold += gold_boost;
+
+    fear += attacker_power * (enemy_gold / attacker_cost);
+  }
+
   /* Modify by settler/cities ratio to prevent early wars when
    * we should be expanding. This will eliminate want if we 
    * produce settlers in all cities (ie full expansion). */
   want -= abs(want) / MAX(cities - settlers, 1);
 
-  /* Calculate average distances to other player's empire. */
-  distance = player_distance_to_player(pplayer, target);
-  ai->diplomacy.player_intel[target->player_no].distance = distance;
-
   /* Tech lead is worrisome. FIXME: Only consider 'military' techs. */
   fear += MAX(get_player_research(target)->techs_researched
               - get_player_research(pplayer)->techs_researched, 0) * 100;
