#角色面板 伤害计算增加甘雨

完善了一些计算逻辑
This commit is contained in:
yoimiya-kokomi 2022-04-27 03:07:58 +08:00
parent 9290346ce3
commit a86698c563
6 changed files with 38 additions and 22 deletions

View File

@ -1,6 +1,6 @@
#1.2.0
* `#角色面板` 增加伤害计算功能
* 目前支持角色:雷神、胡桃、魈
* 目前支持角色:雷神、胡桃、魈、神子、甘雨
* 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果
* 计算伤害为满Buff情况后续会出更详细的Buff及计算展示
* `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制

View File

@ -185,7 +185,7 @@ export async function updateMiaoPlugin(e) {
exec(command, function (error, stdout, stderr) {
if (error) {
if (/Yunzai not found/.test(error)) {
e.reply("自动重启失败,请使用 npm run start 命令启动Yunzai-Bot");
e.reply("自动重启失败,请手动重启以应用新版喵喵。请使用 npm run start 命令启动Yunzai-Bot");
} else {
e.reply("重启失败!\nError code: " + error.code + "\n" + error.stack + "\n 请稍后重试。");
}
@ -195,5 +195,5 @@ export async function updateMiaoPlugin(e) {
}, 1000);
});
return true;
}

View File

@ -359,14 +359,18 @@ let Calc = {
let defNum = (lv + 100) / ((lv + 100) + (enemyLv + 100) * (1 - enemyDef) * (1 - enemyIgnore));
// 抗性区
let kx = 10 - (attr.kx || 0);
let kNum = 0.9;
if (kx >= 0) {
kNum = (100 - kx) / 100;
} else {
kNum = 1 - kx / 200
}
// 反应区
let eleNum = 1;
if (ele) {
eleNum = { zf: 1.5, rh: 2 }[ele] || 1;
if (attr[ele]) {
eleNum = eleNum * (1 + attr[ele] / 100);
}

View File

@ -1,18 +1,30 @@
export const details = [];
export const details = [{
title: "霜华绽发伤害",
dmg: ({ talent }, dmg) => dmg(talent.a['霜华矢·霜华绽发伤害'], 'a2')
}, {
title: "霜华矢两段总伤害",
dmg: ({ talent }, dmg) => dmg(talent.a['霜华矢·霜华绽发伤害'] + talent.a['霜华矢命中伤害'], 'a2')
}, {
title: "霜华矢两段+融化",
dmg: ({ talent }, dmg) => dmg(talent.a['霜华矢·霜华绽发伤害'] + talent.a['霜华矢命中伤害'], 'a2', 'rh')
}, {
title: "Q单个冰凌伤害",
params: {
q: 1
},
dmg: ({ talent }, dmg) => dmg(talent.q['冰棱伤害'], 'q')
}];
export const defParams = {
};
export const buffs = [{
cons: 1,
title: "1命效果霜华失命中减少敌人15%冰抗",
data: {
kx: 15
kx: ({ params }) => params.q ? 0 : 15
}
}, {
cons: 4,
title: "4命效果大招领域内敌人受到的伤害提升25%",
data: {
dmg: 25
dmg: ({ params }) => params.q ? 25 : 0
}
}];

View File

@ -45,7 +45,7 @@ export const buffs = {
}
},
"流浪大地的乐团4": {
check: ({ weaponType }) => ['法器', '弓'].includes(weaponType),
check: ({ weaponType }) => ['法器', '弓'].includes(weaponType),
title: "乐团4角色重击造成的伤害提高35%",
data: {
a2Dmg: 35
@ -71,12 +71,12 @@ export const buffs = {
}
},
"炽烈的炎之魔女4": {
check:({element})=>element === "火",
title: "魔女4蒸发、融化伤害提高15%2层获得15%火元素伤害加成",
check: ({ element }) => element === "火",
title: "魔女4蒸发、融化伤害提高15%1层额外提高7.5%火元素伤害加成",
data: {
zf: 15,
rh: 15,
dmg: 15
dmg: ({ params }) => (params.mn || 1) * 7.5
}
},
"昔日宗室之仪2": {
@ -92,14 +92,14 @@ export const buffs = {
}
},
"冰风迷途的勇士4": {
check:({element})=>element === "冰",
check: ({ element }) => element === "冰",
title: "冰套4攻击处于冰元素影响下的敌人时暴击率提高20%",
data: {
cpct: 20
}
},
"沉沦之心4": {
check:({element})=>element === "水",
check: ({ element }) => element === "水",
title: "水套4施放元素战技后普攻与重击伤害提高30%",
data: {
aDmg: 30,
@ -129,14 +129,14 @@ export const buffs = {
}
},
"平息鸣雷的尊者4": {
check:({element})=>element === "雷",
check: ({ element }) => element === "雷",
title: "平雷4对处于雷元素影响下的敌人造成的伤害提升35%",
data: {
dmg: 35
}
},
"渡过烈火的贤人4": {
check:({element})=>element === "火",
check: ({ element }) => element === "火",
title: "渡火4对处于火元素影响下的敌人造成的伤害提升35%",
data: {
dmg: 35

View File

@ -16,6 +16,7 @@ let polearm = {
}
},
"匣里灭辰": {
check: ({ element }) => ['水', '火'].includes(element),
title: "对于水或或元素影响的敌人造成伤害提高[dmg]%",
refine: {
dmg: [20, 24, 28, 32, 36]
@ -83,9 +84,8 @@ let polearm = {
"护摩之杖": {
title: "角色生命低于50%时额外获得[atkPlus]攻击力",
data: {
atkPlus: ({ attr, refine }) => {
let { hp } = attr,
totalHp = hp.base + hp.plus + hp.pct * hp.base / 100;
atkPlus: ({ attr, refine,calc }) => {
let totalHp = calc(attr.hp);
return totalHp * ([0.8, 1, 1.2, 1.4, 1.6][refine] + [1, 1.2, 1.4, 1.6, 1.8][refine]) / 100
}
}