Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#10109) Add Eiffel tower
Home

[Freeciv-Dev] (PR#10109) Add Eiffel tower

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10109) Add Eiffel tower
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sun, 19 Sep 2004 11:37:38 -0700
Reply-to: rt@xxxxxxxxxxx

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

Here's my proposition
I added support for amount into aicity and changed the amounts to be
permilles of MAX_AI_LOVE/GAME_MAX_REPUTATION
--
mateusz
? freeciv.spec
? ai/test
? client/core.16019
? server/freeciv_user_database
Index: ai/advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.43
diff -u -r1.43 advdiplomacy.c
--- ai/advdiplomacy.c   18 Sep 2004 08:55:59 -0000      1.43
+++ ai/advdiplomacy.c   19 Sep 2004 18:35:17 -0000
@@ -729,7 +729,12 @@
       MIN(player_in_territory(pplayer, aplayer) * (MAX_AI_LOVE / 100),
           pplayers_allied(aplayer, pplayer) ? 
            ai->diplomacy.love_incr - 1 : (MAX_AI_LOVE / 2));
-         
+ 
+    /* Increase the love if aplayer has got a building that makes 
+     * us love him more. Typically it's Eiffel Tower */
+    pplayer->ai.love[aplayer->player_no] +=
+      get_player_bonus(aplayer, EFT_GAIN_AI_LOVE) * MAX_AI_LOVE / 1000;
+         
     /* Massage our numbers to keep love and its opposite on the ground. 
      * Gravitate towards zero. */
     pplayer->ai.love[aplayer->player_no] -= 
Index: ai/aicity.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v
retrieving revision 1.163
diff -u -r1.163 aicity.c
--- ai/aicity.c 13 Sep 2004 15:54:49 -0000      1.163
+++ ai/aicity.c 19 Sep 2004 18:35:17 -0000
@@ -438,6 +438,22 @@
                  - game.incite_cost.unit_factor * 5, 0);
            }
            break;
+          case EFT_REGEN_REPUTATION:
+            v += (GAME_MAX_REPUTATION - pplayer->reputation) * 50 / 
+                   GAME_MAX_REPUTATION + 
+                 amount * 4;
+            break;
+         case EFT_GAIN_AI_LOVE:
+            players_iterate(aplayer) {
+              if (aplayer->ai.control) {
+                if (ai_handicap(pplayer, H_DEFENSIVE)) {
+                  v += amount / 10;
+                } else {
+                  v += amount / 20;
+                }
+              }
+            } players_iterate_end;
+            break;
          case EFT_LAST:
            freelog(LOG_ERROR, "Bad effect type.");
            break;
Index: common/effects.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/effects.c,v
retrieving revision 1.10
diff -u -r1.10 effects.c
--- common/effects.c    13 Sep 2004 18:14:19 -0000      1.10
+++ common/effects.c    19 Sep 2004 18:35:26 -0000
@@ -127,7 +127,9 @@
   "Air_Defend",
   "Missile_Defend",
   "No_Upkeep",
-  "No_Incite"
+  "No_Incite",
+  "Regen_Reputation",
+  "Gain_AI_Love"
 };
 
 /**************************************************************************
Index: common/effects.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/effects.h,v
retrieving revision 1.7
diff -u -r1.7 effects.h
--- common/effects.h    13 Sep 2004 15:54:51 -0000      1.7
+++ common/effects.h    19 Sep 2004 18:35:26 -0000
@@ -114,6 +114,8 @@
   EFT_MISSILE_DEFEND,
   EFT_NO_UPKEEP,
   EFT_NO_INCITE,
+  EFT_REGEN_REPUTATION,
+  EFT_GAIN_AI_LOVE,
   EFT_LAST     /* keep this last */
 };
 
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      19 Sep 2004 18:35:29 -0000
@@ -1523,7 +1523,7 @@
 
 [building_eiffel_tower]
 name           = _("Eiffel Tower")
-tech_req       = "Never"               ; "Steam Engine"
+tech_req       = "Steam Engine"
 bldg_req       = "None"
 graphic        = "b.eiffel_tower"
 graphic_alt    = "-"
@@ -1534,18 +1534,22 @@
 ;equiv_repl    =
 obsolete_by    = "None"
 is_wonder      = 1
-build_cost     = 300
+build_cost     = 100
 upkeep         = 0
 sabotage       = 0
+effect         =
+    { "name", "range", "value"
+      "Regen_Reputation", "Player", 2
+      "Gain_AI_Love", "Player", 20
+    }
 sound          = "w_eiffel_tower"
 sound_alt      = "w_generic"
 ; /* xgettext:no-c-format */
 helptext       = _("\
-When built, every civilization's attitude toward you is improved\
- by 25%.\
+Your reputation and goodwill among other nations is increased\
+ while you possess this wonder.  Reputation is recovered twice\
+ as fast as it would otherwise.\
 ")
-; NOTE:
-; Not implemented.
 
 [building_great_library]
 name           = _("Great Library")
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  19 Sep 2004 18:35:34 -0000
@@ -148,6 +148,11 @@
 "Air_Vet_Combat"- Increases the chance of units of this type becoming veteran
                  after combat by AMOUNT percent
 
+"Gain_AI_Love"  - Increase AI's love for you by AMOUNT permilles of 
+                 MAX_AI_LOVE per turn
+"Regen_Reputation" - Increase your reputation by AMOUNT permilles of
+                 GAME_MAX_REPUTATION per turn
+
 .range may be one of: 
              "None", "Local", "City", "Continent", "Player", "World"
 
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.197
diff -u -r1.197 srv_main.c
--- server/srv_main.c   17 Sep 2004 08:35:14 -0000      1.197
+++ server/srv_main.c   19 Sep 2004 18:35:43 -0000
@@ -48,6 +48,7 @@
 #include "capstr.h"
 #include "city.h"
 #include "dataio.h"
+#include "effects.h"
 #include "events.h"
 #include "fciconv.h"
 #include "fcintl.h"
@@ -439,8 +440,11 @@
        }
         }
     } players_iterate_end;
-    player1->reputation = MIN(player1->reputation + GAME_REPUTATION_INCR,
-                             GAME_MAX_REPUTATION);
+    player1->reputation = 
+      MIN((get_player_bonus(player1, EFT_REGEN_REPUTATION) * 
+           GAME_MAX_REPUTATION / 1000) + 
+         player1->reputation + GAME_REPUTATION_INCR,
+          GAME_MAX_REPUTATION);
   } players_iterate_end;
 }
 

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