#角色面板 伤害计算增加 宵宫、公子

#调整角色面板的文件格式及尺寸,优化显示效果及图像尺寸
This commit is contained in:
yoimiya-kokomi 2022-04-28 02:41:08 +08:00
parent 18186fd75f
commit 3ecde0ef77
7 changed files with 82 additions and 32 deletions

View File

@ -1,12 +1,18 @@
# 1.2.0
# 1.2.1
* `#角色面板` 增加伤害计算功能
* 目前支持角色:雷神、胡桃、魈、神子、甘雨
* 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果
* 计算伤害为满Buff情况后续会出更详细的Buff及计算展示
* 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子
* 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果
* 计算伤害为满Buff情况后续会出更详细的Buff及计算展示
# 1.2.0
* `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制
* 增加 `#喵喵更新` 功能
* 感谢 @碎月 @清秋 的代码支持
* 若更新成功会重启Yunzai需要Yunzai以 npm run start 模式启动
* 尚未经充分测试,请有一定容错能力的勇士尝试
* 增加`#喵喵版本`命令查询版本信息
# 1.1.0
* 增加`#喵喵帮助`用于查看帮助命令
* 增加`#喵喵设置`用于设置喵喵相关功能

View File

@ -673,8 +673,8 @@ export async function renderProfile(e, char, render) {
usefulTitles,
usefulMark,
talentMap: { a: "普攻", e: "战技", q: "爆发" },
cfgScale: Cfg.scale(1.5)
}, "png");
cfgScale: Cfg.scale(1.8)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}

View File

@ -75,12 +75,15 @@ let Calc = {
lodash.forEach("a,a2,a3,e,q".split(","), (key) => {
ret[key] = {
pct: 0, // 倍率加成
def: 0, // 防御降低
ignore: 0, // 无视防御
multi: 0, // 独立倍率乘区加成
plus: 0, // 伤害值提高
dmg: 0, // 伤害提高
cpct: 0,// 暴击提高
cdmg: 0 //爆伤提高
cdmg: 0, //爆伤提高
def: 0, // 防御降低
ignore: 0, // 无视防御
}
})
@ -94,6 +97,8 @@ let Calc = {
ret.element = eleMap[avatar.element];
ret.refine = (avatar.weapon.affix_level * 1 - 1) || 0;
ret.multi = 0;
ret.zf = 0;
ret.rh = 0;
@ -121,7 +126,8 @@ let Calc = {
lodash.forEach(val.split("/"), (v, idx) => {
let valNum = 0;
lodash.forEach(v.split("+"), (v) => {
valNum += v.replace("%", "").trim() * 1;
v = v.split("*")
valNum += v[0].replace("%", "").trim() * (v[1] || 1);
})
valArr.push(valNum);
});
@ -191,7 +197,7 @@ let Calc = {
title = title.replace(`[${key}]`, Format.comma(val, 1));
// 技能提高
let tRet = /^(a|a2|a3|e|q)(Def|Ignore|Dmg|Plus|Pct|Cpct|Cdmg)$/.exec(key);
let tRet = /^(a|a2|a3|e|q)(Def|Ignore|Dmg|Plus|Pct|Cpct|Cdmg|Multi)$/.exec(key);
if (tRet) {
attr[tRet[1]][tRet[2].toLowerCase()] += val * 1 || 0;
return;
@ -328,6 +334,10 @@ let Calc = {
// 攻击区
let atkNum = (atk.base + atk.plus + atk.base * atk.pct / 100);
// 倍率独立乘区
let multiNum = attr.multi / 100;
// 增伤区
let dmgNum = (1 + dmg.base / 100 + dmg.plus / 100);
@ -352,6 +362,7 @@ let Calc = {
cdmgNum += ds.cdmg / 100;
enemyDef += ds.def / 100;
enemyIgnore += ds.ignore / 100;
multiNum += ds.multi / 100;
}
// 防御区
@ -378,12 +389,12 @@ let Calc = {
// 计算最终伤害
let ret = {
dmg: atkNum * pctNum * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum,
avg: atkNum * pctNum * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
}
if (global.debugView === "web-debug") {
// console.log(attr, { atkNum, pctNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum }, ret)
dmg: atkNum * pctNum * (1 + multiNum) * dmgNum * (1 + cdmgNum) * defNum * kNum * eleNum,
avg: atkNum * pctNum * (1 + multiNum) * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
}
console.log(attr, { atkNum, pctNum, multiNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }, ret)
return ret;
};

View File

@ -8,13 +8,10 @@ let logs = {};
let changelogs = [];
let currentVersion;
let isNew = 1;
let lastVersion = await redis.get("miao:last-version");
try {
if (fs.existsSync(_logPath)) {
logs = fs.readFileSync(_logPath, "utf8") || "";
logs = logs.split("\n");
lodash.forEach(logs, (line) => {
if (isNew === -1) {
return false;
@ -25,18 +22,13 @@ try {
if (!currentVersion) {
currentVersion = v;
}
if (v === lastVersion) {
isNew = 0;
} else if (isNew === 0) {
isNew = -1;
}
isNew--;
return;
}
if (isNew > -1) {
changelogs.push(line);
}
});
redis.set("miao:last-version", currentVersion, { EX: 3600 * 24 * 300 });
}
} catch (e) {
// do nth

View File

@ -0,0 +1,34 @@
export const details = [{
title: "开E后首段普攻",
params: { num: 1},
dmg: ({ talent }, dmg) => dmg(talent.a['一段伤害'], 'a')
}, {
title: "开E满Buff普攻尾箭",
params: { num: 10 },
dmg: ({ talent }, dmg) => dmg(talent.a['五段伤害'], 'a')
}, {
title: "开E满Buff尾箭蒸发",
params: { num: 10},
dmg: ({ talent }, dmg) => dmg(talent.a['五段伤害'], 'a', 'zf')
}];
export const buffs = [{
title: "宵宫E开启后额外提升普通[aMulti]%伤害",
data: {
aMulti: ({ talent }) => talent.e["炽焰箭伤害"] - 100
}
}, {
title: "宵宫被动袖火百景图10层提高20%火伤加成",
data: {
dmg: ({ params }) => params.num ? params.num * 2 : 20
}
}, {
title: "命座2宵宫造成暴击后获得25%火伤加成",
cons: 2,
data: {
dmg: ({ params }) => params.num > 1 ? 25 : 0
}
}, {
title: "元素精通:蒸发融化伤害提高[zf]%",
mastery: "zf,rh"
}];

View File

@ -0,0 +1,12 @@
export const details = [{
title: "开E后重击",
dmg: ({ talent }, dmg) => dmg(talent.e['重击伤害'], 'a2')
},{
title: "断流·斩 伤害",
dmg: ({ talent }, dmg) => dmg(talent.e['断流·斩 伤害'], 'e')
},{
title: "开E后Q伤害",
dmg: ({ talent }, dmg) => dmg(talent.q['技能伤害·近战'], 'q')
}];
export const buffs = [];

View File

@ -84,7 +84,7 @@ let polearm = {
"护摩之杖": {
title: "角色生命低于50%时额外获得[atkPlus]攻击力",
data: {
atkPlus: ({ attr, refine,calc }) => {
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
}
@ -342,11 +342,6 @@ let bow = {
}
}],
"飞雷之弦振": [{
title: "攻击力提高[atkPct]%",
refine: {
atkPckt: [20, 25, 30, 35, 40]
}
}, {
title: "满Buff下提高普攻伤害[aDmg]%",
refine: {
aDmg: [40, 50, 60, 70, 80]