Freeciv21
Develop your civilization from humble roots to a global empire
ruleset.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 #include <QLoggingCategory>
16 
17 #define CAP_EFT_HP_REGEN_MIN "HP_Regen_Min"
18 #define CAP_EFT_BOMBARD_LIMIT_PCT "Bombard_Limit_Pct"
19 #define CAP_EFT_WONDER_VISIBLE "Wonder_Visible"
20 #define CAP_VUT_VISIONLAYER "Vision_Layer"
21 #define CAP_EFT_NATION_INTELLIGENCE "Nation_Intelligence"
22 #define RULESET_CAPABILITIES \
23  "+Freeciv-ruleset-Devel-2017.Jan.02 " CAP_EFT_HP_REGEN_MIN \
24  " " CAP_EFT_BOMBARD_LIMIT_PCT " " CAP_EFT_WONDER_VISIBLE \
25  " " CAP_VUT_VISIONLAYER " " CAP_EFT_NATION_INTELLIGENCE
26 /*
27  * Ruleset capabilities acceptable to this program:
28  *
29  * +Freeciv-3.1-ruleset
30  * - basic ruleset format for Freeciv versions 3.1.x; required
31  *
32  * +Freeciv-ruleset-Devel-YYYY.MMM.DD
33  * - ruleset of the development version at the given data
34  *
35  * HP_Regen_Min (optional)
36  * - Hard-coded HP regeneration rules in cities moved to effects.ruleset
37  */
38 
39 Q_DECLARE_LOGGING_CATEGORY(ruleset_category)
40 
41 struct conn_list;
42 
43 typedef void (*rs_conversion_logger)(const char *msg);
44 
45 // functions
46 bool load_rulesets(const char *restore, const char *alt, bool compat_mode,
47  rs_conversion_logger logger, bool act, bool buffer_script,
48  bool load_luadata);
50 void send_rulesets(struct conn_list *dest);
51 
52 void rulesets_deinit();
53 
54 char *get_script_buffer();
55 char *get_parser_buffer();
56 
57 // Default ruleset values that are not settings (in game.h)
58 
59 #define GAME_DEFAULT_ADDTOSIZE 9
60 #define GAME_DEFAULT_CHANGEABLE_BUDGET true
61 #define GAME_DEFAULT_VISION_REVEAL_TILES false
62 #define GAME_DEFAULT_NATIONALITY false
63 #define GAME_DEFAULT_CONVERT_SPEED 50
64 #define GAME_DEFAULT_DISASTER_FREQ 10
65 #define GAME_DEFAULT_ACH_UNIQUE true
66 #define GAME_DEFAULT_ACH_VALUE 1
67 #define RS_DEFAULT_MUUK_FOOD_WIPE true
68 #define RS_DEFAULT_MUUK_GOLD_WIPE true
69 #define RS_DEFAULT_MUUK_SHIELD_WIPE false
70 #define RS_DEFAULT_TECH_STEAL_HOLES true
71 #define RS_DEFAULT_TECH_TRADE_HOLES true
72 #define RS_DEFAULT_TECH_TRADE_LOSS_HOLES true
73 #define RS_DEFAULT_TECH_PARASITE_HOLES true
74 #define RS_DEFAULT_TECH_LOSS_HOLES true
75 #define RS_DEFAULT_PYTHAGOREAN_DIAGONAL false
76 
77 #define RS_DEFAULT_INITIAL_DIPLOMATIC_STATE "War"
78 #define RS_DEFAULT_GOLD_UPKEEP_STYLE "City"
79 #define RS_DEFAULT_TECH_COST_STYLE "Civ I|II"
80 #define RS_DEFAULT_TECH_LEAKAGE "None"
81 #define RS_DEFAULT_TECH_UPKEEP_STYLE "None"
82 
83 #define RS_DEFAULT_CULTURE_VIC_POINTS 1000
84 #define RS_DEFAULT_CULTURE_VIC_LEAD 300
85 #define RS_DEFAULT_CULTURE_MIGRATION_PML 50
86 #define RS_DEFAULT_HISTORY_INTEREST_PML 0
87 
88 #define RS_DEFAULT_EXTRA_APPEARANCE 15
89 #define RS_DEFAULT_EXTRA_DISAPPEARANCE 15
char * get_script_buffer()
Return current script.lua buffer.
Definition: ruleset.cpp:244
void(* rs_conversion_logger)(const char *msg)
Definition: ruleset.h:43
char * get_parser_buffer()
Return current parser.lua buffer.
Definition: ruleset.cpp:249
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
Loads the rulesets.
Definition: ruleset.cpp:8582
void send_rulesets(struct conn_list *dest)
Send all ruleset information to the specified connections.
Definition: ruleset.cpp:8890
bool reload_rulesets_settings()
Reload the game settings saved in the ruleset file.
Definition: ruleset.cpp:8868
void rulesets_deinit()
Completely deinitialize ruleset system.
Definition: ruleset.cpp:8651