diff --git a/apps/character/AvatarCard.js b/apps/character/AvatarCard.js
index bdce5b7a..2edf03e3 100644
--- a/apps/character/AvatarCard.js
+++ b/apps/character/AvatarCard.js
@@ -125,7 +125,7 @@ let Avatar = {
}
})
}
- let char = Character.get(name.trim())
+ let char = Character.get(name.trim(), e.game)
if (!char) {
return false
}
diff --git a/apps/profile/ProfileDetail.js b/apps/profile/ProfileDetail.js
index 892438f5..b8e2ac78 100644
--- a/apps/profile/ProfileDetail.js
+++ b/apps/profile/ProfileDetail.js
@@ -77,11 +77,12 @@ let ProfileDetail = {
if (!Common.cfg('avatarProfile')) {
return false // 面板开关关闭
}
- let char = Character.get(name.trim())
+ let char = Character.get(name.trim(), e.game)
if (!char) {
return false
}
if (/星铁/.test(msg) || char.isSr) {
+ e.game = 'sr'
e.isSr = true
}
diff --git a/models/Weapon.js b/models/Weapon.js
index 80c3e1fb..2347254e 100644
--- a/models/Weapon.js
+++ b/models/Weapon.js
@@ -32,6 +32,12 @@ class Weapon extends Base {
return `${this.isGs ? 'meta' : 'meta-sr'}/weapon/${this.type}/${this.name}/icon.webp`
}
+ get abbr () {
+ let name = this.name
+ let abbr = this.meta?.abbr
+ return name.length <= 4 ? name : (abbr || name)
+ }
+
get imgs () {
if (this.isGs) {
return {
@@ -117,6 +123,12 @@ class Weapon extends Base {
return this._detail
}
+ /**
+ * 计算武器主属性
+ * @param level 武器等级
+ * @param promote 武器突破
+ * @returns {{atkBase: number, attr: {value: *, key: *}}|{}|boolean}
+ */
calcAttr (level, promote = -1) {
let metaAttr = this.detail?.attr
if (!metaAttr) {
@@ -168,13 +180,30 @@ class Weapon extends Base {
}
}
- // 获取精炼描述
+ /**
+ * 获取武器精炼描述
+ * @param affix 精炼
+ * @returns {{name, desc: *}|{}}
+ */
getAffixDesc (affix = 1) {
if (this.isGs) {
- return {}
+ let { text, datas } = this.detail?.affixData || {}
+ let { descFix } = Meta.getMeta('gs', 'weapon')
+ let reg = /\$\[(\d)\]/g
+ let ret
+ let desc = descFix[this.name] || text || ''
+ while ((ret = reg.exec(desc)) !== null) {
+ let idx = ret[1]
+ let value = datas?.[idx]?.[affix - 1]
+ desc = desc.replaceAll(ret[0], `