76#define CITY_CONQUEST_WORTH(_city_, _data_) \
77 (_data_->worth * 0.9 + (city_size_get(_city_) - 0.5) * 10)
93 struct unit *attacker)
103 int fpatt, fpdef, defense,
attack;
105 struct unit *defender;
118 loss = (double) defense * punittype->hp * fpdef / (
attack * fpatt);
119 want = (loss +
MAX(0, loss - attacker->
hp)) /
cost;
123 unit_name_orig(punittype),
129 &&
cost <= best_cost)) {
131 bestunit = punittype;
148 enum terrain_class tc,
149 bool allow_gold_upkeep)
191 enum terrain_class tc,
192 enum unit_role_id role,
193 bool allow_gold_upkeep)
201 if (unit_role_id_is_valid(role)) {
238 bool igwall,
bool quadratic,
272 defense *= wall_value;
284 int defense = 0, walls = 0;
286 const bool igwall =
FALSE;
293 while (walls * walls < city_data->
wallvalue * 10) {
302 if (defense > 1<<12) {
305 if (defense > 1<<15) {
310 return defense * defense;
368 const struct player *other_player,
370 void *data,
int n_data)
373 case VUT_IMPROVEMENT:
388 case VUT_MAXTILEUNITS:
397 case VUT_MINFOREIGNPCT:
398 case VUT_NATIONALITY:
409 case VUT_DIPLREL_TILE:
410 case VUT_DIPLREL_TILE_O:
411 case VUT_DIPLREL_UNITANY:
412 case VUT_DIPLREL_UNITANY_O:
420 context, other_player, req);
435 case VUT_SERVERSETTING:
437 case VUT_NATIONGROUP:
441 case VUT_ACHIEVEMENT:
449 case VUT_TERRAINCLASS:
451 case VUT_TERRAINALTER:
473 const struct city *pcity,
484 .player = actor_player,
497 &enabler->actor_reqs, NULL,
501 &enabler->target_reqs, NULL,
514 const struct city *pcity,
523 const struct unit *ferry;
525 int amod = -99, dmod;
526 bool attack_danger =
FALSE;
539 || *move_time >
pos.turn)) {
540 *move_time =
pos.turn;
547 || *move_time >
pos.turn)) {
548 *move_time =
pos.turn;
573 attack_danger =
TRUE;
584 if (!attack_danger) {
589 attack_danger =
TRUE;
600 if (!attack_danger) {
607 punittype, NULL, EFT_DEFEND_BONUS);
608 return danger * (amod + 100) /
MAX(dmod, 1);
648 unsigned int urgency,
unsigned int danger,
651 if (*value == 0 || danger <= 0) {
655 *value =
MAX(*value, 100 + urgency);
657 if (urgency > 0 && danger > defense * 2) {
659 }
else if (defense != 0 && danger > defense) {
660 *value =
MAX(danger * 100 / defense, *value);
691 unsigned int danger_reduced[
B_LAST];
696 int total_danger = 0;
701 int defense_bonuses_pct[
U_LAST];
702 bool defender_type_handled[
U_LAST];
703 int best_non_scramble[
U_LAST];
704 bool sth_does_not_scramble =
FALSE;
705 int city_def_against[
U_LAST];
712 memset(&danger_reduced, 0,
sizeof(danger_reduced));
725 defense_bonuses_pct[idx] = 0;
726 defender_type_handled[idx] =
FALSE;
727 best_non_scramble[idx] = -1;
729 city_def_against[idx]
732 city_def_against[idx] =
MAX(city_def_against[idx], 1);
758 bonus = coeff / city_def_against[idx] - 100;
763 if (bonus > defense_bonuses_pct[idx]) {
765 best_non_scramble[idx] = bonus;
767 defense_bonuses_pct[idx] = bonus;
769 best_non_scramble[idx] =
MAX(best_non_scramble[idx], bonus);
774 sth_does_not_scramble =
TRUE;
780 if (sth_does_not_scramble || unit_list_size(ptile->
units) <= 0) {
787 best_non_scramble[
id] =
MAX(best_non_scramble[
id], 0);
802 struct unit_list *units;
814 units = ul_cb(aplayer);
816 units = aplayer->units;
820 unsigned int vulnerability;
832 if (unit_distance > ASSESS_DANGER_MAX_DISTANCE
834 && unit_distance > AI_HANDICAP_DISTANCE_LIMIT)) {
857 vulnerability =
MAX(vulnerability, 1);
858 if (3 >= move_time) {
860 if (1 >= move_time) {
866 defbonus_pct = defense_bonuses_pct[
utype_index(utype)];
867 if (defbonus_pct > 100) {
868 defbonus_pct = (defbonus_pct + 100) / 2;
871 vulnerability = vulnerability * 100 / (defbonus_pct + 100);
875 vulnerability /
MAX(move_time, 1));
881 vulnerability *= vulnerability;
883 vulnerability /= move_time;
891 danger_reduced[defender] += vulnerability /
MAX(move_time, 1);
893 }
else if (best_non_scramble[
utype_index(utype)] >= 0) {
898 int danred = vulnerability /
MAX(move_time, 1);
905 danred = danred * (100 + best_non_scramble[
utype_index(utype)])
908 danger_reduced[defender] += danred;
912 total_danger += vulnerability;
942 for (i = 0; i <
B_LAST; i++) {
943 if (0 < danger_reduced[i]) {
945 urgency, danger_reduced[i], defense);
954 city_data->
danger = total_danger;
973 int maxbonus_pct = 0;
990 if (maxbonus_pct > 100) {
991 maxbonus_pct = (maxbonus_pct + 100) / 2;
993 desire += desire * maxbonus_pct / 100;
1016 desire += desire / 2;
1022 desire += desire / 2;
1025 desire += desire / 4;
1028 desire += desire / 4;
1041 struct city *pcity,
unsigned int danger,
1054 struct unit_type *best_unit_type = NULL;
1055 int best_unit_cost = 1;
1058 adv_want total_want = danger + extra_want;
1060 memset(tech_desire, 0,
sizeof(tech_desire));
1106 if ((best_unit_cost > limit_cost
1107 && build_cost < best_unit_cost)
1110 && build_cost <= best_unit_cost))
1111 && (best_unit_type == NULL
1113 || limit_cost <= pcity->shield_stock + 40))) {
1115 best_unit_type = punittype;
1116 best_unit_cost = build_cost;
1126 / city_list_size(pplayer->
cities);
1138 (desire * total_want
1148 if (best_unit_type != NULL) {
1149 if (!walls && !
utype_has_flag(best_unit_type, UTYF_BADCITYDEFENDER)) {
1154 best_unit_cost = 100;
1180 if (!best_unit_type) {
1185 choice->
want = danger;
1215 const struct unit_type *victim_unit_type,
1216 struct player *victim_player,
1217 int veteran,
struct tile *ptile,
1219 struct pf_map *ferry_map,
1231 int victim_count = 1;
1238 struct ai_city *acity_data = NULL;
1242 if (acity != NULL) {
1247 && !boat && boattype) {
1255 victim_count += unit_list_size(ptile->
units);
1266 && punittype->attack_strength > 0 ) {
1278 .unittype = punittype,
1286 / city_list_size(pplayer->
cities);
1314 if (NULL != ferry_map) {
1315 struct tile *dest_tile;
1320 move_time =
pos.turn;
1323 if (atile == dest_tile) {
1325 move_time +=
pos.turn;
1327 }
else if (atile == ptile) {
1330 move_time =
pos.turn;
1337 if (-1 == move_time) {
1339 move_time =
pos.turn;
1349 if (victim_unit_type) {
1352 ptile,
FALSE, veteran);
1372 float finishing_factor = 1;
1386 int city_attack = acity_data->
attack * acity_data->
attack;
1390 (bcost + acity_data->
bcost), vuln,
1393 if (value * city_attack > acity_data->
bcost * vuln) {
1395 acity_data->
bcost, vuln,
1399 desire =
MAX(desire, kd);
1411 bcost_balanced + needferry);
1414 if (tech_dist > 0) {
1424 }
else if (want > best_choice->
want) {
1433 ",move_time=%d,vuln=%d,bcost=%d]",
1438 attack, value, move_time, vuln, bcost);
1441 best_choice->
want = want;
1455 best_choice->
want = want;
1482 struct city *pcity,
struct unit *myunit,
1492 struct player *def_owner;
1497 struct unit *ferryboat;
1502 struct pf_map *ferry_map = NULL;
1522 &ferry_map, &ferryboat,
1523 &boattype, &move_time);
1532 if (myunit->
id != 0) {
1533 log_error(
"%s(): non-virtual unit!", __FUNCTION__);
1544 if (NULL != acity) {
1555 if (1 < move_time && def_type) {
1572 if (vulnerability < m) {
1582 float finishing_factor = 1;
1593 if (NULL != ferry_map) {
1612 if (NULL == ferry_map) {
1615 best_choice, NULL, NULL, NULL);
1622 best_choice, ferry_map, ferryboat, boattype);
1625 if (best_choice->
want > choice->
want) {
1628 choice = best_choice;
1635 if (NULL != ferry_map && !ferryboat) {
1645 log_debug(
"kill_something_with() %s has chosen attacker ferry, "
1659 if (best_choice != choice) {
1665 if (NULL != ferry_map) {
1686 struct unit *aunit = NULL;
1687 struct city *acity = NULL;
1688 struct unit *virtualunit
1695 if (want > choice->
want) {
1696 choice->
want = want;
1752 unsigned int our_def, urgency;
1754 struct unit *virtualunit;
1757 bool martial_need =
FALSE;
1759 bool allow_gold_upkeep;
1771 martial_need =
TRUE;
1774 if (!martial_need) {
1778 martial_need =
TRUE;
1792 if (city_data->
danger != 0 || martial_value > 0) {
1794 int num_defenders = unit_list_size(ptile->
units);
1795 int wall_id, danger;
1796 bool build_walls =
TRUE;
1797 bool def_unit_selected =
FALSE;
1803 build_walls =
FALSE;
1807 if (qdanger >= our_def) {
1811 }
else if (our_def == 0) {
1812 danger = 200 + urgency;
1814 danger =
MIN(200, 100 * qdanger / our_def) + urgency;
1817 danger = 100 * qdanger / our_def;
1827 "our_def=%d", urgency, danger, num_defenders, our_def);
1829 if (our_def == 0 && danger > 0) {
1836 build_walls =
FALSE;
1837 def_unit_selected =
TRUE;
1857 && (danger < 101 || num_defenders > 1
1878 build_walls =
FALSE;
1881 build_walls =
FALSE;
1886 if (!def_unit_selected) {
1887 if ((danger > 0 && num_defenders <= urgency) || martial_value > 0) {
1894 &uchoice, martial_value)) {
1901 uchoice.
want =
MIN(49, danger);
1903 uchoice.
want =
MIN(25, danger);
1906 uchoice.
want = danger;
1909 uchoice.
want += martial_value;
1916 if (!build_walls || uchoice.
want > choice->
want) {
1944 allow_gold_upkeep =
TRUE;
1946 allow_gold_upkeep =
FALSE;
1988 pplayer, pcity, punittype,
2010 if (choice->
want <= 0) {
struct action_enabler_list * action_enablers_for_action(action_id action)
#define action_by_result_iterate(_paction_, _result_)
#define action_enabler_list_iterate_end
#define action_by_result_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
void adv_deinit_choice(struct adv_choice *choice)
void adv_init_choice(struct adv_choice *choice)
void adv_free_choice(struct adv_choice *choice)
struct adv_choice * adv_new_choice(void)
bool is_unit_choice_type(enum choice_type type)
const char * adv_choice_rule_name(const struct adv_choice *choice)
#define adv_choice_set_use(_choice, _use)
static void adv_choice_copy(struct adv_choice *dest, struct adv_choice *src)
struct adv_data * adv_data_get(struct player *pplayer, bool *caller_closes)
bool adv_is_player_dangerous(struct player *pplayer, struct player *aplayer)
int adv_unittype_att_rating(const struct unit_type *punittype, int veteran, int moves_left, int hp)
int adv_unit_att_rating(const struct unit *punit)
bool dai_choose_attacker_air(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, bool allow_gold_upkeep)
struct ai_plr * dai_plr_data_get(struct ai_type *ait, struct player *pplayer, bool *caller_closes)
void dai_choose_diplomat_defensive(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, int def)
void dai_choose_diplomat_offensive(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice)
bool dai_is_ferry_type(const struct unit_type *pferry, struct ai_type *ait)
void dai_hunter_choice(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, bool allow_gold_upkeep)
#define TECH_LOG(ait, loglevel, pplayer, padvance, msg,...)
void dai_choose_paratrooper(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, bool allow_gold_upkeep)
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
static struct ai_city * def_ai_city_data(const struct city *pcity, struct ai_type *deftype)
struct unit_type * dai_wants_defender_against(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct city *pcity, const struct unit_type *att, int want)
int ai_trait_get_value(enum trait tr, struct player *pplayer)
adv_want kill_desire(adv_want benefit, int attack, int loss, int vuln, int victim_count)
int unittype_def_rating_squared(const struct unit_type *att_type, const struct unit_type *def_type, struct player *def_player, struct tile *ptile, bool fortified, int veteran)
const struct impr_type * utype_needs_improvement(const struct unit_type *putype, const struct city *pcity)
int build_cost_balanced(const struct unit_type *punittype)
adv_want find_something_to_kill(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct tile **pdest_tile, struct pf_path **ppath, struct pf_map **pferrymap, struct unit **pferryboat, const struct unit_type **pboattype, int *pmove_time)
adv_want look_for_charge(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct unit **aunit, struct city **acity)
bool dai_can_unit_type_follow_unit_type(const struct unit_type *follower, const struct unit_type *followee, struct ai_type *ait)
bool find_beachhead(const struct player *pplayer, struct pf_map *ferry_map, struct tile *dest_tile, const struct unit_type *cargo_type, struct tile **ferry_dest, struct tile **beachhead_tile)
#define POTENTIALLY_HOSTILE_PLAYER(ait, pplayer, aplayer)
#define simple_ai_unit_type_iterate_end
#define simple_ai_unit_type_iterate(_ut)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
const char * city_name_get(const struct city *pcity)
int city_production_unit_veteran_level(struct city *pcity, const struct unit_type *punittype)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove)
bool city_got_defense_effect(const struct city *pcity, const struct unit_type *attacker)
bool can_city_build_unit_direct(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
bool can_city_build_unit_later(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
int city_total_unit_gold_upkeep(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_list_iterate_end
bool is_stack_vulnerable(const struct tile *ptile)
int get_fortified_defense_power(const struct unit *attacker, struct unit *defender)
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)
bool can_unit_attack_tile(const struct unit *punit, const struct action *paction, const struct tile *dest_tile)
struct unit * get_defender(const struct civ_map *nmap, const struct unit *attacker, const struct tile *ptile)
void get_modified_firepower(const struct civ_map *nmap, const struct unit *attacker, const struct unit *defender, int *att_fp, int *def_fp)
Impr_type_id dai_find_source_building(struct city *pcity, enum effect_type effect_type, const struct unit_type *utype)
adv_want dai_content_effect_value(const struct player *pplayer, const struct city *pcity, int amount, int num_cities, int happiness_step)
struct unit_type * dai_choose_defender_versus(struct city *pcity, struct unit *attacker)
int assess_defense(struct ai_type *ait, struct city *pcity)
static adv_want dai_unit_attack_desirability(struct ai_type *ait, const struct unit_type *punittype)
struct adv_choice * military_advisor_choose_build(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct city *pcity, player_unit_list_getter ul_cb)
static unsigned int assess_danger(struct ai_type *ait, const struct civ_map *nmap, struct city *pcity, player_unit_list_getter ul_cb)
static bool action_may_happen_unit_on_city(const action_id wanted_action, const struct unit *actor, const struct city *pcity, int turns)
static void dai_reevaluate_building(struct city *pcity, adv_want *value, unsigned int urgency, unsigned int danger, int defense)
static void process_attacker_want(struct ai_type *ait, struct city *pcity, adv_want value, const struct unit_type *victim_unit_type, struct player *victim_player, int veteran, struct tile *ptile, struct adv_choice *best_choice, struct pf_map *ferry_map, struct unit *boat, const struct unit_type *boattype)
static struct adv_choice * kill_something_with(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct unit *myunit, struct adv_choice *choice)
bool dai_process_defender_want(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct city *pcity, unsigned int danger, struct adv_choice *choice, adv_want extra_want)
static void adjust_ai_unit_choice(struct city *pcity, struct adv_choice *choice)
static adv_want dai_unit_defense_desirability(struct ai_type *ait, const struct unit_type *punittype)
#define CITY_CONQUEST_WORTH(_city_, _data_)
static enum fc_tristate tactical_req_cb(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
int assess_defense_quadratic(struct ai_type *ait, struct city *pcity)
static struct unit_type * dai_choose_bodyguard(struct ai_type *ait, const struct civ_map *nmap, struct city *pcity, enum terrain_class tc, enum unit_role_id role, bool allow_gold_upkeep)
static int base_assess_defense_unit(struct city *pcity, struct unit *punit, bool igwall, bool quadratic, int wall_value)
static unsigned int assess_danger_unit(const struct civ_map *nmap, const struct city *pcity, struct pf_reverse_map *pcity_map, const struct unit *punit, int *move_time)
static int assess_defense_backend(struct ai_type *ait, struct city *pcity, bool igwall)
static struct unit_type * dai_choose_attacker(struct ai_type *ait, struct city *pcity, enum terrain_class tc, bool allow_gold_upkeep)
void dai_assess_danger_player(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer)
int assess_defense_unit(struct ai_type *ait, struct city *pcity, struct unit *punit, bool igwall)
static int assess_defense_igwall(struct ai_type *ait, struct city *pcity)
static void dai_unit_consider_bodyguard(struct ai_type *ait, const struct civ_map *nmap, struct city *pcity, struct unit_type *punittype, struct adv_choice *choice)
struct unit_list *() player_unit_list_getter(struct player *pplayer)
#define FINISH_HIM_CITY_COUNT
static void attack(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 * actor
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
bool ai_fuzzy(const struct player *pplayer, bool normal_decision)
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)
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)
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
@ H_ASSESS_DANGER_LIMITED
struct impr_type * improvement_by_number(const Impr_type_id id)
const char * improvement_rule_name(const struct impr_type *pimprove)
int impr_buy_gold_cost(const struct city *pcity, const struct impr_type *pimprove, int shields_in_stock)
bool is_great_wonder(const struct impr_type *pimprove)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
bool can_attack_from_non_native(const struct unit_type *utype)
bool is_native_near_tile(const struct civ_map *nmap, const struct unit_class *uclass, const struct tile *ptile)
bool can_attack_non_native(const struct unit_type *utype)
struct city_list * cities
bool pf_reverse_map_unit_position(struct pf_reverse_map *pfrm, const struct unit *punit, struct pf_position *pos)
const struct pf_parameter * pf_map_parameter(const struct pf_map *pfm)
struct pf_map * pf_map_new(const struct pf_parameter *parameter)
bool pf_map_position(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos)
void pf_map_iter_position(struct pf_map *pfm, struct pf_position *pos)
struct pf_reverse_map * pf_reverse_map_new_for_city(const struct civ_map *nmap, const struct city *pcity, const struct player *attacker, int max_turns, bool omniscient)
void pf_reverse_map_destroy(struct pf_reverse_map *pfrm)
void pf_map_destroy(struct pf_map *pfm)
#define pf_map_tiles_iterate(ARG_pfm, NAME_tile, COND_from_start)
#define pf_map_tiles_iterate_end
#define players_iterate_end
#define players_iterate(_pplayer)
static bool player_is_cpuhog(const struct player *pplayer)
enum fc_tristate tri_req_active_turns(int pass, int period, const struct req_context *context, const struct player *other_player, const struct requirement *req)
enum fc_tristate tri_reqs_cb_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, struct requirement_vector *maybe_reqs, req_tester_cb tester, void *data, int n_data)
enum fc_tristate tri_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req)
enum req_unchanging_status is_req_preventing(const struct req_context *context, const struct player *other_player, const struct requirement *req, enum req_problem_type prob_type)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
int research_goal_bulbs_required(const struct research *presearch, Tech_type_id goal)
struct research * research_get(const struct player *pplayer)
int get_specialist_output(const struct city *pcity, Specialist_type_id sp, Output_type_id otype)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
#define CITY_LOG(loglevel, pcity, msg,...)
#define TIMING_LOG(timer, activity)
enum server_states server_state(void)
adv_want building_want[B_LAST]
struct ai_invasion invasion
unsigned int grave_danger
struct ai_plr::@267 stats
adv_want tech_want[A_LAST+1]
citizens feel[CITIZEN_LAST][FEELING_LAST]
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct packet_game_info info
int low_firepower_pearl_harbour
int low_firepower_combat_bonus
struct city_list * cities
struct player_economic economic
const struct player * player
int max_defense_mp_bonus_pct
struct unit_type::@87 adv
int scramble_coeff[U_LAST]
struct unit_type::@88 cache
int defense_mp_bonuses_pct[U_LAST]
Tech_type_id advance_index(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
struct city * tile_city(const struct tile *ptile)
#define TRAIT_DEFAULT_VALUE
const struct unit_type * utype
const struct impr_type * building
struct unit * unit_transport_get(const struct unit *pcargo)
bool is_military_unit(const struct unit *punit)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
void unit_virtual_destroy(struct unit *punit)
bool unit_transported(const struct unit *pcargo)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
int utype_upkeep_cost(const struct unit_type *ut, struct player *pplayer, Output_type_id otype)
bool utype_has_role(const struct unit_type *punittype, int role)
int utype_build_shield_cost_base(const struct unit_type *punittype)
int unit_build_shield_cost_base(const struct unit *punit)
const char * utype_rule_name(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)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
bool unit_can_take_over(const struct unit *punit)
void * utype_ai_data(const struct unit_type *ptype, const struct ai_type *ai)
Unit_type_id utype_index(const struct unit_type *punittype)
bool utype_can_take_over(const struct unit_type *punittype)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
bool utype_acts_hostile(const struct unit_type *putype)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
#define utype_fuel(ptype)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define unit_type_iterate_end