新增#集录统计 #集录记录

This commit is contained in:
Aluxes 2024-04-04 00:33:14 +08:00
parent 13ba9a5afc
commit b72dfe187e
No known key found for this signature in database
GPG Key ID: 6696152F9C003087
8 changed files with 91 additions and 24 deletions

View File

@ -9,15 +9,15 @@ app.reg({
detail: {
name: '抽卡记录',
fn: Gacha.detail,
rule: /^#*喵喵(抽卡|抽奖|角色|武器|常驻|up)+池?(记录|祈愿|分析)$/,
yzRule: /^#*(抽卡|抽奖|角色|武器|常驻|up)+池?(记录|祈愿|分析)$/,
rule: /^#*喵喵(抽卡|抽奖|角色|武器|常驻|集录|up)+池?(记录|祈愿|分析)$/,
yzRule: /^#*(抽卡|抽奖|角色|武器|常驻|集录|up)+池?(记录|祈愿|分析)$/,
yzCheck: () => Cfg.get('gachaStat', false)
},
stat: {
name: '抽卡统计',
fn: Gacha.stat,
rule: /^#*喵喵(全部|抽卡|抽奖|角色|武器|常驻|up|版本)+池?统计$/,
yzRule: /^#*(全部|抽卡|抽奖|角色|武器|常驻|up|版本)+池?统计$/,
rule: /^#*喵喵(全部|抽卡|抽奖|角色|武器|常驻|集录|up|版本)+池?统计$/,
yzRule: /^#*(全部|抽卡|抽奖|角色|武器|常驻|集录|up|版本)+池?统计$/,
yzCheck: () => Cfg.get('gachaStat', false)
}

View File

@ -20,6 +20,9 @@ let Gacha = {
case '武器':
type = 302
break
case '集录':
type = 500
break
}
let uid = e.uid || await getTargetUid(e)
let qq = e.user_id
@ -37,7 +40,7 @@ let Gacha = {
uid,
gacha,
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) {
let msg = e.msg.replace(/#|统计|分析|池/g, '')
@ -48,6 +51,8 @@ let Gacha = {
type = 'char'
} else if (/常驻/.test(msg)) {
type = 'normal'
} else if (/集录/.test(msg)) {
type = 'mix'
} else if (/全部/.test(msg)) {
type = 'all'
}
@ -66,7 +71,7 @@ let Gacha = {
uid,
gacha,
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) {
@ -87,4 +92,4 @@ let Gacha = {
}
}
}
export default Gacha
export default Gacha

View File

@ -1,7 +1,7 @@
import lodash from 'lodash'
import { Data } from '#miao'
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'
let poolVersion = []
@ -23,6 +23,24 @@ poolVersion.push({
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 = {
// 获取JSON数据
@ -109,6 +127,10 @@ let GachaData = {
let weaponFourNum = 0
let bigNum = 0
let allNum = 0
let isMix = false
if (type === 500) {
isMix = true
}
let itemMap = logData.itemMap
if (logData.items.length === 0) {
@ -117,7 +139,7 @@ let GachaData = {
let currVersion
lodash.forEach(logData.items, (item) => {
if (!currVersion || (item.time < currVersion.start)) {
currVersion = GachaData.getVersion(item.time)
currVersion = GachaData.getVersion(item.time, true, isMix)
}
allNum++
@ -264,6 +286,7 @@ let GachaData = {
let items = []
let itemMap = {}
let hasVersion = true
let isMix = false
let loadData = function (poolId) {
let gachaData = GachaData.readJSON(qq, uid, poolId)
items = items.concat(gachaData.items)
@ -279,6 +302,13 @@ let GachaData = {
hasVersion = false
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)
@ -366,7 +396,7 @@ let GachaData = {
if (currVersion) {
versionData.push(getCurr())
}
let v = GachaData.getVersion(ds.time, hasVersion)
let v = GachaData.getVersion(ds.time, hasVersion, isMix)
if (!hasVersion) {
v.version = type === 'all' ? '全部统计' : '常驻池'
}
@ -401,11 +431,19 @@ let GachaData = {
return {
versionData,
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) {
for (let ds of poolVersion) {
if (time > ds.start && time < ds.end) {

View File

@ -46,6 +46,9 @@
width: 125px;
text-align: left;
}
.gacha-pool .pool-name.mix {
width: 160px;
}
.gacha-pool .pool-name .name {
height: 22px;
line-height: 22px;
@ -136,4 +139,3 @@
background: #333;
color: #fff;
}
/*# sourceMappingURL=gacha-stat.css.map */

View File

@ -1,10 +1,10 @@
{{extend elemLayout}}
{{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}}/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-stat.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}}/gacha/gacha-detail.css?v=1.0" />
<link rel="stylesheet" type="text/css" href="{{_res_path}}/gacha/gacha-stat.css?v=1.0" />
{{/block}}
@ -41,7 +41,9 @@
<div class="ck-notice">
<strong>#角色统计/#武器统计</strong>角色/武器池统计,
<strong>#常驻统计</strong>常驻池统计,
<strong>#常驻统计/#集录统计</strong>常驻/集录池统计
</div>
<div class="ck-notice">
<strong>#全部统计</strong>全部抽卡统计,
<strong>#抽卡帮助</strong> 获取帮助
</div>
@ -56,7 +58,7 @@
<div class="version-name line">
{{vData.version}} {{vData.half}}
</div>
<div class="pool-name">
<div class="pool-name {{gacha.isMix ? 'mix' : 'non-mix'}}">
<div class="name">{{vData.name}}</div>
<div class="time">{{vData.from}}~{{vData.to}}</div>
</div>

View File

@ -7,7 +7,7 @@
display: flex;
text-align: center;
& > div {
&>div {
padding: 10px;
height: 56px;
}
@ -53,6 +53,10 @@
width: 125px;
text-align: left;
&.mix {
width: 160px;
}
.name {
height: 22px;
line-height: 22px;
@ -163,5 +167,4 @@
}
}
}

View File

@ -594,5 +594,23 @@ export const poolDetail = [{
char4: ['五郎', '云堇', '多莉'],
weapon5: ['有乐御簾切', '赤角石溃杵'],
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: ['苇海信标', '松籁响起之时', '猎人之径']
}]

View File

@ -52,7 +52,7 @@ export const alias = {
// 剑
天空之刃: '天空剑',
风鹰剑: '风鹰,风影',
波乱月白经津: '波乱,月白,波乱月白,经津,波波津,啵啵剑,月经剑',
波乱月白经津: '波乱,月白,波乱月白,经津,波波津,啵啵剑,月经剑,波波剑',
磐岩结绿: '绿箭,绿剑',
斫峰之刃: '斫峰,盾剑',
苍古自由之誓: '苍古,乐团剑',
@ -110,7 +110,6 @@ export const alias = {
'「究极霸王超级魔剑」': '霸王超级魔剑,究极霸王超级魔剑,霸王剑,超级魔剑,霸王魔剑,究极魔剑,魔剑,极霸剑',
裁断: '斧头',
// 枪
天空之脊: '天空枪,薄荷枪',
护摩之杖: '护摩,护摩枪,护膜',