59#define LOGLEVEL_PARATROOPER LOG_DEBUG
69 struct tile* best_tile = NULL;
83 && unit_list_size(ptile->units) == 0) {
92 if (best_tile != NULL) {
95 "Choose to jump in order to protect allied city %s (%d %d). "
105 && (unit_list_size(ptile->units) == 0)) {
120 if (best_tile != NULL) {
123 "Choose to jump into enemy city %s (%d %d). Benefit: %d",
147 if (!acity && unit_list_size(ptile->units) > 0) {
153 if (unit_list_size(target->units) == 0
168 val += victim->hp * 100;
186 if (best_tile != NULL) {
188 "adjacent units. Benefit: %d",
202 struct tile *ptile_dest = NULL;
233 bool jump_performed =
FALSE;
259 paction->
id, ACT_REQ_PLAYER);
268 if (jump_performed) {
281 struct city *acity = NULL;
286 "waiting in a city for next turn.");
301 "didn't find city to go and recover.");
312 struct tile *ptile_city)
318 int total, total_cities;
353 if (unit_list_size(ptile->units) > 2) {
370 total_cities = city_list_size(pplayer->
cities);
372 if (total > total_cities) {
373 profit = profit * total_cities / total;
384 struct adv_choice *choice,
bool allow_gold_upkeep)
390 int num_requirements = 0;
402 struct unit *virtual_unit;
408 if (
A_NEVER == u_type->require_advance) {
425 for (i = 0; i < num_requirements; i++) {
430 if (i == num_requirements) {
431 requirements[num_requirements++] =
tech_req;
442 pplayer, pcity, u_type,
448 if (profit > choice->
want) {
450 choice->
want = profit;
462 for (i = 0; i < num_requirements; i++) {
bool action_prob_possible(const struct act_prob probability)
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)
struct act_prob action_prob_unit_vs_tgt(const struct civ_map *nmap, const struct action *paction, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct extra_type *extra_tgt)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_iterate_end
#define action_iterate(_act_)
#define adv_choice_set_use(_choice, _use)
struct adv_data * adv_data_get(struct player *pplayer, bool *caller_closes)
static struct tile * find_best_tile_to_paradrop_to(struct ai_type *ait, struct unit *punit)
void dai_manage_paratrooper(struct ai_type *ait, struct player *pplayer, struct unit *punit)
void dai_choose_paratrooper(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct adv_choice *choice, bool allow_gold_upkeep)
#define LOGLEVEL_PARATROOPER
static int calculate_want_for_paratrooper(struct unit *punit, struct tile *ptile_city)
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)
void dai_manage_military(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct unit *punit)
struct city * find_nearest_safe_city(struct unit *punit)
bool dai_military_rampage(struct unit *punit, int thresh_adj, int thresh_move)
#define RAMPAGE_FREE_CITY_OR_BETTER
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_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_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)
double unit_win_chance(const struct civ_map *nmap, 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)
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 log_base(level, message,...)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
#define square_iterate(nmap, center_tile, radius, tile_itr)
#define adjc_iterate(nmap, center_tile, itr_tile)
#define square_iterate_end
int get_continent_size(Continent_id id)
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
const char * player_name(const struct player *pplayer)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool research_goal_tech_req(const struct research *presearch, Tech_type_id goal, Tech_type_id tech)
struct research * research_get(const struct player *pplayer)
#define UNIT_LOG(loglevel, punit, msg,...)
struct adv_data::@92 stats
struct adv_data::@92::@95 units
adv_want tech_want[A_LAST+1]
struct city_list * cities
struct advance * advance_by_number(const Tech_type_id atype)
const char * advance_rule_name(const struct advance *padvance)
Tech_type_id advance_index(const struct advance *padvance)
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)
#define is_ocean(pterrain)
#define is_ocean_tile(ptile)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_continent(_tile)
const struct unit_type * utype
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
void unit_virtual_destroy(struct unit *punit)
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_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_is_consumed_by_action_result(enum action_result result, const struct unit_type *utype)
const char * utype_rule_name(const struct unit_type *punittype)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
#define utype_fuel(ptype)
#define unit_type_iterate(_p)
#define unit_type_iterate_end