-
-
Notifications
You must be signed in to change notification settings - Fork 992
/
WC_II_scenario.cfg
257 lines (228 loc) · 8.87 KB
/
WC_II_scenario.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
#textdomain wesnoth-wc
## macros may not be used inside translatable strings.
#define WC_II_CAMPAIGN_NAME_1P
_ "World Conquest 1p" #enddef
#define WC_II_CAMPAIGN_NAME_2P
_ "World Conquest 2p" #enddef
#define WC_II_CAMPAIGN_NAME_3P
_ "World Conquest 3p" #enddef
#define WC_II_CAMPAIGN_DESC_1P
_ "A randomly generated campaign for 1 player. It has 6 levels of difficulty.
(Expert level, 5 scenarios.)" #enddef
#define WC_II_CAMPAIGN_DESC_2P
_ "A randomly generated cooperative campaign for 2 players. It has 6 levels of difficulty.
(Expert level, 5 scenarios.)" #enddef
#define WC_II_CAMPAIGN_DESC_3P
_ "A randomly generated cooperative campaign for 3 players. It has 6 levels of difficulty.
(Expert level, 5 scenarios.)" #enddef
#define WC2_HUMAN_DIFFICULTY IMAGE COLOR
"units/{IMAGE}.png~RC(magenta>{COLOR})"#enddef
#define WC2_NIGHTMARE_DIFFICULTY
"units/monsters/fire-dragon.png~CROP(0,0,160,160)~SCALE_INTO(72,72)~RC(magenta>red)"#enddef
#define WC2_CAMPAIGN_DIFFICULTY DIFFICULTY IMAGE LABEL DESCRIPTION POWER TRAINED HEROES GOLD TRAIN XP
{CAMPAIGN_DIFFICULTY {DIFFICULTY} {IMAGE} {LABEL} {DESCRIPTION}}
[event]
name=preload
# These events run for every difficulty, so this Lua block ensures only the active difficulty's
# event actually fills the settings variable.
[lua]
code=<<
if wesnoth.scenario.difficulty ~= (...).difficulty then
wesnoth.wml_actions["return"]{}
end
>>
[args]
difficulty={DIFFICULTY}
[/args]
[/lua]
[set_variables]
name=wc2_difficulty
[value]
name={LABEL}
enemy_power={POWER}
enemy_trained={TRAINED}
heroes={HEROES}
# adjust bonus gold for number of players
extra_gold=$(gold * 2 ^ (3 - nplayers) where nplayers = $wc2_player_count, gold = {GOLD})
extra_training={TRAIN}
experience_penalty={XP}
[/value]
[/set_variables]
[/event]
#enddef
# I know I can add them into the main campaign defines but it gets really messy if done that way so I prefer to keep my code clean
#define ICON_ONE
"misc/blank-hex.png~BLIT(units/undead-necromancers/adept+female-defend-1.png~RC(magenta>brown)~CROP(10,0,72,72))~BLIT(units/dwarves/berserker/berserker-laugh-1.png~FL()~RC(magenta>white)~CROP(0,0,60,67),15,5)"
#enddef
#define ICON_TWO
"misc/blank-hex.png~BLIT(units/undead/spectre-se-attack-6.png~RC(magenta>darkred)~CROP(50,62,150,84),-15,-12)~BLIT(units/goblins/spearman-ne-defend.png~FL()~RC(magenta>darkblue)~CROP(0,0,60,67),20,15)"
#enddef
#define ICON_THREE
"misc/blank-hex.png~BLIT(units/drakes/armageddon-fire-se-4.png~RC(magenta>darkred)~CROP(10,0,72,72),-10,-10)~BLIT(units/goblins/spearman-ne-defend.png~FL()~RC(magenta>darkblue)~CROP(0,0,60,67),20,10)"
#enddef
#define IMAGE_ONE
"data/campaigns/The_Rise_Of_Wesnoth/images/story/trow_story_04-Fall_of_Eldaric.jpg~SCALE_INTO(800,600)"
#enddef
#define WC2_CAMPAIGN_NEW PLAYERS ICON
[campaign]
id = "WC_II_{PLAYERS}p"
define = CAMPAIGN_WC_{PLAYERS}P
name= {WC_II_CAMPAIGN_NAME_{PLAYERS}P}
description = {WC_II_CAMPAIGN_DESC_{PLAYERS}P}
first_scenario = "WC_II_{PLAYERS}p"
min_players={PLAYERS}
max_players={PLAYERS}
icon = {ICON}
image = {IMAGE_ONE}
type = mp
abbrev = _ "WC" + {PLAYERS}\
{WC2_CAMPAIGN_DIFFICULTY VERY_EASY {WC2_HUMAN_DIFFICULTY human-peasants/peasant purple} {STR_PEASANT} {STR_BEGINNER} 6 2 2 10 yes 0}
{WC2_CAMPAIGN_DIFFICULTY EASY {WC2_HUMAN_DIFFICULTY human-loyalists/sergeant black} {STR_SERGEANT} {STR_EASY} 7 3 2 7 yes 5}
{WC2_CAMPAIGN_DIFFICULTY NORMAL {WC2_HUMAN_DIFFICULTY human-loyalists/lieutenant brown} {STR_LIEUTENANT} {STR_MEDIUM} 8 4 2 5 yes 10} {DEFAULT_DIFFICULTY}
{WC2_CAMPAIGN_DIFFICULTY HARD {WC2_HUMAN_DIFFICULTY human-loyalists/general orange} {STR_GENERAL} {STR_HARD} 8 5 2 2 no 13}
# Challenging is a string that exists in mainline but only in campaigns so it probably counts as adding a string?
#textdomain wesnoth-httt
{WC2_CAMPAIGN_DIFFICULTY VERY_HARD {WC2_HUMAN_DIFFICULTY human-loyalists/marshal white} {STR_GRAND_MARSHAL} _"Challenging" 9 6 2 1 no 17}
# Expert is a string that was supposed to be in wesnoth-wc but accidentally got added to wesnoth-units instead
#textdomain wesnoth-units
{WC2_CAMPAIGN_DIFFICULTY NIGHTMARE {WC2_NIGHTMARE_DIFFICULTY} {STR_NIGHTMARE} _"Expert" 9 7 1 0 no 20}
[about]
title = _ "Campaign Design"
[entry]
name = "tekelili"
[/entry]
[/about]
[about]
title = _ "Prose, Grammatical and Text Assistance"
[entry]
name = "TL"
[/entry]
[entry]
name = "Natasiel"
[/entry]
[entry]
name = "Rigor"
[/entry]
[entry]
name = "tekelili"
[/entry]
[/about]
[about]
title = _ "Minor Code Contributors"
[entry]
name = "ezysquire"
[/entry]
[entry]
name = "tsr"
[/entry]
[/about]
[about]
title = _ "Playtesting"
[entry]
name = "Bear"
[/entry]
[entry]
name = "Honor"
[/entry]
[entry]
name = "jb"
[/entry]
[entry]
name = "paso"
[/entry]
[entry]
name = "tekelili"
[/entry]
[/about]
[about]
title = _ "Campaign Maintenance"
[entry]
name = "gfgtdf"
comment= "former maintainer"
[/entry]
[entry]
name = "Celtic Minstrel"
comment= "intermittent maintainer"
[/entry]
[entry]
name = "Lord-Knightmare"
comment= "intermittent maintainer"
[/entry]
[/about]
[/campaign]
#enddef
#define WC2_SCENARIO_NEW TAG ID NAME PLAYERS
## Everything that usually goes into [scenario] like [event], [load_ressource], map_data
## etc is generated by lua. This is also why there is only one [scenario] tag: the next
## scenario is again "WC_II" and the lua code detects that is was called a second
## time and generates the second scenario. (Same for third, fourth and fifth). All the lua
## code inside ./lua/map does map/scenario generation.
[{TAG}]
id = {ID}
name={NAME}
allow_new_game=no
scenario_generation=lua
experience_modifier=100
victory_when_enemies_defeated=yes
carryover_percentage=0
carryover_report=no
carryover_add=no
force_lock_settings=yes
[generator]
id={ID}
config_name={NAME}
nplayers={PLAYERS}
create_scenario = <<
local a = ...
local function doit()
wesnoth.dofile('campaigns/World_Conquest//lua/map/main.lua')
return wc_ii_generate_scenario(a.nplayers, a)
end
local status, res = xpcall(doit, function(e) std_print(e, debug.traceback()) end)
if status then
return res
else
print(res)
std_print(res)
end
>>
#ifdef EDITOR
user_config = <<
local a = ...
local function doit()
wesnoth.dofile('campaigns/World_Conquest//lua/map/main.lua');
wesnoth.dofile('campaigns/World_Conquest//lua/map/settings/settings_dialog.lua');
return wc2_debug_settings()
end
local status, res = xpcall(doit, function(e) std_print(e, debug.traceback()) end)
if status then
return res
else
std_print(res)
end
>>
#endif
nplayers={PLAYERS}
[scenario]
{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}
[/scenario]
[/generator]
[/{TAG}]
#enddef
{WC2_CAMPAIGN_NEW 1 {ICON_ONE}}
{WC2_CAMPAIGN_NEW 2 {ICON_TWO}}
{WC2_CAMPAIGN_NEW 3 {ICON_THREE}}
#ifdef EDITOR
{WC2_SCENARIO_NEW multiplayer WC_II {WC_II_CAMPAIGN_NAME_3P} 0}
#else
#ifdef CAMPAIGN_WC_1P
{WC2_SCENARIO_NEW scenario "WC_II_1p" {WC_II_CAMPAIGN_NAME_1P} 1}
#endif
#ifdef CAMPAIGN_WC_2P
{WC2_SCENARIO_NEW scenario "WC_II_2p" {WC_II_CAMPAIGN_NAME_2P} 2}
#endif
#ifdef CAMPAIGN_WC_3P
{WC2_SCENARIO_NEW scenario "WC_II_3p" {WC_II_CAMPAIGN_NAME_3P} 3}
#endif
#endif