Freeciv-3.1
|
#include "support.h"
#include "connection.h"
#include "fc_types.h"
#include "multipliers.h"
#include "requirements.h"
#include "specenum_gen.h"
#include "speclist.h"
Go to the source code of this file.
Data Structures | |
struct | effect |
Macros | |
#define | SPECENUM_NAME effect_type |
#define | SPECENUM_VALUE0 EFT_TECH_PARASITE |
#define | SPECENUM_VALUE0NAME "Tech_Parasite" |
#define | SPECENUM_VALUE1 EFT_AIRLIFT |
#define | SPECENUM_VALUE1NAME "Airlift" |
#define | SPECENUM_VALUE2 EFT_ANY_GOVERNMENT |
#define | SPECENUM_VALUE2NAME "Any_Government" |
#define | SPECENUM_VALUE3 EFT_CAPITAL_CITY |
#define | SPECENUM_VALUE3NAME "Capital_City" |
#define | SPECENUM_VALUE4 EFT_ENABLE_NUKE |
#define | SPECENUM_VALUE4NAME "Enable_Nuke" |
#define | SPECENUM_VALUE5 EFT_ENABLE_SPACE |
#define | SPECENUM_VALUE5NAME "Enable_Space" |
#define | SPECENUM_VALUE6 EFT_SPECIALIST_OUTPUT |
#define | SPECENUM_VALUE6NAME "Specialist_Output" |
#define | SPECENUM_VALUE7 EFT_OUTPUT_BONUS |
#define | SPECENUM_VALUE7NAME "Output_Bonus" |
#define | SPECENUM_VALUE8 EFT_OUTPUT_BONUS_2 |
#define | SPECENUM_VALUE8NAME "Output_Bonus_2" |
#define | SPECENUM_VALUE9 EFT_OUTPUT_ADD_TILE |
#define | SPECENUM_VALUE9NAME "Output_Add_Tile" |
#define | SPECENUM_VALUE10 EFT_OUTPUT_INC_TILE |
#define | SPECENUM_VALUE10NAME "Output_Inc_Tile" |
#define | SPECENUM_VALUE11 EFT_OUTPUT_PER_TILE |
#define | SPECENUM_VALUE11NAME "Output_Per_Tile" |
#define | SPECENUM_VALUE12 EFT_OUTPUT_WASTE_PCT |
#define | SPECENUM_VALUE12NAME "Output_Waste_Pct" |
#define | SPECENUM_VALUE13 EFT_FORCE_CONTENT |
#define | SPECENUM_VALUE13NAME "Force_Content" |
#define | SPECENUM_VALUE14 EFT_GIVE_IMM_TECH |
#define | SPECENUM_VALUE14NAME "Give_Imm_Tech" |
#define | SPECENUM_VALUE15 EFT_GROWTH_FOOD |
#define | SPECENUM_VALUE15NAME "Growth_Food" |
#define | SPECENUM_VALUE16 EFT_HEALTH_PCT |
#define | SPECENUM_VALUE16NAME "Health_Pct" |
#define | SPECENUM_VALUE17 EFT_HAVE_EMBASSIES |
#define | SPECENUM_VALUE17NAME "Have_Embassies" |
#define | SPECENUM_VALUE18 EFT_MAKE_CONTENT |
#define | SPECENUM_VALUE18NAME "Make_Content" |
#define | SPECENUM_VALUE19 EFT_MAKE_CONTENT_MIL |
#define | SPECENUM_VALUE19NAME "Make_Content_Mil" |
#define | SPECENUM_VALUE20 EFT_MAKE_CONTENT_MIL_PER |
#define | SPECENUM_VALUE20NAME "Make_Content_Mil_Per" |
#define | SPECENUM_VALUE21 EFT_MAKE_HAPPY |
#define | SPECENUM_VALUE21NAME "Make_Happy" |
#define | SPECENUM_VALUE22 EFT_NO_ANARCHY |
#define | SPECENUM_VALUE22NAME "No_Anarchy" |
#define | SPECENUM_VALUE23 EFT_NUKE_PROOF |
#define | SPECENUM_VALUE23NAME "Nuke_Proof" |
#define | SPECENUM_VALUE24 EFT_POLLU_POP_PCT |
#define | SPECENUM_VALUE24NAME "Pollu_Pop_Pct" |
#define | SPECENUM_VALUE25 EFT_POLLU_POP_PCT_2 |
#define | SPECENUM_VALUE25NAME "Pollu_Pop_Pct_2" |
#define | SPECENUM_VALUE26 EFT_POLLU_PROD_PCT |
#define | SPECENUM_VALUE26NAME "Pollu_Prod_Pct" |
#define | SPECENUM_VALUE27 EFT_REVEAL_CITIES |
#define | SPECENUM_VALUE27NAME "Reveal_Cities" |
#define | SPECENUM_VALUE28 EFT_REVEAL_MAP |
#define | SPECENUM_VALUE28NAME "Reveal_Map" |
#define | SPECENUM_VALUE29 EFT_INCITE_COST_PCT |
#define | SPECENUM_VALUE29NAME "Incite_Cost_Pct" |
#define | SPECENUM_VALUE30 EFT_SIZE_ADJ |
#define | SPECENUM_VALUE30NAME "Size_Adj" |
#define | SPECENUM_VALUE31 EFT_SIZE_UNLIMIT |
#define | SPECENUM_VALUE31NAME "Size_Unlimit" |
#define | SPECENUM_VALUE32 EFT_SS_STRUCTURAL |
#define | SPECENUM_VALUE32NAME "SS_Structural" |
#define | SPECENUM_VALUE33 EFT_SS_COMPONENT |
#define | SPECENUM_VALUE33NAME "SS_Component" |
#define | SPECENUM_VALUE34 EFT_SS_MODULE |
#define | SPECENUM_VALUE34NAME "SS_Module" |
#define | SPECENUM_VALUE35 EFT_SPY_RESISTANT |
#define | SPECENUM_VALUE35NAME "Spy_Resistant" |
#define | SPECENUM_VALUE36 EFT_MOVE_BONUS |
#define | SPECENUM_VALUE36NAME "Move_Bonus" |
#define | SPECENUM_VALUE37 EFT_UNIT_NO_LOSE_POP |
#define | SPECENUM_VALUE37NAME "Unit_No_Lose_Pop" |
#define | SPECENUM_VALUE38 EFT_UNIT_RECOVER |
#define | SPECENUM_VALUE38NAME "Unit_Recover" |
#define | SPECENUM_VALUE39 EFT_UPGRADE_UNIT |
#define | SPECENUM_VALUE39NAME "Upgrade_Unit" |
#define | SPECENUM_VALUE40 EFT_UPKEEP_FREE |
#define | SPECENUM_VALUE40NAME "Upkeep_Free" |
#define | SPECENUM_VALUE41 EFT_TECH_UPKEEP_FREE |
#define | SPECENUM_VALUE41NAME "Tech_Upkeep_Free" |
#define | SPECENUM_VALUE42 EFT_NO_UNHAPPY |
#define | SPECENUM_VALUE42NAME "No_Unhappy" |
#define | SPECENUM_VALUE43 EFT_VETERAN_BUILD |
#define | SPECENUM_VALUE43NAME "Veteran_Build" |
#define | SPECENUM_VALUE44 EFT_VETERAN_COMBAT |
#define | SPECENUM_VALUE44NAME "Veteran_Combat" |
#define | SPECENUM_VALUE45 EFT_HP_REGEN |
#define | SPECENUM_VALUE45NAME "HP_Regen" |
#define | SPECENUM_VALUE46 EFT_CITY_VISION_RADIUS_SQ |
#define | SPECENUM_VALUE46NAME "City_Vision_Radius_Sq" |
#define | SPECENUM_VALUE47 EFT_UNIT_VISION_RADIUS_SQ |
#define | SPECENUM_VALUE47NAME "Unit_Vision_Radius_Sq" |
#define | SPECENUM_VALUE48 EFT_DEFEND_BONUS |
#define | SPECENUM_VALUE48NAME "Defend_Bonus" |
#define | SPECENUM_VALUE49 EFT_TRADE_ROUTE_PCT |
#define | SPECENUM_VALUE49NAME "Traderoute_Pct" |
#define | SPECENUM_VALUE50 EFT_GAIN_AI_LOVE |
#define | SPECENUM_VALUE50NAME "Gain_AI_Love" |
#define | SPECENUM_VALUE51 EFT_TURN_YEARS |
#define | SPECENUM_VALUE51NAME "Turn_Years" |
#define | SPECENUM_VALUE52 EFT_SLOW_DOWN_TIMELINE |
#define | SPECENUM_VALUE52NAME "Slow_Down_Timeline" |
#define | SPECENUM_VALUE53 EFT_CIVIL_WAR_CHANCE |
#define | SPECENUM_VALUE53NAME "Civil_War_Chance" |
#define | SPECENUM_VALUE54 EFT_MIGRATION_PCT |
#define | SPECENUM_VALUE54NAME "Migration_Pct" |
#define | SPECENUM_VALUE55 EFT_EMPIRE_SIZE_BASE |
#define | SPECENUM_VALUE55NAME "Empire_Size_Base" |
#define | SPECENUM_VALUE56 EFT_EMPIRE_SIZE_STEP |
#define | SPECENUM_VALUE56NAME "Empire_Size_Step" |
#define | SPECENUM_VALUE57 EFT_MAX_RATES |
#define | SPECENUM_VALUE57NAME "Max_Rates" |
#define | SPECENUM_VALUE58 EFT_MARTIAL_LAW_EACH |
#define | SPECENUM_VALUE58NAME "Martial_Law_Each" |
#define | SPECENUM_VALUE59 EFT_MARTIAL_LAW_MAX |
#define | SPECENUM_VALUE59NAME "Martial_Law_Max" |
#define | SPECENUM_VALUE60 EFT_RAPTURE_GROW |
#define | SPECENUM_VALUE60NAME "Rapture_Grow" |
#define | SPECENUM_VALUE61 EFT_REVOLUTION_UNHAPPINESS |
#define | SPECENUM_VALUE61NAME "Revolution_Unhappiness" |
#define | SPECENUM_VALUE62 EFT_HAS_SENATE |
#define | SPECENUM_VALUE62NAME "Has_Senate" |
#define | SPECENUM_VALUE63 EFT_INSPIRE_PARTISANS |
#define | SPECENUM_VALUE63NAME "Inspire_Partisans" |
#define | SPECENUM_VALUE64 EFT_HAPPINESS_TO_GOLD |
#define | SPECENUM_VALUE64NAME "Happiness_To_Gold" |
#define | SPECENUM_VALUE65 EFT_FANATICS |
#define | SPECENUM_VALUE65NAME "Fanatics" |
#define | SPECENUM_VALUE66 EFT_NO_DIPLOMACY |
#define | SPECENUM_VALUE66NAME "No_Diplomacy" |
#define | SPECENUM_VALUE67 EFT_TRADE_REVENUE_BONUS |
#define | SPECENUM_VALUE67NAME "Trade_Revenue_Bonus" |
#define | SPECENUM_VALUE68 EFT_UNHAPPY_FACTOR |
#define | SPECENUM_VALUE68NAME "Unhappy_Factor" |
#define | SPECENUM_VALUE69 EFT_UPKEEP_FACTOR |
#define | SPECENUM_VALUE69NAME "Upkeep_Factor" |
#define | SPECENUM_VALUE70 EFT_UNIT_UPKEEP_FREE_PER_CITY |
#define | SPECENUM_VALUE70NAME "Unit_Upkeep_Free_Per_City" |
#define | SPECENUM_VALUE71 EFT_OUTPUT_WASTE |
#define | SPECENUM_VALUE71NAME "Output_Waste" |
#define | SPECENUM_VALUE72 EFT_OUTPUT_WASTE_BY_DISTANCE |
#define | SPECENUM_VALUE72NAME "Output_Waste_By_Distance" |
#define | SPECENUM_VALUE73 EFT_OUTPUT_PENALTY_TILE |
#define | SPECENUM_VALUE73NAME "Output_Penalty_Tile" |
#define | SPECENUM_VALUE74 EFT_OUTPUT_INC_TILE_CELEBRATE |
#define | SPECENUM_VALUE74NAME "Output_Inc_Tile_Celebrate" |
#define | SPECENUM_VALUE75 EFT_CITY_UNHAPPY_SIZE |
#define | SPECENUM_VALUE75NAME "City_Unhappy_Size" |
#define | SPECENUM_VALUE76 EFT_CITY_RADIUS_SQ |
#define | SPECENUM_VALUE76NAME "City_Radius_Sq" |
#define | SPECENUM_VALUE77 EFT_CITY_BUILD_SLOTS |
#define | SPECENUM_VALUE77NAME "City_Build_Slots" |
#define | SPECENUM_VALUE78 EFT_UPGRADE_PRICE_PCT |
#define | SPECENUM_VALUE78NAME "Upgrade_Price_Pct" |
#define | SPECENUM_VALUE79 EFT_VISIBLE_WALLS |
#define | SPECENUM_VALUE79NAME "Visible_Walls" |
#define | SPECENUM_VALUE80 EFT_TECH_COST_FACTOR |
#define | SPECENUM_VALUE80NAME "Tech_Cost_Factor" |
#define | SPECENUM_VALUE81 EFT_SHIELD2GOLD_FACTOR |
#define | SPECENUM_VALUE81NAME "Shield2Gold_Factor" |
#define | SPECENUM_VALUE82 EFT_TILE_WORKABLE |
#define | SPECENUM_VALUE82NAME "Tile_Workable" |
#define | SPECENUM_VALUE83 EFT_CITY_IMAGE |
#define | SPECENUM_VALUE83NAME "City_Image" |
#define | SPECENUM_VALUE84 EFT_IMPR_BUILD_COST_PCT |
#define | SPECENUM_VALUE84NAME "Building_Build_Cost_Pct" |
#define | SPECENUM_VALUE85 EFT_MAX_TRADE_ROUTES |
#define | SPECENUM_VALUE85NAME "Max_Trade_Routes" |
#define | SPECENUM_VALUE86 EFT_GOV_CENTER |
#define | SPECENUM_VALUE86NAME "Gov_Center" |
#define | SPECENUM_VALUE87 EFT_COMBAT_ROUNDS |
#define | SPECENUM_VALUE87NAME "Combat_Rounds" |
#define | SPECENUM_VALUE88 EFT_IMPR_BUY_COST_PCT |
#define | SPECENUM_VALUE88NAME "Building_Buy_Cost_Pct" |
#define | SPECENUM_VALUE89 EFT_UNIT_BUILD_COST_PCT |
#define | SPECENUM_VALUE89NAME "Unit_Build_Cost_Pct" |
#define | SPECENUM_VALUE90 EFT_UNIT_BUY_COST_PCT |
#define | SPECENUM_VALUE90NAME "Unit_Buy_Cost_Pct" |
#define | SPECENUM_VALUE91 EFT_NOT_TECH_SOURCE |
#define | SPECENUM_VALUE91NAME "Not_Tech_Source" |
#define | SPECENUM_VALUE92 EFT_ENEMY_CITIZEN_UNHAPPY_PCT |
#define | SPECENUM_VALUE92NAME "Enemy_Citizen_Unhappy_Pct" |
#define | SPECENUM_VALUE93 EFT_IRRIGATION_PCT |
#define | SPECENUM_VALUE93NAME "Irrigation_Pct" |
#define | SPECENUM_VALUE94 EFT_MINING_PCT |
#define | SPECENUM_VALUE94NAME "Mining_Pct" |
#define | SPECENUM_VALUE95 EFT_OUTPUT_TILE_PUNISH_PCT |
#define | SPECENUM_VALUE95NAME "Output_Tile_Punish_Pct" |
#define | SPECENUM_VALUE96 EFT_UNIT_BRIBE_COST_PCT |
#define | SPECENUM_VALUE96NAME "Unit_Bribe_Cost_Pct" |
#define | SPECENUM_VALUE97 EFT_VICTORY |
#define | SPECENUM_VALUE97NAME "Victory" |
#define | SPECENUM_VALUE98 EFT_PERFORMANCE |
#define | SPECENUM_VALUE98NAME "Performance" |
#define | SPECENUM_VALUE99 EFT_HISTORY |
#define | SPECENUM_VALUE99NAME "History" |
#define | SPECENUM_VALUE100 EFT_NATION_PERFORMANCE |
#define | SPECENUM_VALUE100NAME "National_Performance" |
#define | SPECENUM_VALUE101 EFT_NATION_HISTORY |
#define | SPECENUM_VALUE101NAME "National_History" |
#define | SPECENUM_VALUE102 EFT_TURN_FRAGMENTS |
#define | SPECENUM_VALUE102NAME "Turn_Fragments" |
#define | SPECENUM_VALUE103 EFT_MAX_STOLEN_GOLD_PM |
#define | SPECENUM_VALUE103NAME "Max_Stolen_Gold_Pm" |
#define | SPECENUM_VALUE104 EFT_THIEFS_SHARE_PM |
#define | SPECENUM_VALUE104NAME "Thiefs_Share_Pm" |
#define | SPECENUM_VALUE105 EFT_RETIRE_PCT |
#define | SPECENUM_VALUE105NAME "Retire_Pct" |
#define | SPECENUM_VALUE106 EFT_ILLEGAL_ACTION_MOVE_COST |
#define | SPECENUM_VALUE106NAME "Illegal_Action_Move_Cost" |
#define | SPECENUM_VALUE107 EFT_HAVE_CONTACTS |
#define | SPECENUM_VALUE107NAME "Have_Contacts" |
#define | SPECENUM_VALUE108 EFT_CASUS_BELLI_CAUGHT |
#define | SPECENUM_VALUE108NAME "Casus_Belli_Caught" |
#define | SPECENUM_VALUE109 EFT_CASUS_BELLI_SUCCESS |
#define | SPECENUM_VALUE109NAME "Casus_Belli_Success" |
#define | SPECENUM_VALUE110 EFT_ACTION_ODDS_PCT |
#define | SPECENUM_VALUE110NAME "Action_Odds_Pct" |
#define | SPECENUM_VALUE111 EFT_BORDER_VISION |
#define | SPECENUM_VALUE111NAME "Border_Vision" |
#define | SPECENUM_VALUE112 EFT_STEALINGS_IGNORE |
#define | SPECENUM_VALUE112NAME "Stealings_Ignore" |
#define | SPECENUM_VALUE113 EFT_OUTPUT_WASTE_BY_REL_DISTANCE |
#define | SPECENUM_VALUE113NAME "Output_Waste_By_Rel_Distance" |
#define | SPECENUM_VALUE114 EFT_SABOTEUR_RESISTANT |
#define | SPECENUM_VALUE114NAME "Building_Saboteur_Resistant" |
#define | SPECENUM_VALUE115 EFT_UNIT_SLOTS |
#define | SPECENUM_VALUE115NAME "Unit_Slots" |
#define | SPECENUM_VALUE116 EFT_ATTACK_BONUS |
#define | SPECENUM_VALUE116NAME "Attack_Bonus" |
#define | SPECENUM_VALUE117 EFT_CONQUEST_TECH_PCT |
#define | SPECENUM_VALUE117NAME "Conquest_Tech_Pct" |
#define | SPECENUM_VALUE118 EFT_ACTION_SUCCESS_MOVE_COST |
#define | SPECENUM_VALUE118NAME "Action_Success_Actor_Move_Cost" |
#define | SPECENUM_VALUE119 EFT_ACTION_SUCCESS_TARGET_MOVE_COST |
#define | SPECENUM_VALUE119NAME "Action_Success_Target_Move_Cost" |
#define | SPECENUM_VALUE120 EFT_INFRA_POINTS |
#define | SPECENUM_VALUE120NAME "Infra_Points" |
#define | SPECENUM_VALUE121 EFT_FORTIFY_DEFENSE_BONUS |
#define | SPECENUM_VALUE121NAME "Fortify_Defense_Bonus" |
#define | SPECENUM_VALUE122 EFT_MAPS_STOLEN_PCT |
#define | SPECENUM_VALUE122NAME "Maps_Stolen_Pct" |
#define | SPECENUM_VALUE123 EFT_UNIT_SHIELD_VALUE_PCT |
#define | SPECENUM_VALUE123NAME "Unit_Shield_Value_Pct" |
#define | SPECENUM_VALUE124 EFT_CASUS_BELLI_COMPLETE |
#define | SPECENUM_VALUE124NAME "Casus_Belli_Complete" |
#define | SPECENUM_VALUE125 EFT_ILLEGAL_ACTION_HP_COST |
#define | SPECENUM_VALUE125NAME "Illegal_Action_HP_Cost" |
#define | SPECENUM_VALUE126 EFT_POPCOST_FREE |
#define | SPECENUM_VALUE126NAME "Popcost_Free" |
#define | SPECENUM_VALUE127 EFT_HEAL_UNIT_PCT |
#define | SPECENUM_VALUE127NAME "Heal_Unit_Pct" |
#define | SPECENUM_VALUE128 EFT_MIN_HP_PCT |
#define | SPECENUM_VALUE128NAME "Min_HP_Pct" |
#define | SPECENUM_VALUE129 EFT_HP_REGEN_2 |
#define | SPECENUM_VALUE129NAME "HP_Regen_2" |
#define | SPECENUM_VALUE130 EFT_USER_EFFECT_1 |
#define | SPECENUM_VALUE130NAME "User_Effect_1" |
#define | SPECENUM_VALUE131 EFT_USER_EFFECT_2 |
#define | SPECENUM_VALUE131NAME "User_Effect_2" |
#define | SPECENUM_VALUE132 EFT_USER_EFFECT_3 |
#define | SPECENUM_VALUE132NAME "User_Effect_3" |
#define | SPECENUM_VALUE133 EFT_USER_EFFECT_4 |
#define | SPECENUM_VALUE133NAME "User_Effect_4" |
#define | SPECENUM_COUNT EFT_COUNT |
#define | SPECLIST_TAG effect |
#define | SPECLIST_TYPE struct effect |
#define | effect_list_iterate(effect_list, peffect) TYPED_LIST_ITERATE(struct effect, effect_list, peffect) |
#define | effect_list_iterate_end LIST_ITERATE_END |
Typedefs | |
typedef double(* | eft_value_filter_cb) (const struct effect *eft, const struct req_context *context, const struct player *other_player, void *data, int n_data) |
typedef bool(* | iec_cb) (struct effect *, void *data) |
Functions | |
struct effect * | effect_new (enum effect_type type, int value, struct multiplier *pmul) |
struct effect * | effect_copy (struct effect *old) |
void | effect_remove (struct effect *peffect) |
void | effect_req_append (struct effect *peffect, struct requirement req) |
void | get_effect_req_text (const struct effect *peffect, char *buf, size_t buf_len) |
void | get_effect_list_req_text (const struct effect_list *plist, struct astring *astr) |
void | ruleset_cache_init (void) |
void | ruleset_cache_free (void) |
void | recv_ruleset_effect (const struct packet_ruleset_effect *packet) |
void | send_ruleset_cache (struct conn_list *dest) |
int | effect_cumulative_max (enum effect_type type, struct universal *unis, size_t n_unis) |
int | effect_cumulative_min (enum effect_type type, struct universal *for_uni) |
int | effect_value_from_universals (enum effect_type type, struct universal *unis, size_t n_unis) |
bool | effect_universals_value_never_below (enum effect_type type, struct universal *unis, size_t n_unis, int min_value) |
int | effect_value_will_make_positive (enum effect_type type) |
bool | is_building_replaced (const struct city *pcity, const struct impr_type *pimprove, const enum req_problem_type prob_type) |
int | get_world_bonus (enum effect_type effect_type) |
int | get_player_bonus (const struct player *plr, enum effect_type effect_type) |
int | get_city_bonus (const struct city *pcity, enum effect_type effect_type) |
int | get_city_specialist_output_bonus (const struct city *pcity, const struct specialist *pspecialist, const struct output_type *poutput, enum effect_type effect_type) |
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_tile_output_bonus (const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type) |
int | get_player_output_bonus (const struct player *pplayer, const struct output_type *poutput, enum effect_type effect_type) |
int | get_city_output_bonus (const struct city *pcity, const struct output_type *poutput, enum effect_type effect_type) |
int | get_building_bonus (const struct city *pcity, const struct impr_type *building, enum effect_type effect_type) |
int | get_unittype_bonus (const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, const struct action *paction, enum effect_type effect_type) |
int | get_unit_bonus (const struct unit *punit, enum effect_type effect_type) |
int | get_unit_vs_tile_bonus (const struct tile *ptile, const struct unit *punit, enum effect_type etype) |
struct effect_list * | get_req_source_effects (struct universal *psource) |
int | get_player_bonus_effects (struct effect_list *plist, const struct player *pplayer, 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) |
int | get_target_bonus_effects (struct effect_list *plist, const struct req_context *context, const struct player *other_player, enum effect_type effect_type) |
double | get_effect_expected_value (const struct req_context *context, const struct player *other_player, enum effect_type effect_type, eft_value_filter_cb weighter, void *data, int n_data) fc__attribute((nonnull(4))) |
bool | building_has_effect (const struct impr_type *pimprove, enum effect_type effect_type) |
int | get_current_construction_bonus (const struct city *pcity, enum effect_type effect_type, const enum req_problem_type prob_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) |
struct effect_list * | get_effects (enum effect_type effect_type) |
bool | iterate_effect_cache (iec_cb cb, void *data) |
#define effect_list_iterate | ( | effect_list, | |
peffect | |||
) | TYPED_LIST_ITERATE(struct effect, effect_list, peffect) |
#define effect_list_iterate_end LIST_ITERATE_END |
#define SPECENUM_NAME effect_type |
#define SPECENUM_VALUE113 EFT_OUTPUT_WASTE_BY_REL_DISTANCE |
#define SPECENUM_VALUE113NAME "Output_Waste_By_Rel_Distance" |
#define SPECENUM_VALUE114NAME "Building_Saboteur_Resistant" |
#define SPECENUM_VALUE118NAME "Action_Success_Actor_Move_Cost" |
#define SPECENUM_VALUE119 EFT_ACTION_SUCCESS_TARGET_MOVE_COST |
#define SPECENUM_VALUE119NAME "Action_Success_Target_Move_Cost" |
typedef double(* eft_value_filter_cb) (const struct effect *eft, const struct req_context *context, const struct player *other_player, void *data, int n_data) |
Returns TRUE if the building has any effect bonuses of the given type.
Note that this function returns a boolean rather than an integer value giving the exact bonus. Finding the exact bonus requires knowing the effect range and may take longer. This function should only be used in situations where the range doesn't matter.
Definition at line 587 of file effects.c.
Referenced by building_crucial(), can_player_build_improvement_direct(), get_building_for_effect(), helptext_building(), try_to_sell_stuff(), and valid_improvement().
Return new copy of the effect
Definition at line 214 of file effects.c.
Referenced by effect_handle_split_universal().
int effect_cumulative_max | ( | enum effect_type | type, |
struct universal * | unis, | ||
size_t | n_unis | ||
) |
Get the maximum effect value in this ruleset for the universal (that is, the sum of all positive effects clauses that apply specifically to this universal – this can be an overestimate in the case of mutually exclusive effects). for_uni can be NULL to get max effect value ignoring requirements.
Definition at line 331 of file effects.c.
Referenced by helptext_unit(), rs_common_units(), rs_max_city_radius_sq(), sanity_check_boolean_effects(), set_unit_type_caches(), and utype_unknown_move_cost().
int effect_cumulative_min | ( | enum effect_type | type, |
struct universal * | for_uni | ||
) |
Get the minimum effect value in this ruleset for the universal (that is, the sum of all negative effects clauses that apply specifically to this universal – this can be an overestimate in the case of mutually exclusive effects). for_uni can be NULL to get min effect value ignoring requirements.
Definition at line 367 of file effects.c.
Referenced by effect_value_will_make_positive(), and sanity_check_boolean_effects().
struct effect * effect_new | ( | enum effect_type | type, |
int | value, | ||
struct multiplier * | pmul | ||
) |
Add effect to ruleset cache.
Definition at line 179 of file effects.c.
Referenced by effect_edit::add_now(), effect_copy(), load_ruleset_effects(), paratroopers_mr_sub_to_effect(), recv_ruleset_effect(), rscompat_postprocess(), and slow_invasion_effects().
void effect_remove | ( | struct effect * | peffect | ) |
Remove effect from the caches.
Definition at line 205 of file effects.c.
Referenced by effect_edit::delete_now().
void effect_req_append | ( | struct effect * | peffect, |
struct requirement | req | ||
) |
Append requirement to effect.
Definition at line 229 of file effects.c.
Referenced by effect_edit::add_now(), effect_copy(), effect_list_compat_cb(), load_ruleset_effects(), paratroopers_mr_sub_to_effect(), recv_ruleset_effect(), rscompat_postprocess(), and slow_invasion_effects().
bool effect_universals_value_never_below | ( | enum effect_type | type, |
struct universal * | unis, | ||
size_t | n_unis, | ||
int | min_value | ||
) |
Returns TRUE iff the specified effect type is guaranteed to always have a value at or above the specified value given the presence of the specified list of universals. Note that it may be true that the effect type always will be at or above the specified value a even if this function refuses to guarantee it by returning FALSE. It may simply be unable to detect that it is so.
type | the effect type |
unis | the list of present universals |
n_unis | the number of universals in unis |
min_value | the value the effect always should be at or above |
Definition at line 488 of file effects.c.
Referenced by helptext_unit(), utype_act_takes_all_mp_cache_set(), and utype_act_takes_all_mp_ustate_cache_set().
int effect_value_from_universals | ( | enum effect_type | type, |
struct universal * | unis, | ||
size_t | n_unis | ||
) |
Return the base value of a given effect that can always be expected from just the sources in the list, independent of other factors. Adds up all the effects that rely only on these universals; effects that have extra conditions are ignored. In effect, 'unis' is a template against which effects are matched. The first universal in the list is special: effects must have a condition that specifically applies to that source to be included (may be a superset requirement, e.g. ExtraFlag for VUT_EXTRA source).
Definition at line 402 of file effects.c.
Referenced by extra_bonus_for_terrain(), and helptext_unit().
int effect_value_will_make_positive | ( | enum effect_type | type | ) |
int get_building_bonus | ( | const struct city * | pcity, |
const struct impr_type * | building, | ||
enum effect_type | effect_type | ||
) |
Returns the effect bonus at a building.
Definition at line 930 of file effects.c.
Referenced by city_improvement_upkeep(), impr_build_shield_cost(), and impr_buy_gold_cost().
int get_city_bonus | ( | const struct city * | pcity, |
enum effect_type | effect_type | ||
) |
Returns the effect bonus at a city.
Definition at line 789 of file effects.c.
Referenced by api_effects_city_bonus(), citizen_content_buildings(), citizen_happiness_nationality(), citizen_happy_wonders(), city_airlift_max(), city_build_slots(), city_can_grow_to(), city_citywalls_gfx(), city_culture(), city_dialog_update_supported_units(), city_got_defense_effect(), city_granary_savings(), city_history_gain(), city_incite_cost(), city_map_update_radius_sq(), city_migration_score(), city_pollution_types(), city_rapture_grow(), city_refresh_vision(), city_support(), city_turn_notify(), city_unit_slots_available(), city_unit_unhappiness(), create_unit_surface(), dai_action_choose_sub_tgt_unit_vs_city(), dai_assess_military_unhappiness(), dai_content_effect_value(), dai_effect_value(), dai_set_defenders(), dai_spend_gold(), dai_war_desire(), diplomat_sabotage(), do_attack(), get_city_dialog_output_text(), get_city_health(), get_city_sprite(), get_city_tithes_bonus(), is_gov_center(), max_trade_routes(), military_advisor_choose_build(), multiairlift(), package_city(), redraw_city_dialog(), redraw_unit_info_label(), set_city_production(), spy_steal_gold(), text_happiness_nationality(), text_happiness_units(), unit_bombard(), update_capital(), update_city_activity(), update_dumb_city(), and city_dialog::update_units().
int get_city_bonus_effects | ( | struct effect_list * | plist, |
const struct city * | pcity, | ||
const struct output_type * | poutput, | ||
enum effect_type | effect_type | ||
) |
Returns the effect sources of this type currently active at the city.
The returned vector must be freed (building_vector_free) when the caller is done with it.
Definition at line 1075 of file effects.c.
Referenced by get_city_dialog_culture_text(), get_city_dialog_illness_text(), get_city_dialog_output_text(), redraw_happiness_city_dialog(), text_happiness_buildings(), and text_happiness_wonders().
int get_city_output_bonus | ( | const struct city * | pcity, |
const struct output_type * | poutput, | ||
enum effect_type | effect_type | ||
) |
Returns the player effect bonus of an output.
Definition at line 906 of file effects.c.
Referenced by city_units_upkeep(), and city_waste().
int get_city_specialist_output_bonus | ( | const struct city * | pcity, |
const struct specialist * | pspecialist, | ||
const struct output_type * | poutput, | ||
enum effect_type | effect_type | ||
) |
Returns the effect bonus of a specialist in a city.
Definition at line 807 of file effects.c.
Referenced by get_specialist_output().
int get_city_tile_output_bonus | ( | const struct city * | pcity, |
const struct tile * | ptile, | ||
const struct output_type * | poutput, | ||
enum effect_type | effect_type | ||
) |
Returns the effect bonus at a city tile. pcity must be supplied.
FIXME: this is now used both for tile bonuses, tile-output bonuses, and city-output bonuses. Thus ptile or poutput may be NULL for certain callers. This could be changed by adding 2 new functions to the interface but they'd be almost identical and their likely names would conflict with functions already in city.c. It's also very similar to get_tile_output_bonus(); it should be called when the city is mandatory.
Definition at line 838 of file effects.c.
Referenced by base_city_can_work_tile(), city_tc_effect_refresh(), get_final_city_output_bonus(), and tile_change_side_effects().
int get_current_construction_bonus | ( | const struct city * | pcity, |
enum effect_type | effect_type, | ||
const enum req_problem_type | prob_type | ||
) |
Returns the effect bonus the currently-in-construction-item will provide.
Note this is not called get_current_production_bonus because that would be confused with EFT_PROD_BONUS.
Problem type tells if we need to be CERTAIN about bonus before counting it or is POSSIBLE bonus enough.
Definition at line 1104 of file effects.c.
Referenced by city_build_building(), city_increase_size(), and city_turn_notify().
double get_effect_expected_value | ( | const struct req_context * | context, |
const struct player * | other_player, | ||
enum effect_type | effect_type, | ||
eft_value_filter_cb | weighter, | ||
void * | data, | ||
int | n_data | ||
) |
Returns the expected value of the effect of given type for given context, calculating value weighted with probability for each individual effect with given callback using arbitrary additional data passed to it.
The way of using multipliers is left on the callback.
void get_effect_list_req_text | ( | const struct effect_list * | plist, |
struct astring * | astr | ||
) |
Make user-friendly text for an effect list. The text is put into a user astring.
Definition at line 1225 of file effects.c.
Referenced by do_tech_parasite_effect(), text_happiness_buildings(), and text_happiness_wonders().
void get_effect_req_text | ( | const struct effect * | peffect, |
char * | buf, | ||
size_t | buf_len | ||
) |
Make user-friendly text for the source. The text is put into a user buffer.
Definition at line 1197 of file effects.c.
Referenced by get_city_dialog_culture_text(), get_city_dialog_illness_text(), get_city_dialog_output_text(), and get_effect_list_req_text().
struct effect_list * get_effects | ( | enum effect_type | effect_type | ) |
Get a list of effects of this type.
Definition at line 136 of file effects.c.
Referenced by adv_units_ruleset_init(), dai_find_source_building(), effect_new(), effect_remove(), effect_universals_value_never_below(), effect_value_from_universals(), get_effect_expected_value(), get_target_bonus_effects(), is_effect_val_known(), ruleset_purge_redundant_reqs_effects(), and ruleset_purge_unused_effects().
int get_player_bonus | ( | const struct player * | pplayer, |
enum effect_type | effect_type | ||
) |
Returns the effect bonus for a player.
Definition at line 771 of file effects.c.
Referenced by adv_best_government(), adv_gov_player_bonus_want(), api_effects_player_bonus(), can_change_to_government(), can_player_build_improvement_direct(), can_player_build_unit_direct(), check_for_game_over(), civil_war_triggered(), could_meet_with_player(), dai_assess_military_unhappiness(), dai_content_effect_value(), dai_diplomacy_actions(), dai_diplomacy_begin_new_phase(), dai_effect_value(), dai_gov_value(), dai_manage_taxes(), do_border_vision_effect(), do_have_contacts_effect(), do_reveal_effects(), do_upgrade_effects(), economy_report_dialog_popup(), fc_double_edge::fc_double_edge(), found_new_tech(), get_player_maxrate(), handle_diplomacy_cancel_pact(), handle_diplomacy_init_meeting_req(), handle_player_change_government(), horiz_taxrate_callback(), make_contact(), nation_history_gain(), player_base_citizen_happiness(), player_culture(), player_has_embassy_from_effect(), player_has_really_useful_tech_parasite(), player_tech_upkeep(), popup_rates_dialog(), pplayer_can_cancel_treaty(), pplayer_can_make_treaty(), rates_set_values(), remove_city(), research_total_bulbs_required(), split_player(), steal_a_tech(), tax_rates_dialog::tax_rates_dialog(), text_happiness_cities(), try_summon_barbarians(), unit_upgrade_price(), fc_client::update_sidebar_tooltips(), utype_happy_cost(), and utype_upkeep_cost().
int get_player_bonus_effects | ( | struct effect_list * | plist, |
const struct player * | pplayer, | ||
enum effect_type | effect_type | ||
) |
Returns the effect sources of this type currently active at the player.
The returned vector must be freed (building_vector_free) when the caller is done with it.
Definition at line 1052 of file effects.c.
Referenced by do_tech_parasite_effect().
int get_player_output_bonus | ( | const struct player * | pplayer, |
const struct output_type * | poutput, | ||
enum effect_type | effect_type | ||
) |
Returns the player effect bonus of an output.
Definition at line 883 of file effects.c.
Referenced by get_tile_output_text(), and utype_upkeep_cost().
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 | ||
) |
Returns the effect bonus the improvement would or does provide if present.
Problem type tells if we need to be CERTAIN about bonus before counting it or is POSSIBLE bonus enough.
Definition at line 1126 of file effects.c.
Referenced by get_current_construction_bonus(), improvement_has_effects(), and rs_buildings().
struct effect_list * get_req_source_effects | ( | struct universal * | psource | ) |
Get a list of effects with this requirement source.
Currently only buildings, advances, and governments are supported.
Definition at line 146 of file effects.c.
Referenced by adjust_improvement_wants_by_effects(), adv_data_city_impr_calc(), building_has_effect(), dai_gov_value(), dai_tech_effect_values(), effect_req_append(), get_potential_improvement_bonus(), helptext_government(), improvement_has_effects(), and is_building_replaced().
int get_target_bonus_effects | ( | struct effect_list * | plist, |
const struct req_context * | context, | ||
const struct player * | other_player, | ||
enum effect_type | effect_type | ||
) |
Returns the effect bonus of a given type for any target.
context gives the target (or targets) to evaluate requirements against effect_type gives the effect type to be considered
context may be NULL. This is equivalent to passing an empty context.
Returns the effect sources of this type currently active.
The returned vector must be freed (building_vector_free) when the caller is done with it.
Definition at line 691 of file effects.c.
Referenced by action_dice_roll_odds(), action_success_target_pay_mp(), ap_dipl_battle_win(), api_effects_unit_bonus(), api_methods_city_inspire_partisans(), casus_belli_range_for(), city_tile_output(), dai_choose_trade_route(), defense_multiplication(), diplomat_success_vs_defender(), do_heal_unit(), fill_grid_sprite_array(), get_building_bonus(), get_caravan_enter_city_trade_bonus(), get_city_bonus(), get_city_bonus_effects(), get_city_output_bonus(), get_city_specialist_output_bonus(), get_city_tile_output_bonus(), get_player_bonus(), get_player_bonus_effects(), get_player_output_bonus(), get_tile_output_bonus(), get_unit_bonus(), get_unit_vs_tile_bonus(), get_unittype_bonus(), get_world_bonus(), helptext_government(), illegal_action_pay_price(), impr_estimate_build_shield_cost(), process_attacker_want(), sdi_try_defend(), spy_steal_some_maps(), unit_bribe_cost(), unit_pays_mp_for_action(), unit_shield_value(), and utype_pays_mp_for_action_estimate().
int get_tile_output_bonus | ( | const struct city * | pcity, |
const struct tile * | ptile, | ||
const struct output_type * | poutput, | ||
enum effect_type | effect_type | ||
) |
Returns the effect bonus at a tile for given output type (or NULL for output-type-independent bonus). If pcity is supplied, it's the bonus for that particular city, otherwise it's the player/city-independent bonus (and any city on the tile is ignored).
Definition at line 862 of file effects.c.
Referenced by city_tile_output().
int get_unit_bonus | ( | const struct unit * | punit, |
enum effect_type | effect_type | ||
) |
Returns the effect bonus at a unit
Definition at line 992 of file effects.c.
Referenced by begin_turn(), dai_find_strategic_airbase(), diplomats_unignored_tech_stealings(), hp_gain_coord(), is_losing_hp(), maybe_become_veteran_real(), regen_turns(), request_unit_return(), spy_steal_gold(), unit_conquer_city(), unit_gain_hitpoints(), and unit_versus_unit().
int get_unit_vs_tile_bonus | ( | const struct tile * | ptile, |
const struct unit * | punit, | ||
enum effect_type | etype | ||
) |
Returns the effect bonus at a tile
Definition at line 1016 of file effects.c.
Referenced by api_effects_unit_vs_tile_bonus().
int get_unittype_bonus | ( | const struct player * | pplayer, |
const struct tile * | ptile, | ||
const struct unit_type * | punittype, | ||
const struct action * | paction, | ||
enum effect_type | effect_type | ||
) |
Returns the effect bonus that applies at a tile for a given unittype.
For instance with EFT_DEFEND_BONUS the attacker's unittype and the defending tile should be passed in. Slightly counter-intuitive! See doc/README.effects to see how the unittype applies for each effect here.
Definition at line 957 of file effects.c.
Referenced by assess_danger(), assess_danger_unit(), city_got_defense_effect(), city_production_unit_veteran_level(), dai_choose_defender_versus(), dai_wants_defender_against(), defense_multiplication(), find_nearest_safe_city(), get_modified_firepower(), get_total_attack_power(), pf_reverse_map_utype_pos(), pft_fill_utype_default_parameter(), unit_type_is_losing_hp(), unit_vision_range_modifiers(), utype_build_shield_cost(), utype_buy_gold_cost(), utype_move_rate(), and utype_pop_value().
int get_world_bonus | ( | enum effect_type | effect_type | ) |
Returns the effect bonus for the whole world.
Definition at line 759 of file effects.c.
Referenced by api_effects_world_bonus(), game_next_year(), and tri_req_active_turns().
bool is_building_replaced | ( | const struct city * | pcity, |
const struct impr_type * | pimprove, | ||
const enum req_problem_type | prob_type | ||
) |
Returns TRUE if a building is replaced. To be replaced, all its effects must be made redundant by groups that it is in. prob_type CERTAIN or POSSIBLE is answer to function name.
Definition at line 641 of file effects.c.
Referenced by is_improvement_redundant().
Iterate through all the effects in cache, and call callback for each. If any callback returns FALSE, there is no further checking and this will return FALSE.
Definition at line 1245 of file effects.c.
Referenced by is_multiplier_needed(), is_universal_needed(), effect_edit::refresh(), tab_misc::refresh_stats(), rscompat_postprocess(), sanity_check_ruleset_data(), and save_effects_ruleset().
void recv_ruleset_effect | ( | const struct packet_ruleset_effect * | packet | ) |
Receives a new effect. This is called by the client when the packet arrives.
Definition at line 534 of file effects.c.
Referenced by handle_ruleset_effect().
void ruleset_cache_free | ( | void | ) |
Free the ruleset cache. This should be called at the end of the game or when the client disconnects from the server. See ruleset_cache_init.
Definition at line 271 of file effects.c.
Referenced by game_ruleset_free().
void ruleset_cache_init | ( | void | ) |
Initialize the ruleset cache. The ruleset cache should be empty before this is done (so if it's previously been initialized, it needs to be freed (see ruleset_cache_free) before it can be reused).
Definition at line 245 of file effects.c.
Referenced by game_ruleset_init().
void send_ruleset_cache | ( | struct conn_list * | dest | ) |
Send the ruleset cache data over the network.
Definition at line 553 of file effects.c.
Referenced by send_rulesets().