hrbattle 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -0
- package/dist/battle/battleCore.d.ts +83 -0
- package/dist/battle/battleCore.js +779 -0
- package/dist/battle/config/json/designed-buffs.json +608 -0
- package/dist/battle/config/json/designed-hero-skill-books.json +146 -0
- package/dist/battle/config/json/designed-monster-skill-books.json +308 -0
- package/dist/battle/config/json/designed-roster.json +438 -0
- package/dist/battle/config/json/designed-skill-templates.json +81 -0
- package/dist/battle/config/jsonConfigLoader.d.ts +26 -0
- package/dist/battle/config/jsonConfigLoader.js +77 -0
- package/dist/battle/effectSystem.d.ts +26 -0
- package/dist/battle/effectSystem.js +175 -0
- package/dist/battle/eventBus.d.ts +8 -0
- package/dist/battle/eventBus.js +20 -0
- package/dist/battle/formula.d.ts +19 -0
- package/dist/battle/formula.js +92 -0
- package/dist/battle/logger.d.ts +28 -0
- package/dist/battle/logger.js +66 -0
- package/dist/battle/random.d.ts +6 -0
- package/dist/battle/random.js +16 -0
- package/dist/battle/script/designedScripts.d.ts +2 -0
- package/dist/battle/script/designedScripts.js +1013 -0
- package/dist/battle/script/monsterScripts.d.ts +2 -0
- package/dist/battle/script/monsterScripts.js +277 -0
- package/dist/battle/script/monsterScripts18xx.d.ts +2 -0
- package/dist/battle/script/monsterScripts18xx.js +330 -0
- package/dist/battle/script/monsterScripts19xx.d.ts +2 -0
- package/dist/battle/script/monsterScripts19xx.js +271 -0
- package/dist/battle/script/monsterScripts19xxPart2.d.ts +2 -0
- package/dist/battle/script/monsterScripts19xxPart2.js +400 -0
- package/dist/battle/skillEngine.d.ts +36 -0
- package/dist/battle/skillEngine.js +246 -0
- package/dist/battle/targeting.d.ts +3 -0
- package/dist/battle/targeting.js +38 -0
- package/dist/battle/turnbar.d.ts +8 -0
- package/dist/battle/turnbar.js +40 -0
- package/dist/battle/types.d.ts +302 -0
- package/dist/battle/types.js +1 -0
- package/dist/cocos-adapter/BattleFacade.d.ts +8 -0
- package/dist/cocos-adapter/BattleFacade.js +22 -0
- package/dist/cocos-adapter/clientBattleResult.d.ts +127 -0
- package/dist/cocos-adapter/clientBattleResult.js +413 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +8 -0
- package/package.json +32 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
{
|
|
2
|
+
"heroStatProfiles": {
|
|
3
|
+
"cook": {
|
|
4
|
+
"Mhp": 184,
|
|
5
|
+
"Def": 66,
|
|
6
|
+
"Att": 73,
|
|
7
|
+
"Spd": 97,
|
|
8
|
+
"pER": 0,
|
|
9
|
+
"pAR": 0,
|
|
10
|
+
"pEHR": 0,
|
|
11
|
+
"pERes": 0,
|
|
12
|
+
"pBSDI": 0,
|
|
13
|
+
"pESDI": 0,
|
|
14
|
+
"pFSDI": 0,
|
|
15
|
+
"pCTR": 0,
|
|
16
|
+
"pCTD": 150,
|
|
17
|
+
"pCTR_Def": 0,
|
|
18
|
+
"pCTD_Def": 0,
|
|
19
|
+
"pHE": 0,
|
|
20
|
+
"pFDI": 0,
|
|
21
|
+
"pFDI_Def": 0,
|
|
22
|
+
"pTDI": 0,
|
|
23
|
+
"pTDI_Def": 0,
|
|
24
|
+
"pWDI": 0,
|
|
25
|
+
"pWDI_Def": 0,
|
|
26
|
+
"pRDI": 0,
|
|
27
|
+
"pRDI_Def": 0,
|
|
28
|
+
"pADI": 0,
|
|
29
|
+
"pADI_Def": 0,
|
|
30
|
+
"pLDI": 0,
|
|
31
|
+
"pLDI_Def": 0,
|
|
32
|
+
"pDDI": 0,
|
|
33
|
+
"pDDI_Def": 0,
|
|
34
|
+
"pIM": 0,
|
|
35
|
+
"pITM": 0,
|
|
36
|
+
"pVulnerability": 0
|
|
37
|
+
},
|
|
38
|
+
"miaoluo": {
|
|
39
|
+
"Mhp": 121,
|
|
40
|
+
"Def": 56,
|
|
41
|
+
"Att": 92,
|
|
42
|
+
"Spd": 109,
|
|
43
|
+
"pER": 0,
|
|
44
|
+
"pAR": 0,
|
|
45
|
+
"pEHR": 0,
|
|
46
|
+
"pERes": 0,
|
|
47
|
+
"pBSDI": 0,
|
|
48
|
+
"pESDI": 0,
|
|
49
|
+
"pFSDI": 0,
|
|
50
|
+
"pCTR": 0,
|
|
51
|
+
"pCTD": 150,
|
|
52
|
+
"pCTR_Def": 0,
|
|
53
|
+
"pCTD_Def": 0,
|
|
54
|
+
"pHE": 0,
|
|
55
|
+
"pFDI": 0,
|
|
56
|
+
"pFDI_Def": 0,
|
|
57
|
+
"pTDI": 0,
|
|
58
|
+
"pTDI_Def": 0,
|
|
59
|
+
"pWDI": 0,
|
|
60
|
+
"pWDI_Def": 0,
|
|
61
|
+
"pRDI": 0,
|
|
62
|
+
"pRDI_Def": 0,
|
|
63
|
+
"pADI": 0,
|
|
64
|
+
"pADI_Def": 0,
|
|
65
|
+
"pLDI": 0,
|
|
66
|
+
"pLDI_Def": 0,
|
|
67
|
+
"pDDI": 0,
|
|
68
|
+
"pDDI_Def": 0,
|
|
69
|
+
"pIM": 0,
|
|
70
|
+
"pITM": 0,
|
|
71
|
+
"pVulnerability": 0
|
|
72
|
+
},
|
|
73
|
+
"kesi": {
|
|
74
|
+
"Mhp": 147,
|
|
75
|
+
"Def": 66,
|
|
76
|
+
"Att": 92,
|
|
77
|
+
"Spd": 100,
|
|
78
|
+
"pER": 0,
|
|
79
|
+
"pAR": 0,
|
|
80
|
+
"pEHR": 0,
|
|
81
|
+
"pERes": 0,
|
|
82
|
+
"pBSDI": 0,
|
|
83
|
+
"pESDI": 0,
|
|
84
|
+
"pFSDI": 0,
|
|
85
|
+
"pCTR": 0,
|
|
86
|
+
"pCTD": 150,
|
|
87
|
+
"pCTR_Def": 0,
|
|
88
|
+
"pCTD_Def": 0,
|
|
89
|
+
"pHE": 0,
|
|
90
|
+
"pFDI": 0,
|
|
91
|
+
"pFDI_Def": 0,
|
|
92
|
+
"pTDI": 0,
|
|
93
|
+
"pTDI_Def": 0,
|
|
94
|
+
"pWDI": 0,
|
|
95
|
+
"pWDI_Def": 0,
|
|
96
|
+
"pRDI": 0,
|
|
97
|
+
"pRDI_Def": 0,
|
|
98
|
+
"pADI": 0,
|
|
99
|
+
"pADI_Def": 0,
|
|
100
|
+
"pLDI": 0,
|
|
101
|
+
"pLDI_Def": 0,
|
|
102
|
+
"pDDI": 0,
|
|
103
|
+
"pDDI_Def": 0,
|
|
104
|
+
"pIM": 0,
|
|
105
|
+
"pITM": 0,
|
|
106
|
+
"pVulnerability": 0
|
|
107
|
+
},
|
|
108
|
+
"blade": {
|
|
109
|
+
"Mhp": 126,
|
|
110
|
+
"Def": 49,
|
|
111
|
+
"Att": 87,
|
|
112
|
+
"Spd": 115,
|
|
113
|
+
"pER": 0,
|
|
114
|
+
"pAR": 0,
|
|
115
|
+
"pEHR": 0,
|
|
116
|
+
"pERes": 0,
|
|
117
|
+
"pBSDI": 0,
|
|
118
|
+
"pESDI": 0,
|
|
119
|
+
"pFSDI": 0,
|
|
120
|
+
"pCTR": 0,
|
|
121
|
+
"pCTD": 150,
|
|
122
|
+
"pCTR_Def": 0,
|
|
123
|
+
"pCTD_Def": 0,
|
|
124
|
+
"pHE": 0,
|
|
125
|
+
"pFDI": 0,
|
|
126
|
+
"pFDI_Def": 0,
|
|
127
|
+
"pTDI": 0,
|
|
128
|
+
"pTDI_Def": 0,
|
|
129
|
+
"pWDI": 0,
|
|
130
|
+
"pWDI_Def": 0,
|
|
131
|
+
"pRDI": 0,
|
|
132
|
+
"pRDI_Def": 0,
|
|
133
|
+
"pADI": 0,
|
|
134
|
+
"pADI_Def": 0,
|
|
135
|
+
"pLDI": 0,
|
|
136
|
+
"pLDI_Def": 0,
|
|
137
|
+
"pDDI": 0,
|
|
138
|
+
"pDDI_Def": 0,
|
|
139
|
+
"pIM": 0,
|
|
140
|
+
"pITM": 0,
|
|
141
|
+
"pVulnerability": 0
|
|
142
|
+
},
|
|
143
|
+
"kleiwu": {
|
|
144
|
+
"Mhp": 142,
|
|
145
|
+
"Def": 59,
|
|
146
|
+
"Att": 102,
|
|
147
|
+
"Spd": 96,
|
|
148
|
+
"pER": 0,
|
|
149
|
+
"pAR": 0,
|
|
150
|
+
"pEHR": 0,
|
|
151
|
+
"pERes": 0,
|
|
152
|
+
"pBSDI": 0,
|
|
153
|
+
"pESDI": 0,
|
|
154
|
+
"pFSDI": 0,
|
|
155
|
+
"pCTR": 0,
|
|
156
|
+
"pCTD": 150,
|
|
157
|
+
"pCTR_Def": 0,
|
|
158
|
+
"pCTD_Def": 0,
|
|
159
|
+
"pHE": 0,
|
|
160
|
+
"pFDI": 0,
|
|
161
|
+
"pFDI_Def": 0,
|
|
162
|
+
"pTDI": 0,
|
|
163
|
+
"pTDI_Def": 0,
|
|
164
|
+
"pWDI": 0,
|
|
165
|
+
"pWDI_Def": 0,
|
|
166
|
+
"pRDI": 0,
|
|
167
|
+
"pRDI_Def": 0,
|
|
168
|
+
"pADI": 0,
|
|
169
|
+
"pADI_Def": 0,
|
|
170
|
+
"pLDI": 0,
|
|
171
|
+
"pLDI_Def": 0,
|
|
172
|
+
"pDDI": 0,
|
|
173
|
+
"pDDI_Def": 0,
|
|
174
|
+
"pIM": 0,
|
|
175
|
+
"pITM": 0,
|
|
176
|
+
"pVulnerability": 0
|
|
177
|
+
},
|
|
178
|
+
"rudy": {
|
|
179
|
+
"Mhp": 190,
|
|
180
|
+
"Def": 89,
|
|
181
|
+
"Att": 73,
|
|
182
|
+
"Spd": 92,
|
|
183
|
+
"pER": 0,
|
|
184
|
+
"pAR": 0,
|
|
185
|
+
"pEHR": 0,
|
|
186
|
+
"pERes": 0,
|
|
187
|
+
"pBSDI": 0,
|
|
188
|
+
"pESDI": 0,
|
|
189
|
+
"pFSDI": 0,
|
|
190
|
+
"pCTR": 0,
|
|
191
|
+
"pCTD": 150,
|
|
192
|
+
"pCTR_Def": 0,
|
|
193
|
+
"pCTD_Def": 0,
|
|
194
|
+
"pHE": 0,
|
|
195
|
+
"pFDI": 0,
|
|
196
|
+
"pFDI_Def": 0,
|
|
197
|
+
"pTDI": 0,
|
|
198
|
+
"pTDI_Def": 0,
|
|
199
|
+
"pWDI": 0,
|
|
200
|
+
"pWDI_Def": 0,
|
|
201
|
+
"pRDI": 0,
|
|
202
|
+
"pRDI_Def": 0,
|
|
203
|
+
"pADI": 0,
|
|
204
|
+
"pADI_Def": 0,
|
|
205
|
+
"pLDI": 0,
|
|
206
|
+
"pLDI_Def": 0,
|
|
207
|
+
"pDDI": 0,
|
|
208
|
+
"pDDI_Def": 0,
|
|
209
|
+
"pIM": 0,
|
|
210
|
+
"pITM": 0,
|
|
211
|
+
"pVulnerability": 0
|
|
212
|
+
},
|
|
213
|
+
"luoluo": {
|
|
214
|
+
"Mhp": 168,
|
|
215
|
+
"Def": 82,
|
|
216
|
+
"Att": 81,
|
|
217
|
+
"Spd": 95,
|
|
218
|
+
"pER": 0,
|
|
219
|
+
"pAR": 0,
|
|
220
|
+
"pEHR": 0,
|
|
221
|
+
"pERes": 0,
|
|
222
|
+
"pBSDI": 0,
|
|
223
|
+
"pESDI": 0,
|
|
224
|
+
"pFSDI": 0,
|
|
225
|
+
"pCTR": 0,
|
|
226
|
+
"pCTD": 150,
|
|
227
|
+
"pCTR_Def": 0,
|
|
228
|
+
"pCTD_Def": 0,
|
|
229
|
+
"pHE": 0,
|
|
230
|
+
"pFDI": 0,
|
|
231
|
+
"pFDI_Def": 0,
|
|
232
|
+
"pTDI": 0,
|
|
233
|
+
"pTDI_Def": 0,
|
|
234
|
+
"pWDI": 0,
|
|
235
|
+
"pWDI_Def": 0,
|
|
236
|
+
"pRDI": 0,
|
|
237
|
+
"pRDI_Def": 0,
|
|
238
|
+
"pADI": 0,
|
|
239
|
+
"pADI_Def": 0,
|
|
240
|
+
"pLDI": 0,
|
|
241
|
+
"pLDI_Def": 0,
|
|
242
|
+
"pDDI": 0,
|
|
243
|
+
"pDDI_Def": 0,
|
|
244
|
+
"pIM": 0,
|
|
245
|
+
"pITM": 0,
|
|
246
|
+
"pVulnerability": 0
|
|
247
|
+
},
|
|
248
|
+
"ailisha": {
|
|
249
|
+
"Mhp": 200,
|
|
250
|
+
"Def": 82,
|
|
251
|
+
"Att": 63,
|
|
252
|
+
"Spd": 100,
|
|
253
|
+
"pER": 0,
|
|
254
|
+
"pAR": 0,
|
|
255
|
+
"pEHR": 0,
|
|
256
|
+
"pERes": 0,
|
|
257
|
+
"pBSDI": 0,
|
|
258
|
+
"pESDI": 0,
|
|
259
|
+
"pFSDI": 0,
|
|
260
|
+
"pCTR": 0,
|
|
261
|
+
"pCTD": 150,
|
|
262
|
+
"pCTR_Def": 0,
|
|
263
|
+
"pCTD_Def": 0,
|
|
264
|
+
"pHE": 0,
|
|
265
|
+
"pFDI": 0,
|
|
266
|
+
"pFDI_Def": 0,
|
|
267
|
+
"pTDI": 0,
|
|
268
|
+
"pTDI_Def": 0,
|
|
269
|
+
"pWDI": 0,
|
|
270
|
+
"pWDI_Def": 0,
|
|
271
|
+
"pRDI": 0,
|
|
272
|
+
"pRDI_Def": 0,
|
|
273
|
+
"pADI": 0,
|
|
274
|
+
"pADI_Def": 0,
|
|
275
|
+
"pLDI": 0,
|
|
276
|
+
"pLDI_Def": 0,
|
|
277
|
+
"pDDI": 0,
|
|
278
|
+
"pDDI_Def": 0,
|
|
279
|
+
"pIM": 0,
|
|
280
|
+
"pITM": 0,
|
|
281
|
+
"pVulnerability": 0
|
|
282
|
+
},
|
|
283
|
+
"luolai": {
|
|
284
|
+
"Mhp": 179,
|
|
285
|
+
"Def": 66,
|
|
286
|
+
"Att": 76,
|
|
287
|
+
"Spd": 98,
|
|
288
|
+
"pER": 0,
|
|
289
|
+
"pAR": 0,
|
|
290
|
+
"pEHR": 0,
|
|
291
|
+
"pERes": 0,
|
|
292
|
+
"pBSDI": 0,
|
|
293
|
+
"pESDI": 0,
|
|
294
|
+
"pFSDI": 0,
|
|
295
|
+
"pCTR": 0,
|
|
296
|
+
"pCTD": 150,
|
|
297
|
+
"pCTR_Def": 0,
|
|
298
|
+
"pCTD_Def": 0,
|
|
299
|
+
"pHE": 0,
|
|
300
|
+
"pFDI": 0,
|
|
301
|
+
"pFDI_Def": 0,
|
|
302
|
+
"pTDI": 0,
|
|
303
|
+
"pTDI_Def": 0,
|
|
304
|
+
"pWDI": 0,
|
|
305
|
+
"pWDI_Def": 0,
|
|
306
|
+
"pRDI": 0,
|
|
307
|
+
"pRDI_Def": 0,
|
|
308
|
+
"pADI": 0,
|
|
309
|
+
"pADI_Def": 0,
|
|
310
|
+
"pLDI": 0,
|
|
311
|
+
"pLDI_Def": 0,
|
|
312
|
+
"pDDI": 0,
|
|
313
|
+
"pDDI_Def": 0,
|
|
314
|
+
"pIM": 0,
|
|
315
|
+
"pITM": 0,
|
|
316
|
+
"pVulnerability": 0
|
|
317
|
+
},
|
|
318
|
+
"tier": {
|
|
319
|
+
"Mhp": 142,
|
|
320
|
+
"Def": 62,
|
|
321
|
+
"Att": 87,
|
|
322
|
+
"Spd": 107,
|
|
323
|
+
"pER": 0,
|
|
324
|
+
"pAR": 0,
|
|
325
|
+
"pEHR": 0,
|
|
326
|
+
"pERes": 0,
|
|
327
|
+
"pBSDI": 0,
|
|
328
|
+
"pESDI": 0,
|
|
329
|
+
"pFSDI": 0,
|
|
330
|
+
"pCTR": 0,
|
|
331
|
+
"pCTD": 150,
|
|
332
|
+
"pCTR_Def": 0,
|
|
333
|
+
"pCTD_Def": 0,
|
|
334
|
+
"pHE": 0,
|
|
335
|
+
"pFDI": 0,
|
|
336
|
+
"pFDI_Def": 0,
|
|
337
|
+
"pTDI": 0,
|
|
338
|
+
"pTDI_Def": 0,
|
|
339
|
+
"pWDI": 0,
|
|
340
|
+
"pWDI_Def": 0,
|
|
341
|
+
"pRDI": 0,
|
|
342
|
+
"pRDI_Def": 0,
|
|
343
|
+
"pADI": 0,
|
|
344
|
+
"pADI_Def": 0,
|
|
345
|
+
"pLDI": 0,
|
|
346
|
+
"pLDI_Def": 0,
|
|
347
|
+
"pDDI": 0,
|
|
348
|
+
"pDDI_Def": 0,
|
|
349
|
+
"pIM": 0,
|
|
350
|
+
"pITM": 0,
|
|
351
|
+
"pVulnerability": 0
|
|
352
|
+
},
|
|
353
|
+
"es": {
|
|
354
|
+
"Mhp": 153,
|
|
355
|
+
"Def": 69,
|
|
356
|
+
"Att": 84,
|
|
357
|
+
"Spd": 102,
|
|
358
|
+
"pER": 0,
|
|
359
|
+
"pAR": 0,
|
|
360
|
+
"pEHR": 0,
|
|
361
|
+
"pERes": 0,
|
|
362
|
+
"pBSDI": 0,
|
|
363
|
+
"pESDI": 0,
|
|
364
|
+
"pFSDI": 0,
|
|
365
|
+
"pCTR": 0,
|
|
366
|
+
"pCTD": 150,
|
|
367
|
+
"pCTR_Def": 0,
|
|
368
|
+
"pCTD_Def": 0,
|
|
369
|
+
"pHE": 0,
|
|
370
|
+
"pFDI": 0,
|
|
371
|
+
"pFDI_Def": 0,
|
|
372
|
+
"pTDI": 0,
|
|
373
|
+
"pTDI_Def": 0,
|
|
374
|
+
"pWDI": 0,
|
|
375
|
+
"pWDI_Def": 0,
|
|
376
|
+
"pRDI": 0,
|
|
377
|
+
"pRDI_Def": 0,
|
|
378
|
+
"pADI": 0,
|
|
379
|
+
"pADI_Def": 0,
|
|
380
|
+
"pLDI": 0,
|
|
381
|
+
"pLDI_Def": 0,
|
|
382
|
+
"pDDI": 0,
|
|
383
|
+
"pDDI_Def": 0,
|
|
384
|
+
"pIM": 0,
|
|
385
|
+
"pITM": 0,
|
|
386
|
+
"pVulnerability": 0
|
|
387
|
+
},
|
|
388
|
+
"pela": {
|
|
389
|
+
"Mhp": 168,
|
|
390
|
+
"Def": 72,
|
|
391
|
+
"Att": 79,
|
|
392
|
+
"Spd": 99,
|
|
393
|
+
"pER": 0,
|
|
394
|
+
"pAR": 0,
|
|
395
|
+
"pEHR": 0,
|
|
396
|
+
"pERes": 0,
|
|
397
|
+
"pBSDI": 0,
|
|
398
|
+
"pESDI": 0,
|
|
399
|
+
"pFSDI": 0,
|
|
400
|
+
"pCTR": 0,
|
|
401
|
+
"pCTD": 150,
|
|
402
|
+
"pCTR_Def": 0,
|
|
403
|
+
"pCTD_Def": 0,
|
|
404
|
+
"pHE": 0,
|
|
405
|
+
"pFDI": 0,
|
|
406
|
+
"pFDI_Def": 0,
|
|
407
|
+
"pTDI": 0,
|
|
408
|
+
"pTDI_Def": 0,
|
|
409
|
+
"pWDI": 0,
|
|
410
|
+
"pWDI_Def": 0,
|
|
411
|
+
"pRDI": 0,
|
|
412
|
+
"pRDI_Def": 0,
|
|
413
|
+
"pADI": 0,
|
|
414
|
+
"pADI_Def": 0,
|
|
415
|
+
"pLDI": 0,
|
|
416
|
+
"pLDI_Def": 0,
|
|
417
|
+
"pDDI": 0,
|
|
418
|
+
"pDDI_Def": 0,
|
|
419
|
+
"pIM": 0,
|
|
420
|
+
"pITM": 0,
|
|
421
|
+
"pVulnerability": 0
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
"defaultLineup": {
|
|
425
|
+
"team1": [
|
|
426
|
+
"cook",
|
|
427
|
+
"miaoluo",
|
|
428
|
+
"kesi",
|
|
429
|
+
"blade"
|
|
430
|
+
],
|
|
431
|
+
"team2": [
|
|
432
|
+
"kleiwu",
|
|
433
|
+
"rudy",
|
|
434
|
+
"luoluo",
|
|
435
|
+
"ailisha"
|
|
436
|
+
]
|
|
437
|
+
}
|
|
438
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "id": "common.basic.single.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
3
|
+
{ "id": "cook.ultimate.slash", "steps": [{ "kind": "damage", "ratio": 4, "scaleStat": "Att" }] },
|
|
4
|
+
{ "id": "miaoluo.basic.flash", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
5
|
+
{ "id": "miaoluo.core.lowhp", "steps": [{ "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }] },
|
|
6
|
+
{ "id": "blade.basic.slow", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
7
|
+
{ "id": "blade.core.aoe", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
8
|
+
{ "id": "blade.ultimate.strike", "steps": [{ "kind": "damage", "ratio": 3, "scaleStat": "Att" }] },
|
|
9
|
+
{ "id": "luoluo.basic.will", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "dazzle", "fixedProb": 5000 }] },
|
|
10
|
+
{ "id": "luoluo.core.taunt", "steps": [{ "kind": "shield", "ratio": 0.1, "scaleStat": "Mhp" }] },
|
|
11
|
+
{ "id": "luoluo.ultimate.def-aoe", "steps": [{ "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "taunt", "fixedProb": 5000 }] },
|
|
12
|
+
{ "id": "rudy.basic.single", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
13
|
+
{ "id": "rudy.core.stun", "steps": [{ "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "stun", "fixedProb": 6500 }] },
|
|
14
|
+
{ "id": "rudy.core.defense-buff", "steps": [{ "kind": "buff", "ratio": 0, "buffId": "def-up", "fixedProb": 10000 }] },
|
|
15
|
+
{ "id": "rudy.ultimate.team-shield", "steps": [{ "kind": "shield", "ratio": 0.2, "ratioByLevel": [0.2, 0.26, 0.32, 0.38, 0.44], "scaleStat": "Mhp" }] },
|
|
16
|
+
{ "id": "es.basic.single", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
17
|
+
{ "id": "es.core.damage", "steps": [{ "kind": "damage", "ratio": 0.35, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "dazzle", "fixedProb": 5000 }] },
|
|
18
|
+
{ "id": "es.core.heal", "steps": [{ "kind": "heal", "ratio": 0.4, "ratioByLevel": [0.4, 0.48, 0.56, 0.64, 0.72], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "bless", "fixedProb": 10000 }] },
|
|
19
|
+
{ "id": "es.ultimate.light-aoe", "steps": [{ "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }] },
|
|
20
|
+
{ "id": "kesi.basic.double-near", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
21
|
+
{ "id": "kesi.core.random", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
22
|
+
{ "id": "kesi.ultimate.dot-burst", "steps": [{ "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }] },
|
|
23
|
+
{ "id": "kleiwu.basic.single", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
24
|
+
{ "id": "kleiwu.basic.dual", "steps": [{ "kind": "damage", "ratio": 0.3, "scaleStat": "Att" }] },
|
|
25
|
+
{ "id": "kleiwu.core.backlash", "steps": [{ "kind": "damage", "ratio": 1.2, "scaleStat": "Att" }] },
|
|
26
|
+
{ "id": "kleiwu.core.split", "steps": [{ "kind": "damage", "ratio": 1.2, "scaleStat": "Att" }, { "kind": "damage", "ratio": 0.4, "scaleStat": "Att" }] },
|
|
27
|
+
{ "id": "kleiwu.ultimate.aoe", "steps": [{ "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }, { "kind": "damage", "ratio": 0.8, "scaleStat": "Att" }, { "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }, { "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
28
|
+
{ "id": "ailisha.basic.fire", "steps": [{ "kind": "damage", "ratio": 0.7, "scaleStat": "Att" }] },
|
|
29
|
+
{ "id": "ailisha.core.share", "steps": [{ "kind": "buff", "ratio": 0, "buffId": "share-damage", "fixedProb": 10000 }] },
|
|
30
|
+
{ "id": "ailisha.ultimate.hp-aoe", "steps": [{ "kind": "damage", "ratio": 1.2, "scaleStat": "Att" }] },
|
|
31
|
+
{ "id": "luolai.basic.random", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }] },
|
|
32
|
+
{ "id": "luolai.core.hot", "steps": [{ "kind": "heal", "ratio": 0.1, "scaleStat": "Mhp" }, { "kind": "buff", "ratio": 0, "buffId": "condense", "fixedProb": 10000 }] },
|
|
33
|
+
{ "id": "luolai.ultimate.heal", "steps": [{ "kind": "heal", "ratio": 0.2, "scaleStat": "Mhp" }, { "kind": "buff", "ratio": 0, "buffId": "condense", "fixedProb": 10000 }] },
|
|
34
|
+
{ "id": "tier.basic.weathering", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 3000 }] },
|
|
35
|
+
{ "id": "tier.core.double", "steps": [{ "kind": "damage", "ratio": 0.6, "scaleStat": "Att", "repeat": 2 }, { "kind": "buff", "ratio": 0, "buffId": "pierce", "fixedProb": 3000 }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 3000 }] },
|
|
36
|
+
{ "id": "tier.ultimate.single", "steps": [{ "kind": "damage", "ratio": 2.5, "scaleStat": "Att" }] },
|
|
37
|
+
{ "id": "tier.ultimate.aoe", "steps": [{ "kind": "damage", "ratio": 0.7, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "def-break", "fixedProb": 8000 }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 10000 }] },
|
|
38
|
+
{ "id": "pela.basic.speed", "steps": [{ "kind": "damage", "ratio": 0.5, "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "speed-up", "fixedProb": 10000 }] },
|
|
39
|
+
{ "id": "pela.core.support", "steps": [{ "kind": "buff", "ratio": 0, "buffId": "damage-up", "fixedProb": 10000 }] },
|
|
40
|
+
{ "id": "pela.ultimate.team-buff", "steps": [{ "kind": "buff", "ratio": 0, "buffId": "attack-up", "fixedProb": 10000 }] },
|
|
41
|
+
{ "id": "m.basic.water.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
42
|
+
{ "id": "m.basic.thunder.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
43
|
+
{ "id": "m.basic.rock.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
44
|
+
{ "id": "m.basic.fire.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
45
|
+
{ "id": "m.basic.light.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
46
|
+
{ "id": "m.basic.dark.50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
47
|
+
{ "id": "m.basic.wind.50.vuln", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "vulnerability-up", "fixedProb": 10000 }] },
|
|
48
|
+
{ "id": "m.basic.fire.50.burn", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "burn", "fixedProb": 10000 }] },
|
|
49
|
+
{ "id": "m.basic.fire.50.burn30", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "burn", "fixedProb": 3000, "fixedProbByLevel": [3000, 3500, 4000, 4500, 5000] }] },
|
|
50
|
+
{ "id": "m.basic.thunder.50.static30", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "static", "fixedProb": 3000, "fixedProbByLevel": [3000, 3500, 4000, 4500, 5000] }] },
|
|
51
|
+
{ "id": "m.basic.wind.50.weather30", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 3000, "fixedProbByLevel": [3000, 3500, 4000, 4500, 5000] }] },
|
|
52
|
+
{ "id": "m.basic.water.80.slow50", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "slow", "fixedProb": 5000, "fixedProbByLevel": [5000, 5500, 6000, 6500, 7000] }] },
|
|
53
|
+
{ "id": "m.basic.thunder.80.static50", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "static", "fixedProb": 5000, "fixedProbByLevel": [5000, 5500, 6000, 6500, 7000] }] },
|
|
54
|
+
{ "id": "m.basic.wind.80.weather50", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 5000, "fixedProbByLevel": [5000, 5500, 6000, 6500, 7000] }] },
|
|
55
|
+
{ "id": "m.basic.light.80.dazzle50", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "dazzle", "fixedProb": 5000, "fixedProbByLevel": [5000, 5500, 6000, 6500, 7000] }] },
|
|
56
|
+
{ "id": "m.basic.dark.80.erosion50", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "erosion", "fixedProb": 5000, "fixedProbByLevel": [5000, 5500, 6000, 6500, 7000] }] },
|
|
57
|
+
{ "id": "m.basic.rock.80.defextra", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }] },
|
|
58
|
+
{ "id": "m.16012.water110", "steps": [{ "kind": "damage", "ratio": 1.1, "ratioByLevel": [1.1, 1.26, 1.42, 1.58, 1.74], "scaleStat": "Att" }] },
|
|
59
|
+
{ "id": "m.16032.shield30", "steps": [{ "kind": "shield", "ratio": 0.3, "ratioByLevel": [0.3, 0.36, 0.42, 0.48, 0.54], "scaleStat": "Mhp" }] },
|
|
60
|
+
{ "id": "m.16042.wind30.weather", "steps": [{ "kind": "damage", "ratio": 0.3, "ratioByLevel": [0.3, 0.36, 0.42, 0.48, 0.54], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 8000, "fixedProbByLevel": [8000, 8500, 9000, 9500, 10000] }] },
|
|
61
|
+
{ "id": "m.16052.fire30.defdown", "steps": [{ "kind": "damage", "ratio": 0.3, "ratioByLevel": [0.3, 0.36, 0.42, 0.48, 0.54], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "def-down-10", "fixedProb": 8000, "fixedProbByLevel": [8000, 8500, 9000, 9500, 10000] }] },
|
|
62
|
+
{ "id": "m.16072.thunder110.static", "steps": [{ "kind": "damage", "ratio": 1.1, "ratioByLevel": [1.1, 1.26, 1.42, 1.58, 1.74], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "static", "fixedProb": 6000, "fixedProbByLevel": [6000, 6500, 7000, 7500, 8000] }] },
|
|
63
|
+
{ "id": "m.16092.wind40.weather", "steps": [{ "kind": "damage", "ratio": 0.4, "ratioByLevel": [0.4, 0.48, 0.56, 0.64, 0.72], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "weathering", "fixedProb": 5000, "fixedProbByLevel": [5000, 5500, 6000, 6500, 7000] }] },
|
|
64
|
+
{ "id": "m.16112.heal40", "steps": [{ "kind": "heal", "ratio": 0.4, "ratioByLevel": [0.4, 0.48, 0.56, 0.64, 0.72], "scaleStat": "Att" }] },
|
|
65
|
+
{ "id": "m.16132.dark100", "steps": [{ "kind": "damage", "ratio": 1.0, "ratioByLevel": [1.0, 1.15, 1.3, 1.45, 1.6], "scaleStat": "Att" }] },
|
|
66
|
+
{ "id": "m.18012.light130.dazzle", "steps": [{ "kind": "damage", "ratio": 1.3, "ratioByLevel": [1.3, 1.5, 1.7, 1.9, 2.1], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "dazzle", "fixedProb": 8000, "fixedProbByLevel": [8000, 8500, 9000, 9500, 10000] }] },
|
|
67
|
+
{ "id": "m.18021.dark80", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }] },
|
|
68
|
+
{ "id": "m.18031.rock50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
69
|
+
{ "id": "m.18032.taunt", "steps": [{ "kind": "buff", "ratio": 0, "buffId": "monster-taunt-reduce", "fixedProb": 10000 }] },
|
|
70
|
+
{ "id": "m.18052.fire80.burn", "steps": [{ "kind": "damage", "ratio": 0.8, "ratioByLevel": [0.8, 0.92, 1.04, 1.16, 1.28], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "burn", "fixedProb": 10000 }] },
|
|
71
|
+
{ "id": "m.18072.wind70", "steps": [{ "kind": "damage", "ratio": 0.7, "ratioByLevel": [0.7, 0.82, 0.94, 1.06, 1.18], "scaleStat": "Att" }] },
|
|
72
|
+
{ "id": "m.18073.speed", "steps": [{ "kind": "buff", "ratio": 0, "buffId": "monster-speed-up-20", "fixedProb": 10000 }] },
|
|
73
|
+
{ "id": "m.19013.fire120.burn", "steps": [{ "kind": "damage", "ratio": 1.2, "ratioByLevel": [1.2, 1.38, 1.56, 1.74, 1.92], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "burn", "fixedProb": 10000 }] },
|
|
74
|
+
{ "id": "m.19032.thunder100.static", "steps": [{ "kind": "damage", "ratio": 1.0, "ratioByLevel": [1.0, 1.15, 1.3, 1.45, 1.6], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "static", "fixedProb": 10000 }, { "kind": "buff", "ratio": 0, "buffId": "effect-res-down-15", "fixedProb": 10000 }] },
|
|
75
|
+
{ "id": "m.19042.wind50", "steps": [{ "kind": "damage", "ratio": 0.5, "ratioByLevel": [0.5, 0.58, 0.66, 0.74, 0.82], "scaleStat": "Att" }] },
|
|
76
|
+
{ "id": "m.19043.wind160.weather", "steps": [{ "kind": "damage", "ratio": 1.6, "ratioByLevel": [1.6, 1.84, 2.08, 2.32, 2.56], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "def-down-30", "fixedProb": 10000 }] },
|
|
77
|
+
{ "id": "m.19052.heal20", "steps": [{ "kind": "heal", "ratio": 0.2, "ratioByLevel": [0.2, 0.24, 0.28, 0.32, 0.36], "scaleStat": "Mhp" }] },
|
|
78
|
+
{ "id": "m.19053.light140.dazzle", "steps": [{ "kind": "damage", "ratio": 1.4, "ratioByLevel": [1.4, 1.61, 1.82, 2.03, 2.24], "scaleStat": "Att" }, { "kind": "buff", "ratio": 0, "buffId": "dazzle", "fixedProb": 10000 }, { "kind": "buff", "ratio": 0, "buffId": "monster-reduce-30", "fixedProb": 10000 }] },
|
|
79
|
+
{ "id": "m.19063.dark180", "steps": [{ "kind": "damage", "ratio": 1.8, "ratioByLevel": [1.8, 2.07, 2.34, 2.61, 2.88], "scaleStat": "Att" }] },
|
|
80
|
+
{ "id": "m.19073.rock150", "steps": [{ "kind": "damage", "ratio": 1.5, "ratioByLevel": [1.5, 1.73, 1.95, 2.18, 2.4], "scaleStat": "Att" }] }
|
|
81
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BattleInitUnit, BuffConfig, SkillDefinition, SkillTemplate, UnitStats } from "../types";
|
|
2
|
+
type JsonHeroSkillBook = {
|
|
3
|
+
heroId: string;
|
|
4
|
+
heroName: string;
|
|
5
|
+
element: BattleInitUnit["element"];
|
|
6
|
+
role: string;
|
|
7
|
+
skills: SkillDefinition[];
|
|
8
|
+
};
|
|
9
|
+
type JsonRoster = {
|
|
10
|
+
heroStatProfiles: Record<string, UnitStats>;
|
|
11
|
+
defaultLineup: {
|
|
12
|
+
team1: string[];
|
|
13
|
+
team2: string[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export interface BattleJsonConfigBundle {
|
|
17
|
+
buffs: BuffConfig[];
|
|
18
|
+
skillTemplates: SkillTemplate[];
|
|
19
|
+
heroSkillBooks: JsonHeroSkillBook[];
|
|
20
|
+
monsterSkillBooks: JsonHeroSkillBook[];
|
|
21
|
+
roster: JsonRoster;
|
|
22
|
+
}
|
|
23
|
+
export declare function loadBattleJsonConfigBundle(): BattleJsonConfigBundle;
|
|
24
|
+
export declare function validateBattleJsonConfigBundle(bundle: BattleJsonConfigBundle): void;
|
|
25
|
+
export declare function buildBattleUnitsFromJsonBundle(bundle: BattleJsonConfigBundle, team1HeroIds?: string[], team2HeroIds?: string[]): BattleInitUnit[];
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import designedBuffs from "./json/designed-buffs.json";
|
|
2
|
+
import designedHeroSkillBooks from "./json/designed-hero-skill-books.json";
|
|
3
|
+
import designedMonsterSkillBooks from "./json/designed-monster-skill-books.json";
|
|
4
|
+
import designedRoster from "./json/designed-roster.json";
|
|
5
|
+
import designedSkillTemplates from "./json/designed-skill-templates.json";
|
|
6
|
+
export function loadBattleJsonConfigBundle() {
|
|
7
|
+
return {
|
|
8
|
+
buffs: designedBuffs,
|
|
9
|
+
skillTemplates: designedSkillTemplates,
|
|
10
|
+
heroSkillBooks: designedHeroSkillBooks,
|
|
11
|
+
monsterSkillBooks: designedMonsterSkillBooks,
|
|
12
|
+
roster: designedRoster
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function validateBattleJsonConfigBundle(bundle) {
|
|
16
|
+
const buffIds = new Set(bundle.buffs.map((item) => item.id));
|
|
17
|
+
const templateIds = new Set(bundle.skillTemplates.map((item) => item.id));
|
|
18
|
+
for (const hero of bundle.heroSkillBooks) {
|
|
19
|
+
if (!bundle.roster.heroStatProfiles[hero.heroId]) {
|
|
20
|
+
throw new Error(`missing-stat-profile:${hero.heroId}`);
|
|
21
|
+
}
|
|
22
|
+
for (const skill of hero.skills) {
|
|
23
|
+
if (skill.configTemplateId && !templateIds.has(skill.configTemplateId)) {
|
|
24
|
+
throw new Error(`missing-skill-template:${hero.heroId}:${skill.id}:${skill.configTemplateId}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const monster of bundle.monsterSkillBooks) {
|
|
29
|
+
for (const skill of monster.skills) {
|
|
30
|
+
if (skill.configTemplateId && !templateIds.has(skill.configTemplateId)) {
|
|
31
|
+
throw new Error(`missing-skill-template:${monster.heroId}:${skill.id}:${skill.configTemplateId}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
for (const template of bundle.skillTemplates) {
|
|
36
|
+
for (const step of template.steps) {
|
|
37
|
+
if (step.buffId && !buffIds.has(step.buffId)) {
|
|
38
|
+
throw new Error(`missing-buff-config:${template.id}:${step.buffId}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function cloneStats(stats) {
|
|
44
|
+
return { ...stats };
|
|
45
|
+
}
|
|
46
|
+
function buildUnitInstanceId(teamId, position, heroId) {
|
|
47
|
+
return `t${teamId}_p${position}_${heroId}`;
|
|
48
|
+
}
|
|
49
|
+
export function buildBattleUnitsFromJsonBundle(bundle, team1HeroIds = bundle.roster.defaultLineup.team1, team2HeroIds = bundle.roster.defaultLineup.team2) {
|
|
50
|
+
const heroBookMap = new Map([
|
|
51
|
+
...bundle.heroSkillBooks.map((item) => [item.heroId, item]),
|
|
52
|
+
...bundle.monsterSkillBooks.map((item) => [item.heroId, item]),
|
|
53
|
+
]);
|
|
54
|
+
const buildTeam = (teamId, heroIds) => {
|
|
55
|
+
return heroIds.map((heroId, index) => {
|
|
56
|
+
const heroBook = heroBookMap.get(heroId);
|
|
57
|
+
if (!heroBook) {
|
|
58
|
+
throw new Error(`missing-hero-skill-book:${heroId}`);
|
|
59
|
+
}
|
|
60
|
+
const position = (index + 1);
|
|
61
|
+
const stats = bundle.roster.heroStatProfiles[heroId];
|
|
62
|
+
if (!stats) {
|
|
63
|
+
throw new Error(`missing-hero-stat-profile:${heroId}`);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
id: buildUnitInstanceId(teamId, position, heroId),
|
|
67
|
+
name: heroBook.heroName,
|
|
68
|
+
teamId,
|
|
69
|
+
position,
|
|
70
|
+
element: heroBook.element,
|
|
71
|
+
stats: cloneStats(stats),
|
|
72
|
+
skills: heroBook.skills.map((skill) => ({ ...skill }))
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return [...buildTeam(1, team1HeroIds), ...buildTeam(2, team2HeroIds)];
|
|
77
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BuffConfig, BuffInstance, UnitId, UnitModel, UnitStats } from "./types";
|
|
2
|
+
import { BattleEventBus } from "./eventBus";
|
|
3
|
+
export declare class EffectSystem {
|
|
4
|
+
private readonly eventBus;
|
|
5
|
+
private buffs;
|
|
6
|
+
private buffConfigs;
|
|
7
|
+
constructor(eventBus: BattleEventBus);
|
|
8
|
+
registerBuffConfigs(configs: BuffConfig[]): void;
|
|
9
|
+
getBuffs(unitId: UnitId): BuffInstance[];
|
|
10
|
+
getBuffConfigs(): BuffConfig[];
|
|
11
|
+
hasBuff(unitId: UnitId, buffId: string): boolean;
|
|
12
|
+
getEffectiveStats(unit: UnitModel): UnitStats;
|
|
13
|
+
addBuff(owner: UnitModel, sourceId: UnitId, buffId: string): void;
|
|
14
|
+
removeBuff(owner: UnitModel, buffId: string): void;
|
|
15
|
+
onTurnStart(owner: UnitModel, allUnits: UnitModel[]): Array<{
|
|
16
|
+
targetId: UnitId;
|
|
17
|
+
value: number;
|
|
18
|
+
buffId: string;
|
|
19
|
+
element?: string;
|
|
20
|
+
}>;
|
|
21
|
+
onTurnEnd(owner: UnitModel, allUnits: UnitModel[]): void;
|
|
22
|
+
private cleanup;
|
|
23
|
+
private recomputeStates;
|
|
24
|
+
private forceTauntPosition;
|
|
25
|
+
private tryReposition;
|
|
26
|
+
}
|