Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] New Igter patch (PR#1370)
Home

[Freeciv-Dev] New Igter patch (PR#1370)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] New Igter patch (PR#1370)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Tue, 9 Apr 2002 21:12:55 -0700 (PDT)

Greg asked for some changes in the original. This is 2nd version of the patch.
I think I got almost all the igter lines. I didn't touch the dubious ones.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
diff -ruN -Xdiff_ignore cvs-freeciv/ai/advmilitary.c freeciv/ai/advmilitary.c
--- cvs-freeciv/ai/advmilitary.c        Wed Apr 10 13:54:22 2002
+++ freeciv/ai/advmilitary.c    Wed Apr 10 13:57:46 2002
@@ -459,7 +459,7 @@
 /*  else if (d < 2) cur = (cur * (a + d))/2; Don't believe in this anymore */
   else cur *= a; /* wanted to rank Legion > Catapult > Archer */
 /* which we will do by munging f in the attacker want equations */
-  if (unit_type_flag(i, F_IGTER) && !def) cur *= 3;
+  if (unit_type_flag(i, F_IGTER) && !def) cur *= IGTER_MOVE_BONUS;
   if (unit_type_flag(i, F_PIKEMEN) && def) {
     cur = (3 * cur) / 2;
   }
@@ -594,8 +594,9 @@
       /* b is unchanged */
 
       m = unit_types[i].move_rate;
-      q = (acity ? 1 : unit_types[n].move_rate * (unit_type_flag(n, F_IGTER) ? 
3 : 1));
-      if (unit_type_flag(i, F_IGTER)) m *= SINGLE_MOVE; /* not quite right */
+      q = (acity ? 1 : unit_types[n].move_rate * (unit_type_flag(n, F_IGTER) ? 
+          IGTER_MOVE_BONUS : 1));
+      if (unit_type_flag(i, F_IGTER)) m *= IGTER_MOVE_BONUS; /* not quite 
right */
       if (unit_types[i].move_type == LAND_MOVING) {
         if (boatspeed != 0) { /* has to be a city, so don't bother with q */
           c = (warmap.cost[bx][by] + m - 1) / m + 1 +
@@ -729,7 +730,7 @@
       pdef = get_defender(myunit, x, y);
 
       m = unit_types[v].move_rate;
-      if (unit_type_flag(v, F_IGTER)) m *= 3; /* not quite right */
+      if (unit_type_flag(v, F_IGTER)) m *= IGTER_MOVE_BONUS; /* not quite 
right */
 
       sanity = (goto_is_sane(myunit, acity->x, acity->y, TRUE) &&
               warmap.cost[x][y] <= (MIN(6, m) * THRESHOLD));
@@ -793,12 +794,12 @@
       else dist = real_map_distance(pcity->x, pcity->y, x, y) * SINGLE_MOVE;
       if (dist > m) {
         dist *= unit_type(pdef)->move_rate;
-        if (unit_flag(pdef, F_IGTER)) dist *= 3;
+        if (unit_flag(pdef, F_IGTER)) dist *= IGTER_MOVE_BONUS;
       }
       if (dist == 0) dist = 1;
 
       m = unit_types[v].move_rate;
-      if (unit_type_flag(v, F_IGTER)) m *= 3; /* not quite right */
+      if (unit_type_flag(v, F_IGTER)) m *= IGTER_MOVE_BONUS; /* not quite 
right */
       c = ((dist + m - 1) / m);
 
       n = pdef->type;
diff -ruN -Xdiff_ignore cvs-freeciv/ai/aiunit.c freeciv/ai/aiunit.c
--- cvs-freeciv/ai/aiunit.c     Wed Apr 10 13:54:22 2002
+++ freeciv/ai/aiunit.c Wed Apr 10 13:59:50 2002
@@ -190,7 +190,7 @@
     * they cross cost 1/3 of a movement point. ---RK */
  
     if (unit_flag(punit, F_IGTER)) {
-      move_rate *= 3;
+      move_rate *= IGTER_MOVE_BONUS;
     }
     move_time = warmap.cost[x][y] / move_rate;
     break;
@@ -1609,7 +1609,7 @@
   ab = unit_belligerence_basic(punit);
   if (ab == 0) return(0); /* don't want to deal with SIGFPE's -- Syela */
   m = unit_type(punit)->move_rate;
-  if (unit_flag(punit, F_IGTER)) m *= SINGLE_MOVE;
+  if (unit_flag(punit, F_IGTER)) m *= IGTER_MOVE_BONUS;
   maxd = MIN(6, m) * THRESHOLD + 1;
   f = unit_type(punit)->build_cost;
   fprime = build_cost_balanced(punit->type);
@@ -1798,7 +1798,7 @@
           else n = real_map_distance(punit->x, punit->y, aunit->x, aunit->y) * 
3;
           if (n > m) { /* if n <= m, it can't run away -- Syela */
             n *= unit_type(aunit)->move_rate;
-            if (unit_flag(aunit, F_IGTER)) n *= 3;
+            if (unit_flag(aunit, F_IGTER)) n *= IGTER_MOVE_BONUS;
           }
           c = (n + m - 1) / m;
           if (!is_ground_unit(punit) && d == 0) b0 = 0;
diff -ruN -Xdiff_ignore cvs-freeciv/common/unit.h freeciv/common/unit.h
--- cvs-freeciv/common/unit.h   Wed Apr 10 13:54:24 2002
+++ freeciv/common/unit.h       Wed Apr 10 13:55:54 2002
@@ -149,6 +149,7 @@
 #define MOVE_COST_RAIL 0
 #define MOVE_COST_ROAD 1
 #define MOVE_COST_AIR 1
+#define IGTER_MOVE_BONUS 3
 
 #define unit_list_iterate_safe(unitlist, punit) \
 { \

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