63#define FERRY_AVAILABLE (-1)
64#define FERRY_ABANDON_BOSS (-2)
71#define FERRY_WANTED (-1)
78#define LOGLEVEL_FERRY LOG_DEBUG
80#define LOGLEVEL_GOBYBOAT LOG_DEBUG
82#define LOGLEVEL_FINDFERRY LOG_DEBUG
85#define LOGLEVEL_FERRY_STATS LOG_NORMAL
127#ifdef LOGLEVEL_FERRY_STATS
208 if (passenger !=
NULL) {
361#ifdef LOGLEVEL_FERRY_STATS
372 log_error(
"Player[%d] in turn %d: boats miscounted.",
564 "Found a potential boat %s[%d](%d,%d)(moves left: %d)",
638 struct unit *passenger,
733 struct unit *passenger,
struct tile *ptile)
740 if (parameter.land.get_TB !=
no_fights) {
787 "in ai_gothere cannot find any boats.");
876 "got boat[%d](moves left: %d), going (%d,%d)",
913 bodyguard->
id, ferryboat->
id, 0,
"",
965 if (passengers <= 0) {
988 "Found a potential cargo %s[%d](%d,%d), going there",
1004 "AI Passengers counting reported false positive %d", passengers);
1030 bool needed =
FALSE;
1038 parameter.omniscience =
FALSE;
1062 if (
pos.turn > turns
1066 "will finish building its own ferry too soon",
1073 "has just started building",
1083 "has another ferry",
1092 "find something better",
1155 "recorded passenger[%d] is not on board, checking for "
1185 "appointed %s[%d] our passenger-in-charge",
bool action_prob_possible(const struct act_prob probability)
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_by_result_iterate_end
bool adv_follow_path(struct unit *punit, struct pf_path *path, struct tile *ptile)
bool adv_unit_execute_path(struct unit *punit, struct pf_path *path)
static bool aiferry_findcargo(struct ai_type *ait, struct unit *pferry)
static void dai_activate_passengers(struct ai_type *ait, struct unit *ferry)
bool aiferry_gobyboat(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct tile *dest_tile, bool with_bodyguard)
int aiferry_find_boat(struct ai_type *ait, struct unit *punit, int cap, struct pf_path **path)
void dai_manage_ferryboat(struct ai_type *ait, struct player *pplayer, struct unit *punit)
bool is_boat_free(struct ai_type *ait, struct unit *boat, struct unit *punit, int cap)
bool dai_is_ferry_type(const struct unit_type *pferry, struct ai_type *ait)
void aiferry_init_stats(struct ai_type *ait, struct player *pplayer)
static bool aiferry_find_interested_city(struct ai_type *ait, struct unit *pferry)
#define LOGLEVEL_FINDFERRY
void dai_ferry_lost(struct ai_type *ait, struct unit *punit)
void dai_ferry_transformed(struct ai_type *ait, struct unit *ferry, const struct unit_type *old)
bool aiferry_goto_amphibious(struct ai_type *ait, struct unit *ferry, struct unit *passenger, struct tile *ptile)
bool is_boss_of_boat(struct ai_type *ait, struct unit *punit)
static void aiferry_psngr_meet_boat(struct ai_type *ait, struct unit *punit, struct unit *pferry)
static void aiferry_make_available(struct ai_type *ait, struct unit *pferry)
static int aiferry_find_boat_nearby(struct ai_type *ait, struct unit *punit, int cap)
static unsigned sea_move(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
int aiferry_avail_boats(struct ai_type *ait, struct player *pplayer)
#define LOGLEVEL_GOBYBOAT
bool dai_amphibious_goto_constrained(struct ai_type *ait, struct unit *ferry, struct unit *passenger, struct tile *ptile, struct pft_amphibious *parameter)
bool dai_is_ferry(struct unit *pferry, struct ai_type *ait)
#define FERRY_ABANDON_BOSS
void dai_ferry_init_ferry(struct ai_type *ait, struct unit *ferry)
void aiferry_clear_boat(struct ai_type *ait, struct unit *punit)
static unsigned combined_land_sea_move(const struct tile *src_tile, enum pf_move_scope src_scope, const struct tile *tgt_tile, enum pf_move_scope dst_scope, const struct pf_parameter *param)
static void aiferry_request_boat(struct ai_type *ait, struct unit *punit)
void aiguard_request_guard(struct ai_type *ait, struct unit *punit)
struct unit * aiguard_guard_of(struct ai_type *ait, struct unit *charge)
enum unit_move_result manage_auto_explorer(struct unit *punit)
const char * city_name_get(const struct city *pcity)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
#define city_owner(_pcity_)
bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer)
struct ai_plr * dai_plr_data_get(struct ai_type *ait, struct player *pplayer, bool *caller_closes)
void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
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)
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
void dai_manage_military(struct ai_type *ait, struct player *pplayer, struct unit *punit)
void dai_manage_unit(struct ai_type *ait, struct player *pplayer, struct unit *punit)
struct city * find_nearest_safe_city(struct unit *punit)
#define IS_ATTACKER(ptype)
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
struct unit * game_unit_by_number(int id)
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_base(level, message,...)
#define log_error(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 real_map_distance(const struct tile *tile0, const struct tile *tile1)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define square_iterate_end
static int map_move_cost(const struct civ_map *nmap, const struct player *pplayer, const struct unit_type *punittype, const struct tile *src_tile, const struct tile *dst_tile)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool can_unit_transport(const struct unit *transporter, const struct unit *transported)
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)
struct pf_path * pf_map_iter_path(struct pf_map *pfm)
void pf_map_destroy(struct pf_map *pfm)
bool pf_path_advance(struct pf_path *path, struct tile *ptile)
#define pf_map_positions_iterate_end
#define pf_map_tiles_iterate(ARG_pfm, NAME_tile, COND_from_start)
#define pf_map_positions_iterate(ARG_pfm, NAME_pos, COND_from_start)
#define pf_map_tiles_iterate_end
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
static bool is_barbarian(const struct player *pplayer)
#define UNIT_LOG(loglevel, punit, msg,...)
struct ai_plr::@282 stats
struct packet_game_info info
enum tile_behavior(* get_TB)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
const struct player * owner
bool(* get_zoc)(const struct player *pplayer, const struct tile *ptile, const struct civ_map *zmap)
unsigned(* get_MC)(const struct tile *from_tile, enum pf_move_scope src_move_scope, const struct tile *to_tile, enum pf_move_scope dst_move_scope, const struct pf_parameter *param)
unsigned(* get_EC)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
const struct unit_type * utype
struct pf_position * positions
struct pf_parameter combined
struct pf_parameter land sea
struct unit_list * transporting
const struct unit_type * utype
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
#define is_ocean_tile(ptile)
struct city * tile_city(const struct tile *ptile)
int get_transporter_occupancy(const struct unit *ptrans)
bool unit_is_alive(int id)
bool is_losing_hp(const struct unit *punit)
bool can_unit_load(const struct unit *pcargo, const struct unit *ptrans)
struct unit * unit_transport_get(const struct unit *pcargo)
bool unit_is_cityfounder(const struct unit *punit)
int get_transporter_capacity(const struct unit *punit)
bool unit_transported(const struct unit *pcargo)
bool unit_has_orders(const struct unit *punit)
#define CHECK_UNIT(punit)
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity, enum gen_action trigger_action)
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 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)
const char * unit_rule_name(const struct unit *punit)
bool utype_has_role(const struct unit_type *punittype, int role)
struct unit_class * unit_class_get(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)
static bool utype_has_flag(const struct unit_type *punittype, int flag)