角色wiki规避自定义角色

This commit is contained in:
Kokomi 2023-03-28 04:02:49 +08:00
parent edae19cfb5
commit 1d27a4be4d
5 changed files with 19 additions and 21 deletions

View File

@ -1,6 +1,6 @@
import { Character, ProfileRank, ProfileDmg, Player } from '../../models/index.js'
import ProfileDetail from './ProfileDetail.js'
import { Data, Common, Format } from '../../components/index.js'
import { Data, Common, Format } from '#miao'
import lodash from 'lodash'
export async function groupRank (e) {
@ -19,9 +19,9 @@ export async function groupRank (e) {
return false
}
let mode = /(分|圣遗物|评分|ACE)/.test(msg) ? 'mark' : 'dmg'
mode = /(词条)/.test(msg) ? 'valid':mode
mode = /(双爆)/.test(msg) ? 'crit':mode
let name = msg.replace(/(#|最强|最高分|第一|词条|双爆|极限|最高|最多词条|最多双爆|最高词条|最高双爆|最牛|圣遗物|评分|群内|群|排名|排行|面板|面版|详情|榜)/g, '')
mode = /(词条)/.test(msg) ? 'valid' : mode
mode = /(双爆)/.test(msg) ? 'crit' : mode
let name = msg.replace(/(#|最强|最高分|第一|词条|双爆|极限|最高|最多|最牛|圣遗物|评分|群内|群|排名|排行|面板|面版|详情|榜)/g, '')
let char = Character.get(name)
if (!char) {
// 名字不存在或不为列表模式则返回false
@ -209,14 +209,12 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) {
}
}
}
if (mode === 'crit'){
tmp._mark = mark?._crit*6.6044 || 0
}
else if (mode === 'valid'){
if (mode === 'crit') {
tmp._mark = mark?._crit * 6.6044 || 0
} else if (mode === 'valid') {
tmp._mark = mark?._valid || 0
}
else{
} else {
tmp._mark = mark?._mark || 0
}
tmp._formatmark = Format.comma(tmp._mark, 1)
@ -227,14 +225,14 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) {
}
let title
if (char) {
if (mode === 'mark'){
title = `#${char.name}${'圣遗物评分'}排行`
if (mode === 'mark') {
title = `#${char.name}${'圣遗物评分'}排行`
}
if (mode === 'crit'){
title = `#${char.name}${'双爆副词条'}排行`
if (mode === 'crit') {
title = `#${char.name}${'双爆副词条'}排行`
}
if (mode === 'valid'){
title = `#${char.name}${'加权有效词条'}排行`
if (mode === 'valid') {
title = `#${char.name}${'加权有效词条'}排行`
}
list = lodash.sortBy(list, mode === 'dmg' ? '_dmg' : '_mark').reverse()
} else {

View File

@ -1,4 +1,4 @@
import { App } from '../components/index.js'
import { App } from '#miao'
import Calendar from './wiki/Calendar.js'
import CharWiki from './wiki/CharWiki.js'

View File

@ -37,7 +37,7 @@ const CharWiki = {
return false
}
let char = Character.get(ret[1])
if (!char) {
if (!char || (char.isCustom && mode !== 'pic')) {
return false
}
e.wikiMode = mode

View File

@ -1,6 +1,6 @@
import lodash from 'lodash'
import moment from 'moment'
import { Cfg, Common, Data } from '../components/index.js'
import { Cfg, Common, Data } from '#miao'
export default class ProfileRank {
constructor (data) {

View File

@ -1,5 +1,5 @@
import lodash from 'lodash'
import { Format } from '../../components/index.js'
import { Format } from '#miao'
import { attrNameMap, mainAttr, subAttr, attrMap ,basicNum,attrPct} from '../../resources/meta/artifact/index.js'
let ArtisMark = {