mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2025-04-21 16:00:17 +08:00
v1.0.0
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { isWeapon, isCharacter } from './utils'
|
||||
import { isWeapon, isCharacter, isBangboo } from './utils'
|
||||
|
||||
const itemCount = (map, name) => {
|
||||
if (!map.has(name)) {
|
||||
@ -12,10 +12,11 @@ const gachaDetail = (data) => {
|
||||
const detailMap = new Map()
|
||||
for (let [key, value] of data) {
|
||||
let detail = {
|
||||
count3: 0, count4: 0, count5: 0,
|
||||
count3w: 0, count4w: 0, count5w: 0, count4c: 0, count5c: 0,
|
||||
weapon3: new Map(), weapon4: new Map(), weapon5: new Map(),
|
||||
char4: new Map(), char5: new Map(),
|
||||
count2: 0, count3: 0, count4: 0,
|
||||
count2w: 0, count3w: 0, count4w: 0, count3c: 0, count4c: 0, count3b: 0, count4b: 0,
|
||||
weapon2: new Map(), weapon3: new Map(), weapon4: new Map(),
|
||||
char3: new Map(), char4: new Map(),
|
||||
bang3: new Map(), bang4: new Map(),
|
||||
date: [],
|
||||
ssrPos: [], countMio: 0, total: value.length,
|
||||
}
|
||||
@ -29,35 +30,41 @@ const gachaDetail = (data) => {
|
||||
if (!dateMax) dateMax = timestamp
|
||||
if (dateMin > timestamp) dateMin = timestamp
|
||||
if (dateMax < timestamp) dateMax = timestamp
|
||||
if (rank === '3') {
|
||||
if (rank === '2') {
|
||||
detail.count2++
|
||||
detail.countMio++
|
||||
if (isWeapon(type)) {
|
||||
detail.count2w++
|
||||
itemCount(detail.weapon2, name)
|
||||
}
|
||||
} else if (rank === '3') {
|
||||
detail.count3++
|
||||
detail.countMio++
|
||||
if (isWeapon(type)) {
|
||||
detail.count3w++
|
||||
itemCount(detail.weapon3, name)
|
||||
} else if (isBangboo(type)) {
|
||||
detail.count3b++
|
||||
itemCount(detail.bang3, name)
|
||||
} else if (isCharacter(type)) {
|
||||
detail.count3c++
|
||||
itemCount(detail.char3, name)
|
||||
}
|
||||
} else if (rank === '4') {
|
||||
detail.ssrPos.push([name, index + 1 - lastSSR, time, key])
|
||||
lastSSR = index + 1
|
||||
detail.count4++
|
||||
detail.countMio++
|
||||
if (isWeapon(type)) {
|
||||
detail.count4w++
|
||||
itemCount(detail.weapon4, name)
|
||||
} else if (isBangboo(type)) {
|
||||
detail.count4b++
|
||||
itemCount(detail.bang4, name)
|
||||
} else if (isCharacter(type)) {
|
||||
detail.count4c++
|
||||
itemCount(detail.char4, name)
|
||||
}
|
||||
} else if (rank === '5') {
|
||||
detail.ssrPos.push([name, index + 1 - lastSSR, time, key])
|
||||
lastSSR = index + 1
|
||||
detail.count5++
|
||||
detail.countMio = 0
|
||||
if (isWeapon(type)) {
|
||||
detail.count5w++
|
||||
itemCount(detail.weapon5, name)
|
||||
} else if (isCharacter(type)) {
|
||||
detail.count5c++
|
||||
itemCount(detail.char5, name)
|
||||
}
|
||||
}
|
||||
})
|
||||
detail.date = [dateMin, dateMax]
|
||||
|
Reference in New Issue
Block a user