From c95efa90fe9001b8d0fc44509e9391c1d44857c3 Mon Sep 17 00:00:00 2001 From: Aluxes <39981645+AshenAshes@users.noreply.github.com> Date: Sat, 13 Apr 2024 18:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E9=93=81=E9=9D=A2=E6=9D=BF=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=94=AF=E6=8C=81=E7=82=B9=E6=BB=A1=E8=A1=8C=E8=BF=B9?= =?UTF-8?q?=EF=BC=8C=E5=A6=82*=E9=BB=84=E6=B3=89=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=8D=A2=E6=BB=A1=E8=A1=8C=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/profile.js | 2 +- apps/profile/ProfileChange.js | 9 ++++++++- apps/profile/ProfileStat.js | 2 +- models/ProfileDmg.js | 8 +++++--- resources/meta-sr/artifact/calc.js | 2 +- resources/meta-sr/character/data.json | 1 + resources/meta-sr/character/砂金/calc.js | 1 + resources/meta-sr/character/黄泉/calc.js | 5 ++++- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/apps/profile.js b/apps/profile.js index 34f290a4..2afbb36b 100644 --- a/apps/profile.js +++ b/apps/profile.js @@ -94,7 +94,7 @@ app.reg({ refreshTalent: { name: '强制刷新天赋', fn: ProfileStat.refreshTalent, - rule: /^#(星铁|原神)?(强制)?(刷新|更新)(所有|角色)*(天赋|技能)$/ + rule: /^#(星铁|原神)?(强制)?(刷新|更新)(所有|角色)*(天赋|技能|行迹)$/ }, profileHelp: { diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index 6b6193f0..cf020e0f 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -155,6 +155,13 @@ const ProfileChange = { txt = txt.replace(consRet[0], '') } + // 行迹树匹配 + let treeRet = /满行迹/.exec(txt) + if (!isGs && treeRet) { + char.trees = ['101', '102', '103', '201', '202', '203', '204', '205', '206', '207', '208', '209', '210'] + txt = txt.replace(treeRet[0], '') + } + // 天赋匹配 let talentRet = (isGs ? /(?:天赋|技能|行迹)((?:[1][0-5]|[1-9])[ ,]?)((?:[1][0-5]|[1-9])[ ,]?)([1][0-5]|[1-9])/ @@ -246,7 +253,7 @@ const ProfileChange = { dataSource: 'change', _source: 'change', promote, - trees: lodash.extend([], source.trees) + trees: lodash.extend([], Data.def(dc.trees, source.trees)) }, char.game) // 设置武器 diff --git a/apps/profile/ProfileStat.js b/apps/profile/ProfileStat.js index cd839572..b82920e0 100644 --- a/apps/profile/ProfileStat.js +++ b/apps/profile/ProfileStat.js @@ -24,7 +24,7 @@ const ProfileStat = { if (refreshCount && !e.isSr) { e.reply(`角色天赋更新成功,共${refreshCount}个角色\n你现在可以通过【#练度统计】【#天赋统计】来查看角色信息了...`) } else if (e.isSr) { - e.reply(`角色天赋更新成功,共${refreshCount}个角色\n你现在可以通过【*练度统计】来查看角色信息了...`) + e.reply(`角色行迹更新成功,共${refreshCount}个角色\n你现在可以通过【*练度统计】来查看角色信息了...`) } else { e.reply('角色天赋未能更新...') } diff --git a/models/ProfileDmg.js b/models/ProfileDmg.js index 4fa85e51..eb92ecd0 100644 --- a/models/ProfileDmg.js +++ b/models/ProfileDmg.js @@ -8,7 +8,7 @@ import DmgCalc from './dmg/DmgCalc.js' import { MiaoError, Meta, Common } from '#miao' export default class ProfileDmg extends Base { - constructor (profile = {}, game = 'gs') { + constructor(profile = {}, game = 'gs') { super() this.profile = profile this.game = game @@ -136,7 +136,9 @@ export default class ProfileDmg extends Base { let { id, weapon, attr, artis } = profile - defParams = defParams || {} + defDmgKey = lodash.isFunction(defDmgKey) ? defDmgKey(meta) : defDmgKey + defDmgIdx = lodash.isFunction(defDmgIdx) ? defDmgIdx(meta) : defDmgIdx + defParams = lodash.isFunction(defParams) ? defParams(meta) : defParams || {} let originalAttr = DmgAttr.getAttr({ id, weapon, attr, char: this.char, game, sp }) @@ -176,7 +178,7 @@ export default class ProfileDmg extends Base { let ds = lodash.merge({ talent }, DmgAttr.getDs(attr, meta)) detail = detail({ ...ds, attr, profile }) } - let params = lodash.merge({}, defParams, detail?.params || {}) + let params = lodash.merge({}, defParams, lodash.isFunction(detail?.params) ? detail?.params(meta) : detail?.params || {}) let { attr, msg } = DmgAttr.calcAttr({ originalAttr, buffs, artis, meta, params, talent: detail.talent || '', game }) if (detail.isStatic) { return diff --git a/resources/meta-sr/artifact/calc.js b/resources/meta-sr/artifact/calc.js index 3cc4de6c..e612382e 100644 --- a/resources/meta-sr/artifact/calc.js +++ b/resources/meta-sr/artifact/calc.js @@ -135,7 +135,7 @@ export default { }] }, 筑城者的贝洛伯格: { - 2: [attr('defPct', 12), { + 2: [attr('defPct', 15), { title: '效果命中大于50%时,提高防御力15%', check: ({ calc, attr }) => calc(attr.effPct) > 50, data: { diff --git a/resources/meta-sr/character/data.json b/resources/meta-sr/character/data.json index 26a6fcf0..a0e72c74 100644 --- a/resources/meta-sr/character/data.json +++ b/resources/meta-sr/character/data.json @@ -751,6 +751,7 @@ "id": 1211, "key": "bailu", "name": "白露", + "star": 5, "elem": "雷", "weapon": "丰饶", "sp": 100, diff --git a/resources/meta-sr/character/砂金/calc.js b/resources/meta-sr/character/砂金/calc.js index 8f428643..897f6a32 100644 --- a/resources/meta-sr/character/砂金/calc.js +++ b/resources/meta-sr/character/砂金/calc.js @@ -21,6 +21,7 @@ export const details = [{ export const mainAttr = 'cpct,cdmg,def' export const defDmgIdx = 1 +export const defParams = ({ cons }) => cons < 4 ? { tArtisBuffCount: 4 } : { tArtisBuffCount: 5.5 } export const buffs = [{ title: '终结技-惊惶:击中【惊惶】状态下的敌方目标时,造成的暴击伤害提高[cdmg]%', diff --git a/resources/meta-sr/character/黄泉/calc.js b/resources/meta-sr/character/黄泉/calc.js index aed2144e..b877c7b8 100644 --- a/resources/meta-sr/character/黄泉/calc.js +++ b/resources/meta-sr/character/黄泉/calc.js @@ -16,7 +16,10 @@ export const details = [{ }, { title: '终结技伤害·对单', params: { q: true }, - dmg: ({ talent }, dmg) => dmg(talent.q['单体伤害'] + 1.5, 'q') + dmg: ({ talent, trees }, dmg) => { + let extraTd = trees['103'] ? 1.5 : 0 + return dmg(talent.q['单体伤害'] + extraTd, 'q') + } }, { title: '终结技伤害·对无花目标', params: { q: true },