Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] (PR#3990) moves_left becomes non-sane after unit upgrade
Home

[Freeciv-Dev] (PR#3990) moves_left becomes non-sane after unit upgrade

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] (PR#3990) moves_left becomes non-sane after unit upgrade
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jul 2003 11:04:37 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[ChrisK@xxxxxxxx - Sun Apr 13 16:16:12 2003]:

> A settler with 1 MP, which is updated to engineer, and has still 1 MP
> after
> the update, is not always able to move on a mountain top, because it
> has
> only half move points respecting to an engineer.
> 
> A general soulution to this problem might be, to give the updated unit
> the
> same *percent* of move points as the obsolete unit has had.

How about this?

We scale the moves_left and the HP from the old unit to the new unit (so
the % remains the same).  We round down, but are careful not to let the
HP drop to 0.

So for instance a unit may upgrade

  HP 19/20  => 28/30
  MP 3/4    => 4/6

  HP 1/30   => 1/20 (don't die)
  MP 1/2    => 0/1  (rounds down)

  HP 20/20  => 30/30
  HP 1/1    => 2/2

jason

Attachment: upgrade_scaling.diff
Description: upgrade_scaling.diff


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