◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“Widget:战术人形属性”的版本间的差异
第37行: | 第37行: | ||
const modToggle = $('#mod-toggle'); | const modToggle = $('#mod-toggle'); | ||
} | } | ||
+ | let mod = 0; | ||
lvInput.addEventListener('input', updateAttrs); | lvInput.addEventListener('input', updateAttrs); | ||
if (modToggle) $(modToggle).on('click', toggleMod); | if (modToggle) $(modToggle).on('click', toggleMod); | ||
updateAttrs(); | updateAttrs(); | ||
− | function calcLifeArmor(lv | + | function calcLifeArmor(lv, attr) { |
const modsuf = mod ? 'Mod' : ''; | const modsuf = mod ? 'Mod' : ''; | ||
const ratio = adat['growing'+modsuf][attr]; | const ratio = adat['growing'+modsuf][attr]; | ||
第48行: | 第49行: | ||
); | ); | ||
} | } | ||
− | function calcOther(lv | + | function calcOther(lv, attr) { |
const modsuf = mod ? 'Mod' : ''; | const modsuf = mod ? 'Mod' : ''; | ||
const ratio = +adat['growing'+modsuf][attr], growth = adat['growth'+modsuf]; | const ratio = +adat['growing'+modsuf][attr], growth = adat['growth'+modsuf]; | ||
第60行: | 第61行: | ||
const attrCrit = $('#crit-td'); | const attrCrit = $('#crit-td'); | ||
if (checked) { | if (checked) { | ||
+ | mod = 1; | ||
lvInput.max = 120; | lvInput.max = 120; | ||
lvInput.min = 100; | lvInput.min = 100; | ||
第65行: | 第67行: | ||
attrCrit.text(attrCrit.data('mod')); | attrCrit.text(attrCrit.data('mod')); | ||
} else { | } else { | ||
+ | mod = 0; | ||
lvInput.max = 100; | lvInput.max = 100; | ||
lvInput.min = 1; | lvInput.min = 1; | ||
第74行: | 第77行: | ||
} | } | ||
function updateAttrs() { | function updateAttrs() { | ||
− | const lv = lvInput.value | + | const lv = lvInput.value; |
if (lv > 89) hpTable.className = ''; | if (lv > 89) hpTable.className = ''; | ||
else if (lv > 69) hpTable.className = 'form4'; | else if (lv > 69) hpTable.className = 'form4'; | ||
第80行: | 第83行: | ||
else if (lv > 9) hpTable.className = 'form2'; | else if (lv > 9) hpTable.className = 'form2'; | ||
else hpTable.className = 'form1'; | else hpTable.className = 'form1'; | ||
− | const hp1 = calcLifeArmor(lv | + | const hp1 = calcLifeArmor(lv, 0); |
[...hpRow.children].forEach(function(e, i) { | [...hpRow.children].forEach(function(e, i) { | ||
e.textContent = hp1*(i+1); | e.textContent = hp1*(i+1); | ||
第87行: | 第90行: | ||
if (i < 4) { | if (i < 4) { | ||
const attr = [1,3,4,2][i]; | const attr = [1,3,4,2][i]; | ||
− | this.textContent = calcOther(lv | + | this.textContent = calcOther(lv, attr); |
− | } else if (adat.type == 6) this.textContent = calcLifeArmor(lv | + | } else if (adat.type == 6) this.textContent = calcLifeArmor(lv, 5); |
}); | }); | ||
} | } |
2023年3月26日 (日) 17:02的版本