47 { ACTIVITY_PILLAGE, ACTIVITY_GEN_ROAD, ACTIVITY_IRRIGATE, ACTIVITY_MINE,
48 ACTIVITY_BASE, ACTIVITY_CULTIVATE, ACTIVITY_PLANT, ACTIVITY_TRANSFORM,
49 ACTIVITY_POLLUTION, ACTIVITY_FALLOUT, ACTIVITY_LAST };
56#define CARGO_ITER(iter) ((struct cargo_iter *) (iter))
69 && order1->
dir == order2->
dir;
84 const struct player *restriction,
86 const struct city *pdest_city)
89 const struct player *punit_owner;
108 if (NULL == psrc_city) {
113 if (psrc_city == pdest_city) {
119 && (NULL == restriction
147 if (NULL == restriction ||
city_owner(psrc_city) == restriction) {
164 if (NULL == restriction ||
city_owner(pdest_city) == restriction) {
190 const struct city *pdest_city)
218 const struct action *paction)
223 const struct player *act_player;
225 has_unit =
punit != NULL;
227 if (has_unit && punittype == NULL) {
244 .player = act_player,
246 .unittype = punittype,
250 EFT_UNIT_SHIELD_VALUE_PCT))
288 struct city *phomecity, *pdestcity;
339 enum action_result result)
349 enum action_sub_result sub_result)
358 const struct player *pplayer,
359 const struct tile *ptile,
bool omniscient)
399 if (vl == V_INVIS || vl == V_SUBSURFACE) {
405 if (vl == V_INVIS || vl == V_SUBSURFACE) {
430 struct city *tgt_city;
434 ACTION_JOIN_CITY, tgt_city));
446 const struct city *pcity)
522 enum unit_activity activity,
523 const struct tile *ptile,
531 if (points_needed >= 0 && speed > 0) {
532 return (points_needed - 1) / speed + 1;
544 case ACTIVITY_PILLAGE:
546 case ACTIVITY_GEN_ROAD:
547 case ACTIVITY_IRRIGATE:
549 case ACTIVITY_POLLUTION:
550 case ACTIVITY_FALLOUT:
553 case ACTIVITY_FORTIFIED:
554 case ACTIVITY_SENTRY:
556 case ACTIVITY_EXPLORE:
557 case ACTIVITY_TRANSFORM:
558 case ACTIVITY_CULTIVATE:
560 case ACTIVITY_FORTIFYING:
561 case ACTIVITY_CONVERT:
564 case ACTIVITY_FORTRESS:
565 case ACTIVITY_AIRBASE:
566 case ACTIVITY_PATROL_UNUSED:
596 for (act = 0; act < ACTIVITY_LAST; act++) {
613 return (activity < ACTIVITY_LAST)
614 && activity != ACTIVITY_FORTRESS
615 && activity != ACTIVITY_AIRBASE
616 && activity != ACTIVITY_OLD_ROAD
617 && activity != ACTIVITY_OLD_RAILROAD
618 && activity != ACTIVITY_UNKNOWN
619 && activity != ACTIVITY_PATROL_UNUSED;
633 case ACTIVITY_POLLUTION:
634 return _(
"Pollution");
637 return Q_(
"?act:Mine");
641 case ACTIVITY_IRRIGATE:
642 return _(
"Irrigate");
643 case ACTIVITY_CULTIVATE:
644 return _(
"Cultivate");
645 case ACTIVITY_FORTIFYING:
646 return _(
"Fortifying");
647 case ACTIVITY_FORTIFIED:
648 return _(
"Fortified");
649 case ACTIVITY_SENTRY:
651 case ACTIVITY_PILLAGE:
655 case ACTIVITY_EXPLORE:
657 case ACTIVITY_TRANSFORM:
658 return _(
"Transform");
659 case ACTIVITY_FALLOUT:
663 case ACTIVITY_GEN_ROAD:
665 case ACTIVITY_CONVERT:
667 case ACTIVITY_OLD_ROAD:
668 case ACTIVITY_OLD_RAILROAD:
669 case ACTIVITY_FORTRESS:
670 case ACTIVITY_AIRBASE:
671 case ACTIVITY_UNKNOWN:
672 case ACTIVITY_PATROL_UNUSED:
688 const struct unit *ptrans)
721 if (!pcargo || !ptrans || pcargo == ptrans) {
773 if (!pcargo || !ptrans) {
797 const struct unit *pcargo,
798 const struct unit *ptrans)
800 if (!pcargo || !ptrans) {
850 enum unit_activity current2 =
851 (current == ACTIVITY_FORTIFIED) ? ACTIVITY_FORTIFYING : current;
874 enum unit_activity activity)
885 if (activity == ACTIVITY_IRRIGATE) {
890 if (NULL == target) {
893 }
else if (activity == ACTIVITY_MINE) {
898 if (NULL == target) {
913 enum unit_activity activity,
926 enum unit_activity activity,
928 const struct tile *ptile)
947#define RETURN_IS_ACTIVITY_ENABLED_UNIT_ON(paction) \
949 switch (action_get_target_kind(paction)) { \
951 return is_action_enabled_unit_on_tile(nmap, paction->id, \
952 punit, ptile, target); \
954 return is_action_enabled_unit_on_extras(nmap, paction->id, \
955 punit, ptile, target); \
964 fc_assert(action_target_kind_is_valid( \
965 action_get_target_kind(paction))); \
974 case ACTIVITY_POLLUTION:
977 "Please use action_speculate_unit_on_tile()");
979 punit, ptile, target);
981 case ACTIVITY_FALLOUT:
984 "Please use action_speculate_unit_on_tile()");
986 punit, ptile, target);
991 "Please use action_speculate_unit_on_tile()");
998 "Please use action_speculate_unit_on_tile()");
1000 punit, ptile, NULL);
1002 case ACTIVITY_IRRIGATE:
1005 "Please use action_speculate_unit_on_tile()");
1009 case ACTIVITY_CULTIVATE:
1012 "Please use action_speculate_unit_on_tile()");
1014 punit, ptile, NULL);
1016 case ACTIVITY_FORTIFYING:
1019 "Please use action_speculate_unit_on_self()");
1023 case ACTIVITY_FORTIFIED:
1029 "Please use action_speculate_unit_on_tile()");
1031 punit, ptile, target);
1033 case ACTIVITY_GEN_ROAD:
1036 "Please use action_speculate_unit_on_tile()");
1038 punit, ptile, target);
1040 case ACTIVITY_SENTRY:
1048 case ACTIVITY_PILLAGE:
1051 "Please use action_speculate_unit_on_tile()");
1054 case ACTIVITY_EXPLORE:
1057 case ACTIVITY_TRANSFORM:
1060 "Please use action_speculate_unit_on_tile()");
1062 punit, ptile, NULL);
1064 case ACTIVITY_CONVERT:
1067 "Please use action_speculate_unit_on_self()");
1070 case ACTIVITY_OLD_ROAD:
1071 case ACTIVITY_OLD_RAILROAD:
1072 case ACTIVITY_FORTRESS:
1073 case ACTIVITY_AIRBASE:
1074 case ACTIVITY_PATROL_UNUSED:
1076 case ACTIVITY_UNKNOWN:
1079 log_error(
"can_unit_do_activity_targeted_at() unknown activity %d",
1083#undef RETURN_IS_ACTIVITY_ENABLED_UNIT_ON
1090 enum unit_activity new_activity)
1093 && new_activity != ACTIVITY_AIRBASE);
1111 if (new_activity == ACTIVITY_FORTIFYING
1113 new_activity = ACTIVITY_FORTIFIED;
1125 enum unit_activity new_activity,
1129 || new_target == NULL);
1143 const struct tile *ptile)
1176 if (!
punit || !astr) {
1199 case ACTIVITY_POLLUTION:
1200 case ACTIVITY_FALLOUT:
1201 case ACTIVITY_OLD_ROAD:
1202 case ACTIVITY_OLD_RAILROAD:
1203 case ACTIVITY_TRANSFORM:
1204 case ACTIVITY_FORTIFYING:
1205 case ACTIVITY_FORTIFIED:
1206 case ACTIVITY_AIRBASE:
1207 case ACTIVITY_FORTRESS:
1208 case ACTIVITY_SENTRY:
1210 case ACTIVITY_EXPLORE:
1211 case ACTIVITY_CONVERT:
1212 case ACTIVITY_CULTIVATE:
1213 case ACTIVITY_PLANT:
1217 case ACTIVITY_IRRIGATE:
1225 case ACTIVITY_PILLAGE:
1237 case ACTIVITY_GEN_ROAD:
1241 case ACTIVITY_UNKNOWN:
1242 case ACTIVITY_PATROL_UNUSED:
1247 log_error(
"Unknown unit activity %d for %s (nb %d) in %s()",
1259 if (!
punit || !astr) {
1295 const struct player *pplayer)
1318 const struct player *pplayer)
1333 const struct player *pplayer)
1350 const struct player *pplayer)
1366 const struct player *pplayer)
1387 const struct player *pplayer)
1426 if (pcity != NULL) {
1427 if (unit_list_size(ptile->units) > 0) {
1437 bool hidden =
FALSE;
1486 if (pcity != NULL) {
1564 case ACTIVITY_IRRIGATE:
1566 case ACTIVITY_GEN_ROAD:
1579 case ACTIVITY_PILLAGE:
1580 case ACTIVITY_POLLUTION:
1581 case ACTIVITY_FALLOUT:
1594 case ACTIVITY_CULTIVATE:
1595 case ACTIVITY_PLANT:
1596 case ACTIVITY_TRANSFORM:
1778 const struct tile *ptile,
1779 bool (*unit_load_test)
1780 (
const struct unit *pc,
1781 const struct unit *pt))
1783 struct unit *best_trans = NULL;
1786 int depth, outermost_moves_left, total_moves;
1787 } cur, best = {
FALSE };
1790 if (!unit_load_test(pcargo, ptrans)) {
1792 }
else if (best_trans == NULL) {
1793 best_trans = ptrans;
1799 cur.outermost_moves_left = ptrans->moves_left;
1803 cur.has_orders =
TRUE;
1805 cur.outermost_moves_left = ptranstrans->moves_left;
1806 cur.total_moves += ptranstrans->moves_left +
unit_move_rate(ptranstrans);
1816 if (best_trans != ptrans) {
1817 if (!cur.has_orders && best.has_orders) {
1818 best_trans = ptrans;
1819 }
else if (cur.has_orders && !best.has_orders) {
1827 cur.is_idle = (ptrans->activity == ACTIVITY_IDLE);
1828 if (best_trans != ptrans) {
1829 if (cur.is_idle && !best.is_idle) {
1830 best_trans = ptrans;
1831 }
else if (!cur.is_idle && best.is_idle) {
1841 if (best_trans != ptrans) {
1842 if (cur.can_freely_unload && !best.can_freely_unload) {
1843 best_trans = ptrans;
1844 }
else if (!cur.can_freely_unload && best.can_freely_unload) {
1851 if (best_trans != ptrans) {
1852 if (cur.depth < best.depth) {
1853 best_trans = ptrans;
1854 }
else if (cur.depth > best.depth) {
1862 if (best_trans != ptrans) {
1863 if (cur.outermost_moves_left > best.outermost_moves_left) {
1864 best_trans = ptrans;
1865 }
else if (cur.outermost_moves_left < best.outermost_moves_left) {
1876 if (best_trans != ptrans) {
1877 if (cur.total_moves > best.total_moves) {
1878 best_trans = ptrans;
1907 const struct tile *ptile)
2037 char *buf,
size_t bufsz)
2048 "Treasury contains %d gold.",
2058 "Upgrade %s to %s for %d gold?\n%s",
2062 upgrade_cost, tbuf);
2066 _(
"Sorry, cannot upgrade %s (yet)."),
2073 "Upgrading %s to %s costs %d gold.\n%s",
2077 upgrade_cost, tbuf);
2082 _(
"You can only upgrade units in your cities."));
2086 _(
"Upgrading this %s would strand units it transports."),
2091 _(
"Upgrading this %s would result in a %s which can not "
2092 "survive at this place."),
2098 _(
"Upgrading this %s would result in a %s which its "
2099 "current transport, %s, could not transport."),
2106 _(
"Cannot upgrade %s while doing '%s'."),
2136 EFT_ACTION_SUCCESS_MOVE_COST);
2188 if (gain > hp_loss) {
2202 }
else if (
punit->
hp + gain < 0) {
2290 int cost, default_hp, dist = 0;
2328 EFT_UNIT_BRIBE_COST_PCT))
2348 return ((
float)
cost / 2 * (1.0 + (
float)
punit->
hp / default_hp));
2376 struct unit *ptrans;
2391#ifndef FREECIV_NDEBUG
2450 return (trans_utype != cargo_utype
2464 const struct unit *ptrans)
2507 if (ptrans == plevel) {
2525 if (iter.
depth > depth) {
2560 return unit_list_link_data(iter->
links[iter->
depth - 1]);
2569 const struct unit_list_link *piter;
2570 const struct unit_list_link *pnext;
2574 if (NULL != pnext) {
2580 while (iter->
depth > 0) {
2584 pnext = unit_list_link_next(piter);
2585 if (NULL != pnext) {
2607 const struct unit *ptrans)
2615 iter->
depth = (NULL != iter->
links[0] ? 1 : 0);
2637 for (i = 0; i < length; i++) {
2642 log_error(
"invalid order %d at index %d", orders[i].order, i);
2645 switch (orders[i].order) {
2649 log_error(
"in order %d, invalid move direction %d.", i, orders[i].dir);
2654 switch (orders[i].activity) {
2655 case ACTIVITY_SENTRY:
2656 if (i != length - 1) {
2658 log_error(
"activity %d is not allowed at index %d.", orders[i].activity,
2665 case ACTIVITY_GEN_ROAD:
2666 case ACTIVITY_FALLOUT:
2667 case ACTIVITY_POLLUTION:
2668 case ACTIVITY_PILLAGE:
2670 case ACTIVITY_IRRIGATE:
2671 case ACTIVITY_PLANT:
2672 case ACTIVITY_CULTIVATE:
2673 case ACTIVITY_TRANSFORM:
2674 case ACTIVITY_CONVERT:
2675 case ACTIVITY_FORTIFYING:
2676 log_error(
"at index %d, use action rather than activity %d.",
2677 i, orders[i].activity);
2680 case ACTIVITY_EXPLORE:
2684 case ACTIVITY_FORTIFIED:
2686 case ACTIVITY_OLD_ROAD:
2687 case ACTIVITY_OLD_RAILROAD:
2688 case ACTIVITY_FORTRESS:
2689 case ACTIVITY_AIRBASE:
2691 case ACTIVITY_PATROL_UNUSED:
2693 case ACTIVITY_UNKNOWN:
2694 log_error(
"at index %d, unsupported activity %d.", i, orders[i].activity);
2702 log_error(
"at index %d, the action %d doesn't exist.", i, orders[i].
action);
2710 log_error(
"at index %d, invalid tile target %d for the action %d.",
2711 i, orders[i].target, orders[i].
action);
2716 log_error(
"at index %d, the action %d sets the outdated target"
2717 " specification dir.",
2727 log_error(
"at index %d, cannot do %s without a target.", i,
2734 if (orders[i].sub_target ==
A_NONE
2736 && orders[i].sub_target !=
A_FUTURE)) {
2738 log_error(
"at index %d, cannot do %s without a target.", i,
2744 case ASTK_EXTRA_NOT_THERE:
2752 if (pextra == NULL) {
2755 log_error(
"at index %d, cannot do %s without a target.", i,
2763 log_error(
"at index %d, cannot do %s to %s.", i,
2778 "Bad action %d in order number %d.", orders[i].
action, i);
2782 if (i != length - 1) {
2793 log_error(
"action %d is not allowed at index %d.",
bool action_removes_extra(const struct action *paction, const struct extra_type *pextra)
bool action_prob_possible(const struct act_prob probability)
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)
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)
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)
bool action_id_exists(const action_id act_id)
bool action_creates_extra(const struct action *paction, const struct extra_type *pextra)
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
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)
#define action_by_result_iterate(_paction_, _result_)
#define action_id_get_sub_target_kind(act_id)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_by_result_iterate_end
int ai_type_number(const struct ai_type *ai)
#define CALL_FUNC_EACH_AI(_func,...)
void astr_add_line(struct astring *astr, const char *format,...)
void astr_add(struct astring *astr, const char *format,...)
bool is_capital(const struct city *pcity)
struct city * tile_non_allied_city(const struct tile *ptile, const struct player *pplayer)
bool is_unit_near_a_friendly_city(const struct civ_map *nmap, const struct unit *punit)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_list_iterate_end
static void base(QVariant data1, QVariant data2)
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 struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
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_unit_bonus(const struct unit *punit, enum effect_type effect_type)
int get_unittype_bonus(const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, const struct action *paction, enum effect_type effect_type)
static bool is_server(void)
enum unit_activity Activity_type_id
#define IDENTITY_NUMBER_ZERO
#define PL_(String1, String2, n)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
#define GAME_UNIT_BRIBE_DIST_MAX
#define GAME_TRANSPORT_MAX_RECURSIVE
struct impr_type * improvement_by_number(const Impr_type_id id)
static bool iterator_valid(const struct iterator *it)
static void iterator_next(struct iterator *it)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
bool same_pos(const struct tile *tile1, const struct tile *tile2)
bool map_untrusted_dir_is_valid(enum direction8 dir)
enum direction8 rand_direction(void)
int map_distance(const struct tile *tile0, const struct tile *tile1)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
#define fc_calloc(n, esz)
const char * move_points_text(int mp, bool reduce)
bool can_exist_at_tile(const struct civ_map *nmap, const struct unit_type *utype, const struct tile *ptile)
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)
bool can_unit_transport(const struct unit *transporter, const struct unit *transported)
int unit_move_rate(const struct unit *punit)
bool can_unit_survive_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_near_tile(const struct civ_map *nmap, const struct unit_class *uclass, const struct tile *ptile)
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
bool can_attack_non_native(const struct unit_type *utype)
struct city_list * cities
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_non_attack(const struct player *pplayer, const struct player *pplayer2)
struct setting_list * level[OLEVELS_NUM]
enum act_tgt_compl target_complexity
const struct unit_list_link * links[GAME_TRANSPORT_MAX_RECURSIVE]
struct city::@17::@20 client
struct civ_game::@30::@34 server
struct packet_ruleset_control control
struct packet_game_info info
bool(* valid)(const struct iterator *it)
void *(* get)(const struct iterator *it)
void(* next)(struct iterator *it)
enum borders_mode borders
enum happyborders_type happyborders
enum airlifting_style airlifting_style
bool airlift_from_always_enabled
bool airlift_to_always_enabled
struct player_economic economic
struct extra_type_list * hiding_extras
enum unit_activity activity
struct unit_type::@87 adv
const struct unit_type * converted_to
enum action_decision action_decision_want
enum unit_activity activity
struct unit_list * transporting
struct unit::@80::@82 client
struct extra_type * changed_from_target
struct extra_type * activity_target
struct act_prob * act_prob_cache
enum unit_activity changed_from
struct player * nationality
void(* removal_callback)(struct unit *punit)
void * ais[FREECIV_AI_MOD_LAST]
struct unit::@80::@83 server
struct unit * transporter
struct goods_type * carrying
struct tile * action_decision_tile
const struct unit_type * utype
enum unit_focus_status focus_status
enum server_side_agent ssa_controller
int fc_snprintf(char *str, size_t n, const char *format,...)
struct advance * valid_advance_by_number(const Tech_type_id id)
#define terrain_has_flag(terr, flag)
bool tile_has_not_aggressive_extra_for_unit(const struct tile *ptile, const struct unit_type *punittype)
bool tile_is_placing(const struct tile *ptile)
int tile_activity_time(enum unit_activity activity, const struct tile *ptile, const struct extra_type *tgt)
bool tile_has_native_base(const struct tile *ptile, const struct unit_type *punittype)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
bool can_cities_trade(const struct city *pc1, const struct city *pc2)
bool unit_can_do_action_sub_result(const struct unit *punit, enum action_sub_result sub_result)
size_t cargo_iter_sizeof(void)
Activity_type_id real_activities[ACTIVITY_LAST]
bool is_real_activity(enum unit_activity activity)
bool can_unit_do_activity_targeted_at(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, struct extra_type *target, const struct tile *ptile)
bool is_tile_activity(enum unit_activity activity)
struct unit_order * create_unit_orders(const struct civ_map *nmap, int length, const struct unit_order *orders)
enum unit_upgrade_result unit_transform_result(const struct civ_map *nmap, const struct unit *punit, const struct unit_type *to_unittype)
bool unit_type_really_ignores_zoc(const struct unit_type *punittype)
bool unit_type_is_losing_hp(const struct player *pplayer, const struct unit_type *punittype)
bool is_terrain_change_activity(enum unit_activity activity)
struct unit * tile_non_allied_unit(const struct tile *ptile, const struct player *pplayer)
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)
static void cargo_iter_next(struct iterator *it)
bool can_unit_change_homecity_to(const struct civ_map *nmap, const struct unit *punit, const struct city *pcity)
void free_unit_orders(struct unit *punit)
void unit_set_ai_data(struct unit *punit, const struct ai_type *ai, void *data)
bool unit_is_alive(int id)
bool unit_can_est_trade_route_here(const struct unit *punit)
bool is_hiding_unit(const struct unit *punit)
int get_activity_rate_this_turn(const struct unit *punit)
int unit_pays_mp_for_action(const struct action *paction, const struct unit *punit)
int get_turns_for_activity_at(const struct unit *punit, enum unit_activity activity, const struct tile *ptile, struct extra_type *tgt)
bool is_plr_zoc_client(const struct player *pplayer, const struct tile *ptile0, const struct civ_map *zmap)
bool unit_transport_load(struct unit *pcargo, struct unit *ptrans, bool force)
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
struct iterator * cargo_iter_init(struct cargo_iter *iter, const struct unit *ptrans)
enum unit_upgrade_result unit_upgrade_info(const struct civ_map *nmap, const struct unit *punit, char *buf, size_t bufsz)
int unit_transport_depth(const struct unit *pcargo)
void set_unit_activity(struct unit *punit, enum unit_activity new_activity)
bool is_losing_hp(const struct unit *punit)
bool can_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
struct unit * tile_non_attack_unit(const struct tile *ptile, const struct player *pplayer)
int hp_gain_coord(const struct unit *punit)
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
static void * cargo_iter_get(const struct iterator *it)
struct player * unit_nationality(const struct unit *punit)
bool unit_being_aggressive(const struct civ_map *nmap, const struct unit *punit)
int get_activity_rate(const struct unit *punit)
bool unit_transport_check(const struct unit *pcargo, const struct unit *ptrans)
bool is_attack_unit(const struct unit *punit)
bool unit_can_airlift_to(const struct civ_map *nmap, const struct unit *punit, const struct city *pdest_city)
const Activity_type_id tile_changing_activities[]
void setup_real_activities_array(void)
struct unit * unit_transport_get(const struct unit *pcargo)
bool unit_transport_unload(struct unit *pcargo)
bool is_build_activity(enum unit_activity activity)
bool unit_contained_in(const struct unit *pcargo, const struct unit *ptrans)
int unit_gain_hitpoints(const struct unit *punit)
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 is_military_unit(const struct unit *punit)
bool can_unit_continue_current_activity(const struct civ_map *nmap, struct unit *punit)
int unit_bribe_cost(struct unit *punit, struct player *briber)
void unit_upkeep_astr(const struct unit *punit, struct astring *astr)
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_is_cityfounder(const struct unit *punit)
bool is_unit_activity_on_tile(enum unit_activity activity, const struct tile *ptile)
bool can_unit_do_autosettlers(const struct unit *punit)
bool is_field_unit(const struct unit *punit)
static bool cargo_iter_valid(const struct iterator *it)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
bool unit_can_do_action_result(const struct unit *punit, enum action_result result)
#define RETURN_IS_ACTIVITY_ENABLED_UNIT_ON(paction)
void set_unit_activity_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type *new_target)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
int unit_cargo_depth(const struct unit *ptrans)
static bool unit_transport_check_one(const struct unit_type *cargo_utype, const struct unit_type *trans_utype)
bool unit_order_list_is_sane(const struct civ_map *nmap, int length, const struct unit_order *orders)
const char * get_activity_text(enum unit_activity activity)
bv_extras get_unit_tile_pillage_set(const struct tile *ptile)
int get_transporter_capacity(const struct unit *punit)
bool is_plr_zoc_srv(const struct player *pplayer, const struct tile *ptile0, const struct civ_map *zmap)
bool is_clean_activity(enum unit_activity activity)
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
void unit_activity_astr(const struct unit *punit, struct astring *astr)
bool unit_can_help_build_wonder_here(const struct civ_map *nmap, const struct unit *punit)
bool can_unit_do_activity(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity)
struct unit * tile_other_players_unit(const struct tile *ptile, const struct player *pplayer)
void unit_virtual_destroy(struct unit *punit)
struct unit * tile_enemy_unit(const struct tile *ptile, const struct player *pplayer)
void unit_tile_set(struct unit *punit, struct tile *ptile)
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 are_unit_orders_equal(const struct unit_order *order1, const struct unit_order *order2)
bool unit_is_virtual(const struct unit *punit)
static void set_unit_activity_internal(struct unit *punit, enum unit_activity new_activity)
bool is_square_threatened(const struct civ_map *nmap, const struct player *pplayer, const struct tile *ptile, bool omniscient)
bool can_unit_unload(const struct unit *pcargo, const struct unit *ptrans)
struct unit * unit_occupies_tile(const struct tile *ptile, const struct player *pplayer)
struct unit_list * unit_transport_cargo(const struct unit *ptrans)
static bool can_type_transport_units_cargo(const struct unit_type *utype, const struct unit *punit)
void * unit_ai_data(const struct unit *punit, const struct ai_type *ai)
bool unit_has_orders(const struct unit *punit)
struct unit * tile_allied_unit(const struct tile *ptile, const struct player *pplayer)
struct unit * transporter_for_unit(const struct unit *pcargo)
static struct unit * base_transporter_for_unit(const struct unit *pcargo, const struct tile *ptile, bool(*unit_load_test)(const struct unit *pc, const struct unit *pt))
bool unit_can_convert(const struct civ_map *nmap, const struct unit *punit)
bool activity_requires_target(enum unit_activity activity)
bool could_unit_be_in_transport(const struct unit *pcargo, const struct unit *ptrans)
bool can_unit_do_activity_targeted(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, struct extra_type *target)
bool can_unit_alight_or_be_unloaded(const struct civ_map *nmap, const struct unit *pcargo, const struct unit *ptrans)
#define unit_transports_iterate_end
#define unit_cargo_iterate_end
#define unit_transported_server(_pcargo_)
#define unit_cargo_iterate(_ptrans, _pcargo)
#define unit_transports_iterate(_pcargo, _ptrans)
@ UU_UNSUITABLE_TRANSPORT
#define unit_transported_client(_pcargo_)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
const struct unit_type * unit_type_get(const struct unit *punit)
int utype_pays_mp_for_action_base(const struct action *paction, const struct unit_type *putype)
bool utype_can_freely_unload(const struct unit_type *pcargotype, const struct unit_type *ptranstype)
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)
bool utype_is_cityfounder(const struct unit_type *utype)
const char * unit_rule_name(const struct unit *punit)
int utype_build_shield_cost_base(const struct unit_type *punittype)
bool utype_may_act_move_frags(const struct unit_type *punit_type, const action_id act_id, const int move_fragments)
int unit_build_shield_cost_base(const struct unit *punit)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
bool utype_can_freely_load(const struct unit_type *pcargotype, const struct unit_type *ptranstype)
int utype_veteran_levels(const struct unit_type *punittype)
struct unit_class * unit_class_get(const struct unit *punit)
bool utype_can_do_action_result(const struct unit_type *putype, enum action_result result)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
bool utype_is_consumed_by_action(const struct action *paction, const struct unit_type *utype)
bool utype_can_do_action_sub_result(const struct unit_type *putype, enum action_sub_result sub_result)
bool utype_is_unmoved_by_action(const struct action *paction, const struct unit_type *utype)
bool utype_acts_hostile(const struct unit_type *putype)
const char * utype_name_translation(const struct unit_type *punittype)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
int unit_upgrade_price(const struct player *pplayer, const struct unit_type *from, const struct unit_type *to)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define utype_fuel(ptype)
static bool utype_has_flag(const struct unit_type *punittype, int flag)