104 log_error(
"Unsupported ai_unit_task %d.", task);
123 int build_time = build_cost /
MAX(output, 1);
149 if (
adip->countdown >= 0) {
164 unsigned int danger = 0;
217 "want bodyguard @(%d, %d) danger=%d, my_def=%d",
234#define LOGLEVEL_GOTHERE LOG_DEBUG
303 struct tile *dest_tile)
339 "%s %s[%d] (%d,%d)->(%d,%d)",
675 log_error(
"%s was on city founding mission without target tile.",
785 struct unit *bodyguard,
struct tile *ptile)
790#ifndef FREECIV_NDEBUG
1087 struct unit *bodyguard;
1096 "Tiles not adjacent: Unit = %d, "
1097 "from = (%d, %d]) to = (%d, %d).",
1237 "ending move early to stay out of trouble");
1355 choice->
want = want;
1378 want = choice->
want;
1395 choice->
want = want;
1430 if (happy_cost > 0) {
1431 unhap += happy_cost;
bool is_action_enabled_unit_on_stack(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile)
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)
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)
bool is_action_enabled_unit_on_extras(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)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_id_get_target_kind(act_id)
struct adv_data * adv_data_get(struct player *pplayer, bool *caller_closes)
bool adv_follow_path(struct unit *punit, struct pf_path *path, struct tile *ptile)
bool adv_danger_at(struct unit *punit, struct tile *ptile)
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)
void adv_avoid_risks(struct pf_parameter *parameter, struct adv_risk_cost *risk_cost, struct unit *punit, const double fearfulness)
#define NORMAL_STACKING_FEARFULNESS
bool aiferry_gobyboat(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct tile *dest_tile, bool with_bodyguard)
bool dai_is_ferry(struct unit *pferry, struct ai_type *ait)
void aiferry_clear_boat(struct ai_type *ait, struct unit *punit)
void aiguard_clear_charge(struct ai_type *ait, struct unit *guard)
void aiguard_request_guard(struct ai_type *ait, struct unit *punit)
void aiguard_assign_guard_city(struct ai_type *ait, struct city *charge, struct unit *guard)
struct unit * aiguard_charge_unit(struct ai_type *ait, struct unit *guard)
void aiguard_clear_guard(struct ai_type *ait, struct unit *charge)
struct unit * aiguard_guard_of(struct ai_type *ait, struct unit *charge)
#define CHECK_CHARGE_UNIT(ait, charge)
#define CHECK_GUARD(ait, guard)
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)
int city_unit_unhappiness(const struct civ_map *nmap, struct unit *punit, int *free_unhappy)
#define city_list_iterate(citylist, pcity)
static bool is_enemy_city_tile(const struct tile *ptile, const struct player *pplayer)
#define city_owner(_pcity_)
#define city_list_iterate_end
void citymap_free_city_spot(struct tile *ptile, int id)
void citymap_reserve_city_spot(struct tile *ptile, int id)
void auto_arrange_workers(struct city *pcity)
bool is_stack_vulnerable(const struct tile *ptile)
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 ai_dip_intel * dai_diplomacy_get(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
#define BODYGUARD_LOG(ait, loglevel, punit, msg,...)
struct unit_type * dai_choose_defender_versus(struct city *pcity, struct unit *attacker)
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
struct unit_type * dai_wants_role_unit(struct ai_type *ait, struct player *pplayer, struct city *pcity, int role, int want)
#define POTENTIALLY_HOSTILE_PLAYER(ait, pplayer, aplayer)
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 const struct action *paction struct unit struct city * pcity
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
struct unit * game_unit_by_number(int id)
struct government * government_of_player(const struct player *pplayer)
Government_type_id government_number(const struct government *pgovern)
void handle_player_change_government(struct player *pplayer, Government_type_id government)
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
const char * improvement_rule_name(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
bool is_tiles_adjacent(const struct tile *tile0, const struct tile *tile1)
bool same_pos(const struct tile *tile1, const struct tile *tile2)
int map_distance(const struct tile *tile0, const struct tile *tile1)
static int map_move_cost_unit(const struct civ_map *nmap, struct unit *punit, const struct tile *ptile)
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)
const char * nation_rule_name(const struct nation_type *pnation)
struct nation_type * nation_of_unit(const struct unit *punit)
const struct pf_position * pf_path_last_position(const struct pf_path *path)
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)
int pf_map_move_cost(struct pf_map *pfm, struct tile *ptile)
int player_index(const struct player *pplayer)
static bool is_barbarian(const struct player *pplayer)
int total_player_citizens(const struct player *pplayer)
#define CITY_LOG(loglevel, pcity, msg,...)
#define UNIT_LOG(loglevel, punit, msg,...)
#define LOGLEVEL_BODYGUARD
struct adv_data::@94 stats
enum tile_behavior(* get_TB)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
int(* get_moves_left_req)(const struct tile *ptile, enum known_type, const struct pf_parameter *param)
bool(* get_zoc)(const struct player *pplayer, const struct tile *ptile, const struct civ_map *zmap)
struct pf_position * positions
struct city_list * cities
struct player_ai ai_common
enum unit_activity activity
struct unit::@84::@87 server
bool tile_has_claimable_base(const struct tile *ptile, const struct unit_type *punittype)
struct city * tile_city(const struct tile *ptile)
const struct unit_type * utype
const struct impr_type * building
int unit_pays_mp_for_action(const struct action *paction, const struct unit *punit)
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
bool is_losing_hp(const struct unit *punit)
bool can_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_is_cityfounder(const struct unit *punit)
bool unit_transported(const struct unit *pcargo)
bool unit_has_orders(const struct unit *punit)
static bool is_enemy_unit_tile(const struct tile *ptile, const struct player *pplayer)
#define CHECK_UNIT(punit)
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity, enum gen_action trigger_action)
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_end
const struct unit_type * unit_type_get(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_may_act_at_all(const struct unit_type *putype)
int unit_build_shield_cost_base(const struct unit *punit)
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_role(const struct unit *punit, enum unit_role_id role)
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_can_do_action(const struct unit_type *putype, const action_id act_id)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define utype_fuel(ptype)