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)
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 ****************************************************************************/
15 #include <fc_config.h>
23 #include "achievements.h"
27 #include "government.h"
31 #include "requirements.h"
32 #include "specialist.h"
36 /****************************************************************
37 Append text for the requirement. Something like
39 "Requires knowledge of the technology Communism."
41 pplayer may be NULL. Note that it must be updated everytime
42 a new requirement type or range is defined.
43 *****************************************************************/
44 bool req_text_insert(char *buf
, size_t bufsz
, struct player
*pplayer
,
45 const struct requirement
*preq
,
46 enum rt_verbosity verb
)
48 if (preq
->quiet
&& verb
!= VERB_ACTUAL
) {
52 switch (preq
->source
.kind
) {
57 switch (preq
->range
) {
58 case REQ_RANGE_PLAYER
:
60 cat_snprintf(buf
, bufsz
,
61 _("Requires knowledge of the technology %s."),
62 advance_name_translation(preq
->source
.value
.advance
));
64 cat_snprintf(buf
, bufsz
,
65 _("Prevented by knowledge of the technology %s."),
66 advance_name_translation(preq
->source
.value
.advance
));
71 cat_snprintf(buf
, bufsz
,
72 _("Requires that a player on your team knows the "
74 advance_name_translation(preq
->source
.value
.advance
));
76 cat_snprintf(buf
, bufsz
,
77 _("Prevented if any player on your team knows the "
79 advance_name_translation(preq
->source
.value
.advance
));
82 case REQ_RANGE_ALLIANCE
:
84 cat_snprintf(buf
, bufsz
,
85 _("Requires that a player allied to you knows the "
87 advance_name_translation(preq
->source
.value
.advance
));
89 cat_snprintf(buf
, bufsz
,
90 _("Prevented if any player allied to you knows the "
92 advance_name_translation(preq
->source
.value
.advance
));
98 cat_snprintf(buf
, bufsz
,
99 _("Requires that someone has discovered the "
101 advance_name_translation(preq
->source
.value
.advance
));
103 cat_snprintf(buf
, bufsz
,
104 _("Requires that no-one has yet discovered the "
106 advance_name_translation(preq
->source
.value
.advance
));
110 cat_snprintf(buf
, bufsz
,
111 _("Requires that some player knows the "
113 advance_name_translation(preq
->source
.value
.advance
));
115 cat_snprintf(buf
, bufsz
,
116 _("Requires that no player knows the "
118 advance_name_translation(preq
->source
.value
.advance
));
122 case REQ_RANGE_LOCAL
:
123 case REQ_RANGE_CADJACENT
:
124 case REQ_RANGE_ADJACENT
:
126 case REQ_RANGE_TRADEROUTE
:
127 case REQ_RANGE_CONTINENT
:
128 case REQ_RANGE_COUNT
:
135 switch (preq
->range
) {
136 case REQ_RANGE_PLAYER
:
138 cat_snprintf(buf
, bufsz
,
139 /* TRANS: %s is a (translatable) tech flag. */
140 _("Requires knowledge of a technology with the "
142 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
144 cat_snprintf(buf
, bufsz
,
145 /* TRANS: %s is a (translatable) tech flag. */
146 _("Prevented by knowledge of any technology with the "
148 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
153 cat_snprintf(buf
, bufsz
,
154 /* TRANS: %s is a (translatable) tech flag. */
155 _("Requires that a player on your team knows "
156 "a technology with the \"%s\" flag."),
157 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
159 cat_snprintf(buf
, bufsz
,
160 /* TRANS: %s is a (translatable) tech flag. */
161 _("Prevented if any player on your team knows "
162 "any technology with the \"%s\" flag."),
163 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
166 case REQ_RANGE_ALLIANCE
:
168 cat_snprintf(buf
, bufsz
,
169 /* TRANS: %s is a (translatable) tech flag. */
170 _("Requires that a player allied to you knows "
171 "a technology with the \"%s\" flag."),
172 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
174 cat_snprintf(buf
, bufsz
,
175 /* TRANS: %s is a (translatable) tech flag. */
176 _("Prevented if any player allied to you knows "
177 "any technology with the \"%s\" flag."),
178 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
181 case REQ_RANGE_WORLD
:
183 cat_snprintf(buf
, bufsz
,
184 /* TRANS: %s is a (translatable) tech flag. */
185 _("Requires that some player knows a technology "
186 "with the \"%s\" flag."),
187 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
189 cat_snprintf(buf
, bufsz
,
190 /* TRANS: %s is a (translatable) tech flag. */
191 _("Requires that no player knows any technology with "
193 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
196 case REQ_RANGE_LOCAL
:
197 case REQ_RANGE_CADJACENT
:
198 case REQ_RANGE_ADJACENT
:
200 case REQ_RANGE_TRADEROUTE
:
201 case REQ_RANGE_CONTINENT
:
202 case REQ_RANGE_COUNT
:
209 if (preq
->range
!= REQ_RANGE_PLAYER
) {
213 cat_snprintf(buf
, bufsz
, _("Requires the %s government."),
214 government_name_translation(preq
->source
.value
.govern
));
216 cat_snprintf(buf
, bufsz
, _("Not available under the %s government."),
217 government_name_translation(preq
->source
.value
.govern
));
221 case VUT_ACHIEVEMENT
:
222 switch (preq
->range
) {
223 case REQ_RANGE_PLAYER
:
225 cat_snprintf(buf
, bufsz
, _("Requires you to have achieved \"%s\"."),
226 achievement_name_translation(preq
->source
.value
.achievement
));
228 cat_snprintf(buf
, bufsz
, _("Not available once you have achieved "
230 achievement_name_translation(preq
->source
.value
.achievement
));
235 cat_snprintf(buf
, bufsz
, _("Requires that at least one of your "
236 "team-mates has achieved \"%s\"."),
237 achievement_name_translation(preq
->source
.value
.achievement
));
239 cat_snprintf(buf
, bufsz
, _("Not available if any of your team-mates "
240 "has achieved \"%s\"."),
241 achievement_name_translation(preq
->source
.value
.achievement
));
244 case REQ_RANGE_ALLIANCE
:
246 cat_snprintf(buf
, bufsz
, _("Requires that at least one of your allies "
247 "has achieved \"%s\"."),
248 achievement_name_translation(preq
->source
.value
.achievement
));
250 cat_snprintf(buf
, bufsz
, _("Not available if any of your allies has "
252 achievement_name_translation(preq
->source
.value
.achievement
));
255 case REQ_RANGE_WORLD
:
257 cat_snprintf(buf
, bufsz
, _("Requires that at least one player "
258 "has achieved \"%s\"."),
259 achievement_name_translation(preq
->source
.value
.achievement
));
261 cat_snprintf(buf
, bufsz
, _("Not available if any player has "
263 achievement_name_translation(preq
->source
.value
.achievement
));
266 case REQ_RANGE_LOCAL
:
267 case REQ_RANGE_CADJACENT
:
268 case REQ_RANGE_ADJACENT
:
270 case REQ_RANGE_TRADEROUTE
:
271 case REQ_RANGE_CONTINENT
:
272 case REQ_RANGE_COUNT
:
279 switch (preq
->range
) {
280 case REQ_RANGE_LOCAL
:
282 cat_snprintf(buf
, bufsz
, _("Applies to the \"%s\" action."),
283 action_name_translation(preq
->source
.value
.action
));
285 cat_snprintf(buf
, bufsz
, _("Doesn't apply to the \"%s\""
287 action_name_translation(preq
->source
.value
.action
));
297 switch (preq
->range
) {
298 case REQ_RANGE_LOCAL
:
300 cat_snprintf(buf
, bufsz
, _("Applies to \"%s\" buildings."),
301 impr_genus_id_translated_name(
302 preq
->source
.value
.impr_genus
));
304 cat_snprintf(buf
, bufsz
, _("Doesn't apply to \"%s\" buildings."),
305 impr_genus_id_translated_name(
306 preq
->source
.value
.impr_genus
));
315 case VUT_IMPROVEMENT
:
316 switch (preq
->range
) {
317 case REQ_RANGE_WORLD
:
318 if (is_great_wonder(preq
->source
.value
.building
)) {
319 if (preq
->survives
) {
321 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
322 cat_snprintf(buf
, bufsz
,
323 /* TRANS: %s is a wonder */
324 _("Requires that %s was built at some point, "
325 "and that it has not yet been rendered "
327 improvement_name_translation
328 (preq
->source
.value
.building
));
330 cat_snprintf(buf
, bufsz
,
331 /* TRANS: %s is a wonder */
332 _("Requires that %s was built at some point."),
333 improvement_name_translation
334 (preq
->source
.value
.building
));
337 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
338 cat_snprintf(buf
, bufsz
,
339 /* TRANS: %s is a wonder */
340 _("Prevented if %s has ever been built, "
341 "unless it would be obsolete."),
342 improvement_name_translation
343 (preq
->source
.value
.building
));
345 cat_snprintf(buf
, bufsz
,
346 /* TRANS: %s is a wonder */
347 _("Prevented if %s has ever been built."),
348 improvement_name_translation
349 (preq
->source
.value
.building
));
353 /* Non-surviving requirement */
355 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
356 cat_snprintf(buf
, bufsz
,
357 /* TRANS: %s is a wonder */
358 _("Requires %s to be owned by any player "
359 "and not yet obsolete."),
360 improvement_name_translation
361 (preq
->source
.value
.building
));
363 cat_snprintf(buf
, bufsz
,
364 /* TRANS: %s is a wonder */
365 _("Requires %s to be owned by any player."),
366 improvement_name_translation
367 (preq
->source
.value
.building
));
370 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
371 cat_snprintf(buf
, bufsz
,
372 /* TRANS: %s is a wonder */
373 _("Prevented if %s is currently owned by "
374 "any player, unless it is obsolete."),
375 improvement_name_translation
376 (preq
->source
.value
.building
));
378 cat_snprintf(buf
, bufsz
,
379 /* TRANS: %s is a wonder */
380 _("Prevented if %s is currently owned by "
382 improvement_name_translation
383 (preq
->source
.value
.building
));
389 /* non-great-wonder world-ranged requirements not supported */
391 case REQ_RANGE_ALLIANCE
:
392 if (is_wonder(preq
->source
.value
.building
)) {
393 if (preq
->survives
) {
395 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
396 cat_snprintf(buf
, bufsz
,
397 /* TRANS: %s is a wonder */
398 _("Requires someone who is currently allied to "
399 "you to have built %s at some point, and for "
400 "it not to have been rendered obsolete."),
401 improvement_name_translation
402 (preq
->source
.value
.building
));
404 cat_snprintf(buf
, bufsz
,
405 /* TRANS: %s is a wonder */
406 _("Requires someone who is currently allied to "
407 "you to have built %s at some point."),
408 improvement_name_translation
409 (preq
->source
.value
.building
));
412 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
413 cat_snprintf(buf
, bufsz
,
414 /* TRANS: %s is a wonder */
415 _("Prevented if someone currently allied to you "
416 "has ever built %s, unless it would be "
418 improvement_name_translation
419 (preq
->source
.value
.building
));
421 cat_snprintf(buf
, bufsz
,
422 /* TRANS: %s is a wonder */
423 _("Prevented if someone currently allied to you "
424 "has ever built %s."),
425 improvement_name_translation
426 (preq
->source
.value
.building
));
430 /* Non-surviving requirement */
432 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
433 cat_snprintf(buf
, bufsz
,
434 /* TRANS: %s is a wonder */
435 _("Requires someone allied to you to own %s, "
436 "and for it not to have been rendered "
438 improvement_name_translation
439 (preq
->source
.value
.building
));
441 cat_snprintf(buf
, bufsz
,
442 /* TRANS: %s is a wonder */
443 _("Requires someone allied to you to own %s."),
444 improvement_name_translation
445 (preq
->source
.value
.building
));
448 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
449 cat_snprintf(buf
, bufsz
,
450 /* TRANS: %s is a wonder */
451 _("Prevented if someone allied to you owns %s, "
452 "unless it is obsolete."),
453 improvement_name_translation
454 (preq
->source
.value
.building
));
456 cat_snprintf(buf
, bufsz
,
457 /* TRANS: %s is a wonder */
458 _("Prevented if someone allied to you owns %s."),
459 improvement_name_translation
460 (preq
->source
.value
.building
));
466 /* non-wonder alliance-ranged requirements not supported */
469 if (is_wonder(preq
->source
.value
.building
)) {
470 if (preq
->survives
) {
472 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
473 cat_snprintf(buf
, bufsz
,
474 /* TRANS: %s is a wonder */
475 _("Requires someone on your team to have "
476 "built %s at some point, and for it not "
477 "to have been rendered obsolete."),
478 improvement_name_translation
479 (preq
->source
.value
.building
));
481 cat_snprintf(buf
, bufsz
,
482 /* TRANS: %s is a wonder */
483 _("Requires someone on your team to have "
484 "built %s at some point."),
485 improvement_name_translation
486 (preq
->source
.value
.building
));
489 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
490 cat_snprintf(buf
, bufsz
,
491 /* TRANS: %s is a wonder */
492 _("Prevented if someone on your team has ever "
493 "built %s, unless it would be obsolete."),
494 improvement_name_translation
495 (preq
->source
.value
.building
));
497 cat_snprintf(buf
, bufsz
,
498 /* TRANS: %s is a wonder */
499 _("Prevented if someone on your team has ever "
501 improvement_name_translation
502 (preq
->source
.value
.building
));
506 /* Non-surviving requirement */
508 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
509 cat_snprintf(buf
, bufsz
,
510 /* TRANS: %s is a wonder */
511 _("Requires someone on your team to own %s, "
512 "and for it not to have been rendered "
514 improvement_name_translation
515 (preq
->source
.value
.building
));
517 cat_snprintf(buf
, bufsz
,
518 /* TRANS: %s is a wonder */
519 _("Requires someone on your team to own %s."),
520 improvement_name_translation
521 (preq
->source
.value
.building
));
524 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
525 cat_snprintf(buf
, bufsz
,
526 /* TRANS: %s is a wonder */
527 _("Prevented if someone on your team owns %s, "
528 "unless it is obsolete."),
529 improvement_name_translation
530 (preq
->source
.value
.building
));
532 cat_snprintf(buf
, bufsz
,
533 /* TRANS: %s is a wonder */
534 _("Prevented if someone on your team owns %s."),
535 improvement_name_translation
536 (preq
->source
.value
.building
));
542 /* non-wonder team-ranged requirements not supported */
544 case REQ_RANGE_PLAYER
:
545 if (is_wonder(preq
->source
.value
.building
)) {
546 if (preq
->survives
) {
548 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
549 cat_snprintf(buf
, bufsz
,
550 /* TRANS: %s is a wonder */
551 _("Requires you to have built %s at some point, "
552 "and for it not to have been rendered "
554 improvement_name_translation
555 (preq
->source
.value
.building
));
557 cat_snprintf(buf
, bufsz
,
558 /* TRANS: %s is a wonder */
559 _("Requires you to have built %s at some point."),
560 improvement_name_translation
561 (preq
->source
.value
.building
));
564 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
565 cat_snprintf(buf
, bufsz
,
566 /* TRANS: %s is a wonder */
567 _("Prevented if you have ever built %s, "
568 "unless it would be obsolete."),
569 improvement_name_translation
570 (preq
->source
.value
.building
));
572 cat_snprintf(buf
, bufsz
,
573 /* TRANS: %s is a wonder */
574 _("Prevented if you have ever built %s."),
575 improvement_name_translation
576 (preq
->source
.value
.building
));
580 /* Non-surviving requirement */
582 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
583 cat_snprintf(buf
, bufsz
,
584 /* TRANS: %s is a wonder */
585 _("Requires you to own %s, which must not "
587 improvement_name_translation
588 (preq
->source
.value
.building
));
590 cat_snprintf(buf
, bufsz
,
591 /* TRANS: %s is a wonder */
592 _("Requires you to own %s."),
593 improvement_name_translation
594 (preq
->source
.value
.building
));
597 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
598 cat_snprintf(buf
, bufsz
,
599 /* TRANS: %s is a wonder */
600 _("Prevented if you own %s, unless it is "
602 improvement_name_translation
603 (preq
->source
.value
.building
));
605 cat_snprintf(buf
, bufsz
,
606 /* TRANS: %s is a wonder */
607 _("Prevented if you own %s."),
608 improvement_name_translation
609 (preq
->source
.value
.building
));
615 /* non-wonder player-ranged requirements not supported */
617 case REQ_RANGE_CONTINENT
:
618 if (is_wonder(preq
->source
.value
.building
)) {
620 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
621 cat_snprintf(buf
, bufsz
,
622 /* TRANS: %s is a wonder */
623 _("Requires %s in one of your cities on the same "
624 "continent, and not yet obsolete."),
625 improvement_name_translation
626 (preq
->source
.value
.building
));
628 cat_snprintf(buf
, bufsz
,
629 /* TRANS: %s is a wonder */
630 _("Requires %s in one of your cities on the same "
632 improvement_name_translation
633 (preq
->source
.value
.building
));
636 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
637 cat_snprintf(buf
, bufsz
,
638 /* TRANS: %s is a wonder */
639 _("Prevented if %s is in one of your cities on the "
640 "same continent, unless it is obsolete."),
641 improvement_name_translation
642 (preq
->source
.value
.building
));
644 cat_snprintf(buf
, bufsz
,
645 /* TRANS: %s is a wonder */
646 _("Prevented if %s is in one of your cities on the "
648 improvement_name_translation
649 (preq
->source
.value
.building
));
654 /* surviving or non-wonder continent-ranged requirements not supported */
656 case REQ_RANGE_TRADEROUTE
:
658 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
659 /* Should only apply to wonders */
660 cat_snprintf(buf
, bufsz
,
661 /* TRANS: %s is a building or wonder */
662 _("Requires %s in the city or a trade partner "
663 "(and not yet obsolete)."),
664 improvement_name_translation
665 (preq
->source
.value
.building
));
667 cat_snprintf(buf
, bufsz
,
668 /* TRANS: %s is a building or wonder */
669 _("Requires %s in the city or a trade partner."),
670 improvement_name_translation
671 (preq
->source
.value
.building
));
674 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
675 /* Should only apply to wonders */
676 cat_snprintf(buf
, bufsz
,
677 /* TRANS: %s is a building or wonder */
678 _("Prevented by %s in the city or a trade partner "
679 "(unless it is obsolete)."),
680 improvement_name_translation
681 (preq
->source
.value
.building
));
683 cat_snprintf(buf
, bufsz
,
684 /* TRANS: %s is a building or wonder */
685 _("Prevented by %s in the city or a trade partner."),
686 improvement_name_translation
687 (preq
->source
.value
.building
));
693 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
694 /* Should only apply to wonders */
695 cat_snprintf(buf
, bufsz
,
696 /* TRANS: %s is a building or wonder */
697 _("Requires %s in the city (and not yet obsolete)."),
698 improvement_name_translation
699 (preq
->source
.value
.building
));
701 cat_snprintf(buf
, bufsz
,
702 /* TRANS: %s is a building or wonder */
703 _("Requires %s in the city."),
704 improvement_name_translation
705 (preq
->source
.value
.building
));
708 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
709 /* Should only apply to wonders */
710 cat_snprintf(buf
, bufsz
,
711 /* TRANS: %s is a building or wonder */
712 _("Prevented by %s in the city (unless it is "
714 improvement_name_translation
715 (preq
->source
.value
.building
));
717 cat_snprintf(buf
, bufsz
,
718 /* TRANS: %s is a building or wonder */
719 _("Prevented by %s in the city."),
720 improvement_name_translation
721 (preq
->source
.value
.building
));
725 case REQ_RANGE_LOCAL
:
727 cat_snprintf(buf
, bufsz
,
728 _("Only applies to \"%s\" buildings."),
729 improvement_name_translation
730 (preq
->source
.value
.building
));
732 cat_snprintf(buf
, bufsz
,
733 _("Does not apply to \"%s\" buildings."),
734 improvement_name_translation
735 (preq
->source
.value
.building
));
738 case REQ_RANGE_CADJACENT
:
739 case REQ_RANGE_ADJACENT
:
740 case REQ_RANGE_COUNT
:
747 switch (preq
->range
) {
748 case REQ_RANGE_LOCAL
:
750 cat_snprintf(buf
, bufsz
,
751 Q_("?extra:Requires %s on the tile."),
752 extra_name_translation(preq
->source
.value
.extra
));
754 cat_snprintf(buf
, bufsz
,
755 Q_("?extra:Prevented by %s on the tile."),
756 extra_name_translation(preq
->source
.value
.extra
));
759 case REQ_RANGE_CADJACENT
:
761 cat_snprintf(buf
, bufsz
,
762 Q_("?extra:Requires %s on the tile or a cardinally "
764 extra_name_translation(preq
->source
.value
.extra
));
766 cat_snprintf(buf
, bufsz
,
767 Q_("?extra:Prevented by %s on the tile or any cardinally "
769 extra_name_translation(preq
->source
.value
.extra
));
772 case REQ_RANGE_ADJACENT
:
774 cat_snprintf(buf
, bufsz
,
775 Q_("?extra:Requires %s on the tile or an adjacent "
777 extra_name_translation(preq
->source
.value
.extra
));
779 cat_snprintf(buf
, bufsz
,
780 Q_("?extra:Prevented by %s on the tile or any adjacent "
782 extra_name_translation(preq
->source
.value
.extra
));
787 cat_snprintf(buf
, bufsz
,
788 Q_("?extra:Requires %s on a tile within the city "
790 extra_name_translation(preq
->source
.value
.extra
));
792 cat_snprintf(buf
, bufsz
,
793 Q_("?extra:Prevented by %s on any tile within the city "
795 extra_name_translation(preq
->source
.value
.extra
));
798 case REQ_RANGE_TRADEROUTE
:
800 cat_snprintf(buf
, bufsz
,
801 Q_("?extra:Requires %s on a tile within the city "
802 "radius, or the city radius of a trade partner."),
803 extra_name_translation(preq
->source
.value
.extra
));
805 cat_snprintf(buf
, bufsz
,
806 Q_("?extra:Prevented by %s on any tile within the city "
807 "radius or the city radius of a trade partner."),
808 extra_name_translation(preq
->source
.value
.extra
));
811 case REQ_RANGE_CONTINENT
:
812 case REQ_RANGE_PLAYER
:
814 case REQ_RANGE_ALLIANCE
:
815 case REQ_RANGE_WORLD
:
816 case REQ_RANGE_COUNT
:
823 switch (preq
->range
) {
826 cat_snprintf(buf
, bufsz
, Q_("?good:Requires import of %s ."),
827 goods_name_translation(preq
->source
.value
.good
));
829 cat_snprintf(buf
, bufsz
, Q_("?goods:Prevented by import of %s."),
830 goods_name_translation(preq
->source
.value
.good
));
833 case REQ_RANGE_LOCAL
:
834 case REQ_RANGE_CADJACENT
:
835 case REQ_RANGE_ADJACENT
:
836 case REQ_RANGE_TRADEROUTE
:
837 case REQ_RANGE_CONTINENT
:
838 case REQ_RANGE_PLAYER
:
840 case REQ_RANGE_ALLIANCE
:
841 case REQ_RANGE_WORLD
:
842 case REQ_RANGE_COUNT
:
849 switch (preq
->range
) {
850 case REQ_RANGE_LOCAL
:
852 cat_snprintf(buf
, bufsz
, Q_("?terrain:Requires %s on the tile."),
853 terrain_name_translation(preq
->source
.value
.terrain
));
855 cat_snprintf(buf
, bufsz
, Q_("?terrain:Prevented by %s on the tile."),
856 terrain_name_translation(preq
->source
.value
.terrain
));
859 case REQ_RANGE_CADJACENT
:
861 cat_snprintf(buf
, bufsz
,
862 Q_("?terrain:Requires %s on the tile or a cardinally "
864 terrain_name_translation(preq
->source
.value
.terrain
));
866 cat_snprintf(buf
, bufsz
,
867 Q_("?terrain:Prevented by %s on the tile or any "
868 "cardinally adjacent tile."),
869 terrain_name_translation(preq
->source
.value
.terrain
));
872 case REQ_RANGE_ADJACENT
:
874 cat_snprintf(buf
, bufsz
,
875 Q_("?terrain:Requires %s on the tile or an adjacent "
877 terrain_name_translation(preq
->source
.value
.terrain
));
879 cat_snprintf(buf
, bufsz
,
880 Q_("?terrain:Prevented by %s on the tile or any "
882 terrain_name_translation(preq
->source
.value
.terrain
));
887 cat_snprintf(buf
, bufsz
,
888 Q_("?terrain:Requires %s on a tile within the city "
890 terrain_name_translation(preq
->source
.value
.terrain
));
892 cat_snprintf(buf
, bufsz
,
893 Q_("?terrain:Prevented by %s on any tile within the city "
895 terrain_name_translation(preq
->source
.value
.terrain
));
898 case REQ_RANGE_TRADEROUTE
:
900 cat_snprintf(buf
, bufsz
,
901 Q_("?terrain:Requires %s on a tile within the city "
902 "radius, or the city radius of a trade partner."),
903 terrain_name_translation(preq
->source
.value
.terrain
));
905 cat_snprintf(buf
, bufsz
,
906 Q_("?terrain:Prevented by %s on any tile within the city "
907 "radius or the city radius of a trade partner."),
908 terrain_name_translation(preq
->source
.value
.terrain
));
911 case REQ_RANGE_CONTINENT
:
912 case REQ_RANGE_PLAYER
:
914 case REQ_RANGE_ALLIANCE
:
915 case REQ_RANGE_WORLD
:
916 case REQ_RANGE_COUNT
:
923 switch (preq
->range
) {
924 case REQ_RANGE_PLAYER
:
926 cat_snprintf(buf
, bufsz
,
927 /* TRANS: "... playing as the Swedes." */
928 _("Requires that you are playing as the %s."),
929 nation_plural_translation(preq
->source
.value
.nation
));
931 cat_snprintf(buf
, bufsz
,
932 /* TRANS: "... playing as the Turks." */
933 _("Requires that you are not playing as the %s."),
934 nation_plural_translation(preq
->source
.value
.nation
));
939 cat_snprintf(buf
, bufsz
,
940 /* TRANS: "... same team as the Indonesians." */
941 _("Requires that you are on the same team as "
943 nation_plural_translation(preq
->source
.value
.nation
));
945 cat_snprintf(buf
, bufsz
,
946 /* TRANS: "... same team as the Greeks." */
947 _("Requires that you are not on the same team as "
949 nation_plural_translation(preq
->source
.value
.nation
));
952 case REQ_RANGE_ALLIANCE
:
954 cat_snprintf(buf
, bufsz
,
955 /* TRANS: "... allied with the Koreans." */
956 _("Requires that you are allied with the %s."),
957 nation_plural_translation(preq
->source
.value
.nation
));
959 cat_snprintf(buf
, bufsz
,
960 /* TRANS: "... allied with the Danes." */
961 _("Requires that you are not allied with the %s."),
962 nation_plural_translation(preq
->source
.value
.nation
));
965 case REQ_RANGE_WORLD
:
966 if (preq
->survives
) {
968 cat_snprintf(buf
, bufsz
,
969 /* TRANS: "Requires the Apaches to have ..." */
970 _("Requires the %s to have been in the game."),
971 nation_plural_translation(preq
->source
.value
.nation
));
973 cat_snprintf(buf
, bufsz
,
974 /* TRANS: "Requires the Celts never to have ..." */
975 _("Requires the %s never to have been in the "
977 nation_plural_translation(preq
->source
.value
.nation
));
981 cat_snprintf(buf
, bufsz
,
982 /* TRANS: "Requires the Belgians in the game." */
983 _("Requires the %s in the game."),
984 nation_plural_translation(preq
->source
.value
.nation
));
986 cat_snprintf(buf
, bufsz
,
987 /* TRANS: "Requires that the Russians are not ... */
988 _("Requires that the %s are not in the game."),
989 nation_plural_translation(preq
->source
.value
.nation
));
993 case REQ_RANGE_LOCAL
:
994 case REQ_RANGE_CADJACENT
:
995 case REQ_RANGE_ADJACENT
:
997 case REQ_RANGE_TRADEROUTE
:
998 case REQ_RANGE_CONTINENT
:
999 case REQ_RANGE_COUNT
:
1000 /* Not supported. */
1005 case VUT_NATIONGROUP
:
1006 switch (preq
->range
) {
1007 case REQ_RANGE_PLAYER
:
1008 if (preq
->present
) {
1009 cat_snprintf(buf
, bufsz
,
1010 /* TRANS: nation group: "... playing African nation." */
1011 _("Requires that you are playing %s nation."),
1012 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1014 cat_snprintf(buf
, bufsz
,
1015 /* TRANS: nation group: "... playing Imaginary nation." */
1016 _("Prevented if you are playing %s nation."),
1017 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1020 case REQ_RANGE_TEAM
:
1021 if (preq
->present
) {
1022 cat_snprintf(buf
, bufsz
,
1023 /* TRANS: nation group: "Requires Medieval nation ..." */
1024 _("Requires %s nation on your team."),
1025 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1027 cat_snprintf(buf
, bufsz
,
1028 /* TRANS: nation group: "Prevented by Medieval nation ..." */
1029 _("Prevented by %s nation on your team."),
1030 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1033 case REQ_RANGE_ALLIANCE
:
1034 if (preq
->present
) {
1035 cat_snprintf(buf
, bufsz
,
1036 /* TRANS: nation group: "Requires Modern nation ..." */
1037 _("Requires %s nation in alliance with you."),
1038 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1040 cat_snprintf(buf
, bufsz
,
1041 /* TRANS: nation group: "Prevented by Modern nation ..." */
1042 _("Prevented if %s nation is in alliance with you."),
1043 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1046 case REQ_RANGE_WORLD
:
1047 if (preq
->present
) {
1048 cat_snprintf(buf
, bufsz
,
1049 /* TRANS: nation group: "Requires Asian nation ..." */
1050 _("Requires %s nation in the game."),
1051 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1053 cat_snprintf(buf
, bufsz
,
1054 /* TRANS: nation group: "Prevented by Asian nation ..." */
1055 _("Prevented by %s nation in the game."),
1056 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1059 case REQ_RANGE_LOCAL
:
1060 case REQ_RANGE_CADJACENT
:
1061 case REQ_RANGE_ADJACENT
:
1062 case REQ_RANGE_CITY
:
1063 case REQ_RANGE_TRADEROUTE
:
1064 case REQ_RANGE_CONTINENT
:
1065 case REQ_RANGE_COUNT
:
1066 /* Not supported. */
1072 if (preq
->range
!= REQ_RANGE_PLAYER
) {
1075 if (preq
->present
) {
1076 cat_snprintf(buf
, bufsz
,
1077 /* TRANS: "Requires that you are playing Asian style
1079 _("Requires that you are playing %s style nation."),
1080 style_name_translation(preq
->source
.value
.style
));
1082 cat_snprintf(buf
, bufsz
,
1083 /* TRANS: "Requires that you are not playing Classical
1085 _("Requires that you are not playing %s style nation."),
1086 style_name_translation(preq
->source
.value
.style
));
1090 case VUT_NATIONALITY
:
1091 switch (preq
->range
) {
1092 case REQ_RANGE_TRADEROUTE
:
1093 if (preq
->present
) {
1094 cat_snprintf(buf
, bufsz
,
1095 /* TRANS: "Requires at least one Barbarian citizen ..." */
1096 _("Requires at least one %s citizen in the city or a "
1098 nation_adjective_translation(preq
->source
.value
.nationality
));
1100 cat_snprintf(buf
, bufsz
,
1101 /* TRANS: "... no Pirate citizens ..." */
1102 _("Requires that there are no %s citizens in "
1103 "the city or any trade partners."),
1104 nation_adjective_translation(preq
->source
.value
.nationality
));
1107 case REQ_RANGE_CITY
:
1108 if (preq
->present
) {
1109 cat_snprintf(buf
, bufsz
,
1110 /* TRANS: "Requires at least one Barbarian citizen ..." */
1111 _("Requires at least one %s citizen in the city."),
1112 nation_adjective_translation(preq
->source
.value
.nationality
));
1114 cat_snprintf(buf
, bufsz
,
1115 /* TRANS: "... no Pirate citizens ..." */
1116 _("Requires that there are no %s citizens in "
1118 nation_adjective_translation(preq
->source
.value
.nationality
));
1121 case REQ_RANGE_WORLD
:
1122 case REQ_RANGE_ALLIANCE
:
1123 case REQ_RANGE_TEAM
:
1124 case REQ_RANGE_PLAYER
:
1125 case REQ_RANGE_LOCAL
:
1126 case REQ_RANGE_CADJACENT
:
1127 case REQ_RANGE_ADJACENT
:
1128 case REQ_RANGE_CONTINENT
:
1129 case REQ_RANGE_COUNT
:
1130 /* Not supported. */
1136 switch (preq
->range
) {
1137 case REQ_RANGE_PLAYER
:
1138 if (preq
->present
) {
1139 cat_snprintf(buf
, bufsz
,
1140 /* TRANS: in this and following strings, '%s' can be one
1141 * of a wide range of relationships; e.g., 'Peace',
1142 * 'Never met', 'Is foreign', 'Hosts embassy',
1143 * 'Provided Casus Belli' */
1144 _("Requires that you have the relationship '%s' with at "
1145 "least one other living player."),
1146 diplrel_name_translation(preq
->source
.value
.diplrel
));
1148 cat_snprintf(buf
, bufsz
,
1149 _("Requires that you do not have the relationship '%s' "
1150 "with any living player."),
1151 diplrel_name_translation(preq
->source
.value
.diplrel
));
1154 case REQ_RANGE_TEAM
:
1155 if (preq
->present
) {
1156 cat_snprintf(buf
, bufsz
,
1157 _("Requires that somebody on your team has the "
1158 "relationship '%s' with at least one other living "
1160 diplrel_name_translation(preq
->source
.value
.diplrel
));
1162 cat_snprintf(buf
, bufsz
,
1163 _("Requires that nobody on your team has the "
1164 "relationship '%s' with any living player."),
1165 diplrel_name_translation(preq
->source
.value
.diplrel
));
1168 case REQ_RANGE_ALLIANCE
:
1169 if (preq
->present
) {
1170 cat_snprintf(buf
, bufsz
,
1171 _("Requires that somebody in your alliance has the "
1172 "relationship '%s' with at least one other living "
1174 diplrel_name_translation(preq
->source
.value
.diplrel
));
1176 cat_snprintf(buf
, bufsz
,
1177 _("Requires that nobody in your alliance has the "
1178 "relationship '%s' with any living player."),
1179 diplrel_name_translation(preq
->source
.value
.diplrel
));
1182 case REQ_RANGE_WORLD
:
1183 if (preq
->present
) {
1184 cat_snprintf(buf
, bufsz
,
1185 _("Requires the relationship '%s' between two living "
1187 diplrel_name_translation(preq
->source
.value
.diplrel
));
1189 cat_snprintf(buf
, bufsz
,
1190 _("Requires that no two living players have the "
1191 "relationship '%s'."),
1192 diplrel_name_translation(preq
->source
.value
.diplrel
));
1195 case REQ_RANGE_LOCAL
:
1196 if (preq
->present
) {
1197 cat_snprintf(buf
, bufsz
,
1198 _("Requires that you have the relationship '%s' with the "
1200 diplrel_name_translation(preq
->source
.value
.diplrel
));
1202 cat_snprintf(buf
, bufsz
,
1203 _("Requires that you do not have the relationship '%s' "
1204 "with the other player."),
1205 diplrel_name_translation(preq
->source
.value
.diplrel
));
1208 case REQ_RANGE_CADJACENT
:
1209 case REQ_RANGE_ADJACENT
:
1210 case REQ_RANGE_CITY
:
1211 case REQ_RANGE_TRADEROUTE
:
1212 case REQ_RANGE_CONTINENT
:
1213 case REQ_RANGE_COUNT
:
1214 /* Not supported. */
1220 switch (preq
->range
) {
1221 case REQ_RANGE_LOCAL
:
1222 if (preq
->present
) {
1223 /* TRANS: %s is a single kind of unit (e.g., "Settlers"). */
1224 cat_snprintf(buf
, bufsz
, Q_("?unit:Requires %s."),
1225 utype_name_translation(preq
->source
.value
.utype
));
1227 /* TRANS: %s is a single kind of unit (e.g., "Settlers"). */
1228 cat_snprintf(buf
, bufsz
, Q_("?unit:Does not apply to %s."),
1229 utype_name_translation(preq
->source
.value
.utype
));
1232 case REQ_RANGE_CADJACENT
:
1233 case REQ_RANGE_ADJACENT
:
1234 case REQ_RANGE_CITY
:
1235 case REQ_RANGE_TRADEROUTE
:
1236 case REQ_RANGE_CONTINENT
:
1237 case REQ_RANGE_PLAYER
:
1238 case REQ_RANGE_TEAM
:
1239 case REQ_RANGE_ALLIANCE
:
1240 case REQ_RANGE_WORLD
:
1241 case REQ_RANGE_COUNT
:
1242 /* Not supported. */
1248 switch (preq
->range
) {
1249 case REQ_RANGE_LOCAL
:
1251 struct astring astr
= ASTRING_INIT
;
1253 /* Unit type flags mean nothing to users. Explicitly list the unit
1254 * types with those flags. */
1255 if (role_units_translations(&astr
, preq
->source
.value
.unitflag
,
1257 if (preq
->present
) {
1258 /* TRANS: %s is a list of unit types separated by "or". */
1259 cat_snprintf(buf
, bufsz
, Q_("?ulist:Requires %s."),
1262 /* TRANS: %s is a list of unit types separated by "or". */
1263 cat_snprintf(buf
, bufsz
, Q_("?ulist:Does not apply to %s."),
1271 case REQ_RANGE_CADJACENT
:
1272 case REQ_RANGE_ADJACENT
:
1273 case REQ_RANGE_CITY
:
1274 case REQ_RANGE_TRADEROUTE
:
1275 case REQ_RANGE_CONTINENT
:
1276 case REQ_RANGE_PLAYER
:
1277 case REQ_RANGE_TEAM
:
1278 case REQ_RANGE_ALLIANCE
:
1279 case REQ_RANGE_WORLD
:
1280 case REQ_RANGE_COUNT
:
1281 /* Not supported. */
1287 switch (preq
->range
) {
1288 case REQ_RANGE_LOCAL
:
1289 if (preq
->present
) {
1290 /* TRANS: %s is a single unit class (e.g., "Air"). */
1291 cat_snprintf(buf
, bufsz
, Q_("?uclass:Requires %s units."),
1292 uclass_name_translation(preq
->source
.value
.uclass
));
1294 /* TRANS: %s is a single unit class (e.g., "Air"). */
1295 cat_snprintf(buf
, bufsz
, Q_("?uclass:Does not apply to %s units."),
1296 uclass_name_translation(preq
->source
.value
.uclass
));
1299 case REQ_RANGE_CADJACENT
:
1300 case REQ_RANGE_ADJACENT
:
1301 case REQ_RANGE_CITY
:
1302 case REQ_RANGE_TRADEROUTE
:
1303 case REQ_RANGE_CONTINENT
:
1304 case REQ_RANGE_PLAYER
:
1305 case REQ_RANGE_TEAM
:
1306 case REQ_RANGE_ALLIANCE
:
1307 case REQ_RANGE_WORLD
:
1308 case REQ_RANGE_COUNT
:
1309 /* Not supported. */
1316 const char *classes
[uclass_count()];
1319 struct astring list
= ASTRING_INIT
;
1321 unit_class_iterate(uclass
) {
1322 if (uclass_has_flag(uclass
, preq
->source
.value
.unitclassflag
)) {
1323 classes
[i
++] = uclass_name_translation(uclass
);
1325 } unit_class_iterate_end
;
1326 astr_build_or_list(&list
, classes
, i
);
1328 switch (preq
->range
) {
1329 case REQ_RANGE_LOCAL
:
1330 if (preq
->present
) {
1331 /* TRANS: %s is a list of unit classes separated by "or". */
1332 cat_snprintf(buf
, bufsz
, Q_("?uclasslist:Requires %s units."),
1335 /* TRANS: %s is a list of unit classes separated by "or". */
1336 cat_snprintf(buf
, bufsz
, Q_("?uclasslist:Does not apply to "
1342 case REQ_RANGE_CADJACENT
:
1343 case REQ_RANGE_ADJACENT
:
1344 case REQ_RANGE_CITY
:
1345 case REQ_RANGE_TRADEROUTE
:
1346 case REQ_RANGE_CONTINENT
:
1347 case REQ_RANGE_PLAYER
:
1348 case REQ_RANGE_TEAM
:
1349 case REQ_RANGE_ALLIANCE
:
1350 case REQ_RANGE_WORLD
:
1351 case REQ_RANGE_COUNT
:
1352 /* Not supported. */
1364 switch (preq
->range
) {
1365 case REQ_RANGE_LOCAL
:
1366 switch (preq
->source
.value
.unit_state
) {
1367 case USP_TRANSPORTED
:
1368 if (preq
->present
) {
1369 cat_snprintf(buf
, bufsz
,
1370 _("Requires that the unit is transported."));
1372 cat_snprintf(buf
, bufsz
,
1373 _("Requires that the unit isn't transported."));
1376 case USP_LIVABLE_TILE
:
1377 if (preq
->present
) {
1378 cat_snprintf(buf
, bufsz
,
1379 _("Requires that the unit is on livable tile."));
1381 cat_snprintf(buf
, bufsz
,
1382 _("Requires that the unit isn't on livable tile."));
1385 case USP_DOMESTIC_TILE
:
1386 if (preq
->present
) {
1387 cat_snprintf(buf
, bufsz
,
1388 _("Requires that the unit is on a domestic "
1391 cat_snprintf(buf
, bufsz
,
1392 _("Requires that the unit isn't on a domestic "
1396 case USP_TRANSPORTING
:
1397 if (preq
->present
) {
1398 cat_snprintf(buf
, bufsz
,
1399 _("Requires that the unit does transport one or "
1400 "more cargo units."));
1402 cat_snprintf(buf
, bufsz
,
1403 _("Requires that the unit doesn't transport "
1404 "any cargo units."));
1407 case USP_HAS_HOME_CITY
:
1408 if (preq
->present
) {
1409 cat_snprintf(buf
, bufsz
,
1410 _("Requires that the unit has a home city."));
1412 cat_snprintf(buf
, bufsz
,
1413 _("Requires that the unit is homeless."));
1416 case USP_NATIVE_TILE
:
1417 if (preq
->present
) {
1418 cat_snprintf(buf
, bufsz
,
1419 _("Requires that the unit is on native tile."));
1421 cat_snprintf(buf
, bufsz
,
1422 _("Requires that the unit isn't on native tile."));
1426 fc_assert_msg(preq
->source
.value
.unit_state
!= USP_COUNT
,
1427 "Invalid unit state property.");
1430 case REQ_RANGE_CADJACENT
:
1431 case REQ_RANGE_ADJACENT
:
1432 case REQ_RANGE_CITY
:
1433 case REQ_RANGE_TRADEROUTE
:
1434 case REQ_RANGE_CONTINENT
:
1435 case REQ_RANGE_PLAYER
:
1436 case REQ_RANGE_TEAM
:
1437 case REQ_RANGE_ALLIANCE
:
1438 case REQ_RANGE_WORLD
:
1439 case REQ_RANGE_COUNT
:
1440 /* Not supported. */
1448 switch (preq
->range
) {
1449 case REQ_RANGE_LOCAL
:
1450 if (preq
->present
) {
1451 cat_snprintf(buf
, bufsz
,
1452 /* %s is numeric move points; it may have a
1453 * fractional part ("1 1/3 MP"). */
1454 _("Requires that the unit has at least %s MP left."),
1455 move_points_text(preq
->source
.value
.minmoves
, TRUE
));
1457 cat_snprintf(buf
, bufsz
,
1458 /* %s is numeric move points; it may have a
1459 * fractional part ("1 1/3 MP"). */
1460 _("Requires that the unit has less than %s MP left."),
1461 move_points_text(preq
->source
.value
.minmoves
, TRUE
));
1464 case REQ_RANGE_CADJACENT
:
1465 case REQ_RANGE_ADJACENT
:
1466 case REQ_RANGE_CITY
:
1467 case REQ_RANGE_TRADEROUTE
:
1468 case REQ_RANGE_CONTINENT
:
1469 case REQ_RANGE_PLAYER
:
1470 case REQ_RANGE_TEAM
:
1471 case REQ_RANGE_ALLIANCE
:
1472 case REQ_RANGE_WORLD
:
1473 case REQ_RANGE_COUNT
:
1474 /* Not supported. */
1480 case VUT_MINVETERAN
:
1481 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1484 /* FIXME: this would be better with veteran level names, but that's
1485 * potentially unit type dependent. */
1486 if (preq
->present
) {
1487 cat_snprintf(buf
, bufsz
,
1488 PL_("Requires a unit with at least %d veteran level.",
1489 "Requires a unit with at least %d veteran levels.",
1490 preq
->source
.value
.minveteran
),
1491 preq
->source
.value
.minveteran
);
1493 cat_snprintf(buf
, bufsz
,
1494 PL_("Requires a unit with fewer than %d veteran level.",
1495 "Requires a unit with fewer than %d veteran levels.",
1496 preq
->source
.value
.minveteran
),
1497 preq
->source
.value
.minveteran
);
1502 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1506 if (preq
->present
) {
1507 cat_snprintf(buf
, bufsz
,
1508 PL_("Requires a unit with at least %d hit point left.",
1509 "Requires a unit with at least %d hit points left.",
1510 preq
->source
.value
.min_hit_points
),
1511 preq
->source
.value
.min_hit_points
);
1513 cat_snprintf(buf
, bufsz
,
1514 PL_("Requires a unit with fewer than %d hit point "
1516 "Requires a unit with fewer than %d hit points "
1518 preq
->source
.value
.min_hit_points
),
1519 preq
->source
.value
.min_hit_points
);
1524 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1527 if (preq
->present
) {
1528 /* TRANS: "Applies only to Food." */
1529 cat_snprintf(buf
, bufsz
, Q_("?output:Applies only to %s."),
1530 get_output_name(preq
->source
.value
.outputtype
));
1532 /* TRANS: "Does not apply to Food." */
1533 cat_snprintf(buf
, bufsz
, Q_("?output:Does not apply to %s."),
1534 get_output_name(preq
->source
.value
.outputtype
));
1538 case VUT_SPECIALIST
:
1539 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1542 if (preq
->present
) {
1543 /* TRANS: "Applies only to Scientists." */
1544 cat_snprintf(buf
, bufsz
, Q_("?specialist:Applies only to %s."),
1545 specialist_plural_translation(preq
->source
.value
.specialist
));
1547 /* TRANS: "Does not apply to Scientists." */
1548 cat_snprintf(buf
, bufsz
, Q_("?specialist:Does not apply to %s."),
1549 specialist_plural_translation(preq
->source
.value
.specialist
));
1554 switch (preq
->range
) {
1555 case REQ_RANGE_TRADEROUTE
:
1556 if (preq
->present
) {
1557 cat_snprintf(buf
, bufsz
,
1558 PL_("Requires a minimum city size of %d for this "
1559 "city or a trade partner.",
1560 "Requires a minimum city size of %d for this "
1561 "city or a trade partner.",
1562 preq
->source
.value
.minsize
),
1563 preq
->source
.value
.minsize
);
1565 cat_snprintf(buf
, bufsz
,
1566 PL_("Requires the city size to be less than %d "
1567 "for this city and all trade partners.",
1568 "Requires the city size to be less than %d "
1569 "for this city and all trade partners.",
1570 preq
->source
.value
.minsize
),
1571 preq
->source
.value
.minsize
);
1574 case REQ_RANGE_CITY
:
1575 if (preq
->present
) {
1576 cat_snprintf(buf
, bufsz
,
1577 PL_("Requires a minimum city size of %d.",
1578 "Requires a minimum city size of %d.",
1579 preq
->source
.value
.minsize
),
1580 preq
->source
.value
.minsize
);
1582 cat_snprintf(buf
, bufsz
,
1583 PL_("Requires the city size to be less than %d.",
1584 "Requires the city size to be less than %d.",
1585 preq
->source
.value
.minsize
),
1586 preq
->source
.value
.minsize
);
1589 case REQ_RANGE_LOCAL
:
1590 case REQ_RANGE_CADJACENT
:
1591 case REQ_RANGE_ADJACENT
:
1592 case REQ_RANGE_CONTINENT
:
1593 case REQ_RANGE_PLAYER
:
1594 case REQ_RANGE_TEAM
:
1595 case REQ_RANGE_ALLIANCE
:
1596 case REQ_RANGE_WORLD
:
1597 case REQ_RANGE_COUNT
:
1598 /* Not supported. */
1602 case VUT_MINCULTURE
:
1603 switch (preq
->range
) {
1604 case REQ_RANGE_CITY
:
1605 if (preq
->present
) {
1606 cat_snprintf(buf
, bufsz
,
1607 PL_("Requires a minimum culture of %d in the city.",
1608 "Requires a minimum culture of %d in the city.",
1609 preq
->source
.value
.minculture
),
1610 preq
->source
.value
.minculture
);
1612 cat_snprintf(buf
, bufsz
,
1613 PL_("Requires the culture in the city to be less "
1615 "Requires the culture in the city to be less "
1617 preq
->source
.value
.minculture
),
1618 preq
->source
.value
.minculture
);
1621 case REQ_RANGE_TRADEROUTE
:
1622 if (preq
->present
) {
1623 cat_snprintf(buf
, bufsz
,
1624 PL_("Requires a minimum culture of %d in this city or "
1626 "Requires a minimum culture of %d in this city or "
1628 preq
->source
.value
.minculture
),
1629 preq
->source
.value
.minculture
);
1631 cat_snprintf(buf
, bufsz
,
1632 PL_("Requires the culture in this city and all trade "
1633 "partners to be less than %d.",
1634 "Requires the culture in this city and all trade "
1635 "partners to be less than %d.",
1636 preq
->source
.value
.minculture
),
1637 preq
->source
.value
.minculture
);
1640 case REQ_RANGE_PLAYER
:
1641 if (preq
->present
) {
1642 cat_snprintf(buf
, bufsz
,
1643 PL_("Requires your nation to have culture "
1645 "Requires your nation to have culture "
1647 preq
->source
.value
.minculture
),
1648 preq
->source
.value
.minculture
);
1650 cat_snprintf(buf
, bufsz
,
1651 PL_("Prevented if your nation has culture of "
1653 "Prevented if your nation has culture of "
1655 preq
->source
.value
.minculture
),
1656 preq
->source
.value
.minculture
);
1659 case REQ_RANGE_TEAM
:
1660 if (preq
->present
) {
1661 cat_snprintf(buf
, bufsz
,
1662 PL_("Requires someone on your team to have culture of "
1664 "Requires someone on your team to have culture of "
1666 preq
->source
.value
.minculture
),
1667 preq
->source
.value
.minculture
);
1669 cat_snprintf(buf
, bufsz
,
1670 PL_("Prevented if anyone on your team has culture of "
1672 "Prevented if anyone on your team has culture of "
1674 preq
->source
.value
.minculture
),
1675 preq
->source
.value
.minculture
);
1678 case REQ_RANGE_ALLIANCE
:
1679 if (preq
->present
) {
1680 cat_snprintf(buf
, bufsz
,
1681 PL_("Requires someone in your current alliance to "
1682 "have culture of at least %d.",
1683 "Requires someone in your current alliance to "
1684 "have culture of at least %d.",
1685 preq
->source
.value
.minculture
),
1686 preq
->source
.value
.minculture
);
1688 cat_snprintf(buf
, bufsz
,
1689 PL_("Prevented if anyone in your current alliance has "
1690 "culture of %d or more.",
1691 "Prevented if anyone in your current alliance has "
1692 "culture of %d or more.",
1693 preq
->source
.value
.minculture
),
1694 preq
->source
.value
.minculture
);
1697 case REQ_RANGE_WORLD
:
1698 if (preq
->present
) {
1699 cat_snprintf(buf
, bufsz
,
1700 PL_("Requires that some player has culture of at "
1702 "Requires that some player has culture of at "
1704 preq
->source
.value
.minculture
),
1705 preq
->source
.value
.minculture
);
1707 cat_snprintf(buf
, bufsz
,
1708 PL_("Requires that no player has culture of %d "
1710 "Requires that no player has culture of %d "
1712 preq
->source
.value
.minculture
),
1713 preq
->source
.value
.minculture
);
1716 case REQ_RANGE_LOCAL
:
1717 case REQ_RANGE_CADJACENT
:
1718 case REQ_RANGE_ADJACENT
:
1719 case REQ_RANGE_CONTINENT
:
1720 case REQ_RANGE_COUNT
:
1725 case VUT_MAXTILEUNITS
:
1726 switch (preq
->range
) {
1727 case REQ_RANGE_LOCAL
:
1728 if (preq
->present
) {
1729 cat_snprintf(buf
, bufsz
,
1730 PL_("At most %d unit may be present on the tile.",
1731 "At most %d units may be present on the tile.",
1732 preq
->source
.value
.max_tile_units
),
1733 preq
->source
.value
.max_tile_units
);
1735 cat_snprintf(buf
, bufsz
,
1736 PL_("There must be more than %d unit present on "
1738 "There must be more than %d units present on "
1740 preq
->source
.value
.max_tile_units
),
1741 preq
->source
.value
.max_tile_units
);
1744 case REQ_RANGE_CADJACENT
:
1745 if (preq
->present
) {
1746 cat_snprintf(buf
, bufsz
,
1747 PL_("The tile or at least one cardinally adjacent tile "
1748 "must have %d unit or fewer.",
1749 "The tile or at least one cardinally adjacent tile "
1750 "must have %d units or fewer.",
1751 preq
->source
.value
.max_tile_units
),
1752 preq
->source
.value
.max_tile_units
);
1754 cat_snprintf(buf
, bufsz
,
1755 PL_("The tile and all cardinally adjacent tiles must "
1756 "have more than %d unit each.",
1757 "The tile and all cardinally adjacent tiles must "
1758 "have more than %d units each.",
1759 preq
->source
.value
.max_tile_units
),
1760 preq
->source
.value
.max_tile_units
);
1763 case REQ_RANGE_ADJACENT
:
1764 if (preq
->present
) {
1765 cat_snprintf(buf
, bufsz
,
1766 PL_("The tile or at least one adjacent tile must have "
1767 "%d unit or fewer.",
1768 "The tile or at least one adjacent tile must have "
1769 "%d units or fewer.",
1770 preq
->source
.value
.max_tile_units
),
1771 preq
->source
.value
.max_tile_units
);
1773 cat_snprintf(buf
, bufsz
,
1774 PL_("The tile and all adjacent tiles must have more "
1775 "than %d unit each.",
1776 "The tile and all adjacent tiles must have more "
1777 "than %d units each.",
1778 preq
->source
.value
.max_tile_units
),
1779 preq
->source
.value
.max_tile_units
);
1782 case REQ_RANGE_CITY
:
1783 case REQ_RANGE_TRADEROUTE
:
1784 case REQ_RANGE_CONTINENT
:
1785 case REQ_RANGE_PLAYER
:
1786 case REQ_RANGE_TEAM
:
1787 case REQ_RANGE_ALLIANCE
:
1788 case REQ_RANGE_WORLD
:
1789 case REQ_RANGE_COUNT
:
1790 /* Not supported. */
1795 if (preq
->range
!= REQ_RANGE_PLAYER
) {
1798 if (preq
->present
) {
1799 cat_snprintf(buf
, bufsz
,
1800 /* TRANS: AI level (e.g., "Handicapped") */
1801 _("Applies to %s AI players."),
1802 ai_level_translated_name(preq
->source
.value
.ai_level
));
1804 cat_snprintf(buf
, bufsz
,
1805 /* TRANS: AI level (e.g., "Cheating") */
1806 _("Does not apply to %s AI players."),
1807 ai_level_translated_name(preq
->source
.value
.ai_level
));
1811 case VUT_TERRAINCLASS
:
1812 switch (preq
->range
) {
1813 case REQ_RANGE_LOCAL
:
1814 if (preq
->present
) {
1815 cat_snprintf(buf
, bufsz
,
1816 /* TRANS: %s is a terrain class */
1817 Q_("?terrainclass:Requires %s terrain on the tile."),
1818 terrain_class_name_translation
1819 (preq
->source
.value
.terrainclass
));
1821 cat_snprintf(buf
, bufsz
,
1822 /* TRANS: %s is a terrain class */
1823 Q_("?terrainclass:Prevented by %s terrain on the tile."),
1824 terrain_class_name_translation
1825 (preq
->source
.value
.terrainclass
));
1828 case REQ_RANGE_CADJACENT
:
1829 if (preq
->present
) {
1830 cat_snprintf(buf
, bufsz
,
1831 /* TRANS: %s is a terrain class */
1832 Q_("?terrainclass:Requires %s terrain on the tile or a "
1833 "cardinally adjacent tile."),
1834 terrain_class_name_translation
1835 (preq
->source
.value
.terrainclass
));
1837 cat_snprintf(buf
, bufsz
,
1838 /* TRANS: %s is a terrain class */
1839 Q_("?terrainclass:Prevented by %s terrain on the tile or "
1840 "any cardinally adjacent tile."),
1841 terrain_class_name_translation
1842 (preq
->source
.value
.terrainclass
));
1845 case REQ_RANGE_ADJACENT
:
1846 if (preq
->present
) {
1847 cat_snprintf(buf
, bufsz
,
1848 /* TRANS: %s is a terrain class */
1849 Q_("?terrainclass:Requires %s terrain on the tile or an "
1851 terrain_class_name_translation
1852 (preq
->source
.value
.terrainclass
));
1854 cat_snprintf(buf
, bufsz
,
1855 /* TRANS: %s is a terrain class */
1856 Q_("?terrainclass:Prevented by %s terrain on the tile or "
1857 "any adjacent tile."),
1858 terrain_class_name_translation
1859 (preq
->source
.value
.terrainclass
));
1862 case REQ_RANGE_CITY
:
1863 if (preq
->present
) {
1864 cat_snprintf(buf
, bufsz
,
1865 /* TRANS: %s is a terrain class */
1866 Q_("?terrainclass:Requires %s terrain on a tile within "
1867 "the city radius."),
1868 terrain_class_name_translation
1869 (preq
->source
.value
.terrainclass
));
1871 cat_snprintf(buf
, bufsz
,
1872 /* TRANS: %s is a terrain class */
1873 Q_("?terrainclass:Prevented by %s terrain on any tile "
1874 "within the city radius."),
1875 terrain_class_name_translation
1876 (preq
->source
.value
.terrainclass
));
1879 case REQ_RANGE_TRADEROUTE
:
1880 if (preq
->present
) {
1881 cat_snprintf(buf
, bufsz
,
1882 /* TRANS: %s is a terrain class */
1883 Q_("?terrainclass:Requires %s terrain on a tile within "
1884 "the city radius or the city radius of a trade "
1886 terrain_class_name_translation
1887 (preq
->source
.value
.terrainclass
));
1889 cat_snprintf(buf
, bufsz
,
1890 /* TRANS: %s is a terrain class */
1891 Q_("?terrainclass:Prevented by %s terrain on any tile "
1892 "within the city radius or the city radius of a trade "
1894 terrain_class_name_translation
1895 (preq
->source
.value
.terrainclass
));
1898 case REQ_RANGE_CONTINENT
:
1899 case REQ_RANGE_PLAYER
:
1900 case REQ_RANGE_TEAM
:
1901 case REQ_RANGE_ALLIANCE
:
1902 case REQ_RANGE_WORLD
:
1903 case REQ_RANGE_COUNT
:
1904 /* Not supported. */
1910 switch (preq
->range
) {
1911 case REQ_RANGE_LOCAL
:
1912 if (preq
->present
) {
1913 cat_snprintf(buf
, bufsz
,
1914 /* TRANS: %s is a (translatable) terrain flag. */
1915 _("Requires terrain with the \"%s\" flag on the tile."),
1916 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1918 cat_snprintf(buf
, bufsz
,
1919 /* TRANS: %s is a (translatable) terrain flag. */
1920 _("Prevented by terrain with the \"%s\" flag on the "
1922 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1925 case REQ_RANGE_CADJACENT
:
1926 if (preq
->present
) {
1927 cat_snprintf(buf
, bufsz
,
1928 /* TRANS: %s is a (translatable) terrain flag. */
1929 _("Requires terrain with the \"%s\" flag on the "
1930 "tile or a cardinally adjacent tile."),
1931 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1933 cat_snprintf(buf
, bufsz
,
1934 /* TRANS: %s is a (translatable) terrain flag. */
1935 _("Prevented by terrain with the \"%s\" flag on "
1936 "the tile or any cardinally adjacent tile."),
1937 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1940 case REQ_RANGE_ADJACENT
:
1941 if (preq
->present
) {
1942 cat_snprintf(buf
, bufsz
,
1943 /* TRANS: %s is a (translatable) terrain flag. */
1944 _("Requires terrain with the \"%s\" flag on the "
1945 "tile or an adjacent tile."),
1946 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1948 cat_snprintf(buf
, bufsz
,
1949 /* TRANS: %s is a (translatable) terrain flag. */
1950 _("Prevented by terrain with the \"%s\" flag on "
1951 "the tile or any adjacent tile."),
1952 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1955 case REQ_RANGE_CITY
:
1956 if (preq
->present
) {
1957 cat_snprintf(buf
, bufsz
,
1958 /* TRANS: %s is a (translatable) terrain flag. */
1959 _("Requires terrain with the \"%s\" flag on a tile "
1960 "within the city radius."),
1961 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1963 cat_snprintf(buf
, bufsz
,
1964 /* TRANS: %s is a (translatable) terrain flag. */
1965 _("Prevented by terrain with the \"%s\" flag on any tile "
1966 "within the city radius."),
1967 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1970 case REQ_RANGE_TRADEROUTE
:
1971 if (preq
->present
) {
1972 cat_snprintf(buf
, bufsz
,
1973 /* TRANS: %s is a (translatable) terrain flag. */
1974 _("Requires terrain with the \"%s\" flag on a tile "
1975 "within the city radius or the city radius of "
1976 "a trade partner."),
1977 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1979 cat_snprintf(buf
, bufsz
,
1980 /* TRANS: %s is a (translatable) terrain flag. */
1981 _("Prevented by terrain with the \"%s\" flag on any tile "
1982 "within the city radius or the city radius of "
1983 "a trade partner."),
1984 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1987 case REQ_RANGE_CONTINENT
:
1988 case REQ_RANGE_PLAYER
:
1989 case REQ_RANGE_TEAM
:
1990 case REQ_RANGE_ALLIANCE
:
1991 case REQ_RANGE_WORLD
:
1992 case REQ_RANGE_COUNT
:
1993 /* Not supported. */
1999 switch (preq
->range
) {
2000 case REQ_RANGE_LOCAL
:
2001 if (preq
->present
) {
2002 cat_snprintf(buf
, bufsz
,
2003 /* TRANS: %s is a (translatable) base flag. */
2004 _("Requires a base with the \"%s\" flag on the tile."),
2005 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2007 cat_snprintf(buf
, bufsz
,
2008 /* TRANS: %s is a (translatable) base flag. */
2009 _("Prevented by a base with the \"%s\" flag on the "
2011 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2014 case REQ_RANGE_CADJACENT
:
2015 if (preq
->present
) {
2016 cat_snprintf(buf
, bufsz
,
2017 /* TRANS: %s is a (translatable) base flag. */
2018 _("Requires a base with the \"%s\" flag on the "
2019 "tile or a cardinally adjacent tile."),
2020 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2022 cat_snprintf(buf
, bufsz
,
2023 /* TRANS: %s is a (translatable) base flag. */
2024 _("Prevented by a base with the \"%s\" flag on "
2025 "the tile or any cardinally adjacent tile."),
2026 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2029 case REQ_RANGE_ADJACENT
:
2030 if (preq
->present
) {
2031 cat_snprintf(buf
, bufsz
,
2032 /* TRANS: %s is a (translatable) base flag. */
2033 _("Requires a base with the \"%s\" flag on the "
2034 "tile or an adjacent tile."),
2035 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2037 cat_snprintf(buf
, bufsz
,
2038 /* TRANS: %s is a (translatable) base flag. */
2039 _("Prevented by a base with the \"%s\" flag on "
2040 "the tile or any adjacent tile."),
2041 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2044 case REQ_RANGE_CITY
:
2045 if (preq
->present
) {
2046 cat_snprintf(buf
, bufsz
,
2047 /* TRANS: %s is a (translatable) base flag. */
2048 _("Requires a base with the \"%s\" flag on a tile "
2049 "within the city radius."),
2050 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2052 cat_snprintf(buf
, bufsz
,
2053 /* TRANS: %s is a (translatable) base flag. */
2054 _("Prevented by a base with the \"%s\" flag on any tile "
2055 "within the city radius."),
2056 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2059 case REQ_RANGE_TRADEROUTE
:
2060 if (preq
->present
) {
2061 cat_snprintf(buf
, bufsz
,
2062 /* TRANS: %s is a (translatable) base flag. */
2063 _("Requires a base with the \"%s\" flag on a tile "
2064 "within the city radius or the city radius of a "
2066 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2068 cat_snprintf(buf
, bufsz
,
2069 /* TRANS: %s is a (translatable) base flag. */
2070 _("Prevented by a base with the \"%s\" flag on any tile "
2071 "within the city radius or the city radius of a "
2073 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2076 case REQ_RANGE_CONTINENT
:
2077 case REQ_RANGE_PLAYER
:
2078 case REQ_RANGE_TEAM
:
2079 case REQ_RANGE_ALLIANCE
:
2080 case REQ_RANGE_WORLD
:
2081 case REQ_RANGE_COUNT
:
2082 /* Not supported. */
2088 switch (preq
->range
) {
2089 case REQ_RANGE_LOCAL
:
2090 if (preq
->present
) {
2091 cat_snprintf(buf
, bufsz
,
2092 /* TRANS: %s is a (translatable) road flag. */
2093 _("Requires a road with the \"%s\" flag on the tile."),
2094 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2096 cat_snprintf(buf
, bufsz
,
2097 /* TRANS: %s is a (translatable) road flag. */
2098 _("Prevented by a road with the \"%s\" flag on the "
2100 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2103 case REQ_RANGE_CADJACENT
:
2104 if (preq
->present
) {
2105 cat_snprintf(buf
, bufsz
,
2106 /* TRANS: %s is a (translatable) road flag. */
2107 _("Requires a road with the \"%s\" flag on the "
2108 "tile or a cardinally adjacent tile."),
2109 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2111 cat_snprintf(buf
, bufsz
,
2112 /* TRANS: %s is a (translatable) road flag. */
2113 _("Prevented by a road with the \"%s\" flag on "
2114 "the tile or any cardinally adjacent tile."),
2115 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2118 case REQ_RANGE_ADJACENT
:
2119 if (preq
->present
) {
2120 cat_snprintf(buf
, bufsz
,
2121 /* TRANS: %s is a (translatable) road flag. */
2122 _("Requires a road with the \"%s\" flag on the "
2123 "tile or an adjacent tile."),
2124 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2126 cat_snprintf(buf
, bufsz
,
2127 /* TRANS: %s is a (translatable) road flag. */
2128 _("Prevented by a road with the \"%s\" flag on "
2129 "the tile or any adjacent tile."),
2130 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2133 case REQ_RANGE_CITY
:
2134 if (preq
->present
) {
2135 cat_snprintf(buf
, bufsz
,
2136 /* TRANS: %s is a (translatable) road flag. */
2137 _("Requires a road with the \"%s\" flag on a tile "
2138 "within the city radius."),
2139 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2141 cat_snprintf(buf
, bufsz
,
2142 /* TRANS: %s is a (translatable) road flag. */
2143 _("Prevented by a road with the \"%s\" flag on any tile "
2144 "within the city radius."),
2145 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2148 case REQ_RANGE_TRADEROUTE
:
2149 if (preq
->present
) {
2150 cat_snprintf(buf
, bufsz
,
2151 /* TRANS: %s is a (translatable) road flag. */
2152 _("Requires a road with the \"%s\" flag on a tile "
2153 "within the city radius or the city radius of a "
2155 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2157 cat_snprintf(buf
, bufsz
,
2158 /* TRANS: %s is a (translatable) road flag. */
2159 _("Prevented by a road with the \"%s\" flag on any tile "
2160 "within the city radius or the city radius of a "
2162 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2165 case REQ_RANGE_CONTINENT
:
2166 case REQ_RANGE_PLAYER
:
2167 case REQ_RANGE_TEAM
:
2168 case REQ_RANGE_ALLIANCE
:
2169 case REQ_RANGE_WORLD
:
2170 case REQ_RANGE_COUNT
:
2171 /* Not supported. */
2177 switch (preq
->range
) {
2178 case REQ_RANGE_LOCAL
:
2179 if (preq
->present
) {
2180 cat_snprintf(buf
, bufsz
,
2181 /* TRANS: %s is a (translatable) extra flag. */
2182 _("Requires an extra with the \"%s\" flag on the tile."),
2183 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2185 cat_snprintf(buf
, bufsz
,
2186 /* TRANS: %s is a (translatable) extra flag. */
2187 _("Prevented by an extra with the \"%s\" flag on the "
2189 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2192 case REQ_RANGE_CADJACENT
:
2193 if (preq
->present
) {
2194 cat_snprintf(buf
, bufsz
,
2195 /* TRANS: %s is a (translatable) extra flag. */
2196 _("Requires an extra with the \"%s\" flag on the "
2197 "tile or a cardinally adjacent tile."),
2198 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2200 cat_snprintf(buf
, bufsz
,
2201 /* TRANS: %s is a (translatable) extra flag. */
2202 _("Prevented by an extra with the \"%s\" flag on "
2203 "the tile or any cardinally adjacent tile."),
2204 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2207 case REQ_RANGE_ADJACENT
:
2208 if (preq
->present
) {
2209 cat_snprintf(buf
, bufsz
,
2210 /* TRANS: %s is a (translatable) extra flag. */
2211 _("Requires an extra with the \"%s\" flag on the "
2212 "tile or an adjacent tile."),
2213 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2215 cat_snprintf(buf
, bufsz
,
2216 /* TRANS: %s is a (translatable) extra flag. */
2217 _("Prevented by an extra with the \"%s\" flag on "
2218 "the tile or any adjacent tile."),
2219 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2222 case REQ_RANGE_CITY
:
2223 if (preq
->present
) {
2224 cat_snprintf(buf
, bufsz
,
2225 /* TRANS: %s is a (translatable) extra flag. */
2226 _("Requires an extra with the \"%s\" flag on a tile "
2227 "within the city radius."),
2228 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2230 cat_snprintf(buf
, bufsz
,
2231 /* TRANS: %s is a (translatable) extra flag. */
2232 _("Prevented by an extra with the \"%s\" flag on any tile "
2233 "within the city radius."),
2234 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2237 case REQ_RANGE_TRADEROUTE
:
2238 if (preq
->present
) {
2239 cat_snprintf(buf
, bufsz
,
2240 /* TRANS: %s is a (translatable) extra flag. */
2241 _("Requires an extra with the \"%s\" flag on a tile "
2242 "within the city radius or the city radius of a "
2244 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2246 cat_snprintf(buf
, bufsz
,
2247 /* TRANS: %s is a (translatable) extra flag. */
2248 _("Prevented by an extra with the \"%s\" flag on any tile "
2249 "within the city radius or the city radius of a "
2251 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2254 case REQ_RANGE_CONTINENT
:
2255 case REQ_RANGE_PLAYER
:
2256 case REQ_RANGE_TEAM
:
2257 case REQ_RANGE_ALLIANCE
:
2258 case REQ_RANGE_WORLD
:
2259 case REQ_RANGE_COUNT
:
2260 /* Not supported. */
2266 if (preq
->range
!= REQ_RANGE_WORLD
) {
2269 if (preq
->present
) {
2270 cat_snprintf(buf
, bufsz
,
2271 _("Requires the game to have reached the year %s."),
2272 textyear(preq
->source
.value
.minyear
));
2274 cat_snprintf(buf
, bufsz
,
2275 _("Requires that the game has not yet reached the "
2277 textyear(preq
->source
.value
.minyear
));
2281 case VUT_MINCALFRAG
:
2282 if (preq
->range
!= REQ_RANGE_WORLD
) {
2285 if (preq
->present
) {
2286 cat_snprintf(buf
, bufsz
,
2287 /* TRANS: %s is a representation of a calendar fragment,
2288 * from the ruleset. May be a bare number. */
2289 _("Requires the game to have reached %s."),
2290 textcalfrag(preq
->source
.value
.mincalfrag
));
2292 cat_snprintf(buf
, bufsz
,
2293 /* TRANS: %s is a representation of a calendar fragment,
2294 * from the ruleset. May be a bare number. */
2295 _("Requires that the game has not yet reached %s."),
2296 textcalfrag(preq
->source
.value
.mincalfrag
));
2301 if (preq
->range
!= REQ_RANGE_WORLD
) {
2304 if (preq
->present
) {
2305 cat_snprintf(buf
, bufsz
,
2306 _("Requires %s map."),
2307 _(topo_flag_name(preq
->source
.value
.topo_property
)));
2309 cat_snprintf(buf
, bufsz
,
2310 _("Prevented on %s map."),
2311 _(topo_flag_name(preq
->source
.value
.topo_property
)));
2316 if (preq
->present
) {
2317 cat_snprintf(buf
, bufsz
,
2318 _("Requires age of %d turns."),
2319 preq
->source
.value
.age
);
2321 cat_snprintf(buf
, bufsz
,
2322 _("Prevented if age is over %d turns."),
2323 preq
->source
.value
.age
);
2328 switch (preq
->range
) {
2329 case REQ_RANGE_WORLD
:
2330 if (preq
->present
) {
2331 cat_snprintf(buf
, bufsz
,
2332 _("Requires %d techs to be known in the world."),
2333 preq
->source
.value
.min_techs
);
2335 cat_snprintf(buf
, bufsz
,
2336 _("Prevented when %d techs are known in the world."),
2337 preq
->source
.value
.min_techs
);
2340 case REQ_RANGE_PLAYER
:
2341 if (preq
->present
) {
2342 cat_snprintf(buf
, bufsz
,
2343 _("Requires player to know %d techs."),
2344 preq
->source
.value
.min_techs
);
2346 cat_snprintf(buf
, bufsz
,
2347 _("Prevented when player knows %d techs."),
2348 preq
->source
.value
.min_techs
);
2351 case REQ_RANGE_LOCAL
:
2352 case REQ_RANGE_CADJACENT
:
2353 case REQ_RANGE_ADJACENT
:
2354 case REQ_RANGE_CITY
:
2355 case REQ_RANGE_TRADEROUTE
:
2356 case REQ_RANGE_CONTINENT
:
2357 case REQ_RANGE_TEAM
:
2358 case REQ_RANGE_ALLIANCE
:
2359 case REQ_RANGE_COUNT
:
2360 /* Not supported. */
2365 case VUT_TERRAINALTER
:
2366 switch (preq
->range
) {
2367 case REQ_RANGE_LOCAL
:
2368 if (preq
->present
) {
2369 cat_snprintf(buf
, bufsz
,
2370 _("Requires terrain on which alteration %s is "
2372 Q_(terrain_alteration_name(preq
->source
.value
.terrainalter
)));
2374 cat_snprintf(buf
, bufsz
,
2375 _("Prevented by terrain on which alteration %s "
2377 Q_(terrain_alteration_name(preq
->source
.value
.terrainalter
)));
2380 case REQ_RANGE_CADJACENT
:
2381 case REQ_RANGE_ADJACENT
:
2382 case REQ_RANGE_CITY
:
2383 case REQ_RANGE_TRADEROUTE
:
2384 case REQ_RANGE_CONTINENT
:
2385 case REQ_RANGE_PLAYER
:
2386 case REQ_RANGE_TEAM
:
2387 case REQ_RANGE_ALLIANCE
:
2388 case REQ_RANGE_WORLD
:
2389 case REQ_RANGE_COUNT
:
2390 /* Not supported. */
2396 if (preq
->source
.value
.citytile
== CITYT_LAST
) {
2399 static char *tile_property
= NULL
;
2401 switch (preq
->source
.value
.citytile
) {
2403 tile_property
= "city centers";
2406 tile_property
= "claimed tiles";
2409 fc_assert(preq
->source
.value
.citytile
!= CITYT_LAST
);
2413 switch (preq
->range
) {
2414 case REQ_RANGE_LOCAL
:
2415 if (preq
->present
) {
2416 cat_snprintf(buf
, bufsz
,
2417 /* TRANS: tile property ("city centers", etc) */
2418 Q_("?tileprop:Applies only to %s."), tile_property
);
2420 cat_snprintf(buf
, bufsz
,
2421 /* TRANS: tile property ("city centers", etc) */
2422 Q_("?tileprop:Does not apply to %s."), tile_property
);
2425 case REQ_RANGE_CADJACENT
:
2426 if (preq
->present
) {
2427 /* TRANS: tile property ("city centers", etc) */
2428 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Applies only to %s and "
2429 "cardinally adjacent tiles."),
2432 /* TRANS: tile property ("city centers", etc) */
2433 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Does not apply to %s or "
2434 "cardinally adjacent tiles."),
2438 case REQ_RANGE_ADJACENT
:
2439 if (preq
->present
) {
2440 /* TRANS: tile property ("city centers", etc) */
2441 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Applies only to %s and "
2442 "adjacent tiles."), tile_property
);
2444 /* TRANS: tile property ("city centers", etc) */
2445 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Does not apply to %s or "
2446 "adjacent tiles."), tile_property
);
2449 case REQ_RANGE_CITY
:
2450 case REQ_RANGE_TRADEROUTE
:
2451 case REQ_RANGE_CONTINENT
:
2452 case REQ_RANGE_PLAYER
:
2453 case REQ_RANGE_TEAM
:
2454 case REQ_RANGE_ALLIANCE
:
2455 case REQ_RANGE_WORLD
:
2456 case REQ_RANGE_COUNT
:
2457 /* Not supported. */
2466 if (verb
== VERB_DEFAULT
) {
2469 log_error("%s requirement %s in range %d is not supported in reqtext.c.",
2470 preq
->present
? "Present" : "Absent",
2471 universal_name_translation(&preq
->source
, text
, sizeof(text
)),
2478 /****************************************************************
2479 Append text for the requirement. Added line ends to a newline.
2480 *****************************************************************/
2481 bool req_text_insert_nl(char *buf
, size_t bufsz
, struct player
*pplayer
,
2482 const struct requirement
*preq
,
2483 enum rt_verbosity verb
)
2485 if (req_text_insert(buf
, bufsz
, pplayer
, preq
, verb
)) {
2486 fc_strlcat(buf
, "\n", bufsz
);