Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] (PR#2377) Limited Huts
Home

[Freeciv-Dev] (PR#2377) Limited Huts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2377) Limited Huts
From: "Raahul Kumar via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 21 Nov 2002 18:02:57 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Easy AI will not get mercs, techs and more than 25 gold from huts.  If the dice
roll is for the good possibilities, the hut goes -pop- and gives only 25 gold.
The Easy AI can still lose units to barbarians. 

Human players and the Hard/Medium AI's are unchanged. 

Aloha,
RK.

He asked me if I knew what time it was -- I said yes, but not right now.
-Steven Wright

 
 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus ? Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
diff -ruN -Xdiff_ignore Cvs_Freeciv/common/player.h Freeciv/common/player.h
--- Cvs_Freeciv/common/player.h Fri Nov 22 11:00:53 2002
+++ Freeciv/common/player.h     Fri Nov 22 11:01:19 2002
@@ -42,7 +42,7 @@
   H_NONE=0, /* no handicaps */
   H_RIGIDPROD=1, /* can't switch to/from building_unit without penalty */
   H_MAP=2, /* only knows map_get_known tiles */
-  H_TECH=4, /* doesn't know what enemies have researched */
+  H_LIMITEDHUTS=4, /* Can get only 25 gold and barbs from huts */
   H_CITYBUILDINGS=8, /* doesn't know what buildings are in enemy cities */
   H_CITYUNITS=16, /* doesn't know what units are in enemy cities */
   H_DEFENSIVE=32, /* builds lots of defensive buildings without calculating 
need */
diff -ruN -Xdiff_ignore Cvs_Freeciv/server/stdinhand.c 
Freeciv/server/stdinhand.c
--- Cvs_Freeciv/server/stdinhand.c      Fri Nov 22 11:00:55 2002
+++ Freeciv/server/stdinhand.c  Fri Nov 22 11:01:19 2002
@@ -1627,7 +1627,8 @@
   int h[11] = { -1,
                H_NONE,
                H_NONE,
-               H_RATES | H_TARGETS | H_HUTS | H_NOPLANES | H_DEFENSIVE,
+               H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
+                               | H_LIMITEDHUTS | H_DEFENSIVE,
                H_NONE,
                H_RATES | H_TARGETS | H_HUTS,
                H_NONE,
diff -ruN -Xdiff_ignore Cvs_Freeciv/server/unittools.c 
Freeciv/server/unittools.c
--- Cvs_Freeciv/server/unittools.c      Fri Nov 22 11:00:57 2002
+++ Freeciv/server/unittools.c  Fri Nov 22 11:58:58 2002
@@ -2477,7 +2477,8 @@
 {
   struct player *pplayer = unit_owner(punit);
   bool ok = TRUE;
-
+  int hut_chance = myrand(12);
+  
   if (game.rgame.hut_overflight==OVERFLIGHT_NOTHING && is_air_unit(punit)) {
     return ok;
   }
@@ -2491,8 +2492,16 @@
                       " they scatter in terror."));
     return ok;
   }
+  
+  /* Easy AI only ever gets 25 gold and barbs */
+  if (pplayer->ai.control && ai_handicap(pplayer, H_LIMITEDHUTS) 
+       && (hut_chance != 10)) {
+     hut_get_gold(punit, 25);
+     send_player_info(pplayer, pplayer);
+     return ok;
+    }
 
-  switch (myrand(12)) {
+  switch (hut_chance) {
   case 0:
     hut_get_gold(punit, 25);
     break;

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