Skip to content

Commit

Permalink
update Apr 15 version
Browse files Browse the repository at this point in the history
  • Loading branch information
xulai1001 committed Apr 15, 2021
1 parent 49deacd commit c5bf0c9
Show file tree
Hide file tree
Showing 147 changed files with 162,839 additions and 61,120 deletions.
3 changes: 3 additions & 0 deletions _docs/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ order: 4
category: 工具
icon: info-circle
---
## 21.04.15
- [update] 异客等

## 21.04.11
- [bugfix] 修正了惊蛰的弹射公式。以前将倍率计算了两次。现在改为正确的连续乘算

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

window.AKDATA = {
akdata: "210309", // jsdelivr tag version
akdata: "210414", // jsdelivr tag version

Data: {},

new_op: ["char_456_ash", "char_457_blitz", "char_458_rfrost", "char_459_tachak"],
new_op: ["char_472_pasngr", "char_363_toddi", "char_304_zebra"],

checkVersion: function (callback) {
$.getJSON(`../resources/version.json?_=${Math.round(Math.random()*1e8)}`, function(v) {
Expand Down
43 changes: 37 additions & 6 deletions resources/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ function applyBuff(charAttr, buffFrm, tag, blackbd, isSkill, isCrit, log, enemy)
if (isSkill && skillId == "skchr_blitz_2")
blackboard.atk_scale *= charAttr.buffList.skill.talent_scale;
break;
case "tachr_472_pasngr_1":
blackboard.damage_scale = blackboard["pasngr_t_1[enhance].damage_scale"];
break;
}
}
} else if (checkSpecs(tag, "ranged_penalty")) { // 距离惩罚类
Expand Down Expand Up @@ -780,6 +783,7 @@ function applyBuff(charAttr, buffFrm, tag, blackbd, isSkill, isCrit, log, enemy)
break;
case "skchr_brownb_2": // 攻击间隔缩短,但是是乘算负数
case "skchr_whispr_2":
case "skchr_pasngr_2":
writeBuff(`base_attack_time: ${blackboard.base_attack_time}x`);
blackboard.base_attack_time *= basic.baseAttackTime;
break;
Expand Down Expand Up @@ -1052,6 +1056,12 @@ function applyBuff(charAttr, buffFrm, tag, blackbd, isSkill, isCrit, log, enemy)
blackboard.base_attack_time *= basic.baseAttackTime;
if (!isCrit) delete blackboard.atk_scale;
break;
case "skchr_pasngr_3":
done = true; break;
case "skchr_toddi_1":
blackboard.edef_scale = blackboard.def;
delete blackboard.def;
break;
}
}

Expand Down Expand Up @@ -1344,11 +1354,15 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
if (checkSpecs(skillId, "instant_buff")) { // 瞬发的有持续时间的buff,例如血浆
duration = blackboard.duration || checkSpecs(skillId, "duration");
attackCount = Math.ceil(duration / attackTime);
tags.push("instant", "buff"); log.write("瞬发增益效果");
tags.push("instant", "buff"); log.writeNote("瞬发Buff,技能周期为Buff持续时间");
} else if (skillId == "skchr_ash_2") {
attackCount = 31;
duration = attackTime * attackCount;
log.write(`[特殊] ${displayNames["skchr_ash_2"]}: 攻击 31 次`);
} else if (skillId == "skchr_toddi_2") {
attackCount = 10;
duration = attackTime * attackCount;
log.write(`[特殊] ${displayNames["skchr_toddi_2"]}: 攻击 10 次`);
} else { // 普通瞬发
attackCount = 1;
// 不占用普攻的瞬发技能,持续时间等于动画时间。否则持续时间为一次普攻间隔
Expand Down Expand Up @@ -1509,6 +1523,7 @@ function calcDurations(isSkill, attackTime, attackSpeed, levelData, buffList, bu
attackDuration -= blackboard.duration || checkSpecs(skillId, "duration");
attackCount = Math.ceil(attackDuration / attackTime);
duration = attackCount * attackTime;
log.writeNote("瞬发Buff,技能周期为Buff持续时间");
} else if (buffList["tachr_400_weedy_2"] && options.cannon) { // 水炮充能,持续20s/cd35s
let m = Math.floor(spData.spCost / 55);
let a = m * 6 + m * 55 * sp_rate; // 前m个水炮充能+自然恢复的sp量
Expand Down Expand Up @@ -1734,14 +1749,16 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
let emrpct = emr / 100;
let ecount = Math.min(buffFrame.maxTarget, enemy.count);

// 平均化惊蛰伤害
if (charId == 'char_306_leizi' && !(isSkill && blackboard.id == "skchr_leizi_2")) {
var scale = 1, tot = 1;
// 平均化惊蛰/异客伤害
if ((charId == 'char_306_leizi' || charId == "char_472_pasngr") &&
!(isSkill && blackboard.id == "skchr_leizi_2")) {
let scale = 1, tot = 1, sks = [1];
for (var i=0; i<ecount-1; ++i) {
scale *= 0.75; tot += scale;
scale *= 0.8; tot += scale; sks.push(scale);
}
log.write(`[特殊] 电法: 原本伤害倍率: ${buffFrame.damage_scale.toFixed(2)}`);
buffFrame.damage_scale *= tot / ecount;
log.write(`[特殊] 惊蛰: 平均倍率 ${(tot / ecount).toFixed(2)}x`);
log.write(`[特殊] 电法: 连锁倍率: ${sks.map(x => x.toFixed(2))}, 平均伤害倍率 ${buffFrame.damage_scale.toFixed(2)}x`);
}

// 计算攻击次数和持续时间
Expand Down Expand Up @@ -2039,6 +2056,7 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
log.write(`[特殊] ${displayNames[buffName]}: 伤害为0 (以上计算无效)`);
break;
case "skchr_silent_2":
case "skchr_zebra_1":
damagePool[2] = 0;
log.write(`[特殊] ${displayNames[buffName]}: 治疗为0 (以上计算无效)`);
break;
Expand Down Expand Up @@ -2120,6 +2138,18 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
pool[1] += damage * bb.projectile_delay_time * enemy.count;
log.write(`[特殊] ${displayNames[buffName]}: 燃烧伤害 ${damage.toFixed(1)}, 命中 ${bb.projectile_delay_time * enemy.count}`);
break;
case "skchr_pasngr_3":
atk = finalFrame.atk * bb.atk_scale;
damage = Math.max(atk * (1-emrpct), atk * 0.05) * buffFrame.damage_scale;
pool[1] += damage * ecount * 8;
log.write(`[特殊] ${displayNames[buffName]}: 雷击区域伤害 ${damage.toFixed(1)} (平均倍率 ${buffFrame.damage_scale.toFixed(2)}), 命中 ${8 * ecount}`);
break;
case "skchr_toddi_2":
atk = finalFrame.atk / bb["attack@atk_scale"] * bb["attack@splash_atk_scale"];
damage = Math.max(atk - enemy.def, atk * 0.05);
pool[0] += damage * enemy.count * dur.hitCount;
log.write(`[特殊] ${displayNames[buffName]}: 爆炸伤害 ${damage.toFixed(1)}, 命中 ${enemy.count * dur.hitCount}`);
break;
// 间接治疗
case "skchr_tiger_2":
pool[2] += damagePool[1] * bb.heal_scale; break;
Expand Down Expand Up @@ -2276,6 +2306,7 @@ function calculateAttack(charAttr, enemy, raidBlackboard, isSkill, charData, lev
case "tachr_416_zumama_1":
case "tachr_362_saga_2":
case "skchr_dusk_2":
case "tachr_472_pasngr_1":
break;
case "skchr_gravel_2":
case "skchr_phatom_1":
Expand Down
4 changes: 3 additions & 1 deletion resources/customdata/dps_options.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
"char_455_nothin": [ "cond"],
"char_456_ash": [ "cond" ],
"char_457_blitz": [ "cond" ],
"char_459_tachak": [ "crit" ]
"char_459_tachak": [ "crit" ],
"char_472_pasngr": [ "cond" ],
"char_363_toddi": [ "cond" ]
}
}
5 changes: 5 additions & 0 deletions resources/customdata/dps_specialtags.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"skchr_myrtle_2": { "reset_attack": true, "sec": true },
"skchr_nian_2": { "reflect": true },
"skchr_nightm_1": { "damage_type": 1 },
"skchr_pasngr_1": { "sim": true },
"skchr_peacok_1": { "sim": true },
"skchr_peacok_2": { "cast_time": 45, "frame_corr": -15, "damage_type": "0" },
"skchr_phatom_2": { "grad": true },
Expand Down Expand Up @@ -185,6 +186,7 @@
"skchr_whitew_2": { "reset_attack": true },
"skchr_yak_1": { "damage_type": "0" },
"skchr_yuki_2": { "reset_attack": true, "attack_begin": 22, "note": "可能丢失最多33%伤害" },
"skchr_zebra_1": { "instant_buff": true, "note": "可以治疗召唤物(待确认),瞬发Buff,技能周期为Buff持续时间" },
"skchr_zumama_1": { "passive": true },
"skchr_zumama_3": { "reset_attack": true },
"skcom_assist_cost[2]": { "reset_attack": true },
Expand Down Expand Up @@ -240,6 +242,7 @@
"tachr_349_chiave_1": { "cond": true, "note": "天赋按1层计算" },
"tachr_356_broca_1": { "cond": true },
"tachr_358_lisa_2": { "cond": true },
"tachr_363_toddi_1": { "cond": true },
"tachr_366_acdrop_1": { "cond": true },
"tachr_367_swllow_1": { "crit": true },
"tachr_385_finlpp_trait": { "ranged_penalty": true },
Expand All @@ -262,6 +265,8 @@
"tachr_440_pinecn_1": { "cond": true },
"tachr_452_bstalk_trait": { "cond": true },
"tachr_457_blitz_1": { "cond": true },
"tachr_472_pasngr_1": { "cond": true, "note": "勾选表示两个天赋都触发" },
"tachr_472_pasngr_2": { "cond": true },
"tachr_503_rang_1": { "cond": true },
"tachr_511_asnipe_1": { "crit": true },
"tachr_2015_dusk_1": { "stack": true }
Expand Down
15 changes: 13 additions & 2 deletions resources/customdata/dps_specialtags_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
"skchr_amiya2_1": { "times": 2 },
"skchr_amiya2_2": { "damage_type": 3, "note": "斩击按3s计算", "reset_attack": true, "prepDuration": 3,
"masked": ["times", "atk_scale"] },
"skchr_archet_1": { "sim": true },
"skchr_archet_1": { "sim": true, "reset_attack": false },
"skchr_asbest_1": { "damage_type": 1, "masked": ["damage_scale"] },
"skchr_asbest_2": { "damage_type": 1, "max_target": "aoe" },
"skchr_ash_2": { "note": "勾选触发天赋时,按全程晕眩计算", "prepDuration": 1 },
"skchr_ash_3": { "note": "勾选触发天赋时,按撞墙计算" },
"skchr_astesi_2": { "max_target": 2 },
"skchr_ayer_1": { "reset_attack": "false", "no_ranged_penalty": true },
"skchr_ayer_2": { "reset_attack": true, "no_ranged_penalty": true, "masked": ["atk_scale"] },
Expand Down Expand Up @@ -97,6 +99,7 @@
"skchr_demkni_2": { "frame_corr": 0, "max_target": "aoe" },
"skchr_demkni_3": { "sec": true, "frame_corr": 0, "max_target": "aoe" },
"skchr_durnar_2": { "max_target": "block" },
"skchr_dusk_1": { "sim": true, "cast_time": 87 },
"skchr_elysm_2": { "masked": ["def", "max_target"] },
"skchr_estell_2": { "damage_type": "0"},
"skchr_ethan_1": { "passive": true },
Expand Down Expand Up @@ -135,6 +138,7 @@
"skchr_iris_2": { "cast_time": 24, "reset_attack": "ogcd" },
"skchr_jaksel_2": { "note": "按最大反击速度计算" },
"skchr_kafka_2": { "reset_attack": true, "masked": [ "atk_scale" ] },
"skchr_lava2_2": { "sec": true, "note": "不重叠部分伤害减半" },
"skchr_lionhd_2": { "reset_attack": "ogcd", "cast_time": 32 },
"skchr_liskam_2": { "alias": [{ "key": "stunDuration", "alias": "stun" }] },
"skchr_mantic_1": { "passive": true },
Expand Down Expand Up @@ -184,6 +188,7 @@
"skchr_rosmon_1": { "damage_type": "0" },
"skchr_rosmon_2": { "masked": ["attack@times"] },
"skchr_rosmon_3": { "enemy": true },
"skchr_saga_2": { "sim": true, "note": "动画时间待测试" },
"skchr_sddrag_2": { "damage_type": "0" },
"skchr_shining_2": { "cast_time": 77, "sim": true, "masked": true },
"skchr_silent_2": { "instant_buff": true, "duration": 15, "note": "施工中", "masked": true },
Expand Down Expand Up @@ -214,6 +219,8 @@
"skchr_swire_1": { "masked": [ "atk" ] },
"skchr_swllow_1": { "sim": true, "times": 2 },
"skchr_swllow_2": { "reset_attack": true, "attack_begin": 2, "times": 3 },
"skchr_tachak_1": { "times": 2, "note": "未计算无视防御效果" },
"skchr_tachak_2": { "times": 2 },
"skchr_tiger_1": { "alias": [{"key": "edef_pene_scale", "alias": "def_penetrate"}] },
"skchr_texas_2": { "cast_time": 65, "times": 2, "max_target": "aoe" },
"skchr_thorns_2": { "reset_attack": true },
Expand All @@ -223,6 +230,7 @@
] },
"skchr_tomimi_1": { "damage_type": "0", "reset_attack": true },
"skchr_tomimi_2": { "damage_type": "0", "reset_attack": true, "masked": ["base_attack_time"] },
"skchr_tuye_1": { "reset_attack": "ogcd", "cast_time": 30 },
"skchr_vodfox_2": { "instant_buff": true, "duration": 15, "note": "施工中", "masked": true },
"skchr_waaifu_1": { "alias": [{ "key": "atk", "alias": "waaifu_s_1[self].atk" }] },
"skchr_waaifu_2": { "max_target": "aoe" },
Expand Down Expand Up @@ -319,6 +327,7 @@
"tachr_391_rosmon_1": { "alias": [{"key": "edef_pene", "alias": "def_penetrate_fixed"}] },
"tachr_254_vodfox_1": { "cond": true },
"tachr_401_elysm_1": { "masked": [ "attack_speed" ] },
"tachr_402_tuye_1": { "cond": true },
"tachr_405_absin_1": { "cond": true },
"tachr_415_flint_1": { "cond": true },
"tachr_416_zumama_1": { "cond": true, "masked": [ "hp_ratio" ] },
Expand All @@ -328,7 +337,9 @@
"tachr_436_whispr_1": { "cond": true },
"tachr_440_pinecn_1": { "cond": true },
"tachr_452_bstalk_trait": { "cond": true },
"tachr_457_blitz_1": { "cond": true },
"tachr_503_rang_1": { "cond": true },
"tachr_509_acast_1": { "alias": [{ "key": "emr_pene", "alias": "magic_resist_penetrate_fixed" }] },
"tachr_511_asnipe_1": { "crit": true }
"tachr_511_asnipe_1": { "crit": true },
"tachr_2015_dusk_1": { "stack": true }
}
36 changes: 19 additions & 17 deletions resources/dps_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ var common = {
},
noExtra: function (args) {
return { pool: [0, 0, 0, 0, 0] };
},
attackSpInterval: function (args) {
// 呵斥
// spCost = attackCount + floor(attackCount * attackTime / interval)
// => spCost / (1+attackTime/interval) < [attackCount] < (spCost+1) / (1+attackTime/interval)
// 直接取ceil
console.log("here", args);
var attackCount = Math.ceil(args.spData.spCost /
(1 + args.attackTime / args.blackboard.interval));
var sp = Math.floor(attackCount * args.attackTime / args.blackboard.interval);
var duration = attackCount * args.attackTime;
this.log.write(`[特殊] 天赋恢复sp: sp + ${sp}`);
this.log.note(`天赋回复 ${sp}sp`);
return {
attackCount, duration,
rotationFlags: { attack: true }
};
}
};

Expand Down Expand Up @@ -628,23 +645,7 @@ AKDATA.Dps.Actions = {
return { duration, attackCount };
}
},
tachr_010_chen_1: {
normal_duration: function (args) {
// 呵斥
// spCost = attackCount + floor(attackCount * attackTime / interval)
// => spCost / (1+attackTime/interval) < [attackCount] < (spCost+1) / (1+attackTime/interval)
// 直接取ceil
var attackCount = Math.ceil(args.spData.spCost /
(1 + args.attackTime / args.blackboard.interval));
var sp = Math.floor(attackCount * args.attackTime / args.blackboard.interval);
var duration = attackCount * args.attackTime;
this.log.write(`[特殊] ${_names["tachr_010_chen_1"]}: sp = ${sp}, attack_count = ${attackCount}`);
return {
attackCount, duration,
rotationFlags: { attack: true }
};
}
},
tachr_010_chen_1: { normal_duration: common.attackSpInterval },
tachr_017_huang_1: { extraDamage: common.noExtra },
tachr_1001_amiya2_1: {
applyBuff: function (attr, blackboard) {
Expand Down Expand Up @@ -949,6 +950,7 @@ AKDATA.Dps.Actions = {
this.rotation.totalDuration / args.blackboard.interval, 2);
}
},
tachr_332_archet_1: { normal_duration: common.attackSpInterval },
tachr_337_utage_trait: {
extraDamage: function(args) { // 攻回
return this.attr.calcDamagePool(args.blackboard.value, this.hitCount, 2);
Expand Down
31 changes: 17 additions & 14 deletions resources/dpsv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function getAliasedBlackboard(buffKey, blackboard, options) {
if (ret[a.alias]) delete ret[a.alias];
}
});
console.log("Raw/Aliased", blackboard, ret);
// console.log("Raw/Aliased", blackboard, ret);
return ret;
} else return blackboard;
}
Expand Down Expand Up @@ -201,13 +201,8 @@ class Character {

explain(log) {
log.pushKey("Character");
//log.write(`| 角色 | 等级 | 技能 |`);
//log.write(`| :--: | :--: | :--: | `);
//log.write(`| ~${this.charId}~ - **${this.charData.name}** | 精英 ${this.phase}, 等级 ${this.level},
// 潜能 ${this.potentialRank+1} | ${this.skillName}, 等级 ${this.skillLevel+1} |`);
log.write(`${this.charId} - ${this.charData.name}`);
log.write(`精英 ${this.phase}, 等级 ${this.level}, 潜能 ${this.potentialRank+1}`);
log.write(`${this.skillName}, 等级 ${this.skillLevel+1}`);
log.write(`角色: ${this.charData.name} / ${this.charId}, 精英 ${this.phase}, 等级 ${this.level}, 潜能 ${this.potentialRank+1}`);
log.write(`技能: ${this.skillName} / ${this.skillId}, 等级 ${this.skillLevel+1}`);
log.popKey();
}

Expand Down Expand Up @@ -247,11 +242,10 @@ class Character {
} // getDamageType

canResetAttack() {
return (checkSpecs(this.skillId, "reset_attack") != false ||
["base_attack_time", "attack@max_target", "max_target"].some(
x => this.blackboard[x] != null
)
);
if (checkSpecs(this.skillId, "reset_attack") != null)
return _spec;
else
return ["base_attack_time", "attack@max_target", "max_target"].some(x => this.blackboard[x] != null);
}
}

Expand Down Expand Up @@ -410,6 +404,7 @@ class DpsContext {
// 被调用的函数必须返回对象字典,返回值放在this.retvar
callSpecial(buffKey, funcKey, args=null) {
var actions = AKDATA.Dps.Actions; // npm需要注释掉该行
//console.log("here", buffKey);
if (actions[buffKey] && actions[buffKey][funcKey]) {
console.log(`callSpecial ${buffKey}->${funcKey}`);
this.retvar = actions[buffKey][funcKey].apply(this, args); // call
Expand All @@ -433,6 +428,7 @@ class DpsContext {
// 设置buffKey/blackboard
args.buffKey = b;
args.blackboard = this.buffList[b];
//console.log(buffKey, funcKey, args);
// 调用并合并结果
r = this.callSpecial(b, funcKey, [args]);
if (r) {
Expand Down Expand Up @@ -1461,10 +1457,17 @@ class DpsCalculator {
lines.push("## 技能-循环相关");
lines.push(`攻击次数: ${e.s_rot.totalAttackCount} (暴击 ${e.s_rot.critAttackCount})`);
lines.push(`命中: ${e.s_hitc} (+暴击 ${e.s_hitcc})`);
lines.push(`持续时间 ${e.s_rot.totalDuration.toFixed(3)} s (准备 ${e.prep} s, 眩晕 ${e.stun} s)`);
lines.push(`持续时间 ${e.s_rot.totalDuration.toFixed(3)} s (准备 ${e.prep} s)`);
lines.push(`启动技力需求: ${e.s_rot.startSp}, ${e.start.toFixed(3)} s`);
if (e.s_log.Rotation) lines.push(...e.s_log.Rotation);

lines.push("## 普攻-循环相关");
lines.push(`攻击次数: ${e.n_rot.totalAttackCount} (暴击 ${e.n_rot.critAttackCount})`);
lines.push(`命中: ${e.n_hitc} (+暴击 ${e.n_hitcc})`);
lines.push(`持续时间 ${e.n_rot.totalDuration.toFixed(3)} s (眩晕 ${e.stun} s)`);
if (e.n_log.Rotation) lines.push(...e.n_log.Rotation);


lines.push("## 技能-伤害计算");
lines.push("| |物理|法术|治疗|真伤|护盾|");
lines.push("| :--: | :--: | :--: | :--: | :--: | :--: |");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function Act17D7MainDlg:_InitFromDynActs(actId)
end

function Act17D7MainDlg:_InitFromStageData()
local suc, stageData = CS.Torappu.StageDB.instance:TryGetStage(self._stageId)
if not suc then
local stageData = CS.Torappu.StageDataUtil.GetStageOrNull(self._stageId)
if stageData == nil then
return;
end
local displayDetailRewards = stageData.stageDropInfo.displayDetailRewards;
Expand Down
Loading

0 comments on commit c5bf0c9

Please sign in to comment.