Freeciv21
Develop your civilization from humble roots to a global empire
effects.h File Reference
#include "requirements.h"
#include "specenum_gen.h"
#include "speclist.h"
+ Include dependency graph for effects.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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_TRADEROUTE_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_VALUE128   EFT_NUKE_IMPROVEMENT_PCT
 
#define SPECENUM_VALUE128NAME   "Nuke_Improvement_Pct"
 
#define SPECENUM_VALUE129   EFT_HP_REGEN_MIN
 
#define SPECENUM_VALUE129NAME   "HP_Regen_Min"
 
#define SPECENUM_VALUE130   EFT_BOMBARD_LIMIT_PCT
 
#define SPECENUM_VALUE130NAME   "Bombard_Limit_Pct"
 
#define SPECENUM_VALUE131   EFT_TRADE_REVENUE_EXPONENT
 
#define SPECENUM_VALUE131NAME   "Trade_Revenue_Exponent"
 
#define SPECENUM_VALUE132   EFT_WONDER_VISIBLE
 
#define SPECENUM_VALUE132NAME   "Wonder_Visible"
 
#define SPECENUM_VALUE133   EFT_NATION_INTELLIGENCE
 
#define SPECENUM_VALUE133NAME   "Nation_Intelligence"
 
#define SPECENUM_VALUE134   EFT_NUKE_INFRASTRUCTURE_PCT
 
#define SPECENUM_VALUE134NAME   "Nuke_Infrastructure_Pct"
 
#define SPECENUM_VALUE135   EFT_GROWTH_SURPLUS_PCT
 
#define SPECENUM_VALUE135NAME   "Growth_Surplus_Pct"
 
#define SPECENUM_VALUE136   EFT_POLLU_TRADE_PCT
 
#define SPECENUM_VALUE136NAME   "Pollu_Trade_Pct"
 
#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 bool(* iec_cb) (struct effect *, void *data)
 

Functions

struct effecteffect_new (enum effect_type type, int value, struct multiplier *pmul)
 Add effect to ruleset cache. More...
 
struct effecteffect_copy (struct effect *old)
 Return new copy of the effect. More...
 
void effect_req_append (struct effect *peffect, struct requirement req)
 Append requirement to effect. More...
 
void get_effect_req_text (const struct effect *peffect, char *buf, size_t buf_len)
 Make user-friendly text for the source. More...
 
QString get_effect_list_req_text (const struct effect_list *plist)
 Make user-friendly text for an effect list. More...
 
QString effect_type_unit_text (effect_type type, int value)
 Returns a string describing an effect value as interpreted in the context of an effect_type, typically as "value [unit]" for some unit. More...
 
void ruleset_cache_init ()
 Initialize the ruleset cache. More...
 
void ruleset_cache_free ()
 Free the ruleset cache. More...
 
void recv_ruleset_effect (const struct packet_ruleset_effect *packet)
 Receives a new effect. More...
 
void send_ruleset_cache (struct conn_list *dest)
 Send the ruleset cache data over the network. More...
 
int effect_cumulative_max (enum effect_type type, struct universal *for_uni)
 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). More...
 
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). More...
 
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. More...
 
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. More...
 
int get_world_bonus (enum effect_type effect_type)
 Returns the effect bonus for the whole world. More...
 
int get_player_bonus (const struct player *plr, enum effect_type effect_type)
 Returns the effect bonus for a player. More...
 
int get_city_bonus (const struct city *pcity, enum effect_type effect_type, enum vision_layer vlayer=V_COUNT)
 Returns the effect bonus at a city. More...
 
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. More...
 
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. More...
 
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 nullptr for output-type-independent bonus). More...
 
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. More...
 
int get_player_intel_bonus (const struct player *pplayer, const struct player *pother, enum national_intelligence nintel, enum effect_type effect_type)
 Gets the player effect bonus of a national intelligence. More...
 
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. More...
 
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. More...
 
int get_unittype_bonus (const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, enum effect_type effect_type, enum vision_layer vision_layer=V_COUNT)
 
int get_unit_bonus (const struct unit *punit, enum effect_type effect_type)
 Returns the effect bonus at a unit. More...
 
struct effect_list * get_req_source_effects (struct universal *psource)
 Get a list of effects with this requirement source. More...
 
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. More...
 
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. More...
 
int get_target_bonus_effects (struct effect_list *plist, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, enum effect_type effect_type, enum vision_layer vision_layer=V_COUNT, enum national_intelligence nintel=NI_COUNT)
 
bool building_has_effect (const struct impr_type *pimprove, enum effect_type effect_type)
 Returns TRUE if the building has any effect bonuses of the given type. More...
 
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. More...
 
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)
 Returns the effect bonus the improvement would or does provide if present. More...
 
const effect_list * get_effects ()
 Get a list of all effects. More...
 
struct effect_list * get_effects (enum effect_type effect_type)
 Get a list of effects of this type. More...
 
bool iterate_effect_cache (iec_cb cb, void *data)
 Iterate through all the effects in cache, and call callback for each. More...
 

Macro Definition Documentation

◆ effect_list_iterate

#define effect_list_iterate (   effect_list,
  peffect 
)     TYPED_LIST_ITERATE(struct effect, effect_list, peffect)

Definition at line 347 of file effects.h.

◆ effect_list_iterate_end

#define effect_list_iterate_end   LIST_ITERATE_END

Definition at line 349 of file effects.h.

◆ SPECENUM_COUNT

#define SPECENUM_COUNT   EFT_COUNT

Definition at line 321 of file effects.h.

◆ SPECENUM_NAME

#define SPECENUM_NAME   effect_type

Definition at line 22 of file effects.h.

◆ SPECENUM_VALUE0

#define SPECENUM_VALUE0   EFT_TECH_PARASITE

Definition at line 23 of file effects.h.

◆ SPECENUM_VALUE0NAME

#define SPECENUM_VALUE0NAME   "Tech_Parasite"

Definition at line 24 of file effects.h.

◆ SPECENUM_VALUE1

#define SPECENUM_VALUE1   EFT_AIRLIFT

Definition at line 25 of file effects.h.

◆ SPECENUM_VALUE10

#define SPECENUM_VALUE10   EFT_OUTPUT_INC_TILE

Definition at line 45 of file effects.h.

◆ SPECENUM_VALUE100

#define SPECENUM_VALUE100   EFT_NATION_PERFORMANCE

Definition at line 250 of file effects.h.

◆ SPECENUM_VALUE100NAME

#define SPECENUM_VALUE100NAME   "National_Performance"

Definition at line 251 of file effects.h.

◆ SPECENUM_VALUE101

#define SPECENUM_VALUE101   EFT_NATION_HISTORY

Definition at line 252 of file effects.h.

◆ SPECENUM_VALUE101NAME

#define SPECENUM_VALUE101NAME   "National_History"

Definition at line 253 of file effects.h.

◆ SPECENUM_VALUE102

#define SPECENUM_VALUE102   EFT_TURN_FRAGMENTS

Definition at line 254 of file effects.h.

◆ SPECENUM_VALUE102NAME

#define SPECENUM_VALUE102NAME   "Turn_Fragments"

Definition at line 255 of file effects.h.

◆ SPECENUM_VALUE103

#define SPECENUM_VALUE103   EFT_MAX_STOLEN_GOLD_PM

Definition at line 256 of file effects.h.

◆ SPECENUM_VALUE103NAME

#define SPECENUM_VALUE103NAME   "Max_Stolen_Gold_Pm"

Definition at line 257 of file effects.h.

◆ SPECENUM_VALUE104

#define SPECENUM_VALUE104   EFT_THIEFS_SHARE_PM

Definition at line 258 of file effects.h.

◆ SPECENUM_VALUE104NAME

#define SPECENUM_VALUE104NAME   "Thiefs_Share_Pm"

Definition at line 259 of file effects.h.

◆ SPECENUM_VALUE105

#define SPECENUM_VALUE105   EFT_RETIRE_PCT

Definition at line 260 of file effects.h.

◆ SPECENUM_VALUE105NAME

#define SPECENUM_VALUE105NAME   "Retire_Pct"

Definition at line 261 of file effects.h.

◆ SPECENUM_VALUE106

#define SPECENUM_VALUE106   EFT_ILLEGAL_ACTION_MOVE_COST

Definition at line 262 of file effects.h.

◆ SPECENUM_VALUE106NAME

#define SPECENUM_VALUE106NAME   "Illegal_Action_Move_Cost"

Definition at line 263 of file effects.h.

◆ SPECENUM_VALUE107

#define SPECENUM_VALUE107   EFT_HAVE_CONTACTS

Definition at line 264 of file effects.h.

◆ SPECENUM_VALUE107NAME

#define SPECENUM_VALUE107NAME   "Have_Contacts"

Definition at line 265 of file effects.h.

◆ SPECENUM_VALUE108

#define SPECENUM_VALUE108   EFT_CASUS_BELLI_CAUGHT

Definition at line 266 of file effects.h.

◆ SPECENUM_VALUE108NAME

#define SPECENUM_VALUE108NAME   "Casus_Belli_Caught"

Definition at line 267 of file effects.h.

◆ SPECENUM_VALUE109

#define SPECENUM_VALUE109   EFT_CASUS_BELLI_SUCCESS

Definition at line 268 of file effects.h.

◆ SPECENUM_VALUE109NAME

#define SPECENUM_VALUE109NAME   "Casus_Belli_Success"

Definition at line 269 of file effects.h.

◆ SPECENUM_VALUE10NAME

#define SPECENUM_VALUE10NAME   "Output_Inc_Tile"

Definition at line 46 of file effects.h.

◆ SPECENUM_VALUE11

#define SPECENUM_VALUE11   EFT_OUTPUT_PER_TILE

Definition at line 48 of file effects.h.

◆ SPECENUM_VALUE110

#define SPECENUM_VALUE110   EFT_ACTION_ODDS_PCT

Definition at line 270 of file effects.h.

◆ SPECENUM_VALUE110NAME

#define SPECENUM_VALUE110NAME   "Action_Odds_Pct"

Definition at line 271 of file effects.h.

◆ SPECENUM_VALUE111

#define SPECENUM_VALUE111   EFT_BORDER_VISION

Definition at line 272 of file effects.h.

◆ SPECENUM_VALUE111NAME

#define SPECENUM_VALUE111NAME   "Border_Vision"

Definition at line 273 of file effects.h.

◆ SPECENUM_VALUE112

#define SPECENUM_VALUE112   EFT_STEALINGS_IGNORE

Definition at line 274 of file effects.h.

◆ SPECENUM_VALUE112NAME

#define SPECENUM_VALUE112NAME   "Stealings_Ignore"

Definition at line 275 of file effects.h.

◆ SPECENUM_VALUE113

#define SPECENUM_VALUE113   EFT_OUTPUT_WASTE_BY_REL_DISTANCE

Definition at line 276 of file effects.h.

◆ SPECENUM_VALUE113NAME

#define SPECENUM_VALUE113NAME   "Output_Waste_By_Rel_Distance"

Definition at line 277 of file effects.h.

◆ SPECENUM_VALUE114

#define SPECENUM_VALUE114   EFT_SABOTEUR_RESISTANT

Definition at line 278 of file effects.h.

◆ SPECENUM_VALUE114NAME

#define SPECENUM_VALUE114NAME   "Building_Saboteur_Resistant"

Definition at line 279 of file effects.h.

◆ SPECENUM_VALUE115

#define SPECENUM_VALUE115   EFT_UNIT_SLOTS

Definition at line 280 of file effects.h.

◆ SPECENUM_VALUE115NAME

#define SPECENUM_VALUE115NAME   "Unit_Slots"

Definition at line 281 of file effects.h.

◆ SPECENUM_VALUE116

#define SPECENUM_VALUE116   EFT_ATTACK_BONUS

Definition at line 282 of file effects.h.

◆ SPECENUM_VALUE116NAME

#define SPECENUM_VALUE116NAME   "Attack_Bonus"

Definition at line 283 of file effects.h.

◆ SPECENUM_VALUE117

#define SPECENUM_VALUE117   EFT_CONQUEST_TECH_PCT

Definition at line 284 of file effects.h.

◆ SPECENUM_VALUE117NAME

#define SPECENUM_VALUE117NAME   "Conquest_Tech_Pct"

Definition at line 285 of file effects.h.

◆ SPECENUM_VALUE118

#define SPECENUM_VALUE118   EFT_ACTION_SUCCESS_MOVE_COST

Definition at line 286 of file effects.h.

◆ SPECENUM_VALUE118NAME

#define SPECENUM_VALUE118NAME   "Action_Success_Actor_Move_Cost"

Definition at line 287 of file effects.h.

◆ SPECENUM_VALUE119

#define SPECENUM_VALUE119   EFT_ACTION_SUCCESS_TARGET_MOVE_COST

Definition at line 288 of file effects.h.

◆ SPECENUM_VALUE119NAME

#define SPECENUM_VALUE119NAME   "Action_Success_Target_Move_Cost"

Definition at line 289 of file effects.h.

◆ SPECENUM_VALUE11NAME

#define SPECENUM_VALUE11NAME   "Output_Per_Tile"

Definition at line 49 of file effects.h.

◆ SPECENUM_VALUE12

#define SPECENUM_VALUE12   EFT_OUTPUT_WASTE_PCT

Definition at line 50 of file effects.h.

◆ SPECENUM_VALUE120

#define SPECENUM_VALUE120   EFT_INFRA_POINTS

Definition at line 290 of file effects.h.

◆ SPECENUM_VALUE120NAME

#define SPECENUM_VALUE120NAME   "Infra_Points"

Definition at line 291 of file effects.h.

◆ SPECENUM_VALUE121

#define SPECENUM_VALUE121   EFT_FORTIFY_DEFENSE_BONUS

Definition at line 292 of file effects.h.

◆ SPECENUM_VALUE121NAME

#define SPECENUM_VALUE121NAME   "Fortify_Defense_Bonus"

Definition at line 293 of file effects.h.

◆ SPECENUM_VALUE122

#define SPECENUM_VALUE122   EFT_MAPS_STOLEN_PCT

Definition at line 294 of file effects.h.

◆ SPECENUM_VALUE122NAME

#define SPECENUM_VALUE122NAME   "Maps_Stolen_Pct"

Definition at line 295 of file effects.h.

◆ SPECENUM_VALUE123

#define SPECENUM_VALUE123   EFT_UNIT_SHIELD_VALUE_PCT

Definition at line 296 of file effects.h.

◆ SPECENUM_VALUE123NAME

#define SPECENUM_VALUE123NAME   "Unit_Shield_Value_Pct"

Definition at line 297 of file effects.h.

◆ SPECENUM_VALUE124

#define SPECENUM_VALUE124   EFT_CASUS_BELLI_COMPLETE

Definition at line 298 of file effects.h.

◆ SPECENUM_VALUE124NAME

#define SPECENUM_VALUE124NAME   "Casus_Belli_Complete"

Definition at line 299 of file effects.h.

◆ SPECENUM_VALUE125

#define SPECENUM_VALUE125   EFT_ILLEGAL_ACTION_HP_COST

Definition at line 300 of file effects.h.

◆ SPECENUM_VALUE125NAME

#define SPECENUM_VALUE125NAME   "Illegal_Action_HP_Cost"

Definition at line 301 of file effects.h.

◆ SPECENUM_VALUE128

#define SPECENUM_VALUE128   EFT_NUKE_IMPROVEMENT_PCT

Definition at line 302 of file effects.h.

◆ SPECENUM_VALUE128NAME

#define SPECENUM_VALUE128NAME   "Nuke_Improvement_Pct"

Definition at line 303 of file effects.h.

◆ SPECENUM_VALUE129

#define SPECENUM_VALUE129   EFT_HP_REGEN_MIN

Definition at line 304 of file effects.h.

◆ SPECENUM_VALUE129NAME

#define SPECENUM_VALUE129NAME   "HP_Regen_Min"

Definition at line 305 of file effects.h.

◆ SPECENUM_VALUE12NAME

#define SPECENUM_VALUE12NAME   "Output_Waste_Pct"

Definition at line 51 of file effects.h.

◆ SPECENUM_VALUE13

#define SPECENUM_VALUE13   EFT_FORCE_CONTENT

Definition at line 52 of file effects.h.

◆ SPECENUM_VALUE130

#define SPECENUM_VALUE130   EFT_BOMBARD_LIMIT_PCT

Definition at line 306 of file effects.h.

◆ SPECENUM_VALUE130NAME

#define SPECENUM_VALUE130NAME   "Bombard_Limit_Pct"

Definition at line 307 of file effects.h.

◆ SPECENUM_VALUE131

#define SPECENUM_VALUE131   EFT_TRADE_REVENUE_EXPONENT

Definition at line 308 of file effects.h.

◆ SPECENUM_VALUE131NAME

#define SPECENUM_VALUE131NAME   "Trade_Revenue_Exponent"

Definition at line 309 of file effects.h.

◆ SPECENUM_VALUE132

#define SPECENUM_VALUE132   EFT_WONDER_VISIBLE

Definition at line 310 of file effects.h.

◆ SPECENUM_VALUE132NAME

#define SPECENUM_VALUE132NAME   "Wonder_Visible"

Definition at line 311 of file effects.h.

◆ SPECENUM_VALUE133

#define SPECENUM_VALUE133   EFT_NATION_INTELLIGENCE

Definition at line 312 of file effects.h.

◆ SPECENUM_VALUE133NAME

#define SPECENUM_VALUE133NAME   "Nation_Intelligence"

Definition at line 313 of file effects.h.

◆ SPECENUM_VALUE134

#define SPECENUM_VALUE134   EFT_NUKE_INFRASTRUCTURE_PCT

Definition at line 314 of file effects.h.

◆ SPECENUM_VALUE134NAME

#define SPECENUM_VALUE134NAME   "Nuke_Infrastructure_Pct"

Definition at line 315 of file effects.h.

◆ SPECENUM_VALUE135

#define SPECENUM_VALUE135   EFT_GROWTH_SURPLUS_PCT

Definition at line 316 of file effects.h.

◆ SPECENUM_VALUE135NAME

#define SPECENUM_VALUE135NAME   "Growth_Surplus_Pct"

Definition at line 317 of file effects.h.

◆ SPECENUM_VALUE136

#define SPECENUM_VALUE136   EFT_POLLU_TRADE_PCT

Definition at line 318 of file effects.h.

◆ SPECENUM_VALUE136NAME

#define SPECENUM_VALUE136NAME   "Pollu_Trade_Pct"

Definition at line 319 of file effects.h.

◆ SPECENUM_VALUE13NAME

#define SPECENUM_VALUE13NAME   "Force_Content"

Definition at line 53 of file effects.h.

◆ SPECENUM_VALUE14

#define SPECENUM_VALUE14   EFT_GIVE_IMM_TECH

Definition at line 55 of file effects.h.

◆ SPECENUM_VALUE14NAME

#define SPECENUM_VALUE14NAME   "Give_Imm_Tech"

Definition at line 56 of file effects.h.

◆ SPECENUM_VALUE15

#define SPECENUM_VALUE15   EFT_GROWTH_FOOD

Definition at line 57 of file effects.h.

◆ SPECENUM_VALUE15NAME

#define SPECENUM_VALUE15NAME   "Growth_Food"

Definition at line 58 of file effects.h.

◆ SPECENUM_VALUE16

#define SPECENUM_VALUE16   EFT_HEALTH_PCT

Definition at line 60 of file effects.h.

◆ SPECENUM_VALUE16NAME

#define SPECENUM_VALUE16NAME   "Health_Pct"

Definition at line 61 of file effects.h.

◆ SPECENUM_VALUE17

#define SPECENUM_VALUE17   EFT_HAVE_EMBASSIES

Definition at line 62 of file effects.h.

◆ SPECENUM_VALUE17NAME

#define SPECENUM_VALUE17NAME   "Have_Embassies"

Definition at line 63 of file effects.h.

◆ SPECENUM_VALUE18

#define SPECENUM_VALUE18   EFT_MAKE_CONTENT

Definition at line 64 of file effects.h.

◆ SPECENUM_VALUE18NAME

#define SPECENUM_VALUE18NAME   "Make_Content"

Definition at line 65 of file effects.h.

◆ SPECENUM_VALUE19

#define SPECENUM_VALUE19   EFT_MAKE_CONTENT_MIL

Definition at line 66 of file effects.h.

◆ SPECENUM_VALUE19NAME

#define SPECENUM_VALUE19NAME   "Make_Content_Mil"

Definition at line 67 of file effects.h.

◆ SPECENUM_VALUE1NAME

#define SPECENUM_VALUE1NAME   "Airlift"

Definition at line 26 of file effects.h.

◆ SPECENUM_VALUE2

#define SPECENUM_VALUE2   EFT_ANY_GOVERNMENT

Definition at line 27 of file effects.h.

◆ SPECENUM_VALUE20

#define SPECENUM_VALUE20   EFT_MAKE_CONTENT_MIL_PER

Definition at line 68 of file effects.h.

◆ SPECENUM_VALUE20NAME

#define SPECENUM_VALUE20NAME   "Make_Content_Mil_Per"

Definition at line 69 of file effects.h.

◆ SPECENUM_VALUE21

#define SPECENUM_VALUE21   EFT_MAKE_HAPPY

Definition at line 71 of file effects.h.

◆ SPECENUM_VALUE21NAME

#define SPECENUM_VALUE21NAME   "Make_Happy"

Definition at line 72 of file effects.h.

◆ SPECENUM_VALUE22

#define SPECENUM_VALUE22   EFT_NO_ANARCHY

Definition at line 73 of file effects.h.

◆ SPECENUM_VALUE22NAME

#define SPECENUM_VALUE22NAME   "No_Anarchy"

Definition at line 74 of file effects.h.

◆ SPECENUM_VALUE23

#define SPECENUM_VALUE23   EFT_NUKE_PROOF

Definition at line 75 of file effects.h.

◆ SPECENUM_VALUE23NAME

#define SPECENUM_VALUE23NAME   "Nuke_Proof"

Definition at line 76 of file effects.h.

◆ SPECENUM_VALUE24

#define SPECENUM_VALUE24   EFT_POLLU_POP_PCT

Definition at line 80 of file effects.h.

◆ SPECENUM_VALUE24NAME

#define SPECENUM_VALUE24NAME   "Pollu_Pop_Pct"

Definition at line 81 of file effects.h.

◆ SPECENUM_VALUE25

#define SPECENUM_VALUE25   EFT_POLLU_POP_PCT_2

Definition at line 82 of file effects.h.

◆ SPECENUM_VALUE25NAME

#define SPECENUM_VALUE25NAME   "Pollu_Pop_Pct_2"

Definition at line 83 of file effects.h.

◆ SPECENUM_VALUE26

#define SPECENUM_VALUE26   EFT_POLLU_PROD_PCT

Definition at line 85 of file effects.h.

◆ SPECENUM_VALUE26NAME

#define SPECENUM_VALUE26NAME   "Pollu_Prod_Pct"

Definition at line 86 of file effects.h.

◆ SPECENUM_VALUE27

#define SPECENUM_VALUE27   EFT_REVEAL_CITIES

Definition at line 88 of file effects.h.

◆ SPECENUM_VALUE27NAME

#define SPECENUM_VALUE27NAME   "Reveal_Cities"

Definition at line 89 of file effects.h.

◆ SPECENUM_VALUE28

#define SPECENUM_VALUE28   EFT_REVEAL_MAP

Definition at line 90 of file effects.h.

◆ SPECENUM_VALUE28NAME

#define SPECENUM_VALUE28NAME   "Reveal_Map"

Definition at line 91 of file effects.h.

◆ SPECENUM_VALUE29

#define SPECENUM_VALUE29   EFT_INCITE_COST_PCT

Definition at line 93 of file effects.h.

◆ SPECENUM_VALUE29NAME

#define SPECENUM_VALUE29NAME   "Incite_Cost_Pct"

Definition at line 94 of file effects.h.

◆ SPECENUM_VALUE2NAME

#define SPECENUM_VALUE2NAME   "Any_Government"

Definition at line 28 of file effects.h.

◆ SPECENUM_VALUE3

#define SPECENUM_VALUE3   EFT_CAPITAL_CITY

Definition at line 29 of file effects.h.

◆ SPECENUM_VALUE30

#define SPECENUM_VALUE30   EFT_SIZE_ADJ

Definition at line 95 of file effects.h.

◆ SPECENUM_VALUE30NAME

#define SPECENUM_VALUE30NAME   "Size_Adj"

Definition at line 96 of file effects.h.

◆ SPECENUM_VALUE31

#define SPECENUM_VALUE31   EFT_SIZE_UNLIMIT

Definition at line 97 of file effects.h.

◆ SPECENUM_VALUE31NAME

#define SPECENUM_VALUE31NAME   "Size_Unlimit"

Definition at line 98 of file effects.h.

◆ SPECENUM_VALUE32

#define SPECENUM_VALUE32   EFT_SS_STRUCTURAL

Definition at line 99 of file effects.h.

◆ SPECENUM_VALUE32NAME

#define SPECENUM_VALUE32NAME   "SS_Structural"

Definition at line 100 of file effects.h.

◆ SPECENUM_VALUE33

#define SPECENUM_VALUE33   EFT_SS_COMPONENT

Definition at line 101 of file effects.h.

◆ SPECENUM_VALUE33NAME

#define SPECENUM_VALUE33NAME   "SS_Component"

Definition at line 102 of file effects.h.

◆ SPECENUM_VALUE34

#define SPECENUM_VALUE34   EFT_SS_MODULE

Definition at line 103 of file effects.h.

◆ SPECENUM_VALUE34NAME

#define SPECENUM_VALUE34NAME   "SS_Module"

Definition at line 104 of file effects.h.

◆ SPECENUM_VALUE35

#define SPECENUM_VALUE35   EFT_SPY_RESISTANT

Definition at line 105 of file effects.h.

◆ SPECENUM_VALUE35NAME

#define SPECENUM_VALUE35NAME   "Spy_Resistant"

Definition at line 106 of file effects.h.

◆ SPECENUM_VALUE36

#define SPECENUM_VALUE36   EFT_MOVE_BONUS

Definition at line 107 of file effects.h.

◆ SPECENUM_VALUE36NAME

#define SPECENUM_VALUE36NAME   "Move_Bonus"

Definition at line 108 of file effects.h.

◆ SPECENUM_VALUE37

#define SPECENUM_VALUE37   EFT_UNIT_NO_LOSE_POP

Definition at line 109 of file effects.h.

◆ SPECENUM_VALUE37NAME

#define SPECENUM_VALUE37NAME   "Unit_No_Lose_Pop"

Definition at line 110 of file effects.h.

◆ SPECENUM_VALUE38

#define SPECENUM_VALUE38   EFT_UNIT_RECOVER

Definition at line 111 of file effects.h.

◆ SPECENUM_VALUE38NAME

#define SPECENUM_VALUE38NAME   "Unit_Recover"

Definition at line 112 of file effects.h.

◆ SPECENUM_VALUE39

#define SPECENUM_VALUE39   EFT_UPGRADE_UNIT

Definition at line 113 of file effects.h.

◆ SPECENUM_VALUE39NAME

#define SPECENUM_VALUE39NAME   "Upgrade_Unit"

Definition at line 114 of file effects.h.

◆ SPECENUM_VALUE3NAME

#define SPECENUM_VALUE3NAME   "Capital_City"

Definition at line 30 of file effects.h.

◆ SPECENUM_VALUE4

#define SPECENUM_VALUE4   EFT_ENABLE_NUKE

Definition at line 31 of file effects.h.

◆ SPECENUM_VALUE40

#define SPECENUM_VALUE40   EFT_UPKEEP_FREE

Definition at line 115 of file effects.h.

◆ SPECENUM_VALUE40NAME

#define SPECENUM_VALUE40NAME   "Upkeep_Free"

Definition at line 116 of file effects.h.

◆ SPECENUM_VALUE41

#define SPECENUM_VALUE41   EFT_TECH_UPKEEP_FREE

Definition at line 117 of file effects.h.

◆ SPECENUM_VALUE41NAME

#define SPECENUM_VALUE41NAME   "Tech_Upkeep_Free"

Definition at line 118 of file effects.h.

◆ SPECENUM_VALUE42

#define SPECENUM_VALUE42   EFT_NO_UNHAPPY

Definition at line 119 of file effects.h.

◆ SPECENUM_VALUE42NAME

#define SPECENUM_VALUE42NAME   "No_Unhappy"

Definition at line 120 of file effects.h.

◆ SPECENUM_VALUE43

#define SPECENUM_VALUE43   EFT_VETERAN_BUILD

Definition at line 121 of file effects.h.

◆ SPECENUM_VALUE43NAME

#define SPECENUM_VALUE43NAME   "Veteran_Build"

Definition at line 122 of file effects.h.

◆ SPECENUM_VALUE44

#define SPECENUM_VALUE44   EFT_VETERAN_COMBAT

Definition at line 123 of file effects.h.

◆ SPECENUM_VALUE44NAME

#define SPECENUM_VALUE44NAME   "Veteran_Combat"

Definition at line 124 of file effects.h.

◆ SPECENUM_VALUE45

#define SPECENUM_VALUE45   EFT_HP_REGEN

Definition at line 125 of file effects.h.

◆ SPECENUM_VALUE45NAME

#define SPECENUM_VALUE45NAME   "HP_Regen"

Definition at line 126 of file effects.h.

◆ SPECENUM_VALUE46

#define SPECENUM_VALUE46   EFT_CITY_VISION_RADIUS_SQ

Definition at line 127 of file effects.h.

◆ SPECENUM_VALUE46NAME

#define SPECENUM_VALUE46NAME   "City_Vision_Radius_Sq"

Definition at line 128 of file effects.h.

◆ SPECENUM_VALUE47

#define SPECENUM_VALUE47   EFT_UNIT_VISION_RADIUS_SQ

Definition at line 129 of file effects.h.

◆ SPECENUM_VALUE47NAME

#define SPECENUM_VALUE47NAME   "Unit_Vision_Radius_Sq"

Definition at line 130 of file effects.h.

◆ SPECENUM_VALUE48

#define SPECENUM_VALUE48   EFT_DEFEND_BONUS

Definition at line 132 of file effects.h.

◆ SPECENUM_VALUE48NAME

#define SPECENUM_VALUE48NAME   "Defend_Bonus"

Definition at line 133 of file effects.h.

◆ SPECENUM_VALUE49

#define SPECENUM_VALUE49   EFT_TRADEROUTE_PCT

Definition at line 134 of file effects.h.

◆ SPECENUM_VALUE49NAME

#define SPECENUM_VALUE49NAME   "Traderoute_Pct"

Definition at line 135 of file effects.h.

◆ SPECENUM_VALUE4NAME

#define SPECENUM_VALUE4NAME   "Enable_Nuke"

Definition at line 32 of file effects.h.

◆ SPECENUM_VALUE5

#define SPECENUM_VALUE5   EFT_ENABLE_SPACE

Definition at line 33 of file effects.h.

◆ SPECENUM_VALUE50

#define SPECENUM_VALUE50   EFT_GAIN_AI_LOVE

Definition at line 136 of file effects.h.

◆ SPECENUM_VALUE50NAME

#define SPECENUM_VALUE50NAME   "Gain_AI_Love"

Definition at line 137 of file effects.h.

◆ SPECENUM_VALUE51

#define SPECENUM_VALUE51   EFT_TURN_YEARS

Definition at line 138 of file effects.h.

◆ SPECENUM_VALUE51NAME

#define SPECENUM_VALUE51NAME   "Turn_Years"

Definition at line 139 of file effects.h.

◆ SPECENUM_VALUE52

#define SPECENUM_VALUE52   EFT_SLOW_DOWN_TIMELINE

Definition at line 140 of file effects.h.

◆ SPECENUM_VALUE52NAME

#define SPECENUM_VALUE52NAME   "Slow_Down_Timeline"

Definition at line 141 of file effects.h.

◆ SPECENUM_VALUE53

#define SPECENUM_VALUE53   EFT_CIVIL_WAR_CHANCE

Definition at line 142 of file effects.h.

◆ SPECENUM_VALUE53NAME

#define SPECENUM_VALUE53NAME   "Civil_War_Chance"

Definition at line 143 of file effects.h.

◆ SPECENUM_VALUE54

#define SPECENUM_VALUE54   EFT_MIGRATION_PCT

Definition at line 145 of file effects.h.

◆ SPECENUM_VALUE54NAME

#define SPECENUM_VALUE54NAME   "Migration_Pct"

Definition at line 146 of file effects.h.

◆ SPECENUM_VALUE55

#define SPECENUM_VALUE55   EFT_EMPIRE_SIZE_BASE

Definition at line 148 of file effects.h.

◆ SPECENUM_VALUE55NAME

#define SPECENUM_VALUE55NAME   "Empire_Size_Base"

Definition at line 149 of file effects.h.

◆ SPECENUM_VALUE56

#define SPECENUM_VALUE56   EFT_EMPIRE_SIZE_STEP

Definition at line 151 of file effects.h.

◆ SPECENUM_VALUE56NAME

#define SPECENUM_VALUE56NAME   "Empire_Size_Step"

Definition at line 152 of file effects.h.

◆ SPECENUM_VALUE57

#define SPECENUM_VALUE57   EFT_MAX_RATES

Definition at line 153 of file effects.h.

◆ SPECENUM_VALUE57NAME

#define SPECENUM_VALUE57NAME   "Max_Rates"

Definition at line 154 of file effects.h.

◆ SPECENUM_VALUE58

#define SPECENUM_VALUE58   EFT_MARTIAL_LAW_EACH

Definition at line 155 of file effects.h.

◆ SPECENUM_VALUE58NAME

#define SPECENUM_VALUE58NAME   "Martial_Law_Each"

Definition at line 156 of file effects.h.

◆ SPECENUM_VALUE59

#define SPECENUM_VALUE59   EFT_MARTIAL_LAW_MAX

Definition at line 157 of file effects.h.

◆ SPECENUM_VALUE59NAME

#define SPECENUM_VALUE59NAME   "Martial_Law_Max"

Definition at line 158 of file effects.h.

◆ SPECENUM_VALUE5NAME

#define SPECENUM_VALUE5NAME   "Enable_Space"

Definition at line 34 of file effects.h.

◆ SPECENUM_VALUE6

#define SPECENUM_VALUE6   EFT_SPECIALIST_OUTPUT

Definition at line 35 of file effects.h.

◆ SPECENUM_VALUE60

#define SPECENUM_VALUE60   EFT_RAPTURE_GROW

Definition at line 159 of file effects.h.

◆ SPECENUM_VALUE60NAME

#define SPECENUM_VALUE60NAME   "Rapture_Grow"

Definition at line 160 of file effects.h.

◆ SPECENUM_VALUE61

#define SPECENUM_VALUE61   EFT_REVOLUTION_UNHAPPINESS

Definition at line 161 of file effects.h.

◆ SPECENUM_VALUE61NAME

#define SPECENUM_VALUE61NAME   "Revolution_Unhappiness"

Definition at line 162 of file effects.h.

◆ SPECENUM_VALUE62

#define SPECENUM_VALUE62   EFT_HAS_SENATE

Definition at line 163 of file effects.h.

◆ SPECENUM_VALUE62NAME

#define SPECENUM_VALUE62NAME   "Has_Senate"

Definition at line 164 of file effects.h.

◆ SPECENUM_VALUE63

#define SPECENUM_VALUE63   EFT_INSPIRE_PARTISANS

Definition at line 165 of file effects.h.

◆ SPECENUM_VALUE63NAME

#define SPECENUM_VALUE63NAME   "Inspire_Partisans"

Definition at line 166 of file effects.h.

◆ SPECENUM_VALUE64

#define SPECENUM_VALUE64   EFT_HAPPINESS_TO_GOLD

Definition at line 167 of file effects.h.

◆ SPECENUM_VALUE64NAME

#define SPECENUM_VALUE64NAME   "Happiness_To_Gold"

Definition at line 168 of file effects.h.

◆ SPECENUM_VALUE65

#define SPECENUM_VALUE65   EFT_FANATICS

Definition at line 170 of file effects.h.

◆ SPECENUM_VALUE65NAME

#define SPECENUM_VALUE65NAME   "Fanatics"

Definition at line 171 of file effects.h.

◆ SPECENUM_VALUE66

#define SPECENUM_VALUE66   EFT_NO_DIPLOMACY

Definition at line 172 of file effects.h.

◆ SPECENUM_VALUE66NAME

#define SPECENUM_VALUE66NAME   "No_Diplomacy"

Definition at line 173 of file effects.h.

◆ SPECENUM_VALUE67

#define SPECENUM_VALUE67   EFT_TRADE_REVENUE_BONUS

Definition at line 174 of file effects.h.

◆ SPECENUM_VALUE67NAME

#define SPECENUM_VALUE67NAME   "Trade_Revenue_Bonus"

Definition at line 175 of file effects.h.

◆ SPECENUM_VALUE68

#define SPECENUM_VALUE68   EFT_UNHAPPY_FACTOR

Definition at line 177 of file effects.h.

◆ SPECENUM_VALUE68NAME

#define SPECENUM_VALUE68NAME   "Unhappy_Factor"

Definition at line 178 of file effects.h.

◆ SPECENUM_VALUE69

#define SPECENUM_VALUE69   EFT_UPKEEP_FACTOR

Definition at line 180 of file effects.h.

◆ SPECENUM_VALUE69NAME

#define SPECENUM_VALUE69NAME   "Upkeep_Factor"

Definition at line 181 of file effects.h.

◆ SPECENUM_VALUE6NAME

#define SPECENUM_VALUE6NAME   "Specialist_Output"

Definition at line 36 of file effects.h.

◆ SPECENUM_VALUE7

#define SPECENUM_VALUE7   EFT_OUTPUT_BONUS

Definition at line 37 of file effects.h.

◆ SPECENUM_VALUE70

#define SPECENUM_VALUE70   EFT_UNIT_UPKEEP_FREE_PER_CITY

Definition at line 183 of file effects.h.

◆ SPECENUM_VALUE70NAME

#define SPECENUM_VALUE70NAME   "Unit_Upkeep_Free_Per_City"

Definition at line 184 of file effects.h.

◆ SPECENUM_VALUE71

#define SPECENUM_VALUE71   EFT_OUTPUT_WASTE

Definition at line 185 of file effects.h.

◆ SPECENUM_VALUE71NAME

#define SPECENUM_VALUE71NAME   "Output_Waste"

Definition at line 186 of file effects.h.

◆ SPECENUM_VALUE72

#define SPECENUM_VALUE72   EFT_OUTPUT_WASTE_BY_DISTANCE

Definition at line 187 of file effects.h.

◆ SPECENUM_VALUE72NAME

#define SPECENUM_VALUE72NAME   "Output_Waste_By_Distance"

Definition at line 188 of file effects.h.

◆ SPECENUM_VALUE73

#define SPECENUM_VALUE73   EFT_OUTPUT_PENALTY_TILE

Definition at line 190 of file effects.h.

◆ SPECENUM_VALUE73NAME

#define SPECENUM_VALUE73NAME   "Output_Penalty_Tile"

Definition at line 191 of file effects.h.

◆ SPECENUM_VALUE74

#define SPECENUM_VALUE74   EFT_OUTPUT_INC_TILE_CELEBRATE

Definition at line 192 of file effects.h.

◆ SPECENUM_VALUE74NAME

#define SPECENUM_VALUE74NAME   "Output_Inc_Tile_Celebrate"

Definition at line 193 of file effects.h.

◆ SPECENUM_VALUE75

#define SPECENUM_VALUE75   EFT_CITY_UNHAPPY_SIZE

Definition at line 195 of file effects.h.

◆ SPECENUM_VALUE75NAME

#define SPECENUM_VALUE75NAME   "City_Unhappy_Size"

Definition at line 196 of file effects.h.

◆ SPECENUM_VALUE76

#define SPECENUM_VALUE76   EFT_CITY_RADIUS_SQ

Definition at line 198 of file effects.h.

◆ SPECENUM_VALUE76NAME

#define SPECENUM_VALUE76NAME   "City_Radius_Sq"

Definition at line 199 of file effects.h.

◆ SPECENUM_VALUE77

#define SPECENUM_VALUE77   EFT_CITY_BUILD_SLOTS

Definition at line 201 of file effects.h.

◆ SPECENUM_VALUE77NAME

#define SPECENUM_VALUE77NAME   "City_Build_Slots"

Definition at line 202 of file effects.h.

◆ SPECENUM_VALUE78

#define SPECENUM_VALUE78   EFT_UPGRADE_PRICE_PCT

Definition at line 203 of file effects.h.

◆ SPECENUM_VALUE78NAME

#define SPECENUM_VALUE78NAME   "Upgrade_Price_Pct"

Definition at line 204 of file effects.h.

◆ SPECENUM_VALUE79

#define SPECENUM_VALUE79   EFT_VISIBLE_WALLS

Definition at line 206 of file effects.h.

◆ SPECENUM_VALUE79NAME

#define SPECENUM_VALUE79NAME   "Visible_Walls"

Definition at line 207 of file effects.h.

◆ SPECENUM_VALUE7NAME

#define SPECENUM_VALUE7NAME   "Output_Bonus"

Definition at line 38 of file effects.h.

◆ SPECENUM_VALUE8

#define SPECENUM_VALUE8   EFT_OUTPUT_BONUS_2

Definition at line 39 of file effects.h.

◆ SPECENUM_VALUE80

#define SPECENUM_VALUE80   EFT_TECH_COST_FACTOR

Definition at line 208 of file effects.h.

◆ SPECENUM_VALUE80NAME

#define SPECENUM_VALUE80NAME   "Tech_Cost_Factor"

Definition at line 209 of file effects.h.

◆ SPECENUM_VALUE81

#define SPECENUM_VALUE81   EFT_SHIELD2GOLD_FACTOR

Definition at line 211 of file effects.h.

◆ SPECENUM_VALUE81NAME

#define SPECENUM_VALUE81NAME   "Shield2Gold_Factor"

Definition at line 212 of file effects.h.

◆ SPECENUM_VALUE82

#define SPECENUM_VALUE82   EFT_TILE_WORKABLE

Definition at line 213 of file effects.h.

◆ SPECENUM_VALUE82NAME

#define SPECENUM_VALUE82NAME   "Tile_Workable"

Definition at line 214 of file effects.h.

◆ SPECENUM_VALUE83

#define SPECENUM_VALUE83   EFT_CITY_IMAGE

Definition at line 216 of file effects.h.

◆ SPECENUM_VALUE83NAME

#define SPECENUM_VALUE83NAME   "City_Image"

Definition at line 217 of file effects.h.

◆ SPECENUM_VALUE84

#define SPECENUM_VALUE84   EFT_IMPR_BUILD_COST_PCT

Definition at line 218 of file effects.h.

◆ SPECENUM_VALUE84NAME

#define SPECENUM_VALUE84NAME   "Building_Build_Cost_Pct"

Definition at line 219 of file effects.h.

◆ SPECENUM_VALUE85

#define SPECENUM_VALUE85   EFT_MAX_TRADE_ROUTES

Definition at line 220 of file effects.h.

◆ SPECENUM_VALUE85NAME

#define SPECENUM_VALUE85NAME   "Max_Trade_Routes"

Definition at line 221 of file effects.h.

◆ SPECENUM_VALUE86

#define SPECENUM_VALUE86   EFT_GOV_CENTER

Definition at line 222 of file effects.h.

◆ SPECENUM_VALUE86NAME

#define SPECENUM_VALUE86NAME   "Gov_Center"

Definition at line 223 of file effects.h.

◆ SPECENUM_VALUE87

#define SPECENUM_VALUE87   EFT_COMBAT_ROUNDS

Definition at line 224 of file effects.h.

◆ SPECENUM_VALUE87NAME

#define SPECENUM_VALUE87NAME   "Combat_Rounds"

Definition at line 225 of file effects.h.

◆ SPECENUM_VALUE88

#define SPECENUM_VALUE88   EFT_IMPR_BUY_COST_PCT

Definition at line 226 of file effects.h.

◆ SPECENUM_VALUE88NAME

#define SPECENUM_VALUE88NAME   "Building_Buy_Cost_Pct"

Definition at line 227 of file effects.h.

◆ SPECENUM_VALUE89

#define SPECENUM_VALUE89   EFT_UNIT_BUILD_COST_PCT

Definition at line 228 of file effects.h.

◆ SPECENUM_VALUE89NAME

#define SPECENUM_VALUE89NAME   "Unit_Build_Cost_Pct"

Definition at line 229 of file effects.h.

◆ SPECENUM_VALUE8NAME

#define SPECENUM_VALUE8NAME   "Output_Bonus_2"

Definition at line 40 of file effects.h.

◆ SPECENUM_VALUE9

#define SPECENUM_VALUE9   EFT_OUTPUT_ADD_TILE

Definition at line 42 of file effects.h.

◆ SPECENUM_VALUE90

#define SPECENUM_VALUE90   EFT_UNIT_BUY_COST_PCT

Definition at line 230 of file effects.h.

◆ SPECENUM_VALUE90NAME

#define SPECENUM_VALUE90NAME   "Unit_Buy_Cost_Pct"

Definition at line 231 of file effects.h.

◆ SPECENUM_VALUE91

#define SPECENUM_VALUE91   EFT_NOT_TECH_SOURCE

Definition at line 232 of file effects.h.

◆ SPECENUM_VALUE91NAME

#define SPECENUM_VALUE91NAME   "Not_Tech_Source"

Definition at line 233 of file effects.h.

◆ SPECENUM_VALUE92

#define SPECENUM_VALUE92   EFT_ENEMY_CITIZEN_UNHAPPY_PCT

Definition at line 234 of file effects.h.

◆ SPECENUM_VALUE92NAME

#define SPECENUM_VALUE92NAME   "Enemy_Citizen_Unhappy_Pct"

Definition at line 235 of file effects.h.

◆ SPECENUM_VALUE93

#define SPECENUM_VALUE93   EFT_IRRIGATION_PCT

Definition at line 236 of file effects.h.

◆ SPECENUM_VALUE93NAME

#define SPECENUM_VALUE93NAME   "Irrigation_Pct"

Definition at line 237 of file effects.h.

◆ SPECENUM_VALUE94

#define SPECENUM_VALUE94   EFT_MINING_PCT

Definition at line 238 of file effects.h.

◆ SPECENUM_VALUE94NAME

#define SPECENUM_VALUE94NAME   "Mining_Pct"

Definition at line 239 of file effects.h.

◆ SPECENUM_VALUE95

#define SPECENUM_VALUE95   EFT_OUTPUT_TILE_PUNISH_PCT

Definition at line 240 of file effects.h.

◆ SPECENUM_VALUE95NAME

#define SPECENUM_VALUE95NAME   "Output_Tile_Punish_Pct"

Definition at line 241 of file effects.h.

◆ SPECENUM_VALUE96

#define SPECENUM_VALUE96   EFT_UNIT_BRIBE_COST_PCT

Definition at line 242 of file effects.h.

◆ SPECENUM_VALUE96NAME

#define SPECENUM_VALUE96NAME   "Unit_Bribe_Cost_Pct"

Definition at line 243 of file effects.h.

◆ SPECENUM_VALUE97

#define SPECENUM_VALUE97   EFT_VICTORY

Definition at line 244 of file effects.h.

◆ SPECENUM_VALUE97NAME

#define SPECENUM_VALUE97NAME   "Victory"

Definition at line 245 of file effects.h.

◆ SPECENUM_VALUE98

#define SPECENUM_VALUE98   EFT_PERFORMANCE

Definition at line 246 of file effects.h.

◆ SPECENUM_VALUE98NAME

#define SPECENUM_VALUE98NAME   "Performance"

Definition at line 247 of file effects.h.

◆ SPECENUM_VALUE99

#define SPECENUM_VALUE99   EFT_HISTORY

Definition at line 248 of file effects.h.

◆ SPECENUM_VALUE99NAME

#define SPECENUM_VALUE99NAME   "History"

Definition at line 249 of file effects.h.

◆ SPECENUM_VALUE9NAME

#define SPECENUM_VALUE9NAME   "Output_Add_Tile"

Definition at line 43 of file effects.h.

◆ SPECLIST_TAG

#define SPECLIST_TAG   effect

Definition at line 344 of file effects.h.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct effect

Definition at line 345 of file effects.h.

Typedef Documentation

◆ iec_cb

typedef bool(* iec_cb) (struct effect *, void *data)

Definition at line 449 of file effects.h.

Function Documentation

◆ building_has_effect()

bool building_has_effect ( const struct impr_type pimprove,
enum effect_type  effect_type 
)

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 504 of file effects.cpp.

Referenced by building_crucial(), can_player_build_improvement_direct(), helptext_building(), try_to_sell_stuff(), and valid_improvement().

◆ effect_copy()

struct effect* effect_copy ( struct effect old)

Return new copy of the effect.

Definition at line 186 of file effects.cpp.

Referenced by effect_handle_split_universal().

◆ effect_cumulative_max()

int effect_cumulative_max ( enum effect_type  type,
struct universal for_uni 
)

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 nullptr to get max effect value ignoring requirements.

Definition at line 307 of file effects.cpp.

Referenced by helptext_unit(), rs_common_units(), rs_max_city_radius_sq(), and sanity_check_boolean_effects().

◆ effect_cumulative_min()

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 nullptr to get min effect value ignoring requirements.

Definition at line 336 of file effects.cpp.

Referenced by sanity_check_boolean_effects().

◆ effect_new()

struct effect* effect_new ( enum effect_type  type,
int  value,
struct multiplier pmul 
)

◆ effect_req_append()

◆ effect_type_unit_text()

QString effect_type_unit_text ( effect_type  type,
int  value 
)

Returns a string describing an effect value as interpreted in the context of an effect_type, typically as "value [unit]" for some unit.

Definition at line 1058 of file effects.cpp.

Referenced by boot_help_texts().

◆ effect_value_from_universals()

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 368 of file effects.cpp.

Referenced by extra_bonus_for_terrain(), and helptext_unit().

◆ get_building_bonus()

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 819 of file effects.cpp.

Referenced by city_improvement_upkeep(), impr_build_shield_cost(), impr_buy_gold_cost(), and initialize_globals().

◆ get_city_bonus()

int get_city_bonus ( const struct city pcity,
enum effect_type  effect_type,
enum vision_layer  vlayer = V_COUNT 
)

◆ get_city_bonus_effects()

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 909 of file effects.cpp.

Referenced by get_city_dialog_culture_text(), get_city_dialog_illness_text(), and get_city_dialog_output_text().

◆ get_city_output_bonus()

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 800 of file effects.cpp.

Referenced by city_units_upkeep(), city_waste(), and cm_state_init().

◆ get_city_specialist_output_bonus()

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 703 of file effects.cpp.

Referenced by get_specialist_output().

◆ get_city_tile_output_bonus()

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 nullptr 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 728 of file effects.cpp.

Referenced by base_city_can_work_tile(), and get_final_city_output_bonus().

◆ get_current_construction_bonus()

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 933 of file effects.cpp.

Referenced by city_build_building(), city_increase_size(), and city_turn_notify().

◆ get_effect_list_req_text()

QString get_effect_list_req_text ( const struct effect_list *  plist)

Make user-friendly text for an effect list.

The text is put into a user astring.

Definition at line 1040 of file effects.cpp.

Referenced by do_tech_parasite_effect().

◆ get_effect_req_text()

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 1011 of file effects.cpp.

Referenced by boot_help_texts(), get_city_dialog_culture_text(), get_city_dialog_illness_text(), get_city_dialog_output_text(), and get_effect_list_req_text().

◆ get_effects() [1/2]

◆ get_effects() [2/2]

struct effect_list* get_effects ( enum effect_type  effect_type)

Get a list of effects of this type.

Definition at line 122 of file effects.cpp.

◆ get_player_bonus()

◆ get_player_bonus_effects()

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 889 of file effects.cpp.

Referenced by do_tech_parasite_effect().

◆ get_player_intel_bonus()

int get_player_intel_bonus ( const struct player pplayer,
const struct player pother,
enum national_intelligence  nintel,
enum effect_type  effect_type 
)

Gets the player effect bonus of a national intelligence.

Definition at line 779 of file effects.cpp.

Referenced by package_player_diplstate(), package_player_info(), and send_research_info().

◆ get_player_output_bonus()

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 760 of file effects.cpp.

Referenced by get_tile_output_text(), and utype_upkeep_cost().

◆ get_potential_improvement_bonus()

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 
)

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 954 of file effects.cpp.

Referenced by get_current_construction_bonus(), and improvement_has_effects().

◆ get_req_source_effects()

struct effect_list* get_req_source_effects ( struct universal psource)

Get a list of effects with this requirement source.

Note: currently only buildings and governments are supported.

Definition at line 132 of file effects.cpp.

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().

◆ get_target_bonus_effects()

int get_target_bonus_effects ( struct effect_list *  plist,
const struct player target_player,
const struct player other_player,
const struct city target_city,
const struct impr_type target_building,
const struct tile target_tile,
const struct unit target_unit,
const struct unit_type target_unittype,
const struct output_type target_output,
const struct specialist target_specialist,
const struct action target_action,
enum effect_type  effect_type,
enum vision_layer  vision_layer = V_COUNT,
enum national_intelligence  nintel = NI_COUNT 
)

◆ get_tile_output_bonus()

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 nullptr 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 746 of file effects.cpp.

Referenced by city_tile_output().

◆ get_unit_bonus()

int get_unit_bonus ( const struct unit punit,
enum effect_type  effect_type 
)

◆ get_unittype_bonus()

int get_unittype_bonus ( const struct player pplayer,
const struct tile ptile,
const struct unit_type punittype,
enum effect_type  effect_type,
enum vision_layer  vision_layer = V_COUNT 
)

◆ get_world_bonus()

int get_world_bonus ( enum effect_type  effect_type)

Returns the effect bonus for the whole world.

Definition at line 659 of file effects.cpp.

Referenced by api_effects_world_bonus(), and game_next_year().

◆ is_building_replaced()

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 566 of file effects.cpp.

Referenced by is_improvement_redundant().

◆ iterate_effect_cache()

bool iterate_effect_cache ( iec_cb  cb,
void *  data 
)

Iterate through all the effects in cache, and call callback for each.

This is currently not very generic implementation, as we have only one user; ruleset sanity checking. If any callback returns FALSE, there is no further checking and this will return FALSE.

Definition at line 1259 of file effects.cpp.

Referenced by is_multiplier_needed(), is_universal_needed(), effect_edit::refresh(), rscompat_optional_capabilities(), rscompat_postprocess(), sanity_check_ruleset_data(), and save_effects_ruleset().

◆ recv_ruleset_effect()

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 447 of file effects.cpp.

Referenced by handle_ruleset_effect().

◆ ruleset_cache_free()

void ruleset_cache_free ( )

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 245 of file effects.cpp.

Referenced by game_ruleset_free().

◆ ruleset_cache_init()

void ruleset_cache_init ( )

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 219 of file effects.cpp.

Referenced by game_ruleset_init().

◆ send_ruleset_cache()

void send_ruleset_cache ( struct conn_list *  dest)

Send the ruleset cache data over the network.

Definition at line 466 of file effects.cpp.

Referenced by send_rulesets().