Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] Re: (PR#18507) [Patch] Help about unit class flags
Home

[Freeciv-Dev] Re: (PR#18507) [Patch] Help about unit class flags

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#18507) [Patch] Help about unit class flags
From: "Marko Lindqvist" <cazfi74@xxxxxxxxx>
Date: Wed, 12 Jul 2006 06:06:06 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Marko Lindqvist wrote:
> 
>   Display help about unit class flags unit has.

  - Take advantage of translated unit class names provided by #18536



  - ML

diff -Nurd -X.diff_ignore freeciv/client/helpdata.c freeciv/client/helpdata.c
--- freeciv/client/helpdata.c   2006-07-12 15:31:43.000000000 +0300
+++ freeciv/client/helpdata.c   2006-07-12 16:00:48.859375000 +0300
@@ -752,6 +752,24 @@
   }
   
   buf[0] = '\0';
+
+  sprintf(buf + strlen(buf), _("* Belongs to %s units class.\n"),
+          get_unit_class(utype)->name);
+  if (unit_class_flag(get_unit_class(utype), UCF_CAN_OCCUPY)
+      && !unit_type_flag(utype, F_NONMIL)) {
+    sprintf(buf + strlen(buf), _("  * Can occupy empty enemy cities.\n"));
+  }
+  if (!unit_class_flag(get_unit_class(utype), UCF_TERRAIN_SPEED)) {
+    sprintf(buf + strlen(buf), _("  * Speed is not affected by terrain.\n"));
+  }
+  if (unit_class_flag(get_unit_class(utype), UCF_DAMAGE_SLOWS)) {
+    sprintf(buf + strlen(buf), _("  * Slowed down while damaged\n"));
+  }
+  if (unit_class_flag(get_unit_class(utype), UCF_MISSILE)) {
+    sprintf(buf + strlen(buf),
+           _("  * Gets used up in making an attack.\n"));
+  }
+
   if (utype->gov_requirement) {
     sprintf(buf + strlen(buf),
            _("* Can only be built with %s as government.\n"), 
@@ -925,10 +943,8 @@
     sprintf(buf + strlen(buf),
            _("* Counts as 'mounted' against certain defenders.\n"));
   }
-  if (unit_class_flag(get_unit_class(utype), UCF_MISSILE)) {
-    sprintf(buf + strlen(buf),
-           _("* A missile unit: gets used up in making an attack.\n"));
-  } else if(unit_type_flag(utype, F_ONEATTACK)) {
+  if (!unit_class_flag(get_unit_class(utype), UCF_MISSILE)
+      && unit_type_flag(utype, F_ONEATTACK)) {
     sprintf(buf + strlen(buf),
            _("* Making an attack ends this unit's turn.\n"));
   }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#18507) [Patch] Help about unit class flags, Marko Lindqvist <=