-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path_main.cfg
307 lines (281 loc) · 9.98 KB
/
_main.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
[textdomain]
name="wesnoth-Era_of_High_Sorcery"
path="data/add-ons/Era_of_High_Sorcery/translations"
[/textdomain]
#textdomain wesnoth-Era_of_High_Sorcery
[language]
type_lightning= _ "lightning"
[/language]
#define EOHS_VERSION_STRING
"2.4.0.4"#enddef
# TODO: un-duplicate with website
#define EOHS_DESCRIPTION
_"Era of High Sorcery (EoHS) is an era where your leader is a powerful wizard whose spells can alter the nature of the entire battlefield (sometimes literally!). EoHS features:
- Three realms of magic, each with more than a dozen unique spells
- Pick your recruits from one or more factions
- Ability to customize your wizard's appearance, changing their hairstyle and recoloring their robes and equipment – plus several hats you can earn by performing in-game feats
- No download required for non-host players: anyone can join or observe an EoHS game
- Freely available on the add-on server for Wesnoth 1.16"#enddef
#ifver WESNOTH_VERSION >= 1.13.8
{gui/macros/_initial.cfg}
#endif
#define EOHS_LUA_FILE CODE
[lua]
code={CODE}
[/lua]
#enddef
#define EOHS_GIVE_TAG_MACRO_TO_LUA MACRO
[set_variables]
name=EoHS.GIVE_TAG_MACRO_TO_LUA
mode=replace
[literal]
{{MACRO}}
[/literal]
[/set_variables]
[lua]
code="EoHS.macros.{MACRO} = wml.variables[""EoHS.GIVE_TAG_MACRO_TO_LUA""]"
[/lua]
#enddef
#define EOHS_GIVE_VALUE_MACRO_TO_LUA MACRO
[set_variable]
name=EoHS.GIVE_VALUE_MACRO_TO_LUA
literal={{MACRO}}
[/set_variable]
[lua]
code="EoHS.macros.{MACRO} = wml.variables[""EoHS.GIVE_VALUE_MACRO_TO_LUA""]"
[/lua]
#enddef
#define EOHS_ACTUAL_MAGIC_LOADED
[set_variable]
name="EoHS.actual_magic_loaded"
value="true"
[/set_variable]
#enddef
#define EOHS_EVENTS STRENGTH BEFORE_PRELOAD_CODE AFTER_PRELOAD_CODE
[event]
name=preload
# if EOHS_EVENTS gets called more than once, we want to insert
# ALL of the individual before_/after_preload code, but only ONE of the shared code.
# Storing the before_/after_preload code in a preload event is a big hack
# (we don't want to run this again on reload),
# but I think we can assume that there will only be one preload before prestart,
# and anyway, previous versions of EoHS didn't even safeguard against this
# (and presumably ended up rerunning the before_/after_preload code repeatedly if you reloaded)
# and we never detected this causing a bug, presumably because the code was idempotent.
[if]
[variable]
name="EoHS_prestart_occurred"
boolean_equals="true"
[/variable]
[else] # else
[set_variables]
name=EoHS.before_preload
mode=insert
[literal]
[lua]
code={BEFORE_PRELOAD_CODE}
[/lua]
[/literal]
[/set_variables]
[set_variables]
name=EoHS.after_preload
mode=insert
[literal]
[lua]
code={AFTER_PRELOAD_CODE}
[/lua]
[/literal]
[/set_variables]
[/else]
[/if]
[/event]
[event]
name=prestart
{STRENGTH}
[if]
[variable]
name="EoHS_prestart_occurred"
boolean_equals="true"
[/variable]
[else] # else
[set_variable]
name="EoHS_prestart_occurred"
value="true"
[/set_variable]
[set_variables]
name=EoHS.wesnoth_cfgs.terrain
mode=replace
[literal]
{core/terrain.cfg}
[/literal]
[/set_variables]
[set_variables]
name=EoHS.wesnoth_cfgs.team_colors
mode=replace
[literal]
{core/team-colors.cfg}
[/literal]
[/set_variables]
[set_variables]
name=EoHS.preload
mode=append
[literal]
[lua]
code=<<--EOHS_EVENTS BEFORE_PRELOAD
EoHS = {
helper = wesnoth.require("lua/helper.lua"),
_ = wesnoth.textdomain("wesnoth-Era_of_High_Sorcery"),
macros = {},
context = {unison=false, synchronized=false, in_event=false} -- The appropriate context for the preload stuff
}
>>
[/lua]
[/literal]
[/set_variables]
[set_variables]
name=EoHS.preload
mode=append
to_variable=EoHS.before_preload
[/set_variables]
[set_variables]
name=EoHS.preload
mode=append
[literal]
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_HEALS}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_CURES}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_REGENERATES}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_SKIRMISHER}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_AMBUSH}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_NIGHTSTALK}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_CONCEALMENT}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_SUBMERGE}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_ILLUMINATES}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_TELEPORT}
{EOHS_GIVE_TAG_MACRO_TO_LUA ABILITY_LEADERSHIP}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_SLOW}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_DRAIN}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_PLAGUE}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_POISON}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_CHARGE}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_MAGICAL}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_MARKSMAN}
{EOHS_GIVE_TAG_MACRO_TO_LUA WEAPON_SPECIAL_FIRSTSTRIKE}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_STRONG}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_QUICK}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_INTELLIGENT}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_RESILIENT}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_DEXTROUS}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_HEALTHY}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_FEARLESS}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_WEAK}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_DIM}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_SLOW}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_UNDEAD}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_MECHANICAL}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_LOYAL}
{EOHS_GIVE_TAG_MACRO_TO_LUA TRAIT_FERAL_MUSTHAVE}
{EOHS_GIVE_VALUE_MACRO_TO_LUA EOHS_VERSION_STRING}
{EOHS_GIVE_VALUE_MACRO_TO_LUA EOHS_DESCRIPTION}
#ifver WESNOTH_VERSION >= 1.13.8
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI_FONT_SIZE_LARGE}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI_FONT_SIZE_SMALL}
[lua]
code=<<
EoHS.macros.GUI_NORMAL__FONT_SIZE__LARGE = EoHS.macros.GUI_FONT_SIZE_LARGE
EoHS.macros.GUI_NORMAL__FONT_SIZE__SMALL = EoHS.macros.GUI_FONT_SIZE_SMALL
>>
[/lua]
#else
{gui/default/macros/_initial.cfg}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI_NORMAL__FONT_SIZE__LARGE}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI_NORMAL__FONT_SIZE__SMALL}
#endif
{EOHS_GIVE_TAG_MACRO_TO_LUA GUI__LISTBOX_SELECTED_CELL}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI__BACKGROUND_COLOR_ENABLED}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI__TEXT_VERTICALLY_CENTRED}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI__TEXT_HORIZONTALLY_CENTRED}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI__FONT_COLOR_ENABLED__DEFAULT}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI__FONT_COLOR_ENABLED__TITLE}
{EOHS_GIVE_VALUE_MACRO_TO_LUA GUI__FONT_COLOR_DISABLED__TITLE}
{CLEAR_VARIABLE EoHS.GIVE_TAG_MACRO_TO_LUA}
{CLEAR_VARIABLE EoHS.GIVE_VALUE_MACRO_TO_LUA}
{~add-ons/Era_of_High_Sorcery/lua_files/}
{~add-ons/Era_of_High_Sorcery/lua_files/actions/}
[lua]
code="for i,func in ipairs(EoHS.end_of_preload_funcs) do func() end; EoHS.context = nil"
[/lua]
[/literal]
[/set_variables]
[set_variables]
name=EoHS.preload
mode=append
to_variable=EoHS.after_preload
[/set_variables]
[insert_tag]
name=command
variable=EoHS.preload
[/insert_tag]
[lua]
code=<<EoHS.init_campaign()>>
[/lua]
[/else]
[/if]
[/event]
#enddef
#define EOHS_ERA_SHARED TYPE_NAME BEFORE_PRELOAD_CODE
require_era=no
[multiplayer_side]
id=EoHS_Faction
image="icons/scroll_red.png"
name=_"Wizards (v"+{EOHS_VERSION_STRING}+", "+{TYPE_NAME}+")"
type="Red Mage"
leader="Red Mage"
[/multiplayer_side]
{EOHS_EVENTS ({EOHS_ACTUAL_MAGIC_LOADED}) ({BEFORE_PRELOAD_CODE}) ("")}
#enddef
[era]
id="EoHS: Era of High Sorcery"
name= _ "EoHS: Era of High Sorcery"
description={EOHS_DESCRIPTION}
# TODO: description=, for 1.11
{EOHS_ERA_SHARED (_"Default") ("")}
[/era]
[era]
id="EoHS: Alternative settings"
name= _ "EoHS: Alternative settings"
description={EOHS_DESCRIPTION}
{EOHS_ERA_SHARED (_"Alt settings") (<<
EoHS.first_player_picks_settings=true
>>)}
[/era]
[modification]
id="EoHS with any era"
name= _ "EoHS with any era"
type="hybrid"
description=_"In this version of EoHS, the alliances are replaced with the factions from whatever era you choose.
"+{EOHS_DESCRIPTION}
{EOHS_EVENTS ({EOHS_ACTUAL_MAGIC_LOADED}) (<<
EoHS.replace_alliances_with_era=true
>>) ("")}
[/modification]
[modification]
id="EoHS with any era: Alternative settings"
name= _ "EoHS with any era: Alternative settings"
type="hybrid"
description=_"In this version of EoHS, the alliances are replaced with the factions from whatever era you choose.
"+{EOHS_DESCRIPTION}
{EOHS_EVENTS ({EOHS_ACTUAL_MAGIC_LOADED}) (<<
EoHS.replace_alliances_with_era=true
EoHS.first_player_picks_settings=true
>>) ("")}
[/modification]
{~add-ons/Era_of_High_Sorcery/scenarios/}
[+units]
[unit_type]
id="EoHS_local_version_checker"
name={EOHS_VERSION_STRING}
hide_help="true"
do_not_list="true"
alignment="neutral"
[/unit_type]
[/units]