[Freeciv-Dev] (PR#13568) Incite cost effects
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13568 >
This patch replaces EFT_INCITE_DIST_PCT with EFT_INCITE_COST_PCT.
The former was making effective distance to capital smaller, the latter
just increases the incite cost. Exactly the same behaviour can be
reached with both effects.
The problem with EFT_INCITE_DIST_PCT was that there were many rounding
problems and a bug with negative cost occurred when it was larger than 100.
--
mateusz
? civscore.log
Index: ai/aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.233
diff -u -r1.233 aicity.c
--- ai/aicity.c 26 Jul 2005 17:21:53 -0000 1.233
+++ ai/aicity.c 30 Jul 2005 08:35:21 -0000
@@ -325,7 +325,6 @@
if (useful) {
int amount = peffect->value, c = cities[mypreq->range];
- struct city *palace = find_palace(pplayer);
switch (peffect->type) {
case EFT_PROD_TO_GOLD:
@@ -352,10 +351,8 @@
break;
/* WAG evaluated effects */
- case EFT_INCITE_DIST_PCT:
- if (palace) {
- v += real_map_distance(pcity->tile, palace->tile);
- }
+ case EFT_INCITE_COST_PCT:
+ v += c * amount / 100;
break;
case EFT_MAKE_HAPPY:
v += (get_entertainers(pcity) + pcity->ppl_unhappy[4]) * 5 * amount;
Index: common/effects.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/effects.c,v
retrieving revision 1.45
diff -u -r1.45 effects.c
--- common/effects.c 26 Jul 2005 16:35:59 -0000 1.45
+++ common/effects.c 30 Jul 2005 08:35:49 -0000
@@ -73,7 +73,7 @@
"Reveal_Cities",
"Reveal_Map",
/* TODO: "Incite_Dist_Adj", */
- "Incite_Dist_Pct",
+ "Incite_Cost_Pct",
"Size_Adj",
"Size_Unlimit",
"SS_Structural",
Index: common/effects.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/effects.h,v
retrieving revision 1.26
diff -u -r1.26 effects.h
--- common/effects.h 10 May 2005 19:08:54 -0000 1.26
+++ common/effects.h 30 Jul 2005 08:35:49 -0000
@@ -61,7 +61,7 @@
EFT_REVEAL_CITIES,
EFT_REVEAL_MAP,
/* TODO: EFT_INCITE_DIST_ADJ, */
- EFT_INCITE_DIST_PCT,
+ EFT_INCITE_COST_PCT,
EFT_SIZE_ADJ,
EFT_SIZE_UNLIMIT,
EFT_SS_STRUCTURAL,
Index: data/civ2/effects.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ2/effects.ruleset,v
retrieving revision 1.9
diff -u -r1.9 effects.ruleset
--- data/civ2/effects.ruleset 10 May 2005 19:08:55 -0000 1.9
+++ data/civ2/effects.ruleset 30 Jul 2005 08:35:49 -0000
@@ -615,8 +615,8 @@
}
[effect_courthouse_3]
-name = "Incite_Dist_Pct"
-value = 75
+name = "Incite_Cost_Pct"
+value = 300
reqs =
{ "type", "name", "range"
"Building", "Courthouse", "City"
Index: data/default/buildings.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/buildings.ruleset,v
retrieving revision 1.73
diff -u -r1.73 buildings.ruleset
--- data/default/buildings.ruleset 26 Jun 2005 16:01:37 -0000 1.73
+++ data/default/buildings.ruleset 30 Jul 2005 08:35:49 -0000
@@ -290,8 +290,7 @@
helptext = _("\
Reduces the corruption and waste in a city by 50%. Under a Democracy, a\
Courthouse makes 1 unhappy citizen content. \
- Also halves the effective distance to the capital, for the purpose\
- of calculating revolt cost.\
+ Also makes the revolt cost of the city 4 times bigger.\
")
[building_factory]
Index: data/default/effects.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/effects.ruleset,v
retrieving revision 1.10
diff -u -r1.10 effects.ruleset
--- data/default/effects.ruleset 10 May 2005 19:08:55 -0000 1.10
+++ data/default/effects.ruleset 30 Jul 2005 08:35:49 -0000
@@ -604,8 +604,8 @@
}
[effect_courthouse_3]
-name = "Incite_Dist_Pct"
-value = 75
+name = "Incite_Cost_Pct"
+value = 300
reqs =
{ "type", "name", "range"
"Building", "Courthouse", "City"
Index: data/history/effects.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/history/effects.ruleset,v
retrieving revision 1.7
diff -u -r1.7 effects.ruleset
--- data/history/effects.ruleset 10 May 2005 19:08:55 -0000 1.7
+++ data/history/effects.ruleset 30 Jul 2005 08:35:49 -0000
@@ -279,8 +279,8 @@
}
[effect_courthouse_3]
-name = "Incite_Dist_Pct"
-value = 75
+name = "Incite_Cost_Pct"
+value = 300
reqs =
{ "type", "name", "range"
"Building", "Courthouse", "City"
Index: server/cityturn.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v
retrieving revision 1.327
diff -u -r1.327 cityturn.c
--- server/cityturn.c 30 Jul 2005 05:10:02 -0000 1.327
+++ server/cityturn.c 30 Jul 2005 08:35:54 -0000
@@ -1378,7 +1378,7 @@
/* No capital? Take max penalty! */
dist = 32;
}
- dist -= (dist * get_city_bonus(pcity, EFT_INCITE_DIST_PCT)) / 100;
+
if (g->waste[O_TRADE].fixed_distance != 0) {
dist = MIN(g->waste[O_TRADE].fixed_distance, dist);
}
@@ -1390,6 +1390,8 @@
cost *= size;
cost *= game.info.incite_total_factor;
cost = cost / (dist + 3);
+
+ cost += (cost * get_city_bonus(pcity, EFT_INCITE_COST_PCT)) / 100;
cost /= 100;
return cost;
- [Freeciv-Dev] (PR#13568) Incite cost effects,
Mateusz Stefek <=
|
|