58 const struct player *plr2);
60 const struct player *plr2);
62 const struct player *plr2);
109 if (!
p1->is_alive || !
p2->is_alive) {
263 return (pcity && pplayer &&
city_owner(pcity) == pplayer);
271 const struct tile *ptile)
286 const struct player *plr2)
306 const struct player *plr2)
325 const struct player *plr2)
342 const struct player *plr2)
516 pplayer =
fc_calloc(1,
sizeof(*pplayer));
517 pplayer->
slot = pslot;
673 if (pplayer ==
NULL) {
701 pcargo->client.transported_by = -1;
762 pslot = pplayer->
slot;
786 if (pcity->original == pplayer) {
789 pcity->original =
NULL;
863 if (pplayer->
nation != pnation) {
870 pnation->
player = pplayer;
872 pplayer->
nation = pnation;
900 return pplayer->
name;
968 const struct tile *ptile)
994 const struct tile *ptile)
1036 const struct tile *ptile,
1092 const struct tile *ptile)
1094 return plr !=
nullptr
1134 const struct city *pcity)
1150 const struct city *pcity)
1152 return (!pplayer || pplayer ==
city_owner(pcity));
1212 if (!pplayer || (
city_owner(pcity) == pplayer)) {
1250 const struct tile *ptile)
1360 return Q_(
"?attitude:Genocidal");
1362 return Q_(
"?attitude:Belligerent");
1364 return Q_(
"?attitude:Hostile");
1366 return Q_(
"?attitude:Uncooperative");
1368 return Q_(
"?attitude:Uneasy");
1370 return Q_(
"?attitude:Neutral");
1372 return Q_(
"?attitude:Respectful");
1374 return Q_(
"?attitude:Helpful");
1376 return Q_(
"?attitude:Enthusiastic");
1378 return Q_(
"?attitude:Admiring");
1381 return Q_(
"?attitude:Worshipful");
1505 &&
pds1->has_reason_to_cancel ==
pds2->has_reason_to_cancel
1506 &&
pds1->contact_turns_left ==
pds2->contact_turns_left);
1643 const enum effect_type
outcome,
1680#define DIPLREL_MESS_SIZE (3 + (DRO_LAST * (5 + 4 + 3 + 2 + 1)))
1767 for (
i = 0;
i < 5;
i++) {
1768 for (j =
i; j < 5; j++) {
int ai_type_number(const struct ai_type *ai)
void dbv_free(struct dbv *pdbv)
#define BV_SET_ALL_FROM(vec_to, vec_from)
#define BV_ISSET(bv, bit)
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
int city_map_radius_sq_get(const struct city *pcity)
int city_total_unit_gold_upkeep(const struct city *pcity)
int city_total_impr_gold_upkeep(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define CITY_MAP_MAX_RADIUS_SQ
#define city_owner(_pcity_)
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_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 * target_city
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_player_bonus(const struct player *pplayer, enum effect_type effect_type)
const struct functions * fc_funcs
static bool is_server(void)
#define CASUS_BELLI_OUTRAGE
#define MAX_NUM_PLAYER_SLOTS
#define CASUS_BELLI_VICTIM
void game_remove_unit(struct world *gworld, struct unit *punit)
void game_remove_city(struct world *gworld, struct city *pcity)
struct city * idex_lookup_city(struct world *iworld, int id)
struct unit * idex_lookup_unit(struct world *iworld, int id)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
int sq_map_distance(const struct tile *tile0, const struct tile *tile1)
#define fc_calloc(n, esz)
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
#define NO_NATION_SELECTED
bool is_settable_ai_level(enum ai_level level)
bool are_diplstates_equal(const struct player_diplstate *pds1, const struct player_diplstate *pds2)
bool player_can_invade_tile(const struct player *pplayer, const struct tile *ptile)
bool player_knows_techs_with_flag(const struct player *pplayer, enum tech_flag_id flag)
int player_multiplier_effect_value(const struct player *pplayer, const struct multiplier *pmul)
void * player_ai_data(const struct player *pplayer, const struct ai_type *ai)
bool player_has_state(const struct player *pplayer, enum plrstate_type state)
bool player_slot_is_used(const struct player_slot *pslot)
bv_diplrel_all_reqs diplrel_req_contradicts(const struct requirement *req)
static bv_diplrel_all_reqs * diplrel_mess_get(void)
int num_known_tech_with_flag(const struct player *pplayer, enum tech_flag_id flag)
static struct @69 player_slots
bool is_valid_username(const char *name)
static void player_diplstate_new(const struct player *plr1, const struct player *plr2)
int player_multiplier_target_value(const struct player *pplayer, const struct multiplier *pmul)
bool can_player_see_tile(const struct player *plr, const struct tile *ptile)
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
static bv_diplrel_all_reqs * diplrel_mess
struct player * player_by_name_prefix(const char *name, enum m_pre_result *result)
int diplrel_by_rule_name(const char *value)
struct player * player_new(struct player_slot *pslot)
struct player * player_by_number(const int player_id)
bool player_in_city_map(const struct player *pplayer, const struct tile *ptile)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
static bv_diplrel_all_reqs * diplrel_mess_gen(void)
bool can_player_see_unit_at(const struct player *pplayer, const struct unit *punit, const struct tile *ptile, bool is_transported)
enum diplstate_type cancel_pact_result(enum diplstate_type oldstate)
int player_slot_count(void)
struct player_slot * player_slot_by_number(int player_id)
int player_multiplier_value(const struct player *pplayer, const struct multiplier *pmul)
int player_get_expected_income(const struct player *pplayer)
int player_number(const struct player *pplayer)
enum dipl_reason pplayer_can_make_treaty(const struct player *p1, const struct player *p2, enum diplstate_type treaty)
const char * player_name(const struct player *pplayer)
static void player_diplstate_defaults(const struct player *plr1, const struct player *plr2)
void player_slots_free(void)
bool is_diplrel_to_other(const struct player *pplayer, int diplrel)
int player_slot_max_used_number(void)
static bool is_valid_alliance(const struct player *p1, const struct player *p2)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
void player_set_ai_data(struct player *pplayer, const struct ai_type *ai, void *data)
static void player_diplstate_destroy(const struct player *plr1, const struct player *plr2)
void player_ruleset_close(struct player *pplayer)
void player_clear(struct player *pplayer, bool full)
int player_slot_index(const struct player_slot *pslot)
struct player * player_by_name(const char *name)
void player_slots_init(void)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
bool player_has_real_embassy(const struct player *pplayer, const struct player *pplayer2)
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
void player_set_color(struct player *pplayer, const struct rgbcolor *prgbcolor)
struct city * player_city_by_number(const struct player *pplayer, int city_id)
struct city * player_primary_capital(const struct player *pplayer)
int player_index(const struct player *pplayer)
int player_in_territory(const struct player *pplayer, const struct player *pplayer2)
struct player * player_by_user(const char *name)
const char * diplrel_name_translation(int value)
bool is_diplrel_between(const struct player *player1, const struct player *player2, int diplrel)
bool player_set_nation(struct player *pplayer, struct nation_type *pnation)
#define DIPLREL_MESS_SIZE
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
int player_age(const struct player *pplayer)
enum dipl_reason pplayer_can_cancel_treaty(const struct player *p1, const struct player *p2)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
int number_of_ai_levels(void)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
static void player_defaults(struct player *pplayer)
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
struct player_slot * slots
bool player_has_embassy_from_effect(const struct player *pplayer, const struct player *pplayer2)
void diplrel_mess_close(void)
bool players_non_invade(const struct player *pplayer1, const struct player *pplayer2)
bool pplayers_non_attack(const struct player *pplayer, const struct player *pplayer2)
bool can_player_see_units_in_city(const struct player *pplayer, const struct city *pcity)
struct player * player_slot_get_player(const struct player_slot *pslot)
static const char * player_name_by_number(int i)
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
struct player_slot * player_slot_next(struct player_slot *pslot)
bool player_can_trust_tile_has_no_units(const struct player *pplayer, const struct tile *ptile)
bool player_slots_initialised(void)
const char * love_text(const int love)
bool gives_shared_tiles(const struct player *me, const struct player *them)
bool player_has_embassy(const struct player *pplayer, const struct player *pplayer2)
enum casus_belli_range casus_belli_range_for(const struct player *offender, const struct unit_type *off_ut, const struct player *tgt_plr, const enum effect_type outcome, const struct action *paction, const struct tile *tgt_tile)
const char * diplrel_rule_name(int value)
bool gives_shared_vision(const struct player *me, const struct player *them)
bool player_owns_city(const struct player *pplayer, const struct city *pcity)
struct player_slot * player_slot_first(void)
void player_destroy(struct player *pplayer)
bool pplayers_in_peace(const struct player *pplayer, const struct player *pplayer2)
#define players_iterate_end
@ DIPL_ALLIANCE_PROBLEM_THEM
@ DIPL_ALLIANCE_PROBLEM_US
#define players_iterate(_pplayer)
#define player_list_iterate(playerlist, pplayer)
static bool is_barbarian(const struct player *pplayer)
#define player_slots_iterate(_pslot)
#define player_list_iterate_end
#define PLAYER_DEFAULT_SCIENCE_RATE
#define set_as_human(plr)
#define players_iterate_alive_end
#define player_slots_iterate_end
#define PLAYER_DEFAULT_TAX_RATE
#define PLAYER_DEFAULT_LUXURY_RATE
#define players_iterate_alive(_pplayer)
#define requirement_diplrel_ereq(_id_, _range_, _present_)
struct research * research_get(const struct player *pplayer)
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
struct rgbcolor * rgbcolor_copy(const struct rgbcolor *prgbcolor)
struct setting_list * level[OLEVELS_NUM]
enum m_pre_result match_prefix(m_pre_accessor_fn_t accessor_fn, size_t n_names, size_t max_len_name, m_pre_strncmp_fn_t cmp_fn, m_strlen_fn_t len_fn, const char *prefix, int *ind_result)
bool is_ascii_name(const char *name)
void spaceship_init(struct player_spaceship *ship)
enum capital_type capital
struct packet_game_info info
bool(* player_tile_vision_get)(const struct tile *ptile, const struct player *pplayer, enum vision_layer vision)
void(* destroy_city)(struct city *pcity)
enum gold_upkeep_style gold_upkeep_style
bool reveal_trade_partner
enum ai_level skill_level
enum barbarian_type barbarian_type
int love[MAX_NUM_PLAYER_SLOTS]
char has_reason_to_cancel
struct city_list * cities
struct player_ai ai_common
struct dbv tile_vision[V_COUNT]
const struct player_diplstate ** diplstates
struct government * target_government
char username[MAX_LEN_NAME]
void * ais[FREECIV_AI_MOD_LAST]
struct government * government
struct connection * current_conn
char * savegame_ai_type_name
const struct ai_type * ai
char ranked_username[MAX_LEN_NAME]
struct conn_list * connections
struct player::@70::@73 client
struct player_economic economic
struct player_spaceship spaceship
struct attribute_block_s attribute_block
bv_player gives_shared_vision
struct attribute_block_s attribute_block_buffer
struct multiplier_value multipliers[MAX_NUM_MULTIPLIERS]
struct nation_type * nation
struct nation_style * style
struct player_slot * slot
bv_player gives_shared_tiles
struct player::@70::@72 server
int num_known_tech_with_flag[TF_COUNT]
struct player * extras_owner
struct unit::@81::@83 client
struct unit_list * transporting
int fc_strcasecmp(const char *str0, const char *str1)
int fc_strncasequotecmp(const char *str0, const char *str1, size_t n)
size_t effectivestrlenquote(const char *str)
#define sz_strlcpy(dest, src)
const struct player_list * team_members(const struct team *pteam)
void team_remove_player(struct player *pplayer)
#define terrain_has_flag(terr, flag)
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
bool is_hiding_unit(const struct unit *punit)
struct player * unit_nationality(const struct unit *punit)
bool unit_transport_unload(struct unit *pcargo)
bool unit_transported(const struct unit *pcargo)
struct unit_list * unit_transport_cargo(const struct unit *ptrans)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
struct unit_class * unit_class_get(const struct unit *punit)
#define vision_layer_iterate(v)
#define vision_layer_iterate_end