78 const struct city *pcity,
101 if (city_list_size(pplayer->
cities)
106 factor += city_list_size(pplayer->
cities)
107 /
MAX(step_bonus, 1);
111 v += factor * num_cities * amount;
140 const bool capital,
int turns,
141 const struct effect *peffect,
const int c,
144 int amount = peffect->
value;
145 bool affects_sea_capable_units =
FALSE;
146 bool affects_land_capable_units =
FALSE;
171 switch (peffect->
type) {
173 case EFT_CAPITAL_CITY:
175 case EFT_UPKEEP_FREE:
176 case EFT_TECH_UPKEEP_FREE:
177 case EFT_POLLU_POP_PCT:
178 case EFT_POLLU_POP_PCT_2:
179 case EFT_POLLU_PROD_PCT:
180 case EFT_OUTPUT_BONUS:
181 case EFT_OUTPUT_BONUS_2:
182 case EFT_OUTPUT_ADD_TILE:
183 case EFT_OUTPUT_INC_TILE:
184 case EFT_OUTPUT_PER_TILE:
185 case EFT_OUTPUT_WASTE:
186 case EFT_OUTPUT_WASTE_BY_DISTANCE:
187 case EFT_OUTPUT_WASTE_BY_REL_DISTANCE:
188 case EFT_OUTPUT_WASTE_PCT:
189 case EFT_SPECIALIST_OUTPUT:
190 case EFT_ENEMY_CITIZEN_UNHAPPY_PCT:
191 case EFT_IRRIGATION_PCT:
193 case EFT_OUTPUT_TILE_PUNISH_PCT:
196 case EFT_CITY_VISION_RADIUS_SQ:
197 case EFT_UNIT_VISION_RADIUS_SQ:
205 case EFT_TURN_FRAGMENTS:
206 case EFT_SLOW_DOWN_TIMELINE:
211 case EFT_INCITE_COST_PCT:
212 v += c * amount / 100;
216 if (city_list_size(pplayer->
cities)
222 case EFT_UNIT_RECOVER:
228 case EFT_FORCE_CONTENT:
231 case EFT_MAKE_CONTENT:
234 case EFT_MAKE_CONTENT_MIL_PER:
238 v +=
MIN(amount, 5) * c;
241 case EFT_MAKE_CONTENT_MIL:
245 v += c *
MAX(amount + 2, 1);
248 case EFT_TECH_PARASITE:
253 if (nplayers <= amount) {
259 if (aplayer != pplayer
262 bulbs += (aplayer->server.bulbs_last_turn
263 + city_list_size(aplayer->cities) + 1);
271 value = bulbs * (1.0 - pow(1.0 - (1.0 /
MORT), turns)) *
MORT;
274 * (nplayers - amount) / (nplayers * amount * 100);
282 case EFT_CONQUEST_TECH_PCT:
287 case EFT_GROWTH_FOOD:
292 case EFT_POPCOST_FREE:
306 case EFT_ANY_GOVERNMENT:
313 case EFT_ENABLE_NUKE:
317 case EFT_ENABLE_SPACE:
329 case EFT_GIVE_IMM_TECH:
334 case EFT_HAVE_CONTACTS:
336 int new_contacts = 0;
344 v += 30 * new_contacts;
347 case EFT_HAVE_EMBASSIES:
350 case EFT_REVEAL_CITIES:
356 * (capital + 1) * amount / 100;
367 case EFT_SIZE_UNLIMIT:
396 v += 30 * extra_food;
399 v += c * amount * 4 / aqueduct_size;
402 case EFT_SS_STRUCTURAL:
403 case EFT_SS_COMPONENT:
414 case EFT_SPY_RESISTANT:
415 case EFT_SABOTEUR_RESISTANT:
420 v += (8 * v * amount + num);
422 case EFT_UNIT_NO_LOSE_POP:
423 v += unit_list_size(pcity->
tile->
units) * 2;
437 case EFT_VETERAN_COMBAT:
439 v += amount * (2 * c + num) / 50;
441 case EFT_VETERAN_BUILD:
444 v += amount * (3 * c + num);
446 case EFT_UPGRADE_UNIT:
449 }
else if (amount == 2) {
455 case EFT_UNIT_BRIBE_COST_PCT:
457 v += ((2 * c + num) * amount) / 400;
459 case EFT_ATTACK_BONUS:
461 v += (num + 4) * amount / 200;
463 case EFT_DEFEND_BONUS:
472 affects_sea_capable_units =
TRUE;
474 if (pclass->adv.land_move !=
MOVE_NONE) {
475 affects_land_capable_units =
TRUE;
478 if (affects_sea_capable_units && affects_land_capable_units) {
484 if (affects_sea_capable_units) {
487 ? amount / 6 : amount / 25;
500 if (capital || affects_land_capable_units) {
513 v += amount / (!adv->
threats.
igwall ? (18 - capital * 6) : 18);
518 case EFT_FORTIFY_DEFENSE_BONUS:
520 v += (num + 4) * amount / 250;
525 case EFT_GAIN_AI_LOVE:
527 if (
is_ai(aplayer)) {
536 case EFT_UPGRADE_PRICE_PCT:
541 case EFT_CITY_UNHAPPY_SIZE:
542 case EFT_UNHAPPY_FACTOR:
543 case EFT_UPKEEP_FACTOR:
544 case EFT_UNIT_UPKEEP_FREE_PER_CITY:
545 case EFT_CIVIL_WAR_CHANCE:
546 case EFT_EMPIRE_SIZE_BASE:
547 case EFT_EMPIRE_SIZE_STEP:
549 case EFT_MARTIAL_LAW_EACH:
550 case EFT_MARTIAL_LAW_MAX:
551 case EFT_RAPTURE_GROW:
552 case EFT_REVOLUTION_UNHAPPINESS:
554 case EFT_INSPIRE_PARTISANS:
555 case EFT_HAPPINESS_TO_GOLD:
557 case EFT_NO_DIPLOMACY:
558 case EFT_NOT_TECH_SOURCE:
559 case EFT_OUTPUT_PENALTY_TILE:
560 case EFT_OUTPUT_INC_TILE_CELEBRATE:
561 case EFT_TRADE_REVENUE_BONUS:
562 case EFT_TILE_WORKABLE:
563 case EFT_COMBAT_ROUNDS:
564 case EFT_ILLEGAL_ACTION_MOVE_COST:
565 case EFT_ILLEGAL_ACTION_HP_COST:
566 case EFT_CASUS_BELLI_CAUGHT:
567 case EFT_CASUS_BELLI_SUCCESS:
568 case EFT_CASUS_BELLI_COMPLETE:
569 case EFT_ACTION_ODDS_PCT:
570 case EFT_BORDER_VISION:
571 case EFT_STEALINGS_IGNORE:
572 case EFT_MAPS_STOLEN_PCT:
573 case EFT_UNIT_SHIELD_VALUE_PCT:
574 case EFT_HEAL_UNIT_PCT:
577 case EFT_VISIBLE_WALLS:
579 case EFT_SHIELD2GOLD_FACTOR:
581 case EFT_PERFORMANCE:
582 case EFT_NATION_PERFORMANCE:
584 v += amount / 10 + 1;
587 case EFT_NATION_HISTORY:
591 case EFT_TECH_COST_FACTOR:
594 case EFT_IMPR_BUILD_COST_PCT:
595 case EFT_UNIT_BUILD_COST_PCT:
598 case EFT_IMPR_BUY_COST_PCT:
599 case EFT_UNIT_BUY_COST_PCT:
602 case EFT_CITY_RADIUS_SQ:
605 case EFT_CITY_BUILD_SLOTS:
608 case EFT_MIGRATION_PCT:
615 if (!acity || acity == pcity ||
city_owner(acity) == pplayer) {
623 case EFT_MAX_TRADE_ROUTES:
637 case EFT_TRADE_ROUTE_PCT:
656 case EFT_MAX_STOLEN_GOLD_PM:
659 case EFT_THIEFS_SHARE_PM:
664 v -= amount * num / 20;
666 case EFT_ACTION_SUCCESS_MOVE_COST:
667 case EFT_ACTION_SUCCESS_TARGET_MOVE_COST:
676 case EFT_INFRA_POINTS:
677 v += amount *
adv->infra_priority;
679 case EFT_USER_EFFECT_1:
680 case EFT_USER_EFFECT_2:
681 case EFT_USER_EFFECT_3:
682 case EFT_USER_EFFECT_4:
719 const struct player *pplayer,
720 const struct city *pcity)
727 case VUT_IMPROVEMENT: {
733 }
else if (!preq->
present && pcity != NULL
759 case VUT_NATIONALITY:
764 if (pcity == NULL || pcity->
original == NULL) {
774 case VUT_TERRAINCLASS:
775 case VUT_TERRAINALTER:
792 case VUT_ACHIEVEMENT:
798 case VUT_MINFOREIGNPCT:
803 case VUT_NATIONGROUP:
805 case VUT_SERVERSETTING:
821 case VUT_DIPLREL_TILE:
822 case VUT_DIPLREL_TILE_O:
823 case VUT_DIPLREL_UNITANY:
824 case VUT_DIPLREL_UNITANY_O:
825 case VUT_MAXTILEUNITS:
bool adv_wants_science(struct player *pplayer)
int ai_trait_get_value(enum trait tr, struct player *pplayer)
int city_granary_size(int city_size)
bool city_can_grow_to(const struct city *pcity, int pop_size)
int city_map_radius_sq_get(const struct city *pcity)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
bool dai_can_requirement_be_met_in_city(const struct requirement *preq, const struct player *pplayer, const struct city *pcity)
adv_want dai_effect_value(struct player *pplayer, const struct adv_data *adv, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, const int nplayers)
adv_want dai_content_effect_value(const struct player *pplayer, const struct city *pcity, int amount, int num_cities, int happiness_step)
static int num_affected_units(const struct effect *peffect, const struct adv_data *ai)
static bool have_better_government(const struct player *pplayer, const struct government *pgov)
static int get_entertainers(const struct city *pcity)
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
signed short Continent_id
bool can_change_to_government(struct player *pplayer, const struct government *gov)
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
bool can_improvement_go_obsolete(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
#define log_error(message,...)
#define iterate_outward(nmap, start_tile, max_dist, itr_tile)
#define iterate_outward_end
#define adjc_iterate(nmap, center_tile, itr_tile)
int player_multiplier_effect_value(const struct player *pplayer, const struct multiplier *pmul)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
#define players_iterate_end
#define players_iterate(_pplayer)
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
bool nation_is_in_current_set(const struct nation_type *pnation)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
#define requirement_fulfilled_by_unit_class(_uc_, _rqs_)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
struct research * research_get(const struct player *pplayer)
int get_specialist_output(const struct city *pcity, Specialist_type_id sp, Output_type_id otype)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
struct adv_data::@90 threats
struct adv_data::@91 explore
struct adv_data::@92 stats
struct adv_data::@92::@95 units
struct adv_data::@94::@96 govt
struct player * production_leader
struct adv_data::@93 dipl
struct adv_data::@94 goal
struct player * tech_leader
struct player * spacerace_leader
citizens feel[CITIZEN_LAST][FEELING_LAST]
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct unit_list * units_supported
struct civ_game::@30::@34 server
struct packet_game_info info
struct multiplier * multiplier
struct requirement_vector reqs
struct government * better
struct government::@40 ai
struct requirement_vector reqs
bool team_pooled_research
struct city_list * cities
struct government * government
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
#define is_ocean_tile(ptile)
struct city * tile_city(const struct tile *ptile)
#define tile_continent(_tile)
int trade_base_between_cities(const struct city *pc1, const struct city *pc2)
int city_num_trade_routes(const struct city *pcity)
unsigned max_trade_routes(const struct city *pcity)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
#define TRAIT_DEFAULT_VALUE
struct specialist * specialist
struct nation_type * nation
struct government * govern
const struct impr_type * building
#define unit_class_iterate(_p)
#define uclass_index(_c_)
#define unit_class_iterate_end
bool victory_enabled(enum victory_condition_type victory)