Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4145) Combat and move points.
Home

[Freeciv-Dev] Re: (PR#4145) Combat and move points.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#4145) Combat and move points.
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 4 May 2003 12:34:52 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, 4 May 2003, Per I. Mathisen wrote:

> On Sun, 4 May 2003, Gregory Berkolaiko wrote:
> > Right now if a land unit is attacked and it's HP is decreased, it's MP are
> > left unaffected. So we have a situation when a unit has more move-points
> > than would be given to it by unit_move_rate (which does take into account
> > HPs and such).
> ...
> > I think we need to change the system. I feel what is now done for ships
> > (unithand.c around line 720) is very just and suitable for land units too.
> 
> Yes. I think this is the right thing to do, and also what civ2 did.
> 
> 728   if (is_sailing_unit(punit)) {
> 729     punit->moves_left = unit_move_rate(punit) - moves_used - SINGLE_MOVE;
> 730   } else {
> 731     punit->moves_left -= SINGLE_MOVE;
> 732   }
> 733   if (is_sailing_unit(pdefender)) {
> 734     pdefender->moves_left = unit_move_rate(pdefender) - def_moves_used;
> 735   }
> 
> should be replaced with
> 
>   punit->moves_left = unit_move_rate(punit) - moves_used - SINGLE_MOVE;
>   pdefender->moves_left = unit_move_rate(pdefender) - moves_used
>                           - SINGLE_MOVE;

And a patch doing that (apart from subtracting SINGLE_MOVE from the 
defender ;)  Comment by GJW (Greg Wooledge ?) changed accordingly.

G.

? ttt.gz
Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.257
diff -u -r1.257 unithand.c
--- server/unithand.c   2003/04/04 16:03:08     1.257
+++ server/unithand.c   2003/05/04 19:31:58
@@ -719,20 +719,13 @@
   /* Adjust attackers moves_left _after_ unit_versus_unit() so that
    * the movement attack modifier is correct! --dwp
    *
-   * And for greater Civ2 compatibility (and ship balance issues), ships
-   * use a different algorithm.  Recompute a new total MP based on the HP
-   * the ship has left after being damaged, and subtract out all of the MP
-   * that had been used so far this turn (plus the points used in the attack
-   * itself). -GJW
+   * For greater Civ2 compatibility (and game balance issues), we recompute 
+   * the new total MP based on the HP the unit has left after being damaged, 
+   * and subtract the MPs that had been used before the combat (plus the 
+   * points used in the attack itself, for the attacker). -GJW, Glip
    */
-  if (is_sailing_unit(punit)) {
-    punit->moves_left = unit_move_rate(punit) - moves_used - SINGLE_MOVE;
-  } else {
-    punit->moves_left -= SINGLE_MOVE;
-  }
-  if (is_sailing_unit(pdefender)) {
-    pdefender->moves_left = unit_move_rate(pdefender) - def_moves_used;
-  }
+  punit->moves_left = unit_move_rate(punit) - moves_used - SINGLE_MOVE;
+  pdefender->moves_left = unit_move_rate(pdefender) - def_moves_used;
   
   if (punit->moves_left < 0) {
     punit->moves_left = 0;

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