66 #define SPECVEC_TAG obligatory_req
67 #define SPECVEC_TYPE struct obligatory_req
69 #define obligatory_req_vector_iterate(obreq_vec, pobreq) \
70 TYPED_VECTOR_ITERATE(struct obligatory_req, obreq_vec, pobreq)
71 #define obligatory_req_vector_iterate_end VECTOR_ITERATE_END
81 #define ACTPROB_VAL_MIN 0
83 #define ACTPROB_VAL_MAX 200
85 #define ACTPROB_VAL_1_PCT (ACTPROB_VAL_MAX / 100)
87 #define ACTPROB_VAL_NA 253
89 #define ACTPROB_VAL_NOT_IMPL 254
95 static struct action_enabler_list
112 const struct city *actor_city,
const struct impr_type *actor_building,
113 const struct tile *actor_tile,
const struct unit *actor_unit,
117 const struct player *target_player,
const struct city *target_city,
118 const struct impr_type *target_building,
const struct tile *target_tile,
119 const struct unit *target_unit,
const struct unit_type *target_unittype,
130 action_range_can_not_cover_the_whole_map);
157 bool is_target = va_arg(args,
int);
159 out->alternative[i].req = contradiction;
160 out->alternative[i].is_target = is_target;
175 if (contra->
users < 1) {
191 const char *error_message, va_list args)
194 enum action_result res;
206 while (ACTRES_NONE != (res = action_result(va_arg(args,
int)))) {
210 "Invalid action result %d", res);
229 const char *error_message, ...)
235 va_start(args, error_message);
249 const char *error_message, ...)
259 va_start(args, error_message);
281 N_(
"All action enablers for %s must require a "
283 ACTRES_ESTABLISH_EMBASSY, ACTRES_SPY_INVESTIGATE_CITY,
284 ACTRES_SPY_STEAL_GOLD, ACTRES_STEAL_MAPS, ACTRES_SPY_STEAL_TECH,
285 ACTRES_SPY_TARGETED_STEAL_TECH, ACTRES_SPY_INCITE_CITY,
286 ACTRES_SPY_BRIBE_UNIT, ACTRES_CAPTURE_UNITS, ACTRES_CONQUER_CITY,
296 DRO_HAS_REAL_EMBASSY),
298 N_(
"All action enablers for %s must require the"
299 " absence of a real embassy."),
300 ACTRES_ESTABLISH_EMBASSY, ACTRES_NONE);
308 N_(
"All action enablers for %s must require that"
309 " the actor unit isn't already fortified."),
310 ACTRES_FORTIFY, ACTRES_NONE);
321 false,
false,
true, DS_WAR),
323 N_(
"All action enablers for %s must require"
324 " a target the actor is at war with."),
325 ACTRES_BOMBARD, ACTRES_ATTACK, ACTRES_NONE);
330 false,
true,
true, DRO_FOREIGN),
332 N_(
"All action enablers for %s must require"
333 " a domestic target."),
334 ACTRES_UPGRADE_UNIT, ACTRES_NONE);
339 false,
true,
true, DS_ARMISTICE),
341 N_(
"All action enablers for %s must require"
342 " a domestic or allied target."),
343 ACTRES_TRANSPORT_EMBARK, ACTRES_TRANSPORT_BOARD,
346 false,
true,
true, DS_WAR),
348 N_(
"All action enablers for %s must require"
349 " a domestic or allied target."),
350 ACTRES_TRANSPORT_EMBARK, ACTRES_TRANSPORT_BOARD,
353 false,
true,
true, DS_CEASEFIRE),
355 N_(
"All action enablers for %s must require"
356 " a domestic or allied target."),
357 ACTRES_TRANSPORT_EMBARK, ACTRES_TRANSPORT_BOARD,
360 false,
true,
true, DS_PEACE),
362 N_(
"All action enablers for %s must require"
363 " a domestic or allied target."),
364 ACTRES_TRANSPORT_EMBARK, ACTRES_TRANSPORT_BOARD,
367 false,
true,
true, DS_NO_CONTACT),
369 N_(
"All action enablers for %s must require"
370 " a domestic or allied target."),
371 ACTRES_TRANSPORT_EMBARK, ACTRES_TRANSPORT_BOARD,
380 N_(
"All action enablers for %s must require"
381 " that the actor has"
382 " the Settlers utype flag."),
383 ACTRES_TRANSFORM_TERRAIN, ACTRES_CULTIVATE, ACTRES_PLANT, ACTRES_ROAD,
384 ACTRES_BASE, ACTRES_MINE, ACTRES_IRRIGATE, ACTRES_CLEAN_POLLUTION,
385 ACTRES_CLEAN_FALLOUT, ACTRES_NONE);
390 false,
true,
true, TER_NO_CITIES),
392 N_(
"All action enablers for %s must require that"
393 " the target doesn't has"
394 " the NoCities terrain flag."),
395 ACTRES_FOUND_CITY, ACTRES_NONE);
404 N_(
"All action enablers for %s must require"
405 " that the actor has a home city."),
406 ACTRES_TRADE_ROUTE, ACTRES_MARKETPLACE, ACTRES_NONE);
412 true,
true, UTYF_NOHOME),
414 N_(
"All action enablers for %s must require"
415 " that the actor doesn't have"
416 " the NoHome utype flag."),
417 ACTRES_HOME_CITY, ACTRES_NONE);
424 false,
true, UTYF_CIVILIAN),
427 true,
true, DS_PEACE),
430 false,
true,
true, CITYT_CLAIMED),
433 N_(
"All action enablers for %s must require"
434 " that the actor has the NonMil utype flag"
435 " or that the target tile is unclaimed"
436 " or that the diplomatic relation to"
437 " the target tile owner isn't peace."),
438 ACTRES_PARADROP, ACTRES_NONE);
444 true,
true, UTYF_CIVILIAN),
446 N_(
"All action enablers for %s must require"
447 " that the actor doesn't have"
448 " the NonMil utype flag."),
449 ACTRES_ATTACK, ACTRES_CONQUER_CITY, ACTRES_NONE);
454 false,
true, UCF_CAN_OCCUPY_CITY),
456 N_(
"All action enablers for %s must require"
457 " that the actor has"
458 " the CanOccupyCity uclass flag."),
459 ACTRES_CONQUER_CITY, ACTRES_NONE);
465 false,
false,
true, DS_WAR),
467 N_(
"All action enablers for %s must require"
468 " that the actor is at war with the target."),
469 ACTRES_CONQUER_CITY, ACTRES_NONE);
477 N_(
"All action enablers for %s must require"
478 " that the actor has a movement point left."),
479 ACTRES_CONQUER_CITY, ACTRES_TRANSPORT_DISEMBARK,
480 ACTRES_TRANSPORT_EMBARK, ACTRES_NONE);
499 false,
false,
true, 0),
501 N_(
"All action enablers for %s must require"
502 " that the target city is empty."),
503 ACTRES_CONQUER_CITY, ACTRES_NONE);
513 N_(
"All action enablers for %s must require"
514 " that the actor isn't transporting"
516 ACTRES_PARADROP, ACTRES_AIRLIFT, ACTRES_NONE);
523 N_(
"All action enablers for %s must require"
524 " that the target isn't transporting another"
526 ACTRES_CAPTURE_UNITS, ACTRES_NONE);
533 N_(
"All action enablers for %s must require"
534 " that the target is transporting a unit."),
535 ACTRES_TRANSPORT_ALIGHT, ACTRES_NONE);
540 N_(
"All action enablers for %s must require"
541 " that the actor is transported."),
542 ACTRES_TRANSPORT_ALIGHT, ACTRES_TRANSPORT_DISEMBARK, ACTRES_NONE);
547 N_(
"All action enablers for %s must require"
548 " that the actor is on a livable tile."),
549 ACTRES_TRANSPORT_ALIGHT, ACTRES_NONE);
556 N_(
"All action enablers for %s must require"
557 " that the actor is transporting a unit."),
558 ACTRES_TRANSPORT_UNLOAD, ACTRES_NONE);
563 N_(
"All action enablers for %s must require"
564 " that the target is transported."),
565 ACTRES_TRANSPORT_UNLOAD, ACTRES_NONE);
570 N_(
"All action enablers for %s must require"
571 " that the target is on a livable tile."),
572 ACTRES_TRANSPORT_UNLOAD, ACTRES_NONE);
576 false,
false,
true, CITYT_CENTER),
578 N_(
"All action enablers for %s must require"
579 " that the actor unit is in a city."),
580 ACTRES_AIRLIFT, ACTRES_NONE);
591 for (
const auto &pnation :
nations) {
597 N_(
"All action enablers for %s must require"
598 " a non animal player actor."),
599 ACTRES_CONQUER_CITY, ACTRES_NONE);
610 ACTION_SPY_POISON, ACTRES_SPY_POISON, ATK_CITY, ASTK_NONE,
611 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
613 ACTION_SPY_POISON_ESC, ACTRES_SPY_POISON, ATK_CITY, ASTK_NONE,
614 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
616 ACTION_SPY_SABOTAGE_UNIT, ACTRES_SPY_SABOTAGE_UNIT, ATK_UNIT,
617 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
619 ACTION_SPY_SABOTAGE_UNIT_ESC, ACTRES_SPY_SABOTAGE_UNIT, ATK_UNIT,
620 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
621 actions[ACTION_SPY_BRIBE_UNIT] =
622 unit_action_new(ACTION_SPY_BRIBE_UNIT, ACTRES_SPY_BRIBE_UNIT, ATK_UNIT,
623 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true,
627 MAK_FORCED, 0, 1,
false);
629 ACTION_SPY_SABOTAGE_CITY, ACTRES_SPY_SABOTAGE_CITY, ATK_CITY,
630 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
632 ACTION_SPY_SABOTAGE_CITY_ESC, ACTRES_SPY_SABOTAGE_CITY, ATK_CITY,
633 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
635 ACTION_SPY_TARGETED_SABOTAGE_CITY, ACTRES_SPY_TARGETED_SABOTAGE_CITY,
636 ATK_CITY, ASTK_BUILDING, ACT_TGT_COMPL_MANDATORY,
false,
true,
637 MAK_ESCAPE, 0, 1,
true);
639 ACTION_SPY_SABOTAGE_CITY_PRODUCTION,
640 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION, ATK_CITY, ASTK_NONE,
641 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
643 ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC,
644 ACTRES_SPY_TARGETED_SABOTAGE_CITY, ATK_CITY, ASTK_BUILDING,
645 ACT_TGT_COMPL_MANDATORY,
false,
true, MAK_ESCAPE, 0, 1,
false);
647 ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC,
648 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION, ATK_CITY, ASTK_NONE,
649 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
651 ACTION_SPY_INCITE_CITY, ACTRES_SPY_INCITE_CITY, ATK_CITY, ASTK_NONE,
652 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
654 ACTION_SPY_INCITE_CITY_ESC, ACTRES_SPY_INCITE_CITY, ATK_CITY,
655 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
657 ACTION_ESTABLISH_EMBASSY, ACTRES_ESTABLISH_EMBASSY, ATK_CITY,
658 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
660 ACTION_ESTABLISH_EMBASSY_STAY, ACTRES_ESTABLISH_EMBASSY, ATK_CITY,
661 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
663 ACTION_SPY_STEAL_TECH, ACTRES_SPY_STEAL_TECH, ATK_CITY, ASTK_NONE,
664 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
666 ACTION_SPY_STEAL_TECH_ESC, ACTRES_SPY_STEAL_TECH, ATK_CITY, ASTK_NONE,
667 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
669 ACTION_SPY_TARGETED_STEAL_TECH, ACTRES_SPY_TARGETED_STEAL_TECH,
670 ATK_CITY, ASTK_TECH, ACT_TGT_COMPL_MANDATORY,
false,
true, MAK_ESCAPE,
673 ACTION_SPY_TARGETED_STEAL_TECH_ESC, ACTRES_SPY_TARGETED_STEAL_TECH,
674 ATK_CITY, ASTK_TECH, ACT_TGT_COMPL_MANDATORY,
false,
true, MAK_ESCAPE,
677 ACTION_SPY_INVESTIGATE_CITY, ACTRES_SPY_INVESTIGATE_CITY, ATK_CITY,
678 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
680 ACTION_INV_CITY_SPEND, ACTRES_SPY_INVESTIGATE_CITY, ATK_CITY,
681 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
683 ACTION_SPY_STEAL_GOLD, ACTRES_SPY_STEAL_GOLD, ATK_CITY, ASTK_NONE,
684 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
686 ACTION_SPY_STEAL_GOLD_ESC, ACTRES_SPY_STEAL_GOLD, ATK_CITY, ASTK_NONE,
687 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
689 ACTION_SPY_SPREAD_PLAGUE, ACTRES_SPY_SPREAD_PLAGUE, ATK_CITY,
690 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
692 ACTION_TRADE_ROUTE, ACTRES_TRADE_ROUTE, ATK_CITY, ASTK_NONE,
693 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS, 0, 1,
true);
695 ACTION_MARKETPLACE, ACTRES_MARKETPLACE, ATK_CITY, ASTK_NONE,
696 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS, 0, 1,
true);
698 ACTION_HELP_WONDER, ACTRES_HELP_WONDER, ATK_CITY, ASTK_NONE,
699 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS, 0, 1,
true);
701 ACTION_CAPTURE_UNITS, ACTRES_CAPTURE_UNITS, ATK_UNITS, ASTK_NONE,
702 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS,
709 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS,
716 ACTION_JOIN_CITY, ACTRES_JOIN_CITY, ATK_CITY, ASTK_NONE,
717 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS, 0, 1,
true);
719 ACTION_STEAL_MAPS, ACTRES_STEAL_MAPS, ATK_CITY, ASTK_NONE,
720 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
722 ACTION_STEAL_MAPS_ESC, ACTRES_STEAL_MAPS, ATK_CITY, ASTK_NONE,
723 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
725 ACTION_BOMBARD, ACTRES_BOMBARD,
727 ATK_UNITS, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS,
735 ACTION_BOMBARD2, ACTRES_BOMBARD,
737 ATK_UNITS, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS,
745 ACTION_BOMBARD3, ACTRES_BOMBARD,
747 ATK_UNITS, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS,
755 ACTION_SPY_NUKE, ACTRES_SPY_NUKE, ATK_CITY, ASTK_NONE,
756 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
true);
758 ACTION_SPY_NUKE_ESC, ACTRES_SPY_NUKE, ATK_CITY, ASTK_NONE,
759 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_ESCAPE, 0, 1,
false);
762 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS, 0,
767 ACTION_NUKE_CITY, ACTRES_NUKE_CITY, ATK_CITY, ASTK_NONE,
768 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS, 1, 1,
true);
770 ACTION_NUKE_UNITS, ACTRES_NUKE_UNITS, ATK_UNITS, ASTK_NONE,
771 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS, 1, 1,
true);
773 ACTION_DESTROY_CITY, ACTRES_DESTROY_CITY, ATK_CITY, ASTK_NONE,
774 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS, 0, 1,
false);
776 ACTION_EXPEL_UNIT, ACTRES_EXPEL_UNIT, ATK_UNIT, ASTK_NONE,
777 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS, 0, 1,
false);
780 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS,
789 ACTRES_DISBAND_UNIT, ATK_SELF, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
true,
790 true, MAK_STAYS, 0, 0,
true);
793 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
true,
false,
796 MAK_STAYS, 0, 0,
false);
799 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_STAYS,
805 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_TELEPORT, 1,
811 ACT_TGT_COMPL_SIMPLE,
true,
true, MAK_TELEPORT, 1,
815 ACTION_ATTACK, ACTRES_ATTACK,
820 ATK_UNITS, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true,
824 MAK_FORCED, 1, 1,
false);
825 actions[ACTION_SUICIDE_ATTACK] =
831 ATK_UNITS, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
832 true, MAK_FORCED, 1, 1,
true);
833 actions[ACTION_STRIKE_BUILDING] =
835 ATK_CITY, ASTK_BUILDING, ACT_TGT_COMPL_MANDATORY,
836 false,
false, MAK_STAYS, 1, 1,
false);
838 ACTION_STRIKE_PRODUCTION, ACTRES_STRIKE_PRODUCTION, ATK_CITY,
839 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
false, MAK_STAYS, 1, 1,
false);
841 ACTION_CONQUER_CITY, ACTRES_CONQUER_CITY, ATK_CITY, ASTK_NONE,
842 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_REGULAR, 1, 1,
false);
844 ACTION_CONQUER_CITY2, ACTRES_CONQUER_CITY, ATK_CITY, ASTK_NONE,
845 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_REGULAR, 1, 1,
false);
847 ACTION_HEAL_UNIT, ACTRES_HEAL_UNIT, ATK_UNIT, ASTK_NONE,
848 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS, 0, 1,
false);
850 ACTION_TRANSFORM_TERRAIN, ACTRES_TRANSFORM_TERRAIN, ATK_TILE,
851 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
853 ACTION_CULTIVATE, ACTRES_CULTIVATE, ATK_TILE, ASTK_NONE,
854 ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
856 ACTION_PLANT, ACTRES_PLANT, ATK_TILE, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
857 true,
false, MAK_STAYS, 0, 0,
false);
859 ACTION_PILLAGE, ACTRES_PILLAGE, ATK_TILE, ASTK_EXTRA,
860 ACT_TGT_COMPL_FLEXIBLE,
true,
false, MAK_STAYS, 0, 0,
false);
862 ACTION_CLEAN_POLLUTION, ACTRES_CLEAN_POLLUTION, ATK_TILE, ASTK_EXTRA,
863 ACT_TGT_COMPL_FLEXIBLE,
true,
false, MAK_STAYS, 0, 0,
false);
865 ACTION_CLEAN_FALLOUT, ACTRES_CLEAN_FALLOUT, ATK_TILE, ASTK_EXTRA,
866 ACT_TGT_COMPL_FLEXIBLE,
true,
false, MAK_STAYS, 0, 0,
false);
868 ACTION_FORTIFY, ACTRES_FORTIFY, ATK_SELF, ASTK_NONE,
869 ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
871 ACTION_ROAD, ACTRES_ROAD, ATK_TILE, ASTK_EXTRA_NOT_THERE,
872 ACT_TGT_COMPL_MANDATORY,
true,
false, MAK_STAYS, 0, 0,
false);
874 ACTION_CONVERT, ACTRES_CONVERT, ATK_SELF, ASTK_NONE,
875 ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
877 ACTION_BASE, ACTRES_BASE, ATK_TILE, ASTK_EXTRA_NOT_THERE,
878 ACT_TGT_COMPL_MANDATORY,
true,
false, MAK_STAYS, 0, 0,
false);
880 ACTION_MINE, ACTRES_MINE, ATK_TILE, ASTK_EXTRA_NOT_THERE,
881 ACT_TGT_COMPL_MANDATORY,
true,
false, MAK_STAYS, 0, 0,
false);
883 ACTION_IRRIGATE, ACTRES_IRRIGATE, ATK_TILE, ASTK_EXTRA_NOT_THERE,
884 ACT_TGT_COMPL_MANDATORY,
true,
false, MAK_STAYS, 0, 0,
false);
886 ACTION_TRANSPORT_ALIGHT, ACTRES_TRANSPORT_ALIGHT, ATK_UNIT, ASTK_NONE,
887 ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
889 ACTION_TRANSPORT_BOARD, ACTRES_TRANSPORT_BOARD, ATK_UNIT, ASTK_NONE,
890 ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
892 ACTION_TRANSPORT_UNLOAD, ACTRES_TRANSPORT_UNLOAD, ATK_UNIT, ASTK_NONE,
893 ACT_TGT_COMPL_SIMPLE,
true,
false, MAK_STAYS, 0, 0,
false);
895 ACTION_TRANSPORT_DISEMBARK1, ACTRES_TRANSPORT_DISEMBARK, ATK_TILE,
896 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_REGULAR, 1, 1,
899 ACTION_TRANSPORT_DISEMBARK2, ACTRES_TRANSPORT_DISEMBARK, ATK_TILE,
900 ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_REGULAR, 1, 1,
903 ACTION_TRANSPORT_EMBARK, ACTRES_TRANSPORT_EMBARK, ATK_UNIT, ASTK_NONE,
904 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_REGULAR, 1, 1,
false);
906 ACTION_SPY_ATTACK, ACTRES_SPY_ATTACK, ATK_UNITS, ASTK_NONE,
907 ACT_TGT_COMPL_SIMPLE,
false,
true, MAK_STAYS, 1, 1,
false);
911 ATK_CITY, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true,
918 ATK_CITY, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true,
925 ATK_CITY, ASTK_NONE, ACT_TGT_COMPL_SIMPLE,
false,
true,
952 for (i = 0; i < ACTRES_NONE; i++) {
1017 for (i = 0; i < ACTRES_NONE; i++) {
1046 if (
actions[act]->ui_name[0] ==
'\0') {
1066 enum act_tgt_compl tgt_compl,
1086 && tgt_compl != ACT_TGT_COMPL_SIMPLE)),
1087 "%s contradicts itself regarding sub targets.",
1141 return gen_action_is_valid(gen_action(act_id)) &&
actions[act_id];
1154 qDebug(
"Asked for non existing action numbered %d", act_id);
1177 qDebug(
"Asked for non existing action named %s",
name);
1208 enum action_sub_target_kind
1223 return ABK_STANDARD;
1224 case ACTRES_SPY_ATTACK:
1225 case ACTRES_SPY_POISON:
1226 case ACTRES_SPY_STEAL_GOLD:
1227 case ACTRES_SPY_SABOTAGE_CITY:
1228 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
1229 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
1230 case ACTRES_SPY_STEAL_TECH:
1231 case ACTRES_SPY_TARGETED_STEAL_TECH:
1232 case ACTRES_SPY_INCITE_CITY:
1233 case ACTRES_SPY_BRIBE_UNIT:
1234 case ACTRES_SPY_SABOTAGE_UNIT:
1235 case ACTRES_STEAL_MAPS:
1236 case ACTRES_SPY_NUKE:
1237 case ACTRES_SPY_SPREAD_PLAGUE:
1238 return ABK_DIPLOMATIC;
1249 enum action_result
result)
1293 "Action %d don't exist.", act_id);
1327 const struct action *blocker)
1366 return gen_action_name(gen_action(act_id));
1393 if (prob.
min == prob.
max) {
1396 return QString(
_(
"%1%")).arg(
1399 return QString(
_(
"[%1% - %2%]"))
1414 const QString &custom)
1416 QString str, chance, probtxt;
1426 "Invalid action %d", act_id);
1429 fc_assert(custom ==
nullptr || custom[0] ==
'\0');
1432 str = QString(
_(
"%1%2 (name may be wrong)"))
1442 if (!probtxt.isEmpty() && !custom.isEmpty()) {
1451 chance = QString(
_(
" (%1; %2)")).arg(custom, probtxt);
1452 }
else if (!probtxt.isEmpty()) {
1461 chance = QString(
_(
" (%1)")).arg(probtxt);
1462 }
else if (!custom.isEmpty()) {
1471 chance = QString(
_(
" (%1)")).arg(custom);
1485 int k =
ui_name.indexOf(QLatin1String(
"%s"));
1489 ui_name.replace(QLatin1String(
"%s"), QLatin1String(
"%1"));
1490 fmtstr += QStringLiteral(
"%1").arg(
ui_name);
1493 str = QString(fmtstr).arg(chance);
1510 }
else if (prob.
min == prob.
max) {
1513 tool_tip = QString(
_(
"The probability of success is %1%."))
1514 .arg(QString::number(
static_cast<double>(prob.
max)
1524 _(
"The probability of success is %1%, %2% or somewhere"
1528 .arg(prob.
max - prob.
min > 1
1532 _(
" (This is the most precise interval I can calculate "
1533 "given the information our nation has access to.)")
1547 "Action %s isn't performed by a unit",
1560 "Action %s isn't performed by a unit",
1564 return ACTIVITY_FORTIFYING;
1566 return ACTIVITY_BASE;
1568 return ACTIVITY_GEN_ROAD;
1570 return ACTIVITY_PILLAGE;
1572 return ACTIVITY_POLLUTION;
1574 return ACTIVITY_FALLOUT;
1576 return ACTIVITY_TRANSFORM;
1578 return ACTIVITY_CONVERT;
1580 return ACTIVITY_PLANT;
1582 return ACTIVITY_MINE;
1584 return ACTIVITY_CULTIVATE;
1586 return ACTIVITY_IRRIGATE;
1588 return ACTIVITY_LAST;
1599 const struct unit *actor_unit,
1600 const struct tile *tgt_tile,
1605 if (pactivity == ACTIVITY_LAST) {
1610 switch (pactivity) {
1611 case ACTIVITY_PILLAGE:
1612 case ACTIVITY_POLLUTION:
1613 case ACTIVITY_FALLOUT:
1615 case ACTIVITY_GEN_ROAD:
1616 case ACTIVITY_IRRIGATE:
1618 case ACTIVITY_CULTIVATE:
1619 case ACTIVITY_PLANT:
1620 case ACTIVITY_TRANSFORM:
1622 case ACTIVITY_FORTIFYING:
1624 case ACTIVITY_CONVERT:
1626 case ACTIVITY_EXPLORE:
1628 case ACTIVITY_FORTIFIED:
1629 case ACTIVITY_SENTRY:
1631 case ACTIVITY_UNKNOWN:
1632 case ACTIVITY_PATROL_UNUSED:
1634 case ACTIVITY_OLD_ROAD:
1635 case ACTIVITY_OLD_RAILROAD:
1636 case ACTIVITY_FORTRESS:
1637 case ACTIVITY_AIRBASE:
1653 if (pextra ==
nullptr) {
1661 switch (paction->
result) {
1668 case ACTRES_IRRIGATE:
1670 case ACTRES_ESTABLISH_EMBASSY:
1671 case ACTRES_SPY_INVESTIGATE_CITY:
1672 case ACTRES_SPY_POISON:
1673 case ACTRES_SPY_STEAL_GOLD:
1674 case ACTRES_SPY_SABOTAGE_CITY:
1675 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
1676 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
1677 case ACTRES_SPY_STEAL_TECH:
1678 case ACTRES_SPY_TARGETED_STEAL_TECH:
1679 case ACTRES_SPY_INCITE_CITY:
1680 case ACTRES_TRADE_ROUTE:
1681 case ACTRES_MARKETPLACE:
1682 case ACTRES_HELP_WONDER:
1683 case ACTRES_SPY_BRIBE_UNIT:
1684 case ACTRES_SPY_SABOTAGE_UNIT:
1685 case ACTRES_CAPTURE_UNITS:
1686 case ACTRES_FOUND_CITY:
1687 case ACTRES_JOIN_CITY:
1688 case ACTRES_STEAL_MAPS:
1689 case ACTRES_BOMBARD:
1690 case ACTRES_SPY_NUKE:
1692 case ACTRES_NUKE_CITY:
1693 case ACTRES_NUKE_UNITS:
1694 case ACTRES_DESTROY_CITY:
1695 case ACTRES_EXPEL_UNIT:
1696 case ACTRES_RECYCLE_UNIT:
1697 case ACTRES_DISBAND_UNIT:
1698 case ACTRES_HOME_CITY:
1699 case ACTRES_UPGRADE_UNIT:
1700 case ACTRES_PARADROP:
1701 case ACTRES_AIRLIFT:
1702 case ACTRES_STRIKE_BUILDING:
1703 case ACTRES_STRIKE_PRODUCTION:
1705 case ACTRES_CONQUER_CITY:
1706 case ACTRES_HEAL_UNIT:
1707 case ACTRES_TRANSFORM_TERRAIN:
1708 case ACTRES_CULTIVATE:
1710 case ACTRES_PILLAGE:
1711 case ACTRES_CLEAN_POLLUTION:
1712 case ACTRES_CLEAN_FALLOUT:
1713 case ACTRES_FORTIFY:
1714 case ACTRES_CONVERT:
1715 case ACTRES_TRANSPORT_ALIGHT:
1716 case ACTRES_TRANSPORT_UNLOAD:
1717 case ACTRES_TRANSPORT_DISEMBARK:
1718 case ACTRES_TRANSPORT_BOARD:
1719 case ACTRES_TRANSPORT_EMBARK:
1720 case ACTRES_SPY_ATTACK:
1721 case ACTRES_SPY_SPREAD_PLAGUE:
1736 if (pextra ==
nullptr) {
1740 switch (paction->
result) {
1741 case ACTRES_PILLAGE:
1743 case ACTRES_CLEAN_POLLUTION:
1745 case ACTRES_CLEAN_FALLOUT:
1747 case ACTRES_ESTABLISH_EMBASSY:
1748 case ACTRES_SPY_INVESTIGATE_CITY:
1749 case ACTRES_SPY_POISON:
1750 case ACTRES_SPY_STEAL_GOLD:
1751 case ACTRES_SPY_SABOTAGE_CITY:
1752 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
1753 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
1754 case ACTRES_SPY_STEAL_TECH:
1755 case ACTRES_SPY_TARGETED_STEAL_TECH:
1756 case ACTRES_SPY_INCITE_CITY:
1757 case ACTRES_TRADE_ROUTE:
1758 case ACTRES_MARKETPLACE:
1759 case ACTRES_HELP_WONDER:
1760 case ACTRES_SPY_BRIBE_UNIT:
1761 case ACTRES_SPY_SABOTAGE_UNIT:
1762 case ACTRES_CAPTURE_UNITS:
1763 case ACTRES_FOUND_CITY:
1764 case ACTRES_JOIN_CITY:
1765 case ACTRES_STEAL_MAPS:
1766 case ACTRES_BOMBARD:
1767 case ACTRES_SPY_NUKE:
1769 case ACTRES_NUKE_CITY:
1770 case ACTRES_NUKE_UNITS:
1771 case ACTRES_DESTROY_CITY:
1772 case ACTRES_EXPEL_UNIT:
1773 case ACTRES_RECYCLE_UNIT:
1774 case ACTRES_DISBAND_UNIT:
1775 case ACTRES_HOME_CITY:
1776 case ACTRES_UPGRADE_UNIT:
1777 case ACTRES_PARADROP:
1778 case ACTRES_AIRLIFT:
1779 case ACTRES_STRIKE_BUILDING:
1780 case ACTRES_STRIKE_PRODUCTION:
1782 case ACTRES_CONQUER_CITY:
1783 case ACTRES_HEAL_UNIT:
1784 case ACTRES_TRANSFORM_TERRAIN:
1785 case ACTRES_CULTIVATE:
1787 case ACTRES_FORTIFY:
1789 case ACTRES_CONVERT:
1792 case ACTRES_IRRIGATE:
1793 case ACTRES_TRANSPORT_ALIGHT:
1794 case ACTRES_TRANSPORT_UNLOAD:
1795 case ACTRES_TRANSPORT_DISEMBARK:
1796 case ACTRES_TRANSPORT_BOARD:
1797 case ACTRES_TRANSPORT_EMBARK:
1798 case ACTRES_SPY_ATTACK:
1799 case ACTRES_SPY_SPREAD_PLAGUE:
1814 requirement_vector_init(&enabler->actor_reqs);
1815 requirement_vector_init(&enabler->target_reqs);
1829 requirement_vector_free(&enabler->
actor_reqs);
1877 return action_enabler_list_remove(
1915 if (paction->
result == ACTRES_NONE) {
1925 bool fulfilled =
false;
1928 for (i = 0; i < obreq->contras->alternatives; i++) {
1929 const struct requirement_vector *ae_vec;
1933 (obreq->contras->alternative[i].is_target ? &enabler->
target_reqs
1956 for (i = 0; i < obreq->contras->alternatives; i++) {
1957 const struct requirement_vector *ae_vec;
1961 (obreq->contras->alternative[i].is_target ? &enabler->
target_reqs
1973 !obreq->contras->alternative[i].req.present;
1975 obreq->contras->alternative[i].req.source;
1977 obreq->contras->alternative[i].req.range;
1979 obreq->contras->alternative[i].req.survives;
1981 obreq->contras->alternative[i].req.quiet;
2005 if (preq->source.kind == VUT_DIPLREL && preq->range == REQ_RANGE_LOCAL) {
2024 const struct requirement_vector *vec)
2065 if (local_diplrel ==
nullptr) {
2071 tile_is_claimed.
quiet =
false;
2072 tile_is_unclaimed.
range = REQ_RANGE_LOCAL;
2073 tile_is_unclaimed.
survives =
false;
2074 tile_is_unclaimed.
source.
kind = VUT_CITYTILE;
2075 tile_is_unclaimed.
present =
false;
2087 tile_is_claimed.
range = REQ_RANGE_LOCAL;
2090 tile_is_claimed.
present =
true;
2100 N_(
"Requirement {%s} implies a claimed "
2101 "tile. No diplomatic relation to Nature."),
2135 if (local_diplrel ==
nullptr) {
2141 tile_is_claimed.
range = REQ_RANGE_LOCAL;
2144 tile_is_claimed.
present =
true;
2150 if (unclaimed_req ==
nullptr) {
2161 N_(
"No diplomatic relation to Nature."
2162 " Requirements {%s} and {%s} contradict each other."),
2192 if (out !=
nullptr) {
2198 if (out !=
nullptr) {
2204 if (out !=
nullptr) {
2210 if (out !=
nullptr) {
2216 if (out !=
nullptr) {
2266 bool has_user =
false;
2285 if (out !=
nullptr) {
2303 const struct requirement_vector *vec)
2324 struct requirement_vector *
2354 return _(
"actor_reqs");
2357 return _(
"target_reqs");
2368 const struct tile *ttile)
2436 const struct tile *target_tile_arg,
const struct city *target_city,
2437 const struct unit *target_unit)
2439 if (target_tile_arg !=
nullptr) {
2441 return target_tile_arg;
2459 return target_tile_arg;
2468 fc_assert_msg(
false,
"Bad action target kind %d for action %d",
2484 const struct tile *target_tile,
const struct city *target_city_arg,
2485 const struct unit *target_unit)
2487 if (target_city_arg !=
nullptr) {
2489 return target_city_arg;
2495 return target_city_arg;
2519 fc_assert_msg(
false,
"Bad action target kind %d for action %d",
2531 const struct unit *actor_unit,
2532 const struct tile *target_tile_arg,
2533 const struct city *target_city_arg,
2534 const struct unit *target_unit)
2537 act_id, actor_unit, target_tile_arg, target_city_arg, target_unit);
2539 act_id, actor_unit, target_tile, target_city_arg, target_unit);
2632 bool ignore_third_party)
2635 case ACTRES_JOIN_CITY:
2642 case ACTRES_BOMBARD:
2655 case ACTRES_UPGRADE_UNIT:
2669 case ACTRES_CONVERT:
2676 case ACTRES_TRANSPORT_UNLOAD:
2683 case ACTRES_TRANSPORT_BOARD:
2684 case ACTRES_TRANSPORT_EMBARK:
2685 case ACTRES_TRANSPORT_ALIGHT:
2686 case ACTRES_TRANSPORT_DISEMBARK:
2687 if (!ignore_third_party) {
2688 bool has_transporter =
false;
2693 has_transporter =
true;
2699 if (!has_transporter) {
2706 case ACTRES_ESTABLISH_EMBASSY:
2707 case ACTRES_SPY_INVESTIGATE_CITY:
2708 case ACTRES_SPY_POISON:
2709 case ACTRES_SPY_STEAL_GOLD:
2710 case ACTRES_SPY_SPREAD_PLAGUE:
2711 case ACTRES_SPY_SABOTAGE_CITY:
2712 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
2713 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
2714 case ACTRES_SPY_STEAL_TECH:
2715 case ACTRES_SPY_TARGETED_STEAL_TECH:
2716 case ACTRES_SPY_INCITE_CITY:
2717 case ACTRES_TRADE_ROUTE:
2718 case ACTRES_MARKETPLACE:
2719 case ACTRES_HELP_WONDER:
2720 case ACTRES_SPY_BRIBE_UNIT:
2721 case ACTRES_SPY_SABOTAGE_UNIT:
2722 case ACTRES_CAPTURE_UNITS:
2723 case ACTRES_FOUND_CITY:
2724 case ACTRES_STEAL_MAPS:
2725 case ACTRES_SPY_NUKE:
2727 case ACTRES_NUKE_CITY:
2728 case ACTRES_NUKE_UNITS:
2729 case ACTRES_DESTROY_CITY:
2730 case ACTRES_EXPEL_UNIT:
2731 case ACTRES_RECYCLE_UNIT:
2732 case ACTRES_DISBAND_UNIT:
2733 case ACTRES_HOME_CITY:
2734 case ACTRES_PARADROP:
2735 case ACTRES_AIRLIFT:
2736 case ACTRES_STRIKE_BUILDING:
2737 case ACTRES_STRIKE_PRODUCTION:
2738 case ACTRES_CONQUER_CITY:
2739 case ACTRES_HEAL_UNIT:
2740 case ACTRES_PILLAGE:
2741 case ACTRES_CLEAN_POLLUTION:
2742 case ACTRES_CLEAN_FALLOUT:
2743 case ACTRES_FORTIFY:
2744 case ACTRES_TRANSFORM_TERRAIN:
2745 case ACTRES_CULTIVATE:
2750 case ACTRES_IRRIGATE:
2751 case ACTRES_SPY_ATTACK:
2791 enum action_result result,
const struct player *actor_player,
2792 const struct city *actor_city,
const struct impr_type *actor_building,
2793 const struct tile *actor_tile,
const struct unit *actor_unit,
2796 const struct specialist *actor_specialist,
const bool omniscient,
2797 const struct city *homecity)
2799 Q_UNUSED(actor_building)
2800 Q_UNUSED(actor_tile)
2801 Q_UNUSED(actor_output)
2803 Q_UNUSED(actor_specialist)
2812 case ACTRES_PARADROP:
2822 case ACTRES_AIRLIFT: {
2826 if (actor_city ==
nullptr) {
2832 && !(
game.
info.airlifting_style & AIRLIFTING_ALLIED_SRC
2838 if (!(omniscient ||
city_owner(actor_city) == actor_player)) {
2843 if (0 >= actor_city->
airlift) {
2855 case ACTRES_CONVERT:
2863 case ACTRES_TRANSPORT_BOARD:
2864 case ACTRES_TRANSPORT_EMBARK:
2873 case ACTRES_TRANSPORT_DISEMBARK:
2880 case ACTRES_ESTABLISH_EMBASSY:
2881 case ACTRES_SPY_INVESTIGATE_CITY:
2882 case ACTRES_SPY_POISON:
2883 case ACTRES_SPY_STEAL_GOLD:
2884 case ACTRES_SPY_SPREAD_PLAGUE:
2885 case ACTRES_SPY_SABOTAGE_CITY:
2886 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
2887 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
2888 case ACTRES_SPY_STEAL_TECH:
2889 case ACTRES_SPY_TARGETED_STEAL_TECH:
2890 case ACTRES_SPY_INCITE_CITY:
2891 case ACTRES_TRADE_ROUTE:
2892 case ACTRES_MARKETPLACE:
2893 case ACTRES_HELP_WONDER:
2894 case ACTRES_SPY_BRIBE_UNIT:
2895 case ACTRES_SPY_SABOTAGE_UNIT:
2896 case ACTRES_CAPTURE_UNITS:
2897 case ACTRES_FOUND_CITY:
2898 case ACTRES_JOIN_CITY:
2899 case ACTRES_STEAL_MAPS:
2900 case ACTRES_BOMBARD:
2901 case ACTRES_SPY_NUKE:
2903 case ACTRES_NUKE_CITY:
2904 case ACTRES_NUKE_UNITS:
2905 case ACTRES_DESTROY_CITY:
2906 case ACTRES_EXPEL_UNIT:
2907 case ACTRES_RECYCLE_UNIT:
2908 case ACTRES_DISBAND_UNIT:
2909 case ACTRES_HOME_CITY:
2910 case ACTRES_UPGRADE_UNIT:
2912 case ACTRES_STRIKE_BUILDING:
2913 case ACTRES_STRIKE_PRODUCTION:
2914 case ACTRES_CONQUER_CITY:
2915 case ACTRES_HEAL_UNIT:
2916 case ACTRES_TRANSFORM_TERRAIN:
2917 case ACTRES_CULTIVATE:
2919 case ACTRES_PILLAGE:
2920 case ACTRES_CLEAN_POLLUTION:
2921 case ACTRES_CLEAN_FALLOUT:
2922 case ACTRES_FORTIFY:
2926 case ACTRES_IRRIGATE:
2927 case ACTRES_TRANSPORT_ALIGHT:
2928 case ACTRES_TRANSPORT_UNLOAD:
2929 case ACTRES_SPY_ATTACK:
2960 const struct city *actor_city,
const struct impr_type *actor_building,
2961 const struct tile *actor_tile,
const struct unit *actor_unit,
2965 const struct player *target_player,
const struct city *target_city,
2966 const struct impr_type *target_building,
const struct tile *target_tile,
2967 const struct unit *target_unit,
const struct unit_type *target_unittype,
2970 const struct extra_type *target_extra,
const bool omniscient,
2971 const struct city *homecity)
2973 Q_UNUSED(target_output)
2974 Q_UNUSED(target_building)
2975 Q_UNUSED(target_specialist)
2976 bool can_see_tgt_unit;
2977 bool can_see_tgt_tile;
2984 && target_city !=
nullptr)
2986 && target_tile !=
nullptr)
2988 && target_unit !=
nullptr)
2991 && target_unit !=
nullptr)
3039 != target_city->
id) {
3054 target_city, target_unit)) {
3062 actor_building, actor_tile, actor_unit,
3063 actor_unittype, actor_output,
3064 actor_specialist, omniscient, homecity);
3072 switch (paction->
result) {
3073 case ACTRES_CAPTURE_UNITS:
3074 case ACTRES_SPY_BRIBE_UNIT:
3081 if (!can_see_tgt_unit) {
3099 case ACTRES_SPY_TARGETED_STEAL_TECH:
3109 case ACTRES_SPY_STEAL_GOLD:
3119 case ACTRES_TRADE_ROUTE:
3120 case ACTRES_MARKETPLACE: {
3142 case ACTRES_HELP_WONDER:
3143 case ACTRES_RECYCLE_UNIT:
3162 case ACTRES_FOUND_CITY:
3169 if (can_see_tgt_tile &&
tile_city(target_tile)) {
3194 if (!can_see_tgt_tile) {
3218 case ACTRES_JOIN_CITY: {
3228 if (new_pop >
game.
info.add_to_size_limit) {
3246 case ACTRES_BOMBARD:
3256 case ACTRES_NUKE_UNITS:
3265 case ACTRES_HOME_CITY:
3268 if (homecity !=
nullptr && homecity->
id == target_city->
id) {
3283 case ACTRES_UPGRADE_UNIT:
3302 case ACTRES_PARADROP:
3315 && (!
game.
info.paradrop_to_transport
3349 case ACTRES_AIRLIFT:
3353 actor_unit, target_city)) {
3379 case ACTRES_CONQUER_CITY:
3388 case ACTRES_HEAL_UNIT:
3391 if (!(target_unit->
hp < target_unittype->
hp)) {
3396 case ACTRES_TRANSFORM_TERRAIN:
3408 case ACTRES_CULTIVATE:
3437 if (target_extra ==
nullptr) {
3451 if (target_extra ==
nullptr) {
3465 if (target_extra ==
nullptr) {
3487 case ACTRES_IRRIGATE:
3488 if (target_extra ==
nullptr) {
3511 case ACTRES_PILLAGE:
3518 bv_extras pspresent =
3521 bv_extras pspossible;
3533 bool required =
false;
3540 if (pdep == pextra) {
3565 if (target_extra !=
nullptr) {
3573 if (tgt != target_extra) {
3586 case ACTRES_CLEAN_POLLUTION: {
3594 if (target_extra !=
nullptr) {
3595 pextra = target_extra;
3600 actor_player, actor_unit);
3601 if (pextra ==
nullptr) {
3622 case ACTRES_CLEAN_FALLOUT: {
3630 if (target_extra !=
nullptr) {
3631 pextra = target_extra;
3636 actor_player, actor_unit);
3637 if (pextra ==
nullptr) {
3658 case ACTRES_TRANSPORT_ALIGHT:
3665 case ACTRES_TRANSPORT_BOARD:
3678 case ACTRES_TRANSPORT_UNLOAD:
3685 case ACTRES_TRANSPORT_DISEMBARK:
3708 case ACTRES_TRANSPORT_EMBARK:
3740 case ACTRES_SPY_ATTACK: {
3754 if (uplayer == actor_player) {
3779 case ACTRES_SPY_SPREAD_PLAGUE:
3782 case ACTRES_ESTABLISH_EMBASSY:
3783 case ACTRES_SPY_INVESTIGATE_CITY:
3784 case ACTRES_SPY_POISON:
3785 case ACTRES_SPY_SABOTAGE_CITY:
3786 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3787 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
3788 case ACTRES_SPY_STEAL_TECH:
3789 case ACTRES_SPY_INCITE_CITY:
3790 case ACTRES_SPY_SABOTAGE_UNIT:
3791 case ACTRES_STEAL_MAPS:
3792 case ACTRES_SPY_NUKE:
3794 case ACTRES_NUKE_CITY:
3795 case ACTRES_DESTROY_CITY:
3796 case ACTRES_EXPEL_UNIT:
3797 case ACTRES_DISBAND_UNIT:
3798 case ACTRES_CONVERT:
3799 case ACTRES_STRIKE_BUILDING:
3800 case ACTRES_STRIKE_PRODUCTION:
3801 case ACTRES_FORTIFY:
3815 const struct city *actor_city,
const struct impr_type *actor_building,
3816 const struct tile *actor_tile,
const struct unit *actor_unit,
3820 const struct player *target_player,
const struct city *target_city,
3821 const struct impr_type *target_building,
const struct tile *target_tile,
3822 const struct unit *target_unit,
const struct unit_type *target_unittype,
3827 actor_building, actor_tile, actor_unit,
3828 actor_unittype, actor_output, actor_specialist,
3831 target_player, actor_player, target_city, target_building,
3832 target_tile, target_unit, target_unittype, target_output,
3844 const struct city *actor_city,
const struct impr_type *actor_building,
3845 const struct tile *actor_tile,
const struct unit *actor_unit,
3849 const struct player *target_player,
const struct city *target_city,
3850 const struct impr_type *target_building,
const struct tile *target_tile,
3851 const struct unit *target_unit,
const struct unit_type *target_unittype,
3854 const struct extra_type *target_extra,
const struct city *actor_home)
3859 wanted_action, actor_player, actor_city, actor_building, actor_tile,
3860 actor_unit, actor_unittype, actor_output, actor_specialist,
3861 target_player, target_city, target_building, target_tile, target_unit,
3862 target_unittype, target_output, target_specialist, target_extra,
true,
3868 "Is omniscient, should get yes or no.");
3879 actor_tile, actor_unit, actor_unittype,
3880 actor_output, actor_specialist, target_player,
3881 target_city, target_building, target_tile,
3882 target_unit, target_unittype, target_output,
3883 target_specialist)) {
3899 const action_id wanted_action,
const struct unit *actor_unit,
3900 const struct city *actor_home,
const struct tile *actor_tile,
3901 const struct city *target_city)
3903 const struct impr_type *target_building;
3906 if (actor_unit ==
nullptr || target_city ==
nullptr) {
3913 "Action %s is performed by %s not %s",
3916 action_actor_kind_name(AAK_UNIT));
3922 action_target_kind_name(ATK_CITY));
3936 actor_tile, actor_unit,
unit_type_get(actor_unit),
nullptr,
nullptr,
3937 city_owner(target_city), target_city, target_building,
3938 city_tile(target_city),
nullptr, target_utype,
nullptr,
nullptr,
3939 nullptr, actor_home);
3949 const struct unit *actor_unit,
3950 const struct city *target_city)
3953 wanted_action, actor_unit,
unit_home(actor_unit),
3964 const action_id wanted_action,
const struct unit *actor_unit,
3965 const struct city *actor_home,
const struct tile *actor_tile,
3966 const struct unit *target_unit)
3968 if (actor_unit ==
nullptr || target_unit ==
nullptr) {
3975 "Action %s is performed by %s not %s",
3978 action_actor_kind_name(AAK_UNIT));
3984 action_target_kind_name(ATK_UNIT));
3995 actor_tile, actor_unit,
unit_type_get(actor_unit),
nullptr,
nullptr,
3998 nullptr,
nullptr,
nullptr, actor_home);
4008 const struct unit *actor_unit,
4009 const struct unit *target_unit)
4012 wanted_action, actor_unit,
unit_home(actor_unit),
4023 const action_id wanted_action,
const struct unit *actor_unit,
4024 const struct city *actor_home,
const struct tile *actor_tile,
4025 const struct tile *target_tile)
4027 if (actor_unit ==
nullptr || target_tile ==
nullptr
4028 || unit_list_size(target_tile->
units) == 0) {
4035 "Action %s is performed by %s not %s",
4038 action_actor_kind_name(AAK_UNIT));
4044 action_target_kind_name(ATK_UNITS));
4061 nullptr,
nullptr,
nullptr, actor_home)) {
4079 const struct unit *actor_unit,
4080 const struct tile *target_tile)
4083 wanted_action, actor_unit,
unit_home(actor_unit),
4094 const action_id wanted_action,
const struct unit *actor_unit,
4095 const struct city *actor_home,
const struct tile *actor_tile,
4096 const struct tile *target_tile,
const struct extra_type *target_extra)
4098 if (actor_unit ==
nullptr || target_tile ==
nullptr) {
4105 "Action %s is performed by %s not %s",
4108 action_actor_kind_name(AAK_UNIT));
4114 action_target_kind_name(ATK_TILE));
4125 actor_tile, actor_unit,
unit_type_get(actor_unit),
nullptr,
nullptr,
4127 nullptr,
nullptr,
nullptr,
nullptr, target_extra, actor_home);
4137 const struct unit *actor_unit,
4138 const struct tile *target_tile,
4142 wanted_action, actor_unit,
unit_home(actor_unit),
4143 unit_tile(actor_unit), target_tile, target_extra);
4154 const action_id wanted_action,
const struct unit *actor_unit,
4155 const struct city *actor_home,
const struct tile *actor_tile)
4157 if (actor_unit ==
nullptr) {
4164 "Action %s is performed by %s not %s",
4167 action_actor_kind_name(AAK_UNIT));
4173 action_target_kind_name(ATK_SELF));
4184 actor_tile, actor_unit,
unit_type_get(actor_unit),
nullptr,
nullptr,
4185 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4186 nullptr, actor_home);
4197 const struct unit *actor_unit)
4222 const struct city *actor_city,
const struct impr_type *actor_building,
4223 const struct tile *actor_tile,
const struct unit *actor_unit,
4226 const struct player *target_player,
const struct city *target_city,
4227 const struct impr_type *target_building,
const struct tile *target_tile,
4228 const struct unit *target_unit,
const struct output_type *target_output,
4239 mke_eval_reqs(actor_player, actor_player, target_player, actor_city,
4240 actor_building, actor_tile, actor_unit, actor_output,
4241 actor_specialist, &enabler->actor_reqs,
RPT_CERTAIN),
4242 mke_eval_reqs(actor_player, target_player, actor_player, target_city,
4243 target_building, target_tile, target_unit,
4244 target_output, target_specialist,
4265 enum effect_type effect_type,
const struct player *pow_player,
4266 const struct player *target_player,
const struct player *other_player,
4267 const struct city *target_city,
const struct impr_type *target_building,
4268 const struct tile *target_tile,
const struct unit *target_unit,
4276 target_city, target_building, target_tile,
4277 target_unit, target_output, target_specialist,
4292 const struct player *target_player)
4297 if (actor_research != target_research) {
4308 == TECH_PREREQS_KNOWN))) {
4330 const struct unit *pdefender)
4375 pdefender->
tile,
nullptr,
nullptr,
nullptr)) {
4383 nullptr,
tile_owner(pdefender->tile),
nullptr,
4384 tile_city(pdefender->tile),
nullptr, pdefender->
tile,
nullptr,
4385 nullptr,
nullptr,
nullptr,
nullptr, EFT_SPY_RESISTANT)
4402 const struct unit *pvictim,
4403 const struct tile *tgt_tile)
4405 struct unit *pdefender;
4429 const struct
unit *actor_unit)
4450 const struct city *actor_city,
const struct impr_type *actor_building,
4451 const struct tile *actor_tile,
const struct unit *actor_unit,
4452 const struct unit_type *actor_unittype_p,
4454 const struct specialist *actor_specialist,
const struct city *actor_home,
4455 const struct player *target_player,
const struct city *target_city,
4456 const struct impr_type *target_building,
const struct tile *target_tile,
4457 const struct unit *target_unit,
4458 const struct unit_type *target_unittype_p,
4466 const struct unit_type *target_unittype;
4470 if (actor_unittype_p ==
nullptr && actor_unit !=
nullptr) {
4473 actor_unittype = actor_unittype_p;
4476 if (target_unittype_p ==
nullptr && target_unit !=
nullptr) {
4479 target_unittype = target_unittype_p;
4483 wanted_action, actor_player, actor_city, actor_building, actor_tile,
4484 actor_unit, actor_unittype, actor_output, actor_specialist,
4485 target_player, target_city, target_building, target_tile, target_unit,
4486 target_unittype, target_output, target_specialist, target_extra,
false,
4500 actor_building, actor_tile, actor_unit,
4501 actor_output, actor_specialist, target_player,
4502 target_city, target_building, target_tile,
4503 target_unit, target_output, target_specialist));
4505 switch (paction->
result) {
4506 case ACTRES_SPY_POISON:
4510 case ACTRES_SPY_STEAL_GOLD:
4513 case ACTRES_SPY_SPREAD_PLAGUE:
4516 case ACTRES_STEAL_MAPS:
4519 case ACTRES_SPY_SABOTAGE_UNIT:
4523 case ACTRES_SPY_BRIBE_UNIT:
4527 case ACTRES_SPY_ATTACK:
4531 case ACTRES_SPY_SABOTAGE_CITY:
4534 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
4537 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
4540 case ACTRES_SPY_INCITE_CITY:
4543 case ACTRES_ESTABLISH_EMBASSY:
4546 case ACTRES_SPY_STEAL_TECH:
4554 case ACTRES_SPY_TARGETED_STEAL_TECH:
4562 case ACTRES_SPY_INVESTIGATE_CITY:
4566 case ACTRES_TRADE_ROUTE:
4569 case ACTRES_MARKETPLACE:
4573 case ACTRES_HELP_WONDER:
4577 case ACTRES_CAPTURE_UNITS:
4581 case ACTRES_EXPEL_UNIT:
4585 case ACTRES_BOMBARD:
4589 case ACTRES_FOUND_CITY:
4593 case ACTRES_JOIN_CITY:
4597 case ACTRES_SPY_NUKE:
4607 case ACTRES_NUKE_CITY:
4610 case ACTRES_NUKE_UNITS:
4613 case ACTRES_DESTROY_CITY:
4617 case ACTRES_RECYCLE_UNIT:
4621 case ACTRES_DISBAND_UNIT:
4625 case ACTRES_HOME_CITY:
4629 case ACTRES_UPGRADE_UNIT:
4633 case ACTRES_PARADROP:
4636 case ACTRES_AIRLIFT:
4640 case ACTRES_ATTACK: {
4650 }
else if (known ==
TRI_YES) {
4654 case ACTRES_STRIKE_BUILDING:
4662 case ACTRES_STRIKE_PRODUCTION:
4667 case ACTRES_CONQUER_CITY:
4671 case ACTRES_HEAL_UNIT:
4675 case ACTRES_TRANSFORM_TERRAIN:
4676 case ACTRES_CULTIVATE:
4678 case ACTRES_PILLAGE:
4679 case ACTRES_CLEAN_POLLUTION:
4680 case ACTRES_CLEAN_FALLOUT:
4681 case ACTRES_FORTIFY:
4683 case ACTRES_CONVERT:
4686 case ACTRES_IRRIGATE:
4689 case ACTRES_TRANSPORT_ALIGHT:
4692 case ACTRES_TRANSPORT_BOARD:
4695 case ACTRES_TRANSPORT_EMBARK:
4698 case ACTRES_TRANSPORT_UNLOAD:
4701 case ACTRES_TRANSPORT_DISEMBARK:
4742 const struct
unit *actor_unit,
const struct city *actor_home,
4744 const struct city *target_city)
4746 const struct impr_type *target_building;
4749 if (actor_unit ==
nullptr || target_city ==
nullptr) {
4758 action_actor_kind_name(AAK_UNIT));
4764 action_target_kind_name(ATK_CITY));
4784 target_city,
nullptr)) {
4799 nullptr, actor_tile, actor_unit,
nullptr,
nullptr,
4800 nullptr, actor_home,
city_owner(target_city),
4801 target_city, target_building,
city_tile(target_city),
4802 nullptr, target_utype,
nullptr,
nullptr,
nullptr);
4811 const struct city *target_city)
4823 const struct
unit *actor_unit,
const struct city *actor_home,
4825 const struct unit *target_unit)
4827 if (actor_unit ==
nullptr || target_unit ==
nullptr) {
4836 action_actor_kind_name(AAK_UNIT));
4842 action_target_kind_name(ATK_UNIT));
4860 nullptr, actor_tile, actor_unit,
nullptr,
nullptr,
4861 nullptr, actor_home,
unit_owner(target_unit),
4863 unit_tile(target_unit), target_unit,
nullptr,
nullptr,
4873 const struct unit *target_unit)
4885 const struct
unit *actor_unit,
const struct city *actor_home,
4887 const struct tile *target_tile)
4891 if (actor_unit ==
nullptr || target_tile ==
nullptr) {
4900 action_actor_kind_name(AAK_UNIT));
4906 action_target_kind_name(ATK_UNITS));
4928 CITYT_CENTER,
true)) {
4948 if (unit_list_size(target_tile->
units) == 0) {
4991 actor_tile, actor_unit,
nullptr,
nullptr,
nullptr, actor_home,
4993 unit_tile(target_unit), target_unit,
nullptr,
nullptr,
nullptr,
5004 "Invalid probability [%d, %d]", prob_unit.min,
5031 const struct tile *target_tile)
5043 const struct
unit *actor_unit,
const struct city *actor_home,
5045 const struct tile *target_tile,
const struct extra_type *target_extra)
5047 if (actor_unit ==
nullptr || target_tile ==
nullptr) {
5056 action_actor_kind_name(AAK_UNIT));
5062 action_target_kind_name(ATK_TILE));
5080 nullptr, actor_tile, actor_unit,
nullptr,
nullptr,
5081 nullptr, actor_home,
tile_owner(target_tile),
5082 tile_city(target_tile),
nullptr, target_tile,
nullptr,
5083 nullptr,
nullptr,
nullptr, target_extra);
5092 const struct tile *target_tile,
5096 unit_tile(actor_unit), act_id, target_tile,
5105 const struct city *actor_home,
5106 const struct tile *actor_tile,
5109 if (actor_unit ==
nullptr) {
5120 action_actor_kind_name(AAK_UNIT));
5126 action_target_kind_name(ATK_SELF));
5136 nullptr, actor_tile, actor_unit,
nullptr,
nullptr,
5137 nullptr, actor_home,
nullptr,
nullptr,
nullptr,
nullptr,
5138 nullptr,
nullptr,
nullptr,
nullptr,
nullptr);
5164 const struct unit *act_unit,
5165 const struct city *tgt_city,
5166 const struct unit *tgt_unit,
5167 const struct tile *tgt_tile,
5201 qCritical(
"Invalid action target kind");
5214 const struct
unit *actor,
5215 const struct city *actor_home,
5216 const struct tile *actor_tile,
5217 const bool omniscient_cheat,
5218 const struct city *target)
5225 if (omniscient_cheat) {
5227 actor_tile, target)) {
5244 const struct
unit *actor,
5245 const struct city *actor_home,
5246 const struct tile *actor_tile,
5247 bool omniscient_cheat,
5248 const struct tile *target)
5255 if (omniscient_cheat) {
5257 actor_tile, target)) {
5275 const struct city *actor_home,
const struct tile *actor_tile,
5276 bool omniscient_cheat,
const struct tile *target_tile,
5284 if (omniscient_cheat) {
5286 actor_tile, target_tile,
5294 target_tile, target_extra);
5304 const struct
unit *actor,
5305 const struct city *actor_home,
5306 const struct tile *actor_tile,
5307 bool omniscient_cheat)
5314 if (omniscient_cheat) {
5413 return probability.
max < probability.
min;
5462 if (my_ap1.
min < my_ap2.
min) {
5464 }
else if (my_ap1.
min > my_ap2.
min) {
5466 }
else if (my_ap1.
max < my_ap2.
max) {
5468 }
else if (my_ap1.
max > my_ap2.
max) {
5499 return static_cast<double>(my_ap.
min)
5543 my_ap1.min = ap1->
min;
5544 my_ap1.max = ap1->
max;
5554 my_ap2.min = ap2->min;
5555 my_ap2.max = ap2->max;
5582 switch (paction->
result) {
5583 case ACTRES_STRIKE_BUILDING:
5584 case ACTRES_STRIKE_PRODUCTION:
5587 case ACTRES_SPY_SPREAD_PLAGUE:
5588 case ACTRES_SPY_STEAL_TECH:
5589 case ACTRES_SPY_TARGETED_STEAL_TECH:
5590 case ACTRES_SPY_INCITE_CITY:
5591 case ACTRES_SPY_SABOTAGE_CITY:
5592 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
5593 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
5594 case ACTRES_SPY_STEAL_GOLD:
5595 case ACTRES_STEAL_MAPS:
5596 case ACTRES_SPY_NUKE:
5600 case ACTRES_ESTABLISH_EMBASSY:
5601 case ACTRES_SPY_INVESTIGATE_CITY:
5602 case ACTRES_SPY_POISON:
5603 case ACTRES_TRADE_ROUTE:
5604 case ACTRES_MARKETPLACE:
5605 case ACTRES_HELP_WONDER:
5606 case ACTRES_SPY_BRIBE_UNIT:
5607 case ACTRES_SPY_SABOTAGE_UNIT:
5608 case ACTRES_CAPTURE_UNITS:
5609 case ACTRES_FOUND_CITY:
5610 case ACTRES_JOIN_CITY:
5611 case ACTRES_BOMBARD:
5613 case ACTRES_NUKE_CITY:
5614 case ACTRES_NUKE_UNITS:
5615 case ACTRES_DESTROY_CITY:
5616 case ACTRES_EXPEL_UNIT:
5617 case ACTRES_RECYCLE_UNIT:
5618 case ACTRES_DISBAND_UNIT:
5619 case ACTRES_HOME_CITY:
5620 case ACTRES_UPGRADE_UNIT:
5621 case ACTRES_PARADROP:
5622 case ACTRES_AIRLIFT:
5624 case ACTRES_CONQUER_CITY:
5625 case ACTRES_HEAL_UNIT:
5626 case ACTRES_TRANSFORM_TERRAIN:
5627 case ACTRES_CULTIVATE:
5629 case ACTRES_PILLAGE:
5630 case ACTRES_CLEAN_POLLUTION:
5631 case ACTRES_CLEAN_FALLOUT:
5632 case ACTRES_FORTIFY:
5634 case ACTRES_CONVERT:
5637 case ACTRES_IRRIGATE:
5638 case ACTRES_TRANSPORT_ALIGHT:
5639 case ACTRES_TRANSPORT_UNLOAD:
5640 case ACTRES_TRANSPORT_DISEMBARK:
5641 case ACTRES_TRANSPORT_BOARD:
5642 case ACTRES_TRANSPORT_EMBARK:
5643 case ACTRES_SPY_ATTACK:
5658 const struct unit *act_unit,
5659 const struct city *tgt_city,
5660 const struct player *tgt_player,
5661 const struct action *paction)
5666 "Bad initial odds for action number %d."
5667 " Does it roll the dice at all?",
5675 nullptr, act_player, tgt_player, tgt_city,
nullptr,
nullptr,
5676 act_unit,
unit_type_get(act_unit),
nullptr,
nullptr, paction,
5677 EFT_ACTION_ODDS_PCT))
5681 return CLIP(0, odds, 100);
5710 const struct player *target_player,
const struct city *target_city,
5711 const struct impr_type *target_building,
const struct tile *target_tile,
5712 const struct unit *target_unit,
const struct unit_type *target_unittype,
5720 target_building, target_tile, target_unit,
5721 target_unittype, target_output, target_specialist,
5735 const struct player *actor_player,
5736 const struct city *target_city)
5744 target_city,
nullptr,
city_tile(target_city),
5745 nullptr,
nullptr,
nullptr,
nullptr);
5766 const struct unit *actor_unit)
5784 nullptr, actor_tile, actor_unit,
5785 actor_unittype,
nullptr,
nullptr,
false,
5796 actor_player, actor_player,
nullptr, actor_city,
nullptr, actor_tile,
5797 actor_unit,
nullptr,
nullptr, &enabler->actor_reqs,
5862 if ((actor_uni ==
nullptr
5865 && (target_uni ==
nullptr
5899 enum action_result result)
5908 act_list[(*position)++] = paction->
id;
5921 switch (
static_cast<enum gen_action
>(act)) {
5922 case ACTION_SPY_POISON:
5923 return "ui_name_poison_city";
5924 case ACTION_SPY_POISON_ESC:
5925 return "ui_name_poison_city_escape";
5926 case ACTION_SPY_SABOTAGE_UNIT:
5927 return "ui_name_sabotage_unit";
5928 case ACTION_SPY_SABOTAGE_UNIT_ESC:
5929 return "ui_name_sabotage_unit_escape";
5930 case ACTION_SPY_BRIBE_UNIT:
5931 return "ui_name_bribe_unit";
5932 case ACTION_SPY_SABOTAGE_CITY:
5933 return "ui_name_sabotage_city";
5934 case ACTION_SPY_SABOTAGE_CITY_ESC:
5935 return "ui_name_sabotage_city_escape";
5936 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
5937 return "ui_name_targeted_sabotage_city";
5938 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
5939 return "ui_name_sabotage_city_production";
5940 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
5941 return "ui_name_targeted_sabotage_city_escape";
5942 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
5943 return "ui_name_sabotage_city_production_escape";
5944 case ACTION_SPY_INCITE_CITY:
5945 return "ui_name_incite_city";
5946 case ACTION_SPY_INCITE_CITY_ESC:
5947 return "ui_name_incite_city_escape";
5948 case ACTION_ESTABLISH_EMBASSY:
5949 return "ui_name_establish_embassy";
5950 case ACTION_ESTABLISH_EMBASSY_STAY:
5951 return "ui_name_establish_embassy_stay";
5952 case ACTION_SPY_STEAL_TECH:
5953 return "ui_name_steal_tech";
5954 case ACTION_SPY_STEAL_TECH_ESC:
5955 return "ui_name_steal_tech_escape";
5956 case ACTION_SPY_TARGETED_STEAL_TECH:
5957 return "ui_name_targeted_steal_tech";
5958 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
5959 return "ui_name_targeted_steal_tech_escape";
5960 case ACTION_SPY_INVESTIGATE_CITY:
5961 return "ui_name_investigate_city";
5962 case ACTION_INV_CITY_SPEND:
5963 return "ui_name_investigate_city_spend_unit";
5964 case ACTION_SPY_STEAL_GOLD:
5965 return "ui_name_steal_gold";
5966 case ACTION_SPY_STEAL_GOLD_ESC:
5967 return "ui_name_steal_gold_escape";
5968 case ACTION_SPY_SPREAD_PLAGUE:
5969 return "ui_name_spread_plague";
5970 case ACTION_STEAL_MAPS:
5971 return "ui_name_steal_maps";
5972 case ACTION_STEAL_MAPS_ESC:
5973 return "ui_name_steal_maps_escape";
5974 case ACTION_TRADE_ROUTE:
5975 return "ui_name_establish_trade_route";
5976 case ACTION_MARKETPLACE:
5977 return "ui_name_enter_marketplace";
5978 case ACTION_HELP_WONDER:
5979 return "ui_name_help_wonder";
5980 case ACTION_CAPTURE_UNITS:
5981 return "ui_name_capture_units";
5982 case ACTION_EXPEL_UNIT:
5983 return "ui_name_expel_unit";
5984 case ACTION_FOUND_CITY:
5985 return "ui_name_found_city";
5986 case ACTION_JOIN_CITY:
5987 return "ui_name_join_city";
5988 case ACTION_BOMBARD:
5989 return "ui_name_bombard";
5990 case ACTION_BOMBARD2:
5991 return "ui_name_bombard_2";
5992 case ACTION_BOMBARD3:
5993 return "ui_name_bombard_3";
5994 case ACTION_SPY_NUKE:
5995 return "ui_name_suitcase_nuke";
5996 case ACTION_SPY_NUKE_ESC:
5997 return "ui_name_suitcase_nuke_escape";
5999 return "ui_name_explode_nuclear";
6000 case ACTION_NUKE_CITY:
6001 return "ui_name_nuke_city";
6002 case ACTION_NUKE_UNITS:
6003 return "ui_name_nuke_units";
6004 case ACTION_DESTROY_CITY:
6005 return "ui_name_destroy_city";
6006 case ACTION_RECYCLE_UNIT:
6007 return "ui_name_recycle_unit";
6008 case ACTION_DISBAND_UNIT:
6009 return "ui_name_disband_unit";
6010 case ACTION_HOME_CITY:
6011 return "ui_name_home_city";
6012 case ACTION_UPGRADE_UNIT:
6013 return "ui_name_upgrade_unit";
6014 case ACTION_PARADROP:
6015 return "ui_name_paradrop_unit";
6016 case ACTION_AIRLIFT:
6017 return "ui_name_airlift_unit";
6019 return "ui_name_attack";
6020 case ACTION_SUICIDE_ATTACK:
6021 return "ui_name_suicide_attack";
6022 case ACTION_STRIKE_BUILDING:
6023 return "ui_name_surgical_strike_building";
6024 case ACTION_STRIKE_PRODUCTION:
6025 return "ui_name_surgical_strike_production";
6026 case ACTION_CONQUER_CITY:
6027 return "ui_name_conquer_city";
6028 case ACTION_CONQUER_CITY2:
6029 return "ui_name_conquer_city_2";
6030 case ACTION_HEAL_UNIT:
6031 return "ui_name_heal_unit";
6032 case ACTION_TRANSFORM_TERRAIN:
6033 return "ui_name_transform_terrain";
6034 case ACTION_CULTIVATE:
6035 return "ui_name_cultivate";
6037 return "ui_name_plant";
6038 case ACTION_PILLAGE:
6039 return "ui_name_pillage";
6040 case ACTION_CLEAN_POLLUTION:
6041 return "ui_name_clean_pollution";
6042 case ACTION_CLEAN_FALLOUT:
6043 return "ui_name_clean_fallout";
6044 case ACTION_FORTIFY:
6045 return "ui_name_fortify";
6047 return "ui_name_road";
6048 case ACTION_CONVERT:
6049 return "ui_name_convert_unit";
6051 return "ui_name_build_base";
6053 return "ui_name_build_mine";
6054 case ACTION_IRRIGATE:
6055 return "ui_name_irrigate";
6056 case ACTION_TRANSPORT_ALIGHT:
6057 return "ui_name_transport_alight";
6058 case ACTION_TRANSPORT_BOARD:
6059 return "ui_name_transport_board";
6060 case ACTION_TRANSPORT_EMBARK:
6061 return "ui_name_transport_embark";
6062 case ACTION_TRANSPORT_UNLOAD:
6063 return "ui_name_transport_unload";
6064 case ACTION_TRANSPORT_DISEMBARK1:
6065 return "ui_name_transport_disembark";
6066 case ACTION_TRANSPORT_DISEMBARK2:
6067 return "ui_name_transport_disembark_2";
6068 case ACTION_SPY_ATTACK:
6069 return "ui_name_spy_attack";
6070 case ACTION_USER_ACTION1:
6071 return "ui_name_user_action_1";
6072 case ACTION_USER_ACTION2:
6073 return "ui_name_user_action_2";
6074 case ACTION_USER_ACTION3:
6075 return "ui_name_user_action_3";
6080 fc_assert(act >= 0 && act < ACTION_COUNT);
6090 case ACTION_SPY_POISON:
6092 return N_(
"%sPoison City%s");
6093 case ACTION_SPY_POISON_ESC:
6095 return N_(
"%sPoison City and Escape%s");
6096 case ACTION_SPY_SABOTAGE_UNIT:
6098 return N_(
"S%sabotage Enemy Unit%s");
6099 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6101 return N_(
"S%sabotage Enemy Unit and Escape%s");
6102 case ACTION_SPY_BRIBE_UNIT:
6104 return N_(
"Bribe Enemy %sUnit%s");
6105 case ACTION_SPY_SABOTAGE_CITY:
6107 return N_(
"%sSabotage City%s");
6108 case ACTION_SPY_SABOTAGE_CITY_ESC:
6110 return N_(
"%sSabotage City and Escape%s");
6111 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6113 return N_(
"Industria%sl Sabotage%s");
6114 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6116 return N_(
"Industria%sl Sabotage Production%s");
6117 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6119 return N_(
"Industria%sl Sabotage and Escape%s");
6120 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6123 return N_(
"Industria%sl Sabotage Production and Escape%s");
6124 case ACTION_SPY_INCITE_CITY:
6126 return N_(
"Incite a Re%svolt%s");
6127 case ACTION_SPY_INCITE_CITY_ESC:
6129 return N_(
"Incite a Re%svolt and Escape%s");
6130 case ACTION_ESTABLISH_EMBASSY:
6132 return N_(
"Establish %sEmbassy%s");
6133 case ACTION_ESTABLISH_EMBASSY_STAY:
6135 return N_(
"Becom%se Ambassador%s");
6136 case ACTION_SPY_STEAL_TECH:
6138 return N_(
"Steal %sTechnology%s");
6139 case ACTION_SPY_STEAL_TECH_ESC:
6141 return N_(
"Steal %sTechnology and Escape%s");
6142 case ACTION_SPY_TARGETED_STEAL_TECH:
6144 return N_(
"In%sdustrial Espionage%s");
6145 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6147 return N_(
"In%sdustrial Espionage and Escape%s");
6148 case ACTION_SPY_INVESTIGATE_CITY:
6150 return N_(
"%sInvestigate City%s");
6151 case ACTION_INV_CITY_SPEND:
6154 return N_(
"%sInvestigate City (spends the unit)%s");
6155 case ACTION_SPY_STEAL_GOLD:
6157 return N_(
"Steal %sGold%s");
6158 case ACTION_SPY_STEAL_GOLD_ESC:
6160 return N_(
"Steal %sGold and Escape%s");
6161 case ACTION_SPY_SPREAD_PLAGUE:
6163 return N_(
"Spread %sPlague%s");
6164 case ACTION_STEAL_MAPS:
6166 return N_(
"Steal %sMaps%s");
6167 case ACTION_STEAL_MAPS_ESC:
6169 return N_(
"Steal %sMaps and Escape%s");
6170 case ACTION_TRADE_ROUTE:
6172 return N_(
"Establish Trade %sRoute%s");
6173 case ACTION_MARKETPLACE:
6175 return N_(
"Enter %sMarketplace%s");
6176 case ACTION_HELP_WONDER:
6178 return N_(
"Help %sBuild Wonder%s");
6179 case ACTION_CAPTURE_UNITS:
6181 return N_(
"%sCapture Units%s");
6182 case ACTION_EXPEL_UNIT:
6184 return N_(
"%sExpel Unit%s");
6185 case ACTION_FOUND_CITY:
6187 return N_(
"%sFound City%s");
6188 case ACTION_JOIN_CITY:
6190 return N_(
"%sJoin City%s");
6191 case ACTION_BOMBARD:
6193 return N_(
"B%sombard%s");
6194 case ACTION_BOMBARD2:
6196 return N_(
"B%sombard 2%s");
6197 case ACTION_BOMBARD3:
6199 return N_(
"B%sombard 3%s");
6200 case ACTION_SPY_NUKE:
6202 return N_(
"Suitcase %sNuke%s");
6203 case ACTION_SPY_NUKE_ESC:
6205 return N_(
"Suitcase %sNuke and Escape%s");
6208 return N_(
"Explode %sNuclear%s");
6209 case ACTION_NUKE_CITY:
6211 return N_(
"%sNuke City%s");
6212 case ACTION_NUKE_UNITS:
6214 return N_(
"%sNuke Units%s");
6215 case ACTION_DESTROY_CITY:
6217 return N_(
"Destroy %sCity%s");
6218 case ACTION_RECYCLE_UNIT:
6220 return N_(
"Rec%sycle Unit%s");
6221 case ACTION_DISBAND_UNIT:
6223 return N_(
"%sDisband Unit%s");
6224 case ACTION_HOME_CITY:
6226 return N_(
"Set %sHome City%s");
6227 case ACTION_UPGRADE_UNIT:
6229 return N_(
"%sUpgrade Unit%s");
6230 case ACTION_PARADROP:
6232 return N_(
"Drop %sParatrooper%s");
6233 case ACTION_AIRLIFT:
6235 return N_(
"%sAirlift to City%s");
6238 return N_(
"%sAttack%s");
6239 case ACTION_SUICIDE_ATTACK:
6241 return N_(
"%sSuicide Attack%s");
6242 case ACTION_STRIKE_BUILDING:
6244 return N_(
"Surgical Str%sike Building%s");
6245 case ACTION_STRIKE_PRODUCTION:
6247 return N_(
"Surgical Str%sike Production%s");
6248 case ACTION_CONQUER_CITY:
6250 return N_(
"%sConquer City%s");
6251 case ACTION_CONQUER_CITY2:
6253 return N_(
"%sConquer City 2%s");
6254 case ACTION_HEAL_UNIT:
6256 return N_(
"Heal %sUnit%s");
6257 case ACTION_TRANSFORM_TERRAIN:
6259 return N_(
"%sTransform Terrain%s");
6260 case ACTION_CULTIVATE:
6262 return N_(
"Transform by %sCultivating%s");
6265 return N_(
"Transform by %sPlanting%s");
6266 case ACTION_PILLAGE:
6268 return N_(
"Pilla%sge%s");
6269 case ACTION_CLEAN_POLLUTION:
6271 return N_(
"Clean %sPollution%s");
6272 case ACTION_CLEAN_FALLOUT:
6274 return N_(
"Clean %sFallout%s");
6275 case ACTION_FORTIFY:
6277 return N_(
"%sFortify%s");
6280 return N_(
"Build %sRoad%s");
6281 case ACTION_CONVERT:
6283 return N_(
"%sConvert Unit%s");
6286 return N_(
"%sBuild Base%s");
6289 return N_(
"Build %sMine%s");
6290 case ACTION_IRRIGATE:
6292 return N_(
"Build %sIrrigation%s");
6293 case ACTION_TRANSPORT_ALIGHT:
6295 return N_(
"%sAlight%s");
6296 case ACTION_TRANSPORT_BOARD:
6298 return N_(
"%sBoard%s");
6299 case ACTION_TRANSPORT_EMBARK:
6301 return N_(
"%sEmbark%s");
6302 case ACTION_TRANSPORT_UNLOAD:
6304 return N_(
"%sUnload%s");
6305 case ACTION_TRANSPORT_DISEMBARK1:
6307 return N_(
"%sDisembark%s");
6308 case ACTION_TRANSPORT_DISEMBARK2:
6310 return N_(
"%sDisembark 2%s");
6311 case ACTION_SPY_ATTACK:
6313 return N_(
"%sEliminate Diplomat%s");
6314 case ACTION_USER_ACTION1:
6316 return N_(
"%sUser Action 1%s");
6317 case ACTION_USER_ACTION2:
6319 return N_(
"%sUser Action 2%s");
6320 case ACTION_USER_ACTION3:
6322 return N_(
"%sUser Action 3%s");
6336 switch (
static_cast<enum gen_action
>(act)) {
6337 case ACTION_SPY_POISON:
6338 case ACTION_SPY_POISON_ESC:
6339 case ACTION_SPY_SABOTAGE_UNIT:
6340 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6341 case ACTION_SPY_BRIBE_UNIT:
6342 case ACTION_SPY_SABOTAGE_CITY:
6343 case ACTION_SPY_SABOTAGE_CITY_ESC:
6344 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6345 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6346 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6347 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6348 case ACTION_SPY_INCITE_CITY:
6349 case ACTION_SPY_INCITE_CITY_ESC:
6350 case ACTION_ESTABLISH_EMBASSY:
6351 case ACTION_ESTABLISH_EMBASSY_STAY:
6352 case ACTION_SPY_STEAL_TECH:
6353 case ACTION_SPY_STEAL_TECH_ESC:
6354 case ACTION_SPY_TARGETED_STEAL_TECH:
6355 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6356 case ACTION_SPY_INVESTIGATE_CITY:
6357 case ACTION_INV_CITY_SPEND:
6358 case ACTION_SPY_STEAL_GOLD:
6359 case ACTION_SPY_STEAL_GOLD_ESC:
6360 case ACTION_SPY_SPREAD_PLAGUE:
6361 case ACTION_STEAL_MAPS:
6362 case ACTION_STEAL_MAPS_ESC:
6363 case ACTION_TRADE_ROUTE:
6364 case ACTION_MARKETPLACE:
6365 case ACTION_HELP_WONDER:
6366 case ACTION_CAPTURE_UNITS:
6367 case ACTION_EXPEL_UNIT:
6368 case ACTION_FOUND_CITY:
6369 case ACTION_JOIN_CITY:
6370 case ACTION_SPY_NUKE:
6371 case ACTION_SPY_NUKE_ESC:
6372 case ACTION_NUKE_CITY:
6373 case ACTION_NUKE_UNITS:
6374 case ACTION_DESTROY_CITY:
6375 case ACTION_RECYCLE_UNIT:
6376 case ACTION_DISBAND_UNIT:
6377 case ACTION_HOME_CITY:
6378 case ACTION_UPGRADE_UNIT:
6379 case ACTION_PARADROP:
6380 case ACTION_AIRLIFT:
6382 case ACTION_SUICIDE_ATTACK:
6383 case ACTION_STRIKE_BUILDING:
6384 case ACTION_STRIKE_PRODUCTION:
6385 case ACTION_CONQUER_CITY:
6386 case ACTION_CONQUER_CITY2:
6387 case ACTION_HEAL_UNIT:
6388 case ACTION_TRANSFORM_TERRAIN:
6389 case ACTION_CULTIVATE:
6391 case ACTION_PILLAGE:
6392 case ACTION_CLEAN_POLLUTION:
6393 case ACTION_CLEAN_FALLOUT:
6394 case ACTION_FORTIFY:
6396 case ACTION_CONVERT:
6399 case ACTION_IRRIGATE:
6400 case ACTION_TRANSPORT_ALIGHT:
6401 case ACTION_TRANSPORT_BOARD:
6402 case ACTION_TRANSPORT_EMBARK:
6403 case ACTION_TRANSPORT_UNLOAD:
6404 case ACTION_TRANSPORT_DISEMBARK1:
6405 case ACTION_TRANSPORT_DISEMBARK2:
6406 case ACTION_BOMBARD:
6407 case ACTION_BOMBARD2:
6408 case ACTION_BOMBARD3:
6410 case ACTION_SPY_ATTACK:
6413 case ACTION_USER_ACTION1:
6414 return "user_action_1_min_range";
6415 case ACTION_USER_ACTION2:
6416 return "user_action_2_min_range";
6417 case ACTION_USER_ACTION3:
6418 return "user_action_3_min_range";
6423 fc_assert(act >= 0 && act < ACTION_COUNT);
6432 switch (
static_cast<enum gen_action
>(act)) {
6433 case ACTION_SPY_POISON:
6434 case ACTION_SPY_POISON_ESC:
6435 case ACTION_SPY_SABOTAGE_UNIT:
6436 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6437 case ACTION_SPY_BRIBE_UNIT:
6438 case ACTION_SPY_SABOTAGE_CITY:
6439 case ACTION_SPY_SABOTAGE_CITY_ESC:
6440 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6441 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6442 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6443 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6444 case ACTION_SPY_INCITE_CITY:
6445 case ACTION_SPY_INCITE_CITY_ESC:
6446 case ACTION_ESTABLISH_EMBASSY:
6447 case ACTION_ESTABLISH_EMBASSY_STAY:
6448 case ACTION_SPY_STEAL_TECH:
6449 case ACTION_SPY_STEAL_TECH_ESC:
6450 case ACTION_SPY_TARGETED_STEAL_TECH:
6451 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6452 case ACTION_SPY_INVESTIGATE_CITY:
6453 case ACTION_INV_CITY_SPEND:
6454 case ACTION_SPY_STEAL_GOLD:
6455 case ACTION_SPY_STEAL_GOLD_ESC:
6456 case ACTION_SPY_SPREAD_PLAGUE:
6457 case ACTION_STEAL_MAPS:
6458 case ACTION_STEAL_MAPS_ESC:
6459 case ACTION_TRADE_ROUTE:
6460 case ACTION_MARKETPLACE:
6461 case ACTION_HELP_WONDER:
6462 case ACTION_CAPTURE_UNITS:
6463 case ACTION_EXPEL_UNIT:
6464 case ACTION_FOUND_CITY:
6465 case ACTION_JOIN_CITY:
6466 case ACTION_SPY_NUKE:
6467 case ACTION_SPY_NUKE_ESC:
6468 case ACTION_NUKE_CITY:
6469 case ACTION_NUKE_UNITS:
6470 case ACTION_DESTROY_CITY:
6471 case ACTION_RECYCLE_UNIT:
6472 case ACTION_DISBAND_UNIT:
6473 case ACTION_HOME_CITY:
6474 case ACTION_UPGRADE_UNIT:
6475 case ACTION_PARADROP:
6476 case ACTION_AIRLIFT:
6478 case ACTION_SUICIDE_ATTACK:
6479 case ACTION_STRIKE_BUILDING:
6480 case ACTION_STRIKE_PRODUCTION:
6481 case ACTION_CONQUER_CITY:
6482 case ACTION_CONQUER_CITY2:
6483 case ACTION_HEAL_UNIT:
6484 case ACTION_TRANSFORM_TERRAIN:
6485 case ACTION_CULTIVATE:
6487 case ACTION_PILLAGE:
6488 case ACTION_CLEAN_POLLUTION:
6489 case ACTION_CLEAN_FALLOUT:
6490 case ACTION_FORTIFY:
6492 case ACTION_CONVERT:
6495 case ACTION_IRRIGATE:
6496 case ACTION_TRANSPORT_ALIGHT:
6497 case ACTION_TRANSPORT_BOARD:
6498 case ACTION_TRANSPORT_EMBARK:
6499 case ACTION_TRANSPORT_UNLOAD:
6500 case ACTION_TRANSPORT_DISEMBARK1:
6501 case ACTION_TRANSPORT_DISEMBARK2:
6502 case ACTION_BOMBARD:
6503 case ACTION_BOMBARD2:
6504 case ACTION_BOMBARD3:
6506 case ACTION_SPY_ATTACK:
6510 case ACTION_USER_ACTION1:
6511 case ACTION_USER_ACTION2:
6512 case ACTION_USER_ACTION3:
6518 fc_assert(act >= 0 && act < ACTION_COUNT);
6530 switch (
static_cast<enum gen_action
>(act)) {
6531 case ACTION_SPY_POISON:
6532 case ACTION_SPY_POISON_ESC:
6533 case ACTION_SPY_SABOTAGE_UNIT:
6534 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6535 case ACTION_SPY_BRIBE_UNIT:
6536 case ACTION_SPY_SABOTAGE_CITY:
6537 case ACTION_SPY_SABOTAGE_CITY_ESC:
6538 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6539 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6540 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6541 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6542 case ACTION_SPY_INCITE_CITY:
6543 case ACTION_SPY_INCITE_CITY_ESC:
6544 case ACTION_ESTABLISH_EMBASSY:
6545 case ACTION_ESTABLISH_EMBASSY_STAY:
6546 case ACTION_SPY_STEAL_TECH:
6547 case ACTION_SPY_STEAL_TECH_ESC:
6548 case ACTION_SPY_TARGETED_STEAL_TECH:
6549 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6550 case ACTION_SPY_INVESTIGATE_CITY:
6551 case ACTION_INV_CITY_SPEND:
6552 case ACTION_SPY_STEAL_GOLD:
6553 case ACTION_SPY_STEAL_GOLD_ESC:
6554 case ACTION_SPY_SPREAD_PLAGUE:
6555 case ACTION_STEAL_MAPS:
6556 case ACTION_STEAL_MAPS_ESC:
6557 case ACTION_TRADE_ROUTE:
6558 case ACTION_MARKETPLACE:
6559 case ACTION_CAPTURE_UNITS:
6560 case ACTION_EXPEL_UNIT:
6561 case ACTION_FOUND_CITY:
6562 case ACTION_JOIN_CITY:
6563 case ACTION_SPY_NUKE:
6564 case ACTION_SPY_NUKE_ESC:
6565 case ACTION_DESTROY_CITY:
6566 case ACTION_DISBAND_UNIT:
6567 case ACTION_HOME_CITY:
6568 case ACTION_UPGRADE_UNIT:
6569 case ACTION_PARADROP:
6571 case ACTION_SUICIDE_ATTACK:
6572 case ACTION_STRIKE_BUILDING:
6573 case ACTION_STRIKE_PRODUCTION:
6574 case ACTION_CONQUER_CITY:
6575 case ACTION_CONQUER_CITY2:
6576 case ACTION_HEAL_UNIT:
6577 case ACTION_TRANSFORM_TERRAIN:
6578 case ACTION_CULTIVATE:
6580 case ACTION_PILLAGE:
6581 case ACTION_CLEAN_POLLUTION:
6582 case ACTION_CLEAN_FALLOUT:
6583 case ACTION_FORTIFY:
6585 case ACTION_CONVERT:
6588 case ACTION_IRRIGATE:
6589 case ACTION_TRANSPORT_ALIGHT:
6590 case ACTION_TRANSPORT_BOARD:
6591 case ACTION_TRANSPORT_EMBARK:
6592 case ACTION_TRANSPORT_UNLOAD:
6593 case ACTION_TRANSPORT_DISEMBARK1:
6594 case ACTION_TRANSPORT_DISEMBARK2:
6595 case ACTION_SPY_ATTACK:
6598 case ACTION_HELP_WONDER:
6599 return "help_wonder_max_range";
6600 case ACTION_RECYCLE_UNIT:
6601 return "recycle_unit_max_range";
6602 case ACTION_BOMBARD:
6603 return "bombard_max_range";
6604 case ACTION_BOMBARD2:
6605 return "bombard_2_max_range";
6606 case ACTION_BOMBARD3:
6607 return "bombard_3_max_range";
6609 return "explode_nuclear_max_range";
6610 case ACTION_NUKE_CITY:
6611 return "nuke_city_max_range";
6612 case ACTION_NUKE_UNITS:
6613 return "nuke_units_max_range";
6614 case ACTION_AIRLIFT:
6615 return "airlift_max_range";
6616 case ACTION_USER_ACTION1:
6617 return "user_action_1_max_range";
6618 case ACTION_USER_ACTION2:
6619 return "user_action_2_max_range";
6620 case ACTION_USER_ACTION3:
6621 return "user_action_3_max_range";
6626 fc_assert(act >= 0 && act < ACTION_COUNT);
6635 switch (
static_cast<enum gen_action
>(act)) {
6636 case ACTION_SPY_POISON:
6637 case ACTION_SPY_POISON_ESC:
6638 case ACTION_SPY_SABOTAGE_UNIT:
6639 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6640 case ACTION_SPY_BRIBE_UNIT:
6641 case ACTION_SPY_SABOTAGE_CITY:
6642 case ACTION_SPY_SABOTAGE_CITY_ESC:
6643 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6644 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6645 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6646 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6647 case ACTION_SPY_INCITE_CITY:
6648 case ACTION_SPY_INCITE_CITY_ESC:
6649 case ACTION_ESTABLISH_EMBASSY:
6650 case ACTION_ESTABLISH_EMBASSY_STAY:
6651 case ACTION_SPY_STEAL_TECH:
6652 case ACTION_SPY_STEAL_TECH_ESC:
6653 case ACTION_SPY_TARGETED_STEAL_TECH:
6654 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6655 case ACTION_SPY_INVESTIGATE_CITY:
6656 case ACTION_INV_CITY_SPEND:
6657 case ACTION_SPY_STEAL_GOLD:
6658 case ACTION_SPY_STEAL_GOLD_ESC:
6659 case ACTION_STEAL_MAPS:
6660 case ACTION_STEAL_MAPS_ESC:
6661 case ACTION_SPY_SPREAD_PLAGUE:
6662 case ACTION_TRADE_ROUTE:
6663 case ACTION_MARKETPLACE:
6664 case ACTION_CAPTURE_UNITS:
6665 case ACTION_EXPEL_UNIT:
6666 case ACTION_FOUND_CITY:
6667 case ACTION_JOIN_CITY:
6668 case ACTION_SPY_NUKE:
6669 case ACTION_SPY_NUKE_ESC:
6670 case ACTION_DESTROY_CITY:
6671 case ACTION_DISBAND_UNIT:
6672 case ACTION_HOME_CITY:
6673 case ACTION_UPGRADE_UNIT:
6674 case ACTION_PARADROP:
6676 case ACTION_SUICIDE_ATTACK:
6677 case ACTION_STRIKE_BUILDING:
6678 case ACTION_STRIKE_PRODUCTION:
6679 case ACTION_CONQUER_CITY:
6680 case ACTION_CONQUER_CITY2:
6681 case ACTION_HEAL_UNIT:
6682 case ACTION_TRANSFORM_TERRAIN:
6683 case ACTION_CULTIVATE:
6685 case ACTION_PILLAGE:
6686 case ACTION_CLEAN_POLLUTION:
6687 case ACTION_CLEAN_FALLOUT:
6688 case ACTION_FORTIFY:
6690 case ACTION_CONVERT:
6693 case ACTION_IRRIGATE:
6694 case ACTION_TRANSPORT_ALIGHT:
6695 case ACTION_TRANSPORT_BOARD:
6696 case ACTION_TRANSPORT_EMBARK:
6697 case ACTION_TRANSPORT_UNLOAD:
6698 case ACTION_TRANSPORT_DISEMBARK1:
6699 case ACTION_TRANSPORT_DISEMBARK2:
6700 case ACTION_SPY_ATTACK:
6704 case ACTION_HELP_WONDER:
6705 case ACTION_RECYCLE_UNIT:
6707 case ACTION_BOMBARD:
6708 case ACTION_BOMBARD2:
6709 case ACTION_BOMBARD3:
6713 case ACTION_NUKE_CITY:
6714 case ACTION_NUKE_UNITS:
6716 case ACTION_AIRLIFT:
6718 case ACTION_USER_ACTION1:
6719 case ACTION_USER_ACTION2:
6720 case ACTION_USER_ACTION3:
6726 fc_assert(act >= 0 && act < ACTION_COUNT);
6738 switch (
static_cast<enum gen_action
>(act)) {
6739 case ACTION_SPY_POISON:
6740 case ACTION_SPY_POISON_ESC:
6741 case ACTION_SPY_SABOTAGE_UNIT:
6742 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6743 case ACTION_SPY_BRIBE_UNIT:
6744 case ACTION_SPY_SABOTAGE_CITY:
6745 case ACTION_SPY_SABOTAGE_CITY_ESC:
6746 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6747 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6748 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6749 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6750 case ACTION_SPY_INCITE_CITY:
6751 case ACTION_SPY_INCITE_CITY_ESC:
6752 case ACTION_ESTABLISH_EMBASSY:
6753 case ACTION_ESTABLISH_EMBASSY_STAY:
6754 case ACTION_SPY_STEAL_TECH:
6755 case ACTION_SPY_STEAL_TECH_ESC:
6756 case ACTION_SPY_TARGETED_STEAL_TECH:
6757 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6758 case ACTION_SPY_INVESTIGATE_CITY:
6759 case ACTION_INV_CITY_SPEND:
6760 case ACTION_SPY_STEAL_GOLD:
6761 case ACTION_SPY_STEAL_GOLD_ESC:
6762 case ACTION_SPY_SPREAD_PLAGUE:
6763 case ACTION_STEAL_MAPS:
6764 case ACTION_STEAL_MAPS_ESC:
6765 case ACTION_TRADE_ROUTE:
6766 case ACTION_MARKETPLACE:
6767 case ACTION_HELP_WONDER:
6768 case ACTION_CAPTURE_UNITS:
6769 case ACTION_EXPEL_UNIT:
6770 case ACTION_FOUND_CITY:
6771 case ACTION_JOIN_CITY:
6772 case ACTION_SPY_NUKE:
6773 case ACTION_SPY_NUKE_ESC:
6774 case ACTION_NUKE_CITY:
6775 case ACTION_NUKE_UNITS:
6776 case ACTION_DESTROY_CITY:
6777 case ACTION_RECYCLE_UNIT:
6778 case ACTION_DISBAND_UNIT:
6779 case ACTION_HOME_CITY:
6780 case ACTION_UPGRADE_UNIT:
6781 case ACTION_PARADROP:
6782 case ACTION_AIRLIFT:
6784 case ACTION_SUICIDE_ATTACK:
6785 case ACTION_STRIKE_BUILDING:
6786 case ACTION_STRIKE_PRODUCTION:
6787 case ACTION_CONQUER_CITY:
6788 case ACTION_CONQUER_CITY2:
6789 case ACTION_HEAL_UNIT:
6790 case ACTION_TRANSFORM_TERRAIN:
6791 case ACTION_CULTIVATE:
6793 case ACTION_PILLAGE:
6794 case ACTION_CLEAN_POLLUTION:
6795 case ACTION_CLEAN_FALLOUT:
6796 case ACTION_FORTIFY:
6798 case ACTION_CONVERT:
6801 case ACTION_IRRIGATE:
6802 case ACTION_TRANSPORT_ALIGHT:
6803 case ACTION_TRANSPORT_BOARD:
6804 case ACTION_TRANSPORT_EMBARK:
6805 case ACTION_TRANSPORT_UNLOAD:
6806 case ACTION_TRANSPORT_DISEMBARK1:
6807 case ACTION_TRANSPORT_DISEMBARK2:
6808 case ACTION_BOMBARD:
6809 case ACTION_BOMBARD2:
6810 case ACTION_BOMBARD3:
6812 case ACTION_SPY_ATTACK:
6815 case ACTION_USER_ACTION1:
6816 return "user_action_1_target_kind";
6817 case ACTION_USER_ACTION2:
6818 return "user_action_2_target_kind";
6819 case ACTION_USER_ACTION3:
6820 return "user_action_3_target_kind";
6825 fc_assert(act >= 0 && act < ACTION_COUNT);
6838 switch (
static_cast<enum gen_action
>(act)) {
6839 case ACTION_SPY_POISON:
6840 case ACTION_SPY_POISON_ESC:
6841 case ACTION_SPY_SABOTAGE_UNIT:
6842 case ACTION_SPY_SABOTAGE_UNIT_ESC:
6843 case ACTION_SPY_BRIBE_UNIT:
6844 case ACTION_SPY_SABOTAGE_CITY:
6845 case ACTION_SPY_SABOTAGE_CITY_ESC:
6846 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
6847 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
6848 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
6849 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
6850 case ACTION_SPY_INCITE_CITY:
6851 case ACTION_SPY_INCITE_CITY_ESC:
6852 case ACTION_ESTABLISH_EMBASSY:
6853 case ACTION_ESTABLISH_EMBASSY_STAY:
6854 case ACTION_SPY_STEAL_TECH:
6855 case ACTION_SPY_STEAL_TECH_ESC:
6856 case ACTION_SPY_TARGETED_STEAL_TECH:
6857 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
6858 case ACTION_SPY_INVESTIGATE_CITY:
6859 case ACTION_INV_CITY_SPEND:
6860 case ACTION_SPY_STEAL_GOLD:
6861 case ACTION_SPY_STEAL_GOLD_ESC:
6862 case ACTION_STEAL_MAPS:
6863 case ACTION_STEAL_MAPS_ESC:
6864 case ACTION_TRADE_ROUTE:
6865 case ACTION_MARKETPLACE:
6866 case ACTION_HELP_WONDER:
6867 case ACTION_CAPTURE_UNITS:
6868 case ACTION_EXPEL_UNIT:
6869 case ACTION_FOUND_CITY:
6870 case ACTION_JOIN_CITY:
6871 case ACTION_SPY_NUKE:
6872 case ACTION_SPY_NUKE_ESC:
6873 case ACTION_NUKE_CITY:
6874 case ACTION_NUKE_UNITS:
6875 case ACTION_DESTROY_CITY:
6876 case ACTION_RECYCLE_UNIT:
6877 case ACTION_DISBAND_UNIT:
6878 case ACTION_HOME_CITY:
6879 case ACTION_UPGRADE_UNIT:
6880 case ACTION_PARADROP:
6881 case ACTION_AIRLIFT:
6883 case ACTION_SUICIDE_ATTACK:
6884 case ACTION_STRIKE_BUILDING:
6885 case ACTION_STRIKE_PRODUCTION:
6886 case ACTION_CONQUER_CITY:
6887 case ACTION_CONQUER_CITY2:
6888 case ACTION_HEAL_UNIT:
6889 case ACTION_TRANSFORM_TERRAIN:
6890 case ACTION_CULTIVATE:
6892 case ACTION_PILLAGE:
6893 case ACTION_CLEAN_POLLUTION:
6894 case ACTION_CLEAN_FALLOUT:
6895 case ACTION_FORTIFY:
6897 case ACTION_CONVERT:
6900 case ACTION_IRRIGATE:
6901 case ACTION_TRANSPORT_ALIGHT:
6902 case ACTION_TRANSPORT_BOARD:
6903 case ACTION_TRANSPORT_EMBARK:
6904 case ACTION_TRANSPORT_UNLOAD:
6905 case ACTION_TRANSPORT_DISEMBARK1:
6906 case ACTION_TRANSPORT_DISEMBARK2:
6907 case ACTION_BOMBARD:
6908 case ACTION_BOMBARD2:
6909 case ACTION_BOMBARD3:
6911 case ACTION_SPY_ATTACK:
6914 case ACTION_SPY_SPREAD_PLAGUE:
6915 return "spread_plague_actor_consuming_always";
6916 case ACTION_USER_ACTION1:
6917 return "user_action_1_actor_consuming_always";
6918 case ACTION_USER_ACTION2:
6919 return "user_action_2_actor_consuming_always";
6920 case ACTION_USER_ACTION3:
6921 return "user_action_3_actor_consuming_always";
6926 fc_assert(act >= 0 && act < ACTION_COUNT);
6943 bool accept_all_actions)
6945 if (
actor ==
nullptr || target ==
nullptr) {
6984 bool accept_all_actions)
7009 bool accept_all_actions)
7011 if (actor ==
nullptr || target ==
nullptr) {
7051 bool accept_all_actions)
7080 bool accept_all_actions)
7082 if (actor ==
nullptr || target ==
nullptr) {
7143 const struct tile *tgt_tile,
7145 bool accept_all_actions)
7147 if (actor ==
nullptr || tgt_tile ==
nullptr || tgt_extra ==
nullptr) {
7192 const struct tile *target_tile,
7193 bool accept_all_actions)
7198 accept_all_actions)) {
bool action_removes_extra(const struct action *paction, const struct extra_type *pextra)
Returns TRUE iff the specified action can remove the specified extra.
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
Returns TRUE if the wanted action can be done to the target city.
static struct action * actions[MAX_NUM_ACTIONS]
static struct req_vec_problem * enabler_tile_tgt_local_diplrel_implies_claimed(const struct action_enabler *enabler)
Detects a local DiplRel requirement in a tile targeted action without an explicit claimed requirement...
bool is_action_enabled_unit_on_unit(const action_id wanted_action, const struct unit *actor_unit, const struct unit *target_unit)
Returns TRUE if actor_unit can do wanted_action to target_unit as far as action enablers are concerne...
bool action_distance_inside_max(const struct action *action, const int distance)
Returns TRUE iff the specified distance between actor and target is sm,aller or equal to the max rang...
static void oblig_hard_req_reg(struct ae_contra_or *contras, const char *error_message,...)
Register an obligatory hard requirement for the specified action results.
static bool is_enabler_active(const struct action_enabler *enabler, const struct player *actor_player, const struct city *actor_city, const struct impr_type *actor_building, const struct tile *actor_tile, const struct unit *actor_unit, const struct unit_type *actor_unittype, const struct output_type *actor_output, const struct specialist *actor_specialist, const struct player *target_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist)
Return TRUE iff the action enabler is active.
static void voblig_hard_req_reg(struct ae_contra_or *contras, const char *error_message, va_list args)
Register an obligatory hard requirement for the specified action results.
const char * action_max_range_ruleset_var_name(int act)
Return max range ruleset variable name for the action or nullptr if max range can't be set in the rul...
bool action_mp_full_makes_legal(const struct unit *actor, const action_id act_id)
Returns TRUE if the specified action can't be done now but would have been legal if the unit had full...
static struct act_prob act_prob_unseen_target(action_id act_id, const struct unit *actor_unit)
Returns the action probability for when a target is unseen.
enum action_actor_kind action_get_actor_kind(const struct action *paction)
Get the actor kind of an action.
const char * action_rule_name(const struct action *action)
Get the rule name of the action.
static struct action * action_new(action_id id, enum action_result result, enum action_target_kind target_kind, enum action_sub_target_kind sub_target_kind, enum act_tgt_compl tgt_compl, const int min_distance, const int max_distance, bool actor_consuming_always)
Create a new action.
void actions_init()
Initialize the actions and the action enablers.
req_vec_num_in_item action_enabler_vector_number(const void *enabler, const struct requirement_vector *vec)
Returns the requirement vector number of the specified requirement vector in the specified action ena...
const QString action_prepare_ui_name(action_id act_id, const char *mnemonic, const struct act_prob prob, const QString &custom)
Get the UI name ready to show the action in the UI.
bool action_has_complex_target(const struct action *paction)
Returns TRUE iff the specified action allows the player to provide details in addition to actor and t...
struct act_prob action_prob_self(const struct unit *actor_unit, const action_id act_id)
Get the actor unit's probability of successfully performing the chosen action on itself.
bool action_prob_possible(const struct act_prob probability)
Returns TRUE iff the given action probability belongs to an action that may be possible.
#define ACTPROB_VAL_NOT_IMPL
struct action_auto_perf auto_perfs[MAX_NUM_ACTION_AUTO_PERFORMERS]
struct act_prob action_prob_new_certain()
Returns the certain action probability.
static struct act_prob action_prob_vs_units_full(const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct tile *target_tile)
Get the actor unit's probability of successfully performing the chosen action on all units at the tar...
static bool is_action_enabled(const action_id wanted_action, const struct player *actor_player, const struct city *actor_city, const struct impr_type *actor_building, const struct tile *actor_tile, const struct unit *actor_unit, const struct unit_type *actor_unittype, const struct output_type *actor_output, const struct specialist *actor_specialist, const struct player *target_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct extra_type *target_extra, const struct city *actor_home)
Returns TRUE if the wanted action is enabled.
struct extra_type * action_tgt_tile_extra(const struct unit *actor, const struct tile *target_tile, bool accept_all_actions)
Find an extra to target for an action at the specified tile.
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
Create a new copy of an existing action enabler.
void action_list_end(action_id *act_list, int size)
Terminate an action list of the specified size.
struct unit * action_tgt_unit(struct unit *actor, struct tile *target_tile, bool accept_all_actions)
Find a unit to target for an action at the specified tile.
struct city * action_tgt_city(struct unit *actor, struct tile *target_tile, bool accept_all_actions)
Find a city to target for an action on the specified tile.
static bool is_action_enabled_unit_on_self_full(const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile)
Returns TRUE if actor_unit can do wanted_action to itself as far as action enablers are concerned.
int action_dice_roll_odds(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct player *tgt_player, const struct action *paction)
Returns the odds of an action not failing its dice roll.
bool is_action_enabled_unit_on_self(const action_id wanted_action, const struct unit *actor_unit)
Returns TRUE if actor_unit can do wanted_action to itself as far as action enablers are concerned.
int action_get_act_time(const struct action *paction, const struct unit *actor_unit, const struct tile *tgt_tile, const struct extra_type *tgt_extra)
Returns the unit activity time (work) this action takes (requires) or ACT_TIME_INSTANTANEOUS if the a...
bool is_action_enabled_unit_on_city(const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
Returns TRUE if actor_unit can do wanted_action to target_city as far as action enablers are concerne...
static QString action_prob_to_text(const struct act_prob prob)
Returns a text representation of the action probability prob unless it is a signal.
static bool is_target_possible(const action_id wanted_action, const struct player *actor_player, const struct player *target_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist)
Returns TRUE if the wanted action can be done to the target.
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
Returns a suggestion to fix the specified action enabler or nullptr if no fix is found to be needed.
struct act_prob action_prob_unit_vs_tgt(const struct action *paction, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct extra_type *extra_tgt)
Returns the actor unit's probability of successfully performing the specified action against the acti...
static bool may_unit_act_vs_city(struct unit *actor, struct city *target, bool accept_all_actions)
Returns TRUE iff, from the point of view of the owner of the actor unit, it looks like the actor unit...
struct act_prob action_prob_new_not_relevant()
Returns the n/a action probability.
const char * action_ui_name_ruleset_var_name(int act)
Return ui_name ruleset variable name for the action.
void actions_free()
Free the actions and the action enablers.
bool are_action_probabilitys_equal(const struct act_prob *ap1, const struct act_prob *ap2)
Returns TRUE iff ap1 and ap2 are equal.
struct act_prob action_prob_vs_city(const struct unit *actor_unit, const action_id act_id, const struct city *target_city)
Get the actor unit's probability of successfully performing the chosen action on the target city.
const QString action_prob_explain(const struct act_prob prob)
Explain an action probability in a way suitable for a tool tip for the button that starts it.
static bool is_action_enabled_unit_on_units_full(const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct tile *target_tile)
Returns TRUE if actor_unit can do wanted_action to all units on the target_tile as far as action enab...
struct act_prob action_prob_vs_unit(const struct unit *actor_unit, const action_id act_id, const struct unit *target_unit)
Get the actor unit's probability of successfully performing the chosen action on the target unit.
struct act_prob action_prob_new_not_impl()
Returns the "not implemented" action probability.
const char * action_ui_name_default(int act)
Return default ui_name for the action.
enum action_battle_kind action_get_battle_kind(const struct action *pact)
Get the battle kind that can prevent an action.
struct req_vec_problem * action_enabler_suggest_repair_oblig(const struct action_enabler *enabler)
Returns a suggestion to add an obligatory hard requirement to an action enabler or nullptr if no hard...
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Get the sub target kind of an action.
static bool action_prob_not_relevant(const struct act_prob probability)
Returns TRUE iff the given action probability represents the lack of an action probability.
void action_enabler_free(struct action_enabler *enabler)
Free resources allocated for the action enabler.
struct act_prob action_prob_vs_tile(const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
Get the actor unit's probability of successfully performing the chosen action on the target tile.
static void ae_contra_close(struct ae_contra_or *contra)
Tell an ae_contra_or that one of its users is done with it.
static enum fc_tristate action_enabled_local(const action_id wanted_action, const struct player *actor_player, const struct city *actor_city, const struct impr_type *actor_building, const struct tile *actor_tile, const struct unit *actor_unit, const struct output_type *actor_output, const struct specialist *actor_specialist, const struct player *target_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct output_type *target_output, const struct specialist *target_specialist)
Find out if the action is enabled, may be enabled or isn't enabled given what the player owning the a...
static void hard_code_oblig_hard_reqs()
Hard code the obligatory hard requirements that don't depend on the rest of the ruleset.
static struct act_prob action_prob_vs_city_full(const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct city *target_city)
Get the actor unit's probability of successfully performing the chosen action on the target city.
int action_max_range_default(int act)
Return default max range for the action if it is ruleset settable.
static enum fc_tristate tech_can_be_stolen(const struct player *actor_player, const struct player *target_player)
Does the target has any techs the actor don't?
struct tile * action_tgt_tile(struct unit *actor, struct tile *target, const struct extra_type *target_extra, bool accept_all_actions)
Returns the tile iff it, from the point of view of the owner of the actor unit, looks like a target t...
struct act_prob action_prob_vs_units(const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile)
Get the actor unit's probability of successfully performing the chosen action on all units at the tar...
static struct act_prob action_prob_vs_unit_full(const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct unit *target_unit)
Get the actor unit's probability of successfully performing the chosen action on the target unit.
int action_number(const struct action *action)
Get the universal number of the action.
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
Return actor consuming always ruleset variable name for the action or nullptr if actor consuming alwa...
bool is_action_enabled_unit_on_units(const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile)
Returns TRUE if actor_unit can do wanted_action to all units on the target_tile as far as action enab...
const char * action_min_range_ruleset_var_name(int act)
Return min range ruleset variable name for the action or nullptr if min range can't be set in the rul...
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
Returns TRUE iff blocked will be illegal if blocker is legal.
static struct obligatory_req_vector obligatory_hard_reqs[ACTRES_NONE]
struct action * action_by_rule_name(const char *name)
Return the action with the given name.
const QString action_name_translation(const struct action *action)
Get the action name used when displaying the action in the UI.
static void oblig_hard_req_register(const struct requirement &contradiction, bool is_target, const char *error_message,...)
Register an obligatory hard requirement for the action results it applies to.
struct act_prob action_speculate_unit_on_self(action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat)
Returns a speculation about the actor unit's probability of successfully performing the chosen action...
FC_STATIC_ASSERT(MAP_DISTANCE_MAX<=ACTION_DISTANCE_LAST_NON_SIGNAL, action_range_can_not_cover_the_whole_map)
static struct action * unit_action_new(action_id id, enum action_result result, enum action_target_kind target_kind, enum action_sub_target_kind sub_target_kind, enum act_tgt_compl tgt_compl, bool rare_pop_up, bool unitwaittime_controlled, enum moves_actor_kind moves_actor, const int min_distance, const int max_distance, bool actor_consuming_always)
Create a new action performed by a unit actor.
static bool action_prob_not_impl(const struct act_prob probability)
Returns TRUE iff the given action probability represents that support for finding this action probabi...
bool action_maybe_possible_actor_unit(const action_id act_id, const struct unit *actor_unit)
Returns TRUE if the wanted action (as far as the player knows) can be performed right now by the spec...
static bool actions_initialized
bool action_immune_government(struct government *gov, action_id act)
Will a player with the government gov be immune to the action act?
struct action * action_is_blocked_by(const action_id act_id, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city_arg, const struct unit *target_unit)
Returns the action that blocks the specified action or nullptr if the specified action isn't blocked.
static const struct tile * blocked_find_target_tile(const action_id act_id, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city, const struct unit *target_unit)
Returns the target tile for actions that may block the specified action.
static bool is_effect_val_known(enum effect_type effect_type, const struct player *pow_player, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct output_type *target_output, const struct specialist *target_specialist)
Find out if the effect value is known.
static struct req_vec_problem * enabler_first_self_contradiction(const struct action_enabler *enabler)
Returns the first action enabler specific contradiction in the specified enabler or nullptr if no ena...
static struct act_prob ap_dipl_battle_win(const struct unit *pattacker, const struct unit *pdefender)
The action probability that pattacker will win a diplomatic battle.
static bool action_actor_utype_hard_reqs_ok_full(enum action_result result, const struct unit_type *actor_unittype, bool ignore_third_party)
Returns TRUE if the specified unit type can perform an action with the wanted result given that an ac...
static const struct impr_type * tgt_city_local_building(const struct city *target_city)
Returns the local building type of a city target.
int action_dice_roll_initial_odds(const struct action *paction)
Returns the initial odds of an action not failing its dice roll.
struct act_prob action_prob_fall_back(const struct act_prob *ap1, const struct act_prob *ap2)
Returns ap1 with ap2 as fall back in cases where ap1 doesn't happen.
#define obligatory_req_vector_iterate_end
bool actions_are_ready()
Returns TRUE iff the actions are initialized.
static void hard_code_oblig_hard_reqs_ruleset()
Hard code the obligatory hard requirements that needs access to the ruleset before they can be genera...
static bool plr_sees_tile(const struct player *plr, const struct tile *ttile)
Returns TRUE iff the specified player can see the specified tile.
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item number)
Returns a writable pointer to the specified requirement vector in the action enabler or nullptr if th...
void action_list_add_all_by_result(action_id *act_list, int *position, enum action_result result)
Add all actions with the specified result to the specified action list starting at the specified posi...
static struct act_prob action_prob_self_full(const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id)
Get the actor unit's probability of successfully performing the chosen action on itself.
struct act_prob action_speculate_unit_on_units(action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target)
Returns a speculation about the actor unit's probability of successfully performing the chosen action...
bool action_univs_not_blocking(const struct action *paction, struct universal *actor_uni, struct universal *target_uni)
Is there any action enablers of the given type not blocked by universals?
static const struct unit_type * tgt_city_local_utype(const struct city *target_city)
Returns the local unit type of a city target.
struct act_prob action_speculate_unit_on_city(const action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, const bool omniscient_cheat, const struct city *target)
Returns a speculation about the actor unit's probability of successfully performing the chosen action...
bool is_action_enabled_unit_on_tile(const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
Returns TRUE if actor_unit can do wanted_action to the target_tile as far as action enablers are conc...
static struct act_prob action_prob(const action_id wanted_action, const struct player *actor_player, const struct city *actor_city, const struct impr_type *actor_building, const struct tile *actor_tile, const struct unit *actor_unit, const struct unit_type *actor_unittype_p, const struct output_type *actor_output, const struct specialist *actor_specialist, const struct city *actor_home, const struct player *target_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype_p, const struct output_type *target_output, const struct specialist *target_specialist, const struct extra_type *target_extra)
An action's probability of success.
const struct action_auto_perf * action_auto_perf_by_number(const int num)
Returns action auto performer rule number num.
const QString action_id_name_translation(action_id act_id)
Get the action name used when displaying the action in the UI.
#define obligatory_req_vector_iterate(obreq_vec, pobreq)
const char * action_target_kind_ruleset_var_name(int act)
Return target kind ruleset variable name for the action or nullptr if min range can't be set in the r...
struct action_enabler * action_enabler_new()
Create a new action enabler.
static struct action_enabler_list * action_enablers_by_action[MAX_NUM_ACTIONS]
void action_enabler_add(struct action_enabler *enabler)
Add an action enabler to the current ruleset.
static struct requirement * req_vec_first_contradiction_in_vec(const struct requirement *req, const struct requirement_vector *vec)
Returns the first requirement in the specified requirement vector that contradicts the specified requ...
struct action * action_by_number(action_id act_id)
Return the action with the given id.
enum unit_activity action_get_activity(const struct action *paction)
Returns the unit activity this action may cause or ACTIVITY_LAST if the action doesn't result in a un...
#define ACTPROB_VAL_1_PCT
bool action_actor_utype_hard_reqs_ok(enum action_result result, const struct unit_type *actor_unittype)
Returns TRUE if the specified unit type can perform an action with the wanted result given that an ac...
bool action_requires_details(const struct action *paction)
Returns TRUE iff the specified action REQUIRES the player to provide details in addition to actor and...
static struct ae_contra_or * req_contradiction_or(int alternatives,...)
Returns a new array of alternative action enabler contradictions.
int action_get_role(const struct action *paction)
Get the unit type role corresponding to the ability to do the specified action.
int action_min_range_default(int act)
Return default min range for the action if it is ruleset settable.
static const struct city * blocked_find_target_city(const action_id act_id, const struct unit *actor_unit, const struct tile *target_tile, const struct city *target_city_arg, const struct unit *target_unit)
Returns the target city for actions that may block the specified action.
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
Returns a suggestion to improve the specified action enabler or nullptr if nothing to improve is foun...
struct act_prob action_prob_new_impossible()
Returns the impossible action probability.
bool action_id_exists(const action_id act_id)
Returns TRUE iff the specified action ID refers to a valid action.
static bool may_unit_act_vs_unit(struct unit *actor, struct unit *target, bool accept_all_actions)
Returns TRUE iff, from the point of view of the owner of the actor unit, it looks like the actor unit...
static struct requirement * req_vec_first_local_diplrel(const struct requirement_vector *vec)
Returns the first local DiplRel requirement in the specified requirement vector or nullptr if it does...
bool action_enabler_remove(struct action_enabler *enabler)
Remove an action enabler from the current ruleset.
enum action_target_kind action_get_target_kind(const struct action *paction)
Get the target kind of an action.
static bool is_action_enabled_unit_on_city_full(const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct city *target_city)
Returns TRUE if actor_unit can do wanted_action to target_city as far as action enablers are concerne...
bool action_has_result(const struct action *paction, enum action_result result)
Returns TRUE iff performing the specified action has the specified result.
static bool action_prob_is_signal(const struct act_prob probability)
Returns TRUE iff the given action probability represents a special signal value rather than a regular...
static struct act_prob ap_diplomat_battle(const struct unit *pattacker, const struct unit *pvictim, const struct tile *tgt_tile)
The action probability that pattacker will win a diplomatic battle.
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
Returns the name of the given requirement vector number n in an action enabler or nullptr if enablers...
static bool plr_knows_tile(const struct player *plr, const struct tile *ttile)
Returns TRUE iff the specified player knows (has seen) the specified tile.
bool action_creates_extra(const struct action *paction, const struct extra_type *pextra)
Returns TRUE iff the specified action can create the specified extra.
void actions_rs_pre_san_gen()
Generate action related data based on the currently loaded ruleset.
int action_prob_cmp_pessimist(const struct act_prob ap1, const struct act_prob ap2)
Compare action probabilities.
static bool is_action_enabled_unit_on_tile_full(const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct tile *target_tile, const struct extra_type *target_extra)
Returns TRUE if actor_unit can do wanted_action to the target_tile as far as action enablers are conc...
bool action_id_is_rare_pop_up(action_id act_id)
Returns TRUE iff a unit's ability to perform this action will pop up the action selection dialog befo...
struct act_prob action_speculate_unit_on_tile(action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target_tile, const struct extra_type *target_extra)
Returns a speculation about the actor unit's probability of successfully performing the chosen action...
static enum fc_tristate action_hard_reqs_actor(enum action_result result, const struct player *actor_player, const struct city *actor_city, const struct impr_type *actor_building, const struct tile *actor_tile, const struct unit *actor_unit, const struct unit_type *actor_unittype, const struct output_type *actor_output, const struct specialist *actor_specialist, const bool omniscient, const struct city *homecity)
Returns TRUE iff the wanted action is possible as far as the actor is concerned given that an action ...
static struct req_vec_problem * enabler_first_clarification(const struct action_enabler *enabler)
Returns the first action enabler specific clarification possibility in the specified enabler or nullp...
struct action_auto_perf * action_auto_perf_slot_number(const int num)
Returns action auto performer rule slot number num so it can be filled.
double action_prob_to_0_to_1_pessimist(const struct act_prob ap)
Returns double in the range [0-1] representing the minimum of the given action probability.
struct act_prob action_prob_new_unknown()
Returns the "user don't know" action probability.
static struct act_prob action_prob_vs_tile_full(const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
Get the actor unit's probability of successfully performing the chosen action on the target tile.
const char * action_id_rule_name(action_id act_id)
Get the rule name of the action.
bool is_action_possible_on_unit(action_id act_id, const unit *target_unit)
Checks if there is any hopes that the action is possible against the target unit (by chacking the tar...
static enum fc_tristate is_action_possible(const action_id wanted_action, const struct player *actor_player, const struct city *actor_city, const struct impr_type *actor_building, const struct tile *actor_tile, const struct unit *actor_unit, const struct unit_type *actor_unittype, const struct output_type *actor_output, const struct specialist *actor_specialist, const struct player *target_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct extra_type *target_extra, const bool omniscient, const struct city *homecity)
Returns if the wanted action is possible given that an action enabler later will enable it.
bool action_distance_accepted(const struct action *action, const int distance)
Returns TRUE iff the specified distance between actor and target is within the range acceptable to th...
static void hard_code_actions()
Hard code the actions.
struct action_enabler_list * action_enablers_for_action(action_id action)
Get all enablers for an action in the current ruleset.
static bool is_action_enabled_unit_on_unit_full(const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct unit *target_unit)
Returns TRUE if actor_unit can do wanted_action to target_unit as far as action enablers are concerne...
static bool may_unit_act_vs_tile_extra(const struct unit *actor, const struct tile *tgt_tile, const struct extra_type *tgt_extra, bool accept_all_actions)
Returns TRUE iff, from the point of view of the owner of the actor unit, it looks like the actor unit...
#define ACTION_DISTANCE_MAX
#define ACTION_DISTANCE_LAST_NON_SIGNAL
#define action_enabler_list_iterate_end
#define ACTION_DISTANCE_UNLIMITED
#define action_iterate_end
#define action_id_would_be_blocked_by(blocked_id, blocker_id)
#define action_id_get_actor_kind(act_id)
#define ACTPROB_NOT_KNOWN
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_id_distance_accepted(act_id, distance)
#define ACTPROB_IMPOSSIBLE
#define ACTPROB_NOT_IMPLEMENTED
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define action_id_has_result_safe(act_id, result)
#define ACTION_ODDS_PCT_DICE_ROLL_NA
bool can_build_base(const struct unit *punit, const struct base_type *pbase, const struct tile *ptile)
Can unit build base to given tile?
bool BV_ISSET(const BV &bv, int bit)
#define BV_ISSET_ANY(vec)
bool citymindist_prevents_city_on_tile(const struct tile *ptile)
Returns TRUE iff it is illegal to found a city on the specified tile because of citymindist.
int city_production_build_shield_cost(const struct city *pcity)
Return the number of shields it takes to build current city production.
struct city * is_non_allied_city_tile(const struct tile *ptile, const struct player *pplayer)
Is there an non_allied city on this tile?
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
struct city * is_non_attack_city_tile(const struct tile *ptile, const struct player *pplayer)
Is there an enemy city on this tile?
int city_unit_slots_available(const struct city *pcity)
Return number of free unit slots in a city.
struct tile * city_tile(const struct city *pcity)
Return the tile location of the city.
bool city_can_grow_to(const struct city *pcity, int pop_size)
Return TRUE iff the city can grow to the given size.
citizens city_size_get(const struct city *pcity)
Get the city size.
struct unit * get_defender(const struct unit *attacker, const struct tile *ptile)
Finds the best defender on the tile, given an attacker.
enum unit_attack_result unit_attack_units_at_tile_result(const struct unit *punit, const struct tile *ptile)
Check if unit can attack unit stack at tile.
struct unit * get_diplomatic_defender(const struct unit *act_unit, const struct unit *pvictim, const struct tile *tgt_tile)
Returns the defender of the tile in a diplomatic battle or nullptr if no diplomatic defender could be...
double unit_win_chance(const struct unit *attacker, const struct unit *defender)
Returns a double in the range [0;1] indicating the attackers chance of winning.
bool can_unit_attack_tile(const struct unit *punit, const struct tile *dest_tile)
Is unit (1) diplomatically allowed to attack and (2) physically able to do so?
int get_target_bonus_effects(struct effect_list *plist, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, enum effect_type effect_type, enum vision_layer vision_layer, enum national_intelligence nintel)
Returns the effect bonus of a given type for any target.
const effect_list * get_effects()
Get a list of all effects.
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
const struct functions * fc_funcs
#define ACT_TIME_INSTANTANEOUS
#define MAX_NUM_ACTION_AUTO_PERFORMERS
struct city * game_city_by_number(int id)
Often used function to get a city pointer from a city ID.
#define RS_DEFAULT_EXPLODE_NUCLEAR_MAX_RANGE
#define RS_DEFAULT_ACTION_MIN_RANGE
#define RS_DEFAULT_ACTION_MAX_RANGE
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_msg(condition, message,...)
#define fc_assert_action_msg(condition, action, message,...)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define fc_assert_ret_val_msg(condition, val, message,...)
bv_extras get_tile_infrastructure_set(const struct tile *ptile, int *pcount)
Return a bitfield of the extras on the tile that are infrastructure.
bool terrain_surroundings_allow_change(const struct tile *ptile, const struct terrain *pterrain)
Returns FALSE if a terrain change to 'pterrain' would be prevented by not having enough similar terra...
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
Return real distance between two tiles.
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
Return TRUE iff the unit can "exist" at this location.
int unit_move_rate(const struct unit *punit)
This function calculates the move rate of the unit.
bool unit_could_load_at(const struct unit *punit, const struct tile *ptile)
Return whether we could find a suitable transporter for given unit at 'ptile'.
bool unit_can_move_to_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *dst_tile, bool igzoc, bool enter_enemy_city)
Returns whether the unit can move from its current tile to the destination tile.
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
Return TRUE iff transporter type has ability to transport transported class.
std::vector< nation_type > nations
Nation_type_id nation_index(const struct nation_type *pnation)
Return the nation index.
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
Returns which kind of barbarians can use this nation.
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
Checks if a unit can be seen by pplayer at its current location.
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
Returns true iff players can attack each other.
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
Returns TRUE iff pow_player can see externally visible features of target_city.
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
Returns true iff players are allied.
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
Check if pplayer could see all units on ptile if it had units.
bool pplayers_non_attack(const struct player *pplayer, const struct player *pplayer2)
Returns true iff players have peace, cease-fire, or armistice.
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
Return TRUE iff the player can see the city's internals.
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
Will the universal 'source' fulfill the requirements in the list? If 'check_necessary' is FALSE: are ...
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *descr,...)
Returns a new requirement vector problem with the specified number of suggested solutions and the spe...
struct req_vec_problem * req_vec_get_first_contradiction(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Returns the first self contradiction found in the specified requirement vector with suggested solutio...
struct requirement req_from_values(int type, int range, bool survives, bool present, bool quiet, int value)
Set the values of a req from serializable integers.
bool are_reqs_active(const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, const struct requirement_vector *reqs, const enum req_problem_type prob_type, const enum vision_layer vision_layer, const enum national_intelligence nintel)
Checks the requirement(s) to see if they are active on the given target.
QString req_to_fstring(const struct requirement *req)
Returns the given requirement as a formatted string ready for printing.
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
Returns TRUE if req1 and req2 contradicts each other.
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
Returns TRUE if the given requirement contradicts the given requirement vector.
#define requirement_fulfilled_by_unit_type(_ut_, _rqs_)
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
#define requirement_vector_iterate_end
#define requirement_fulfilled_by_government(_gov_, _rqs_)
#define requirement_vector_iterate(req_vec, preq)
struct research * research_get(const struct player *pplayer)
Returns the research structure associated with the player.
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
Returns state of the tech for current research.
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
Returns TRUE iff the given tech can be given to the players sharing the research immediately.
bool can_build_road(struct road_type *proad, const struct unit *punit, const struct tile *ptile)
Tells if unit can build road on tile.
server_setting_id server_setting_by_name(const char *name)
Returns the server setting with the specified name.
int server_setting_value_int_get(server_setting_id id)
Returns the value of the server setting with the specified id.
enum fc_tristate fc_tristate_and(enum fc_tristate one, enum fc_tristate two)
An AND function for fc_tristate.
#define CLIP(lower, current, upper)
#define BOOL_TO_TRISTATE(tri)
enum action_auto_perf_cause cause
action_id alternatives[MAX_NUM_ACTIONS]
struct requirement_vector actor_reqs
struct requirement_vector target_reqs
struct action::@10::@11 is_unit
bool unitwaittime_controlled
bool actor_consuming_always
enum action_sub_target_kind sub_target_kind
enum moves_actor_kind moves_actor
enum action_result result
char ui_name[MAX_LEN_NAME]
enum action_actor_kind actor_kind
enum act_tgt_compl target_complexity
enum action_target_kind target_kind
struct action_enabler_contradiction * alternative
struct universal production
struct packet_game_info info
struct packet_scenario_info scenario
int(* player_tile_city_id_get)(const struct tile *ptile, const struct player *pplayer)
struct ae_contra_or * contras
struct player_economic economic
req_vec_num_in_item vector_number
enum req_vec_change_operation operation
struct req_vec_change * suggested_solutions
struct terrain * irrigation_result
struct terrain * mining_result
struct terrain * transform_result
struct veteran_system * veteran
const struct unit_type * obsoleted_by
const struct unit_type * converted_to
struct extra_type * activity_target
const struct unit_type * utype
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.
Tech_type_id advance_number(const struct advance *padvance)
Return the advance index.
#define advance_iterate(_start, _p)
#define advance_iterate_end
struct extra_type * get_preferred_pillage(bv_extras extras)
Returns the highest-priority (best) extra to be pillaged from the terrain set.
#define terrain_has_flag(terr, flag)
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
Returns TRUE iff the target_tile is seen by pow_player.
int tile_activity_time(enum unit_activity activity, const struct tile *ptile, const struct extra_type *tgt)
Time to complete the given activity on the given tile.
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
Return a known_type enumeration value for the tile.
struct city * tile_city(const struct tile *ptile)
Return the city on this tile (or nullptr), checking for city center.
#define tile_terrain(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
bool can_cities_trade(const struct city *pc1, const struct city *pc2)
Return TRUE iff the two cities are capable of trade; i.e., if a caravan from one city can enter the o...
bool can_establish_trade_route(const struct city *pc1, const struct city *pc2)
Returns TRUE iff the two cities can establish a trade route.
const struct unit_type * utype
enum citytile_type citytile
const struct impr_type * building
enum unit_upgrade_result unit_upgrade_test(const struct unit *punit, bool is_free)
Tests if the unit could be updated.
struct unit * is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
Is there an non-allied unit on this tile?
struct unit * unit_transport_get(const struct unit *pcargo)
Returns the transporter of the unit or nullptr if it is not transported.
bool unit_contained_in(const struct unit *pcargo, const struct unit *ptrans)
Returns whether 'pcargo' is transported by 'ptrans', either directly or indirectly.
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
Return TRUE iff the given unit could be loaded into the transporter if we moved there.
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
Return TRUE iff this unit can do the specified generalized (ruleset defined) action enabler controlle...
bool unit_can_convert(const struct unit *punit)
Tests if unit can be converted to another type.
bv_extras get_unit_tile_pillage_set(const struct tile *ptile)
Return a mask of the extras which are actively (currently) being pillaged on the given tile.
int get_transporter_capacity(const struct unit *punit)
Return the number of units the transporter can hold (or 0).
enum unit_airlift_result test_unit_can_airlift_to(const struct player *restriction, const struct unit *punit, const struct city *pdest_city)
Determines if punit can be airlifted to dest_city now! So punit needs to be in a city now.
bool unit_transported(const struct unit *pcargo)
Returns TRUE iff the unit is transported.
bool can_unit_unload(const struct unit *pcargo, const struct unit *ptrans)
Return TRUE iff the given unit can be unloaded from its current transporter.
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
Return the unit type for this unit.
int utype_pop_value(const struct unit_type *punittype)
How much city shrinks when it builds unit of this type.
bool utype_may_act_move_frags(const struct unit_type *punit_type, const action_id act_id, const int move_fragments)
Return TRUE iff the given (action enabler controlled) action may be performed by a unit of the given ...
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
Returns TRUE iff the unit type is unique and the player already has one.
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
Return whether the unit has the given flag.
int unit_pop_value(const struct unit *punit)
How much population is put to building this unit.
bool utype_can_do_act_if_tgt_citytile(const struct unit_type *punit_type, const action_id act_id, const enum citytile_type prop, const bool is_there)
Returns TRUE iff the unit type can do the specified (action enabler controlled) action while its targ...
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
Return TRUE iff units of the given type can do the specified generalized (ruleset defined) action ena...
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
Return veteran level properties of given unit in given veterancy level.
#define unit_type_iterate(_p)
#define unit_type_iterate_end