87 const struct player *pplayer,
169#define SAME_TER_SCORE 21
170#define DIFF_TER_SCORE 81
171#define KNOWN_SAME_TER_SCORE 0
172#define KNOWN_DIFF_TER_SCORE 51
178#define MAX_NEW_TILES 5
184#define VISION_TILES 9
189#define BEST_NORMAL_TILE \
190 (100 * MAX_NEW_TILES * DIFF_TER_SCORE +\
191 100 * (VISION_TILES - MAX_NEW_TILES) * KNOWN_DIFF_TER_SCORE)
195#define OWN_CITY_SCORE (BEST_NORMAL_TILE + 1)
200#define HUT_SCORE (OWN_CITY_SCORE + 1)
202#define BEST_POSSIBLE_SCORE (HUT_SCORE + BEST_NORMAL_TILE)
300#define DIST_FACTOR 0.6
386 if (
is_ai(pplayer)) {
424#undef KNOWN_SAME_TER_SCORE
425#undef KNOWN_DIFF_TER_SCORE
bool adv_follow_path(struct unit *punit, struct pf_path *path, struct tile *ptile)
void adv_avoid_risks(struct pf_parameter *parameter, struct adv_risk_cost *risk_cost, struct unit *punit, const double fearfulness)
#define NORMAL_STACKING_FEARFULNESS
#define CALL_PLR_AI_FUNC(_func, _player,...)
static int explorer_desirable(struct tile *ptile, struct player *pplayer, struct unit *punit)
static enum tile_behavior explorer_tb(const struct tile *ptile, enum known_type k, const struct pf_parameter *param)
enum unit_move_result manage_auto_explorer(struct unit *punit)
static bool explorer_goto(struct unit *punit, struct tile *ptile)
#define KNOWN_DIFF_TER_SCORE
#define KNOWN_SAME_TER_SCORE
static int likely_native(struct tile *ptile, struct player *pplayer, struct unit_class *pclass)
#define BEST_POSSIBLE_SCORE
static bool player_may_explore(const struct tile *ptile, const struct player *pplayer, const struct unit_type *punittype)
#define city_owner(_pcity_)
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
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
#define fc_assert_action(condition, action)
bool is_tiles_adjacent(const struct tile *tile0, const struct tile *tile1)
bool same_pos(const struct tile *tile1, const struct tile *tile2)
#define adjc_dir_iterate(nmap, center_tile, itr_tile, dir_itr)
#define circle_iterate(nmap, center_tile, sq_radius, tile_itr)
#define adjc_dir_iterate_end
#define circle_iterate_end
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
static bool is_native_tile_to_class(const struct unit_class *punitclass, const struct tile *ptile)
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)
bool player_can_invade_tile(const struct player *pplayer, const struct tile *ptile)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
static bool is_barbarian(const struct player *pplayer)
#define UNIT_LOG(loglevel, punit, msg,...)
#define TIMING_LOG(timer, activity)
enum tile_behavior(* get_TB)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
const struct player * owner
const struct unit_type * utype
struct city * tile_city(const struct tile *ptile)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
const struct unit_type * unit_type_get(const struct unit *punit)
struct unit_class * unit_class_get(const struct unit *punit)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
static bool utype_has_flag(const struct unit_type *punittype, int flag)