webperimental: killstack decides stack protects.
[freeciv.git] / common / effects.h
blob6b5520b75c64dd652d7a55a5adb37a35d30d31fc
1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
13 #ifndef FC__EFFECTS_H
14 #define FC__EFFECTS_H
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
20 /* utility */
21 #include "support.h" /* bool type */
23 /* common */
24 #include "connection.h"
25 #include "fc_types.h"
26 #include "multipliers.h"
28 #include "requirements.h"
30 /* Type of effects. Add new values via SPECENUM_VALUE%d and
31 * SPECENUM_VALUE%dNAME at the end of the list.
32 * Used in the network protocol.
34 #define SPECENUM_NAME effect_type
35 #define SPECENUM_VALUE0 EFT_TECH_PARASITE
36 #define SPECENUM_VALUE0NAME "Tech_Parasite"
37 #define SPECENUM_VALUE1 EFT_AIRLIFT
38 #define SPECENUM_VALUE1NAME "Airlift"
39 #define SPECENUM_VALUE2 EFT_ANY_GOVERNMENT
40 #define SPECENUM_VALUE2NAME "Any_Government"
41 #define SPECENUM_VALUE3 EFT_CAPITAL_CITY
42 #define SPECENUM_VALUE3NAME "Capital_City"
43 #define SPECENUM_VALUE4 EFT_ENABLE_NUKE
44 #define SPECENUM_VALUE4NAME "Enable_Nuke"
45 #define SPECENUM_VALUE5 EFT_ENABLE_SPACE
46 #define SPECENUM_VALUE5NAME "Enable_Space"
47 #define SPECENUM_VALUE6 EFT_SPECIALIST_OUTPUT
48 #define SPECENUM_VALUE6NAME "Specialist_Output"
49 #define SPECENUM_VALUE7 EFT_OUTPUT_BONUS
50 #define SPECENUM_VALUE7NAME "Output_Bonus"
51 #define SPECENUM_VALUE8 EFT_OUTPUT_BONUS_2
52 #define SPECENUM_VALUE8NAME "Output_Bonus_2"
53 /* add to each worked tile */
54 #define SPECENUM_VALUE9 EFT_OUTPUT_ADD_TILE
55 #define SPECENUM_VALUE9NAME "Output_Add_Tile"
56 /* add to each worked tile that already has output */
57 #define SPECENUM_VALUE10 EFT_OUTPUT_INC_TILE
58 #define SPECENUM_VALUE10NAME "Output_Inc_Tile"
59 /* increase tile output by given % */
60 #define SPECENUM_VALUE11 EFT_OUTPUT_PER_TILE
61 #define SPECENUM_VALUE11NAME "Output_Per_Tile"
62 #define SPECENUM_VALUE12 EFT_OUTPUT_WASTE_PCT
63 #define SPECENUM_VALUE12NAME "Output_Waste_Pct"
64 #define SPECENUM_VALUE13 EFT_FORCE_CONTENT
65 #define SPECENUM_VALUE13NAME "Force_Content"
66 /* TODO: EFT_FORCE_CONTENT_PCT */
67 #define SPECENUM_VALUE14 EFT_GIVE_IMM_TECH
68 #define SPECENUM_VALUE14NAME "Give_Imm_Tech"
69 #define SPECENUM_VALUE15 EFT_GROWTH_FOOD
70 #define SPECENUM_VALUE15NAME "Growth_Food"
71 /* reduced illness due to buildings ... */
72 #define SPECENUM_VALUE16 EFT_HEALTH_PCT
73 #define SPECENUM_VALUE16NAME "Health_Pct"
74 #define SPECENUM_VALUE17 EFT_HAVE_EMBASSIES
75 #define SPECENUM_VALUE17NAME "Have_Embassies"
76 #define SPECENUM_VALUE18 EFT_MAKE_CONTENT
77 #define SPECENUM_VALUE18NAME "Make_Content"
78 #define SPECENUM_VALUE19 EFT_MAKE_CONTENT_MIL
79 #define SPECENUM_VALUE19NAME "Make_Content_Mil"
80 #define SPECENUM_VALUE20 EFT_MAKE_CONTENT_MIL_PER
81 #define SPECENUM_VALUE20NAME "Make_Content_Mil_Per"
82 /* TODO: EFT_MAKE_CONTENT_PCT */
83 #define SPECENUM_VALUE21 EFT_MAKE_HAPPY
84 #define SPECENUM_VALUE21NAME "Make_Happy"
85 #define SPECENUM_VALUE22 EFT_NO_ANARCHY
86 #define SPECENUM_VALUE22NAME "No_Anarchy"
87 #define SPECENUM_VALUE23 EFT_NUKE_PROOF
88 #define SPECENUM_VALUE23NAME "Nuke_Proof"
89 /* TODO: EFT_POLLU_ADJ */
90 /* TODO: EFT_POLLU_PCT */
91 /* TODO: EFT_POLLU_POP_ADJ */
92 #define SPECENUM_VALUE24 EFT_POLLU_POP_PCT
93 #define SPECENUM_VALUE24NAME "Pollu_Pop_Pct"
94 #define SPECENUM_VALUE25 EFT_POLLU_POP_PCT_2
95 #define SPECENUM_VALUE25NAME "Pollu_Pop_Pct_2"
96 /* TODO: EFT_POLLU_PROD_ADJ */
97 #define SPECENUM_VALUE26 EFT_POLLU_PROD_PCT
98 #define SPECENUM_VALUE26NAME "Pollu_Prod_Pct"
99 /* TODO: EFT_PROD_PCT */
100 #define SPECENUM_VALUE27 EFT_REVEAL_CITIES
101 #define SPECENUM_VALUE27NAME "Reveal_Cities"
102 #define SPECENUM_VALUE28 EFT_REVEAL_MAP
103 #define SPECENUM_VALUE28NAME "Reveal_Map"
104 /* TODO: EFT_INCITE_DIST_ADJ */
105 #define SPECENUM_VALUE29 EFT_INCITE_COST_PCT
106 #define SPECENUM_VALUE29NAME "Incite_Cost_Pct"
107 #define SPECENUM_VALUE30 EFT_SIZE_ADJ
108 #define SPECENUM_VALUE30NAME "Size_Adj"
109 #define SPECENUM_VALUE31 EFT_SIZE_UNLIMIT
110 #define SPECENUM_VALUE31NAME "Size_Unlimit"
111 #define SPECENUM_VALUE32 EFT_SS_STRUCTURAL
112 #define SPECENUM_VALUE32NAME "SS_Structural"
113 #define SPECENUM_VALUE33 EFT_SS_COMPONENT
114 #define SPECENUM_VALUE33NAME "SS_Component"
115 #define SPECENUM_VALUE34 EFT_SS_MODULE
116 #define SPECENUM_VALUE34NAME "SS_Module"
117 #define SPECENUM_VALUE35 EFT_SPY_RESISTANT
118 #define SPECENUM_VALUE35NAME "Spy_Resistant"
119 #define SPECENUM_VALUE36 EFT_MOVE_BONUS
120 #define SPECENUM_VALUE36NAME "Move_Bonus"
121 #define SPECENUM_VALUE37 EFT_UNIT_NO_LOSE_POP
122 #define SPECENUM_VALUE37NAME "Unit_No_Lose_Pop"
123 #define SPECENUM_VALUE38 EFT_UNIT_RECOVER
124 #define SPECENUM_VALUE38NAME "Unit_Recover"
125 #define SPECENUM_VALUE39 EFT_UPGRADE_UNIT
126 #define SPECENUM_VALUE39NAME "Upgrade_Unit"
127 #define SPECENUM_VALUE40 EFT_UPKEEP_FREE
128 #define SPECENUM_VALUE40NAME "Upkeep_Free"
129 #define SPECENUM_VALUE41 EFT_TECH_UPKEEP_FREE
130 #define SPECENUM_VALUE41NAME "Tech_Upkeep_Free"
131 #define SPECENUM_VALUE42 EFT_NO_UNHAPPY
132 #define SPECENUM_VALUE42NAME "No_Unhappy"
133 #define SPECENUM_VALUE43 EFT_VETERAN_BUILD
134 #define SPECENUM_VALUE43NAME "Veteran_Build"
135 #define SPECENUM_VALUE44 EFT_VETERAN_COMBAT
136 #define SPECENUM_VALUE44NAME "Veteran_Combat"
137 #define SPECENUM_VALUE45 EFT_HP_REGEN
138 #define SPECENUM_VALUE45NAME "HP_Regen"
139 #define SPECENUM_VALUE46 EFT_CITY_VISION_RADIUS_SQ
140 #define SPECENUM_VALUE46NAME "City_Vision_Radius_Sq"
141 #define SPECENUM_VALUE47 EFT_UNIT_VISION_RADIUS_SQ
142 #define SPECENUM_VALUE47NAME "Unit_Vision_Radius_Sq"
143 /* Interacts with F_BADWALLATTACKER, ignored by F_IGWALL */
144 #define SPECENUM_VALUE48 EFT_DEFEND_BONUS
145 #define SPECENUM_VALUE48NAME "Defend_Bonus"
146 #define SPECENUM_VALUE49 EFT_TRADEROUTE_PCT
147 #define SPECENUM_VALUE49NAME "Traderoute_Pct"
148 #define SPECENUM_VALUE50 EFT_GAIN_AI_LOVE
149 #define SPECENUM_VALUE50NAME "Gain_AI_Love"
150 #define SPECENUM_VALUE51 EFT_TURN_YEARS
151 #define SPECENUM_VALUE51NAME "Turn_Years"
152 #define SPECENUM_VALUE52 EFT_SLOW_DOWN_TIMELINE
153 #define SPECENUM_VALUE52NAME "Slow_Down_Timeline"
154 #define SPECENUM_VALUE53 EFT_CIVIL_WAR_CHANCE
155 #define SPECENUM_VALUE53NAME "Civil_War_Chance"
156 /* change of the migration score */
157 #define SPECENUM_VALUE54 EFT_MIGRATION_PCT
158 #define SPECENUM_VALUE54NAME "Migration_Pct"
159 /* +1 unhappy when more than this cities */
160 #define SPECENUM_VALUE55 EFT_EMPIRE_SIZE_BASE
161 #define SPECENUM_VALUE55NAME "Empire_Size_Base"
162 /* adds additional +1 unhappy steps to above */
163 #define SPECENUM_VALUE56 EFT_EMPIRE_SIZE_STEP
164 #define SPECENUM_VALUE56NAME "Empire_Size_Step"
165 #define SPECENUM_VALUE57 EFT_MAX_RATES
166 #define SPECENUM_VALUE57NAME "Max_Rates"
167 #define SPECENUM_VALUE58 EFT_MARTIAL_LAW_EACH
168 #define SPECENUM_VALUE58NAME "Martial_Law_Each"
169 #define SPECENUM_VALUE59 EFT_MARTIAL_LAW_MAX
170 #define SPECENUM_VALUE59NAME "Martial_Law_Max"
171 #define SPECENUM_VALUE60 EFT_RAPTURE_GROW
172 #define SPECENUM_VALUE60NAME "Rapture_Grow"
173 #define SPECENUM_VALUE61 EFT_REVOLUTION_UNHAPPINESS
174 #define SPECENUM_VALUE61NAME "Revolution_Unhappiness"
175 #define SPECENUM_VALUE62 EFT_HAS_SENATE
176 #define SPECENUM_VALUE62NAME "Has_Senate"
177 #define SPECENUM_VALUE63 EFT_INSPIRE_PARTISANS
178 #define SPECENUM_VALUE63NAME "Inspire_Partisans"
179 #define SPECENUM_VALUE64 EFT_HAPPINESS_TO_GOLD
180 #define SPECENUM_VALUE64NAME "Happiness_To_Gold"
181 /* stupid special case; we hate it */
182 #define SPECENUM_VALUE65 EFT_FANATICS
183 #define SPECENUM_VALUE65NAME "Fanatics"
184 #define SPECENUM_VALUE66 EFT_NO_DIPLOMACY
185 #define SPECENUM_VALUE66NAME "No_Diplomacy"
186 #define SPECENUM_VALUE67 EFT_TRADE_REVENUE_BONUS
187 #define SPECENUM_VALUE67NAME "Trade_Revenue_Bonus"
188 /* multiply unhappy upkeep by this effect */
189 #define SPECENUM_VALUE68 EFT_UNHAPPY_FACTOR
190 #define SPECENUM_VALUE68NAME "Unhappy_Factor"
191 /* multiply upkeep by this effect */
192 #define SPECENUM_VALUE69 EFT_UPKEEP_FACTOR
193 #define SPECENUM_VALUE69NAME "Upkeep_Factor"
194 /* this many units are free from upkeep */
195 #define SPECENUM_VALUE70 EFT_UNIT_UPKEEP_FREE_PER_CITY
196 #define SPECENUM_VALUE70NAME "Unit_Upkeep_Free_Per_City"
197 #define SPECENUM_VALUE71 EFT_OUTPUT_WASTE
198 #define SPECENUM_VALUE71NAME "Output_Waste"
199 #define SPECENUM_VALUE72 EFT_OUTPUT_WASTE_BY_DISTANCE
200 #define SPECENUM_VALUE72NAME "Output_Waste_By_Distance"
201 /* -1 penalty to tiles producing more than this */
202 #define SPECENUM_VALUE73 EFT_OUTPUT_PENALTY_TILE
203 #define SPECENUM_VALUE73NAME "Output_Penalty_Tile"
204 #define SPECENUM_VALUE74 EFT_OUTPUT_INC_TILE_CELEBRATE
205 #define SPECENUM_VALUE74NAME "Output_Inc_Tile_Celebrate"
206 /* all citizens after this are unhappy */
207 #define SPECENUM_VALUE75 EFT_CITY_UNHAPPY_SIZE
208 #define SPECENUM_VALUE75NAME "City_Unhappy_Size"
209 /* add to default squared city radius */
210 #define SPECENUM_VALUE76 EFT_CITY_RADIUS_SQ
211 #define SPECENUM_VALUE76NAME "City_Radius_Sq"
212 /* number of build slots for units */
213 #define SPECENUM_VALUE77 EFT_CITY_BUILD_SLOTS
214 #define SPECENUM_VALUE77NAME "City_Build_Slots"
215 #define SPECENUM_VALUE78 EFT_UPGRADE_PRICE_PCT
216 #define SPECENUM_VALUE78NAME "Upgrade_Price_Pct"
217 /* City should use walls gfx */
218 #define SPECENUM_VALUE79 EFT_VISIBLE_WALLS
219 #define SPECENUM_VALUE79NAME "Visible_Walls"
220 #define SPECENUM_VALUE80 EFT_TECH_COST_FACTOR
221 #define SPECENUM_VALUE80NAME "Tech_Cost_Factor"
222 /* [x%] gold upkeep instead of [1] shield upkeep for units */
223 #define SPECENUM_VALUE81 EFT_SHIELD2GOLD_FACTOR
224 #define SPECENUM_VALUE81NAME "Shield2Gold_Factor"
225 #define SPECENUM_VALUE82 EFT_TILE_WORKABLE
226 #define SPECENUM_VALUE82NAME "Tile_Workable"
227 /* The index for the city image of the given city style. */
228 #define SPECENUM_VALUE83 EFT_CITY_IMAGE
229 #define SPECENUM_VALUE83NAME "City_Image"
230 #define SPECENUM_VALUE84 EFT_IRRIG_POSSIBLE
231 #define SPECENUM_VALUE84NAME "Irrig_Possible"
232 #define SPECENUM_VALUE85 EFT_MAX_TRADE_ROUTES
233 #define SPECENUM_VALUE85NAME "Max_Trade_Routes"
234 #define SPECENUM_VALUE86 EFT_GOV_CENTER
235 #define SPECENUM_VALUE86NAME "Gov_Center"
236 #define SPECENUM_VALUE87 EFT_TRANSFORM_POSSIBLE
237 #define SPECENUM_VALUE87NAME "Transform_Possible"
238 #define SPECENUM_VALUE88 EFT_MINING_POSSIBLE
239 #define SPECENUM_VALUE88NAME "Mining_Possible"
240 #define SPECENUM_VALUE89 EFT_IRRIG_TF_POSSIBLE
241 #define SPECENUM_VALUE89NAME "Irrig_TF_Possible"
242 #define SPECENUM_VALUE90 EFT_MINING_TF_POSSIBLE
243 #define SPECENUM_VALUE90NAME "Mining_TF_Possible"
244 #define SPECENUM_VALUE91 EFT_NOT_TECH_SOURCE
245 #define SPECENUM_VALUE91NAME "Not_Tech_Source"
246 #define SPECENUM_VALUE92 EFT_ENEMY_CITIZEN_UNHAPPY_PCT
247 #define SPECENUM_VALUE92NAME "Enemy_Citizen_Unhappy_Pct"
248 #define SPECENUM_VALUE93 EFT_IRRIGATION_PCT
249 #define SPECENUM_VALUE93NAME "Irrigation_Pct"
250 #define SPECENUM_VALUE94 EFT_MINING_PCT
251 #define SPECENUM_VALUE94NAME "Mining_Pct"
252 #define SPECENUM_VALUE95 EFT_OUTPUT_TILE_PUNISH_PCT
253 #define SPECENUM_VALUE95NAME "Output_Tile_Punish_Pct"
254 #define SPECENUM_VALUE96 EFT_UNIT_BRIBE_COST_PCT
255 #define SPECENUM_VALUE96NAME "Unit_Bribe_Cost_Pct"
256 #define SPECENUM_VALUE97 EFT_VICTORY
257 #define SPECENUM_VALUE97NAME "Victory"
258 #define SPECENUM_VALUE98 EFT_PERFORMANCE
259 #define SPECENUM_VALUE98NAME "Performance"
260 #define SPECENUM_VALUE99 EFT_HISTORY
261 #define SPECENUM_VALUE99NAME "History"
262 #define SPECENUM_VALUE100 EFT_NATION_PERFORMANCE
263 #define SPECENUM_VALUE100NAME "National_Performance"
264 #define SPECENUM_VALUE101 EFT_NATION_HISTORY
265 #define SPECENUM_VALUE101NAME "National_History"
266 #define SPECENUM_VALUE102 EFT_TURN_FRAGMENTS
267 #define SPECENUM_VALUE102NAME "Turn_Fragments"
268 #define SPECENUM_VALUE103 EFT_MAX_STOLEN_GOLD_PM
269 #define SPECENUM_VALUE103NAME "Max_Stolen_Gold_Pm"
270 #define SPECENUM_VALUE104 EFT_THIEFS_SHARE_PM
271 #define SPECENUM_VALUE104NAME "Thiefs_Share_Pm"
272 #define SPECENUM_VALUE105 EFT_RETIRE_PCT
273 #define SPECENUM_VALUE105NAME "Retire_Pct"
274 #define SPECENUM_VALUE106 EFT_ILLEGAL_ACTION_MOVE_COST
275 #define SPECENUM_VALUE106NAME "Illegal_Action_Move_Cost"
276 #define SPECENUM_VALUE107 EFT_HAVE_CONTACTS
277 #define SPECENUM_VALUE107NAME "Have_Contacts"
278 #define SPECENUM_VALUE108 EFT_CASUS_BELLI_CAUGHT
279 #define SPECENUM_VALUE108NAME "Casus_Belli_Caught"
280 #define SPECENUM_VALUE109 EFT_CASUS_BELLI_SUCCESS
281 #define SPECENUM_VALUE109NAME "Casus_Belli_Success"
282 #define SPECENUM_VALUE110 EFT_ACTION_ODDS_PCT
283 #define SPECENUM_VALUE110NAME "Action_Odds_Pct"
284 #define SPECENUM_VALUE111 EFT_BORDER_VISION
285 #define SPECENUM_VALUE111NAME "Border_Vision"
286 #define SPECENUM_VALUE112 EFT_STEALINGS_IGNORE
287 #define SPECENUM_VALUE112NAME "Stealings_Ignore"
288 #define SPECENUM_VALUE113 EFT_OUTPUT_WASTE_BY_REL_DISTANCE
289 #define SPECENUM_VALUE113NAME "Output_Waste_By_Rel_Distance"
290 #define SPECENUM_VALUE114 EFT_SABOTEUR_RESISTANT
291 #define SPECENUM_VALUE114NAME "Building_Saboteur_Resistant"
292 #define SPECENUM_VALUE115 EFT_UNIT_SLOTS
293 #define SPECENUM_VALUE115NAME "Unit_Slots"
294 #define SPECENUM_VALUE116 EFT_ATTACK_BONUS
295 #define SPECENUM_VALUE116NAME "Attack_Bonus"
296 /* keep this last */
297 #define SPECENUM_COUNT EFT_COUNT
298 #include "specenum_gen.h"
300 /* An effect is provided by a source. If the source is present, and the
301 * other conditions (described below) are met, the effect will be active.
302 * Note the difference between effect and effect_type. */
303 struct effect {
304 enum effect_type type;
306 /* pointer to multipliers (NULL means that this effect has no multiplier */
307 struct multiplier *multiplier;
309 /* The "value" of the effect. The meaning of this varies between
310 * effects. When get_xxx_bonus() is called the value of all applicable
311 * effects will be summed up. */
312 int value;
314 /* An effect can have multiple requirements. The effect will only be
315 * active if all of these requirement are met. */
316 struct requirement_vector reqs;
319 /* An effect_list is a list of effects. */
320 #define SPECLIST_TAG effect
321 #define SPECLIST_TYPE struct effect
322 #include "speclist.h"
323 #define effect_list_iterate(effect_list, peffect) \
324 TYPED_LIST_ITERATE(struct effect, effect_list, peffect)
325 #define effect_list_iterate_end LIST_ITERATE_END
327 struct effect *effect_new(enum effect_type type, int value,
328 struct multiplier *pmul);
329 struct effect *effect_copy(struct effect *old);
330 void effect_req_append(struct effect *peffect, struct requirement req);
332 struct astring;
333 void get_effect_req_text(const struct effect *peffect,
334 char *buf, size_t buf_len);
335 void get_effect_list_req_text(const struct effect_list *plist,
336 struct astring *astr);
338 /* ruleset cache creation and communication functions */
339 struct packet_ruleset_effect;
341 void ruleset_cache_init(void);
342 void ruleset_cache_free(void);
343 void recv_ruleset_effect(const struct packet_ruleset_effect *packet);
344 void send_ruleset_cache(struct conn_list *dest);
346 int effect_cumulative_max(enum effect_type type, struct universal *for_uni);
347 int effect_cumulative_min(enum effect_type type, struct universal *for_uni);
349 bool is_building_replaced(const struct city *pcity,
350 struct impr_type *pimprove,
351 const enum req_problem_type prob_type);
353 /* functions to know the bonuses a certain effect is granting */
354 int get_world_bonus(enum effect_type effect_type);
355 int get_player_bonus(const struct player *plr, enum effect_type effect_type);
356 int get_city_bonus(const struct city *pcity, enum effect_type effect_type);
357 int get_city_specialist_output_bonus(const struct city *pcity,
358 const struct specialist *pspecialist,
359 const struct output_type *poutput,
360 enum effect_type effect_type);
361 int get_city_tile_output_bonus(const struct city *pcity,
362 const struct tile *ptile,
363 const struct output_type *poutput,
364 enum effect_type effect_type);
365 int get_player_output_bonus(const struct player *pplayer,
366 const struct output_type *poutput,
367 enum effect_type effect_type);
368 int get_city_output_bonus(const struct city *pcity,
369 const struct output_type *poutput,
370 enum effect_type effect_type);
371 int get_building_bonus(const struct city *pcity,
372 const struct impr_type *building,
373 enum effect_type effect_type);
374 int get_unittype_bonus(const struct player *pplayer,
375 const struct tile *ptile, /* pcity is implied */
376 const struct unit_type *punittype,
377 enum effect_type effect_type);
378 int get_unit_bonus(const struct unit *punit, enum effect_type effect_type);
379 int get_tile_bonus(const struct tile *ptile, const struct unit *punit,
380 enum effect_type etype);
382 /* miscellaneous auxiliary effects functions */
383 struct effect_list *get_req_source_effects(struct universal *psource);
385 int get_player_bonus_effects(struct effect_list *plist,
386 const struct player *pplayer,
387 enum effect_type effect_type);
388 int get_city_bonus_effects(struct effect_list *plist,
389 const struct city *pcity,
390 const struct output_type *poutput,
391 enum effect_type effect_type);
393 int get_target_bonus_effects(struct effect_list *plist,
394 const struct player *target_player,
395 const struct player *other_player,
396 const struct city *target_city,
397 const struct impr_type *target_building,
398 const struct tile *target_tile,
399 const struct unit *target_unit,
400 const struct unit_type *target_unittype,
401 const struct output_type *target_output,
402 const struct specialist *target_specialist,
403 const struct action *target_action,
404 enum effect_type effect_type);
406 bool building_has_effect(const struct impr_type *pimprove,
407 enum effect_type effect_type);
408 int get_current_construction_bonus(const struct city *pcity,
409 enum effect_type effect_type,
410 const enum req_problem_type prob_type);
411 int get_potential_improvement_bonus(struct impr_type *pimprove,
412 const struct city *pcity,
413 enum effect_type effect_type,
414 const enum req_problem_type prob_type);
416 struct effect_list *get_effects(enum effect_type effect_type);
418 typedef bool (*iec_cb)(struct effect*, void *data);
419 bool iterate_effect_cache(iec_cb cb, void *data);
421 #ifdef __cplusplus
423 #endif /* __cplusplus */
425 #endif /* FC__EFFECTS_H */