60
51
struct packet_game_info info;
61
struct government *government_when_anarchy;
52
struct government *government_during_revolution;
63
54
struct packet_ruleset_control control;
65
char id[MAX_ID_LEN]; /* server only */
66
int timeoutint; /* increase timeout every N turns... */
67
int timeoutinc; /* ... by this amount ... */
68
int timeoutincmult; /* ... and multiply timeoutinc by this amount ... */
69
int timeoutintinc; /* ... and increase timeoutint by this amount */
70
int timeoutcounter; /* timeoutcounter - timeoutint = turns to next inc. */
71
int timeoutaddenemymove; /* minimum timeout after an enemy move is seen */
73
struct timer *phase_timer; /* Time since seconds_to_phase_done was set. */
55
struct packet_scenario_info scenario;
75
/* The .info.simultaneous_phases value indicates the phase mode currently in
76
* use. The "stored" value is a value the player can change; it won't
77
* take effect until the next turn. */
78
bool simultaneous_phases_stored;
80
struct player *player_ptr; /* Client-only; may be NULL */
81
57
struct player players[MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS];
82
59
struct conn_list *all_connections; /* including not yet established */
83
60
struct conn_list *est_connections; /* all established client conns */
84
char save_name[MAX_LEN_NAME];
86
int scoreturn; /* next make_history_report() */
89
bool fogofwar_old; /* as the fog_of_war bit get changed by setting
90
the server we need to remember the old setting */
91
int ai_goal_government; /* kludge */
93
char rulesetdir[MAX_LEN_NAME];
95
/* values from game.info.t */
97
/* Items given to all players at game start. Server only. */
98
int global_init_techs[MAX_NUM_TECH_LIST];
99
int global_init_buildings[MAX_NUM_BUILDING_LIST];
102
char demography[MAX_LEN_DEMOGRAPHY];
103
char allow_take[MAX_LEN_ALLOW_TAKE];
105
/* used by the map editor to control game_save; could be used by the server too */
109
bool save_known; /* loading will just reveal the squares around cities and units */
110
bool save_starts; /* start positions will be auto generated */
111
bool save_private_map; /* FoW map; will be created if not saved */
114
int trireme_loss_chance[MAX_VET_LEVELS];
115
62
int work_veteran_chance[MAX_VET_LEVELS];
116
63
int veteran_chance[MAX_VET_LEVELS];
119
bool user_message_set;
120
char user_message[256];
71
bool debug[DEBUG_LAST];
72
int timeoutint; /* increase timeout every N turns... */
73
int timeoutinc; /* ... by this amount ... */
74
int timeoutincmult; /* ... and multiply timeoutinc by this amount ... */
75
int timeoutintinc; /* ... and increase timeoutint by this amount */
76
int timeoutcounter; /* timeoutcounter - timeoutint = turns to next inc. */
77
int timeoutaddenemymove; /* minimum timeout after an enemy move is seen */
79
struct timer *phase_timer; /* Time since seconds_to_phase_done was set. */
80
/* The .info.phase_mode value indicates the phase mode currently in
81
* use. The "stored" value is a value the player can change; it won't
82
* take effect until the next turn. */
83
int phase_mode_stored;
84
char connectmsg[MAX_LEN_MSG];
85
char save_name[MAX_LEN_NAME];
87
int scoreturn; /* next make_history_report() */
89
bool fogofwar_old; /* as the fog_of_war bit get changed by setting
90
* the server we need to remember the old setting */
92
char rulesetdir[MAX_LEN_NAME];
93
char demography[MAX_LEN_DEMOGRAPHY];
94
char allow_take[MAX_LEN_ALLOW_TAKE];
103
/* values from game.info.t */
105
/* Items given to all players at game start. Server only. */
106
int global_init_techs[MAX_NUM_TECH_LIST];
107
int global_init_buildings[MAX_NUM_BUILDING_LIST];
110
/* used by the map editor to control game_save. */
114
bool save_known; /* loading will just reveal the squares around
115
* cities and units */
116
bool save_starts; /* start positions will be auto generated */
117
bool save_private_map; /* FoW map; will be created if not saved */
121
bool user_message_set;
122
char user_message[256];
124
128
/* Function to be called in game_remove_unit when a unit is deleted. */
141
152
struct unit *game_find_unit_by_number(int id);
143
154
void game_remove_player(struct player *pplayer);
144
void game_renumber_players(int plrno);
146
156
void game_remove_unit(struct unit *punit);
147
157
void game_remove_city(struct city *pcity);
148
158
void initialize_globals(void);
150
struct player *get_player(int player_id);
151
bool is_valid_player_id(int player_id);
152
int get_num_human_and_ai_players(void);
153
160
bool is_player_phase(const struct player *pplayer, int phase);
155
162
const char *population_to_text(int thousand_citizen);
164
const char *gui_name(enum gui_type);
166
const char *textyear(int year);
157
168
extern struct civ_game game;
158
extern bool is_server;
160
170
bool setting_class_is_changeable(enum sset_class class);
176
186
#define GAME_DEFAULT_TECHLEVEL 0
177
187
#define GAME_MIN_TECHLEVEL 0
178
#define GAME_MAX_TECHLEVEL 50
180
#define GAME_DEFAULT_UNHAPPYSIZE 4
181
#define GAME_MIN_UNHAPPYSIZE 1
182
#define GAME_MAX_UNHAPPYSIZE 6
188
#define GAME_MAX_TECHLEVEL 100
184
190
#define GAME_DEFAULT_ANGRYCITIZEN TRUE
186
#define GAME_DEFAULT_END_YEAR 5000
187
#define GAME_MIN_END_YEAR GAME_START_YEAR
188
#define GAME_MAX_END_YEAR 5000
192
#define GAME_DEFAULT_END_TURN 5000
193
#define GAME_MIN_END_TURN -32768
194
#define GAME_MAX_END_TURN 32767
190
196
#define GAME_DEFAULT_MIN_PLAYERS 1
191
197
#define GAME_MIN_MIN_PLAYERS 0
269
271
#define GAME_DEFAULT_NATURALCITYNAMES TRUE
273
#define GAME_DEFAULT_MIGRATION FALSE
275
#define GAME_DEFAULT_MGR_TURNINTERVAL 5
276
#define GAME_MIN_MGR_TURNINTERVAL 1
277
#define GAME_MAX_MGR_TURNINTERVAL 100
279
#define GAME_DEFAULT_MGR_FOODNEEDED TRUE
281
#define GAME_DEFAULT_MGR_DISTANCE 3
282
#define GAME_MIN_MGR_DISTANCE 1
283
#define GAME_MAX_MGR_DISTANCE 7
285
#define GAME_DEFAULT_MGR_NATIONCHANCE 50
286
#define GAME_MIN_MGR_NATIONCHANCE 0
287
#define GAME_MAX_MGR_NATIONCHANCE 100
289
#define GAME_DEFAULT_MGR_WORLDCHANCE 10
290
#define GAME_MIN_MGR_WORLDCHANCE 0
291
#define GAME_MAX_MGR_WORLDCHANCE 100
271
293
#define GAME_DEFAULT_AQUEDUCTLOSS 0
272
294
#define GAME_MIN_AQUEDUCTLOSS 0
273
295
#define GAME_MAX_AQUEDUCTLOSS 100
275
297
#define GAME_DEFAULT_KILLCITIZEN 1
276
298
#define GAME_MIN_KILLCITIZEN 0
277
#define GAME_MAX_KILLCITIZEN 15
299
#define GAME_MAX_KILLCITIZEN ((1 << MOVETYPE_LAST) - 1)
279
301
#define GAME_DEFAULT_TECHPENALTY 100
280
302
#define GAME_MIN_TECHPENALTY 0
333
354
#define GAME_MIN_FULLTRADESIZE 1
334
355
#define GAME_MAX_FULLTRADESIZE 50
357
#define GAME_DEFAULT_TRADEMINDIST 9
358
#define GAME_MIN_TRADEMINDIST 1
359
#define GAME_MAX_TRADEMINDIST 999
336
361
#define GAME_DEFAULT_BARBARIANRATE 2
337
362
#define GAME_MIN_BARBARIANRATE 0
338
363
#define GAME_MAX_BARBARIANRATE 4
340
#define GAME_DEFAULT_ONSETBARBARIAN (GAME_START_YEAR+ \
341
((GAME_DEFAULT_END_YEAR-(GAME_START_YEAR))/3))
342
#define GAME_MIN_ONSETBARBARIAN GAME_START_YEAR
343
#define GAME_MAX_ONSETBARBARIAN GAME_MAX_END_YEAR
365
#define GAME_DEFAULT_ONSETBARBARIAN 60
366
#define GAME_MIN_ONSETBARBARIAN 0
367
#define GAME_MAX_ONSETBARBARIAN GAME_MAX_END_TURN
345
369
#define GAME_DEFAULT_OCCUPYCHANCE 0
346
370
#define GAME_MIN_OCCUPYCHANCE 0
359
385
#define GAME_DEFAULT_DEMOGRAPHY "NASRLPEMOqrb"
360
386
#define GAME_DEFAULT_ALLOW_TAKE "HAhadOo"
388
#define GAME_DEFAULT_EVENT_CACHE_TURNS 1
389
#define GAME_MIN_EVENT_CACHE_TURNS 0
390
#define GAME_MAX_EVENT_CACHE_TURNS 9
392
#define GAME_DEFAULT_EVENT_CACHE_MAX_SIZE 256
393
#define GAME_MIN_EVENT_CACHE_MAX_SIZE 10
394
#define GAME_MAX_EVENT_CACHE_MAX_SIZE 1000
396
#define GAME_DEFAULT_EVENT_CACHE_CHAT TRUE
398
#define GAME_DEFAULT_EVENT_CACHE_INFO FALSE
362
400
#define GAME_DEFAULT_COMPRESS_LEVEL 6 /* if we have compression */
363
#define GAME_MIN_COMPRESS_LEVEL 0
401
#define GAME_MIN_COMPRESS_LEVEL 1
364
402
#define GAME_MAX_COMPRESS_LEVEL 9
365
#define GAME_NO_COMPRESS_LEVEL 0
404
#if defined(HAVE_LIBBZ2)
405
# define GAME_MIN_COMPRESS_TYPE FZ_PLAIN
406
# define GAME_MAX_COMPRESS_TYPE FZ_BZIP2
407
# define GAME_DEFAULT_COMPRESS_TYPE FZ_BZIP2
408
#elif defined(HAVE_LIBZ)
409
# define GAME_MIN_COMPRESS_TYPE FZ_PLAIN
410
# define GAME_MAX_COMPRESS_TYPE FZ_ZLIB
411
# define GAME_DEFAULT_COMPRESS_TYPE FZ_ZLIB
413
# define GAME_MIN_COMPRESS_TYPE FZ_PLAIN
414
# define GAME_MAX_COMPRESS_TYPE FZ_PLAIN
415
# define GAME_DEFAULT_COMPRESS_TYPE FZ_PLAIN
367
418
#define GAME_DEFAULT_ALLOWED_CITY_NAMES 1
368
419
#define GAME_MIN_ALLOWED_CITY_NAMES 0
375
426
#define GAME_START_YEAR -4000
428
#define GAME_MAX_READ_RECURSION 10 /* max recursion for the read command */
430
/* ruleset settings */
432
#define RS_MAX_VALUE 10000
434
#define RS_DEFAULT_POS_YEAR_LABEL "AD"
435
#define RS_DEFAULT_NEG_YEAR_LABEL "BC"
437
#define RS_DEFAULT_ILLNESS_ON FALSE
439
#define RS_DEFAULT_ILLNESS_BASE_FACTOR 25
440
#define RS_MIN_ILLNESS_BASE_FACTOR 0
441
#define RS_MAX_ILLNESS_BASE_FACTOR RS_MAX_VALUE
443
#define RS_DEFAULT_ILLNESS_MIN_SIZE 3
444
#define RS_MIN_ILLNESS_MIN_SIZE 1
445
#define RS_MAX_ILLNESS_MIN_SIZE 100
447
#define RS_DEFAULT_ILLNESS_TRADE_INFECTION_PCT 50
448
#define RS_MIN_ILLNESS_TRADE_INFECTION_PCT 0
449
#define RS_MAX_ILLNESS_TRADE_INFECTION_PCT 500
451
#define RS_DEFAULT_ILLNESS_POLLUTION_PCT 50
452
#define RS_MIN_ILLNESS_POLLUTION_PCT 0
453
#define RS_MAX_ILLNESS_POLLUTION_PCT 500
455
#define RS_DEFAULT_CALENDAR_SKIP_0 TRUE
457
#define RS_DEFAULT_BORDER_RADIUS_SQ_CITY 17 /* city radius 4 */
458
#define RS_MIN_BORDER_RADIUS_SQ_CITY 0
459
#define RS_MAX_BORDER_RADIUS_SQ_CITY 401 /* city radius 20 */
461
#define RS_DEFAULT_BORDER_SIZE_EFFECT 1
462
#define RS_MIN_BORDER_SIZE_EFFECT 0
463
#define RS_MAX_BORDER_SIZE_EFFECT 100
465
#define RS_DEFAULT_INCITE_BASE_COST 1000
466
#define RS_MIN_INCITE_BASE_COST 0
467
#define RS_MAX_INCITE_BASE_COST RS_MAX_VALUE
469
#define RS_DEFAULT_INCITE_IMPROVEMENT_FCT 1
470
#define RS_MIN_INCITE_IMPROVEMENT_FCT 0
471
#define RS_MAX_INCITE_IMPROVEMENT_FCT RS_MAX_VALUE
473
#define RS_DEFAULT_INCITE_UNIT_FCT 2
474
#define RS_MIN_INCITE_UNIT_FCT 0
475
#define RS_MAX_INCITE_UNIT_FCT RS_MAX_VALUE
477
#define RS_DEFAULT_INCITE_TOTAL_FCT 100
478
#define RS_MIN_INCITE_TOTAL_FCT 0
479
#define RS_MAX_INCITE_TOTAL_FCT RS_MAX_VALUE
481
#define RS_DEFAULT_GRANARY_FOOD_INI 20
483
#define RS_DEFAULT_GRANARY_FOOD_INC 10
484
#define RS_MIN_GRANARY_FOOD_INC 0
485
#define RS_MAX_GRANARY_FOOD_INC RS_MAX_VALUE
487
#define RS_DEFAULT_CITY_CENTER_OUTPUT 0
488
#define RS_MIN_CITY_CENTER_OUTPUT 0
489
#define RS_MAX_CITY_CENTER_OUTPUT RS_MAX_VALUE
491
#define RS_DEFAULT_CITIES_MIN_DIST 2
492
#define RS_MIN_CITIES_MIN_DIST 1
493
#define RS_MAX_CITIES_MIN_DIST RS_MAX_VALUE
495
#define RS_DEFAULT_VIS_RADIUS_SQ 5 /* city radius 2 */
496
#define RS_MIN_VIS_RADIUS_SQ 0
497
#define RS_MAX_VIS_RADIUS_SQ 401 /* city radius 20 */
499
#define RS_DEFAULT_BASE_POLLUTION -20
500
/* no min / max values as it can be set to high negative values to
501
* deactiveate pollution and high positive values to create much
504
#define RS_DEFAULT_HAPPY_COST 2
505
#define RS_MIN_HAPPY_COST 0
506
#define RS_MAX_HAPPY_COST 100
508
#define RS_DEFAULT_FOOD_COST 2
509
#define RS_MIN_FOOD_COST 0
510
#define RS_MAX_FOOD_COST 100
512
#define RS_DEFAULT_GOLD_UPKEEP_STYLE 0
513
#define RS_MIN_GOLD_UPKEEP_STYLE 0
514
#define RS_MAX_GOLD_UPKEEP_STYLE 2
516
#define RS_DEFAULT_SLOW_INVASIONS TRUE
518
#define RS_DEFAULT_TIRED_ATTACK FALSE
520
#define RS_DEFAULT_KILLSTACK TRUE
522
#define RS_DEFAULT_BASE_BRIBE_COST 750
523
#define RS_MIN_BASE_BRIBE_COST 0
524
#define RS_MAX_BASE_BRIBE_COST RS_MAX_VALUE
526
#define RS_DEFAULT_RANSOM_GOLD 100
527
#define RS_MIN_RANSOM_GOLD 0
528
#define RS_MAX_RANSOM_GOLD RS_MAX_VALUE
530
#define RS_DEFAULT_PILLAGE_SELECT TRUE
532
#define RS_DEFAULT_UPGRADE_VETERAN_LOSS 0
533
#define RS_MIN_UPGRADE_VETERAN_LOSS 0
534
#define RS_MAX_UPGRADE_VETERAN_LOSS MAX_VET_LEVELS
536
#define RS_DEFAULT_BASE_TECH_COST 20
537
#define RS_MIN_BASE_TECH_COST 0
538
#define RS_MAX_BASE_TECH_COST 200
540
#define RS_DEFAULT_TECH_COST_STYLE 0
541
#define RS_MIN_TECH_COST_STYLE 0
542
#define RS_MAX_TECH_COST_STYLE 2
544
#define RS_DEFAULT_TECH_LEAKAGE 0
545
#define RS_MIN_TECH_LEAKAGE 0
546
#define RS_MAX_TECH_LEAKAGE 3
377
548
#endif /* FC__GAME_H */