? city_incite_cost.diff ? test-the-price.gz Index: server/cityturn.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v retrieving revision 1.195 diff -u -r1.195 cityturn.c --- server/cityturn.c 2002/09/25 00:45:10 1.195 +++ server/cityturn.c 2002/09/25 14:25:32 @@ -1185,11 +1185,31 @@ struct government *g = get_gov_pcity(pcity); struct city *capital; int dist; - + int goldfactor=0, city_value=0; +/* for the cost of a revolt you need + * goldfactor + * distance to capital + * city_value + * old + * - size + * new + * - size (multiplied with goldfactor, divided by modified distance to cap) + * - buildings(+ wonders) (added) + * - units (added) (present 50%) (supported 50%) + * modifiers + * - unhappy + * - courthouse (modifies distance) + * - city_is_empty + * (- buy back ... is at another place) + * */ if (city_got_building(pcity, B_PALACE)) { pcity->incite_revolt_cost = INCITE_IMPOSSIBLE_COST; } else { - pcity->incite_revolt_cost = city_owner(pcity)->economic.gold + 1000; + goldfactor = city_owner(pcity)->economic.gold + 1000; + goldfactor *= pcity->size; + + pcity->incite_revolt_cost = goldfactor; + capital = find_palace(city_owner(pcity)); if (capital) { int tmp = map_distance(capital->x, capital->y, pcity->x, pcity->y); @@ -1205,7 +1225,29 @@ dist = MIN(g->fixed_corruption_distance, dist); } pcity->incite_revolt_cost /= (dist + 3); - pcity->incite_revolt_cost *= pcity->size; + + /* no damage discount */ + /* linear .. not quadratical */ + /* should we use unit_value?? */ + unit_list_iterate(pcity->units_supported, punit) { + city_value += unit_type(punit)->build_cost/2; + } unit_list_iterate_end; + + unit_list_iterate(map_get_tile(pcity->x,pcity->y)->units,punit){ + city_value += unit_type(punit)->build_cost/2; + } unit_list_iterate_end; + + built_impr_iterate(pcity, i) { + if (!is_wonder(i)) { + city_value += improvement_value(i)/2; + } else { + city_value += improvement_value(i); + } + } built_impr_iterate_end; + + /* city_value not distance dependent */ + pcity->incite_revolt_cost += city_value*4; + if (city_unhappy(pcity)) { pcity->incite_revolt_cost /= 2; }