71#define SPECVEC_TAG obligatory_req
72#define SPECVEC_TYPE struct obligatory_req
74#define obligatory_req_vector_iterate(obreq_vec, pobreq) \
75 TYPED_VECTOR_ITERATE(struct obligatory_req, obreq_vec, pobreq)
76#define obligatory_req_vector_iterate_end VECTOR_ITERATE_END
86#define ACTPROB_VAL_MIN 0
88#define ACTPROB_VAL_MAX 200
90#define ACTPROB_VAL_1_PCT (ACTPROB_VAL_MAX / 100)
92#define ACTPROB_VAL_NA 253
94#define ACTPROB_VAL_NOT_IMPL 254
111 enum action_result
result,
119static enum action_sub_target_kind
121static enum act_tgt_compl
123 enum action_target_kind tgt_kind,
124 enum action_sub_target_kind sub_tgt_kind);
138 const struct unit *pvictim,
139 const struct tile *tgt_tile)
144 action_range_can_not_cover_the_whole_map);
175 bool is_target = va_arg(args,
int);
193 if (contra->
users < 1) {
209 const char *error_message,
213 enum action_result res;
225 while (ACTRES_NONE != (res = va_arg(args,
enum action_result))) {
229 "Invalid action result %d", res);
248 const char *error_message,
255 va_start(args, error_message);
269 const char *error_message,
280 va_start(args, error_message);
295 const char *error_message,
299 enum action_sub_result res;
311 while (ACT_SUB_RES_COUNT != (res = va_arg(args,
312 enum action_sub_result))) {
316 "Invalid action result %d", res);
337 const char *error_message,
344 va_start(args, error_message);
365 N_(
"All action enablers for %s must require a "
367 ACTRES_ESTABLISH_EMBASSY,
368 ACTRES_SPY_INVESTIGATE_CITY,
369 ACTRES_SPY_STEAL_GOLD,
371 ACTRES_SPY_STEAL_TECH,
372 ACTRES_SPY_TARGETED_STEAL_TECH,
373 ACTRES_SPY_INCITE_CITY,
374 ACTRES_SPY_BRIBE_UNIT,
375 ACTRES_CAPTURE_UNITS,
390 N_(
"All action enablers for %s must require a "
391 "non domestic target."),
392 ACTRES_PARADROP_CONQUER,
406 N_(
"All action enablers for %s must require a "
407 "non domestic target."),
408 ACTRES_CONQUER_EXTRAS,
418 DRO_HAS_REAL_EMBASSY),
420 N_(
"All action enablers for %s must require the"
421 " absence of a real embassy."),
422 ACTRES_ESTABLISH_EMBASSY,
431 N_(
"All action enablers for %s must require that"
432 " the actor unit isn't already fortified."),
443 N_(
"All action enablers for %s must require"
444 " that the actor is at war with the target."),
460 N_(
"All action enablers for %s must require"
461 " that the actor is at war with the owner of the"
462 " target tile or that the target tile doesn't have"
472 N_(
"All action enablers for %s must require"
473 " a domestic target."),
474 ACTRES_UPGRADE_UNIT, ACTRES_NONE);
481 N_(
"All action enablers for %s must require"
482 " a domestic or allied target."),
483 ACTRES_TRANSPORT_EMBARK,
484 ACTRES_TRANSPORT_BOARD,
489 N_(
"All action enablers for %s must require"
490 " a domestic or allied target."),
491 ACTRES_TRANSPORT_EMBARK,
492 ACTRES_TRANSPORT_BOARD,
497 N_(
"All action enablers for %s must require"
498 " a domestic or allied target."),
499 ACTRES_TRANSPORT_EMBARK,
500 ACTRES_TRANSPORT_BOARD,
505 N_(
"All action enablers for %s must require"
506 " a domestic or allied target."),
507 ACTRES_TRANSPORT_EMBARK,
508 ACTRES_TRANSPORT_BOARD,
513 N_(
"All action enablers for %s must require"
514 " a domestic or allied target."),
515 ACTRES_TRANSPORT_EMBARK,
516 ACTRES_TRANSPORT_BOARD,
525 N_(
"All action enablers for %s must require"
526 " that the actor has"
527 " the Settlers utype flag."),
528 ACTRES_TRANSFORM_TERRAIN,
535 ACTRES_CLEAN_POLLUTION,
536 ACTRES_CLEAN_FALLOUT,
545 N_(
"All action enablers for %s must require"
547 " tile's terrain's irrigation_time"
548 " is above 0. (See \"TerrainAlter\"'s"
549 " \"CanIrrigate\")"),
556 N_(
"All action enablers for %s must require"
558 " tile's terrain's mining_time"
559 " is above 0. (See \"TerrainAlter\"'s"
570 N_(
"All action enablers for %s must require that"
571 " the target doesn't have"
572 " the NoCities terrain flag."),
583 N_(
"All action enablers for %s must require"
584 " that the actor has a home city."),
605 N_(
"All action enablers for %s must require"
606 " that the actor has the NonMil utype flag"
607 " or that the target tile is unclaimed"
608 " or that the diplomatic relation to"
609 " the target tile owner isn't peace."),
611 ACTRES_PARADROP_CONQUER,
620 N_(
"All action enablers for %s must require"
621 " that the actor doesn't have"
622 " the NonMil utype flag."),
636 N_(
"All action enablers for %s must require"
637 " no city at the target tile or"
638 " that the actor doesn't have"
639 " the NonMil utype flag."),
640 ACTRES_PARADROP_CONQUER,
647 UCF_CAN_OCCUPY_CITY),
649 N_(
"All action enablers for %s must require"
650 " that the actor has"
651 " the CanOccupyCity uclass flag."),
658 UCF_CAN_OCCUPY_CITY),
665 N_(
"All action enablers for %s must require"
666 " no city at the target tile or"
667 " that the actor has"
668 " the CanOccupyCity uclass flag."),
669 ACTRES_PARADROP_CONQUER,
678 N_(
"All action enablers for %s must require"
679 " that the actor is at war with the target."),
692 N_(
"All action enablers for %s must require"
693 " no city at the target tile or"
694 " that the actor is at war with the target."),
695 ACTRES_PARADROP_CONQUER,
705 N_(
"All action enablers for %s must require"
706 " that the actor has a movement point left."),
708 ACTRES_TRANSPORT_DISEMBARK,
709 ACTRES_TRANSPORT_EMBARK,
710 ACTRES_CONQUER_EXTRAS,
735 N_(
"All action enablers for %s must require"
736 " that the target city is empty."),
748 N_(
"All action enablers for %s must require"
749 " that the actor isn't transporting"
752 ACTRES_PARADROP_CONQUER,
761 N_(
"All action enablers for %s must require"
762 " that the actor has a home city."),
763 ACTRES_HOMELESS, ACTRES_NONE);
771 N_(
"All action enablers for %s must require"
772 " that the target isn't transporting another"
774 ACTRES_CAPTURE_UNITS, ACTRES_NONE);
781 N_(
"All action enablers for %s must require"
782 " that the target is transporting a unit."),
783 ACTRES_TRANSPORT_ALIGHT, ACTRES_NONE);
788 N_(
"All action enablers for %s must require"
789 " that the actor is transported."),
790 ACTRES_TRANSPORT_ALIGHT,
791 ACTRES_TRANSPORT_DISEMBARK,
797 N_(
"All action enablers for %s must require"
798 " that the actor is on a livable tile."),
799 ACTRES_TRANSPORT_ALIGHT, ACTRES_NONE);
806 N_(
"All action enablers for %s must require"
807 " that the actor is transporting a unit."),
808 ACTRES_TRANSPORT_UNLOAD, ACTRES_NONE);
813 N_(
"All action enablers for %s must require"
814 " that the target is transported."),
815 ACTRES_TRANSPORT_UNLOAD, ACTRES_NONE);
820 N_(
"All action enablers for %s must require"
821 " that the target is on a livable tile."),
822 ACTRES_TRANSPORT_UNLOAD, ACTRES_NONE);
830 N_(
"All action enablers for %s must require"
831 " that the actor isn't transported."),
840 N_(
"All action enablers for %s must require"
841 " that the actor unit is in a city."),
855 N_(
"All action enablers for %s must require"
856 " that the actor unit doesn't have the"
857 " HutFrighten unit class flag."),
858 ACT_SUB_RES_HUT_ENTER,
866 N_(
"All action enablers for %s must require"
867 " that the actor unit has the HutFrighten"
868 " unit class flag."),
869 ACT_SUB_RES_HUT_FRIGHTEN,
887 N_(
"All action enablers for %s must require"
888 " a non animal player actor."),
902 N_(
"All action enablers for %s must require"
903 " no city at the target tile or"
904 " a non animal player actor."),
905 ACTRES_PARADROP_CONQUER,
919 MAK_ESCAPE, 0, 1,
TRUE);
920 actions[ACTION_SPY_POISON_ESC] =
923 MAK_ESCAPE, 0, 1,
FALSE);
924 actions[ACTION_SPY_SABOTAGE_UNIT] =
927 MAK_ESCAPE, 0, 1,
TRUE);
928 actions[ACTION_SPY_SABOTAGE_UNIT_ESC] =
929 unit_action_new(ACTION_SPY_SABOTAGE_UNIT_ESC, ACTRES_SPY_SABOTAGE_UNIT,
931 MAK_ESCAPE, 0, 1,
FALSE);
932 actions[ACTION_SPY_BRIBE_UNIT] =
940 actions[ACTION_SPY_SABOTAGE_CITY] =
943 MAK_ESCAPE, 0, 1,
TRUE);
944 actions[ACTION_SPY_SABOTAGE_CITY_ESC] =
945 unit_action_new(ACTION_SPY_SABOTAGE_CITY_ESC, ACTRES_SPY_SABOTAGE_CITY,
947 MAK_ESCAPE, 0, 1,
FALSE);
948 actions[ACTION_SPY_TARGETED_SABOTAGE_CITY] =
950 ACTRES_SPY_TARGETED_SABOTAGE_CITY,
952 MAK_ESCAPE, 0, 1,
TRUE);
953 actions[ACTION_SPY_SABOTAGE_CITY_PRODUCTION] =
955 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION,
957 MAK_ESCAPE, 0, 1,
TRUE);
958 actions[ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC] =
960 ACTRES_SPY_TARGETED_SABOTAGE_CITY,
962 MAK_ESCAPE, 0, 1,
FALSE);
963 actions[ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC] =
965 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION,
967 MAK_ESCAPE, 0, 1,
FALSE);
968 actions[ACTION_SPY_INCITE_CITY] =
971 MAK_ESCAPE, 0, 1,
TRUE);
972 actions[ACTION_SPY_INCITE_CITY_ESC] =
975 MAK_ESCAPE, 0, 1,
FALSE);
976 actions[ACTION_ESTABLISH_EMBASSY] =
978 ACTRES_ESTABLISH_EMBASSY,
980 MAK_STAYS, 0, 1,
FALSE);
981 actions[ACTION_ESTABLISH_EMBASSY_STAY] =
983 ACTRES_ESTABLISH_EMBASSY,
985 MAK_STAYS, 0, 1,
TRUE);
986 actions[ACTION_SPY_STEAL_TECH] =
988 ACTRES_SPY_STEAL_TECH,
990 MAK_ESCAPE, 0, 1,
TRUE);
991 actions[ACTION_SPY_STEAL_TECH_ESC] =
993 ACTRES_SPY_STEAL_TECH,
995 MAK_ESCAPE, 0, 1,
FALSE);
996 actions[ACTION_SPY_TARGETED_STEAL_TECH] =
998 ACTRES_SPY_TARGETED_STEAL_TECH,
1000 MAK_ESCAPE, 0, 1,
TRUE);
1001 actions[ACTION_SPY_TARGETED_STEAL_TECH_ESC] =
1003 ACTRES_SPY_TARGETED_STEAL_TECH,
1005 MAK_ESCAPE, 0, 1,
FALSE);
1006 actions[ACTION_SPY_INVESTIGATE_CITY] =
1008 ACTRES_SPY_INVESTIGATE_CITY,
1010 MAK_STAYS, 0, 1,
FALSE);
1011 actions[ACTION_INV_CITY_SPEND] =
1013 ACTRES_SPY_INVESTIGATE_CITY,
1015 MAK_STAYS, 0, 1,
TRUE);
1016 actions[ACTION_SPY_STEAL_GOLD] =
1018 ACTRES_SPY_STEAL_GOLD,
1020 MAK_ESCAPE, 0, 1,
TRUE);
1021 actions[ACTION_SPY_STEAL_GOLD_ESC] =
1023 ACTRES_SPY_STEAL_GOLD,
1025 MAK_ESCAPE, 0, 1,
FALSE);
1026 actions[ACTION_SPY_SPREAD_PLAGUE] =
1028 ACTRES_SPY_SPREAD_PLAGUE,
1030 MAK_ESCAPE, 0, 1,
FALSE);
1034 MAK_STAYS, 0, 1,
TRUE);
1038 MAK_STAYS, 0, 1,
TRUE);
1042 MAK_STAYS, 0, 1,
TRUE);
1043 actions[ACTION_CAPTURE_UNITS] =
1063 MAK_STAYS, 0, 1,
TRUE);
1067 MAK_ESCAPE, 0, 1,
TRUE);
1068 actions[ACTION_STEAL_MAPS_ESC] =
1071 MAK_ESCAPE, 0, 1,
FALSE);
1106 MAK_ESCAPE, 0, 1,
TRUE);
1107 actions[ACTION_SPY_NUKE_ESC] =
1110 MAK_ESCAPE, 0, 1,
FALSE);
1122 MAK_STAYS, 1, 1,
TRUE);
1126 MAK_STAYS, 1, 1,
TRUE);
1127 actions[ACTION_DESTROY_CITY] =
1130 MAK_STAYS, 0, 1,
FALSE);
1134 MAK_STAYS, 0, 1,
FALSE);
1135 actions[ACTION_DISBAND_UNIT_RECOVER] =
1136 unit_action_new(ACTION_DISBAND_UNIT_RECOVER, ACTRES_DISBAND_UNIT_RECOVER,
1142 actions[ACTION_DISBAND_UNIT] =
1147 ACTRES_DISBAND_UNIT,
1149 MAK_STAYS, 0, 0,
TRUE);
1155 MAK_STAYS, 0, 0,
FALSE);
1159 MAK_STAYS, 0, 0,
FALSE);
1160 actions[ACTION_UPGRADE_UNIT] =
1176 actions[ACTION_PARADROP_CONQUER] =
1185 actions[ACTION_PARADROP_FRIGHTEN] =
1194 actions[ACTION_PARADROP_FRIGHTEN_CONQUER] =
1196 ACTRES_PARADROP_CONQUER,
1204 actions[ACTION_PARADROP_ENTER] =
1213 actions[ACTION_PARADROP_ENTER_CONQUER] =
1215 ACTRES_PARADROP_CONQUER,
1239 actions[ACTION_SUICIDE_ATTACK] =
1242 MAK_FORCED, 1, 1,
TRUE);
1243 actions[ACTION_STRIKE_BUILDING] =
1246 MAK_STAYS, 1, 1,
FALSE);
1247 actions[ACTION_STRIKE_PRODUCTION] =
1250 MAK_STAYS, 1, 1,
FALSE);
1251 actions[ACTION_CONQUER_CITY] =
1254 MAK_REGULAR, 1, 1,
FALSE);
1255 actions[ACTION_CONQUER_CITY2] =
1258 MAK_REGULAR, 1, 1,
FALSE);
1259 actions[ACTION_CONQUER_CITY3] =
1262 MAK_REGULAR, 1, 1,
FALSE);
1263 actions[ACTION_CONQUER_CITY4] =
1266 MAK_REGULAR, 1, 1,
FALSE);
1267 actions[ACTION_CONQUER_EXTRAS] =
1270 MAK_REGULAR, 1, 1,
FALSE);
1271 actions[ACTION_CONQUER_EXTRAS2] =
1274 MAK_REGULAR, 1, 1,
FALSE);
1275 actions[ACTION_CONQUER_EXTRAS3] =
1278 MAK_REGULAR, 1, 1,
FALSE);
1279 actions[ACTION_CONQUER_EXTRAS4] =
1282 MAK_REGULAR, 1, 1,
FALSE);
1286 MAK_STAYS, 0, 1,
FALSE);
1290 MAK_STAYS, 0, 1,
FALSE);
1291 actions[ACTION_TRANSFORM_TERRAIN] =
1294 MAK_STAYS, 0, 0,
FALSE);
1298 MAK_STAYS, 0, 0,
FALSE);
1302 MAK_STAYS, 0, 0,
FALSE);
1306 MAK_STAYS, 0, 0,
FALSE);
1307 actions[ACTION_CLEAN_POLLUTION] =
1310 MAK_STAYS, 0, 0,
FALSE);
1311 actions[ACTION_CLEAN_FALLOUT] =
1314 MAK_STAYS, 0, 0,
FALSE);
1318 MAK_STAYS, 0, 0,
FALSE);
1322 MAK_STAYS, 0, 0,
FALSE);
1326 MAK_STAYS, 0, 0,
FALSE);
1330 MAK_STAYS, 0, 0,
FALSE);
1334 MAK_STAYS, 0, 0,
FALSE);
1338 MAK_STAYS, 0, 0,
FALSE);
1339 actions[ACTION_TRANSPORT_ALIGHT] =
1342 MAK_STAYS, 0, 0,
FALSE);
1343 actions[ACTION_TRANSPORT_BOARD] =
1346 MAK_STAYS, 0, 0,
FALSE);
1347 actions[ACTION_TRANSPORT_UNLOAD] =
1350 MAK_STAYS, 0, 0,
FALSE);
1351 actions[ACTION_TRANSPORT_DISEMBARK1] =
1353 ACTRES_TRANSPORT_DISEMBARK,
1355 MAK_REGULAR, 1, 1,
FALSE);
1356 actions[ACTION_TRANSPORT_DISEMBARK2] =
1358 ACTRES_TRANSPORT_DISEMBARK,
1360 MAK_REGULAR, 1, 1,
FALSE);
1361 actions[ACTION_TRANSPORT_DISEMBARK3] =
1363 ACTRES_TRANSPORT_DISEMBARK,
1365 MAK_REGULAR, 1, 1,
FALSE);
1366 actions[ACTION_TRANSPORT_DISEMBARK4] =
1368 ACTRES_TRANSPORT_DISEMBARK,
1370 MAK_REGULAR, 1, 1,
FALSE);
1371 actions[ACTION_TRANSPORT_EMBARK] =
1374 MAK_REGULAR, 1, 1,
FALSE);
1375 actions[ACTION_TRANSPORT_EMBARK2] =
1378 MAK_REGULAR, 1, 1,
FALSE);
1379 actions[ACTION_TRANSPORT_EMBARK3] =
1382 MAK_REGULAR, 1, 1,
FALSE);
1386 MAK_STAYS, 1, 1,
FALSE);
1390 MAK_REGULAR, 1, 1,
FALSE);
1394 MAK_REGULAR, 1, 1,
FALSE);
1398 MAK_REGULAR, 1, 1,
FALSE);
1402 MAK_REGULAR, 1, 1,
FALSE);
1403 actions[ACTION_HUT_FRIGHTEN] =
1406 MAK_REGULAR, 1, 1,
FALSE);
1407 actions[ACTION_HUT_FRIGHTEN2] =
1410 MAK_REGULAR, 1, 1,
FALSE);
1411 actions[ACTION_HUT_FRIGHTEN3] =
1414 MAK_REGULAR, 1, 1,
FALSE);
1415 actions[ACTION_HUT_FRIGHTEN4] =
1418 MAK_REGULAR, 1, 1,
FALSE);
1422 MAK_REGULAR, 1, 1,
FALSE);
1426 MAK_REGULAR, 1, 1,
FALSE);
1430 MAK_REGULAR, 1, 1,
FALSE);
1431 actions[ACTION_USER_ACTION1] =
1434 MAK_UNREPRESENTABLE,
1437 actions[ACTION_USER_ACTION2] =
1440 MAK_UNREPRESENTABLE,
1443 actions[ACTION_USER_ACTION3] =
1446 MAK_UNREPRESENTABLE,
1449 actions[ACTION_USER_ACTION4] =
1452 MAK_UNREPRESENTABLE,
1467 for (i = 0; i < ACTIVITY_LAST; i++) {
1482 for (i = 0; i < ACTRES_NONE; i++) {
1488 for (i = 0; i < ACT_SUB_RES_COUNT; i++) {
1548 for (i = 0; i < ACTRES_NONE; i++) {
1554 for (i = 0; i < ACT_SUB_RES_COUNT; i++) {
1572 for (i = 0; i < ACTIVITY_LAST; i++) {
1591 if (
actions[act]->ui_name[0] ==
'\0') {
1608 enum action_result
result,
1626 if (act != ACTIVITY_LAST) {
1647 "%s contradicts itself regarding sub targets.",
1673 enum action_result
result,
1700 return gen_action_is_valid(act_id) &&
actions[act_id];
1741 const struct action *paction)
1752 const struct action *paction)
1766 return ABK_STANDARD;
1767 case ACTRES_SPY_ATTACK:
1768 case ACTRES_SPY_POISON:
1769 case ACTRES_SPY_STEAL_GOLD:
1770 case ACTRES_SPY_SABOTAGE_CITY:
1771 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
1772 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
1773 case ACTRES_SPY_STEAL_TECH:
1774 case ACTRES_SPY_TARGETED_STEAL_TECH:
1775 case ACTRES_SPY_INCITE_CITY:
1776 case ACTRES_SPY_BRIBE_UNIT:
1777 case ACTRES_SPY_SABOTAGE_UNIT:
1778 case ACTRES_STEAL_MAPS:
1779 case ACTRES_SPY_NUKE:
1780 case ACTRES_SPY_SPREAD_PLAGUE:
1781 return ABK_DIPLOMATIC;
1823 FALSE,
"Action %d don't exist.", act_id);
1857 const struct action *blocker)
1903 return gen_action_name(act_id);
1919 const char *mnemonic)
1945 if (prob.
min == prob.
max) {
1954 astr_set(&chance,
_(
"[%.1f%%, %.1f%%]"),
1979 const char *probtxt;
1990 "Invalid action %d", act_id);
1993 fc_assert(custom == NULL || custom[0] ==
'\0');
2006 if (probtxt != NULL && custom != NULL) {
2015 astr_set(&chance,
_(
" (%s; %s)"), custom, probtxt);
2016 }
else if (probtxt != NULL) {
2026 }
else if (custom != NULL) {
2049 const char *ui_name =
_(
actions[act_id]->ui_name);
2051 if (mnemonic[0] !=
'\0') {
2055 while ((hit = strstr(ui_name, mnemonic))) {
2056 astr_add(&fmtstr,
"%.*s%s%s", (
int)(hit - ui_name), ui_name,
2057 mnemonic, mnemonic);
2058 ui_name = hit + strlen(mnemonic);
2092 }
else if (prob.
min == prob.
max) {
2095 astr_set(&tool_tip,
_(
"The probability of success is %.1f%%."),
2104 _(
"The probability of success is %.1f%%, %.1f%% or somewhere"
2108 prob.
max - prob.
min > 1 ?
2111 _(
" (This is the most precise interval I can calculate "
2112 "given the information our nation has access to.)") :
2126 "Action %s isn't performed by a unit",
2138 if (result == ACTRES_FORTIFY) {
2139 return ACTIVITY_FORTIFYING;
2140 }
else if (result == ACTRES_BASE) {
2141 return ACTIVITY_BASE;
2142 }
else if (result == ACTRES_ROAD) {
2143 return ACTIVITY_GEN_ROAD;
2144 }
else if (result == ACTRES_PILLAGE) {
2145 return ACTIVITY_PILLAGE;
2146 }
else if (result == ACTRES_CLEAN_POLLUTION) {
2147 return ACTIVITY_POLLUTION;
2148 }
else if (result == ACTRES_CLEAN_FALLOUT) {
2149 return ACTIVITY_FALLOUT;
2150 }
else if (result == ACTRES_TRANSFORM_TERRAIN) {
2151 return ACTIVITY_TRANSFORM;
2152 }
else if (result == ACTRES_CONVERT) {
2153 return ACTIVITY_CONVERT;
2154 }
else if (result == ACTRES_PLANT) {
2155 return ACTIVITY_PLANT;
2156 }
else if (result == ACTRES_MINE) {
2157 return ACTIVITY_MINE;
2158 }
else if (result == ACTRES_CULTIVATE) {
2159 return ACTIVITY_CULTIVATE;
2160 }
else if (result == ACTRES_IRRIGATE) {
2161 return ACTIVITY_IRRIGATE;
2163 return ACTIVITY_LAST;
2175 const struct tile *tgt_tile,
2180 if (pactivity == ACTIVITY_LAST) {
2185 switch (pactivity) {
2186 case ACTIVITY_PILLAGE:
2187 case ACTIVITY_POLLUTION:
2188 case ACTIVITY_FALLOUT:
2190 case ACTIVITY_GEN_ROAD:
2191 case ACTIVITY_IRRIGATE:
2193 case ACTIVITY_CULTIVATE:
2194 case ACTIVITY_PLANT:
2195 case ACTIVITY_TRANSFORM:
2197 case ACTIVITY_FORTIFYING:
2199 case ACTIVITY_CONVERT:
2201 case ACTIVITY_EXPLORE:
2203 case ACTIVITY_FORTIFIED:
2204 case ACTIVITY_SENTRY:
2206 case ACTIVITY_UNKNOWN:
2207 case ACTIVITY_PATROL_UNUSED:
2209 case ACTIVITY_OLD_ROAD:
2210 case ACTIVITY_OLD_RAILROAD:
2211 case ACTIVITY_FORTRESS:
2212 case ACTIVITY_AIRBASE:
2228 if (pextra == NULL) {
2236 switch (paction->
result) {
2243 case ACTRES_IRRIGATE:
2245 case ACTRES_ESTABLISH_EMBASSY:
2246 case ACTRES_SPY_INVESTIGATE_CITY:
2247 case ACTRES_SPY_POISON:
2248 case ACTRES_SPY_STEAL_GOLD:
2249 case ACTRES_SPY_SABOTAGE_CITY:
2250 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
2251 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
2252 case ACTRES_SPY_STEAL_TECH:
2253 case ACTRES_SPY_TARGETED_STEAL_TECH:
2254 case ACTRES_SPY_INCITE_CITY:
2255 case ACTRES_TRADE_ROUTE:
2256 case ACTRES_MARKETPLACE:
2257 case ACTRES_HELP_WONDER:
2258 case ACTRES_SPY_BRIBE_UNIT:
2259 case ACTRES_SPY_SABOTAGE_UNIT:
2260 case ACTRES_CAPTURE_UNITS:
2261 case ACTRES_FOUND_CITY:
2262 case ACTRES_JOIN_CITY:
2263 case ACTRES_STEAL_MAPS:
2264 case ACTRES_BOMBARD:
2265 case ACTRES_SPY_NUKE:
2267 case ACTRES_NUKE_UNITS:
2268 case ACTRES_DESTROY_CITY:
2269 case ACTRES_EXPEL_UNIT:
2270 case ACTRES_DISBAND_UNIT_RECOVER:
2271 case ACTRES_DISBAND_UNIT:
2272 case ACTRES_HOME_CITY:
2273 case ACTRES_HOMELESS:
2274 case ACTRES_UPGRADE_UNIT:
2275 case ACTRES_PARADROP:
2276 case ACTRES_PARADROP_CONQUER:
2277 case ACTRES_AIRLIFT:
2278 case ACTRES_STRIKE_BUILDING:
2279 case ACTRES_STRIKE_PRODUCTION:
2281 case ACTRES_CONQUER_CITY:
2282 case ACTRES_CONQUER_EXTRAS:
2283 case ACTRES_HEAL_UNIT:
2284 case ACTRES_TRANSFORM_TERRAIN:
2285 case ACTRES_CULTIVATE:
2287 case ACTRES_PILLAGE:
2288 case ACTRES_CLEAN_POLLUTION:
2289 case ACTRES_CLEAN_FALLOUT:
2290 case ACTRES_FORTIFY:
2291 case ACTRES_CONVERT:
2292 case ACTRES_TRANSPORT_ALIGHT:
2293 case ACTRES_TRANSPORT_UNLOAD:
2294 case ACTRES_TRANSPORT_DISEMBARK:
2295 case ACTRES_TRANSPORT_BOARD:
2296 case ACTRES_TRANSPORT_EMBARK:
2297 case ACTRES_SPY_ATTACK:
2298 case ACTRES_SPY_SPREAD_PLAGUE:
2299 case ACTRES_HUT_ENTER:
2300 case ACTRES_HUT_FRIGHTEN:
2301 case ACTRES_UNIT_MOVE:
2316 if (pextra == NULL) {
2320 switch (paction->
result) {
2321 case ACTRES_PILLAGE:
2323 case ACTRES_CLEAN_POLLUTION:
2325 case ACTRES_CLEAN_FALLOUT:
2327 case ACTRES_HUT_ENTER:
2328 case ACTRES_HUT_FRIGHTEN:
2330 case ACTRES_ESTABLISH_EMBASSY:
2331 case ACTRES_SPY_INVESTIGATE_CITY:
2332 case ACTRES_SPY_POISON:
2333 case ACTRES_SPY_STEAL_GOLD:
2334 case ACTRES_SPY_SABOTAGE_CITY:
2335 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
2336 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
2337 case ACTRES_SPY_STEAL_TECH:
2338 case ACTRES_SPY_TARGETED_STEAL_TECH:
2339 case ACTRES_SPY_INCITE_CITY:
2340 case ACTRES_TRADE_ROUTE:
2341 case ACTRES_MARKETPLACE:
2342 case ACTRES_HELP_WONDER:
2343 case ACTRES_SPY_BRIBE_UNIT:
2344 case ACTRES_SPY_SABOTAGE_UNIT:
2345 case ACTRES_CAPTURE_UNITS:
2346 case ACTRES_FOUND_CITY:
2347 case ACTRES_JOIN_CITY:
2348 case ACTRES_STEAL_MAPS:
2349 case ACTRES_BOMBARD:
2350 case ACTRES_SPY_NUKE:
2352 case ACTRES_NUKE_UNITS:
2353 case ACTRES_DESTROY_CITY:
2354 case ACTRES_EXPEL_UNIT:
2355 case ACTRES_DISBAND_UNIT_RECOVER:
2356 case ACTRES_DISBAND_UNIT:
2357 case ACTRES_HOME_CITY:
2358 case ACTRES_HOMELESS:
2359 case ACTRES_UPGRADE_UNIT:
2360 case ACTRES_PARADROP:
2361 case ACTRES_PARADROP_CONQUER:
2362 case ACTRES_AIRLIFT:
2363 case ACTRES_STRIKE_BUILDING:
2364 case ACTRES_STRIKE_PRODUCTION:
2366 case ACTRES_CONQUER_CITY:
2367 case ACTRES_CONQUER_EXTRAS:
2368 case ACTRES_HEAL_UNIT:
2369 case ACTRES_TRANSFORM_TERRAIN:
2370 case ACTRES_CULTIVATE:
2372 case ACTRES_FORTIFY:
2374 case ACTRES_CONVERT:
2377 case ACTRES_IRRIGATE:
2378 case ACTRES_TRANSPORT_ALIGHT:
2379 case ACTRES_TRANSPORT_UNLOAD:
2380 case ACTRES_TRANSPORT_DISEMBARK:
2381 case ACTRES_TRANSPORT_BOARD:
2382 case ACTRES_TRANSPORT_EMBARK:
2383 case ACTRES_SPY_ATTACK:
2384 case ACTRES_SPY_SPREAD_PLAGUE:
2385 case ACTRES_UNIT_MOVE:
2402 requirement_vector_init(&enabler->
actor_reqs);
2417 requirement_vector_free(&enabler->
actor_reqs);
2449 action_enabler_list_append(
2466 return action_enabler_list_remove(
2474struct action_enabler_list *
2495 const struct obligatory_req_vector *oblig)
2514 bool fulfilled =
FALSE;
2517 for (i = 0; i < obreq->contras->alternatives; i++) {
2518 const struct requirement_vector *ae_vec;
2521 ae_vec = (obreq->contras->alternative[i].is_target
2529 || (obreq->contras->alternative[i].req.present
2531 &obreq->contras->alternative[i].req.source))) {
2551 for (i = 0; i < obreq->contras->alternatives; i++) {
2552 const struct requirement_vector *ae_vec;
2555 ae_vec = (obreq->contras->alternative[i].is_target
2568 = !obreq->contras->alternative[i].req.present;
2570 = obreq->contras->alternative[i].req.source;
2572 = obreq->contras->alternative[i].req.range;
2574 = obreq->contras->alternative[i].req.survives;
2576 = obreq->contras->alternative[i].req.quiet;
2601 enum action_sub_result sub_res;
2613 if (paction->
result != ACTRES_NONE) {
2622 for (sub_res = action_sub_result_begin();
2623 sub_res != action_sub_result_end();
2624 sub_res = action_sub_result_next(sub_res)) {
2652 if (preq->source.kind == VUT_DIPLREL
2653 && preq->range == REQ_RANGE_LOCAL) {
2671 const struct requirement_vector *vec)
2710 if (local_diplrel == NULL) {
2716 tile_is_unclaimed.
range = REQ_RANGE_LOCAL;
2718 tile_is_unclaimed.
source.
kind = VUT_CITYTILE;
2731 tile_is_claimed.
range = REQ_RANGE_LOCAL;
2744 N_(
"Requirement {%s} of action \"%s\" implies a claimed "
2745 "tile. No diplomatic relation to Nature."),
2782 if (local_diplrel == NULL) {
2788 tile_is_claimed.
range = REQ_RANGE_LOCAL;
2797 if (unclaimed_req == NULL) {
2808 N_(
"In enabler for \"%s\": No diplomatic relation to Nature."
2809 " Requirements {%s} and {%s} contradict each other."),
2933 bool has_user =
FALSE;
2947 " used by any unit."),
2969 const struct requirement_vector *vec)
2990struct requirement_vector *
3020 return _(
"actor_reqs");
3023 return _(
"target_reqs");
3034 const struct tile *ttile)
3043 const struct tile *ttile)
3059 if (
target_city->production.kind == VUT_IMPROVEMENT) {
3101static const struct tile *
3104 const struct tile *target_tile_arg,
3108 if (target_tile_arg != NULL) {
3110 return target_tile_arg;
3136 return target_tile_arg;
3159static const struct city *
3163 const struct city *target_city_arg,
3166 if (target_city_arg != NULL) {
3168 return target_city_arg;
3177 return target_city_arg;
3215 const struct action *act,
3217 const struct tile *target_tile_arg,
3218 const struct city *target_city_arg,
3329 bool ignore_third_party)
3331 switch (paction->
result) {
3332 case ACTRES_JOIN_CITY:
3333 if (actor_unittype->
pop_cost <= 0) {
3339 case ACTRES_BOMBARD:
3352 case ACTRES_UPGRADE_UNIT:
3366 case ACTRES_CONVERT:
3373 case ACTRES_TRANSPORT_UNLOAD:
3380 case ACTRES_TRANSPORT_BOARD:
3381 case ACTRES_TRANSPORT_EMBARK:
3382 case ACTRES_TRANSPORT_ALIGHT:
3383 case ACTRES_TRANSPORT_DISEMBARK:
3384 if (!ignore_third_party) {
3385 bool has_transporter =
FALSE;
3389 has_transporter =
TRUE;
3394 if (!has_transporter) {
3401 case ACTRES_CONQUER_EXTRAS:
3402 if (!ignore_third_party) {
3403 bool has_target =
FALSE;
3439 case ACTRES_PARADROP:
3440 case ACTRES_PARADROP_CONQUER:
3447 case ACTRES_HUT_ENTER:
3448 case ACTRES_HUT_FRIGHTEN:
3449 case ACTRES_ESTABLISH_EMBASSY:
3450 case ACTRES_SPY_INVESTIGATE_CITY:
3451 case ACTRES_SPY_POISON:
3452 case ACTRES_SPY_STEAL_GOLD:
3453 case ACTRES_SPY_SPREAD_PLAGUE:
3454 case ACTRES_SPY_SABOTAGE_CITY:
3455 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3456 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
3457 case ACTRES_SPY_STEAL_TECH:
3458 case ACTRES_SPY_TARGETED_STEAL_TECH:
3459 case ACTRES_SPY_INCITE_CITY:
3460 case ACTRES_TRADE_ROUTE:
3461 case ACTRES_MARKETPLACE:
3462 case ACTRES_HELP_WONDER:
3463 case ACTRES_SPY_BRIBE_UNIT:
3464 case ACTRES_SPY_SABOTAGE_UNIT:
3465 case ACTRES_CAPTURE_UNITS:
3466 case ACTRES_FOUND_CITY:
3467 case ACTRES_STEAL_MAPS:
3468 case ACTRES_SPY_NUKE:
3470 case ACTRES_NUKE_UNITS:
3471 case ACTRES_DESTROY_CITY:
3472 case ACTRES_EXPEL_UNIT:
3473 case ACTRES_DISBAND_UNIT_RECOVER:
3474 case ACTRES_DISBAND_UNIT:
3475 case ACTRES_HOME_CITY:
3476 case ACTRES_HOMELESS:
3477 case ACTRES_AIRLIFT:
3478 case ACTRES_STRIKE_BUILDING:
3479 case ACTRES_STRIKE_PRODUCTION:
3480 case ACTRES_CONQUER_CITY:
3481 case ACTRES_HEAL_UNIT:
3482 case ACTRES_PILLAGE:
3483 case ACTRES_CLEAN_POLLUTION:
3484 case ACTRES_CLEAN_FALLOUT:
3485 case ACTRES_FORTIFY:
3486 case ACTRES_TRANSFORM_TERRAIN:
3487 case ACTRES_CULTIVATE:
3492 case ACTRES_IRRIGATE:
3493 case ACTRES_SPY_ATTACK:
3494 case ACTRES_UNIT_MOVE:
3524 actor_unittype,
FALSE);
3541 const struct action *paction,
3543 const bool omniscient,
3544 const struct city *homecity)
3546 enum action_result result = paction->
result;
3548 if (
actor == NULL) {
3561 case ACTRES_PARADROP:
3562 case ACTRES_PARADROP_CONQUER:
3572 case ACTRES_AIRLIFT:
3577 if (
actor->city == NULL) {
3595 if (0 >=
actor->city->airlift
3607 case ACTRES_CONVERT:
3615 case ACTRES_TRANSPORT_BOARD:
3616 case ACTRES_TRANSPORT_EMBARK:
3625 case ACTRES_TRANSPORT_DISEMBARK:
3632 case ACTRES_HOMELESS:
3633 case ACTRES_UNIT_MOVE:
3634 case ACTRES_ESTABLISH_EMBASSY:
3635 case ACTRES_SPY_INVESTIGATE_CITY:
3636 case ACTRES_SPY_POISON:
3637 case ACTRES_SPY_STEAL_GOLD:
3638 case ACTRES_SPY_SPREAD_PLAGUE:
3639 case ACTRES_SPY_SABOTAGE_CITY:
3640 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3641 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
3642 case ACTRES_SPY_STEAL_TECH:
3643 case ACTRES_SPY_TARGETED_STEAL_TECH:
3644 case ACTRES_SPY_INCITE_CITY:
3645 case ACTRES_TRADE_ROUTE:
3646 case ACTRES_MARKETPLACE:
3647 case ACTRES_HELP_WONDER:
3648 case ACTRES_SPY_BRIBE_UNIT:
3649 case ACTRES_SPY_SABOTAGE_UNIT:
3650 case ACTRES_CAPTURE_UNITS:
3651 case ACTRES_FOUND_CITY:
3652 case ACTRES_JOIN_CITY:
3653 case ACTRES_STEAL_MAPS:
3654 case ACTRES_BOMBARD:
3655 case ACTRES_SPY_NUKE:
3657 case ACTRES_NUKE_UNITS:
3658 case ACTRES_DESTROY_CITY:
3659 case ACTRES_EXPEL_UNIT:
3660 case ACTRES_DISBAND_UNIT_RECOVER:
3661 case ACTRES_DISBAND_UNIT:
3662 case ACTRES_HOME_CITY:
3663 case ACTRES_UPGRADE_UNIT:
3665 case ACTRES_STRIKE_BUILDING:
3666 case ACTRES_STRIKE_PRODUCTION:
3667 case ACTRES_CONQUER_CITY:
3668 case ACTRES_CONQUER_EXTRAS:
3669 case ACTRES_HEAL_UNIT:
3670 case ACTRES_TRANSFORM_TERRAIN:
3671 case ACTRES_CULTIVATE:
3673 case ACTRES_PILLAGE:
3674 case ACTRES_CLEAN_POLLUTION:
3675 case ACTRES_CLEAN_FALLOUT:
3676 case ACTRES_FORTIFY:
3680 case ACTRES_IRRIGATE:
3681 case ACTRES_TRANSPORT_ALIGHT:
3682 case ACTRES_TRANSPORT_UNLOAD:
3683 case ACTRES_SPY_ATTACK:
3684 case ACTRES_HUT_ENTER:
3685 case ACTRES_HUT_FRIGHTEN:
3723 const bool omniscient,
3724 const struct city *homecity)
3726 bool can_see_tgt_unit;
3727 bool can_see_tgt_tile;
3733 if (
actor == NULL) {
3736 if (target == NULL) {
3741 || (tkind == ATK_TILE && target->
tile != NULL)
3742 || (tkind == ATK_EXTRAS && target->
tile != NULL)
3743 || (tkind == ATK_UNIT && target->
unit != NULL)
3745 || (tkind == ATK_UNITS && target->
unit != NULL)
3746 || (tkind == ATK_SELF),
3752 can_see_tgt_unit = (omniscient || (target->
unit
3759 can_see_tgt_tile = (omniscient
3763 if (tkind != ATK_SELF
3823 switch (paction->
result) {
3824 case ACTRES_CAPTURE_UNITS:
3825 case ACTRES_SPY_BRIBE_UNIT:
3832 if (!can_see_tgt_unit) {
3850 case ACTRES_SPY_TARGETED_STEAL_TECH:
3860 case ACTRES_SPY_STEAL_GOLD:
3870 case ACTRES_TRADE_ROUTE:
3871 case ACTRES_MARKETPLACE:
3894 case ACTRES_HELP_WONDER:
3895 case ACTRES_DISBAND_UNIT_RECOVER:
3914 case ACTRES_FOUND_CITY:
3944 if (!can_see_tgt_tile) {
3966 case ACTRES_JOIN_CITY:
3995 case ACTRES_NUKE_UNITS:
4005 case ACTRES_HOME_CITY:
4008 if (homecity != NULL && homecity->
id == target->
city->
id) {
4023 case ACTRES_UPGRADE_UNIT:
4043 case ACTRES_PARADROP:
4044 case ACTRES_PARADROP_CONQUER:
4089 case ACTRES_AIRLIFT:
4119 case ACTRES_CONQUER_CITY:
4128 case ACTRES_CONQUER_EXTRAS:
4144 case ACTRES_HEAL_UNIT:
4147 if (!can_see_tgt_unit) {
4155 case ACTRES_TRANSFORM_TERRAIN:
4167 case ACTRES_CULTIVATE:
4235 case ACTRES_IRRIGATE:
4249 case ACTRES_PILLAGE:
4258 bv_extras pspossible;
4269 bool required =
FALSE;
4274 if (pdep == pextra) {
4317 case ACTRES_CLEAN_POLLUTION:
4343 if (pextra == NULL) {
4357 case ACTRES_CLEAN_FALLOUT:
4383 if (pextra == NULL) {
4397 case ACTRES_TRANSPORT_ALIGHT:
4404 case ACTRES_TRANSPORT_BOARD:
4417 case ACTRES_TRANSPORT_UNLOAD:
4424 case ACTRES_TRANSPORT_DISEMBARK:
4445 case ACTRES_TRANSPORT_EMBARK:
4475 case ACTRES_SPY_ATTACK:
4490 if (uplayer ==
actor->player) {
4515 case ACTRES_HUT_ENTER:
4516 case ACTRES_HUT_FRIGHTEN:
4528 case ACTRES_UNIT_MOVE:
4554 case ACTRES_SPY_SPREAD_PLAGUE:
4557 case ACTRES_BOMBARD:
4571 bool hiding_extra =
FALSE;
4574 if (pextra->eus == EUS_HIDDEN
4576 hiding_extra =
TRUE;
4581 if (!hiding_extra) {
4582 bool has_target =
FALSE;
4598 case ACTRES_ESTABLISH_EMBASSY:
4599 case ACTRES_SPY_INVESTIGATE_CITY:
4600 case ACTRES_SPY_POISON:
4601 case ACTRES_SPY_SABOTAGE_CITY:
4602 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
4603 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
4604 case ACTRES_SPY_STEAL_TECH:
4605 case ACTRES_SPY_INCITE_CITY:
4606 case ACTRES_SPY_SABOTAGE_UNIT:
4607 case ACTRES_STEAL_MAPS:
4608 case ACTRES_SPY_NUKE:
4610 case ACTRES_DESTROY_CITY:
4611 case ACTRES_EXPEL_UNIT:
4612 case ACTRES_DISBAND_UNIT:
4613 case ACTRES_CONVERT:
4614 case ACTRES_STRIKE_BUILDING:
4615 case ACTRES_STRIKE_PRODUCTION:
4616 case ACTRES_FORTIFY:
4617 case ACTRES_HOMELESS:
4656 const struct city *actor_home)
4666 "Is omniscient, should get yes or no.");
4693 const struct city *actor_home,
4694 const struct tile *actor_tile,
4697 const struct impr_type *target_building;
4706 FALSE,
"Action %s is performed by %s not %s",
4708 action_actor_kind_name(
4710 action_actor_kind_name(AAK_UNIT));
4714 FALSE,
"Action %s is against %s not %s",
4716 action_target_kind_name(
4718 action_target_kind_name(ATK_CITY));
4741 .building = target_building,
4743 .unittype = target_utype,
4776 const struct city *actor_home,
4777 const struct tile *actor_tile,
4786 FALSE,
"Action %s is performed by %s not %s",
4788 action_actor_kind_name(
4790 action_actor_kind_name(AAK_UNIT));
4794 FALSE,
"Action %s is against %s not %s",
4796 action_target_kind_name(
4798 action_target_kind_name(ATK_UNIT));
4853 const struct city *actor_home,
4854 const struct tile *actor_tile,
4866 FALSE,
"Action %s is performed by %s not %s",
4868 action_actor_kind_name(
4870 action_actor_kind_name(AAK_UNIT));
4874 FALSE,
"Action %s is against %s not %s",
4876 action_target_kind_name(
4878 action_target_kind_name(ATK_UNITS));
4904 NULL, actor_home)) {
4941 const struct city *actor_home,
4942 const struct tile *actor_tile,
4952 FALSE,
"Action %s is performed by %s not %s",
4954 action_actor_kind_name(
4956 action_actor_kind_name(AAK_UNIT));
4960 FALSE,
"Action %s is against %s not %s",
4962 action_target_kind_name(
4964 action_target_kind_name(ATK_TILE));
5018 const struct city *actor_home,
5019 const struct tile *actor_tile,
5029 FALSE,
"Action %s is performed by %s not %s",
5031 action_actor_kind_name(
5033 action_actor_kind_name(AAK_UNIT));
5037 FALSE,
"Action %s is against %s not %s",
5039 action_target_kind_name(
5041 action_target_kind_name(ATK_EXTRAS));
5096 const struct city *actor_home,
5097 const struct tile *actor_tile)
5105 FALSE,
"Action %s is performed by %s not %s",
5107 action_actor_kind_name(
5109 action_actor_kind_name(AAK_UNIT));
5113 FALSE,
"Action %s is against %s not %s",
5115 action_target_kind_name(
5117 action_target_kind_name(ATK_SELF));
5180 if (
actor == NULL ||
actor->player == NULL) {
5185 if (target == NULL) {
5194 &enabler->actor_reqs,
5198 &enabler->target_reqs,
5220 const struct player *pov_player,
5222 const struct player *other_player)
5240 const struct player *target_player)
5245 if (actor_research != target_research) {
5255 == TECH_PREREQS_KNOWN))) {
5276 const struct unit *pdefender)
5321 .
tile = pdefender->tile,
5338 chance =
CLIP(0, chance, 100);
5353 const struct unit *pvictim,
5354 const struct tile *tgt_tile)
5356 struct unit *pdefender;
5397 const struct unit *act_unit,
5398 const struct city *tgt_city,
5399 const struct player *tgt_player,
5400 const struct action *paction)
5404 .player = act_player,
5411 tgt_player, paction);
5434 const struct unit *act_unit,
5435 const struct city *tgt_city,
5436 const struct unit *tgt_unit,
5437 const struct tile *tgt_tile,
5438 const struct player *tgt_player,
5439 const struct action *paction)
5449 case ABK_DIPLOMATIC:
5462 tgt_city, tgt_player,
5483 const struct city *actor_home,
5491 if (
actor == NULL) {
5494 if (target == NULL) {
5514 switch (paction->
result) {
5515 case ACTRES_SPY_POISON:
5524 case ACTRES_SPY_STEAL_GOLD:
5527 case ACTRES_SPY_SPREAD_PLAGUE:
5530 case ACTRES_STEAL_MAPS:
5533 case ACTRES_SPY_SABOTAGE_UNIT:
5537 case ACTRES_SPY_BRIBE_UNIT:
5541 case ACTRES_SPY_ATTACK:
5545 case ACTRES_SPY_SABOTAGE_CITY:
5548 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
5551 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
5554 case ACTRES_SPY_INCITE_CITY:
5557 case ACTRES_ESTABLISH_EMBASSY:
5560 case ACTRES_SPY_STEAL_TECH:
5569 case ACTRES_SPY_TARGETED_STEAL_TECH:
5578 case ACTRES_SPY_INVESTIGATE_CITY:
5582 case ACTRES_TRADE_ROUTE:
5585 case ACTRES_MARKETPLACE:
5589 case ACTRES_HELP_WONDER:
5593 case ACTRES_CAPTURE_UNITS:
5597 case ACTRES_EXPEL_UNIT:
5601 case ACTRES_BOMBARD:
5605 case ACTRES_FOUND_CITY:
5609 case ACTRES_JOIN_CITY:
5613 case ACTRES_SPY_NUKE:
5626 case ACTRES_NUKE_UNITS:
5629 case ACTRES_DESTROY_CITY:
5633 case ACTRES_DISBAND_UNIT_RECOVER:
5637 case ACTRES_DISBAND_UNIT:
5641 case ACTRES_HOME_CITY:
5645 case ACTRES_HOMELESS:
5649 case ACTRES_UPGRADE_UNIT:
5653 case ACTRES_PARADROP:
5654 case ACTRES_PARADROP_CONQUER:
5657 case ACTRES_AIRLIFT:
5663 struct unit *defender_unit
5674 }
else if (known ==
TRI_YES) {
5679 case ACTRES_STRIKE_BUILDING:
5687 case ACTRES_STRIKE_PRODUCTION:
5694 case ACTRES_CONQUER_CITY:
5698 case ACTRES_CONQUER_EXTRAS:
5702 case ACTRES_HEAL_UNIT:
5706 case ACTRES_TRANSFORM_TERRAIN:
5707 case ACTRES_CULTIVATE:
5709 case ACTRES_PILLAGE:
5710 case ACTRES_CLEAN_POLLUTION:
5711 case ACTRES_CLEAN_FALLOUT:
5712 case ACTRES_FORTIFY:
5714 case ACTRES_CONVERT:
5717 case ACTRES_IRRIGATE:
5720 case ACTRES_TRANSPORT_ALIGHT:
5723 case ACTRES_TRANSPORT_BOARD:
5726 case ACTRES_TRANSPORT_EMBARK:
5729 case ACTRES_TRANSPORT_UNLOAD:
5732 case ACTRES_TRANSPORT_DISEMBARK:
5735 case ACTRES_HUT_ENTER:
5736 case ACTRES_HUT_FRIGHTEN:
5741 case ACTRES_UNIT_MOVE:
5785 const struct city *actor_home,
5786 const struct tile *actor_tile,
5790 const struct impr_type *target_building;
5801 "Action %s is performed by %s not %s",
5803 action_actor_kind_name(
5805 action_actor_kind_name(AAK_UNIT));
5809 "Action %s is against %s not %s",
5811 action_target_kind_name(
5813 action_target_kind_name(ATK_CITY));
5860 .building = target_building,
5862 .unittype = target_utype,
5888 const struct city *actor_home,
5889 const struct tile *actor_tile,
5900 "Action %s is performed by %s not %s",
5902 action_actor_kind_name(
5904 action_actor_kind_name(AAK_UNIT));
5908 "Action %s is against %s not %s",
5910 action_target_kind_name(
5912 action_target_kind_name(ATK_UNIT));
5972 const struct city *actor_home,
5973 const struct tile *actor_tile,
5988 "Action %s is performed by %s not %s",
5990 action_actor_kind_name(
5992 action_actor_kind_name(AAK_UNIT));
5996 "Action %s is against %s not %s",
5998 action_target_kind_name(
6000 action_target_kind_name(ATK_UNITS));
6024 CITYT_CENTER,
TRUE)) {
6099 prob_unit =
action_prob(nmap, act_id, actor_ctxt, actor_home,
6117 "Invalid probability [%d, %d]",
6118 prob_unit.
min, prob_unit.
max);
6160 const struct city *actor_home,
6161 const struct tile *actor_tile,
6173 "Action %s is performed by %s not %s",
6175 action_actor_kind_name(
6177 action_actor_kind_name(AAK_UNIT));
6181 "Action %s is against %s not %s",
6183 action_target_kind_name(
6185 action_target_kind_name(ATK_TILE));
6243 const struct city *actor_home,
6244 const struct tile *actor_tile,
6256 "Action %s is performed by %s not %s",
6258 action_actor_kind_name(
6260 action_actor_kind_name(AAK_UNIT));
6264 "Action %s is against %s not %s",
6266 action_target_kind_name(
6268 action_target_kind_name(ATK_EXTRAS));
6326 const struct city *actor_home,
6327 const struct tile *actor_tile,
6339 "Action %s is performed by %s not %s",
6341 action_actor_kind_name(
6343 action_actor_kind_name(AAK_UNIT));
6347 "Action %s is against %s not %s",
6349 action_target_kind_name(
6351 action_target_kind_name(ATK_SELF));
6400 const struct action *paction,
6401 const struct unit *act_unit,
6402 const struct city *tgt_city,
6403 const struct unit *tgt_unit,
6404 const struct tile *tgt_tile,
6427 tgt_tile, extra_tgt);
6444 log_error(
"Invalid action target kind");
6459 const struct city *actor_home,
6460 const struct tile *actor_tile,
6461 const bool omniscient_cheat,
6462 const struct city* target)
6469 if (omniscient_cheat) {
6471 actor, actor_home, actor_tile,
6494 const struct city *actor_home,
6495 const struct tile *actor_tile,
6496 bool omniscient_cheat,
6497 const struct unit *target)
6504 if (omniscient_cheat) {
6506 actor, actor_home, actor_tile,
6527 const struct city *actor_home,
6528 const struct tile *actor_tile,
6529 bool omniscient_cheat,
6530 const struct tile *target)
6537 if (omniscient_cheat) {
6539 actor, actor_home, actor_tile,
6560 const struct city *actor_home,
6561 const struct tile *actor_tile,
6562 bool omniscient_cheat,
6571 if (omniscient_cheat) {
6573 actor, actor_home, actor_tile,
6594 const struct city *actor_home,
6595 const struct tile *actor_tile,
6596 bool omniscient_cheat,
6605 if (omniscient_cheat) {
6607 actor, actor_home, actor_tile,
6628 const struct city *actor_home,
6629 const struct tile *actor_tile,
6630 bool omniscient_cheat)
6636 if (omniscient_cheat) {
6638 actor, actor_home, actor_tile)) {
6748 return probability.
max < probability.
min;
6797 if (my_ap1.
min < my_ap2.
min) {
6799 }
else if (my_ap1.
min > my_ap2.
min) {
6801 }
else if (my_ap1.
max < my_ap2.
max) {
6803 }
else if (my_ap1.
max > my_ap2.
max) {
6885 my_ap2.
min = ap2->min;
6886 my_ap2.
max = ap2->max;
6955 my_ap2.
min = ap2->min;
6956 my_ap2.
max = ap2->max;
6981 switch (paction->
result) {
6982 case ACTRES_STRIKE_BUILDING:
6983 case ACTRES_STRIKE_PRODUCTION:
6984 case ACTRES_SPY_SPREAD_PLAGUE:
6985 case ACTRES_SPY_STEAL_TECH:
6986 case ACTRES_SPY_TARGETED_STEAL_TECH:
6987 case ACTRES_SPY_INCITE_CITY:
6988 case ACTRES_SPY_SABOTAGE_CITY:
6989 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
6990 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
6991 case ACTRES_SPY_STEAL_GOLD:
6992 case ACTRES_STEAL_MAPS:
6993 case ACTRES_SPY_NUKE:
6994 case ACTRES_SPY_POISON:
7003 case ACTRES_ESTABLISH_EMBASSY:
7004 case ACTRES_SPY_INVESTIGATE_CITY:
7005 case ACTRES_TRADE_ROUTE:
7006 case ACTRES_MARKETPLACE:
7007 case ACTRES_HELP_WONDER:
7008 case ACTRES_SPY_BRIBE_UNIT:
7009 case ACTRES_SPY_SABOTAGE_UNIT:
7010 case ACTRES_CAPTURE_UNITS:
7011 case ACTRES_FOUND_CITY:
7012 case ACTRES_JOIN_CITY:
7013 case ACTRES_BOMBARD:
7015 case ACTRES_NUKE_UNITS:
7016 case ACTRES_DESTROY_CITY:
7017 case ACTRES_EXPEL_UNIT:
7018 case ACTRES_DISBAND_UNIT_RECOVER:
7019 case ACTRES_DISBAND_UNIT:
7020 case ACTRES_HOME_CITY:
7021 case ACTRES_HOMELESS:
7022 case ACTRES_UPGRADE_UNIT:
7023 case ACTRES_PARADROP:
7024 case ACTRES_PARADROP_CONQUER:
7025 case ACTRES_AIRLIFT:
7027 case ACTRES_CONQUER_CITY:
7028 case ACTRES_CONQUER_EXTRAS:
7029 case ACTRES_HEAL_UNIT:
7030 case ACTRES_TRANSFORM_TERRAIN:
7031 case ACTRES_CULTIVATE:
7033 case ACTRES_PILLAGE:
7034 case ACTRES_CLEAN_POLLUTION:
7035 case ACTRES_CLEAN_FALLOUT:
7036 case ACTRES_FORTIFY:
7038 case ACTRES_CONVERT:
7041 case ACTRES_IRRIGATE:
7042 case ACTRES_TRANSPORT_ALIGHT:
7043 case ACTRES_TRANSPORT_UNLOAD:
7044 case ACTRES_TRANSPORT_DISEMBARK:
7045 case ACTRES_TRANSPORT_BOARD:
7046 case ACTRES_TRANSPORT_EMBARK:
7047 case ACTRES_SPY_ATTACK:
7048 case ACTRES_HUT_ENTER:
7049 case ACTRES_HUT_FRIGHTEN:
7050 case ACTRES_UNIT_MOVE:
7065 const struct unit *act_unit,
7066 const struct city *tgt_city,
7067 const struct player *tgt_player,
7068 const struct action *paction)
7074 "Bad initial odds for action number %d."
7075 " Does it roll the dice at all?",
7084 .player = act_player,
7091 EFT_ACTION_ODDS_PCT))
7095 return CLIP(0, odds, 100);
7125 const struct player *actor_player,
7143 const struct player *actor_player,
7147 FALSE,
"Action %s is against %s not cities",
7149 action_target_kind_name(
7200 &enabler->actor_reqs,
7248 .value.utype = act_utype };
7328 struct action_enabler_list *
enablers;
7379 if ((actor_uni == NULL
7382 && (target_uni == NULL
7416 enum action_result result)
7424 act_list[(*position)++] = paction->
id;
7436 switch ((
enum gen_action)act) {
7437 case ACTION_SPY_POISON:
7438 return "ui_name_poison_city";
7439 case ACTION_SPY_POISON_ESC:
7440 return "ui_name_poison_city_escape";
7441 case ACTION_SPY_SABOTAGE_UNIT:
7442 return "ui_name_sabotage_unit";
7443 case ACTION_SPY_SABOTAGE_UNIT_ESC:
7444 return "ui_name_sabotage_unit_escape";
7445 case ACTION_SPY_BRIBE_UNIT:
7446 return "ui_name_bribe_unit";
7447 case ACTION_SPY_SABOTAGE_CITY:
7448 return "ui_name_sabotage_city";
7449 case ACTION_SPY_SABOTAGE_CITY_ESC:
7450 return "ui_name_sabotage_city_escape";
7451 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
7452 return "ui_name_targeted_sabotage_city";
7453 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
7454 return "ui_name_sabotage_city_production";
7455 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
7456 return "ui_name_targeted_sabotage_city_escape";
7457 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
7458 return "ui_name_sabotage_city_production_escape";
7459 case ACTION_SPY_INCITE_CITY:
7460 return "ui_name_incite_city";
7461 case ACTION_SPY_INCITE_CITY_ESC:
7462 return "ui_name_incite_city_escape";
7463 case ACTION_ESTABLISH_EMBASSY:
7464 return "ui_name_establish_embassy";
7465 case ACTION_ESTABLISH_EMBASSY_STAY:
7466 return "ui_name_establish_embassy_stay";
7467 case ACTION_SPY_STEAL_TECH:
7468 return "ui_name_steal_tech";
7469 case ACTION_SPY_STEAL_TECH_ESC:
7470 return "ui_name_steal_tech_escape";
7471 case ACTION_SPY_TARGETED_STEAL_TECH:
7472 return "ui_name_targeted_steal_tech";
7473 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
7474 return "ui_name_targeted_steal_tech_escape";
7475 case ACTION_SPY_INVESTIGATE_CITY:
7476 return "ui_name_investigate_city";
7477 case ACTION_INV_CITY_SPEND:
7478 return "ui_name_investigate_city_spend_unit";
7479 case ACTION_SPY_STEAL_GOLD:
7480 return "ui_name_steal_gold";
7481 case ACTION_SPY_STEAL_GOLD_ESC:
7482 return "ui_name_steal_gold_escape";
7483 case ACTION_SPY_SPREAD_PLAGUE:
7484 return "ui_name_spread_plague";
7485 case ACTION_STEAL_MAPS:
7486 return "ui_name_steal_maps";
7487 case ACTION_STEAL_MAPS_ESC:
7488 return "ui_name_steal_maps_escape";
7489 case ACTION_TRADE_ROUTE:
7490 return "ui_name_establish_trade_route";
7491 case ACTION_MARKETPLACE:
7492 return "ui_name_enter_marketplace";
7493 case ACTION_HELP_WONDER:
7494 return "ui_name_help_wonder";
7495 case ACTION_CAPTURE_UNITS:
7496 return "ui_name_capture_units";
7497 case ACTION_EXPEL_UNIT:
7498 return "ui_name_expel_unit";
7499 case ACTION_FOUND_CITY:
7500 return "ui_name_found_city";
7501 case ACTION_JOIN_CITY:
7502 return "ui_name_join_city";
7503 case ACTION_BOMBARD:
7504 return "ui_name_bombard";
7505 case ACTION_BOMBARD2:
7506 return "ui_name_bombard_2";
7507 case ACTION_BOMBARD3:
7508 return "ui_name_bombard_3";
7509 case ACTION_SPY_NUKE:
7510 return "ui_name_suitcase_nuke";
7511 case ACTION_SPY_NUKE_ESC:
7512 return "ui_name_suitcase_nuke_escape";
7514 return "ui_name_explode_nuclear";
7515 case ACTION_NUKE_CITY:
7516 return "ui_name_nuke_city";
7517 case ACTION_NUKE_UNITS:
7518 return "ui_name_nuke_units";
7519 case ACTION_DESTROY_CITY:
7520 return "ui_name_destroy_city";
7521 case ACTION_DISBAND_UNIT_RECOVER:
7522 return "ui_name_disband_unit_recover";
7523 case ACTION_DISBAND_UNIT:
7524 return "ui_name_disband_unit";
7525 case ACTION_HOME_CITY:
7526 return "ui_name_home_city";
7527 case ACTION_HOMELESS:
7528 return "ui_name_homeless";
7529 case ACTION_UPGRADE_UNIT:
7530 return "ui_name_upgrade_unit";
7531 case ACTION_PARADROP:
7532 return "ui_name_paradrop_unit";
7533 case ACTION_PARADROP_CONQUER:
7534 return "ui_name_paradrop_unit_conquer";
7535 case ACTION_PARADROP_FRIGHTEN:
7536 return "ui_name_paradrop_unit_frighten";
7537 case ACTION_PARADROP_FRIGHTEN_CONQUER:
7538 return "ui_name_paradrop_unit_frighten_conquer";
7539 case ACTION_PARADROP_ENTER:
7540 return "ui_name_paradrop_unit_enter";
7541 case ACTION_PARADROP_ENTER_CONQUER:
7542 return "ui_name_paradrop_unit_enter_conquer";
7543 case ACTION_AIRLIFT:
7544 return "ui_name_airlift_unit";
7546 return "ui_name_attack";
7547 case ACTION_SUICIDE_ATTACK:
7548 return "ui_name_suicide_attack";
7549 case ACTION_STRIKE_BUILDING:
7550 return "ui_name_surgical_strike_building";
7551 case ACTION_STRIKE_PRODUCTION:
7552 return "ui_name_surgical_strike_production";
7553 case ACTION_CONQUER_CITY:
7554 return "ui_name_conquer_city";
7555 case ACTION_CONQUER_CITY2:
7556 return "ui_name_conquer_city_2";
7557 case ACTION_CONQUER_CITY3:
7558 return "ui_name_conquer_city_3";
7559 case ACTION_CONQUER_CITY4:
7560 return "ui_name_conquer_city_4";
7561 case ACTION_CONQUER_EXTRAS:
7562 return "ui_name_conquer_extras";
7563 case ACTION_CONQUER_EXTRAS2:
7564 return "ui_name_conquer_extras_2";
7565 case ACTION_CONQUER_EXTRAS3:
7566 return "ui_name_conquer_extras_3";
7567 case ACTION_CONQUER_EXTRAS4:
7568 return "ui_name_conquer_extras_4";
7569 case ACTION_HEAL_UNIT:
7570 return "ui_name_heal_unit";
7571 case ACTION_HEAL_UNIT2:
7572 return "ui_name_heal_unit_2";
7573 case ACTION_TRANSFORM_TERRAIN:
7574 return "ui_name_transform_terrain";
7575 case ACTION_CULTIVATE:
7576 return "ui_name_cultivate";
7578 return "ui_name_plant";
7579 case ACTION_PILLAGE:
7580 return "ui_name_pillage";
7581 case ACTION_CLEAN_POLLUTION:
7582 return "ui_name_clean_pollution";
7583 case ACTION_CLEAN_FALLOUT:
7584 return "ui_name_clean_fallout";
7585 case ACTION_FORTIFY:
7586 return "ui_name_fortify";
7588 return "ui_name_road";
7589 case ACTION_CONVERT:
7590 return "ui_name_convert_unit";
7592 return "ui_name_build_base";
7594 return "ui_name_build_mine";
7595 case ACTION_IRRIGATE:
7596 return "ui_name_irrigate";
7597 case ACTION_TRANSPORT_ALIGHT:
7598 return "ui_name_transport_alight";
7599 case ACTION_TRANSPORT_BOARD:
7600 return "ui_name_transport_board";
7601 case ACTION_TRANSPORT_EMBARK:
7602 return "ui_name_transport_embark";
7603 case ACTION_TRANSPORT_EMBARK2:
7604 return "ui_name_transport_embark_2";
7605 case ACTION_TRANSPORT_EMBARK3:
7606 return "ui_name_transport_embark_3";
7607 case ACTION_TRANSPORT_UNLOAD:
7608 return "ui_name_transport_unload";
7609 case ACTION_TRANSPORT_DISEMBARK1:
7610 return "ui_name_transport_disembark";
7611 case ACTION_TRANSPORT_DISEMBARK2:
7612 return "ui_name_transport_disembark_2";
7613 case ACTION_TRANSPORT_DISEMBARK3:
7614 return "ui_name_transport_disembark_3";
7615 case ACTION_TRANSPORT_DISEMBARK4:
7616 return "ui_name_transport_disembark_4";
7617 case ACTION_HUT_ENTER:
7618 return "ui_name_enter_hut";
7619 case ACTION_HUT_ENTER2:
7620 return "ui_name_enter_hut_2";
7621 case ACTION_HUT_ENTER3:
7622 return "ui_name_enter_hut_3";
7623 case ACTION_HUT_ENTER4:
7624 return "ui_name_enter_hut_4";
7625 case ACTION_HUT_FRIGHTEN:
7626 return "ui_name_frighten_hut";
7627 case ACTION_HUT_FRIGHTEN2:
7628 return "ui_name_frighten_hut_2";
7629 case ACTION_HUT_FRIGHTEN3:
7630 return "ui_name_frighten_hut_3";
7631 case ACTION_HUT_FRIGHTEN4:
7632 return "ui_name_frighten_hut_4";
7633 case ACTION_SPY_ATTACK:
7634 return "ui_name_spy_attack";
7635 case ACTION_UNIT_MOVE:
7636 return "ui_name_unit_move";
7637 case ACTION_UNIT_MOVE2:
7638 return "ui_name_unit_move_2";
7639 case ACTION_UNIT_MOVE3:
7640 return "ui_name_unit_move_3";
7641 case ACTION_USER_ACTION1:
7642 return "ui_name_user_action_1";
7643 case ACTION_USER_ACTION2:
7644 return "ui_name_user_action_2";
7645 case ACTION_USER_ACTION3:
7646 return "ui_name_user_action_3";
7647 case ACTION_USER_ACTION4:
7648 return "ui_name_user_action_4";
7653 fc_assert(act >= 0 && act < ACTION_COUNT);
7662 switch ((
enum gen_action)act) {
7663 case ACTION_SPY_POISON:
7665 return N_(
"%sPoison City%s");
7666 case ACTION_SPY_POISON_ESC:
7668 return N_(
"%sPoison City and Escape%s");
7669 case ACTION_SPY_SABOTAGE_UNIT:
7671 return N_(
"S%sabotage Enemy Unit%s");
7672 case ACTION_SPY_SABOTAGE_UNIT_ESC:
7674 return N_(
"S%sabotage Enemy Unit and Escape%s");
7675 case ACTION_SPY_BRIBE_UNIT:
7677 return N_(
"Bribe Enemy %sUnit%s");
7678 case ACTION_SPY_SABOTAGE_CITY:
7680 return N_(
"%sSabotage City%s");
7681 case ACTION_SPY_SABOTAGE_CITY_ESC:
7683 return N_(
"%sSabotage City and Escape%s");
7684 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
7686 return N_(
"Industria%sl Sabotage%s");
7687 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
7689 return N_(
"Industria%sl Sabotage Production%s");
7690 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
7692 return N_(
"Industria%sl Sabotage and Escape%s");
7693 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
7695 return N_(
"Industria%sl Sabotage Production and Escape%s");
7696 case ACTION_SPY_INCITE_CITY:
7698 return N_(
"Incite a Re%svolt%s");
7699 case ACTION_SPY_INCITE_CITY_ESC:
7701 return N_(
"Incite a Re%svolt and Escape%s");
7702 case ACTION_ESTABLISH_EMBASSY:
7704 return N_(
"Establish %sEmbassy%s");
7705 case ACTION_ESTABLISH_EMBASSY_STAY:
7707 return N_(
"Becom%se Ambassador%s");
7708 case ACTION_SPY_STEAL_TECH:
7710 return N_(
"Steal %sTechnology%s");
7711 case ACTION_SPY_STEAL_TECH_ESC:
7713 return N_(
"Steal %sTechnology and Escape%s");
7714 case ACTION_SPY_TARGETED_STEAL_TECH:
7716 return N_(
"In%sdustrial Espionage%s");
7717 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
7719 return N_(
"In%sdustrial Espionage and Escape%s");
7720 case ACTION_SPY_INVESTIGATE_CITY:
7722 return N_(
"%sInvestigate City%s");
7723 case ACTION_INV_CITY_SPEND:
7726 return N_(
"%sInvestigate City (spends the unit)%s");
7727 case ACTION_SPY_STEAL_GOLD:
7729 return N_(
"Steal %sGold%s");
7730 case ACTION_SPY_STEAL_GOLD_ESC:
7732 return N_(
"Steal %sGold and Escape%s");
7733 case ACTION_SPY_SPREAD_PLAGUE:
7735 return N_(
"Spread %sPlague%s");
7736 case ACTION_STEAL_MAPS:
7738 return N_(
"Steal %sMaps%s");
7739 case ACTION_STEAL_MAPS_ESC:
7741 return N_(
"Steal %sMaps and Escape%s");
7742 case ACTION_TRADE_ROUTE:
7744 return N_(
"Establish Trade %sRoute%s");
7745 case ACTION_MARKETPLACE:
7747 return N_(
"Enter %sMarketplace%s");
7748 case ACTION_HELP_WONDER:
7750 return N_(
"Help %sbuild Wonder%s");
7751 case ACTION_CAPTURE_UNITS:
7753 return N_(
"%sCapture Units%s");
7754 case ACTION_EXPEL_UNIT:
7756 return N_(
"%sExpel Unit%s");
7757 case ACTION_FOUND_CITY:
7759 return N_(
"%sFound City%s");
7760 case ACTION_JOIN_CITY:
7762 return N_(
"%sJoin City%s");
7763 case ACTION_BOMBARD:
7765 return N_(
"B%sombard%s");
7766 case ACTION_BOMBARD2:
7768 return N_(
"B%sombard 2%s");
7769 case ACTION_BOMBARD3:
7771 return N_(
"B%sombard 3%s");
7772 case ACTION_SPY_NUKE:
7774 return N_(
"Suitcase %sNuke%s");
7775 case ACTION_SPY_NUKE_ESC:
7777 return N_(
"Suitcase %sNuke and Escape%s");
7780 return N_(
"Explode %sNuclear%s");
7781 case ACTION_NUKE_CITY:
7783 return N_(
"%sNuke City%s");
7784 case ACTION_NUKE_UNITS:
7786 return N_(
"%sNuke Units%s");
7787 case ACTION_DESTROY_CITY:
7789 return N_(
"Destroy %sCity%s");
7790 case ACTION_DISBAND_UNIT_RECOVER:
7792 return N_(
"Dis%sband recovering production%s");
7793 case ACTION_DISBAND_UNIT:
7795 return N_(
"Dis%sband without recovering production%s");
7796 case ACTION_HOME_CITY:
7798 return N_(
"Set %sHome City%s");
7799 case ACTION_HOMELESS:
7801 return N_(
"Make %sHomeless%s");
7802 case ACTION_UPGRADE_UNIT:
7804 return N_(
"%sUpgrade Unit%s");
7805 case ACTION_PARADROP:
7807 return N_(
"Drop %sParatrooper%s");
7808 case ACTION_PARADROP_CONQUER:
7810 return N_(
"Drop %sParatrooper%s");
7811 case ACTION_PARADROP_FRIGHTEN:
7813 return N_(
"Drop %sParatrooper%s");
7814 case ACTION_PARADROP_FRIGHTEN_CONQUER:
7816 return N_(
"Drop %sParatrooper%s");
7817 case ACTION_PARADROP_ENTER:
7819 return N_(
"Drop %sParatrooper%s");
7820 case ACTION_PARADROP_ENTER_CONQUER:
7822 return N_(
"Drop %sParatrooper%s");
7823 case ACTION_AIRLIFT:
7825 return N_(
"%sAirlift to City%s");
7828 return N_(
"%sAttack%s");
7829 case ACTION_SUICIDE_ATTACK:
7831 return N_(
"%sSuicide Attack%s");
7832 case ACTION_STRIKE_BUILDING:
7834 return N_(
"Surgical Str%sike Building%s");
7835 case ACTION_STRIKE_PRODUCTION:
7837 return N_(
"Surgical Str%sike Production%s");
7838 case ACTION_CONQUER_CITY:
7839 case ACTION_CONQUER_CITY3:
7840 case ACTION_CONQUER_CITY4:
7842 return N_(
"%sConquer City%s");
7843 case ACTION_CONQUER_CITY2:
7845 return N_(
"%sConquer City 2%s");
7846 case ACTION_CONQUER_EXTRAS:
7847 case ACTION_CONQUER_EXTRAS3:
7848 case ACTION_CONQUER_EXTRAS4:
7850 return N_(
"%sConquer Extras%s");
7851 case ACTION_CONQUER_EXTRAS2:
7853 return N_(
"%sConquer Extras 2%s");
7854 case ACTION_HEAL_UNIT:
7855 case ACTION_HEAL_UNIT2:
7857 return N_(
"Heal %sUnit%s");
7858 case ACTION_TRANSFORM_TERRAIN:
7860 return N_(
"%sTransform Terrain%s");
7861 case ACTION_CULTIVATE:
7863 return N_(
"Transform by %sCultivating%s");
7866 return N_(
"Transform by %sPlanting%s");
7867 case ACTION_PILLAGE:
7869 return N_(
"Pilla%sge%s");
7870 case ACTION_CLEAN_POLLUTION:
7872 return N_(
"Clean %sPollution%s");
7873 case ACTION_CLEAN_FALLOUT:
7875 return N_(
"Clean %sFallout%s");
7876 case ACTION_FORTIFY:
7878 return N_(
"%sFortify%s");
7881 return N_(
"Build %sRoad%s");
7882 case ACTION_CONVERT:
7884 return N_(
"%sConvert Unit%s");
7887 return N_(
"%sBuild Base%s");
7890 return N_(
"Build %sMine%s");
7891 case ACTION_IRRIGATE:
7893 return N_(
"Build %sIrrigation%s");
7894 case ACTION_TRANSPORT_ALIGHT:
7896 return N_(
"%sDeboard%s");
7897 case ACTION_TRANSPORT_BOARD:
7899 return N_(
"%sBoard%s");
7900 case ACTION_TRANSPORT_EMBARK:
7901 case ACTION_TRANSPORT_EMBARK2:
7902 case ACTION_TRANSPORT_EMBARK3:
7904 return N_(
"%sEmbark%s");
7905 case ACTION_TRANSPORT_UNLOAD:
7907 return N_(
"%sUnload%s");
7908 case ACTION_TRANSPORT_DISEMBARK1:
7909 case ACTION_TRANSPORT_DISEMBARK3:
7910 case ACTION_TRANSPORT_DISEMBARK4:
7912 return N_(
"%sDisembark%s");
7913 case ACTION_TRANSPORT_DISEMBARK2:
7915 return N_(
"%sDisembark 2%s");
7916 case ACTION_SPY_ATTACK:
7918 return N_(
"%sEliminate Diplomat%s");
7919 case ACTION_HUT_ENTER:
7920 case ACTION_HUT_ENTER2:
7921 case ACTION_HUT_ENTER3:
7922 case ACTION_HUT_ENTER4:
7924 return N_(
"Enter %sHut%s");
7925 case ACTION_HUT_FRIGHTEN:
7926 case ACTION_HUT_FRIGHTEN2:
7927 case ACTION_HUT_FRIGHTEN3:
7928 case ACTION_HUT_FRIGHTEN4:
7930 return N_(
"Frighten %sHut%s");
7931 case ACTION_UNIT_MOVE:
7932 case ACTION_UNIT_MOVE2:
7933 case ACTION_UNIT_MOVE3:
7935 return N_(
"Regular %sMove%s");
7936 case ACTION_USER_ACTION1:
7938 return N_(
"%sUser Action 1%s");
7939 case ACTION_USER_ACTION2:
7941 return N_(
"%sUser Action 2%s");
7942 case ACTION_USER_ACTION3:
7944 return N_(
"%sUser Action 3%s");
7945 case ACTION_USER_ACTION4:
7947 return N_(
"%sUser Action 4%s");
7964 switch ((
enum gen_action)act) {
7965 case ACTION_SPY_POISON:
7966 case ACTION_SPY_POISON_ESC:
7967 case ACTION_SPY_SABOTAGE_UNIT:
7968 case ACTION_SPY_SABOTAGE_UNIT_ESC:
7969 case ACTION_SPY_BRIBE_UNIT:
7970 case ACTION_SPY_SABOTAGE_CITY:
7971 case ACTION_SPY_SABOTAGE_CITY_ESC:
7972 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
7973 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
7974 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
7975 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
7976 case ACTION_SPY_INCITE_CITY:
7977 case ACTION_SPY_INCITE_CITY_ESC:
7978 case ACTION_ESTABLISH_EMBASSY:
7979 case ACTION_ESTABLISH_EMBASSY_STAY:
7980 case ACTION_SPY_STEAL_TECH:
7981 case ACTION_SPY_STEAL_TECH_ESC:
7982 case ACTION_SPY_TARGETED_STEAL_TECH:
7983 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
7984 case ACTION_SPY_INVESTIGATE_CITY:
7985 case ACTION_INV_CITY_SPEND:
7986 case ACTION_SPY_STEAL_GOLD:
7987 case ACTION_SPY_STEAL_GOLD_ESC:
7988 case ACTION_SPY_SPREAD_PLAGUE:
7989 case ACTION_STEAL_MAPS:
7990 case ACTION_STEAL_MAPS_ESC:
7991 case ACTION_TRADE_ROUTE:
7992 case ACTION_MARKETPLACE:
7993 case ACTION_HELP_WONDER:
7994 case ACTION_CAPTURE_UNITS:
7995 case ACTION_EXPEL_UNIT:
7996 case ACTION_FOUND_CITY:
7997 case ACTION_JOIN_CITY:
7998 case ACTION_SPY_NUKE:
7999 case ACTION_SPY_NUKE_ESC:
8000 case ACTION_DESTROY_CITY:
8001 case ACTION_DISBAND_UNIT_RECOVER:
8002 case ACTION_DISBAND_UNIT:
8003 case ACTION_HOME_CITY:
8004 case ACTION_HOMELESS:
8005 case ACTION_UPGRADE_UNIT:
8006 case ACTION_PARADROP:
8007 case ACTION_PARADROP_CONQUER:
8008 case ACTION_PARADROP_FRIGHTEN:
8009 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8010 case ACTION_PARADROP_ENTER:
8011 case ACTION_PARADROP_ENTER_CONQUER:
8012 case ACTION_AIRLIFT:
8014 case ACTION_SUICIDE_ATTACK:
8015 case ACTION_STRIKE_BUILDING:
8016 case ACTION_STRIKE_PRODUCTION:
8017 case ACTION_CONQUER_CITY:
8018 case ACTION_CONQUER_CITY2:
8019 case ACTION_CONQUER_CITY3:
8020 case ACTION_CONQUER_CITY4:
8021 case ACTION_HEAL_UNIT:
8022 case ACTION_HEAL_UNIT2:
8023 case ACTION_TRANSFORM_TERRAIN:
8024 case ACTION_CULTIVATE:
8026 case ACTION_PILLAGE:
8027 case ACTION_CLEAN_POLLUTION:
8028 case ACTION_CLEAN_FALLOUT:
8029 case ACTION_FORTIFY:
8031 case ACTION_CONVERT:
8034 case ACTION_IRRIGATE:
8035 case ACTION_TRANSPORT_ALIGHT:
8036 case ACTION_TRANSPORT_BOARD:
8037 case ACTION_TRANSPORT_EMBARK:
8038 case ACTION_TRANSPORT_EMBARK2:
8039 case ACTION_TRANSPORT_EMBARK3:
8040 case ACTION_TRANSPORT_UNLOAD:
8041 case ACTION_TRANSPORT_DISEMBARK1:
8042 case ACTION_TRANSPORT_DISEMBARK2:
8043 case ACTION_TRANSPORT_DISEMBARK3:
8044 case ACTION_TRANSPORT_DISEMBARK4:
8045 case ACTION_BOMBARD:
8046 case ACTION_BOMBARD2:
8047 case ACTION_BOMBARD3:
8048 case ACTION_SPY_ATTACK:
8049 case ACTION_CONQUER_EXTRAS:
8050 case ACTION_CONQUER_EXTRAS2:
8051 case ACTION_CONQUER_EXTRAS3:
8052 case ACTION_CONQUER_EXTRAS4:
8053 case ACTION_HUT_ENTER:
8054 case ACTION_HUT_ENTER2:
8055 case ACTION_HUT_ENTER3:
8056 case ACTION_HUT_ENTER4:
8057 case ACTION_HUT_FRIGHTEN:
8058 case ACTION_HUT_FRIGHTEN2:
8059 case ACTION_HUT_FRIGHTEN4:
8060 case ACTION_HUT_FRIGHTEN3:
8061 case ACTION_UNIT_MOVE:
8062 case ACTION_UNIT_MOVE2:
8063 case ACTION_UNIT_MOVE3:
8067 return "explode_nuclear_min_range";
8068 case ACTION_NUKE_CITY:
8069 return "nuke_city_min_range";
8070 case ACTION_NUKE_UNITS:
8071 return "nuke_units_min_range";
8072 case ACTION_USER_ACTION1:
8073 return "user_action_1_min_range";
8074 case ACTION_USER_ACTION2:
8075 return "user_action_2_min_range";
8076 case ACTION_USER_ACTION3:
8077 return "user_action_3_min_range";
8078 case ACTION_USER_ACTION4:
8079 return "user_action_4_min_range";
8084 fc_assert(act >= 0 && act < ACTION_COUNT);
8094 case ACTRES_ESTABLISH_EMBASSY:
8095 case ACTRES_SPY_INVESTIGATE_CITY:
8096 case ACTRES_SPY_POISON:
8097 case ACTRES_SPY_STEAL_GOLD:
8098 case ACTRES_SPY_SABOTAGE_CITY:
8099 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8100 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8101 case ACTRES_SPY_STEAL_TECH:
8102 case ACTRES_SPY_TARGETED_STEAL_TECH:
8103 case ACTRES_SPY_INCITE_CITY:
8104 case ACTRES_TRADE_ROUTE:
8105 case ACTRES_MARKETPLACE:
8106 case ACTRES_HELP_WONDER:
8107 case ACTRES_SPY_BRIBE_UNIT:
8108 case ACTRES_SPY_SABOTAGE_UNIT:
8109 case ACTRES_CAPTURE_UNITS:
8110 case ACTRES_FOUND_CITY:
8111 case ACTRES_JOIN_CITY:
8112 case ACTRES_STEAL_MAPS:
8113 case ACTRES_BOMBARD:
8114 case ACTRES_SPY_NUKE:
8115 case ACTRES_DESTROY_CITY:
8116 case ACTRES_EXPEL_UNIT:
8117 case ACTRES_DISBAND_UNIT_RECOVER:
8118 case ACTRES_DISBAND_UNIT:
8119 case ACTRES_HOME_CITY:
8120 case ACTRES_HOMELESS:
8121 case ACTRES_UPGRADE_UNIT:
8122 case ACTRES_PARADROP:
8123 case ACTRES_PARADROP_CONQUER:
8124 case ACTRES_AIRLIFT:
8125 case ACTRES_STRIKE_BUILDING:
8126 case ACTRES_STRIKE_PRODUCTION:
8128 case ACTRES_CONQUER_CITY:
8129 case ACTRES_HEAL_UNIT:
8130 case ACTRES_TRANSFORM_TERRAIN:
8131 case ACTRES_CULTIVATE:
8133 case ACTRES_PILLAGE:
8134 case ACTRES_CLEAN_POLLUTION:
8135 case ACTRES_CLEAN_FALLOUT:
8136 case ACTRES_FORTIFY:
8138 case ACTRES_CONVERT:
8141 case ACTRES_IRRIGATE:
8142 case ACTRES_TRANSPORT_ALIGHT:
8143 case ACTRES_TRANSPORT_UNLOAD:
8144 case ACTRES_TRANSPORT_DISEMBARK:
8145 case ACTRES_TRANSPORT_BOARD:
8146 case ACTRES_TRANSPORT_EMBARK:
8147 case ACTRES_SPY_ATTACK:
8148 case ACTRES_SPY_SPREAD_PLAGUE:
8149 case ACTRES_CONQUER_EXTRAS:
8150 case ACTRES_HUT_ENTER:
8151 case ACTRES_HUT_FRIGHTEN:
8152 case ACTRES_UNIT_MOVE:
8157 case ACTRES_NUKE_UNITS:
8175 switch ((
enum gen_action)act) {
8176 case ACTION_SPY_POISON:
8177 case ACTION_SPY_POISON_ESC:
8178 case ACTION_SPY_SABOTAGE_UNIT:
8179 case ACTION_SPY_SABOTAGE_UNIT_ESC:
8180 case ACTION_SPY_BRIBE_UNIT:
8181 case ACTION_SPY_SABOTAGE_CITY:
8182 case ACTION_SPY_SABOTAGE_CITY_ESC:
8183 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
8184 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
8185 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
8186 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
8187 case ACTION_SPY_INCITE_CITY:
8188 case ACTION_SPY_INCITE_CITY_ESC:
8189 case ACTION_ESTABLISH_EMBASSY:
8190 case ACTION_ESTABLISH_EMBASSY_STAY:
8191 case ACTION_SPY_STEAL_TECH:
8192 case ACTION_SPY_STEAL_TECH_ESC:
8193 case ACTION_SPY_TARGETED_STEAL_TECH:
8194 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
8195 case ACTION_SPY_INVESTIGATE_CITY:
8196 case ACTION_INV_CITY_SPEND:
8197 case ACTION_SPY_STEAL_GOLD:
8198 case ACTION_SPY_STEAL_GOLD_ESC:
8199 case ACTION_SPY_SPREAD_PLAGUE:
8200 case ACTION_STEAL_MAPS:
8201 case ACTION_STEAL_MAPS_ESC:
8202 case ACTION_TRADE_ROUTE:
8203 case ACTION_MARKETPLACE:
8204 case ACTION_CAPTURE_UNITS:
8205 case ACTION_EXPEL_UNIT:
8206 case ACTION_FOUND_CITY:
8207 case ACTION_JOIN_CITY:
8208 case ACTION_SPY_NUKE:
8209 case ACTION_SPY_NUKE_ESC:
8210 case ACTION_DESTROY_CITY:
8211 case ACTION_DISBAND_UNIT:
8212 case ACTION_HOME_CITY:
8213 case ACTION_HOMELESS:
8214 case ACTION_UPGRADE_UNIT:
8215 case ACTION_PARADROP:
8216 case ACTION_PARADROP_CONQUER:
8217 case ACTION_PARADROP_FRIGHTEN:
8218 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8219 case ACTION_PARADROP_ENTER:
8220 case ACTION_PARADROP_ENTER_CONQUER:
8222 case ACTION_SUICIDE_ATTACK:
8223 case ACTION_STRIKE_BUILDING:
8224 case ACTION_STRIKE_PRODUCTION:
8225 case ACTION_CONQUER_CITY:
8226 case ACTION_CONQUER_CITY2:
8227 case ACTION_CONQUER_CITY3:
8228 case ACTION_CONQUER_CITY4:
8229 case ACTION_HEAL_UNIT:
8230 case ACTION_HEAL_UNIT2:
8231 case ACTION_TRANSFORM_TERRAIN:
8232 case ACTION_CULTIVATE:
8234 case ACTION_PILLAGE:
8235 case ACTION_CLEAN_POLLUTION:
8236 case ACTION_CLEAN_FALLOUT:
8237 case ACTION_FORTIFY:
8239 case ACTION_CONVERT:
8242 case ACTION_IRRIGATE:
8243 case ACTION_TRANSPORT_ALIGHT:
8244 case ACTION_TRANSPORT_BOARD:
8245 case ACTION_TRANSPORT_EMBARK:
8246 case ACTION_TRANSPORT_EMBARK2:
8247 case ACTION_TRANSPORT_EMBARK3:
8248 case ACTION_TRANSPORT_UNLOAD:
8249 case ACTION_TRANSPORT_DISEMBARK1:
8250 case ACTION_TRANSPORT_DISEMBARK2:
8251 case ACTION_TRANSPORT_DISEMBARK3:
8252 case ACTION_TRANSPORT_DISEMBARK4:
8253 case ACTION_SPY_ATTACK:
8254 case ACTION_CONQUER_EXTRAS:
8255 case ACTION_CONQUER_EXTRAS2:
8256 case ACTION_CONQUER_EXTRAS3:
8257 case ACTION_CONQUER_EXTRAS4:
8258 case ACTION_HUT_ENTER:
8259 case ACTION_HUT_ENTER2:
8260 case ACTION_HUT_ENTER3:
8261 case ACTION_HUT_ENTER4:
8262 case ACTION_HUT_FRIGHTEN:
8263 case ACTION_HUT_FRIGHTEN2:
8264 case ACTION_HUT_FRIGHTEN3:
8265 case ACTION_HUT_FRIGHTEN4:
8266 case ACTION_UNIT_MOVE:
8267 case ACTION_UNIT_MOVE2:
8268 case ACTION_UNIT_MOVE3:
8271 case ACTION_HELP_WONDER:
8272 return "help_wonder_max_range";
8273 case ACTION_DISBAND_UNIT_RECOVER:
8274 return "disband_unit_recover_max_range";
8275 case ACTION_BOMBARD:
8276 return "bombard_max_range";
8277 case ACTION_BOMBARD2:
8278 return "bombard_2_max_range";
8279 case ACTION_BOMBARD3:
8280 return "bombard_3_max_range";
8282 return "explode_nuclear_max_range";
8283 case ACTION_NUKE_CITY:
8284 return "nuke_city_max_range";
8285 case ACTION_NUKE_UNITS:
8286 return "nuke_units_max_range";
8287 case ACTION_AIRLIFT:
8288 return "airlift_max_range";
8289 case ACTION_USER_ACTION1:
8290 return "user_action_1_max_range";
8291 case ACTION_USER_ACTION2:
8292 return "user_action_2_max_range";
8293 case ACTION_USER_ACTION3:
8294 return "user_action_3_max_range";
8295 case ACTION_USER_ACTION4:
8296 return "user_action_4_max_range";
8301 fc_assert(act >= 0 && act < ACTION_COUNT);
8311 case ACTRES_ESTABLISH_EMBASSY:
8312 case ACTRES_SPY_INVESTIGATE_CITY:
8313 case ACTRES_SPY_POISON:
8314 case ACTRES_SPY_STEAL_GOLD:
8315 case ACTRES_SPY_SABOTAGE_CITY:
8316 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8317 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8318 case ACTRES_SPY_STEAL_TECH:
8319 case ACTRES_SPY_TARGETED_STEAL_TECH:
8320 case ACTRES_SPY_INCITE_CITY:
8321 case ACTRES_TRADE_ROUTE:
8322 case ACTRES_MARKETPLACE:
8323 case ACTRES_SPY_BRIBE_UNIT:
8324 case ACTRES_SPY_SABOTAGE_UNIT:
8325 case ACTRES_CAPTURE_UNITS:
8326 case ACTRES_FOUND_CITY:
8327 case ACTRES_JOIN_CITY:
8328 case ACTRES_STEAL_MAPS:
8329 case ACTRES_SPY_NUKE:
8330 case ACTRES_DESTROY_CITY:
8331 case ACTRES_EXPEL_UNIT:
8332 case ACTRES_DISBAND_UNIT:
8333 case ACTRES_HOME_CITY:
8334 case ACTRES_HOMELESS:
8335 case ACTRES_UPGRADE_UNIT:
8336 case ACTRES_PARADROP:
8337 case ACTRES_PARADROP_CONQUER:
8338 case ACTRES_STRIKE_BUILDING:
8339 case ACTRES_STRIKE_PRODUCTION:
8341 case ACTRES_CONQUER_CITY:
8342 case ACTRES_HEAL_UNIT:
8343 case ACTRES_TRANSFORM_TERRAIN:
8344 case ACTRES_CULTIVATE:
8346 case ACTRES_PILLAGE:
8347 case ACTRES_CLEAN_POLLUTION:
8348 case ACTRES_CLEAN_FALLOUT:
8349 case ACTRES_FORTIFY:
8351 case ACTRES_CONVERT:
8354 case ACTRES_IRRIGATE:
8355 case ACTRES_TRANSPORT_ALIGHT:
8356 case ACTRES_TRANSPORT_UNLOAD:
8357 case ACTRES_TRANSPORT_DISEMBARK:
8358 case ACTRES_TRANSPORT_BOARD:
8359 case ACTRES_TRANSPORT_EMBARK:
8360 case ACTRES_SPY_ATTACK:
8361 case ACTRES_SPY_SPREAD_PLAGUE:
8362 case ACTRES_CONQUER_EXTRAS:
8363 case ACTRES_HUT_ENTER:
8364 case ACTRES_HUT_FRIGHTEN:
8365 case ACTRES_UNIT_MOVE:
8369 case ACTRES_HELP_WONDER:
8370 case ACTRES_DISBAND_UNIT_RECOVER:
8372 case ACTRES_BOMBARD:
8376 case ACTRES_NUKE_UNITS:
8378 case ACTRES_AIRLIFT:
8396 switch ((
enum gen_action)act) {
8397 case ACTION_SPY_POISON:
8398 case ACTION_SPY_POISON_ESC:
8399 case ACTION_SPY_SABOTAGE_UNIT:
8400 case ACTION_SPY_SABOTAGE_UNIT_ESC:
8401 case ACTION_SPY_BRIBE_UNIT:
8402 case ACTION_SPY_SABOTAGE_CITY:
8403 case ACTION_SPY_SABOTAGE_CITY_ESC:
8404 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
8405 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
8406 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
8407 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
8408 case ACTION_SPY_INCITE_CITY:
8409 case ACTION_SPY_INCITE_CITY_ESC:
8410 case ACTION_ESTABLISH_EMBASSY:
8411 case ACTION_ESTABLISH_EMBASSY_STAY:
8412 case ACTION_SPY_STEAL_TECH:
8413 case ACTION_SPY_STEAL_TECH_ESC:
8414 case ACTION_SPY_TARGETED_STEAL_TECH:
8415 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
8416 case ACTION_SPY_INVESTIGATE_CITY:
8417 case ACTION_INV_CITY_SPEND:
8418 case ACTION_SPY_STEAL_GOLD:
8419 case ACTION_SPY_STEAL_GOLD_ESC:
8420 case ACTION_SPY_SPREAD_PLAGUE:
8421 case ACTION_STEAL_MAPS:
8422 case ACTION_STEAL_MAPS_ESC:
8423 case ACTION_TRADE_ROUTE:
8424 case ACTION_MARKETPLACE:
8425 case ACTION_HELP_WONDER:
8426 case ACTION_CAPTURE_UNITS:
8427 case ACTION_EXPEL_UNIT:
8428 case ACTION_FOUND_CITY:
8429 case ACTION_JOIN_CITY:
8430 case ACTION_SPY_NUKE:
8431 case ACTION_SPY_NUKE_ESC:
8432 case ACTION_NUKE_UNITS:
8433 case ACTION_DESTROY_CITY:
8434 case ACTION_DISBAND_UNIT_RECOVER:
8435 case ACTION_DISBAND_UNIT:
8436 case ACTION_HOME_CITY:
8437 case ACTION_HOMELESS:
8438 case ACTION_UPGRADE_UNIT:
8439 case ACTION_PARADROP:
8440 case ACTION_PARADROP_CONQUER:
8441 case ACTION_PARADROP_FRIGHTEN:
8442 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8443 case ACTION_PARADROP_ENTER:
8444 case ACTION_PARADROP_ENTER_CONQUER:
8445 case ACTION_AIRLIFT:
8447 case ACTION_SUICIDE_ATTACK:
8448 case ACTION_STRIKE_BUILDING:
8449 case ACTION_STRIKE_PRODUCTION:
8450 case ACTION_CONQUER_CITY:
8451 case ACTION_CONQUER_CITY2:
8452 case ACTION_CONQUER_CITY3:
8453 case ACTION_CONQUER_CITY4:
8454 case ACTION_HEAL_UNIT:
8455 case ACTION_HEAL_UNIT2:
8456 case ACTION_TRANSFORM_TERRAIN:
8457 case ACTION_CULTIVATE:
8459 case ACTION_CLEAN_POLLUTION:
8460 case ACTION_CLEAN_FALLOUT:
8461 case ACTION_FORTIFY:
8463 case ACTION_CONVERT:
8466 case ACTION_IRRIGATE:
8467 case ACTION_TRANSPORT_ALIGHT:
8468 case ACTION_TRANSPORT_BOARD:
8469 case ACTION_TRANSPORT_EMBARK:
8470 case ACTION_TRANSPORT_EMBARK2:
8471 case ACTION_TRANSPORT_EMBARK3:
8472 case ACTION_TRANSPORT_UNLOAD:
8473 case ACTION_TRANSPORT_DISEMBARK1:
8474 case ACTION_TRANSPORT_DISEMBARK2:
8475 case ACTION_TRANSPORT_DISEMBARK3:
8476 case ACTION_TRANSPORT_DISEMBARK4:
8477 case ACTION_BOMBARD:
8478 case ACTION_BOMBARD2:
8479 case ACTION_BOMBARD3:
8480 case ACTION_SPY_ATTACK:
8481 case ACTION_CONQUER_EXTRAS:
8482 case ACTION_CONQUER_EXTRAS2:
8483 case ACTION_CONQUER_EXTRAS3:
8484 case ACTION_CONQUER_EXTRAS4:
8485 case ACTION_HUT_ENTER:
8486 case ACTION_HUT_ENTER2:
8487 case ACTION_HUT_ENTER3:
8488 case ACTION_HUT_ENTER4:
8489 case ACTION_HUT_FRIGHTEN:
8490 case ACTION_HUT_FRIGHTEN2:
8491 case ACTION_HUT_FRIGHTEN3:
8492 case ACTION_HUT_FRIGHTEN4:
8493 case ACTION_UNIT_MOVE:
8494 case ACTION_UNIT_MOVE2:
8495 case ACTION_UNIT_MOVE3:
8499 return "explode_nuclear_target_kind";
8500 case ACTION_NUKE_CITY:
8501 return "nuke_city_target_kind";
8502 case ACTION_PILLAGE:
8503 return "pillage_target_kind";
8504 case ACTION_USER_ACTION1:
8505 return "user_action_1_target_kind";
8506 case ACTION_USER_ACTION2:
8507 return "user_action_2_target_kind";
8508 case ACTION_USER_ACTION3:
8509 return "user_action_3_target_kind";
8510 case ACTION_USER_ACTION4:
8511 return "user_action_4_target_kind";
8516 fc_assert(act >= 0 && act < ACTION_COUNT);
8523enum action_target_kind
8530 case ACTRES_ESTABLISH_EMBASSY:
8531 case ACTRES_SPY_INVESTIGATE_CITY:
8532 case ACTRES_SPY_POISON:
8533 case ACTRES_SPY_STEAL_GOLD:
8534 case ACTRES_SPY_SABOTAGE_CITY:
8535 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8536 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8537 case ACTRES_SPY_STEAL_TECH:
8538 case ACTRES_SPY_TARGETED_STEAL_TECH:
8539 case ACTRES_SPY_INCITE_CITY:
8540 case ACTRES_TRADE_ROUTE:
8541 case ACTRES_MARKETPLACE:
8542 case ACTRES_HELP_WONDER:
8543 case ACTRES_JOIN_CITY:
8544 case ACTRES_STEAL_MAPS:
8545 case ACTRES_SPY_NUKE:
8546 case ACTRES_DESTROY_CITY:
8547 case ACTRES_DISBAND_UNIT_RECOVER:
8548 case ACTRES_HOME_CITY:
8549 case ACTRES_UPGRADE_UNIT:
8550 case ACTRES_AIRLIFT:
8551 case ACTRES_STRIKE_BUILDING:
8552 case ACTRES_STRIKE_PRODUCTION:
8553 case ACTRES_CONQUER_CITY:
8554 case ACTRES_SPY_SPREAD_PLAGUE:
8556 case ACTRES_SPY_BRIBE_UNIT:
8557 case ACTRES_SPY_SABOTAGE_UNIT:
8558 case ACTRES_EXPEL_UNIT:
8559 case ACTRES_HEAL_UNIT:
8560 case ACTRES_TRANSPORT_ALIGHT:
8561 case ACTRES_TRANSPORT_UNLOAD:
8562 case ACTRES_TRANSPORT_BOARD:
8563 case ACTRES_TRANSPORT_EMBARK:
8565 case ACTRES_BOMBARD:
8567 case ACTRES_CAPTURE_UNITS:
8568 case ACTRES_NUKE_UNITS:
8569 case ACTRES_SPY_ATTACK:
8571 case ACTRES_FOUND_CITY:
8573 case ACTRES_PARADROP:
8574 case ACTRES_PARADROP_CONQUER:
8575 case ACTRES_TRANSFORM_TERRAIN:
8576 case ACTRES_CULTIVATE:
8578 case ACTRES_PILLAGE:
8579 case ACTRES_CLEAN_POLLUTION:
8580 case ACTRES_CLEAN_FALLOUT:
8584 case ACTRES_IRRIGATE:
8585 case ACTRES_TRANSPORT_DISEMBARK:
8586 case ACTRES_HUT_ENTER:
8587 case ACTRES_HUT_FRIGHTEN:
8588 case ACTRES_UNIT_MOVE:
8590 case ACTRES_CONQUER_EXTRAS:
8592 case ACTRES_DISBAND_UNIT:
8593 case ACTRES_CONVERT:
8594 case ACTRES_FORTIFY:
8595 case ACTRES_HOMELESS:
8610 enum action_target_kind tgt_kind)
8618 case ACTRES_ESTABLISH_EMBASSY:
8619 case ACTRES_SPY_INVESTIGATE_CITY:
8620 case ACTRES_SPY_POISON:
8621 case ACTRES_SPY_STEAL_GOLD:
8622 case ACTRES_SPY_SABOTAGE_CITY:
8623 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8624 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8625 case ACTRES_SPY_STEAL_TECH:
8626 case ACTRES_SPY_TARGETED_STEAL_TECH:
8627 case ACTRES_SPY_INCITE_CITY:
8628 case ACTRES_TRADE_ROUTE:
8629 case ACTRES_MARKETPLACE:
8630 case ACTRES_HELP_WONDER:
8631 case ACTRES_JOIN_CITY:
8632 case ACTRES_STEAL_MAPS:
8633 case ACTRES_SPY_NUKE:
8634 case ACTRES_DESTROY_CITY:
8635 case ACTRES_DISBAND_UNIT_RECOVER:
8636 case ACTRES_HOME_CITY:
8637 case ACTRES_UPGRADE_UNIT:
8638 case ACTRES_AIRLIFT:
8639 case ACTRES_STRIKE_BUILDING:
8640 case ACTRES_STRIKE_PRODUCTION:
8641 case ACTRES_CONQUER_CITY:
8642 case ACTRES_SPY_SPREAD_PLAGUE:
8643 return tgt_kind == ATK_CITY;
8644 case ACTRES_SPY_BRIBE_UNIT:
8645 case ACTRES_SPY_SABOTAGE_UNIT:
8646 case ACTRES_EXPEL_UNIT:
8647 case ACTRES_HEAL_UNIT:
8648 case ACTRES_TRANSPORT_ALIGHT:
8649 case ACTRES_TRANSPORT_UNLOAD:
8650 case ACTRES_TRANSPORT_BOARD:
8651 case ACTRES_TRANSPORT_EMBARK:
8652 return tgt_kind == ATK_UNIT;
8653 case ACTRES_CAPTURE_UNITS:
8654 case ACTRES_BOMBARD:
8655 case ACTRES_NUKE_UNITS:
8657 case ACTRES_SPY_ATTACK:
8658 return tgt_kind == ATK_UNITS;
8659 case ACTRES_FOUND_CITY:
8660 case ACTRES_PARADROP:
8661 case ACTRES_PARADROP_CONQUER:
8662 case ACTRES_TRANSFORM_TERRAIN:
8663 case ACTRES_CULTIVATE:
8665 case ACTRES_CLEAN_POLLUTION:
8666 case ACTRES_CLEAN_FALLOUT:
8670 case ACTRES_IRRIGATE:
8671 case ACTRES_TRANSPORT_DISEMBARK:
8672 case ACTRES_HUT_ENTER:
8673 case ACTRES_HUT_FRIGHTEN:
8674 case ACTRES_UNIT_MOVE:
8675 return tgt_kind == ATK_TILE;
8676 case ACTRES_CONQUER_EXTRAS:
8677 return tgt_kind == ATK_EXTRAS;
8678 case ACTRES_DISBAND_UNIT:
8679 case ACTRES_CONVERT:
8680 case ACTRES_FORTIFY:
8681 case ACTRES_HOMELESS:
8682 return tgt_kind == ATK_SELF;
8683 case ACTRES_PILLAGE:
8684 return (tgt_kind == ATK_TILE || tgt_kind == ATK_EXTRAS);
8686 return (tgt_kind == ATK_TILE || tgt_kind == ATK_CITY);
8711static enum action_sub_target_kind
8718 case ACTRES_ESTABLISH_EMBASSY:
8719 case ACTRES_SPY_INVESTIGATE_CITY:
8720 case ACTRES_SPY_POISON:
8721 case ACTRES_SPY_STEAL_GOLD:
8722 case ACTRES_SPY_SABOTAGE_CITY:
8723 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8724 case ACTRES_SPY_STEAL_TECH:
8725 case ACTRES_SPY_INCITE_CITY:
8726 case ACTRES_TRADE_ROUTE:
8727 case ACTRES_MARKETPLACE:
8728 case ACTRES_HELP_WONDER:
8729 case ACTRES_JOIN_CITY:
8730 case ACTRES_STEAL_MAPS:
8731 case ACTRES_SPY_NUKE:
8732 case ACTRES_DESTROY_CITY:
8733 case ACTRES_DISBAND_UNIT_RECOVER:
8734 case ACTRES_HOME_CITY:
8735 case ACTRES_HOMELESS:
8736 case ACTRES_UPGRADE_UNIT:
8737 case ACTRES_AIRLIFT:
8738 case ACTRES_STRIKE_PRODUCTION:
8739 case ACTRES_CONQUER_CITY:
8740 case ACTRES_SPY_SPREAD_PLAGUE:
8742 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8743 case ACTRES_STRIKE_BUILDING:
8744 return ASTK_BUILDING;
8745 case ACTRES_SPY_TARGETED_STEAL_TECH:
8747 case ACTRES_SPY_BRIBE_UNIT:
8748 case ACTRES_SPY_SABOTAGE_UNIT:
8749 case ACTRES_EXPEL_UNIT:
8750 case ACTRES_HEAL_UNIT:
8751 case ACTRES_TRANSPORT_ALIGHT:
8752 case ACTRES_TRANSPORT_UNLOAD:
8753 case ACTRES_TRANSPORT_BOARD:
8754 case ACTRES_TRANSPORT_EMBARK:
8756 case ACTRES_CAPTURE_UNITS:
8757 case ACTRES_BOMBARD:
8758 case ACTRES_NUKE_UNITS:
8760 case ACTRES_SPY_ATTACK:
8762 case ACTRES_FOUND_CITY:
8764 case ACTRES_PARADROP:
8765 case ACTRES_PARADROP_CONQUER:
8766 case ACTRES_TRANSFORM_TERRAIN:
8767 case ACTRES_CULTIVATE:
8769 case ACTRES_TRANSPORT_DISEMBARK:
8770 case ACTRES_HUT_ENTER:
8771 case ACTRES_HUT_FRIGHTEN:
8772 case ACTRES_UNIT_MOVE:
8774 case ACTRES_PILLAGE:
8775 case ACTRES_CLEAN_POLLUTION:
8776 case ACTRES_CLEAN_FALLOUT:
8781 case ACTRES_IRRIGATE:
8782 return ASTK_EXTRA_NOT_THERE;
8783 case ACTRES_CONQUER_EXTRAS:
8785 case ACTRES_DISBAND_UNIT:
8786 case ACTRES_CONVERT:
8787 case ACTRES_FORTIFY:
8801static enum act_tgt_compl
8803 enum action_target_kind tgt_kind,
8804 enum action_sub_target_kind sub_tgt_kind)
8807 ACT_TGT_COMPL_SIMPLE);
8810 case ACTRES_ESTABLISH_EMBASSY:
8811 case ACTRES_SPY_INVESTIGATE_CITY:
8812 case ACTRES_SPY_POISON:
8813 case ACTRES_SPY_STEAL_GOLD:
8814 case ACTRES_SPY_SABOTAGE_CITY:
8815 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8816 case ACTRES_SPY_STEAL_TECH:
8817 case ACTRES_SPY_INCITE_CITY:
8818 case ACTRES_TRADE_ROUTE:
8819 case ACTRES_MARKETPLACE:
8820 case ACTRES_HELP_WONDER:
8821 case ACTRES_JOIN_CITY:
8822 case ACTRES_STEAL_MAPS:
8823 case ACTRES_SPY_NUKE:
8824 case ACTRES_DESTROY_CITY:
8825 case ACTRES_DISBAND_UNIT_RECOVER:
8826 case ACTRES_HOME_CITY:
8827 case ACTRES_HOMELESS:
8828 case ACTRES_UPGRADE_UNIT:
8829 case ACTRES_AIRLIFT:
8830 case ACTRES_STRIKE_PRODUCTION:
8831 case ACTRES_CONQUER_CITY:
8832 case ACTRES_SPY_SPREAD_PLAGUE:
8833 return ACT_TGT_COMPL_SIMPLE;
8834 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8835 case ACTRES_STRIKE_BUILDING:
8836 case ACTRES_SPY_TARGETED_STEAL_TECH:
8837 return ACT_TGT_COMPL_MANDATORY;
8838 case ACTRES_SPY_BRIBE_UNIT:
8839 case ACTRES_SPY_SABOTAGE_UNIT:
8840 case ACTRES_EXPEL_UNIT:
8841 case ACTRES_HEAL_UNIT:
8842 case ACTRES_TRANSPORT_ALIGHT:
8843 case ACTRES_TRANSPORT_UNLOAD:
8844 case ACTRES_TRANSPORT_BOARD:
8845 case ACTRES_TRANSPORT_EMBARK:
8846 return ACT_TGT_COMPL_SIMPLE;
8847 case ACTRES_CAPTURE_UNITS:
8848 case ACTRES_BOMBARD:
8849 case ACTRES_NUKE_UNITS:
8851 case ACTRES_SPY_ATTACK:
8852 return ACT_TGT_COMPL_SIMPLE;
8853 case ACTRES_FOUND_CITY:
8855 case ACTRES_PARADROP:
8856 case ACTRES_PARADROP_CONQUER:
8857 case ACTRES_TRANSFORM_TERRAIN:
8858 case ACTRES_CULTIVATE:
8860 case ACTRES_TRANSPORT_DISEMBARK:
8861 case ACTRES_HUT_ENTER:
8862 case ACTRES_HUT_FRIGHTEN:
8863 case ACTRES_UNIT_MOVE:
8864 return ACT_TGT_COMPL_SIMPLE;
8865 case ACTRES_PILLAGE:
8866 case ACTRES_CLEAN_POLLUTION:
8867 case ACTRES_CLEAN_FALLOUT:
8868 return ACT_TGT_COMPL_FLEXIBLE;
8872 case ACTRES_IRRIGATE:
8873 return ACT_TGT_COMPL_MANDATORY;
8874 case ACTRES_CONQUER_EXTRAS:
8875 return ACT_TGT_COMPL_SIMPLE;
8876 case ACTRES_DISBAND_UNIT:
8877 case ACTRES_CONVERT:
8878 case ACTRES_FORTIFY:
8879 return ACT_TGT_COMPL_SIMPLE;
8881 return ACT_TGT_COMPL_SIMPLE;
8885 return ACT_TGT_COMPL_SIMPLE;
8897 switch ((
enum gen_action)act) {
8898 case ACTION_SPY_POISON:
8899 case ACTION_SPY_POISON_ESC:
8900 case ACTION_SPY_SABOTAGE_UNIT:
8901 case ACTION_SPY_SABOTAGE_UNIT_ESC:
8902 case ACTION_SPY_BRIBE_UNIT:
8903 case ACTION_SPY_SABOTAGE_CITY:
8904 case ACTION_SPY_SABOTAGE_CITY_ESC:
8905 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
8906 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
8907 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
8908 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
8909 case ACTION_SPY_INCITE_CITY:
8910 case ACTION_SPY_INCITE_CITY_ESC:
8911 case ACTION_ESTABLISH_EMBASSY:
8912 case ACTION_ESTABLISH_EMBASSY_STAY:
8913 case ACTION_SPY_STEAL_TECH:
8914 case ACTION_SPY_STEAL_TECH_ESC:
8915 case ACTION_SPY_TARGETED_STEAL_TECH:
8916 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
8917 case ACTION_SPY_INVESTIGATE_CITY:
8918 case ACTION_INV_CITY_SPEND:
8919 case ACTION_SPY_STEAL_GOLD:
8920 case ACTION_SPY_STEAL_GOLD_ESC:
8921 case ACTION_STEAL_MAPS:
8922 case ACTION_STEAL_MAPS_ESC:
8923 case ACTION_TRADE_ROUTE:
8924 case ACTION_MARKETPLACE:
8925 case ACTION_HELP_WONDER:
8926 case ACTION_CAPTURE_UNITS:
8927 case ACTION_EXPEL_UNIT:
8928 case ACTION_JOIN_CITY:
8929 case ACTION_SPY_NUKE:
8930 case ACTION_SPY_NUKE_ESC:
8931 case ACTION_DESTROY_CITY:
8932 case ACTION_DISBAND_UNIT_RECOVER:
8933 case ACTION_DISBAND_UNIT:
8934 case ACTION_HOME_CITY:
8935 case ACTION_HOMELESS:
8936 case ACTION_UPGRADE_UNIT:
8937 case ACTION_PARADROP:
8938 case ACTION_PARADROP_CONQUER:
8939 case ACTION_PARADROP_FRIGHTEN:
8940 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8941 case ACTION_PARADROP_ENTER:
8942 case ACTION_PARADROP_ENTER_CONQUER:
8943 case ACTION_AIRLIFT:
8945 case ACTION_SUICIDE_ATTACK:
8946 case ACTION_STRIKE_BUILDING:
8947 case ACTION_STRIKE_PRODUCTION:
8948 case ACTION_CONQUER_CITY:
8949 case ACTION_CONQUER_CITY2:
8950 case ACTION_CONQUER_CITY3:
8951 case ACTION_CONQUER_CITY4:
8952 case ACTION_HEAL_UNIT:
8953 case ACTION_HEAL_UNIT2:
8954 case ACTION_TRANSFORM_TERRAIN:
8955 case ACTION_CULTIVATE:
8957 case ACTION_PILLAGE:
8958 case ACTION_CLEAN_POLLUTION:
8959 case ACTION_CLEAN_FALLOUT:
8960 case ACTION_FORTIFY:
8962 case ACTION_CONVERT:
8965 case ACTION_IRRIGATE:
8966 case ACTION_TRANSPORT_ALIGHT:
8967 case ACTION_TRANSPORT_BOARD:
8968 case ACTION_TRANSPORT_EMBARK:
8969 case ACTION_TRANSPORT_EMBARK2:
8970 case ACTION_TRANSPORT_EMBARK3:
8971 case ACTION_TRANSPORT_UNLOAD:
8972 case ACTION_TRANSPORT_DISEMBARK1:
8973 case ACTION_TRANSPORT_DISEMBARK2:
8974 case ACTION_TRANSPORT_DISEMBARK3:
8975 case ACTION_TRANSPORT_DISEMBARK4:
8976 case ACTION_BOMBARD:
8977 case ACTION_BOMBARD2:
8978 case ACTION_BOMBARD3:
8979 case ACTION_SPY_ATTACK:
8980 case ACTION_CONQUER_EXTRAS:
8981 case ACTION_CONQUER_EXTRAS2:
8982 case ACTION_CONQUER_EXTRAS3:
8983 case ACTION_CONQUER_EXTRAS4:
8984 case ACTION_HUT_ENTER:
8985 case ACTION_HUT_ENTER2:
8986 case ACTION_HUT_ENTER3:
8987 case ACTION_HUT_ENTER4:
8988 case ACTION_HUT_FRIGHTEN:
8989 case ACTION_HUT_FRIGHTEN2:
8990 case ACTION_HUT_FRIGHTEN3:
8991 case ACTION_HUT_FRIGHTEN4:
8992 case ACTION_UNIT_MOVE:
8993 case ACTION_UNIT_MOVE2:
8994 case ACTION_UNIT_MOVE3:
8997 case ACTION_FOUND_CITY:
8998 return "found_city_consuming_always";
9000 return "explode_nuclear_consuming_always";
9001 case ACTION_NUKE_CITY:
9002 return "nuke_city_consuming_always";
9003 case ACTION_NUKE_UNITS:
9004 return "nuke_units_consuming_always";
9005 case ACTION_SPY_SPREAD_PLAGUE:
9006 return "spread_plague_actor_consuming_always";
9007 case ACTION_USER_ACTION1:
9008 return "user_action_1_actor_consuming_always";
9009 case ACTION_USER_ACTION2:
9010 return "user_action_2_actor_consuming_always";
9011 case ACTION_USER_ACTION3:
9012 return "user_action_3_actor_consuming_always";
9013 case ACTION_USER_ACTION4:
9014 return "user_action_4_actor_consuming_always";
9019 fc_assert(act >= 0 && act < ACTION_COUNT);
9035 case ACTION_MARKETPLACE:
9036 return "enter_marketplace_blocked_by";
9037 case ACTION_BOMBARD:
9038 return "bombard_blocked_by";
9039 case ACTION_BOMBARD2:
9040 return "bombard_2_blocked_by";
9041 case ACTION_BOMBARD3:
9042 return "bombard_3_blocked_by";
9044 return "explode_nuclear_blocked_by";
9045 case ACTION_NUKE_CITY:
9046 return "nuke_city_blocked_by";
9047 case ACTION_NUKE_UNITS:
9048 return "nuke_units_blocked_by";
9050 return "attack_blocked_by";
9051 case ACTION_SUICIDE_ATTACK:
9052 return "suicide_attack_blocked_by";
9053 case ACTION_CONQUER_CITY:
9054 return "conquer_city_blocked_by";
9055 case ACTION_CONQUER_CITY2:
9056 return "conquer_city_2_blocked_by";
9057 case ACTION_CONQUER_CITY3:
9058 return "conquer_city_3_blocked_by";
9059 case ACTION_CONQUER_CITY4:
9060 return "conquer_city_4_blocked_by";
9061 case ACTION_UNIT_MOVE:
9062 return "move_blocked_by";
9063 case ACTION_UNIT_MOVE2:
9064 return "move_2_blocked_by";
9065 case ACTION_UNIT_MOVE3:
9066 return "move_3_blocked_by";
9067 case ACTION_SPY_POISON:
9068 case ACTION_SPY_POISON_ESC:
9069 case ACTION_SPY_SABOTAGE_UNIT:
9070 case ACTION_SPY_SABOTAGE_UNIT_ESC:
9071 case ACTION_SPY_BRIBE_UNIT:
9072 case ACTION_SPY_SABOTAGE_CITY:
9073 case ACTION_SPY_SABOTAGE_CITY_ESC:
9074 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
9075 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
9076 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
9077 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
9078 case ACTION_SPY_INCITE_CITY:
9079 case ACTION_SPY_INCITE_CITY_ESC:
9080 case ACTION_ESTABLISH_EMBASSY:
9081 case ACTION_ESTABLISH_EMBASSY_STAY:
9082 case ACTION_SPY_STEAL_TECH:
9083 case ACTION_SPY_STEAL_TECH_ESC:
9084 case ACTION_SPY_TARGETED_STEAL_TECH:
9085 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
9086 case ACTION_SPY_INVESTIGATE_CITY:
9087 case ACTION_INV_CITY_SPEND:
9088 case ACTION_SPY_STEAL_GOLD:
9089 case ACTION_SPY_STEAL_GOLD_ESC:
9090 case ACTION_STEAL_MAPS:
9091 case ACTION_STEAL_MAPS_ESC:
9092 case ACTION_TRADE_ROUTE:
9093 case ACTION_HELP_WONDER:
9094 case ACTION_CAPTURE_UNITS:
9095 case ACTION_EXPEL_UNIT:
9096 case ACTION_FOUND_CITY:
9097 case ACTION_JOIN_CITY:
9098 case ACTION_SPY_NUKE:
9099 case ACTION_SPY_NUKE_ESC:
9100 case ACTION_DESTROY_CITY:
9101 case ACTION_DISBAND_UNIT_RECOVER:
9102 case ACTION_DISBAND_UNIT:
9103 case ACTION_HOME_CITY:
9104 case ACTION_HOMELESS:
9105 case ACTION_UPGRADE_UNIT:
9106 case ACTION_PARADROP:
9107 case ACTION_PARADROP_CONQUER:
9108 case ACTION_PARADROP_FRIGHTEN:
9109 case ACTION_PARADROP_FRIGHTEN_CONQUER:
9110 case ACTION_PARADROP_ENTER:
9111 case ACTION_PARADROP_ENTER_CONQUER:
9112 case ACTION_AIRLIFT:
9113 case ACTION_STRIKE_BUILDING:
9114 case ACTION_STRIKE_PRODUCTION:
9115 case ACTION_HEAL_UNIT:
9116 case ACTION_HEAL_UNIT2:
9117 case ACTION_TRANSFORM_TERRAIN:
9118 case ACTION_CULTIVATE:
9120 case ACTION_PILLAGE:
9121 case ACTION_CLEAN_POLLUTION:
9122 case ACTION_CLEAN_FALLOUT:
9123 case ACTION_FORTIFY:
9125 case ACTION_CONVERT:
9128 case ACTION_IRRIGATE:
9129 case ACTION_TRANSPORT_ALIGHT:
9130 case ACTION_TRANSPORT_BOARD:
9131 case ACTION_TRANSPORT_EMBARK:
9132 case ACTION_TRANSPORT_EMBARK2:
9133 case ACTION_TRANSPORT_EMBARK3:
9134 case ACTION_TRANSPORT_UNLOAD:
9135 case ACTION_TRANSPORT_DISEMBARK1:
9136 case ACTION_TRANSPORT_DISEMBARK2:
9137 case ACTION_TRANSPORT_DISEMBARK3:
9138 case ACTION_TRANSPORT_DISEMBARK4:
9139 case ACTION_SPY_SPREAD_PLAGUE:
9140 case ACTION_SPY_ATTACK:
9141 case ACTION_CONQUER_EXTRAS:
9142 case ACTION_CONQUER_EXTRAS2:
9143 case ACTION_CONQUER_EXTRAS3:
9144 case ACTION_CONQUER_EXTRAS4:
9145 case ACTION_HUT_ENTER:
9146 case ACTION_HUT_ENTER2:
9147 case ACTION_HUT_ENTER3:
9148 case ACTION_HUT_ENTER4:
9149 case ACTION_HUT_FRIGHTEN:
9150 case ACTION_HUT_FRIGHTEN2:
9151 case ACTION_HUT_FRIGHTEN3:
9152 case ACTION_HUT_FRIGHTEN4:
9153 case ACTION_USER_ACTION1:
9154 case ACTION_USER_ACTION2:
9155 case ACTION_USER_ACTION3:
9156 case ACTION_USER_ACTION4:
9183 case ACTION_SPY_BRIBE_UNIT:
9184 return "bribe_unit_post_success_forced_actions";
9186 return "attack_post_success_forced_actions";
9187 case ACTION_MARKETPLACE:
9188 case ACTION_BOMBARD:
9189 case ACTION_BOMBARD2:
9190 case ACTION_BOMBARD3:
9192 case ACTION_NUKE_CITY:
9193 case ACTION_NUKE_UNITS:
9194 case ACTION_SUICIDE_ATTACK:
9195 case ACTION_CONQUER_CITY:
9196 case ACTION_CONQUER_CITY2:
9197 case ACTION_CONQUER_CITY3:
9198 case ACTION_CONQUER_CITY4:
9199 case ACTION_SPY_POISON:
9200 case ACTION_SPY_POISON_ESC:
9201 case ACTION_SPY_SABOTAGE_UNIT:
9202 case ACTION_SPY_SABOTAGE_UNIT_ESC:
9203 case ACTION_SPY_SABOTAGE_CITY:
9204 case ACTION_SPY_SABOTAGE_CITY_ESC:
9205 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
9206 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
9207 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
9208 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
9209 case ACTION_SPY_INCITE_CITY:
9210 case ACTION_SPY_INCITE_CITY_ESC:
9211 case ACTION_ESTABLISH_EMBASSY:
9212 case ACTION_ESTABLISH_EMBASSY_STAY:
9213 case ACTION_SPY_STEAL_TECH:
9214 case ACTION_SPY_STEAL_TECH_ESC:
9215 case ACTION_SPY_TARGETED_STEAL_TECH:
9216 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
9217 case ACTION_SPY_INVESTIGATE_CITY:
9218 case ACTION_INV_CITY_SPEND:
9219 case ACTION_SPY_STEAL_GOLD:
9220 case ACTION_SPY_STEAL_GOLD_ESC:
9221 case ACTION_STEAL_MAPS:
9222 case ACTION_STEAL_MAPS_ESC:
9223 case ACTION_TRADE_ROUTE:
9224 case ACTION_HELP_WONDER:
9225 case ACTION_CAPTURE_UNITS:
9226 case ACTION_EXPEL_UNIT:
9227 case ACTION_FOUND_CITY:
9228 case ACTION_JOIN_CITY:
9229 case ACTION_SPY_NUKE:
9230 case ACTION_SPY_NUKE_ESC:
9231 case ACTION_DESTROY_CITY:
9232 case ACTION_DISBAND_UNIT_RECOVER:
9233 case ACTION_DISBAND_UNIT:
9234 case ACTION_HOME_CITY:
9235 case ACTION_HOMELESS:
9236 case ACTION_UPGRADE_UNIT:
9237 case ACTION_PARADROP:
9238 case ACTION_PARADROP_CONQUER:
9239 case ACTION_PARADROP_FRIGHTEN:
9240 case ACTION_PARADROP_FRIGHTEN_CONQUER:
9241 case ACTION_PARADROP_ENTER:
9242 case ACTION_PARADROP_ENTER_CONQUER:
9243 case ACTION_AIRLIFT:
9244 case ACTION_STRIKE_BUILDING:
9245 case ACTION_STRIKE_PRODUCTION:
9246 case ACTION_HEAL_UNIT:
9247 case ACTION_HEAL_UNIT2:
9248 case ACTION_TRANSFORM_TERRAIN:
9249 case ACTION_CULTIVATE:
9251 case ACTION_PILLAGE:
9252 case ACTION_CLEAN_POLLUTION:
9253 case ACTION_CLEAN_FALLOUT:
9254 case ACTION_FORTIFY:
9256 case ACTION_CONVERT:
9259 case ACTION_IRRIGATE:
9260 case ACTION_TRANSPORT_ALIGHT:
9261 case ACTION_TRANSPORT_BOARD:
9262 case ACTION_TRANSPORT_EMBARK:
9263 case ACTION_TRANSPORT_EMBARK2:
9264 case ACTION_TRANSPORT_EMBARK3:
9265 case ACTION_TRANSPORT_UNLOAD:
9266 case ACTION_TRANSPORT_DISEMBARK1:
9267 case ACTION_TRANSPORT_DISEMBARK2:
9268 case ACTION_TRANSPORT_DISEMBARK3:
9269 case ACTION_TRANSPORT_DISEMBARK4:
9270 case ACTION_SPY_SPREAD_PLAGUE:
9271 case ACTION_SPY_ATTACK:
9272 case ACTION_CONQUER_EXTRAS:
9273 case ACTION_CONQUER_EXTRAS2:
9274 case ACTION_CONQUER_EXTRAS3:
9275 case ACTION_CONQUER_EXTRAS4:
9276 case ACTION_HUT_ENTER:
9277 case ACTION_HUT_ENTER2:
9278 case ACTION_HUT_ENTER3:
9279 case ACTION_HUT_ENTER4:
9280 case ACTION_HUT_FRIGHTEN:
9281 case ACTION_HUT_FRIGHTEN2:
9282 case ACTION_HUT_FRIGHTEN3:
9283 case ACTION_HUT_FRIGHTEN4:
9284 case ACTION_UNIT_MOVE:
9285 case ACTION_UNIT_MOVE2:
9286 case ACTION_UNIT_MOVE3:
9287 case ACTION_USER_ACTION1:
9288 case ACTION_USER_ACTION2:
9289 case ACTION_USER_ACTION3:
9290 case ACTION_USER_ACTION4:
9316 if (!strcasecmp(
"Recycle Unit", old_name)) {
9317 return "Disband Unit Recover";
9326 N_(
"individual cities"),
9327 N_(
"individual units"),
9340 fc_assert(kind >= 0 && kind < ATK_COUNT);
bool action_removes_extra(const struct action *paction, const struct extra_type *pextra)
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
static struct action * actions[MAX_NUM_ACTIONS]
const char * action_prepare_ui_name(action_id act_id, const char *mnemonic, const struct act_prob prob, const char *custom)
const char * action_name_translation(const struct action *action)
bool action_distance_inside_max(const struct action *action, const int distance)
static void oblig_hard_req_reg(struct ae_contra_or *contras, const char *error_message,...)
struct act_prob action_speculate_unit_on_extras(const struct civ_map *nmap, 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)
static enum fc_tristate is_action_possible(const struct civ_map *nmap, const action_id wanted_action, const struct req_context *actor, const struct req_context *target, const struct extra_type *target_extra, const bool omniscient, const struct city *homecity)
static void voblig_hard_req_reg(struct ae_contra_or *contras, const char *error_message, va_list args)
const char * action_prob_explain(const struct act_prob prob)
bool action_mp_full_makes_legal(const struct unit *actor, const action_id act_id)
static struct act_prob action_prob_battle_then_dice_roll(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct player *tgt_player, const struct action *paction)
static bool is_action_enabled_unit_on_self_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile)
enum action_actor_kind action_get_actor_kind(const struct action *paction)
bool action_prob_certain(const struct act_prob probability)
const char * action_id_name_translation(action_id act_id)
struct action_auto_perf * action_auto_perf_slot_number(const int num)
req_vec_num_in_item action_enabler_vector_number(const void *enabler, const struct requirement_vector *vec)
bool action_has_complex_target(const struct action *paction)
static bool action_actor_utype_hard_reqs_ok_full(const struct action *paction, const struct unit_type *actor_unittype, bool ignore_third_party)
static struct obligatory_req_vector oblig_hard_reqs_r[ACTRES_NONE]
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
static bool is_action_enabled_unit_on_tile_full(const struct civ_map *nmap, 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)
bool action_prob_possible(const struct act_prob probability)
#define ACTPROB_VAL_NOT_IMPL
struct action_auto_perf auto_perfs[MAX_NUM_ACTION_AUTO_PERFORMERS]
bool action_actor_utype_hard_reqs_ok(const struct action *paction, const struct unit_type *actor_unittype)
struct act_prob action_prob_new_not_impl(void)
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
static enum fc_tristate action_enabled_local(const action_id wanted_action, const struct req_context *actor, const struct req_context *target)
void actions_rs_pre_san_gen(void)
const char * action_min_range_ruleset_var_name(int act)
struct act_prob action_speculate_unit_on_self(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat)
void action_list_end(action_id *act_list, int size)
const char * action_blocked_by_ruleset_var_name(const struct action *act)
static bool is_action_enabled(const struct civ_map *nmap, const action_id wanted_action, const struct req_context *actor, const struct req_context *target, const struct extra_type *target_extra, const struct city *actor_home)
static struct act_prob action_prob(const struct civ_map *nmap, const action_id wanted_action, const struct req_context *actor, const struct city *actor_home, const struct req_context *target, const struct extra_type *target_extra)
struct req_vec_problem * action_enabler_suggest_repair_oblig(const struct action_enabler *enabler)
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)
static struct ae_contra_or * req_contradiction_or(int alternatives,...)
struct act_prob action_prob_vs_tile(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
static struct act_prob action_prob_pre_action_dice_roll(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct player *tgt_player, const struct action *paction)
const char * atk_helpnames[ATK_COUNT]
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)
static enum fc_tristate action_hard_reqs_actor(const struct civ_map *nmap, const struct action *paction, const struct req_context *actor, const bool omniscient, const struct city *homecity)
static void hard_code_actions(void)
static bool is_action_enabled_unit_on_city_full(const struct civ_map *nmap, 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)
bool action_is_in_use(struct action *paction)
static struct req_vec_problem * enabler_tile_tgt_local_diplrel_implies_claimed(const struct action_enabler *enabler)
bool action_ever_possible(action_id action)
bool action_result_legal_target_kind(enum action_result result, enum action_target_kind tgt_kind)
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
bool are_action_probabilitys_equal(const struct act_prob *ap1, const struct act_prob *ap2)
static struct act_prob action_prob_self_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id)
const char * action_post_success_forced_ruleset_var_name(const struct action *act)
struct action * action_by_rule_name(const char *name)
static bool action_has_possible_actor_hard_reqs(struct action *paction)
const char * action_rule_name(const struct action *action)
const char * action_id_rule_name(action_id act_id)
enum action_battle_kind action_get_battle_kind(const struct action *pact)
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
static const struct tile * blocked_find_target_tile(const struct action *act, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city, const struct unit *target_unit)
static bool action_prob_not_relevant(const struct act_prob probability)
static bool is_action_enabled_unit_on_extras_full(const struct civ_map *nmap, 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)
void action_enabler_free(struct action_enabler *enabler)
static void ae_contra_close(struct ae_contra_or *contra)
struct act_prob action_speculate_unit_on_units(const struct civ_map *nmap, 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)
static enum fc_tristate tech_can_be_stolen(const struct player *actor_player, const struct player *target_player)
static struct action_list * actlist_by_result[ACTRES_LAST]
static struct obligatory_req_vector oblig_hard_reqs_sr[ACT_SUB_RES_COUNT]
static void oblig_hard_req_reg_sub_res(struct ae_contra_or *contras, const char *error_message,...)
struct action_list * action_list_by_activity(enum unit_activity activity)
int action_number(const struct action *action)
struct act_prob action_prob_new_unknown(void)
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
static struct req_vec_problem * enabler_first_clarification(const struct action_enabler *enabler)
static bool is_action_enabled_unit_on_units_full(const struct civ_map *nmap, 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)
static bool is_effect_val_known(enum effect_type effect_type, const struct player *pov_player, const struct req_context *context, const struct player *other_player)
static bool action_prob_not_impl(const struct act_prob probability)
bool is_action_enabled_unit_on_tile(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
struct act_prob action_prob_and(const struct act_prob *ap1, const struct act_prob *ap2)
static bool actions_initialized
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
bool action_immune_government(struct government *gov, action_id act)
static void voblig_hard_req_reg_sub_res(struct ae_contra_or *contras, const char *error_message, va_list args)
static bool is_target_possible(const action_id wanted_action, const struct player *actor_player, const struct req_context *target)
bool is_action_enabled_unit_on_units(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile)
static struct act_prob ap_dipl_battle_win(const struct unit *pattacker, const struct unit *pdefender)
struct act_prob action_prob_vs_extras(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
enum unit_activity actres_get_activity(enum action_result result)
struct act_prob action_prob_new_certain(void)
const char * action_max_range_ruleset_var_name(int act)
static struct act_prob action_prob_vs_city_full(const struct civ_map *nmap, 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)
int action_dice_roll_initial_odds(const struct action *paction)
struct act_prob action_prob_self(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id)
struct act_prob action_prob_fall_back(const struct act_prob *ap1, const struct act_prob *ap2)
#define obligatory_req_vector_iterate_end
static const struct unit_type * tgt_city_local_utype(const struct city *target_city)
static struct requirement * req_vec_first_local_diplrel(const struct requirement_vector *vec)
enum action_target_kind action_target_kind_default(enum action_result result)
static struct act_prob action_prob_vs_tile_full(const struct civ_map *nmap, 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)
static bool plr_sees_tile(const struct player *plr, const struct tile *ttile)
bool is_action_enabled_unit_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
struct act_prob action_prob_vs_units(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile)
struct action_list * action_list_by_result(enum action_result result)
void action_list_add_all_by_result(action_id *act_list, int *position, enum action_result result)
bool action_univs_not_blocking(const struct action *paction, struct universal *actor_uni, struct universal *target_uni)
struct act_prob action_speculate_unit_on_city(const struct civ_map *nmap, 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)
static struct requirement * req_vec_first_contradiction_in_vec(const struct requirement *req, const struct requirement_vector *vec)
bool actions_are_ready(void)
bool is_action_enabled_unit_on_unit(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct unit *target_unit)
static enum act_tgt_compl action_target_compl_calc(enum action_result result, enum action_target_kind tgt_kind, enum action_sub_target_kind sub_tgt_kind)
int action_min_range_default(enum action_result result)
struct act_prob action_speculate_unit_on_tile(const struct civ_map *nmap, 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)
struct act_prob action_prob_vs_city(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct city *target_city)
const char * action_target_kind_ruleset_var_name(int act)
#define obligatory_req_vector_iterate(obreq_vec, pobreq)
static struct act_prob action_prob_vs_unit_full(const struct civ_map *nmap, 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)
bool action_maybe_possible_actor_unit(const struct civ_map *nmap, const action_id act_id, const struct unit *actor_unit)
struct action * action_is_blocked_by(const struct civ_map *nmap, const struct action *act, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city_arg, const struct unit *target_unit)
static bool is_enabler_active(const struct action_enabler *enabler, const struct req_context *actor, const struct req_context *target)
static struct action_enabler_list * action_enablers_by_action[MAX_NUM_ACTIONS]
void action_enabler_add(struct action_enabler *enabler)
static struct act_prob action_prob_vs_units_full(const struct civ_map *nmap, 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)
static void hard_code_oblig_hard_reqs(void)
const char * action_ui_name_default(int act)
#define ACTPROB_VAL_1_PCT
bool action_enabler_utype_possible_actor(const struct action_enabler *ae, const struct unit_type *act_utype)
static struct act_prob act_prob_unseen_target(const struct civ_map *nmap, action_id act_id, const struct unit *actor_unit)
struct action_enabler * action_enabler_new(void)
bool action_requires_details(const struct action *paction)
struct act_prob action_prob_new_not_relevant(void)
const char * action_target_kind_help(enum action_target_kind kind)
static struct req_vec_problem * enabler_first_self_contradiction(const struct action_enabler *enabler)
int action_get_role(const struct action *paction)
struct act_prob action_speculate_unit_on_unit(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct unit *target)
static struct action * unit_action_new(action_id id, enum action_result result, 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)
const struct action_auto_perf * action_auto_perf_by_number(const int num)
struct act_prob action_prob_new_impossible(void)
bool action_enabler_possible_actor(const struct action_enabler *ae)
static const struct city * blocked_find_target_city(const struct action *act, const struct unit *actor_unit, const struct tile *target_tile, const struct city *target_city_arg, const struct unit *target_unit)
struct action ** _actions
bool action_id_exists(const action_id act_id)
bool action_enabler_remove(struct action_enabler *enabler)
enum action_target_kind action_get_target_kind(const struct action *paction)
struct act_prob action_prob_unit_vs_tgt(const struct civ_map *nmap, 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)
static enum action_sub_target_kind action_sub_target_kind_default(enum action_result result)
static bool action_prob_is_signal(const struct act_prob probability)
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
static bool plr_knows_tile(const struct player *plr, const struct tile *ttile)
bool action_creates_extra(const struct action *paction, const struct extra_type *pextra)
static const char * action_prob_to_text(const struct act_prob prob)
int action_prob_cmp_pessimist(const struct act_prob ap1, const struct act_prob ap2)
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
bool action_id_is_rare_pop_up(action_id act_id)
static struct action * action_new(action_id id, enum action_result result, const int min_distance, const int max_distance, bool actor_consuming_always)
static void hard_code_oblig_hard_reqs_ruleset(void)
static struct req_vec_problem * ae_suggest_repair_if_no_oblig(const struct action_enabler *enabler, const struct obligatory_req_vector *oblig)
struct act_prob action_prob_vs_unit(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct unit *target_unit)
static const struct impr_type * tgt_city_local_building(const struct city *target_city)
static struct astring ui_name_str
bool is_action_enabled_unit_on_extras(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
static bool is_action_enabled_unit_on_unit_full(const struct civ_map *nmap, 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)
double action_prob_to_0_to_1_pessimist(const struct act_prob ap)
static void oblig_hard_req_register(struct requirement contradiction, bool is_target, const char *error_message,...)
const char * gen_action_name_update_cb(const char *old_name)
static struct action_list * actlist_by_activity[ACTIVITY_LAST]
static struct act_prob ap_diplomat_battle(const struct unit *pattacker, const struct unit *pvictim, const struct tile *tgt_tile) fc__attribute((nonnull(3)))
struct action_enabler_list * action_enablers_for_action(action_id action)
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item number)
bool action_distance_accepted(const struct action *action, const int distance)
static struct act_prob action_prob_vs_extras_full(const struct civ_map *nmap, 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)
const char * action_ui_name_ruleset_var_name(int act)
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
int action_max_range_default(enum action_result result)
#define ACTION_DISTANCE_MAX
static struct action * action_by_number(action_id act_id)
#define action_enabler_list_re_iterate_end
#define ACTION_DISTANCE_LAST_NON_SIGNAL
#define action_enabler_list_re_iterate(action_enabler_list, aenabler)
#define action_has_result(_act_, _res_)
#define action_enabler_list_iterate_end
#define ACTION_DISTANCE_UNLIMITED
#define action_iterate_end
#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
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_clear(struct astring *astr)
void astr_add(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
bool can_build_base(const struct unit *punit, const struct base_type *pbase, const struct tile *ptile)
bool territory_claiming_base(const struct base_type *pbase)
#define BV_ISSET(bv, bit)
#define BV_ISSET_ANY(vec)
int city_production_build_shield_cost(const struct city *pcity)
int city_unit_slots_available(const struct city *pcity)
bool citymindist_prevents_city_on_tile(const struct civ_map *nmap, const struct tile *ptile)
bool city_can_grow_to(const struct city *pcity, int pop_size)
static bool is_non_allied_city_tile(const struct tile *ptile, const struct player *pplayer)
static bool is_non_attack_city_tile(const struct tile *ptile, const struct player *pplayer)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
bool is_unit_reachable_at(const struct unit *defender, const struct unit *attacker, const struct tile *location)
enum unit_attack_result unit_attack_units_at_tile_result(const struct unit *punit, const struct action *paction, const struct tile *ptile)
struct unit * get_diplomatic_defender(const struct unit *act_unit, const struct unit *pvictim, const struct tile *tgt_tile)
double unit_win_chance(const struct civ_map *nmap, const struct unit *attacker, const struct unit *defender)
bool can_unit_attack_tile(const struct unit *punit, const struct action *paction, const struct tile *dest_tile)
struct unit * get_defender(const struct civ_map *nmap, const struct unit *attacker, const struct tile *ptile)
struct unit struct city struct unit * target_unit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
struct unit struct city struct unit struct tile * target_tile
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city * target_city
struct unit struct city struct unit struct tile struct extra_type * target_extra
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
struct effect_list * get_effects(enum effect_type effect_type)
#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
static bool is_ruleset_compat_mode(void)
#define RS_DEFAULT_EXPLODE_NUCLEAR_MAX_RANGE
#define RS_DEFAULT_ACTION_MIN_RANGE
#define RS_DEFAULT_USER_ACTION_TARGET_KIND
#define RS_DEFAULT_ACTION_MAX_RANGE
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#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 log_error(message,...)
#define FC_STATIC_ASSERT(cond, tag)
#define fc_assert_ret_val_msg(condition, val, message,...)
bv_extras get_tile_infrastructure_set(const struct tile *ptile, int *pcount)
bool terrain_surroundings_allow_change(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
#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)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
int unit_move_rate(const struct unit *punit)
bool unit_could_load_at(const struct unit *punit, const struct tile *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_transport, bool enter_enemy_city)
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
bool can_attack_non_native(const struct unit_type *utype)
Nation_type_id nation_number(const struct nation_type *pnation)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
struct player_slot * slots
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
bool player_can_trust_tile_has_no_units(const struct player *pplayer, const struct tile *ptile)
bool universal_never_there(const struct universal *source)
const struct req_context * req_context_empty(void)
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
struct req_vec_problem * req_vec_suggest_repair(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
struct requirement req_from_values(int type, int range, bool survives, bool present, bool quiet, int value)
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *descr,...)
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs)
struct req_vec_problem * req_vec_suggest_improvement(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
#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)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
bool can_build_road(const struct civ_map *nmap, struct road_type *proad, const struct unit *punit, const struct tile *ptile)
server_setting_id server_setting_by_name(const char *name)
int server_setting_value_int_get(server_setting_id id)
enum fc_tristate fc_tristate_and(enum fc_tristate one, enum fc_tristate two)
#define CLIP(lower, current, upper)
enum action_auto_perf_cause cause
action_id alternatives[MAX_NUM_ACTIONS]
struct requirement_vector actor_reqs
struct requirement_vector target_reqs
bool unitwaittime_controlled
bool actor_consuming_always
enum action_sub_target_kind sub_target_kind
enum moves_actor_kind moves_actor
struct action::@12::@13 is_unit
enum action_result result
char ui_name[MAX_LEN_NAME]
bv_action_sub_results sub_results
enum action_actor_kind actor_kind
enum act_tgt_compl target_complexity
enum action_target_kind target_kind
struct action_enabler_contradiction * alternative
struct packet_game_info info
struct packet_scenario_info scenario
int(* player_tile_city_id_get)(const struct tile *ptile, const struct player *pplayer)
bool(* player_tile_vision_get)(const struct tile *ptile, const struct player *pplayer, enum vision_layer vision)
struct ae_contra_or * contras
bool tech_steal_allow_holes
enum airlifting_style airlifting_style
bool airlift_from_always_enabled
bv_actions diplchance_initial_odds
struct player_economic economic
const struct player * player
const struct unit_type * unittype
req_vec_num_in_item vector_number
enum req_vec_change_operation operation
struct req_vec_change * suggested_solutions
struct terrain * cultivate_result
struct terrain * plant_result
struct terrain * transform_result
struct unit_class::@85 cache
struct extra_type_list * native_bases
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)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_iterate(_start, _p)
#define advance_iterate_end
struct extra_type * get_preferred_pillage(bv_extras extras)
#define terrain_has_flag(terr, flag)
bool tile_has_claimable_base(const struct tile *ptile, const struct unit_type *punittype)
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
int tile_activity_time(enum unit_activity activity, const struct tile *ptile, const struct extra_type *tgt)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
#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)
bool can_establish_trade_route(const struct city *pc1, const struct city *pc2)
enum citytile_type citytile
struct unit * unit_transport_get(const struct unit *pcargo)
bool unit_contained_in(const struct unit *pcargo, const struct unit *ptrans)
enum unit_airlift_result test_unit_can_airlift_to(const struct civ_map *nmap, const struct player *restriction, const struct unit *punit, const struct city *pdest_city)
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
bv_extras get_unit_tile_pillage_set(const struct tile *ptile)
int get_transporter_capacity(const struct unit *punit)
enum unit_upgrade_result unit_upgrade_test(const struct civ_map *nmap, const struct unit *punit, bool is_free)
bool unit_transported(const struct unit *pcargo)
bool can_unit_unload(const struct unit *pcargo, const struct unit *ptrans)
bool unit_can_convert(const struct civ_map *nmap, const struct unit *punit)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
bool utype_may_act_move_frags(const struct unit_type *punit_type, const action_id act_id, const int move_fragments)
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
int unit_pop_value(const struct unit *punit)
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)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
#define unit_type_iterate(_p)
#define unit_type_iterate_end