56 requirement_vector_init(&p->
reqs);
73 requirement_vector_free(&p->
reqs);
93 pimprove->allows_units =
FALSE;
96 pimprove->allows_units =
TRUE;
101 pimprove->allows_extras =
FALSE;
104 pimprove->allows_extras =
TRUE;
109 pimprove->prevents_disaster =
FALSE;
112 pimprove->prevents_disaster =
TRUE;
117 pimprove->protects_vs_actions =
FALSE;
120 &act->target_reqs)) {
121 pimprove->protects_vs_actions =
TRUE;
126 pimprove->allows_actions =
FALSE;
129 pimprove->allows_actions =
TRUE;
211 if (NULL == pimprove) {
272 const struct tile *ptile,
280 .building = pimprove,
284 EFT_IMPR_BUILD_COST_PCT)) / 100;
305 const struct impr_type *pimprove,
int shields_in_stock)
319 if (shields_in_stock == 0) {
382 enum impr_flag_id flag)
403 return requirement_vector_size(&pimprove->
obsolete_by) > 0;
411 const struct city *pcity)
417 .building = pimprove,
595 .value = { .building = pimprove } };
668 bool space_part =
FALSE;
675 if (preq->range >= REQ_RANGE_PLAYER
757 if (preq->range >= REQ_RANGE_PLAYER
773 return (pimprove->
genus == IG_GREAT_WONDER);
781 return (pimprove->
genus == IG_SMALL_WONDER);
789 return (pimprove->
genus == IG_IMPROVEMENT);
798 return pimprove->
genus == IG_SPECIAL;
886 city_id = pplayer->
wonders[idx];
901 log_error(
"Player %s (nb %d) has outdated wonder info for "
902 "%s (nb %d), it points to city nb %d.",
907 log_error(
"Player %s (nb %d) has outdated wonder info for "
908 "%s (nb %d), the city %s (nb %d) doesn't have this wonder.",
926 const struct player *pplayer,
929 if (pplayer ==
owner) {
1005 log_error(
"Game has outdated wonder info for %s (nb %d), "
1006 "the player %s (nb %d) doesn't have this wonder.",
1046 return (NULL != pplayer
1058 if (NULL == pplayer) {
1092 if (pcity->
owner != pplayer) {
1101 if (pimprove != NULL
1116 if (pobs->source.kind == VUT_IMPROVEMENT && pobs->present) {
1117 return pobs->source.value.building;
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
#define action_enablers_iterate_end
#define action_id_get_actor_kind(act_id)
#define action_enablers_iterate(_enabler_)
#define BV_ISSET(bv, bit)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
const char * city_name_get(const struct city *pcity)
int city_map_radius_sq_get(const struct city *pcity)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
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 int cost
bool can_disaster_happen(const struct disaster_type *pdis, const struct city *pcity)
#define disaster_type_iterate(_p)
#define disaster_type_iterate_end
struct effect_list * get_req_source_effects(struct universal *psource)
bool is_building_replaced(const struct city *pcity, const struct impr_type *pimprove, const enum req_problem_type prob_type)
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type)
int get_potential_improvement_bonus(const struct impr_type *pimprove, const struct city *pcity, enum effect_type effect_type, const enum req_problem_type prob_type, bool consider_multipliers)
int get_building_bonus(const struct city *pcity, const struct impr_type *building, enum effect_type effect_type)
bool building_has_effect(const struct impr_type *pimprove, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
static bool is_server(void)
static GtkWidget * source
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
struct impr_type * improvement_by_number(const Impr_type_id id)
bool can_sell_building(const struct impr_type *pimprove)
int impr_sell_gold(const struct impr_type *pimprove)
void improvements_init(void)
const struct impr_type * improvement_array_last(void)
const struct impr_type * valid_improvement_by_number(const Impr_type_id id)
bool can_city_sell_building(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_direct(const struct player *p, const struct impr_type *pimprove)
bool great_wonder_is_built(const struct impr_type *pimprove)
static bool improvement_has_side_effects(const struct city *pcity, const struct impr_type *pimprove)
enum test_result test_player_sell_building_now(struct player *pplayer, struct city *pcity, const struct impr_type *pimprove)
bool is_special_improvement(const struct impr_type *pimprove)
static bool impr_prevents_disaster(const struct city *pcity, const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_later(const struct player *p, const struct impr_type *pimprove)
void wonder_built(const struct city *pcity, const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
bool wonder_is_lost(const struct player *pplayer, const struct impr_type *pimprove)
bool can_player_build_improvement_now(const struct player *p, struct impr_type *pimprove)
bool is_improvement(const struct impr_type *pimprove)
static bool improvement_has_effects(const struct city *pcity, const struct impr_type *pimprove)
bool wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
int impr_base_build_shield_cost(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
static bool impr_provides_buildable_extras(const struct city *pcity, const struct impr_type *pimprove)
bool small_wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
bool can_improvement_go_obsolete(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
bool is_improvement_visible(const struct impr_type *pimprove)
struct city * city_from_wonder(const struct player *pplayer, const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
int impr_buy_gold_cost(const struct city *pcity, const struct impr_type *pimprove, int shields_in_stock)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
static void improvement_free(struct impr_type *p)
bool is_wonder(const struct impr_type *pimprove)
static bool impr_protects_vs_actions(const struct city *pcity, 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)
static bool impr_allows_actions(const struct city *pcity, const struct impr_type *pimprove)
struct impr_type * improvement_by_translated_name(const char *name)
void improvement_feature_cache_init(void)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
struct impr_type * improvement_by_rule_name(const char *name)
struct city * city_from_small_wonder(const struct player *pplayer, const struct impr_type *pimprove)
void wonder_destroyed(const struct city *pcity, const struct impr_type *pimprove)
static struct impr_type improvement_types[B_LAST]
const char * improvement_name_translation(const struct impr_type *pimprove)
struct city * city_from_great_wonder(const struct impr_type *pimprove)
Impr_type_id improvement_count(void)
static bool impr_provides_buildable_units(const struct city *pcity, const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
struct impr_type * improvement_array_first(void)
int impr_estimate_build_shield_cost(const struct player *pplayer, const struct tile *ptile, const struct impr_type *pimprove)
bool wonder_visible_to_player(const struct impr_type *wonder, const struct player *pplayer, const struct player *owner)
const struct impr_type * improvement_replacement(const struct impr_type *pimprove)
struct player * great_wonder_owner(const struct impr_type *pimprove)
bool great_wonder_is_available(const struct impr_type *pimprove)
void improvements_free(void)
bool is_improvement_productive(const struct city *pcity, const struct impr_type *pimprove)
#define WONDER_BUILT(city_id)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define WONDER_OWNED(player_id)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
static const char * rule_name_get(const struct name_translation *ptrans)
static const char * name_translation_get(const struct name_translation *ptrans)
struct player * player_by_number(const int player_id)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
struct city * player_city_by_number(const struct player *pplayer, int city_id)
bool is_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req, const enum req_problem_type prob_type)
enum req_unchanging_status is_req_preventing(const struct req_context *context, const struct player *other_player, const struct requirement *req, enum req_problem_type prob_type)
#define requirement_fulfilled_by_improvement(_imp_, _rqs_)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
#define requirement_needs_improvement(_imp_, _rqs_)
#define NUM_SS_COMPONENTS
#define NUM_SS_STRUCTURALS
void strvec_destroy(struct strvec *psv)
struct packet_ruleset_control control
struct packet_game_info info
struct requirement_vector obsolete_by
struct requirement_vector reqs
struct name_translation name
int great_wonder_owners[B_LAST]
enum wonder_visib_type small_wonder_visibility
enum spaceship_state state
struct player_spaceship spaceship
const struct player * player
int fc_strcasecmp(const char *str0, const char *str1)
bool utype_player_already_has_this(const struct player *pplayer, const struct unit_type *putype)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
#define unit_type_iterate(_p)
#define unit_type_iterate_end
bool victory_enabled(enum victory_condition_type victory)