33 struct player *best =
nullptr;
51 best_state = ship->
state;
54 best_state = ship->
state;
55 best_arrival = arrival;
74 || city_list_size(pplayer->
cities) == 0
75 || city_list_size(target->
cities) == 0) {
88 if (min_dist > dist) {
struct action * action_by_number(action_id act_id)
Return the action with the given id.
#define action_id_get_role(act_id)
int player_distance_to_player(struct player *pplayer, struct player *target)
Calculate average distances to other players.
int city_gold_worth(struct city *pcity)
Rough calculation of the worth of pcity in gold.
struct player * player_leading_spacerace()
Find who is leading the space race.
int city_granary_size(int city_size)
Generalized formula used to calculate granary size.
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
bool city_unhappy(const struct city *pcity)
Return TRUE iff the city is unhappy.
bool can_city_build_unit_direct(const struct city *pcity, const struct unit_type *punittype)
Return whether given city can build given unit, ignoring whether unit is obsolete.
citizens city_size_get(const struct city *pcity)
Get the city size.
#define city_list_iterate(citylist, pcity)
#define output_type_iterate(output)
#define city_list_iterate_end
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
#define output_type_iterate_end
int impr_sell_gold(const struct impr_type *pimprove)
Returns the amount of gold received when this improvement is sold.
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
Returns the number of shields it takes to build this improvement.
bool is_wonder(const struct impr_type *pimprove)
Returns whether improvement is some kind of wonder.
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
Returns TRUE if the improvement or wonder is obsolete.
bool same_pos(const struct tile *tile1, const struct tile *tile2)
Are (x1,y1) and (x2,y2) really the same when adjusted? This function might be necessary ALOT of place...
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
Return real distance between two tiles.
struct city_list * cities
static bool is_barbarian(const struct player *pplayer)
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
struct unit_list * units_supported
struct packet_scenario_info scenario
enum spaceship_state state
struct city_list * cities
const struct unit_type * obsoleted_by
int unit_shield_value(const struct unit *punit, const struct unit_type *punittype, const struct action *paction)
Returns how many shields the unit (type) is worth.
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
int utype_buy_gold_cost(const struct city *pcity, const struct unit_type *punittype, int shields_in_stock)
Returns the amount of gold it takes to rush this unit.
const struct unit_type * unit_type_get(const struct unit *punit)
Return the unit type for this unit.
int unit_build_shield_cost(const struct city *pcity, const struct unit *punit)
Returns the number of shields it takes to build this unit.
struct unit_type * best_role_unit_for_player(const struct player *pplayer, int role)
Return "best" unit the player can build, with given role/flag.
bool victory_enabled(enum victory_condition_type victory)
Whether victory condition is enabled.