-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathleveleditor.cmd
480 lines (437 loc) · 15.1 KB
/
leveleditor.cmd
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
@ECHO OFF
:leveleditor.cmd [<"Integer": Level Selection> or <"OUT": Disable Terminal Support>]
IF NOT DEFINED VERCODE EXIT
IF NOT %1.==OUT. (
PUSHD "../.."
IF NOT %1.==. (
SET SELECTED=%1
)
)
:EDITOR
COLOR 0F
MODE CON:COLS=%COLS% LINES=%LINES%
IF NOT DEFINED SELECTED GOTO EXIT
START /MIN "RichManager" "%RichManager%" State=Level %SELECTED% - Chapter %CHAPTER%;Details=Editing a level;LargeImage=preview_battle;LargeImageTooltip=;SmallImage=icon;SmallImageTooltip=Battles of Batch
ECHO.[2J[21;42H҉ Preparing Your Amazing Battle[17D[1B[s
ECHO.[u 0%%
CALL "%SCRIPTS_GAME%\loader.cmd"
:DISPLAY
SET LOAD.ERR=
(
CLS
ECHO.[?25l[0m[H.-------------------.-----------------------------------------------------------------------------------------------.
ECHO.^| Press %RGB.PINK%Q[0m to return ^|[95C^|
ECHO.^|-------------------'[95C^|
FOR /L %%I IN (1, 1, 44) DO ECHO.^|[115C^|
ECHO.'-------------------------------------------------------------------------------------------------------------------'[2A
ECHO.%LOC.HP.P%
ECHO.[2C ___
ECHO.[2C //_\\_
ECHO.[2C ."\\ ".
ECHO.[2C / \
ECHO.[2C ^| \_
ECHO.[2C ^| ,--.-.^)
ECHO.[2C \ / o \o\
ECHO.[2C /\/\ \ /_/
ECHO.[2C (_. `--'__^)
ECHO.[2C ^| .-' \
ECHO.[2C ^| .-'. ^)
ECHO.[2C ^| ( _/--.-'
ECHO.[2C ^| `.___.'
ECHO.[2C ^|
ECHO.[47;3H^| ^|[47;3H[1mYour HP: %RGB.GREEN%%PLAYER.HP.NOW%[0m%RGB.GRAY%/%PLAYER.HP.FULL%[0m [47;40HYou dealt %PLAYER.ATTACK.AMOUNT% DMG to %PLAYER.ATTACK.ENEMY% - CRIT: %ATK.CRIT%[47;90HEnemy Total HP: %ENEMY.HP.NOW.T%/%ENEMY.HP.FULL.T%
ECHO.[46;3H[1mYour AV: %RGB.PURPLE%%AV.PLAYER%[0m ^(Your Turn^)
ECHO.[2;45H[s:---------: HELP - ^? :---------:
ECHO.[u[1B: %RGB.COIN%Select an enemy to edit:[0m :
ECHO.[u[2B: Navigate using %RGB.CYAN%I[0m and %RGB.CYAN%K[0m. :
ECHO.[u[3B: Press %RGB.CYAN%C[0m to create an enemy![0m :
ECHO.[u[4B:------------------------------:
ECHO.[u[5B %RGB.AQUAMARINE%^> Edit Mode ^<[0m
ECHO.[42;4H[s
ECHO.[u[1B:------------------------------------:
ECHO.[u[2B %RGB.GREEN%Once done[0m[1m, press %RGB.CYAN%CTRL[0m[1m + %RGB.CYAN%S[0m[1m to save.[0m
ECHO.[u[3B:------------------------------------:
ECHO.[32;3H .-----------: %RGB.PURPLE%GUIDE[0m :-----------.[1m
ECHO.[3C Use [4mI[24m ^& [4mK[24m to %RGB.YELLOW%select[0m[1m an enemy.
ECHO.[3C Use [4mW[24m [4mA[24m [4mS[24m ^& [4mD[24m to %RGB.YELLOW%move[0m[1m the enemy.
ECHO.[3C Use [4mJ[24m ^& [4mL[24m to %RGB.YELLOW%move[0m[1m an enemy left
ECHO.[3C or right by just one character.
ECHO.[3C Use [4mC[24m to %RGB.YELLOW%create[0m[1m a new enemy.
ECHO.[3C Use [4mE[24m to %RGB.YELLOW%edit[0m[1m an enemy's %RGB.CYAN%data[0m[1m.
ECHO.[3C Use [4mCTRL[24m + [4mX[24m to %RGB.RED%delete[0m[1m an enemy.
ECHO.[3C Use [4mR[24m to %RGB.YELLOW%refresh[0m[1m the menu.
ECHO.[3C Use [4mCTRL[24m + [4mR[24m to %RGB.YELLOW%undo[0m[1m all changes.
)
:: Calculate the HP of all enemies together
SET ENEMY.HP.NOW.T=
FOR /L %%I IN (1,1,%EN.MAX%) DO (
SET /A ENEMY.HP.NOW.T+=ENEMY.HP.NOW.%%I
)
:RE
:: Display the HP bars
CALL "%SCRIPTS_GAME%\hpbar_now.cmd"
CALL :BATTLE-DISPLAY_CHOICE
%CHOICE%
IF %CHOICE.INPUT%.==. GOTO DISPLAY
IF /I "%CHOICE.INPUT%"=="K" (
CALL :BATTLE-S_CHOICE
CALL :BATTLE-DISPLAY_CHOICE
)
IF /I "%CHOICE.INPUT%"=="I" (
CALL :BATTLE-W_CHOICE
CALL :BATTLE-DISPLAY_CHOICE
)
IF /I "%CHOICE.INPUT%"=="J" (
CALL :MOVE LEFT
)
IF /I "%CHOICE.INPUT%"=="L" (
CALL :MOVE RIGHT
)
IF /I "%CHOICE.INPUT%"=="W" (
CALL :MOVE UP
)
IF /I "%CHOICE.INPUT%"=="S" (
CALL :MOVE DOWN
)
IF /I "%CHOICE.INPUT%"=="A" (
CALL :MOVE LEFT +1
)
IF /I "%CHOICE.INPUT%"=="D" (
CALL :MOVE RIGHT +1
)
IF /I "%CHOICE.INPUT%"=="C" (
CALL :CREATE
GOTO DISPLAY
)
IF /I "%CHOICE.INPUT%"=="E" (
CALL :EDIT
GOTO DISPLAY
)
IF /I "%CHOICE.INPUT%"=="" (
CALL :DELETE
GOTO DISPLAY
)
IF /I "%CHOICE.INPUT%"=="" (
CALL :EXPORT
) ELSE ECHO.[44;44H
IF /I "%CHOICE.INPUT%"=="R" (
MODE CON:COLS=%COLS% LINES=%LINES%
GOTO DISPLAY
)
IF /I %CHOICE.INPUT%==TIMEOUT (MODE CON:COLS=%COLS% LINES=%LINES%&GOTO DISPLAY)
IF /I %CHOICE.INPUT%== (
GOTO EDITOR
)
IF /I "%CHOICE.INPUT%"=="Q" (
GOTO EXIT
)
GOTO RE
:EDIT
SET TMP.NAV=20
:EDIT-RE
SET LOAD.ERR=
COLOR 08
SETLOCAL ENABLEDELAYEDEXPANSION
ECHO.[?25l[0m[18;35H
ECHO.[42C .-------------------------.
ECHO.[42C:-: :-:[26D%RGB.CYAN%Type: %RGB.YELLOW%!ENEMY.TYPE.%INPUTATK%![0m
ECHO.[42C : - - - - - - - - :
ECHO.[42C:-: :-:[27D%RGB.CYAN%Level: %RGB.YELLOW%!ENEMY.LVL.%INPUTATK%![0m
ECHO.[42C '-------------------------'
ENDLOCAL
ECHO.
ECHO.[49C%RGB.GRAY%[Use A to select][0m
ECHO.[45C%RGB.GRAY%[Use W and S to navigate][0m
ECHO.[48C%RGB.GRAY%[Press Q to return][0m
ECHO.[%TMP.NAV%;41H[1m^>[s[33C^<[0m
%CHOICE%
IF %CHOICE.INPUT%.==. GOTO EDIT-RE
IF /I %CHOICE.INPUT%==Q EXIT /B 0
IF /I %CHOICE.INPUT%==CANCEL EXIT /B 0
IF /I %CHOICE.INPUT%==W IF NOT %TMP.NAV% LEQ 20 SET /A TMP.NAV-=2
IF /I %CHOICE.INPUT%==S IF NOT %TMP.NAV% GEQ 22 SET /A TMP.NAV+=2
IF /I NOT %CHOICE.INPUT%==A GOTO EDIT-RE
:EDIT-INPUT
SET /A "TMP.SELECTED=((%TMP.NAV% - 20) / 2) + 1"
SETLOCAL ENABLEDELAYEDEXPANSION
%INPUT% "PROMPT=[u[?25h[12C[0m[1m" "length=8"
ENDLOCAL&SET UDERFINE=%UDERFINE: =_%
IF "%UDERFINE%"==")_" GOTO EDIT-INPUT
IF %TMP.SELECTED% EQU 1 (
CALL SET TMP.OLDTYPE=%%ENEMY.TYPE.%INPUTATK%%%
SET TMP.TYPE=%UDERFINE%
) ELSE (
SET TMP.TYPE=%%ENEMY.TYPE.%INPUTATK%%%
)
IF %TMP.SELECTED% EQU 2 (
SETLOCAL ENABLEDELAYEDEXPANSION
ECHO %UDERFINE%| FINDSTR /R "^[1-9][0-9]*$">NUL
IF ERRORLEVEL 1 (
CALL "%DEV_ERR%" Error registering enemy:Level is not an integer.
GOTO EDIT-RE
)
ENDLOCAL
SET TMP.LVL=%UDERFINE%
) ELSE SET TMP.LVL=%%ENEMY.LVL.%INPUTATK%%%
for /l %%I in (1,1,7) do (
SET "EN.%INPUTATK%.LINE.%%I="
)
:: Register the enemy
CALL "%ENEMY%" %TMP.TYPE% %INPUTATK% %TMP.LVL%
IF NOT DEFINED EN.%INPUTATK%.LINE.1 (
:: If it doesn't exist, return.
CALL "%DEV_ERR%" Error registering enemy:Invalid Enemy.
CALL "%ENEMY%" %TMP.OLDTYPE% %INPUTATK% %TMP.LVL%
GOTO EDIT-RE
)
IF DEFINED LOAD.ERR GOTO EDIT-RE
:: Setup for the enemy.
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "TOKENS=1-2 DELIMS=," %%A IN ("!ENEMY.HP.AMOUNT.%INPUTATK%!") DO (
ENDLOCAL
CALL :RAND %INPUTATK% %%A %%B
)
SET /A ENEMY.HP.FULL.%INPUTATK%=ENEMY.HP.NOW.%INPUTATK%
FOR /L %%X IN (90,-10,10) DO CALL :CREATE-HPBAR %INPUTATK% %%X %%ENEMY.HP.FULL.%INPUTATK%%%
COLOR 08
GOTO EDIT-RE
:DELETE
IF %EN.MAX% LEQ 1 EXIT /B 0
FOR /F "TOKENS=3DELIMS=." %%1 IN ('SET ENEMY.TYPE.') DO (
CALL :FIX-INDETIFIERS %INPUTATK% %%1
)
SET "ENEMY.TYPE.%EN.MAX%="
SET ENEMY.HP.NOW.%EN.MAX%=
SET /A EN.MAX-=1
SET /A INPUTATK=1
EXIT /B 0
:FIX-INDETIFIERS
SET /A TMP.PREV_CNT=%2-1
IF NOT %2 GTR %1 EXIT /B 0
SETLOCAL ENABLEDELAYEDEXPANSION
SET TMP.TYPE=!ENEMY.TYPE.%2!
SET TMP.LVL=!ENEMY.LVL.%2!
ENDLOCAL&CALL "%ENEMY%" %TMP.TYPE% %TMP.PREV_CNT% %TMP.LVL%
SET /A ENEMY.HP.NOW.%TMP.PREV_CNT%=ENEMY.HP.NOW.%2
SET /A ENEMY.HP.FULL.%TMP.PREV_CNT%=ENEMY.HP.NOW.%TMP.PREV_CNT%
SET /A LOC.W%TMP.PREV_CNT%=LOC.W%2
SET /A LOC.H%TMP.PREV_CNT%=LOC.H%2
CALL :CREATE-LOCATION %TMP.PREV_CNT% %%LOC.W%2%% %%LOC.H%2%%
FOR /L %%X IN (90,-10,10) DO CALL :CREATE-HPBAR %EN.MAX% %%X %%ENEMY.HP.FULL.%EN.MAX%%%
EXIT /B 0
:CREATE
(
COLOR 08
ECHO.[?25l[0m[18;35H┏━━━━━━━━━━━━━━━━━━━┫%RGB.CYAN%INPUT[0m┠━━━━━━━━━━━━━━━━━━━┓
ECHO.[34C┃ ┃
ECHO.[34C┃ What type should the enemy be^? ┃
ECHO.[34C┃ See %RGB.CYAN%enemy.cmd[0m for reference. ┃
ECHO.[34C┃ ┃
ECHO.[34C┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┨
ECHO.[34C┃ ^> [s ^< ┃
ECHO.[34C┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
ECHO.
ECHO.[43C%RGB.GRAY%[Enter Q or CANCEL to cancel]
)
SETLOCAL ENABLEDELAYEDEXPANSION
%INPUT% "PROMPT=[0m[?25h[u[1m" "length=8"
ENDLOCAL&SET TMP.TYPE=%UDERFINE: =_%
IF "%TMP.TYPE%"==")_" GOTO CREATE
IF /I %TMP.TYPE%==Q EXIT /B 0
IF /I %TMP.TYPE%==CANCEL EXIT /B 0
(
COLOR 08
ECHO.[?25l[0m[18;35H┏━━━━━━━━━━━━━━━━━━━┫%RGB.CYAN%INPUT[0m┠━━━━━━━━━━━━━━━━━━━┓
ECHO.[34C┃ ┃
ECHO.[34C┃ What level should the enemy be^? ┃
ECHO.[34C┃ See %RGB.CYAN%enemy.cmd[0m for reference. ┃
ECHO.[34C┃ ┃
ECHO.[34C┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┨
ECHO.[34C┃ ^> [s ^< ┃
ECHO.[34C┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
ECHO.
ECHO.[43C%RGB.GRAY%[Enter Q or CANCEL to cancel]
)
SETLOCAL ENABLEDELAYEDEXPANSION
%INPUT% "PROMPT=[0m[?25h[u[1m" "length=3"
ENDLOCAL&SET TMP.LVL=%UDERFINE: =_%
IF "%TMP.LVL%"==")_" GOTO CREATE
IF /I %TMP.LVL%==Q EXIT /B 0
IF /I %TMP.LVL%==CANCEL EXIT /B 0
:: Register Enemy
SET /A EN.MAX+=1
SET "EN.%EN.MAX%.LINE.1=
SET "EN.%EN.MAX%.LINE.2=
SET "EN.%EN.MAX%.LINE.3=
SET "EN.%EN.MAX%.LINE.4=
SET "EN.%EN.MAX%.LINE.5=
SET "EN.%EN.MAX%.LINE.6=
SET "EN.%EN.MAX%.LINE.7=
CALL "%ENEMY%" %TMP.TYPE% %EN.MAX% %TMP.LVL%
IF NOT DEFINED EN.%EN.MAX%.LINE.1 (
CALL "%DEV_ERR%" Error registering enemy:Invalid Enemy.
SET LOAD.ERR=TRUE
)
IF DEFINED LOAD.ERR (
SET "ENEMY.TYPE.%EN.MAX%="
SET ENEMY.HP.NOW.%EN.MAX%=
SET /A EN.MAX-=1
EXIT /B 0
)
SET INPUTATK=%EN.MAX%
:: Data Setup
SET /A AV.%EN.MAX%=%EN.MAX%*10
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "TOKENS=1-2 DELIMS=," %%A IN ("!ENEMY.HP.AMOUNT.%EN.MAX%!") DO (
ENDLOCAL
CALL :RAND %EN.MAX% %%A %%B
)
SET /A ENEMY.HP.FULL.%EN.MAX%=ENEMY.HP.NOW.%EN.MAX%
SET /A ENEMY.HP.FULL.T+=%%2
SET LOC.W%EN.MAX%=55
SET LOC.H%EN.MAX%=20
CALL :CREATE-LOCATION %EN.MAX% %%LOC.W%EN.MAX%%% %%LOC.H%EN.MAX%%%
FOR /L %%X IN (90,-10,10) DO CALL :CREATE-HPBAR %EN.MAX% %%X %%ENEMY.HP.FULL.%EN.MAX%%%
EXIT /B 0
:MOVE
CALL :CLEAR_INFO_SELECTION
IF %1==LEFT (
SET /A LOC.W%INPUTATK%-=1%2
)
IF %1==RIGHT (
SET /A LOC.W%INPUTATK%+=1%2
ECHO.%TMP.LOC_HP_OLD%[3B[2D [3B[4D [1B[4D
)
IF %1==UP (
SET /A LOC.H%INPUTATK%-=1%2
)
IF %1==DOWN (
SET /A LOC.H%INPUTATK%+=1%2
)
SETLOCAL ENABLEDELAYEDEXPANSION
IF !LOC.H%INPUTATK%! LEQ 3 (
ENDLOCAL
CALL :MOVE-UNDO %1 %2
) ELSE IF !LOC.H%INPUTATK%! GEQ 40 (
ENDLOCAL
CALL :MOVE-UNDO %1 %2
) ELSE IF !LOC.W%INPUTATK%! LEQ 21 (
ENDLOCAL
CALL :MOVE-UNDO %1 %2
) ELSE IF !LOC.W%INPUTATK%! GEQ 94 (
ENDLOCAL
CALL :MOVE-UNDO %1 %2
) ELSE ENDLOCAL
CALL :CREATE-LOCATION %INPUTATK% %%LOC.W%INPUTATK%%% %%LOC.H%INPUTATK%%%
EXIT /B 0
:MOVE-UNDO
IF %1==LEFT (
SET /A LOC.W%INPUTATK%+=1%2
)
IF %1==RIGHT (
SET /A LOC.W%INPUTATK%-=1%2
)
IF %1==UP (
SET /A LOC.H%INPUTATK%+=1%2
)
IF %1==DOWN (
SET /A LOC.H%INPUTATK%-=1%2
)
EXIT /B 0
:CREATE-LOCATION
SET TMP=0
SET LOC.EN.%1=[%3;%2H
SET /A TMP=%2-1
SET MOV.EN.%1=[%TMP%C
SET /A TMP=%3-1
SET LOC.HP.%1=[%TMP%;%2H
EXIT /B 0
:EXPORT
SETLOCAL ENABLEDELAYEDEXPANSION
(
ECHO.IF NOT DEFINED VERCODE EXIT
ECHO.
ECHO.::REWARDS
ECHO.SET REWARD.MONEY=%REWARD.MONEY%
ECHO.SET REWARD.XP=%REWARD.XP%
ECHO.
ECHO.::ENEMIES
FOR /L %%I IN (1,1,%EN.MAX%) DO (
ECHO.CALL "%%ENEMY%%" !ENEMY.TYPE.%%I! %%I !ENEMY.LVL.%%I!
)
ECHO.
ECHO.::DISPLAY
FOR /L %%I IN (1,1,%EN.MAX%) DO (
ECHO.SET LOC.W%%I=!LOC.W%%I!
ECHO.SET LOC.H%%I=!LOC.H%%I!
ECHO.
)
ECHO.SET LOC.WP=%LOC.WP%
ECHO.SET LOC.HP=%LOC.HP%
ECHO.
ECHO.::LOOT TABLE
FOR /L %%I IN (1,1,%LOOT.MAX%) DO (
ECHO.SET LOOT.%%I=!LOOT.%%I!
ECHO.SET LOOT.%%I.X=!LOOT.%%I.X!
ECHO.SET LOOT.%%I.SAV=!LOOT.%%I.SAV!
ECHO.SET LOOT.%%I.ONCE=!LOOT.%%I.ONCE!
ECHO.
)
ECHO.::END
ECHO.EXIT /B 0
)>"data\levels\lvl%SELECTED%\setup.cmd"
ECHO.[44;44H%RGB.GREEN%√ %RGB.TRUE%Level has been exported at "lvl%SELECTED%\setup.cmd"[0m
ENDLOCAL
EXIT /B 0
:BATTLE-S_CHOICE
SETLOCAL ENABLEDELAYEDEXPANSION
IF %INPUTATK% GTR %EN.MAX% (SET INPUTATK=1) ELSE SET /A INPUTATK+=1
:BATTLE-S_CHOICE-RE
IF !ENEMY.HP.NOW.%INPUTATK%! EQU 0 IF %INPUTATK% GTR %EN.MAX% (SET INPUTATK=1) ELSE (
SET /A INPUTATK+=1
GOTO BATTLE-S_CHOICE-RE
)
IF !ENEMY.HP.NOW.%INPUTATK%! EQU 0 GOTO :BATTLE-S_CHOICE-RE
ENDLOCAL&&SET INPUTATK=%INPUTATK%
EXIT /B 0
:BATTLE-W_CHOICE
SETLOCAL ENABLEDELAYEDEXPANSION
IF %INPUTATK% LSS 1 (SET INPUTATK=%EN.MAX%) ELSE SET /A INPUTATK-=1
:BATTLE-W_CHOICE-RE
IF !ENEMY.HP.NOW.%INPUTATK%! EQU 0 IF %INPUTATK% LSS 1 (
SET INPUTATK=%EN.MAX%
) ELSE (
SET /A INPUTATK-=1
GOTO BATTLE-W_CHOICE-RE
)
IF !ENEMY.HP.NOW.%INPUTATK%! EQU 0 GOTO :BATTLE-W_CHOICE-RE
ENDLOCAL&&SET INPUTATK=%INPUTATK%
EXIT /B 0
:BATTLE-DISPLAY_CHOICE
SETLOCAL ENABLEDELAYEDEXPANSION
IF DEFINED TMP.LOC_HP_OLD (
:: Clears the info that appear on the right side when focusing on an enemy.
ECHO.!LOC.HP.%INPUTATK%![2D [12C !LOC.HP.%INPUTATK%![1A !LOC.HP.%INPUTATK%![8B %TMP.LOC_HP_OLD%[4B[2D [1B[3D %TMP.LOC_HP_OLD%[11C[5B %TMP.LOC_HP_OLD%[11C[4B %TMP.LOC_HP_OLD%[11C[3B [0m%TMP.LOC_HP_OLD%[11C[2B
)
SET TMP.LOC_HP_OLD=!LOC.HP.%INPUTATK%!
FOR /F "TOKENS=1-2 DELIMS=," %%A IN ("!ENEMY.ATK.AMOUNT.%INPUTATK%!") DO (
SET /A "ENEMY.MAXP_ATK=%%A+%%B"
SET /A "ENEMY.MINP_ATK=%%B"
)
ECHO.!LOC.HP.%INPUTATK%![4B[2D[4m^|[0m [0m^>[1B[3D' ^>!LOC.HP.%INPUTATK%![11C[5B%RGB.PURPLE%AV:[0m !AV.%INPUTATK%!!LOC.HP.%INPUTATK%![11C[4B%RGB%245;151;151mAtk: [0m!ENEMY.MINP_ATK!~!ENEMY.MAXP_ATK!!LOC.HP.%INPUTATK%![11C[3B%RGB%176;225;187mHP: [0m!ENEMY.HP.NOW.%INPUTATK%!!LOC.HP.%INPUTATK%![11C[2B%RGB.CYAN%Lvl: [0m!ENEMY.LVL.%INPUTATK%!
ENDLOCAL&&SET TMP.LOC_HP_OLD=%TMP.LOC_HP_OLD%
EXIT /B 0
:CREATE-HPBAR
SET CNT1=%1&SET CNT2=%2&SET TMP_ENEMY.HP.FULL=%3
SET /A "ENEMY.HOLO.HP.%CNT1%.%CNT2%=%TMP_ENEMY.HP.FULL%00/100"&SET /A "ENEMY.HOLO.HP.%CNT1%.%CNT2%=ENEMY.HOLO.HP.%CNT1%.%CNT2%*(100-%CNT2%)"&SET /A "ENEMY.HOLO.HP.%CNT1%.%CNT2%=%TMP_ENEMY.HP.FULL%00-ENEMY.HOLO.HP.%CNT1%.%CNT2%"&SET /A "ENEMY.HOLO.HP.%CNT1%.%CNT2%=ENEMY.HOLO.HP.%CNT1%.%CNT2%/100"
EXIT /B 0
:RAND
SET /A "ENEMY.HP.NOW.%1=%random% %% %2 %3"
EXIT /B 0
:EXIT
IF NOT %1.==OUT. (
POPD
CLEAR
ECHO ON
)
@EXIT /B 0