[Freeciv-Dev] Blitzkrieg patch
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hello all,
Here is a patch for the Wonder of the World "Blitzkrieg", for freeciv
1.11.0. In fact, it is just an extraction of the relevant files from the
larger "Fascism" patch (see relevant threads). Unlike some elements of
the general "Fascism" patch which are inflammatory to some, the Blitzkrieg
wonder has nothing to do with any particular nation or form of government,
and therefore was extracted for hopeful approval to be patched into the
main freeciv distribution.
IMHO, "Blitzkrieg" is a good idea for a Wonder and is very powerful,
rivalling the power of "must have" Wonders like the Pyramids and Hoover
Dam. It is a very simple concept -- in essence, a Magellan's Expedition
applying to land units. It and other "non-Civ II" features of freeciv
should not be condemned for being "non-Civ II", but instead should be
EMBRACED for making freeciv unique and fresh, rather than a regular
rip-off of Civ II which is what freeciv otherwise would just be. If a
user insists on playing by strict "Civ II" rules, he can set the tech
requirement to "Never" so that it can never be built.
Cheers,
---Reed Meyer
please respond to rdm@xxxxxxxxxxxxxx
Here's the patch: (filename: blitzkrieg_totalpatch-1.11.0)
============================================================
Patch to Freeciv to handle the Blitzkrieg Wonder.
Includes both the source code patch and the patch to buildings.ruleset.
By Reed D. Meyer (rdm@xxxxxxxxxxxxxx). Freeciv 1.11 patch finished 7/23/00.
**************************************************************************
NOTE!!!!!!!!!! If the Fascism government patch is not installed, you will
need to change the line "tech_req" in the buildings.ruleset patch (at the
end of this file) to something other than "Fascism". "Communism" might be
an appropriate alternative.
**************************************************************************
To patch, copy this file to your Freeciv 1.11 main directory, then type:
patch -p0 < blitzkrieg_totalpatch-1.11.0
To undo the patch, type:
patch -R -p0 < blitzkrieg_totalpatch-1.11.0
--- /data/dept/cortes/freecivnew/freeciv-1.11.0/ai/aicity.c Sun Jun 18
14:21:53 2000
+++ ai/aicity.c Fri Jul 21 17:46:59 2000
@@ -117,13 +117,39 @@
city_list_iterate_end;
/* this is a weird place to iterate a units list! */
+
+/* LIGHTHOUSE and BLITZKRIEG added, MAGELLAN modified, by Reed Meyer. */
+/* The 2 in the formula for MAGELLAN represents a fudge factor of 50% */
+/* (divide by 2) to account for fact that a ship's purpose is not TOTALLY */
+/* just "moving around on the high seas"; its purpose is to battle */
+/* other units! (Or in the case of ferryboats, transporting units) */
+/* I.e., the "value" of one ship is not just its movement rate. */
+/* The 3 at the end of the formula for BLITZKRIEG does the same thing. */
+/* The 4 in the formula for LIGHTHOUSE does the same thing, plus an */
+/* additional factor of 50% (additional divide by 2) to account for that */
+/* Wonder's getting obsolete rather quickly in the game, thus a penalty */
+/* to wanting to research it. MAGELLAN also got modified because it */
+/* didn't use to have the improvement_variant check. */
+
unit_list_iterate(pplayer->units, punit)
- if (is_sailing_unit(punit))
- values[B_MAGELLAN] += unit_types[punit->type].build_cost * 6 /
- unit_types[punit->type].move_rate;
+ if (is_sailing_unit(punit)) {
+ values[B_LIGHTHOUSE] += (unit_types[punit->type].build_cost * 3) /
+ (unit_types[punit->type].move_rate * 4);
+ values[B_MAGELLAN] += (unit_types[punit->type].build_cost *
+ ((improvement_variant(B_MAGELLAN)==1) ? 3 : 6)) /
+ (unit_types[punit->type].move_rate * 2);
+ }
+ if (is_ground_unit(punit))
+ values[B_BLITZKRIEG] += (unit_types[punit->type].build_cost *
+ ((unit_types[punit->type].move_rate > 8) ? 6 : 3)) /
+ (unit_types[punit->type].move_rate * 3);
unit_list_iterate_end;
- values[B_MAGELLAN] *= 100 * SHIELD_WEIGHTING;
- values[B_MAGELLAN] /= (MORT * improvement_value(B_MAGELLAN));
+ values[B_LIGHTHOUSE] *= 100 * SHIELD_WEIGHTING /
+ (MORT * improvement_value(B_LIGHTHOUSE));
+ values[B_MAGELLAN] *= 100 * SHIELD_WEIGHTING /
+ (MORT * improvement_value(B_MAGELLAN));
+ values[B_BLITZKRIEG] *= 100 * SHIELD_WEIGHTING /
+ (MORT * improvement_value(B_BLITZKRIEG));
/* This is a weird place to put tech advice */
/* This was: > G_DESPOTISM; should maybe remove test, depending
@@ -144,7 +170,9 @@
/* this probably isn't right -- Syela */
city_list_iterate(pplayer->cities, pcity)
+ pcity->ai.building_want[B_LIGHTHOUSE] = values[B_LIGHTHOUSE];
pcity->ai.building_want[B_MAGELLAN] = values[B_MAGELLAN];
+ pcity->ai.building_want[B_BLITZKRIEG] = values[B_BLITZKRIEG];
pcity->ai.building_want[B_ASMITHS] = values[B_ASMITHS];
pcity->ai.building_want[B_CURE] = values[B_CURE];
pcity->ai.building_want[B_HANGING] += values[B_CURE];
--- /data/dept/cortes/freecivnew/freeciv-1.11.0/ai/aiunit.c Tue Jun 13
11:05:05 2000
+++ ai/aiunit.c Fri Jul 21 17:57:16 2000
@@ -177,10 +177,14 @@
int unit_move_turns(struct unit *punit, int x, int y)
{
int m, d;
+ struct player *pplayer = get_player(punit->owner);
m = unit_types[punit->type].move_rate;
+ if(is_ground_unit(punit)) {
+ if(player_owns_active_wonder(pplayer, B_BLITZKRIEG))
+ m+= (m>8) ? 6 : 3;
+ }
if (unit_flag(punit->type, F_IGTER)) m *= 3;
if(is_sailing_unit(punit)) {
- struct player *pplayer = get_player(punit->owner);
if (player_owns_active_wonder(pplayer, B_LIGHTHOUSE))
m += 3;
if (player_owns_active_wonder(pplayer, B_MAGELLAN))
--- /data/dept/cortes/freecivnew/freeciv-1.11.0/common/city.c Tue Jun 13
16:18:31 2000
+++ common/city.c Sat Jul 22 20:02:43 2000
@@ -1122,6 +1122,7 @@
case B_DARWIN:
case B_LIGHTHOUSE:
case B_MAGELLAN:
+ case B_BLITZKRIEG:
case B_MICHELANGELO:
case B_SETI:
case B_PYRAMIDS:
--- /data/dept/cortes/freecivnew/freeciv-1.11.0/common/city.h Tue Jun 27
09:20:27 2000
+++ common/city.h Sat Jul 22 20:06:20 2000
@@ -40,7 +40,7 @@
B_GREAT, B_WALL, B_HANGING, B_HOOVER, B_ISAAC, B_BACH, B_RICHARDS,
B_LEONARDO, B_LIGHTHOUSE, B_MAGELLAN, B_MANHATTEN, B_MARCO, B_MICHELANGELO,
B_ORACLE, B_PYRAMIDS, B_SETI, B_SHAKESPEARE, B_LIBERTY, B_SUNTZU,
- B_UNITED, B_WOMENS,
+ B_UNITED, B_WOMENS, B_BLITZKRIEG,
B_CAPITAL, B_LAST
};
--- /data/dept/cortes/freecivnew/freeciv-1.11.0/common/unit.c Fri Jun 23
13:06:35 2000
+++ common/unit.c Sat Jul 22 20:11:15 2000
@@ -111,6 +111,10 @@
if (val < 6)
val = 6;
}
+ if(is_ground_unit(punit)) {
+ if(player_owns_active_wonder(pplayer, B_BLITZKRIEG))
+ val+= (get_unit_type(punit->type)->move_rate>8) ? 6 : 3;
+ }
if (val < 3) val = 3;
return val;
}
--- /data/dept/cortes/freecivnew/freeciv-1.11.0/data/default/buildings.ruleset
Wed Jun 28 09:00:18 2000
+++ data/default/buildings.ruleset Tue Jul 25 20:14:45 2000
@@ -1931,6 +1931,22 @@
; For Civ2 this should reduce unhappiness by one for *each* unit
; outside a city that is causing at least one unhappiness.
+[building_blitzkrieg]
+name = _("Blitzkrieg")
+tech_req = "Fascism"
+bldg_req = "None"
+equiv_range = "Player"
+obsolete_by = "None"
+is_wonder = 1
+build_cost = 600
+upkeep = 0
+sabotage = 0
+helptext = _("\
+Gives 2 additional movement points to all land units which have\
+ a movement rate of at least 3. All other land units get 1\
+ bonus movement point.\
+")
+
[building_capitalization]
name = _("Capitalization")
tech_req = "The Corporation"
- [Freeciv-Dev] Blitzkrieg patch,
Reed Meyer <=
|
|