mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
parent
3b01e8f4a3
commit
20bdcf2573
@ -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 })
|
||||
}
|
||||
}
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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) {
|
||||
|
@ -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]
|
||||
|
@ -239,8 +239,9 @@ export default {
|
||||
}
|
||||
},
|
||||
4: [attr('cpct', 4), {
|
||||
title: '对陷入不少于3个负面效果的地方目标造成的暴击伤害提高[cdmg]%',
|
||||
title: '对陷入不少于3个负面效果的敌方目标造成的暴击率额外提高[cpct]%,暴击伤害提高[cdmg]%',
|
||||
data: {
|
||||
cpct: 4,
|
||||
cdmg: 24
|
||||
}
|
||||
}]
|
||||
|
@ -42,7 +42,7 @@ export const buffs = [{
|
||||
enemydmg: ({ talent }) => talent.t['伤害提高'] * 100 * 4
|
||||
}
|
||||
}, {
|
||||
title: '行迹-逾锋:对陷入灼烧状态的地方目标造成的伤害提高[dmg]%',
|
||||
title: '行迹-逾锋:对陷入灼烧状态的敌方目标造成的伤害提高[dmg]%',
|
||||
tree: 3,
|
||||
data: {
|
||||
dmg: 20
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export default function (staticIdx, keyIdx) {
|
||||
],
|
||||
延长记号: [
|
||||
staticIdx(1, 'stance'),
|
||||
keyIdx('对触电或风化状态的地方目标伤害提高[dmg]%', 'dmg', 2)
|
||||
keyIdx('对触电或风化状态的敌方目标伤害提高[dmg]%', 'dmg', 2)
|
||||
],
|
||||
晚安与睡颜: [
|
||||
(tables) => {
|
||||
|
Loading…
Reference in New Issue
Block a user