Author: sveinung
Date: Wed Jul 29 12:57:39 2015
New Revision: 29264

URL: http://svn.gna.org/viewcvs/freeciv?rev=29264&view=rev
Log:
freeciv-manual: Minimal unit types support

See patch #6145

Modified:
    trunk/doc/man/freeciv-manual.6.in
    trunk/tools/civmanual.c

Modified: trunk/doc/man/freeciv-manual.6.in
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/doc/man/freeciv-manual.6.in?rev=29264&r1=29263&r2=29264&view=diff
==============================================================================
--- trunk/doc/man/freeciv-manual.6.in   (original)
+++ trunk/doc/man/freeciv-manual.6.in   Wed Jul 29 12:57:39 2015
@@ -23,7 +23,7 @@
 \fBfreeciv-manual\fR generates a subset of documentation for
 .IR freeciv-server(6)
 and the game rules of a selected ruleset that it runs. Currently it
-generates 6 files:
+generates 7 files:
 .TP
 .BI "manual1.html"
 Server options
@@ -48,6 +48,10 @@
 .BI "manual6.html"
 Governments
 
+.TP
+.BI "manual7.html"
+Unit types
+
 .SH BUGS
 This tool is currently only really of use to the Freeciv maintainers,
 as a starting point for pages on the main Freeciv wiki; it's not very

Modified: trunk/tools/civmanual.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/civmanual.c?rev=29264&r1=29263&r2=29264&view=diff
==============================================================================
--- trunk/tools/civmanual.c     (original)
+++ trunk/tools/civmanual.c     Wed Jul 29 12:57:39 2015
@@ -45,6 +45,7 @@
 #include "government.h"
 #include "improvement.h"
 #include "map.h"
+#include "movement.h"
 #include "player.h"
 #include "version.h"
 
@@ -76,6 +77,7 @@
   MANUAL_BUILDINGS,
   MANUAL_WONDERS,
   MANUAL_GOVS,
+  MANUAL_UNITS,
   MANUAL_COUNT
 };
 
@@ -481,6 +483,38 @@
         helptext_government(buf, sizeof(buf), NULL, NULL, pgov);
         fprintf(doc, "%s\n\n", buf);
       } governments_iterate_end;
+      break;
+
+    case MANUAL_UNITS:
+      /* FIXME: this doesn't resemble the wiki manual at all. */
+      fprintf(doc, _("<h1>Freeciv %s unit types help</h1>\n\n"),
+              VERSION_STRING);
+      unit_type_iterate(putype) {
+        char buf[64000];
+        fprintf(doc, "%s%s%s\n\n", SECTION_BEGIN,
+                utype_name_translation(putype), SECTION_END);
+        fprintf(doc,
+                PL_("Cost: %d shield\n",
+                    "Cost: %d shields\n",
+                    utype_build_shield_cost(putype)),
+                utype_build_shield_cost(putype));
+        fprintf(doc, _("Upkeep: %s\n"),
+                helptext_unit_upkeep_str(putype));
+        fprintf(doc, _("Moves: %s\n"),
+                move_points_text(putype->move_rate, TRUE));
+        fprintf(doc, _("Vision: %d\n"),
+                (int)sqrt((double)putype->vision_radius_sq));
+        fprintf(doc, _("Attack: %d\n"),
+                putype->attack_strength);
+        fprintf(doc, _("Defense: %d\n"),
+                putype->defense_strength);
+        fprintf(doc, _("Firepower: %d\n"),
+                putype->firepower);
+        fprintf(doc, _("Hitpoints: %d\n"),
+                putype->hp);
+        helptext_unit(buf, sizeof(buf), NULL, "", putype);
+        fprintf(doc, "%s\n\n", buf);
+      } unit_type_iterate_end;
       break;
 
     case MANUAL_COUNT:


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to