Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10125) Pollu_Prod_Pct
Home

[Freeciv-Dev] (PR#10125) Pollu_Prod_Pct

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10125) Pollu_Prod_Pct
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Sep 2004 09:19:09 -0700
Reply-to: rt@xxxxxxxxxxx

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

This patch changes the two pollution effects to be normal bonus percentages.

jason

? drawn_sprites.diff
? freeciv.spec
? ftwl.diff
? settler_recursion_crash
? client/tilespec.diff
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.245
diff -u -r1.245 city.c
--- common/city.c       15 Sep 2004 09:54:01 -0000      1.245
+++ common/city.c       17 Sep 2004 16:18:25 -0000
@@ -1923,16 +1923,21 @@
 int city_pollution(struct city *pcity, int shield_total)
 {
   struct player *pplayer = city_owner(pcity);
-  int mod, pollution = shield_total;
+  int mod, pollution;
+
+  /* Add one one pollution per shield, multipled by the bonus. */
+  mod = 100 + get_city_bonus(pcity, EFT_POLLU_PROD_PCT);
+  mod = MAX(0, mod);
+  pollution = shield_total * mod / 100;
+
+  /* Add one 1/4 pollution per citizen per tech, multiplied by the bonus. */
+  mod = 100 + get_city_bonus(pcity, EFT_POLLU_POP_PCT);
+  mod = MAX(0, mod);
+  pollution += (pcity->size
+               * num_known_tech_with_flag(pplayer,
+                                          TF_POPULATION_POLLUTION_INC)
+               * mod) / (4 * 100);
 
-  mod = get_city_bonus(pcity, EFT_POLLU_PROD_PCT);
-  if (mod > 0) {
-    pollution /= mod;
-  }
-  mod = (pcity->size *
-      num_known_tech_with_flag(pplayer, TF_POPULATION_POLLUTION_INC)) / 4;
-  mod -= mod * get_city_bonus(pcity, EFT_POLLU_POP_PCT) / 100;
-  pollution += MAX(mod, 0);
   pollution = MAX(0, pollution - 20);
 
   return pollution;
Index: data/civ1/buildings.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ1/buildings.ruleset,v
retrieving revision 1.37
diff -u -r1.37 buildings.ruleset
--- data/civ1/buildings.ruleset 13 Sep 2004 15:54:53 -0000      1.37
+++ data/civ1/buildings.ruleset 17 Sep 2004 16:18:26 -0000
@@ -449,7 +449,7 @@
 effect         =
     { "name", "value", "equiv"
       "Prod_Bonus", 50, "Generators"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_hydro_plant"
 sound_alt      = "b_generic"
@@ -539,7 +539,7 @@
 sabotage       = 100
 effect         =
     { "name", "value"
-      "Pollu_Pop_Pct", 100
+      "Pollu_Pop_Pct", -100
     }
 sound          = "b_mass_transit"
 sound_alt      = "b_generic"
@@ -596,7 +596,7 @@
 effect         =
     { "name", "value", "equiv"
       "Prod_Bonus", 50, "Generators"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_nuclear_plant"
 sound_alt      = "b_generic"
@@ -706,7 +706,7 @@
 sabotage       = 100
 effect         =
     { "name", "value", "equiv"
-      "Pollu_Prod_Pct", 3, "Janitors"
+      "Pollu_Prod_Pct", -66, "Janitors"
     }
 sound          = "b_recycling_center"
 sound_alt      = "b_generic"
@@ -1231,7 +1231,7 @@
 effect         =
     { "name", "range", "value", "equiv"
       "Prod_Bonus", "Continent", 50, "Generators"
-      "Pollu_Prod_Pct", "Continent", 2, "Janitors"
+      "Pollu_Prod_Pct", "Continent", -50, "Janitors"
     }
 variant                = 1             ; FIXME: remove when gen-impr obsoletes
 sound          = "w_hoover_dam"
Index: data/civ2/buildings.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/civ2/buildings.ruleset,v
retrieving revision 1.40
diff -u -r1.40 buildings.ruleset
--- data/civ2/buildings.ruleset 13 Sep 2004 15:54:53 -0000      1.40
+++ data/civ2/buildings.ruleset 17 Sep 2004 16:18:26 -0000
@@ -525,7 +525,7 @@
     { "name", "value", "equiv", "req_type", "req"
       "Prod_Bonus", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_hydro_plant"
 sound_alt      = "b_generic"
@@ -617,7 +617,7 @@
 sabotage       = 100
 effect         =
     { "name", "value"
-      "Pollu_Pop_Pct", 100
+      "Pollu_Pop_Pct", -100
     }
 sound          = "b_mass_transit"
 sound_alt      = "b_generic"
@@ -675,7 +675,7 @@
     { "name", "value", "equiv", "req_type", "req"
       "Prod_Bonus", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_nuclear_plant"
 sound_alt      = "b_generic"
@@ -873,7 +873,7 @@
 sabotage       = 100
 effect         =
     { "name", "value", "equiv"
-      "Pollu_Prod_Pct", 3, "Janitors"
+      "Pollu_Prod_Pct", -66, "Janitors"
     }
 sound          = "b_recycling_center"
 sound_alt      = "b_generic"
@@ -1573,7 +1573,7 @@
     { "name", "range", "value", "equiv", "req_type", "req"
       "Prod_Bonus", "Player", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", "Player", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", "Player", 2, "Janitors"
+      "Pollu_Prod_Pct", "Player", -50, "Janitors"
     }
 sound          = "w_hoover_dam"
 sound_alt      = "w_generic"
Index: data/default/buildings.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/default/buildings.ruleset,v
retrieving revision 1.53
diff -u -r1.53 buildings.ruleset
--- data/default/buildings.ruleset      17 Sep 2004 00:54:07 -0000      1.53
+++ data/default/buildings.ruleset      17 Sep 2004 16:18:26 -0000
@@ -588,7 +588,7 @@
     { "name", "value", "equiv", "req_type", "req"
       "Prod_Bonus", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_hydro_plant"
 sound_alt      = "b_generic"
@@ -683,7 +683,7 @@
 sabotage       = 100
 effect         =
     { "name", "value"
-      "Pollu_Pop_Pct", 100
+      "Pollu_Pop_Pct", -100
     }
 sound          = "b_mass_transit"
 sound_alt      = "b_generic"
@@ -741,7 +741,7 @@
     { "name", "value", "equiv", "req_type", "req"
       "Prod_Bonus", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_nuclear_plant"
 sound_alt      = "b_generic"
@@ -947,7 +947,7 @@
 sabotage       = 100
 effect         =
     { "name", "value", "equiv"
-      "Pollu_Prod_Pct", 3, "Janitors"
+      "Pollu_Prod_Pct", -66, "Janitors"
     }
 sound          = "b_recycling_center"
 sound_alt      = "b_generic"
@@ -1655,7 +1655,7 @@
     { "name", "range", "value", "equiv", "req_type", "req"
       "Prod_Bonus", "Player", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", "Player", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", "Player", 2, "Janitors"
+      "Pollu_Prod_Pct", "Player", -50, "Janitors"
     }
 sound          = "w_hoover_dam"
 sound_alt      = "w_generic"
Index: data/history/buildings.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/history/buildings.ruleset,v
retrieving revision 1.12
diff -u -r1.12 buildings.ruleset
--- data/history/buildings.ruleset      13 Sep 2004 15:54:53 -0000      1.12
+++ data/history/buildings.ruleset      17 Sep 2004 16:18:26 -0000
@@ -529,7 +529,7 @@
     { "name", "value", "equiv", "req_type", "req"
       "Prod_Bonus", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_hydro_plant"
 sound_alt      = "b_generic"
@@ -624,7 +624,7 @@
 sabotage       = 100
 effect         =
     { "name", "value"
-      "Pollu_Pop_Pct", 100
+      "Pollu_Pop_Pct", -100
     }
 sound          = "b_mass_transit"
 sound_alt      = "b_generic"
@@ -682,7 +682,7 @@
     { "name", "value", "equiv", "req_type", "req"
       "Prod_Bonus", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", 2, "Janitors"
+      "Pollu_Prod_Pct", -50, "Janitors"
     }
 sound          = "b_nuclear_plant"
 sound_alt      = "b_generic"
@@ -888,7 +888,7 @@
 sabotage       = 100
 effect         =
     { "name", "value", "equiv"
-      "Pollu_Prod_Pct", 3, "Janitors"
+      "Pollu_Prod_Pct", -66, "Janitors"
     }
 sound          = "b_recycling_center"
 sound_alt      = "b_generic"
@@ -1596,7 +1596,7 @@
     { "name", "range", "value", "equiv", "req_type", "req"
       "Prod_Bonus", "Player", 25, "Generators", "Building", "Factory"
       "Prod_Bonus", "Player", 25, "Generators", "Building", "Mfg. Plant"
-      "Pollu_Prod_Pct", "Player", 2, "Janitors"
+      "Pollu_Prod_Pct", "Player", -50, "Janitors"
     }
 sound          = "w_hoover_dam"
 sound_alt      = "w_generic"
Index: doc/README.effects
===================================================================
RCS file: /home/freeciv/CVS/freeciv/doc/README.effects,v
retrieving revision 1.3
diff -u -r1.3 README.effects
--- doc/README.effects  13 Sep 2004 15:54:53 -0000      1.3
+++ doc/README.effects  17 Sep 2004 16:18:27 -0000
@@ -68,11 +68,9 @@
 
 "Nuke_Proof"   - nuclear attacks will fail within AMOUNT distance
 
-"Pollu_Pop_Pct"        - decreases pollution caused by population by AMOUNT 
percent
+"Pollu_Pop_Pct"        - increases pollution caused by population by AMOUNT 
percent
 
-"Pollu_Prod_Pct"- multiplies pollution caused by shield production by
-                 AMOUNT percent (applied after Pollu_Prod_Adj;
-                 multiple effects are multiplicative)
+"Pollu_Prod_Pct"- increases pollution caused by shields by AMOUNT percent
 
 "Prod_Add_Tile"        - each worked tile produces AMOUNT additional shield
                  production

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