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;
3216 const struct tile *target_tile_arg,
3217 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);
6161 const struct city *actor_home,
6162 const struct tile *actor_tile,
6174 "Action %s is performed by %s not %s",
6176 action_actor_kind_name(
6178 action_actor_kind_name(AAK_UNIT));
6182 "Action %s is against %s not %s",
6184 action_target_kind_name(
6186 action_target_kind_name(ATK_TILE));
6245 const struct city *actor_home,
6246 const struct tile *actor_tile,
6258 "Action %s is performed by %s not %s",
6260 action_actor_kind_name(
6262 action_actor_kind_name(AAK_UNIT));
6266 "Action %s is against %s not %s",
6268 action_target_kind_name(
6270 action_target_kind_name(ATK_EXTRAS));
6329 const struct city *actor_home,
6330 const struct tile *actor_tile,
6342 "Action %s is performed by %s not %s",
6344 action_actor_kind_name(
6346 action_actor_kind_name(AAK_UNIT));
6350 "Action %s is against %s not %s",
6352 action_target_kind_name(
6354 action_target_kind_name(ATK_SELF));
6403 const struct unit *act_unit,
6404 const struct city *tgt_city,
6405 const struct unit *tgt_unit,
6406 const struct tile *tgt_tile,
6430 tgt_tile, extra_tgt);
6447 log_error(
"Invalid action target kind");
6461 const struct city *actor_home,
6462 const struct tile *actor_tile,
6463 const bool omniscient_cheat,
6464 const struct city* target)
6472 if (omniscient_cheat) {
6474 actor, actor_home, actor_tile,
6496 const struct city *actor_home,
6497 const struct tile *actor_tile,
6498 bool omniscient_cheat,
6499 const struct unit *target)
6507 if (omniscient_cheat) {
6509 actor, actor_home, actor_tile,
6529 const struct city *actor_home,
6530 const struct tile *actor_tile,
6531 bool omniscient_cheat,
6532 const struct tile *target)
6540 if (omniscient_cheat) {
6542 actor, actor_home, actor_tile,
6562 const struct city *actor_home,
6563 const struct tile *actor_tile,
6564 bool omniscient_cheat,
6574 if (omniscient_cheat) {
6576 actor, actor_home, actor_tile,
6596 const struct city *actor_home,
6597 const struct tile *actor_tile,
6598 bool omniscient_cheat,
6608 if (omniscient_cheat) {
6610 actor, actor_home, actor_tile,
6630 const struct city *actor_home,
6631 const struct tile *actor_tile,
6632 bool omniscient_cheat)
6640 if (omniscient_cheat) {
6642 actor, actor_home, actor_tile)) {
6752 return probability.
max < probability.
min;
6801 if (my_ap1.
min < my_ap2.
min) {
6803 }
else if (my_ap1.
min > my_ap2.
min) {
6805 }
else if (my_ap1.
max < my_ap2.
max) {
6807 }
else if (my_ap1.
max > my_ap2.
max) {
6889 my_ap2.
min = ap2->min;
6890 my_ap2.
max = ap2->max;
6959 my_ap2.
min = ap2->min;
6960 my_ap2.
max = ap2->max;
6985 switch (paction->
result) {
6986 case ACTRES_STRIKE_BUILDING:
6987 case ACTRES_STRIKE_PRODUCTION:
6988 case ACTRES_SPY_SPREAD_PLAGUE:
6989 case ACTRES_SPY_STEAL_TECH:
6990 case ACTRES_SPY_TARGETED_STEAL_TECH:
6991 case ACTRES_SPY_INCITE_CITY:
6992 case ACTRES_SPY_SABOTAGE_CITY:
6993 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
6994 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
6995 case ACTRES_SPY_STEAL_GOLD:
6996 case ACTRES_STEAL_MAPS:
6997 case ACTRES_SPY_NUKE:
6998 case ACTRES_SPY_POISON:
7007 case ACTRES_ESTABLISH_EMBASSY:
7008 case ACTRES_SPY_INVESTIGATE_CITY:
7009 case ACTRES_TRADE_ROUTE:
7010 case ACTRES_MARKETPLACE:
7011 case ACTRES_HELP_WONDER:
7012 case ACTRES_SPY_BRIBE_UNIT:
7013 case ACTRES_SPY_SABOTAGE_UNIT:
7014 case ACTRES_CAPTURE_UNITS:
7015 case ACTRES_FOUND_CITY:
7016 case ACTRES_JOIN_CITY:
7017 case ACTRES_BOMBARD:
7019 case ACTRES_NUKE_UNITS:
7020 case ACTRES_DESTROY_CITY:
7021 case ACTRES_EXPEL_UNIT:
7022 case ACTRES_DISBAND_UNIT_RECOVER:
7023 case ACTRES_DISBAND_UNIT:
7024 case ACTRES_HOME_CITY:
7025 case ACTRES_HOMELESS:
7026 case ACTRES_UPGRADE_UNIT:
7027 case ACTRES_PARADROP:
7028 case ACTRES_PARADROP_CONQUER:
7029 case ACTRES_AIRLIFT:
7031 case ACTRES_CONQUER_CITY:
7032 case ACTRES_CONQUER_EXTRAS:
7033 case ACTRES_HEAL_UNIT:
7034 case ACTRES_TRANSFORM_TERRAIN:
7035 case ACTRES_CULTIVATE:
7037 case ACTRES_PILLAGE:
7038 case ACTRES_CLEAN_POLLUTION:
7039 case ACTRES_CLEAN_FALLOUT:
7040 case ACTRES_FORTIFY:
7042 case ACTRES_CONVERT:
7045 case ACTRES_IRRIGATE:
7046 case ACTRES_TRANSPORT_ALIGHT:
7047 case ACTRES_TRANSPORT_UNLOAD:
7048 case ACTRES_TRANSPORT_DISEMBARK:
7049 case ACTRES_TRANSPORT_BOARD:
7050 case ACTRES_TRANSPORT_EMBARK:
7051 case ACTRES_SPY_ATTACK:
7052 case ACTRES_HUT_ENTER:
7053 case ACTRES_HUT_FRIGHTEN:
7054 case ACTRES_UNIT_MOVE:
7069 const struct unit *act_unit,
7070 const struct city *tgt_city,
7071 const struct player *tgt_player,
7072 const struct action *paction)
7078 "Bad initial odds for action number %d."
7079 " Does it roll the dice at all?",
7088 .player = act_player,
7095 EFT_ACTION_ODDS_PCT))
7099 return CLIP(0, odds, 100);
7129 const struct player *actor_player,
7147 const struct player *actor_player,
7151 FALSE,
"Action %s is against %s not cities",
7153 action_target_kind_name(
7204 &enabler->actor_reqs,
7252 .value.utype = act_utype };
7332 struct action_enabler_list *
enablers;
7383 if ((actor_uni == NULL
7386 && (target_uni == NULL
7420 enum action_result result)
7428 act_list[(*position)++] = paction->
id;
7440 switch ((
enum gen_action)act) {
7441 case ACTION_SPY_POISON:
7442 return "ui_name_poison_city";
7443 case ACTION_SPY_POISON_ESC:
7444 return "ui_name_poison_city_escape";
7445 case ACTION_SPY_SABOTAGE_UNIT:
7446 return "ui_name_sabotage_unit";
7447 case ACTION_SPY_SABOTAGE_UNIT_ESC:
7448 return "ui_name_sabotage_unit_escape";
7449 case ACTION_SPY_BRIBE_UNIT:
7450 return "ui_name_bribe_unit";
7451 case ACTION_SPY_SABOTAGE_CITY:
7452 return "ui_name_sabotage_city";
7453 case ACTION_SPY_SABOTAGE_CITY_ESC:
7454 return "ui_name_sabotage_city_escape";
7455 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
7456 return "ui_name_targeted_sabotage_city";
7457 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
7458 return "ui_name_sabotage_city_production";
7459 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
7460 return "ui_name_targeted_sabotage_city_escape";
7461 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
7462 return "ui_name_sabotage_city_production_escape";
7463 case ACTION_SPY_INCITE_CITY:
7464 return "ui_name_incite_city";
7465 case ACTION_SPY_INCITE_CITY_ESC:
7466 return "ui_name_incite_city_escape";
7467 case ACTION_ESTABLISH_EMBASSY:
7468 return "ui_name_establish_embassy";
7469 case ACTION_ESTABLISH_EMBASSY_STAY:
7470 return "ui_name_establish_embassy_stay";
7471 case ACTION_SPY_STEAL_TECH:
7472 return "ui_name_steal_tech";
7473 case ACTION_SPY_STEAL_TECH_ESC:
7474 return "ui_name_steal_tech_escape";
7475 case ACTION_SPY_TARGETED_STEAL_TECH:
7476 return "ui_name_targeted_steal_tech";
7477 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
7478 return "ui_name_targeted_steal_tech_escape";
7479 case ACTION_SPY_INVESTIGATE_CITY:
7480 return "ui_name_investigate_city";
7481 case ACTION_INV_CITY_SPEND:
7482 return "ui_name_investigate_city_spend_unit";
7483 case ACTION_SPY_STEAL_GOLD:
7484 return "ui_name_steal_gold";
7485 case ACTION_SPY_STEAL_GOLD_ESC:
7486 return "ui_name_steal_gold_escape";
7487 case ACTION_SPY_SPREAD_PLAGUE:
7488 return "ui_name_spread_plague";
7489 case ACTION_STEAL_MAPS:
7490 return "ui_name_steal_maps";
7491 case ACTION_STEAL_MAPS_ESC:
7492 return "ui_name_steal_maps_escape";
7493 case ACTION_TRADE_ROUTE:
7494 return "ui_name_establish_trade_route";
7495 case ACTION_MARKETPLACE:
7496 return "ui_name_enter_marketplace";
7497 case ACTION_HELP_WONDER:
7498 return "ui_name_help_wonder";
7499 case ACTION_CAPTURE_UNITS:
7500 return "ui_name_capture_units";
7501 case ACTION_EXPEL_UNIT:
7502 return "ui_name_expel_unit";
7503 case ACTION_FOUND_CITY:
7504 return "ui_name_found_city";
7505 case ACTION_JOIN_CITY:
7506 return "ui_name_join_city";
7507 case ACTION_BOMBARD:
7508 return "ui_name_bombard";
7509 case ACTION_BOMBARD2:
7510 return "ui_name_bombard_2";
7511 case ACTION_BOMBARD3:
7512 return "ui_name_bombard_3";
7513 case ACTION_SPY_NUKE:
7514 return "ui_name_suitcase_nuke";
7515 case ACTION_SPY_NUKE_ESC:
7516 return "ui_name_suitcase_nuke_escape";
7518 return "ui_name_explode_nuclear";
7519 case ACTION_NUKE_CITY:
7520 return "ui_name_nuke_city";
7521 case ACTION_NUKE_UNITS:
7522 return "ui_name_nuke_units";
7523 case ACTION_DESTROY_CITY:
7524 return "ui_name_destroy_city";
7525 case ACTION_DISBAND_UNIT_RECOVER:
7526 return "ui_name_disband_unit_recover";
7527 case ACTION_DISBAND_UNIT:
7528 return "ui_name_disband_unit";
7529 case ACTION_HOME_CITY:
7530 return "ui_name_home_city";
7531 case ACTION_HOMELESS:
7532 return "ui_name_homeless";
7533 case ACTION_UPGRADE_UNIT:
7534 return "ui_name_upgrade_unit";
7535 case ACTION_PARADROP:
7536 return "ui_name_paradrop_unit";
7537 case ACTION_PARADROP_CONQUER:
7538 return "ui_name_paradrop_unit_conquer";
7539 case ACTION_PARADROP_FRIGHTEN:
7540 return "ui_name_paradrop_unit_frighten";
7541 case ACTION_PARADROP_FRIGHTEN_CONQUER:
7542 return "ui_name_paradrop_unit_frighten_conquer";
7543 case ACTION_PARADROP_ENTER:
7544 return "ui_name_paradrop_unit_enter";
7545 case ACTION_PARADROP_ENTER_CONQUER:
7546 return "ui_name_paradrop_unit_enter_conquer";
7547 case ACTION_AIRLIFT:
7548 return "ui_name_airlift_unit";
7550 return "ui_name_attack";
7551 case ACTION_SUICIDE_ATTACK:
7552 return "ui_name_suicide_attack";
7553 case ACTION_STRIKE_BUILDING:
7554 return "ui_name_surgical_strike_building";
7555 case ACTION_STRIKE_PRODUCTION:
7556 return "ui_name_surgical_strike_production";
7557 case ACTION_CONQUER_CITY:
7558 return "ui_name_conquer_city";
7559 case ACTION_CONQUER_CITY2:
7560 return "ui_name_conquer_city_2";
7561 case ACTION_CONQUER_CITY3:
7562 return "ui_name_conquer_city_3";
7563 case ACTION_CONQUER_CITY4:
7564 return "ui_name_conquer_city_4";
7565 case ACTION_CONQUER_EXTRAS:
7566 return "ui_name_conquer_extras";
7567 case ACTION_CONQUER_EXTRAS2:
7568 return "ui_name_conquer_extras_2";
7569 case ACTION_CONQUER_EXTRAS3:
7570 return "ui_name_conquer_extras_3";
7571 case ACTION_CONQUER_EXTRAS4:
7572 return "ui_name_conquer_extras_4";
7573 case ACTION_HEAL_UNIT:
7574 return "ui_name_heal_unit";
7575 case ACTION_HEAL_UNIT2:
7576 return "ui_name_heal_unit_2";
7577 case ACTION_TRANSFORM_TERRAIN:
7578 return "ui_name_transform_terrain";
7579 case ACTION_CULTIVATE:
7580 return "ui_name_cultivate";
7582 return "ui_name_plant";
7583 case ACTION_PILLAGE:
7584 return "ui_name_pillage";
7585 case ACTION_CLEAN_POLLUTION:
7586 return "ui_name_clean_pollution";
7587 case ACTION_CLEAN_FALLOUT:
7588 return "ui_name_clean_fallout";
7589 case ACTION_FORTIFY:
7590 return "ui_name_fortify";
7592 return "ui_name_road";
7593 case ACTION_CONVERT:
7594 return "ui_name_convert_unit";
7596 return "ui_name_build_base";
7598 return "ui_name_build_mine";
7599 case ACTION_IRRIGATE:
7600 return "ui_name_irrigate";
7601 case ACTION_TRANSPORT_ALIGHT:
7602 return "ui_name_transport_alight";
7603 case ACTION_TRANSPORT_BOARD:
7604 return "ui_name_transport_board";
7605 case ACTION_TRANSPORT_EMBARK:
7606 return "ui_name_transport_embark";
7607 case ACTION_TRANSPORT_EMBARK2:
7608 return "ui_name_transport_embark_2";
7609 case ACTION_TRANSPORT_EMBARK3:
7610 return "ui_name_transport_embark_3";
7611 case ACTION_TRANSPORT_UNLOAD:
7612 return "ui_name_transport_unload";
7613 case ACTION_TRANSPORT_DISEMBARK1:
7614 return "ui_name_transport_disembark";
7615 case ACTION_TRANSPORT_DISEMBARK2:
7616 return "ui_name_transport_disembark_2";
7617 case ACTION_TRANSPORT_DISEMBARK3:
7618 return "ui_name_transport_disembark_3";
7619 case ACTION_TRANSPORT_DISEMBARK4:
7620 return "ui_name_transport_disembark_4";
7621 case ACTION_HUT_ENTER:
7622 return "ui_name_enter_hut";
7623 case ACTION_HUT_ENTER2:
7624 return "ui_name_enter_hut_2";
7625 case ACTION_HUT_ENTER3:
7626 return "ui_name_enter_hut_3";
7627 case ACTION_HUT_ENTER4:
7628 return "ui_name_enter_hut_4";
7629 case ACTION_HUT_FRIGHTEN:
7630 return "ui_name_frighten_hut";
7631 case ACTION_HUT_FRIGHTEN2:
7632 return "ui_name_frighten_hut_2";
7633 case ACTION_HUT_FRIGHTEN3:
7634 return "ui_name_frighten_hut_3";
7635 case ACTION_HUT_FRIGHTEN4:
7636 return "ui_name_frighten_hut_4";
7637 case ACTION_SPY_ATTACK:
7638 return "ui_name_spy_attack";
7639 case ACTION_UNIT_MOVE:
7640 return "ui_name_unit_move";
7641 case ACTION_UNIT_MOVE2:
7642 return "ui_name_unit_move_2";
7643 case ACTION_UNIT_MOVE3:
7644 return "ui_name_unit_move_3";
7645 case ACTION_USER_ACTION1:
7646 return "ui_name_user_action_1";
7647 case ACTION_USER_ACTION2:
7648 return "ui_name_user_action_2";
7649 case ACTION_USER_ACTION3:
7650 return "ui_name_user_action_3";
7651 case ACTION_USER_ACTION4:
7652 return "ui_name_user_action_4";
7657 fc_assert(act >= 0 && act < ACTION_COUNT);
7666 switch ((
enum gen_action)act) {
7667 case ACTION_SPY_POISON:
7669 return N_(
"%sPoison City%s");
7670 case ACTION_SPY_POISON_ESC:
7672 return N_(
"%sPoison City and Escape%s");
7673 case ACTION_SPY_SABOTAGE_UNIT:
7675 return N_(
"S%sabotage Enemy Unit%s");
7676 case ACTION_SPY_SABOTAGE_UNIT_ESC:
7678 return N_(
"S%sabotage Enemy Unit and Escape%s");
7679 case ACTION_SPY_BRIBE_UNIT:
7681 return N_(
"Bribe Enemy %sUnit%s");
7682 case ACTION_SPY_SABOTAGE_CITY:
7684 return N_(
"%sSabotage City%s");
7685 case ACTION_SPY_SABOTAGE_CITY_ESC:
7687 return N_(
"%sSabotage City and Escape%s");
7688 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
7690 return N_(
"Industria%sl Sabotage%s");
7691 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
7693 return N_(
"Industria%sl Sabotage Production%s");
7694 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
7696 return N_(
"Industria%sl Sabotage and Escape%s");
7697 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
7699 return N_(
"Industria%sl Sabotage Production and Escape%s");
7700 case ACTION_SPY_INCITE_CITY:
7702 return N_(
"Incite a Re%svolt%s");
7703 case ACTION_SPY_INCITE_CITY_ESC:
7705 return N_(
"Incite a Re%svolt and Escape%s");
7706 case ACTION_ESTABLISH_EMBASSY:
7708 return N_(
"Establish %sEmbassy%s");
7709 case ACTION_ESTABLISH_EMBASSY_STAY:
7711 return N_(
"Becom%se Ambassador%s");
7712 case ACTION_SPY_STEAL_TECH:
7714 return N_(
"Steal %sTechnology%s");
7715 case ACTION_SPY_STEAL_TECH_ESC:
7717 return N_(
"Steal %sTechnology and Escape%s");
7718 case ACTION_SPY_TARGETED_STEAL_TECH:
7720 return N_(
"In%sdustrial Espionage%s");
7721 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
7723 return N_(
"In%sdustrial Espionage and Escape%s");
7724 case ACTION_SPY_INVESTIGATE_CITY:
7726 return N_(
"%sInvestigate City%s");
7727 case ACTION_INV_CITY_SPEND:
7730 return N_(
"%sInvestigate City (spends the unit)%s");
7731 case ACTION_SPY_STEAL_GOLD:
7733 return N_(
"Steal %sGold%s");
7734 case ACTION_SPY_STEAL_GOLD_ESC:
7736 return N_(
"Steal %sGold and Escape%s");
7737 case ACTION_SPY_SPREAD_PLAGUE:
7739 return N_(
"Spread %sPlague%s");
7740 case ACTION_STEAL_MAPS:
7742 return N_(
"Steal %sMaps%s");
7743 case ACTION_STEAL_MAPS_ESC:
7745 return N_(
"Steal %sMaps and Escape%s");
7746 case ACTION_TRADE_ROUTE:
7748 return N_(
"Establish Trade %sRoute%s");
7749 case ACTION_MARKETPLACE:
7751 return N_(
"Enter %sMarketplace%s");
7752 case ACTION_HELP_WONDER:
7754 return N_(
"Help %sbuild Wonder%s");
7755 case ACTION_CAPTURE_UNITS:
7757 return N_(
"%sCapture Units%s");
7758 case ACTION_EXPEL_UNIT:
7760 return N_(
"%sExpel Unit%s");
7761 case ACTION_FOUND_CITY:
7763 return N_(
"%sFound City%s");
7764 case ACTION_JOIN_CITY:
7766 return N_(
"%sJoin City%s");
7767 case ACTION_BOMBARD:
7769 return N_(
"B%sombard%s");
7770 case ACTION_BOMBARD2:
7772 return N_(
"B%sombard 2%s");
7773 case ACTION_BOMBARD3:
7775 return N_(
"B%sombard 3%s");
7776 case ACTION_SPY_NUKE:
7778 return N_(
"Suitcase %sNuke%s");
7779 case ACTION_SPY_NUKE_ESC:
7781 return N_(
"Suitcase %sNuke and Escape%s");
7784 return N_(
"Explode %sNuclear%s");
7785 case ACTION_NUKE_CITY:
7787 return N_(
"%sNuke City%s");
7788 case ACTION_NUKE_UNITS:
7790 return N_(
"%sNuke Units%s");
7791 case ACTION_DESTROY_CITY:
7793 return N_(
"Destroy %sCity%s");
7794 case ACTION_DISBAND_UNIT_RECOVER:
7796 return N_(
"Dis%sband recovering production%s");
7797 case ACTION_DISBAND_UNIT:
7799 return N_(
"Dis%sband without recovering production%s");
7800 case ACTION_HOME_CITY:
7802 return N_(
"Set %sHome City%s");
7803 case ACTION_HOMELESS:
7805 return N_(
"Make %sHomeless%s");
7806 case ACTION_UPGRADE_UNIT:
7808 return N_(
"%sUpgrade Unit%s");
7809 case ACTION_PARADROP:
7811 return N_(
"Drop %sParatrooper%s");
7812 case ACTION_PARADROP_CONQUER:
7814 return N_(
"Drop %sParatrooper%s");
7815 case ACTION_PARADROP_FRIGHTEN:
7817 return N_(
"Drop %sParatrooper%s");
7818 case ACTION_PARADROP_FRIGHTEN_CONQUER:
7820 return N_(
"Drop %sParatrooper%s");
7821 case ACTION_PARADROP_ENTER:
7823 return N_(
"Drop %sParatrooper%s");
7824 case ACTION_PARADROP_ENTER_CONQUER:
7826 return N_(
"Drop %sParatrooper%s");
7827 case ACTION_AIRLIFT:
7829 return N_(
"%sAirlift to City%s");
7832 return N_(
"%sAttack%s");
7833 case ACTION_SUICIDE_ATTACK:
7835 return N_(
"%sSuicide Attack%s");
7836 case ACTION_STRIKE_BUILDING:
7838 return N_(
"Surgical Str%sike Building%s");
7839 case ACTION_STRIKE_PRODUCTION:
7841 return N_(
"Surgical Str%sike Production%s");
7842 case ACTION_CONQUER_CITY:
7843 case ACTION_CONQUER_CITY3:
7844 case ACTION_CONQUER_CITY4:
7846 return N_(
"%sConquer City%s");
7847 case ACTION_CONQUER_CITY2:
7849 return N_(
"%sConquer City 2%s");
7850 case ACTION_CONQUER_EXTRAS:
7851 case ACTION_CONQUER_EXTRAS3:
7852 case ACTION_CONQUER_EXTRAS4:
7854 return N_(
"%sConquer Extras%s");
7855 case ACTION_CONQUER_EXTRAS2:
7857 return N_(
"%sConquer Extras 2%s");
7858 case ACTION_HEAL_UNIT:
7859 case ACTION_HEAL_UNIT2:
7861 return N_(
"Heal %sUnit%s");
7862 case ACTION_TRANSFORM_TERRAIN:
7864 return N_(
"%sTransform Terrain%s");
7865 case ACTION_CULTIVATE:
7867 return N_(
"Transform by %sCultivating%s");
7870 return N_(
"Transform by %sPlanting%s");
7871 case ACTION_PILLAGE:
7873 return N_(
"Pilla%sge%s");
7874 case ACTION_CLEAN_POLLUTION:
7876 return N_(
"Clean %sPollution%s");
7877 case ACTION_CLEAN_FALLOUT:
7879 return N_(
"Clean %sFallout%s");
7880 case ACTION_FORTIFY:
7882 return N_(
"%sFortify%s");
7885 return N_(
"Build %sRoad%s");
7886 case ACTION_CONVERT:
7888 return N_(
"%sConvert Unit%s");
7891 return N_(
"%sBuild Base%s");
7894 return N_(
"Build %sMine%s");
7895 case ACTION_IRRIGATE:
7897 return N_(
"Build %sIrrigation%s");
7898 case ACTION_TRANSPORT_ALIGHT:
7900 return N_(
"%sDeboard%s");
7901 case ACTION_TRANSPORT_BOARD:
7903 return N_(
"%sBoard%s");
7904 case ACTION_TRANSPORT_EMBARK:
7905 case ACTION_TRANSPORT_EMBARK2:
7906 case ACTION_TRANSPORT_EMBARK3:
7908 return N_(
"%sEmbark%s");
7909 case ACTION_TRANSPORT_UNLOAD:
7911 return N_(
"%sUnload%s");
7912 case ACTION_TRANSPORT_DISEMBARK1:
7913 case ACTION_TRANSPORT_DISEMBARK3:
7914 case ACTION_TRANSPORT_DISEMBARK4:
7916 return N_(
"%sDisembark%s");
7917 case ACTION_TRANSPORT_DISEMBARK2:
7919 return N_(
"%sDisembark 2%s");
7920 case ACTION_SPY_ATTACK:
7922 return N_(
"%sEliminate Diplomat%s");
7923 case ACTION_HUT_ENTER:
7924 case ACTION_HUT_ENTER2:
7925 case ACTION_HUT_ENTER3:
7926 case ACTION_HUT_ENTER4:
7928 return N_(
"Enter %sHut%s");
7929 case ACTION_HUT_FRIGHTEN:
7930 case ACTION_HUT_FRIGHTEN2:
7931 case ACTION_HUT_FRIGHTEN3:
7932 case ACTION_HUT_FRIGHTEN4:
7934 return N_(
"Frighten %sHut%s");
7935 case ACTION_UNIT_MOVE:
7936 case ACTION_UNIT_MOVE2:
7937 case ACTION_UNIT_MOVE3:
7939 return N_(
"Regular %sMove%s");
7940 case ACTION_USER_ACTION1:
7942 return N_(
"%sUser Action 1%s");
7943 case ACTION_USER_ACTION2:
7945 return N_(
"%sUser Action 2%s");
7946 case ACTION_USER_ACTION3:
7948 return N_(
"%sUser Action 3%s");
7949 case ACTION_USER_ACTION4:
7951 return N_(
"%sUser Action 4%s");
7968 switch ((
enum gen_action)act) {
7969 case ACTION_SPY_POISON:
7970 case ACTION_SPY_POISON_ESC:
7971 case ACTION_SPY_SABOTAGE_UNIT:
7972 case ACTION_SPY_SABOTAGE_UNIT_ESC:
7973 case ACTION_SPY_BRIBE_UNIT:
7974 case ACTION_SPY_SABOTAGE_CITY:
7975 case ACTION_SPY_SABOTAGE_CITY_ESC:
7976 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
7977 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
7978 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
7979 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
7980 case ACTION_SPY_INCITE_CITY:
7981 case ACTION_SPY_INCITE_CITY_ESC:
7982 case ACTION_ESTABLISH_EMBASSY:
7983 case ACTION_ESTABLISH_EMBASSY_STAY:
7984 case ACTION_SPY_STEAL_TECH:
7985 case ACTION_SPY_STEAL_TECH_ESC:
7986 case ACTION_SPY_TARGETED_STEAL_TECH:
7987 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
7988 case ACTION_SPY_INVESTIGATE_CITY:
7989 case ACTION_INV_CITY_SPEND:
7990 case ACTION_SPY_STEAL_GOLD:
7991 case ACTION_SPY_STEAL_GOLD_ESC:
7992 case ACTION_SPY_SPREAD_PLAGUE:
7993 case ACTION_STEAL_MAPS:
7994 case ACTION_STEAL_MAPS_ESC:
7995 case ACTION_TRADE_ROUTE:
7996 case ACTION_MARKETPLACE:
7997 case ACTION_HELP_WONDER:
7998 case ACTION_CAPTURE_UNITS:
7999 case ACTION_EXPEL_UNIT:
8000 case ACTION_FOUND_CITY:
8001 case ACTION_JOIN_CITY:
8002 case ACTION_SPY_NUKE:
8003 case ACTION_SPY_NUKE_ESC:
8004 case ACTION_DESTROY_CITY:
8005 case ACTION_DISBAND_UNIT_RECOVER:
8006 case ACTION_DISBAND_UNIT:
8007 case ACTION_HOME_CITY:
8008 case ACTION_HOMELESS:
8009 case ACTION_UPGRADE_UNIT:
8010 case ACTION_PARADROP:
8011 case ACTION_PARADROP_CONQUER:
8012 case ACTION_PARADROP_FRIGHTEN:
8013 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8014 case ACTION_PARADROP_ENTER:
8015 case ACTION_PARADROP_ENTER_CONQUER:
8016 case ACTION_AIRLIFT:
8018 case ACTION_SUICIDE_ATTACK:
8019 case ACTION_STRIKE_BUILDING:
8020 case ACTION_STRIKE_PRODUCTION:
8021 case ACTION_CONQUER_CITY:
8022 case ACTION_CONQUER_CITY2:
8023 case ACTION_CONQUER_CITY3:
8024 case ACTION_CONQUER_CITY4:
8025 case ACTION_HEAL_UNIT:
8026 case ACTION_HEAL_UNIT2:
8027 case ACTION_TRANSFORM_TERRAIN:
8028 case ACTION_CULTIVATE:
8030 case ACTION_PILLAGE:
8031 case ACTION_CLEAN_POLLUTION:
8032 case ACTION_CLEAN_FALLOUT:
8033 case ACTION_FORTIFY:
8035 case ACTION_CONVERT:
8038 case ACTION_IRRIGATE:
8039 case ACTION_TRANSPORT_ALIGHT:
8040 case ACTION_TRANSPORT_BOARD:
8041 case ACTION_TRANSPORT_EMBARK:
8042 case ACTION_TRANSPORT_EMBARK2:
8043 case ACTION_TRANSPORT_EMBARK3:
8044 case ACTION_TRANSPORT_UNLOAD:
8045 case ACTION_TRANSPORT_DISEMBARK1:
8046 case ACTION_TRANSPORT_DISEMBARK2:
8047 case ACTION_TRANSPORT_DISEMBARK3:
8048 case ACTION_TRANSPORT_DISEMBARK4:
8049 case ACTION_BOMBARD:
8050 case ACTION_BOMBARD2:
8051 case ACTION_BOMBARD3:
8052 case ACTION_SPY_ATTACK:
8053 case ACTION_CONQUER_EXTRAS:
8054 case ACTION_CONQUER_EXTRAS2:
8055 case ACTION_CONQUER_EXTRAS3:
8056 case ACTION_CONQUER_EXTRAS4:
8057 case ACTION_HUT_ENTER:
8058 case ACTION_HUT_ENTER2:
8059 case ACTION_HUT_ENTER3:
8060 case ACTION_HUT_ENTER4:
8061 case ACTION_HUT_FRIGHTEN:
8062 case ACTION_HUT_FRIGHTEN2:
8063 case ACTION_HUT_FRIGHTEN4:
8064 case ACTION_HUT_FRIGHTEN3:
8065 case ACTION_UNIT_MOVE:
8066 case ACTION_UNIT_MOVE2:
8067 case ACTION_UNIT_MOVE3:
8071 return "explode_nuclear_min_range";
8072 case ACTION_NUKE_CITY:
8073 return "nuke_city_min_range";
8074 case ACTION_NUKE_UNITS:
8075 return "nuke_units_min_range";
8076 case ACTION_USER_ACTION1:
8077 return "user_action_1_min_range";
8078 case ACTION_USER_ACTION2:
8079 return "user_action_2_min_range";
8080 case ACTION_USER_ACTION3:
8081 return "user_action_3_min_range";
8082 case ACTION_USER_ACTION4:
8083 return "user_action_4_min_range";
8088 fc_assert(act >= 0 && act < ACTION_COUNT);
8098 case ACTRES_ESTABLISH_EMBASSY:
8099 case ACTRES_SPY_INVESTIGATE_CITY:
8100 case ACTRES_SPY_POISON:
8101 case ACTRES_SPY_STEAL_GOLD:
8102 case ACTRES_SPY_SABOTAGE_CITY:
8103 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8104 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8105 case ACTRES_SPY_STEAL_TECH:
8106 case ACTRES_SPY_TARGETED_STEAL_TECH:
8107 case ACTRES_SPY_INCITE_CITY:
8108 case ACTRES_TRADE_ROUTE:
8109 case ACTRES_MARKETPLACE:
8110 case ACTRES_HELP_WONDER:
8111 case ACTRES_SPY_BRIBE_UNIT:
8112 case ACTRES_SPY_SABOTAGE_UNIT:
8113 case ACTRES_CAPTURE_UNITS:
8114 case ACTRES_FOUND_CITY:
8115 case ACTRES_JOIN_CITY:
8116 case ACTRES_STEAL_MAPS:
8117 case ACTRES_BOMBARD:
8118 case ACTRES_SPY_NUKE:
8119 case ACTRES_DESTROY_CITY:
8120 case ACTRES_EXPEL_UNIT:
8121 case ACTRES_DISBAND_UNIT_RECOVER:
8122 case ACTRES_DISBAND_UNIT:
8123 case ACTRES_HOME_CITY:
8124 case ACTRES_HOMELESS:
8125 case ACTRES_UPGRADE_UNIT:
8126 case ACTRES_PARADROP:
8127 case ACTRES_PARADROP_CONQUER:
8128 case ACTRES_AIRLIFT:
8129 case ACTRES_STRIKE_BUILDING:
8130 case ACTRES_STRIKE_PRODUCTION:
8132 case ACTRES_CONQUER_CITY:
8133 case ACTRES_HEAL_UNIT:
8134 case ACTRES_TRANSFORM_TERRAIN:
8135 case ACTRES_CULTIVATE:
8137 case ACTRES_PILLAGE:
8138 case ACTRES_CLEAN_POLLUTION:
8139 case ACTRES_CLEAN_FALLOUT:
8140 case ACTRES_FORTIFY:
8142 case ACTRES_CONVERT:
8145 case ACTRES_IRRIGATE:
8146 case ACTRES_TRANSPORT_ALIGHT:
8147 case ACTRES_TRANSPORT_UNLOAD:
8148 case ACTRES_TRANSPORT_DISEMBARK:
8149 case ACTRES_TRANSPORT_BOARD:
8150 case ACTRES_TRANSPORT_EMBARK:
8151 case ACTRES_SPY_ATTACK:
8152 case ACTRES_SPY_SPREAD_PLAGUE:
8153 case ACTRES_CONQUER_EXTRAS:
8154 case ACTRES_HUT_ENTER:
8155 case ACTRES_HUT_FRIGHTEN:
8156 case ACTRES_UNIT_MOVE:
8161 case ACTRES_NUKE_UNITS:
8179 switch ((
enum gen_action)act) {
8180 case ACTION_SPY_POISON:
8181 case ACTION_SPY_POISON_ESC:
8182 case ACTION_SPY_SABOTAGE_UNIT:
8183 case ACTION_SPY_SABOTAGE_UNIT_ESC:
8184 case ACTION_SPY_BRIBE_UNIT:
8185 case ACTION_SPY_SABOTAGE_CITY:
8186 case ACTION_SPY_SABOTAGE_CITY_ESC:
8187 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
8188 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
8189 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
8190 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
8191 case ACTION_SPY_INCITE_CITY:
8192 case ACTION_SPY_INCITE_CITY_ESC:
8193 case ACTION_ESTABLISH_EMBASSY:
8194 case ACTION_ESTABLISH_EMBASSY_STAY:
8195 case ACTION_SPY_STEAL_TECH:
8196 case ACTION_SPY_STEAL_TECH_ESC:
8197 case ACTION_SPY_TARGETED_STEAL_TECH:
8198 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
8199 case ACTION_SPY_INVESTIGATE_CITY:
8200 case ACTION_INV_CITY_SPEND:
8201 case ACTION_SPY_STEAL_GOLD:
8202 case ACTION_SPY_STEAL_GOLD_ESC:
8203 case ACTION_SPY_SPREAD_PLAGUE:
8204 case ACTION_STEAL_MAPS:
8205 case ACTION_STEAL_MAPS_ESC:
8206 case ACTION_TRADE_ROUTE:
8207 case ACTION_MARKETPLACE:
8208 case ACTION_CAPTURE_UNITS:
8209 case ACTION_EXPEL_UNIT:
8210 case ACTION_FOUND_CITY:
8211 case ACTION_JOIN_CITY:
8212 case ACTION_SPY_NUKE:
8213 case ACTION_SPY_NUKE_ESC:
8214 case ACTION_DESTROY_CITY:
8215 case ACTION_DISBAND_UNIT:
8216 case ACTION_HOME_CITY:
8217 case ACTION_HOMELESS:
8218 case ACTION_UPGRADE_UNIT:
8219 case ACTION_PARADROP:
8220 case ACTION_PARADROP_CONQUER:
8221 case ACTION_PARADROP_FRIGHTEN:
8222 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8223 case ACTION_PARADROP_ENTER:
8224 case ACTION_PARADROP_ENTER_CONQUER:
8226 case ACTION_SUICIDE_ATTACK:
8227 case ACTION_STRIKE_BUILDING:
8228 case ACTION_STRIKE_PRODUCTION:
8229 case ACTION_CONQUER_CITY:
8230 case ACTION_CONQUER_CITY2:
8231 case ACTION_CONQUER_CITY3:
8232 case ACTION_CONQUER_CITY4:
8233 case ACTION_HEAL_UNIT:
8234 case ACTION_HEAL_UNIT2:
8235 case ACTION_TRANSFORM_TERRAIN:
8236 case ACTION_CULTIVATE:
8238 case ACTION_PILLAGE:
8239 case ACTION_CLEAN_POLLUTION:
8240 case ACTION_CLEAN_FALLOUT:
8241 case ACTION_FORTIFY:
8243 case ACTION_CONVERT:
8246 case ACTION_IRRIGATE:
8247 case ACTION_TRANSPORT_ALIGHT:
8248 case ACTION_TRANSPORT_BOARD:
8249 case ACTION_TRANSPORT_EMBARK:
8250 case ACTION_TRANSPORT_EMBARK2:
8251 case ACTION_TRANSPORT_EMBARK3:
8252 case ACTION_TRANSPORT_UNLOAD:
8253 case ACTION_TRANSPORT_DISEMBARK1:
8254 case ACTION_TRANSPORT_DISEMBARK2:
8255 case ACTION_TRANSPORT_DISEMBARK3:
8256 case ACTION_TRANSPORT_DISEMBARK4:
8257 case ACTION_SPY_ATTACK:
8258 case ACTION_CONQUER_EXTRAS:
8259 case ACTION_CONQUER_EXTRAS2:
8260 case ACTION_CONQUER_EXTRAS3:
8261 case ACTION_CONQUER_EXTRAS4:
8262 case ACTION_HUT_ENTER:
8263 case ACTION_HUT_ENTER2:
8264 case ACTION_HUT_ENTER3:
8265 case ACTION_HUT_ENTER4:
8266 case ACTION_HUT_FRIGHTEN:
8267 case ACTION_HUT_FRIGHTEN2:
8268 case ACTION_HUT_FRIGHTEN3:
8269 case ACTION_HUT_FRIGHTEN4:
8270 case ACTION_UNIT_MOVE:
8271 case ACTION_UNIT_MOVE2:
8272 case ACTION_UNIT_MOVE3:
8275 case ACTION_HELP_WONDER:
8276 return "help_wonder_max_range";
8277 case ACTION_DISBAND_UNIT_RECOVER:
8278 return "disband_unit_recover_max_range";
8279 case ACTION_BOMBARD:
8280 return "bombard_max_range";
8281 case ACTION_BOMBARD2:
8282 return "bombard_2_max_range";
8283 case ACTION_BOMBARD3:
8284 return "bombard_3_max_range";
8286 return "explode_nuclear_max_range";
8287 case ACTION_NUKE_CITY:
8288 return "nuke_city_max_range";
8289 case ACTION_NUKE_UNITS:
8290 return "nuke_units_max_range";
8291 case ACTION_AIRLIFT:
8292 return "airlift_max_range";
8293 case ACTION_USER_ACTION1:
8294 return "user_action_1_max_range";
8295 case ACTION_USER_ACTION2:
8296 return "user_action_2_max_range";
8297 case ACTION_USER_ACTION3:
8298 return "user_action_3_max_range";
8299 case ACTION_USER_ACTION4:
8300 return "user_action_4_max_range";
8305 fc_assert(act >= 0 && act < ACTION_COUNT);
8315 case ACTRES_ESTABLISH_EMBASSY:
8316 case ACTRES_SPY_INVESTIGATE_CITY:
8317 case ACTRES_SPY_POISON:
8318 case ACTRES_SPY_STEAL_GOLD:
8319 case ACTRES_SPY_SABOTAGE_CITY:
8320 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8321 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8322 case ACTRES_SPY_STEAL_TECH:
8323 case ACTRES_SPY_TARGETED_STEAL_TECH:
8324 case ACTRES_SPY_INCITE_CITY:
8325 case ACTRES_TRADE_ROUTE:
8326 case ACTRES_MARKETPLACE:
8327 case ACTRES_SPY_BRIBE_UNIT:
8328 case ACTRES_SPY_SABOTAGE_UNIT:
8329 case ACTRES_CAPTURE_UNITS:
8330 case ACTRES_FOUND_CITY:
8331 case ACTRES_JOIN_CITY:
8332 case ACTRES_STEAL_MAPS:
8333 case ACTRES_SPY_NUKE:
8334 case ACTRES_DESTROY_CITY:
8335 case ACTRES_EXPEL_UNIT:
8336 case ACTRES_DISBAND_UNIT:
8337 case ACTRES_HOME_CITY:
8338 case ACTRES_HOMELESS:
8339 case ACTRES_UPGRADE_UNIT:
8340 case ACTRES_PARADROP:
8341 case ACTRES_PARADROP_CONQUER:
8342 case ACTRES_STRIKE_BUILDING:
8343 case ACTRES_STRIKE_PRODUCTION:
8345 case ACTRES_CONQUER_CITY:
8346 case ACTRES_HEAL_UNIT:
8347 case ACTRES_TRANSFORM_TERRAIN:
8348 case ACTRES_CULTIVATE:
8350 case ACTRES_PILLAGE:
8351 case ACTRES_CLEAN_POLLUTION:
8352 case ACTRES_CLEAN_FALLOUT:
8353 case ACTRES_FORTIFY:
8355 case ACTRES_CONVERT:
8358 case ACTRES_IRRIGATE:
8359 case ACTRES_TRANSPORT_ALIGHT:
8360 case ACTRES_TRANSPORT_UNLOAD:
8361 case ACTRES_TRANSPORT_DISEMBARK:
8362 case ACTRES_TRANSPORT_BOARD:
8363 case ACTRES_TRANSPORT_EMBARK:
8364 case ACTRES_SPY_ATTACK:
8365 case ACTRES_SPY_SPREAD_PLAGUE:
8366 case ACTRES_CONQUER_EXTRAS:
8367 case ACTRES_HUT_ENTER:
8368 case ACTRES_HUT_FRIGHTEN:
8369 case ACTRES_UNIT_MOVE:
8373 case ACTRES_HELP_WONDER:
8374 case ACTRES_DISBAND_UNIT_RECOVER:
8376 case ACTRES_BOMBARD:
8380 case ACTRES_NUKE_UNITS:
8382 case ACTRES_AIRLIFT:
8400 switch ((
enum gen_action)act) {
8401 case ACTION_SPY_POISON:
8402 case ACTION_SPY_POISON_ESC:
8403 case ACTION_SPY_SABOTAGE_UNIT:
8404 case ACTION_SPY_SABOTAGE_UNIT_ESC:
8405 case ACTION_SPY_BRIBE_UNIT:
8406 case ACTION_SPY_SABOTAGE_CITY:
8407 case ACTION_SPY_SABOTAGE_CITY_ESC:
8408 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
8409 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
8410 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
8411 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
8412 case ACTION_SPY_INCITE_CITY:
8413 case ACTION_SPY_INCITE_CITY_ESC:
8414 case ACTION_ESTABLISH_EMBASSY:
8415 case ACTION_ESTABLISH_EMBASSY_STAY:
8416 case ACTION_SPY_STEAL_TECH:
8417 case ACTION_SPY_STEAL_TECH_ESC:
8418 case ACTION_SPY_TARGETED_STEAL_TECH:
8419 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
8420 case ACTION_SPY_INVESTIGATE_CITY:
8421 case ACTION_INV_CITY_SPEND:
8422 case ACTION_SPY_STEAL_GOLD:
8423 case ACTION_SPY_STEAL_GOLD_ESC:
8424 case ACTION_SPY_SPREAD_PLAGUE:
8425 case ACTION_STEAL_MAPS:
8426 case ACTION_STEAL_MAPS_ESC:
8427 case ACTION_TRADE_ROUTE:
8428 case ACTION_MARKETPLACE:
8429 case ACTION_HELP_WONDER:
8430 case ACTION_CAPTURE_UNITS:
8431 case ACTION_EXPEL_UNIT:
8432 case ACTION_FOUND_CITY:
8433 case ACTION_JOIN_CITY:
8434 case ACTION_SPY_NUKE:
8435 case ACTION_SPY_NUKE_ESC:
8436 case ACTION_NUKE_UNITS:
8437 case ACTION_DESTROY_CITY:
8438 case ACTION_DISBAND_UNIT_RECOVER:
8439 case ACTION_DISBAND_UNIT:
8440 case ACTION_HOME_CITY:
8441 case ACTION_HOMELESS:
8442 case ACTION_UPGRADE_UNIT:
8443 case ACTION_PARADROP:
8444 case ACTION_PARADROP_CONQUER:
8445 case ACTION_PARADROP_FRIGHTEN:
8446 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8447 case ACTION_PARADROP_ENTER:
8448 case ACTION_PARADROP_ENTER_CONQUER:
8449 case ACTION_AIRLIFT:
8451 case ACTION_SUICIDE_ATTACK:
8452 case ACTION_STRIKE_BUILDING:
8453 case ACTION_STRIKE_PRODUCTION:
8454 case ACTION_CONQUER_CITY:
8455 case ACTION_CONQUER_CITY2:
8456 case ACTION_CONQUER_CITY3:
8457 case ACTION_CONQUER_CITY4:
8458 case ACTION_HEAL_UNIT:
8459 case ACTION_HEAL_UNIT2:
8460 case ACTION_TRANSFORM_TERRAIN:
8461 case ACTION_CULTIVATE:
8463 case ACTION_CLEAN_POLLUTION:
8464 case ACTION_CLEAN_FALLOUT:
8465 case ACTION_FORTIFY:
8467 case ACTION_CONVERT:
8470 case ACTION_IRRIGATE:
8471 case ACTION_TRANSPORT_ALIGHT:
8472 case ACTION_TRANSPORT_BOARD:
8473 case ACTION_TRANSPORT_EMBARK:
8474 case ACTION_TRANSPORT_EMBARK2:
8475 case ACTION_TRANSPORT_EMBARK3:
8476 case ACTION_TRANSPORT_UNLOAD:
8477 case ACTION_TRANSPORT_DISEMBARK1:
8478 case ACTION_TRANSPORT_DISEMBARK2:
8479 case ACTION_TRANSPORT_DISEMBARK3:
8480 case ACTION_TRANSPORT_DISEMBARK4:
8481 case ACTION_BOMBARD:
8482 case ACTION_BOMBARD2:
8483 case ACTION_BOMBARD3:
8484 case ACTION_SPY_ATTACK:
8485 case ACTION_CONQUER_EXTRAS:
8486 case ACTION_CONQUER_EXTRAS2:
8487 case ACTION_CONQUER_EXTRAS3:
8488 case ACTION_CONQUER_EXTRAS4:
8489 case ACTION_HUT_ENTER:
8490 case ACTION_HUT_ENTER2:
8491 case ACTION_HUT_ENTER3:
8492 case ACTION_HUT_ENTER4:
8493 case ACTION_HUT_FRIGHTEN:
8494 case ACTION_HUT_FRIGHTEN2:
8495 case ACTION_HUT_FRIGHTEN3:
8496 case ACTION_HUT_FRIGHTEN4:
8497 case ACTION_UNIT_MOVE:
8498 case ACTION_UNIT_MOVE2:
8499 case ACTION_UNIT_MOVE3:
8503 return "explode_nuclear_target_kind";
8504 case ACTION_NUKE_CITY:
8505 return "nuke_city_target_kind";
8506 case ACTION_PILLAGE:
8507 return "pillage_target_kind";
8508 case ACTION_USER_ACTION1:
8509 return "user_action_1_target_kind";
8510 case ACTION_USER_ACTION2:
8511 return "user_action_2_target_kind";
8512 case ACTION_USER_ACTION3:
8513 return "user_action_3_target_kind";
8514 case ACTION_USER_ACTION4:
8515 return "user_action_4_target_kind";
8520 fc_assert(act >= 0 && act < ACTION_COUNT);
8527enum action_target_kind
8534 case ACTRES_ESTABLISH_EMBASSY:
8535 case ACTRES_SPY_INVESTIGATE_CITY:
8536 case ACTRES_SPY_POISON:
8537 case ACTRES_SPY_STEAL_GOLD:
8538 case ACTRES_SPY_SABOTAGE_CITY:
8539 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8540 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8541 case ACTRES_SPY_STEAL_TECH:
8542 case ACTRES_SPY_TARGETED_STEAL_TECH:
8543 case ACTRES_SPY_INCITE_CITY:
8544 case ACTRES_TRADE_ROUTE:
8545 case ACTRES_MARKETPLACE:
8546 case ACTRES_HELP_WONDER:
8547 case ACTRES_JOIN_CITY:
8548 case ACTRES_STEAL_MAPS:
8549 case ACTRES_SPY_NUKE:
8550 case ACTRES_DESTROY_CITY:
8551 case ACTRES_DISBAND_UNIT_RECOVER:
8552 case ACTRES_HOME_CITY:
8553 case ACTRES_UPGRADE_UNIT:
8554 case ACTRES_AIRLIFT:
8555 case ACTRES_STRIKE_BUILDING:
8556 case ACTRES_STRIKE_PRODUCTION:
8557 case ACTRES_CONQUER_CITY:
8558 case ACTRES_SPY_SPREAD_PLAGUE:
8560 case ACTRES_SPY_BRIBE_UNIT:
8561 case ACTRES_SPY_SABOTAGE_UNIT:
8562 case ACTRES_EXPEL_UNIT:
8563 case ACTRES_HEAL_UNIT:
8564 case ACTRES_TRANSPORT_ALIGHT:
8565 case ACTRES_TRANSPORT_UNLOAD:
8566 case ACTRES_TRANSPORT_BOARD:
8567 case ACTRES_TRANSPORT_EMBARK:
8569 case ACTRES_BOMBARD:
8571 case ACTRES_CAPTURE_UNITS:
8572 case ACTRES_NUKE_UNITS:
8573 case ACTRES_SPY_ATTACK:
8575 case ACTRES_FOUND_CITY:
8577 case ACTRES_PARADROP:
8578 case ACTRES_PARADROP_CONQUER:
8579 case ACTRES_TRANSFORM_TERRAIN:
8580 case ACTRES_CULTIVATE:
8582 case ACTRES_PILLAGE:
8583 case ACTRES_CLEAN_POLLUTION:
8584 case ACTRES_CLEAN_FALLOUT:
8588 case ACTRES_IRRIGATE:
8589 case ACTRES_TRANSPORT_DISEMBARK:
8590 case ACTRES_HUT_ENTER:
8591 case ACTRES_HUT_FRIGHTEN:
8592 case ACTRES_UNIT_MOVE:
8594 case ACTRES_CONQUER_EXTRAS:
8596 case ACTRES_DISBAND_UNIT:
8597 case ACTRES_CONVERT:
8598 case ACTRES_FORTIFY:
8599 case ACTRES_HOMELESS:
8614 enum action_target_kind tgt_kind)
8622 case ACTRES_ESTABLISH_EMBASSY:
8623 case ACTRES_SPY_INVESTIGATE_CITY:
8624 case ACTRES_SPY_POISON:
8625 case ACTRES_SPY_STEAL_GOLD:
8626 case ACTRES_SPY_SABOTAGE_CITY:
8627 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8628 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8629 case ACTRES_SPY_STEAL_TECH:
8630 case ACTRES_SPY_TARGETED_STEAL_TECH:
8631 case ACTRES_SPY_INCITE_CITY:
8632 case ACTRES_TRADE_ROUTE:
8633 case ACTRES_MARKETPLACE:
8634 case ACTRES_HELP_WONDER:
8635 case ACTRES_JOIN_CITY:
8636 case ACTRES_STEAL_MAPS:
8637 case ACTRES_SPY_NUKE:
8638 case ACTRES_DESTROY_CITY:
8639 case ACTRES_DISBAND_UNIT_RECOVER:
8640 case ACTRES_HOME_CITY:
8641 case ACTRES_UPGRADE_UNIT:
8642 case ACTRES_AIRLIFT:
8643 case ACTRES_STRIKE_BUILDING:
8644 case ACTRES_STRIKE_PRODUCTION:
8645 case ACTRES_CONQUER_CITY:
8646 case ACTRES_SPY_SPREAD_PLAGUE:
8647 return tgt_kind == ATK_CITY;
8648 case ACTRES_SPY_BRIBE_UNIT:
8649 case ACTRES_SPY_SABOTAGE_UNIT:
8650 case ACTRES_EXPEL_UNIT:
8651 case ACTRES_HEAL_UNIT:
8652 case ACTRES_TRANSPORT_ALIGHT:
8653 case ACTRES_TRANSPORT_UNLOAD:
8654 case ACTRES_TRANSPORT_BOARD:
8655 case ACTRES_TRANSPORT_EMBARK:
8656 return tgt_kind == ATK_UNIT;
8657 case ACTRES_CAPTURE_UNITS:
8658 case ACTRES_BOMBARD:
8659 case ACTRES_NUKE_UNITS:
8661 case ACTRES_SPY_ATTACK:
8662 return tgt_kind == ATK_UNITS;
8663 case ACTRES_FOUND_CITY:
8664 case ACTRES_PARADROP:
8665 case ACTRES_PARADROP_CONQUER:
8666 case ACTRES_TRANSFORM_TERRAIN:
8667 case ACTRES_CULTIVATE:
8669 case ACTRES_CLEAN_POLLUTION:
8670 case ACTRES_CLEAN_FALLOUT:
8674 case ACTRES_IRRIGATE:
8675 case ACTRES_TRANSPORT_DISEMBARK:
8676 case ACTRES_HUT_ENTER:
8677 case ACTRES_HUT_FRIGHTEN:
8678 case ACTRES_UNIT_MOVE:
8679 return tgt_kind == ATK_TILE;
8680 case ACTRES_CONQUER_EXTRAS:
8681 return tgt_kind == ATK_EXTRAS;
8682 case ACTRES_DISBAND_UNIT:
8683 case ACTRES_CONVERT:
8684 case ACTRES_FORTIFY:
8685 case ACTRES_HOMELESS:
8686 return tgt_kind == ATK_SELF;
8687 case ACTRES_PILLAGE:
8688 return (tgt_kind == ATK_TILE || tgt_kind == ATK_EXTRAS);
8690 return (tgt_kind == ATK_TILE || tgt_kind == ATK_CITY);
8715static enum action_sub_target_kind
8722 case ACTRES_ESTABLISH_EMBASSY:
8723 case ACTRES_SPY_INVESTIGATE_CITY:
8724 case ACTRES_SPY_POISON:
8725 case ACTRES_SPY_STEAL_GOLD:
8726 case ACTRES_SPY_SABOTAGE_CITY:
8727 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8728 case ACTRES_SPY_STEAL_TECH:
8729 case ACTRES_SPY_INCITE_CITY:
8730 case ACTRES_TRADE_ROUTE:
8731 case ACTRES_MARKETPLACE:
8732 case ACTRES_HELP_WONDER:
8733 case ACTRES_JOIN_CITY:
8734 case ACTRES_STEAL_MAPS:
8735 case ACTRES_SPY_NUKE:
8736 case ACTRES_DESTROY_CITY:
8737 case ACTRES_DISBAND_UNIT_RECOVER:
8738 case ACTRES_HOME_CITY:
8739 case ACTRES_HOMELESS:
8740 case ACTRES_UPGRADE_UNIT:
8741 case ACTRES_AIRLIFT:
8742 case ACTRES_STRIKE_PRODUCTION:
8743 case ACTRES_CONQUER_CITY:
8744 case ACTRES_SPY_SPREAD_PLAGUE:
8746 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8747 case ACTRES_STRIKE_BUILDING:
8748 return ASTK_BUILDING;
8749 case ACTRES_SPY_TARGETED_STEAL_TECH:
8751 case ACTRES_SPY_BRIBE_UNIT:
8752 case ACTRES_SPY_SABOTAGE_UNIT:
8753 case ACTRES_EXPEL_UNIT:
8754 case ACTRES_HEAL_UNIT:
8755 case ACTRES_TRANSPORT_ALIGHT:
8756 case ACTRES_TRANSPORT_UNLOAD:
8757 case ACTRES_TRANSPORT_BOARD:
8758 case ACTRES_TRANSPORT_EMBARK:
8760 case ACTRES_CAPTURE_UNITS:
8761 case ACTRES_BOMBARD:
8762 case ACTRES_NUKE_UNITS:
8764 case ACTRES_SPY_ATTACK:
8766 case ACTRES_FOUND_CITY:
8768 case ACTRES_PARADROP:
8769 case ACTRES_PARADROP_CONQUER:
8770 case ACTRES_TRANSFORM_TERRAIN:
8771 case ACTRES_CULTIVATE:
8773 case ACTRES_TRANSPORT_DISEMBARK:
8774 case ACTRES_HUT_ENTER:
8775 case ACTRES_HUT_FRIGHTEN:
8776 case ACTRES_UNIT_MOVE:
8778 case ACTRES_PILLAGE:
8779 case ACTRES_CLEAN_POLLUTION:
8780 case ACTRES_CLEAN_FALLOUT:
8785 case ACTRES_IRRIGATE:
8786 return ASTK_EXTRA_NOT_THERE;
8787 case ACTRES_CONQUER_EXTRAS:
8789 case ACTRES_DISBAND_UNIT:
8790 case ACTRES_CONVERT:
8791 case ACTRES_FORTIFY:
8805static enum act_tgt_compl
8807 enum action_target_kind tgt_kind,
8808 enum action_sub_target_kind sub_tgt_kind)
8811 ACT_TGT_COMPL_SIMPLE);
8814 case ACTRES_ESTABLISH_EMBASSY:
8815 case ACTRES_SPY_INVESTIGATE_CITY:
8816 case ACTRES_SPY_POISON:
8817 case ACTRES_SPY_STEAL_GOLD:
8818 case ACTRES_SPY_SABOTAGE_CITY:
8819 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
8820 case ACTRES_SPY_STEAL_TECH:
8821 case ACTRES_SPY_INCITE_CITY:
8822 case ACTRES_TRADE_ROUTE:
8823 case ACTRES_MARKETPLACE:
8824 case ACTRES_HELP_WONDER:
8825 case ACTRES_JOIN_CITY:
8826 case ACTRES_STEAL_MAPS:
8827 case ACTRES_SPY_NUKE:
8828 case ACTRES_DESTROY_CITY:
8829 case ACTRES_DISBAND_UNIT_RECOVER:
8830 case ACTRES_HOME_CITY:
8831 case ACTRES_HOMELESS:
8832 case ACTRES_UPGRADE_UNIT:
8833 case ACTRES_AIRLIFT:
8834 case ACTRES_STRIKE_PRODUCTION:
8835 case ACTRES_CONQUER_CITY:
8836 case ACTRES_SPY_SPREAD_PLAGUE:
8837 return ACT_TGT_COMPL_SIMPLE;
8838 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
8839 case ACTRES_STRIKE_BUILDING:
8840 case ACTRES_SPY_TARGETED_STEAL_TECH:
8841 return ACT_TGT_COMPL_MANDATORY;
8842 case ACTRES_SPY_BRIBE_UNIT:
8843 case ACTRES_SPY_SABOTAGE_UNIT:
8844 case ACTRES_EXPEL_UNIT:
8845 case ACTRES_HEAL_UNIT:
8846 case ACTRES_TRANSPORT_ALIGHT:
8847 case ACTRES_TRANSPORT_UNLOAD:
8848 case ACTRES_TRANSPORT_BOARD:
8849 case ACTRES_TRANSPORT_EMBARK:
8850 return ACT_TGT_COMPL_SIMPLE;
8851 case ACTRES_CAPTURE_UNITS:
8852 case ACTRES_BOMBARD:
8853 case ACTRES_NUKE_UNITS:
8855 case ACTRES_SPY_ATTACK:
8856 return ACT_TGT_COMPL_SIMPLE;
8857 case ACTRES_FOUND_CITY:
8859 case ACTRES_PARADROP:
8860 case ACTRES_PARADROP_CONQUER:
8861 case ACTRES_TRANSFORM_TERRAIN:
8862 case ACTRES_CULTIVATE:
8864 case ACTRES_TRANSPORT_DISEMBARK:
8865 case ACTRES_HUT_ENTER:
8866 case ACTRES_HUT_FRIGHTEN:
8867 case ACTRES_UNIT_MOVE:
8868 return ACT_TGT_COMPL_SIMPLE;
8869 case ACTRES_PILLAGE:
8870 case ACTRES_CLEAN_POLLUTION:
8871 case ACTRES_CLEAN_FALLOUT:
8872 return ACT_TGT_COMPL_FLEXIBLE;
8876 case ACTRES_IRRIGATE:
8877 return ACT_TGT_COMPL_MANDATORY;
8878 case ACTRES_CONQUER_EXTRAS:
8879 return ACT_TGT_COMPL_SIMPLE;
8880 case ACTRES_DISBAND_UNIT:
8881 case ACTRES_CONVERT:
8882 case ACTRES_FORTIFY:
8883 return ACT_TGT_COMPL_SIMPLE;
8885 return ACT_TGT_COMPL_SIMPLE;
8889 return ACT_TGT_COMPL_SIMPLE;
8901 switch ((
enum gen_action)act) {
8902 case ACTION_SPY_POISON:
8903 case ACTION_SPY_POISON_ESC:
8904 case ACTION_SPY_SABOTAGE_UNIT:
8905 case ACTION_SPY_SABOTAGE_UNIT_ESC:
8906 case ACTION_SPY_BRIBE_UNIT:
8907 case ACTION_SPY_SABOTAGE_CITY:
8908 case ACTION_SPY_SABOTAGE_CITY_ESC:
8909 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
8910 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
8911 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
8912 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
8913 case ACTION_SPY_INCITE_CITY:
8914 case ACTION_SPY_INCITE_CITY_ESC:
8915 case ACTION_ESTABLISH_EMBASSY:
8916 case ACTION_ESTABLISH_EMBASSY_STAY:
8917 case ACTION_SPY_STEAL_TECH:
8918 case ACTION_SPY_STEAL_TECH_ESC:
8919 case ACTION_SPY_TARGETED_STEAL_TECH:
8920 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
8921 case ACTION_SPY_INVESTIGATE_CITY:
8922 case ACTION_INV_CITY_SPEND:
8923 case ACTION_SPY_STEAL_GOLD:
8924 case ACTION_SPY_STEAL_GOLD_ESC:
8925 case ACTION_STEAL_MAPS:
8926 case ACTION_STEAL_MAPS_ESC:
8927 case ACTION_TRADE_ROUTE:
8928 case ACTION_MARKETPLACE:
8929 case ACTION_HELP_WONDER:
8930 case ACTION_CAPTURE_UNITS:
8931 case ACTION_EXPEL_UNIT:
8932 case ACTION_JOIN_CITY:
8933 case ACTION_SPY_NUKE:
8934 case ACTION_SPY_NUKE_ESC:
8935 case ACTION_DESTROY_CITY:
8936 case ACTION_DISBAND_UNIT_RECOVER:
8937 case ACTION_DISBAND_UNIT:
8938 case ACTION_HOME_CITY:
8939 case ACTION_HOMELESS:
8940 case ACTION_UPGRADE_UNIT:
8941 case ACTION_PARADROP:
8942 case ACTION_PARADROP_CONQUER:
8943 case ACTION_PARADROP_FRIGHTEN:
8944 case ACTION_PARADROP_FRIGHTEN_CONQUER:
8945 case ACTION_PARADROP_ENTER:
8946 case ACTION_PARADROP_ENTER_CONQUER:
8947 case ACTION_AIRLIFT:
8949 case ACTION_SUICIDE_ATTACK:
8950 case ACTION_STRIKE_BUILDING:
8951 case ACTION_STRIKE_PRODUCTION:
8952 case ACTION_CONQUER_CITY:
8953 case ACTION_CONQUER_CITY2:
8954 case ACTION_CONQUER_CITY3:
8955 case ACTION_CONQUER_CITY4:
8956 case ACTION_HEAL_UNIT:
8957 case ACTION_HEAL_UNIT2:
8958 case ACTION_TRANSFORM_TERRAIN:
8959 case ACTION_CULTIVATE:
8961 case ACTION_PILLAGE:
8962 case ACTION_CLEAN_POLLUTION:
8963 case ACTION_CLEAN_FALLOUT:
8964 case ACTION_FORTIFY:
8966 case ACTION_CONVERT:
8969 case ACTION_IRRIGATE:
8970 case ACTION_TRANSPORT_ALIGHT:
8971 case ACTION_TRANSPORT_BOARD:
8972 case ACTION_TRANSPORT_EMBARK:
8973 case ACTION_TRANSPORT_EMBARK2:
8974 case ACTION_TRANSPORT_EMBARK3:
8975 case ACTION_TRANSPORT_UNLOAD:
8976 case ACTION_TRANSPORT_DISEMBARK1:
8977 case ACTION_TRANSPORT_DISEMBARK2:
8978 case ACTION_TRANSPORT_DISEMBARK3:
8979 case ACTION_TRANSPORT_DISEMBARK4:
8980 case ACTION_BOMBARD:
8981 case ACTION_BOMBARD2:
8982 case ACTION_BOMBARD3:
8983 case ACTION_SPY_ATTACK:
8984 case ACTION_CONQUER_EXTRAS:
8985 case ACTION_CONQUER_EXTRAS2:
8986 case ACTION_CONQUER_EXTRAS3:
8987 case ACTION_CONQUER_EXTRAS4:
8988 case ACTION_HUT_ENTER:
8989 case ACTION_HUT_ENTER2:
8990 case ACTION_HUT_ENTER3:
8991 case ACTION_HUT_ENTER4:
8992 case ACTION_HUT_FRIGHTEN:
8993 case ACTION_HUT_FRIGHTEN2:
8994 case ACTION_HUT_FRIGHTEN3:
8995 case ACTION_HUT_FRIGHTEN4:
8996 case ACTION_UNIT_MOVE:
8997 case ACTION_UNIT_MOVE2:
8998 case ACTION_UNIT_MOVE3:
9001 case ACTION_FOUND_CITY:
9002 return "found_city_consuming_always";
9004 return "explode_nuclear_consuming_always";
9005 case ACTION_NUKE_CITY:
9006 return "nuke_city_consuming_always";
9007 case ACTION_NUKE_UNITS:
9008 return "nuke_units_consuming_always";
9009 case ACTION_SPY_SPREAD_PLAGUE:
9010 return "spread_plague_actor_consuming_always";
9011 case ACTION_USER_ACTION1:
9012 return "user_action_1_actor_consuming_always";
9013 case ACTION_USER_ACTION2:
9014 return "user_action_2_actor_consuming_always";
9015 case ACTION_USER_ACTION3:
9016 return "user_action_3_actor_consuming_always";
9017 case ACTION_USER_ACTION4:
9018 return "user_action_4_actor_consuming_always";
9023 fc_assert(act >= 0 && act < ACTION_COUNT);
9039 case ACTION_MARKETPLACE:
9040 return "enter_marketplace_blocked_by";
9041 case ACTION_BOMBARD:
9042 return "bombard_blocked_by";
9043 case ACTION_BOMBARD2:
9044 return "bombard_2_blocked_by";
9045 case ACTION_BOMBARD3:
9046 return "bombard_3_blocked_by";
9048 return "explode_nuclear_blocked_by";
9049 case ACTION_NUKE_CITY:
9050 return "nuke_city_blocked_by";
9051 case ACTION_NUKE_UNITS:
9052 return "nuke_units_blocked_by";
9054 return "attack_blocked_by";
9055 case ACTION_SUICIDE_ATTACK:
9056 return "suicide_attack_blocked_by";
9057 case ACTION_CONQUER_CITY:
9058 return "conquer_city_blocked_by";
9059 case ACTION_CONQUER_CITY2:
9060 return "conquer_city_2_blocked_by";
9061 case ACTION_CONQUER_CITY3:
9062 return "conquer_city_3_blocked_by";
9063 case ACTION_CONQUER_CITY4:
9064 return "conquer_city_4_blocked_by";
9065 case ACTION_UNIT_MOVE:
9066 return "move_blocked_by";
9067 case ACTION_UNIT_MOVE2:
9068 return "move_2_blocked_by";
9069 case ACTION_UNIT_MOVE3:
9070 return "move_3_blocked_by";
9071 case ACTION_SPY_POISON:
9072 case ACTION_SPY_POISON_ESC:
9073 case ACTION_SPY_SABOTAGE_UNIT:
9074 case ACTION_SPY_SABOTAGE_UNIT_ESC:
9075 case ACTION_SPY_BRIBE_UNIT:
9076 case ACTION_SPY_SABOTAGE_CITY:
9077 case ACTION_SPY_SABOTAGE_CITY_ESC:
9078 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
9079 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
9080 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
9081 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
9082 case ACTION_SPY_INCITE_CITY:
9083 case ACTION_SPY_INCITE_CITY_ESC:
9084 case ACTION_ESTABLISH_EMBASSY:
9085 case ACTION_ESTABLISH_EMBASSY_STAY:
9086 case ACTION_SPY_STEAL_TECH:
9087 case ACTION_SPY_STEAL_TECH_ESC:
9088 case ACTION_SPY_TARGETED_STEAL_TECH:
9089 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
9090 case ACTION_SPY_INVESTIGATE_CITY:
9091 case ACTION_INV_CITY_SPEND:
9092 case ACTION_SPY_STEAL_GOLD:
9093 case ACTION_SPY_STEAL_GOLD_ESC:
9094 case ACTION_STEAL_MAPS:
9095 case ACTION_STEAL_MAPS_ESC:
9096 case ACTION_TRADE_ROUTE:
9097 case ACTION_HELP_WONDER:
9098 case ACTION_CAPTURE_UNITS:
9099 case ACTION_EXPEL_UNIT:
9100 case ACTION_FOUND_CITY:
9101 case ACTION_JOIN_CITY:
9102 case ACTION_SPY_NUKE:
9103 case ACTION_SPY_NUKE_ESC:
9104 case ACTION_DESTROY_CITY:
9105 case ACTION_DISBAND_UNIT_RECOVER:
9106 case ACTION_DISBAND_UNIT:
9107 case ACTION_HOME_CITY:
9108 case ACTION_HOMELESS:
9109 case ACTION_UPGRADE_UNIT:
9110 case ACTION_PARADROP:
9111 case ACTION_PARADROP_CONQUER:
9112 case ACTION_PARADROP_FRIGHTEN:
9113 case ACTION_PARADROP_FRIGHTEN_CONQUER:
9114 case ACTION_PARADROP_ENTER:
9115 case ACTION_PARADROP_ENTER_CONQUER:
9116 case ACTION_AIRLIFT:
9117 case ACTION_STRIKE_BUILDING:
9118 case ACTION_STRIKE_PRODUCTION:
9119 case ACTION_HEAL_UNIT:
9120 case ACTION_HEAL_UNIT2:
9121 case ACTION_TRANSFORM_TERRAIN:
9122 case ACTION_CULTIVATE:
9124 case ACTION_PILLAGE:
9125 case ACTION_CLEAN_POLLUTION:
9126 case ACTION_CLEAN_FALLOUT:
9127 case ACTION_FORTIFY:
9129 case ACTION_CONVERT:
9132 case ACTION_IRRIGATE:
9133 case ACTION_TRANSPORT_ALIGHT:
9134 case ACTION_TRANSPORT_BOARD:
9135 case ACTION_TRANSPORT_EMBARK:
9136 case ACTION_TRANSPORT_EMBARK2:
9137 case ACTION_TRANSPORT_EMBARK3:
9138 case ACTION_TRANSPORT_UNLOAD:
9139 case ACTION_TRANSPORT_DISEMBARK1:
9140 case ACTION_TRANSPORT_DISEMBARK2:
9141 case ACTION_TRANSPORT_DISEMBARK3:
9142 case ACTION_TRANSPORT_DISEMBARK4:
9143 case ACTION_SPY_SPREAD_PLAGUE:
9144 case ACTION_SPY_ATTACK:
9145 case ACTION_CONQUER_EXTRAS:
9146 case ACTION_CONQUER_EXTRAS2:
9147 case ACTION_CONQUER_EXTRAS3:
9148 case ACTION_CONQUER_EXTRAS4:
9149 case ACTION_HUT_ENTER:
9150 case ACTION_HUT_ENTER2:
9151 case ACTION_HUT_ENTER3:
9152 case ACTION_HUT_ENTER4:
9153 case ACTION_HUT_FRIGHTEN:
9154 case ACTION_HUT_FRIGHTEN2:
9155 case ACTION_HUT_FRIGHTEN3:
9156 case ACTION_HUT_FRIGHTEN4:
9157 case ACTION_USER_ACTION1:
9158 case ACTION_USER_ACTION2:
9159 case ACTION_USER_ACTION3:
9160 case ACTION_USER_ACTION4:
9187 case ACTION_SPY_BRIBE_UNIT:
9188 return "bribe_unit_post_success_forced_actions";
9190 return "attack_post_success_forced_actions";
9191 case ACTION_MARKETPLACE:
9192 case ACTION_BOMBARD:
9193 case ACTION_BOMBARD2:
9194 case ACTION_BOMBARD3:
9196 case ACTION_NUKE_CITY:
9197 case ACTION_NUKE_UNITS:
9198 case ACTION_SUICIDE_ATTACK:
9199 case ACTION_CONQUER_CITY:
9200 case ACTION_CONQUER_CITY2:
9201 case ACTION_CONQUER_CITY3:
9202 case ACTION_CONQUER_CITY4:
9203 case ACTION_SPY_POISON:
9204 case ACTION_SPY_POISON_ESC:
9205 case ACTION_SPY_SABOTAGE_UNIT:
9206 case ACTION_SPY_SABOTAGE_UNIT_ESC:
9207 case ACTION_SPY_SABOTAGE_CITY:
9208 case ACTION_SPY_SABOTAGE_CITY_ESC:
9209 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
9210 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION:
9211 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
9212 case ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC:
9213 case ACTION_SPY_INCITE_CITY:
9214 case ACTION_SPY_INCITE_CITY_ESC:
9215 case ACTION_ESTABLISH_EMBASSY:
9216 case ACTION_ESTABLISH_EMBASSY_STAY:
9217 case ACTION_SPY_STEAL_TECH:
9218 case ACTION_SPY_STEAL_TECH_ESC:
9219 case ACTION_SPY_TARGETED_STEAL_TECH:
9220 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
9221 case ACTION_SPY_INVESTIGATE_CITY:
9222 case ACTION_INV_CITY_SPEND:
9223 case ACTION_SPY_STEAL_GOLD:
9224 case ACTION_SPY_STEAL_GOLD_ESC:
9225 case ACTION_STEAL_MAPS:
9226 case ACTION_STEAL_MAPS_ESC:
9227 case ACTION_TRADE_ROUTE:
9228 case ACTION_HELP_WONDER:
9229 case ACTION_CAPTURE_UNITS:
9230 case ACTION_EXPEL_UNIT:
9231 case ACTION_FOUND_CITY:
9232 case ACTION_JOIN_CITY:
9233 case ACTION_SPY_NUKE:
9234 case ACTION_SPY_NUKE_ESC:
9235 case ACTION_DESTROY_CITY:
9236 case ACTION_DISBAND_UNIT_RECOVER:
9237 case ACTION_DISBAND_UNIT:
9238 case ACTION_HOME_CITY:
9239 case ACTION_HOMELESS:
9240 case ACTION_UPGRADE_UNIT:
9241 case ACTION_PARADROP:
9242 case ACTION_PARADROP_CONQUER:
9243 case ACTION_PARADROP_FRIGHTEN:
9244 case ACTION_PARADROP_FRIGHTEN_CONQUER:
9245 case ACTION_PARADROP_ENTER:
9246 case ACTION_PARADROP_ENTER_CONQUER:
9247 case ACTION_AIRLIFT:
9248 case ACTION_STRIKE_BUILDING:
9249 case ACTION_STRIKE_PRODUCTION:
9250 case ACTION_HEAL_UNIT:
9251 case ACTION_HEAL_UNIT2:
9252 case ACTION_TRANSFORM_TERRAIN:
9253 case ACTION_CULTIVATE:
9255 case ACTION_PILLAGE:
9256 case ACTION_CLEAN_POLLUTION:
9257 case ACTION_CLEAN_FALLOUT:
9258 case ACTION_FORTIFY:
9260 case ACTION_CONVERT:
9263 case ACTION_IRRIGATE:
9264 case ACTION_TRANSPORT_ALIGHT:
9265 case ACTION_TRANSPORT_BOARD:
9266 case ACTION_TRANSPORT_EMBARK:
9267 case ACTION_TRANSPORT_EMBARK2:
9268 case ACTION_TRANSPORT_EMBARK3:
9269 case ACTION_TRANSPORT_UNLOAD:
9270 case ACTION_TRANSPORT_DISEMBARK1:
9271 case ACTION_TRANSPORT_DISEMBARK2:
9272 case ACTION_TRANSPORT_DISEMBARK3:
9273 case ACTION_TRANSPORT_DISEMBARK4:
9274 case ACTION_SPY_SPREAD_PLAGUE:
9275 case ACTION_SPY_ATTACK:
9276 case ACTION_CONQUER_EXTRAS:
9277 case ACTION_CONQUER_EXTRAS2:
9278 case ACTION_CONQUER_EXTRAS3:
9279 case ACTION_CONQUER_EXTRAS4:
9280 case ACTION_HUT_ENTER:
9281 case ACTION_HUT_ENTER2:
9282 case ACTION_HUT_ENTER3:
9283 case ACTION_HUT_ENTER4:
9284 case ACTION_HUT_FRIGHTEN:
9285 case ACTION_HUT_FRIGHTEN2:
9286 case ACTION_HUT_FRIGHTEN3:
9287 case ACTION_HUT_FRIGHTEN4:
9288 case ACTION_UNIT_MOVE:
9289 case ACTION_UNIT_MOVE2:
9290 case ACTION_UNIT_MOVE3:
9291 case ACTION_USER_ACTION1:
9292 case ACTION_USER_ACTION2:
9293 case ACTION_USER_ACTION3:
9294 case ACTION_USER_ACTION4:
9320 if (!strcasecmp(
"Recycle Unit", old_name)) {
9321 return "Disband Unit Recover";
9330 N_(
"individual cities"),
9331 N_(
"individual units"),
9344 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,...)
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 act_prob action_prob_self(const struct unit *actor_unit, const action_id act_id)
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)
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,...)
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)
struct act_prob action_prob_unit_vs_tgt(const struct action *paction, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct extra_type *extra_tgt)
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)
struct act_prob action_prob_vs_tile(const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
static void ae_contra_close(struct ae_contra_or *contra)
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 act_prob action_prob_vs_units(const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile)
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)
struct act_prob action_speculate_unit_on_self(action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat)
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 action * action_is_blocked_by(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)
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_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)
struct act_prob action_speculate_unit_on_extras(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)
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 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)
struct act_prob action_speculate_unit_on_units(action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target)
bool action_univs_not_blocking(const struct action *paction, struct universal *actor_uni, struct universal *target_uni)
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)
struct act_prob action_speculate_unit_on_city(const action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, const bool omniscient_cheat, const struct city *target)
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_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)
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_prob_vs_extras(const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
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)
struct act_prob action_speculate_unit_on_unit(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)
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)
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)
struct act_prob action_speculate_unit_on_tile(action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target_tile, const struct extra_type *target_extra)
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