diff --git a/CHANGELOG.md b/CHANGELOG.md index b7707cf1..afe82a5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,15 @@ -# 1.5.3 +# 1.5.4 * `#喵喵日历` 增加 `#喵喵日历列表`命令,以列表形式展示活动信息 +* `#深渊出场率`、`#角色持有率` 等功能样式及字体微调 +* 增加鹿野院平藏的角色信息,可通过`#平藏天赋`、`#平藏命座`查看信息 +* `#角色面板` 伤害计算增加双手剑计算逻辑,增加物伤计算逻辑 * `#角色面板` 伤害计算增加部分角色,目前支持 * 长柄武器:雷神、胡桃、魈、钟离、香菱 * 法器:神子、心海、可莉ⁿᵉʷ、凝光ⁿᵉʷ * 弓:甘雨、宵宫、公子 * 单手剑:绫人、绫华、刻晴、阿贝多、行秋、班尼特、七七ⁿᵉʷ -* `#深渊出场率`、`#角色持有率` 等功能样式及字体微调 -* 添加鹿野苑平藏的meta信息 + * 双手剑:一斗ⁿᵉʷ、优菈ⁿᵉʷ # 1.5.0 diff --git a/apps/character.js b/apps/character.js index c2b1e8a9..66b59d0d 100644 --- a/apps/character.js +++ b/apps/character.js @@ -715,6 +715,7 @@ export async function renderProfile(e, char, render, mode = "profile", params = dmgCfg: dmgCalc.dmgCfg, reliquaries, enemyLv, + enemyName: dmgCalc.enemyName || "小宝", totalMark: c(totalMark, 1), totalMaxMark, markScore: Reliquaries.getMarkScore(totalMark, totalMaxMark), diff --git a/components/Calc.js b/components/Calc.js index 29fd6151..0b82a7b9 100644 --- a/components/Calc.js +++ b/components/Calc.js @@ -30,7 +30,7 @@ let Calc = { const cfgPath = `${_path}/plugins/miao-plugin/resources/meta/character/${name}/calc.js`; - let details, buffs = [], defParams = {}, defDmgIdx = -1, mainAttr = "atk,cpct,cdmg"; + let details, buffs = [], defParams = {}, defDmgIdx = -1, mainAttr = "atk,cpct,cdmg", enemyName = "小宝"; if (fs.existsSync(cfgPath)) { let fileData = await import (`file://${cfgPath}`); details = fileData.details || false; @@ -42,10 +42,13 @@ let Calc = { if (fileData.mainAttr) { mainAttr = fileData.mainAttr; } + if (fileData.enemyName) { + enemyName = fileData.enemyName; + } } if (details) { - return { details, buffs, defParams, defDmgIdx, mainAttr } + return { details, buffs, defParams, defDmgIdx, mainAttr, enemyName } } return false; }, @@ -118,6 +121,7 @@ let Calc = { } ret.weaponType = avatar.weapon.type_name; + ret.weapon = avatar.weapon; ret.element = eleMap[avatar.element]; ret.refine = (avatar.weapon.affix_level * 1 - 1) || 0; @@ -178,6 +182,7 @@ let Calc = { params, refine: attr.refine, weaponType: attr.weaponType, + weapon: attr.weapon, element: eleMap[attr.element] || attr.element, calc(ds) { return (ds.base || 0) + (ds.plus || 0) + ((ds.base || 0) * (ds.pct || 0) / 100) @@ -327,7 +332,7 @@ let Calc = { let { calc } = ds; let dmgFn = function (pctNum = 0, talent = false, ele = false, basicNum = 0, mode = "talent") { - let { atk, dmg, cdmg, cpct } = attr; + let { atk, dmg, phy, cdmg, cpct } = attr; // 攻击区 let atkNum = calc(atk); @@ -338,6 +343,10 @@ let Calc = { // 增伤区 let dmgNum = (1 + dmg.base / 100 + dmg.plus / 100); + if (ele === "phy") { + dmgNum = (1 + phy.base / 100 + phy.plus / 100); + } + //console.log({ base: Format.comma(dmg.base, 2), plus: Format.comma(dmg.plus, 2) }) let cpctNum = cpct.base / 100 + cpct.plus / 100; @@ -381,7 +390,9 @@ let Calc = { // 反应区 let eleNum = 1; - if (ele) { + if (ele === "phy") { + //do nothing + } else if (ele) { // todo 更详细 let eleMap = { '水': { zf: 2 }, @@ -426,7 +437,7 @@ let Calc = { } dmgFn.heal = function (num) { - if(showDetail){ + if (showDetail) { console.log(num, calc(attr.heal), attr.heal.inc) } return { @@ -459,7 +470,7 @@ let Calc = { talent } - let { buffs, details, defParams, mainAttr, defDmgIdx } = charCalcData; + let { buffs, details, defParams, mainAttr, defDmgIdx, enemyName } = charCalcData; defParams = defParams || {}; @@ -481,6 +492,11 @@ let Calc = { lodash.forEach(details, (detail, detailSysIdx) => { + if (lodash.isFunction(detail)) { + let { attr } = Calc.calcAttr({ originalAttr, buffs, meta }); + let ds = lodash.merge({ talent }, Calc.getDs(attr, meta)); + detail = detail({ ...ds, attr, avatar }); + } let params = lodash.merge({}, defParams, detail.params || {}); let { attr } = Calc.calcAttr({ originalAttr, buffs, meta, params, talent: detail.talent || "" }); if (detail.check && !detail.check(Calc.getDs(attr, meta, params))) { @@ -561,6 +577,7 @@ let Calc = { ret, msg, dmgRet, + enemyName, dmgCfg: dmgDetail } } diff --git a/resources/character/detail.html b/resources/character/detail.html index be50b4b8..0088e862 100644 --- a/resources/character/detail.html +++ b/resources/character/detail.html @@ -51,7 +51,7 @@ {{if dmgData.length > 0}}