From 20bdcf25734e05ffc3501f5ea618e79d0e5a1b17 Mon Sep 17 00:00:00 2001 From: Aluxes <39981645+AshenAshes@users.noreply.github.com> Date: Tue, 2 Apr 2024 01:39:32 +0800 Subject: [PATCH] fix: #685 #729 #I9CY30 #I9CSTM #I97YLH --- apps/profile/ProfileArtis.js | 8 ++++---- apps/profile/ProfileChange.js | 20 +++++++++---------- apps/profile/ProfileDetail.js | 6 +++--- apps/profile/ProfileRank.js | 2 +- apps/wiki/CalendarSr.js | 11 +++++----- resources/meta-sr/artifact/calc.js | 3 ++- resources/meta-sr/character/桂乃芬/calc.js | 2 +- resources/meta-sr/character/砂金/calc.js | 2 +- resources/meta-sr/weapon/虚无/calc.js | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/apps/profile/ProfileArtis.js b/apps/profile/ProfileArtis.js index 2c8ae191..ab82ff70 100644 --- a/apps/profile/ProfileArtis.js +++ b/apps/profile/ProfileArtis.js @@ -25,10 +25,10 @@ export async function profileArtis (e) { let { game } = char let charCfg = ArtisMarkCfg.getCfg(profile) - let { attrMap } = Meta.getMeta('gs', 'arti') + let { attrMap } = Meta.getMeta(game, 'arti') let artisDetail = profile.getArtisMark() - let artisKeyTitle = Artifact.getArtisKeyTitle() + let artisKeyTitle = Artifact.getArtisKeyTitle(game) // 渲染图像 return e.reply([await Common.render('character/artis-mark', { @@ -43,7 +43,7 @@ export async function profileArtis (e) { charCfg, game, changeProfile: e._profileMsg - }, { e, scale: 1.6 / 1.1, retType: "base64" }), new Button(e).profile(char, uid)]) + }, { e, scale: 1.6 / 1.1, retType: 'base64' }), new Button(e).profile(char, uid)]) } /* @@ -94,4 +94,4 @@ export async function profileArtisList (e) { artis, artisKeyTitle }, { e, scale: 1.4 }) -} \ No newline at end of file +} diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index e2ef63b5..6b6193f0 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -24,18 +24,19 @@ const ProfileChange = { if (!/(变|改|换)/.test(msg)) { return false } - msg = msg.toLowerCase().replace(/uid ?:? ?/, '').replace('', '') + let game = /星铁/.test(msg) ? 'sr' : 'gs' + msg = msg.toLowerCase().replace(/uid ?:? ?/, '').replace('星铁', '') let regRet = /^#*(\d{9,10})?(.+?)(详细|详情|面板|面版|圣遗物|伤害[1-7]?)?\s*(\d{9,10})?[变换改](.+)/.exec(msg) if (!regRet || !regRet[2]) { return false } let ret = {} let change = {} - let char = Character.get(lodash.trim(regRet[2]).replace('星铁', '')) + let char = Character.get(lodash.trim(regRet[2]).replace(/\d{9,10}/g, ''), game) + game = char.isSr ? 'sr' : 'gs' if (!char) { return false } - const game = char.game const isGs = game === 'gs' const keyMap = isGs ? { @@ -68,7 +69,7 @@ const ProfileChange = { ret.char = char.id ret.mode = regRet[3] === '换' ? '面板' : regRet[3] ret.uid = regRet[1] || regRet[4] || '' - ret.game = char.game + ret.game = game msg = regRet[5] // 更换匹配 @@ -81,11 +82,8 @@ const ProfileChange = { // 匹配圣遗物 let keyRet = keyReg.exec(txt) if (keyRet && keyRet[4]) { - let char = Character.get(lodash.trim(keyRet[2])) + let char = Character.get(lodash.trim(keyRet[2]), game) if (char) { - if (char.game !== game) { - return true - } lodash.forEach(keyRet[4].split('+'), (key) => { key = lodash.trim(key) let type = keyTitleMap[key] @@ -176,8 +174,8 @@ const ProfileChange = { } txt = lodash.trim(txt) if (txt) { - let chars = Character.get(txt) - if (chars && (chars.game === game)) { + let chars = Character.get(txt, game) + if (chars) { char.char = chars.id } } @@ -285,7 +283,7 @@ const ProfileChange = { if (ds['arti' + idx]) { let source = getSource(ds['arti' + idx]) if (source && source.artis && source.artis[idx]) { - artis[idx] = source.artis[idx] + artis[idx] = lodash.cloneDeep(source.artis[idx]) } } let artisIdx = (isGs ? '00111' : '001122')[idx - 1] diff --git a/apps/profile/ProfileDetail.js b/apps/profile/ProfileDetail.js index 4783c65c..37f73295 100644 --- a/apps/profile/ProfileDetail.js +++ b/apps/profile/ProfileDetail.js @@ -2,8 +2,8 @@ import lodash from 'lodash' import { getTargetUid, getProfileRefresh } from './ProfileCommon.js' import ProfileList from './ProfileList.js' import { Cfg, Common, Data, Format } from '#miao' -import { Button } from '#miao.models' -import { MysApi, ProfileRank, Character, Weapon, Artifact } from '#miao.models' +import { Button, MysApi, ProfileRank, Character, Weapon, Artifact } from '#miao.models' + import ProfileChange from './ProfileChange.js' import { profileArtis } from './ProfileArtis.js' import { ProfileWeapon } from './ProfileWeapon.js' @@ -253,7 +253,7 @@ let ProfileDetail = { changeProfile: e._profileMsg } // 渲染图像 - const msgRes = await e.reply([await Common.render('character/profile-detail', renderData, { e, scale: 1.6, retType: "base64" }), new Button(e).profile(char, uid)]) + const msgRes = await e.reply([await Common.render('character/profile-detail', renderData, { e, scale: 1.6, retType: 'base64' }), new Button(e).profile(char, uid)]) if (msgRes) { // 如果消息发送成功,就将message_id和图片路径存起来,3小时过期 const message_id = [e.message_id] diff --git a/apps/profile/ProfileRank.js b/apps/profile/ProfileRank.js index 4de09d1c..79c55402 100644 --- a/apps/profile/ProfileRank.js +++ b/apps/profile/ProfileRank.js @@ -103,7 +103,7 @@ export async function resetRank(e) { } let game = e.isSr ? 'sr' : 'gs' let msg = e.original_msg || e.msg - let name = msg.replace(/(#|重置|重设|排名|排行|群|群内|面板|详情|面版)/g, '').trim() + let name = msg.replace(/(#|星铁|重置|重设|排名|排行|群|群内|面板|详情|面版)/g, '').trim() let charId = '' let charName = '全部角色' if (name) { diff --git a/apps/wiki/CalendarSr.js b/apps/wiki/CalendarSr.js index 0500bbfc..d7de7351 100644 --- a/apps/wiki/CalendarSr.js +++ b/apps/wiki/CalendarSr.js @@ -117,8 +117,9 @@ let CalSr = { let abyss1Start = moment(versionStartTime, 'YYYY-MM-DD HH:mm:ss').day(1).hours(4).format(f) - if (newAbyssStart.diff(abyss1Start, 'days') % 14 !== 0) { - abyss1Start = moment(abyss1Start).subtract(7, 'days').format(f) + let diff0 = Math.abs(newAbyssStart.diff(abyss1Start, 'days') % 14) + if (diff0 !== 0) { + abyss1Start = moment(abyss1Start).subtract(diff0, 'days').format(f) } let abyss1End = moment(abyss1Start).add(42, 'days').format(f) @@ -138,10 +139,10 @@ let CalSr = { let title1 = '「混沌回忆」' let title2 = '「虚构叙事」' - let exchange = true + let exchange = false let diff = newAbyssStart.diff(abyss0Start, 'days') - if (diff >= 0 && diff % 14 === 0) { - exchange = false + if (diff >= 0 && diff % 28 === 0) { + exchange = true } if (exchange) { [title1, title2] = [title2, title1] diff --git a/resources/meta-sr/artifact/calc.js b/resources/meta-sr/artifact/calc.js index 9a27ec19..3cc4de6c 100644 --- a/resources/meta-sr/artifact/calc.js +++ b/resources/meta-sr/artifact/calc.js @@ -239,8 +239,9 @@ export default { } }, 4: [attr('cpct', 4), { - title: '对陷入不少于3个负面效果的地方目标造成的暴击伤害提高[cdmg]%', + title: '对陷入不少于3个负面效果的敌方目标造成的暴击率额外提高[cpct]%,暴击伤害提高[cdmg]%', data: { + cpct: 4, cdmg: 24 } }] diff --git a/resources/meta-sr/character/桂乃芬/calc.js b/resources/meta-sr/character/桂乃芬/calc.js index 298f5001..a43d48bf 100644 --- a/resources/meta-sr/character/桂乃芬/calc.js +++ b/resources/meta-sr/character/桂乃芬/calc.js @@ -42,7 +42,7 @@ export const buffs = [{ enemydmg: ({ talent }) => talent.t['伤害提高'] * 100 * 4 } }, { - title: '行迹-逾锋:对陷入灼烧状态的地方目标造成的伤害提高[dmg]%', + title: '行迹-逾锋:对陷入灼烧状态的敌方目标造成的伤害提高[dmg]%', tree: 3, data: { dmg: 20 diff --git a/resources/meta-sr/character/砂金/calc.js b/resources/meta-sr/character/砂金/calc.js index b15db18a..8f428643 100644 --- a/resources/meta-sr/character/砂金/calc.js +++ b/resources/meta-sr/character/砂金/calc.js @@ -23,7 +23,7 @@ export const mainAttr = 'cpct,cdmg,def' export const defDmgIdx = 1 export const buffs = [{ - title: '终结技-惊惶:击中【惊惶】状态下的地方目标时,造成的暴击伤害提高[cdmg]%', + title: '终结技-惊惶:击中【惊惶】状态下的敌方目标时,造成的暴击伤害提高[cdmg]%', data: { cdmg: ({ talent }) => talent.q['暴击伤害提高'] * 100 } diff --git a/resources/meta-sr/weapon/虚无/calc.js b/resources/meta-sr/weapon/虚无/calc.js index 15bbcad4..03843ef3 100644 --- a/resources/meta-sr/weapon/虚无/calc.js +++ b/resources/meta-sr/weapon/虚无/calc.js @@ -13,7 +13,7 @@ export default function (staticIdx, keyIdx) { ], 延长记号: [ staticIdx(1, 'stance'), - keyIdx('对触电或风化状态的地方目标伤害提高[dmg]%', 'dmg', 2) + keyIdx('对触电或风化状态的敌方目标伤害提高[dmg]%', 'dmg', 2) ], 晚安与睡颜: [ (tables) => {