mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
#角色面板 支持对治疗量的计算,新增支持角色 心海
This commit is contained in:
parent
14d3aa9cc4
commit
db67f380fd
@ -1,3 +1,8 @@
|
||||
# 1.3.1
|
||||
|
||||
* `#角色面板` 伤害计算新增部分角色
|
||||
* 目前支持:雷神、胡桃、魈、神子、甘雨、宵宫、公子、绫人、绫华、心海
|
||||
|
||||
# 1.3.0
|
||||
|
||||
* 增加 `#雷神伤害` 功能
|
||||
|
@ -138,13 +138,14 @@ let Calc = {
|
||||
lodash.forEach(char.talent[key].tables, (tr) => {
|
||||
let val = tr.values[lv - 1];
|
||||
val = val.replace(/[^\x00-\xff]/g, "").trim();
|
||||
|
||||
let valArr = [];
|
||||
let valArr = [], valArr2 = [];
|
||||
lodash.forEach(val.split("/"), (v, idx) => {
|
||||
let valNum = 0;
|
||||
lodash.forEach(v.split("+"), (v) => {
|
||||
v = v.split("*")
|
||||
valNum += v[0].replace("%", "").trim() * (v[1] || 1);
|
||||
let v1 = v[0].replace("%", "").trim();
|
||||
valNum += v1 * (v[1] || 1);
|
||||
valArr2.push(v1)
|
||||
})
|
||||
valArr.push(valNum);
|
||||
});
|
||||
@ -156,6 +157,7 @@ let Calc = {
|
||||
} else {
|
||||
map[tr.name] = valArr;
|
||||
}
|
||||
map[tr.name + "2"] = valArr2;
|
||||
})
|
||||
ret[key] = map;
|
||||
})
|
||||
@ -205,7 +207,7 @@ let Calc = {
|
||||
let title = buff.title;
|
||||
|
||||
if (buff.mastery) {
|
||||
let mastery = attr.mastery.base + attr.mastery.plus;
|
||||
let mastery = Math.max(0, attr.mastery.base + attr.mastery.plus);
|
||||
let masteryNum = 2.78 * mastery / (mastery + 1400) * 100;
|
||||
buff.data = buff.data || {};
|
||||
lodash.forEach(buff.mastery.split(","), (key) => {
|
||||
@ -312,6 +314,7 @@ let Calc = {
|
||||
},
|
||||
|
||||
getDmgFn({ attr, avatar, enemyLv }) {
|
||||
|
||||
return function (pctNum = 0, talent = false, ele = false) {
|
||||
let { atk, dmg, cdmg, cpct } = attr;
|
||||
// 攻击区
|
||||
@ -335,11 +338,12 @@ let Calc = {
|
||||
let enemyDef = attr.enemy.def / 100;
|
||||
let enemyIgnore = attr.enemy.ignore / 100;
|
||||
|
||||
pctNum = pctNum / 100;
|
||||
|
||||
let plusNum = 0;
|
||||
|
||||
if (talent && attr[talent]) {
|
||||
pctNum = pctNum / 100;
|
||||
|
||||
let ds = attr[talent];
|
||||
pctNum += ds.pct / 100;
|
||||
dmgNum += ds.dmg / 100;
|
||||
@ -379,10 +383,18 @@ let Calc = {
|
||||
cdmgNum = 0;
|
||||
}
|
||||
|
||||
// 计算最终伤害
|
||||
let ret = {
|
||||
dmg: (atkNum * pctNum * (1 + multiNum) + plusNum) * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum,
|
||||
avg: (atkNum * pctNum * (1 + multiNum) + plusNum) * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
|
||||
let ret = {};
|
||||
if (talent === "dmgRet") {
|
||||
ret = {
|
||||
dmg: pctNum * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum,
|
||||
avg: pctNum * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
|
||||
}
|
||||
} else {
|
||||
// 计算最终伤害
|
||||
ret = {
|
||||
dmg: (atkNum * pctNum * (1 + multiNum) + plusNum) * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum,
|
||||
avg: (atkNum * pctNum * (1 + multiNum) + plusNum) * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(attr, { atkNum, pctNum, multiNum, plusNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }, ret)
|
||||
@ -436,8 +448,15 @@ let Calc = {
|
||||
}
|
||||
let dmg = Calc.getDmgFn({ attr, avatar, enemyLv }),
|
||||
basicDmgRet;
|
||||
if (detail.dmg) {
|
||||
basicDmgRet = detail.dmg({ attr, talent }, dmg);
|
||||
let ds = lodash.merge({ talent }, Calc.getDs(attr, meta, params));
|
||||
|
||||
if (detail.dmg || detail.heal) {
|
||||
basicDmgRet = detail.dmg ? detail.dmg(ds, dmg) : detail.heal(ds, function (num) {
|
||||
let { attr, calc } = ds;
|
||||
return {
|
||||
avg: num * (1 + calc(attr.heal) / 100)
|
||||
}
|
||||
});
|
||||
detail.userIdx = detailMap.length;
|
||||
detailMap.push(detail);
|
||||
ret.push({
|
||||
@ -478,8 +497,15 @@ let Calc = {
|
||||
}
|
||||
let { attr } = Calc.calcAttr(originalAttr, buffs, meta, params, incAttr, reduceAttr);
|
||||
let dmg = Calc.getDmgFn({ attr, avatar, enemyLv });
|
||||
if (detail.dmg) {
|
||||
let dmgCalcRet = detail.dmg({ attr, talent }, dmg);
|
||||
let ds = lodash.merge({ talent }, Calc.getDs(attr, meta, params));
|
||||
|
||||
if (detail.dmg || detail.heal) {
|
||||
let dmgCalcRet = detail.dmg ? detail.dmg(ds, dmg) : detail.heal(ds, function (num) {
|
||||
let { attr, calc } = ds;
|
||||
return {
|
||||
avg: num * (1 + calc(attr.heal) / 100)
|
||||
}
|
||||
});
|
||||
rowData.push({
|
||||
type: dmgCalcRet.avg === basicDmg.avg ? "avg" : (dmgCalcRet.avg > basicDmg.avg ? "gt" : "lt"),
|
||||
...dmgCalcRet
|
||||
|
@ -372,6 +372,15 @@ body {
|
||||
box-shadow: 0 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
.dmg-cont .tr > div.value-full {
|
||||
display: table;
|
||||
width: 200%;
|
||||
}
|
||||
|
||||
.dmg-cont .tr > div.value-none {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.dmg-cont .thead {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -64,8 +64,13 @@
|
||||
<div class="dmg tr">
|
||||
<div class="title dmg-idx">{{idx+1}}</div>
|
||||
<div class="title dmg-title">{{dmg.title}}</div>
|
||||
{{if dmg.dmg === "NaN"}}
|
||||
<div class="value value-full">{{dmg.avg}}</div>
|
||||
<div class="value value-none"></div>
|
||||
{{else}}
|
||||
<div class="value">{{dmg.dmg}}</div>
|
||||
<div class="value">{{dmg.avg}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
@ -123,7 +128,7 @@
|
||||
{{if dmgCfg && dmgCfg.attr && dmgCfg.attr.length>0}}
|
||||
<div class="dmg-calc dmg-cont cont">
|
||||
<div class="cont-title">
|
||||
词条伤害计算<span>#{{name}}伤害{{dmgCfg.userIdx+1}}: 当前计算为[{{dmgCfg.title}}]的 平均伤害</span>
|
||||
词条伤害计算<span>#{{name}}伤害{{dmgCfg.userIdx+1}}: 当前计算为[{{dmgCfg.title}}]</span>
|
||||
</div>
|
||||
<div class="cont-table">
|
||||
<div class="tr thead ">
|
||||
@ -145,12 +150,13 @@
|
||||
{{if cell.type === "na"}}
|
||||
<div class="td na">
|
||||
<strong>-</strong>
|
||||
<span>{{dmgCfg.basicRet.avg}}/{{dmgCfg.basicRet.dmg}}</span>
|
||||
<span>{{dmgCfg.basicRet.avg}}{{dmgCfg.basicRet.dmg!="NaN"?`/${dmgCfg.basicRet.dmg}`:''}}</span>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="td {{cell.type}}">
|
||||
<strong>{{cell.val}}</strong>
|
||||
<span>{{cell.avg}}/{{cell.dmg}}</span>
|
||||
|
||||
<span>{{cell.avg}}{{cell.dmg!="NaN"?`/${cell.dmg}`:''}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
@ -160,7 +166,7 @@
|
||||
<div class="cont-footer dmg-desc">
|
||||
<ul>
|
||||
<li>大数字的含义为圣遗物副词条置换后<strong>平均伤害</strong>的变化,下方的详情数字为<strong>平均伤害</strong>/<strong>暴击伤害</strong>。</li>
|
||||
<li><strong>平均伤害</strong>:是将暴击率计算在内的伤害期望,能反映综合的输出能力,不等于实际伤害数字。</li>
|
||||
<li>关于<strong>平均伤害</strong>:是将暴击率计算在内的伤害期望,能反映综合的输出能力,不等于实际伤害数字。</li>
|
||||
<li>可用于评估当前面板下圣遗物副词条的侧重方向。实际游戏情况更加复杂,结果供参考~</li>
|
||||
<li>如需更换计算的伤害类型,可使用命令 <strong>#{{name}}伤害+序号</strong>来切换,序号参见伤害计算板块</li>
|
||||
|
||||
|
72
resources/meta/character/珊瑚宫心海/calc.js
Normal file
72
resources/meta/character/珊瑚宫心海/calc.js
Normal file
@ -0,0 +1,72 @@
|
||||
import lodash from "lodash";
|
||||
|
||||
export const details = [{
|
||||
check: ({ cons }) => cons < 2,
|
||||
title: "水母每跳治疗",
|
||||
heal: ({ attr, talent, calc }, heal) => {
|
||||
let t = talent.e['治疗量2'], hp = calc(attr.hp);
|
||||
return heal(hp * t[0] / 100 + t[1]);
|
||||
}
|
||||
}, {
|
||||
cons: 2,
|
||||
title: "半血水母每跳治疗",
|
||||
heal: ({ attr, talent, calc }, heal) => {
|
||||
let t = talent.e['治疗量2'], hp = calc(attr.hp);
|
||||
return heal(hp * t[0] / 100 + t[1] * 1 + hp * 0.045);
|
||||
}
|
||||
}, {
|
||||
title: "开Q普攻三段伤害",
|
||||
dmg: ({ attr, talent }, dmg) => dmg(talent.a['三段伤害'], 'a')
|
||||
}, {
|
||||
title: "开Q重击伤害",
|
||||
dmg: ({ attr, talent }, dmg) => dmg(talent.a['重击伤害'], 'a2')
|
||||
}, {
|
||||
title: "开Q普攻三段总伤",
|
||||
dmg: ({ attr, talent, cons, calc }, dmg) => {
|
||||
let ret = { dmg: 0, avg: 0 };
|
||||
lodash.forEach('一二三'.split(""), (num) => {
|
||||
let dmgRet = dmg(talent.a['三段伤害'], 'a');
|
||||
ret.dmg += dmgRet.dmg;
|
||||
ret.avg += dmgRet.avg;
|
||||
});
|
||||
if (cons > 0) {
|
||||
let dmgRet = dmg(calc(attr.hp) * 0.3, 'dmgRet');
|
||||
ret.dmg += dmgRet.dmg;
|
||||
ret.avg += dmgRet.avg;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}];
|
||||
|
||||
export const defDmgIdx = 1;
|
||||
export const mainAttr = "hp,atk";
|
||||
|
||||
|
||||
export const buffs = [{
|
||||
title: "心海被动:治疗加成提高25%",
|
||||
}, {
|
||||
title: "心海被动:开Q后重击伤害基于治疗加成提高[aPlus]",
|
||||
data: {
|
||||
aPlus: ({ attr, calc }) => calc(attr.hp) * calc(attr.heal) * 0.15 / 100,
|
||||
a2Plus: ({ attr, calc }) => calc(attr.hp) * calc(attr.heal) * 0.15 / 100
|
||||
}
|
||||
}, {
|
||||
title: "海人化羽:开Q后普攻伤害提高[aPlus]",
|
||||
data: {
|
||||
aPlus: ({ attr, talent, calc }) => calc(attr.hp) * talent.q['普通攻击伤害提升'] / 100
|
||||
}
|
||||
}, {
|
||||
title: "海人化羽:开Q后重击伤害提高[a2Plus]",
|
||||
data: {
|
||||
a2Plus: ({ attr, talent, calc }) => calc(attr.hp) * talent.q['重击伤害提升'] / 100
|
||||
}
|
||||
}, {
|
||||
title: "心海1命:开Q后第三段普攻额外释放一只游鱼,造成生命值上限30%的水元素伤害",
|
||||
cons: 1
|
||||
}, {
|
||||
title: "心海6命:开Q攻击获得治疗后,获得40%水伤加成",
|
||||
cons: 6,
|
||||
data: {
|
||||
dmg: 40
|
||||
}
|
||||
}];
|
@ -222,12 +222,12 @@ let catalyst = {
|
||||
}
|
||||
},
|
||||
"不灭月华": {
|
||||
title: "治疗加成提高[heal]%,普攻伤害增加[aPlus]",
|
||||
title: "治疗加成提高[_heal]%,普攻伤害增加[aPlus]",
|
||||
refine: {
|
||||
heal: step(10, 2.5)
|
||||
_heal: step(10, 2.5)
|
||||
},
|
||||
data: {
|
||||
aPlus: ({ attr, calc }) => calc(attr.hp) / 100
|
||||
aPlus: ({ attr, calc, refine }) => calc(attr.hp) * step(1, 0.5)[refine] / 100
|
||||
}
|
||||
},
|
||||
"神乐之真意": {
|
||||
|
Loading…
Reference in New Issue
Block a user