Skip to content

Commit

Permalink
June 9 excu2 v1, others to be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xulai1001 committed Jun 9, 2023
1 parent 25b02e7 commit 88266d2
Show file tree
Hide file tree
Showing 179 changed files with 1,095,499 additions and 673,166 deletions.
2 changes: 1 addition & 1 deletion _data/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ css:

modules:
- /assets/js/common.js
- /resources/akdata.js?ver=230504
- /resources/akdata.js?ver=230609
2 changes: 1 addition & 1 deletion _docs/character.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function show(hash) {
let desc = AKDATA.formatString(x.description);
if ( x.rangeId && (i == 0 || x.rangeId != talentInfo.candidates[i-1].rangeId ) ) desc += '<hr>' + createRangeTable(x.rangeId);
return [
x.unlockCondition.phase ? `精英${x.unlockCondition.phase}` : '',
x.unlockCondition.phase ? `精英${AKDATA.checkEnum('phase', x.unlockCondition.phase)}` : '',
`Lv.${x.unlockCondition.level}`,
x.requiredPotentialRank ? `潜能${x.requiredPotentialRank+1}` : '',
desc,
Expand Down
2 changes: 1 addition & 1 deletion _docs/dps.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ function calculate(index) {
$(".dps__row-g_dps th").text("平均HPS");
}

let line = `${s.hitDamage.toFixed(2)} * ${s.dur.hitCount}`;
let line = `${s.hitDamage.toFixed(2)} * ${Math.round(s.dur.hitCount*100)/100}`;
if (s.damageType != 2) {
$(".dps__row-s_damage th").text("技能总伤害");
$("dps__row-s_dps span").text("技能DPS(均摊)");
Expand Down
8 changes: 4 additions & 4 deletions _docs/mastery.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ function calculate(charId) {
level.forEach(x => {
let _n = itemdb[x.id].name.replace(" ", "");
i[_n] = x.count;
itemCache[_n] = {id: x.id, name: _n, rarity: itemdb[x.id].rarity};
itemCache[_n] = {id: x.id, name: _n, rarity: AKDATA.checkEnum('rarity', itemdb[x.id].rarity)};
});
resultView.mats[k].push(i);
}
Expand All @@ -680,10 +680,10 @@ function calculate(charId) {
let m = {};
mats[elite].forEach(x => {
let _nm = itemdb[x.id].name.replace(" ", "");
itemCache[_nm] = { id: x.id, name: _nm, rarity: itemdb[x.id].rarity };
itemCache[_nm] = { id: x.id, name: _nm, rarity: AKDATA.checkEnum('rarity', itemdb[x.id].rarity) };
m[_nm] = x.count;
});
m["龙门币"] = EliteLMB[db.rarity+1][elite-1];
m["龙门币"] = EliteLMB[AKDATA.checkEnum('rarity', db.rarity)+1][elite-1];
resultView.mats_e.elite.push({...m});
}
}
Expand All @@ -696,7 +696,7 @@ function calculate(charId) {
edb[eid]["itemCost"][lv].forEach(x => {
if (!["mod_update_token_1", "mod_update_token_2"].includes(x.id)) {
let _nm = itemdb[x.id].name.replace(" ", "");
itemCache[_nm] = { id: x.id, name: _nm, rarity: itemdb[x.id].rarity };
itemCache[_nm] = { id: x.id, name: _nm, rarity: AKDATA.checkEnum('rarity', itemdb[x.id].rarity) };
m[_nm] = x.count;
}
});
Expand Down
5 changes: 5 additions & 0 deletions _docs/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ category: 帮助与支持
icon: cloud-upload
layout: text-page
---
## 23.06.09
- [update] 圣约送葬人
- [todo] 其余干员和模组有待更新。同时需要优化Log伤害表显示
- [note] 补充了部分页面对新数据格式的枚举值的适配。可能还有一些页面的(稀有度和精英化等级)显示问题需要排查

## 23.06.05
- [fix] Issue #22 优化了伤害颜色表示。现在可以按照DPS和HPS单独显示不同的伤害类型颜色了
- 同时增加了表示护盾和掉血的颜色。(护盾色会优先覆盖治疗色,如果治疗附带护盾会显示为护盾蓝色)
Expand Down
1 change: 1 addition & 0 deletions _sass/layout/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

&__body {
flex: 1;
font-family: Bahnschrift;
}
}

Expand Down
12 changes: 0 additions & 12 deletions assets/images/copy.py

This file was deleted.

6 changes: 3 additions & 3 deletions resources/akdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const useCache = true;
const cacheBeginTime = new Date(2019, 12, 10).getTime();

window.AKDATA = {
akdata: "230504-v2", // jsdelivr tag version
akdata: "230609-v1", // jsdelivr tag version

Data: {},

new_op: [ "char_249_mlyss", "char_4027_heyak", "char_1031_slent2", "char_4006_melnte"],
todo_list: [],
new_op: [ "char_1032_excu2" /*, "char_498_inside", "char_4015_spuria"*/],
todo_list: ["char_498_inside", "char_4015_spuria"],

professionNames: {
"PIONEER": "先锋",
Expand Down
119 changes: 108 additions & 11 deletions resources/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,23 @@ function applyBuff(charAttr, buffFrm, tag, blackbd, isSkill, isCrit, log, enemy)
case "tachr_348_ceylon_1_clone":
blackboard.atk = blackboard['ceylon_t_1[common].atk']; //+ blackboard['celyon_t_1[map].atk']; // 无法判断是否水地形
break;
case "skchr_excu2_1":
blackboard.edef_pene = blackboard.def_penetrate_fixed;
break;
case "skchr_excu2_3":
buffFrame.baseAttackTime += blackboard.base_attack_time;
writeBuff(`base_attack_time + ${blackboard.base_attack_time}s`);
blackboard.base_attack_time = 0;
buffFrame.atk_table = [...Array(blackboard["attack@max_stack_cnt"]+1).keys()].map(
x => blackboard["attack@atk"] * x
);
break;
case "tachr_1032_excu2_1":
if (!isSkill) {
buffFrame.times = 1 + blackboard.prob;
log.write("普攻:计算期望攻击次数(类似慕斯天赋算法)"); // 但是慕斯连击不加技力
}
break;
}
}
// --- applyBuff switch ends here ---
Expand Down Expand Up @@ -3005,11 +3022,7 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
duration = levelData.duration - prepDuration;
// 抬手时间
var frameBegin = calcAttackBegin(skillId, attackSpeed, options, log);
// var frameBegin = Math.round((checkSpecs(skillId, "attack_begin") || 12));
// if (skillId == "skchr_glaze_2" && options.far) {
// log.writeNote("技能前摇增加至27帧");
// frameBegin = 27;
// }

var t = frameBegin / 30;
attackCount = Math.ceil((duration - t) / attackTime);
log.write(`技能前摇: ${t.toFixed(3)}s, ${frameBegin} 帧`);
Expand Down Expand Up @@ -3086,6 +3099,13 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
log.writeNote(`计入 ${new_mag - mag} 发额外弹药`);
mag = new_mag;
}
if (charId == "char_1032_excu2") {
let extraMagazine = parseInt(options.extra_magazine) || 0;
if (extraMagazine > 0) {
log.writeNote(`计入 ${extraMagazine} 发额外弹药`);
mag += extraMagazine;
}
}
log.write(`弹药类技能: ${displayNames[skillId]}: 攻击 ${mag} 次`);
attackCount = mag;
duration = attackTime * attackCount;
Expand Down Expand Up @@ -3315,6 +3335,20 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
log.write(`攻速: ${aspd_list}...`);
log.write(`叠层攻击帧数(考虑帧数对齐补正): ${frame_list}...`);
log.write(`叠层时间 ${stack_frame} 帧(包括第${stack_attack_count}次攻击)`);
} else if (charId == "char_1032_excu2" && buffList["tachr_1032_excu2_1"]) {
let {prob, prob_add} = buffList["tachr_1032_excu2_1"];
let stackCount = Math.ceil((1-prob) / prob_add); // 叠层次数
let n = Math.min(attackCount, stackCount);
let stackProb = prob + prob_add * (n-1); // 等差数列了
let expect = (prob + stackProb) * n / 2 + Math.max(attackCount-n, 0);
log.writeNote(`技能连击期望 ${expect.toFixed(2)}`);
tags["origAttackCount"] = attackCount;
tags["extraAttack"] = expect;
attackCount += expect;
if (skillId == "skchr_excu2_3") {
duration += 1;
log.writeNote("尾刀动画时间1s");
}
}
// -- calcDurations skill judge ends here

Expand Down Expand Up @@ -3345,6 +3379,10 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
stunDuration = 20;
}
if (stunDuration > 0) log.write(`晕眩: ${stunDuration}s`);

// 圣葬: 开技能可以重置普攻,但结束时不行
// 因此设置reset_attack=False但在普攻这里改成True
if (charId == "char_1032_excu2") rst = true;

// 快速估算
let spRatio = 1;
Expand Down Expand Up @@ -3471,6 +3509,10 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
let p = buffList["tachr_301_cutter_1"].prob;
extra_sp += (skillId == "skchr_cutter_1" ? (attackCount*2+1)*p : attackCount*2*p);
}
if (buffList["tachr_1032_excu2_1"]) {
let p = buffList["tachr_1032_excu2_1"].prob;
extra_sp += attackCount*p;
}
next = (attackCount + extra_sp >= realSp);
if (next) attackCount -= 1;
}
Expand All @@ -3484,7 +3526,12 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
if (buffList["tachr_301_cutter_1"]) {
let p = buffList["tachr_301_cutter_1"].prob;
let _n = ( skillId == "skchr_cutter_1" ? (attackCount*2+1)*p : attackCount*2*p )
line.push(`光蚀刻痕触发 ${_n.toFixed(2)} 次`);
line.push(`光蚀刻痕期望 ${_n.toFixed(2)} 次`);
}
if (buffList["tachr_1032_excu2_1"]) {
let p = buffList["tachr_1032_excu2_1"].prob;
let _n = attackCount*p;
line.push(`连击期望 ${_n.toFixed(2)} 次`);
}
if (line.length > 0) log.write(`[特殊] ${line.join(", ")}`);
if (rst) {
Expand Down Expand Up @@ -3757,7 +3804,7 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
log.write(`[特殊] ${displayNames["skchr_bubble_2"]}: 攻击力以防御计算(${basicFrame.def + buffFrame.def})`);
}
// 迷迭香
if (["char_391_rosmon", "char_1027_greyy2", "char_421_crow", "char_491_humus",
if (["char_391_rosmon", "char_1027_greyy2", "char_421_crow", "char_491_humus", "char_1032_excu2",
"char_431_ashlok", "char_4066_highmo", "char_4039_horn"].includes(charId)) {
if (charId == "char_4039_horn" && options.melee) {}
else {
Expand Down Expand Up @@ -4225,6 +4272,12 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
case "tachr_491_humus_trait":
pool[2] += bb.value * dur.attackCount * Math.min(ecount, 2);
break;
case "tachr_1032_excu2_trait":
let excu2_trait_ratio = (isSkill && blackboard.id == "skchr_excu2_3") ? blackboard.trait_ratio : 1;
let block = (isSkill && blackboard.id == "skchr_excu2_2") ? 3 : 2;
log.write(`特性倍率 ${excu2_trait_ratio}x`);
pool[2] += bb.value * dur.attackCount * Math.min(ecount, block) * excu2_trait_ratio;
break;
case "tachr_2013_cerber_1":
let cerber_t1_scale = bb.atk_scale;
let cerber_t1_loss = 0;
Expand Down Expand Up @@ -5237,7 +5290,12 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
log.writeNote(`自爆真伤 ${kalts_t2_value}`);
}
break;

case "skchr_excu2_3":
let excu2_s3_atk = dur.tags["finalFrame.atk"] * bb["attack@final_atk_scale"];
damage = Math.max(excu2_s3_atk - edef, excu2_s3_atk * 0.05) * buffFrame.damage_scale;
pool[0] += damage * ecount;
log.writeNote(`尾刀伤害 ${damage.toFixed(1)}`);
break;
}; // extraDamage switch ends here

// 百分比/固定回血
Expand Down Expand Up @@ -5355,9 +5413,9 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
case "tachr_1031_slent2_1":
break;
case "skchr_gravel_2":
pool[4] += bb.hp_ratio * finalFrame.maxHp * 0.9;
pool[4] += bb.hp_ratio * finalFrame.maxHp;
log.write(`[特殊] ${displayNames[buffName]}: 护盾量 ${pool[4].toFixed(1)}`);
log.writeNote("护盾实际生效90%");
log.writeNote("护盾在9秒内衰减到0");
break;
case "skchr_phatom_1":
pool[4] += bb.hp_ratio * finalFrame.maxHp;
Expand Down Expand Up @@ -5484,7 +5542,7 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
function calculateGradDamage(_) { // _ -> args
var ret = 0;
var dmg_table = [];
var _seq = [...Array(_.dur.attackCount).keys()]; // [0, 1, ..., attackCount-1]
var _seq = [...Array(Math.round(_.dur.attackCount)).keys()]; // [0, 1, ..., attackCount-1]
var subProf = AKDATA.Data.character_table[_.charId].subProfessionId;

if (subProf == "funnel") {
Expand Down Expand Up @@ -5556,6 +5614,45 @@ function calculateGradDamage(_) { // _ -> args
kwargs.dmg_table = dmg_table;
}
_.log.write(explainGradAttackTiming(kwargs));
} else if (_.skillId == "skchr_excu2_3") {
// 异葬3: 计算每击的期望
// 第二段伤害是加攻以后的攻击力
let acount = _.dur.tags["origAttackCount"];
let tbl = _.buffFrame.atk_table;
let seq = [...Array(acount).keys()];
while (tbl.length < acount + 1)
tbl.push(tbl[tbl.length-1]); // padding
let excu2_atk = tbl.slice(0, acount+1).map(
x => _.finalFrame.atk + _.basicFrame.atk * x // 每击攻击力,第n次攻击连击时按第n+1次的攻击力计算
);
let excu2_dmg = excu2_atk.map(
x => Math.max(x-_.edef, x*0.05) * _.buffFrame.damage_scale // 伤害
);
let {prob, prob_add} = _.buffList["tachr_1032_excu2_1"];
let excu2_prob = seq.map(
x => Math.min(1, prob + prob_add * x) // 连击概率
);
let excu2_expect = seq.map(
x => excu2_dmg[x] + excu2_prob[x] * excu2_dmg[x+1]
);
ret = excu2_expect.reduce((x, y) => x + y);


// explain with markdown
let lines = [
["攻击次数", ...(seq.map(x=>x+1))],
[":--:", ...(seq.map(x => ":--:"))],
["攻击力", ...(excu2_atk.map(x=>Math.round(x)))],
["连击期望", ...(excu2_prob.map(x=>`${Math.round(x*100)}%`))],
["伤害期望", ...(excu2_expect.map(x=>Math.round(x)))]
];
let mdText = lines.map(x => `| ${x.join(" | ")} |`).join('\n');
_.log.write(mdText);
_.log.write("");

// 把最终攻击力暂存在dur.tags里面
_.dur.tags["finalFrame.atk"] = excu2_atk[excu2_atk.length-1];
_.log.write(`最终攻击力 ${_.dur.tags["finalFrame.atk"].toFixed(1)}`);
} else {
// 一般处理(煌,傀影): 攻击加成系数在buffFrame.atk_table预先计算好,此时finalFrame.atk为最后一次攻击的攻击力
// 由finalFrame.atk计算之前每次攻击的实际攻击力,同时不影响其他buff
Expand Down
Loading

0 comments on commit 88266d2

Please sign in to comment.