Freeciv21
Develop your civilization from humble roots to a global empire
fc_types.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  __ __ part of Freeciv21. Freeciv21 is free software: you can
4 / \\..// \ redistribute it and/or modify it under the terms of the GNU
5  ( oo ) General Public License as published by the Free Software
6  \__/ Foundation, either version 3 of the License, or (at your
7  option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 
12 #pragma once
13 
14 // utility
15 #include "bitvector.h"
16 
17 /* This file serves to reduce the cross-inclusion of header files which
18  * occurs when a type which is defined in one file is needed for a function
19  * definition in another file.
20  *
21  * Nothing in this file should require anything else from the common/
22  * directory! */
23 
24 #define MAX_NUM_PLAYER_SLOTS 512 // Used in the network protocol.
25  /* Must be divisable by 32 or iterations
26  * in savegame2.c needs to be changed */
27 #define MAX_NUM_BARBARIANS 12 // 3, but slots reserved for future use.
28 #define MAX_NUM_PLAYERS MAX_NUM_PLAYER_SLOTS - MAX_NUM_BARBARIANS
29 // Used in the network protocol.
30 #define MAX_NUM_CONNECTIONS (2 * (MAX_NUM_PLAYER_SLOTS))
31 // e.g. unit_types. Used in the network protocol.
32 #define MAX_NUM_ITEMS 200
33 #define MAX_NUM_ADVANCES 250 // Used in the network protocol.
34 #define MAX_NUM_UNIT_TYPES 250 // Used in the network protocol.
35 #define MAX_NUM_BUILDINGS 200 // Used in the network protocol.
36 #define MAX_NUM_TECH_LIST 10 // Used in the network protocol.
37 #define MAX_NUM_UNIT_LIST 10 // Used in the network protocol.
38 #define MAX_NUM_BUILDING_LIST 10 // Used in the network protocol.
39 #define MAX_LEN_VET_SHORT_NAME 8
40 // Used in the network protocol. See diplomat_success_vs_defender()
41 #define MAX_VET_LEVELS 20
42 #define MAX_EXTRA_TYPES 128 // Used in the network protocol.
43 #define MAX_BASE_TYPES MAX_EXTRA_TYPES // Used in the network protocol.
44 #define MAX_ROAD_TYPES MAX_EXTRA_TYPES // Used in the network protocol.
45 #define MAX_GOODS_TYPES 25
46 #define MAX_DISASTER_TYPES 10
47 #define MAX_ACHIEVEMENT_TYPES 40
48 #define MAX_NUM_ACTION_AUTO_PERFORMERS 4
49 #define MAX_NUM_MULTIPLIERS 15
50 #define MAX_NUM_LEADERS MAX_NUM_ITEMS // Used in the network protocol.
51 #define MAX_NUM_NATION_SETS \
52  32 /* Used in the network protocol. \
53  * RULESET_NATION_SETS packet may become too big \
54  * if increased */
55 #define MAX_NUM_NATION_GROUPS 128 // Used in the network protocol.
56 // Used in the network protocol -- nation count is a UINT16
57 #define MAX_NUM_NATIONS MAX_UINT16
58 #define MAX_NUM_STARTPOS_NATIONS 1024 // Used in the network protocol.
59 #define MAX_CALENDAR_FRAGMENTS 52 // Used in the network protocol.
60 #define MAX_NUM_TECH_CLASSES 16 // Used in the network protocol.
61 
62 // Changing these will probably break network compatability.
63 #define MAX_LEN_NAME 48
64 #define MAX_LEN_CITYNAME 80
65 #define MAX_LEN_MAP_LABEL 64
66 #define MAX_LEN_DEMOGRAPHY 32
67 #define MAX_LEN_ALLOW_TAKE 16
68 #define MAX_LEN_GAME_IDENTIFIER 33
69 #define MAX_GRANARY_INIS 24
70 #define MAX_LEN_STARTUNIT (20 + 1)
71 #define MAX_LEN_ENUM 64
72 
73 /* Line breaks after this number of characters; be carefull and use only 70
74  */
75 #define LINE_BREAK 70
76 
77 // symbol to flag missing numbers for better debugging
78 #define IDENTITY_NUMBER_ZERO (0)
79 
81 
82 // A bitvector for all player slots. Used in the network protocol.
84 
85 // Changing this breaks network compatibility.
91  O_LUXURY,
93  O_LAST
94 };
95 
96 // Changing this enum will break savegame and network compatability.
97 /* When changing this, also update list of valid requirement "Activity"
98  * values in doc/README.effects. */
99 #define SPECENUM_NAME unit_activity
100 #define SPECENUM_VALUE0 ACTIVITY_IDLE
101 #define SPECENUM_VALUE0NAME N_("Idle")
102 #define SPECENUM_VALUE1 ACTIVITY_POLLUTION
103 #define SPECENUM_VALUE1NAME N_("Pollution")
104 #define SPECENUM_VALUE2 ACTIVITY_OLD_ROAD
105 #define SPECENUM_VALUE2NAME "Unused Road"
106 #define SPECENUM_VALUE3 ACTIVITY_MINE
107 #define SPECENUM_VALUE3NAME N_("Mine")
108 #define SPECENUM_VALUE4 ACTIVITY_IRRIGATE
109 #define SPECENUM_VALUE4NAME N_("Irrigate")
110 #define SPECENUM_VALUE5 ACTIVITY_FORTIFIED
111 #define SPECENUM_VALUE5NAME N_("Fortified")
112 #define SPECENUM_VALUE6 ACTIVITY_FORTRESS
113 #define SPECENUM_VALUE6NAME N_("Fortress")
114 #define SPECENUM_VALUE7 ACTIVITY_SENTRY
115 #define SPECENUM_VALUE7NAME N_("Sentry")
116 #define SPECENUM_VALUE8 ACTIVITY_OLD_RAILROAD
117 #define SPECENUM_VALUE8NAME "Unused Railroad"
118 #define SPECENUM_VALUE9 ACTIVITY_PILLAGE
119 #define SPECENUM_VALUE9NAME N_("Pillage")
120 #define SPECENUM_VALUE10 ACTIVITY_GOTO
121 #define SPECENUM_VALUE10NAME N_("Goto")
122 #define SPECENUM_VALUE11 ACTIVITY_EXPLORE
123 #define SPECENUM_VALUE11NAME N_("Explore")
124 #define SPECENUM_VALUE12 ACTIVITY_TRANSFORM
125 #define SPECENUM_VALUE12NAME N_("Transform")
126 #define SPECENUM_VALUE13 ACTIVITY_UNKNOWN
127 #define SPECENUM_VALUE13NAME "Unused"
128 #define SPECENUM_VALUE14 ACTIVITY_AIRBASE
129 #define SPECENUM_VALUE14NAME "Unused Airbase"
130 #define SPECENUM_VALUE15 ACTIVITY_FORTIFYING
131 #define SPECENUM_VALUE15NAME N_("Fortifying")
132 #define SPECENUM_VALUE16 ACTIVITY_FALLOUT
133 #define SPECENUM_VALUE16NAME N_("Fallout")
134 #define SPECENUM_VALUE17 ACTIVITY_PATROL_UNUSED
135 #define SPECENUM_VALUE17NAME "Unused Patrol"
136 #define SPECENUM_VALUE18 ACTIVITY_BASE
137 #define SPECENUM_VALUE18NAME N_("Base")
138 #define SPECENUM_VALUE19 ACTIVITY_GEN_ROAD
139 #define SPECENUM_VALUE19NAME N_("Road")
140 #define SPECENUM_VALUE20 ACTIVITY_CONVERT
141 #define SPECENUM_VALUE20NAME N_("Convert")
142 #define SPECENUM_VALUE21 ACTIVITY_CULTIVATE
143 #define SPECENUM_VALUE21NAME N_("Cultivate")
144 #define SPECENUM_VALUE22 ACTIVITY_PLANT
145 #define SPECENUM_VALUE22NAME N_("Plant")
146 #define SPECENUM_COUNT ACTIVITY_LAST
147 #include "specenum_gen.h"
148 
149 // Values used in the network protocol.
150 #define SPECENUM_NAME action_result
151 #define SPECENUM_VALUE0 ACTRES_ESTABLISH_EMBASSY
152 #define SPECENUM_VALUE0NAME "Establish Embassy"
153 #define SPECENUM_VALUE1 ACTRES_SPY_INVESTIGATE_CITY
154 #define SPECENUM_VALUE1NAME "Investigate City"
155 #define SPECENUM_VALUE2 ACTRES_SPY_POISON
156 #define SPECENUM_VALUE2NAME "Poison City"
157 #define SPECENUM_VALUE3 ACTRES_SPY_STEAL_GOLD
158 #define SPECENUM_VALUE3NAME "Steal Gold"
159 #define SPECENUM_VALUE4 ACTRES_SPY_SABOTAGE_CITY
160 #define SPECENUM_VALUE4NAME "Sabotage City"
161 #define SPECENUM_VALUE5 ACTRES_SPY_TARGETED_SABOTAGE_CITY
162 #define SPECENUM_VALUE5NAME "Targeted Sabotage City"
163 #define SPECENUM_VALUE6 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION
164 #define SPECENUM_VALUE6NAME "Sabotage City Production"
165 #define SPECENUM_VALUE7 ACTRES_SPY_STEAL_TECH
166 #define SPECENUM_VALUE7NAME "Steal Tech"
167 #define SPECENUM_VALUE8 ACTRES_SPY_TARGETED_STEAL_TECH
168 #define SPECENUM_VALUE8NAME "Targeted Steal Tech"
169 #define SPECENUM_VALUE9 ACTRES_SPY_INCITE_CITY
170 #define SPECENUM_VALUE9NAME "Incite City"
171 #define SPECENUM_VALUE10 ACTRES_TRADE_ROUTE
172 #define SPECENUM_VALUE10NAME "Establish Trade Route"
173 #define SPECENUM_VALUE11 ACTRES_MARKETPLACE
174 #define SPECENUM_VALUE11NAME "Enter Marketplace"
175 #define SPECENUM_VALUE12 ACTRES_HELP_WONDER
176 #define SPECENUM_VALUE12NAME "Help Wonder"
177 #define SPECENUM_VALUE13 ACTRES_SPY_BRIBE_UNIT
178 #define SPECENUM_VALUE13NAME "Bribe Unit"
179 #define SPECENUM_VALUE14 ACTRES_SPY_SABOTAGE_UNIT
180 #define SPECENUM_VALUE14NAME "Sabotage Unit"
181 #define SPECENUM_VALUE15 ACTRES_CAPTURE_UNITS
182 #define SPECENUM_VALUE15NAME "Capture Units"
183 #define SPECENUM_VALUE16 ACTRES_FOUND_CITY
184 #define SPECENUM_VALUE16NAME "Found City"
185 #define SPECENUM_VALUE17 ACTRES_JOIN_CITY
186 #define SPECENUM_VALUE17NAME "Join City"
187 #define SPECENUM_VALUE18 ACTRES_STEAL_MAPS
188 #define SPECENUM_VALUE18NAME "Steal Maps"
189 #define SPECENUM_VALUE19 ACTRES_BOMBARD
190 #define SPECENUM_VALUE19NAME "Bombard"
191 #define SPECENUM_VALUE20 ACTRES_SPY_NUKE
192 #define SPECENUM_VALUE20NAME "Suitcase Nuke"
193 #define SPECENUM_VALUE21 ACTRES_NUKE
194 #define SPECENUM_VALUE21NAME "Explode Nuclear"
195 #define SPECENUM_VALUE22 ACTRES_NUKE_CITY
196 #define SPECENUM_VALUE22NAME "Nuke City"
197 #define SPECENUM_VALUE23 ACTRES_NUKE_UNITS
198 #define SPECENUM_VALUE23NAME "Nuke Units"
199 #define SPECENUM_VALUE24 ACTRES_DESTROY_CITY
200 #define SPECENUM_VALUE24NAME "Destroy City"
201 #define SPECENUM_VALUE25 ACTRES_EXPEL_UNIT
202 #define SPECENUM_VALUE25NAME "Expel Unit"
203 #define SPECENUM_VALUE26 ACTRES_RECYCLE_UNIT
204 #define SPECENUM_VALUE26NAME "Recycle Unit"
205 #define SPECENUM_VALUE27 ACTRES_DISBAND_UNIT
206 #define SPECENUM_VALUE27NAME "Disband Unit"
207 #define SPECENUM_VALUE28 ACTRES_HOME_CITY
208 #define SPECENUM_VALUE28NAME "Home City"
209 #define SPECENUM_VALUE29 ACTRES_UPGRADE_UNIT
210 #define SPECENUM_VALUE29NAME "Upgrade Unit"
211 #define SPECENUM_VALUE30 ACTRES_PARADROP
212 #define SPECENUM_VALUE30NAME "Paradrop Unit"
213 #define SPECENUM_VALUE31 ACTRES_AIRLIFT
214 #define SPECENUM_VALUE31NAME "Airlift Unit"
215 #define SPECENUM_VALUE32 ACTRES_ATTACK
216 #define SPECENUM_VALUE32NAME "Attack"
217 #define SPECENUM_VALUE33 ACTRES_STRIKE_BUILDING
218 #define SPECENUM_VALUE33NAME "Surgical Strike Building"
219 #define SPECENUM_VALUE34 ACTRES_STRIKE_PRODUCTION
220 #define SPECENUM_VALUE34NAME "Surgical Strike Production"
221 #define SPECENUM_VALUE35 ACTRES_CONQUER_CITY
222 #define SPECENUM_VALUE35NAME "Conquer City"
223 #define SPECENUM_VALUE36 ACTRES_HEAL_UNIT
224 #define SPECENUM_VALUE36NAME "Heal Unit"
225 #define SPECENUM_VALUE37 ACTRES_TRANSFORM_TERRAIN
226 #define SPECENUM_VALUE37NAME "Transform Terrain"
227 #define SPECENUM_VALUE38 ACTRES_CULTIVATE
228 #define SPECENUM_VALUE38NAME "Cultivate"
229 #define SPECENUM_VALUE39 ACTRES_PLANT
230 #define SPECENUM_VALUE39NAME "Plant"
231 #define SPECENUM_VALUE40 ACTRES_PILLAGE
232 #define SPECENUM_VALUE40NAME "Pillage"
233 #define SPECENUM_VALUE41 ACTRES_FORTIFY
234 #define SPECENUM_VALUE41NAME "Fortify"
235 #define SPECENUM_VALUE42 ACTRES_ROAD
236 #define SPECENUM_VALUE42NAME "Build Road"
237 #define SPECENUM_VALUE43 ACTRES_CONVERT
238 #define SPECENUM_VALUE43NAME "Convert Unit"
239 #define SPECENUM_VALUE44 ACTRES_BASE
240 #define SPECENUM_VALUE44NAME "Build Base"
241 #define SPECENUM_VALUE45 ACTRES_MINE
242 #define SPECENUM_VALUE45NAME "Build Mine"
243 #define SPECENUM_VALUE46 ACTRES_IRRIGATE
244 #define SPECENUM_VALUE46NAME "Build Irrigation"
245 #define SPECENUM_VALUE47 ACTRES_CLEAN_POLLUTION
246 #define SPECENUM_VALUE47NAME "Clean Pollution"
247 #define SPECENUM_VALUE48 ACTRES_CLEAN_FALLOUT
248 #define SPECENUM_VALUE48NAME "Clean Fallout"
249 #define SPECENUM_VALUE49 ACTRES_TRANSPORT_ALIGHT
250 #define SPECENUM_VALUE49NAME "Transport Alight"
251 #define SPECENUM_VALUE50 ACTRES_TRANSPORT_UNLOAD
252 #define SPECENUM_VALUE50NAME "Transport Unload"
253 #define SPECENUM_VALUE51 ACTRES_TRANSPORT_DISEMBARK
254 #define SPECENUM_VALUE51NAME "Transport Disembark"
255 #define SPECENUM_VALUE52 ACTRES_TRANSPORT_BOARD
256 #define SPECENUM_VALUE52NAME "Transport Board"
257 #define SPECENUM_VALUE53 ACTRES_TRANSPORT_EMBARK
258 #define SPECENUM_VALUE53NAME "Transport Embark"
259 #define SPECENUM_VALUE54 ACTRES_SPY_SPREAD_PLAGUE
260 #define SPECENUM_VALUE54NAME "Spread Plague"
261 #define SPECENUM_VALUE55 ACTRES_SPY_ATTACK
262 #define SPECENUM_VALUE55NAME "Spy Attack"
263 // All consequences are handled as (ruleset) action data.
264 #define SPECENUM_COUNT ACTRES_NONE
265 #include "specenum_gen.h"
266 
267 // Happens at once, not during turn change.
268 #define ACT_TIME_INSTANTANEOUS (-1)
269 
270 /* Symbol used to flag no (sub) target of an action or for an activity.
271  * IDENTITY_NUMBER_ZERO can't be used since 0 is a valid identity for
272  * certain (sub) targets. */
273 #define NO_TARGET (-1)
274 
275 // How "large" a Casus Belli is.
276 #define SPECENUM_NAME casus_belli_range
277 // No one gets a Casus Belli.
278 #define SPECENUM_VALUE0 CBR_NONE
279 #define SPECENUM_VALUE0NAME N_("No Casus Belli")
280 // Only the victim player gets a Casus Belli.
281 #define SPECENUM_VALUE1 CBR_VICTIM_ONLY
282 #define SPECENUM_VALUE1NAME N_("Victim Casus Belli")
283 // Every other player, including the victim, gets a Casus Belli.
284 #define SPECENUM_VALUE2 CBR_INTERNATIONAL_OUTRAGE
285 #define SPECENUM_VALUE2NAME N_("International Outrage")
286 #define SPECENUM_COUNT CBR_LAST
287 #include "specenum_gen.h"
288 
290 
291 typedef signed short Continent_id;
292 typedef int Terrain_type_id;
293 typedef int Resource_type_id;
294 typedef int Specialist_type_id;
295 typedef int Impr_type_id;
296 typedef int Tech_type_id;
298 typedef enum unit_activity Activity_type_id;
299 typedef int Nation_type_id;
300 typedef int Government_type_id;
301 typedef int Unit_type_id;
302 typedef int Base_type_id;
303 typedef int Road_type_id;
304 typedef int Disaster_type_id;
305 typedef int Multiplier_type_id;
306 typedef int Goods_type_id;
307 typedef unsigned char citizens;
308 typedef int action_id;
309 
310 struct advance;
311 struct city;
312 struct connection;
313 struct government;
314 struct impr_type;
315 struct nation_type;
316 struct output_type;
317 struct player;
318 struct specialist;
319 struct terrain;
320 struct tile;
321 struct unit;
322 struct achievement;
323 struct action;
324 
325 // Changing these will break network compatibility.
326 #define SP_MAX 20
327 #define MAX_NUM_REQS 20
328 
329 #define MAX_NUM_RULESETS 63 // Used in the network protocol.
330 #define MAX_RULESET_NAME_LENGTH 64 // Used in the network protocol.
331 #define RULESET_SUFFIX ".serv"
332 
333 // Unit Class List, also 32-bit vector?
334 #define UCL_LAST 32 // Used in the network protocol.
335 typedef int Unit_Class_id;
336 
337 /* The direction8 gives the 8 possible directions. These may be used in
338  * a number of ways, for instance as an index into the DIR_DX/DIR_DY
339  * arrays. Not all directions may be valid; see is_valid_dir and
340  * is_cardinal_dir. */
341 
342 /* The DIR8/direction8 naming system is used to avoid conflict with
343  * DIR4/direction4 in client/tilespec.h
344  *
345  * Changing the order of the directions will break network compatability.
346  *
347  * Some code assumes that the first 4 directions are the reverses of the
348  * last 4 (in no particular order). See client/goto.c and
349  * map.c:opposite_direction(). */
350 
351 // Used in the network protocol.
352 #define SPECENUM_NAME direction8
353 #define SPECENUM_VALUE0 DIR8_NORTHWEST
354 #define SPECENUM_VALUE0NAME "Northwest"
355 #define SPECENUM_VALUE1 DIR8_NORTH
356 #define SPECENUM_VALUE1NAME "North"
357 #define SPECENUM_VALUE2 DIR8_NORTHEAST
358 #define SPECENUM_VALUE2NAME "Northeast"
359 #define SPECENUM_VALUE3 DIR8_WEST
360 #define SPECENUM_VALUE3NAME "West"
361 #define SPECENUM_VALUE4 DIR8_EAST
362 #define SPECENUM_VALUE4NAME "East"
363 #define SPECENUM_VALUE5 DIR8_SOUTHWEST
364 #define SPECENUM_VALUE5NAME "Southwest"
365 #define SPECENUM_VALUE6 DIR8_SOUTH
366 #define SPECENUM_VALUE6NAME "South"
367 #define SPECENUM_VALUE7 DIR8_SOUTHEAST
368 #define SPECENUM_VALUE7NAME "Southeast"
369 #define SPECENUM_INVALID ((enum direction8)(DIR8_SOUTHEAST + 1))
370 #include "specenum_gen.h"
371 
372 /* No direction. Understood as the origin tile that a direction would have
373  * been relative to. */
374 #define DIR8_ORIGIN direction8_invalid()
375 
376 // Used in the network protocol.
377 #define SPECENUM_NAME free_tech_method
378 #define SPECENUM_VALUE0 FTM_GOAL
379 #define SPECENUM_VALUE0NAME "Goal"
380 #define SPECENUM_VALUE1 FTM_RANDOM
381 #define SPECENUM_VALUE1NAME "Random"
382 #define SPECENUM_VALUE2 FTM_CHEAPEST
383 #define SPECENUM_VALUE2NAME "Cheapest"
384 #include "specenum_gen.h"
385 
386 /* Some code requires compile time value for number of directions, and
387  * cannot use specenum function call direction8_max(). */
388 #define DIR8_MAGIC_MAX 8
389 
390 /* The victim gets a casus belli if EFT_CASUS_BELLI_* is equal to or above
391  * CASUS_BELLI_VICTIM. To change this value you must update the
392  * documentation of each Casus_Belli_* effect in
393  * doc/README.effects, update existing rulesets and add ruleset
394  * compatibility code to server/rscompat.c. */
395 #define CASUS_BELLI_VICTIM 1
396 /* International outrage: Everyone gets a casus belli if EFT_CASUS_BELLI_*
397  * is equal to or above CASUS_BELLI_OUTRAGE. To change this value you must
398  * update the documentation of each Casus_Belli_* effect in
399  * doc/README.effects, update existing rulesets and add ruleset
400  * compatibility code to server/rscompat.c. */
401 #define CASUS_BELLI_OUTRAGE 1000
402 
403 // Used in the network protocol.
404 /* server/commands.c must match these */
405 #define SPECENUM_NAME ai_level
406 #define SPECENUM_VALUE0 AI_LEVEL_AWAY
407 #define SPECENUM_VALUE0NAME N_("Away")
408 #define SPECENUM_VALUE1 AI_LEVEL_HANDICAPPED
409 #define SPECENUM_VALUE1NAME N_("Handicapped")
410 #define SPECENUM_VALUE2 AI_LEVEL_NOVICE
411 #define SPECENUM_VALUE2NAME N_("Novice")
412 #define SPECENUM_VALUE3 AI_LEVEL_EASY
413 #define SPECENUM_VALUE3NAME N_("Easy")
414 #define SPECENUM_VALUE4 AI_LEVEL_NORMAL
415 #define SPECENUM_VALUE4NAME N_("Normal")
416 #define SPECENUM_VALUE5 AI_LEVEL_HARD
417 #define SPECENUM_VALUE5NAME N_("Hard")
418 #define SPECENUM_VALUE6 AI_LEVEL_CHEATING
419 #define SPECENUM_VALUE6NAME N_("Cheating")
420 
421 #ifdef FREECIV_DEBUG
422 #define SPECENUM_VALUE7 AI_LEVEL_EXPERIMENTAL
423 #define SPECENUM_VALUE7NAME N_("Experimental")
424 #endif // FREECIV_DEBUG
425 
426 #define SPECENUM_COUNT AI_LEVEL_COUNT
427 #include "specenum_gen.h"
428 
429 // pplayer->ai.barbarian_type and nations use this enum.
430 #define SPECENUM_NAME barbarian_type
431 #define SPECENUM_VALUE0 NOT_A_BARBARIAN
432 #define SPECENUM_VALUE0NAME "None"
433 #define SPECENUM_VALUE1 LAND_BARBARIAN
434 #define SPECENUM_VALUE1NAME "Land"
435 #define SPECENUM_VALUE2 SEA_BARBARIAN
436 #define SPECENUM_VALUE2NAME "Sea"
437 #define SPECENUM_VALUE3 ANIMAL_BARBARIAN
438 #define SPECENUM_VALUE3NAME "Animal"
439 #define SPECENUM_VALUE4 LAND_AND_SEA_BARBARIAN
440 #define SPECENUM_VALUE4NAME "LandAndSea"
441 #include "specenum_gen.h"
442 
443 /*
444  * CityTile requirement types.
445  *
446  * Used in the network protocol
447  */
448 #define SPECENUM_NAME citytile_type
449 #define SPECENUM_VALUE0 CITYT_CENTER
450 #define SPECENUM_VALUE0NAME "Center"
451 #define SPECENUM_VALUE1 CITYT_CLAIMED
452 #define SPECENUM_VALUE1NAME "Claimed"
453 #define SPECENUM_COUNT CITYT_LAST
454 #include "specenum_gen.h"
455 
456 /*
457  * CityStatus requirement types.
458  *
459  * Used in the network protocol
460  */
461 #define SPECENUM_NAME citystatus_type
462 #define SPECENUM_VALUE0 CITYS_OWNED_BY_ORIGINAL
463 #define SPECENUM_VALUE0NAME "OwnedByOriginal"
464 #define SPECENUM_COUNT CITYS_LAST
465 #include "specenum_gen.h"
466 
467 /*
468  * UnitState requirement property types.
469  *
470  * Used in the network protocol.
471  */
472 #define SPECENUM_NAME ustate_prop
473 #define SPECENUM_VALUE0 USP_TRANSPORTED
474 #define SPECENUM_VALUE0NAME "Transported"
475 #define SPECENUM_VALUE1 USP_LIVABLE_TILE
476 #define SPECENUM_VALUE1NAME "OnLivableTile"
477 #define SPECENUM_VALUE2 USP_DOMESTIC_TILE
478 #define SPECENUM_VALUE2NAME "OnDomesticTile"
479 #define SPECENUM_VALUE3 USP_TRANSPORTING
480 #define SPECENUM_VALUE3NAME "Transporting"
481 #define SPECENUM_VALUE4 USP_HAS_HOME_CITY
482 #define SPECENUM_VALUE4NAME "HasHomeCity"
483 #define SPECENUM_VALUE5 USP_NATIVE_TILE
484 #define SPECENUM_VALUE5NAME "OnNativeTile"
485 #define SPECENUM_VALUE6 USP_NATIVE_EXTRA
486 #define SPECENUM_VALUE6NAME "InNativeExtra"
487 #define SPECENUM_VALUE7 USP_MOVED_THIS_TURN
488 #define SPECENUM_VALUE7NAME "MovedThisTurn"
489 #define SPECENUM_COUNT USP_COUNT
490 #include "specenum_gen.h"
491 
492 /* Changing these values will break map_init_topology.
493  * Changing the names will break file format compatibility. */
494 #define SPECENUM_NAME topo_flag
495 #define SPECENUM_BITWISE
496 #define SPECENUM_VALUE0 TF_WRAPX
497 #define SPECENUM_VALUE0NAME N_("WrapX")
498 #define SPECENUM_VALUE1 TF_WRAPY
499 #define SPECENUM_VALUE1NAME N_("WrapY")
500 #define SPECENUM_VALUE2 TF_ISO
501 #define SPECENUM_VALUE2NAME N_("ISO")
502 #define SPECENUM_VALUE3 TF_HEX
503 #define SPECENUM_VALUE3NAME N_("Hex")
504 #define TOPO_FLAG_BITS 4
505 #include "specenum_gen.h"
506 
507 // Used in the network protocol.
508 #define SPECENUM_NAME impr_genus_id
509 #define SPECENUM_VALUE0 IG_GREAT_WONDER
510 #define SPECENUM_VALUE0NAME "GreatWonder"
511 #define SPECENUM_VALUE1 IG_SMALL_WONDER
512 #define SPECENUM_VALUE1NAME "SmallWonder"
513 #define SPECENUM_VALUE2 IG_IMPROVEMENT
514 #define SPECENUM_VALUE2NAME "Improvement"
515 #define SPECENUM_VALUE3 IG_SPECIAL
516 #define SPECENUM_VALUE3NAME "Special"
517 #define SPECENUM_COUNT IG_COUNT
518 #include "specenum_gen.h"
519 
520 // Used in the network protocol.
521 #define SPECENUM_NAME vision_layer
522 #define SPECENUM_VALUE0 V_MAIN
523 #define SPECENUM_VALUE0NAME N_("Main")
524 #define SPECENUM_VALUE1 V_INVIS
525 #define SPECENUM_VALUE1NAME N_("Stealth")
526 #define SPECENUM_VALUE2 V_SUBSURFACE
527 #define SPECENUM_VALUE2NAME N_("Subsurface")
528 #define SPECENUM_COUNT V_COUNT
529 #include "specenum_gen.h"
530 
531 // Used in the network protocol.
532 #define SPECENUM_NAME national_intelligence
533 #define SPECENUM_VALUE0 NI_MULTIPLIERS
534 #define SPECENUM_VALUE0NAME N_("Multipliers")
535 #define SPECENUM_VALUE1 NI_WONDERS
536 #define SPECENUM_VALUE1NAME N_("Wonders")
537 #define SPECENUM_VALUE2 NI_SCORE
538 #define SPECENUM_VALUE2NAME N_("Score")
539 #define SPECENUM_VALUE3 NI_GOLD
540 #define SPECENUM_VALUE3NAME N_("Gold")
541 #define SPECENUM_VALUE4 NI_GOVERNMENT
542 #define SPECENUM_VALUE4NAME N_("Government")
543 #define SPECENUM_VALUE5 NI_DIPLOMACY
544 #define SPECENUM_VALUE5NAME N_("Diplomacy")
545 #define SPECENUM_VALUE6 NI_TECHS
546 #define SPECENUM_VALUE6NAME N_("Techs")
547 #define SPECENUM_VALUE7 NI_TAX_RATES
548 #define SPECENUM_VALUE7NAME N_("Tax Rates")
549 #define SPECENUM_VALUE8 NI_CULTURE
550 #define SPECENUM_VALUE8NAME N_("Culture")
551 #define SPECENUM_VALUE9 NI_MOOD
552 #define SPECENUM_VALUE9NAME N_("Mood")
553 #define SPECENUM_VALUE10 NI_HISTORY
554 #define SPECENUM_VALUE10NAME N_("History")
555 #define SPECENUM_COUNT NI_COUNT
556 #include "specenum_gen.h"
557 
558 // Used in the network protocol.
559 BV_DEFINE(bv_intel_visible, NI_COUNT);
560 
561 // A server setting + its value.
562 typedef int ssetv;
563 
564 /* Sometimes we don't know (or don't care) if some requirements for effect
565  * are currently fulfilled or not. This enum tells lower level functions
566  * how to handle uncertain requirements.
567  */
568 enum req_problem_type {
569  RPT_POSSIBLE, // We want to know if it is possible that effect is active
570  RPT_CERTAIN // We want to know if it is certain that effect is active
571 };
572 
573 #define REVERSED_RPT(x) (x == RPT_CERTAIN ? RPT_POSSIBLE : RPT_CERTAIN)
574 
575 /* Originally in requirements.h, bumped up and revised to unify with
576  * city_production and worklists. Functions remain in requirements.c
577  * Used in the network protocol. */
578 typedef union {
579  struct advance *advance;
580  struct government *govern;
581  const struct impr_type *building;
582  struct nation_type *nation;
583  struct nation_type *nationality;
585  struct terrain *terrain;
586  struct unit_class *uclass;
587  const struct unit_type *utype;
588  struct extra_type *extra;
590  struct nation_group *nationgroup;
591  struct nation_style *style;
592  struct action *action;
593  struct goods_type *good;
594 
595  enum ai_level ai_level;
596  enum citytile_type citytile;
597  enum citystatus_type citystatus;
598  enum vision_layer vlayer;
599  enum national_intelligence nintel;
600  int minsize;
601  int minculture;
602  int minforeignpct;
603  int minyear;
604  int mincalfrag;
605  Output_type_id outputtype;
606  int terrainclass; // enum terrain_class
607  int terrainalter; // enum terrain_alteration
608  int unitclassflag; // enum unit_class_flag_id
609  int unitflag; // enum unit_flag_id
610  int terrainflag; // enum terrain_flag_id
611  int techflag; // enum tech_flag_id
612  int baseflag; // enum base_flag_id
613  int roadflag; // enum road_flag_id
614  int extraflag;
615  int diplrel; /* enum diplstate_type or
616  enum diplrel_other */
617  enum ustate_prop unit_state;
618  enum unit_activity activity;
619  enum impr_genus_id impr_genus;
620  int minmoves;
621  int max_tile_units;
622  int minveteran;
623  int min_hit_points;
624  int age;
625  int min_techs;
626 
627  enum topo_flag topo_property;
628  ssetv ssetval;
629 } universals_u;
630 
631 /* The kind of universals_u (value_union_type was req_source_type).
632  * Used in the network protocol. */
633 #define SPECENUM_NAME universals_n
634 #define SPECENUM_VALUE0 VUT_NONE
635 #define SPECENUM_VALUE0NAME "None"
636 #define SPECENUM_VALUE1 VUT_ADVANCE
637 #define SPECENUM_VALUE1NAME "Tech"
638 #define SPECENUM_VALUE2 VUT_GOVERNMENT
639 #define SPECENUM_VALUE2NAME "Gov"
640 #define SPECENUM_VALUE3 VUT_IMPROVEMENT
641 #define SPECENUM_VALUE3NAME "Building"
642 #define SPECENUM_VALUE4 VUT_TERRAIN
643 #define SPECENUM_VALUE4NAME "Terrain"
644 #define SPECENUM_VALUE5 VUT_NATION
645 #define SPECENUM_VALUE5NAME "Nation"
646 #define SPECENUM_VALUE6 VUT_UTYPE
647 #define SPECENUM_VALUE6NAME "UnitType"
648 #define SPECENUM_VALUE7 VUT_UTFLAG
649 #define SPECENUM_VALUE7NAME "UnitFlag"
650 #define SPECENUM_VALUE8 VUT_UCLASS
651 #define SPECENUM_VALUE8NAME "UnitClass"
652 #define SPECENUM_VALUE9 VUT_UCFLAG
653 #define SPECENUM_VALUE9NAME "UnitClassFlag"
654 #define SPECENUM_VALUE10 VUT_OTYPE
655 #define SPECENUM_VALUE10NAME "OutputType"
656 #define SPECENUM_VALUE11 VUT_SPECIALIST
657 #define SPECENUM_VALUE11NAME "Specialist"
658 // Minimum size: at city range means city size
659 #define SPECENUM_VALUE12 VUT_MINSIZE
660 #define SPECENUM_VALUE12NAME "MinSize"
661 // AI level of the player
662 #define SPECENUM_VALUE13 VUT_AI_LEVEL
663 #define SPECENUM_VALUE13NAME "AI"
664 // More generic terrain type currently "Land" or "Ocean"
665 #define SPECENUM_VALUE14 VUT_TERRAINCLASS
666 #define SPECENUM_VALUE14NAME "TerrainClass"
667 #define SPECENUM_VALUE15 VUT_MINYEAR
668 #define SPECENUM_VALUE15NAME "MinYear"
669 // Terrain alterations that are possible
670 #define SPECENUM_VALUE16 VUT_TERRAINALTER
671 #define SPECENUM_VALUE16NAME "TerrainAlter"
672 // Target tile is used by city.
673 #define SPECENUM_VALUE17 VUT_CITYTILE
674 #define SPECENUM_VALUE17NAME "CityTile"
675 #define SPECENUM_VALUE18 VUT_GOOD
676 #define SPECENUM_VALUE18NAME "Good"
677 #define SPECENUM_VALUE19 VUT_TERRFLAG
678 #define SPECENUM_VALUE19NAME "TerrainFlag"
679 #define SPECENUM_VALUE20 VUT_NATIONALITY
680 #define SPECENUM_VALUE20NAME "Nationality"
681 #define SPECENUM_VALUE21 VUT_BASEFLAG
682 #define SPECENUM_VALUE21NAME "BaseFlag"
683 #define SPECENUM_VALUE22 VUT_ROADFLAG
684 #define SPECENUM_VALUE22NAME "RoadFlag"
685 #define SPECENUM_VALUE23 VUT_EXTRA
686 #define SPECENUM_VALUE23NAME "Extra"
687 #define SPECENUM_VALUE24 VUT_TECHFLAG
688 #define SPECENUM_VALUE24NAME "TechFlag"
689 #define SPECENUM_VALUE25 VUT_ACHIEVEMENT
690 #define SPECENUM_VALUE25NAME "Achievement"
691 #define SPECENUM_VALUE26 VUT_DIPLREL
692 #define SPECENUM_VALUE26NAME "DiplRel"
693 #define SPECENUM_VALUE27 VUT_MAXTILEUNITS
694 #define SPECENUM_VALUE27NAME "MaxUnitsOnTile"
695 #define SPECENUM_VALUE28 VUT_STYLE
696 #define SPECENUM_VALUE28NAME "Style"
697 #define SPECENUM_VALUE29 VUT_MINCULTURE
698 #define SPECENUM_VALUE29NAME "MinCulture"
699 #define SPECENUM_VALUE30 VUT_UNITSTATE
700 #define SPECENUM_VALUE30NAME "UnitState"
701 #define SPECENUM_VALUE31 VUT_MINMOVES
702 #define SPECENUM_VALUE31NAME "MinMoveFrags"
703 #define SPECENUM_VALUE32 VUT_MINVETERAN
704 #define SPECENUM_VALUE32NAME "MinVeteran"
705 #define SPECENUM_VALUE33 VUT_MINHP
706 #define SPECENUM_VALUE33NAME "MinHitPoints"
707 #define SPECENUM_VALUE34 VUT_AGE
708 #define SPECENUM_VALUE34NAME "Age"
709 #define SPECENUM_VALUE35 VUT_NATIONGROUP
710 #define SPECENUM_VALUE35NAME "NationGroup"
711 #define SPECENUM_VALUE36 VUT_TOPO
712 #define SPECENUM_VALUE36NAME "Topology"
713 #define SPECENUM_VALUE37 VUT_IMPR_GENUS
714 #define SPECENUM_VALUE37NAME "BuildingGenus"
715 #define SPECENUM_VALUE38 VUT_ACTION
716 #define SPECENUM_VALUE38NAME "Action"
717 #define SPECENUM_VALUE39 VUT_MINTECHS
718 #define SPECENUM_VALUE39NAME "MinTechs"
719 #define SPECENUM_VALUE40 VUT_EXTRAFLAG
720 #define SPECENUM_VALUE40NAME "ExtraFlag"
721 #define SPECENUM_VALUE41 VUT_MINCALFRAG
722 #define SPECENUM_VALUE41NAME "MinCalFrag"
723 #define SPECENUM_VALUE42 VUT_SERVERSETTING
724 #define SPECENUM_VALUE42NAME "ServerSetting"
725 #define SPECENUM_VALUE43 VUT_CITYSTATUS
726 #define SPECENUM_VALUE43NAME "CityStatus"
727 #define SPECENUM_VALUE44 VUT_MINFOREIGNPCT
728 #define SPECENUM_VALUE44NAME "MinForeignPct"
729 #define SPECENUM_VALUE45 VUT_ACTIVITY
730 #define SPECENUM_VALUE45NAME "Activity"
731 #define SPECENUM_VALUE46 VUT_VISIONLAYER
732 #define SPECENUM_VALUE46NAME "VisionLayer"
733 #define SPECENUM_VALUE47 VUT_NINTEL
734 #define SPECENUM_VALUE47NAME "NationalIntelligence"
735 // Keep this last.
736 #define SPECENUM_COUNT VUT_COUNT
737 #include "specenum_gen.h"
738 
739 // Used in the network protocol.
740 struct universal {
742  enum universals_n kind; // formerly .type and .is_unit
743 };
744 
745 // Used in the network protocol.
749 BV_DEFINE(bv_roads, MAX_ROAD_TYPES);
750 BV_DEFINE(bv_startpos_nations, MAX_NUM_STARTPOS_NATIONS);
751 
752 // Used in the network protocol.
753 #define SPECENUM_NAME airlifting_style
754 #define SPECENUM_BITWISE
755 // Like classical Freeciv. One unit per turn.
756 #define SPECENUM_ZERO AIRLIFTING_CLASSICAL
757 // Allow airlifting from allied cities.
758 #define SPECENUM_VALUE0 AIRLIFTING_ALLIED_SRC
759 // Allow airlifting to allied cities.
760 #define SPECENUM_VALUE1 AIRLIFTING_ALLIED_DEST
761 /* Unlimited units to airlift from the source (but always needs an Airport
762  * or equivalent). */
763 #define SPECENUM_VALUE2 AIRLIFTING_UNLIMITED_SRC
764 /* Unlimited units to airlift to the destination (doesn't require any
765  * Airport or equivalent). */
766 #define SPECENUM_VALUE3 AIRLIFTING_UNLIMITED_DEST
767 #include "specenum_gen.h"
768 
769 // Used in the network protocol.
770 #define SPECENUM_NAME caravan_bonus_style
771 #define SPECENUM_VALUE0 CBS_CLASSIC
772 #define SPECENUM_VALUE0NAME "Classic"
773 #define SPECENUM_VALUE1 CBS_LOGARITHMIC
774 #define SPECENUM_VALUE1NAME "Logarithmic"
775 #define SPECENUM_VALUE2 CBS_LINEAR
776 #define SPECENUM_VALUE2NAME "Linear"
777 #define SPECENUM_VALUE3 CBS_DISTANCE
778 #define SPECENUM_VALUE3NAME "Distance"
779 #include "specenum_gen.h"
780 
781 // Used in the network protocol.
782 #define SPECENUM_NAME persistent_ready
783 #define SPECENUM_VALUE0 PERSISTENTR_DISABLED
784 #define SPECENUM_VALUE0NAME "Disabled"
785 #define SPECENUM_VALUE1 PERSISTENTR_CONNECTED
786 #define SPECENUM_VALUE1NAME "Connected"
787 #include "specenum_gen.h"
788 
789 #define SPECENUM_NAME reveal_map
790 #define SPECENUM_BITWISE
791 // Reveal only the area around the first units at the beginning.
792 #define SPECENUM_ZERO REVEAL_MAP_NONE
793 // Reveal the (fogged) map at the beginning of the game.
794 #define SPECENUM_VALUE0 REVEAL_MAP_START
795 // Reveal (and unfog) the map for dead players.
796 #define SPECENUM_VALUE1 REVEAL_MAP_DEAD
797 #include "specenum_gen.h"
798 
799 // Used in the network protocol.
800 #define SPECENUM_NAME unitwaittime_style
801 #define SPECENUM_BITWISE
802 // Unit wait time only prevents moving.
803 #define SPECENUM_ZERO UWT_CLASSICAL
804 #define SPECENUM_ZERONAME "Classical"
805 // Wait time applies to activities such as building roads and fortresses.
806 #define SPECENUM_VALUE0 UWT_ACTIVITIES
807 #define SPECENUM_VALUE0NAME "Activities"
808 #include "specenum_gen.h"
809 
810 // Used in the network protocol.
811 #define SPECENUM_NAME gameloss_style
812 #define SPECENUM_BITWISE
813 // Like classical Freeciv. No special effects.
814 #define SPECENUM_ZERO GAMELOSS_STYLE_CLASSICAL
815 // Remaining cities are taken by barbarians.
816 #define SPECENUM_VALUE0 GAMELOSS_STYLE_BARB
817 #define SPECENUM_VALUE0NAME "Barbarians"
818 // Try civil war.
819 #define SPECENUM_VALUE1 GAMELOSS_STYLE_CWAR
820 #define SPECENUM_VALUE1NAME "CivilWar"
821 // Do some looting
822 #define SPECENUM_VALUE2 GAMELOSS_STYLE_LOOT
823 #define SPECENUM_VALUE2NAME "Loot"
824 #include "specenum_gen.h"
825 
826 // Used in the network protocol.
827 #define SPECENUM_NAME tech_upkeep_style
828 // No upkeep
829 #define SPECENUM_VALUE0 TECH_UPKEEP_NONE
830 #define SPECENUM_VALUE0NAME "None"
831 // Normal tech upkeep
832 #define SPECENUM_VALUE1 TECH_UPKEEP_BASIC
833 #define SPECENUM_VALUE1NAME "Basic"
834 // Tech upkeep multiplied by number of cities
835 #define SPECENUM_VALUE2 TECH_UPKEEP_PER_CITY
836 #define SPECENUM_VALUE2NAME "Cities"
837 #include "specenum_gen.h"
838 
839 // Used in the network protocol.
840 #define SPECENUM_NAME trade_revenue_style
841 #define SPECENUM_VALUE0 TRS_CLASSIC
842 #define SPECENUM_VALUE0NAME "Classic"
843 #define SPECENUM_VALUE1 TRS_SIMPLE
844 #define SPECENUM_VALUE1NAME "Simple"
845 #include "specenum_gen.h"
846 
847 // Used in the network protocol.
848 // Numerical values used in savegames
849 #define SPECENUM_NAME phase_mode_type
850 #define SPECENUM_VALUE0 PMT_CONCURRENT
851 #define SPECENUM_VALUE0NAME "Concurrent"
852 #define SPECENUM_VALUE1 PMT_PLAYERS_ALTERNATE
853 #define SPECENUM_VALUE1NAME "Players Alternate"
854 #define SPECENUM_VALUE2 PMT_TEAMS_ALTERNATE
855 #define SPECENUM_VALUE2NAME "Teams Alternate"
856 #include "specenum_gen.h"
857 
858 // Phase mode change has changed meaning of the phase numbers
859 #define PHASE_INVALIDATED -1
860 // Phase was never known
861 #define PHASE_UNKNOWN -2
862 
863 // Used in the network protocol.
869 };
870 
871 enum trait_dist_mode { TDM_FIXED = 0, TDM_EVEN };
872 
873 // Used in the network protocol.
882 };
883 
884 // Server setting types.
885 #define SPECENUM_NAME sset_type
886 #define SPECENUM_VALUE0 SST_BOOL
887 #define SPECENUM_VALUE1 SST_INT
888 #define SPECENUM_VALUE2 SST_STRING
889 #define SPECENUM_VALUE3 SST_ENUM
890 #define SPECENUM_VALUE4 SST_BITWISE
891 #define SPECENUM_COUNT SST_COUNT
892 #include "specenum_gen.h"
893 
894 // Mark server setting id's.
895 typedef int server_setting_id;
896 
897 // Used in the network protocol.
898 #define SPECENUM_NAME extra_category
899 #define SPECENUM_VALUE0 ECAT_INFRA
900 #define SPECENUM_VALUE0NAME "Infra"
901 #define SPECENUM_VALUE1 ECAT_NATURAL
902 #define SPECENUM_VALUE1NAME "Natural"
903 #define SPECENUM_VALUE2 ECAT_NUISANCE
904 #define SPECENUM_VALUE2NAME "Nuisance"
905 #define SPECENUM_VALUE3 ECAT_BONUS
906 #define SPECENUM_VALUE3NAME "Bonus"
907 #define SPECENUM_VALUE4 ECAT_RESOURCE
908 #define SPECENUM_VALUE4NAME "Resource"
909 #define SPECENUM_COUNT ECAT_COUNT
910 #include "specenum_gen.h"
911 #define ECAT_NONE ECAT_COUNT
912 
913 // Used in the network protocol.
914 #define SPECENUM_NAME extra_cause
915 #define SPECENUM_VALUE0 EC_IRRIGATION
916 #define SPECENUM_VALUE0NAME "Irrigation"
917 #define SPECENUM_VALUE1 EC_MINE
918 #define SPECENUM_VALUE1NAME "Mine"
919 #define SPECENUM_VALUE2 EC_ROAD
920 #define SPECENUM_VALUE2NAME "Road"
921 #define SPECENUM_VALUE3 EC_BASE
922 #define SPECENUM_VALUE3NAME "Base"
923 #define SPECENUM_VALUE4 EC_POLLUTION
924 #define SPECENUM_VALUE4NAME "Pollution"
925 #define SPECENUM_VALUE5 EC_FALLOUT
926 #define SPECENUM_VALUE5NAME "Fallout"
927 #define SPECENUM_VALUE6 EC_HUT
928 #define SPECENUM_VALUE6NAME "Hut"
929 #define SPECENUM_VALUE7 EC_APPEARANCE
930 #define SPECENUM_VALUE7NAME "Appear"
931 #define SPECENUM_VALUE8 EC_RESOURCE
932 #define SPECENUM_VALUE8NAME "Resource"
933 #define SPECENUM_COUNT EC_COUNT
934 #define SPECENUM_BITVECTOR bv_causes
935 #include "specenum_gen.h"
936 #define EC_NONE EC_COUNT
937 #define EC_SPECIAL ((enum extra_cause)(EC_NONE + 1))
938 #define EC_DEFENSIVE ((enum extra_cause)(EC_NONE + 2))
939 #define EC_NATURAL_DEFENSIVE ((enum extra_cause)(EC_NONE + 3))
940 #define EC_LAST ((enum extra_cause)(EC_NONE + 4))
941 
942 // struct extra_type reserve 16 bits (0-15) for these.
943 FC_STATIC_ASSERT(EC_COUNT < 16, extra_causes_over_limit);
944 
945 // Used in the network protocol.
946 #define SPECENUM_NAME extra_rmcause
947 #define SPECENUM_VALUE0 ERM_PILLAGE
948 #define SPECENUM_VALUE0NAME "Pillage"
949 #define SPECENUM_VALUE1 ERM_CLEANPOLLUTION
950 #define SPECENUM_VALUE1NAME "CleanPollution"
951 #define SPECENUM_VALUE2 ERM_CLEANFALLOUT
952 #define SPECENUM_VALUE2NAME "CleanFallout"
953 #define SPECENUM_VALUE3 ERM_DISAPPEARANCE
954 #define SPECENUM_VALUE3NAME "Disappear"
955 #define SPECENUM_VALUE4 ERM_ENTER
956 #define SPECENUM_VALUE4NAME "Enter"
957 #define SPECENUM_COUNT ERM_COUNT
958 #define SPECENUM_BITVECTOR bv_rmcauses
959 #include "specenum_gen.h"
960 #define ERM_NONE ERM_COUNT
961 
962 // struct extra_type reserve 8 bits (0-7) for these.
963 FC_STATIC_ASSERT(ERM_COUNT < 8, extra_rmcauses_over_limit);
964 
965 #define SPECENUM_NAME extra_unit_seen_type
966 #define SPECENUM_VALUE0 EUS_NORMAL
967 #define SPECENUM_VALUE0NAME "Normal"
968 #define SPECENUM_VALUE1 EUS_HIDDEN
969 #define SPECENUM_VALUE1NAME "Hidden"
970 #include "specenum_gen.h"
971 
972 // Used in the network protocol.
973 #define SPECENUM_NAME achievement_type
974 #define SPECENUM_VALUE0 ACHIEVEMENT_SPACESHIP
975 #define SPECENUM_VALUE0NAME "Spaceship"
976 #define SPECENUM_VALUE1 ACHIEVEMENT_MAP
977 #define SPECENUM_VALUE1NAME "Map_Known"
978 #define SPECENUM_VALUE2 ACHIEVEMENT_MULTICULTURAL
979 #define SPECENUM_VALUE2NAME "Multicultural"
980 #define SPECENUM_VALUE3 ACHIEVEMENT_CULTURED_CITY
981 #define SPECENUM_VALUE3NAME "Cultured_City"
982 #define SPECENUM_VALUE4 ACHIEVEMENT_CULTURED_NATION
983 #define SPECENUM_VALUE4NAME "Cultured_Nation"
984 #define SPECENUM_VALUE5 ACHIEVEMENT_LUCKY
985 #define SPECENUM_VALUE5NAME "Lucky"
986 #define SPECENUM_VALUE6 ACHIEVEMENT_HUTS
987 #define SPECENUM_VALUE6NAME "Huts"
988 #define SPECENUM_VALUE7 ACHIEVEMENT_METROPOLIS
989 #define SPECENUM_VALUE7NAME "Metropolis"
990 #define SPECENUM_VALUE8 ACHIEVEMENT_LITERATE
991 #define SPECENUM_VALUE8NAME "Literate"
992 #define SPECENUM_VALUE9 ACHIEVEMENT_LAND_AHOY
993 #define SPECENUM_VALUE9NAME "Land_Ahoy"
994 #define SPECENUM_COUNT ACHIEVEMENT_COUNT
995 #include "specenum_gen.h"
996 
997 // Used in the network protocol.
998 #define SPECENUM_NAME mood_type
999 #define SPECENUM_VALUE0 MOOD_PEACEFUL
1000 #define SPECENUM_VALUE0NAME "Peaceful"
1001 #define SPECENUM_VALUE1 MOOD_COMBAT
1002 #define SPECENUM_VALUE1NAME "Combat"
1003 #define SPECENUM_COUNT MOOD_COUNT
1004 #include "specenum_gen.h"
1005 
1006 // Used in the network protocol.
1007 #define SPECENUM_NAME action_decision
1008 // Doesn't need the player to decide what action to take.
1009 #define SPECENUM_VALUE0 ACT_DEC_NOTHING
1010 #define SPECENUM_VALUE0NAME N_("nothing")
1011 // Wants a decision because of something done to the actor.
1012 #define SPECENUM_VALUE1 ACT_DEC_PASSIVE
1013 #define SPECENUM_VALUE1NAME N_("passive")
1014 // Wants a decision because of something the actor did.
1015 #define SPECENUM_VALUE2 ACT_DEC_ACTIVE
1016 #define SPECENUM_VALUE2NAME N_("active")
1017 #define SPECENUM_COUNT ACT_DEC_COUNT
1018 #include "specenum_gen.h"
1019 
1020 /*
1021  * Action probability
1022  *
1023  * An action probability is the probability that an action will be
1024  * successful under the given circumstances. It is an interval that
1025  * includes the end points. An end point goes from 0% to 100%.
1026  * Alternatively it can signal a special case.
1027  *
1028  * End point values from 0 up to and including 200 should be understood as
1029  * the chance of success measured in half percentage points. In other words:
1030  * The value 3 indicates that the chance is 1.5%. The value 10 indicates
1031  * that the chance is 5%. The probability of a minimum may be rounded down
1032  * to the nearest half percentage point. The probability of a maximum may
1033  * be rounded up to the nearest half percentage point.
1034  *
1035  * Values with a higher minimum than maximum are special case values. All
1036  * special cases should be declared and documented below. An undocumented
1037  * value in this range should be considered a bug. If a special value for
1038  * internal use is needed please avoid the range from and including 0 up
1039  * to and including 255.
1040  *
1041  * [0, 0] ACTPROB_IMPOSSIBLE is another way of saying that the
1042  * probability is 0%. It isn't really a special value since it
1043  * is in range.
1044  *
1045  * [200, 200] ACTPROB_CERTAIN is another way of saying that the probability
1046  * is 100%. It isn't really a special value since it is in range.
1047  *
1048  * [253, 0] ACTPROB_NA indicates that no probability should exist.
1049  *
1050  * [254, 0] ACTPROB_NOT_IMPLEMENTED indicates that support for finding
1051  * this probability currently is missing.
1052  *
1053  * [0, 200] ACTPROB_NOT_KNOWN indicates that the player don't know enough
1054  * to find out. It is caused by the probability depending on a
1055  * rule that depends on game state the player don't have access
1056  * to. It may be possible for the player to later gain access to
1057  * this game state. It isn't really a special value since it is
1058  * in range.
1059  */
1060 struct act_prob {
1061  int min;
1062  int max;
1063 };
1064 
1066 
1067 /* Road type compatibility with old specials based roads.
1068  * Used in the network protocol. */
1070 
1071 /*
1072  * Maximum number of trade routes a city can have in any situation.
1073  * Changing this changes network protocol.
1074  */
1075 #define MAX_TRADE_ROUTES 5
1076 
1077 // Used in the network protocol.
1078 #define SPECENUM_NAME goods_selection_method
1079 #define SPECENUM_VALUE0 GSM_LEAVING
1080 #define SPECENUM_VALUE0NAME "Leaving"
1081 #define SPECENUM_VALUE1 GSM_ARRIVAL
1082 #define SPECENUM_VALUE1NAME "Arrival"
1083 #include "specenum_gen.h"
1084 
1086 
1094 };
1095 
1098 // Used in network protocol.
1106 };
1107 
1108 // Used in the network protocol.
1109 #define SPECENUM_NAME tech_cost_style
1110 #define SPECENUM_VALUE0 TECH_COST_CIV1CIV2
1111 #define SPECENUM_VALUE0NAME "Civ I|II"
1112 #define SPECENUM_VALUE1 TECH_COST_CLASSIC
1113 #define SPECENUM_VALUE1NAME "Classic"
1114 #define SPECENUM_VALUE2 TECH_COST_CLASSIC_PRESET
1115 #define SPECENUM_VALUE2NAME "Classic+"
1116 #define SPECENUM_VALUE3 TECH_COST_EXPERIMENTAL
1117 #define SPECENUM_VALUE3NAME "Experimental"
1118 #define SPECENUM_VALUE4 TECH_COST_EXPERIMENTAL_PRESET
1119 #define SPECENUM_VALUE4NAME "Experimental+"
1120 #define SPECENUM_VALUE5 TECH_COST_LINEAR
1121 #define SPECENUM_VALUE5NAME "Linear"
1122 #include "specenum_gen.h"
1123 
1124 // Used in the network protocol.
1125 #define SPECENUM_NAME tech_leakage_style
1126 #define SPECENUM_VALUE0 TECH_LEAKAGE_NONE
1127 #define SPECENUM_VALUE0NAME "None"
1128 #define SPECENUM_VALUE1 TECH_LEAKAGE_EMBASSIES
1129 #define SPECENUM_VALUE1NAME "Embassies"
1130 #define SPECENUM_VALUE2 TECH_LEAKAGE_PLAYERS
1131 #define SPECENUM_VALUE2NAME "All Players"
1132 #define SPECENUM_VALUE3 TECH_LEAKAGE_NO_BARBS
1133 #define SPECENUM_VALUE3NAME "Normal Players"
1134 #include "specenum_gen.h"
1135 
1136 // Used in the network protocol.
1137 #define SPECENUM_NAME gold_upkeep_style
1138 #define SPECENUM_VALUE0 GOLD_UPKEEP_CITY
1139 #define SPECENUM_VALUE0NAME "City"
1140 #define SPECENUM_VALUE1 GOLD_UPKEEP_MIXED
1141 #define SPECENUM_VALUE1NAME "Mixed"
1142 #define SPECENUM_VALUE2 GOLD_UPKEEP_NATION
1143 #define SPECENUM_VALUE2NAME "Nation"
1144 #include "specenum_gen.h"
1146 typedef float adv_want;
1147 #define ADV_WANT_PRINTF "%f"
1153 };
1155 // Used in the network protocol.
1156 #define SPECENUM_NAME capital_type
1157 #define SPECENUM_VALUE0 CAPITAL_NOT
1158 #define SPECENUM_VALUE0NAME "Not"
1159 #define SPECENUM_VALUE1 CAPITAL_SECONDARY
1160 #define SPECENUM_VALUE1NAME "Secondary"
1161 #define SPECENUM_VALUE2 CAPITAL_PRIMARY
1162 #define SPECENUM_VALUE2NAME "Primary"
1163 #include "specenum_gen.h"
int Road_type_id
Definition: fc_types.h:301
trait_dist_mode
Definition: fc_types.h:869
@ TDM_FIXED
Definition: fc_types.h:869
@ TDM_EVEN
Definition: fc_types.h:869
enum unit_activity Activity_type_id
Definition: fc_types.h:296
#define MAX_BASE_TYPES
Definition: fc_types.h:43
float adv_want
Definition: fc_types.h:1144
road_compat
Definition: fc_types.h:1067
@ ROCO_RAILROAD
Definition: fc_types.h:1067
@ ROCO_NONE
Definition: fc_types.h:1067
@ ROCO_RIVER
Definition: fc_types.h:1067
@ ROCO_ROAD
Definition: fc_types.h:1067
BV_DEFINE(bv_player, MAX_NUM_PLAYER_SLOTS)
int Goods_type_id
Definition: fc_types.h:304
#define MAX_ROAD_TYPES
Definition: fc_types.h:44
diplomacy_mode
Definition: fc_types.h:872
@ DIPLO_NO_MIXED
Definition: fc_types.h:877
@ DIPLO_FOR_TEAMS
Definition: fc_types.h:878
@ DIPLO_NO_AIS
Definition: fc_types.h:876
@ DIPLO_FOR_HUMANS
Definition: fc_types.h:874
@ DIPLO_FOR_ALL
Definition: fc_types.h:873
@ DIPLO_FOR_AIS
Definition: fc_types.h:875
@ DIPLO_DISABLED
Definition: fc_types.h:879
environment_upset_type
Definition: fc_types.h:1085
@ EUT_NUCLEAR_WINTER
Definition: fc_types.h:1085
@ EUT_GLOBAL_WARMING
Definition: fc_types.h:1085
int server_setting_id
Definition: fc_types.h:893
int Tech_type_id
Definition: fc_types.h:294
setting_default_level
Definition: fc_types.h:1147
@ SETDEF_RULESET
Definition: fc_types.h:1149
@ SETDEF_INTERNAL
Definition: fc_types.h:1148
@ SETDEF_CHANGED
Definition: fc_types.h:1150
unsigned char citizens
Definition: fc_types.h:305
int Impr_type_id
Definition: fc_types.h:293
int ssetv
Definition: fc_types.h:560
req_problem_type
Definition: fc_types.h:566
@ RPT_CERTAIN
Definition: fc_types.h:568
@ RPT_POSSIBLE
Definition: fc_types.h:567
revolen_type
Definition: fc_types.h:1087
@ REVOLEN_RANDOM
Definition: fc_types.h:1089
@ REVOLEN_RANDQUICK
Definition: fc_types.h:1091
@ REVOLEN_FIXED
Definition: fc_types.h:1088
@ REVOLEN_QUICKENING
Definition: fc_types.h:1090
adv_unit_task
Definition: fc_types.h:287
@ AUT_BUILD_CITY
Definition: fc_types.h:287
@ AUT_NONE
Definition: fc_types.h:287
@ AUT_AUTO_SETTLER
Definition: fc_types.h:287
int Unit_Class_id
Definition: fc_types.h:333
int Nation_type_id
Definition: fc_types.h:297
int Terrain_type_id
Definition: fc_types.h:290
int action_id
Definition: fc_types.h:306
int Specialist_type_id
Definition: fc_types.h:292
int Government_type_id
Definition: fc_types.h:298
test_result
Definition: fc_types.h:1063
@ TR_ALREADY_SOLD
Definition: fc_types.h:1063
@ TR_OTHER_FAILURE
Definition: fc_types.h:1063
@ TR_SUCCESS
Definition: fc_types.h:1063
#define MAX_NUM_PLAYER_SLOTS
Definition: fc_types.h:24
happyborders_type
Definition: fc_types.h:1094
@ HB_ALLIANCE
Definition: fc_types.h:1094
@ HB_DISABLED
Definition: fc_types.h:1094
@ HB_NATIONAL
Definition: fc_types.h:1094
FC_STATIC_ASSERT(EC_COUNT< 16, extra_causes_over_limit)
int Resource_type_id
Definition: fc_types.h:291
#define MAX_EXTRA_TYPES
Definition: fc_types.h:42
#define MAX_NUM_STARTPOS_NATIONS
Definition: fc_types.h:56
spaceship_place_type
Definition: fc_types.h:1097
@ SSHIP_PLACE_PROPULSION
Definition: fc_types.h:1100
@ SSHIP_PLACE_STRUCTURAL
Definition: fc_types.h:1098
@ SSHIP_PLACE_LIFE_SUPPORT
Definition: fc_types.h:1102
@ SSHIP_PLACE_SOLAR_PANELS
Definition: fc_types.h:1103
@ SSHIP_PLACE_FUEL
Definition: fc_types.h:1099
@ SSHIP_PLACE_HABITATION
Definition: fc_types.h:1101
int Unit_type_id
Definition: fc_types.h:299
victory_condition_type
Definition: fc_types.h:1083
@ VC_SPACERACE
Definition: fc_types.h:1083
@ VC_CULTURE
Definition: fc_types.h:1083
@ VC_ALLIED
Definition: fc_types.h:1083
int Disaster_type_id
Definition: fc_types.h:302
output_type_id
Definition: fc_types.h:84
@ O_SHIELD
Definition: fc_types.h:86
@ O_FOOD
Definition: fc_types.h:85
@ O_TRADE
Definition: fc_types.h:87
@ O_SCIENCE
Definition: fc_types.h:90
@ O_LUXURY
Definition: fc_types.h:89
@ O_GOLD
Definition: fc_types.h:88
@ O_LAST
Definition: fc_types.h:91
signed short Continent_id
Definition: fc_types.h:289
borders_mode
Definition: fc_types.h:862
@ BORDERS_ENABLED
Definition: fc_types.h:864
@ BORDERS_DISABLED
Definition: fc_types.h:863
@ BORDERS_SEE_INSIDE
Definition: fc_types.h:865
@ BORDERS_EXPAND
Definition: fc_types.h:866
int Base_type_id
Definition: fc_types.h:300
int Multiplier_type_id
Definition: fc_types.h:303
enum output_type_id Output_type_id
Definition: fc_types.h:295
override_bool
Definition: fc_types.h:78
@ OVERRIDE_TRUE
Definition: fc_types.h:78
@ NO_OVERRIDE
Definition: fc_types.h:78
@ OVERRIDE_FALSE
Definition: fc_types.h:78
int max
Definition: fc_types.h:1060
int min
Definition: fc_types.h:1059
Definition: tech.h:113
Definition: city.h:291
Definition: player.h:231
Definition: tile.h:42
Definition: unit.h:134
enum universals_n kind
Definition: fc_types.h:740
universals_u value
Definition: fc_types.h:739