Freeciv-3.4
Loading...
Searching...
No Matches
reqtext.c
Go to the documentation of this file.
1/****************************************************************************
2 Freeciv - Copyright (C) 2004 - The Freeciv Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12****************************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "astring.h"
20#include "fcintl.h"
21
22/* common */
23#include "achievements.h"
24#include "actions.h"
25#include "calendar.h"
26#include "counters.h"
27#include "extras.h"
28#include "government.h"
29#include "map.h"
30#include "movement.h"
31#include "nation.h"
32#include "player.h"
33#include "requirements.h"
34#include "server_settings.h"
35#include "specialist.h"
36#include "terrain.h"
37
38#include "reqtext.h"
39
40/*************************************************************/
48bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer,
49 const struct requirement *preq,
50 enum rt_verbosity verb, const char *prefix)
51{
52 if (preq->quiet && verb != VERB_ACTUAL) {
53 return FALSE;
54 }
55
56 switch (preq->source.kind) {
57 case VUT_NONE:
58 return FALSE;
59
60 case VUT_COUNTER:
61 if (preq->present) {
62
63 fc_strlcat(buf, prefix, bufsz);
65 _("Requires counter %s to achieve at minimum %d value."),
66 counter_rule_name(preq->source.value.counter),
67 preq->source.value.counter->checkpoint);
68 } else {
69
70 fc_strlcat(buf, prefix, bufsz);
72 _("Requires counter %s to be less than %d value."),
73 counter_rule_name(preq->source.value.counter),
74 preq->source.value.counter->checkpoint - 1);
75 }
76 break;
77 case VUT_ADVANCE:
78 switch (preq->range) {
80 fc_strlcat(buf, prefix, bufsz);
81 if (preq->present) {
83 _("Requires knowledge of the technology %s."),
84 advance_name_translation(preq->source.value.advance));
85 } else {
87 _("Prevented by knowledge of the technology %s."),
88 advance_name_translation(preq->source.value.advance));
89 }
90 return TRUE;
91 case REQ_RANGE_TEAM:
92 fc_strlcat(buf, prefix, bufsz);
93 if (preq->present) {
95 _("Requires that a player on your team knows the "
96 "technology %s."),
97 advance_name_translation(preq->source.value.advance));
98 } else {
100 _("Prevented if any player on your team knows the "
101 "technology %s."),
102 advance_name_translation(preq->source.value.advance));
103 }
104 return TRUE;
106 fc_strlcat(buf, prefix, bufsz);
107 if (preq->present) {
109 _("Requires that a player allied to you knows the "
110 "technology %s."),
111 advance_name_translation(preq->source.value.advance));
112 } else {
114 _("Prevented if any player allied to you knows the "
115 "technology %s."),
116 advance_name_translation(preq->source.value.advance));
117 }
118 return TRUE;
119 case REQ_RANGE_WORLD:
120 fc_strlcat(buf, prefix, bufsz);
121 if (preq->survives) {
122 if (preq->present) {
124 _("Requires that someone has discovered the "
125 "technology %s."),
126 advance_name_translation(preq->source.value.advance));
127 } else {
129 _("Requires that no-one has yet discovered the "
130 "technology %s."),
131 advance_name_translation(preq->source.value.advance));
132 }
133 } else {
134 if (preq->present) {
136 _("Requires that some player knows the "
137 "technology %s."),
138 advance_name_translation(preq->source.value.advance));
139 } else {
141 _("Requires that no player knows the "
142 "technology %s."),
143 advance_name_translation(preq->source.value.advance));
144 }
145 }
146 return TRUE;
147 case REQ_RANGE_LOCAL:
148 case REQ_RANGE_TILE:
151 case REQ_RANGE_CITY:
154 case REQ_RANGE_COUNT:
155 /* Not supported. */
156 break;
157 }
158 break;
159
160 case VUT_TECHFLAG:
161 switch (preq->range) {
162 case REQ_RANGE_PLAYER:
163 fc_strlcat(buf, prefix, bufsz);
164 if (preq->present) {
166 /* TRANS: %s is a (translatable) tech flag. */
167 _("Requires knowledge of a technology with the "
168 "\"%s\" flag."),
169 tech_flag_id_translated_name(preq->source.value.techflag));
170 } else {
172 /* TRANS: %s is a (translatable) tech flag. */
173 _("Prevented by knowledge of any technology with the "
174 "\"%s\" flag."),
175 tech_flag_id_translated_name(preq->source.value.techflag));
176 }
177 return TRUE;
178 case REQ_RANGE_TEAM:
179 fc_strlcat(buf, prefix, bufsz);
180 if (preq->present) {
182 /* TRANS: %s is a (translatable) tech flag. */
183 _("Requires that a player on your team knows "
184 "a technology with the \"%s\" flag."),
185 tech_flag_id_translated_name(preq->source.value.techflag));
186 } else {
188 /* TRANS: %s is a (translatable) tech flag. */
189 _("Prevented if any player on your team knows "
190 "any technology with the \"%s\" flag."),
191 tech_flag_id_translated_name(preq->source.value.techflag));
192 }
193 return TRUE;
195 fc_strlcat(buf, prefix, bufsz);
196 if (preq->present) {
198 /* TRANS: %s is a (translatable) tech flag. */
199 _("Requires that a player allied to you knows "
200 "a technology with the \"%s\" flag."),
201 tech_flag_id_translated_name(preq->source.value.techflag));
202 } else {
204 /* TRANS: %s is a (translatable) tech flag. */
205 _("Prevented if any player allied to you knows "
206 "any technology with the \"%s\" flag."),
207 tech_flag_id_translated_name(preq->source.value.techflag));
208 }
209 return TRUE;
210 case REQ_RANGE_WORLD:
211 fc_strlcat(buf, prefix, bufsz);
212 if (preq->present) {
214 /* TRANS: %s is a (translatable) tech flag. */
215 _("Requires that some player knows a technology "
216 "with the \"%s\" flag."),
217 tech_flag_id_translated_name(preq->source.value.techflag));
218 } else {
220 /* TRANS: %s is a (translatable) tech flag. */
221 _("Requires that no player knows any technology with "
222 "the \"%s\" flag."),
223 tech_flag_id_translated_name(preq->source.value.techflag));
224 }
225 return TRUE;
226 case REQ_RANGE_LOCAL:
227 case REQ_RANGE_TILE:
230 case REQ_RANGE_CITY:
233 case REQ_RANGE_COUNT:
234 /* Not supported. */
235 break;
236 }
237 break;
238
239 case VUT_GOVERNMENT:
240 if (preq->range != REQ_RANGE_PLAYER) {
241 break;
242 }
243 fc_strlcat(buf, prefix, bufsz);
244 if (preq->present) {
245 cat_snprintf(buf, bufsz, _("Requires the %s government."),
246 government_name_translation(preq->source.value.govern));
247 } else {
248 cat_snprintf(buf, bufsz, _("Not available under the %s government."),
249 government_name_translation(preq->source.value.govern));
250 }
251 return TRUE;
252
253 case VUT_GOVFLAG:
254 if (preq->range != REQ_RANGE_PLAYER) {
255 break;
256 }
257 fc_strlcat(buf, prefix, bufsz);
258 if (preq->present) {
259 cat_snprintf(buf, bufsz, _("Requires a %s government."),
260 gov_flag_id_translated_name(preq->source.value.govflag));
261 } else {
262 cat_snprintf(buf, bufsz, _("Not available under a %s government."),
263 gov_flag_id_translated_name(preq->source.value.govflag));
264 }
265 return TRUE;
266
267 case VUT_ACHIEVEMENT:
268 switch (preq->range) {
269 case REQ_RANGE_PLAYER:
270 fc_strlcat(buf, prefix, bufsz);
271 if (preq->present) {
272 cat_snprintf(buf, bufsz, _("Requires you to have achieved \"%s\"."),
273 achievement_name_translation(preq->source.value.achievement));
274 } else {
275 cat_snprintf(buf, bufsz, _("Not available once you have achieved "
276 "\"%s\"."),
277 achievement_name_translation(preq->source.value.achievement));
278 }
279 return TRUE;
280 case REQ_RANGE_TEAM:
281 fc_strlcat(buf, prefix, bufsz);
282 if (preq->present) {
283 cat_snprintf(buf, bufsz, _("Requires that at least one of your "
284 "team-mates has achieved \"%s\"."),
285 achievement_name_translation(preq->source.value.achievement));
286 } else {
287 cat_snprintf(buf, bufsz, _("Not available if any of your team-mates "
288 "has achieved \"%s\"."),
289 achievement_name_translation(preq->source.value.achievement));
290 }
291 return TRUE;
293 fc_strlcat(buf, prefix, bufsz);
294 if (preq->present) {
295 cat_snprintf(buf, bufsz, _("Requires that at least one of your allies "
296 "has achieved \"%s\"."),
297 achievement_name_translation(preq->source.value.achievement));
298 } else {
299 cat_snprintf(buf, bufsz, _("Not available if any of your allies has "
300 "achieved \"%s\"."),
301 achievement_name_translation(preq->source.value.achievement));
302 }
303 return TRUE;
304 case REQ_RANGE_WORLD:
305 fc_strlcat(buf, prefix, bufsz);
306 if (preq->present) {
307 cat_snprintf(buf, bufsz, _("Requires that at least one player "
308 "has achieved \"%s\"."),
309 achievement_name_translation(preq->source.value.achievement));
310 } else {
311 cat_snprintf(buf, bufsz, _("Not available if any player has "
312 "achieved \"%s\"."),
313 achievement_name_translation(preq->source.value.achievement));
314 }
315 return TRUE;
316 case REQ_RANGE_LOCAL:
317 case REQ_RANGE_TILE:
320 case REQ_RANGE_CITY:
323 case REQ_RANGE_COUNT:
324 /* Not supported. */
325 break;
326 }
327 break;
328
329 case VUT_ACTION:
330 switch (preq->range) {
331 case REQ_RANGE_LOCAL:
332 fc_strlcat(buf, prefix, bufsz);
333 if (preq->present) {
334 cat_snprintf(buf, bufsz, _("Applies to the \"%s\" action."),
335 action_name_translation(preq->source.value.action));
336 } else {
337 cat_snprintf(buf, bufsz, _("Doesn't apply to the \"%s\""
338 " action."),
339 action_name_translation(preq->source.value.action));
340 }
341 return TRUE;
342 default:
343 /* Not supported. */
344 break;
345 }
346 break;
347
348 case VUT_IMPR_GENUS:
349 switch (preq->range) {
350 case REQ_RANGE_LOCAL:
351 fc_strlcat(buf, prefix, bufsz);
352 if (preq->present) {
353 cat_snprintf(buf, bufsz, _("Applies to \"%s\" buildings."),
355 preq->source.value.impr_genus));
356 } else {
357 cat_snprintf(buf, bufsz, _("Doesn't apply to \"%s\" buildings."),
359 preq->source.value.impr_genus));
360 }
361 return TRUE;
362 default:
363 /* Not supported. */
364 break;
365 }
366 break;
367
368 case VUT_IMPR_FLAG:
369 switch (preq->range) {
370 case REQ_RANGE_LOCAL:
371 fc_strlcat(buf, prefix, bufsz);
372 if (preq->present) {
373 cat_snprintf(buf, bufsz, _("Applies to \"%s\" buildings."),
375 preq->source.value.impr_flag));
376 } else {
377 cat_snprintf(buf, bufsz, _("Doesn't apply to \"%s\" buildings."),
379 preq->source.value.impr_flag));
380 }
381 return TRUE;
382 default:
383 /* Not supported. */
384 break;
385 }
386 break;
387
388 case VUT_PLAYER_FLAG:
389 switch (preq->range) {
390 case REQ_RANGE_PLAYER:
391 fc_strlcat(buf, prefix, bufsz);
392 if (preq->present) {
393 cat_snprintf(buf, bufsz, _("Applies to players with \"%s\" flag."),
395 preq->source.value.plr_flag));
396 } else {
397 cat_snprintf(buf, bufsz, _("Doesn't apply to players with \"%s\" flag."),
399 preq->source.value.plr_flag));
400 }
401 return TRUE;
402 default:
403 /* Not supported. */
404 break;
405 }
406 break;
407
408 case VUT_PLAYER_STATE:
409 switch (preq->range) {
410 case REQ_RANGE_PLAYER:
411 fc_strlcat(buf, prefix, bufsz);
412 if (preq->present) {
413 cat_snprintf(buf, bufsz, _("Applies to \"%s\" players."),
414 plrstate_type_translated_name(preq->source.value.plrstate));
415 } else {
416 cat_snprintf(buf, bufsz, _("Doesn't apply to \"%s\" players."),
417 plrstate_type_translated_name(preq->source.value.plrstate));
418 }
419 return TRUE;
420 default:
421 /* Not supported. */
422 break;
423 }
424 break;
425
426 case VUT_IMPROVEMENT:
427 case VUT_SITE:
428 switch (preq->range) {
429 case REQ_RANGE_WORLD:
430 if (is_great_wonder(preq->source.value.building)) {
431 fc_strlcat(buf, prefix, bufsz);
432 if (preq->survives) {
433 if (preq->present) {
434 if (preq->source.kind == VUT_IMPROVEMENT
435 && can_improvement_go_obsolete(preq->source.value.building)) {
437 /* TRANS: %s is a wonder */
438 _("Requires that %s was built at some point, "
439 "and that it has not yet been rendered "
440 "obsolete."),
442 (preq->source.value.building));
443 } else {
445 /* TRANS: %s is a wonder */
446 _("Requires that %s was built at some point."),
448 (preq->source.value.building));
449 }
450 } else {
451 if (preq->source.kind == VUT_IMPROVEMENT
452 && can_improvement_go_obsolete(preq->source.value.building)) {
454 /* TRANS: %s is a wonder */
455 _("Prevented if %s has ever been built, "
456 "unless it would be obsolete."),
458 (preq->source.value.building));
459 } else {
461 /* TRANS: %s is a wonder */
462 _("Prevented if %s has ever been built."),
464 (preq->source.value.building));
465 }
466 }
467 } else {
468 /* Non-surviving requirement */
469 if (preq->present) {
470 if (preq->source.kind == VUT_IMPROVEMENT
471 && can_improvement_go_obsolete(preq->source.value.building)) {
473 /* TRANS: %s is a wonder */
474 _("Requires %s to be owned by any player "
475 "and not yet obsolete."),
477 (preq->source.value.building));
478 } else {
480 /* TRANS: %s is a wonder */
481 _("Requires %s to be owned by any player."),
483 (preq->source.value.building));
484 }
485 } else {
486 if (preq->source.kind == VUT_IMPROVEMENT
487 && can_improvement_go_obsolete(preq->source.value.building)) {
489 /* TRANS: %s is a wonder */
490 _("Prevented if %s is currently owned by "
491 "any player, unless it is obsolete."),
493 (preq->source.value.building));
494 } else {
496 /* TRANS: %s is a wonder */
497 _("Prevented if %s is currently owned by "
498 "any player."),
500 (preq->source.value.building));
501 }
502 }
503 }
504 return TRUE;
505 }
506 /* Non-great-wonder world-ranged requirements not supported */
507 break;
509 if (is_wonder(preq->source.value.building)) {
510 fc_strlcat(buf, prefix, bufsz);
511 if (preq->survives) {
512 if (preq->present) {
513 if (preq->source.kind == VUT_IMPROVEMENT
514 && can_improvement_go_obsolete(preq->source.value.building)) {
516 /* TRANS: %s is a wonder */
517 _("Requires someone who is currently allied to "
518 "you to have built %s at some point, and for "
519 "it not to have been rendered obsolete."),
521 (preq->source.value.building));
522 } else {
524 /* TRANS: %s is a wonder */
525 _("Requires someone who is currently allied to "
526 "you to have built %s at some point."),
528 (preq->source.value.building));
529 }
530 } else {
531 if (preq->source.kind == VUT_IMPROVEMENT
532 && can_improvement_go_obsolete(preq->source.value.building)) {
534 /* TRANS: %s is a wonder */
535 _("Prevented if someone currently allied to you "
536 "has ever built %s, unless it would be "
537 "obsolete."),
539 (preq->source.value.building));
540 } else {
542 /* TRANS: %s is a wonder */
543 _("Prevented if someone currently allied to you "
544 "has ever built %s."),
546 (preq->source.value.building));
547 }
548 }
549 } else {
550 /* Non-surviving requirement */
551 if (preq->present) {
552 if (preq->source.kind == VUT_IMPROVEMENT
553 && can_improvement_go_obsolete(preq->source.value.building)) {
555 /* TRANS: %s is a wonder */
556 _("Requires someone allied to you to own %s, "
557 "and for it not to have been rendered "
558 "obsolete."),
560 (preq->source.value.building));
561 } else {
563 /* TRANS: %s is a wonder */
564 _("Requires someone allied to you to own %s."),
566 (preq->source.value.building));
567 }
568 } else {
569 if (preq->source.kind == VUT_IMPROVEMENT
570 && can_improvement_go_obsolete(preq->source.value.building)) {
572 /* TRANS: %s is a wonder */
573 _("Prevented if someone allied to you owns %s, "
574 "unless it is obsolete."),
576 (preq->source.value.building));
577 } else {
579 /* TRANS: %s is a wonder */
580 _("Prevented if someone allied to you owns %s."),
582 (preq->source.value.building));
583 }
584 }
585 }
586 return TRUE;
587 }
588 /* Non-wonder alliance-ranged requirements not supported */
589 break;
590 case REQ_RANGE_TEAM:
591 if (is_wonder(preq->source.value.building)) {
592 fc_strlcat(buf, prefix, bufsz);
593 if (preq->survives) {
594 if (preq->present) {
595 if (preq->source.kind == VUT_IMPROVEMENT
596 && can_improvement_go_obsolete(preq->source.value.building)) {
598 /* TRANS: %s is a wonder */
599 _("Requires someone on your team to have "
600 "built %s at some point, and for it not "
601 "to have been rendered obsolete."),
603 (preq->source.value.building));
604 } else {
606 /* TRANS: %s is a wonder */
607 _("Requires someone on your team to have "
608 "built %s at some point."),
610 (preq->source.value.building));
611 }
612 } else {
613 if (preq->source.kind == VUT_IMPROVEMENT
614 && can_improvement_go_obsolete(preq->source.value.building)) {
616 /* TRANS: %s is a wonder */
617 _("Prevented if someone on your team has ever "
618 "built %s, unless it would be obsolete."),
620 (preq->source.value.building));
621 } else {
623 /* TRANS: %s is a wonder */
624 _("Prevented if someone on your team has ever "
625 "built %s."),
627 (preq->source.value.building));
628 }
629 }
630 } else {
631 /* Non-surviving requirement */
632 if (preq->present) {
633 if (preq->source.kind == VUT_IMPROVEMENT
634 && can_improvement_go_obsolete(preq->source.value.building)) {
636 /* TRANS: %s is a wonder */
637 _("Requires someone on your team to own %s, "
638 "and for it not to have been rendered "
639 "obsolete."),
641 (preq->source.value.building));
642 } else {
644 /* TRANS: %s is a wonder */
645 _("Requires someone on your team to own %s."),
647 (preq->source.value.building));
648 }
649 } else {
650 if (preq->source.kind == VUT_IMPROVEMENT
651 && can_improvement_go_obsolete(preq->source.value.building)) {
653 /* TRANS: %s is a wonder */
654 _("Prevented if someone on your team owns %s, "
655 "unless it is obsolete."),
657 (preq->source.value.building));
658 } else {
660 /* TRANS: %s is a wonder */
661 _("Prevented if someone on your team owns %s."),
663 (preq->source.value.building));
664 }
665 }
666 }
667 return TRUE;
668 }
669 /* Non-wonder team-ranged requirements not supported */
670 break;
671 case REQ_RANGE_PLAYER:
672 if (is_wonder(preq->source.value.building)) {
673 fc_strlcat(buf, prefix, bufsz);
674 if (preq->survives) {
675 if (preq->present) {
676 if (preq->source.kind == VUT_IMPROVEMENT
677 && can_improvement_go_obsolete(preq->source.value.building)) {
679 /* TRANS: %s is a wonder */
680 _("Requires you to have built %s at some point, "
681 "and for it not to have been rendered "
682 "obsolete."),
684 (preq->source.value.building));
685 } else {
687 /* TRANS: %s is a wonder */
688 _("Requires you to have built %s at some point."),
690 (preq->source.value.building));
691 }
692 } else {
693 if (preq->source.kind == VUT_IMPROVEMENT
694 && can_improvement_go_obsolete(preq->source.value.building)) {
696 /* TRANS: %s is a wonder */
697 _("Prevented if you have ever built %s, "
698 "unless it would be obsolete."),
700 (preq->source.value.building));
701 } else {
703 /* TRANS: %s is a wonder */
704 _("Prevented if you have ever built %s."),
706 (preq->source.value.building));
707 }
708 }
709 } else {
710 /* Non-surviving requirement */
711 if (preq->present) {
712 if (preq->source.kind == VUT_IMPROVEMENT
713 && can_improvement_go_obsolete(preq->source.value.building)) {
715 /* TRANS: %s is a wonder */
716 _("Requires you to own %s, which must not "
717 "be obsolete."),
719 (preq->source.value.building));
720 } else {
722 /* TRANS: %s is a wonder */
723 _("Requires you to own %s."),
725 (preq->source.value.building));
726 }
727 } else {
728 if (preq->source.kind == VUT_IMPROVEMENT
729 && can_improvement_go_obsolete(preq->source.value.building)) {
731 /* TRANS: %s is a wonder */
732 _("Prevented if you own %s, unless it is "
733 "obsolete."),
735 (preq->source.value.building));
736 } else {
738 /* TRANS: %s is a wonder */
739 _("Prevented if you own %s."),
741 (preq->source.value.building));
742 }
743 }
744 }
745 return TRUE;
746 }
747 /* Non-wonder player-ranged requirements not supported */
748 break;
750 if (is_wonder(preq->source.value.building)) {
751 fc_strlcat(buf, prefix, bufsz);
752 if (preq->present) {
753 if (preq->source.kind == VUT_IMPROVEMENT
754 && can_improvement_go_obsolete(preq->source.value.building)) {
756 /* TRANS: %s is a wonder */
757 _("Requires %s in one of your cities on the same "
758 "continent, and not yet obsolete."),
760 (preq->source.value.building));
761 } else {
763 /* TRANS: %s is a wonder */
764 _("Requires %s in one of your cities on the same "
765 "continent."),
767 (preq->source.value.building));
768 }
769 } else {
770 if (preq->source.kind == VUT_IMPROVEMENT
771 && can_improvement_go_obsolete(preq->source.value.building)) {
773 /* TRANS: %s is a wonder */
774 _("Prevented if %s is in one of your cities on the "
775 "same continent, unless it is obsolete."),
777 (preq->source.value.building));
778 } else {
780 /* TRANS: %s is a wonder */
781 _("Prevented if %s is in one of your cities on the "
782 "same continent."),
784 (preq->source.value.building));
785 }
786 }
787 return TRUE;
788 }
789 /* Surviving or non-wonder continent-ranged requirements not supported */
790 break;
792 fc_strlcat(buf, prefix, bufsz);
793 if (preq->present) {
794 if (preq->source.kind == VUT_IMPROVEMENT
795 && can_improvement_go_obsolete(preq->source.value.building)) {
796 /* Should only apply to wonders */
798 /* TRANS: %s is a building or wonder */
799 _("Requires %s in the city or a trade partner "
800 "(and not yet obsolete)."),
802 (preq->source.value.building));
803 } else {
805 /* TRANS: %s is a building or wonder */
806 _("Requires %s in the city or a trade partner."),
808 (preq->source.value.building));
809 }
810 } else {
811 if (preq->source.kind == VUT_IMPROVEMENT
812 && can_improvement_go_obsolete(preq->source.value.building)) {
813 /* Should only apply to wonders */
815 /* TRANS: %s is a building or wonder */
816 _("Prevented by %s in the city or a trade partner "
817 "(unless it is obsolete)."),
819 (preq->source.value.building));
820 } else {
822 /* TRANS: %s is a building or wonder */
823 _("Prevented by %s in the city or a trade partner."),
825 (preq->source.value.building));
826 }
827 }
828 return TRUE;
829 case REQ_RANGE_CITY:
830 fc_strlcat(buf, prefix, bufsz);
831 if (preq->present) {
832 if (preq->source.kind == VUT_IMPROVEMENT
833 && can_improvement_go_obsolete(preq->source.value.building)) {
834 /* Should only apply to wonders */
836 /* TRANS: %s is a building or wonder */
837 _("Requires %s in the city (and not yet obsolete)."),
839 (preq->source.value.building));
840 } else {
842 /* TRANS: %s is a building or wonder */
843 _("Requires %s in the city."),
845 (preq->source.value.building));
846 }
847 } else {
848 if (preq->source.kind == VUT_IMPROVEMENT
849 && can_improvement_go_obsolete(preq->source.value.building)) {
850 /* Should only apply to wonders */
852 /* TRANS: %s is a building or wonder */
853 _("Prevented by %s in the city (unless it is "
854 "obsolete)."),
856 (preq->source.value.building));
857 } else {
859 /* TRANS: %s is a building or wonder */
860 _("Prevented by %s in the city."),
862 (preq->source.value.building));
863 }
864 }
865 return TRUE;
866 case REQ_RANGE_LOCAL:
867 fc_strlcat(buf, prefix, bufsz);
868 if (preq->present) {
870 _("Only applies to \"%s\" buildings."),
872 (preq->source.value.building));
873 } else {
875 _("Does not apply to \"%s\" buildings."),
877 (preq->source.value.building));
878 }
879 return TRUE;
880 case REQ_RANGE_TILE:
881 fc_strlcat(buf, prefix, bufsz);
882 if (preq->present) {
884 _("Requires \"%s\" building in a city on the tile."),
886 (preq->source.value.building));
887 } else {
889 _("Prevented by \"%s\" building in a city on the tile."),
891 (preq->source.value.building));
892 }
893 return TRUE;
896 case REQ_RANGE_COUNT:
897 /* Not supported. */
898 break;
899 }
900 break;
901
902 case VUT_EXTRA:
903 switch (preq->range) {
904 case REQ_RANGE_LOCAL:
905 fc_strlcat(buf, prefix, bufsz);
906 if (preq->present) {
908 _("Only applies to \"%s\" extras."),
909 extra_name_translation(preq->source.value.extra));
910 } else {
912 _("Does not apply to \"%s\" extras."),
913 extra_name_translation(preq->source.value.extra));
914 }
915 return TRUE;
916 case REQ_RANGE_TILE:
917 fc_strlcat(buf, prefix, bufsz);
918 if (preq->present) {
920 Q_("?extra:Requires %s on the tile."),
921 extra_name_translation(preq->source.value.extra));
922 } else {
924 Q_("?extra:Prevented by %s on the tile."),
925 extra_name_translation(preq->source.value.extra));
926 }
927 return TRUE;
929 fc_strlcat(buf, prefix, bufsz);
930 if (preq->present) {
932 Q_("?extra:Requires %s on the tile or a cardinally "
933 "adjacent tile."),
934 extra_name_translation(preq->source.value.extra));
935 } else {
937 Q_("?extra:Prevented by %s on the tile or any cardinally "
938 "adjacent tile."),
939 extra_name_translation(preq->source.value.extra));
940 }
941 return TRUE;
943 fc_strlcat(buf, prefix, bufsz);
944 if (preq->present) {
946 Q_("?extra:Requires %s on the tile or an adjacent "
947 "tile."),
948 extra_name_translation(preq->source.value.extra));
949 } else {
951 Q_("?extra:Prevented by %s on the tile or any adjacent "
952 "tile."),
953 extra_name_translation(preq->source.value.extra));
954 }
955 return TRUE;
956 case REQ_RANGE_CITY:
957 fc_strlcat(buf, prefix, bufsz);
958 if (preq->present) {
960 Q_("?extra:Requires %s on a tile within the city "
961 "radius."),
962 extra_name_translation(preq->source.value.extra));
963 } else {
965 Q_("?extra:Prevented by %s on any tile within the city "
966 "radius."),
967 extra_name_translation(preq->source.value.extra));
968 }
969 return TRUE;
971 fc_strlcat(buf, prefix, bufsz);
972 if (preq->present) {
974 Q_("?extra:Requires %s on a tile within the city "
975 "radius, or the city radius of a trade partner."),
976 extra_name_translation(preq->source.value.extra));
977 } else {
979 Q_("?extra:Prevented by %s on any tile within the city "
980 "radius or the city radius of a trade partner."),
981 extra_name_translation(preq->source.value.extra));
982 }
983 return TRUE;
985 case REQ_RANGE_PLAYER:
986 case REQ_RANGE_TEAM:
988 case REQ_RANGE_WORLD:
989 case REQ_RANGE_COUNT:
990 /* Not supported. */
991 break;
992 }
993 break;
994
995 case VUT_GOOD:
996 switch (preq->range) {
997 case REQ_RANGE_CITY:
998 fc_strlcat(buf, prefix, bufsz);
999 if (preq->present) {
1000 cat_snprintf(buf, bufsz, Q_("?good:Requires import of %s ."),
1001 goods_name_translation(preq->source.value.good));
1002 } else {
1003 cat_snprintf(buf, bufsz, Q_("?goods:Prevented by import of %s."),
1004 goods_name_translation(preq->source.value.good));
1005 }
1006 return TRUE;
1007 case REQ_RANGE_LOCAL:
1008 case REQ_RANGE_TILE:
1010 case REQ_RANGE_ADJACENT:
1013 case REQ_RANGE_PLAYER:
1014 case REQ_RANGE_TEAM:
1015 case REQ_RANGE_ALLIANCE:
1016 case REQ_RANGE_WORLD:
1017 case REQ_RANGE_COUNT:
1018 /* Not supported. */
1019 break;
1020 }
1021 break;
1022
1023 case VUT_TERRAIN:
1024 switch (preq->range) {
1025 case REQ_RANGE_TILE:
1026 fc_strlcat(buf, prefix, bufsz);
1027 if (preq->present) {
1028 cat_snprintf(buf, bufsz, Q_("?terrain:Requires %s on the tile."),
1029 terrain_name_translation(preq->source.value.terrain));
1030 } else {
1031 cat_snprintf(buf, bufsz, Q_("?terrain:Prevented by %s on the tile."),
1032 terrain_name_translation(preq->source.value.terrain));
1033 }
1034 return TRUE;
1036 fc_strlcat(buf, prefix, bufsz);
1037 if (preq->present) {
1039 Q_("?terrain:Requires %s on the tile or a cardinally "
1040 "adjacent tile."),
1041 terrain_name_translation(preq->source.value.terrain));
1042 } else {
1044 Q_("?terrain:Prevented by %s on the tile or any "
1045 "cardinally adjacent tile."),
1046 terrain_name_translation(preq->source.value.terrain));
1047 }
1048 return TRUE;
1049 case REQ_RANGE_ADJACENT:
1050 fc_strlcat(buf, prefix, bufsz);
1051 if (preq->present) {
1053 Q_("?terrain:Requires %s on the tile or an adjacent "
1054 "tile."),
1055 terrain_name_translation(preq->source.value.terrain));
1056 } else {
1058 Q_("?terrain:Prevented by %s on the tile or any "
1059 "adjacent tile."),
1060 terrain_name_translation(preq->source.value.terrain));
1061 }
1062 return TRUE;
1063 case REQ_RANGE_CITY:
1064 fc_strlcat(buf, prefix, bufsz);
1065 if (preq->present) {
1067 Q_("?terrain:Requires %s on a tile within the city "
1068 "radius."),
1069 terrain_name_translation(preq->source.value.terrain));
1070 } else {
1072 Q_("?terrain:Prevented by %s on any tile within the city "
1073 "radius."),
1074 terrain_name_translation(preq->source.value.terrain));
1075 }
1076 return TRUE;
1078 fc_strlcat(buf, prefix, bufsz);
1079 if (preq->present) {
1081 Q_("?terrain:Requires %s on a tile within the city "
1082 "radius, or the city radius of a trade partner."),
1083 terrain_name_translation(preq->source.value.terrain));
1084 } else {
1086 Q_("?terrain:Prevented by %s on any tile within the city "
1087 "radius or the city radius of a trade partner."),
1088 terrain_name_translation(preq->source.value.terrain));
1089 }
1090 return TRUE;
1092 case REQ_RANGE_PLAYER:
1093 case REQ_RANGE_TEAM:
1094 case REQ_RANGE_ALLIANCE:
1095 case REQ_RANGE_WORLD:
1096 case REQ_RANGE_LOCAL:
1097 case REQ_RANGE_COUNT:
1098 /* Not supported. */
1099 break;
1100 }
1101 break;
1102
1103 case VUT_NATION:
1104 switch (preq->range) {
1105 case REQ_RANGE_PLAYER:
1106 fc_strlcat(buf, prefix, bufsz);
1107 if (preq->present) {
1109 /* TRANS: "... playing as the Swedes." */
1110 _("Requires that you are playing as the %s."),
1111 nation_plural_translation(preq->source.value.nation));
1112 } else {
1114 /* TRANS: "... playing as the Turks." */
1115 _("Requires that you are not playing as the %s."),
1116 nation_plural_translation(preq->source.value.nation));
1117 }
1118 return TRUE;
1119 case REQ_RANGE_TEAM:
1120 fc_strlcat(buf, prefix, bufsz);
1121 if (preq->present) {
1123 /* TRANS: "... same team as the Indonesians." */
1124 _("Requires that you are on the same team as "
1125 "the %s."),
1126 nation_plural_translation(preq->source.value.nation));
1127 } else {
1129 /* TRANS: "... same team as the Greeks." */
1130 _("Requires that you are not on the same team as "
1131 "the %s."),
1132 nation_plural_translation(preq->source.value.nation));
1133 }
1134 return TRUE;
1135 case REQ_RANGE_ALLIANCE:
1136 fc_strlcat(buf, prefix, bufsz);
1137 if (preq->present) {
1139 /* TRANS: "... allied with the Koreans." */
1140 _("Requires that you are allied with the %s."),
1141 nation_plural_translation(preq->source.value.nation));
1142 } else {
1144 /* TRANS: "... allied with the Danes." */
1145 _("Requires that you are not allied with the %s."),
1146 nation_plural_translation(preq->source.value.nation));
1147 }
1148 return TRUE;
1149 case REQ_RANGE_WORLD:
1150 fc_strlcat(buf, prefix, bufsz);
1151 if (preq->survives) {
1152 if (preq->present) {
1154 /* TRANS: "Requires the Apaches to have ..." */
1155 _("Requires the %s to have been in the game."),
1156 nation_plural_translation(preq->source.value.nation));
1157 } else {
1159 /* TRANS: "Requires the Celts never to have ..." */
1160 _("Requires the %s never to have been in the "
1161 "game."),
1162 nation_plural_translation(preq->source.value.nation));
1163 }
1164 } else {
1165 if (preq->present) {
1167 /* TRANS: "Requires the Belgians in the game." */
1168 _("Requires the %s in the game."),
1169 nation_plural_translation(preq->source.value.nation));
1170 } else {
1172 /* TRANS: "Requires that the Russians are not ... */
1173 _("Requires that the %s are not in the game."),
1174 nation_plural_translation(preq->source.value.nation));
1175 }
1176 }
1177 return TRUE;
1178 case REQ_RANGE_LOCAL:
1179 case REQ_RANGE_TILE:
1181 case REQ_RANGE_ADJACENT:
1182 case REQ_RANGE_CITY:
1185 case REQ_RANGE_COUNT:
1186 /* Not supported. */
1187 break;
1188 }
1189 break;
1190
1191 case VUT_NATIONGROUP:
1192 switch (preq->range) {
1193 case REQ_RANGE_PLAYER:
1194 fc_strlcat(buf, prefix, bufsz);
1195 if (preq->present) {
1197 /* TRANS: nation group: "... playing African nation." */
1198 _("Requires that you are playing %s nation."),
1199 nation_group_name_translation(preq->source.value.nationgroup));
1200 } else {
1202 /* TRANS: nation group: "... playing Imaginary nation." */
1203 _("Prevented if you are playing %s nation."),
1204 nation_group_name_translation(preq->source.value.nationgroup));
1205 }
1206 return TRUE;
1207 case REQ_RANGE_TEAM:
1208 fc_strlcat(buf, prefix, bufsz);
1209 if (preq->present) {
1211 /* TRANS: nation group: "Requires Medieval nation ..." */
1212 _("Requires %s nation on your team."),
1213 nation_group_name_translation(preq->source.value.nationgroup));
1214 } else {
1216 /* TRANS: nation group: "Prevented by Medieval nation ..." */
1217 _("Prevented by %s nation on your team."),
1218 nation_group_name_translation(preq->source.value.nationgroup));
1219 }
1220 return TRUE;
1221 case REQ_RANGE_ALLIANCE:
1222 fc_strlcat(buf, prefix, bufsz);
1223 if (preq->present) {
1225 /* TRANS: nation group: "Requires Modern nation ..." */
1226 _("Requires %s nation in alliance with you."),
1227 nation_group_name_translation(preq->source.value.nationgroup));
1228 } else {
1230 /* TRANS: nation group: "Prevented by Modern nation ..." */
1231 _("Prevented if %s nation is in alliance with you."),
1232 nation_group_name_translation(preq->source.value.nationgroup));
1233 }
1234 return TRUE;
1235 case REQ_RANGE_WORLD:
1236 fc_strlcat(buf, prefix, bufsz);
1237 if (preq->present) {
1239 /* TRANS: nation group: "Requires Asian nation ..." */
1240 _("Requires %s nation in the game."),
1241 nation_group_name_translation(preq->source.value.nationgroup));
1242 } else {
1244 /* TRANS: nation group: "Prevented by Asian nation ..." */
1245 _("Prevented by %s nation in the game."),
1246 nation_group_name_translation(preq->source.value.nationgroup));
1247 }
1248 return TRUE;
1249 case REQ_RANGE_LOCAL:
1250 case REQ_RANGE_TILE:
1252 case REQ_RANGE_ADJACENT:
1253 case REQ_RANGE_CITY:
1256 case REQ_RANGE_COUNT:
1257 /* Not supported. */
1258 break;
1259 }
1260 break;
1261
1262 case VUT_STYLE:
1263 if (preq->range != REQ_RANGE_PLAYER) {
1264 break;
1265 }
1266 fc_strlcat(buf, prefix, bufsz);
1267 if (preq->present) {
1269 /* TRANS: "Requires that you are playing Asian style
1270 * nation." */
1271 _("Requires that you are playing %s style nation."),
1272 style_name_translation(preq->source.value.style));
1273 } else {
1275 /* TRANS: "Requires that you are not playing Classical
1276 * style nation." */
1277 _("Requires that you are not playing %s style nation."),
1278 style_name_translation(preq->source.value.style));
1279 }
1280 return TRUE;
1281
1282 case VUT_NATIONALITY:
1283 switch (preq->range) {
1285 fc_strlcat(buf, prefix, bufsz);
1286 if (preq->present) {
1288 /* TRANS: "Requires at least one Barbarian citizen ..." */
1289 _("Requires at least one %s citizen in the city or a "
1290 "trade partner."),
1291 nation_adjective_translation(preq->source.value.nationality));
1292 } else {
1294 /* TRANS: "... no Pirate citizens ..." */
1295 _("Requires that there are no %s citizens in "
1296 "the city or any trade partners."),
1297 nation_adjective_translation(preq->source.value.nationality));
1298 }
1299 return TRUE;
1300 case REQ_RANGE_CITY:
1301 fc_strlcat(buf, prefix, bufsz);
1302 if (preq->present) {
1304 /* TRANS: "Requires at least one Barbarian citizen ..." */
1305 _("Requires at least one %s citizen in the city."),
1306 nation_adjective_translation(preq->source.value.nationality));
1307 } else {
1309 /* TRANS: "... no Pirate citizens ..." */
1310 _("Requires that there are no %s citizens in "
1311 "the city."),
1312 nation_adjective_translation(preq->source.value.nationality));
1313 }
1314 return TRUE;
1315 case REQ_RANGE_WORLD:
1316 case REQ_RANGE_ALLIANCE:
1317 case REQ_RANGE_TEAM:
1318 case REQ_RANGE_PLAYER:
1319 case REQ_RANGE_LOCAL:
1320 case REQ_RANGE_TILE:
1322 case REQ_RANGE_ADJACENT:
1324 case REQ_RANGE_COUNT:
1325 /* Not supported. */
1326 break;
1327 }
1328 break;
1329
1330 case VUT_ORIGINAL_OWNER:
1331 switch (preq->range) {
1332 case REQ_RANGE_CITY:
1333 fc_strlcat(buf, prefix, bufsz);
1334 if (preq->present) {
1336 _("Requires city to be founded by %s."),
1337 nation_adjective_translation(preq->source.value.origowner));
1338 } else {
1340 _("Requires that city was not originally owned by %s."),
1341 nation_adjective_translation(preq->source.value.origowner));
1342 }
1343 return TRUE;
1345 case REQ_RANGE_WORLD:
1346 case REQ_RANGE_ALLIANCE:
1347 case REQ_RANGE_TEAM:
1348 case REQ_RANGE_PLAYER:
1349 case REQ_RANGE_LOCAL:
1350 case REQ_RANGE_TILE:
1352 case REQ_RANGE_ADJACENT:
1354 case REQ_RANGE_COUNT:
1355 /* Not supported. */
1356 break;
1357 }
1358 break;
1359
1360 case VUT_DIPLREL:
1361 switch (preq->range) {
1362 case REQ_RANGE_PLAYER:
1363 fc_strlcat(buf, prefix, bufsz);
1364 if (preq->present) {
1366 /* TRANS: in this and following strings, '%s' can be one
1367 * of a wide range of relationships; e.g., 'Peace',
1368 * 'Never met', 'Foreign', 'Hosts embassy',
1369 * 'Provided Casus Belli' */
1370 _("Requires that you have the relationship '%s' with at "
1371 "least one other living player."),
1372 diplrel_name_translation(preq->source.value.diplrel));
1373 } else {
1375 _("Requires that you do not have the relationship '%s' "
1376 "with any living player."),
1377 diplrel_name_translation(preq->source.value.diplrel));
1378 }
1379 return TRUE;
1380 case REQ_RANGE_TEAM:
1381 fc_strlcat(buf, prefix, bufsz);
1382 if (preq->present) {
1384 _("Requires that somebody on your team has the "
1385 "relationship '%s' with at least one other living "
1386 "player."),
1387 diplrel_name_translation(preq->source.value.diplrel));
1388 } else {
1390 _("Requires that nobody on your team has the "
1391 "relationship '%s' with any living player."),
1392 diplrel_name_translation(preq->source.value.diplrel));
1393 }
1394 return TRUE;
1395 case REQ_RANGE_ALLIANCE:
1396 fc_strlcat(buf, prefix, bufsz);
1397 if (preq->present) {
1399 _("Requires that somebody in your alliance has the "
1400 "relationship '%s' with at least one other living "
1401 "player."),
1402 diplrel_name_translation(preq->source.value.diplrel));
1403 } else {
1405 _("Requires that nobody in your alliance has the "
1406 "relationship '%s' with any living player."),
1407 diplrel_name_translation(preq->source.value.diplrel));
1408 }
1409 return TRUE;
1410 case REQ_RANGE_WORLD:
1411 fc_strlcat(buf, prefix, bufsz);
1412 if (preq->present) {
1414 _("Requires the relationship '%s' between two living "
1415 "players."),
1416 diplrel_name_translation(preq->source.value.diplrel));
1417 } else {
1419 _("Requires that no two living players have the "
1420 "relationship '%s'."),
1421 diplrel_name_translation(preq->source.value.diplrel));
1422 }
1423 return TRUE;
1424 case REQ_RANGE_LOCAL:
1425 fc_strlcat(buf, prefix, bufsz);
1426 if (preq->present) {
1428 _("Requires that you have the relationship '%s' with the "
1429 "other player."),
1430 diplrel_name_translation(preq->source.value.diplrel));
1431 } else {
1433 _("Requires that you do not have the relationship '%s' "
1434 "with the other player."),
1435 diplrel_name_translation(preq->source.value.diplrel));
1436 }
1437 return TRUE;
1438 case REQ_RANGE_TILE:
1440 case REQ_RANGE_ADJACENT:
1441 case REQ_RANGE_CITY:
1444 case REQ_RANGE_COUNT:
1445 /* Not supported. */
1446 break;
1447 }
1448 break;
1449
1450 case VUT_DIPLREL_TILE:
1451 switch (preq->range) {
1452 case REQ_RANGE_PLAYER:
1453 fc_strlcat(buf, prefix, bufsz);
1454 if (preq->present) {
1456 /* TRANS: in this and following strings, '%s' can be one
1457 * of a wide range of relationships; e.g., 'Peace',
1458 * 'Never met', 'Foreign', 'Hosts embassy',
1459 * 'Provided Casus Belli' */
1460 _("Requires that the tile owner has the relationship"
1461 " '%s' with at least one other living player."),
1462 diplrel_name_translation(preq->source.value.diplrel));
1463 } else {
1465 _("Requires that the tile owner does not have the"
1466 " relationship '%s' with any living player."),
1467 diplrel_name_translation(preq->source.value.diplrel));
1468 }
1469 return TRUE;
1470 case REQ_RANGE_TEAM:
1471 fc_strlcat(buf, prefix, bufsz);
1472 if (preq->present) {
1474 _("Requires that somebody on the tile owner's team"
1475 " has the relationship '%s' with at least one other"
1476 " living player."),
1477 diplrel_name_translation(preq->source.value.diplrel));
1478 } else {
1480 _("Requires that nobody on the tile owner's team has"
1481 " the relationship '%s' with any living player."),
1482 diplrel_name_translation(preq->source.value.diplrel));
1483 }
1484 return TRUE;
1485 case REQ_RANGE_ALLIANCE:
1486 fc_strlcat(buf, prefix, bufsz);
1487 if (preq->present) {
1489 _("Requires that somebody in the tile owner's alliance"
1490 " has the relationship '%s' with at least one other "
1491 "living player."),
1492 diplrel_name_translation(preq->source.value.diplrel));
1493 } else {
1495 _("Requires that nobody in the tile owner's alliance "
1496 "has the relationship '%s' with any living player."),
1497 diplrel_name_translation(preq->source.value.diplrel));
1498 }
1499 return TRUE;
1500 case REQ_RANGE_LOCAL:
1501 fc_strlcat(buf, prefix, bufsz);
1502 if (preq->present) {
1504 _("Requires that you have the relationship '%s' with"
1505 " the tile owner."),
1506 diplrel_name_translation(preq->source.value.diplrel));
1507 } else {
1509 _("Requires that you do not have the relationship '%s'"
1510 " with the tile owner."),
1511 diplrel_name_translation(preq->source.value.diplrel));
1512 }
1513 return TRUE;
1514 case REQ_RANGE_TILE:
1516 case REQ_RANGE_ADJACENT:
1517 case REQ_RANGE_CITY:
1520 case REQ_RANGE_WORLD:
1521 case REQ_RANGE_COUNT:
1522 /* Not supported. */
1523 break;
1524 }
1525 break;
1526
1527 case VUT_DIPLREL_TILE_O:
1528 switch (preq->range) {
1529 case REQ_RANGE_LOCAL:
1530 fc_strlcat(buf, prefix, bufsz);
1531 if (preq->present) {
1533 _("Requires that the tile owner has the relationship"
1534 " '%s' with the other player."),
1535 diplrel_name_translation(preq->source.value.diplrel));
1536 } else {
1538 _("Requires that the tile owner does not have the"
1539 " relationship '%s' with the other player."),
1540 diplrel_name_translation(preq->source.value.diplrel));
1541 }
1542 return TRUE;
1543 case REQ_RANGE_TILE:
1545 case REQ_RANGE_ADJACENT:
1546 case REQ_RANGE_CITY:
1549 case REQ_RANGE_PLAYER:
1550 case REQ_RANGE_TEAM:
1551 case REQ_RANGE_ALLIANCE:
1552 case REQ_RANGE_WORLD:
1553 case REQ_RANGE_COUNT:
1554 /* Not supported. */
1555 break;
1556 }
1557 break;
1558
1560 switch (preq->range) {
1561 case REQ_RANGE_PLAYER:
1562 fc_strlcat(buf, prefix, bufsz);
1563 if (preq->present) {
1565 /* TRANS: in this and following strings, '%s' can be one
1566 * of a wide range of relationships; e.g., 'Peace',
1567 * 'Never met', 'Foreign', 'Hosts embassy',
1568 * 'Provided Casus Belli' */
1569 _("Requires that the tile has at least one unit whose "
1570 "owner has the relationship "
1571 "'%s' with at least one other living player."),
1572 diplrel_name_translation(preq->source.value.diplrel));
1573 } else {
1575 _("Requires that no unit at the tile is owned by a player "
1576 "who has the relationship '%s' with any living player."),
1577 diplrel_name_translation(preq->source.value.diplrel));
1578 }
1579 return TRUE;
1580 case REQ_RANGE_TEAM:
1581 fc_strlcat(buf, prefix, bufsz);
1582 if (preq->present) {
1584 _("Requires that the tile has at least one unit whose "
1585 "owner is on a team where a member "
1586 "has the relationship '%s' with at least one other "
1587 "living player."),
1588 diplrel_name_translation(preq->source.value.diplrel));
1589 } else {
1591 _("Requires that no unit at the tile is owned by a player "
1592 "who is on a team where a member "
1593 "has the relationship '%s' with at least one other "
1594 "living player."),
1595 diplrel_name_translation(preq->source.value.diplrel));
1596 }
1597 return TRUE;
1598 case REQ_RANGE_ALLIANCE:
1599 fc_strlcat(buf, prefix, bufsz);
1600 if (preq->present) {
1602 _("Requires that the tile has at least one unit whose "
1603 "owner is allied to someone that "
1604 "has the relationship '%s' with at least one other "
1605 "living player."),
1606 diplrel_name_translation(preq->source.value.diplrel));
1607 } else {
1609 _("Requires that no unit at the tile is owned by a player "
1610 "allied to someone that "
1611 "has the relationship '%s' with any living player."),
1612 diplrel_name_translation(preq->source.value.diplrel));
1613 }
1614 return TRUE;
1615 case REQ_RANGE_LOCAL:
1616 fc_strlcat(buf, prefix, bufsz);
1617 if (preq->present) {
1619 _("Requires that you have the relationship '%s' with "
1620 "the owner of at least one unit at the tile."),
1621 diplrel_name_translation(preq->source.value.diplrel));
1622 } else {
1624 _("Requires that you do not have the relationship '%s' "
1625 "with the owner of any unit at the tile."),
1626 diplrel_name_translation(preq->source.value.diplrel));
1627 }
1628 return TRUE;
1629 case REQ_RANGE_TILE:
1631 case REQ_RANGE_ADJACENT:
1632 case REQ_RANGE_CITY:
1635 case REQ_RANGE_WORLD:
1636 case REQ_RANGE_COUNT:
1637 /* Not supported. */
1638 break;
1639 }
1640 break;
1641
1643 switch (preq->range) {
1644 case REQ_RANGE_LOCAL:
1645 fc_strlcat(buf, prefix, bufsz);
1646 if (preq->present) {
1648 _("Requires that the tile has at least one unit whose "
1649 "owner has the relationship '%s' with the other player."),
1650 diplrel_name_translation(preq->source.value.diplrel));
1651 } else {
1653 _("Requires that no unit at the tile is owned by a player "
1654 "who has the relationship '%s' with the other player."),
1655 diplrel_name_translation(preq->source.value.diplrel));
1656 }
1657 return TRUE;
1658 case REQ_RANGE_TILE:
1660 case REQ_RANGE_ADJACENT:
1661 case REQ_RANGE_CITY:
1664 case REQ_RANGE_PLAYER:
1665 case REQ_RANGE_TEAM:
1666 case REQ_RANGE_ALLIANCE:
1667 case REQ_RANGE_WORLD:
1668 case REQ_RANGE_COUNT:
1669 /* Not supported. */
1670 break;
1671 }
1672 break;
1673
1674 case VUT_UTYPE:
1675 switch (preq->range) {
1676 case REQ_RANGE_LOCAL:
1677 fc_strlcat(buf, prefix, bufsz);
1678 if (preq->present) {
1679 /* TRANS: %s is a single kind of unit (e.g., "Settlers"). */
1680 cat_snprintf(buf, bufsz, Q_("?unit:Requires %s."),
1681 utype_name_translation(preq->source.value.utype));
1682 } else {
1683 /* TRANS: %s is a single kind of unit (e.g., "Settlers"). */
1684 cat_snprintf(buf, bufsz, Q_("?unit:Does not apply to %s."),
1685 utype_name_translation(preq->source.value.utype));
1686 }
1687 return TRUE;
1688 case REQ_RANGE_TILE:
1690 case REQ_RANGE_ADJACENT:
1691 case REQ_RANGE_CITY:
1694 case REQ_RANGE_PLAYER:
1695 case REQ_RANGE_TEAM:
1696 case REQ_RANGE_ALLIANCE:
1697 case REQ_RANGE_WORLD:
1698 case REQ_RANGE_COUNT:
1699 /* Not supported. */
1700 break;
1701 }
1702 break;
1703
1704 case VUT_UTFLAG:
1705 switch (preq->range) {
1706 case REQ_RANGE_LOCAL:
1707 {
1708 struct astring astr = ASTRING_INIT;
1709
1710 /* Unit type flags mean nothing to users. Explicitly list the unit
1711 * types with those flags. */
1712 if (role_units_translations(&astr, preq->source.value.unitflag,
1713 TRUE)) {
1714 fc_strlcat(buf, prefix, bufsz);
1715 if (preq->present) {
1716 /* TRANS: %s is a list of unit types separated by "or". */
1717 cat_snprintf(buf, bufsz, Q_("?ulist:Requires %s."),
1718 astr_str(&astr));
1719 } else {
1720 /* TRANS: %s is a list of unit types separated by "or". */
1721 cat_snprintf(buf, bufsz, Q_("?ulist:Does not apply to %s."),
1722 astr_str(&astr));
1723 }
1724 astr_free(&astr);
1725 return TRUE;
1726 }
1727 }
1728 break;
1729 case REQ_RANGE_TILE:
1731 case REQ_RANGE_ADJACENT:
1732 case REQ_RANGE_CITY:
1735 case REQ_RANGE_PLAYER:
1736 case REQ_RANGE_TEAM:
1737 case REQ_RANGE_ALLIANCE:
1738 case REQ_RANGE_WORLD:
1739 case REQ_RANGE_COUNT:
1740 /* Not supported. */
1741 break;
1742 }
1743 break;
1744
1745 case VUT_UCLASS:
1746 switch (preq->range) {
1747 case REQ_RANGE_LOCAL:
1748 fc_strlcat(buf, prefix, bufsz);
1749 if (preq->present) {
1750 /* TRANS: %s is a single unit class (e.g., "Air"). */
1751 cat_snprintf(buf, bufsz, Q_("?uclass:Requires %s units."),
1752 uclass_name_translation(preq->source.value.uclass));
1753 } else {
1754 /* TRANS: %s is a single unit class (e.g., "Air"). */
1755 cat_snprintf(buf, bufsz, Q_("?uclass:Does not apply to %s units."),
1756 uclass_name_translation(preq->source.value.uclass));
1757 }
1758 return TRUE;
1759 case REQ_RANGE_TILE:
1761 case REQ_RANGE_ADJACENT:
1762 case REQ_RANGE_CITY:
1765 case REQ_RANGE_PLAYER:
1766 case REQ_RANGE_TEAM:
1767 case REQ_RANGE_ALLIANCE:
1768 case REQ_RANGE_WORLD:
1769 case REQ_RANGE_COUNT:
1770 /* Not supported. */
1771 break;
1772 }
1773 break;
1774
1775 case VUT_UCFLAG:
1776 {
1777 const char *classes[uclass_count()];
1778 int i = 0;
1779 bool done = FALSE;
1780 struct astring list = ASTRING_INIT;
1781
1782 unit_class_iterate(uclass) {
1783 if (uclass_has_flag(uclass, preq->source.value.unitclassflag)) {
1784 classes[i++] = uclass_name_translation(uclass);
1785 }
1788
1789 switch (preq->range) {
1790 case REQ_RANGE_LOCAL:
1791 fc_strlcat(buf, prefix, bufsz);
1792 if (preq->present) {
1793 /* TRANS: %s is a list of unit classes separated by "or". */
1794 cat_snprintf(buf, bufsz, Q_("?uclasslist:Requires %s units."),
1795 astr_str(&list));
1796 } else {
1797 /* TRANS: %s is a list of unit classes separated by "or". */
1798 cat_snprintf(buf, bufsz, Q_("?uclasslist:Does not apply to "
1799 "%s units."),
1800 astr_str(&list));
1801 }
1802 done = TRUE;
1803 break;
1804 case REQ_RANGE_TILE:
1806 case REQ_RANGE_ADJACENT:
1807 case REQ_RANGE_CITY:
1810 case REQ_RANGE_PLAYER:
1811 case REQ_RANGE_TEAM:
1812 case REQ_RANGE_ALLIANCE:
1813 case REQ_RANGE_WORLD:
1814 case REQ_RANGE_COUNT:
1815 /* Not supported. */
1816 break;
1817 }
1818 astr_free(&list);
1819 if (done) {
1820 return TRUE;
1821 }
1822 }
1823 break;
1824
1825 case VUT_UNITSTATE:
1826 {
1827 switch (preq->range) {
1828 case REQ_RANGE_LOCAL:
1829 switch (preq->source.value.unit_state) {
1830 case USP_TRANSPORTED:
1831 fc_strlcat(buf, prefix, bufsz);
1832 if (preq->present) {
1834 _("Requires that the unit is transported."));
1835 } else {
1837 _("Requires that the unit isn't transported."));
1838 }
1839 return TRUE;
1840 case USP_LIVABLE_TILE:
1841 fc_strlcat(buf, prefix, bufsz);
1842 if (preq->present) {
1844 _("Requires that the unit is on livable tile."));
1845 } else {
1847 _("Requires that the unit isn't on livable tile."));
1848 }
1849 return TRUE;
1850 case USP_TRANSPORTING:
1851 fc_strlcat(buf, prefix, bufsz);
1852 if (preq->present) {
1854 _("Requires that the unit does transport one or "
1855 "more cargo units."));
1856 } else {
1858 _("Requires that the unit doesn't transport "
1859 "any cargo units."));
1860 }
1861 return TRUE;
1862 case USP_HAS_HOME_CITY:
1863 fc_strlcat(buf, prefix, bufsz);
1864 if (preq->present) {
1866 _("Requires that the unit has a home city."));
1867 } else {
1869 _("Requires that the unit is homeless."));
1870 }
1871 return TRUE;
1872 case USP_NATIVE_TILE:
1873 fc_strlcat(buf, prefix, bufsz);
1874 if (preq->present) {
1876 _("Requires that the unit is on native tile."));
1877 } else {
1879 _("Requires that the unit isn't on native tile."));
1880 }
1881 return TRUE;
1882 case USP_NATIVE_EXTRA:
1883 fc_strlcat(buf, prefix, bufsz);
1884 if (preq->present) {
1886 _("Requires that the unit is in a native extra."));
1887 } else {
1889 _("Requires that the unit isn't in a native extra."));
1890 }
1891 return TRUE;
1893 fc_strlcat(buf, prefix, bufsz);
1894 if (preq->present) {
1896 _("Requires that the unit has moved this turn."));
1897 } else {
1899 _("Requires that the unit hasn't moved this turn."));
1900 }
1901 return TRUE;
1902 case USP_COUNT:
1903 fc_assert_msg(preq->source.value.unit_state != USP_COUNT,
1904 "Invalid unit state property.");
1905 }
1906 break;
1907 case REQ_RANGE_TILE:
1909 case REQ_RANGE_ADJACENT:
1910 case REQ_RANGE_CITY:
1913 case REQ_RANGE_PLAYER:
1914 case REQ_RANGE_TEAM:
1915 case REQ_RANGE_ALLIANCE:
1916 case REQ_RANGE_WORLD:
1917 case REQ_RANGE_COUNT:
1918 /* Not supported. */
1919 break;
1920 }
1921 }
1922 break;
1923
1924 case VUT_ACTIVITY:
1925 {
1926 switch (preq->range) {
1927 case REQ_RANGE_LOCAL:
1928 fc_strlcat(buf, prefix, bufsz);
1929 if (preq->present) {
1931 _("Requires that the unit is performing activity %s."),
1932 Q_(unit_activity_name(preq->source.value.activity)));
1933 } else {
1935 _("Requires that the unit is not performing activity %s."),
1936 Q_(unit_activity_name(preq->source.value.activity)));
1937 }
1938 return TRUE;
1939 case REQ_RANGE_TILE:
1941 case REQ_RANGE_ADJACENT:
1942 case REQ_RANGE_CITY:
1945 case REQ_RANGE_PLAYER:
1946 case REQ_RANGE_TEAM:
1947 case REQ_RANGE_ALLIANCE:
1948 case REQ_RANGE_WORLD:
1949 case REQ_RANGE_COUNT:
1950 /* Not supported. */
1951 break;
1952 }
1953 }
1954 break;
1955
1956 case VUT_MINMOVES:
1957 {
1958 switch (preq->range) {
1959 case REQ_RANGE_LOCAL:
1960 fc_strlcat(buf, prefix, bufsz);
1961 if (preq->present) {
1963 /* TRANS: %s is numeric move points; it may have a
1964 * fractional part ("1 1/3 MP"). */
1965 _("Requires that the unit has at least %s MP left."),
1966 move_points_text(preq->source.value.minmoves, TRUE));
1967 } else {
1969 /* TRANS: %s is numeric move points; it may have a
1970 * fractional part ("1 1/3 MP"). */
1971 _("Requires that the unit has less than %s MP left."),
1972 move_points_text(preq->source.value.minmoves, TRUE));
1973 }
1974 return TRUE;
1975 case REQ_RANGE_TILE:
1977 case REQ_RANGE_ADJACENT:
1978 case REQ_RANGE_CITY:
1981 case REQ_RANGE_PLAYER:
1982 case REQ_RANGE_TEAM:
1983 case REQ_RANGE_ALLIANCE:
1984 case REQ_RANGE_WORLD:
1985 case REQ_RANGE_COUNT:
1986 /* Not supported. */
1987 break;
1988 }
1989 }
1990 break;
1991
1992 case VUT_MINVETERAN:
1993 if (preq->range != REQ_RANGE_LOCAL) {
1994 break;
1995 }
1996 /* FIXME: this would be better with veteran level names, but that's
1997 * potentially unit type dependent. */
1998 fc_strlcat(buf, prefix, bufsz);
1999 if (preq->present) {
2001 PL_("Requires a unit with at least %d veteran level.",
2002 "Requires a unit with at least %d veteran levels.",
2003 preq->source.value.minveteran),
2004 preq->source.value.minveteran);
2005 } else {
2007 PL_("Requires a unit with fewer than %d veteran level.",
2008 "Requires a unit with fewer than %d veteran levels.",
2009 preq->source.value.minveteran),
2010 preq->source.value.minveteran);
2011 }
2012 return TRUE;
2013
2014 case VUT_MINHP:
2015 if (preq->range != REQ_RANGE_LOCAL) {
2016 break;
2017 }
2018
2019 fc_strlcat(buf, prefix, bufsz);
2020 if (preq->present) {
2022 PL_("Requires a unit with at least %d hit point left.",
2023 "Requires a unit with at least %d hit points left.",
2024 preq->source.value.min_hit_points),
2025 preq->source.value.min_hit_points);
2026 } else {
2028 PL_("Requires a unit with fewer than %d hit point "
2029 "left.",
2030 "Requires a unit with fewer than %d hit points "
2031 "left.",
2032 preq->source.value.min_hit_points),
2033 preq->source.value.min_hit_points);
2034 }
2035 return TRUE;
2036
2037 case VUT_OTYPE:
2038 if (preq->range != REQ_RANGE_LOCAL) {
2039 break;
2040 }
2041 fc_strlcat(buf, prefix, bufsz);
2042 if (preq->present) {
2043 /* TRANS: "Applies only to Food." */
2044 cat_snprintf(buf, bufsz, Q_("?output:Applies only to %s."),
2045 get_output_name(preq->source.value.outputtype));
2046 } else {
2047 /* TRANS: "Does not apply to Food." */
2048 cat_snprintf(buf, bufsz, Q_("?output:Does not apply to %s."),
2049 get_output_name(preq->source.value.outputtype));
2050 }
2051 return TRUE;
2052
2053 case VUT_SPECIALIST:
2054 if (preq->range != REQ_RANGE_LOCAL) {
2055 break;
2056 }
2057 fc_strlcat(buf, prefix, bufsz);
2058 if (preq->present) {
2059 /* TRANS: "Applies only to Scientists." */
2060 cat_snprintf(buf, bufsz, Q_("?specialist:Applies only to %s."),
2061 specialist_plural_translation(preq->source.value.specialist));
2062 } else {
2063 /* TRANS: "Does not apply to Scientists." */
2064 cat_snprintf(buf, bufsz, Q_("?specialist:Does not apply to %s."),
2065 specialist_plural_translation(preq->source.value.specialist));
2066 }
2067 return TRUE;
2068
2069 case VUT_MINSIZE:
2070 switch (preq->range) {
2072 fc_strlcat(buf, prefix, bufsz);
2073 if (preq->present) {
2075 PL_("Requires a minimum city size of %d for this "
2076 "city or a trade partner.",
2077 "Requires a minimum city size of %d for this "
2078 "city or a trade partner.",
2079 preq->source.value.minsize),
2080 preq->source.value.minsize);
2081 } else {
2083 PL_("Requires the city size to be less than %d "
2084 "for this city and all trade partners.",
2085 "Requires the city size to be less than %d "
2086 "for this city and all trade partners.",
2087 preq->source.value.minsize),
2088 preq->source.value.minsize);
2089 }
2090 return TRUE;
2091 case REQ_RANGE_CITY:
2092 fc_strlcat(buf, prefix, bufsz);
2093 if (preq->present) {
2095 PL_("Requires a minimum city size of %d.",
2096 "Requires a minimum city size of %d.",
2097 preq->source.value.minsize),
2098 preq->source.value.minsize);
2099 } else {
2101 PL_("Requires the city size to be less than %d.",
2102 "Requires the city size to be less than %d.",
2103 preq->source.value.minsize),
2104 preq->source.value.minsize);
2105 }
2106 return TRUE;
2107 case REQ_RANGE_LOCAL:
2108 case REQ_RANGE_TILE:
2110 case REQ_RANGE_ADJACENT:
2112 case REQ_RANGE_PLAYER:
2113 case REQ_RANGE_TEAM:
2114 case REQ_RANGE_ALLIANCE:
2115 case REQ_RANGE_WORLD:
2116 case REQ_RANGE_COUNT:
2117 /* Not supported. */
2118 break;
2119 }
2120 break;
2121
2122 case VUT_MINCULTURE:
2123 switch (preq->range) {
2124 case REQ_RANGE_CITY:
2125 fc_strlcat(buf, prefix, bufsz);
2126 if (preq->present) {
2128 PL_("Requires a minimum culture of %d in the city.",
2129 "Requires a minimum culture of %d in the city.",
2130 preq->source.value.minculture),
2131 preq->source.value.minculture);
2132 } else {
2134 PL_("Requires the culture in the city to be less "
2135 "than %d.",
2136 "Requires the culture in the city to be less "
2137 "than %d.",
2138 preq->source.value.minculture),
2139 preq->source.value.minculture);
2140 }
2141 return TRUE;
2143 fc_strlcat(buf, prefix, bufsz);
2144 if (preq->present) {
2146 PL_("Requires a minimum culture of %d in this city or "
2147 "a trade partner.",
2148 "Requires a minimum culture of %d in this city or "
2149 "a trade partner.",
2150 preq->source.value.minculture),
2151 preq->source.value.minculture);
2152 } else {
2154 PL_("Requires the culture in this city and all trade "
2155 "partners to be less than %d.",
2156 "Requires the culture in this city and all trade "
2157 "partners to be less than %d.",
2158 preq->source.value.minculture),
2159 preq->source.value.minculture);
2160 }
2161 return TRUE;
2162 case REQ_RANGE_PLAYER:
2163 fc_strlcat(buf, prefix, bufsz);
2164 if (preq->present) {
2166 PL_("Requires your nation to have culture "
2167 "of at least %d.",
2168 "Requires your nation to have culture "
2169 "of at least %d.",
2170 preq->source.value.minculture),
2171 preq->source.value.minculture);
2172 } else {
2174 PL_("Prevented if your nation has culture of "
2175 "%d or more.",
2176 "Prevented if your nation has culture of "
2177 "%d or more.",
2178 preq->source.value.minculture),
2179 preq->source.value.minculture);
2180 }
2181 return TRUE;
2182 case REQ_RANGE_TEAM:
2183 fc_strlcat(buf, prefix, bufsz);
2184 if (preq->present) {
2186 PL_("Requires someone on your team to have culture of "
2187 "at least %d.",
2188 "Requires someone on your team to have culture of "
2189 "at least %d.",
2190 preq->source.value.minculture),
2191 preq->source.value.minculture);
2192 } else {
2194 PL_("Prevented if anyone on your team has culture of "
2195 "%d or more.",
2196 "Prevented if anyone on your team has culture of "
2197 "%d or more.",
2198 preq->source.value.minculture),
2199 preq->source.value.minculture);
2200 }
2201 return TRUE;
2202 case REQ_RANGE_ALLIANCE:
2203 fc_strlcat(buf, prefix, bufsz);
2204 if (preq->present) {
2206 PL_("Requires someone in your current alliance to "
2207 "have culture of at least %d.",
2208 "Requires someone in your current alliance to "
2209 "have culture of at least %d.",
2210 preq->source.value.minculture),
2211 preq->source.value.minculture);
2212 } else {
2214 PL_("Prevented if anyone in your current alliance has "
2215 "culture of %d or more.",
2216 "Prevented if anyone in your current alliance has "
2217 "culture of %d or more.",
2218 preq->source.value.minculture),
2219 preq->source.value.minculture);
2220 }
2221 return TRUE;
2222 case REQ_RANGE_WORLD:
2223 fc_strlcat(buf, prefix, bufsz);
2224 if (preq->present) {
2226 PL_("Requires that some player has culture of at "
2227 "least %d.",
2228 "Requires that some player has culture of at "
2229 "least %d.",
2230 preq->source.value.minculture),
2231 preq->source.value.minculture);
2232 } else {
2234 PL_("Requires that no player has culture of %d "
2235 "or more.",
2236 "Requires that no player has culture of %d "
2237 "or more.",
2238 preq->source.value.minculture),
2239 preq->source.value.minculture);
2240 }
2241 return TRUE;
2242 case REQ_RANGE_LOCAL:
2243 case REQ_RANGE_TILE:
2245 case REQ_RANGE_ADJACENT:
2247 case REQ_RANGE_COUNT:
2248 break;
2249 }
2250 break;
2251
2252 case VUT_MINFOREIGNPCT:
2253 switch (preq->range) {
2254 case REQ_RANGE_CITY:
2255 fc_strlcat(buf, prefix, bufsz);
2256 if (preq->present) {
2258 _("At least %d%% of the citizens of the city "
2259 "must be foreign."),
2260 preq->source.value.minforeignpct);
2261 } else {
2263 _("Less than %d%% of the citizens of the city "
2264 "must be foreign."),
2265 preq->source.value.minforeignpct);
2266 }
2267 return TRUE;
2269 fc_strlcat(buf, prefix, bufsz);
2270 if (preq->present) {
2272 _("At least %d%% of the citizens of the city "
2273 "or some trade partner must be foreign."),
2274 preq->source.value.minforeignpct);
2275 } else {
2277 _("Less than %d%% of the citizens of the city "
2278 "and each trade partner must be foreign."),
2279 preq->source.value.minforeignpct);
2280 }
2281 return TRUE;
2282 case REQ_RANGE_PLAYER:
2283 case REQ_RANGE_TEAM:
2284 case REQ_RANGE_ALLIANCE:
2285 case REQ_RANGE_WORLD:
2286 case REQ_RANGE_LOCAL:
2287 case REQ_RANGE_TILE:
2289 case REQ_RANGE_ADJACENT:
2291 case REQ_RANGE_COUNT:
2292 break;
2293 }
2294 break;
2295
2297 switch (preq->range) {
2298 case REQ_RANGE_TILE:
2299 fc_strlcat(buf, prefix, bufsz);
2300 if (preq->present) {
2302 PL_("At most %d total unit may be present on the tile.",
2303 "At most %d total units may be present on the tile.",
2304 preq->source.value.max_tile_total_units),
2305 preq->source.value.max_tile_total_units);
2306 } else {
2308 PL_("There must be more than %d total unit present on "
2309 "the tile.",
2310 "There must be more than %d total units present on "
2311 "the tile.",
2312 preq->source.value.max_tile_total_units),
2313 preq->source.value.max_tile_total_units);
2314 }
2315 return TRUE;
2317 fc_strlcat(buf, prefix, bufsz);
2318 if (preq->present) {
2320 PL_("The tile or at least one cardinally adjacent tile "
2321 "must have %d total unit or fewer.",
2322 "The tile or at least one cardinally adjacent tile "
2323 "must have %d total units or fewer.",
2324 preq->source.value.max_tile_total_units),
2325 preq->source.value.max_tile_total_units);
2326 } else {
2328 PL_("The tile and all cardinally adjacent tiles must "
2329 "have more than %d total unit each.",
2330 "The tile and all cardinally adjacent tiles must "
2331 "have more than %d total units each.",
2332 preq->source.value.max_tile_total_units),
2333 preq->source.value.max_tile_total_units);
2334 }
2335 return TRUE;
2336 case REQ_RANGE_ADJACENT:
2337 fc_strlcat(buf, prefix, bufsz);
2338 if (preq->present) {
2340 PL_("The tile or at least one adjacent tile must have "
2341 "%d total unit or fewer.",
2342 "The tile or at least one adjacent tile must have "
2343 "%d total units or fewer.",
2344 preq->source.value.max_tile_total_units),
2345 preq->source.value.max_tile_total_units);
2346 } else {
2348 PL_("The tile and all adjacent tiles must have more "
2349 "than %d total unit each.",
2350 "The tile and all adjacent tiles must have more "
2351 "than %d total units each.",
2352 preq->source.value.max_tile_total_units),
2353 preq->source.value.max_tile_total_units);
2354 }
2355 return TRUE;
2356 case REQ_RANGE_CITY:
2359 case REQ_RANGE_PLAYER:
2360 case REQ_RANGE_TEAM:
2361 case REQ_RANGE_ALLIANCE:
2362 case REQ_RANGE_WORLD:
2363 case REQ_RANGE_LOCAL:
2364 case REQ_RANGE_COUNT:
2365 /* Not supported. */
2366 break;
2367 }
2368 break;
2369
2371 switch (preq->range) {
2372 case REQ_RANGE_TILE:
2373 fc_strlcat(buf, prefix, bufsz);
2374 if (preq->present) {
2376 PL_("At most %d untransported unit may be present on the tile.",
2377 "At most %d untransported units may be present on the tile.",
2378 preq->source.value.max_tile_top_units),
2379 preq->source.value.max_tile_top_units);
2380 } else {
2382 PL_("There must be more than %d untransported unit present on "
2383 "the tile.",
2384 "There must be more than %d untransported units present on "
2385 "the tile.",
2386 preq->source.value.max_tile_top_units),
2387 preq->source.value.max_tile_top_units);
2388 }
2389 return TRUE;
2391 fc_strlcat(buf, prefix, bufsz);
2392 if (preq->present) {
2394 PL_("The tile or at least one cardinally adjacent tile "
2395 "must have %d untransporte unit or fewer.",
2396 "The tile or at least one cardinally adjacent tile "
2397 "must have %d untransporte units or fewer.",
2398 preq->source.value.max_tile_top_units),
2399 preq->source.value.max_tile_top_units);
2400 } else {
2402 PL_("The tile and all cardinally adjacent tiles must "
2403 "have more than %d untransported unit each.",
2404 "The tile and all cardinally adjacent tiles must "
2405 "have more than %d untransported units each.",
2406 preq->source.value.max_tile_top_units),
2407 preq->source.value.max_tile_top_units);
2408 }
2409 return TRUE;
2410 case REQ_RANGE_ADJACENT:
2411 fc_strlcat(buf, prefix, bufsz);
2412 if (preq->present) {
2414 PL_("The tile or at least one adjacent tile must have "
2415 "%d untransported unit or fewer.",
2416 "The tile or at least one adjacent tile must have "
2417 "%d untransported units or fewer.",
2418 preq->source.value.max_tile_top_units),
2419 preq->source.value.max_tile_top_units);
2420 } else {
2422 PL_("The tile and all adjacent tiles must have "
2423 "more than %d untransported unit each.",
2424 "The tile and all adjacent tiles must have "
2425 "more than %d untransported units each.",
2426 preq->source.value.max_tile_top_units),
2427 preq->source.value.max_tile_top_units);
2428 }
2429 return TRUE;
2430 case REQ_RANGE_CITY:
2433 case REQ_RANGE_PLAYER:
2434 case REQ_RANGE_TEAM:
2435 case REQ_RANGE_ALLIANCE:
2436 case REQ_RANGE_WORLD:
2437 case REQ_RANGE_LOCAL:
2438 case REQ_RANGE_COUNT:
2439 /* Not supported. */
2440 break;
2441 }
2442 break;
2443
2444 case VUT_AI_LEVEL:
2445 if (preq->range != REQ_RANGE_PLAYER) {
2446 break;
2447 }
2448 fc_strlcat(buf, prefix, bufsz);
2449 if (preq->present) {
2451 /* TRANS: AI level (e.g., "Handicapped") */
2452 _("Applies to %s AI players."),
2453 ai_level_translated_name(preq->source.value.ai_level));
2454 } else {
2456 /* TRANS: AI level (e.g., "Cheating") */
2457 _("Does not apply to %s AI players."),
2458 ai_level_translated_name(preq->source.value.ai_level));
2459 }
2460 return TRUE;
2461
2462 case VUT_TERRAINCLASS:
2463 switch (preq->range) {
2464 case REQ_RANGE_TILE:
2465 fc_strlcat(buf, prefix, bufsz);
2466 if (preq->present) {
2468 /* TRANS: %s is a terrain class */
2469 Q_("?terrainclass:Requires %s terrain on the tile."),
2471 (preq->source.value.terrainclass));
2472 } else {
2474 /* TRANS: %s is a terrain class */
2475 Q_("?terrainclass:Prevented by %s terrain on the tile."),
2477 (preq->source.value.terrainclass));
2478 }
2479 return TRUE;
2481 fc_strlcat(buf, prefix, bufsz);
2482 if (preq->present) {
2484 /* TRANS: %s is a terrain class */
2485 Q_("?terrainclass:Requires %s terrain on the tile or a "
2486 "cardinally adjacent tile."),
2488 (preq->source.value.terrainclass));
2489 } else {
2491 /* TRANS: %s is a terrain class */
2492 Q_("?terrainclass:Prevented by %s terrain on the tile or "
2493 "any cardinally adjacent tile."),
2495 (preq->source.value.terrainclass));
2496 }
2497 return TRUE;
2498 case REQ_RANGE_ADJACENT:
2499 fc_strlcat(buf, prefix, bufsz);
2500 if (preq->present) {
2502 /* TRANS: %s is a terrain class */
2503 Q_("?terrainclass:Requires %s terrain on the tile or an "
2504 "adjacent tile."),
2506 (preq->source.value.terrainclass));
2507 } else {
2509 /* TRANS: %s is a terrain class */
2510 Q_("?terrainclass:Prevented by %s terrain on the tile or "
2511 "any adjacent tile."),
2513 (preq->source.value.terrainclass));
2514 }
2515 return TRUE;
2516 case REQ_RANGE_CITY:
2517 fc_strlcat(buf, prefix, bufsz);
2518 if (preq->present) {
2520 /* TRANS: %s is a terrain class */
2521 Q_("?terrainclass:Requires %s terrain on a tile within "
2522 "the city radius."),
2524 (preq->source.value.terrainclass));
2525 } else {
2527 /* TRANS: %s is a terrain class */
2528 Q_("?terrainclass:Prevented by %s terrain on any tile "
2529 "within the city radius."),
2531 (preq->source.value.terrainclass));
2532 }
2533 return TRUE;
2535 fc_strlcat(buf, prefix, bufsz);
2536 if (preq->present) {
2538 /* TRANS: %s is a terrain class */
2539 Q_("?terrainclass:Requires %s terrain on a tile within "
2540 "the city radius or the city radius of a trade "
2541 "partner."),
2543 (preq->source.value.terrainclass));
2544 } else {
2546 /* TRANS: %s is a terrain class */
2547 Q_("?terrainclass:Prevented by %s terrain on any tile "
2548 "within the city radius or the city radius of a trade "
2549 "partner."),
2551 (preq->source.value.terrainclass));
2552 }
2553 return TRUE;
2555 case REQ_RANGE_PLAYER:
2556 case REQ_RANGE_TEAM:
2557 case REQ_RANGE_ALLIANCE:
2558 case REQ_RANGE_WORLD:
2559 case REQ_RANGE_LOCAL:
2560 case REQ_RANGE_COUNT:
2561 /* Not supported. */
2562 break;
2563 }
2564 break;
2565
2566 case VUT_TERRFLAG:
2567 switch (preq->range) {
2568 case REQ_RANGE_TILE:
2569 fc_strlcat(buf, prefix, bufsz);
2570 if (preq->present) {
2572 /* TRANS: %s is a (translatable) terrain flag. */
2573 _("Requires terrain with the \"%s\" flag on the tile."),
2574 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2575 } else {
2577 /* TRANS: %s is a (translatable) terrain flag. */
2578 _("Prevented by terrain with the \"%s\" flag on the "
2579 "tile."),
2580 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2581 }
2582 return TRUE;
2584 fc_strlcat(buf, prefix, bufsz);
2585 if (preq->present) {
2587 /* TRANS: %s is a (translatable) terrain flag. */
2588 _("Requires terrain with the \"%s\" flag on the "
2589 "tile or a cardinally adjacent tile."),
2590 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2591 } else {
2593 /* TRANS: %s is a (translatable) terrain flag. */
2594 _("Prevented by terrain with the \"%s\" flag on "
2595 "the tile or any cardinally adjacent tile."),
2596 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2597 }
2598 return TRUE;
2599 case REQ_RANGE_ADJACENT:
2600 fc_strlcat(buf, prefix, bufsz);
2601 if (preq->present) {
2603 /* TRANS: %s is a (translatable) terrain flag. */
2604 _("Requires terrain with the \"%s\" flag on the "
2605 "tile or an adjacent tile."),
2606 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2607 } else {
2609 /* TRANS: %s is a (translatable) terrain flag. */
2610 _("Prevented by terrain with the \"%s\" flag on "
2611 "the tile or any adjacent tile."),
2612 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2613 }
2614 return TRUE;
2615 case REQ_RANGE_CITY:
2616 fc_strlcat(buf, prefix, bufsz);
2617 if (preq->present) {
2619 /* TRANS: %s is a (translatable) terrain flag. */
2620 _("Requires terrain with the \"%s\" flag on a tile "
2621 "within the city radius."),
2622 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2623 } else {
2625 /* TRANS: %s is a (translatable) terrain flag. */
2626 _("Prevented by terrain with the \"%s\" flag on any tile "
2627 "within the city radius."),
2628 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2629 }
2630 return TRUE;
2632 fc_strlcat(buf, prefix, bufsz);
2633 if (preq->present) {
2635 /* TRANS: %s is a (translatable) terrain flag. */
2636 _("Requires terrain with the \"%s\" flag on a tile "
2637 "within the city radius or the city radius of "
2638 "a trade partner."),
2639 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2640 } else {
2642 /* TRANS: %s is a (translatable) terrain flag. */
2643 _("Prevented by terrain with the \"%s\" flag on any tile "
2644 "within the city radius or the city radius of "
2645 "a trade partner."),
2646 terrain_flag_id_translated_name(preq->source.value.terrainflag));
2647 }
2648 return TRUE;
2650 case REQ_RANGE_PLAYER:
2651 case REQ_RANGE_TEAM:
2652 case REQ_RANGE_ALLIANCE:
2653 case REQ_RANGE_WORLD:
2654 case REQ_RANGE_LOCAL:
2655 case REQ_RANGE_COUNT:
2656 /* Not supported. */
2657 break;
2658 }
2659 break;
2660
2661 case VUT_ROADFLAG:
2662 switch (preq->range) {
2663 case REQ_RANGE_LOCAL:
2664 fc_strlcat(buf, prefix, bufsz);
2665 if (preq->present) {
2667 /* TRANS: %s is a (translatable) road flag. */
2668 _("Only applies to roads with the \"%s\" flag."),
2670 (preq->source.value.roadflag));
2671 } else {
2673 /* TRANS: %s is a (translatable) road flag. */
2674 _("Does not apply to roads with the \"%s\" flag."),
2676 (preq->source.value.roadflag));
2677 }
2678 return TRUE;
2679 case REQ_RANGE_TILE:
2680 fc_strlcat(buf, prefix, bufsz);
2681 if (preq->present) {
2683 /* TRANS: %s is a (translatable) road flag. */
2684 _("Requires a road with the \"%s\" flag on the tile."),
2685 road_flag_id_translated_name(preq->source.value.roadflag));
2686 } else {
2688 /* TRANS: %s is a (translatable) road flag. */
2689 _("Prevented by a road with the \"%s\" flag on the "
2690 "tile."),
2691 road_flag_id_translated_name(preq->source.value.roadflag));
2692 }
2693 return TRUE;
2695 fc_strlcat(buf, prefix, bufsz);
2696 if (preq->present) {
2698 /* TRANS: %s is a (translatable) road flag. */
2699 _("Requires a road with the \"%s\" flag on the "
2700 "tile or a cardinally adjacent tile."),
2701 road_flag_id_translated_name(preq->source.value.roadflag));
2702 } else {
2704 /* TRANS: %s is a (translatable) road flag. */
2705 _("Prevented by a road with the \"%s\" flag on "
2706 "the tile or any cardinally adjacent tile."),
2707 road_flag_id_translated_name(preq->source.value.roadflag));
2708 }
2709 return TRUE;
2710 case REQ_RANGE_ADJACENT:
2711 fc_strlcat(buf, prefix, bufsz);
2712 if (preq->present) {
2714 /* TRANS: %s is a (translatable) road flag. */
2715 _("Requires a road with the \"%s\" flag on the "
2716 "tile or an adjacent tile."),
2717 road_flag_id_translated_name(preq->source.value.roadflag));
2718 } else {
2720 /* TRANS: %s is a (translatable) road flag. */
2721 _("Prevented by a road with the \"%s\" flag on "
2722 "the tile or any adjacent tile."),
2723 road_flag_id_translated_name(preq->source.value.roadflag));
2724 }
2725 return TRUE;
2726 case REQ_RANGE_CITY:
2727 fc_strlcat(buf, prefix, bufsz);
2728 if (preq->present) {
2730 /* TRANS: %s is a (translatable) road flag. */
2731 _("Requires a road with the \"%s\" flag on a tile "
2732 "within the city radius."),
2733 road_flag_id_translated_name(preq->source.value.roadflag));
2734 } else {
2736 /* TRANS: %s is a (translatable) road flag. */
2737 _("Prevented by a road with the \"%s\" flag on any tile "
2738 "within the city radius."),
2739 road_flag_id_translated_name(preq->source.value.roadflag));
2740 }
2741 return TRUE;
2743 fc_strlcat(buf, prefix, bufsz);
2744 if (preq->present) {
2746 /* TRANS: %s is a (translatable) road flag. */
2747 _("Requires a road with the \"%s\" flag on a tile "
2748 "within the city radius or the city radius of a "
2749 "trade partner."),
2750 road_flag_id_translated_name(preq->source.value.roadflag));
2751 } else {
2753 /* TRANS: %s is a (translatable) road flag. */
2754 _("Prevented by a road with the \"%s\" flag on any tile "
2755 "within the city radius or the city radius of a "
2756 "trade partner."),
2757 road_flag_id_translated_name(preq->source.value.roadflag));
2758 }
2759 return TRUE;
2761 case REQ_RANGE_PLAYER:
2762 case REQ_RANGE_TEAM:
2763 case REQ_RANGE_ALLIANCE:
2764 case REQ_RANGE_WORLD:
2765 case REQ_RANGE_COUNT:
2766 /* Not supported. */
2767 break;
2768 }
2769 break;
2770
2771 case VUT_EXTRAFLAG:
2772 switch (preq->range) {
2773 case REQ_RANGE_LOCAL:
2774 fc_strlcat(buf, prefix, bufsz);
2775 if (preq->present) {
2777 /* TRANS: %s is a (translatable) extra flag. */
2778 _("Only applies to extras with the \"%s\" flag."),
2780 (preq->source.value.extraflag));
2781 } else {
2783 /* TRANS: %s is a (translatable) extra flag. */
2784 _("Does not apply to extras with the \"%s\" flag."),
2786 (preq->source.value.extraflag));
2787 }
2788 return TRUE;
2789 case REQ_RANGE_TILE:
2790 fc_strlcat(buf, prefix, bufsz);
2791 if (preq->present) {
2793 /* TRANS: %s is a (translatable) extra flag. */
2794 _("Requires an extra with the \"%s\" flag on the tile."),
2795 extra_flag_id_translated_name(preq->source.value.extraflag));
2796 } else {
2798 /* TRANS: %s is a (translatable) extra flag. */
2799 _("Prevented by an extra with the \"%s\" flag on the "
2800 "tile."),
2801 extra_flag_id_translated_name(preq->source.value.extraflag));
2802 }
2803 return TRUE;
2805 fc_strlcat(buf, prefix, bufsz);
2806 if (preq->present) {
2808 /* TRANS: %s is a (translatable) extra flag. */
2809 _("Requires an extra with the \"%s\" flag on the "
2810 "tile or a cardinally adjacent tile."),
2811 extra_flag_id_translated_name(preq->source.value.extraflag));
2812 } else {
2814 /* TRANS: %s is a (translatable) extra flag. */
2815 _("Prevented by an extra with the \"%s\" flag on "
2816 "the tile or any cardinally adjacent tile."),
2817 extra_flag_id_translated_name(preq->source.value.extraflag));
2818 }
2819 return TRUE;
2820 case REQ_RANGE_ADJACENT:
2821 fc_strlcat(buf, prefix, bufsz);
2822 if (preq->present) {
2824 /* TRANS: %s is a (translatable) extra flag. */
2825 _("Requires an extra with the \"%s\" flag on the "
2826 "tile or an adjacent tile."),
2827 extra_flag_id_translated_name(preq->source.value.extraflag));
2828 } else {
2830 /* TRANS: %s is a (translatable) extra flag. */
2831 _("Prevented by an extra with the \"%s\" flag on "
2832 "the tile or any adjacent tile."),
2833 extra_flag_id_translated_name(preq->source.value.extraflag));
2834 }
2835 return TRUE;
2836 case REQ_RANGE_CITY:
2837 fc_strlcat(buf, prefix, bufsz);
2838 if (preq->present) {
2840 /* TRANS: %s is a (translatable) extra flag. */
2841 _("Requires an extra with the \"%s\" flag on a tile "
2842 "within the city radius."),
2843 extra_flag_id_translated_name(preq->source.value.extraflag));
2844 } else {
2846 /* TRANS: %s is a (translatable) extra flag. */
2847 _("Prevented by an extra with the \"%s\" flag on any tile "
2848 "within the city radius."),
2849 extra_flag_id_translated_name(preq->source.value.extraflag));
2850 }
2851 return TRUE;
2853 fc_strlcat(buf, prefix, bufsz);
2854 if (preq->present) {
2856 /* TRANS: %s is a (translatable) extra flag. */
2857 _("Requires an extra with the \"%s\" flag on a tile "
2858 "within the city radius or the city radius of a "
2859 "trade partner."),
2860 extra_flag_id_translated_name(preq->source.value.extraflag));
2861 } else {
2863 /* TRANS: %s is a (translatable) extra flag. */
2864 _("Prevented by an extra with the \"%s\" flag on any tile "
2865 "within the city radius or the city radius of a "
2866 "trade partner."),
2867 extra_flag_id_translated_name(preq->source.value.extraflag));
2868 }
2869 return TRUE;
2871 case REQ_RANGE_PLAYER:
2872 case REQ_RANGE_TEAM:
2873 case REQ_RANGE_ALLIANCE:
2874 case REQ_RANGE_WORLD:
2875 case REQ_RANGE_COUNT:
2876 /* Not supported. */
2877 break;
2878 }
2879 break;
2880
2881 case VUT_MINYEAR:
2882 if (preq->range != REQ_RANGE_WORLD) {
2883 break;
2884 }
2885 fc_strlcat(buf, prefix, bufsz);
2886 if (preq->present) {
2888 _("Requires the game to have reached the year %s."),
2889 textyear(preq->source.value.minyear));
2890 } else {
2892 _("Requires that the game has not yet reached the "
2893 "year %s."),
2894 textyear(preq->source.value.minyear));
2895 }
2896 return TRUE;
2897
2898 case VUT_MINCALFRAG:
2899 if (preq->range != REQ_RANGE_WORLD) {
2900 break;
2901 }
2902 fc_strlcat(buf, prefix, bufsz);
2903 if (preq->present) {
2905 /* TRANS: %s is a representation of a calendar fragment,
2906 * from the ruleset. May be a bare number. */
2907 _("Requires the game to have reached %s."),
2908 textcalfrag(preq->source.value.mincalfrag));
2909 } else {
2911 /* TRANS: %s is a representation of a calendar fragment,
2912 * from the ruleset. May be a bare number. */
2913 _("Requires that the game has not yet reached %s."),
2914 textcalfrag(preq->source.value.mincalfrag));
2915 }
2916 return TRUE;
2917
2918 case VUT_TOPO:
2919 if (preq->range != REQ_RANGE_WORLD) {
2920 break;
2921 }
2922 fc_strlcat(buf, prefix, bufsz);
2923 if (preq->present) {
2925 /* TRANS: topology flag name ("Hex", "ISO") */
2926 _("Requires %s map."),
2927 _(topo_flag_name(preq->source.value.topo_property)));
2928 } else {
2930 /* TRANS: topology flag name ("Hex", "ISO") */
2931 _("Prevented on %s map."),
2932 _(topo_flag_name(preq->source.value.topo_property)));
2933 }
2934 return TRUE;
2935
2936 case VUT_WRAP:
2937 if (preq->range != REQ_RANGE_WORLD) {
2938 break;
2939 }
2940 fc_strlcat(buf, prefix, bufsz);
2941 if (preq->present) {
2943 /* TRANS: wrap flag name ("WrapX", "WrapY") */
2944 _("Requires %s map."),
2945 _(wrap_flag_name(preq->source.value.wrap_property)));
2946 } else {
2948 /* TRANS: wrap flag name ("WrapX", "WrapY") */
2949 _("Prevented on %s map."),
2950 _(wrap_flag_name(preq->source.value.wrap_property)));
2951 }
2952 return TRUE;
2953
2954 case VUT_SERVERSETTING:
2955 if (preq->range != REQ_RANGE_WORLD) {
2956 break;
2957 }
2958 fc_strlcat(buf, prefix, bufsz);
2960 /* TRANS: %s is a server setting, its value and if it is
2961 * required to be present or absent. The string's format
2962 * is specified in ssetv_human_readable().
2963 * Example: "killstack is enabled". */
2964 _("Requires that the server setting %s."),
2965 ssetv_human_readable(preq->source.value.ssetval,
2966 preq->present));
2967 return TRUE;
2968
2969 case VUT_AGE:
2970 fc_strlcat(buf, prefix, bufsz);
2971 if (preq->present) {
2973 _("Requires age of %d turns."),
2974 preq->source.value.age);
2975 } else {
2977 _("Prevented if age is over %d turns."),
2978 preq->source.value.age);
2979 }
2980 return TRUE;
2981
2982 case VUT_FORM_AGE:
2983 fc_strlcat(buf, prefix, bufsz);
2984 if (preq->present) {
2986 _("Requires form age of %d turns."),
2987 preq->source.value.form_age);
2988 } else {
2990 _("Prevented if form age is over %d turns."),
2991 preq->source.value.form_age);
2992 }
2993 return TRUE;
2994
2995 case VUT_MINTECHS:
2996 switch (preq->range) {
2997 case REQ_RANGE_WORLD:
2998 fc_strlcat(buf, prefix, bufsz);
2999 if (preq->present) {
3001 _("Requires %d techs to be known in the world."),
3002 preq->source.value.min_techs);
3003 } else {
3005 _("Prevented when %d techs are known in the world."),
3006 preq->source.value.min_techs);
3007 }
3008 return TRUE;
3009 case REQ_RANGE_PLAYER:
3010 fc_strlcat(buf, prefix, bufsz);
3011 if (preq->present) {
3013 _("Requires player to know %d techs."),
3014 preq->source.value.min_techs);
3015 } else {
3017 _("Prevented when player knows %d techs."),
3018 preq->source.value.min_techs);
3019 }
3020 return TRUE;
3021 case REQ_RANGE_LOCAL:
3022 case REQ_RANGE_TILE:
3024 case REQ_RANGE_ADJACENT:
3025 case REQ_RANGE_CITY:
3028 case REQ_RANGE_TEAM:
3029 case REQ_RANGE_ALLIANCE:
3030 case REQ_RANGE_COUNT:
3031 /* Not supported. */
3032 break;
3033 }
3034 break;
3035
3036 case VUT_FUTURETECHS:
3037 switch (preq->range) {
3038 case REQ_RANGE_WORLD:
3039 fc_strlcat(buf, prefix, bufsz);
3040 if (preq->present) {
3042 _("Requires %d future techs to be known in the world."),
3043 preq->source.value.future_techs);
3044 } else {
3046 _("Prevented when %d future techs are known in the world."),
3047 preq->source.value.future_techs);
3048 }
3049 return TRUE;
3050 case REQ_RANGE_PLAYER:
3051 fc_strlcat(buf, prefix, bufsz);
3052 if (preq->present) {
3054 _("Requires player to know %d future techs."),
3055 preq->source.value.future_techs);
3056 } else {
3058 _("Prevented when player knows %d future techs."),
3059 preq->source.value.future_techs);
3060 }
3061 return TRUE;
3062 case REQ_RANGE_LOCAL:
3063 case REQ_RANGE_TILE:
3065 case REQ_RANGE_ADJACENT:
3066 case REQ_RANGE_CITY:
3069 case REQ_RANGE_TEAM:
3070 case REQ_RANGE_ALLIANCE:
3071 case REQ_RANGE_COUNT:
3072 /* Not supported. */
3073 break;
3074 }
3075 break;
3076
3077 case VUT_MINCITIES:
3078 switch (preq->range) {
3079 case REQ_RANGE_PLAYER:
3080 fc_strlcat(buf, prefix, bufsz);
3081 if (preq->present) {
3083 _("Requires player to have at least %d cities."),
3084 preq->source.value.min_cities);
3085 } else {
3087 _("Prevented when player has at least %d cities."),
3088 preq->source.value.min_cities);
3089 }
3090 return TRUE;
3091 case REQ_RANGE_WORLD:
3092 case REQ_RANGE_LOCAL:
3093 case REQ_RANGE_TILE:
3095 case REQ_RANGE_ADJACENT:
3096 case REQ_RANGE_CITY:
3099 case REQ_RANGE_TEAM:
3100 case REQ_RANGE_ALLIANCE:
3101 case REQ_RANGE_COUNT:
3102 /* Not supported. */
3103 break;
3104 }
3105 break;
3106
3107 case VUT_TERRAINALTER:
3108 switch (preq->range) {
3109 case REQ_RANGE_TILE:
3110 fc_strlcat(buf, prefix, bufsz);
3111 if (preq->present) {
3113 _("Requires terrain on which alteration %s is "
3114 "possible."),
3115 Q_(terrain_alteration_name(preq->source.value.terrainalter)));
3116 } else {
3118 _("Prevented by terrain on which alteration %s "
3119 "can be made."),
3120 Q_(terrain_alteration_name(preq->source.value.terrainalter)));
3121 }
3122 return TRUE;
3124 case REQ_RANGE_ADJACENT:
3125 case REQ_RANGE_CITY:
3128 case REQ_RANGE_PLAYER:
3129 case REQ_RANGE_TEAM:
3130 case REQ_RANGE_ALLIANCE:
3131 case REQ_RANGE_WORLD:
3132 case REQ_RANGE_LOCAL:
3133 case REQ_RANGE_COUNT:
3134 /* Not supported. */
3135 break;
3136 }
3137 break;
3138
3139 case VUT_CITYTILE:
3140 if (preq->source.value.citytile == CITYT_LAST) {
3141 break;
3142 } else {
3143 static char *tile_property = NULL;
3144
3145 switch (preq->source.value.citytile) {
3146 case CITYT_CENTER:
3147 tile_property = _("city centers");
3148 break;
3149 case CITYT_CLAIMED:
3150 tile_property = _("claimed tiles");
3151 break;
3152 case CITYT_EXTRAS_OWNED:
3153 tile_property = _("owned extras");
3154 break;
3155 case CITYT_WORKED:
3156 tile_property = _("worked tiles");
3157 break;
3159 /* TRANS: a specific city for each use case */
3160 tile_property = _("tiles on the same continent as the city");
3161 break;
3163 {
3164 bool oceanic_cities = FALSE; /* FIXME: maybe cache globally? */
3165
3170 /* TRANS: a specific city for each use case */
3171 tile_property = _("tiles of a mass of a different "
3172 "terrain class next to the city");
3173 break;
3174 }
3176 if (oceanic_cities) {
3177 break;
3178 }
3179 /* TRANS: a specific city for each use case */
3180 tile_property = _("tiles of a body of water next to the city");
3181 }
3182 break;
3183 case CITYT_LAST:
3184 fc_assert(preq->source.value.citytile != CITYT_LAST);
3185 break;
3186 }
3187
3188 switch (preq->range) {
3189 case REQ_RANGE_TILE:
3190 fc_strlcat(buf, prefix, bufsz);
3191 if (preq->present) {
3193 /* TRANS: tile property ("city centers", etc) */
3194 Q_("?tileprop:Applies only to %s."), tile_property);
3195 } else {
3197 /* TRANS: tile property ("city centers", etc) */
3198 Q_("?tileprop:Does not apply to %s."), tile_property);
3199 }
3200 return TRUE;
3202 fc_strlcat(buf, prefix, bufsz);
3203 if (preq->present) {
3204 /* TRANS: tile property ("city centers", etc) */
3205 cat_snprintf(buf, bufsz, Q_("?tileprop:Applies only to %s and "
3206 "cardinally adjacent tiles."),
3208 } else {
3209 /* TRANS: tile property ("city centers", etc) */
3210 cat_snprintf(buf, bufsz, Q_("?tileprop:Does not apply to %s or "
3211 "cardinally adjacent tiles."),
3213 }
3214 return TRUE;
3215 case REQ_RANGE_ADJACENT:
3216 fc_strlcat(buf, prefix, bufsz);
3217 if (preq->present) {
3218 /* TRANS: tile property ("city centers", etc) */
3219 cat_snprintf(buf, bufsz, Q_("?tileprop:Applies only to %s and "
3220 "adjacent tiles."), tile_property);
3221 } else {
3222 /* TRANS: tile property ("city centers", etc) */
3223 cat_snprintf(buf, bufsz, Q_("?tileprop:Does not apply to %s or "
3224 "adjacent tiles."), tile_property);
3225 }
3226 return TRUE;
3227 case REQ_RANGE_CITY:
3230 case REQ_RANGE_PLAYER:
3231 case REQ_RANGE_TEAM:
3232 case REQ_RANGE_ALLIANCE:
3233 case REQ_RANGE_WORLD:
3234 case REQ_RANGE_LOCAL:
3235 case REQ_RANGE_COUNT:
3236 /* Not supported. */
3237 break;
3238 }
3239
3240 break;
3241 }
3242
3243 case VUT_CITYSTATUS:
3244 if (preq->source.value.citystatus != CITYS_LAST) {
3245 static char *city_property = NULL;
3246
3247 switch (preq->source.value.citystatus) {
3249 city_property = _("owned by original");
3250 break;
3251 case CITYS_STARVED:
3252 city_property = _("starved");
3253 break;
3254 case CITYS_DISORDER:
3255 city_property = _("disorder");
3256 break;
3257 case CITYS_CELEBRATION:
3258 city_property = _("celebration");
3259 break;
3260 case CITYS_TRANSFERRED:
3261 city_property = _("transferred");
3262 break;
3264 city_property = _("capitalconnected");
3265 break;
3266 case CITYS_LAST:
3267 fc_assert(preq->source.value.citystatus != CITYS_LAST);
3268 break;
3269 }
3270
3271 switch (preq->range) {
3272 case REQ_RANGE_CITY:
3273 fc_strlcat(buf, prefix, bufsz);
3274 if (preq->present) {
3275 /* TRANS: city property ("owned by original", etc) */
3276 cat_snprintf(buf, bufsz, Q_("?cityprop:Applies only to %s cities"),
3278 } else {
3279 /* TRANS: city property ("owned by original", etc) */
3280 cat_snprintf(buf, bufsz, Q_("?cityprop:Does not apply to %s cities"),
3282 }
3283 return TRUE;
3285 fc_strlcat(buf, prefix, bufsz);
3286 if (preq->present) {
3287 /* TRANS: city property ("owned by original", etc) */
3288 cat_snprintf(buf, bufsz, Q_("?cityprop:Applies only to %s cities or "
3289 "their trade partners."), city_property);
3290 } else {
3291 /* TRANS: city property ("owned by original", etc) */
3292 cat_snprintf(buf, bufsz, Q_("?cityprop:Does not apply to %s cities or "
3293 "their trade partners."), city_property);
3294 }
3295 return TRUE;
3296 case REQ_RANGE_LOCAL:
3297 case REQ_RANGE_TILE:
3298 case REQ_RANGE_ADJACENT:
3301 case REQ_RANGE_PLAYER:
3302 case REQ_RANGE_TEAM:
3303 case REQ_RANGE_ALLIANCE:
3304 case REQ_RANGE_WORLD:
3305 case REQ_RANGE_COUNT:
3306 /* Not supported. */
3307 break;
3308 }
3309 }
3310 break;
3311
3312 case VUT_MINLATITUDE:
3313 switch (preq->range) {
3314 case REQ_RANGE_WORLD:
3315 fc_strlcat(buf, prefix, bufsz);
3316 if (preq->present) {
3318 _("Some part of the world must be at latitude %d or "
3319 "further north."),
3320 preq->source.value.latitude);
3321 } else {
3323 _("The entire world must be at latitude %d or "
3324 "further south."),
3325 preq->source.value.latitude - 1);
3326 }
3327 return TRUE;
3328 case REQ_RANGE_TILE:
3329 fc_strlcat(buf, prefix, bufsz);
3330 if (preq->present) {
3332 _("Tile must be at latitude %d or further north."),
3333 preq->source.value.latitude);
3334 } else {
3336 _("Tile must be at latitude %d or further south."),
3337 preq->source.value.latitude - 1);
3338 }
3339 return TRUE;
3341 fc_strlcat(buf, prefix, bufsz);
3342 if (preq->present) {
3344 _("A cardinally adjacent tile must be at latitude "
3345 "%d or further north."),
3346 preq->source.value.latitude);
3347 } else {
3349 _("All cardinally adjacent tiles must be at latitude "
3350 "%d or further south."),
3351 preq->source.value.latitude - 1);
3352 }
3353 return TRUE;
3354 case REQ_RANGE_ADJACENT:
3355 fc_strlcat(buf, prefix, bufsz);
3356 if (preq->present) {
3358 _("An adjacent tile must be at latitude %d or "
3359 "further north."),
3360 preq->source.value.latitude);
3361 } else {
3363 _("All adjacent tiles must be at latitude %d or "
3364 "further south."),
3365 preq->source.value.latitude - 1);
3366 }
3367 return TRUE;
3368 case REQ_RANGE_CITY:
3371 case REQ_RANGE_PLAYER:
3372 case REQ_RANGE_TEAM:
3373 case REQ_RANGE_ALLIANCE:
3374 case REQ_RANGE_LOCAL:
3375 case REQ_RANGE_COUNT:
3376 /* Not supported. */
3377 break;
3378 }
3379 break;
3380
3381 case VUT_MAXLATITUDE:
3382 switch (preq->range) {
3383 case REQ_RANGE_WORLD:
3384 fc_strlcat(buf, prefix, bufsz);
3385 if (preq->present) {
3387 _("Some part of the world must be at latitude %d or "
3388 "further south."),
3389 preq->source.value.latitude);
3390 } else {
3392 _("The entire world must be at latitude %d or "
3393 "further north."),
3394 preq->source.value.latitude + 1);
3395 }
3396 return TRUE;
3397 case REQ_RANGE_TILE:
3398 fc_strlcat(buf, prefix, bufsz);
3399 if (preq->present) {
3401 _("Tile must be at latitude %d or further south."),
3402 preq->source.value.latitude);
3403 } else {
3405 _("Tile must be at latitude %d or further north."),
3406 preq->source.value.latitude + 1);
3407 }
3408 return TRUE;
3410 fc_strlcat(buf, prefix, bufsz);
3411 if (preq->present) {
3413 _("A cardinally adjacent tile must be at latitude "
3414 "%d or further south."),
3415 preq->source.value.latitude);
3416 } else {
3418 _("All cardinally adjacent tiles must be at latitude "
3419 "%d or further north."),
3420 preq->source.value.latitude + 1);
3421 }
3422 return TRUE;
3423 case REQ_RANGE_ADJACENT:
3424 fc_strlcat(buf, prefix, bufsz);
3425 if (preq->present) {
3427 _("An adjacent tile must be at latitude %d or "
3428 "further south."),
3429 preq->source.value.latitude);
3430 } else {
3432 _("All adjacent tiles must be at latitude %d or "
3433 "further north."),
3434 preq->source.value.latitude + 1);
3435 }
3436 return TRUE;
3437 case REQ_RANGE_CITY:
3440 case REQ_RANGE_PLAYER:
3441 case REQ_RANGE_TEAM:
3442 case REQ_RANGE_ALLIANCE:
3443 case REQ_RANGE_LOCAL:
3444 case REQ_RANGE_COUNT:
3445 /* Not supported. */
3446 break;
3447 }
3448 break;
3449
3451 switch (preq->range) {
3452 case REQ_RANGE_TILE:
3453 fc_strlcat(buf, prefix, bufsz);
3454 /* Test some special cases */
3455 switch (preq->source.value.distance_sq)
3456 {
3457 case 0:
3458 if (preq->present) {
3459 fc_strlcat(buf, _("Must be the same tile."), bufsz);
3460 } else {
3461 fc_strlcat(buf, _("Must not be the same tile."), bufsz);
3462 }
3463 break;
3464 case 1:
3465 if (preq->present) {
3466 fc_strlcat(buf, _("Must be cardinally adjacent."), bufsz);
3467 } else {
3468 fc_strlcat(buf, _("Must not be cardinally adjacent."), bufsz);
3469 }
3470 break;
3471 case 2:
3472 case 3:
3473 if (preq->present) {
3474 fc_strlcat(buf, _("Must be adjacent."), bufsz);
3475 } else {
3476 fc_strlcat(buf, _("Must not be adjacent."), bufsz);
3477 }
3478 break;
3479
3480 default:
3481 if (preq->present) {
3483 _("The squared distance between the tiles "
3484 "must be at most %d."),
3485 preq->source.value.distance_sq);
3486 } else {
3488 _("The squared distance between the tiles "
3489 "must be at least %d."),
3490 preq->source.value.distance_sq + 1);
3491 }
3492 break;
3493 }
3494 return TRUE;
3496 case REQ_RANGE_ADJACENT:
3497 case REQ_RANGE_CITY:
3500 case REQ_RANGE_PLAYER:
3501 case REQ_RANGE_TEAM:
3502 case REQ_RANGE_ALLIANCE:
3503 case REQ_RANGE_WORLD:
3504 case REQ_RANGE_LOCAL:
3505 case REQ_RANGE_COUNT:
3506 /* Not supported. */
3507 break;
3508 }
3509 break;
3510
3512 switch (preq->range) {
3514 fc_strlcat(buf, prefix, bufsz);
3515 /* Off-by-one: The requirement counts the tile itself, we're phrasing
3516 * the helptext in terms of *other* tiles only. */
3517 if (preq->present) {
3518 if (preq->source.value.region_tiles == 1) {
3519 /* Special case for zero */
3521 _("No other cardinally adjacent tile may be part of "
3522 "the same continent or ocean."),
3523 bufsz);
3524 } else {
3526 PL_("No more than %d other cardinally adjacent tile "
3527 "may be part of the same continent or ocean.",
3528 "No more than %d other cardinally adjacent tiles "
3529 "may be part of the same continent or ocean.",
3530 preq->source.value.region_tiles - 1),
3531 preq->source.value.region_tiles - 1);
3532 }
3533 } else {
3535 PL_("Requires at least %d other cardinally adjacent "
3536 "tile of the same continent or ocean.",
3537 "Requires at least %d other cardinally adjacent "
3538 "tiles of the same continent or ocean.",
3539 preq->source.value.region_tiles),
3540 preq->source.value.region_tiles);
3541 }
3542
3543 return TRUE;
3544 case REQ_RANGE_ADJACENT:
3545 fc_strlcat(buf, prefix, bufsz);
3546 /* Off-by-one: The requirement counts the tile itself, we're phrasing
3547 * the helptext in terms of *other* tiles only. */
3548 if (preq->present) {
3549 if (preq->source.value.region_tiles == 1) {
3550 /* Special case for zero */
3552 _("No other adjacent tile may be part of the same "
3553 "continent or ocean."),
3554 bufsz);
3555 } else {
3557 PL_("No more than %d other adjacent tile may be "
3558 "part of the same continent or ocean.",
3559 "No more than %d other adjacent tiles may be "
3560 "part of the same continent or ocean.",
3561 preq->source.value.region_tiles - 1),
3562 preq->source.value.region_tiles - 1);
3563 }
3564 } else {
3566 PL_("Requires at least %d other adjacent tile of the "
3567 "same continent or ocean.",
3568 "Requires at least %d other adjacent tiles of the "
3569 "same continent or ocean.",
3570 preq->source.value.region_tiles),
3571 preq->source.value.region_tiles);
3572 }
3573
3574 return TRUE;
3576 fc_strlcat(buf, prefix, bufsz);
3577 if (preq->present) {
3579 _("Requires a continent or ocean size of at most %d."),
3580 preq->source.value.region_tiles);
3581 } else {
3583 _("Requires a continent or ocean size of at least %d."),
3584 preq->source.value.region_tiles + 1);
3585 }
3586
3587 return TRUE;
3588 case REQ_RANGE_PLAYER:
3589 case REQ_RANGE_TEAM:
3590 case REQ_RANGE_ALLIANCE:
3591 case REQ_RANGE_WORLD:
3592 case REQ_RANGE_LOCAL:
3593 case REQ_RANGE_TILE:
3594 case REQ_RANGE_CITY:
3596 case REQ_RANGE_COUNT:
3597 /* Not supported. */
3598 break;
3599 }
3600 break;
3601
3602 case VUT_TILE_REL:
3603 switch (preq->source.value.tilerel) {
3604 case TREL_SAME_TCLASS:
3605 switch (preq->range) {
3606 case REQ_RANGE_TILE:
3607 fc_strlcat(buf, prefix, bufsz);
3608 if (preq->present) {
3609 fc_strlcat(buf, _("Must be on the same terrain class."),
3610 bufsz);
3611 } else {
3612 fc_strlcat(buf, _("Must be on a different terrain class."),
3613 bufsz);
3614 }
3615 return TRUE;
3617 fc_strlcat(buf, prefix, bufsz);
3618 if (preq->present) {
3619 fc_strlcat(buf, _("Must be cardinally adjacent to the same "
3620 "terrain class."),
3621 bufsz);
3622 } else {
3623 fc_strlcat(buf, _("Must not be cardinally adjacent to the same "
3624 "terrain class."),
3625 bufsz);
3626 }
3627 return TRUE;
3628 case REQ_RANGE_ADJACENT:
3629 fc_strlcat(buf, prefix, bufsz);
3630 if (preq->present) {
3631 fc_strlcat(buf, _("Must be adjacent to the same terrain class."),
3632 bufsz);
3633 } else {
3634 fc_strlcat(buf, _("Must not be adjacent to the same terrain "
3635 "class."),
3636 bufsz);
3637 }
3638 return TRUE;
3639 case REQ_RANGE_CITY:
3642 case REQ_RANGE_PLAYER:
3643 case REQ_RANGE_TEAM:
3644 case REQ_RANGE_ALLIANCE:
3645 case REQ_RANGE_WORLD:
3646 case REQ_RANGE_LOCAL:
3647 case REQ_RANGE_COUNT:
3648 /* Not supported. */
3649 break;
3650 }
3651 break;
3652 case TREL_SAME_REGION:
3653 switch (preq->range) {
3654 case REQ_RANGE_TILE:
3655 fc_strlcat(buf, prefix, bufsz);
3656 if (preq->present) {
3657 fc_strlcat(buf, _("Must be on the same continent or ocean."),
3658 bufsz);
3659 } else {
3660 fc_strlcat(buf, _("Must be on a different continent or ocean."),
3661 bufsz);
3662 }
3663 return TRUE;
3665 fc_strlcat(buf, prefix, bufsz);
3666 if (preq->present) {
3667 fc_strlcat(buf, _("Must be cardinally adjacent to the same "
3668 "continent or ocean."),
3669 bufsz);
3670 } else {
3671 fc_strlcat(buf, _("Must not be cardinally adjacent to the same "
3672 "continent or ocean."),
3673 bufsz);
3674 }
3675 return TRUE;
3676 case REQ_RANGE_ADJACENT:
3677 fc_strlcat(buf, prefix, bufsz);
3678 if (preq->present) {
3679 fc_strlcat(buf, _("Must be adjacent to the same continent or "
3680 "ocean."),
3681 bufsz);
3682 } else {
3683 fc_strlcat(buf, _("Must not be adjacent to the same continent "
3684 "or ocean."),
3685 bufsz);
3686 }
3687 return TRUE;
3688 case REQ_RANGE_CITY:
3691 case REQ_RANGE_PLAYER:
3692 case REQ_RANGE_TEAM:
3693 case REQ_RANGE_ALLIANCE:
3694 case REQ_RANGE_WORLD:
3695 case REQ_RANGE_LOCAL:
3696 case REQ_RANGE_COUNT:
3697 /* Not supported. */
3698 break;
3699 }
3700 break;
3702 switch (preq->range) {
3704 fc_strlcat(buf, prefix, bufsz);
3705 if (preq->present) {
3706 fc_strlcat(buf, _("May only be cardinally adjacent to this "
3707 "other continent or ocean."),
3708 bufsz);
3709 } else {
3710 fc_strlcat(buf, _("Must be cardinally adjacent to more than "
3711 "just this other continent or ocean."),
3712 bufsz);
3713 }
3714 return TRUE;
3715 case REQ_RANGE_ADJACENT:
3716 fc_strlcat(buf, prefix, bufsz);
3717 if (preq->present) {
3718 fc_strlcat(buf, _("May only be adjacent to this other continent "
3719 "or ocean."),
3720 bufsz);
3721 } else {
3722 fc_strlcat(buf, _("Must be adjacent to more than just this "
3723 "other continent or ocean."),
3724 bufsz);
3725 }
3726 return TRUE;
3727 case REQ_RANGE_CITY:
3730 case REQ_RANGE_PLAYER:
3731 case REQ_RANGE_TEAM:
3732 case REQ_RANGE_ALLIANCE:
3733 case REQ_RANGE_WORLD:
3734 case REQ_RANGE_LOCAL:
3735 case REQ_RANGE_TILE:
3736 case REQ_RANGE_COUNT:
3737 /* Not supported. */
3738 break;
3739 }
3740 break;
3742 switch (preq->range) {
3743 case REQ_RANGE_TILE:
3744 fc_strlcat(buf, prefix, bufsz);
3745 if (preq->present) {
3746 fc_strlcat(buf, _("Must be on a lake or island surrounded by "
3747 "this continent or ocean."),
3748 bufsz);
3749 } else {
3750 fc_strlcat(buf, _("Must not be on a lake or island surrounded "
3751 "by this continent or ocean."),
3752 bufsz);
3753 }
3754 return TRUE;
3756 fc_strlcat(buf, prefix, bufsz);
3757 if (preq->present) {
3758 fc_strlcat(buf, _("Must be on or cardinally adjacent to a lake "
3759 "or island surrounded by this continent or "
3760 "ocean."),
3761 bufsz);
3762 } else {
3763 fc_strlcat(buf, _("Must not be on nor cardinally adjacent to a "
3764 "lake or island surrounded by this continent "
3765 "or ocean."),
3766 bufsz);
3767 }
3768 return TRUE;
3769 case REQ_RANGE_ADJACENT:
3770 fc_strlcat(buf, prefix, bufsz);
3771 if (preq->present) {
3772 fc_strlcat(buf, _("Must be on or adjacent to a lake or island "
3773 "surrounded by this continent or ocean."),
3774 bufsz);
3775 } else {
3776 fc_strlcat(buf, _("Must not be on nor adjacent to a lake or "
3777 "island surrounded by this continent or "
3778 "ocean."),
3779 bufsz);
3780 }
3781 return TRUE;
3782 case REQ_RANGE_CITY:
3785 case REQ_RANGE_PLAYER:
3786 case REQ_RANGE_TEAM:
3787 case REQ_RANGE_ALLIANCE:
3788 case REQ_RANGE_WORLD:
3789 case REQ_RANGE_LOCAL:
3790 case REQ_RANGE_COUNT:
3791 /* Not supported. */
3792 break;
3793 }
3794 break;
3795
3796 case TREL_COUNT:
3797 /* Invalid. */
3798 break;
3799 }
3800 break;
3801
3802 case VUT_COUNT:
3803 break;
3804 }
3805
3806 if (verb == VERB_DEFAULT) {
3807 char text[256];
3808
3809 log_error("%s requirement %s in range %d is not supported in reqtext.c.",
3810 preq->present ? "Present" : "Absent",
3811 universal_name_translation(&preq->source, text, sizeof(text)),
3812 preq->range);
3813 }
3814
3815 return FALSE;
3816}
3817
3818/*************************************************************/
3821bool req_text_insert_nl(char *buf, size_t bufsz, struct player *pplayer,
3822 const struct requirement *preq,
3823 enum rt_verbosity verb, const char *prefix)
3824{
3825 if (req_text_insert(buf, bufsz, pplayer, preq, verb, prefix)) {
3826 fc_strlcat(buf, "\n", bufsz);
3827
3828 return TRUE;
3829 }
3830
3831 return FALSE;
3832}
const char * achievement_name_translation(struct achievement *pach)
const char * action_name_translation(const struct action *paction)
Definition actions.c:1251
void astr_free(struct astring *astr)
Definition astring.c:148
const char * astr_build_or_list(struct astring *astr, const char *const *items, size_t number)
Definition astring.c:313
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
Definition astring.h:93
#define ASTRING_INIT
Definition astring.h:44
const char * textcalfrag(int frag)
Definition calendar.c:101
const char * textyear(int year)
Definition calendar.c:121
const char * get_output_name(Output_type_id output)
Definition city.c:629
static struct fc_sockaddr_list * list
Definition clinet.c:102
char * incite_cost
Definition comments.c:76
const char * counter_rule_name(struct counter *pcount)
Definition counters.c:165
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:194
#define Q_(String)
Definition fcintl.h:70
#define PL_(String1, String2, n)
Definition fcintl.h:71
#define _(String)
Definition fcintl.h:67
const char * government_name_translation(const struct government *pgovern)
Definition government.c:145
static const int bufsz
Definition helpdlg.c:70
bool can_improvement_go_obsolete(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
Definition log.h:182
#define fc_assert(condition)
Definition log.h:177
#define log_error(message,...)
Definition log.h:104
const char * move_points_text(int mp, bool reduce)
Definition movement.c:1048
const char * nation_adjective_translation(const struct nation_type *pnation)
Definition nation.c:149
const char * nation_group_name_translation(const struct nation_group *pgroup)
Definition nation.c:1128
const char * nation_plural_translation(const struct nation_type *pnation)
Definition nation.c:159
const char * diplrel_name_translation(int value)
Definition player.c:1639
bool req_text_insert_nl(char *buf, size_t bufsz, struct player *pplayer, const struct requirement *preq, enum rt_verbosity verb, const char *prefix)
Definition reqtext.c:3821
bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, const struct requirement *preq, enum rt_verbosity verb, const char *prefix)
Definition reqtext.c:48
rt_verbosity
Definition reqtext.h:20
@ VERB_ACTUAL
Definition reqtext.h:20
@ VERB_DEFAULT
Definition reqtext.h:20
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
const char * ssetv_human_readable(ssetv val, bool present)
const char * specialist_plural_translation(const struct specialist *sp)
Definition specialist.c:166
const char * style_name_translation(const struct nation_style *pstyle)
Definition style.c:99
size_t fc_strlcat(char *dest, const char *src, size_t n)
Definition support.c:822
int cat_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:986
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:300
const char * terrain_class_name_translation(enum terrain_class tclass)
Definition terrain.c:665
const char * terrain_name_translation(const struct terrain *pterrain)
Definition terrain.c:241
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
Definition terrain.c:586
#define terrain_type_iterate(_p)
Definition terrain.h:266
#define terrain_type_iterate_end
Definition terrain.h:272
#define terrain_has_flag(terr, flag)
Definition terrain.h:176
const char * goods_name_translation(struct goods_type *pgood)
const char * uclass_name_translation(const struct unit_class *pclass)
Definition unittype.c:1658
Unit_Class_id uclass_count(void)
Definition unittype.c:2475
const char * utype_name_translation(const struct unit_type *punittype)
Definition unittype.c:1586
bool role_units_translations(struct astring *astr, int flag, bool alts)
Definition unittype.c:1694
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
Definition unittype.h:773
#define unit_class_iterate(_p)
Definition unittype.h:916
#define unit_class_iterate_end
Definition unittype.h:923