mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 22:48:13 +00:00
新增#集录统计 #集录记录
This commit is contained in:
parent
13ba9a5afc
commit
b72dfe187e
@ -9,15 +9,15 @@ app.reg({
|
|||||||
detail: {
|
detail: {
|
||||||
name: '抽卡记录',
|
name: '抽卡记录',
|
||||||
fn: Gacha.detail,
|
fn: Gacha.detail,
|
||||||
rule: /^#*喵喵(抽卡|抽奖|角色|武器|常驻|up)+池?(记录|祈愿|分析)$/,
|
rule: /^#*喵喵(抽卡|抽奖|角色|武器|常驻|集录|up)+池?(记录|祈愿|分析)$/,
|
||||||
yzRule: /^#*(抽卡|抽奖|角色|武器|常驻|up)+池?(记录|祈愿|分析)$/,
|
yzRule: /^#*(抽卡|抽奖|角色|武器|常驻|集录|up)+池?(记录|祈愿|分析)$/,
|
||||||
yzCheck: () => Cfg.get('gachaStat', false)
|
yzCheck: () => Cfg.get('gachaStat', false)
|
||||||
},
|
},
|
||||||
stat: {
|
stat: {
|
||||||
name: '抽卡统计',
|
name: '抽卡统计',
|
||||||
fn: Gacha.stat,
|
fn: Gacha.stat,
|
||||||
rule: /^#*喵喵(全部|抽卡|抽奖|角色|武器|常驻|up|版本)+池?统计$/,
|
rule: /^#*喵喵(全部|抽卡|抽奖|角色|武器|常驻|集录|up|版本)+池?统计$/,
|
||||||
yzRule: /^#*(全部|抽卡|抽奖|角色|武器|常驻|up|版本)+池?统计$/,
|
yzRule: /^#*(全部|抽卡|抽奖|角色|武器|常驻|集录|up|版本)+池?统计$/,
|
||||||
yzCheck: () => Cfg.get('gachaStat', false)
|
yzCheck: () => Cfg.get('gachaStat', false)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,9 @@ let Gacha = {
|
|||||||
case '武器':
|
case '武器':
|
||||||
type = 302
|
type = 302
|
||||||
break
|
break
|
||||||
|
case '集录':
|
||||||
|
type = 500
|
||||||
|
break
|
||||||
}
|
}
|
||||||
let uid = e.uid || await getTargetUid(e)
|
let uid = e.uid || await getTargetUid(e)
|
||||||
let qq = e.user_id
|
let qq = e.user_id
|
||||||
@ -37,7 +40,7 @@ let Gacha = {
|
|||||||
uid,
|
uid,
|
||||||
gacha,
|
gacha,
|
||||||
face: Gacha.getFace(uid)
|
face: Gacha.getFace(uid)
|
||||||
}, { e, scale: 1.4, retType: "base64" }), new Button(e).gacha()])
|
}, { e, scale: 1.4, retType: 'base64' }), new Button(e).gacha()])
|
||||||
},
|
},
|
||||||
async stat (e) {
|
async stat (e) {
|
||||||
let msg = e.msg.replace(/#|统计|分析|池/g, '')
|
let msg = e.msg.replace(/#|统计|分析|池/g, '')
|
||||||
@ -48,6 +51,8 @@ let Gacha = {
|
|||||||
type = 'char'
|
type = 'char'
|
||||||
} else if (/常驻/.test(msg)) {
|
} else if (/常驻/.test(msg)) {
|
||||||
type = 'normal'
|
type = 'normal'
|
||||||
|
} else if (/集录/.test(msg)) {
|
||||||
|
type = 'mix'
|
||||||
} else if (/全部/.test(msg)) {
|
} else if (/全部/.test(msg)) {
|
||||||
type = 'all'
|
type = 'all'
|
||||||
}
|
}
|
||||||
@ -66,7 +71,7 @@ let Gacha = {
|
|||||||
uid,
|
uid,
|
||||||
gacha,
|
gacha,
|
||||||
face: Gacha.getFace(uid)
|
face: Gacha.getFace(uid)
|
||||||
}, { e, scale: 1.4, retType: "base64" }), new Button(e).gacha()])
|
}, { e, scale: 1.4, retType: 'base64' }), new Button(e).gacha()])
|
||||||
},
|
},
|
||||||
|
|
||||||
getFace (uid) {
|
getFace (uid) {
|
||||||
@ -87,4 +92,4 @@ let Gacha = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default Gacha
|
export default Gacha
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import lodash from 'lodash'
|
import lodash from 'lodash'
|
||||||
import { Data } from '#miao'
|
import { Data } from '#miao'
|
||||||
import { Character, Weapon } from '#miao.models'
|
import { Character, Weapon } from '#miao.models'
|
||||||
import { poolDetail } from '../../resources/meta-gs/info/index.js'
|
import { poolDetail, mixPoolDetail } from '../../resources/meta-gs/info/index.js'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
let poolVersion = []
|
let poolVersion = []
|
||||||
@ -23,6 +23,24 @@ poolVersion.push({
|
|||||||
end: new Date('2025-12-31 23:59:59')
|
end: new Date('2025-12-31 23:59:59')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let mixPoolVersion = []
|
||||||
|
lodash.forEach(mixPoolDetail, (ds) => {
|
||||||
|
mixPoolVersion.push({
|
||||||
|
...ds,
|
||||||
|
start: new Date(ds.from),
|
||||||
|
end: new Date(ds.to)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
let mixLast = mixPoolVersion[mixPoolVersion.length - 1]
|
||||||
|
mixPoolVersion.push({
|
||||||
|
version: '新版本',
|
||||||
|
half: '?',
|
||||||
|
from: mixLast.to,
|
||||||
|
to: '2025-12-31 23:59:59',
|
||||||
|
start: mixLast.end,
|
||||||
|
end: new Date('2025-12-31 23:59:59')
|
||||||
|
})
|
||||||
|
|
||||||
let GachaData = {
|
let GachaData = {
|
||||||
|
|
||||||
// 获取JSON数据
|
// 获取JSON数据
|
||||||
@ -109,6 +127,10 @@ let GachaData = {
|
|||||||
let weaponFourNum = 0
|
let weaponFourNum = 0
|
||||||
let bigNum = 0
|
let bigNum = 0
|
||||||
let allNum = 0
|
let allNum = 0
|
||||||
|
let isMix = false
|
||||||
|
if (type === 500) {
|
||||||
|
isMix = true
|
||||||
|
}
|
||||||
|
|
||||||
let itemMap = logData.itemMap
|
let itemMap = logData.itemMap
|
||||||
if (logData.items.length === 0) {
|
if (logData.items.length === 0) {
|
||||||
@ -117,7 +139,7 @@ let GachaData = {
|
|||||||
let currVersion
|
let currVersion
|
||||||
lodash.forEach(logData.items, (item) => {
|
lodash.forEach(logData.items, (item) => {
|
||||||
if (!currVersion || (item.time < currVersion.start)) {
|
if (!currVersion || (item.time < currVersion.start)) {
|
||||||
currVersion = GachaData.getVersion(item.time)
|
currVersion = GachaData.getVersion(item.time, true, isMix)
|
||||||
}
|
}
|
||||||
|
|
||||||
allNum++
|
allNum++
|
||||||
@ -264,6 +286,7 @@ let GachaData = {
|
|||||||
let items = []
|
let items = []
|
||||||
let itemMap = {}
|
let itemMap = {}
|
||||||
let hasVersion = true
|
let hasVersion = true
|
||||||
|
let isMix = false
|
||||||
let loadData = function (poolId) {
|
let loadData = function (poolId) {
|
||||||
let gachaData = GachaData.readJSON(qq, uid, poolId)
|
let gachaData = GachaData.readJSON(qq, uid, poolId)
|
||||||
items = items.concat(gachaData.items)
|
items = items.concat(gachaData.items)
|
||||||
@ -279,6 +302,13 @@ let GachaData = {
|
|||||||
hasVersion = false
|
hasVersion = false
|
||||||
loadData(200)
|
loadData(200)
|
||||||
}
|
}
|
||||||
|
if (['mix'].includes(type)) {
|
||||||
|
isMix = true
|
||||||
|
loadData(500)
|
||||||
|
}
|
||||||
|
if (['all'].includes(type)) {
|
||||||
|
loadData(500)
|
||||||
|
}
|
||||||
|
|
||||||
items = items.sort((a, b) => b.time - a.time)
|
items = items.sort((a, b) => b.time - a.time)
|
||||||
|
|
||||||
@ -366,7 +396,7 @@ let GachaData = {
|
|||||||
if (currVersion) {
|
if (currVersion) {
|
||||||
versionData.push(getCurr())
|
versionData.push(getCurr())
|
||||||
}
|
}
|
||||||
let v = GachaData.getVersion(ds.time, hasVersion)
|
let v = GachaData.getVersion(ds.time, hasVersion, isMix)
|
||||||
if (!hasVersion) {
|
if (!hasVersion) {
|
||||||
v.version = type === 'all' ? '全部统计' : '常驻池'
|
v.version = type === 'all' ? '全部统计' : '常驻池'
|
||||||
}
|
}
|
||||||
@ -401,11 +431,19 @@ let GachaData = {
|
|||||||
return {
|
return {
|
||||||
versionData,
|
versionData,
|
||||||
itemMap,
|
itemMap,
|
||||||
totalStat: stat
|
totalStat: stat,
|
||||||
|
isMix
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getVersion (time, hasVersion = true) {
|
getVersion (time, hasVersion = true, isMix = false) {
|
||||||
|
if (isMix) {
|
||||||
|
for (let ds of mixPoolVersion) {
|
||||||
|
if (time > ds.start && time < ds.end) {
|
||||||
|
return ds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (hasVersion) {
|
if (hasVersion) {
|
||||||
for (let ds of poolVersion) {
|
for (let ds of poolVersion) {
|
||||||
if (time > ds.start && time < ds.end) {
|
if (time > ds.start && time < ds.end) {
|
||||||
|
@ -46,6 +46,9 @@
|
|||||||
width: 125px;
|
width: 125px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
.gacha-pool .pool-name.mix {
|
||||||
|
width: 160px;
|
||||||
|
}
|
||||||
.gacha-pool .pool-name .name {
|
.gacha-pool .pool-name .name {
|
||||||
height: 22px;
|
height: 22px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
@ -136,4 +139,3 @@
|
|||||||
background: #333;
|
background: #333;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
/*# sourceMappingURL=gacha-stat.css.map */
|
|
@ -1,10 +1,10 @@
|
|||||||
{{extend elemLayout}}
|
{{extend elemLayout}}
|
||||||
|
|
||||||
{{block 'css'}}
|
{{block 'css'}}
|
||||||
<link rel="stylesheet" type="text/css" href="{{_res_path}}/common/tpl.css?v=1.0"/>
|
<link rel="stylesheet" type="text/css" href="{{_res_path}}/common/tpl.css?v=1.0" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/avatar-list.css"/>
|
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/avatar-list.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{_res_path}}/gacha/gacha-detail.css?v=1.0"/>
|
<link rel="stylesheet" type="text/css" href="{{_res_path}}/gacha/gacha-detail.css?v=1.0" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{_res_path}}/gacha/gacha-stat.css?v=1.0"/>
|
<link rel="stylesheet" type="text/css" href="{{_res_path}}/gacha/gacha-stat.css?v=1.0" />
|
||||||
|
|
||||||
{{/block}}
|
{{/block}}
|
||||||
|
|
||||||
@ -41,7 +41,9 @@
|
|||||||
|
|
||||||
<div class="ck-notice">
|
<div class="ck-notice">
|
||||||
<strong>#角色统计/#武器统计</strong>角色/武器池统计,
|
<strong>#角色统计/#武器统计</strong>角色/武器池统计,
|
||||||
<strong>#常驻统计</strong>常驻池统计,
|
<strong>#常驻统计/#集录统计</strong>常驻/集录池统计
|
||||||
|
</div>
|
||||||
|
<div class="ck-notice">
|
||||||
<strong>#全部统计</strong>全部抽卡统计,
|
<strong>#全部统计</strong>全部抽卡统计,
|
||||||
<strong>#抽卡帮助</strong> 获取帮助
|
<strong>#抽卡帮助</strong> 获取帮助
|
||||||
</div>
|
</div>
|
||||||
@ -56,7 +58,7 @@
|
|||||||
<div class="version-name line">
|
<div class="version-name line">
|
||||||
{{vData.version}} {{vData.half}}
|
{{vData.version}} {{vData.half}}
|
||||||
</div>
|
</div>
|
||||||
<div class="pool-name">
|
<div class="pool-name {{gacha.isMix ? 'mix' : 'non-mix'}}">
|
||||||
<div class="name">{{vData.name}}</div>
|
<div class="name">{{vData.name}}</div>
|
||||||
<div class="time">{{vData.from}}~{{vData.to}}</div>
|
<div class="time">{{vData.from}}~{{vData.to}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
& > div {
|
&>div {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
}
|
}
|
||||||
@ -53,6 +53,10 @@
|
|||||||
width: 125px;
|
width: 125px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
|
&.mix {
|
||||||
|
width: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
height: 22px;
|
height: 22px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
@ -163,5 +167,4 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -594,5 +594,23 @@ export const poolDetail = [{
|
|||||||
char4: ['五郎', '云堇', '多莉'],
|
char4: ['五郎', '云堇', '多莉'],
|
||||||
weapon5: ['有乐御簾切', '赤角石溃杵'],
|
weapon5: ['有乐御簾切', '赤角石溃杵'],
|
||||||
weapon4: ['暗巷闪光', '暗巷猎手', '钟剑', '匣里灭辰', '西风秘典']
|
weapon4: ['暗巷闪光', '暗巷猎手', '钟剑', '匣里灭辰', '西风秘典']
|
||||||
|
}, {
|
||||||
|
version: '4.5',
|
||||||
|
half: '下半',
|
||||||
|
from: '2024-04-02 18:00:00',
|
||||||
|
to: '2024-04-23 14:59:59',
|
||||||
|
char5: ['那维莱特', '枫原万叶'],
|
||||||
|
char4: ['芭芭拉', '行秋', '烟绯'],
|
||||||
|
weapon5: ['万世流涌大典', '苍古自由之誓'],
|
||||||
|
weapon4: ['暗巷的酒与诗', '幽夜华尔兹', '笛剑', '西风大剑', '西风长枪']
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const mixPoolDetail = [{
|
||||||
|
version: '4.5',
|
||||||
|
half: '上半',
|
||||||
|
from: '2024-03-13 06:00:00',
|
||||||
|
to: '2024-04-02 17:59:59',
|
||||||
|
char5: ['优菈', '阿贝多', '可莉'],
|
||||||
|
weapon5: ['苇海信标', '松籁响起之时', '猎人之径']
|
||||||
|
}]
|
||||||
|
@ -52,7 +52,7 @@ export const alias = {
|
|||||||
// 剑
|
// 剑
|
||||||
天空之刃: '天空剑',
|
天空之刃: '天空剑',
|
||||||
风鹰剑: '风鹰,风影',
|
风鹰剑: '风鹰,风影',
|
||||||
波乱月白经津: '波乱,月白,波乱月白,经津,波波津,啵啵剑,月经剑',
|
波乱月白经津: '波乱,月白,波乱月白,经津,波波津,啵啵剑,月经剑,波波剑',
|
||||||
磐岩结绿: '绿箭,绿剑',
|
磐岩结绿: '绿箭,绿剑',
|
||||||
斫峰之刃: '斫峰,盾剑',
|
斫峰之刃: '斫峰,盾剑',
|
||||||
苍古自由之誓: '苍古,乐团剑',
|
苍古自由之誓: '苍古,乐团剑',
|
||||||
@ -110,7 +110,6 @@ export const alias = {
|
|||||||
'「究极霸王超级魔剑」': '霸王超级魔剑,究极霸王超级魔剑,霸王剑,超级魔剑,霸王魔剑,究极魔剑,魔剑,极霸剑',
|
'「究极霸王超级魔剑」': '霸王超级魔剑,究极霸王超级魔剑,霸王剑,超级魔剑,霸王魔剑,究极魔剑,魔剑,极霸剑',
|
||||||
裁断: '斧头',
|
裁断: '斧头',
|
||||||
|
|
||||||
|
|
||||||
// 枪
|
// 枪
|
||||||
天空之脊: '天空枪,薄荷枪',
|
天空之脊: '天空枪,薄荷枪',
|
||||||
护摩之杖: '护摩,护摩枪,护膜',
|
护摩之杖: '护摩,护摩枪,护膜',
|
||||||
|
Loading…
Reference in New Issue
Block a user