-
Notifications
You must be signed in to change notification settings - Fork 0
/
randomize.bat
295 lines (295 loc) · 10.2 KB
/
randomize.bat
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
@echo off
set savedir=Z:\media\SHARE\roms\Proton\Diablo.pc\Saves
set configdir=Z:\media\SHARE\roms\Proton\Diablo.pc\Config
cls
SET /a counter=1
xcopy /T /E palette\zfolders %savedir%\
IF [%1] == [lua] (
:loop
SET "param%counter%=%~1"
IF DEFINED param%counter% SET /a counter+=1&shift&GOTO loop
SET /a counter -=1
)
::LUA random needs 28 params
IF NOT %counter%==28 SET param1=gurksaft
echo ----------------------
echo Randomize Town Palette
echo ----------------------
::delete old palette
del %savedir%\levels\towndata\town.pal > nul
IF %param1% == lua (
set /a num1=%param2%
) ELSE (
set /a num1=%random% %%5 +1
)
copy palette\towndata\town_%num1%.pal %savedir%\levels\towndata\town.pal > nul
echo palette\towndata\town_%num1%.pal levels\towndata\town.pal
echo ----------------------------------
echo Randomize Level 1 Palette (Church)
echo ----------------------------------
::delete old palette
del %savedir%\levels\l1data\l1_1.pal > nul
del %savedir%\levels\l1data\l1_2.pal > nul
del %savedir%\levels\l1data\l1_3.pal > nul
del %savedir%\levels\l1data\l1_4.pal > nul
del %savedir%\levels\l1data\l1_5.pal > nul
::randomize
IF %param1% == lua (
set /a num1=%param3%
set /a num2=%param4%
set /a num3=%param5%
set /a num4=%param6%
set /a num5=%param7%
) ELSE (
set /a num1=%random% %%66 +1
:2again1
set /a num2=%random% %%66 +1
if [%num1%] == [%num2%] goto 2again1
:3again1
set /a num3=%random% %%66 +1
if [%num1%] == [%num3%] goto 3again1
if [%num2%] == [%num3%] goto 3again1
:4again1
set /a num4=%random% %%66 +1
if [%num1%] == [%num4%] goto 4again1
if [%num2%] == [%num4%] goto 4again1
if [%num3%] == [%num4%] goto 4again1
:5again1
set /a num5=%random% %%66 +1
if [%num1%] == [%num5%] goto 5again1
if [%num2%] == [%num5%] goto 5again1
if [%num3%] == [%num5%] goto 5again1
if [%num4%] == [%num5%] goto 5again1
)
copy palette\l1data\l1_%num1%.pal %savedir%\levels\l1data\l1_1.pal > nul
echo palette\l1data\l1_%num1%.pal levels\l1data\l1_1.pal
copy palette\l1data\l1_%num2%.pal %savedir%\levels\l1data\l1_2.pal > nul
echo palette\l1data\l1_%num2%.pal levels\l1data\l1_2.pal
copy palette\l1data\l1_%num3%.pal %savedir%\levels\l1data\l1_3.pal > nul
echo palette\l1data\l1_%num3%.pal levels\l1data\l1_3.pal
copy palette\l1data\l1_%num4%.pal %savedir%\levels\l1data\l1_4.pal > nul
echo palette\l1data\l1_%num4%.pal levels\l1data\l1_4.pal
copy palette\l1data\l1_%num5%.pal %savedir%\levels\l1data\l1_5.pal > nul
echo palette\l1data\l1_%num5%.pal levels\l1data\l1_5.pal
echo -------------------------------------
echo Randomize Level 2 Palette (Catacombs)
echo -------------------------------------
::delete old palette
del %savedir%\levels\l2data\l2_1.pal > nul
del %savedir%\levels\l2data\l2_2.pal > nul
del %savedir%\levels\l2data\l2_3.pal > nul
del %savedir%\levels\l2data\l2_4.pal > nul
del %savedir%\levels\l2data\l2_5.pal > nul
::randomize
IF %param1% == lua (
set /a num1=%param8%
set /a num2=%param9%
set /a num3=%param10%
set /a num4=%param11%
set /a num5=%param12%
) ELSE (
set /a num1=%random% %%74 +1
:2again2
set /a num2=%random% %%74 +1
if [%num1%] == [%num2%] goto 2again2
:3again2
set /a num3=%random% %%74 +1
if [%num1%] == [%num3%] goto 3again2
if [%num2%] == [%num3%] goto 3again2
:4again2
set /a num4=%random% %%74 +1
if [%num1%] == [%num4%] goto 4again2
if [%num2%] == [%num4%] goto 4again2
if [%num3%] == [%num4%] goto 4again2
:5again2
set /a num5=%random% %%74 +1
if [%num1%] == [%num5%] goto 5again2
if [%num2%] == [%num5%] goto 5again2
if [%num3%] == [%num5%] goto 5again2
if [%num4%] == [%num5%] goto 5again2
)
copy palette\l2data\l2_%num1%.pal %savedir%\levels\l2data\l2_1.pal > nul
echo palette\l2data\l2_%num1%.pal levels\l2data\l2_1.pal
copy palette\l2data\l2_%num2%.pal %savedir%\levels\l2data\l2_2.pal > nul
echo palette\l2data\l2_%num2%.pal levels\l2data\l2_2.pal
copy palette\l2data\l2_%num3%.pal %savedir%\levels\l2data\l2_3.pal > nul
echo palette\l2data\l2_%num3%.pal levels\l2data\l2_3.pal
copy palette\l2data\l2_%num4%.pal %savedir%\levels\l2data\l2_4.pal > nul
echo palette\l2data\l2_%num4%.pal levels\l2data\l2_4.pal
copy palette\l2data\l2_%num5%.pal %savedir%\levels\l2data\l2_5.pal > nul
echo palette\l2data\l2_%num5%.pal levels\l2data\l2_5.pal
echo ---------------------------------
echo Randomize Level 3 Palette (Caves)
echo ---------------------------------
::delete old palette
del %savedir%\levels\l3data\l3_1.pal > nul
del %savedir%\levels\l3data\l3_2.pal > nul
del %savedir%\levels\l3data\l3_3.pal > nul
del %savedir%\levels\l3data\l3_4.pal > nul
del %savedir%\levels\l3data\l3_5.pal > nul
::randomize
IF %param1% == lua (
set /a num1=%param13%
set /a num2=%param14%
set /a num3=%param15%
set /a num4=%param16%
set /a num5=%param17%
) ELSE (
set /a num1=%random% %%58 +1
:2again3
set /a num2=%random% %%58 +1
if [%num1%] == [%num2%] goto 2again3
:3again3
set /a num3=%random% %%58 +1
if [%num1%] == [%num3%] goto 3again3
if [%num2%] == [%num3%] goto 3again3
:4again3
set /a num4=%random% %%58 +1
if [%num1%] == [%num4%] goto 4again3
if [%num2%] == [%num4%] goto 4again3
if [%num3%] == [%num4%] goto 4again3
:5again3
set /a num5=%random% %%58 +1
if [%num1%] == [%num5%] goto 5again3
if [%num2%] == [%num5%] goto 5again3
if [%num3%] == [%num5%] goto 5again3
if [%num4%] == [%num5%] goto 5again3
)
copy palette\l3data\l3_%num1%.pal %savedir%\levels\l3data\l3_1.pal > nul
echo palette\l3data\l3_%num1%.pal levels\l3data\l3_1.pal
copy palette\l3data\l3_%num2%.pal %savedir%\levels\l3data\l3_2.pal > nul
echo palette\l3data\l3_%num2%.pal levels\l3data\l3_2.pal
copy palette\l3data\l3_%num3%.pal %savedir%\levels\l3data\l3_3.pal > nul
echo palette\l3data\l3_%num3%.pal levels\l3data\l3_3.pal
copy palette\l3data\l3_%num4%.pal %savedir%\levels\l3data\l3_4.pal > nul
echo palette\l3data\l3_%num4%.pal levels\l3data\l3_4.pal
copy palette\l3data\l3_%num5%.pal %savedir%\levels\l3data\l3_5.pal > nul
echo palette\l3data\l3_%num5%.pal levels\l3data\l3_5.pal
echo --------------------------------
echo Randomize Level 4 Palette (Hell)
echo --------------------------------
::delete old palette
del %savedir%\levels\l4data\l4_1.pal > nul
del %savedir%\levels\l4data\l4_2.pal > nul
del %savedir%\levels\l4data\l4_3.pal > nul
del %savedir%\levels\l4data\l4_4.pal > nul
del %savedir%\levels\l4data\l4_5.pal > nul
::randomize
IF %param1% == lua (
set /a num1=%param18%
set /a num2=%param19%
set /a num3=%param20%
set /a num4=%param21%
set /a num5=%param22%
) ELSE (
set /a num1=%random% %%46 +1
:2again4
set /a num2=%random% %%46 +1
if [%num1%] == [%num2%] goto 2again4
:3again4
set /a num3=%random% %%46 +1
if [%num1%] == [%num3%] goto 3again4
if [%num2%] == [%num3%] goto 3again4
:4again4
set /a num4=%random% %%46 +1
if [%num1%] == [%num4%] goto 4again4
if [%num2%] == [%num4%] goto 4again4
if [%num3%] == [%num4%] goto 4again4
:5again4
set /a num5=%random% %%46 +1
if [%num1%] == [%num5%] goto 5again4
if [%num2%] == [%num5%] goto 5again4
if [%num3%] == [%num5%] goto 5again4
if [%num4%] == [%num5%] goto 5again4
)
copy palette\l4data\l4_%num1%.pal %savedir%\levels\l4data\l4_1.pal > nul
echo palette\l4data\l4_%num1%.pal levels\l4data\l4_1.pal
copy palette\l4data\l4_%num2%.pal %savedir%\levels\l4data\l4_2.pal > nul
echo palette\l4data\l4_%num2%.pal levels\l4data\l4_2.pal
copy palette\l4data\l4_%num3%.pal %savedir%\levels\l4data\l4_3.pal > nul
echo palette\l4data\l4_%num3%.pal levels\l4data\l4_3.pal
copy palette\l4data\l4_%num4%.pal %savedir%\levels\l4data\l4_4.pal > nul
echo palette\l4data\l4_%num4%.pal levels\l4data\l4_4.pal
copy palette\l4data\l4_%num5%.pal %savedir%\levels\l4data\l4_5.pal > nul
echo palette\l4data\l4_%num5%.pal levels\l4data\l4_5.pal
echo ---------------------------------
echo Randomize Level 5 Palette (Crypt)
echo ---------------------------------
::delete old palette
del %savedir%\NLevels\l5data\L5Base.PAL > nul
IF %param1% == lua (
set /a num1=%param23%
) ELSE (
set /a num1=%random% %%74 +1
)
copy palette\l5data\l5_%num1%.pal %savedir%\NLevels\l5data\L5Base.PAL > nul
echo palette\l5data\l5_%num1%.pal NLevels\l5data\L5Base.PAL
echo --------------------------------
echo Randomize Level 6 Palette (Hive)
echo --------------------------------
::delete old palette
del %savedir%\NLevels\l6data\l6base1.pal > nul
del %savedir%\NLevels\l6data\l6base2.pal > nul
del %savedir%\NLevels\l6data\l6base3.pal > nul
del %savedir%\NLevels\l6data\l6base4.pal > nul
del %savedir%\NLevels\l6data\l6base5.pal > nul
::randomize
IF %param1% == lua (
set /a num1=%param24%
set /a num2=%param25%
set /a num3=%param26%
set /a num4=%param27%
set /a num5=%param28%
) ELSE (
set /a num1=%random% %%79 +1
:2again6
set /a num2=%random% %%79 +1
if [%num1%] == [%num2%] goto 2again6
:3again6
set /a num3=%random% %%79 +1
if [%num1%] == [%num3%] goto 3again6
if [%num2%] == [%num3%] goto 3again6
:4again6
set /a num4=%random% %%79 +1
if [%num1%] == [%num4%] goto 4again6
if [%num2%] == [%num4%] goto 4again6
if [%num3%] == [%num4%] goto 4again6
:5again6
set /a num5=%random% %%79 +1
if [%num1%] == [%num5%] goto 5again6
if [%num2%] == [%num5%] goto 5again6
if [%num3%] == [%num5%] goto 5again6
if [%num4%] == [%num5%] goto 5again6
)
copy palette\l6data\l6_%num1%.pal %savedir%\NLevels\l6data\l6base1.pal > nul
echo palette\l6data\l6_%num1%.pal NLevels\l6data\l6base1.pal
copy palette\l6data\l6_%num2%.pal %savedir%\NLevels\l6data\l6base2.pal > nul
echo palette\l6data\l6_%num2%.pal NLevels\l6data\l6base2.pal
copy palette\l6data\l6_%num3%.pal %savedir%\NLevels\l6data\l6base3.pal > nul
echo palette\l6data\l6_%num3%.pal NLevels\l6data\l6base3.pal
copy palette\l6data\l6_%num4%.pal %savedir%\NLevels\l6data\l6base4.pal > nul
echo palette\l6data\l6_%num4%.pal NLevels\l6data\l6base4.pal
copy palette\l6data\l6_%num5%.pal %savedir%\NLevels\l6data\l6base5.pal > nul
echo palette\l6data\l6_%num5%.pal NLevels\l6data\l6base5.pal
IF %param1% == lua (
echo --------------
echo LUA random end
echo --------------
) ELSE (
echo ----------------
echo BATCH random end
echo ----------------
)
::clear vars
set num1=
set num2=
set num3=
set num4=
set num5=
SET /a counter=1
:clearloop
SET param%counter%=
SET /a counter+=1
IF DEFINED param%counter% GOTO clearloop
SET counter=
start devilutionx.exe --save-dir %savedir% --config-dir %configdir%