打开主菜单

少前百科GFwiki β

更改

Widget:战术人形属性

添加106字节2023年3月26日 (日) 16:58
无编辑摘要
const base_attr = [[.6,.6,.8,1.2,1.8,0],[1.6,.6,1.2,.3,1.6,0],[.8,2.4,.5,1.6,.8,0],[1,1,1,1,1,0],[1.5,1.8,1.6,.6,.6,0],[2,.7,.4,.3,.3,1]][adat.type-1];
adat.growing = adat.growing.split(',');
adat.growingMod = adat.growingMod?.split(',');$('#attr-table')[0].insertAdjacentHTML('beforebegin', `<input id="lv-input" type="number" min="1" max="100" value="100"><input id="mod-toggle" type="checkbox"><label for="mod-toggle">MOD</label>`);
const tables = $('#attr-tpl')[0].content.cloneNode(true);
$('#attr-tpl').remove();
const hpTable = $('#attr-table>table')[0];
const hpRow = $('#hp-tr')[0];
const [lvInput, modToggle] = $('#lv-input')[0];if (adat.growingMod) { lvInput.insertAdjacentHTML('afterend', `<input id="mod-toggle" type="checkbox"><label for="mod-toggle">MOD</label>`); const modToggle = $('#mod-toggle');}
lvInput.addEventListener('input', updateAttrs);
if (modToggle) $(modToggle).on('click', toggleMod);
updateAttrs();