Freeciv-3.3
Loading...
Searching...
No Matches
manual_units.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "fcintl.h"
20
21/* common */
22#include "game.h"
23#include "movement.h"
24
25/* client */
26#include "helpdata.h"
27
28/* tools/manual */
29#include "fc_manual.h"
30
31/**********************************************************************/
38{
39 FILE *doc;
40
42
43 if (doc == NULL) {
44 return FALSE;
45 }
46
47 /* Freeciv-web uses (parts of) the unit type HTML output in its own
48 * manual pages. */
49 /* FIXME: this doesn't resemble the wiki manual at all. */
50 /* TRANS: markup ... Freeciv version ... ruleset name ... markup */
51 fprintf(doc, _("%sFreeciv %s unit types help (%s)%s\n\n"),
53 tag_info->title_end);
55 char buf[64000];
56
57 fprintf(doc, tag_info->item_begin, "utype", putype->item_number);
58 fprintf(doc, "%s%s%s\n\n", tag_info->sect_title_begin,
59 utype_name_translation(putype), tag_info->sect_title_end);
60 fprintf(doc, tag_info->subitem_begin, "cost");
62 PL_("Cost: %d shield",
63 "Cost: %d shields",
66 fprintf(doc, "%s", tag_info->subitem_end);
67 fprintf(doc, tag_info->subitem_begin, "upkeep");
68 fprintf(doc, _("Upkeep: %s"),
70 fprintf(doc, "%s", tag_info->subitem_end);
71 fprintf(doc, tag_info->subitem_begin, "moves");
72 fprintf(doc, _("Moves: %s"),
73 move_points_text(putype->move_rate, TRUE));
74 fprintf(doc, "%s", tag_info->subitem_end);
75 fprintf(doc, tag_info->subitem_begin, "vision");
76 fprintf(doc, _("Vision: %d"),
77 (int)sqrt((double)putype->vision_radius_sq));
78 fprintf(doc, "%s", tag_info->subitem_end);
79 fprintf(doc, tag_info->subitem_begin, "attack");
80 fprintf(doc, _("Attack: %d"),
81 putype->attack_strength);
82 fprintf(doc, "%s", tag_info->subitem_end);
83 fprintf(doc, tag_info->subitem_begin, "defense");
84 fprintf(doc, _("Defense: %d"),
85 putype->defense_strength);
86 fprintf(doc, "%s", tag_info->subitem_end);
87 fprintf(doc, tag_info->subitem_begin, "firepower");
88 fprintf(doc, _("Firepower: %d"),
89 putype->firepower);
90 fprintf(doc, "%s", tag_info->subitem_end);
91 fprintf(doc, tag_info->subitem_begin, "hitpoints");
92 fprintf(doc, _("Hitpoints: %d"),
93 putype->hp);
94 fprintf(doc, "%s", tag_info->subitem_end);
95 fprintf(doc, tag_info->subitem_begin, "obsolete");
96 fprintf(doc, _("Obsolete by: %s"),
97 U_NOT_OBSOLETED == putype->obsoleted_by ?
98 Q_("?utype:None") :
99 utype_name_translation(putype->obsoleted_by));
100 fprintf(doc, "%s", tag_info->subitem_end);
101 fprintf(doc, tag_info->subitem_begin, "helptext");
102 helptext_unit(buf, sizeof(buf), NULL, "", putype, FALSE);
103 fprintf(doc, "%s", buf);
104 fprintf(doc, "%s", tag_info->subitem_end);
105 fprintf(doc, "%s", tag_info->item_end);
107
109
110 return TRUE;
111}
char * incite_cost
Definition comments.c:76
void manual_finalize(struct tag_types *tag_info, FILE *doc, enum manuals manual)
Definition fc_manual.c:320
FILE * manual_start(struct tag_types *tag_info, int manual_number)
Definition fc_manual.c:291
#define Q_(String)
Definition fcintl.h:70
#define PL_(String1, String2, n)
Definition fcintl.h:71
#define _(String)
Definition fcintl.h:67
struct civ_game game
Definition game.c:61
char * helptext_unit(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct unit_type *utype, bool class_help)
Definition helpdata.c:1932
char * helptext_unit_upkeep_str(const struct unit_type *utype)
Definition helpdata.c:4997
bool manual_units(struct tag_types *tag_info)
const char * move_points_text(int mp, bool reduce)
Definition movement.c:1016
struct packet_ruleset_control control
Definition game.h:83
char name[MAX_LEN_NAME]
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
int utype_build_shield_cost_base(const struct unit_type *punittype)
Definition unittype.c:1474
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1566
#define unit_type_iterate(_p)
Definition unittype.h:862
#define unit_type_iterate_end
Definition unittype.h:869
#define U_NOT_OBSOLETED
Definition unittype.h:535