Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2005:
[Freeciv-Dev] (PR#13977) Patch: splitting "Fanatic" option
Home

[Freeciv-Dev] (PR#13977) Patch: splitting "Fanatic" option

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13977) Patch: splitting "Fanatic" option
From: "Lo'oris" <lo_oris@xxxxxxxx>
Date: Wed, 14 Sep 2005 19:31:02 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13977 >

I'm writing a new rulesed. It would be very nice for me to have the 
"Fanatic" flag for the units split in two different options:
(1) "Fanatic": only Fanatic_troops government can built this unit
(2) "Fanatic_free": Fanatic_troops government can mantain these unit 
for free

i'm not a programmer anymore, but i tried anyway to make a patch. 
Strange enough, it did work. Here it is (based on beta7).

i cannot do that in the cvs because it breaks client compatibility, and 
i cannot compile cvs client since i do not have gtk 2.4. Anyway, it 
should be nice if it could be added :)

to say it all, it would be even nicer if instead of "free" / "not 
free", i could choose "pay normal mantainance" / "pay reduced 
mantainance", but i think i dunno how to write such a thing...

--- common/unittype copia.h     Sun Jan 16 11:58:03 2005
+++ common/unittype.h   Wed Sep 14 22:14:26 2005
@@ -107,6 +107,7 @@
    F_ADD_TO_CITY,      /* unit can add to city population */
    F_FANATIC,          /* Only Fundamentalist government can build
                          these units */
+  F_FANATIC_FREE,     /* Freely mantained by Fund. gov's */
    F_GAMELOSS,         /* Losing this unit means losing the game */
    F_UNIQUE,           /* A player can only have one unit of this type 
*/
    F_UNBRIBABLE,       /* Cannot be bribed */
--- common/unittype copia.c     Sun Jan 16 11:58:03 2005
+++ common/unittype.c   Wed Sep 14 22:13:46 2005
@@ -45,7 +45,7 @@
    "AEGIS", "Fighter", "Marines", "Partial_Invis", "Settlers", 
"Diplomat",
    "Trireme", "Nuclear", "Spy", "Transform", "Paratroopers",
    "Airbase", "Cities", "IgTired", "Missile_Carrier", "No_Land_Attack",
-  "AddToCity", "Fanatic", "GameLoss", "Unique", "Unbribable",
+  "AddToCity", "Fanatic", "Fanatic_free", "GameLoss", "Unique", 
"Unbribable",
    "Undisbandable", "SuperSpy", "NoHome", "NoVeteran", "Bombarder",
    "CityBuster", "NoBuild"
  };
@@ -136,7 +136,7 @@
  int utype_shield_cost(struct unit_type *ut, struct government *g)
  {
    if (government_has_flag(g, G_FANATIC_TROOPS) &&
-      BV_ISSET(ut->flags, F_FANATIC)) {
+      BV_ISSET(ut->flags, F_FANATIC_FREE)) {
      return 0;
    }
    return ut->shield_cost * g->unit_shield_cost_factor;

-- 
Lo'oris, tu sei il lano e modifichi astromondi
  - Braindamage

Annusa Lo'oris su www.looris.webhop.net 
 

 

 --

 Email.it, the professional e-mail, gratis per te: http://www.email.it/f

 

 Sponsor:

 Con la Pietra Naturale puoi grigliare carne, pesce e verdura direttamente in 
tavola!

 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2743&d=15-9
I'm writing a new rulesed. It would be very nice for me to have the "Fanatic" flag for the units split in two different options:
(1) "Fanatic": only Fanatic_troops government can built this unit
(2) "Fanatic_free": Fanatic_troops government can mantain these unit for free

i'm not a programmer anymore, but i tried anyway to make a patch. Strange enough, it did work. Here it is (based on beta7).

i cannot do that in the cvs because it breaks client compatibility, and i cannot compile cvs client since i do not have gtk 2.4. Anyway, it should be nice if it could be added :)

to say it all, it would be even nicer if instead of "free" / "not free", i could choose "pay normal mantainance" / "pay reduced mantainance", but i think i dunno how to write such a thing...

--- common/unittype copia.h Sun Jan 16 11:58:03 2005
+++ common/unittype.h Wed Sep 14 22:14:26 2005
@@ -107,6 +107,7 @@
F_ADD_TO_CITY, /* unit can add to city population */
F_FANATIC, /* Only Fundamentalist government can build
these units */
+ F_FANATIC_FREE, /* Freely mantained by Fund. gov's */
F_GAMELOSS, /* Losing this unit means losing the game */
F_UNIQUE, /* A player can only have one unit of this type */
F_UNBRIBABLE, /* Cannot be bribed */
--- common/unittype copia.c Sun Jan 16 11:58:03 2005
+++ common/unittype.c Wed Sep 14 22:13:46 2005
@@ -45,7 +45,7 @@
"AEGIS", "Fighter", "Marines", "Partial_Invis", "Settlers", "Diplomat",
"Trireme", "Nuclear", "Spy", "Transform", "Paratroopers",
"Airbase", "Cities", "IgTired", "Missile_Carrier", "No_Land_Attack",
- "AddToCity", "Fanatic", "GameLoss", "Unique", "Unbribable",
+ "AddToCity", "Fanatic", "Fanatic_free", "GameLoss", "Unique", "Unbribable",
"Undisbandable", "SuperSpy", "NoHome", "NoVeteran", "Bombarder",
"CityBuster", "NoBuild"
};
@@ -136,7 +136,7 @@
int utype_shield_cost(struct unit_type *ut, struct government *g)
{
if (government_has_flag(g, G_FANATIC_TROOPS) &&
- BV_ISSET(ut->flags, F_FANATIC)) {
+ BV_ISSET(ut->flags, F_FANATIC_FREE)) {
return 0;
}
return ut->shield_cost * g->unit_shield_cost_factor;

--
Lo'oris, tu sei il lano e modifichi astromondi
- Braindamage

Annusa Lo'oris su www.looris.webhop.net
[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13977) Patch: splitting "Fanatic" option, Lo'oris <=