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;
2968 ? E_UNIT_ILLEGAL_ACTION : E_BAD_COMMAND),
2969 actor, stopped_action_id,
2974 actor, stopped_action,
2984 (information_revealed
2985 ? E_UNIT_ILLEGAL_ACTION : E_BAD_COMMAND),
ftc_server,
2986 _(
"No explanation why you couldn't do %s. This is a bug."
2987 " Sorry about that. -- Sveinung"),
2997 const int target_id,
3018 const int target_id,
3023 struct unit *pactor;
3030 actor_id32 = actor_id16;
3035 if (NULL == paction) {
3037 log_error(
"handle_unit_action_query() the action %d doesn't exist.",
3044 if (NULL == pactor) {
3046 log_verbose(
"handle_unit_action_query() invalid actor %d",
3052 switch (paction->
result) {
3053 case ACTRES_SPY_BRIBE_UNIT:
3058 actor_id32, actor_id32, target_id,
3060 action_type, request_kind);
3064 NULL, NULL,
punit, request_kind, ACT_REQ_PLAYER);
3069 case ACTRES_SPY_INCITE_CITY:
3074 actor_id32, actor_id32, target_id,
3076 action_type, request_kind);
3080 NULL, pcity, NULL, request_kind, ACT_REQ_PLAYER);
3085 case ACTRES_UPGRADE_UNIT:
3099 actor_id32, actor_id32, target_id,
3100 upgr_cost, action_type,
3105 NULL, pcity, NULL, request_kind, ACT_REQ_PLAYER);
3110 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3111 case ACTRES_STRIKE_BUILDING:
3120 NULL, pcity, NULL, request_kind, ACT_REQ_PLAYER);
3157 const int target_id,
3158 const int sub_tgt_id,
3163 sub_tgt_id,
name, action_type, ACT_REQ_PLAYER);
3177 const int target_id,
3178 const int sub_tgt_id_incoming,
3181 const enum action_requester requester)
3190 struct city *pcity = NULL;
3195 log_error(
"unit_perform_action() the action %d doesn't exist.",
3205 log_verbose(
"unit_perform_action() invalid actor %d",
3213 if (pcity == NULL) {
3214 log_verbose(
"unit_perform_action() invalid target city %d",
3223 if (
punit == NULL) {
3224 log_verbose(
"unit_perform_action() invalid target unit %d",
3237 log_verbose(
"unit_perform_action() invalid target tile %d",
3258 sub_tgt_id = sub_tgt_id_incoming;
3277 if (sub_tgt_impr == NULL) {
3286 case ASTK_EXTRA_NOT_THERE:
3301 log_verbose(
"unit_perform_action() action %d requires action "
3302 "but extra id %d is invalid.",
3303 action_type, sub_tgt_id);
3313#define ACTION_PERFORM_UNIT_CITY(action, actor, target, action_performer) \
3315 && is_action_enabled_unit_on_city(nmap, action_type, \
3316 actor_unit, pcity)) { \
3318 script_server_signal_emit("action_started_unit_city", \
3319 action_by_number(action), actor, target); \
3320 if (!actor || !unit_is_alive(actor_id)) { \
3324 if (!target || !city_exist(target_id)) { \
3328 success = action_performer; \
3330 action_success_actor_price(paction, actor_id, actor); \
3332 script_server_signal_emit("action_finished_unit_city", \
3333 action_by_number(action), success, \
3334 unit_is_alive(actor_id) ? actor : NULL, \
3335 city_exist(target_id) ? target : NULL); \
3338 illegal_action(pplayer, actor_unit, action_type, \
3339 pcity ? city_owner(pcity) : NULL, NULL, pcity, NULL, \
3343#define ACTION_PERFORM_UNIT_SELF(action, actor, action_performer) \
3345 && is_action_enabled_unit_on_self(nmap, action_type, actor_unit)) { \
3347 script_server_signal_emit("action_started_unit_self", \
3348 action_by_number(action), actor); \
3349 if (!actor || !unit_is_alive(actor_id)) { \
3353 success = action_performer; \
3355 action_success_actor_price(paction, actor_id, actor); \
3357 script_server_signal_emit("action_finished_unit_self", \
3358 action_by_number(action), success, \
3359 unit_is_alive(actor_id) ? actor : NULL); \
3362 illegal_action(pplayer, actor_unit, action_type, \
3363 unit_owner(actor_unit), NULL, NULL, actor_unit, \
3367#define ACTION_PERFORM_UNIT_UNIT(action, actor, target, action_performer) \
3369 && is_action_enabled_unit_on_unit(nmap, action_type, actor_unit, punit)) { \
3371 script_server_signal_emit("action_started_unit_unit", \
3372 action_by_number(action), actor, target); \
3373 if (!actor || !unit_is_alive(actor_id)) { \
3377 if (!target || !unit_is_alive(target_id)) { \
3381 success = action_performer; \
3383 action_success_actor_price(paction, actor_id, actor); \
3384 action_success_target_pay_mp(paction, target_id, punit); \
3386 script_server_signal_emit("action_finished_unit_unit", \
3387 action_by_number(action), success, \
3388 unit_is_alive(actor_id) ? actor : NULL, \
3389 unit_is_alive(target_id) ? target : NULL); \
3392 illegal_action(pplayer, actor_unit, action_type, \
3393 punit ? unit_owner(punit) : NULL, NULL, NULL, punit, \
3397#define ACTION_PERFORM_UNIT_UNITS(action, actor, target, action_performer)\
3399 && is_action_enabled_unit_on_units(nmap, action_type, \
3400 actor_unit, target_tile)) { \
3402 script_server_signal_emit("action_started_unit_units", \
3403 action_by_number(action), actor, target); \
3404 if (!actor || !unit_is_alive(actor_id)) { \
3408 success = action_performer; \
3410 action_success_actor_price(paction, actor_id, actor); \
3412 script_server_signal_emit("action_finished_unit_units", \
3413 action_by_number(action), success, \
3414 unit_is_alive(actor_id) ? actor : NULL, \
3418 illegal_action(pplayer, actor_unit, action_type, \
3419 NULL, target_tile, NULL, NULL, \
3423#define ACTION_PERFORM_UNIT_TILE(action, actor, target, action_performer) \
3425 && is_action_enabled_unit_on_tile(nmap, action_type, \
3426 actor_unit, target_tile, \
3429 script_server_signal_emit("action_started_unit_tile", \
3430 action_by_number(action), actor, target); \
3431 if (!actor || !unit_is_alive(actor_id)) { \
3435 success = action_performer; \
3437 action_success_actor_price(paction, actor_id, actor); \
3439 script_server_signal_emit("action_finished_unit_tile", \
3440 action_by_number(action), success, \
3441 unit_is_alive(actor_id) ? actor : NULL, \
3445 illegal_action(pplayer, actor_unit, action_type, \
3446 target_tile ? tile_owner(target_tile) : NULL, \
3447 target_tile, NULL, NULL, \
3451#define ACTION_PERFORM_UNIT_EXTRAS(action, actor, target, action_performer)\
3453 && is_action_enabled_unit_on_extras(nmap, action_type, \
3454 actor_unit, target_tile, \
3457 script_server_signal_emit("action_started_unit_extras", \
3458 action_by_number(action), actor, target); \
3459 if (!actor || !unit_is_alive(actor_id)) { \
3463 success = action_performer; \
3465 action_success_actor_price(paction, actor_id, actor); \
3467 script_server_signal_emit("action_finished_unit_extras", \
3468 action_by_number(action), success, \
3469 unit_is_alive(actor_id) ? actor : NULL, \
3473 illegal_action(pplayer, actor_unit, action_type, \
3474 target_tile ? target_tile->extras_owner : NULL, \
3475 target_tile, NULL, NULL, \
3479#define ACTION_PERFORM_UNIT_ANY(paction, actor, \
3480 target_city, target_unit, target_tile, \
3482 switch (action_get_target_kind(paction)) { \
3484 ACTION_PERFORM_UNIT_CITY(paction->id, actor, target_city, \
3485 action_performer); \
3488 ACTION_PERFORM_UNIT_UNIT(paction->id, actor, target_unit, \
3489 action_performer); \
3492 ACTION_PERFORM_UNIT_UNITS(paction->id, actor, target_tile, \
3493 action_performer); \
3496 ACTION_PERFORM_UNIT_TILE(paction->id, actor, target_tile, \
3497 action_performer); \
3500 ACTION_PERFORM_UNIT_EXTRAS(paction->id, actor, target_tile, \
3501 action_performer); \
3504 ACTION_PERFORM_UNIT_SELF(paction->id, actor, TRUE); \
3507 fc_assert(action_get_target_kind(paction) != ATK_COUNT); \
3511 switch (paction->
result) {
3512 case ACTRES_SPY_BRIBE_UNIT:
3517 case ACTRES_SPY_SABOTAGE_UNIT:
3523 case ACTRES_EXPEL_UNIT:
3528 case ACTRES_HEAL_UNIT:
3533 case ACTRES_TRANSPORT_ALIGHT:
3538 case ACTRES_TRANSPORT_UNLOAD:
3543 case ACTRES_TRANSPORT_BOARD:
3548 case ACTRES_TRANSPORT_EMBARK:
3553 case ACTRES_DISBAND_UNIT:
3557 case ACTRES_FORTIFY:
3561 case ACTRES_CONVERT:
3565 case ACTRES_HOMELESS:
3569 case ACTRES_SPY_SABOTAGE_CITY:
3575 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
3582 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
3588 case ACTRES_SPY_POISON:
3594 case ACTRES_SPY_SPREAD_PLAGUE:
3599 case ACTRES_SPY_INVESTIGATE_CITY:
3606 case ACTRES_ESTABLISH_EMBASSY:
3612 case ACTRES_SPY_INCITE_CITY:
3618 case ACTRES_SPY_STEAL_TECH:
3624 case ACTRES_SPY_TARGETED_STEAL_TECH:
3628 sub_tgt_id, paction));
3630 case ACTRES_SPY_STEAL_GOLD:
3636 case ACTRES_STEAL_MAPS:
3642 case ACTRES_TRADE_ROUTE:
3647 case ACTRES_MARKETPLACE:
3652 case ACTRES_HELP_WONDER:
3658 case ACTRES_SPY_NUKE:
3664 case ACTRES_JOIN_CITY:
3669 case ACTRES_DESTROY_CITY:
3675 case ACTRES_DISBAND_UNIT_RECOVER:
3680 case ACTRES_HOME_CITY:
3685 case ACTRES_UPGRADE_UNIT:
3688 pcity, requester, paction));
3690 case ACTRES_CONQUER_CITY:
3696 case ACTRES_STRIKE_BUILDING:
3704 case ACTRES_STRIKE_PRODUCTION:
3711 case ACTRES_CONQUER_EXTRAS:
3716 case ACTRES_AIRLIFT:
3720 case ACTRES_CAPTURE_UNITS:
3725 case ACTRES_BOMBARD:
3736 case ACTRES_NUKE_UNITS:
3741 case ACTRES_SPY_ATTACK:
3746 case ACTRES_FOUND_CITY:
3757 case ACTRES_PARADROP:
3758 case ACTRES_PARADROP_CONQUER:
3762 case ACTRES_TRANSPORT_DISEMBARK:
3768 case ACTRES_HUT_ENTER:
3773 case ACTRES_HUT_FRIGHTEN:
3778 case ACTRES_UNIT_MOVE:
3783 case ACTRES_TRANSFORM_TERRAIN:
3787 case ACTRES_CULTIVATE:
3795 case ACTRES_PILLAGE:
3801 case ACTRES_CLEAN_POLLUTION:
3807 case ACTRES_CLEAN_FALLOUT:
3831 case ACTRES_IRRIGATE:
3860 struct player *new_owner = (new_pcity == NULL ? old_owner
3873 if (old_owner != new_owner) {
3915 if (new_pcity != NULL) {
3937 if (new_pcity != NULL) {
3959 const struct action *paction)
3961 const char *
giver = NULL;
3975 _(
"%s transferred control over a %s to you in %s."),
3992 struct city *pcity,
const struct action *paction)
4016 _(
"%s added to aid %s in growing."),
4024 _(
"%s adds %s to your city %s."),
4039 (lua_Integer)amount,
"unit_added");
4054 struct tile *ptile,
const char *
name,
4055 const struct action *paction)
4059 struct player *nationality;
4103 enum unit_activity activity,
4108 if (NULL ==
punit) {
4110 log_verbose(
"handle_unit_change_activity() invalid unit %d", unit_id);
4138 if (
activity == ACTIVITY_EXPLORE) {
4151 int unit_id16,
int unit_id32,
4159 unit_id = unit_id16;
4161 unit_id = unit_id32;
4165 activity_target = NULL;
4172 if (activity_target == NULL) {
4174 bool required =
TRUE;
4176 if (
punit == NULL) {
4180 if (
activity == ACTIVITY_IRRIGATE) {
4185 }
else if (activity == ACTIVITY_MINE) {
4190 }
else if (activity == ACTIVITY_BASE) {
4195 if (pbase != NULL) {
4199 }
else if (activity == ACTIVITY_POLLUTION) {
4202 }
else if (activity == ACTIVITY_FALLOUT) {
4209 if (activity_target == NULL && required) {
4246 struct player *pplayer = pconn->playing;
4248 if (pplayer != NULL) {
4270 }
else if (pconn->observer) {
4282 int att_veteran,
int def_veteran,
int bombard)
4319 if (NULL == pconn->playing && pconn->observer) {
4333 const struct action *paction)
4346 log_debug(
"Start bombard: %s %s to %d, %d.",
4353 enum direction8 facing;
4371 _(
"Your %s bombards the %s %s."),
4379 _(
"Your %s is bombarded by the %s %s."),
4387 pdefender->hp = def_hp;
4432 struct tile *def_tile,
const struct action *paction)
4444 log_debug(
"Start nuclear attack: %s %s against (%d, %d).",
4452 _(
"Your %s was shot down by "
4455 _(
"The nuclear attack on %s was avoided by"
4456 " your SDI defense."),
city_link(pcity));
4502 struct unit *act_unit,
4503 struct city *tgt_city,
4504 const struct action *paction)
4507 struct player *tgt_player;
4509 bool try_civil_war =
FALSE;
4527 tgt_city_id = tgt_city->
id;
4543 try_civil_war =
TRUE;
4549 _(
"You destroy %s completely."),
4552 if (tgt_player != act_player) {
4556 _(
"%s has been destroyed by %s."),
4575 if (try_civil_war) {
4594 const struct action *paction)
4600 struct unit *ploser, *pwinner;
4602 int moves_used, def_moves_used;
4603 int old_unit_vet, old_defender_vet, vet;
4607 enum direction8 facing;
4608 int att_hp, def_hp, att_fp, def_fp;
4609 int att_hp_start, def_hp_start;
4610 int def_power, att_power;
4611 int att_vet, def_vet;
4612 struct unit *pdefender;
4623 def_hp_start = pdefender->
hp;
4628 log_debug(
"Start attack: %s %s against %s %s.",
4638 "Trying to attack a unit with which you have peace "
4639 "or cease-fire at (%d, %d).",
TILE_XY(def_tile));
4642 "Trying to attack a unit with which you have "
4643 "alliance at (%d, %d).",
TILE_XY(def_tile));
4658 old_defender_vet = pdefender->
veteran;
4672 &att_vet, &def_vet);
4683 pdefender->
hp = def_hp;
4712 if (pdefender->
hp <= 0
4721 if (
punit->
hp > 0 && pdefender->
hp > 0) {
4724 pdefender->
veteran - old_defender_vet, 0);
4728 winner_id = pwinner->
id;
4729 ploser = (pdefender->
hp > 0) ?
punit : pdefender;
4732 old_defender_vet)) ? 0 : 1;
4735 pdefender->
veteran - old_defender_vet, 0);
4743 if (
punit == ploser) {
4745 log_debug(
"Attacker lost: %s %s against %s %s.",
4756 _(
"Your %s %s [id:%d %sD:%.1f lost %d HP, %d HP remaining]"
4757 " survived the pathetic %sattack from the %s %s %s "
4758 "[id:%d %sA:%.1f HP:%d]."),
4764 def_hp_start - pdefender->
hp,
4784 _(
"Your attacking %s %s [id:%d %sA:%.1f HP:%d] failed "
4785 "against the %s %s %s [id:%d lost %d HP, %d HP "
4797 def_hp_start - pdefender->
hp,
4805 log_debug(
"Defender lost: %s %s against %s %s.",
4817 _(
"Your %s %s [id:%d %sD:%.1f HP:%d] lost to an attack by "
4818 "the %s %s %s [id:%d %sA:%.1f lost %d HP, has %d HP "
4832 att_hp_start - pwinner->
hp,
4841 _(
"Your attacking %s %s [id:%d %s%sA:%.1f lost %d HP, "
4842 "has %d remaining] succeeded against the %s %s %s "
4850 att_hp_start - pwinner->
hp,
4888 NULL, NULL, paction,
4925 struct unit *act_unit,
4926 struct city *tgt_city,
4927 const struct action *paction)
4929 struct player *tgt_player;
4946 tgt_city, tgt_player,
4952 _(
"Your %s failed to do %s in %s."),
4976 _(
"Your %s succeeded in destroying"
4977 " the production of %s in %s."),
4982 _(
"The production of %s was destroyed in %s,"
4983 " %s are suspected."),
5001 struct unit *act_unit,
5002 struct city *tgt_city,
5004 const struct action *paction)
5006 struct player *tgt_player;
5023 tgt_city, tgt_player,
5029 _(
"Your %s failed to do %s in %s."),
5047 _(
"Your %s didn't find a %s to %s in %s."),
5070 _(
"Your %s destroyed the %s in %s."),
5076 _(
"The %s destroyed the %s in %s."),
5094 struct unit *act_unit,
5095 struct city *tgt_city,
5101 int tgt_city_id = tgt_city->
id;
5103 const char *victim_link =
city_link(tgt_city);
5120 tgt_player, tgt_tile,
5131 struct tile *dest_tile,
5133 struct unit *embark_to,
5134 bool enter_enemy_city)
5139 src_tile, dest_tile, igzoc,
TRUE, embark_to,
5148 _(
"Cannot attack unless you declare war first."));
5153 _(
"%s can only move into your own zone of control."),
5159 _(
"%s cannot move that far from the coast line."),
5166 _(
"Cannot invade unless you break peace with "
5174 _(
"%s cannot disembark outside of a city or a native base "
5183 _(
"Terrain is unsuitable for %s units."),
5204 const struct action *paction)
5240 bool move_do_not_act)
5243 struct unit *ptrans;
5278 if (!move_do_not_act) {
5282 bool one_action_may_be_legal
5290 if (one_action_may_be_legal || can_not_move) {
5319 punit, pdesttile, NULL)) {
5324 punit, pdesttile, NULL)) {
5329 punit, pdesttile, NULL)) {
5347 NO_TARGET,
"", ACTION_TRANSPORT_EMBARK2,
5355 NO_TARGET,
"", ACTION_TRANSPORT_EMBARK3,
5358 punit, pdesttile, NULL)) {
5361 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK1,
5364 punit, pdesttile, NULL)) {
5367 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK2,
5370 punit, pdesttile, NULL)) {
5373 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK3,
5376 punit, pdesttile, NULL)) {
5379 NO_TARGET,
"", ACTION_TRANSPORT_DISEMBARK4,
5382 punit, pdesttile, NULL)) {
5388 punit, pdesttile, NULL)) {
5394 punit, pdesttile, NULL)) {
5400 punit, pdesttile, NULL)) {
5426 struct city *pcity_dest,
5427 const struct action *paction)
5477 prod =
_(
"current production");
5484 work =
_(
"remaining");
5489 work =
_(
"surplus");
5496 _(
"Your %s does %s to help build the %s in %s (%d %s)."),
5515 _(
"Help building the %s in %s received from %s %s "
5541 struct city *pcity_dest,
5542 const struct action *paction)
5548 int home_overbooked = 0;
5549 int dest_overbooked = 0;
5552 struct city *pcity_homecity;
5553 struct trade_route_list *routes_out_of_dest;
5554 struct trade_route_list *routes_out_of_home;
5555 enum trade_route_bonus_type bonus_type;
5557 const char *goods_str;
5570 if (!pcity_homecity) {
5572 _(
"Sorry, your %s cannot establish"
5573 " a trade route because it has no home city."),
5583 if (
goods == NULL) {
5585 _(
"Sorry, your %s cannot establish"
5586 " a trade route because it's not carrying any goods."),
5596 _(
"Sorry, your %s cannot establish"
5597 " a trade route between %s and %s."),
5605 routes_out_of_home = trade_route_list_new();
5606 routes_out_of_dest = trade_route_list_new();
5615 if (can_establish) {
5622 if (can_establish && (home_overbooked >= 0 || dest_overbooked >= 0)) {
5626 if (home_overbooked >= 0) {
5632 _(
"Sorry, your %s cannot establish"
5633 " a trade route here!"),
5638 PL_(
" The city of %s already has %d "
5639 "better trade route!",
5640 " The city of %s already has %d "
5641 "better trade routes!", home_max),
5645 can_establish =
FALSE;
5650 if (can_establish && dest_overbooked >= 0) {
5656 _(
"Sorry, your %s cannot establish"
5657 " a trade route here!"),
5662 PL_(
" The city of %s already has %d "
5663 "better trade route!",
5664 " The city of %s already has %d "
5665 "better trade routes!", dest_max),
5669 can_establish =
FALSE;
5688 switch (bonus_type) {
5693 _(
"Your %s from %s has arrived in %s carrying %s."),
5703 PL_(
"Your %s from %s has arrived in %s carrying %s,"
5704 " and revenues amount to %d in gold.",
5705 "Your %s from %s has arrived in %s carrying %s,"
5706 " and revenues amount to %d in gold.",
5714 case TBONUS_SCIENCE:
5718 PL_(
"Your %s from %s has arrived in %s carrying %s,"
5719 " and revenues amount to %d in research.",
5720 "Your %s from %s has arrived in %s carrying %s,"
5721 " and revenues amount to %d in research.",
5733 PL_(
"Your %s from %s has arrived in %s carrying %s,"
5734 " and revenues amount to %d in gold and research.",
5735 "Your %s from %s has arrived in %s carrying %s,"
5736 " and revenues amount to %d in gold and research.",
5746 if (bonus_type == TBONUS_GOLD || bonus_type == TBONUS_BOTH) {
5752 if (bonus_type == TBONUS_SCIENCE || bonus_type == TBONUS_BOTH) {
5760 if (can_establish) {
5762 struct city_list *cities_out_of_home;
5763 struct city_list *cities_out_of_dest;
5764 struct player *partner_player;
5775 _(
"New trade route established from %s to %s."),
5778 if (pplayer != partner_player) {
5781 _(
"The %s established a trade route between their "
5788 cities_out_of_home = city_list_new();
5789 cities_out_of_dest = city_list_new();
5819 proute_to->
partner = pcity_homecity->
id;
5823 proute_from->
dir = RDIR_BIDIRECTIONAL;
5824 proute_to->
dir = RDIR_BIDIRECTIONAL;
5826 proute_from->
dir = RDIR_FROM;
5827 proute_to->
dir = RDIR_TO;
5829 trade_route_list_append(pcity_homecity->
routes, proute_from);
5830 trade_route_list_append(pcity_dest->
routes, proute_to);
5854 if (pplayer != partner_player) {
5883 city_list_destroy(cities_out_of_home);
5884 city_list_destroy(cities_out_of_dest);
5896 trade_route_list_destroy(routes_out_of_home);
5897 trade_route_list_destroy(routes_out_of_dest);
5911 int unit_id16,
int unit_id32,
5912 enum unit_ss_data_type
type,
5919 unit_id32 = unit_id16;
5924 if (NULL ==
punit) {
5927 if (
type != USSDT_UNQUEUE) {
5929 log_verbose(
"handle_unit_sscs_set() invalid unit %d", unit_id32);
5944 log_verbose(
"unit_sscs_set() invalid target tile %d for unit %d",
5970 case USSDT_BATTLE_GROUP:
5987 }
else if (value == 1) {
5997 log_verbose(
"handle_unit_sscs_set(): illegal sentry state for %s %d",
6024 int unit_id16,
int unit_id32,
6025 enum server_side_agent
agent)
6030 unit_id32 = unit_id16;
6035 if (NULL ==
punit) {
6037 log_verbose(
"handle_unit_server_side_agent_set() invalid unit %d",
6042 if (!server_side_agent_is_valid(
agent)) {
6044 log_verbose(
"handle_unit_server_side_agent_set() invalid agent %d",
6057 if (
agent == SSA_AUTOEXPLORE) {
6080 enum server_side_agent
agent)
6086 case SSA_AUTOSETTLER:
6091 case SSA_AUTOEXPLORE:
6117 enum unit_activity old_activity,
6122 switch (old_activity) {
6123 case ACTIVITY_PILLAGE:
6125 if (old_target != NULL) {
6127 if (punit2->activity == ACTIVITY_PILLAGE) {
6129 if (pdep == old_target) {
6140 case ACTIVITY_EXPLORE:
6148 case ACTIVITY_EXPLORE:
6166 const struct action *paction)
6180 enum unit_activity new_activity)
6186 && new_activity != ACTIVITY_GEN_ROAD,
FALSE);
6188 if (new_activity == ACTIVITY_PILLAGE) {
6208 enum unit_activity new_activity)
6231 const struct action *paction,
6247 enum unit_activity new_activity,
6253 new_activity, *new_target)) {
6258 if (
list != NULL && action_list_size(
list) > 0) {
6261 (*new_target) != NULL ? (*new_target)->id :
NO_TARGET,
6278 enum unit_activity new_activity,
6282 new_activity, *new_target)) {
6287 enum unit_activity stored_activity = new_activity;
6290 &new_activity, new_target);
6291 if (new_activity != stored_activity
6301 if (new_activity == ACTIVITY_PILLAGE) {
6323 int length = packet->
length;
6341 if (NULL ==
punit) {
6343 log_verbose(
"handle_unit_orders() invalid unit %d", unit_id);
6349 log_error(
"handle_unit_orders() invalid %s (%d) "
6361 log_verbose(
"handle_unit_orders() invalid %s (%d) tile (%d, %d) "
6375 log_error(
"received invalid orders from %s for %s (%d).",
6414 log_debug(
"Orders for unit %d: length:%d", unit_id, length);
6415 for (i = 0; i < length; i++) {
6422 "no action/activity required",
6451 if (pcity == NULL || pcity->
owner != pplayer || ptile == NULL) {
6461 if (ptask == NULL) {
6462 if (packet->
activity == ACTIVITY_LAST) {
6468 worker_task_list_append(pcity->
task_reqs, ptask);
6470 if (packet->
activity == ACTIVITY_LAST) {
6471 worker_task_list_remove(pcity->
task_reqs, ptask);
6477 if (ptask != NULL) {
6478 ptask->
ptile = ptile;
6480 if (packet->
tgt >= 0) {
6484 log_debug(
"Illegal worker task target %d", packet->
tgt);
6495 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)
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_vs_tile(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
const char * action_id_rule_name(action_id act_id)
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 act_prob action_prob_vs_extras(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
enum unit_activity actres_get_activity(enum action_result result)
struct act_prob action_prob_self(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id)
bool is_action_enabled_unit_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
struct act_prob action_prob_vs_units(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile)
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 action * action_is_blocked_by(const struct civ_map *nmap, const struct action *act, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city_arg, const struct unit *target_unit)
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_unit_vs_tgt(const struct civ_map *nmap, const struct action *paction, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct extra_type *extra_tgt)
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