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;
213 _(
"Terrain Cultivate Plant Transform\n"));
215 "----------------------------------------------------------------\n");
218 char cultivation_time[4], plant_time[4], transform_time[4];
219 const char *
terrain, *cultivate_result,
220 *plant_result,*transform_result;
221 struct universal for_terr = { .
kind = VUT_TERRAIN, .value = { .terrain = pterrain }};
222 int cslen, pslen, tslen;
224 fc_snprintf(cultivation_time,
sizeof(cultivation_time),
225 "%d", pterrain->cultivate_time);
227 "%d", pterrain->plant_time);
228 fc_snprintf(transform_time,
sizeof(transform_time),
229 "%d", pterrain->transform_time);
232 (pterrain->cultivate_result ==
T_NONE
237 (pterrain->plant_result ==
T_NONE
242 (pterrain->transform_result == pterrain
243 || pterrain->transform_result ==
T_NONE
245 NULL, &for_terr)) ?
""
254 "%s%*s %3s %s%*s %3s %s%*s %3s %s\n",
257 (pterrain->cultivate_result ==
T_NONE) ?
"-" : cultivation_time,
260 (pterrain->plant_result ==
T_NONE) ?
"-" : plant_time,
263 (pterrain->transform_result ==
T_NONE) ?
"-" : transform_time,
266 if (clean_pollution_time != 0 && pterrain->clean_pollution_time != 0) {
267 if (clean_pollution_time < 0) {
268 clean_pollution_time = pterrain->clean_pollution_time;
270 if (clean_pollution_time != pterrain->clean_pollution_time) {
271 clean_pollution_time = 0;
275 if (clean_fallout_time != 0 && pterrain->clean_fallout_time != 0) {
276 if (clean_fallout_time < 0) {
277 clean_fallout_time = pterrain->clean_fallout_time;
279 if (clean_fallout_time != pterrain->clean_fallout_time) {
280 clean_fallout_time = 0;
284 if (pillage_time != 0 && pterrain->pillage_time != 0) {
285 if (pillage_time < 0) {
286 pillage_time = pterrain->pillage_time;
288 if (pillage_time != pterrain->pillage_time) {
301 int time = -1, factor = -1;
304 if (pextra->removal_time == 0) {
306 factor = pextra->removal_time_factor;
307 }
else if (factor != pextra->removal_time_factor) {
312 time = pextra->removal_time;
313 }
else if (time != pextra->removal_time) {
321 clean_pollution_time = time;
323 clean_pollution_time = 0;
325 }
else if (clean_pollution_time != 0) {
328 if (time > 0 && factor > 0 && time != clean_pollution_time * factor) {
329 clean_pollution_time = 0;
330 }
else if (time >= 0) {
331 clean_pollution_time = time;
332 }
else if (factor >= 0) {
333 clean_pollution_time = clean_pollution_time * factor;
341 int time = -1, factor = -1;
344 if (pextra->removal_time == 0) {
346 factor = pextra->removal_time_factor;
347 }
else if (factor != pextra->removal_time_factor) {
352 time = pextra->removal_time;
353 }
else if (time != pextra->removal_time) {
361 clean_fallout_time = time;
363 clean_fallout_time = 0;
365 }
else if (clean_fallout_time != 0) {
368 if (time > 0 && factor > 0 && time != clean_fallout_time * factor) {
369 clean_fallout_time = 0;
370 }
else if (time >= 0) {
371 clean_fallout_time = time;
372 }
else if (factor >= 0) {
373 clean_fallout_time = clean_fallout_time * factor;
381 int time = -1, factor = -1;
384 if (pextra->removal_time == 0) {
386 factor = pextra->removal_time_factor;
387 }
else if (factor != pextra->removal_time_factor) {
392 time = pextra->removal_time;
393 }
else if (time != pextra->removal_time) {
405 }
else if (pillage_time != 0) {
408 if (time > 0 && factor > 0 && time != pillage_time * factor) {
410 }
else if (time >= 0) {
412 }
else if (factor >= 0) {
413 pillage_time = pillage_time * factor;
424 if (pextra->buildable && pextra->build_time > 0) {
425 terrain_independent_extras =
TRUE;
429 if (!terrain_independent_extras) {
431 if (pextra->buildable && pextra->build_time > 0) {
432 terrain_independent_extras =
TRUE;
438 if (clean_pollution_time > 0 || clean_fallout_time > 0 || pillage_time > 0
439 || terrain_independent_extras) {
442 _(
"Time taken for the following activities is independent of "
448 _(
"Activity Time\n"));
450 "---------------------------");
451 if (clean_pollution_time > 0)
453 _(
"\nClean pollution %3d"), clean_pollution_time);
454 if (clean_fallout_time > 0)
456 _(
"\nClean fallout %3d"), clean_fallout_time);
457 if (pillage_time > 0)
459 _(
"\nPillage %3d"), pillage_time);
461 if (pextra->buildable && pextra->build_time > 0) {
473 if (pextra->buildable && pextra->build_time > 0) {
486 }
else if (0 == strcmp(
name,
"VeteranLevels")) {
488 _(
"In this ruleset, the following veteran levels are defined:"),
489 _(
"This ruleset has no default veteran levels defined."));
490 }
else if (0 == strcmp(
name,
"FreecivVersion")) {
501 }
else if (0 == strcmp(
name,
"DefaultMetaserver")) {
518 struct requirement_vector *psubjreqs,
520 const char *
const *strs,
521 char *buf,
size_t bufsz,
604 char *buf,
size_t bufsz,
const char *prefix)
609 static const char *
const govstrs[] = {
611 N_(
"?gov:Allows %s (with %s but no %s)."),
613 N_(
"?gov:Allows %s (with %s)."),
615 N_(
"?gov:Allows %s (absent %s)."),
617 N_(
"?gov:Allows %s."),
619 N_(
"?gov:Prevents %s.")
628 static const char *
const imprstrs[] = {
630 N_(
"?improvement:Allows %s (with %s but no %s)."),
632 N_(
"?improvement:Allows %s (with %s)."),
634 N_(
"?improvement:Allows %s (absent %s)."),
636 N_(
"?improvement:Allows %s."),
638 N_(
"?improvement:Prevents %s.")
647 static const char *
const utstrs[] = {
649 N_(
"?unittype:Allows %s (with %s but no %s)."),
651 N_(
"?unittype:Allows %s (with %s)."),
653 N_(
"?unittype:Allows %s (absent %s)."),
655 N_(
"?unittype:Allows %s."),
657 N_(
"?unittype:Prevents %s.")
665 static const char *
const estrs[] = {
667 N_(
"?extra:Allows %s (with %s but no %s)."),
669 N_(
"?extra:Allows %s (with %s)."),
671 N_(
"?extra:Allows %s (absent %s)."),
673 N_(
"?extra:Allows %s."),
675 N_(
"?extra:Prevents %s.")
683 static const char *
const gstrs[] = {
685 N_(
"?good:Allows %s (with %s but no %s)."),
687 N_(
"?good:Allows %s (with %s)."),
689 N_(
"?good:Allows %s (absent %s)."),
691 N_(
"?good:Allows %s."),
693 N_(
"?good:Prevents %s.")
726 for (ta = ha->
topic, tb = hb->
topic; *ta !=
'\0' && *tb !=
'\0'; ta++, tb++) {
728 if (*tb ==
' ')
return -1;
730 }
else if (*tb !=
' ') {
731 if (*ta ==
' ')
return 1;
743 static bool booted =
FALSE;
746 const char *filename;
749 struct section_list *sec;
752 char long_buffer[64000];
775 log_error(
"failed reading help-texts from '%s':\n%s", filename,
790 int level = strspn(gen_str,
" ");
801 log_error(
"bad help-generate category \"%s\"", gen_str);
812 "%s.categories", sec_name);
823 struct help_list *category_nodes = help_list_new();
825 switch (current_type) {
833 help_list_append(category_nodes, pitem);
844 help_list_append(category_nodes, pitem);
856 help_list_append(category_nodes, pitem);
865 "%s.categories", sec_name);
869 bool include =
FALSE;
870 const char *cat = extra_category_name(pextra->category);
873 for (ci = 0; ci < ncats; ci++) {
888 help_list_append(category_nodes, pitem);
900 help_list_append(category_nodes, pitem);
912 help_list_append(category_nodes, pitem);
922 help_list_append(category_nodes, pitem);
933 help_list_append(category_nodes, pitem);
945 help_list_append(category_nodes, pitem);
988 const char *nodesc =
_(
"Current ruleset contains no summary.");
1034 if (description != NULL) {
1035 desc_len = strlen(
"\n\n") + strlen(description);
1039 if (summary != NULL) {
1040 if (version[0] !=
'\0') {
1041 len = strlen(
_(ts_name))
1045 + strlen(
_(summary))
1050 _(ts_name), version,
_(summary));
1052 len = strlen(
_(ts_name))
1054 + strlen(
_(summary))
1059 _(ts_name),
_(summary));
1062 const char *nodesc =
_(
"Current tileset contains no summary.");
1064 if (version[0] !=
'\0') {
1065 len = strlen(
_(ts_name))
1074 _(ts_name), version,
1077 len = strlen(
_(ts_name))
1088 if (description != NULL) {
1104 help_list_append(category_nodes, pitem);
1110 help_text_buffer[0] =
'\0';
1115 if (pmul->helptext) {
1116 const char *sep =
"";
1118 cat_snprintf(help_text_buffer,
sizeof(help_text_buffer),
1128 log_error(
"Bad current_type: %d.", current_type);
1135 help_list_destroy(category_nodes);
1148 long_buffer[0] =
'\0';
1149 for (i = 0; i < npara; i++) {
1151 const char *para = paras[i];
1153 if (strncmp(para,
"$", 1) == 0) {
1160 if (inserted && i != npara - 1) {
1170 section_list_destroy(sec);
1206 if (pos < 0 || pos >
size) {
1228 static char vtopic[128];
1229 static char vtext[256];
1234 char *p = ptmp->topic;
1239 if (strcmp(
name, p) == 0 && (htype ==
HELP_ANY || htype == ptmp->type)) {
1249 vitem.
topic = vtopic;
1254 _(
"Sorry, no help topic for %s.\n"), vitem.
topic);
1258 _(
"Sorry, no help topic for %s.\n"
1259 "This page was auto-generated.\n\n"),
1317 const char *user_text,
const struct impr_type *pimprove)
1321 .
kind = VUT_IMPROVEMENT,
1322 .value = {.building = pimprove}
1328 if (NULL == pimprove) {
1349 if (VUT_ADVANCE == pobs->source.kind && pobs->present) {
1351 _(
"* The discovery of %s will make %s obsolete.\n"),
1355 if (VUT_IMPROVEMENT == pobs->source.kind && pobs->present) {
1358 _(
"* The presence of %s in the city will make %s "
1367 _(
"* A 'small wonder': at most one of your cities may "
1368 "possess this improvement.\n"));
1399 _(
"* Allows all players with knowledge of %s "
1400 "to build %s units.\n"),
1406 _(
"* Allows all players to build %s units.\n"),
1419 bool demanded =
FALSE;
1420 enum req_range max_range = REQ_RANGE_LOCAL;
1445 if (!preq->present) {
1451 if (preq->range > max_range) {
1453 max_range = preq->range;
1463 switch (max_range) {
1464 case REQ_RANGE_LOCAL:
1469 _(
"* Makes it possible to target the city building it "
1470 "with the action \'%s\'.\n"),
1473 case REQ_RANGE_CITY:
1478 _(
"* Makes it possible to target its city with the "
1479 "action \'%s\'.\n"),
1482 case REQ_RANGE_TRADE_ROUTE:
1487 _(
"* Makes it possible to target its city and its "
1488 "trade partners with the action \'%s\'.\n"),
1491 case REQ_RANGE_CONTINENT:
1496 _(
"* Makes it possible to target all cities with its "
1497 "owner on its continent with the action \'%s\'.\n"),
1500 case REQ_RANGE_PLAYER:
1505 _(
"* Makes it possible to target all cities with its "
1506 "owner with the action \'%s\'.\n"),
1509 case REQ_RANGE_TEAM:
1514 _(
"* Makes it possible to target all cities on the "
1515 "same team with the action \'%s\'.\n"),
1518 case REQ_RANGE_ALLIANCE:
1523 _(
"* Makes it possible to target all cities owned by "
1524 "or allied to its owner with the action \'%s\'.\n"),
1527 case REQ_RANGE_WORLD:
1532 _(
"* Makes it possible to target all cities with the "
1533 "action \'%s\'.\n"),
1536 case REQ_RANGE_CADJACENT:
1537 case REQ_RANGE_ADJACENT:
1538 case REQ_RANGE_COUNT:
1539 log_error(
"The range %s is invalid for buildings.",
1540 req_range_name(max_range));
1550 bool vulnerable =
FALSE;
1551 enum req_range min_range = REQ_RANGE_COUNT;
1571 &(enabler->target_reqs))) {
1575 enum req_range vector_max_range = REQ_RANGE_LOCAL;
1583 if (preq->present) {
1588 if (preq->range > vector_max_range) {
1590 vector_max_range = preq->range;
1594 if (vector_max_range < min_range) {
1596 min_range = vector_max_range;
1602 switch (min_range) {
1603 case REQ_RANGE_LOCAL:
1606 _(
"* Makes it impossible to do the action \'%s\' to "
1607 "the city building it.\n"),
1610 case REQ_RANGE_CITY:
1613 _(
"* Makes it impossible to do the action \'%s\' to "
1617 case REQ_RANGE_TRADE_ROUTE:
1620 _(
"* Makes it impossible to do the action \'%s\' to "
1621 "its city or to its city's trade partners.\n"),
1624 case REQ_RANGE_CONTINENT:
1627 _(
"* Makes it impossible to do the action \'%s\' to "
1628 "any city with its owner on its continent.\n"),
1631 case REQ_RANGE_PLAYER:
1634 _(
"* Makes it impossible to do the action \'%s\' to "
1635 "any city with its owner.\n"),
1638 case REQ_RANGE_TEAM:
1641 _(
"* Makes it impossible to do the action \'%s\' to "
1642 "any city on the same team.\n"),
1645 case REQ_RANGE_ALLIANCE:
1648 _(
"* Makes it impossible to do the action \'%s\' to "
1649 "any city allied to or owned by its owner.\n"),
1652 case REQ_RANGE_WORLD:
1655 _(
"* Makes it impossible to do the action \'%s\' to "
1656 "any city in the game.\n"),
1659 case REQ_RANGE_CADJACENT:
1660 case REQ_RANGE_ADJACENT:
1661 case REQ_RANGE_COUNT:
1662 log_error(
"The range %s is invalid for buildings.",
1663 req_range_name(min_range));
1678 _(
"* All players start with this improvement in their "
1701 _(
"* The %s start with this improvement in their "
1711 _(
"* If you lose the city containing this improvement, "
1712 "it will be rebuilt for free in another of your cities "
1713 "(if the 'savepalace' server setting is enabled).\n"));
1716 if (user_text && user_text[0] !=
'\0') {
1764 const char *user_text,
const struct unit_type *utype)
1766 bool has_vet_levels;
1785 _(
"* Belongs to %s unit class."),
1796 CATLSTR(buf,
bufsz,
_(
" * Speed is not affected by terrain.\n"));
1800 CATLSTR(buf,
bufsz,
_(
" * Does not get defense bonuses from terrain.\n"));
1804 CATLSTR(buf,
bufsz,
_(
" * Not subject to zones of control.\n"));
1807 CATLSTR(buf,
bufsz,
_(
" * Subject to zones of control.\n"));
1815 { .
kind = VUT_UTYPE, .value = { .utype = utype }},
1816 { .kind = VUT_CITYTILE, .value = { .citytile = CITYT_CENTER }},
1819 EFT_FORTIFY_DEFENSE_BONUS,
1820 unit_is_in_city,
ARRAY_SIZE(unit_is_in_city));
1826 _(
" * Gets a %d%% defensive bonus while in cities.\n"),
1833 _(
" * Is unreachable. Most units cannot attack this one.\n"));
1837 _(
" * Doesn't prevent enemy units from attacking other "
1838 "units on its tile.\n"));
1845 _(
" * Doesn't prevent enemy cities from working the tile it's on.\n"));
1850 _(
" * Can attack units on non-native tiles.\n"));
1856 if (helptxt != NULL) {
1872 if (cbonus->quiet) {
1887 switch (cbonus->type) {
1888 case CBONUS_DEFENSE_MULTIPLIER:
1891 _(
"* %d%% defense bonus if attacked by %s.\n"),
1892 cbonus->value * 100,
1895 case CBONUS_DEFENSE_DIVIDER:
1898 _(
"* Reduces target's defense to 1 / %d when "
1903 case CBONUS_LOW_FIREPOWER:
1906 _(
"* Reduces target's firepower to 1 when "
1910 case CBONUS_DEFENSE_MULTIPLIER_PCT:
1913 _(
"* %d%% defense bonus if attacked by %s.\n"),
1917 case CBONUS_DEFENSE_DIVIDER_PCT:
1920 _(
"* Reduces target's defense to 1 / %.2f when "
1922 ((
float) cbonus->value + 100.0f) / 100.0f,
1925 case CBONUS_SCRAMBLES_PCT:
1928 _(
"* %d%% defense bonus "
1929 "instead of any bonuses from city improvements "
1930 "if attacked by %s in a city.\n"),
1947 CATLSTR(buf,
bufsz,
_(
"* Can escape once stack defender is lost.\n"));
1950 CATLSTR(buf,
bufsz,
_(
"* Can pursue escaping units and kill them.\n"));
1957 CATLSTR(buf,
bufsz,
_(
"* Only barbarians may build this.\n"));
1960 CATLSTR(buf,
bufsz,
_(
"* Can only be built in games where new cities "
1964 CATLSTR(buf,
bufsz,
_(
" - New cities are not allowed in the current "
1968 CATLSTR(buf,
bufsz,
_(
" - New cities are allowed in the current "
1980 if (!pnation->init_units[i]) {
1982 }
else if (pnation->init_units[i] == utype) {
1989 PL_(
"* The %s start the game with %d of these units.\n",
1990 "* The %s start the game with %d of these units.\n",
2000 if (utype2->converted_to == utype
2011 _(
"* May be obtained by conversion of %s.\n"),
2024 CATLSTR(buf,
bufsz,
_(
"* Losing this unit will lose you the game!\n"));
2028 _(
"* Each player may only have one of this type of unit.\n"));
2034 if (helptxt != NULL) {
2044 PL_(
"* Costs %d population to build.\n",
2045 "* Costs %d population to build.\n", utype->
pop_cost),
2062 PL_(
"* Can carry and refuel %d %s unit.\n",
2063 "* Can carry and refuel up to %d %s units.\n",
2069 bool has_restricted_load =
FALSE, has_unrestricted_load =
FALSE,
2070 has_restricted_unload =
FALSE, has_unrestricted_unload =
FALSE;
2074 has_unrestricted_load =
TRUE;
2076 has_restricted_load =
TRUE;
2079 has_unrestricted_unload =
TRUE;
2081 has_restricted_unload =
TRUE;
2085 if (has_restricted_load) {
2086 if (has_unrestricted_load) {
2091 _(
" * Some cargo cannot be loaded except in a city or a "
2092 "base native to this transport.\n"));
2097 _(
" * Cargo cannot be loaded except in a city or a "
2098 "base native to this transport.\n"));
2101 if (has_restricted_unload) {
2102 if (has_unrestricted_unload) {
2106 _(
" * Some cargo cannot be unloaded except in a city or a "
2107 "base native to this transport.\n"));
2112 _(
" * Cargo cannot be unloaded except in a city or a "
2113 "base native to this transport.\n"));
2119 CATLSTR(buf,
bufsz,
_(
"* Must stay next to safe coast.\n"));
2124 bv_unit_classes embarks, disembarks;
2136 if (!
BV_ISSET(embarks, trans_class)
2143 BV_SET(embarks, trans_class);
2147 if (!
BV_ISSET(disembarks, trans_class)
2154 BV_SET(disembarks, trans_class);
2177 _(
"* May load onto and unload from %s transports even "
2178 "when underway.\n"),
2184 _(
"* May load onto %s transports even when underway.\n"),
2204 _(
"* May unload from %s transports even when underway.\n"),
2211 CATLSTR(buf,
bufsz,
_(
"* Strong in diplomatic battles.\n"));
2215 CATLSTR(buf,
bufsz,
_(
"* Defends cities against diplomatic actions.\n"));
2218 CATLSTR(buf,
bufsz,
_(
"* Will never lose a diplomat-versus-diplomat fight.\n"));
2222 CATLSTR(buf,
bufsz,
_(
"* Will always survive a spy mission.\n"));
2224 if (utype->
vlayer == V_INVIS) {
2226 _(
"* Is invisible except when next to an enemy unit or city.\n"));
2230 _(
"* Can only attack units on native tiles.\n"));
2234 _(
"* Gets double firepower when attacking cities.\n"));
2240 _(
"* Ignores terrain effects (moving costs at most %s MP "
2245 CATLSTR(buf,
bufsz,
_(
"* Never imposes a zone of control.\n"));
2247 CATLSTR(buf,
bufsz,
_(
"* May impose a zone of control on its adjacent "
2251 CATLSTR(buf,
bufsz,
_(
"* Not subject to zones of control imposed "
2252 "by other units.\n"));
2256 _(
"* A non-military unit:\n"));
2259 _(
" * Cannot attack.\n"));
2262 _(
" * Doesn't impose martial law.\n"));
2265 _(
" * Can enter foreign territory regardless of peace treaty.\n"));
2268 _(
" * Doesn't prevent enemy cities from working the tile it's on.\n"));
2272 _(
"* A field unit: one unhappiness applies even when non-aggressive.\n"));
2278 _(
"* An enemy unit considering to auto attack this unit will "
2279 "choose to do so even if it has better odds when defending "
2280 "against it than when attacking it.\n"));
2287 _(
"* Under certain conditions the shield upkeep of this unit can "
2288 "be converted to gold upkeep.\n"));
2295 _(
"* Can attack against %s units, which are usually not "
2316 _(
"* Unit has to end each turn next to safe coast or"
2317 " in a city or a base.\n"));
2323 PL_(
"* Unit has to be next to safe coast, in a city or a base"
2324 " after %d turn.\n",
2325 "* Unit has to be next to safe coast, in a city or a base"
2326 " after %d turns.\n",
2332 PL_(
"* Unit has to be in a city or a base"
2333 " after %d turn.\n",
2334 "* Unit has to be in a city or a base"
2335 " after %d turns.\n",
2345 PL_(
"* Unit has to be next to safe coast, in a city, a base, or on a %s"
2346 " after %d turn.\n",
2347 "* Unit has to be next to safe coast, in a city, a base, or on a %s"
2348 " after %d turns.\n",
2354 PL_(
"* Unit has to be in a city, a base, or on a %s"
2355 " after %d turn.\n",
2356 "* Unit has to be in a city, a base, or on a %s"
2357 " after %d turns.\n",
2368 bool not_an_auto_attacker =
TRUE;
2371 if (auto_action->cause != AAPC_UNIT_MOVED_ADJ) {
2378 not_an_auto_attacker =
FALSE;
2383 if (not_an_auto_attacker) {
2385 _(
"* Will never be forced (by the autoattack server setting)"
2386 " to attack units moving to an adjacent tile.\n"));
2399 const char *target_adjective;
2400 char sub_target_text[100];
2407 _(
"* Can do the action \'%s\'.\n"),
2416 DRO_FOREIGN,
TRUE)) {
2418 target_adjective =
_(
"domestic ");
2420 DRO_FOREIGN,
FALSE)) {
2422 target_adjective =
_(
"foreign ");
2425 target_adjective =
"";
2428 sub_target_text[0] =
'\0';
2435 _(
"extras among "));
2440 _(action_sub_target_kind_name(
2450 _(
" * is done to %s%s%s.\n"),
2460 _(
" * uses up the %s.\n"),
2468 _(
" * can lead to a %s against a defender.\n"),
2469 action_battle_kind_translated_name(
2475 { .
kind = VUT_ACTION, .value.action = paction },
2476 { .kind = VUT_UTYPE, .value.utype = utype },
2487 _(
" * may fail because of a dice throw.\n"));
2496 _(
" * the %s may be captured while trying to"
2497 " escape after completing the mission.\n"),
2507 _(
" * ends this unit's turn.\n"));
2516 _(
" * ending up on a native tile"
2517 " after this action has been performed"
2518 " ends this unit's turn.\n"));
2528 ACTRES_PARADROP_CONQUER)) ?
2539 _(
" * target must be at the same tile.\n"));
2544 PL_(
" * target must be exactly %d tile away.\n",
2545 " * target must be exactly %d tiles away.\n",
2556 _(
" * target can be anywhere.\n"));
2561 PL_(
" * target must be at least %d tile away.\n",
2562 " * target must be at least %d tiles away.\n",
2572 PL_(
" * target can be max %d tile away.\n",
2573 " * target can be max %d tiles away.\n",
2582 PL_(
" * target must be between %d and %d tile away.\n",
2583 " * target must be between %d and %d tiles away.\n",
2592 const enum effect_type eft;
2593 const char *hlp_text;
2596 { EFT_CASUS_BELLI_SUCCESS,
N_(
"successfully") },
2598 { EFT_CASUS_BELLI_CAUGHT,
N_(
"getting caught before") },
2602 { .
kind = VUT_ACTION, .value.action = paction },
2603 { .kind = VUT_DIPLREL, },
2608 for (i = 0; i <
ARRAY_SIZE(casus_belli); i++) {
2612 const char *victim_diplrel_names[DRO_LAST];
2613 const char *outrage_diplrel_names[DRO_LAST];
2614 int victim_diplrel_count = 0;
2615 int outrage_diplrel_count = 0;
2618 for (diplrel = 0; diplrel < DS_NO_CONTACT; diplrel++) {
2619 int casus_belli_amount;
2633 outrage_diplrel_names[outrage_diplrel_count++] =
2636 victim_diplrel_names[victim_diplrel_count++] =
2643 if (outrage_diplrel_count > 0) {
2647 _(
" * %s performing this action during %s causes"
2648 " international outrage: the whole world gets "
2649 "Casus Belli against you.\n"),
2650 _(casus_belli[i].hlp_text),
2652 outrage_diplrel_count));
2655 if (victim_diplrel_count > 0) {
2659 _(
" * %s performing this action during %s gives"
2660 " the victim Casus Belli against you.\n"),
2661 _(casus_belli[i].hlp_text),
2663 victim_diplrel_count));
2670 switch (paction->
result) {
2671 case ACTRES_HELP_WONDER:
2675 _(
" * adds %d production.\n"),
2678 case ACTRES_HEAL_UNIT:
2681 { .
kind = VUT_ACTION, .value.action = paction },
2682 { .kind = VUT_UTYPE, .value.utype = utype },
2686 _(
" * restores up to %d%% of the target unit's"
2694 case ACTRES_FOUND_CITY:
2698 _(
" * is disabled in the current game.\n"));
2702 PL_(
" * initial population: %d.\n",
2703 " * initial population: %d.\n",
2707 case ACTRES_JOIN_CITY:
2710 PL_(
" * max target size: %d.\n",
2711 " * max target size: %d.\n",
2716 PL_(
" * adds %d population.\n",
2717 " * adds %d population.\n",
2721 case ACTRES_BOMBARD:
2724 _(
" * %d per turn.\n"),
2728 _(
" * These attacks will only damage (never kill)"
2729 " defenders, but damage all"
2730 " defenders on a tile, and have no risk for the"
2733 case ACTRES_UPGRADE_UNIT:
2736 _(
" * upgraded to %s or, when possible, to the unit "
2737 "type it upgrades to.\n"),
2743 _(
" * weaker when tired. If performed with less "
2744 "than a single move point left the attack power "
2745 "is reduced accordingly.\n"));
2748 case ACTRES_CONVERT:
2751 PL_(
" * is converted into %s (takes %d MP).\n",
2752 " * is converted into %s (takes %d MP).\n",
2757 case ACTRES_SPY_NUKE:
2759 case ACTRES_NUKE_UNITS:
2763 _(
" * %d%% of the population of each city inside"
2764 " the nuclear blast dies.\n"),
2768 _(
" * can never destroy city completely "
2769 "(%d%% of size 1 rounds down to 0).\n"),
2773 _(
" * can even destroy city completely "
2774 "(%d%% of size 1 rounds up to 1).\n"),
2780 _(
" * all units caught in the open by the nuclear"
2784 _(
" * a unit caught in the nuclear blast while"
2785 " inside a city has a %d%% chance of survival.\n"),
2789 _(
" * all units caught in the nuclear blast"
2795 case ACTRES_CULTIVATE:
2796 case ACTRES_TRANSFORM_TERRAIN:
2798 _(
" * converts target tile terrain to another"
2803 case ACTRES_IRRIGATE:
2826 case ACTRES_CLEAN_POLLUTION:
2827 case ACTRES_CLEAN_FALLOUT:
2849 case ACTRES_PILLAGE:
2871 case ACTRES_FORTIFY:
2873 struct universal unit_is_fortified[] = {
2874 { .
kind = VUT_ACTIVITY,
2875 .value = { .activity = ACTIVITY_FORTIFIED }},
2876 { .kind = VUT_UTYPE, .value = { .utype = utype }},
2879 EFT_FORTIFY_DEFENSE_BONUS,
2880 unit_is_fortified,
ARRAY_SIZE(unit_is_fortified));
2886 .value = { .utype = utype }},
2892 _(
" * to stay put. No defensive bonus.\n"));
2893 }
else if (bonus > 0) {
2897 _(
" * granting a %d%% defensive bonus.\n"),
2902 case ACTRES_CONQUER_EXTRAS:
2946 _(
" * if a suitable hut is at the targetet tile it"
2947 " will be entered.\n"));
2953 _(
" * if a suitable hut is at the targetet tile it"
2954 " will be frightened.\n"));
2961 _(
" * the %s may end up loaded into a transport if it"
2962 " can't survive on its own at the target tile.\n"),
2984 blockers[i] = quoted;
2995 _(
" * can't be done if %s is legal.\n"),
3000 for (; i > 0; i--) {
3002 free((
char *)(blockers[i - 1]));
3032 &(enabler->target_reqs))) {
3040 _(
"* Doing the action \'%s\' to this unit"
3041 " is impossible.\n"),
3045 if (!has_vet_levels) {
3048 CATLSTR(buf,
bufsz,
_(
"* Will never achieve veteran status.\n"));
3054 bool veteran_through_combat =
3068 _(
" * Veterans have increased strength in combat.\n"));
3075 _(
" * Veterans have improved chances in diplomatic "
3080 _(
" * Veterans are more likely to survive missions.\n"));
3086 _(
" * Veterans work faster.\n"));
3090 if (strlen(buf) > 0) {
3093 if (has_vet_levels && utype->
veteran) {
3097 _(
"This type of unit has its own veteran levels:"), NULL)) {
3116 const char *user_text,
int i)
3121 .
kind = VUT_ADVANCE,
3122 .value = {.advance = vap}
3135 if (vap->
tclass == NULL) {
3143 if (NULL != pplayer) {
3151 PL_(
"Starting now, researching %s would need %d bulb.",
3152 "Starting now, researching %s would need %d bulbs.",
3163 PL_(
" The whole project will require %d bulb to complete.",
3164 " The whole project will require %d bulbs to complete.",
3169 PL_(
"To research %s you need to research %d other"
3170 " technology first.%s",
3171 "To research %s you need to research %d other"
3172 " technologies first.%s",
3178 _(
"You cannot research this technology."));
3184 _(
" This number may vary depending on what "
3185 "other players research.\n"));
3214 _(
"* All players start the game with knowledge of this "
3231 if (pnation->init_techs[j] ==
A_LAST) {
3233 }
else if (pnation->init_techs[j] == i) {
3236 _(
"* The %s start the game with knowledge of this "
3245 bv_techs roots, rootsofroots;
3277 const char *root_techs[
A_LAST];
3283 root_techs[n_roots++]
3290 _(
"* Only those who know %s can acquire this "
3291 "technology (by any means).\n"),
3299 _(
"* The first player to learn %s gets"
3300 " an immediate advance.\n"),
3304 for (flagid = TECH_USER_1 ; flagid <= TECH_USER_LAST; flagid++) {
3308 if (helptxt != NULL) {
3319 _(
"* To preserve this technology for our nation some bulbs "
3320 "are needed each turn.\n"));
3324 if (strlen(buf) > 0) {
3339 const char *user_text,
struct terrain *pterrain)
3342 .
kind = VUT_TERRAIN,
3343 .value = {.terrain = pterrain}
3360 _(
"* You cannot build cities on this terrain."));
3367 if (pextra->buildable) {
3369 _(
"* Paths cannot be built on this terrain."));
3379 if (pextra->buildable) {
3381 _(
"* Bases cannot be built on this terrain."));
3390 _(
"* The coastline of this terrain is unsafe."));
3414 _(
"* Units on this terrain neither impose zones of control "
3415 "nor are restricted by them.\n"));
3418 _(
"* Units on this terrain may impose a zone of control, or "
3419 "be restricted by one.\n"));
3421 for (flagid = TER_USER_1 ; flagid <= TER_USER_LAST; flagid++) {
3425 if (helptxt != NULL) {
3435 if (buf[0] !=
'\0') {
3442 if (user_text && user_text[0] !=
'\0') {
3458 static char str[64];
3459 bool has_effect =
FALSE;
3475 if (
str[0] !=
'\0') {
3478 if (incr == 0 && bonus == 0) {
3501 return has_effect ?
str : NULL;
3515 { .
kind = VUT_EXTRA, .value.extra = pextra },
3516 { .kind = VUT_TERRAIN, .value.terrain = pterrain },
3517 { .kind = VUT_OTYPE }
3567 if (bonus[o] > 0 || pterrain->
output[o] > 0) {
3587 enum unit_activity act)
3589 static char buffer[256];
3594 fc_snprintf(buffer,
sizeof(buffer),
PL_(
"%d turn",
"%d turns", btime),
3599 PL_(
", +%d food",
", +%d food", bonus[0]), bonus[0]);
3603 PL_(
", +%d shield",
", +%d shields", bonus[1]), bonus[1]);
3607 PL_(
", +%d trade",
", +%d trade", bonus[2]), bonus[2]);
3620 const char *user_text,
struct extra_type *pextra)
3627 .value = {.extra = pextra}
3660 group_start = strlen(buf);
3665 _(
"Build by issuing an \"irrigate\" order.\n"));
3669 _(
"Build by issuing a \"mine\" order.\n"));
3673 _(
"Build by issuing a \"road\" order.\n"));
3678 if (pbase->
gui_type == BASE_GUI_OTHER) {
3680 _(
"Build by issuing a \"build base\" order.\n"));
3682 const char *order =
"";
3685 case BASE_GUI_FORTRESS:
3688 case BASE_GUI_AIRBASE:
3697 _(
"Build by issuing a \"%s\" order.\n"), order);
3704 _(
"May randomly appear around polluting city.\n"));
3709 _(
"May randomly appear around nuclear blast.\n"));
3717 _(
"Placed by map generator.\n"));
3722 _(
"Can be explored by certain units.\n"));
3727 _(
"May appear spontaneously.\n"));
3730 if (requirement_vector_size(&pextra->
reqs) > 0) {
3731 char reqsbuf[8192] =
"";
3739 buildable ?
Q_(
"?bullet:* ") :
"");
3741 if (reqsbuf[0] !=
'\0') {
3753 if (buf[group_start] !=
'\0') {
3757 group_start = strlen(buf);
3760 int pillage_time = -1;
3766 int terr_pillage_time = pterrain->pillage_time
3769 if (terr_pillage_time != 0) {
3770 if (pillage_time < 0) {
3771 pillage_time = terr_pillage_time;
3772 }
else if (pillage_time != terr_pillage_time) {
3780 if (pillage_time < 0) {
3782 _(
"Can be pillaged by units (time is terrain-dependent).\n"));
3783 }
else if (pillage_time > 0) {
3785 PL_(
"Can be pillaged by units (takes %d turn).\n",
3786 "Can be pillaged by units (takes %d turns).\n",
3787 pillage_time), pillage_time);
3792 int clean_time = -1;
3798 int terr_clean_time = -1;
3801 && pterrain->clean_pollution_time != 0) {
3802 terr_clean_time = pterrain->clean_pollution_time
3806 && pterrain->clean_fallout_time != 0) {
3807 int terr_clean_fall_time = pterrain->clean_fallout_time
3809 if (terr_clean_time > 0
3810 && terr_clean_time != terr_clean_fall_time) {
3816 terr_clean_time = terr_clean_fall_time;
3818 if (clean_time < 0) {
3819 clean_time = terr_clean_time;
3820 }
else if (clean_time != terr_clean_time) {
3827 if (clean_time < 0) {
3829 _(
"Can be cleaned by units (time is terrain-dependent).\n"));
3830 }
else if (clean_time > 0) {
3832 PL_(
"Can be cleaned by units (takes %d turn).\n",
3833 "Can be cleaned by units (takes %d turns).\n",
3834 clean_time), clean_time);
3838 if (requirement_vector_size(&pextra->
rmreqs) > 0) {
3839 char reqsbuf[8192] =
"";
3845 if (reqsbuf[0] !=
'\0') {
3851 if (buf[group_start] !=
'\0') {
3857 group_start = strlen(buf);
3861 if (buf[group_start] !=
'\0') {
3871 _(
"* Visible only if %s known.\n"),
3876 if (pextra->
eus == EUS_HIDDEN) {
3878 _(
"* Units inside are hidden from non-allied players.\n"));
3894 if (proad != NULL) {
3908 _(
" * Such units can move onto this tile even if it would "
3909 "not normally be suitable terrain.\n"));
3916 _(
" * Such units situated here are not considered aggressive "
3917 "if this tile is within 3 tiles of a friendly city.\n"));
3923 _(
" * Such units get a %d%% defense bonus on this "
3945 _(
"* Can be conquered by %s.\n"),
3958 _(
"* Movement cost along %s is %s MP.\n"),
3967 _(
"* Defeat of one unit does not cause death of all other units "
3968 "on this tile.\n"));
3970 if (pbase != NULL) {
3973 _(
"* Extends national borders of the building nation.\n"));
3977 _(
"* Grants permanent vision of an area around the tile to "
3982 _(
"* Allows the owner to see normally invisible stealth units "
3983 "in an area around the tile.\n"));
3987 _(
"* Allows the owner to see normally invisible subsurface units "
3988 "in an area around the tile.\n"));
3995 if (helptxt != NULL) {
4005 if (proad != NULL || pbase != NULL) {
4006 bool road, do_time, do_bonus;
4008 road = (proad != NULL);
4025 if (do_time || do_bonus) {
4026 if (do_time && do_bonus) {
4028 _(
"\nTime to build and output bonus depends on terrain:\n\n"));
4032 _(
"Terrain Time Bonus F/P/T\n"
4033 "----------------------------------\n"));
4034 }
else if (do_time) {
4036 _(
"\nTime to build depends on terrain:\n\n"));
4041 "------------------\n"));
4047 _(
"\nYields an output bonus with some terrains:\n\n"));
4049 _(
"Terrain Bonus F/P/T\n"
4050 "-------------------------\n"));;
4055 const char *bonus_text
4057 if (turns > 0 || bonus_text) {
4082 if (user_text && user_text[0] !=
'\0') {
4095 const char *user_text,
struct goods_type *pgood)
4110 _(
"There's no bonuses paid when trade route gets established.\n\n"));
4113 _(
"When trade route gets established, %d%% of the normal bonus is paid.\n"),
4141 const char *user_text,
struct specialist *pspec)
4176 const char *user_text,
struct government *gov)
4180 .
kind = VUT_GOVERNMENT,
4181 .value = {.govern = gov}
4211 const struct unit_type *unittype = NULL;
4212 enum unit_type_flag_id unitflag = unit_type_flag_id_invalid();
4216 bool too_complex =
FALSE;
4217 bool world_value_valid =
TRUE;
4225 if (!preq->present || preq->quiet) {
4229 switch (preq->source.kind) {
4241 unitclass = preq->source.value.uclass;
4243 world_value_valid =
FALSE;
4247 unittype = preq->source.value.utype;
4250 if (!unit_type_flag_id_is_valid(unitflag)) {
4251 unitflag = preq->source.value.unitflag;
4253 world_value_valid =
FALSE;
4261 case VUT_GOVERNMENT:
4265 fc_assert(preq->source.value.govern == gov);
4269 world_value_valid =
FALSE;
4284 const bool playerwide
4290 int world_value = -999, net_value = -999;
4291 if (world_value_valid) {
4300 .unittype = unittype,
4305 net_value = peffect->value + world_value;
4311 bool harvested_only =
TRUE;
4313 if (peffect->type == EFT_UPKEEP_FACTOR
4314 || peffect->type == EFT_UNIT_UPKEEP_FREE_PER_CITY
4315 || peffect->type == EFT_OUTPUT_BONUS
4316 || peffect->type == EFT_OUTPUT_BONUS_2) {
4318 harvested_only =
FALSE;
4324 if (!harvested_only || pot->
harvested) {
4332 astr_set(&outputs_or,
"%s",
Q_(
"?outputlist: Nothing "));
4333 astr_set(&outputs_and,
"%s",
Q_(
"?outputlist: Nothing "));
4339 switch (peffect->type) {
4340 case EFT_UNHAPPY_FACTOR:
4345 PL_(
"* Military units away from home and field units"
4346 " will each cause %d citizen to become unhappy.\n",
4347 "* Military units away from home and field units"
4348 " will each cause %d citizens to become unhappy.\n",
4353 case EFT_ENEMY_CITIZEN_UNHAPPY_PCT:
4354 if (playerwide && net_value != world_value) {
4355 if (world_value > 0) {
4356 if (net_value > 0) {
4358 _(
"* Unhappiness from foreign citizens due to "
4359 "war with their home state is %d%% the usual "
4361 (net_value * 100) / world_value);
4364 _(
"* No unhappiness from foreign citizens even when "
4365 "at war with their home state.\n"));
4371 _(
"* Each foreign citizen causes %.2g unhappiness "
4372 "in their city while you are at war with their "
4374 (
double)net_value / 100);
4378 case EFT_MAKE_CONTENT_MIL:
4381 PL_(
"* Each of your cities will avoid %d unhappiness"
4382 " caused by units.\n",
4383 "* Each of your cities will avoid %d unhappiness"
4384 " caused by units.\n",
4389 case EFT_MAKE_CONTENT:
4392 PL_(
"* Each of your cities will avoid %d unhappiness,"
4393 " not including that caused by aggression.\n",
4394 "* Each of your cities will avoid %d unhappiness,"
4395 " not including that caused by aggression.\n",
4400 case EFT_FORCE_CONTENT:
4403 PL_(
"* Each of your cities will avoid %d unhappiness,"
4404 " including that caused by aggression.\n",
4405 "* Each of your cities will avoid %d unhappiness,"
4406 " including that caused by aggression.\n",
4411 case EFT_UPKEEP_FACTOR:
4412 if (world_value_valid && !unittype) {
4413 if (net_value == 0) {
4418 _(
"* You pay no %s upkeep for your units.\n"),
4422 _(
"* You pay no upkeep for your units.\n"));
4424 }
else if (net_value != world_value) {
4425 double ratio = (double)net_value / world_value;
4430 _(
"* You pay %.2g times normal %s upkeep for your "
4435 _(
"* You pay %.2g times normal upkeep for your "
4442 case EFT_UNIT_UPKEEP_FREE_PER_CITY:
4450 PL_(
"* Each of your cities will avoid paying %d %s"
4451 " upkeep for your units.\n",
4452 "* Each of your cities will avoid paying %d %s"
4453 " upkeep for your units.\n", peffect->value),
4454 peffect->value,
astr_str(&outputs_and));
4459 PL_(
"* Each of your cities will avoid paying %d"
4460 " upkeep for your units.\n",
4461 "* Each of your cities will avoid paying %d"
4462 " upkeep for your units.\n", peffect->value),
4467 case EFT_CIVIL_WAR_CHANCE:
4470 _(
"* If you lose your capital,"
4471 " the base chance of civil war is %d%%.\n"),
4475 case EFT_EMPIRE_SIZE_BASE:
4478 PL_(
"* You can have %d city before an "
4479 "additional unhappy citizen appears in each city "
4480 "due to civilization size.\n",
4481 "* You can have up to %d cities before an "
4482 "additional unhappy citizen appears in each city "
4483 "due to civilization size.\n", net_value),
4487 case EFT_EMPIRE_SIZE_STEP:
4490 PL_(
"* After the first unhappy citizen due to"
4491 " civilization size, for each %d additional city"
4492 " another unhappy citizen will appear.\n",
4493 "* After the first unhappy citizen due to"
4494 " civilization size, for each %d additional cities"
4495 " another unhappy citizen will appear.\n",
4502 if (net_value < 100) {
4504 _(
"* The maximum rate you can set for science,"
4505 " gold, or luxuries is %d%%.\n"),
4509 _(
"* Has unlimited science/gold/luxuries rates.\n"));
4513 case EFT_MARTIAL_LAW_EACH:
4516 PL_(
"* Your units may impose martial law."
4517 " Each military unit inside a city will force %d"
4518 " unhappy citizen to become content.\n",
4519 "* Your units may impose martial law."
4520 " Each military unit inside a city will force %d"
4521 " unhappy citizens to become content.\n",
4526 case EFT_MARTIAL_LAW_MAX:
4527 if (playerwide && net_value < 100) {
4529 PL_(
"* A maximum of %d unit in each city can enforce"
4531 "* A maximum of %d units in each city can enforce"
4537 case EFT_RAPTURE_GROW:
4538 if (playerwide && net_value > 0) {
4540 _(
"* You may grow your cities by means of "
4546 _(
" (Cities below size %d cannot grow in this way.)"),
4552 case EFT_REVOLUTION_UNHAPPINESS:
4555 PL_(
"* If a city is in disorder for more than %d turn "
4556 "in a row, government will fall into anarchy.\n",
4557 "* If a city is in disorder for more than %d turns "
4558 "in a row, government will fall into anarchy.\n",
4563 case EFT_HAS_SENATE:
4564 if (playerwide && net_value > 0) {
4566 _(
"* Has a senate that may prevent declaration of war.\n"));
4569 case EFT_INSPIRE_PARTISANS:
4570 if (playerwide && net_value > 0) {
4572 _(
"* Allows partisans when cities are taken by the "
4576 case EFT_HAPPINESS_TO_GOLD:
4577 if (playerwide && net_value > 0) {
4579 _(
"* Buildings that normally confer bonuses against"
4580 " unhappiness will instead give gold.\n"));
4584 if (playerwide && net_value > 0) {
4595 _(
"* Pays no upkeep for %s.\n"),
4601 case EFT_NO_UNHAPPY:
4602 if (playerwide && net_value > 0) {
4606 case EFT_VETERAN_BUILD:
4615 if (unit_type_flag_id_is_valid(unitflag)) {
4618 if (conditions > 1) {
4628 Q_(
"?unitclass:* New %s units will be veteran.\n"),
4630 }
else if (unit_type_flag_id_is_valid(unitflag)) {
4634 Q_(
"?unitflag:* New %s units will be veteran.\n"),
4635 unit_type_flag_id_translated_name(unitflag));
4636 }
else if (unittype != NULL) {
4637 if (world_value_valid && net_value > 0) {
4646 Q_(
"?unittype:* New %s units will have the rank "
4655 _(
"* New units will be veteran.\n"));
4659 case EFT_OUTPUT_PENALTY_TILE:
4660 if (world_value_valid) {
4665 PL_(
"* Each worked tile that gives more than %d %s will"
4666 " suffer a -1 penalty, unless the city working it"
4668 "* Each worked tile that gives more than %d %s will"
4669 " suffer a -1 penalty, unless the city working it"
4670 " is celebrating.", net_value),
4676 _(
" (Cities below size %d will not celebrate.)"),
4682 case EFT_OUTPUT_INC_TILE_CELEBRATE:
4685 PL_(
"* Each worked tile with at least 1 %s will yield"
4686 " %d more of it while the city working it is"
4688 "* Each worked tile with at least 1 %s will yield"
4689 " %d more of it while the city working it is"
4690 " celebrating.", peffect->value),
4691 astr_str(&outputs_or), peffect->value);
4696 _(
" (Cities below size %d will not celebrate.)"),
4701 case EFT_OUTPUT_INC_TILE:
4704 PL_(
"* Each worked tile with at least 1 %s will yield"
4705 " %d more of it.\n",
4706 "* Each worked tile with at least 1 %s will yield"
4707 " %d more of it.\n", peffect->value),
4708 astr_str(&outputs_or), peffect->value);
4710 case EFT_OUTPUT_BONUS:
4711 case EFT_OUTPUT_BONUS_2:
4715 _(
"* %s production is increased %d%%.\n"),
4716 astr_str(&outputs_and), peffect->value);
4718 case EFT_OUTPUT_WASTE:
4719 if (world_value_valid) {
4720 if (net_value > 30) {
4723 _(
"* %s production will suffer massive losses.\n"),
4725 }
else if (net_value >= 15) {
4728 _(
"* %s production will suffer some losses.\n"),
4730 }
else if (net_value > 0) {
4733 _(
"* %s production will suffer a small amount "
4739 case EFT_HEALTH_PCT:
4741 if (peffect->value > 0) {
4743 " within your cities.\n"));
4744 }
else if (peffect->value < 0) {
4746 " within your cities.\n"));
4750 case EFT_OUTPUT_WASTE_BY_REL_DISTANCE:
4754 net_value = (net_value + 39) / 40;
4756 case EFT_OUTPUT_WASTE_BY_DISTANCE:
4757 if (world_value_valid) {
4758 if (net_value >= 300) {
4761 _(
"* %s losses will increase quickly"
4762 " with distance from capital.\n"),
4764 }
else if (net_value >= 200) {
4767 _(
"* %s losses will increase"
4768 " with distance from capital.\n"),
4770 }
else if (net_value > 0) {
4773 _(
"* %s losses will increase slowly"
4774 " with distance from capital.\n"),
4779 case EFT_MIGRATION_PCT:
4781 if (peffect->value > 0) {
4783 " into your cities.\n"));
4784 }
else if (peffect->value < 0) {
4786 " into your cities.\n"));
4790 case EFT_BORDER_VISION:
4792 && playerwide && net_value > 0) {
4819 _(
"* Makes it impossible to do the action \'%s\'"
4826 if (user_text && user_text[0] !=
'\0') {
4836 static char buf[128];
4846 if (utype->
upkeep[o] > 0) {
4849 (any > 0 ?
Q_(
"?blistmore:, ") :
""), utype->
upkeep[o],
4857 (any > 0 ?
Q_(
"?blistmore:, ") :
""), utype->
happy_cost);
4872 const char *user_text)
4876 .value = {.nation = pnation}
4878 bool print_break =
TRUE;
4880#define PRINT_BREAK() do { \
4881 if (print_break) { \
4882 if (buf[0] != '\0') { \
4883 CATLSTR(buf, bufsz, "\n\n"); \
4885 print_break = FALSE; \
4892 if (pnation->
legend[0] !=
'\0') {
4900 _(
"Initial government is %s.\n"),
4920 _(
"Starts with knowledge of %s in addition to the standard "
4932 int i, j,
n = 0, total = 0;
4939 for (j = 0; j <
n; j++) {
4958 for (i = 0; i <
n; i++) {
4973 for (i = 0; i <
n; i++) {
4974 utype_name_strs[i] =
astr_str(&utype_names[i]);
4978 for (i = 0; i <
n; i++) {
4986 PL_(
"Starts with the following additional unit: %s.\n",
4987 "Starts with the following additional units: %s.\n",
5010 _(
"First city will get %s for free in addition to the "
5020 if (buf[0] !=
'\0') {
5025 if (user_text && user_text[0] !=
'\0') {
5026 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)