Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] [Patch] Cleanup of defense power calculations
Home

[Freeciv-Dev] [Patch] Cleanup of defense power calculations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] [Patch] Cleanup of defense power calculations
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Feb 2002 17:07:07 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx


base_get_defense_power, get_defense_power and get_total_defense_power
multiply defense_strength with POWER_FACTOR. get_virtual_defense_power
doesn't.

You may have a better name for unit_vulnerability_virtual2.

From the belligerence functions only unit_belligerence returns a
squared value. From the vulnerability functions only
unit_vulnerability_basic returns a _non_-squared value.

get_simple_defense_power has been removed.

The patch is on top of attack_power2.diff.

Nothing should be changed except this one (which I consider a bug):
-  if (unit_on_fortress(defender) &&
-      !map_get_city(defender->x, defender->y))
-    defensepower*=2;

+  if (map_has_special(x, y, S_FORTRESS) && !pcity) {
+    defensepower +=
+       (defensepower * terrain_control.fortress_defense_bonus) / 100;
+  }

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Real Users find the one combination of bizarre
   input values that shuts down the system for days."

Attachment: defense_power1.diff
Description: Text document


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