94 int city_y,
int city_radius_sq)
150 log_debug(
"canvas_to_city_pos(pos=(%d,%d))=(%d,%d)@radius=%d",
158#define citydlg_iterate(pcity, ptile, pedge, pcorner, _x, _y) \
160 float _x##_0, _y##_0; \
161 int _tile_x, _tile_y; \
162 const int _x##_w = get_citydlg_canvas_width(); \
163 const int _y##_h = get_citydlg_canvas_height(); \
164 index_to_map_pos(&_tile_x, &_tile_y, tile_index((pcity)->tile)); \
166 map_to_gui_vector(tileset, 1.0, &_x##_0, &_y##_0, _tile_x, _tile_y); \
167 _x##_0 -= (_x##_w - tileset_tile_width(tileset)) / 2; \
168 _y##_0 -= (_y##_h - tileset_tile_height(tileset)) / 2; \
169 log_debug("citydlg: %f,%f + %dx%d", \
170 _x##_0, _y##_0, _x##_w, _y##_h); \
172 gui_rect_iterate_coord(_x##_0, _y##_0, _x##_w, _y##_h, \
173 ptile, pedge, pcorner, _x##_g, _y##_g, 1.0) { \
174 const int _x = _x##_g - _x##_0; \
175 const int _y = _y##_g - _y##_0; \
178#define citydlg_iterate_end \
180 } gui_rect_iterate_coord_end; \
286 PL_(
"%3d gold per turn",
"%3d gold per turn", output),
290 PL_(
"%3d infrapoint per turn",
"%3d infrapoints per turn", output),
299 stock =
pcity->shield_stock;
307 PL_(
"%3d turn",
"%3d turns", turns), turns);
340 switch (target->
kind) {
366 PL_(
"%d turn",
"%d turns", turns),
386 switch (target->
kind) {
411 const char *state =
NULL;
415 state =
_(
"Obsolete");
419 state =
_(
"Destroyed");
421 state =
_(
"Great Wonder");
425 state =
_(
"Obsolete");
429 state =
_(
"Small Wonder");
537 for (
i = 0;
i < sum->
n;
i++) {
589 char *posdesc, *negdesc;
667 for (
i = 0;
i < sum->
n;
i++) {
724 Q_(
"?city_sum:(unknown)"));
728 for (
i = 0;
i < sum->n;
i++) {
729 if (!sum->sums[
i].suppress_if_zero
732 sum->format, sum->sums[
i].value,
733 (sum->sums[
i].value < 0) ? sum->sums[
i].negdesc
734 : sum->sums[
i].posdesc);
735 if (sum->sums[
i].auxfmt) {
769 Q_(
"?city_surplus:Citizens"));
775 Q_(
"?city_surplus:Taxed from trade"));
815 Q_(
"?city_surplus:Building tithes"));
854 Q_(
"?city_surplus:Bonus from %s"),
855 Q_(
"?city_surplus:Loss from %s"),
buf2);
862 Q_(
"?city_surplus: (%+.0f%%)"), delta,
863 Q_(
"?city_surplus:Bonus from %s"),
864 Q_(
"?city_surplus:Loss from %s"),
buf2);
883 Q_(
"?city_surplus:Size penalty"));
899 fmt =
Q_(
"?city_surplus:Waste%s");
904 fmt =
Q_(
"?city_surplus:Corruption%s");
912 Q_(
"?city_surplus:Disorder"));
916 Q_(
"?city_surplus:Used"));
921 "==== : Adds up to\n"
922 "%4.0f : Total surplus"), (
double)
pcity->surplus[
otype]);
948 Q_(
"?city_plague:Risk from overcrowding"));
950 Q_(
"?city_plague:Risk from trade"));
952 Q_(
"?city_plague:Risk from pollution"));
980 Q_(
"?city_plague: (%+.0f%%)"), -delta,
981 Q_(
"?city_plague:Risk from %s"),
982 Q_(
"?city_plague:Bonus from %s"),
buf2);
992 "====== : Adds up to\n"
993 "%5.1f%% : Plague chance per turn"),
994 ((
double)(illness) / 10.0));
1014 city_sum_add(sum, prod,
Q_(
"?city_pollution:Pollution from shields"));
1016 city_sum_add(sum, mod,
Q_(
"?city_pollution:Pollution modifier"));
1018 Q_(
"?city_pollution:"
1019 "==== : Adds up to\n"
1020 "%4.0f : Total surplus"), (
double)
pollu);
1069 "==== : Adds up to\n"
1070 "%4.0f : Total culture"), (
double)
pcity->
client.culture);
1092 fc_snprintf(src,
sizeof(src),
_(
"unlimited take offs%s"),
1096 ?
"" :
PL_(
" (until the landing has been spent)",
1097 " (until all landings have been spent)",
1103 PL_(
"%d take off",
"%d take offs",
pcity->airlift),
1113 fc_snprintf(dest,
sizeof(dest),
_(
"unlimited landings"));
1118 PL_(
"%d landing",
"%d landings",
pcity->airlift),
1136 PL_(
"%d take off or landing",
"%d take offs or landings",
1165 ?
"" :
Q_(
"?landings:*"));
1229 for (
n = 0;
n <
pcity->specialists[
sp];
n++,
i++) {
1235 log_error(
"get_city_citizen_types() %d citizens "
1236 "not equal %d city size in \"%s\".",
1380 if (position == 0) {
1393 }
else if (position >= 1
1545 &&
pcity->anarchy != 0)
1592 if (
NULL == ptile) {
void astr_vadd(struct astring *astr, const char *format, va_list ap)
char * astr_to_str(struct astring *astr)
struct canvas int int struct sprite int int int int height
struct canvas int int int int struct sprite *sprite canvas_put_rectangle
struct canvas int int canvas_y
struct canvas int canvas_x
struct canvas int int struct sprite int int int width
int city_turns_to_build(const struct city *pcity, const struct universal *target, bool include_shield_stock)
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
int city_production_build_shield_cost(const struct city *pcity)
int city_pollution_types(const struct city *pcity, int shield_total, int *pollu_prod, int *pollu_pop, int *pollu_mod)
int city_waste(const struct city *pcity, Output_type_id otype, int total, int *breakdown)
int city_build_slots(const struct city *pcity)
struct tile * city_map_to_tile(const struct civ_map *nmap, const struct tile *city_center, int city_radius_sq, int city_map_x, int city_map_y)
const char * city_name_get(const struct city *pcity)
int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b)
bool can_city_build_later(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
bool city_can_use_specialist(const struct city *pcity, Specialist_type_id type)
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
void add_tax_income(const struct player *pplayer, int trade, int *output)
int get_city_tithes_bonus(const struct city *pcity)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
bool is_valid_city_coords(const int city_radius_sq, const int city_map_x, const int city_map_y)
bool can_city_build_direct(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
int city_map_radius_sq_get(const struct city *pcity)
int rs_max_city_radius_sq(void)
bool can_city_build_now(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
bool city_production_is_genus(const struct city *pcity, enum impr_genus_id genus)
bool city_production_build_units(const struct city *pcity, bool add_production, int *num_units)
struct output_type output_types[O_LAST]
bool city_can_change_build(const struct city *pcity)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define CITY_REL2ABS(_coor)
#define city_owner(_pcity_)
#define city_map_iterate_without_index_end
#define CITY_ABS2REL(_coor)
#define city_map_iterate_without_index(_radius_sq, _x, _y)
static double city_sum_total(struct city_sum *sum)
void get_city_dialog_production_row(char *buf[], size_t column_size, struct universal *target, struct city *pcity)
void get_city_dialog_output_text(const struct city *pcity, Output_type_id otype, char *buf, size_t bufsz)
#define citydlg_iterate_end
void get_city_dialog_production(struct city *pcity, char *buffer, size_t buffer_len)
int city_set_worklist(struct city *pcity, const struct worklist *pworklist)
int city_rename(struct city *pcity, const char *name)
void city_worklist_commit(struct city *pcity, struct worklist *pwl)
#define citydlg_iterate(pcity, ptile, pedge, pcorner, _x, _y)
int get_city_citizen_types(struct city *pcity, enum citizen_feeling idx, enum citizen_category *categories)
int city_buy_production(struct city *pcity)
char * city_production_cost_str(const struct city *pcity)
bool city_queue_insert(struct city *pcity, int position, struct universal *item)
bool city_queue_insert_worklist(struct city *pcity, int position, const struct worklist *worklist)
int city_toggle_worker(struct city *pcity, int city_x, int city_y)
void get_city_dialog_airlift_text(const struct city *pcity, char *buf, size_t bufsz)
static int city_sum_compare(double val1, double val2)
bool city_set_queue(struct city *pcity, const struct worklist *pqueue)
int city_change_production(struct city *pcity, struct universal *target)
void get_city_dialog_production_full(char *buffer, size_t buffer_len, struct universal *target, struct city *pcity)
void city_rotate_specialist(struct city *pcity, int citizen_index)
int get_citydlg_canvas_width(void)
bool canvas_to_city_pos(int *city_x, int *city_y, int city_radius_sq, int canvas_x, int canvas_y)
static bool base_city_queue_insert(struct city *pcity, int position, struct universal *item)
void activate_all_units(struct tile *ptile)
bool city_queue_clear(struct city *pcity)
static void city_sum_add_real(struct city_sum *sum, double value, bool suppress_if_zero, const char *auxfmt, double aux, char *posdesc, char *negdesc)
void get_city_dialog_airlift_value(const struct city *pcity, char *buf, size_t bufsz)
static int citydlg_map_height
bool city_to_canvas_pos(float *canvas_x, float *canvas_y, int city_x, int city_y, int city_radius_sq)
void generate_citydlg_dimensions(void)
static struct city_sum * city_sum_new(const char *format)
void city_get_queue(struct city *pcity, struct worklist *pqueue)
void city_dialog_redraw_map(struct city *pcity, struct canvas *pcanvas)
int city_sell_improvement(struct city *pcity, Impr_type_id sell_id)
void get_city_dialog_pollution_text(const struct city *pcity, char *buf, size_t bufsz)
int city_change_specialist(struct city *pcity, Specialist_type_id from, Specialist_type_id to)
void get_city_dialog_culture_text(const struct city *pcity, char *buf, size_t bufsz)
bool city_can_buy(const struct city *pcity)
int get_citydlg_canvas_height(void)
static int citydlg_map_width
void get_city_dialog_illness_text(const struct city *pcity, char *buf, size_t bufsz)
void refresh_city_dialog(struct city *pcity)
bool can_client_issue_orders(void)
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
void unit_focus_set(struct unit *punit)
void request_new_unit_activity(struct unit *punit, enum unit_activity act)
int city_history_gain(const struct city *pcity)
static void base(QVariant data1, QVariant data2)
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
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 cost
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_city_bonus_effects(struct effect_list *plist, const struct city *pcity, const struct output_type *poutput, enum effect_type effect_type)
void get_effect_req_text(const struct effect *peffect, char *buf, size_t buf_len)
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
enum output_type_id Output_type_id
#define PL_(String1, String2, n)
struct city * game_city_by_number(int id)
bool great_wonder_is_built(const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
bool wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
bool is_convert_improvement(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
int impr_estimate_build_shield_cost(const struct player *pplayer, const struct tile *ptile, const struct impr_type *pimprove)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
void map_to_gui_vector(const struct tileset *t, float zoom, float *gui_dx, float *gui_dy, int map_dx, int map_dy)
void put_one_element(struct canvas *pcanvas, float zoom, enum mapview_layer layer, const struct tile *ptile, const struct tile_edge *pedge, const struct tile_corner *pcorner, const struct unit *punit, const struct city *pcity, int canvas_x, int canvas_y, const struct city *citymode, const struct unit_type *putype)
#define fc_realloc(ptr, sz)
struct client_options gui_options
int dsend_packet_city_sell(struct connection *pc, int city_id, int build_id)
int dsend_packet_city_worklist(struct connection *pc, int city_id, const struct worklist *worklist)
int dsend_packet_city_make_specialist(struct connection *pc, int city_id, int tile_id)
int dsend_packet_city_change(struct connection *pc, int city_id, int production_kind, int production_value)
int dsend_packet_city_change_specialist(struct connection *pc, int city_id, Specialist_type_id from, Specialist_type_id to)
int dsend_packet_city_make_worker(struct connection *pc, int city_id, int tile_id)
int dsend_packet_city_rename(struct connection *pc, int city_id, const char *name)
int dsend_packet_city_buy(struct connection *pc, int city_id)
int player_multiplier_effect_value(const struct player *pplayer, const struct multiplier *pmul)
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
int universal_number(const struct universal *source)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
Specialist_type_id specialist_count(void)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
SPECPQ_PRIORITY_TYPE priority
struct city_sum::@133 * sums
struct packet_game_info info
bool concise_city_production
enum airlifting_style airlifting_style
bool airlift_from_always_enabled
bool airlift_to_always_enabled
struct unit::@84::@86 client
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
size_t fc_strlcat(char *dest, const char *src, size_t n)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
struct city * tile_city(const struct tile *ptile)
#define tile_worked(_tile)
struct unit * get_drawable_unit(const struct tileset *t, struct tile *ptile, const struct city *citymode)
struct tileset * get_tileset(void)
struct tileset * unscaled_tileset
bool tileset_is_isometric(const struct tileset *t)
int tileset_tile_height(const struct tileset *t)
int tileset_tile_width(const struct tileset *t)
#define mapview_layer_iterate(layer)
#define mapview_layer_iterate_end
const char * goods_name_translation(struct goods_type *pgood)
#define trade_routes_iterate_end
#define trade_routes_iterate(c, proute)
const struct unit_type * utype
const struct impr_type * building
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const char * utype_values_string(const struct unit_type *punittype)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
void worklist_advance(struct worklist *pwl)
bool worklist_peek(const struct worklist *pwl, struct universal *prod)
void worklist_copy(struct worklist *dst, const struct worklist *src)
void worklist_init(struct worklist *pwl)
bool worklist_peek_ith(const struct worklist *pwl, struct universal *prod, int idx)
bool worklist_is_empty(const struct worklist *pwl)
bool worklist_append(struct worklist *pwl, const struct universal *prod)
bool worklist_insert(struct worklist *pwl, const struct universal *prod, int idx)
void worklist_remove(struct worklist *pwl, int idx)
int worklist_length(const struct worklist *pwl)
#define worklist_iterate_end
#define worklist_iterate(_list, _p)