1$#include "stratagus.h"
2
3$#include "age.h"
4$#include "ai.h"
5//Wyrmgus start
6$#include "character.h"
7//Wyrmgus end
8$#include "dialogue.h"
9$#include "font.h"
10$#include "game.h"
11//Wyrmgus start
12$#include "grand_strategy.h"
13//Wyrmgus end
14$#include "iolib.h"
15//Wyrmgus start
16$#include "item.h"
17//Wyrmgus end
18$#include "map/map.h"
19$#include "map/minimap.h"
20$#include "mod.h"
21$#include "movie.h"
22$#include "netconnect.h"
23$#include "player.h"
24//Wyrmgus start
25$#include "province.h"
26$#include "quest.h"
27$#include "script.h"
28//Wyrmgus end
29$#include "sound.h"
30$#include "sound_server.h"
31$#include "ui/ui.h"
32$#include "unit/unit.h"
33$#include "unit/unit_manager.h"
34$#include "unit/unittype.h"
35//Wyrmgus start
36$#include "upgrade/upgrade.h"
37$#include "util.h"
38//Wyrmgus end
39$#include "video.h"
40$#include "widgets.h"
41
42$#ifdef _MSC_VER
43$#pragma warning(disable:4800)
44$#endif
45
46$[
47mt = { __index = function(t, key) return CIcon:Get(key) end }
48Icons = {}
49setmetatable(Icons, mt)
50
51mt = { __index = function(t, key) return CUpgrade:Get(key) end }
52Upgrades = {}
53setmetatable(Upgrades, mt)
54
55mt = { __index = function(t, key) return CFont:Get(key) end }
56Fonts = {}
57setmetatable(Fonts, mt)
58
59mt = { __index = function(t, key) return CFontColor:Get(key) end }
60FontColors = {}
61setmetatable(FontColors, mt)
62
63mt = { __index = function(t, key) return UnitTypeByIdent(key) end }
64UnitTypes = {}
65setmetatable(UnitTypes, mt)
66
67function GameStarting()
68end
69$]
70
71//Wyrmgus start
72//#define MaxCosts 7
73#define MaxCosts 18
74//Wyrmgus end
75#define FoodCost MaxCosts
76#define ScoreCost MaxCosts + 1
77#define ManaResCost MaxCosts + 2
78#define FreeWorkersCount MaxCosts + 3
79#define MaxResourceInfo MaxCosts + 4
80//Wyrmgus start
81//#define PlayerMax 16
82#define PlayerMax 32
83//Wyrmgus end
84#define PlayerNumNeutral (PlayerMax - 1)
85#define InfiniteRepairRange 0x7FFFFFFF
86
87#define NoButton 0
88#define LeftButton 2
89#define MiddleButton 4
90#define RightButton 8
91#define UpButton 16
92#define DownButton 32
93
94enum Difficulties {
95	DifficultyNoDifficulty = 0,
96	DifficultyEasy,
97	DifficultyNormal,
98	DifficultyHard,
99	DifficultyBrutal
100};
101
102enum TechLevels {
103	NoTechLevel = 0,
104	AgrarianBronzeTechLevel,
105	AgrarianIronTechLevel,
106	CivilizedBronzeTechLevel,
107	CivilizedIronTechLevel,
108	CivilizedGunpowderTechLevel
109};
110
111$using std::string;
112$using std::vector;
113
114$pfile "ai.pkg"
115$pfile "editor.pkg"
116$pfile "font.pkg"
117$pfile "game.pkg"
118//Wyrmgus start
119$pfile "grand_strategy.pkg"
120//Wyrmgus end
121$pfile "map.pkg"
122$pfile "master.pkg"
123$pfile "minimap.pkg"
124$pfile "mod.pkg"
125$pfile "network.pkg"
126$pfile "particle.pkg"
127$pfile "pathfinder.pkg"
128$pfile "player.pkg"
129$pfile "sound.pkg"
130$pfile "translate.pkg"
131$pfile "trigger.pkg"
132$pfile "ui.pkg"
133$pfile "unit.pkg"
134$pfile "unittype.pkg"
135$pfile "upgrade.pkg"
136$pfile "video.pkg"
137
138extern int SaveGame(const std::string filename);
139extern void DeleteSaveGame(const std::string filename);
140
141extern const char *Translate @ _(const char *str);
142
143extern int SyncRand(void);
144extern int SyncRand(int max);
145extern bool CanAccessFile(const char *filename);
146void Exit(int err);
147
148$extern std::string CliMapName;
149extern std::string CliMapName;
150extern std::string StratagusLibPath;
151
152//Wyrmgus start
153extern std::string GetPluralForm(std::string name);
154extern std::string NameToIdent(std::string text);
155
156extern void HeroAddQuest(std::string hero_full_name, std::string quest_name);
157extern void HeroCompleteQuest(std::string hero_full_name, std::string quest_name);
158extern void SaveCustomHero(std::string hero_full_name);
159extern void DeleteCustomHero(std::string hero_full_name);
160extern void SetCurrentCustomHero(std::string hero_full_name);
161extern std::string GetCurrentCustomHero();
162extern void ChangeCustomHeroCivilization(std::string hero_full_name, std::string civilization_name, std::string new_hero_name, std::string new_hero_family_name);
163extern bool IsNameValidForCustomHero(std::string hero_name, std::string hero_family_name);
164extern int GetFileLastModified(std::string file_name);
165extern std::string GeneratePersonalName(std::string unit_type_ident);
166extern int GetItemClassIdByName(std::string item_class);
167extern std::string GetItemEffectsString(std::string item_ident);
168extern std::string GetUniqueItemEffectsString(std::string item_ident);
169extern void SaveHeroes();
170
171extern bool LoadingPersistentHeroes;
172
173extern int GetWorldMapTerrainTypeId(std::string terrain_type_name);
174
175extern void DeleteModFaction(std::string faction_name);
176extern void DeleteModUnitType(std::string unit_type_ident);
177extern void DisableMod(std::string mod_file);
178extern void SetDLCFileEquivalency(const std::string dlc_file, const std::string replacement_file);
179
180extern void SaveQuestCompletion();
181extern void SetCurrentQuest(std::string quest_ident);
182extern std::string GetCurrentQuest();
183extern void SetCurrentCampaign(std::string campaign_ident);
184extern std::string GetCurrentCampaign();
185extern void SetQuestCompleted(std::string quest_ident, int difficulty = DifficultyNormal, bool save = true);
186extern void SetQuestCompleted(std::string quest_ident, bool save);
187extern void SetAchievementObtained(std::string achievement_ident, bool save = true, bool display = true);
188
189extern void CallDialogue(std::string dialogue_ident, int player);
190extern void CallDialogueNode(std::string dialogue_ident, int node, int player);
191extern void CallDialogueNodeOptionEffect(std::string dialogue_ident, int node, int option, int player);
192//Wyrmgus end