102 ||
ut->attack_strength <
ut->transport_capacity
109 *
ut->attack_strength
114 if (
utai->missile_platform) {
193 *
MIN(
ut->attack_strength, 30)
212 if (best > choice->
want) {
220 }
else if (best >= 0) {
241 if (want > choice->
want) {
464 if (move_cost >
limit) {
483 struct unit *defender;
525 "giving up racing %s (%d, %d)->(%d, %d)",
541 if (defender !=
NULL) {
564 "with want %d, dist1 %d, dist2 %d",
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)
#define adv_choice_set_use(_choice, _use)
bool adv_is_player_dangerous(struct player *pplayer, struct player *aplayer)
bool adv_unit_execute_path(struct unit *punit, struct pf_path *path)
static void dai_hunter_juiciness(struct player *pplayer, struct unit *punit, struct unit *target, unsigned *stackthreat, unsigned *stackcost)
static void eval_hunter_want(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, struct unit_type *best_type, int veteran)
static struct unit * dai_hunter_find(struct player *pplayer, struct city *pcity)
bool dai_hunter_qualify(struct player *pplayer, struct unit *punit)
static void dai_hunter_missile_want(struct player *pplayer, struct city *pcity, struct adv_choice *choice)
static struct unit_type * dai_hunter_guess_best(struct city *pcity, enum terrain_class tc, struct ai_type *ait, bool allow_gold_upkeep)
void dai_hunter_choice(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, bool allow_gold_upkeep)
int dai_hunter_manage(struct ai_type *ait, struct player *pplayer, struct unit *punit)
static void dai_hunter_try_launch(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct unit *target)
#define BV_ISSET(bv, bit)
int city_production_unit_veteran_level(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)
#define city_owner(_pcity_)
double unit_win_chance(const struct civ_map *nmap, const struct unit *attacker, const struct unit *defender, const struct action *paction)
enum unit_attack_result unit_attack_unit_at_tile_result(const struct unit *punit, const struct action *paction, const struct unit *pdefender, const struct tile *dest_tile)
struct unit * get_defender(const struct civ_map *nmap, const struct unit *attacker, const struct tile *ptile, const struct action *paction)
bool can_unit_attack_tile(const struct unit *punit, const struct action *paction, const struct tile *dest_tile)
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
bool dai_unit_can_strike_my_unit(const struct unit *attacker, const struct unit *defender)
#define DEFENSE_POWER(ptype)
#define ATTACK_POWER(ptype)
#define UNITTYPE_COSTS(ut)
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 * game_unit_by_number(int id)
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
#define fc_assert_ret_val(condition, val)
bool is_tiles_adjacent(const struct tile *tile0, const struct tile *tile1)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
static int index_to_map_pos_y(int mindex)
static int index_to_map_pos_x(int mindex)
int unit_move_rate(const struct unit *punit)
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)
const char * nation_rule_name(const struct nation_type *pnation)
struct nation_type * nation_of_unit(const struct unit *punit)
void pf_path_destroy(struct pf_path *path)
struct pf_map * pf_map_new(const struct pf_parameter *parameter)
struct pf_path * pf_map_path(struct pf_map *pfm, struct tile *ptile)
void pf_map_destroy(struct pf_map *pfm)
#define pf_map_move_costs_iterate_end
#define pf_map_move_costs_iterate(ARG_pfm, NAME_tile, NAME_cost, COND_from_start)
int player_index(const struct player *pplayer)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
static bool is_barbarian(const struct player *pplayer)
#define CITY_LOG(loglevel, pcity, msg,...)
#define UNIT_LOG(loglevel, punit, msg,...)
struct unit_list * units_supported
struct unit_list * transporting
struct city * tile_city(const struct tile *ptile)
const struct unit_type * utype
struct unit * unit_transport_get(const struct unit *pcargo)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
int get_transporter_capacity(const struct unit *punit)
void unit_virtual_destroy(struct unit *punit)
bool unit_transported(const struct unit *pcargo)
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)
#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_upkeep_cost(const struct unit_type *ut, struct player *pplayer, Output_type_id otype)
const char * unit_rule_name(const struct unit *punit)
int unit_build_shield_cost_base(const struct unit *punit)
bool unit_has_type_role(const struct unit *punit, enum unit_role_id role)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
void * utype_ai_data(const struct unit_type *ptype, const struct ai_type *ai)
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)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define unit_type_iterate_end