116 enum unit_activity new_activity);
118 enum unit_activity new_activity,
123 struct player *tgt_player,
128 const enum action_requester requester);
130 struct city *pcity,
const struct action *paction);
132 struct tile *ptile,
const char *
name,
133 const struct action *paction);
136 struct city *pcity_dest,
137 const struct action *paction);
141 struct city *pcity_dest,
142 const struct action *paction);
146 const struct action *paction);
148 const struct action *paction);
150 struct tile *def_tile,
151 const struct action *paction);
153 struct unit *act_unit,
154 struct city *tgt_city,
155 const struct action *paction);
158 const struct action *paction);
160 const struct action *paction);
162 struct unit *act_unit,
163 struct city *tgt_city,
164 const struct action *paction);
166 struct unit *act_unit,
167 struct city *tgt_city,
169 const struct action *paction);
171 struct unit *act_unit,
172 struct city *tgt_city,
175 const struct action *paction);
177 const struct action *paction,
181 const int *
list,
int n,
const struct tile *ptile);
190 int number_of_upgraded_units = 0;
194 if (NULL == from_unittype) {
196 log_verbose(
"handle_unit_type_upgrade() invalid unit type %d", uti);
203 _(
"Illegal packet, can't upgrade %s (yet)."),
219 paction->
id, ACT_REQ_SS_AGENT)) {
220 number_of_upgraded_units++;
229 if (number_of_upgraded_units > 0) {
236 PL_(
"%d %s upgraded to %s for %d gold.",
237 "%d %s upgraded to %s for %d gold.",
238 cost * number_of_upgraded_units),
239 number_of_upgraded_units,
242 cost * number_of_upgraded_units);
246 _(
"No units could be upgraded."));
258 enum action_requester ordered_by,
259 const struct action *paction)
269 if (ordered_by == ACT_REQ_PLAYER) {
271 PL_(
"%s upgraded to %s for %d gold.",
272 "%s upgraded to %s for %d gold.",
cost),
287 const int *
list,
int n,
const struct tile *ptile)
295 for (i = 0; i <
n; i++) {
317 struct tile *pdesttile,
318 const struct action *paction)
324 bv_unit_types unique_on_tile;
327 int n = 0, capt[unit_list_size(pdesttile->
units)];
328 bool lost_with_city =
FALSE;
342 bool unique_conflict =
FALSE;
348 unique_conflict =
TRUE;
359 unique_conflict =
TRUE;
367 if (unique_conflict) {
368 log_debug(
"capture units: already got unique unit");
371 _(
"You can only have one %s."),
378 capt[
n++] = to_capture->id;
392 for (i = 0; i <
n; i++) {
395 const char *victim_link;
397 struct tile *ptile = NULL;
398 bool really_lost =
FALSE;
404 if (uplayer == pplayer) {
409 really_lost = lost_with_city && !
utype_has_flag(utype, UTYF_NOHOME);
415 hcity, ULR_CAPTURED);
429 _(
"Your %s succeeded in capturing the %s %s."),
438 _(
"Your %s was captured by the %s."),
439 victim_link, capturer_nation);
443 pdesttile, victim_link);
451 _(
"%s lost along with control of %s."),
452 victim_link, hcity_name);
454 wipe_unit(to_capture, ULR_CAPTURED, NULL);
479 lost_with_city =
TRUE;
505 const struct action *paction)
549 _(
"The %s don't have a capital to expel their %s to."),
563 _(
"Your %s succeeded in expelling the %s %s."),
568 _(
"Your %s was expelled by the %s."),
573 log_error(
"Bug in unit expulsion: unit can't teleport.");
593 struct unit *act_unit,
594 struct tile *tgt_tile,
595 const struct action *paction)
619 tgt_player, tgt_tile,
633 struct unit *act_unit,
634 struct unit *tgt_unit,
635 const struct action *paction)
639 struct player *tgt_player;
640 struct tile *tgt_tile;
643 const char *tgt_unit_owner;
685 tgt_unit->
hp =
MIN(tgt_unit->
hp + healing_limit, tgt_hp_max);
696 if (act_player == tgt_player) {
699 tgt_unit_owner =
_(
"your");
707 _(
"Your %s heals %s %s."),
708 act_unit_link, tgt_unit_owner, tgt_unit_link);
710 if (act_player != tgt_player) {
713 _(
"%s %s heals your %s."),
715 act_unit_link, tgt_unit_link);
732 struct unit *act_unit,
733 struct unit *tgt_unit,
734 const struct action *paction)
751 struct unit *act_unit,
752 struct unit *tgt_unit,
753 const struct action *paction)
772 struct unit *act_unit,
773 struct unit *tgt_unit,
774 const struct action *paction)
789 struct unit *act_unit,
790 struct tile *tgt_tile,
791 const struct action *paction)
817 struct unit *act_unit,
818 struct tile *tgt_tile,
819 const struct action *paction)
847 struct unit *act_unit,
848 struct unit *tgt_unit,
849 const struct action *paction)
851 struct tile *tgt_tile;
870 ACT_SUB_RES_MAY_EMBARK),
884 const struct action *paction)
899 const struct player *oplayer)
901 enum diplstate_type ds;
912 && ds != DS_TEAM && pplayer != oplayer;
923 const struct action *paction,
926 bool act_if_diplrel_kind(
const struct unit_type *,
931 if (player2 == NULL) {
941 if (act_if_diplrel_kind(actor_utype, paction->
id,
949 if (!act_if_diplrel_kind(actor_utype, paction->
id, DS_WAR,
TRUE)) {
969 struct player *target_player = NULL;
987 switch (paction->
result) {
1001 case ACTRES_PARADROP:
1002 case ACTRES_PARADROP_CONQUER:
1016 case ACTRES_CONQUER_EXTRAS:
1017 case ACTRES_ESTABLISH_EMBASSY:
1018 case ACTRES_SPY_INVESTIGATE_CITY:
1019 case ACTRES_SPY_POISON:
1020 case ACTRES_SPY_SPREAD_PLAGUE:
1021 case ACTRES_SPY_STEAL_GOLD:
1022 case ACTRES_SPY_SABOTAGE_CITY:
1023 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
1024 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
1025 case ACTRES_SPY_STEAL_TECH:
1026 case ACTRES_SPY_TARGETED_STEAL_TECH:
1027 case ACTRES_SPY_INCITE_CITY:
1028 case ACTRES_TRADE_ROUTE:
1029 case ACTRES_MARKETPLACE:
1030 case ACTRES_HELP_WONDER:
1031 case ACTRES_SPY_BRIBE_UNIT:
1032 case ACTRES_SPY_SABOTAGE_UNIT:
1033 case ACTRES_CAPTURE_UNITS:
1034 case ACTRES_FOUND_CITY:
1035 case ACTRES_JOIN_CITY:
1036 case ACTRES_STEAL_MAPS:
1037 case ACTRES_SPY_NUKE:
1039 case ACTRES_NUKE_UNITS:
1040 case ACTRES_DESTROY_CITY:
1041 case ACTRES_EXPEL_UNIT:
1042 case ACTRES_DISBAND_UNIT_RECOVER:
1043 case ACTRES_DISBAND_UNIT:
1044 case ACTRES_HOME_CITY:
1045 case ACTRES_HOMELESS:
1046 case ACTRES_UPGRADE_UNIT:
1047 case ACTRES_AIRLIFT:
1048 case ACTRES_HEAL_UNIT:
1049 case ACTRES_STRIKE_BUILDING:
1050 case ACTRES_STRIKE_PRODUCTION:
1051 case ACTRES_BOMBARD:
1052 case ACTRES_CONQUER_CITY:
1053 case ACTRES_TRANSFORM_TERRAIN:
1054 case ACTRES_CULTIVATE:
1056 case ACTRES_PILLAGE:
1057 case ACTRES_CLEAN_POLLUTION:
1058 case ACTRES_CLEAN_FALLOUT:
1059 case ACTRES_FORTIFY:
1060 case ACTRES_CONVERT:
1064 case ACTRES_IRRIGATE:
1065 case ACTRES_TRANSPORT_ALIGHT:
1066 case ACTRES_TRANSPORT_UNLOAD:
1067 case ACTRES_TRANSPORT_DISEMBARK:
1068 case ACTRES_TRANSPORT_BOARD:
1069 case ACTRES_TRANSPORT_EMBARK:
1070 case ACTRES_SPY_ATTACK:
1071 case ACTRES_HUT_ENTER:
1072 case ACTRES_HUT_FRIGHTEN:
1073 case ACTRES_UNIT_MOVE:
1133 if (target_player == NULL) {
1148 actor_player, target_player,
1150 return target_player;
1176 struct player *war_player;
1182 if (war_player != NULL) {
1204 const struct player *pplayer)
1247 (is_target ? &enabler->target_reqs : &enabler->actor_reqs))
1249 &enabler->actor_reqs)) {
1289 (is_target ? &enabler->target_reqs
1290 : &enabler->actor_reqs))
1292 &enabler->actor_reqs)) {
1311 struct player *must_war_player;
1312 const struct action *paction;
1316 struct player *tgt_player = NULL;
1399 tgt_player = act_player;
1410 switch (paction->
result) {
1411 case ACTRES_UPGRADE_UNIT:
1414 case ACTRES_AIRLIFT:
1417 case ACTRES_NUKE_UNITS:
1425 case ACTRES_CONQUER_CITY:
1433 action_custom =
MR_OK;
1436 case ACTRES_TRANSPORT_EMBARK:
1444 action_custom =
MR_OK;
1447 case ACTRES_TRANSPORT_DISEMBARK:
1448 case ACTRES_HUT_ENTER:
1449 case ACTRES_HUT_FRIGHTEN:
1450 case ACTRES_CONQUER_EXTRAS:
1451 case ACTRES_UNIT_MOVE:
1459 action_custom =
MR_OK;
1478 }
else if ((!can_exist
1480 USP_LIVABLE_TILE,
FALSE))
1483 USP_LIVABLE_TILE,
TRUE))) {
1486 }
else if ((!on_native
1488 USP_NATIVE_TILE,
FALSE))
1491 USP_NATIVE_TILE,
TRUE))) {
1524 USP_TRANSPORTED,
TRUE)) {
1528 USP_TRANSPORTED,
FALSE)) {
1532 USP_TRANSPORTING,
TRUE)) {
1536 USP_TRANSPORTING,
FALSE)) {
1540 USP_HAS_HOME_CITY,
TRUE)) {
1544 USP_HAS_HOME_CITY,
FALSE)) {
1550 }
else if (act_player && tgt_player
1572 }
else if (tgt_player != NULL
1573 && act_player != tgt_player
1579 }
else if (tgt_player != NULL
1580 && act_player == tgt_player
1586 }
else if (
punit != NULL
1591 }
else if (tgt_player
1620 }
else if (paction &&
punit
1641 }
else if (paction &&
punit
1674 && action_custom !=
ATT_OK) {
1675 switch (action_custom) {
1717 ACTRES_TRANSPORT_EMBARK)
1719 ACTRES_TRANSPORT_DISEMBARK))
1720 && action_custom !=
MR_OK) {
1721 switch (action_custom) {
1753 act_player, act_utype));
1801 switch (explnat->
kind) {
1806 "Asked to explain why a non actor can't act.");
1809 _(
"Unit cannot do anything."));
1813 _(
"Your %s found no suitable target."),
1823 _(
"Your %s found no suitable target."),
1837 USP_LIVABLE_TILE,
FALSE)) {
1851 _(
"Your %s cannot act from %s. "
1852 "Only %s can act from a non livable tile."),
1861 _(
"Unit cannot act from %s."),
1869 _(
"Unit cannot act against %s."),
1874 _(
"This unit is being transported, and"
1875 " so cannot act."));
1879 _(
"This unit cannot act when it isn't being "
1884 _(
"This unit is transporting, and"
1885 " so cannot act."));
1889 _(
"This unit cannot act when it isn't transporting."));
1893 _(
"This unit has a home city, and so cannot act."));
1897 _(
"This unit cannot act unless it has a home city."));
1901 _(
"You must declare war on %s first. Try using "
1902 "the Nations report"
1911 _(
"You must break peace with %s first. Try using "
1912 "the Nations report to declare war"
1921 _(
"This unit cannot act against domestic targets."));
1925 _(
"This unit cannot act against foreign targets."));
1930 _(
"%s cannot act against tiles with non allied units."),
1936 _(
"%s %s cannot act."),
1943 _(
"This unit cannot act against %s targets."),
1948 _(
"This unit has too few moves left to act."));
1952 _(
"This unit cannot act against city centers."));
1956 _(
"This unit cannot act against non city centers."));
1960 _(
"This unit cannot act against claimed tiles."));
1964 _(
"This unit cannot act against unclaimed tiles."));
1968 _(
"This unit is too near its target to act."));
1972 _(
"This unit is too far away from its target to act."));
1976 _(
"Can't perform any action this scenario permits."));
1980 _(
"Can't perform any action this close to a city."));
1985 _(
"%s can't do anything to %s. It is too big."),
1992 _(
"%s needs an improvement to grow, so "
1993 "%s cannot do anything to it."),
2000 _(
"%s don't have enough capacity, so "
2001 "%s cannot do anything."),
2008 _(
"%s can't do anything to an unknown target tile."),
2018 "Treasury contains %d gold.",
2025 PL_(
"%s can't do anything. %d gold may help. %s",
2026 "%s can't do anything. %d gold may help. %s",
2034 _(
"%s cannot move that far from the coast line."),
2039 _(
"%s cannot disembark outside of a city or a native base "
2047 _(
"%s can't do anything since there is an unreachable "
2053 _(
"%s can't do anything since you already have a %s."),
2064 _(
"No action possible."));
2082 struct player *actor_player;
2089 int actor_target_distance;
2097 bool at_least_one_action =
FALSE;
2149 _(
"Target not at target tile."));
2187 if (plrtile && plrtile->
site) {
2196 actor_target_distance)) {
2255 if (actor_target_distance == 0) {
2277 at_least_one_action =
TRUE;
2317 "Invalid action target kind.");
2332 target_unit_id, target_unit_id,
2333 target_city_id, target_city_id,
2353 const enum event_type
event,
2366 switch (explnat->
kind) {
2377 _(
"Only %s can do %s."),
2385 _(
"%s can't do %s."),
2395 _(
"Your %s found no target suitable for %s."),
2403 _(
"Having your %s do %s to this target is redundant."),
2413 stopped_action, USP_LIVABLE_TILE,
2418 USP_LIVABLE_TILE,
FALSE)) {
2432 _(
"Your %s can't do %s from %s. "
2433 "Only %s can do %s from a non livable tile."),
2446 _(
"Your %s can't do %s from %s."),
2458 _(
"Your %s can't do %s to %s."),
2468 _(
"Your %s can't do %s while being transported."),
2477 _(
"Your %s can't do %s while not being transported."),
2486 _(
"Your %s can't do %s while transporting."),
2495 _(
"Your %s can't do %s while not transporting."),
2504 _(
"Your %s can't do %s because it has a home city."),
2513 _(
"Your %s can't do %s because it is homeless."),
2523 _(
"Your %s can't do %s while you"
2524 " aren't at war with %s."),
2536 _(
"Your %s can't do %s while you "
2537 "are at peace with %s. Try using "
2538 "the Nations report to declare war"
2553 _(
"Your %s can't do %s to domestic %s."),
2556 action_target_kind_translated_name(
2565 _(
"Your %s can't do %s to foreign %s."),
2568 action_target_kind_translated_name(
2575 _(
"Your %s can't do %s to tiles with non allied units."),
2584 _(
"%s %s can't do %s."),
2594 _(
"Your %s can't do %s to %s %s."),
2598 action_target_kind_translated_name(
2606 _(
"Your %s has too few moves left to do %s."),
2615 _(
"Your %s can't do %s to city centers."),
2625 _(
"Your %s can only do %s to city centers."),
2634 _(
"Your %s can't do %s to claimed tiles."),
2644 _(
"Your %s can't do %s to unclaimed tiles."),
2654 PL_(
"Your %s must be at least %d tile away to do %s.",
2655 "Your %s must be at least %d tiles away to do %s.",
2667 PL_(
"Your %s can't be more than %d tile away to do %s.",
2668 "Your %s can't be more than %d tiles away to do %s.",
2678 _(
"Can't do %s in this scenario."),
2685 _(
"Can't do %s this close to a city."),
2692 _(
"%s can't do %s to %s. It is too big."),
2701 _(
"%s needs an improvement to grow, so "
2702 "%s cannot do %s."),
2711 _(
"%s has no capacity to %s %s."),
2720 _(
"%s can't do %s to an unknown tile."),
2731 "Treasury contains %d gold.",
2739 PL_(
"%s can't do %s for %d gold. %s",
2740 "%s can't do %s for %d gold. %s",
2750 _(
"%s cannot move that far from the coast line."),
2757 _(
"%s cannot disembark outside of a city or a native base "
2767 _(
"Your %s can't do %s there since there's an "
2768 "unreachable unit."),
2775 _(
"You already have a %s."),
2785 _(
"Your %s can't do %s when %s is legal."),
2789 free(stop_act_name);
2797 _(
"Your %s was unable to do %s."),
2820 bool information_revealed,
2821 struct unit *act_unit,
2822 struct action *stopped_action,
2823 struct player *tgt_player,
2824 struct tile *tgt_tile,
2825 const enum action_requester requester)
2834 .action = stopped_action,
2841 || requester == ACT_REQ_SS_AGENT),
2843 "The player wasn't responsible for this.");
2845 if (!information_revealed) {
2855 EFT_ILLEGAL_ACTION_HP_COST);
2858 punishment_hp =
MAX(0, punishment_hp);
2861 act_unit->
hp =
MAX(0, act_unit->
hp - punishment_hp);
2863 if (punishment_hp != 0) {
2873 if (act_unit->
hp > 0) {
2881 _(
"Your %s lost %d hit points while attempting to"
2894 _(
"Your %s was killed while attempting to do %s."),
2907 EFT_ILLEGAL_ACTION_MOVE_COST);
2910 punishment_mp =
MAX(0, punishment_mp);
2916 if (punishment_mp != 0) {
2923 _(
"Your %s lost %s MP for attempting an illegal action."),
2928 return punishment_mp != 0 || punishment_hp != 0;
2939 struct player *tgt_player,
2944 const enum action_requester requester)
2946 bool information_revealed;
2966 ? E_UNIT_ILLEGAL_ACTION : E_BAD_COMMAND),
2967 actor, stopped_action_id,
2972 actor, stopped_action,
2982 (information_revealed
2983 ? E_UNIT_ILLEGAL_ACTION : E_BAD_COMMAND),
ftc_server,
2984 _(
"No explanation why you couldn't do %s. This is a bug."
2985 " Sorry about that. -- Sveinung"),
2995 const int target_id,
3016 const int target_id,
3021 struct unit *pactor;
3028 actor_id32 = actor_id16;
3033 if (NULL == paction) {
3035 log_error(
"handle_unit_action_query() the action %d doesn't exist.",
3042 if (NULL == pactor) {
3044 log_verbose(
"handle_unit_action_query() invalid actor %d",
3050 switch (paction->
result) {
3051 case ACTRES_SPY_BRIBE_UNIT:
3056 actor_id32, actor_id16, target_id,
3058 action_type, request_kind);
3062 NULL, NULL,
punit, request_kind, ACT_REQ_PLAYER);
3067 case ACTRES_SPY_INCITE_CITY:
3072 actor_id32, actor_id16, target_id,
3074 action_type, request_kind);
3078 NULL, pcity, NULL, request_kind, ACT_REQ_PLAYER);
3083 case ACTRES_UPGRADE_UNIT:
3097 actor_id32, actor_id16, target_id,
3098 upgr_cost, action_type,
3103 NULL, pcity, NULL, request_kind, ACT_REQ_PLAYER);
3108 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3109 case ACTRES_STRIKE_BUILDING:
3118 NULL, pcity, NULL, request_kind, ACT_REQ_PLAYER);
3155 const int target_id,
3156 const int sub_tgt_id,
3161 sub_tgt_id,
name, action_type, ACT_REQ_PLAYER);
3175 const int target_id,
3176 const int sub_tgt_id_incoming,
3179 const enum action_requester requester)
3188 struct city *pcity = NULL;
3193 log_error(
"unit_perform_action() the action %d doesn't exist.",
3203 log_verbose(
"unit_perform_action() invalid actor %d",
3211 if (pcity == NULL) {
3212 log_verbose(
"unit_perform_action() invalid target city %d",
3221 if (
punit == NULL) {
3222 log_verbose(
"unit_perform_action() invalid target unit %d",
3235 log_verbose(
"unit_perform_action() invalid target tile %d",
3256 sub_tgt_id = sub_tgt_id_incoming;
3275 if (sub_tgt_impr == NULL) {
3284 case ASTK_EXTRA_NOT_THERE:
3299 log_verbose(
"unit_perform_action() action %d requires action "
3300 "but extra id %d is invalid.",
3301 action_type, sub_tgt_id);
3311#define ACTION_PERFORM_UNIT_CITY(action, actor, target, action_performer) \
3313 && is_action_enabled_unit_on_city(nmap, action_type, \
3314 actor_unit, pcity)) { \
3316 script_server_signal_emit("action_started_unit_city", \
3317 action_by_number(action), actor, target); \
3318 if (!actor || !unit_is_alive(actor_id)) { \
3322 if (!target || !city_exist(target_id)) { \
3326 success = action_performer; \
3328 action_success_actor_price(paction, actor_id, actor); \
3330 script_server_signal_emit("action_finished_unit_city", \
3331 action_by_number(action), success, \
3332 unit_is_alive(actor_id) ? actor : NULL, \
3333 city_exist(target_id) ? target : NULL); \
3336 illegal_action(pplayer, actor_unit, action_type, \
3337 pcity ? city_owner(pcity) : NULL, NULL, pcity, NULL, \
3341#define ACTION_PERFORM_UNIT_SELF(action, actor, action_performer) \
3343 && is_action_enabled_unit_on_self(nmap, action_type, actor_unit)) { \
3345 script_server_signal_emit("action_started_unit_self", \
3346 action_by_number(action), actor); \
3347 if (!actor || !unit_is_alive(actor_id)) { \
3351 success = action_performer; \
3353 action_success_actor_price(paction, actor_id, actor); \
3355 script_server_signal_emit("action_finished_unit_self", \
3356 action_by_number(action), success, \
3357 unit_is_alive(actor_id) ? actor : NULL); \
3360 illegal_action(pplayer, actor_unit, action_type, \
3361 unit_owner(actor_unit), NULL, NULL, actor_unit, \
3365#define ACTION_PERFORM_UNIT_UNIT(action, actor, target, action_performer) \
3367 && is_action_enabled_unit_on_unit(nmap, action_type, actor_unit, punit)) { \
3369 script_server_signal_emit("action_started_unit_unit", \
3370 action_by_number(action), actor, target); \
3371 if (!actor || !unit_is_alive(actor_id)) { \
3375 if (!target || !unit_is_alive(target_id)) { \
3379 success = action_performer; \
3381 action_success_actor_price(paction, actor_id, actor); \
3382 action_success_target_pay_mp(paction, target_id, punit); \
3384 script_server_signal_emit("action_finished_unit_unit", \
3385 action_by_number(action), success, \
3386 unit_is_alive(actor_id) ? actor : NULL, \
3387 unit_is_alive(target_id) ? target : NULL); \
3390 illegal_action(pplayer, actor_unit, action_type, \
3391 punit ? unit_owner(punit) : NULL, NULL, NULL, punit, \
3395#define ACTION_PERFORM_UNIT_UNITS(action, actor, target, action_performer)\
3397 && is_action_enabled_unit_on_units(nmap, action_type, \
3398 actor_unit, target_tile)) { \
3400 script_server_signal_emit("action_started_unit_units", \
3401 action_by_number(action), actor, target); \
3402 if (!actor || !unit_is_alive(actor_id)) { \
3406 success = action_performer; \
3408 action_success_actor_price(paction, actor_id, actor); \
3410 script_server_signal_emit("action_finished_unit_units", \
3411 action_by_number(action), success, \
3412 unit_is_alive(actor_id) ? actor : NULL, \
3416 illegal_action(pplayer, actor_unit, action_type, \
3417 NULL, target_tile, NULL, NULL, \
3421#define ACTION_PERFORM_UNIT_TILE(action, actor, target, action_performer) \
3423 && is_action_enabled_unit_on_tile(nmap, action_type, \
3424 actor_unit, target_tile, \
3427 script_server_signal_emit("action_started_unit_tile", \
3428 action_by_number(action), actor, target); \
3429 if (!actor || !unit_is_alive(actor_id)) { \
3433 success = action_performer; \
3435 action_success_actor_price(paction, actor_id, actor); \
3437 script_server_signal_emit("action_finished_unit_tile", \
3438 action_by_number(action), success, \
3439 unit_is_alive(actor_id) ? actor : NULL, \
3443 illegal_action(pplayer, actor_unit, action_type, \
3444 target_tile ? tile_owner(target_tile) : NULL, \
3445 target_tile, NULL, NULL, \
3449#define ACTION_PERFORM_UNIT_EXTRAS(action, actor, target, action_performer)\
3451 && is_action_enabled_unit_on_extras(nmap, action_type, \
3452 actor_unit, target_tile, \
3455 script_server_signal_emit("action_started_unit_extras", \
3456 action_by_number(action), actor, target); \
3457 if (!actor || !unit_is_alive(actor_id)) { \
3461 success = action_performer; \
3463 action_success_actor_price(paction, actor_id, actor); \
3465 script_server_signal_emit("action_finished_unit_extras", \
3466 action_by_number(action), success, \
3467 unit_is_alive(actor_id) ? actor : NULL, \
3471 illegal_action(pplayer, actor_unit, action_type, \
3472 target_tile ? target_tile->extras_owner : NULL, \
3473 target_tile, NULL, NULL, \
3477#define ACTION_PERFORM_UNIT_ANY(paction, actor, \
3478 target_city, target_unit, target_tile, \
3480 switch (action_get_target_kind(paction)) { \
3482 ACTION_PERFORM_UNIT_CITY(paction->id, actor, target_city, \
3483 action_performer); \
3486 ACTION_PERFORM_UNIT_UNIT(paction->id, actor, target_unit, \
3487 action_performer); \
3490 ACTION_PERFORM_UNIT_UNITS(paction->id, actor, target_tile, \
3491 action_performer); \
3494 ACTION_PERFORM_UNIT_TILE(paction->id, actor, target_tile, \
3495 action_performer); \
3498 ACTION_PERFORM_UNIT_EXTRAS(paction->id, actor, target_tile, \
3499 action_performer); \
3502 ACTION_PERFORM_UNIT_SELF(paction->id, actor, TRUE); \
3505 fc_assert(action_get_target_kind(paction) != ATK_COUNT); \
3509 switch (paction->
result) {
3510 case ACTRES_SPY_BRIBE_UNIT:
3515 case ACTRES_SPY_SABOTAGE_UNIT:
3521 case ACTRES_EXPEL_UNIT:
3526 case ACTRES_HEAL_UNIT:
3531 case ACTRES_TRANSPORT_ALIGHT:
3536 case ACTRES_TRANSPORT_UNLOAD:
3541 case ACTRES_TRANSPORT_BOARD:
3546 case ACTRES_TRANSPORT_EMBARK:
3551 case ACTRES_DISBAND_UNIT:
3555 case ACTRES_FORTIFY:
3559 case ACTRES_CONVERT:
3563 case ACTRES_HOMELESS:
3567 case ACTRES_SPY_SABOTAGE_CITY:
3573 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3580 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
3586 case ACTRES_SPY_POISON:
3592 case ACTRES_SPY_SPREAD_PLAGUE:
3597 case ACTRES_SPY_INVESTIGATE_CITY:
3604 case ACTRES_ESTABLISH_EMBASSY:
3610 case ACTRES_SPY_INCITE_CITY:
3616 case ACTRES_SPY_STEAL_TECH:
3622 case ACTRES_SPY_TARGETED_STEAL_TECH:
3626 sub_tgt_id, paction));
3628 case ACTRES_SPY_STEAL_GOLD:
3634 case ACTRES_STEAL_MAPS:
3640 case ACTRES_TRADE_ROUTE:
3645 case ACTRES_MARKETPLACE:
3650 case ACTRES_HELP_WONDER:
3656 case ACTRES_SPY_NUKE:
3662 case ACTRES_JOIN_CITY:
3667 case ACTRES_DESTROY_CITY:
3673 case ACTRES_DISBAND_UNIT_RECOVER:
3678 case ACTRES_HOME_CITY:
3683 case ACTRES_UPGRADE_UNIT:
3686 pcity, requester, paction));
3688 case ACTRES_CONQUER_CITY:
3694 case ACTRES_STRIKE_BUILDING:
3702 case ACTRES_STRIKE_PRODUCTION:
3709 case ACTRES_CONQUER_EXTRAS:
3714 case ACTRES_AIRLIFT:
3718 case ACTRES_CAPTURE_UNITS:
3723 case ACTRES_BOMBARD:
3734 case ACTRES_NUKE_UNITS:
3739 case ACTRES_SPY_ATTACK:
3744 case ACTRES_FOUND_CITY:
3755 case ACTRES_PARADROP:
3756 case ACTRES_PARADROP_CONQUER:
3760 case ACTRES_TRANSPORT_DISEMBARK:
3766 case ACTRES_HUT_ENTER:
3771 case ACTRES_HUT_FRIGHTEN:
3776 case ACTRES_UNIT_MOVE:
3781 case ACTRES_TRANSFORM_TERRAIN:
3785 case ACTRES_CULTIVATE:
3793 case ACTRES_PILLAGE:
3799 case ACTRES_CLEAN_POLLUTION:
3805 case ACTRES_CLEAN_FALLOUT:
3829 case ACTRES_IRRIGATE:
3858 struct player *new_owner = (new_pcity == NULL ? old_owner
3871 if (old_owner != new_owner) {
3913 if (new_pcity != NULL) {
3935 if (new_pcity != NULL) {
3957 const struct action *paction)
3959 const char *
giver = NULL;
3973 _(
"%s transferred control over a %s to you in %s."),
3990 struct city *pcity,
const struct action *paction)
4014 _(
"%s added to aid %s in growing."),
4022 _(
"%s adds %s to your city %s."),
4037 (lua_Integer)amount,
"unit_added");
4052 struct tile *ptile,
const char *
name,
4053 const struct action *paction)
4057 struct player *nationality;
4101 enum unit_activity activity,
4106 if (NULL ==
punit) {
4108 log_verbose(
"handle_unit_change_activity() invalid unit %d", unit_id);
4136 if (
activity == ACTIVITY_EXPLORE) {
4149 int unit_id16,
int unit_id32,
4157 unit_id = unit_id16;
4159 unit_id = unit_id32;
4163 activity_target = NULL;
4170 if (activity_target == NULL) {
4172 bool required =
TRUE;
4174 if (
punit == NULL) {
4178 if (
activity == ACTIVITY_IRRIGATE) {
4183 }
else if (activity == ACTIVITY_MINE) {
4188 }
else if (activity == ACTIVITY_BASE) {
4193 if (pbase != NULL) {
4197 }
else if (activity == ACTIVITY_POLLUTION) {
4200 }
else if (activity == ACTIVITY_FALLOUT) {
4207 if (activity_target == NULL && required) {
4244 struct player *pplayer = pconn->playing;
4246 if (pplayer != NULL) {
4268 }
else if (pconn->observer) {
4280 int att_veteran,
int def_veteran,
int bombard)
4317 if (NULL == pconn->playing && pconn->observer) {
4331 const struct action *paction)
4344 log_debug(
"Start bombard: %s %s to %d, %d.",
4351 enum direction8 facing;
4369 _(
"Your %s bombards the %s %s."),
4377 _(
"Your %s is bombarded by the %s %s."),
4385 pdefender->hp = def_hp;
4430 struct tile *def_tile,
const struct action *paction)
4442 log_debug(
"Start nuclear attack: %s %s against (%d, %d).",
4450 _(
"Your %s was shot down by "
4453 _(
"The nuclear attack on %s was avoided by"
4454 " your SDI defense."),
city_link(pcity));
4500 struct unit *act_unit,
4501 struct city *tgt_city,
4502 const struct action *paction)
4505 struct player *tgt_player;
4507 bool try_civil_war =
FALSE;
4525 tgt_city_id = tgt_city->
id;
4541 try_civil_war =
TRUE;
4547 _(
"You destroy %s completely."),
4550 if (tgt_player != act_player) {
4554 _(
"%s has been destroyed by %s."),
4573 if (try_civil_war) {
4592 const struct action *paction)
4598 struct unit *ploser, *pwinner;
4600 int moves_used, def_moves_used;
4601 int old_unit_vet, old_defender_vet, vet;
4605 enum direction8 facing;
4606 int att_hp, def_hp, att_fp, def_fp;
4607 int att_hp_start, def_hp_start;
4608 int def_power, att_power;
4609 int att_vet, def_vet;
4610 struct unit *pdefender;
4621 def_hp_start = pdefender->
hp;
4626 log_debug(
"Start attack: %s %s against %s %s.",
4636 "Trying to attack a unit with which you have peace "
4637 "or cease-fire at (%d, %d).",
TILE_XY(def_tile));
4640 "Trying to attack a unit with which you have "
4641 "alliance at (%d, %d).",
TILE_XY(def_tile));
4656 old_defender_vet = pdefender->
veteran;
4670 &att_vet, &def_vet);
4681 pdefender->
hp = def_hp;
4710 if (pdefender->
hp <= 0
4719 if (
punit->
hp > 0 && pdefender->
hp > 0) {
4722 pdefender->
veteran - old_defender_vet, 0);
4726 winner_id = pwinner->
id;
4727 ploser = (pdefender->
hp > 0) ?
punit : pdefender;
4730 old_defender_vet)) ? 0 : 1;
4733 pdefender->
veteran - old_defender_vet, 0);
4741 if (
punit == ploser) {
4743 log_debug(
"Attacker lost: %s %s against %s %s.",
4754 _(
"Your %s %s [id:%d %sD:%.1f lost %d HP, %d HP remaining]"
4755 " survived the pathetic %sattack from the %s %s %s "
4756 "[id:%d %sA:%.1f HP:%d]."),
4762 def_hp_start - pdefender->
hp,
4782 _(
"Your attacking %s %s [id:%d %sA:%.1f HP:%d] failed "
4783 "against the %s %s %s [id:%d lost %d HP, %d HP "
4795 def_hp_start - pdefender->
hp,
4803 log_debug(
"Defender lost: %s %s against %s %s.",
4815 _(
"Your %s %s [id:%d %sD:%.1f HP:%d] lost to an attack by "
4816 "the %s %s %s [id:%d %sA:%.1f lost %d HP, has %d HP "
4830 att_hp_start - pwinner->
hp,
4839 _(
"Your attacking %s %s [id:%d %s%sA:%.1f lost %d HP, "
4840 "has %d remaining] succeeded against the %s %s %s "
4848 att_hp_start - pwinner->
hp,
4886 NULL, NULL, paction,
4923 struct unit *act_unit,
4924 struct city *tgt_city,
4925 const struct action *paction)
4927 struct player *tgt_player;
4944 tgt_city, tgt_player,
4950 _(
"Your %s failed to do %s in %s."),
4974 _(
"Your %s succeeded in destroying"
4975 " the production of %s in %s."),
4980 _(
"The production of %s was destroyed in %s,"
4981 " %s are suspected."),
4999 struct unit *act_unit,
5000 struct city *tgt_city,
5002 const struct action *paction)
5004 struct player *tgt_player;
5021 tgt_city, tgt_player,
5027 _(
"Your %s failed to do %s in %s."),
5045 _(
"Your %s didn't find a %s to %s in %s."),
5068 _(
"Your %s destroyed the %s in %s."),
5074 _(
"The %s destroyed the %s in %s."),
5092 struct unit *act_unit,
5093 struct city *tgt_city,
5099 int tgt_city_id = tgt_city->
id;
5101 const char *victim_link =
city_link(tgt_city);
5118 tgt_player, tgt_tile,
5129 struct tile *dest_tile,
5131 struct unit *embark_to,
5132 bool enter_enemy_city)
5137 src_tile, dest_tile, igzoc,
TRUE, embark_to,
5146 _(
"Cannot attack unless you declare war first."));
5151 _(
"%s can only move into your own zone of control."),
5157 _(
"%s cannot move that far from the coast line."),
5164 _(
"Cannot invade unless you break peace with "
5172 _(
"%s cannot disembark outside of a city or a native base "
5181 _(
"Terrain is unsuitable for %s units."),
5202 const struct action *paction)
5238 bool move_do_not_act)
5241 struct unit *ptrans;
5276 if (!move_do_not_act) {
5280 bool one_action_may_be_legal
5288 if (one_action_may_be_legal || can_not_move) {
5317 punit, pdesttile, NULL)) {
5322 punit, pdesttile, NULL)) {
5327 punit, pdesttile, NULL)) {
5345 NO_TARGET,
"", ACTION_TRANSPORT_EMBARK2,
5353 NO_TARGET,
"", ACTION_TRANSPORT_EMBARK3,
5356 punit, pdesttile, NULL)) {
5359 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK1,
5362 punit, pdesttile, NULL)) {
5365 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK2,
5368 punit, pdesttile, NULL)) {
5371 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK3,
5374 punit, pdesttile, NULL)) {
5377 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK4,
5380 punit, pdesttile, NULL)) {
5386 punit, pdesttile, NULL)) {
5392 punit, pdesttile, NULL)) {
5398 punit, pdesttile, NULL)) {
5424 struct city *pcity_dest,
5425 const struct action *paction)
5475 prod =
_(
"current production");
5482 work =
_(
"remaining");
5487 work =
_(
"surplus");
5494 _(
"Your %s does %s to help build the %s in %s (%d %s)."),
5513 _(
"Help building the %s in %s received from %s %s "
5539 struct city *pcity_dest,
5540 const struct action *paction)
5546 int home_overbooked = 0;
5547 int dest_overbooked = 0;
5550 struct city *pcity_homecity;
5551 struct trade_route_list *routes_out_of_dest;
5552 struct trade_route_list *routes_out_of_home;
5553 enum trade_route_bonus_type bonus_type;
5555 const char *goods_str;
5568 if (!pcity_homecity) {
5570 _(
"Sorry, your %s cannot establish"
5571 " a trade route because it has no home city."),
5581 if (
goods == NULL) {
5583 _(
"Sorry, your %s cannot establish"
5584 " a trade route because it's not carrying any goods."),
5594 _(
"Sorry, your %s cannot establish"
5595 " a trade route between %s and %s."),
5603 routes_out_of_home = trade_route_list_new();
5604 routes_out_of_dest = trade_route_list_new();
5613 if (can_establish) {
5620 if (can_establish && (home_overbooked >= 0 || dest_overbooked >= 0)) {
5624 if (home_overbooked >= 0) {
5630 _(
"Sorry, your %s cannot establish"
5631 " a trade route here!"),
5636 PL_(
" The city of %s already has %d "
5637 "better trade route!",
5638 " The city of %s already has %d "
5639 "better trade routes!", home_max),
5643 can_establish =
FALSE;
5648 if (can_establish && dest_overbooked >= 0) {
5654 _(
"Sorry, your %s cannot establish"
5655 " a trade route here!"),
5660 PL_(
" The city of %s already has %d "
5661 "better trade route!",
5662 " The city of %s already has %d "
5663 "better trade routes!", dest_max),
5667 can_establish =
FALSE;
5686 switch (bonus_type) {
5691 _(
"Your %s from %s has arrived in %s carrying %s."),
5701 PL_(
"Your %s from %s has arrived in %s carrying %s,"
5702 " and revenues amount to %d in gold.",
5703 "Your %s from %s has arrived in %s carrying %s,"
5704 " and revenues amount to %d in gold.",
5712 case TBONUS_SCIENCE:
5716 PL_(
"Your %s from %s has arrived in %s carrying %s,"
5717 " and revenues amount to %d in research.",
5718 "Your %s from %s has arrived in %s carrying %s,"
5719 " and revenues amount to %d in research.",
5731 PL_(
"Your %s from %s has arrived in %s carrying %s,"
5732 " and revenues amount to %d in gold and research.",
5733 "Your %s from %s has arrived in %s carrying %s,"
5734 " and revenues amount to %d in gold and research.",
5744 if (bonus_type == TBONUS_GOLD || bonus_type == TBONUS_BOTH) {
5750 if (bonus_type == TBONUS_SCIENCE || bonus_type == TBONUS_BOTH) {
5758 if (can_establish) {
5760 struct city_list *cities_out_of_home;
5761 struct city_list *cities_out_of_dest;
5762 struct player *partner_player;
5773 _(
"New trade route established from %s to %s."),
5776 if (pplayer != partner_player) {
5779 _(
"The %s established a trade route between their "
5786 cities_out_of_home = city_list_new();
5787 cities_out_of_dest = city_list_new();
5817 proute_to->
partner = pcity_homecity->
id;
5821 proute_from->
dir = RDIR_BIDIRECTIONAL;
5822 proute_to->
dir = RDIR_BIDIRECTIONAL;
5824 proute_from->
dir = RDIR_FROM;
5825 proute_to->
dir = RDIR_TO;
5827 trade_route_list_append(pcity_homecity->
routes, proute_from);
5828 trade_route_list_append(pcity_dest->
routes, proute_to);
5852 if (pplayer != partner_player) {
5881 city_list_destroy(cities_out_of_home);
5882 city_list_destroy(cities_out_of_dest);
5894 trade_route_list_destroy(routes_out_of_home);
5895 trade_route_list_destroy(routes_out_of_dest);
5909 int unit_id16,
int unit_id32,
5910 enum unit_ss_data_type
type,
5917 unit_id32 = unit_id16;
5922 if (NULL ==
punit) {
5925 if (
type != USSDT_UNQUEUE) {
5927 log_verbose(
"handle_unit_sscs_set() invalid unit %d", unit_id32);
5942 log_verbose(
"unit_sscs_set() invalid target tile %d for unit %d",
5968 case USSDT_BATTLE_GROUP:
5985 }
else if (value == 1) {
5995 log_verbose(
"handle_unit_sscs_set(): illegal sentry state for %s %d",
6022 int unit_id16,
int unit_id32,
6023 enum server_side_agent
agent)
6028 unit_id32 = unit_id16;
6033 if (NULL ==
punit) {
6035 log_verbose(
"handle_unit_server_side_agent_set() invalid unit %d",
6040 if (!server_side_agent_is_valid(
agent)) {
6042 log_verbose(
"handle_unit_server_side_agent_set() invalid agent %d",
6055 if (
agent == SSA_AUTOEXPLORE) {
6078 enum server_side_agent
agent)
6084 case SSA_AUTOSETTLER:
6089 case SSA_AUTOEXPLORE:
6114 enum unit_activity old_activity,
6119 switch (old_activity) {
6120 case ACTIVITY_PILLAGE:
6122 if (old_target != NULL) {
6124 if (punit2->activity == ACTIVITY_PILLAGE) {
6126 if (pdep == old_target) {
6137 case ACTIVITY_EXPLORE:
6145 case ACTIVITY_EXPLORE:
6163 const struct action *paction)
6177 enum unit_activity new_activity)
6183 && new_activity != ACTIVITY_GEN_ROAD,
FALSE);
6185 if (new_activity == ACTIVITY_PILLAGE) {
6205 enum unit_activity new_activity)
6228 const struct action *paction,
6244 enum unit_activity new_activity,
6250 new_activity, *new_target)) {
6255 if (
list != NULL && action_list_size(
list) > 0) {
6258 (*new_target) != NULL ? (*new_target)->id :
NO_TARGET,
6275 enum unit_activity new_activity,
6279 new_activity, *new_target)) {
6284 enum unit_activity stored_activity = new_activity;
6287 &new_activity, new_target);
6288 if (new_activity != stored_activity
6298 if (new_activity == ACTIVITY_PILLAGE) {
6320 int length = packet->
length;
6338 if (NULL ==
punit) {
6340 log_verbose(
"handle_unit_orders() invalid unit %d", unit_id);
6346 log_error(
"handle_unit_orders() invalid %s (%d) "
6358 log_verbose(
"handle_unit_orders() invalid %s (%d) tile (%d, %d) "
6372 log_error(
"received invalid orders from %s for %s (%d).",
6411 log_debug(
"Orders for unit %d: length:%d", unit_id, length);
6412 for (i = 0; i < length; i++) {
6419 "no action/activity required",
6448 if (pcity == NULL || pcity->
owner != pplayer || ptile == NULL) {
6458 if (ptask == NULL) {
6459 if (packet->
activity == ACTIVITY_LAST) {
6465 worker_task_list_append(pcity->
task_reqs, ptask);
6467 if (packet->
activity == ACTIVITY_LAST) {
6468 worker_task_list_remove(pcity->
task_reqs, ptask);
6474 if (ptask != NULL) {
6475 ptask->
ptile = ptile;
6477 if (packet->
tgt >= 0) {
6481 log_debug(
"Illegal worker task target %d", packet->
tgt);
6492 worker_task_list_remove(pcity->
task_reqs, ptask);
const char * action_name_translation(const struct action *action)
bool action_distance_inside_max(const struct action *action, const int distance)
bool action_mp_full_makes_legal(const struct unit *actor, const action_id act_id)
const char * action_id_name_translation(action_id act_id)
struct act_prob action_prob_self(const struct unit *actor_unit, const action_id act_id)
bool action_prob_possible(const struct act_prob probability)
bool action_actor_utype_hard_reqs_ok(const struct action *paction, const struct unit_type *actor_unittype)
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)
const char * action_id_rule_name(action_id act_id)
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)
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)
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 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)
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)
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_prob_vs_city(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct city *target_city)
bool action_maybe_possible_actor_unit(const struct civ_map *nmap, const action_id act_id, const struct unit *actor_unit)
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)
bool action_id_exists(const action_id act_id)
enum action_target_kind action_get_target_kind(const struct action *paction)
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)
struct action_enabler_list * action_enablers_for_action(action_id action)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_enabler_list_iterate_end
#define action_id_get_role(act_id)
#define action_iterate_end
#define action_id_get_actor_kind(act_id)
#define ACTPROB_NOT_KNOWN
#define action_has_result_safe(paction, result)
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_id_distance_accepted(act_id, distance)
#define ACTPROB_IMPOSSIBLE
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define action_id_has_result_safe(act_id, result)
#define action_id_has_complex_target(act_id)
#define CALL_PLR_AI_FUNC(_func, _player,...)
void astr_free(struct astring *astr)
const char * astr_build_or_list(struct astring *astr, const char *const *items, size_t number)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
void adv_unit_new_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
struct extra_type * base_extra_get(const struct base_type *pbase)
struct base_type * get_base_by_gui_type(enum base_gui_type type, const struct unit *punit, const struct tile *ptile)
#define BV_ISSET(bv, bit)
bool has_capability(const char *cap, const char *capstr)
void citizens_update(struct city *pcity, struct player *plr)
bool city_production_gets_caravan_shields(const struct universal *tgt)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
bool is_capital(const struct city *pcity)
const char * city_name_get(const struct city *pcity)
bool citymindist_prevents_city_on_tile(const struct civ_map *nmap, const struct tile *ptile)
void city_size_add(struct city *pcity, int add)
bool city_can_grow_to(const struct city *pcity, int pop_size)
struct city * tile_non_attack_city(const struct tile *ptile, const struct player *pplayer)
const char * city_production_name_translation(const struct city *pcity)
static bool is_non_allied_city_tile(const struct tile *ptile, const struct player *pplayer)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
#define city_list_iterate_end
void nullify_prechange_production(struct city *pcity)
bool city_change_size(struct city *pcity, citizens size, struct player *nationality, const char *reason)
int city_incite_cost(struct player *pplayer, struct city *pcity)
bool city_reduce_size(struct city *pcity, citizens pop_loss, struct player *destroyer, const char *reason)
bool city_refresh(struct city *pcity)
static struct fc_sockaddr_list * list
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 city * sdi_try_defend(const struct civ_map *nmap, const struct player *owner, const struct tile *ptile)
int get_total_defense_power(const struct unit *attacker, const struct unit *defender)
int get_total_attack_power(const struct unit *attacker, const struct unit *defender)
struct unit * get_defender(const struct civ_map *nmap, const struct unit *attacker, const struct tile *ptile)
void get_modified_firepower(const struct civ_map *nmap, const struct unit *attacker, const struct unit *defender, int *att_fp, int *def_fp)
void conn_list_do_unbuffer(struct conn_list *dest)
void conn_list_do_buffer(struct conn_list *dest)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
static void bombard(QVariant data1, QVariant data2)
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 const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
struct unit struct city struct unit struct tile struct extra_type * target_extra
int int initiated_from int int giver
bool spy_steal_some_maps(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
bool spy_sabotage_unit(struct player *pplayer, struct unit *pdiplomat, struct unit *pvictim, const struct action *paction)
bool diplomat_embassy(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
void spy_send_sabotage_list(struct connection *pc, struct unit *pdiplomat, struct city *pcity, const struct action *paction, int request_kind)
bool diplomat_get_tech(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, Tech_type_id technology, const struct action *paction)
bool diplomat_sabotage(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, Impr_type_id improvement, const struct action *paction)
bool diplomat_incite(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
bool spy_steal_gold(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
bool spy_spread_plague(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
bool spy_nuke_city(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
bool diplomat_investigate(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
bool diplomat_bribe(struct player *pplayer, struct unit *pdiplomat, struct unit *pvictim, const struct action *paction)
bool spy_attack(struct player *act_player, struct unit *act_unit, struct tile *tgt_tile, const struct action *paction)
bool spy_poison(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
@ ANEK_CITY_TOO_CLOSE_TGT
@ ANEK_IS_NOT_CITY_CENTER
@ ANEK_TGT_NON_ALLIED_UNITS_ON_TILE
@ ANEK_ACTOR_HAS_HOME_CITY
@ ANEK_ACT_NOT_ENOUGH_MONEY
@ ANEK_IS_NOT_TRANSPORTING
@ ANEK_ACTOR_HAS_NO_HOME_CITY
@ ANEK_IS_NOT_TRANSPORTED
@ ANEK_TGT_IS_UNIQUE_ACT_HAS
#define IDENTITY_NUMBER_ZERO
#define PL_(String1, String2, n)
const char * unit_tired_attack_string(const struct unit *punit)
const char * unit_veteran_level_string(const struct unit *punit)
const char * city_tile_link(const struct city *pcity)
const char * tile_link(const struct tile *ptile)
const char * unit_firepower_if_not_one(int firepower)
const struct ft_color ftc_server
const char * city_link(const struct city *pcity)
const char * unit_link(const struct unit *punit)
const char * unit_tile_link(const struct unit *punit)
const char * unit_achieved_rank_string(const struct unit *punit)
bool is_player_phase(const struct player *pplayer, int phase)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
static int target_extra_id
struct impr_type * improvement_by_number(const Impr_type_id id)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
enum direction8 opposite_direction(enum direction8 dir)
const char * dir_get_name(enum direction8 dir)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
bool base_get_direction_for_step(const struct civ_map *nmap, const struct tile *start_tile, const struct tile *end_tile, enum direction8 *dir)
static int map_move_cost_unit(const struct civ_map *nmap, struct unit *punit, const struct tile *ptile)
void vision_clear_sight(struct vision *vision)
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
void map_show_tile(struct player *src_player, struct tile *ptile)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void map_show_circle(struct player *pplayer, struct tile *ptile, int radius_sq)
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
const char * move_points_text(int mp, bool reduce)
enum unit_move_result unit_move_to_tile_test(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, const struct tile *src_tile, const struct tile *dst_tile, bool igzoc, bool enter_transport, struct unit *embark_to, bool enter_enemy_city)
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 can_unit_survive_at_tile(const struct civ_map *nmap, 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)
@ MR_DESTINATION_OCCUPIED_BY_NON_ALLIED_UNIT
const char * nation_rule_name(const struct nation_type *pnation)
struct nation_type * nation_of_unit(const struct unit *punit)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_of_player(const struct player *pplayer)
const char * nation_plural_for_player(const struct player *pplayer)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
#define REQEST_PLAYER_INITIATED
int dsend_packet_unit_action_answer(struct connection *pc, int actor_id16, int actor_id32, int target_id, int cost, action_id action_type, int request_kind)
void dlsend_packet_nuke_tile_info(struct conn_list *dest, int tile)
void lsend_packet_worker_task(struct conn_list *dest, const struct packet_worker_task *packet)
int send_packet_unit_short_info(struct connection *pc, const struct packet_unit_short_info *packet, bool force_to_send)
int dsend_packet_unit_actions(struct connection *pc, int actor_unit_id16, int actor_unit_id32, int target_unit_id16, int target_unit_id32, int target_city_id16, int target_city_id32, int target_tile_id, int target_extra_id, int request_kind, const struct act_prob *action_probabilities)
void lsend_packet_unit_combat_info(struct conn_list *dest, const struct packet_unit_combat_info *packet)
int send_packet_unit_info(struct connection *pc, const struct packet_unit_info *packet)
int send_packet_unit_combat_info(struct connection *pc, const struct packet_unit_combat_info *packet)
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
const char * player_name(const struct player *pplayer)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
struct city * player_city_by_number(const struct player *pplayer, int city_id)
struct city * player_primary_capital(const struct player *pplayer)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_non_attack(const struct player *pplayer, const struct player *pplayer2)
bool can_player_see_units_in_city(const struct player *pplayer, const struct city *pcity)
#define players_iterate_end
#define players_iterate(_pplayer)
int normal_player_count(void)
bool civil_war_triggered(struct player *pplayer)
void maybe_make_contact(struct tile *ptile, struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
struct player * civil_war(struct player *pplayer)
struct conn_list * player_reply_dest(struct player *pplayer)
bool civil_war_possible(struct player *pplayer, bool conquering_city, bool honour_server_option)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
#define requirement_fulfilled_by_unit_type(_ut_, _rqs_)
#define requirement_fulfilled_by_terrain(_ter_, _rqs_)
#define requirement_fulfilled_by_nation(_nat_, _rqs_)
struct research * research_get(const struct player *pplayer)
#define sanity_check_city(x)
void script_server_signal_emit(const char *signal_name,...)
#define CLIP(lower, current, upper)
void spaceship_lost(struct player *pplayer)
#define DEFAULT_SPECIALIST
bool unitwaittime_controlled
bool actor_consuming_always
enum action_sub_target_kind sub_target_kind
struct action::@12::@13 is_unit
enum action_result result
bv_action_sub_results sub_results
enum act_tgt_compl target_complexity
struct player * no_war_with
const struct unit_type * no_tgt_utype
struct terrain * no_act_terrain
struct city * capacity_city
struct player * peace_with
struct nation_type * no_act_nation
struct worker_task_list * task_reqs
struct trade_route_list * routes
struct universal production
citizens specialists[SP_MAX]
struct unit_list * units_supported
struct civ_game::@30::@34 server
struct packet_ruleset_control control
struct conn_list * est_connections
struct packet_game_info info
struct packet_scenario_info scenario
char capability[MAX_LEN_CAPSTR]
enum goods_selection_method goods_selection
struct unit_order orders[MAX_LEN_ROUTE]
enum unit_activity activity
enum spaceship_state state
struct vision_site * site
struct connection * current_conn
struct conn_list * connections
struct player_economic economic
struct player_spaceship spaceship
struct player_score score
struct nation_type * nation
const struct player * player
enum trade_route_bonus_type bonus_type
struct goods_type * goods
enum unit_activity activity
enum action_decision action_decision_want
enum unit_activity activity
struct extra_type * activity_target
struct unit::@80::@83 server
struct goods_type * carrying
struct tile * action_decision_tile
const struct unit_type * utype
enum server_side_agent ssa_controller
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
const char * terrain_name_translation(const struct terrain *pterrain)
#define terrain_has_flag(terr, flag)
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_owner(_tile)
struct goods_type * goods_from_city_to_unit(struct city *src, struct unit *punit)
bool can_cities_trade(const struct city *pc1, const struct city *pc2)
enum trade_route_type cities_trade_route_type(const struct city *pcity1, const struct city *pcity2)
int trade_base_between_cities(const struct city *pc1, const struct city *pc2)
int city_num_trade_routes(const struct city *pcity)
static struct goods_type goods[MAX_GOODS_TYPES]
bool goods_has_flag(const struct goods_type *pgood, enum goods_flag_id flag)
struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type)
unsigned max_trade_routes(const struct city *pcity)
const char * goods_name_translation(struct goods_type *pgood)
int get_caravan_enter_city_trade_bonus(const struct city *pc1, const struct city *pc2, struct goods_type *pgood, const bool establish_trade)
int city_trade_removable(const struct city *pcity, struct trade_route_list *would_remove)
bool have_cities_trade_route(const struct city *pc1, const struct city *pc2)
#define trade_route_list_iterate(trade_route_list, proute)
#define trade_route_list_iterate_end
struct unit_order * create_unit_orders(const struct civ_map *nmap, int length, const struct unit_order *orders)
int unit_shield_value(const struct unit *punit, const struct unit_type *punittype, const struct action *paction)
int get_transporter_occupancy(const struct unit *ptrans)
void free_unit_orders(struct unit *punit)
bool unit_is_alive(int id)
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
void set_unit_activity(struct unit *punit, enum unit_activity new_activity)
struct player * unit_nationality(const struct unit *punit)
struct unit * unit_transport_get(const struct unit *pcargo)
bool unit_transport_unload(struct unit *pcargo)
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 can_unit_continue_current_activity(const struct civ_map *nmap, struct unit *punit)
int unit_bribe_cost(struct unit *punit, struct player *briber)
bool can_unit_do_autosettlers(const struct unit *punit)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
void set_unit_activity_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type *new_target)
bool can_unit_do_activity(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity)
enum unit_upgrade_result unit_upgrade_test(const struct civ_map *nmap, const struct unit *punit, bool is_free)
bool kills_citizen_after_attack(const struct unit *punit)
bool unit_transported(const struct unit *pcargo)
bool unit_has_orders(const struct unit *punit)
bool activity_requires_target(enum unit_activity activity)
bool can_unit_do_activity_targeted(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, struct extra_type *target)
#define MAX_NUM_BATTLEGROUPS
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
#define ACTION_PERFORM_UNIT_CITY(action, actor, target, action_performer)
static bool do_unit_strike_city_production(const struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
static bool rel_may_become_war(const struct player *pplayer, const struct player *oplayer)
void handle_unit_server_side_agent_set(struct player *pplayer, int unit_id16, int unit_id32, enum server_side_agent agent)
static bool do_unit_change_homecity(struct unit *punit, struct city *pcity, const struct action *paction)
static bool do_unit_upgrade(struct player *pplayer, struct unit *punit, struct city *pcity, enum action_requester ordered_by, const struct action *paction)
static bool do_attack(struct unit *actor_unit, struct tile *target_tile, const struct action *paction)
static void send_combat(struct unit *pattacker, struct unit *pdefender, int att_veteran, int def_veteran, int bombard)
void handle_unit_get_actions(struct connection *pc, const struct packet_unit_get_actions *packet)
#define ACTION_PERFORM_UNIT_UNITS(action, actor, target, action_performer)
static bool do_unit_make_homeless(struct unit *punit, const struct action *paction)
static bool non_allied_not_listed_at(const struct player *pplayer, const int *list, int n, const struct tile *ptile)
void handle_unit_orders(struct player *pplayer, const struct packet_unit_orders *packet)
void illegal_action_msg(struct player *pplayer, const enum event_type event, struct unit *actor, const action_id stopped_action, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
static bool do_heal_unit(struct player *act_player, struct unit *act_unit, struct unit *tgt_unit, const struct action *paction)
void handle_unit_sscs_set(struct player *pplayer, int unit_id16, int unit_id32, enum unit_ss_data_type type, int value)
static bool do_unit_alight(struct player *act_player, struct unit *act_unit, struct unit *tgt_unit, const struct action *paction)
static bool do_capture_units(struct player *pplayer, struct unit *punit, struct tile *pdesttile, const struct action *paction)
static bool do_expel_unit(struct player *pplayer, struct unit *actor, struct unit *target, const struct action *paction)
static bool do_unit_conquer_city(struct player *act_player, struct unit *act_unit, struct city *tgt_city, struct action *paction)
static bool do_unit_strike_city_building(const struct player *act_player, struct unit *act_unit, struct city *tgt_city, Impr_type_id tgt_bld_id, const struct action *paction)
static bool does_nation_block_action(const action_id act_id, bool is_target, struct unit *actor_unit, struct nation_type *pnation)
#define ACTION_PERFORM_UNIT_UNIT(action, actor, target, action_performer)
void handle_worker_task(struct player *pplayer, const struct packet_worker_task *packet)
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity)
static bool do_unit_embark(struct player *act_player, struct unit *act_unit, struct unit *tgt_unit, const struct action *paction)
bool unit_perform_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id_incoming, const char *name, const action_id action_type, const enum action_requester requester)
#define ACTION_PERFORM_UNIT_TILE(action, actor, target, action_performer)
static bool illegal_action_pay_price(struct player *pplayer, bool information_revealed, struct unit *act_unit, struct action *stopped_action, struct player *tgt_player, struct tile *tgt_tile, const enum action_requester requester)
static void explain_why_no_action_enabled(struct unit *punit, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
static bool does_terrain_block_action(const action_id act_id, bool is_target, struct unit *actor_unit, struct terrain *pterrain)
static void unit_activity_dependencies(struct unit *punit, enum unit_activity old_activity, struct extra_type *old_target)
static void unit_query_impossible(struct connection *pc, const int actor_id, const int target_id, int request_kind)
static bool unit_bombard(struct unit *punit, struct tile *ptile, const struct action *paction)
bool unit_move_handling(struct unit *punit, struct tile *pdesttile, bool move_do_not_act)
static bool unit_do_destroy_city(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
static void handle_unit_change_activity_real(struct player *pplayer, int unit_id, enum unit_activity activity, struct extra_type *activity_target)
#define ACTION_PERFORM_UNIT_SELF(action, actor, action_performer)
void unit_do_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id, const char *name, const action_id action_type)
static struct ane_expl * expl_act_not_enabl(struct unit *punit, const action_id act_id, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
static bool do_action_activity(struct unit *punit, const struct action *paction)
void handle_unit_action_query(struct connection *pc, int actor_id16, int actor_id32, const int target_id, const action_id action_type, int request_kind)
static bool need_war_enabler(const struct unit_type *actor_utype, const struct action *paction, struct player *player1, struct player *player2, bool act_if_diplrel_kind(const struct unit_type *, const action_id, const int, const bool))
void handle_unit_do_action(struct player *pplayer, const struct packet_unit_do_action *packet)
static bool do_unit_unload(struct player *act_player, struct unit *act_unit, struct unit *tgt_unit, const struct action *paction)
void unit_change_homecity_handling(struct unit *punit, struct city *new_pcity, bool rehome)
static bool unit_activity_targeted_internal(struct unit *punit, enum unit_activity new_activity, struct extra_type **new_target)
static bool tile_has_units_not_allied_to_but_seen_by(const struct tile *ptile, const struct player *pplayer)
static bool do_action_activity_targeted(struct unit *punit, const struct action *paction, struct extra_type **new_target)
static struct player * need_war_player(const struct unit *actor, const action_id act_id, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
static bool unit_do_help_build(struct player *pplayer, struct unit *punit, struct city *pcity_dest, const struct action *paction)
void handle_unit_type_upgrade(struct player *pplayer, Unit_type_id uti)
static bool city_add_unit(struct player *pplayer, struct unit *punit, struct city *pcity, const struct action *paction)
static bool unit_activity_internal(struct unit *punit, enum unit_activity new_activity)
bool unit_activity_handling_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type **new_target)
static bool unit_nuke(struct player *pplayer, struct unit *punit, struct tile *def_tile, const struct action *paction)
static bool can_unit_move_to_tile_with_notify(struct unit *punit, struct tile *dest_tile, bool igzoc, struct unit *embark_to, bool enter_enemy_city)
static bool do_unit_board(struct player *act_player, struct unit *act_unit, struct unit *tgt_unit, const struct action *paction)
static void see_combat(struct unit *pattacker, struct unit *pdefender)
#define ACTION_PERFORM_UNIT_ANY(paction, actor, target_city, target_unit, target_tile, action_performer)
static struct player * need_war_player_hlp(const struct unit *actor, const action_id act, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
void handle_unit_change_activity(struct player *pplayer, int unit_id16, int unit_id32, enum unit_activity activity, int target_id)
static bool unit_do_regular_move(struct player *actor_player, struct unit *actor_unit, struct tile *target_tile, const struct action *paction)
static bool do_conquer_extras(struct player *act_player, struct unit *act_unit, struct tile *tgt_tile, const struct action *paction)
bool unit_server_side_agent_set(struct player *pplayer, struct unit *punit, enum server_side_agent agent)
static bool do_unit_establish_trade(struct player *pplayer, struct unit *punit, struct city *pcity_dest, const struct action *paction)
static bool do_disembark(struct player *act_player, struct unit *act_unit, struct tile *tgt_tile, const struct action *paction)
static void unit_plans_clear(struct unit *punit)
static bool city_build(struct player *pplayer, struct unit *punit, struct tile *ptile, const char *name, const struct action *paction)
static bool do_unit_hut(struct player *act_player, struct unit *act_unit, struct tile *tgt_tile, const struct action *paction)
enum ane_kind action_not_enabled_reason(struct unit *punit, action_id act_id, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
#define ACTION_PERFORM_UNIT_EXTRAS(action, actor, target, action_performer)
static void illegal_action(struct player *pplayer, struct unit *actor, action_id stopped_action, struct player *tgt_player, struct tile *target_tile, const struct city *target_city, const struct unit *target_unit, int request_kind, const enum action_requester requester)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
bool utype_may_act_tgt_city_tile(const struct unit_type *punit_type, const action_id act_id, const enum citytile_type prop, const bool is_there)
const char * uclass_name_translation(const struct unit_class *pclass)
const struct unit_type * unit_type_get(const struct unit *punit)
const char * unit_name_translation(const struct unit *punit)
bool utype_is_moved_to_tgt_by_action(const struct action *paction, const struct unit_type *utype)
const char * unit_rule_name(const struct unit *punit)
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
Unit_type_id utype_count(void)
bool utype_can_do_act_when_ustate(const struct unit_type *punit_type, const action_id act_id, const enum ustate_prop prop, const bool is_there)
struct unit_class * unit_class_get(const struct unit *punit)
struct unit_type * utype_by_number(const Unit_type_id id)
bool utype_is_consumed_by_action(const struct action *paction, const struct unit_type *utype)
bool utype_can_act_if_tgt_diplrel_tile_other(const struct unit_type *punit_type, const action_id act_id, const int prop, const bool is_there)
Unit_type_id utype_index(const struct unit_type *punittype)
int unit_pop_value(const struct unit *punit)
const char * utype_name_translation(const struct unit_type *punittype)
bool can_utype_do_act_if_tgt_diplrel(const struct unit_type *punit_type, const action_id act_id, const int prop, const bool is_there)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
bool role_units_translations(struct astring *astr, int flag, bool alts)
int unit_upgrade_price(const struct player *pplayer, const struct unit_type *from, const struct unit_type *to)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
struct vision * vision_new(struct player *pplayer, struct tile *ptile)
void vision_free(struct vision *vision)
bool worker_task_is_sane(struct worker_task *ptask)
void worker_task_init(struct worker_task *ptask)
#define worker_task_list_iterate(tasklist, ptask)
#define worker_task_list_iterate_end