62#define MAXIMUM_CLAIMED_OCEAN_SIZE (20)
75 bool can_reveal_tiles);
79 bool can_reveal_tiles);
84 const struct tile *ptile,
87 const struct player *pplayer,
110 _(
"Global warming has occurred!"));
112 _(
"Coastlines have been flooded and vast "
113 "ranges of grassland have become deserts."));
123 _(
"Nuclear winter has occurred!"));
125 _(
"Wetlands have dried up and vast "
126 "ranges of grassland have become tundra."));
139 memset(used, 0,
sizeof(used));
144 while (
effect > 0 && (k--) > 0) {
175 for (
i = 0;
i < 2;
i++) {
204 if (
new !=
T_NONE && old !=
new) {
230 }
else if (old ==
new) {
254 if (gained !=
NULL) {
315 _(
"New hope sweeps like fire through the country as "
316 "the discovery of new infrastructure building technology "
322 _(
"The people are pleased to hear that your "
323 "scientists finally know about new infrastructure building "
330 _(
"Workers spontaneously gather and upgrade all "
331 "possible cities with better infrastructure."));
334 _(
"Workers spontaneously gather and upgrade all "
496 const struct player *eowner;
522 if (
NULL == pplayer && !
pconn->observer) {
526 if (pplayer !=
NULL) {
563 if (pplayer !=
NULL) {
573 info.
label[0] =
'\0';
577 }
else if (pplayer !=
NULL && known) {
586 eowner =
plrtile->extras_owner;
608 info.
label[0] =
'\0';
626 info.
label[0] =
'\0';
670 bool can_reveal_tiles)
688 bool can_reveal_tiles)
711 log_debug(
"Updating vision at (%d, %d) in a radius of %d.",
714 log_debug(
" vision layer %d is changing from %d to %d.",
755 if (pplayer == ptile->owner) {
910 const struct player *pplayer,
921 const struct player *pplayer,
935 const struct tile *ptile,
950 bool can_reveal_tiles)
956 log_debug(
"%s() for player %s (nb %d) at (%d, %d).",
960 log_debug(
" vision layer %d is changing from %d to %d.",
970 log_debug(
"(%d, %d): hiding invisible units to player %s (nb %d).",
986 log_debug(
"(%d, %d): hiding subsurface units to player %s (nb %d).",
999 log_debug(
"(%d, %d): hiding visible units to player %s (nb %d).",
1013 plrtile->seen_count[v] += change[v];
1028 log_debug(
"(%d, %d): revealing tile to player %s (nb %d).",
1043 log_debug(
"(%d, %d): fogging tile for player %s (nb %d).",
1072 log_debug(
"(%d, %d): unfogging tile for player %s (nb %d).",
1104 log_debug(
"(%d, %d): revealing invisible units to player %s (nb %d).",
1117 log_debug(
"(%d, %d): revealing subsurface units to player %s (nb %d).",
1139 return plrtile->own_seen[vlayer];
1152 plrtile->own_seen[v] += change[v];
1269 bool changed =
FALSE;
1271 if (!
aplayer->server.private_map) {
1288 if (
aplrtile->extras_owner == pplayer) {
1312 ptile->extras_owner =
NULL;
1368 const struct player *pplayer)
1383 const struct player *pplayer)
1458 if (
NULL == pplayer &&
pconn->observer) {
1518 if (dest_tile->
site) {
1535 if (!dest_tile->
site) {
1603 pplayer->server.really_gives_vision = pplayer->gives_shared_vision;
1626 }
while (
added > 0);
1641 log_error(
"Trying to give shared vision from %s to %s, "
1642 "but that vision is already given!",
1653 log_debug(
"giving shared vision from %s to %s",
1662 log_debug(
"really giving shared vision from %s to %s",
1699 log_error(
"Tried removing the shared vision from %s to %s, "
1700 "but it did not exist in the first place!",
1709 log_debug(
"removing shared vision from %s to %s",
1721 log_debug(
"really removing shared vision from %s to %s",
1841 log_verbose(
"Moved %s %s due to changing terrain at (%d,%d).",
1846 _(
"Moved your %s due to changing terrain."),
1898 log_verbose(
"Disbanded %s %s due to changing terrain "
1904 _(
"Disbanded your %s due to changing terrain."),
1960 if (pcity !=
NULL) {
2067 if (claimer !=
NULL) {
2171 ||
ploser->server.border_vision)) {
2301 if (radius_sq < 0) {
2448 if (powner !=
NULL) {
2451 pbase->vision_invis_sq,
2452 pbase->vision_subs_sq);
2460 pbase->vision_invis_sq,
2461 pbase->vision_subs_sq);
2484 if (powner !=
NULL) {
2544 if (pcity->server.needs_arrange ==
CNA_NORMAL) {
2547 pcity->server.needs_arrange =
CNA_NOT;
2645 && (0 <=
pbase->vision_main_sq || 0 <=
pbase->vision_invis_sq)) {
2649 0 <=
pbase->vision_invis_sq ?
pbase->vision_invis_sq : -1,
2650 0 <=
pbase->vision_subs_sq ?
pbase->vision_subs_sq : -1);
bool is_adv_data_phase_open(struct player *pplayer)
bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
void adv_data_phase_done(struct player *pplayer)
#define CALL_FUNC_EACH_AI(_func,...)
bool territory_claiming_base(const struct base_type *pbase)
bool bv_match_dbv(const struct dbv *match, const unsigned char *src)
void dbv_init(struct dbv *pdbv, int bits)
void dbv_set(struct dbv *pdbv, int bit)
bool dbv_isset(const struct dbv *pdbv, int bit)
void dbv_copy(struct dbv *dest, const struct dbv *src)
void dbv_free(struct dbv *pdbv)
void dbv_clr(struct dbv *pdbv, int bit)
void dbv_to_bv(unsigned char *dest, const struct dbv *src)
#define BV_ISSET(bv, bit)
int tile_border_source_radius_sq(struct tile *ptile)
bool is_border_source(struct tile *ptile)
int tile_border_strength(struct tile *ptile, struct tile *source)
bool is_free_worked(const struct city *pcity, const struct tile *ptile)
int city_map_radius_sq_get(const struct city *pcity)
static bool is_non_allied_city_tile(const struct tile *ptile, const struct player *pplayer)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
void auto_arrange_workers(struct city *pcity)
void city_refresh_queue_add(struct city *pcity)
bool city_refresh(struct city *pcity)
void city_refresh_queue_processing(void)
void conn_list_do_unbuffer(struct conn_list *dest)
void conn_list_compression_thaw(const struct conn_list *pconn_list)
void conn_list_do_buffer(struct conn_list *dest)
void conn_list_compression_freeze(const struct conn_list *pconn_list)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
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
int get_city_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
signed short Continent_id
#define IDENTITY_NUMBER_ZERO
const struct ft_color ftc_server
const char * unit_link(const struct unit *punit)
const char * unit_tile_link(const struct unit *punit)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
static GtkWidget * source
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
struct tile * rand_map_pos(const struct civ_map *nmap)
int map_vector_to_sq_distance(int dx, int dy)
bool terrain_surroundings_allow_change(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain)
void map_distance_vector(int *dx, int *dy, const struct tile *tile0, const struct tile *tile1)
#define circle_dxyr_iterate(nmap, center_tile, sq_radius, _tile, dx, dy, dr)
#define cardinal_adjc_iterate_end
#define adjc_iterate(nmap, center_tile, itr_tile)
#define circle_dxyr_iterate_end
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
#define circle_iterate(nmap, center_tile, sq_radius, tile_itr)
#define whole_map_iterate(_map, _tile)
#define MAP_TILE_OWNER_NULL
#define whole_map_iterate_end
#define circle_iterate_end
void assign_continent_numbers(void)
int get_ocean_size(Continent_id id)
struct terrain * most_shallow_ocean(bool frozen)
int get_lake_surrounders(Continent_id cont)
void player_map_init(struct player *pplayer)
static void terrain_change_bounce_single_unit(struct unit *punit, struct tile *from)
void update_player_tile_last_seen(struct player *pplayer, struct tile *ptile)
static void shared_vision_change_seen(struct player *pplayer, struct tile *ptile, const v_radius_t change, bool can_reveal_tiles)
void vision_clear_sight(struct vision *vision)
void map_claim_base(struct tile *ptile, struct extra_type *pextra, struct player *powner, struct player *ploser)
void map_set_border_vision(struct player *pplayer, const bool is_enabled)
void map_claim_ownership(struct tile *ptile, struct player *powner, struct tile *psource, bool claim_bases)
static int player_tile_own_seen(const struct player_tile *plrtile, enum vision_layer vlayer)
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
static bool map_is_also_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void send_map_info(struct conn_list *dest)
static bool really_give_tile_info_from_player_to_player(struct player *pfrom, struct player *pdest, struct tile *ptile)
bool send_tile_suppression(bool now)
void destroy_extra(struct tile *ptile, struct extra_type *pextra)
static void check_units_single_tile(struct tile *ptile)
static void really_give_map_from_player_to_player(struct player *pfrom, struct player *pdest)
void disable_fog_of_war(void)
bool really_gives_vision(struct player *me, struct player *them)
static bool unit_is_on_layer(const struct unit *punit, enum vision_layer vlayer)
void map_know_and_see_all(struct player *pplayer)
static void map_change_own_seen(struct player *pplayer, struct tile *ptile, const v_radius_t change)
void show_map_to_all(void)
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile)
static int map_get_seen(const struct player *pplayer, const struct tile *ptile, enum vision_layer vlayer)
static void ocean_to_land_fix_rivers(struct tile *ptile)
void give_map_from_player_to_player(struct player *pfrom, struct player *pdest)
void send_all_known_tiles(struct conn_list *dest)
void bounce_units_on_terrain_change(struct tile *ptile)
void give_seamap_from_player_to_player(struct player *pfrom, struct player *pdest)
void remove_shared_vision(struct player *pfrom, struct player *pto)
bool need_to_reassign_continents(const struct terrain *oldter, const struct terrain *newter)
static bool is_claimable_ocean(struct tile *ptile, struct tile *source, struct player *pplayer)
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
static bool is_terrain_ecologically_wet(struct tile *ptile)
void tile_claim_bases(struct tile *ptile, struct player *powner)
void disable_fog_of_war_player(struct player *pplayer)
void climate_change(bool warming, int effect)
void enable_fog_of_war(void)
static bool send_tile_suppressed
static void create_vision_dependencies(void)
void upgrade_all_city_extras(struct player *pplayer, bool discovery)
void create_extra(struct tile *ptile, struct extra_type *pextra, struct player *pplayer)
void map_update_border(struct tile *ptile, struct player *owner, int old_radius_sq, int new_radius_sq)
void map_set_known(struct tile *ptile, struct player *pplayer)
void map_show_all(struct player *pplayer)
static void map_unit_homecity_enqueue(struct tile *ptile)
static void map_change_seen(struct player *pplayer, struct tile *ptile, const v_radius_t change, bool can_reveal_tiles)
void map_show_tile(struct player *src_player, struct tile *ptile)
void give_citymap_from_player_to_player(struct city *pcity, struct player *pfrom, struct player *pdest)
void nuclear_winter(int effect)
void tile_change_side_effects(struct tile *ptile, bool refresh_city)
static void player_tile_init(struct tile *ptile, struct player *pplayer)
void terrain_changed(struct tile *ptile)
void player_map_free(struct player *pplayer)
static void unbuffer_shared_vision(struct player *pplayer)
static void map_claim_border_ownership(struct tile *ptile, struct player *powner, struct tile *psource)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void change_playertile_site(struct player_tile *ptile, struct vision_site *new_site)
void map_calculate_borders(void)
void fix_tile_on_terrain_change(struct tile *ptile, struct terrain *oldter, bool extend_rivers)
void enable_fog_of_war_player(struct player *pplayer)
void map_show_circle(struct player *pplayer, struct tile *ptile, int radius_sq)
void map_vision_update(struct player *pplayer, struct tile *ptile, const v_radius_t old_radius_sq, const v_radius_t new_radius_sq, bool can_reveal_tiles)
void map_claim_border(struct tile *ptile, struct player *owner, int radius_sq)
void update_tile_knowledge(struct tile *ptile)
void remove_player_from_maps(struct player *pplayer)
void give_shared_vision(struct player *pfrom, struct player *pto)
void check_terrain_change(struct tile *ptile, struct terrain *oldter)
bool give_distorted_map(struct player *pfrom, struct player *pto, int prob, bool reveal_cities)
void map_hide_tile(struct player *src_player, struct tile *ptile)
static void buffer_shared_vision(struct player *pplayer)
static bool give_tile_info_from_player_to_player(struct player *pfrom, struct player *pdest, struct tile *ptile)
void global_warming(int effect)
bool upgrade_city_extras(struct city *pcity, struct extra_type **gained)
void map_clear_border(struct tile *ptile)
void map_clear_known(struct tile *ptile, struct player *pplayer)
static void player_tile_free(struct tile *ptile, struct player *pplayer)
#define MAXIMUM_CLAIMED_OCEAN_SIZE
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
void vision_change_sight(struct vision *vision, const v_radius_t radius_sq)
#define map_get_player_site(_ptile_, _pplayer_)
#define map_get_playermap_site(_plrtile_)
#define fc_realloc(ptr, sz)
bool can_unit_exist_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)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void dlsend_packet_edit_fogofwar_state(struct conn_list *dest, bool enabled)
void lsend_packet_map_info(struct conn_list *dest, const struct packet_map_info *packet)
int send_packet_tile_info(struct connection *pc, const struct packet_tile_info *packet)
int num_known_tech_with_flag(const struct player *pplayer, enum tech_flag_id flag)
int player_slot_count(void)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
int player_index(const struct player *pplayer)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool gives_shared_vision(const struct player *me, const struct player *them)
#define players_iterate_end
#define players_iterate(_pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
#define phase_players_iterate(pplayer)
#define phase_players_iterate_end
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
int count_river_near_tile(struct civ_map *nmap, const struct tile *ptile, const struct extra_type *priver)
#define sanity_check_tile(x)
#define DEFAULT_SPECIALIST
enum server_states server_state(void)
enum city_needs_arrange needs_arrange
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct conn_list * est_connections
struct packet_game_info info
struct packet_scenario_info scenario
struct civ_game::@31::@35 server
enum borders_mode borders
enum happyborders_type happyborders
int border_city_permanent_radius_sq
Resource_type_id resource
char label[MAX_LEN_MAP_LABEL]
char spec_sprite[MAX_LEN_NAME]
struct player * extras_owner
struct vision_site * site
struct extra_type * resource
struct city_list * cities
struct conn_list * connections
struct player_tile * private_map
struct player::@70::@72 server
struct terrain * cooler_wetter_result
struct terrain * cooler_drier_result
struct terrain * warmer_wetter_result
struct terrain * warmer_drier_result
struct extra_type * resource
struct player * extras_owner
struct extra_type * placing
enum unit_activity activity
struct unit::@81::@84 server
struct extra_type * activity_target
#define sz_strlcpy(dest, src)
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
Terrain_type_id terrain_count(void)
Terrain_type_id terrain_number(const struct terrain *pterrain)
#define is_ocean(pterrain)
#define is_ocean_tile(ptile)
#define terrain_has_flag(terr, flag)
void tile_add_extra(struct tile *ptile, const struct extra_type *pextra)
bool tile_has_river(const struct tile *ptile)
bool tile_map_check(struct civ_map *nmap, struct tile *vtile)
void tile_remove_extra(struct tile *ptile, const struct extra_type *pextra)
void tile_change_terrain(struct tile *ptile, struct terrain *pterrain)
bool tile_has_conflicting_extra(const struct tile *ptile, const struct extra_type *pextra)
void tile_set_owner(struct tile *ptile, struct player *pplayer, struct tile *claimer)
struct city * tile_city(const struct tile *ptile)
#define tile_claimer(_tile)
#define tile_worked(_tile)
#define tile_resource(_tile)
#define tile_terrain(_tile)
#define tile_continent(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
int get_transporter_occupancy(const struct unit *ptrans)
bool unit_is_alive(int id)
bool unit_transported(const struct unit *pcargo)
struct unit_list * unit_transport_cargo(const struct unit *ptrans)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity)
#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)
struct vision_site * vision_site_copy(const struct vision_site *psite)
void vision_site_destroy(struct vision_site *psite)
#define V_RADIUS(main_sq, invis_sq, subs_sq)
#define vision_layer_iterate(v)
#define vision_site_owner(v)
short int v_radius_t[V_COUNT]
#define vision_layer_iterate_end