link to automatically set char stats from levels
This commit is contained in:
parent
f8355450a4
commit
2ef0919097
@ -346,6 +346,21 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('.apply-level-stats').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
const data = $(e.target).data();
|
||||
Object.keys(data).forEach((stat) => {
|
||||
switch (stat) {
|
||||
case 'power':
|
||||
case 'guard':
|
||||
case 'magic':
|
||||
case 'speed':
|
||||
$(`#char-${stat}`).val(data[stat]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const $enemyInfoModal = $('#enemy-info-modal');
|
||||
if ($enemyInfoModal.length) {
|
||||
let rowData;
|
||||
|
@ -26,7 +26,20 @@ block tab-content
|
||||
|
||||
while level < 80
|
||||
mixin calcCharStats(char)
|
||||
code= char.initial.map((x, i) => Math.min(i < 4 ? 999 : 255, x + (char.level[i] * (level - 1)))).join('/')
|
||||
- const values = char.initial.map((x, i) => Math.min(i < 4 ? 999 : 255, x + (char.level[i] * (level - 1))))
|
||||
code: a.apply-level-stats(
|
||||
href="#"
|
||||
data-hp=values[0]
|
||||
data-mp=values[1]
|
||||
data-power=values[2]
|
||||
data-guard=values[3]
|
||||
data-magic=values[4]
|
||||
data-speed=values[5]
|
||||
)
|
||||
= values.slice(0, 2).join('/')
|
||||
= ' '
|
||||
= values.slice(2).join('/')
|
||||
|
||||
tr
|
||||
td= ++level
|
||||
td: +calcCharStats(esuna)
|
||||
|
Loading…
x
Reference in New Issue
Block a user