From 6badfb97a78906feddfba320dea3dcd10ad354d2 Mon Sep 17 00:00:00 2001 From: Kokomi <1379177109@qq.com> Date: Sun, 29 Oct 2023 15:51:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97=E5=B1=95?= =?UTF-8?q?=E7=A4=BAcreatedBy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/ProfileDmg.js | 27 ++++++++++++++++++------ resources/character/profile-detail.css | 10 +++++++-- resources/character/profile-detail.html | 13 ++++++++---- resources/character/profile-detail.less | 20 ++++++++++++++++-- resources/meta-gs/artifact/artis-mark.js | 3 ++- resources/meta-gs/weapon/desc.js | 1 + 6 files changed, 58 insertions(+), 16 deletions(-) diff --git a/models/ProfileDmg.js b/models/ProfileDmg.js index fa755410..6f160b9e 100644 --- a/models/ProfileDmg.js +++ b/models/ProfileDmg.js @@ -5,7 +5,7 @@ import { Character } from './index.js' import DmgBuffs from './dmg/DmgBuffs.js' import DmgAttr from './dmg/DmgAttr.js' import DmgCalc from './dmg/DmgCalc.js' -import { MiaoError, Meta } from '#miao' +import { MiaoError, Meta, Common } from '#miao' export default class ProfileDmg extends Base { constructor (profile = {}, game = 'gs') { @@ -20,10 +20,18 @@ export default class ProfileDmg extends Base { static dmgRulePath (name, game = 'gs') { const _path = process.cwd() - for (let file of ['calc_user', 'calc_auto', 'calc']) { - let path = `${_path}/plugins/miao-plugin/resources/meta-${game}/character/${name}/${file}.js` + let dmgFile = [ + { file: 'calc_user', name: '自定义伤害' }, + { file: 'calc_auto', name: '组团伤害', test: () => Common.cfg('teamCalc') }, + { file: 'calc', name: '喵喵' } + ] + for (let ds of dmgFile) { + let path = `${_path}/plugins/miao-plugin/resources/meta-${game}/character/${name}/${ds.file}.js` + if (ds.test && !ds.test()) { + continue + } if (fs.existsSync(path)) { - return path + return { path, createdBy: ds.name } } } return false @@ -79,8 +87,12 @@ export default class ProfileDmg extends Base { const cfgPath = ProfileDmg.dmgRulePath(this.char?.name, this.char?.game) let cfg = {} if (cfgPath) { - cfg = await import(`file://${cfgPath}`) + cfg = await import(`file://${cfgPath.path}`) + // 文件中定义了createBy的话,优先进行展示 + let createdBy = cfg.createdBy || cfgPath.createdBy || '喵喵' + createdBy = createdBy.slice(0, 15) return { + createdBy, details: cfg.details || false, // 计算详情 buffs: cfg.buffs || [], // 角色buff defParams: cfg.defParams || {}, // 默认参数,一般为空 @@ -105,7 +117,7 @@ export default class ProfileDmg extends Base { if (!charCalcData) { return false } - let { buffs, details, defParams, mainAttr, defDmgIdx, defDmgKey, enemyName } = charCalcData + let { createdBy, buffs, details, defParams, mainAttr, defDmgIdx, defDmgKey, enemyName } = charCalcData let talent = this.talent() @@ -260,7 +272,8 @@ export default class ProfileDmg extends Base { dmgRet, enemyName, dmgCfg: dmgDetail, - enemyLv + enemyLv, + createdBy } } } diff --git a/resources/character/profile-detail.css b/resources/character/profile-detail.css index 911a051f..f73271fb 100644 --- a/resources/character/profile-detail.css +++ b/resources/character/profile-detail.css @@ -19,7 +19,7 @@ body { } .basic { position: relative; - margin: 0 -15px 10px -10px; + margin: 0 -15px 15px -10px; } .basic:after { content: ""; @@ -324,7 +324,11 @@ body { margin: 10px 0; width: 100%; } -.dmg-mode .dmg-list .cont-footer { +.dmg-created-by { + padding-left: 5px; + float: right; +} +.dmg-mode .not-dmg-mode { display: none; } .cont-title { @@ -383,10 +387,12 @@ body { .dmg-cont .tr .th { color: #d3bc8e; padding-right: 15px; + padding-left: 5px; text-align: right; background: rgba(0, 0, 0, 0.4); min-width: 100px; font-size: 15px; + white-space: nowrap; } .profile-mode .dmg-idx { display: none !important; diff --git a/resources/character/profile-detail.html b/resources/character/profile-detail.html index 42920449..5e923edd 100644 --- a/resources/character/profile-detail.html +++ b/resources/character/profile-detail.html @@ -236,7 +236,7 @@ {{/if}} {{each ad.artis ds idx}} -
+
{{if ds && ds.name && ds.main && ds.main.key && ds.main.key!="undefined"}}
@@ -268,12 +268,13 @@ - {{ set {dmgRet, dmgCfg, enemyLv, enemyName, dmgMsg, dmgData} = dmgCalc }} + {{ set {dmgRet, dmgCfg, enemyLv, enemyName, dmgMsg, dmgData, createdBy} = dmgCalc }}
{{if dmgData?.length > 0}}
- 伤害计算目标为{{enemyLv}}级{{enemyName||'小宝'}}{{if game==='gs'}},如需调整等级可使用 #敌人等级{{enemyLv}} 来进行设置{{/if}} + 伤害计算 + 使用{{gameHash}}{{data.abbr}}伤害命令可以查看伤害详情
@@ -297,7 +298,11 @@ {{/each}}
{{/if}} diff --git a/resources/character/profile-detail.less b/resources/character/profile-detail.less index 5fdb2329..0553757f 100644 --- a/resources/character/profile-detail.less +++ b/resources/character/profile-detail.less @@ -18,7 +18,7 @@ body { .basic { position: relative; - margin: 0 -15px 10px -10px; + margin: 0 -15px 15px -10px; } .basic:after { @@ -388,7 +388,12 @@ body { width: 100%; } -.dmg-mode .dmg-list .cont-footer { +.dmg-created-by { + padding-left: 5px; + float: right; +} + +.dmg-mode .not-dmg-mode { display: none; } @@ -461,10 +466,12 @@ body { .th { color: #d3bc8e; padding-right: 15px; + padding-left: 5px; text-align: right; background: rgba(0, 0, 0, .4); min-width: 100px; font-size: 15px; + white-space: nowrap; } } @@ -533,6 +540,15 @@ body { box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, .8); overflow: hidden; + &.item { + &.arti-class-ACE, + &.arti-class-MAX { + .head { + + } + } + } + .arti-icon { width: 60px; diff --git a/resources/meta-gs/artifact/artis-mark.js b/resources/meta-gs/artifact/artis-mark.js index 3fcf8cf7..36481639 100644 --- a/resources/meta-gs/artifact/artis-mark.js +++ b/resources/meta-gs/artifact/artis-mark.js @@ -75,5 +75,6 @@ export const usefulAttr = { 琳妮特: { hp: 0, atk: 75, def: 0, cpct: 100, cdmg: 100, mastery: 0, dmg: 100, phy: 0, recharge: 55, heal: 0 }, 菲米尼: { hp: 0, atk: 75, def: 0, cpct: 100, cdmg: 100, mastery: 0, dmg: 100, phy: 100, recharge: 55, heal: 0 }, 那维莱特: { hp: 100, atk: 0, def: 0, cpct: 100, cdmg: 100, mastery: 75, dmg: 100, phy: 0, recharge: 75, heal: 0 }, - 莱欧斯利: { hp: 0, atk: 75, def: 0, cpct: 100, cdmg: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 } + 莱欧斯利: { hp: 0, atk: 75, def: 0, cpct: 100, cdmg: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 }, + 芙宁娜: { hp: 100, atk: 0, def: 0, cpct: 100, cdmg: 100, mastery: 75, dmg: 100, phy: 0, recharge: 75, heal: 100 }, } diff --git a/resources/meta-gs/weapon/desc.js b/resources/meta-gs/weapon/desc.js index 212e7764..877b15a0 100644 --- a/resources/meta-gs/weapon/desc.js +++ b/resources/meta-gs/weapon/desc.js @@ -39,6 +39,7 @@ export const descFix = { 贯月矢: '触发草元素反应后,每20秒产生至多存在10秒的种识之叶,后台也能触发。拾取提升攻击力32%,持续12秒。', 护摩之杖: '生命值提升$[0]。
获得$[1]生命值上限的攻击力提升,生命值低于50%时,进一步获得$[2]生命值上限的攻击力提升。', 薙草之稻光: '攻击力获得提升,提升程度相当于充能效率超出100%部分的$[0],至多提升$[1]。
施放爆发后的12秒内,充能效率提升$[2]。', + "「渔获」":'元素爆发的伤害提升$[0]
元素爆发的暴击率提升$[1]', // 弓 终末嗟叹之诗: '精通提高$[0]点;战技或爆发命中敌人时,获得追思之符,后台也能触发。4枚时消耗所有追思之符:精通提高$[1]点,攻击力提升$[2],持续12秒。',