Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2002:
[Freeciv-Dev] Firepower factor no more (PR#1819)
Home

[Freeciv-Dev] Firepower factor no more (PR#1819)

[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] Firepower factor no more (PR#1819)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Wed, 24 Jul 2002 02:54:27 -0700 (PDT)

This removes unit_adjust entries, finshes the task of removing the useless
options that used to exist in units.ruleset. Changes made:

Civ 1 Ruleset:

Change hp/fp to 1 for all units

Common Ruleset Changes

Got rid of firepower_factor, units_adjust and entries explaining their use.


Tested:

Applies against current CVS. Compiles. No difference in save games for Default.
 
If there any differences in save games for Civ 1 rules, the current patch is
still correct. I doubt it, but have not tested it to make sure. 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
diff -ruN -Xdiff_ignore Cvs_Freeciv/common/game.c Freeciv/common/game.c
--- Cvs_Freeciv/common/game.c   Wed Jul 24 16:26:03 2002
+++ Freeciv/common/game.c       Wed Jul 24 16:43:08 2002
@@ -714,7 +714,6 @@
 
   sz_strlcpy(game.rulesetdir, GAME_DEFAULT_RULESETDIR);
 
-  game.firepower_factor = 1;
   game.num_unit_types = 0;
   game.num_impr_types = 0;
   game.num_tech_types = 0;
diff -ruN -Xdiff_ignore Cvs_Freeciv/data/civ1/units.ruleset 
Freeciv/data/civ1/units.ruleset
--- Cvs_Freeciv/data/civ1/units.ruleset Wed Jul 24 16:26:04 2002
+++ Freeciv/data/civ1/units.ruleset     Wed Jul 24 17:15:23 2002
@@ -13,8 +13,6 @@
 description="Civ1-style unit_type data for Freeciv"
 options="1.9"
 
-[units_adjust]
-firepower_factor=10             ; Means effective hitpoints=1
 
 ; Below: The individual units, one per section.
 ;
@@ -80,7 +78,7 @@
 pop_cost      = 1
 attack        = 0
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -152,7 +150,7 @@
 pop_cost      = 0
 attack        = 1
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -184,7 +182,7 @@
 pop_cost      = 0
 attack        = 1
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -212,7 +210,7 @@
 pop_cost      = 0
 attack        = 3
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -240,7 +238,7 @@
 pop_cost      = 0
 attack        = 3
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -268,7 +266,7 @@
 pop_cost      = 0
 attack        = 1
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -296,7 +294,7 @@
 pop_cost      = 0
 attack        = 2
 defense       = 3
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -325,7 +323,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 4
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -353,7 +351,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 4
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -381,7 +379,7 @@
 pop_cost      = 0
 attack        = 5
 defense       = 5
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -409,7 +407,7 @@
 pop_cost      = 0
 attack        = 3
 defense       = 5
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -437,7 +435,7 @@
 pop_cost      = 0
 attack        = 8
 defense       = 5
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -465,7 +463,7 @@
 pop_cost      = 0
 attack        = 6
 defense       = 4
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -493,7 +491,7 @@
 pop_cost      = 0
 attack        = 6
 defense       = 6
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 1
@@ -526,7 +524,7 @@
 pop_cost      = 0
 attack        = 2
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -554,7 +552,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -582,7 +580,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -610,7 +608,7 @@
 pop_cost      = 0
 attack        = 5
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -638,7 +636,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -667,7 +665,7 @@
 pop_cost      = 0
 attack        = 5
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -695,7 +693,7 @@
 pop_cost      = 0
 attack        = 8
 defense       = 3
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -723,7 +721,7 @@
 pop_cost      = 0
 attack        = 10
 defense       = 5
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 1
@@ -751,7 +749,7 @@
 pop_cost      = 0
 attack        = 6
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -779,7 +777,7 @@
 pop_cost      = 0
 attack        = 8
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -807,7 +805,7 @@
 pop_cost      = 0
 attack        = 10
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -835,7 +833,7 @@
 pop_cost      = 0
 attack        = 12
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -863,7 +861,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 10
 vision_range  = 2
@@ -891,7 +889,7 @@
 pop_cost      = 0
 attack        = 12
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 8
 vision_range  = 2
@@ -919,7 +917,7 @@
 pop_cost      = 0
 attack        = 10
 defense       = 3
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 6
 vision_range  = 2
@@ -947,7 +945,7 @@
 pop_cost      = 0
 attack        = 8
 defense       = 4
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 14
 vision_range  = 2
@@ -975,7 +973,7 @@
 pop_cost      = 0
 attack        = 14
 defense       = 5
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 12
 vision_range  = 2
@@ -1003,7 +1001,7 @@
 pop_cost      = 0
 attack        = 1
 defense       = 0
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 1
@@ -1031,7 +1029,7 @@
 pop_cost      = 0
 attack        = 1
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 1
@@ -1059,7 +1057,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 4
 vision_range  = 1
@@ -1087,7 +1085,7 @@
 pop_cost      = 0
 attack        = 2
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 1
@@ -1115,7 +1113,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 4
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 4
 vision_range  = 1
@@ -1143,7 +1141,7 @@
 pop_cost      = 0
 attack        = 4
 defense       = 4
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 6
 vision_range  = 2
@@ -1171,7 +1169,7 @@
 pop_cost      = 0
 attack        = 6
 defense       = 6
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 6
 vision_range  = 2
@@ -1199,7 +1197,7 @@
 pop_cost      = 0
 attack        = 8
 defense       = 8
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 5
 vision_range  = 2
@@ -1227,7 +1225,7 @@
 pop_cost      = 0
 attack        = 18
 defense       = 12
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 4
 vision_range  = 2
@@ -1255,7 +1253,7 @@
 pop_cost      = 0
 attack        = 8
 defense       = 2
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 2
@@ -1287,7 +1285,7 @@
 pop_cost      = 0
 attack        = 1
 defense       = 12
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 5
 vision_range  = 2
@@ -1320,7 +1318,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 3
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 4
 vision_range  = 2
@@ -1348,7 +1346,7 @@
 pop_cost      = 0
 attack        = 18
 defense       = 0
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 12
 vision_range  = 1
@@ -1376,7 +1374,7 @@
 pop_cost      = 0
 attack        = 99
 defense       = 0
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 16
 vision_range  = 1
@@ -1423,7 +1421,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 0
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -1469,7 +1467,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 0
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 3
 vision_range  = 2
@@ -1497,7 +1495,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -1533,7 +1531,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
@@ -1561,7 +1559,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 1
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 1
 vision_range  = 1
@@ -1589,7 +1587,7 @@
 pop_cost      = 0
 attack        = 0
 defense       = 0
-hitpoints     = 10
+hitpoints     = 1 
 firepower     = 1
 move_rate     = 2
 vision_range  = 1
diff -ruN -Xdiff_ignore Cvs_Freeciv/data/civ2/units.ruleset 
Freeciv/data/civ2/units.ruleset
--- Cvs_Freeciv/data/civ2/units.ruleset Wed Jul 24 16:26:04 2002
+++ Freeciv/data/civ2/units.ruleset     Wed Jul 24 17:15:40 2002
@@ -13,8 +13,6 @@
 description="Civ2 unit_type data for Freeciv (incomplete)"
 options="1.9"
 
-[units_adjust]
-firepower_factor=1              ; convenient for Civ1
 
 ; Below: The individual units, one per section.
 ;
diff -ruN -Xdiff_ignore Cvs_Freeciv/data/default/units.ruleset 
Freeciv/data/default/units.ruleset
--- Cvs_Freeciv/data/default/units.ruleset      Wed Jul 24 16:26:04 2002
+++ Freeciv/data/default/units.ruleset  Wed Jul 24 17:15:53 2002
@@ -21,9 +21,6 @@
 description="Default unit_type data for Freeciv"
 options="1.9"
 
-[units_adjust]
-firepower_factor=1     ; Multiply firepower by this value. Set it
-                       ; to zero to disable firepower altogether.
 
 ; Below: The individual units, one per section.
 ;
diff -ruN -Xdiff_ignore Cvs_Freeciv/doc/README.rulesets 
Freeciv/doc/README.rulesets
--- Cvs_Freeciv/doc/README.rulesets     Wed Jul 24 16:26:05 2002
+++ Freeciv/doc/README.rulesets Wed Jul 24 17:12:56 2002
@@ -113,20 +113,6 @@
   game (rather than intrinsic properties of the unit).
   See comments in common/unit.h
 
-- The [units_adjust] section of the units file deserves some
-  explanation.  It contains the entry
-
-       firepower_factor.
-
-  The value of firepower_factor is used when combat is resolved:
-  All combat firepower values are multiplied by firepower_factor,
-  which means that the effective hitpoints of any unit is really 
-      (hitpoints/firepower_factor).
-  Actually, it is these effective hitpoints which are report to the
-  client for all hitpoint values.
-  (This complicated setup is so that the AI calculations don't 
-  blow up when using Civ1 rulesets.)
-
 - The cities section of the nations ruleset files deserves some
   explanation.  At first glance, it simply contains a comma-
   separated list of quoted city names.  However, this list can
diff -ruN -Xdiff_ignore Cvs_Freeciv/server/ruleset.c Freeciv/server/ruleset.c
--- Cvs_Freeciv/server/ruleset.c        Wed Jul 24 16:26:10 2002
+++ Freeciv/server/ruleset.c    Wed Jul 24 16:44:12 2002
@@ -620,9 +620,7 @@
   datafile_options =
     check_ruleset_capabilities(file, "+1.9", filename);
 
-  game.firepower_factor =
-    secfile_lookup_int_default(file, 1, "units_adjust.firepower_factor");
-
+  
   sec = secfile_get_secnames_prefix(file, "unit_", &nval);
 
   /* Tech requirement is used to flag removed unit_types, which
@@ -2401,7 +2399,7 @@
     packet.tech_requirement = u->tech_requirement;
     packet.vision_range = u->vision_range;
     packet.transport_capacity = u->transport_capacity;
-    packet.hp = u->hp / game.firepower_factor;
+    packet.hp = u->hp;
     packet.firepower = u->firepower;
     packet.obsoleted_by = u->obsoleted_by;
     packet.fuel = u->fuel;
diff -ruN -Xdiff_ignore Cvs_Freeciv/server/unithand.c Freeciv/server/unithand.c
--- Cvs_Freeciv/server/unithand.c       Wed Jul 24 16:26:10 2002
+++ Freeciv/server/unithand.c   Wed Jul 24 16:44:48 2002
@@ -707,8 +707,8 @@
     
   combat.attacker_unit_id=punit->id;
   combat.defender_unit_id=pdefender->id;
-  combat.attacker_hp=punit->hp / game.firepower_factor;
-  combat.defender_hp=pdefender->hp / game.firepower_factor;
+  combat.attacker_hp=punit->hp;
+  combat.defender_hp=pdefender->hp;
   combat.make_winner_veteran=pwinner->veteran?1:0;
   
   for(o=0; o<game.nplayers; o++)
diff -ruN -Xdiff_ignore Cvs_Freeciv/server/unittools.c 
Freeciv/server/unittools.c
--- Cvs_Freeciv/server/unittools.c      Wed Jul 24 16:26:10 2002
+++ Freeciv/server/unittools.c  Wed Jul 24 16:45:44 2002
@@ -203,9 +203,9 @@
   }
   while (attacker->hp>0 && defender->hp>0) {
     if (myrand(attackpower+defensepower) >= defensepower) {
-      defender->hp -= attack_firepower * game.firepower_factor;
+      defender->hp -= attack_firepower;
     } else {
-      attacker->hp -= defense_firepower * game.firepower_factor;
+      attacker->hp -= defense_firepower;
     }
   }
   if (attacker->hp<0) attacker->hp = 0;
@@ -1971,7 +1971,7 @@
   packet->veteran = punit->veteran;
   packet->type = punit->type;
   packet->movesleft = punit->moves_left;
-  packet->hp = punit->hp / game.firepower_factor;
+  packet->hp = punit->hp;
   packet->activity = punit->activity;
   packet->activity_count = punit->activity_count;
   packet->unhappiness = punit->unhappiness;

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