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"
30 #include "requirements.h"
31 #include "specialist.h"
35 /****************************************************************
36 Append text for the requirement. Something like
38 "Requires knowledge of the technology Communism."
40 pplayer may be NULL. Note that it must be updated everytime
41 a new requirement type or range is defined.
42 *****************************************************************/
43 bool req_text_insert(char *buf
, size_t bufsz
, struct player
*pplayer
,
44 const struct requirement
*preq
,
45 enum rt_verbosity verb
)
47 if (preq
->quiet
&& verb
!= VERB_ACTUAL
) {
51 switch (preq
->source
.kind
) {
56 switch (preq
->range
) {
57 case REQ_RANGE_PLAYER
:
59 cat_snprintf(buf
, bufsz
,
60 _("Requires knowledge of the technology %s."),
61 advance_name_translation(preq
->source
.value
.advance
));
63 cat_snprintf(buf
, bufsz
,
64 _("Prevented by knowledge of the technology %s."),
65 advance_name_translation(preq
->source
.value
.advance
));
70 cat_snprintf(buf
, bufsz
,
71 _("Requires that a player on your team knows the "
73 advance_name_translation(preq
->source
.value
.advance
));
75 cat_snprintf(buf
, bufsz
,
76 _("Prevented if any player on your team knows the "
78 advance_name_translation(preq
->source
.value
.advance
));
81 case REQ_RANGE_ALLIANCE
:
83 cat_snprintf(buf
, bufsz
,
84 _("Requires that a player allied to you knows the "
86 advance_name_translation(preq
->source
.value
.advance
));
88 cat_snprintf(buf
, bufsz
,
89 _("Prevented if any player allied to you knows the "
91 advance_name_translation(preq
->source
.value
.advance
));
97 cat_snprintf(buf
, bufsz
,
98 _("Requires that someone has discovered the "
100 advance_name_translation(preq
->source
.value
.advance
));
102 cat_snprintf(buf
, bufsz
,
103 _("Requires that no-one has yet discovered the "
105 advance_name_translation(preq
->source
.value
.advance
));
109 cat_snprintf(buf
, bufsz
,
110 _("Requires that some player knows the "
112 advance_name_translation(preq
->source
.value
.advance
));
114 cat_snprintf(buf
, bufsz
,
115 _("Requires that no player knows the "
117 advance_name_translation(preq
->source
.value
.advance
));
121 case REQ_RANGE_LOCAL
:
122 case REQ_RANGE_CADJACENT
:
123 case REQ_RANGE_ADJACENT
:
125 case REQ_RANGE_TRADEROUTE
:
126 case REQ_RANGE_CONTINENT
:
127 case REQ_RANGE_COUNT
:
134 switch (preq
->range
) {
135 case REQ_RANGE_PLAYER
:
137 cat_snprintf(buf
, bufsz
,
138 /* TRANS: %s is a (translatable) tech flag. */
139 _("Requires knowledge of a technology with the "
141 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
143 cat_snprintf(buf
, bufsz
,
144 /* TRANS: %s is a (translatable) tech flag. */
145 _("Prevented by knowledge of any technology with the "
147 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
152 cat_snprintf(buf
, bufsz
,
153 /* TRANS: %s is a (translatable) tech flag. */
154 _("Requires that a player on your team knows "
155 "a technology with the \"%s\" flag."),
156 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
158 cat_snprintf(buf
, bufsz
,
159 /* TRANS: %s is a (translatable) tech flag. */
160 _("Prevented if any player on your team knows "
161 "any technology with the \"%s\" flag."),
162 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
165 case REQ_RANGE_ALLIANCE
:
167 cat_snprintf(buf
, bufsz
,
168 /* TRANS: %s is a (translatable) tech flag. */
169 _("Requires that a player allied to you knows "
170 "a technology with the \"%s\" flag."),
171 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
173 cat_snprintf(buf
, bufsz
,
174 /* TRANS: %s is a (translatable) tech flag. */
175 _("Prevented if any player allied to you knows "
176 "any technology with the \"%s\" flag."),
177 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
180 case REQ_RANGE_WORLD
:
182 cat_snprintf(buf
, bufsz
,
183 /* TRANS: %s is a (translatable) tech flag. */
184 _("Requires that some player knows a technology "
185 "with the \"%s\" flag."),
186 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
188 cat_snprintf(buf
, bufsz
,
189 /* TRANS: %s is a (translatable) tech flag. */
190 _("Requires that no player knows any technology with "
192 tech_flag_id_translated_name(preq
->source
.value
.techflag
));
195 case REQ_RANGE_LOCAL
:
196 case REQ_RANGE_CADJACENT
:
197 case REQ_RANGE_ADJACENT
:
199 case REQ_RANGE_TRADEROUTE
:
200 case REQ_RANGE_CONTINENT
:
201 case REQ_RANGE_COUNT
:
208 if (preq
->range
!= REQ_RANGE_PLAYER
) {
212 cat_snprintf(buf
, bufsz
, _("Requires the %s government."),
213 government_name_translation(preq
->source
.value
.govern
));
215 cat_snprintf(buf
, bufsz
, _("Not available under the %s government."),
216 government_name_translation(preq
->source
.value
.govern
));
220 case VUT_ACHIEVEMENT
:
221 switch (preq
->range
) {
222 case REQ_RANGE_PLAYER
:
224 cat_snprintf(buf
, bufsz
, _("Requires you to have achieved \"%s\"."),
225 achievement_name_translation(preq
->source
.value
.achievement
));
227 cat_snprintf(buf
, bufsz
, _("Not available once you have achieved "
229 achievement_name_translation(preq
->source
.value
.achievement
));
234 cat_snprintf(buf
, bufsz
, _("Requires that at least one of your "
235 "team-mates has achieved \"%s\"."),
236 achievement_name_translation(preq
->source
.value
.achievement
));
238 cat_snprintf(buf
, bufsz
, _("Not available if any of your team-mates "
239 "has achieved \"%s\"."),
240 achievement_name_translation(preq
->source
.value
.achievement
));
243 case REQ_RANGE_ALLIANCE
:
245 cat_snprintf(buf
, bufsz
, _("Requires that at least one of your allies "
246 "has achieved \"%s\"."),
247 achievement_name_translation(preq
->source
.value
.achievement
));
249 cat_snprintf(buf
, bufsz
, _("Not available if any of your allies has "
251 achievement_name_translation(preq
->source
.value
.achievement
));
254 case REQ_RANGE_WORLD
:
256 cat_snprintf(buf
, bufsz
, _("Requires that at least one player "
257 "has achieved \"%s\"."),
258 achievement_name_translation(preq
->source
.value
.achievement
));
260 cat_snprintf(buf
, bufsz
, _("Not available if any player has "
262 achievement_name_translation(preq
->source
.value
.achievement
));
265 case REQ_RANGE_LOCAL
:
266 case REQ_RANGE_CADJACENT
:
267 case REQ_RANGE_ADJACENT
:
269 case REQ_RANGE_TRADEROUTE
:
270 case REQ_RANGE_CONTINENT
:
271 case REQ_RANGE_COUNT
:
278 switch (preq
->range
) {
279 case REQ_RANGE_LOCAL
:
281 cat_snprintf(buf
, bufsz
, _("Applies to the \"%s\" action."),
282 action_name_translation(preq
->source
.value
.action
));
284 cat_snprintf(buf
, bufsz
, _("Doesn't apply to the \"%s\""
286 action_name_translation(preq
->source
.value
.action
));
296 switch (preq
->range
) {
297 case REQ_RANGE_LOCAL
:
299 cat_snprintf(buf
, bufsz
, _("Applies to \"%s\" buildings."),
300 impr_genus_id_translated_name(
301 preq
->source
.value
.impr_genus
));
303 cat_snprintf(buf
, bufsz
, _("Doesn't apply to \"%s\" buildings."),
304 impr_genus_id_translated_name(
305 preq
->source
.value
.impr_genus
));
314 case VUT_IMPROVEMENT
:
315 switch (preq
->range
) {
316 case REQ_RANGE_WORLD
:
317 if (is_great_wonder(preq
->source
.value
.building
)) {
318 if (preq
->survives
) {
320 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
321 cat_snprintf(buf
, bufsz
,
322 /* TRANS: %s is a wonder */
323 _("Requires that %s was built at some point, "
324 "and that it has not yet been rendered "
326 improvement_name_translation
327 (preq
->source
.value
.building
));
329 cat_snprintf(buf
, bufsz
,
330 /* TRANS: %s is a wonder */
331 _("Requires that %s was built at some point."),
332 improvement_name_translation
333 (preq
->source
.value
.building
));
336 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
337 cat_snprintf(buf
, bufsz
,
338 /* TRANS: %s is a wonder */
339 _("Prevented if %s has ever been built, "
340 "unless it would be obsolete."),
341 improvement_name_translation
342 (preq
->source
.value
.building
));
344 cat_snprintf(buf
, bufsz
,
345 /* TRANS: %s is a wonder */
346 _("Prevented if %s has ever been built."),
347 improvement_name_translation
348 (preq
->source
.value
.building
));
352 /* Non-surviving requirement */
354 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
355 cat_snprintf(buf
, bufsz
,
356 /* TRANS: %s is a wonder */
357 _("Requires %s to be owned by any player "
358 "and not yet obsolete."),
359 improvement_name_translation
360 (preq
->source
.value
.building
));
362 cat_snprintf(buf
, bufsz
,
363 /* TRANS: %s is a wonder */
364 _("Requires %s to be owned by any player."),
365 improvement_name_translation
366 (preq
->source
.value
.building
));
369 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
370 cat_snprintf(buf
, bufsz
,
371 /* TRANS: %s is a wonder */
372 _("Prevented if %s is currently owned by "
373 "any player, unless it is obsolete."),
374 improvement_name_translation
375 (preq
->source
.value
.building
));
377 cat_snprintf(buf
, bufsz
,
378 /* TRANS: %s is a wonder */
379 _("Prevented if %s is currently owned by "
381 improvement_name_translation
382 (preq
->source
.value
.building
));
388 /* non-great-wonder world-ranged requirements not supported */
390 case REQ_RANGE_ALLIANCE
:
391 if (is_wonder(preq
->source
.value
.building
)) {
392 if (preq
->survives
) {
394 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
395 cat_snprintf(buf
, bufsz
,
396 /* TRANS: %s is a wonder */
397 _("Requires someone who is currently allied to "
398 "you to have built %s at some point, and for "
399 "it not to have been rendered obsolete."),
400 improvement_name_translation
401 (preq
->source
.value
.building
));
403 cat_snprintf(buf
, bufsz
,
404 /* TRANS: %s is a wonder */
405 _("Requires someone who is currently allied to "
406 "you to have built %s at some point."),
407 improvement_name_translation
408 (preq
->source
.value
.building
));
411 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
412 cat_snprintf(buf
, bufsz
,
413 /* TRANS: %s is a wonder */
414 _("Prevented if someone currently allied to you "
415 "has ever built %s, unless it would be "
417 improvement_name_translation
418 (preq
->source
.value
.building
));
420 cat_snprintf(buf
, bufsz
,
421 /* TRANS: %s is a wonder */
422 _("Prevented if someone currently allied to you "
423 "has ever built %s."),
424 improvement_name_translation
425 (preq
->source
.value
.building
));
429 /* Non-surviving requirement */
431 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
432 cat_snprintf(buf
, bufsz
,
433 /* TRANS: %s is a wonder */
434 _("Requires someone allied to you to own %s, "
435 "and for it not to have been rendered "
437 improvement_name_translation
438 (preq
->source
.value
.building
));
440 cat_snprintf(buf
, bufsz
,
441 /* TRANS: %s is a wonder */
442 _("Requires someone allied to you to own %s."),
443 improvement_name_translation
444 (preq
->source
.value
.building
));
447 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
448 cat_snprintf(buf
, bufsz
,
449 /* TRANS: %s is a wonder */
450 _("Prevented if someone allied to you owns %s, "
451 "unless it is obsolete."),
452 improvement_name_translation
453 (preq
->source
.value
.building
));
455 cat_snprintf(buf
, bufsz
,
456 /* TRANS: %s is a wonder */
457 _("Prevented if someone allied to you owns %s."),
458 improvement_name_translation
459 (preq
->source
.value
.building
));
465 /* non-wonder alliance-ranged requirements not supported */
468 if (is_wonder(preq
->source
.value
.building
)) {
469 if (preq
->survives
) {
471 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
472 cat_snprintf(buf
, bufsz
,
473 /* TRANS: %s is a wonder */
474 _("Requires someone on your team to have "
475 "built %s at some point, and for it not "
476 "to have been rendered obsolete."),
477 improvement_name_translation
478 (preq
->source
.value
.building
));
480 cat_snprintf(buf
, bufsz
,
481 /* TRANS: %s is a wonder */
482 _("Requires someone on your team to have "
483 "built %s at some point."),
484 improvement_name_translation
485 (preq
->source
.value
.building
));
488 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
489 cat_snprintf(buf
, bufsz
,
490 /* TRANS: %s is a wonder */
491 _("Prevented if someone on your team has ever "
492 "built %s, unless it would be obsolete."),
493 improvement_name_translation
494 (preq
->source
.value
.building
));
496 cat_snprintf(buf
, bufsz
,
497 /* TRANS: %s is a wonder */
498 _("Prevented if someone on your team has ever "
500 improvement_name_translation
501 (preq
->source
.value
.building
));
505 /* Non-surviving requirement */
507 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
508 cat_snprintf(buf
, bufsz
,
509 /* TRANS: %s is a wonder */
510 _("Requires someone on your team to own %s, "
511 "and for it not to have been rendered "
513 improvement_name_translation
514 (preq
->source
.value
.building
));
516 cat_snprintf(buf
, bufsz
,
517 /* TRANS: %s is a wonder */
518 _("Requires someone on your team to own %s."),
519 improvement_name_translation
520 (preq
->source
.value
.building
));
523 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
524 cat_snprintf(buf
, bufsz
,
525 /* TRANS: %s is a wonder */
526 _("Prevented if someone on your team owns %s, "
527 "unless it is obsolete."),
528 improvement_name_translation
529 (preq
->source
.value
.building
));
531 cat_snprintf(buf
, bufsz
,
532 /* TRANS: %s is a wonder */
533 _("Prevented if someone on your team owns %s."),
534 improvement_name_translation
535 (preq
->source
.value
.building
));
541 /* non-wonder team-ranged requirements not supported */
543 case REQ_RANGE_PLAYER
:
544 if (is_wonder(preq
->source
.value
.building
)) {
545 if (preq
->survives
) {
547 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
548 cat_snprintf(buf
, bufsz
,
549 /* TRANS: %s is a wonder */
550 _("Requires you to have built %s at some point, "
551 "and for it not to have been rendered "
553 improvement_name_translation
554 (preq
->source
.value
.building
));
556 cat_snprintf(buf
, bufsz
,
557 /* TRANS: %s is a wonder */
558 _("Requires you to have built %s at some point."),
559 improvement_name_translation
560 (preq
->source
.value
.building
));
563 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
564 cat_snprintf(buf
, bufsz
,
565 /* TRANS: %s is a wonder */
566 _("Prevented if you have ever built %s, "
567 "unless it would be obsolete."),
568 improvement_name_translation
569 (preq
->source
.value
.building
));
571 cat_snprintf(buf
, bufsz
,
572 /* TRANS: %s is a wonder */
573 _("Prevented if you have ever built %s."),
574 improvement_name_translation
575 (preq
->source
.value
.building
));
579 /* Non-surviving requirement */
581 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
582 cat_snprintf(buf
, bufsz
,
583 /* TRANS: %s is a wonder */
584 _("Requires you to own %s, which must not "
586 improvement_name_translation
587 (preq
->source
.value
.building
));
589 cat_snprintf(buf
, bufsz
,
590 /* TRANS: %s is a wonder */
591 _("Requires you to own %s."),
592 improvement_name_translation
593 (preq
->source
.value
.building
));
596 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
597 cat_snprintf(buf
, bufsz
,
598 /* TRANS: %s is a wonder */
599 _("Prevented if you own %s, unless it is "
601 improvement_name_translation
602 (preq
->source
.value
.building
));
604 cat_snprintf(buf
, bufsz
,
605 /* TRANS: %s is a wonder */
606 _("Prevented if you own %s."),
607 improvement_name_translation
608 (preq
->source
.value
.building
));
614 /* non-wonder player-ranged requirements not supported */
616 case REQ_RANGE_CONTINENT
:
617 if (is_wonder(preq
->source
.value
.building
)) {
619 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
620 cat_snprintf(buf
, bufsz
,
621 /* TRANS: %s is a wonder */
622 _("Requires %s in one of your cities on the same "
623 "continent, and not yet obsolete."),
624 improvement_name_translation
625 (preq
->source
.value
.building
));
627 cat_snprintf(buf
, bufsz
,
628 /* TRANS: %s is a wonder */
629 _("Requires %s in one of your cities on the same "
631 improvement_name_translation
632 (preq
->source
.value
.building
));
635 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
636 cat_snprintf(buf
, bufsz
,
637 /* TRANS: %s is a wonder */
638 _("Prevented if %s is in one of your cities on the "
639 "same continent, unless it is obsolete."),
640 improvement_name_translation
641 (preq
->source
.value
.building
));
643 cat_snprintf(buf
, bufsz
,
644 /* TRANS: %s is a wonder */
645 _("Prevented if %s is in one of your cities on the "
647 improvement_name_translation
648 (preq
->source
.value
.building
));
653 /* surviving or non-wonder continent-ranged requirements not supported */
655 case REQ_RANGE_TRADEROUTE
:
657 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
658 /* Should only apply to wonders */
659 cat_snprintf(buf
, bufsz
,
660 /* TRANS: %s is a building or wonder */
661 _("Requires %s in the city or a trade partner "
662 "(and not yet obsolete)."),
663 improvement_name_translation
664 (preq
->source
.value
.building
));
666 cat_snprintf(buf
, bufsz
,
667 /* TRANS: %s is a building or wonder */
668 _("Requires %s in the city or a trade partner."),
669 improvement_name_translation
670 (preq
->source
.value
.building
));
673 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
674 /* Should only apply to wonders */
675 cat_snprintf(buf
, bufsz
,
676 /* TRANS: %s is a building or wonder */
677 _("Prevented by %s in the city or a trade partner "
678 "(unless it is obsolete)."),
679 improvement_name_translation
680 (preq
->source
.value
.building
));
682 cat_snprintf(buf
, bufsz
,
683 /* TRANS: %s is a building or wonder */
684 _("Prevented by %s in the city or a trade partner."),
685 improvement_name_translation
686 (preq
->source
.value
.building
));
692 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
693 /* Should only apply to wonders */
694 cat_snprintf(buf
, bufsz
,
695 /* TRANS: %s is a building or wonder */
696 _("Requires %s in the city (and not yet obsolete)."),
697 improvement_name_translation
698 (preq
->source
.value
.building
));
700 cat_snprintf(buf
, bufsz
,
701 /* TRANS: %s is a building or wonder */
702 _("Requires %s in the city."),
703 improvement_name_translation
704 (preq
->source
.value
.building
));
707 if (can_improvement_go_obsolete(preq
->source
.value
.building
)) {
708 /* Should only apply to wonders */
709 cat_snprintf(buf
, bufsz
,
710 /* TRANS: %s is a building or wonder */
711 _("Prevented by %s in the city (unless it is "
713 improvement_name_translation
714 (preq
->source
.value
.building
));
716 cat_snprintf(buf
, bufsz
,
717 /* TRANS: %s is a building or wonder */
718 _("Prevented by %s in the city."),
719 improvement_name_translation
720 (preq
->source
.value
.building
));
724 case REQ_RANGE_LOCAL
:
726 cat_snprintf(buf
, bufsz
,
727 _("Only applies to \"%s\" buildings."),
728 improvement_name_translation
729 (preq
->source
.value
.building
));
731 cat_snprintf(buf
, bufsz
,
732 _("Does not apply to \"%s\" buildings."),
733 improvement_name_translation
734 (preq
->source
.value
.building
));
737 case REQ_RANGE_CADJACENT
:
738 case REQ_RANGE_ADJACENT
:
739 case REQ_RANGE_COUNT
:
746 switch (preq
->range
) {
747 case REQ_RANGE_LOCAL
:
749 cat_snprintf(buf
, bufsz
,
750 Q_("?extra:Requires %s on the tile."),
751 extra_name_translation(preq
->source
.value
.extra
));
753 cat_snprintf(buf
, bufsz
,
754 Q_("?extra:Prevented by %s on the tile."),
755 extra_name_translation(preq
->source
.value
.extra
));
758 case REQ_RANGE_CADJACENT
:
760 cat_snprintf(buf
, bufsz
,
761 Q_("?extra:Requires %s on the tile or a cardinally "
763 extra_name_translation(preq
->source
.value
.extra
));
765 cat_snprintf(buf
, bufsz
,
766 Q_("?extra:Prevented by %s on the tile or any cardinally "
768 extra_name_translation(preq
->source
.value
.extra
));
771 case REQ_RANGE_ADJACENT
:
773 cat_snprintf(buf
, bufsz
,
774 Q_("?extra:Requires %s on the tile or an adjacent "
776 extra_name_translation(preq
->source
.value
.extra
));
778 cat_snprintf(buf
, bufsz
,
779 Q_("?extra:Prevented by %s on the tile or any adjacent "
781 extra_name_translation(preq
->source
.value
.extra
));
786 cat_snprintf(buf
, bufsz
,
787 Q_("?extra:Requires %s on a tile within the city "
789 extra_name_translation(preq
->source
.value
.extra
));
791 cat_snprintf(buf
, bufsz
,
792 Q_("?extra:Prevented by %s on any tile within the city "
794 extra_name_translation(preq
->source
.value
.extra
));
797 case REQ_RANGE_TRADEROUTE
:
799 cat_snprintf(buf
, bufsz
,
800 Q_("?extra:Requires %s on a tile within the city "
801 "radius, or the city radius of a trade partner."),
802 extra_name_translation(preq
->source
.value
.extra
));
804 cat_snprintf(buf
, bufsz
,
805 Q_("?extra:Prevented by %s on any tile within the city "
806 "radius or the city radius of a trade partner."),
807 extra_name_translation(preq
->source
.value
.extra
));
810 case REQ_RANGE_CONTINENT
:
811 case REQ_RANGE_PLAYER
:
813 case REQ_RANGE_ALLIANCE
:
814 case REQ_RANGE_WORLD
:
815 case REQ_RANGE_COUNT
:
822 switch (preq
->range
) {
825 cat_snprintf(buf
, bufsz
, Q_("?good:Requires import of %s ."),
826 goods_name_translation(preq
->source
.value
.good
));
828 cat_snprintf(buf
, bufsz
, Q_("?goods:Prevented by import of %s."),
829 goods_name_translation(preq
->source
.value
.good
));
832 case REQ_RANGE_LOCAL
:
833 case REQ_RANGE_CADJACENT
:
834 case REQ_RANGE_ADJACENT
:
835 case REQ_RANGE_TRADEROUTE
:
836 case REQ_RANGE_CONTINENT
:
837 case REQ_RANGE_PLAYER
:
839 case REQ_RANGE_ALLIANCE
:
840 case REQ_RANGE_WORLD
:
841 case REQ_RANGE_COUNT
:
848 switch (preq
->range
) {
849 case REQ_RANGE_LOCAL
:
851 cat_snprintf(buf
, bufsz
, Q_("?terrain:Requires %s on the tile."),
852 terrain_name_translation(preq
->source
.value
.terrain
));
854 cat_snprintf(buf
, bufsz
, Q_("?terrain:Prevented by %s on the tile."),
855 terrain_name_translation(preq
->source
.value
.terrain
));
858 case REQ_RANGE_CADJACENT
:
860 cat_snprintf(buf
, bufsz
,
861 Q_("?terrain:Requires %s on the tile or a cardinally "
863 terrain_name_translation(preq
->source
.value
.terrain
));
865 cat_snprintf(buf
, bufsz
,
866 Q_("?terrain:Prevented by %s on the tile or any "
867 "cardinally adjacent tile."),
868 terrain_name_translation(preq
->source
.value
.terrain
));
871 case REQ_RANGE_ADJACENT
:
873 cat_snprintf(buf
, bufsz
,
874 Q_("?terrain:Requires %s on the tile or an adjacent "
876 terrain_name_translation(preq
->source
.value
.terrain
));
878 cat_snprintf(buf
, bufsz
,
879 Q_("?terrain:Prevented by %s on the tile or any "
881 terrain_name_translation(preq
->source
.value
.terrain
));
886 cat_snprintf(buf
, bufsz
,
887 Q_("?terrain:Requires %s on a tile within the city "
889 terrain_name_translation(preq
->source
.value
.terrain
));
891 cat_snprintf(buf
, bufsz
,
892 Q_("?terrain:Prevented by %s on any tile within the city "
894 terrain_name_translation(preq
->source
.value
.terrain
));
897 case REQ_RANGE_TRADEROUTE
:
899 cat_snprintf(buf
, bufsz
,
900 Q_("?terrain:Requires %s on a tile within the city "
901 "radius, or the city radius of a trade partner."),
902 terrain_name_translation(preq
->source
.value
.terrain
));
904 cat_snprintf(buf
, bufsz
,
905 Q_("?terrain:Prevented by %s on any tile within the city "
906 "radius or the city radius of a trade partner."),
907 terrain_name_translation(preq
->source
.value
.terrain
));
910 case REQ_RANGE_CONTINENT
:
911 case REQ_RANGE_PLAYER
:
913 case REQ_RANGE_ALLIANCE
:
914 case REQ_RANGE_WORLD
:
915 case REQ_RANGE_COUNT
:
922 switch (preq
->range
) {
923 case REQ_RANGE_PLAYER
:
925 cat_snprintf(buf
, bufsz
,
926 /* TRANS: "... playing as the Swedes." */
927 _("Requires that you are playing as the %s."),
928 nation_plural_translation(preq
->source
.value
.nation
));
930 cat_snprintf(buf
, bufsz
,
931 /* TRANS: "... playing as the Turks." */
932 _("Requires that you are not playing as the %s."),
933 nation_plural_translation(preq
->source
.value
.nation
));
938 cat_snprintf(buf
, bufsz
,
939 /* TRANS: "... same team as the Indonesians." */
940 _("Requires that you are on the same team as "
942 nation_plural_translation(preq
->source
.value
.nation
));
944 cat_snprintf(buf
, bufsz
,
945 /* TRANS: "... same team as the Greeks." */
946 _("Requires that you are not on the same team as "
948 nation_plural_translation(preq
->source
.value
.nation
));
951 case REQ_RANGE_ALLIANCE
:
953 cat_snprintf(buf
, bufsz
,
954 /* TRANS: "... allied with the Koreans." */
955 _("Requires that you are allied with the %s."),
956 nation_plural_translation(preq
->source
.value
.nation
));
958 cat_snprintf(buf
, bufsz
,
959 /* TRANS: "... allied with the Danes." */
960 _("Requires that you are not allied with the %s."),
961 nation_plural_translation(preq
->source
.value
.nation
));
964 case REQ_RANGE_WORLD
:
965 if (preq
->survives
) {
967 cat_snprintf(buf
, bufsz
,
968 /* TRANS: "Requires the Apaches to have ..." */
969 _("Requires the %s to have been in the game."),
970 nation_plural_translation(preq
->source
.value
.nation
));
972 cat_snprintf(buf
, bufsz
,
973 /* TRANS: "Requires the Celts never to have ..." */
974 _("Requires the %s never to have been in the "
976 nation_plural_translation(preq
->source
.value
.nation
));
980 cat_snprintf(buf
, bufsz
,
981 /* TRANS: "Requires the Belgians in the game." */
982 _("Requires the %s in the game."),
983 nation_plural_translation(preq
->source
.value
.nation
));
985 cat_snprintf(buf
, bufsz
,
986 /* TRANS: "Requires that the Russians are not ... */
987 _("Requires that the %s are not in the game."),
988 nation_plural_translation(preq
->source
.value
.nation
));
992 case REQ_RANGE_LOCAL
:
993 case REQ_RANGE_CADJACENT
:
994 case REQ_RANGE_ADJACENT
:
996 case REQ_RANGE_TRADEROUTE
:
997 case REQ_RANGE_CONTINENT
:
998 case REQ_RANGE_COUNT
:
1004 case VUT_NATIONGROUP
:
1005 switch (preq
->range
) {
1006 case REQ_RANGE_PLAYER
:
1007 if (preq
->present
) {
1008 cat_snprintf(buf
, bufsz
,
1009 /* TRANS: nation group: "... playing African nation." */
1010 _("Requires that you are playing %s nation."),
1011 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1013 cat_snprintf(buf
, bufsz
,
1014 /* TRANS: nation group: "... playing Imaginary nation." */
1015 _("Prevented if you are playing %s nation."),
1016 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1019 case REQ_RANGE_TEAM
:
1020 if (preq
->present
) {
1021 cat_snprintf(buf
, bufsz
,
1022 /* TRANS: nation group: "Requires Medieval nation ..." */
1023 _("Requires %s nation on your team."),
1024 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1026 cat_snprintf(buf
, bufsz
,
1027 /* TRANS: nation group: "Prevented by Medieval nation ..." */
1028 _("Prevented by %s nation on your team."),
1029 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1032 case REQ_RANGE_ALLIANCE
:
1033 if (preq
->present
) {
1034 cat_snprintf(buf
, bufsz
,
1035 /* TRANS: nation group: "Requires Modern nation ..." */
1036 _("Requires %s nation in alliance with you."),
1037 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1039 cat_snprintf(buf
, bufsz
,
1040 /* TRANS: nation group: "Prevented by Modern nation ..." */
1041 _("Prevented if %s nation is in alliance with you."),
1042 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1045 case REQ_RANGE_WORLD
:
1046 if (preq
->present
) {
1047 cat_snprintf(buf
, bufsz
,
1048 /* TRANS: nation group: "Requires Asian nation ..." */
1049 _("Requires %s nation in the game."),
1050 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1052 cat_snprintf(buf
, bufsz
,
1053 /* TRANS: nation group: "Prevented by Asian nation ..." */
1054 _("Prevented by %s nation in the game."),
1055 nation_group_name_translation(preq
->source
.value
.nationgroup
));
1058 case REQ_RANGE_LOCAL
:
1059 case REQ_RANGE_CADJACENT
:
1060 case REQ_RANGE_ADJACENT
:
1061 case REQ_RANGE_CITY
:
1062 case REQ_RANGE_TRADEROUTE
:
1063 case REQ_RANGE_CONTINENT
:
1064 case REQ_RANGE_COUNT
:
1065 /* Not supported. */
1071 if (preq
->range
!= REQ_RANGE_PLAYER
) {
1074 if (preq
->present
) {
1075 cat_snprintf(buf
, bufsz
,
1076 /* TRANS: "Requires that you are playing Asian style
1078 _("Requires that you are playing %s style nation."),
1079 style_name_translation(preq
->source
.value
.style
));
1081 cat_snprintf(buf
, bufsz
,
1082 /* TRANS: "Requires that you are not playing Classical
1084 _("Requires that you are not playing %s style nation."),
1085 style_name_translation(preq
->source
.value
.style
));
1089 case VUT_NATIONALITY
:
1090 switch (preq
->range
) {
1091 case REQ_RANGE_TRADEROUTE
:
1092 if (preq
->present
) {
1093 cat_snprintf(buf
, bufsz
,
1094 /* TRANS: "Requires at least one Barbarian citizen ..." */
1095 _("Requires at least one %s citizen in the city or a "
1097 nation_adjective_translation(preq
->source
.value
.nationality
));
1099 cat_snprintf(buf
, bufsz
,
1100 /* TRANS: "... no Pirate citizens ..." */
1101 _("Requires that there are no %s citizens in "
1102 "the city or any trade partners."),
1103 nation_adjective_translation(preq
->source
.value
.nationality
));
1106 case REQ_RANGE_CITY
:
1107 if (preq
->present
) {
1108 cat_snprintf(buf
, bufsz
,
1109 /* TRANS: "Requires at least one Barbarian citizen ..." */
1110 _("Requires at least one %s citizen in the city."),
1111 nation_adjective_translation(preq
->source
.value
.nationality
));
1113 cat_snprintf(buf
, bufsz
,
1114 /* TRANS: "... no Pirate citizens ..." */
1115 _("Requires that there are no %s citizens in "
1117 nation_adjective_translation(preq
->source
.value
.nationality
));
1120 case REQ_RANGE_WORLD
:
1121 case REQ_RANGE_ALLIANCE
:
1122 case REQ_RANGE_TEAM
:
1123 case REQ_RANGE_PLAYER
:
1124 case REQ_RANGE_LOCAL
:
1125 case REQ_RANGE_CADJACENT
:
1126 case REQ_RANGE_ADJACENT
:
1127 case REQ_RANGE_CONTINENT
:
1128 case REQ_RANGE_COUNT
:
1129 /* Not supported. */
1135 switch (preq
->range
) {
1136 case REQ_RANGE_PLAYER
:
1137 if (preq
->present
) {
1138 cat_snprintf(buf
, bufsz
,
1139 /* TRANS: in this and following strings, '%s' can be one
1140 * of a wide range of relationships; e.g., 'Peace',
1141 * 'Never met', 'Is foreign', 'Hosts embassy',
1142 * 'Provided Casus Belli' */
1143 _("Requires that you have the relationship '%s' with at "
1144 "least one other living player."),
1145 diplrel_name_translation(preq
->source
.value
.diplrel
));
1147 cat_snprintf(buf
, bufsz
,
1148 _("Requires that you do not have the relationship '%s' "
1149 "with any living player."),
1150 diplrel_name_translation(preq
->source
.value
.diplrel
));
1153 case REQ_RANGE_TEAM
:
1154 if (preq
->present
) {
1155 cat_snprintf(buf
, bufsz
,
1156 _("Requires that somebody on your team has the "
1157 "relationship '%s' with at least one other living "
1159 diplrel_name_translation(preq
->source
.value
.diplrel
));
1161 cat_snprintf(buf
, bufsz
,
1162 _("Requires that nobody on your team has the "
1163 "relationship '%s' with any living player."),
1164 diplrel_name_translation(preq
->source
.value
.diplrel
));
1167 case REQ_RANGE_ALLIANCE
:
1168 if (preq
->present
) {
1169 cat_snprintf(buf
, bufsz
,
1170 _("Requires that somebody in your alliance has the "
1171 "relationship '%s' with at least one other living "
1173 diplrel_name_translation(preq
->source
.value
.diplrel
));
1175 cat_snprintf(buf
, bufsz
,
1176 _("Requires that nobody in your alliance has the "
1177 "relationship '%s' with any living player."),
1178 diplrel_name_translation(preq
->source
.value
.diplrel
));
1181 case REQ_RANGE_WORLD
:
1182 if (preq
->present
) {
1183 cat_snprintf(buf
, bufsz
,
1184 _("Requires the relationship '%s' between two living "
1186 diplrel_name_translation(preq
->source
.value
.diplrel
));
1188 cat_snprintf(buf
, bufsz
,
1189 _("Requires that no two living players have the "
1190 "relationship '%s'."),
1191 diplrel_name_translation(preq
->source
.value
.diplrel
));
1194 case REQ_RANGE_LOCAL
:
1195 if (preq
->present
) {
1196 cat_snprintf(buf
, bufsz
,
1197 _("Requires that you have the relationship '%s' with the "
1199 diplrel_name_translation(preq
->source
.value
.diplrel
));
1201 cat_snprintf(buf
, bufsz
,
1202 _("Requires that you do not have the relationship '%s' "
1203 "with the other player."),
1204 diplrel_name_translation(preq
->source
.value
.diplrel
));
1207 case REQ_RANGE_CADJACENT
:
1208 case REQ_RANGE_ADJACENT
:
1209 case REQ_RANGE_CITY
:
1210 case REQ_RANGE_TRADEROUTE
:
1211 case REQ_RANGE_CONTINENT
:
1212 case REQ_RANGE_COUNT
:
1213 /* Not supported. */
1219 switch (preq
->range
) {
1220 case REQ_RANGE_LOCAL
:
1221 if (preq
->present
) {
1222 /* TRANS: %s is a single kind of unit (e.g., "Settlers"). */
1223 cat_snprintf(buf
, bufsz
, Q_("?unit:Requires %s."),
1224 utype_name_translation(preq
->source
.value
.utype
));
1226 /* TRANS: %s is a single kind of unit (e.g., "Settlers"). */
1227 cat_snprintf(buf
, bufsz
, Q_("?unit:Does not apply to %s."),
1228 utype_name_translation(preq
->source
.value
.utype
));
1231 case REQ_RANGE_CADJACENT
:
1232 case REQ_RANGE_ADJACENT
:
1233 case REQ_RANGE_CITY
:
1234 case REQ_RANGE_TRADEROUTE
:
1235 case REQ_RANGE_CONTINENT
:
1236 case REQ_RANGE_PLAYER
:
1237 case REQ_RANGE_TEAM
:
1238 case REQ_RANGE_ALLIANCE
:
1239 case REQ_RANGE_WORLD
:
1240 case REQ_RANGE_COUNT
:
1241 /* Not supported. */
1247 switch (preq
->range
) {
1248 case REQ_RANGE_LOCAL
:
1250 struct astring astr
= ASTRING_INIT
;
1252 /* Unit type flags mean nothing to users. Explicitly list the unit
1253 * types with those flags. */
1254 if (role_units_translations(&astr
, preq
->source
.value
.unitflag
,
1256 if (preq
->present
) {
1257 /* TRANS: %s is a list of unit types separated by "or". */
1258 cat_snprintf(buf
, bufsz
, Q_("?ulist:Requires %s."),
1261 /* TRANS: %s is a list of unit types separated by "or". */
1262 cat_snprintf(buf
, bufsz
, Q_("?ulist:Does not apply to %s."),
1270 case REQ_RANGE_CADJACENT
:
1271 case REQ_RANGE_ADJACENT
:
1272 case REQ_RANGE_CITY
:
1273 case REQ_RANGE_TRADEROUTE
:
1274 case REQ_RANGE_CONTINENT
:
1275 case REQ_RANGE_PLAYER
:
1276 case REQ_RANGE_TEAM
:
1277 case REQ_RANGE_ALLIANCE
:
1278 case REQ_RANGE_WORLD
:
1279 case REQ_RANGE_COUNT
:
1280 /* Not supported. */
1286 switch (preq
->range
) {
1287 case REQ_RANGE_LOCAL
:
1288 if (preq
->present
) {
1289 /* TRANS: %s is a single unit class (e.g., "Air"). */
1290 cat_snprintf(buf
, bufsz
, Q_("?uclass:Requires %s units."),
1291 uclass_name_translation(preq
->source
.value
.uclass
));
1293 /* TRANS: %s is a single unit class (e.g., "Air"). */
1294 cat_snprintf(buf
, bufsz
, Q_("?uclass:Does not apply to %s units."),
1295 uclass_name_translation(preq
->source
.value
.uclass
));
1298 case REQ_RANGE_CADJACENT
:
1299 case REQ_RANGE_ADJACENT
:
1300 case REQ_RANGE_CITY
:
1301 case REQ_RANGE_TRADEROUTE
:
1302 case REQ_RANGE_CONTINENT
:
1303 case REQ_RANGE_PLAYER
:
1304 case REQ_RANGE_TEAM
:
1305 case REQ_RANGE_ALLIANCE
:
1306 case REQ_RANGE_WORLD
:
1307 case REQ_RANGE_COUNT
:
1308 /* Not supported. */
1315 const char *classes
[uclass_count()];
1318 struct astring list
= ASTRING_INIT
;
1320 unit_class_iterate(uclass
) {
1321 if (uclass_has_flag(uclass
, preq
->source
.value
.unitclassflag
)) {
1322 classes
[i
++] = uclass_name_translation(uclass
);
1324 } unit_class_iterate_end
;
1325 astr_build_or_list(&list
, classes
, i
);
1327 switch (preq
->range
) {
1328 case REQ_RANGE_LOCAL
:
1329 if (preq
->present
) {
1330 /* TRANS: %s is a list of unit classes separated by "or". */
1331 cat_snprintf(buf
, bufsz
, Q_("?uclasslist:Requires %s units."),
1334 /* TRANS: %s is a list of unit classes separated by "or". */
1335 cat_snprintf(buf
, bufsz
, Q_("?uclasslist:Does not apply to "
1341 case REQ_RANGE_CADJACENT
:
1342 case REQ_RANGE_ADJACENT
:
1343 case REQ_RANGE_CITY
:
1344 case REQ_RANGE_TRADEROUTE
:
1345 case REQ_RANGE_CONTINENT
:
1346 case REQ_RANGE_PLAYER
:
1347 case REQ_RANGE_TEAM
:
1348 case REQ_RANGE_ALLIANCE
:
1349 case REQ_RANGE_WORLD
:
1350 case REQ_RANGE_COUNT
:
1351 /* Not supported. */
1363 switch (preq
->range
) {
1364 case REQ_RANGE_LOCAL
:
1365 switch (preq
->source
.value
.unit_state
) {
1366 case USP_TRANSPORTED
:
1367 if (preq
->present
) {
1368 cat_snprintf(buf
, bufsz
,
1369 _("Requires that the unit is transported."));
1371 cat_snprintf(buf
, bufsz
,
1372 _("Requires that the unit isn't transported."));
1375 case USP_LIVABLE_TILE
:
1376 if (preq
->present
) {
1377 cat_snprintf(buf
, bufsz
,
1378 _("Requires that the unit is on livable tile."));
1380 cat_snprintf(buf
, bufsz
,
1381 _("Requires that the unit isn't on livable tile."));
1384 case USP_DOMESTIC_TILE
:
1385 if (preq
->present
) {
1386 cat_snprintf(buf
, bufsz
,
1387 _("Requires that the unit is on a domestic "
1390 cat_snprintf(buf
, bufsz
,
1391 _("Requires that the unit isn't on a domestic "
1395 case USP_TRANSPORTING
:
1396 if (preq
->present
) {
1397 cat_snprintf(buf
, bufsz
,
1398 _("Requires that the unit does transport one or "
1399 "more cargo units."));
1401 cat_snprintf(buf
, bufsz
,
1402 _("Requires that the unit doesn't transport "
1403 "any cargo units."));
1406 case USP_HAS_HOME_CITY
:
1407 if (preq
->present
) {
1408 cat_snprintf(buf
, bufsz
,
1409 _("Requires that the unit has a home city."));
1411 cat_snprintf(buf
, bufsz
,
1412 _("Requires that the unit is homeless."));
1415 case USP_NATIVE_TILE
:
1416 if (preq
->present
) {
1417 cat_snprintf(buf
, bufsz
,
1418 _("Requires that the unit is on native tile."));
1420 cat_snprintf(buf
, bufsz
,
1421 _("Requires that the unit isn't on native tile."));
1425 fc_assert_msg(preq
->source
.value
.unit_state
!= USP_COUNT
,
1426 "Invalid unit state property.");
1429 case REQ_RANGE_CADJACENT
:
1430 case REQ_RANGE_ADJACENT
:
1431 case REQ_RANGE_CITY
:
1432 case REQ_RANGE_TRADEROUTE
:
1433 case REQ_RANGE_CONTINENT
:
1434 case REQ_RANGE_PLAYER
:
1435 case REQ_RANGE_TEAM
:
1436 case REQ_RANGE_ALLIANCE
:
1437 case REQ_RANGE_WORLD
:
1438 case REQ_RANGE_COUNT
:
1439 /* Not supported. */
1447 switch (preq
->range
) {
1448 case REQ_RANGE_LOCAL
:
1449 if (preq
->present
) {
1450 cat_snprintf(buf
, bufsz
,
1451 /* %s is numeric move points; it may have a
1452 * fractional part ("1 1/3 MP"). */
1453 _("Requires that the unit has at least %s MP left."),
1454 move_points_text(preq
->source
.value
.minmoves
, TRUE
));
1456 cat_snprintf(buf
, bufsz
,
1457 /* %s is numeric move points; it may have a
1458 * fractional part ("1 1/3 MP"). */
1459 _("Requires that the unit has less than %s MP left."),
1460 move_points_text(preq
->source
.value
.minmoves
, TRUE
));
1463 case REQ_RANGE_CADJACENT
:
1464 case REQ_RANGE_ADJACENT
:
1465 case REQ_RANGE_CITY
:
1466 case REQ_RANGE_TRADEROUTE
:
1467 case REQ_RANGE_CONTINENT
:
1468 case REQ_RANGE_PLAYER
:
1469 case REQ_RANGE_TEAM
:
1470 case REQ_RANGE_ALLIANCE
:
1471 case REQ_RANGE_WORLD
:
1472 case REQ_RANGE_COUNT
:
1473 /* Not supported. */
1479 case VUT_MINVETERAN
:
1480 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1483 /* FIXME: this would be better with veteran level names, but that's
1484 * potentially unit type dependent. */
1485 if (preq
->present
) {
1486 cat_snprintf(buf
, bufsz
,
1487 PL_("Requires a unit with at least %d veteran level.",
1488 "Requires a unit with at least %d veteran levels.",
1489 preq
->source
.value
.minveteran
),
1490 preq
->source
.value
.minveteran
);
1492 cat_snprintf(buf
, bufsz
,
1493 PL_("Requires a unit with fewer than %d veteran level.",
1494 "Requires a unit with fewer than %d veteran levels.",
1495 preq
->source
.value
.minveteran
),
1496 preq
->source
.value
.minveteran
);
1501 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1505 if (preq
->present
) {
1506 cat_snprintf(buf
, bufsz
,
1507 PL_("Requires a unit with at least %d hit point left.",
1508 "Requires a unit with at least %d hit points left.",
1509 preq
->source
.value
.min_hit_points
),
1510 preq
->source
.value
.min_hit_points
);
1512 cat_snprintf(buf
, bufsz
,
1513 PL_("Requires a unit with fewer than %d hit point "
1515 "Requires a unit with fewer than %d hit points "
1517 preq
->source
.value
.min_hit_points
),
1518 preq
->source
.value
.min_hit_points
);
1523 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1526 if (preq
->present
) {
1527 /* TRANS: "Applies only to Food." */
1528 cat_snprintf(buf
, bufsz
, Q_("?output:Applies only to %s."),
1529 get_output_name(preq
->source
.value
.outputtype
));
1531 /* TRANS: "Does not apply to Food." */
1532 cat_snprintf(buf
, bufsz
, Q_("?output:Does not apply to %s."),
1533 get_output_name(preq
->source
.value
.outputtype
));
1537 case VUT_SPECIALIST
:
1538 if (preq
->range
!= REQ_RANGE_LOCAL
) {
1541 if (preq
->present
) {
1542 /* TRANS: "Applies only to Scientists." */
1543 cat_snprintf(buf
, bufsz
, Q_("?specialist:Applies only to %s."),
1544 specialist_plural_translation(preq
->source
.value
.specialist
));
1546 /* TRANS: "Does not apply to Scientists." */
1547 cat_snprintf(buf
, bufsz
, Q_("?specialist:Does not apply to %s."),
1548 specialist_plural_translation(preq
->source
.value
.specialist
));
1553 switch (preq
->range
) {
1554 case REQ_RANGE_TRADEROUTE
:
1555 if (preq
->present
) {
1556 cat_snprintf(buf
, bufsz
,
1557 PL_("Requires a minimum city size of %d for this "
1558 "city or a trade partner.",
1559 "Requires a minimum city size of %d for this "
1560 "city or a trade partner.",
1561 preq
->source
.value
.minsize
),
1562 preq
->source
.value
.minsize
);
1564 cat_snprintf(buf
, bufsz
,
1565 PL_("Requires the city size to be less than %d "
1566 "for this city and all trade partners.",
1567 "Requires the city size to be less than %d "
1568 "for this city and all trade partners.",
1569 preq
->source
.value
.minsize
),
1570 preq
->source
.value
.minsize
);
1573 case REQ_RANGE_CITY
:
1574 if (preq
->present
) {
1575 cat_snprintf(buf
, bufsz
,
1576 PL_("Requires a minimum city size of %d.",
1577 "Requires a minimum city size of %d.",
1578 preq
->source
.value
.minsize
),
1579 preq
->source
.value
.minsize
);
1581 cat_snprintf(buf
, bufsz
,
1582 PL_("Requires the city size to be less than %d.",
1583 "Requires the city size to be less than %d.",
1584 preq
->source
.value
.minsize
),
1585 preq
->source
.value
.minsize
);
1588 case REQ_RANGE_LOCAL
:
1589 case REQ_RANGE_CADJACENT
:
1590 case REQ_RANGE_ADJACENT
:
1591 case REQ_RANGE_CONTINENT
:
1592 case REQ_RANGE_PLAYER
:
1593 case REQ_RANGE_TEAM
:
1594 case REQ_RANGE_ALLIANCE
:
1595 case REQ_RANGE_WORLD
:
1596 case REQ_RANGE_COUNT
:
1597 /* Not supported. */
1601 case VUT_MINCULTURE
:
1602 switch (preq
->range
) {
1603 case REQ_RANGE_CITY
:
1604 if (preq
->present
) {
1605 cat_snprintf(buf
, bufsz
,
1606 PL_("Requires a minimum culture of %d in the city.",
1607 "Requires a minimum culture of %d in the city.",
1608 preq
->source
.value
.minculture
),
1609 preq
->source
.value
.minculture
);
1611 cat_snprintf(buf
, bufsz
,
1612 PL_("Requires the culture in the city to be less "
1614 "Requires the culture in the city to be less "
1616 preq
->source
.value
.minculture
),
1617 preq
->source
.value
.minculture
);
1620 case REQ_RANGE_TRADEROUTE
:
1621 if (preq
->present
) {
1622 cat_snprintf(buf
, bufsz
,
1623 PL_("Requires a minimum culture of %d in this city or "
1625 "Requires a minimum culture of %d in this city or "
1627 preq
->source
.value
.minculture
),
1628 preq
->source
.value
.minculture
);
1630 cat_snprintf(buf
, bufsz
,
1631 PL_("Requires the culture in this city and all trade "
1632 "partners to be less than %d.",
1633 "Requires the culture in this city and all trade "
1634 "partners to be less than %d.",
1635 preq
->source
.value
.minculture
),
1636 preq
->source
.value
.minculture
);
1639 case REQ_RANGE_PLAYER
:
1640 if (preq
->present
) {
1641 cat_snprintf(buf
, bufsz
,
1642 PL_("Requires your nation to have culture "
1644 "Requires your nation to have culture "
1646 preq
->source
.value
.minculture
),
1647 preq
->source
.value
.minculture
);
1649 cat_snprintf(buf
, bufsz
,
1650 PL_("Prevented if your nation has culture of "
1652 "Prevented if your nation has culture of "
1654 preq
->source
.value
.minculture
),
1655 preq
->source
.value
.minculture
);
1658 case REQ_RANGE_TEAM
:
1659 if (preq
->present
) {
1660 cat_snprintf(buf
, bufsz
,
1661 PL_("Requires someone on your team to have culture of "
1663 "Requires someone on your team to have culture of "
1665 preq
->source
.value
.minculture
),
1666 preq
->source
.value
.minculture
);
1668 cat_snprintf(buf
, bufsz
,
1669 PL_("Prevented if anyone on your team has culture of "
1671 "Prevented if anyone on your team has culture of "
1673 preq
->source
.value
.minculture
),
1674 preq
->source
.value
.minculture
);
1677 case REQ_RANGE_ALLIANCE
:
1678 if (preq
->present
) {
1679 cat_snprintf(buf
, bufsz
,
1680 PL_("Requires someone in your current alliance to "
1681 "have culture of at least %d.",
1682 "Requires someone in your current alliance to "
1683 "have culture of at least %d.",
1684 preq
->source
.value
.minculture
),
1685 preq
->source
.value
.minculture
);
1687 cat_snprintf(buf
, bufsz
,
1688 PL_("Prevented if anyone in your current alliance has "
1689 "culture of %d or more.",
1690 "Prevented if anyone in your current alliance has "
1691 "culture of %d or more.",
1692 preq
->source
.value
.minculture
),
1693 preq
->source
.value
.minculture
);
1696 case REQ_RANGE_WORLD
:
1697 if (preq
->present
) {
1698 cat_snprintf(buf
, bufsz
,
1699 PL_("Requires that some player has culture of at "
1701 "Requires that some player has culture of at "
1703 preq
->source
.value
.minculture
),
1704 preq
->source
.value
.minculture
);
1706 cat_snprintf(buf
, bufsz
,
1707 PL_("Requires that no player has culture of %d "
1709 "Requires that no player has culture of %d "
1711 preq
->source
.value
.minculture
),
1712 preq
->source
.value
.minculture
);
1715 case REQ_RANGE_LOCAL
:
1716 case REQ_RANGE_CADJACENT
:
1717 case REQ_RANGE_ADJACENT
:
1718 case REQ_RANGE_CONTINENT
:
1719 case REQ_RANGE_COUNT
:
1724 case VUT_MAXTILEUNITS
:
1725 switch (preq
->range
) {
1726 case REQ_RANGE_LOCAL
:
1727 if (preq
->present
) {
1728 cat_snprintf(buf
, bufsz
,
1729 PL_("At most %d unit may be present on the tile.",
1730 "At most %d units may be present on the tile.",
1731 preq
->source
.value
.max_tile_units
),
1732 preq
->source
.value
.max_tile_units
);
1734 cat_snprintf(buf
, bufsz
,
1735 PL_("There must be more than %d unit present on "
1737 "There must be more than %d units present on "
1739 preq
->source
.value
.max_tile_units
),
1740 preq
->source
.value
.max_tile_units
);
1743 case REQ_RANGE_CADJACENT
:
1744 if (preq
->present
) {
1745 cat_snprintf(buf
, bufsz
,
1746 PL_("The tile or at least one cardinally adjacent tile "
1747 "must have %d unit or fewer.",
1748 "The tile or at least one cardinally adjacent tile "
1749 "must have %d units or fewer.",
1750 preq
->source
.value
.max_tile_units
),
1751 preq
->source
.value
.max_tile_units
);
1753 cat_snprintf(buf
, bufsz
,
1754 PL_("The tile and all cardinally adjacent tiles must "
1755 "have more than %d unit each.",
1756 "The tile and all cardinally adjacent tiles must "
1757 "have more than %d units each.",
1758 preq
->source
.value
.max_tile_units
),
1759 preq
->source
.value
.max_tile_units
);
1762 case REQ_RANGE_ADJACENT
:
1763 if (preq
->present
) {
1764 cat_snprintf(buf
, bufsz
,
1765 PL_("The tile or at least one adjacent tile must have "
1766 "%d unit or fewer.",
1767 "The tile or at least one adjacent tile must have "
1768 "%d units or fewer.",
1769 preq
->source
.value
.max_tile_units
),
1770 preq
->source
.value
.max_tile_units
);
1772 cat_snprintf(buf
, bufsz
,
1773 PL_("The tile and all adjacent tiles must have more "
1774 "than %d unit each.",
1775 "The tile and all adjacent tiles must have more "
1776 "than %d units each.",
1777 preq
->source
.value
.max_tile_units
),
1778 preq
->source
.value
.max_tile_units
);
1781 case REQ_RANGE_CITY
:
1782 case REQ_RANGE_TRADEROUTE
:
1783 case REQ_RANGE_CONTINENT
:
1784 case REQ_RANGE_PLAYER
:
1785 case REQ_RANGE_TEAM
:
1786 case REQ_RANGE_ALLIANCE
:
1787 case REQ_RANGE_WORLD
:
1788 case REQ_RANGE_COUNT
:
1789 /* Not supported. */
1794 if (preq
->range
!= REQ_RANGE_PLAYER
) {
1797 if (preq
->present
) {
1798 cat_snprintf(buf
, bufsz
,
1799 /* TRANS: AI level (e.g., "Handicapped") */
1800 _("Applies to %s AI players."),
1801 ai_level_translated_name(preq
->source
.value
.ai_level
));
1803 cat_snprintf(buf
, bufsz
,
1804 /* TRANS: AI level (e.g., "Cheating") */
1805 _("Does not apply to %s AI players."),
1806 ai_level_translated_name(preq
->source
.value
.ai_level
));
1810 case VUT_TERRAINCLASS
:
1811 switch (preq
->range
) {
1812 case REQ_RANGE_LOCAL
:
1813 if (preq
->present
) {
1814 cat_snprintf(buf
, bufsz
,
1815 /* TRANS: %s is a terrain class */
1816 Q_("?terrainclass:Requires %s terrain on the tile."),
1817 terrain_class_name_translation
1818 (preq
->source
.value
.terrainclass
));
1820 cat_snprintf(buf
, bufsz
,
1821 /* TRANS: %s is a terrain class */
1822 Q_("?terrainclass:Prevented by %s terrain on the tile."),
1823 terrain_class_name_translation
1824 (preq
->source
.value
.terrainclass
));
1827 case REQ_RANGE_CADJACENT
:
1828 if (preq
->present
) {
1829 cat_snprintf(buf
, bufsz
,
1830 /* TRANS: %s is a terrain class */
1831 Q_("?terrainclass:Requires %s terrain on the tile or a "
1832 "cardinally adjacent tile."),
1833 terrain_class_name_translation
1834 (preq
->source
.value
.terrainclass
));
1836 cat_snprintf(buf
, bufsz
,
1837 /* TRANS: %s is a terrain class */
1838 Q_("?terrainclass:Prevented by %s terrain on the tile or "
1839 "any cardinally adjacent tile."),
1840 terrain_class_name_translation
1841 (preq
->source
.value
.terrainclass
));
1844 case REQ_RANGE_ADJACENT
:
1845 if (preq
->present
) {
1846 cat_snprintf(buf
, bufsz
,
1847 /* TRANS: %s is a terrain class */
1848 Q_("?terrainclass:Requires %s terrain on the tile or an "
1850 terrain_class_name_translation
1851 (preq
->source
.value
.terrainclass
));
1853 cat_snprintf(buf
, bufsz
,
1854 /* TRANS: %s is a terrain class */
1855 Q_("?terrainclass:Prevented by %s terrain on the tile or "
1856 "any adjacent tile."),
1857 terrain_class_name_translation
1858 (preq
->source
.value
.terrainclass
));
1861 case REQ_RANGE_CITY
:
1862 if (preq
->present
) {
1863 cat_snprintf(buf
, bufsz
,
1864 /* TRANS: %s is a terrain class */
1865 Q_("?terrainclass:Requires %s terrain on a tile within "
1866 "the city radius."),
1867 terrain_class_name_translation
1868 (preq
->source
.value
.terrainclass
));
1870 cat_snprintf(buf
, bufsz
,
1871 /* TRANS: %s is a terrain class */
1872 Q_("?terrainclass:Prevented by %s terrain on any tile "
1873 "within the city radius."),
1874 terrain_class_name_translation
1875 (preq
->source
.value
.terrainclass
));
1878 case REQ_RANGE_TRADEROUTE
:
1879 if (preq
->present
) {
1880 cat_snprintf(buf
, bufsz
,
1881 /* TRANS: %s is a terrain class */
1882 Q_("?terrainclass:Requires %s terrain on a tile within "
1883 "the city radius or the city radius of a trade "
1885 terrain_class_name_translation
1886 (preq
->source
.value
.terrainclass
));
1888 cat_snprintf(buf
, bufsz
,
1889 /* TRANS: %s is a terrain class */
1890 Q_("?terrainclass:Prevented by %s terrain on any tile "
1891 "within the city radius or the city radius of a trade "
1893 terrain_class_name_translation
1894 (preq
->source
.value
.terrainclass
));
1897 case REQ_RANGE_CONTINENT
:
1898 case REQ_RANGE_PLAYER
:
1899 case REQ_RANGE_TEAM
:
1900 case REQ_RANGE_ALLIANCE
:
1901 case REQ_RANGE_WORLD
:
1902 case REQ_RANGE_COUNT
:
1903 /* Not supported. */
1909 switch (preq
->range
) {
1910 case REQ_RANGE_LOCAL
:
1911 if (preq
->present
) {
1912 cat_snprintf(buf
, bufsz
,
1913 /* TRANS: %s is a (translatable) terrain flag. */
1914 _("Requires terrain with the \"%s\" flag on the tile."),
1915 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1917 cat_snprintf(buf
, bufsz
,
1918 /* TRANS: %s is a (translatable) terrain flag. */
1919 _("Prevented by terrain with the \"%s\" flag on the "
1921 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1924 case REQ_RANGE_CADJACENT
:
1925 if (preq
->present
) {
1926 cat_snprintf(buf
, bufsz
,
1927 /* TRANS: %s is a (translatable) terrain flag. */
1928 _("Requires terrain with the \"%s\" flag on the "
1929 "tile or a cardinally adjacent tile."),
1930 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1932 cat_snprintf(buf
, bufsz
,
1933 /* TRANS: %s is a (translatable) terrain flag. */
1934 _("Prevented by terrain with the \"%s\" flag on "
1935 "the tile or any cardinally adjacent tile."),
1936 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1939 case REQ_RANGE_ADJACENT
:
1940 if (preq
->present
) {
1941 cat_snprintf(buf
, bufsz
,
1942 /* TRANS: %s is a (translatable) terrain flag. */
1943 _("Requires terrain with the \"%s\" flag on the "
1944 "tile or an adjacent tile."),
1945 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1947 cat_snprintf(buf
, bufsz
,
1948 /* TRANS: %s is a (translatable) terrain flag. */
1949 _("Prevented by terrain with the \"%s\" flag on "
1950 "the tile or any adjacent tile."),
1951 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1954 case REQ_RANGE_CITY
:
1955 if (preq
->present
) {
1956 cat_snprintf(buf
, bufsz
,
1957 /* TRANS: %s is a (translatable) terrain flag. */
1958 _("Requires terrain with the \"%s\" flag on a tile "
1959 "within the city radius."),
1960 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1962 cat_snprintf(buf
, bufsz
,
1963 /* TRANS: %s is a (translatable) terrain flag. */
1964 _("Prevented by terrain with the \"%s\" flag on any tile "
1965 "within the city radius."),
1966 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1969 case REQ_RANGE_TRADEROUTE
:
1970 if (preq
->present
) {
1971 cat_snprintf(buf
, bufsz
,
1972 /* TRANS: %s is a (translatable) terrain flag. */
1973 _("Requires terrain with the \"%s\" flag on a tile "
1974 "within the city radius or the city radius of "
1975 "a trade partner."),
1976 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1978 cat_snprintf(buf
, bufsz
,
1979 /* TRANS: %s is a (translatable) terrain flag. */
1980 _("Prevented by terrain with the \"%s\" flag on any tile "
1981 "within the city radius or the city radius of "
1982 "a trade partner."),
1983 terrain_flag_id_translated_name(preq
->source
.value
.terrainflag
));
1986 case REQ_RANGE_CONTINENT
:
1987 case REQ_RANGE_PLAYER
:
1988 case REQ_RANGE_TEAM
:
1989 case REQ_RANGE_ALLIANCE
:
1990 case REQ_RANGE_WORLD
:
1991 case REQ_RANGE_COUNT
:
1992 /* Not supported. */
1998 switch (preq
->range
) {
1999 case REQ_RANGE_LOCAL
:
2000 if (preq
->present
) {
2001 cat_snprintf(buf
, bufsz
,
2002 /* TRANS: %s is a (translatable) base flag. */
2003 _("Requires a base with the \"%s\" flag on the tile."),
2004 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2006 cat_snprintf(buf
, bufsz
,
2007 /* TRANS: %s is a (translatable) base flag. */
2008 _("Prevented by a base with the \"%s\" flag on the "
2010 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2013 case REQ_RANGE_CADJACENT
:
2014 if (preq
->present
) {
2015 cat_snprintf(buf
, bufsz
,
2016 /* TRANS: %s is a (translatable) base flag. */
2017 _("Requires a base with the \"%s\" flag on the "
2018 "tile or a cardinally adjacent tile."),
2019 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2021 cat_snprintf(buf
, bufsz
,
2022 /* TRANS: %s is a (translatable) base flag. */
2023 _("Prevented by a base with the \"%s\" flag on "
2024 "the tile or any cardinally adjacent tile."),
2025 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2028 case REQ_RANGE_ADJACENT
:
2029 if (preq
->present
) {
2030 cat_snprintf(buf
, bufsz
,
2031 /* TRANS: %s is a (translatable) base flag. */
2032 _("Requires a base with the \"%s\" flag on the "
2033 "tile or an adjacent tile."),
2034 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2036 cat_snprintf(buf
, bufsz
,
2037 /* TRANS: %s is a (translatable) base flag. */
2038 _("Prevented by a base with the \"%s\" flag on "
2039 "the tile or any adjacent tile."),
2040 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2043 case REQ_RANGE_CITY
:
2044 if (preq
->present
) {
2045 cat_snprintf(buf
, bufsz
,
2046 /* TRANS: %s is a (translatable) base flag. */
2047 _("Requires a base with the \"%s\" flag on a tile "
2048 "within the city radius."),
2049 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2051 cat_snprintf(buf
, bufsz
,
2052 /* TRANS: %s is a (translatable) base flag. */
2053 _("Prevented by a base with the \"%s\" flag on any tile "
2054 "within the city radius."),
2055 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2058 case REQ_RANGE_TRADEROUTE
:
2059 if (preq
->present
) {
2060 cat_snprintf(buf
, bufsz
,
2061 /* TRANS: %s is a (translatable) base flag. */
2062 _("Requires a base with the \"%s\" flag on a tile "
2063 "within the city radius or the city radius of a "
2065 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2067 cat_snprintf(buf
, bufsz
,
2068 /* TRANS: %s is a (translatable) base flag. */
2069 _("Prevented by a base with the \"%s\" flag on any tile "
2070 "within the city radius or the city radius of a "
2072 base_flag_id_translated_name(preq
->source
.value
.baseflag
));
2075 case REQ_RANGE_CONTINENT
:
2076 case REQ_RANGE_PLAYER
:
2077 case REQ_RANGE_TEAM
:
2078 case REQ_RANGE_ALLIANCE
:
2079 case REQ_RANGE_WORLD
:
2080 case REQ_RANGE_COUNT
:
2081 /* Not supported. */
2087 switch (preq
->range
) {
2088 case REQ_RANGE_LOCAL
:
2089 if (preq
->present
) {
2090 cat_snprintf(buf
, bufsz
,
2091 /* TRANS: %s is a (translatable) road flag. */
2092 _("Requires a road with the \"%s\" flag on the tile."),
2093 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2095 cat_snprintf(buf
, bufsz
,
2096 /* TRANS: %s is a (translatable) road flag. */
2097 _("Prevented by a road with the \"%s\" flag on the "
2099 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2102 case REQ_RANGE_CADJACENT
:
2103 if (preq
->present
) {
2104 cat_snprintf(buf
, bufsz
,
2105 /* TRANS: %s is a (translatable) road flag. */
2106 _("Requires a road with the \"%s\" flag on the "
2107 "tile or a cardinally adjacent tile."),
2108 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2110 cat_snprintf(buf
, bufsz
,
2111 /* TRANS: %s is a (translatable) road flag. */
2112 _("Prevented by a road with the \"%s\" flag on "
2113 "the tile or any cardinally adjacent tile."),
2114 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2117 case REQ_RANGE_ADJACENT
:
2118 if (preq
->present
) {
2119 cat_snprintf(buf
, bufsz
,
2120 /* TRANS: %s is a (translatable) road flag. */
2121 _("Requires a road with the \"%s\" flag on the "
2122 "tile or an adjacent tile."),
2123 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2125 cat_snprintf(buf
, bufsz
,
2126 /* TRANS: %s is a (translatable) road flag. */
2127 _("Prevented by a road with the \"%s\" flag on "
2128 "the tile or any adjacent tile."),
2129 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2132 case REQ_RANGE_CITY
:
2133 if (preq
->present
) {
2134 cat_snprintf(buf
, bufsz
,
2135 /* TRANS: %s is a (translatable) road flag. */
2136 _("Requires a road with the \"%s\" flag on a tile "
2137 "within the city radius."),
2138 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2140 cat_snprintf(buf
, bufsz
,
2141 /* TRANS: %s is a (translatable) road flag. */
2142 _("Prevented by a road with the \"%s\" flag on any tile "
2143 "within the city radius."),
2144 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2147 case REQ_RANGE_TRADEROUTE
:
2148 if (preq
->present
) {
2149 cat_snprintf(buf
, bufsz
,
2150 /* TRANS: %s is a (translatable) road flag. */
2151 _("Requires a road with the \"%s\" flag on a tile "
2152 "within the city radius or the city radius of a "
2154 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2156 cat_snprintf(buf
, bufsz
,
2157 /* TRANS: %s is a (translatable) road flag. */
2158 _("Prevented by a road with the \"%s\" flag on any tile "
2159 "within the city radius or the city radius of a "
2161 road_flag_id_translated_name(preq
->source
.value
.roadflag
));
2164 case REQ_RANGE_CONTINENT
:
2165 case REQ_RANGE_PLAYER
:
2166 case REQ_RANGE_TEAM
:
2167 case REQ_RANGE_ALLIANCE
:
2168 case REQ_RANGE_WORLD
:
2169 case REQ_RANGE_COUNT
:
2170 /* Not supported. */
2176 switch (preq
->range
) {
2177 case REQ_RANGE_LOCAL
:
2178 if (preq
->present
) {
2179 cat_snprintf(buf
, bufsz
,
2180 /* TRANS: %s is a (translatable) extra flag. */
2181 _("Requires an extra with the \"%s\" flag on the tile."),
2182 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2184 cat_snprintf(buf
, bufsz
,
2185 /* TRANS: %s is a (translatable) extra flag. */
2186 _("Prevented by an extra with the \"%s\" flag on the "
2188 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2191 case REQ_RANGE_CADJACENT
:
2192 if (preq
->present
) {
2193 cat_snprintf(buf
, bufsz
,
2194 /* TRANS: %s is a (translatable) extra flag. */
2195 _("Requires an extra with the \"%s\" flag on the "
2196 "tile or a cardinally adjacent tile."),
2197 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2199 cat_snprintf(buf
, bufsz
,
2200 /* TRANS: %s is a (translatable) extra flag. */
2201 _("Prevented by an extra with the \"%s\" flag on "
2202 "the tile or any cardinally adjacent tile."),
2203 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2206 case REQ_RANGE_ADJACENT
:
2207 if (preq
->present
) {
2208 cat_snprintf(buf
, bufsz
,
2209 /* TRANS: %s is a (translatable) extra flag. */
2210 _("Requires an extra with the \"%s\" flag on the "
2211 "tile or an adjacent tile."),
2212 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2214 cat_snprintf(buf
, bufsz
,
2215 /* TRANS: %s is a (translatable) extra flag. */
2216 _("Prevented by an extra with the \"%s\" flag on "
2217 "the tile or any adjacent tile."),
2218 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2221 case REQ_RANGE_CITY
:
2222 if (preq
->present
) {
2223 cat_snprintf(buf
, bufsz
,
2224 /* TRANS: %s is a (translatable) extra flag. */
2225 _("Requires an extra with the \"%s\" flag on a tile "
2226 "within the city radius."),
2227 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2229 cat_snprintf(buf
, bufsz
,
2230 /* TRANS: %s is a (translatable) extra flag. */
2231 _("Prevented by an extra with the \"%s\" flag on any tile "
2232 "within the city radius."),
2233 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2236 case REQ_RANGE_TRADEROUTE
:
2237 if (preq
->present
) {
2238 cat_snprintf(buf
, bufsz
,
2239 /* TRANS: %s is a (translatable) extra flag. */
2240 _("Requires an extra with the \"%s\" flag on a tile "
2241 "within the city radius or the city radius of a "
2243 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2245 cat_snprintf(buf
, bufsz
,
2246 /* TRANS: %s is a (translatable) extra flag. */
2247 _("Prevented by an extra with the \"%s\" flag on any tile "
2248 "within the city radius or the city radius of a "
2250 extra_flag_id_translated_name(preq
->source
.value
.extraflag
));
2253 case REQ_RANGE_CONTINENT
:
2254 case REQ_RANGE_PLAYER
:
2255 case REQ_RANGE_TEAM
:
2256 case REQ_RANGE_ALLIANCE
:
2257 case REQ_RANGE_WORLD
:
2258 case REQ_RANGE_COUNT
:
2259 /* Not supported. */
2265 if (preq
->range
!= REQ_RANGE_WORLD
) {
2268 if (preq
->present
) {
2269 cat_snprintf(buf
, bufsz
,
2270 _("Requires the game to have reached the year %s."),
2271 textyear(preq
->source
.value
.minyear
));
2273 cat_snprintf(buf
, bufsz
,
2274 _("Requires that the game has not yet reached the "
2276 textyear(preq
->source
.value
.minyear
));
2280 case VUT_MINCALFRAG
:
2281 if (preq
->range
!= REQ_RANGE_WORLD
) {
2284 if (preq
->present
) {
2285 cat_snprintf(buf
, bufsz
,
2286 /* TRANS: %s is a representation of a calendar fragment,
2287 * from the ruleset. May be a bare number. */
2288 _("Requires the game to have reached %s."),
2289 textcalfrag(preq
->source
.value
.mincalfrag
));
2291 cat_snprintf(buf
, bufsz
,
2292 /* TRANS: %s is a representation of a calendar fragment,
2293 * from the ruleset. May be a bare number. */
2294 _("Requires that the game has not yet reached %s."),
2295 textcalfrag(preq
->source
.value
.mincalfrag
));
2300 if (preq
->range
!= REQ_RANGE_WORLD
) {
2303 if (preq
->present
) {
2304 cat_snprintf(buf
, bufsz
,
2305 _("Requires %s map."),
2306 _(topo_flag_name(preq
->source
.value
.topo_property
)));
2308 cat_snprintf(buf
, bufsz
,
2309 _("Prevented on %s map."),
2310 _(topo_flag_name(preq
->source
.value
.topo_property
)));
2315 if (preq
->present
) {
2316 cat_snprintf(buf
, bufsz
,
2317 _("Requires age of %d turns."),
2318 preq
->source
.value
.age
);
2320 cat_snprintf(buf
, bufsz
,
2321 _("Prevented if age is over %d turns."),
2322 preq
->source
.value
.age
);
2327 switch (preq
->range
) {
2328 case REQ_RANGE_WORLD
:
2329 if (preq
->present
) {
2330 cat_snprintf(buf
, bufsz
,
2331 _("Requires %d techs to be known in the world."),
2332 preq
->source
.value
.min_techs
);
2334 cat_snprintf(buf
, bufsz
,
2335 _("Prevented when %d techs are known in the world."),
2336 preq
->source
.value
.min_techs
);
2339 case REQ_RANGE_PLAYER
:
2340 if (preq
->present
) {
2341 cat_snprintf(buf
, bufsz
,
2342 _("Requires player to know %d techs."),
2343 preq
->source
.value
.min_techs
);
2345 cat_snprintf(buf
, bufsz
,
2346 _("Prevented when player knows %d techs."),
2347 preq
->source
.value
.min_techs
);
2350 case REQ_RANGE_LOCAL
:
2351 case REQ_RANGE_CADJACENT
:
2352 case REQ_RANGE_ADJACENT
:
2353 case REQ_RANGE_CITY
:
2354 case REQ_RANGE_TRADEROUTE
:
2355 case REQ_RANGE_CONTINENT
:
2356 case REQ_RANGE_TEAM
:
2357 case REQ_RANGE_ALLIANCE
:
2358 case REQ_RANGE_COUNT
:
2359 /* Not supported. */
2364 case VUT_TERRAINALTER
:
2365 switch (preq
->range
) {
2366 case REQ_RANGE_LOCAL
:
2367 if (preq
->present
) {
2368 cat_snprintf(buf
, bufsz
,
2369 _("Requires terrain on which alteration %s is "
2371 Q_(terrain_alteration_name(preq
->source
.value
.terrainalter
)));
2373 cat_snprintf(buf
, bufsz
,
2374 _("Prevented by terrain on which alteration %s "
2376 Q_(terrain_alteration_name(preq
->source
.value
.terrainalter
)));
2379 case REQ_RANGE_CADJACENT
:
2380 case REQ_RANGE_ADJACENT
:
2381 case REQ_RANGE_CITY
:
2382 case REQ_RANGE_TRADEROUTE
:
2383 case REQ_RANGE_CONTINENT
:
2384 case REQ_RANGE_PLAYER
:
2385 case REQ_RANGE_TEAM
:
2386 case REQ_RANGE_ALLIANCE
:
2387 case REQ_RANGE_WORLD
:
2388 case REQ_RANGE_COUNT
:
2389 /* Not supported. */
2395 if (preq
->source
.value
.citytile
== CITYT_LAST
) {
2398 static char *tile_property
= NULL
;
2400 switch (preq
->source
.value
.citytile
) {
2402 tile_property
= "city centers";
2405 tile_property
= "claimed tiles";
2408 fc_assert(preq
->source
.value
.citytile
!= CITYT_LAST
);
2412 switch (preq
->range
) {
2413 case REQ_RANGE_LOCAL
:
2414 if (preq
->present
) {
2415 cat_snprintf(buf
, bufsz
,
2416 /* TRANS: tile property ("city centers", etc) */
2417 Q_("?tileprop:Applies only to %s."), tile_property
);
2419 cat_snprintf(buf
, bufsz
,
2420 /* TRANS: tile property ("city centers", etc) */
2421 Q_("?tileprop:Does not apply to %s."), tile_property
);
2424 case REQ_RANGE_CADJACENT
:
2425 if (preq
->present
) {
2426 /* TRANS: tile property ("city centers", etc) */
2427 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Applies only to %s and "
2428 "cardinally adjacent tiles."),
2431 /* TRANS: tile property ("city centers", etc) */
2432 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Does not apply to %s or "
2433 "cardinally adjacent tiles."),
2437 case REQ_RANGE_ADJACENT
:
2438 if (preq
->present
) {
2439 /* TRANS: tile property ("city centers", etc) */
2440 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Applies only to %s and "
2441 "adjacent tiles."), tile_property
);
2443 /* TRANS: tile property ("city centers", etc) */
2444 cat_snprintf(buf
, bufsz
, Q_("?tileprop:Does not apply to %s or "
2445 "adjacent tiles."), tile_property
);
2448 case REQ_RANGE_CITY
:
2449 case REQ_RANGE_TRADEROUTE
:
2450 case REQ_RANGE_CONTINENT
:
2451 case REQ_RANGE_PLAYER
:
2452 case REQ_RANGE_TEAM
:
2453 case REQ_RANGE_ALLIANCE
:
2454 case REQ_RANGE_WORLD
:
2455 case REQ_RANGE_COUNT
:
2456 /* Not supported. */
2465 if (verb
== VERB_DEFAULT
) {
2468 log_error("%s requirement %s in range %d is not supported in reqtext.c.",
2469 preq
->present
? "Present" : "Absent",
2470 universal_name_translation(&preq
->source
, text
, sizeof(text
)),
2477 /****************************************************************
2478 Append text for the requirement. Added line ends to a newline.
2479 *****************************************************************/
2480 bool req_text_insert_nl(char *buf
, size_t bufsz
, struct player
*pplayer
,
2481 const struct requirement
*preq
,
2482 enum rt_verbosity verb
)
2484 if (req_text_insert(buf
, bufsz
, pplayer
, preq
, verb
)) {
2485 fc_strlcat(buf
, "\n", bufsz
);