73 bool can_reveal_tiles);
77 bool can_reveal_tiles);
82 const struct tile *ptile,
85 const struct player *pplayer,
108 _(
"Global warming has occurred!"));
110 _(
"Coastlines have been flooded and vast "
111 "ranges of grassland have become deserts."));
121 _(
"Nuclear winter has occurred!"));
123 _(
"Wetlands have dried up and vast "
124 "ranges of grassland have become tundra."));
137 memset(used, 0,
sizeof(used));
142 while (
effect > 0 && (k--) > 0) {
173 for (
i = 0;
i < 2;
i++) {
228 }
else if (
old ==
new) {
252 if (gained !=
NULL) {
313 _(
"New hope sweeps like fire through the country as "
314 "the discovery of new infrastructure building technology "
320 _(
"The people are pleased to hear that your "
321 "scientists finally know about new infrastructure building "
328 _(
"Workers spontaneously gather and upgrade all "
329 "possible cities with better infrastructure."));
332 _(
"Workers spontaneously gather and upgrade all "
494 const struct player *eowner;
520 if (
NULL == pplayer && !
pconn->observer) {
524 if (pplayer !=
NULL) {
561 if (pplayer !=
NULL) {
571 info.
label[0] =
'\0';
577 }
else if (pplayer !=
NULL && known) {
586 eowner =
plrtile->extras_owner;
608 info.
label[0] =
'\0';
628 info.
label[0] =
'\0';
675 bool can_reveal_tiles)
693 bool can_reveal_tiles)
716 log_debug(
"Updating vision at (%d, %d) in a radius of %d.",
719 log_debug(
" vision layer %d is changing from %d to %d.",
760 if (pplayer == ptile->owner) {
915 const struct player *pplayer,
926 const struct player *pplayer,
940 const struct tile *ptile,
955 bool can_reveal_tiles)
961 log_debug(
"%s() for player %s (nb %d) at (%d, %d).",
965 log_debug(
" vision layer %d is changing from %d to %d.",
975 log_debug(
"(%d, %d): hiding invisible units to player %s (nb %d).",
991 log_debug(
"(%d, %d): hiding subsurface units to player %s (nb %d).",
1004 log_debug(
"(%d, %d): hiding visible units to player %s (nb %d).",
1018 plrtile->seen_count[v] += change[v];
1033 log_debug(
"(%d, %d): revealing tile to player %s (nb %d).",
1048 log_debug(
"(%d, %d): fogging tile for player %s (nb %d).",
1077 log_debug(
"(%d, %d): unfogging tile for player %s (nb %d).",
1109 log_debug(
"(%d, %d): revealing invisible units to player %s (nb %d).",
1122 log_debug(
"(%d, %d): revealing subsurface units to player %s (nb %d).",
1144 return plrtile->own_seen[vlayer];
1157 plrtile->own_seen[v] += change[v];
1274 bool changed =
FALSE;
1276 if (!
aplayer->server.private_map) {
1293 if (
aplrtile->extras_owner == pplayer) {
1317 ptile->extras_owner =
NULL;
1373 const struct player *pplayer)
1388 const struct player *pplayer)
1463 if (
NULL == pplayer &&
pconn->observer) {
1523 if (dest_tile->
site) {
1540 if (!dest_tile->
site) {
1608 pplayer->server.really_gives_vision = pplayer->gives_shared_vision;
1631 }
while (
added > 0);
1646 log_error(
"Trying to give shared vision from %s to %s, "
1647 "but that vision is already given!",
1658 log_debug(
"giving shared vision from %s to %s",
1667 log_debug(
"really giving shared vision from %s to %s",
1704 log_error(
"Tried removing the shared vision from %s to %s, "
1705 "but it did not exist in the first place!",
1714 log_debug(
"removing shared vision from %s to %s",
1726 log_debug(
"really removing shared vision from %s to %s",
1848 log_verbose(
"Moved %s %s due to changing terrain at (%d,%d).",
1853 _(
"Moved your %s due to changing terrain."),
1905 log_verbose(
"Disbanded %s %s due to changing terrain "
1911 _(
"Disbanded your %s due to changing terrain."),
2074 if (claimer !=
NULL) {
2135 ||
ploser->server.border_vision)) {
2265 if (radius_sq < 0) {
2404 if (powner !=
NULL) {
2407 pbase->vision_invis_sq,
2408 pbase->vision_subs_sq);
2416 pbase->vision_invis_sq,
2417 pbase->vision_subs_sq);
2440 if (powner !=
NULL) {
2601 && (0 <=
pbase->vision_main_sq || 0 <=
pbase->vision_invis_sq)) {
2605 0 <=
pbase->vision_invis_sq ?
pbase->vision_invis_sq : -1,
2606 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
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
int get_city_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct req_context *other_context, enum effect_type effect_type)
#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)
struct terrain * most_shallow_ocean(bool frozen)
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)
static bool is_tile_claimable(struct tile *ptile, struct tile *source, struct player *pplayer)
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)
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)
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 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)
struct conn_list * est_connections
struct packet_game_info info
struct packet_scenario_info scenario
struct civ_game::@32::@36 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::@73::@75 server
struct player_tile * private_map
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::@84::@87 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 everyone_non_allied)
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity, enum gen_action trigger_action)
#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 unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
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
#define MAP_NATIVE_HEIGHT