Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/ruleset.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
ruleset.h
Go to the documentation of this file.
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.
7
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__RULESET_H
14#define FC__RULESET_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20#define RULESET_CAPABILITIES_BASE "+Freeciv-ruleset-3.2-Devel-2022.Feb.02"
21#ifdef FREECIV_WEB
22#define RULESET_CAPABILITIES RULESET_CAPABILITIES_BASE " +web-compatible"
23#else /* FREECIV_WEB */
24#define RULESET_CAPABILITIES RULESET_CAPABILITIES_BASE
25#endif /* FREECIV_WEB */
26/*
27 * Ruleset capabilities acceptable to this program:
28 *
29 * +Freeciv-3.2-ruleset
30 * - basic ruleset format for Freeciv versions 3.2.x; required
31 *
32 * +Freeciv-ruleset-Devel-YYYY.MMM.DD
33 * - ruleset of the development version at the given date
34 */
35
36#define RSFORMAT_3_2 30
37
38struct conn_list;
39
40 typedef void (*rs_conversion_logger)(const char *msg);
41
42/* functions */
43bool load_rulesets(const char *restore, const char *alt, bool compat_mode,
44 rs_conversion_logger logger,
45 bool act, bool buffer_script, bool load_luadata);
46bool reload_rulesets_settings(void);
47void send_rulesets(struct conn_list *dest);
48
49void rulesets_deinit(void);
50
51 void ruleset_error_real(rs_conversion_logger logger,
52 const char *file, const char *function,
53 int line, enum log_level level,
54 const char *format, ...)
55 fc__attribute((__format__ (__printf__, 6, 7)));
56
57#define ruleset_error(logger, level, format, ...) \
58 do { \
59 ruleset_error_real(logger, __FILE__, __FUNCTION__, __FC_LINE__, \
60 level, format, ## __VA_ARGS__); \
61 } while (FALSE);
62
63char *get_script_buffer(void);
64char *get_parser_buffer(void);
65
66int ruleset_purge_unused_entities(void);
67int ruleset_purge_redundant_reqs(void);
68
69/* Default ruleset values that are not settings (in game.h) */
70
71#define GAME_DEFAULT_ADDTOSIZE 9
72#define GAME_DEFAULT_CHANGABLE_TAX TRUE
73#define GAME_DEFAULT_VISION_REVEAL_TILES FALSE
74#define GAME_DEFAULT_DISASTER_FREQ 10
75#define GAME_DEFAULT_ACH_UNIQUE TRUE
76#define GAME_DEFAULT_ACH_VALUE 1
77#define RS_DEFAULT_MUUK_FOOD_WIPE TRUE
78#define RS_DEFAULT_MUUK_GOLD_WIPE TRUE
79#define RS_DEFAULT_MUUK_SHIELD_WIPE FALSE
80#define RS_DEFAULT_TECH_STEAL_HOLES TRUE
81#define RS_DEFAULT_TECH_TRADE_HOLES TRUE
82#define RS_DEFAULT_TECH_TRADE_LOSS_HOLES TRUE
83#define RS_DEFAULT_TECH_PARASITE_HOLES TRUE
84#define RS_DEFAULT_TECH_LOSS_HOLES TRUE
85#define RS_DEFAULT_PYTHAGOREAN_DIAGONAL FALSE
86
87#define RS_DEFAULT_GOLD_UPKEEP_STYLE "City"
88#define RS_DEFAULT_TECH_COST_STYLE "Civ I|II"
89#define RS_DEFAULT_TECH_LEAKAGE "None"
90#define RS_DEFAULT_TECH_UPKEEP_STYLE "None"
91
92#define RS_DEFAULT_CULTURE_VIC_POINTS 1000
93#define RS_DEFAULT_CULTURE_VIC_LEAD 300
94#define RS_DEFAULT_CULTURE_MIGRATION_PML 50
95#define RS_DEFAULT_HISTORY_INTEREST_PML 0
96
97#define RS_DEFAULT_GOODS_SELECTION GSM_LEAVING
98
99#define RS_DEFAULT_EXTRA_APPEARANCE 15
100#define RS_DEFAULT_EXTRA_DISAPPEARANCE 15
101
102#define RS_DEFAULT_ONLY_KILLING_VETERAN FALSE
103#define RS_DEFAULT_ONLY_REAL_FIGHT_VETERAN FALSE
104#define RS_DEFAULT_COMBAT_ODDS_SCALED_VETERANCY FALSE
105#define RS_DEFAULT_DAMAGE_REDUCES_BOMBARD_RATE TRUE
106
107#define RS_DEFAULT_SMALL_WONDER_VISIBILITY "Always"
108
109#define RS_DEFAULT_BASE_TECH_COST 20
110#define RS_MIN_BASE_TECH_COST 0
111#define RS_MAX_BASE_TECH_COST 20000
112
113#define RS_DEFAULT_MIN_TECH_COST 20
114#define RS_MIN_MIN_TECH_COST 0
115#define RS_MAX_MIN_TECH_COST 20000
116
117#define RS_DEFAULT_NATIONALITY FALSE
118#define RS_DEFAULT_UBUILD_NAT FALSE
119#define RS_DEFAULT_CONVERT_SPEED 50
120
121#ifdef __cplusplus
122}
123#endif /* __cplusplus */
124
125#endif /* FC__RULESET_H */
incite_cost
char * incite_cost
Definition comments.c:74
log_level
log_level
Definition log.h:28
ruleset_purge_unused_entities
int ruleset_purge_unused_entities(void)
Definition ruleset.c:313
rs_conversion_logger
void(* rs_conversion_logger)(const char *msg)
Definition ruleset.h:40
rulesets_deinit
void rulesets_deinit(void)
Definition ruleset.c:9443
load_rulesets
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
Definition ruleset.c:9363
ruleset_purge_redundant_reqs
int ruleset_purge_redundant_reqs(void)
Definition ruleset.c:490
reload_rulesets_settings
bool reload_rulesets_settings(void)
Definition ruleset.c:9710
get_parser_buffer
char * get_parser_buffer(void)
Definition ruleset.c:562
ruleset_error_real
void ruleset_error_real(rs_conversion_logger logger, const char *file, const char *function, int line, enum log_level level, const char *format,...) fc__attribute((__format__(__printf__
send_rulesets
void send_rulesets(struct conn_list *dest)
Definition ruleset.c:9733
get_script_buffer
char * get_script_buffer(void)
Definition ruleset.c:554
level
struct setting_list * level[OLEVELS_NUM]
Definition settings.c:190
fc__attribute
#define fc__attribute(x)
Definition support.h:99