-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathpatch
382 lines (375 loc) · 21.4 KB
/
patch
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
diff --git a/static/builder.css b/static/builder.css
index 047b204..9aa5fa1 100644
--- a/static/builder.css
+++ b/static/builder.css
@@ -1112,6 +1112,36 @@ i.img.img-slot-hand.leftHand {
margin-left: 5px;
}
+.killerBuffs {
+ display: flex;
+ flex-wrap: wrap;
+ margin-top: 10px;
+}
+
+.killerBuff {
+ display: flex;
+ margin-right: 5px;
+}
+
+.killerBuff i.img {
+ height: 38px;
+ width: 34px;
+ margin-right: -8px;
+ z-index: 2;
+}
+
+.killerBuff input {
+ width: 70px;
+ text-align: right;
+}
+
+.killerBuff .inputWithIcon .leftIcon {
+ left: 7px;
+}
+
+#killerBuffSwitch i {
+ margin-right: 5px;
+}
@media (max-width: 991px) {
diff --git a/static/builder.html b/static/builder.html
index ad746a4..54714c0 100644
--- a/static/builder.html
+++ b/static/builder.html
@@ -523,6 +523,209 @@
<input type="text" class="form-control" placeholder="0"/>
</div>
</div>
+ <div class="stat">
+ <div id="killerBuffSwitch" class="btn btn-default" onclick="switchDisplayKillerBuffs()"><i class="fas fa-edit"></i>Killer buffs</div>
+ </div>
+ </div>
+ <div class="col-xs-12 killerBuffsSummary">
+ <div class="physical"></div>
+ <div class="magical"></div>
+ </div>
+ <div class="col-xs-12 killerBuffs physical hidden">
+ <div class="killerBuff aquatic">
+ <i class="img img-killer-physical-aquatic" title="aquatic physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff beast">
+ <i class="img img-killer-physical-beast" title="beast physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff bird">
+ <i class="img img-killer-physical-bird" title="bird physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff bug">
+ <i class="img img-killer-physical-bug" title="bug physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff demon">
+ <i class="img img-killer-physical-demon" title="demon physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff dragon">
+ <i class="img img-killer-physical-dragon" title="dragon physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff human">
+ <i class="img img-killer-physical-human" title="human physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff machine">
+ <i class="img img-killer-physical-machine" title="machine physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff plant">
+ <i class="img img-killer-physical-plant" title="plant physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff undead">
+ <i class="img img-killer-physical-undead" title="undead physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff stone">
+ <i class="img img-killer-physical-stone" title="stone physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff spirit">
+ <i class="img img-killer-physical-spirit" title="spirit physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 killerBuffs magical hidden">
+ <div class="killerBuff aquatic">
+ <i class="img img-killer-magical-aquatic" title="aquatic physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff beast">
+ <i class="img img-killer-magical-beast" title="beast physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff bird">
+ <i class="img img-killer-magical-bird" title="bird physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff bug">
+ <i class="img img-killer-magical-bug" title="bug physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff demon">
+ <i class="img img-killer-magical-demon" title="demon physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff dragon">
+ <i class="img img-killer-magical-dragon" title="dragon physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff human">
+ <i class="img img-killer-magical-human" title="human physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff machine">
+ <i class="img img-killer-magical-machine" title="machine physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff plant">
+ <i class="img img-killer-magical-plant" title="plant physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff undead">
+ <i class="img img-killer-magical-undead" title="undead physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff stone">
+ <i class="img img-killer-magical-stone" title="stone physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
+ <div class="killerBuff spirit">
+ <i class="img img-killer-magical-spirit" title="spirit physical killer buff"></i>
+ <div class="inputWithIcon withPercent buff">
+ <span class="leftIcon glyphicon glyphicon-upload" title="buff"></span>
+ <span class="rightIcon">%</span>
+ <input type="text" class="form-control" placeholder="0"/>
+ </div>
+ </div>
</div>
<div class="col-xs-12 unitAttackElement">
<div class="col-xs-3 text-right">Imbue(s):</div>
diff --git a/static/builder.js b/static/builder.js
index a3ac8bc..4f0cd9f 100644
--- a/static/builder.js
+++ b/static/builder.js
@@ -471,6 +471,22 @@ function readStatsValues() {
builds[currentUnitIndex].baseValues["lbDamage"] = parseInt($(".unitStats .stat.lbDamage .buff input").val()) || 0;
builds[currentUnitIndex].innateElements = getSelectedValuesFor("elements");
builds[currentUnitIndex].baseValues["currentStack"] = parseInt($(".unitStack input").val()) || 0;
+ builds[currentUnitIndex].baseValues["killerBuffs"] = [];
+ killerList.forEach(killer => {
+ let physical = parseInt($(".killerBuffs.physical ." + killer + " input").val()) || 0;
+ let magical = parseInt($(".killerBuffs.magical ." + killer + " input").val()) || 0;
+
+ if (physical || magical) {
+ let killerData = {'name':killer};
+ if (physical) {
+ killerData.physical = physical;
+ }
+ if (magical) {
+ killerData.magical = magical;
+ }
+ builds[currentUnitIndex].baseValues["killerBuffs"].push(killerData);
+ }
+ });
}
@@ -1524,7 +1540,18 @@ function updateUnitStats() {
} else {
$(".panel.unit").addClass("hidden");
}
-
+ $('.killerBuffs input').val("");
+ if (builds[currentUnitIndex].baseValues["killerBuffs"]) {
+ builds[currentUnitIndex].baseValues["killerBuffs"].forEach(killerData => {
+ if (killerData.physical) {
+ $('.killerBuffs.physical .' + killerData.name + ' input').val(killerData.physical);
+ }
+ if (killerData.magical) {
+ $('.killerBuffs.magical .' + killerData.name + ' input').val(killerData.magical);
+ }
+ });
+ }
+ updateKillerBuffSummary();
readStatsValues();
}
@@ -3700,6 +3727,24 @@ function uploadToImgur() {
});
}
+function switchDisplayKillerBuffs() {
+ $('.unit.panel .killerBuffs.physical').toggleClass('hidden');
+ $('.unit.panel .killerBuffs.magical').toggleClass('hidden');
+ $('.unit.panel .killerBuffsSummary').toggleClass('hidden');
+}
+
+function onKillerBuffChange() {
+ readStatsValues();
+ logCurrentBuild();
+ updateKillerBuffSummary();
+}
+
+function updateKillerBuffSummary() {
+ let killerHtml = getKillerHtml(builds[currentUnitIndex].baseValues["killerBuffs"]);
+ $('.unit.panel .killerBuffsSummary .physical').html(killerHtml.physical);
+ $('.unit.panel .killerBuffsSummary .magical').html(killerHtml.magical);
+}
+
function inventoryLoaded() {
dataStorage.itemInventory = itemInventory;
$(".equipments select option[value=owned]").prop("disabled", false);
@@ -3869,6 +3914,7 @@ function startPage() {
$(".unitStats .stat.mitigation .buff input").on('input',$.debounce(300,function() {onBuffChange("mitigation")}));
$(".unitStats .stat.drawAttacks .buff input").on('input',$.debounce(300,function() {onBuffChange("drawAttacks")}));
$(".unitStats .stat.lbDamage .buff input").on('input',$.debounce(300,function() {onBuffChange("lbDamage")}));
+ $(".killerBuffs input").on('input',$.debounce(300,function() {onKillerBuffChange();}));
$(".unitStack input").on('input',$.debounce(300,function() {logCurrentBuild();}));
$("#multicastSkillsDiv select").change(function() {customFormula = null; logCurrentBuild();});
$("#paramChallengeSelect").change(function() {
diff --git a/static/builder/common.js b/static/builder/common.js
index 646e1f8..d5ee33b 100644
--- a/static/builder/common.js
+++ b/static/builder/common.js
@@ -122,7 +122,8 @@ function innerCalculateBuildValueWithFormula(itemAndPassives, unitBuild, ennemyS
"stack": {
"currentStack":unitBuild.baseValues.currentStack,
"lastStackingSkillId":"any"
- }
+ },
+ "killerBuff":{}
}
for (var i = 0; i < itemAndPassives.length; i++) {
if (itemAndPassives[i] && itemAndPassives[i].skillEnhancement) {
@@ -136,6 +137,18 @@ function innerCalculateBuildValueWithFormula(itemAndPassives, unitBuild, ennemyS
}
}
}
+ if (unitBuild.baseValues.killerBuffs && unitBuild.baseValues.killerBuffs.length) {
+ unitBuild.baseValues.killerBuffs.forEach(killerData => {
+ if (killerData.physical) {
+ if (!context.killerBuff.physical) context.killerBuff.physical = {};
+ context.killerBuff.physical[killerData.name] = killerData.physical;
+ }
+ if (killerData.magical) {
+ if (!context.killerBuff.magical) context.killerBuff.magical = {};
+ context.killerBuff.magical[killerData.name] = killerData.magical;
+ }
+ });
+ }
// Level correction (1+(level/100)) and final multiplier (between 85% and 100%, so 92.5% mean)
var level;
if (unitBuild._level) {
diff --git a/static/units.js b/static/units.js
index 4f10c00..bdd5396 100644
--- a/static/units.js
+++ b/static/units.js
@@ -1042,7 +1042,9 @@ function importUnits() {
onClick: function() {
if (importedOwnedUnit) {
ownedUnits = importedOwnedUnit;
+ markSaveNeeded();
saveUserData(false, true, false);
+ savePublicLink();
showRaritySort();
} else {
Modal.show("Please select a file to import");