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

 This splits "Fighter" flag in two. "Fighter" is very good attacking
"Helicopter" units. "AttackAny" can attack even otherwise unreachable
units.
 Applies on top of #33762


 - ML

diff -Nurd -X.diff_ignore freeciv/client/helpdata.c freeciv/client/helpdata.c
--- freeciv/client/helpdata.c	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/client/helpdata.c	2007-01-20 03:26:20.000000000 +0200
@@ -918,7 +918,7 @@
   if (unit_type_flag(utype, F_UNBRIBABLE)) {
     sprintf(buf + strlen(buf), _("* May not be bribed.\n"));
   }
-  if (unit_type_flag(utype, F_FIGHTER)) {
+  if (unit_type_flag(utype, F_ATTACK_ANY)) {
     sprintf(buf + strlen(buf), _("* Can attack otherwise unreachable enemy units.\n"));
   }
   if (unit_type_flag(utype, F_PARTIAL_INVIS)) {
@@ -949,7 +949,11 @@
   }
   if (unit_type_flag(utype, F_HELICOPTER)) {
     sprintf(buf + strlen(buf),
-            _("* Defends very badly agains fighter type units.\n"));
+            _("* Counts as 'helicopter' against certain attackers.\n"));
+  }
+  if (unit_type_flag(utype, F_FIGHTER)) {
+    sprintf(buf + strlen(buf),
+            _("* Very good at attacking 'helicopter' units.\n"));
   }
   if (unit_type_flag(utype, F_AIRUNIT)) {
     sprintf(buf + strlen(buf),
diff -Nurd -X.diff_ignore freeciv/common/combat.c freeciv/common/combat.c
--- freeciv/common/combat.c	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/common/combat.c	2007-01-20 03:26:31.000000000 +0200
@@ -93,7 +93,7 @@
   }
 
   /* 2. Only fighters can attack planes, except in city or airbase attacks */
-  if (!unit_flag(punit, F_FIGHTER)
+  if (!unit_flag(punit, F_ATTACK_ANY)
       && unit_class_flag(get_unit_class(unit_type(pdefender)), UCF_UNREACHABLE)
       && !(pcity || tile_has_special(dest_tile, S_AIRBASE))) {
     return FALSE;
diff -Nurd -X.diff_ignore freeciv/common/unittype.c freeciv/common/unittype.c
--- freeciv/common/unittype.c	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/common/unittype.c	2007-01-20 03:15:27.000000000 +0200
@@ -46,13 +46,13 @@
 static const char *flag_names[] = {
   "TradeRoute" ,"HelpWonder", "IgZOC", "NonMil", "IgTer", 
   "OneAttack", "Pikemen", "Horse", "IgWall", "FieldUnit", 
-  "AEGIS", "Fighter", "Marines", "Partial_Invis", "Settlers", "Diplomat",
+  "AEGIS", "AttackAny", "Marines", "Partial_Invis", "Settlers", "Diplomat",
   "Trireme", "Nuclear", "Spy", "Transform", "Paratroopers",
   "Airbase", "Cities", "No_Land_Attack",
   "AddToCity", "Fanatic", "GameLoss", "Unique", "Unbribable", 
   "Undisbandable", "SuperSpy", "NoHome", "NoVeteran", "Bombarder",
   "CityBuster", "NoBuild", "BadWallAttacker", "BadCityDefender",
-  "Helicopter", "AirUnit"
+  "Helicopter", "AirUnit", "Fighter"
 };
 static const char *role_names[] = {
   "FirstBuild", "Explorer", "Hut", "HutTech", "Partisan",
diff -Nurd -X.diff_ignore freeciv/common/unittype.h freeciv/common/unittype.h
--- freeciv/common/unittype.h	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/common/unittype.h	2007-01-20 03:26:42.000000000 +0200
@@ -68,7 +68,7 @@
   F_IGWALL,      
   F_FIELDUNIT,   
   F_AEGIS,       
-  F_FIGHTER,     
+  F_ATTACK_ANY,       /* Can attack even unreachable units */
   F_MARINES,     
   F_PARTIAL_INVIS,    /* Invisibile except when adjacent (Submarine) */   
   F_SETTLERS,         /* Does not include ability to found cities */
@@ -98,6 +98,7 @@
   F_BADCITYDEFENDER,  /* Firepower set to 1 and attackers x2 when in city */
   F_HELICOPTER,       /* Defends badly against F_FIGHTER units */
   F_AIRUNIT,          /* Bad at attacking F_AEGIS units */
+  F_FIGHTER,          /* Good at attacking F_HELICOPTER units */
   F_LAST
 };
 #define F_MAX 64
diff -Nurd -X.diff_ignore freeciv/data/civ1/units.ruleset freeciv/data/civ1/units.ruleset
--- freeciv/data/civ1/units.ruleset	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/data/civ1/units.ruleset	2007-01-20 03:16:58.000000000 +0200
@@ -65,7 +65,7 @@
 ; "Missile"       = Unit is destroyed when it attacks
 ; "RoadNative"    = Road tiles are always considered native terrain
 ; "BuildAnywhere" = Unit can be built even in the middle of non-native terrain
-; "Unreachable"   = Unit can be attacked only by units with "Fighter" flag or on
+; "Unreachable"   = Unit can be attacked only by units with "AttackAny" flag or on
 ;                   city or airbase
 
 [unitclass_land]
@@ -597,7 +597,7 @@
 uk_shield     = 1
 uk_food       = 0
 uk_gold       = 0
-flags         = "FieldUnit", "Fighter", "AirUnit"
+flags         = "FieldUnit", "Fighter", "AirUnit", "AttackAny"
 roles         = ""
 
 [unit_bomber]
diff -Nurd -X.diff_ignore freeciv/data/civ2/units.ruleset freeciv/data/civ2/units.ruleset
--- freeciv/data/civ2/units.ruleset	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/data/civ2/units.ruleset	2007-01-20 03:17:24.000000000 +0200
@@ -65,7 +65,7 @@
 ; "Missile"       = Unit is destroyed when it attacks
 ; "RoadNative"    = Road tiles are always considered native terrain
 ; "BuildAnywhere" = Unit can be built even in the middle of non-native terrain
-; "Unreachable"   = Unit can be attacked only by units with "Fighter" flag or on
+; "Unreachable"   = Unit can be attacked only by units with "AttackAny" flag or on
 ;                   city or airbase
 
 [unitclass_missile]
@@ -995,7 +995,7 @@
 uk_shield     = 1
 uk_food       = 0
 uk_gold       = 0
-flags         = "Fighter", "AirUnit"
+flags         = "Fighter", "AirUnit", "AttackAny"
 roles         = ""
 
 [unit_bomber]
@@ -1085,7 +1085,7 @@
 uk_shield     = 1
 uk_food       = 0
 uk_gold       = 0
-flags         = "Fighter", "AirUnit"
+flags         = "Fighter", "AirUnit", "AttackAny"
 roles         = ""
 helptext      = _("\
 An improved Fighter, with improved attack and a higher movement\
diff -Nurd -X.diff_ignore freeciv/data/default/units.ruleset freeciv/data/default/units.ruleset
--- freeciv/data/default/units.ruleset	2007-01-20 03:31:57.000000000 +0200
+++ freeciv/data/default/units.ruleset	2007-01-20 03:15:00.000000000 +0200
@@ -71,7 +71,7 @@
 ; "Missile"       = Unit is destroyed when it attacks
 ; "RoadNative"    = Road tiles are always considered native terrain
 ; "BuildAnywhere" = Unit can be built even in the middle of non-native terrain
-; "Unreachable"   = Unit can be attacked only by units with "Fighter" flag or on
+; "Unreachable"   = Unit can be attacked only by units with "AttackAny" flag or on
 ;                   city or airbase
 
 [unitclass_missile]
@@ -166,7 +166,7 @@
 ; "IgWall"	= ignore effect of city walls
 ; "FieldUnit"	= cause unhappiness even when not being aggressive
 ; "AEGIS"	= fivefold increased defence against "AirUnit" attacks
-; "Fighter"	= can attack unreachable units
+; "AttackAny"   = can attack unreachable units
 ; "Marines"	= (land only) can attack from transports
 ; "Partial_Invis" = visible only to adjancent units; does not hide transported
 ;		  units other than missiles
@@ -214,6 +214,7 @@
 ;                 rule)
 ; "Helicopter"  = defends very badly against "Fighter" units
 ; "AirUnit"     = very bad at attacking "AEGIS" units
+; "Fighter"     = good attacker against "Helicopter" units
 ;
 ; Following flag strings require extra fields:
 ;  "Paratroopers"
@@ -1050,7 +1051,7 @@
 uk_shield     = 1
 uk_food       = 0
 uk_gold       = 0
-flags         = "Fighter", "AirUnit"
+flags         = "AttackAny", "AirUnit", "Fighter"
 roles         = ""
 
 [unit_bomber]
@@ -1140,7 +1141,7 @@
 uk_shield     = 1
 uk_food       = 0
 uk_gold       = 0
-flags         = "Partial_Invis", "Fighter", "AirUnit"
+flags         = "Partial_Invis", "AttackAny", "AirUnit", "Fighter"
 roles         = ""
 helptext      = _("\
 An improved Fighter, with improved attack and a higher movement\
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to