◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“Widget:融合势力属性”的版本间的差异
小 |
小 |
||
第11行: | 第11行: | ||
function calc(attr, lv, rank, size, resolve, form) { | function calc(attr, lv, rank, size, resolve, form) { | ||
− | let ratio = ratios[attr] | + | let ratio = ratios[attr]; |
− | let base = type_coef[type][attr] * ratio * | + | let base = type_coef[type][attr] * ratio * 2 * grow * |
− | size_coef[size] * rank_coef[rank] * form / | + | size_coef[size] * rank_coef[rank] * form / (maxform * 5e6); |
let accretion = type_coef[type][attr] * ratio * (lv - 1) * grow * | let accretion = type_coef[type][attr] * ratio * (lv - 1) * grow * | ||
− | size_coef[size] * rank_coef[rank] * form / | + | size_coef[size] * rank_coef[rank] * form / (maxform * 1e8); |
if (base - Math.floor(base) < 1e-3) { | if (base - Math.floor(base) < 1e-3) { | ||
base = Math.floor(base); | base = Math.floor(base); |
2022年5月1日 (日) 12:42的版本
<script> const type_coef = [
[4.79, 3.67, 0.46, 0.55, 0.75, 0.18], [3.84, 2.94, 0.42, 0.44, 0.60, 0.15], [3.60, 2.76, 0.42, 0.42, 0.57, 0.14]];
const size_coef = [100, 102, 105, 108, 110]; const rank_coef = [80, 90, 100, 110, 120]; let div, type, ratios, grow; let maxform = 5; let resolution = new Array(5);
function calc(attr, lv, rank, size, resolve, form) {
let ratio = ratios[attr]; let base = type_coef[type][attr] * ratio * 2 * grow * size_coef[size] * rank_coef[rank] * form / (maxform * 5e6); let accretion = type_coef[type][attr] * ratio * (lv - 1) * grow * size_coef[size] * rank_coef[rank] * form / (maxform * 1e8); if (base - Math.floor(base) < 1e-3) { base = Math.floor(base); } return Math.ceil(base) + Math.floor(accretion) + form * resolution[resolve][attr];
}
function main() {
div = document.getElementById('attrs'); let unitid = div.dataset.id; if (unitid < 2000 || unitid == 2006 || unitid == 3010) maxform = 1; type = div.dataset.type; ratios = div.dataset.attrs.split(',').map(x => +x); grow = div.dataset.grow; let r2d = div.dataset.resolution.split(';'); for (let i = 0; i < 5; i++) { rs = r2d[i].split(','); resolution[i] = new Array(6); for (let j = 0; j < 6; j++) resolution[i][j] = +rs[j]; } for (let i = 6; --i;) document.getElementById('attr-td-' + i).textContent = calc(i-1, 100, 4, 0, 4, maxform);
}
window.onload = main; </script>