60#define CATLSTR(_b, _s, _t) fc_strlcat(_b, _t, _s)
64 "(Any)",
"(Text)",
"Units",
"Improvements",
"Wonders",
65 "Techs",
"Terrain",
"Extras",
"Goods",
"Specialists",
"Governments",
66 "Ruleset",
"Tileset",
"Nations",
"Multipliers", NULL
69#define SPECLIST_TAG help
70#define SPECLIST_TYPE struct help_item
73#define help_list_iterate(helplist, phelp) \
74 TYPED_LIST_ITERATE(struct help_item, helplist, phelp)
75#define help_list_iterate_end LIST_ITERATE_END
143 const char *intro,
const char *nolevels)
153 if (veteran->
levels == 1) {
156 CATLSTR(outbuf, outlen, nolevels);
165 CATLSTR(outbuf, outlen, intro);
166 CATLSTR(outbuf, outlen,
"\n\n");
173 _(
"Veteran level Power factor Move bonus\n"));
176 _(
"--------------------------------------------"));
177 for (i = 0; i < veteran->
levels; i++) {
186 "\n%s%*s %4d%% %12s",
206 if (0 == strcmp(
name,
"TerrainAlterations")) {
207 int clean_pollution_time = -1, clean_fallout_time = -1, pillage_time = -1;
208 bool terrain_independent_extras =
FALSE;
218 bool can_transform_water2land =
220 bool can_transform_land2water =
223 int num_land_tiles_needed =
226 int num_water_tiles_needed =
230 if (can_transform_water2land && num_land_tiles_needed > 0) {
232 PL_(
"To transform a water tile to a land tile, the water tile "
233 "must have %d adjacent land tile.\n",
234 "To transform a water tile to a land tile, the water tile "
235 "must have %d adjacent land tiles.\n",
236 num_land_tiles_needed),
237 num_land_tiles_needed);
239 if (can_transform_land2water && num_water_tiles_needed > 0) {
241 PL_(
"To transform a land tile to a water tile, the land tile "
242 "must have %d adjacent water tile.\n",
243 "To transform a land tile to a water tile, the land tile "
244 "must have %d adjacent water tiles.\n",
245 num_water_tiles_needed),
246 num_water_tiles_needed);
253 _(
"Terrain Cultivate Plant Transform\n"));
255 "----------------------------------------------------------------\n");
258 char cultivation_time[4], plant_time[4], transform_time[4];
259 const char *
terrain, *cultivate_result,
260 *plant_result,*transform_result;
261 struct universal for_terr = { .
kind = VUT_TERRAIN, .value = { .terrain = pterrain }};
262 int cslen, pslen, tslen;
264 fc_snprintf(cultivation_time,
sizeof(cultivation_time),
265 "%d", pterrain->cultivate_time);
267 "%d", pterrain->plant_time);
268 fc_snprintf(transform_time,
sizeof(transform_time),
269 "%d", pterrain->transform_time);
272 (pterrain->cultivate_result ==
T_NONE
277 (pterrain->plant_result ==
T_NONE
282 (pterrain->transform_result == pterrain
283 || pterrain->transform_result ==
T_NONE
285 NULL, &for_terr)) ?
""
290 if (strcmp(transform_result,
"") != 0
291 && pterrain->transform_result !=
T_NONE) {
292 enum terrain_class ter_class =
294 enum terrain_class trans_ter_class =
296 if (!can_transform_water2land
297 && ter_class == TC_OCEAN && trans_ter_class == TC_LAND) {
298 transform_result =
"";
300 if (!can_transform_land2water
301 && ter_class == TC_LAND && trans_ter_class == TC_OCEAN) {
302 transform_result =
"";
312 "%s%*s %3s %s%*s %3s %s%*s %3s %s\n",
315 (pterrain->cultivate_result ==
T_NONE) ?
"-" : cultivation_time,
318 (pterrain->plant_result ==
T_NONE) ?
"-" : plant_time,
321 (!strcmp(transform_result,
"")) ?
"-" : transform_time,
324 if (clean_pollution_time != 0 && pterrain->clean_pollution_time != 0) {
325 if (clean_pollution_time < 0) {
326 clean_pollution_time = pterrain->clean_pollution_time;
328 if (clean_pollution_time != pterrain->clean_pollution_time) {
329 clean_pollution_time = 0;
333 if (clean_fallout_time != 0 && pterrain->clean_fallout_time != 0) {
334 if (clean_fallout_time < 0) {
335 clean_fallout_time = pterrain->clean_fallout_time;
337 if (clean_fallout_time != pterrain->clean_fallout_time) {
338 clean_fallout_time = 0;
342 if (pillage_time != 0 && pterrain->pillage_time != 0) {
343 if (pillage_time < 0) {
344 pillage_time = pterrain->pillage_time;
346 if (pillage_time != pterrain->pillage_time) {
359 int time = -1, factor = -1;
362 if (pextra->removal_time == 0) {
364 factor = pextra->removal_time_factor;
365 }
else if (factor != pextra->removal_time_factor) {
370 time = pextra->removal_time;
371 }
else if (time != pextra->removal_time) {
379 clean_pollution_time = time;
381 clean_pollution_time = 0;
383 }
else if (clean_pollution_time != 0) {
386 if (time > 0 && factor > 0 && time != clean_pollution_time * factor) {
387 clean_pollution_time = 0;
388 }
else if (time >= 0) {
389 clean_pollution_time = time;
390 }
else if (factor >= 0) {
391 clean_pollution_time = clean_pollution_time * factor;
399 int time = -1, factor = -1;
402 if (pextra->removal_time == 0) {
404 factor = pextra->removal_time_factor;
405 }
else if (factor != pextra->removal_time_factor) {
410 time = pextra->removal_time;
411 }
else if (time != pextra->removal_time) {
419 clean_fallout_time = time;
421 clean_fallout_time = 0;
423 }
else if (clean_fallout_time != 0) {
426 if (time > 0 && factor > 0 && time != clean_fallout_time * factor) {
427 clean_fallout_time = 0;
428 }
else if (time >= 0) {
429 clean_fallout_time = time;
430 }
else if (factor >= 0) {
431 clean_fallout_time = clean_fallout_time * factor;
439 int time = -1, factor = -1;
442 if (pextra->removal_time == 0) {
444 factor = pextra->removal_time_factor;
445 }
else if (factor != pextra->removal_time_factor) {
450 time = pextra->removal_time;
451 }
else if (time != pextra->removal_time) {
463 }
else if (pillage_time != 0) {
466 if (time > 0 && factor > 0 && time != pillage_time * factor) {
468 }
else if (time >= 0) {
470 }
else if (factor >= 0) {
471 pillage_time = pillage_time * factor;
482 if (pextra->buildable && pextra->build_time > 0) {
483 terrain_independent_extras =
TRUE;
487 if (!terrain_independent_extras) {
489 if (pextra->buildable && pextra->build_time > 0) {
490 terrain_independent_extras =
TRUE;
496 if (clean_pollution_time > 0 || clean_fallout_time > 0 || pillage_time > 0
497 || terrain_independent_extras) {
500 _(
"Time taken for the following activities is independent of "
506 _(
"Activity Time\n"));
508 "---------------------------");
509 if (clean_pollution_time > 0)
511 _(
"\nClean pollution %3d"), clean_pollution_time);
512 if (clean_fallout_time > 0)
514 _(
"\nClean fallout %3d"), clean_fallout_time);
515 if (pillage_time > 0)
517 _(
"\nPillage %3d"), pillage_time);
519 if (pextra->buildable && pextra->build_time > 0) {
531 if (pextra->buildable && pextra->build_time > 0) {
544 }
else if (0 == strcmp(
name,
"VeteranLevels")) {
546 _(
"In this ruleset, the following veteran levels are defined:"),
547 _(
"This ruleset has no default veteran levels defined."));
548 }
else if (0 == strcmp(
name,
"FreecivVersion")) {
559 }
else if (0 == strcmp(
name,
"DefaultMetaserver")) {
576 struct requirement_vector *psubjreqs,
578 const char *
const *strs,
579 char *buf,
size_t bufsz,
662 char *buf,
size_t bufsz,
const char *prefix)
667 static const char *
const govstrs[] = {
669 N_(
"?gov:Allows %s (with %s but no %s)."),
671 N_(
"?gov:Allows %s (with %s)."),
673 N_(
"?gov:Allows %s (absent %s)."),
675 N_(
"?gov:Allows %s."),
677 N_(
"?gov:Prevents %s.")
686 static const char *
const imprstrs[] = {
688 N_(
"?improvement:Allows %s (with %s but no %s)."),
690 N_(
"?improvement:Allows %s (with %s)."),
692 N_(
"?improvement:Allows %s (absent %s)."),
694 N_(
"?improvement:Allows %s."),
696 N_(
"?improvement:Prevents %s.")
705 static const char *
const utstrs[] = {
707 N_(
"?unittype:Allows %s (with %s but no %s)."),
709 N_(
"?unittype:Allows %s (with %s)."),
711 N_(
"?unittype:Allows %s (absent %s)."),
713 N_(
"?unittype:Allows %s."),
715 N_(
"?unittype:Prevents %s.")
723 static const char *
const estrs[] = {
725 N_(
"?extra:Allows %s (with %s but no %s)."),
727 N_(
"?extra:Allows %s (with %s)."),
729 N_(
"?extra:Allows %s (absent %s)."),
731 N_(
"?extra:Allows %s."),
733 N_(
"?extra:Prevents %s.")
741 static const char *
const gstrs[] = {
743 N_(
"?good:Allows %s (with %s but no %s)."),
745 N_(
"?good:Allows %s (with %s)."),
747 N_(
"?good:Allows %s (absent %s)."),
749 N_(
"?good:Allows %s."),
751 N_(
"?good:Prevents %s.")
784 for (ta = ha->
topic, tb = hb->
topic; *ta !=
'\0' && *tb !=
'\0'; ta++, tb++) {
786 if (*tb ==
' ')
return -1;
788 }
else if (*tb !=
' ') {
789 if (*ta ==
' ')
return 1;
801 static bool booted =
FALSE;
804 const char *filename;
807 struct section_list *sec;
810 char long_buffer[64000];
833 log_error(
"failed reading help-texts from '%s':\n%s", filename,
848 int level = strspn(gen_str,
" ");
859 log_error(
"bad help-generate category \"%s\"", gen_str);
870 "%s.categories", sec_name);
881 struct help_list *category_nodes = help_list_new();
883 switch (current_type) {
891 help_list_append(category_nodes, pitem);
902 help_list_append(category_nodes, pitem);
914 help_list_append(category_nodes, pitem);
923 "%s.categories", sec_name);
927 bool include =
FALSE;
928 const char *cat = extra_category_name(pextra->category);
931 for (ci = 0; ci < ncats; ci++) {
946 help_list_append(category_nodes, pitem);
958 help_list_append(category_nodes, pitem);
970 help_list_append(category_nodes, pitem);
980 help_list_append(category_nodes, pitem);
991 help_list_append(category_nodes, pitem);
1003 help_list_append(category_nodes, pitem);
1046 const char *nodesc =
_(
"Current ruleset contains no summary.");
1092 if (description != NULL) {
1093 desc_len = strlen(
"\n\n") + strlen(description);
1097 if (summary != NULL) {
1098 if (version[0] !=
'\0') {
1099 len = strlen(
_(ts_name))
1103 + strlen(
_(summary))
1108 _(ts_name), version,
_(summary));
1110 len = strlen(
_(ts_name))
1112 + strlen(
_(summary))
1117 _(ts_name),
_(summary));
1120 const char *nodesc =
_(
"Current tileset contains no summary.");
1122 if (version[0] !=
'\0') {
1123 len = strlen(
_(ts_name))
1132 _(ts_name), version,
1135 len = strlen(
_(ts_name))
1146 if (description != NULL) {
1162 help_list_append(category_nodes, pitem);
1168 help_text_buffer[0] =
'\0';
1173 if (pmul->helptext) {
1174 const char *sep =
"";
1176 cat_snprintf(help_text_buffer,
sizeof(help_text_buffer),
1186 log_error(
"Bad current_type: %d.", current_type);
1193 help_list_destroy(category_nodes);
1206 long_buffer[0] =
'\0';
1207 for (i = 0; i < npara; i++) {
1209 const char *para = paras[i];
1211 if (strncmp(para,
"$", 1) == 0) {
1218 if (inserted && i != npara - 1) {
1228 section_list_destroy(sec);
1264 if (pos < 0 || pos >
size) {
1286 static char vtopic[128];
1287 static char vtext[256];
1292 char *p = ptmp->topic;
1297 if (strcmp(
name, p) == 0 && (htype ==
HELP_ANY || htype == ptmp->type)) {
1307 vitem.
topic = vtopic;
1312 _(
"Sorry, no help topic for %s.\n"), vitem.
topic);
1316 _(
"Sorry, no help topic for %s.\n"
1317 "This page was auto-generated.\n\n"),
1375 const char *user_text,
const struct impr_type *pimprove)
1379 .
kind = VUT_IMPROVEMENT,
1380 .value = {.building = pimprove}
1386 if (NULL == pimprove) {
1407 if (VUT_ADVANCE == pobs->source.kind
1408 && pobs->present && !pobs->quiet) {
1410 _(
"* The discovery of %s will make %s obsolete.\n"),
1414 if (VUT_IMPROVEMENT == pobs->source.kind
1415 && pobs->present && !pobs->quiet) {
1418 _(
"* The presence of %s in the city will make %s "
1427 _(
"* A 'small wonder': at most one of your cities may "
1428 "possess this improvement.\n"));
1459 _(
"* Allows all players with knowledge of %s "
1460 "to build %s units.\n"),
1466 _(
"* Allows all players to build %s units.\n"),
1479 bool demanded =
FALSE;
1480 enum req_range max_range = REQ_RANGE_LOCAL;
1505 if (!preq->present) {
1511 if (preq->range > max_range) {
1513 max_range = preq->range;
1523 switch (max_range) {
1524 case REQ_RANGE_LOCAL:
1529 _(
"* Makes it possible to target the city building it "
1530 "with the action \'%s\'.\n"),
1533 case REQ_RANGE_CITY:
1538 _(
"* Makes it possible to target its city with the "
1539 "action \'%s\'.\n"),
1542 case REQ_RANGE_TRADE_ROUTE:
1547 _(
"* Makes it possible to target its city and its "
1548 "trade partners with the action \'%s\'.\n"),
1551 case REQ_RANGE_CONTINENT:
1556 _(
"* Makes it possible to target all cities with its "
1557 "owner on its continent with the action \'%s\'.\n"),
1560 case REQ_RANGE_PLAYER:
1565 _(
"* Makes it possible to target all cities with its "
1566 "owner with the action \'%s\'.\n"),
1569 case REQ_RANGE_TEAM:
1574 _(
"* Makes it possible to target all cities on the "
1575 "same team with the action \'%s\'.\n"),
1578 case REQ_RANGE_ALLIANCE:
1583 _(
"* Makes it possible to target all cities owned by "
1584 "or allied to its owner with the action \'%s\'.\n"),
1587 case REQ_RANGE_WORLD:
1592 _(
"* Makes it possible to target all cities with the "
1593 "action \'%s\'.\n"),
1596 case REQ_RANGE_CADJACENT:
1597 case REQ_RANGE_ADJACENT:
1598 case REQ_RANGE_COUNT:
1599 log_error(
"The range %s is invalid for buildings.",
1600 req_range_name(max_range));
1610 bool vulnerable =
FALSE;
1611 enum req_range min_range = REQ_RANGE_COUNT;
1631 &(enabler->target_reqs))) {
1635 enum req_range vector_max_range = REQ_RANGE_LOCAL;
1643 if (preq->present) {
1648 if (preq->range > vector_max_range) {
1650 vector_max_range = preq->range;
1654 if (vector_max_range < min_range) {
1656 min_range = vector_max_range;
1662 switch (min_range) {
1663 case REQ_RANGE_LOCAL:
1666 _(
"* Makes it impossible to do the action \'%s\' to "
1667 "the city building it.\n"),
1670 case REQ_RANGE_CITY:
1673 _(
"* Makes it impossible to do the action \'%s\' to "
1677 case REQ_RANGE_TRADE_ROUTE:
1680 _(
"* Makes it impossible to do the action \'%s\' to "
1681 "its city or to its city's trade partners.\n"),
1684 case REQ_RANGE_CONTINENT:
1687 _(
"* Makes it impossible to do the action \'%s\' to "
1688 "any city with its owner on its continent.\n"),
1691 case REQ_RANGE_PLAYER:
1694 _(
"* Makes it impossible to do the action \'%s\' to "
1695 "any city with its owner.\n"),
1698 case REQ_RANGE_TEAM:
1701 _(
"* Makes it impossible to do the action \'%s\' to "
1702 "any city on the same team.\n"),
1705 case REQ_RANGE_ALLIANCE:
1708 _(
"* Makes it impossible to do the action \'%s\' to "
1709 "any city allied to or owned by its owner.\n"),
1712 case REQ_RANGE_WORLD:
1715 _(
"* Makes it impossible to do the action \'%s\' to "
1716 "any city in the game.\n"),
1719 case REQ_RANGE_CADJACENT:
1720 case REQ_RANGE_ADJACENT:
1721 case REQ_RANGE_COUNT:
1722 log_error(
"The range %s is invalid for buildings.",
1723 req_range_name(min_range));
1738 _(
"* All players start with this improvement in their "
1761 _(
"* The %s start with this improvement in their "
1771 _(
"* If you lose the city containing this improvement, "
1772 "it will be rebuilt for free in another of your cities "
1773 "(if the 'savepalace' server setting is enabled).\n"));
1776 if (user_text && user_text[0] !=
'\0') {
1824 const char *user_text,
const struct unit_type *utype)
1826 bool has_vet_levels;
1845 _(
"* Belongs to %s unit class."),
1856 CATLSTR(buf,
bufsz,
_(
" * Speed is not affected by terrain.\n"));
1860 CATLSTR(buf,
bufsz,
_(
" * Does not get defense bonuses from terrain.\n"));
1864 CATLSTR(buf,
bufsz,
_(
" * Not subject to zones of control.\n"));
1867 CATLSTR(buf,
bufsz,
_(
" * Subject to zones of control.\n"));
1875 { .
kind = VUT_UTYPE, .value = { .utype = utype }},
1876 { .kind = VUT_CITYTILE, .value = { .citytile = CITYT_CENTER }},
1879 EFT_FORTIFY_DEFENSE_BONUS,
1880 unit_is_in_city,
ARRAY_SIZE(unit_is_in_city));
1886 _(
" * Gets a %d%% defensive bonus while in cities.\n"),
1893 _(
" * Is unreachable. Most units cannot attack this one.\n"));
1897 _(
" * Doesn't prevent enemy units from attacking other "
1898 "units on its tile.\n"));
1905 _(
" * Doesn't prevent enemy cities from working the tile it's on.\n"));
1910 _(
" * Can attack units on non-native tiles.\n"));
1916 if (helptxt != NULL) {
1932 if (cbonus->quiet) {
1947 switch (cbonus->type) {
1948 case CBONUS_DEFENSE_MULTIPLIER:
1951 _(
"* %d%% defense bonus if attacked by %s.\n"),
1952 cbonus->value * 100,
1955 case CBONUS_DEFENSE_DIVIDER:
1958 _(
"* Reduces target's defense to 1 / %d when "
1963 case CBONUS_LOW_FIREPOWER:
1966 _(
"* Reduces target's firepower to 1 when "
1970 case CBONUS_DEFENSE_MULTIPLIER_PCT:
1973 _(
"* %d%% defense bonus if attacked by %s.\n"),
1977 case CBONUS_DEFENSE_DIVIDER_PCT:
1980 _(
"* Reduces target's defense to 1 / %.2f when "
1982 ((
float) cbonus->value + 100.0f) / 100.0f,
1985 case CBONUS_SCRAMBLES_PCT:
1988 _(
"* %d%% defense bonus "
1989 "instead of any bonuses from city improvements "
1990 "if attacked by %s in a city.\n"),
2007 CATLSTR(buf,
bufsz,
_(
"* Can escape once stack defender is lost.\n"));
2010 CATLSTR(buf,
bufsz,
_(
"* Can pursue escaping units and kill them.\n"));
2017 CATLSTR(buf,
bufsz,
_(
"* Only barbarians may build this.\n"));
2020 CATLSTR(buf,
bufsz,
_(
"* Can only be built in games where new cities "
2024 CATLSTR(buf,
bufsz,
_(
" - New cities are not allowed in the current "
2028 CATLSTR(buf,
bufsz,
_(
" - New cities are allowed in the current "
2040 if (!pnation->init_units[i]) {
2042 }
else if (pnation->init_units[i] == utype) {
2049 PL_(
"* The %s start the game with %d of these units.\n",
2050 "* The %s start the game with %d of these units.\n",
2060 if (utype2->converted_to == utype
2071 _(
"* May be obtained by conversion of %s.\n"),
2084 CATLSTR(buf,
bufsz,
_(
"* Losing this unit will lose you the game!\n"));
2088 _(
"* Each player may only have one of this type of unit.\n"));
2094 if (helptxt != NULL) {
2104 PL_(
"* Costs %d population to build.\n",
2105 "* Costs %d population to build.\n", utype->
pop_cost),
2122 PL_(
"* Can carry and refuel %d %s unit.\n",
2123 "* Can carry and refuel up to %d %s units.\n",
2129 bool has_restricted_load =
FALSE, has_unrestricted_load =
FALSE,
2130 has_restricted_unload =
FALSE, has_unrestricted_unload =
FALSE;
2134 has_unrestricted_load =
TRUE;
2136 has_restricted_load =
TRUE;
2139 has_unrestricted_unload =
TRUE;
2141 has_restricted_unload =
TRUE;
2145 if (has_restricted_load) {
2146 if (has_unrestricted_load) {
2151 _(
" * Some cargo cannot be loaded except in a city or a "
2152 "base native to this transport.\n"));
2157 _(
" * Cargo cannot be loaded except in a city or a "
2158 "base native to this transport.\n"));
2161 if (has_restricted_unload) {
2162 if (has_unrestricted_unload) {
2166 _(
" * Some cargo cannot be unloaded except in a city or a "
2167 "base native to this transport.\n"));
2172 _(
" * Cargo cannot be unloaded except in a city or a "
2173 "base native to this transport.\n"));
2179 CATLSTR(buf,
bufsz,
_(
"* Must stay next to safe coast.\n"));
2184 bv_unit_classes embarks, disembarks;
2196 if (!
BV_ISSET(embarks, trans_class)
2203 BV_SET(embarks, trans_class);
2207 if (!
BV_ISSET(disembarks, trans_class)
2214 BV_SET(disembarks, trans_class);
2237 _(
"* May load onto and unload from %s transports even "
2238 "when underway.\n"),
2244 _(
"* May load onto %s transports even when underway.\n"),
2264 _(
"* May unload from %s transports even when underway.\n"),
2271 CATLSTR(buf,
bufsz,
_(
"* Strong in diplomatic battles.\n"));
2275 CATLSTR(buf,
bufsz,
_(
"* Defends cities against diplomatic actions.\n"));
2278 CATLSTR(buf,
bufsz,
_(
"* Will never lose a diplomat-versus-diplomat fight.\n"));
2282 CATLSTR(buf,
bufsz,
_(
"* Will always survive a spy mission.\n"));
2284 if (utype->
vlayer == V_INVIS) {
2286 _(
"* Is invisible except when next to an enemy unit or city.\n"));
2290 _(
"* Can only attack units on native tiles.\n"));
2294 _(
"* Gets double firepower when attacking cities.\n"));
2300 _(
"* Ignores terrain effects (moving costs at most %s MP "
2305 CATLSTR(buf,
bufsz,
_(
"* Never imposes a zone of control.\n"));
2307 CATLSTR(buf,
bufsz,
_(
"* May impose a zone of control on its adjacent "
2311 CATLSTR(buf,
bufsz,
_(
"* Not subject to zones of control imposed "
2312 "by other units.\n"));
2316 _(
"* A non-military unit:\n"));
2319 _(
" * Cannot attack.\n"));
2322 _(
" * Doesn't impose martial law.\n"));
2325 _(
" * Can enter foreign territory regardless of peace treaty.\n"));
2328 _(
" * Doesn't prevent enemy cities from working the tile it's on.\n"));
2332 _(
"* A field unit: one unhappiness applies even when non-aggressive.\n"));
2338 _(
"* An enemy unit considering to auto attack this unit will "
2339 "choose to do so even if it has better odds when defending "
2340 "against it than when attacking it.\n"));
2347 _(
"* Under certain conditions the shield upkeep of this unit can "
2348 "be converted to gold upkeep.\n"));
2355 _(
"* Can attack against %s units, which are usually not "
2376 _(
"* Unit has to end each turn next to safe coast or"
2377 " in a city or a base.\n"));
2383 PL_(
"* Unit has to be next to safe coast, in a city or a base"
2384 " after %d turn.\n",
2385 "* Unit has to be next to safe coast, in a city or a base"
2386 " after %d turns.\n",
2392 PL_(
"* Unit has to be in a city or a base"
2393 " after %d turn.\n",
2394 "* Unit has to be in a city or a base"
2395 " after %d turns.\n",
2405 PL_(
"* Unit has to be next to safe coast, in a city, a base, or on a %s"
2406 " after %d turn.\n",
2407 "* Unit has to be next to safe coast, in a city, a base, or on a %s"
2408 " after %d turns.\n",
2414 PL_(
"* Unit has to be in a city, a base, or on a %s"
2415 " after %d turn.\n",
2416 "* Unit has to be in a city, a base, or on a %s"
2417 " after %d turns.\n",
2428 bool not_an_auto_attacker =
TRUE;
2431 if (auto_action->cause != AAPC_UNIT_MOVED_ADJ) {
2438 not_an_auto_attacker =
FALSE;
2443 if (not_an_auto_attacker) {
2445 _(
"* Will never be forced (by the autoattack server setting)"
2446 " to attack units moving to an adjacent tile.\n"));
2459 const char *target_adjective;
2460 char sub_target_text[100];
2467 _(
"* Can do the action \'%s\'.\n"),
2476 DRO_FOREIGN,
TRUE)) {
2478 target_adjective =
_(
"domestic ");
2480 DRO_FOREIGN,
FALSE)) {
2482 target_adjective =
_(
"foreign ");
2485 target_adjective =
"";
2488 sub_target_text[0] =
'\0';
2495 _(
"extras among "));
2500 _(action_sub_target_kind_name(
2510 _(
" * is done to %s%s%s.\n"),
2520 _(
" * uses up the %s.\n"),
2528 _(
" * can lead to a %s against a defender.\n"),
2529 action_battle_kind_translated_name(
2535 { .
kind = VUT_ACTION, .value.action = paction },
2536 { .kind = VUT_UTYPE, .value.utype = utype },
2547 _(
" * may fail because of a dice throw.\n"));
2556 _(
" * the %s may be captured while trying to"
2557 " escape after completing the mission.\n"),
2567 _(
" * ends this unit's turn.\n"));
2576 _(
" * ending up on a native tile"
2577 " after this action has been performed"
2578 " ends this unit's turn.\n"));
2588 ACTRES_PARADROP_CONQUER)) ?
2599 _(
" * target must be at the same tile.\n"));
2604 PL_(
" * target must be exactly %d tile away.\n",
2605 " * target must be exactly %d tiles away.\n",
2616 _(
" * target can be anywhere.\n"));
2621 PL_(
" * target must be at least %d tile away.\n",
2622 " * target must be at least %d tiles away.\n",
2632 PL_(
" * target can be max %d tile away.\n",
2633 " * target can be max %d tiles away.\n",
2642 PL_(
" * target must be between %d and %d tile away.\n",
2643 " * target must be between %d and %d tiles away.\n",
2652 const enum effect_type eft;
2653 const char *hlp_text;
2656 { EFT_CASUS_BELLI_SUCCESS,
N_(
"successfully") },
2658 { EFT_CASUS_BELLI_CAUGHT,
N_(
"getting caught before") },
2662 { .
kind = VUT_ACTION, .value.action = paction },
2663 { .kind = VUT_DIPLREL, },
2668 for (i = 0; i <
ARRAY_SIZE(casus_belli); i++) {
2672 const char *victim_diplrel_names[DRO_LAST];
2673 const char *outrage_diplrel_names[DRO_LAST];
2674 int victim_diplrel_count = 0;
2675 int outrage_diplrel_count = 0;
2678 for (diplrel = 0; diplrel < DS_NO_CONTACT; diplrel++) {
2679 int casus_belli_amount;
2693 outrage_diplrel_names[outrage_diplrel_count++] =
2696 victim_diplrel_names[victim_diplrel_count++] =
2703 if (outrage_diplrel_count > 0) {
2707 _(
" * %s performing this action during %s causes"
2708 " international outrage: the whole world gets "
2709 "Casus Belli against you.\n"),
2710 _(casus_belli[i].hlp_text),
2712 outrage_diplrel_count));
2715 if (victim_diplrel_count > 0) {
2719 _(
" * %s performing this action during %s gives"
2720 " the victim Casus Belli against you.\n"),
2721 _(casus_belli[i].hlp_text),
2723 victim_diplrel_count));
2730 switch (paction->
result) {
2731 case ACTRES_HELP_WONDER:
2735 _(
" * adds %d production.\n"),
2738 case ACTRES_HEAL_UNIT:
2741 { .
kind = VUT_ACTION, .value.action = paction },
2742 { .kind = VUT_UTYPE, .value.utype = utype },
2746 _(
" * restores up to %d%% of the target unit's"
2754 case ACTRES_FOUND_CITY:
2758 _(
" * is disabled in the current game.\n"));
2762 PL_(
" * initial population: %d.\n",
2763 " * initial population: %d.\n",
2767 case ACTRES_JOIN_CITY:
2770 PL_(
" * max target size: %d.\n",
2771 " * max target size: %d.\n",
2776 PL_(
" * adds %d population.\n",
2777 " * adds %d population.\n",
2781 case ACTRES_BOMBARD:
2784 _(
" * %d per turn.\n"),
2788 _(
" * These attacks will only damage (never kill)"
2789 " defenders, but damage all"
2790 " defenders on a tile, and have no risk for the"
2793 case ACTRES_UPGRADE_UNIT:
2796 _(
" * upgraded to %s or, when possible, to the unit "
2797 "type it upgrades to.\n"),
2803 _(
" * weaker when tired. If performed with less "
2804 "than a single move point left the attack power "
2805 "is reduced accordingly.\n"));
2808 case ACTRES_CONVERT:
2811 PL_(
" * is converted into %s (takes %d MP).\n",
2812 " * is converted into %s (takes %d MP).\n",
2817 case ACTRES_SPY_NUKE:
2819 case ACTRES_NUKE_UNITS:
2823 _(
" * %d%% of the population of each city inside"
2824 " the nuclear blast dies.\n"),
2828 _(
" * can never destroy city completely "
2829 "(%d%% of size 1 rounds down to 0).\n"),
2833 _(
" * can even destroy city completely "
2834 "(%d%% of size 1 rounds up to 1).\n"),
2840 _(
" * all units caught in the open by the nuclear"
2844 _(
" * a unit caught in the nuclear blast while"
2845 " inside a city has a %d%% chance of survival.\n"),
2849 _(
" * all units caught in the nuclear blast"
2855 case ACTRES_CULTIVATE:
2856 case ACTRES_TRANSFORM_TERRAIN:
2858 _(
" * converts target tile terrain to another"
2863 case ACTRES_IRRIGATE:
2886 case ACTRES_CLEAN_POLLUTION:
2887 case ACTRES_CLEAN_FALLOUT:
2909 case ACTRES_PILLAGE:
2931 case ACTRES_FORTIFY:
2933 struct universal unit_is_fortified[] = {
2934 { .
kind = VUT_ACTIVITY,
2935 .value = { .activity = ACTIVITY_FORTIFIED }},
2936 { .kind = VUT_UTYPE, .value = { .utype = utype }},
2939 EFT_FORTIFY_DEFENSE_BONUS,
2940 unit_is_fortified,
ARRAY_SIZE(unit_is_fortified));
2946 .value = { .utype = utype }},
2952 _(
" * to stay put. No defensive bonus.\n"));
2953 }
else if (bonus > 0) {
2957 _(
" * granting a %d%% defensive bonus.\n"),
2962 case ACTRES_CONQUER_EXTRAS:
3006 _(
" * if a suitable hut is at the targetet tile it"
3007 " will be entered.\n"));
3013 _(
" * if a suitable hut is at the targetet tile it"
3014 " will be frightened.\n"));
3021 _(
" * the %s may end up loaded into a transport if it"
3022 " can't survive on its own at the target tile.\n"),
3044 blockers[i] = quoted;
3055 _(
" * can't be done if %s is legal.\n"),
3060 for (; i > 0; i--) {
3062 free((
char *)(blockers[i - 1]));
3092 &(enabler->target_reqs))) {
3100 _(
"* Doing the action \'%s\' to this unit"
3101 " is impossible.\n"),
3105 if (!has_vet_levels) {
3108 CATLSTR(buf,
bufsz,
_(
"* Will never achieve veteran status.\n"));
3114 bool veteran_through_combat =
3128 _(
" * Veterans have increased strength in combat.\n"));
3135 _(
" * Veterans have improved chances in diplomatic "
3140 _(
" * Veterans are more likely to survive missions.\n"));
3146 _(
" * Veterans work faster.\n"));
3150 if (strlen(buf) > 0) {
3153 if (has_vet_levels && utype->
veteran) {
3157 _(
"This type of unit has its own veteran levels:"), NULL)) {
3176 const char *user_text,
int i)
3181 .
kind = VUT_ADVANCE,
3182 .value = {.advance = vap}
3195 if (vap->
tclass == NULL) {
3203 if (NULL != pplayer) {
3211 PL_(
"Starting now, researching %s would need %d bulb.",
3212 "Starting now, researching %s would need %d bulbs.",
3223 PL_(
" The whole project will require %d bulb to complete.",
3224 " The whole project will require %d bulbs to complete.",
3229 PL_(
"To research %s you need to research %d other"
3230 " technology first.%s",
3231 "To research %s you need to research %d other"
3232 " technologies first.%s",
3238 _(
"You cannot research this technology."));
3244 _(
" This number may vary depending on what "
3245 "other players research.\n"));
3274 _(
"* All players start the game with knowledge of this "
3291 if (pnation->init_techs[j] ==
A_LAST) {
3293 }
else if (pnation->init_techs[j] == i) {
3296 _(
"* The %s start the game with knowledge of this "
3305 bv_techs roots, rootsofroots;
3337 const char *root_techs[
A_LAST];
3343 root_techs[n_roots++]
3350 _(
"* Only those who know %s can acquire this "
3351 "technology (by any means).\n"),
3359 _(
"* The first player to learn %s gets"
3360 " an immediate advance.\n"),
3364 for (flagid = TECH_USER_1 ; flagid <= TECH_USER_LAST; flagid++) {
3368 if (helptxt != NULL) {
3379 _(
"* To preserve this technology for our nation some bulbs "
3380 "are needed each turn.\n"));
3384 if (strlen(buf) > 0) {
3399 const char *user_text,
struct terrain *pterrain)
3402 .
kind = VUT_TERRAIN,
3403 .value = {.terrain = pterrain}
3420 _(
"* You cannot build cities on this terrain."));
3427 if (pextra->buildable) {
3429 _(
"* Paths cannot be built on this terrain."));
3439 if (pextra->buildable) {
3441 _(
"* Bases cannot be built on this terrain."));
3450 _(
"* The coastline of this terrain is unsafe."));
3474 _(
"* Units on this terrain neither impose zones of control "
3475 "nor are restricted by them.\n"));
3478 _(
"* Units on this terrain may impose a zone of control, or "
3479 "be restricted by one.\n"));
3481 for (flagid = TER_USER_1 ; flagid <= TER_USER_LAST; flagid++) {
3485 if (helptxt != NULL) {
3495 if (buf[0] !=
'\0') {
3502 if (user_text && user_text[0] !=
'\0') {
3518 static char str[64];
3519 bool has_effect =
FALSE;
3535 if (
str[0] !=
'\0') {
3538 if (incr == 0 && bonus == 0) {
3561 return has_effect ?
str : NULL;
3575 { .
kind = VUT_EXTRA, .value.extra = pextra },
3576 { .kind = VUT_TERRAIN, .value.terrain = pterrain },
3577 { .kind = VUT_OTYPE }
3627 if (bonus[o] > 0 || pterrain->
output[o] > 0) {
3647 enum unit_activity act)
3649 static char buffer[256];
3654 fc_snprintf(buffer,
sizeof(buffer),
PL_(
"%d turn",
"%d turns", btime),
3659 PL_(
", +%d food",
", +%d food", bonus[0]), bonus[0]);
3663 PL_(
", +%d shield",
", +%d shields", bonus[1]), bonus[1]);
3667 PL_(
", +%d trade",
", +%d trade", bonus[2]), bonus[2]);
3680 const char *user_text,
struct extra_type *pextra)
3687 .value = {.extra = pextra}
3720 group_start = strlen(buf);
3725 _(
"Build by issuing an \"irrigate\" order.\n"));
3729 _(
"Build by issuing a \"mine\" order.\n"));
3733 _(
"Build by issuing a \"road\" order.\n"));
3738 if (pbase->
gui_type == BASE_GUI_OTHER) {
3740 _(
"Build by issuing a \"build base\" order.\n"));
3742 const char *order =
"";
3745 case BASE_GUI_FORTRESS:
3748 case BASE_GUI_AIRBASE:
3757 _(
"Build by issuing a \"%s\" order.\n"), order);
3764 _(
"May randomly appear around polluting city.\n"));
3769 _(
"May randomly appear around nuclear blast.\n"));
3777 _(
"Placed by map generator.\n"));
3782 _(
"Can be explored by certain units.\n"));
3787 _(
"May appear spontaneously.\n"));
3790 if (requirement_vector_size(&pextra->
reqs) > 0) {
3791 char reqsbuf[8192] =
"";
3799 buildable ?
Q_(
"?bullet:* ") :
"");
3801 if (reqsbuf[0] !=
'\0') {
3813 if (buf[group_start] !=
'\0') {
3817 group_start = strlen(buf);
3820 int pillage_time = -1;
3826 int terr_pillage_time = pterrain->pillage_time
3829 if (terr_pillage_time != 0) {
3830 if (pillage_time < 0) {
3831 pillage_time = terr_pillage_time;
3832 }
else if (pillage_time != terr_pillage_time) {
3840 if (pillage_time < 0) {
3842 _(
"Can be pillaged by units (time is terrain-dependent).\n"));
3843 }
else if (pillage_time > 0) {
3845 PL_(
"Can be pillaged by units (takes %d turn).\n",
3846 "Can be pillaged by units (takes %d turns).\n",
3847 pillage_time), pillage_time);
3852 int clean_time = -1;
3858 int terr_clean_time = -1;
3861 && pterrain->clean_pollution_time != 0) {
3862 terr_clean_time = pterrain->clean_pollution_time
3866 && pterrain->clean_fallout_time != 0) {
3867 int terr_clean_fall_time = pterrain->clean_fallout_time
3869 if (terr_clean_time > 0
3870 && terr_clean_time != terr_clean_fall_time) {
3876 terr_clean_time = terr_clean_fall_time;
3878 if (clean_time < 0) {
3879 clean_time = terr_clean_time;
3880 }
else if (clean_time != terr_clean_time) {
3887 if (clean_time < 0) {
3889 _(
"Can be cleaned by units (time is terrain-dependent).\n"));
3890 }
else if (clean_time > 0) {
3892 PL_(
"Can be cleaned by units (takes %d turn).\n",
3893 "Can be cleaned by units (takes %d turns).\n",
3894 clean_time), clean_time);
3898 if (requirement_vector_size(&pextra->
rmreqs) > 0) {
3899 char reqsbuf[8192] =
"";
3905 if (reqsbuf[0] !=
'\0') {
3911 if (buf[group_start] !=
'\0') {
3917 group_start = strlen(buf);
3921 if (buf[group_start] !=
'\0') {
3931 _(
"* Visible only if %s known.\n"),
3936 if (pextra->
eus == EUS_HIDDEN) {
3938 _(
"* Units inside are hidden from non-allied players.\n"));
3954 if (proad != NULL) {
3968 _(
" * Such units can move onto this tile even if it would "
3969 "not normally be suitable terrain.\n"));
3976 _(
" * Such units situated here are not considered aggressive "
3977 "if this tile is within 3 tiles of a friendly city.\n"));
3983 _(
" * Such units get a %d%% defense bonus on this "
4005 _(
"* Can be conquered by %s.\n"),
4018 _(
"* Movement cost along %s is %s MP.\n"),
4027 _(
"* Defeat of one unit does not cause death of all other units "
4028 "on this tile.\n"));
4030 if (pbase != NULL) {
4033 _(
"* Extends national borders of the building nation.\n"));
4037 _(
"* Grants permanent vision of an area around the tile to "
4042 _(
"* Allows the owner to see normally invisible stealth units "
4043 "in an area around the tile.\n"));
4047 _(
"* Allows the owner to see normally invisible subsurface units "
4048 "in an area around the tile.\n"));
4055 if (helptxt != NULL) {
4065 if (proad != NULL || pbase != NULL) {
4066 bool road, do_time, do_bonus;
4068 road = (proad != NULL);
4085 if (do_time || do_bonus) {
4086 if (do_time && do_bonus) {
4088 _(
"\nTime to build and output bonus depends on terrain:\n\n"));
4092 _(
"Terrain Time Bonus F/P/T\n"
4093 "----------------------------------\n"));
4094 }
else if (do_time) {
4096 _(
"\nTime to build depends on terrain:\n\n"));
4101 "------------------\n"));
4107 _(
"\nYields an output bonus with some terrains:\n\n"));
4109 _(
"Terrain Bonus F/P/T\n"
4110 "-------------------------\n"));;
4115 const char *bonus_text
4117 if (turns > 0 || bonus_text) {
4142 if (user_text && user_text[0] !=
'\0') {
4155 const char *user_text,
struct goods_type *pgood)
4170 _(
"There's no bonuses paid when trade route gets established.\n\n"));
4173 _(
"When trade route gets established, %d%% of the normal bonus is paid.\n"),
4201 const char *user_text,
struct specialist *pspec)
4236 const char *user_text,
struct government *gov)
4240 .
kind = VUT_GOVERNMENT,
4241 .value = {.govern = gov}
4271 const struct unit_type *unittype = NULL;
4272 enum unit_type_flag_id unitflag = unit_type_flag_id_invalid();
4276 bool too_complex =
FALSE;
4277 bool world_value_valid =
TRUE;
4285 if (!preq->present || preq->quiet) {
4289 switch (preq->source.kind) {
4301 unitclass = preq->source.value.uclass;
4303 world_value_valid =
FALSE;
4307 unittype = preq->source.value.utype;
4310 if (!unit_type_flag_id_is_valid(unitflag)) {
4311 unitflag = preq->source.value.unitflag;
4313 world_value_valid =
FALSE;
4321 case VUT_GOVERNMENT:
4325 fc_assert(preq->source.value.govern == gov);
4329 world_value_valid =
FALSE;
4344 const bool playerwide
4350 int world_value = -999, net_value = -999;
4351 if (world_value_valid) {
4360 .unittype = unittype,
4365 net_value = peffect->value + world_value;
4371 bool harvested_only =
TRUE;
4373 if (peffect->type == EFT_UPKEEP_FACTOR
4374 || peffect->type == EFT_UNIT_UPKEEP_FREE_PER_CITY
4375 || peffect->type == EFT_OUTPUT_BONUS
4376 || peffect->type == EFT_OUTPUT_BONUS_2) {
4378 harvested_only =
FALSE;
4384 if (!harvested_only || pot->
harvested) {
4392 astr_set(&outputs_or,
"%s",
Q_(
"?outputlist: Nothing "));
4393 astr_set(&outputs_and,
"%s",
Q_(
"?outputlist: Nothing "));
4399 switch (peffect->type) {
4400 case EFT_UNHAPPY_FACTOR:
4405 PL_(
"* Military units away from home and field units"
4406 " will each cause %d citizen to become unhappy.\n",
4407 "* Military units away from home and field units"
4408 " will each cause %d citizens to become unhappy.\n",
4413 case EFT_ENEMY_CITIZEN_UNHAPPY_PCT:
4414 if (playerwide && net_value != world_value) {
4415 if (world_value > 0) {
4416 if (net_value > 0) {
4418 _(
"* Unhappiness from foreign citizens due to "
4419 "war with their home state is %d%% the usual "
4421 (net_value * 100) / world_value);
4424 _(
"* No unhappiness from foreign citizens even when "
4425 "at war with their home state.\n"));
4431 _(
"* Each foreign citizen causes %.2g unhappiness "
4432 "in their city while you are at war with their "
4434 (
double)net_value / 100);
4438 case EFT_MAKE_CONTENT_MIL:
4441 PL_(
"* Each of your cities will avoid %d unhappiness"
4442 " caused by units.\n",
4443 "* Each of your cities will avoid %d unhappiness"
4444 " caused by units.\n",
4449 case EFT_MAKE_CONTENT:
4452 PL_(
"* Each of your cities will avoid %d unhappiness,"
4453 " not including that caused by aggression.\n",
4454 "* Each of your cities will avoid %d unhappiness,"
4455 " not including that caused by aggression.\n",
4460 case EFT_FORCE_CONTENT:
4463 PL_(
"* Each of your cities will avoid %d unhappiness,"
4464 " including that caused by aggression.\n",
4465 "* Each of your cities will avoid %d unhappiness,"
4466 " including that caused by aggression.\n",
4471 case EFT_UPKEEP_FACTOR:
4472 if (world_value_valid && !unittype) {
4473 if (net_value == 0) {
4478 _(
"* You pay no %s upkeep for your units.\n"),
4482 _(
"* You pay no upkeep for your units.\n"));
4484 }
else if (net_value != world_value) {
4485 double ratio = (double)net_value / world_value;
4490 _(
"* You pay %.2g times normal %s upkeep for your "
4495 _(
"* You pay %.2g times normal upkeep for your "
4502 case EFT_UNIT_UPKEEP_FREE_PER_CITY:
4510 PL_(
"* Each of your cities will avoid paying %d %s"
4511 " upkeep for your units.\n",
4512 "* Each of your cities will avoid paying %d %s"
4513 " upkeep for your units.\n", peffect->value),
4514 peffect->value,
astr_str(&outputs_and));
4519 PL_(
"* Each of your cities will avoid paying %d"
4520 " upkeep for your units.\n",
4521 "* Each of your cities will avoid paying %d"
4522 " upkeep for your units.\n", peffect->value),
4527 case EFT_CIVIL_WAR_CHANCE:
4530 _(
"* If you lose your capital,"
4531 " the base chance of civil war is %d%%.\n"),
4535 case EFT_EMPIRE_SIZE_BASE:
4538 PL_(
"* You can have %d city before an "
4539 "additional unhappy citizen appears in each city "
4540 "due to civilization size.\n",
4541 "* You can have up to %d cities before an "
4542 "additional unhappy citizen appears in each city "
4543 "due to civilization size.\n", net_value),
4547 case EFT_EMPIRE_SIZE_STEP:
4550 PL_(
"* After the first unhappy citizen due to"
4551 " civilization size, for each %d additional city"
4552 " another unhappy citizen will appear.\n",
4553 "* After the first unhappy citizen due to"
4554 " civilization size, for each %d additional cities"
4555 " another unhappy citizen will appear.\n",
4562 if (net_value < 100) {
4564 _(
"* The maximum rate you can set for science,"
4565 " gold, or luxuries is %d%%.\n"),
4569 _(
"* Has unlimited science/gold/luxuries rates.\n"));
4573 case EFT_MARTIAL_LAW_EACH:
4576 PL_(
"* Your units may impose martial law."
4577 " Each military unit inside a city will force %d"
4578 " unhappy citizen to become content.\n",
4579 "* Your units may impose martial law."
4580 " Each military unit inside a city will force %d"
4581 " unhappy citizens to become content.\n",
4586 case EFT_MARTIAL_LAW_MAX:
4587 if (playerwide && net_value < 100) {
4589 PL_(
"* A maximum of %d unit in each city can enforce"
4591 "* A maximum of %d units in each city can enforce"
4597 case EFT_RAPTURE_GROW:
4598 if (playerwide && net_value > 0) {
4600 _(
"* You may grow your cities by means of "
4606 _(
" (Cities below size %d cannot grow in this way.)"),
4612 case EFT_REVOLUTION_UNHAPPINESS:
4615 PL_(
"* If a city is in disorder for more than %d turn "
4616 "in a row, government will fall into anarchy.\n",
4617 "* If a city is in disorder for more than %d turns "
4618 "in a row, government will fall into anarchy.\n",
4623 case EFT_HAS_SENATE:
4624 if (playerwide && net_value > 0) {
4626 _(
"* Has a senate that may prevent declaration of war.\n"));
4629 case EFT_INSPIRE_PARTISANS:
4630 if (playerwide && net_value > 0) {
4632 _(
"* Allows partisans when cities are taken by the "
4636 case EFT_HAPPINESS_TO_GOLD:
4637 if (playerwide && net_value > 0) {
4639 _(
"* Buildings that normally confer bonuses against"
4640 " unhappiness will instead give gold.\n"));
4644 if (playerwide && net_value > 0) {
4655 _(
"* Pays no upkeep for %s.\n"),
4661 case EFT_NO_UNHAPPY:
4662 if (playerwide && net_value > 0) {
4666 case EFT_VETERAN_BUILD:
4675 if (unit_type_flag_id_is_valid(unitflag)) {
4678 if (conditions > 1) {
4688 Q_(
"?unitclass:* New %s units will be veteran.\n"),
4690 }
else if (unit_type_flag_id_is_valid(unitflag)) {
4694 Q_(
"?unitflag:* New %s units will be veteran.\n"),
4695 unit_type_flag_id_translated_name(unitflag));
4696 }
else if (unittype != NULL) {
4697 if (world_value_valid && net_value > 0) {
4706 Q_(
"?unittype:* New %s units will have the rank "
4715 _(
"* New units will be veteran.\n"));
4719 case EFT_OUTPUT_PENALTY_TILE:
4720 if (world_value_valid) {
4725 PL_(
"* Each worked tile that gives more than %d %s will"
4726 " suffer a -1 penalty, unless the city working it"
4728 "* Each worked tile that gives more than %d %s will"
4729 " suffer a -1 penalty, unless the city working it"
4730 " is celebrating.", net_value),
4736 _(
" (Cities below size %d will not celebrate.)"),
4742 case EFT_OUTPUT_INC_TILE_CELEBRATE:
4745 PL_(
"* Each worked tile with at least 1 %s will yield"
4746 " %d more of it while the city working it is"
4748 "* Each worked tile with at least 1 %s will yield"
4749 " %d more of it while the city working it is"
4750 " celebrating.", peffect->value),
4751 astr_str(&outputs_or), peffect->value);
4756 _(
" (Cities below size %d will not celebrate.)"),
4761 case EFT_OUTPUT_INC_TILE:
4764 PL_(
"* Each worked tile with at least 1 %s will yield"
4765 " %d more of it.\n",
4766 "* Each worked tile with at least 1 %s will yield"
4767 " %d more of it.\n", peffect->value),
4768 astr_str(&outputs_or), peffect->value);
4770 case EFT_OUTPUT_BONUS:
4771 case EFT_OUTPUT_BONUS_2:
4775 _(
"* %s production is increased %d%%.\n"),
4776 astr_str(&outputs_and), peffect->value);
4778 case EFT_OUTPUT_WASTE:
4779 if (world_value_valid) {
4780 if (net_value > 30) {
4783 _(
"* %s production will suffer massive losses.\n"),
4785 }
else if (net_value >= 15) {
4788 _(
"* %s production will suffer some losses.\n"),
4790 }
else if (net_value > 0) {
4793 _(
"* %s production will suffer a small amount "
4799 case EFT_HEALTH_PCT:
4801 if (peffect->value > 0) {
4803 " within your cities.\n"));
4804 }
else if (peffect->value < 0) {
4806 " within your cities.\n"));
4810 case EFT_OUTPUT_WASTE_BY_REL_DISTANCE:
4814 net_value = (net_value + 39) / 40;
4816 case EFT_OUTPUT_WASTE_BY_DISTANCE:
4817 if (world_value_valid) {
4818 if (net_value >= 300) {
4821 _(
"* %s losses will increase quickly"
4822 " with distance from capital.\n"),
4824 }
else if (net_value >= 200) {
4827 _(
"* %s losses will increase"
4828 " with distance from capital.\n"),
4830 }
else if (net_value > 0) {
4833 _(
"* %s losses will increase slowly"
4834 " with distance from capital.\n"),
4839 case EFT_MIGRATION_PCT:
4841 if (peffect->value > 0) {
4843 " into your cities.\n"));
4844 }
else if (peffect->value < 0) {
4846 " into your cities.\n"));
4850 case EFT_BORDER_VISION:
4852 && playerwide && net_value > 0) {
4879 _(
"* Makes it impossible to do the action \'%s\'"
4886 if (user_text && user_text[0] !=
'\0') {
4896 static char buf[128];
4906 if (utype->
upkeep[o] > 0) {
4909 (any > 0 ?
Q_(
"?blistmore:, ") :
""), utype->
upkeep[o],
4917 (any > 0 ?
Q_(
"?blistmore:, ") :
""), utype->
happy_cost);
4932 const char *user_text)
4936 .value = {.nation = pnation}
4938 bool print_break =
TRUE;
4940#define PRINT_BREAK() do { \
4941 if (print_break) { \
4942 if (buf[0] != '\0') { \
4943 CATLSTR(buf, bufsz, "\n\n"); \
4945 print_break = FALSE; \
4952 if (pnation->
legend[0] !=
'\0') {
4960 _(
"Initial government is %s.\n"),
4980 _(
"Starts with knowledge of %s in addition to the standard "
4992 int i, j,
n = 0, total = 0;
4999 for (j = 0; j <
n; j++) {
5018 for (i = 0; i <
n; i++) {
5033 for (i = 0; i <
n; i++) {
5034 utype_name_strs[i] =
astr_str(&utype_names[i]);
5038 for (i = 0; i <
n; i++) {
5046 PL_(
"Starts with the following additional unit: %s.\n",
5047 "Starts with the following additional units: %s.\n",
5070 _(
"First city will get %s for free in addition to the "
5080 if (buf[0] !=
'\0') {
5085 if (user_text && user_text[0] !=
'\0') {
5086 if (buf[0] !=
'\0') {
bool action_removes_extra(const struct action *paction, const struct extra_type *pextra)
const char * action_name_translation(const struct action *action)
enum action_actor_kind action_get_actor_kind(const struct action *paction)
const char * action_id_name_translation(action_id act_id)
void action_list_end(action_id *act_list, int size)
bool action_is_in_use(struct action *paction)
enum action_battle_kind action_get_battle_kind(const struct action *pact)
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
bool action_immune_government(struct government *gov, action_id act)
int action_dice_roll_initial_odds(const struct action *paction)
void action_list_add_all_by_result(action_id *act_list, int *position, enum action_result result)
const char * action_target_kind_help(enum action_target_kind kind)
enum action_target_kind action_get_target_kind(const struct action *paction)
bool action_creates_extra(const struct action *paction, const struct extra_type *pextra)
struct action_enabler_list * action_enablers_for_action(action_id action)
#define action_id_univs_not_blocking(act_id, act_uni, tgt_uni)
#define action_auto_perf_iterate_end
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_enabler_list_iterate_end
#define action_id_get_role(act_id)
#define ACTION_DISTANCE_UNLIMITED
#define action_array_iterate(_act_list_, _act_id_)
#define action_array_iterate_end
#define action_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define action_auto_perf_iterate(_act_perf_)
#define ACTION_ODDS_PCT_DICE_ROLL_NA
void astr_free(struct astring *astr)
const char * astr_build_or_list(struct astring *astr, const char *const *items, size_t number)
void astr_set(struct astring *astr, const char *format,...)
const char * astr_build_and_list(struct astring *astr, const char *const *items, size_t number)
void astr_init(struct astring *astr)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
bool territory_claiming_base(const struct base_type *pbase)
#define BV_CLR_ALL_FROM(vec_to, vec_from)
#define BV_ARE_EQUAL(vec1, vec2)
#define BV_ISSET(bv, bit)
#define BV_ISSET_ANY(vec)
struct output_type * get_output_type(Output_type_id output)
const char * get_output_name(Output_type_id output)
#define output_type_iterate(output)
#define output_type_iterate_end
enum client_states client_state(void)
bool client_nation_is_in_current_set(const struct nation_type *pnation)
static struct fc_sockaddr_list * list
static void road(QVariant data1, QVariant data2)
bool effect_universals_value_never_below(enum effect_type type, struct universal *unis, size_t n_unis, int min_value)
struct effect_list * get_req_source_effects(struct universal *psource)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
int effect_value_from_universals(enum effect_type type, struct universal *unis, size_t n_unis)
int effect_cumulative_max(enum effect_type type, struct universal *unis, size_t n_unis)
bool building_has_effect(const struct impr_type *pimprove, enum effect_type effect_type)
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
#define MAX_NUM_BUILDING_LIST
#define CASUS_BELLI_OUTRAGE
#define CASUS_BELLI_VICTIM
#define MAX_NUM_UNIT_LIST
#define MAX_NUM_TECH_LIST
enum output_type_id Output_type_id
size_t get_internal_string_length(const char *text)
#define PL_(String1, String2, n)
const char * government_name_translation(const struct government *pgovern)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
static GtkWidget * source
const char * client_string
void insert_client_build_info(char *outbuf, size_t outlen)
void popdown_help_dialog(void)
#define CATLSTR(_b, _s, _t)
static void extra_bonus_for_terrain(struct extra_type *pextra, struct terrain *pterrain, int *bonus)
void help_iter_start(void)
static int help_item_compar(const struct help_item *const *ppa, const struct help_item *const *ppb)
static bool help_nodes_init
void free_help_texts(void)
void boot_help_texts(void)
static void insert_allows(struct universal *psource, char *buf, size_t bufsz, const char *prefix)
static bool insert_generated_text(char *outbuf, size_t outlen, const char *name)
static struct help_list * help_nodes
static const char *const help_type_names[]
void helptext_government(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct government *gov)
void helptext_advance(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, int i)
enum help_page_type help_type_by_requirement(const struct requirement *req)
void helptext_extra(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct extra_type *pextra)
static void check_help_nodes_init(void)
const struct help_item * get_help_item(int pos)
static bool insert_veteran_help(char *outbuf, size_t outlen, const struct veteran_system *veteran, const char *intro, const char *nolevels)
void helptext_goods(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct goods_type *pgood)
static bool show_help_for_nation(const struct nation_type *pnation)
const char * helptext_road_bonus_str(const struct terrain *pterrain, const struct road_type *proad)
static const struct help_list_link * help_nodes_iterator
char * helptext_unit_upkeep_str(const struct unit_type *utype)
const char * helptext_extra_for_terrain_str(struct extra_type *pextra, struct terrain *pterrain, enum unit_activity act)
static void insert_allows_single(struct universal *psource, struct requirement_vector *psubjreqs, const char *subjstr, const char *const *strs, char *buf, size_t bufsz, const char *prefix)
#define help_list_iterate_end
static bool utype_may_do_escape_action(const struct unit_type *utype)
void helptext_specialist(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct specialist *pspec)
const struct help_item * get_help_item_spec(const char *name, enum help_page_type htype, int *pos)
#define help_list_iterate(helplist, phelp)
const struct help_item * help_iter_next(void)
char * helptext_building(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct impr_type *pimprove)
void helptext_terrain(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, struct terrain *pterrain)
char * helptext_unit(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct unit_type *utype)
void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation, const char *user_text)
static struct help_item * new_help_item(int type)
#define HELP_TILESET_ITEM
#define HELP_RULESET_ITEM
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
struct impr_type * improvement_by_number(const Impr_type_id id)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
struct terrain_misc terrain_control
const char * move_points_text(int mp, bool reduce)
const char * move_points_text_full(int mp, bool reduce, const char *prefix, const char *none, bool align)
bool is_native_to_class(const struct unit_class *punitclass, const struct terrain *pterrain, const bv_extras *extras)
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
bool can_attack_non_native(const struct unit_type *utype)
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
static const char * name_translation_get(const struct name_translation *ptrans)
const char * nation_plural_translation(const struct nation_type *pnation)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
const char * diplrel_name_translation(int value)
struct section_file * secfile_load(const char *filename, bool allow_duplicates)
const char * secfile_error(void)
const char * section_name(const struct section *psection)
void secfile_destroy(struct section_file *secfile)
void secfile_check_unused(const struct section_file *secfile)
struct section_list * secfile_sections_by_name_prefix(const struct section_file *secfile, const char *prefix)
const char ** secfile_lookup_str_vec(const struct section_file *secfile, size_t *dim, const char *path,...)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
#define section_list_iterate(seclist, psection)
#define section_list_iterate_end
bool req_text_insert_nl(char *buf, size_t bufsz, struct player *pplayer, const struct requirement *preq, enum rt_verbosity verb, const char *prefix)
bool universal_is_relevant_to_requirement(const struct requirement *req, const struct universal *source)
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
#define requirement_fulfilled_by_unit_type(_ut_, _rqs_)
#define requirement_fulfilled_by_improvement(_imp_, _rqs_)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
int research_goal_bulbs_required(const struct research *presearch, Tech_type_id goal)
int research_total_bulbs_required(const struct research *presearch, Tech_type_id tech, bool loss_value)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
bool road_provides_move_bonus(const struct road_type *proad)
server_setting_id server_setting_by_name(const char *name)
bool server_setting_value_bool_get(server_setting_id id)
struct setting_list * level[OLEVELS_NUM]
int compare_strings(const void *first, const void *second)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
const struct strvec * get_data_dirs(void)
struct specialist * specialist_by_number(const Specialist_type_id id)
const char * specialist_plural_translation(const struct specialist *sp)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
void strvec_destroy(struct strvec *psv)
void strvec_append(struct strvec *psv, const char *string)
const char * strvec_to_or_list(const struct strvec *psv, struct astring *astr)
struct strvec * strvec_new(void)
void strvec_clear(struct strvec *psv)
size_t strvec_size(const struct strvec *psv)
const char * strvec_to_and_list(const struct strvec *psv, struct astring *astr)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
enum moves_actor_kind moves_actor
struct action::@12::@13 is_unit
enum action_result result
bv_action_sub_results sub_results
struct requirement_vector research_reqs
struct tech_class * tclass
enum base_gui_type gui_type
struct civ_game::@29 rgame
struct packet_ruleset_control control
int global_init_techs[MAX_NUM_TECH_LIST]
struct packet_game_info info
struct civ_game::@30::@33 client
int global_init_buildings[MAX_NUM_BUILDING_LIST]
struct packet_scenario_info scenario
char * ruleset_description
struct veteran_system * veteran
struct requirement_vector reqs
struct requirement_vector reqs
struct requirement_vector obsolete_by
struct requirement_vector reqs
int init_buildings[MAX_NUM_BUILDING_LIST]
struct government * init_government
struct unit_type * init_units[MAX_NUM_UNIT_LIST]
int init_techs[MAX_NUM_TECH_LIST]
enum borders_mode borders
int nuke_defender_survival_chance_pct
enum tech_upkeep_style tech_upkeep_style
char version[MAX_LEN_NAME]
int tile_incr_const[O_LAST]
struct requirement_vector reqs
int road_output_incr_pct[O_LAST]
struct requirement_vector build_reqs
struct veteran_system * veteran
const struct unit_type * obsoleted_by
struct advance * require_advance
bv_unit_classes disembarks
const struct unit_type * converted_to
struct combat_bonus_list * bonuses
struct name_translation name
struct veteran_level * definitions
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
int fc_strcasecmp(const char *str0, const char *str1)
size_t fc_strlcat(char *dest, const char *src, size_t n)
int cat_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)
struct advance * advance_by_number(const Tech_type_id atype)
bool advance_has_flag(Tech_type_id tech, enum tech_flag_id flag)
const char * tech_class_name_translation(const struct tech_class *ptclass)
struct advance * advance_requires(const struct advance *padvance, enum tech_req require)
const char * advance_name_translation(const struct advance *padvance)
struct advance * valid_advance_by_number(const Tech_type_id id)
bool techs_have_fixed_costs(void)
const char * tech_flag_helptxt(enum tech_flag_id id)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_index_iterate_end
#define advance_root_req_iterate_end
#define advance_index_iterate(_start, _index)
#define advance_root_req_iterate(_goal, _padvance)
const char * terrain_name_translation(const struct terrain *pterrain)
const char * terrain_rule_name(const struct terrain *pterrain)
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
const char * terrain_flag_helptxt(enum terrain_flag_id id)
int terrain_extra_build_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
#define terrain_has_flag(terr, flag)
const char * tileset_description(struct tileset *t)
const char * tileset_summary(struct tileset *t)
const char * tileset_name_get(struct tileset *t)
const char * tileset_version(struct tileset *t)
const char * goods_name_translation(struct goods_type *pgood)
#define goods_type_iterate_end
#define goods_type_iterate(_p)
const struct impr_type * building
Output_type_id outputtype
const char * uclass_name_translation(const struct unit_class *pclass)
bool utype_action_takes_all_mp(const struct unit_type *putype, struct action *paction)
bool utype_can_freely_unload(const struct unit_type *pcargotype, const struct unit_type *ptranstype)
const char * unit_class_flag_helptxt(enum unit_class_flag_id id)
Unit_Class_id uclass_count(void)
struct unit_type * get_role_unit(int role, int role_index)
int utype_build_shield_cost_base(const struct unit_type *punittype)
const struct veteran_system * utype_veteran_system(const struct unit_type *punittype)
int num_role_units(int role)
bool utype_can_freely_load(const struct unit_type *pcargotype, const struct unit_type *ptranstype)
Unit_type_id utype_count(void)
int utype_veteran_levels(const struct unit_type *punittype)
bool utype_can_do_action_result(const struct unit_type *putype, enum action_result result)
bool utype_action_takes_all_mp_if_ustate_is(const struct unit_type *putype, struct action *paction, const enum ustate_prop prop)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
bool utype_is_consumed_by_action(const struct action *paction, const struct unit_type *utype)
bool utype_veteran_has_power_bonus(const struct unit_type *punittype)
const char * unit_type_flag_helptxt(enum unit_type_flag_id id)
const char * utype_name_translation(const struct unit_type *punittype)
bool can_utype_do_act_if_tgt_diplrel(const struct unit_type *punit_type, const action_id act_id, const int prop, const bool is_there)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
#define UCF_LAST_USER_FLAG
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define utype_fuel(ptype)
#define combat_bonus_list_iterate_end
#define combat_bonus_list_iterate(bonuslist, pbonus)
#define unit_class_iterate(_p)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define UTYF_LAST_USER_FLAG
#define unit_type_iterate(_p)
#define uclass_index(_c_)
#define unit_class_iterate_end
#define unit_type_iterate_end
const char * freeciv_name_version(void)