Add signet pages
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export const signetGroups = [
|
||||
{ id: '1', name: '[구원]의 각인', icon: 'Kevin' },
|
||||
{ id: '2', name: '[황금]의 각인', icon: 'Eden' },
|
||||
{ id: '3', name: '[오멸]의 각인', icon: 'Kalpas' },
|
||||
{ id: '4', name: '[천혜]의 각인', icon: 'Su' },
|
||||
{ id: '5', name: '[찰나]의 각인', icon: 'Sakura' },
|
||||
{ id: '6', name: '[무한]의 각인', icon: 'Mobius' },
|
||||
{ id: '7', name: '[부생]의 각인', icon: 'Hua' },
|
||||
// { id: '8', name: '[■■]의 각인', icon: 'Elysia' },
|
||||
// { id: '9', name: '[■■]의 각인', icon: 'Elysia' },
|
||||
{ id: '10', name: '[계율]의 각인', icon: 'Aponia' },
|
||||
{ id: '11', name: '[나선]의 각인', icon: 'Verve' },
|
||||
{ id: '12', name: '[욱광]의 각인', icon: 'Kosma' },
|
||||
{ id: '13', name: '[번성]의 각인', icon: 'Griseo' },
|
||||
{ id: '14', name: '[환몽]의 각인', icon: 'Pardofelis' }
|
||||
]
|
||||
@@ -23,7 +23,6 @@ describe('formatSubSkillInfo', () => {
|
||||
it('appends 0, based on precision, if the calculated value does not have decimals', () => {
|
||||
const params = {
|
||||
info: '전투 중 초기 SP가 #1[f1] 증가하며, 오픈월드에서는 10분에 1회 발동한다.',
|
||||
|
||||
maxLv: 11,
|
||||
paramBase1: 20,
|
||||
paramBase2: 0,
|
||||
|
||||
@@ -223,3 +223,18 @@ export function getTagTypeLabel(type: TagType) {
|
||||
return `Unknown Tag Type (${type})`
|
||||
}
|
||||
}
|
||||
|
||||
export function getErSignetTypeLabel(quality: number) {
|
||||
switch (quality) {
|
||||
case 1:
|
||||
return '일반 각인'
|
||||
case 2:
|
||||
return '증폭 각인'
|
||||
case 3:
|
||||
return '코어 각인'
|
||||
case 4:
|
||||
return '전용 각인'
|
||||
default:
|
||||
return `Unknown (${quality})`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,3 +261,33 @@ export interface StigmataSetCatalogItem {
|
||||
name: string
|
||||
stigmataList: { id: string; icon: string; maxRarity: number }[]
|
||||
}
|
||||
|
||||
export interface ErSignet {
|
||||
id: string
|
||||
name: string
|
||||
desc: string
|
||||
buffSuit: string
|
||||
quality: number
|
||||
}
|
||||
|
||||
export interface ErBattlesuit {
|
||||
battlesuit: string
|
||||
abilities: ErBattlesuitAbility[]
|
||||
signets: ErSignet[]
|
||||
}
|
||||
export interface ErBattlesuitCatalogItem {
|
||||
battlesuit: string
|
||||
}
|
||||
|
||||
export interface ErBattlesuitAbility {
|
||||
id: string
|
||||
type: number
|
||||
name: string
|
||||
desc: string
|
||||
}
|
||||
|
||||
export interface ErSignetGroup {
|
||||
id: string
|
||||
name: string
|
||||
icon: string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { compileGodWarData } from './compileGodWarData'
|
||||
|
||||
describe('compileGodWarData', () => {
|
||||
it('compiles main battlesuit abilities and signets', () => {
|
||||
const { mainAvatarList } = compileGodWarData()
|
||||
|
||||
const targetItem = mainAvatarList[11]
|
||||
expect(targetItem).toMatchObject({
|
||||
battlesuit: expect.any(String),
|
||||
abilities: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
name: expect.any(String),
|
||||
desc: expect.any(String)
|
||||
})
|
||||
]),
|
||||
signets: expect.arrayContaining([
|
||||
{
|
||||
id: expect.any(String),
|
||||
buffSuit: expect.any(String),
|
||||
name: expect.any(String),
|
||||
desc: expect.any(String),
|
||||
quality: expect.any(Number)
|
||||
}
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
it('compiles buff list per suit', () => {
|
||||
const { buffSuitBuffListMap } = compileGodWarData()
|
||||
|
||||
const targetItem = buffSuitBuffListMap.get('3')
|
||||
|
||||
expect(targetItem).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: expect.any(String),
|
||||
buffSuit: expect.any(String),
|
||||
name: expect.any(String),
|
||||
desc: expect.any(String),
|
||||
quality: expect.any(Number)
|
||||
})
|
||||
])
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,83 @@
|
||||
import { ErBattlesuit, ErBattlesuitAbility, ErSignet, ErSignetGroup } from '../../data/types'
|
||||
import { getRawGodWarAvatarAbilityMap } from '../raw/godWarAvatarAbility'
|
||||
import { getRawGodWarBuffMap } from '../raw/godWarBuff'
|
||||
import { getRawGodWarBuffSuitMap } from '../raw/godWarBuffSuit'
|
||||
import { getRawGodWarMainAvatarMap } from '../raw/godWarMainAvatar'
|
||||
import { getText } from './utils'
|
||||
|
||||
export function compileGodWarData() {
|
||||
const rawMainAvatarMap = getRawGodWarMainAvatarMap()['1']
|
||||
const rawGodWarAvatarAbilityMap = getRawGodWarAvatarAbilityMap()
|
||||
const rawGodWarBuffMap = getRawGodWarBuffMap()
|
||||
const rawGodWarBuffSuitMap = getRawGodWarBuffSuitMap()
|
||||
const battlesuitIdRawBuffListMap = new Map<string, ErSignet[]>()
|
||||
const buffSuitBuffListMap = new Map<string, ErSignet[]>()
|
||||
|
||||
Object.entries(rawGodWarBuffMap).forEach(([id1, rawbuffMap]) => {
|
||||
const rawBuffList = Object.entries(rawbuffMap)
|
||||
rawBuffList.forEach(([id2, rawBuff]) => {
|
||||
const buffSuit = rawBuff.BuffSuit.toString()
|
||||
// No data
|
||||
if (buffSuit === '0') {
|
||||
return
|
||||
}
|
||||
if (buffSuit === '8') {
|
||||
const buffGroupId = rawBuff.BuffGroup.toString()
|
||||
let buffList = battlesuitIdRawBuffListMap.get(buffGroupId)
|
||||
if (buffList == null) {
|
||||
buffList = []
|
||||
battlesuitIdRawBuffListMap.set(buffGroupId, buffList)
|
||||
}
|
||||
buffList.push({
|
||||
id: `${id1}-${id2}`,
|
||||
name: getText(rawBuff.BuffName),
|
||||
desc: getText(rawBuff.BuffDesc),
|
||||
buffSuit,
|
||||
quality: rawBuff.BuffQuality
|
||||
})
|
||||
} else {
|
||||
if (rawBuff.BuffSuit < 10 && id1.length > 4) {
|
||||
return
|
||||
}
|
||||
let buffList = buffSuitBuffListMap.get(buffSuit)
|
||||
if (buffList == null) {
|
||||
buffList = []
|
||||
buffSuitBuffListMap.set(buffSuit, buffList)
|
||||
}
|
||||
buffList.push({
|
||||
id: `${id1}-${id2}`,
|
||||
name: getText(rawBuff.BuffName),
|
||||
desc: getText(rawBuff.BuffDesc),
|
||||
buffSuit,
|
||||
quality: rawBuff.BuffQuality
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const mainAvatarList = Object.entries(rawMainAvatarMap).map<ErBattlesuit>(([id, rawData]) => {
|
||||
const abilities = rawData.AvatarAbilityID.map<ErBattlesuitAbility>(id => {
|
||||
const stringId = id.toString()
|
||||
const rawAbility = rawGodWarAvatarAbilityMap[stringId]
|
||||
|
||||
return {
|
||||
id: stringId,
|
||||
type: rawAbility.AbilityType,
|
||||
name: getText(rawAbility.AbilityTitle),
|
||||
desc: getText(rawAbility.AbilityDes)
|
||||
}
|
||||
})
|
||||
const signets = battlesuitIdRawBuffListMap.get(id)!
|
||||
|
||||
return {
|
||||
battlesuit: id,
|
||||
abilities,
|
||||
signets
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
buffSuitBuffListMap,
|
||||
mainAvatarList
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,17 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import YAML from 'yaml'
|
||||
import { BattlesuitCatalogItem, RootStigma, StigmataSet, WeaponCatalogItem } from '../data/types'
|
||||
import {
|
||||
BattlesuitCatalogItem,
|
||||
ErBattlesuit,
|
||||
ErBattlesuitCatalogItem,
|
||||
ErSignet,
|
||||
RootStigma,
|
||||
StigmataCatalogItem,
|
||||
StigmataSet,
|
||||
StigmataSetCatalogItem,
|
||||
WeaponCatalogItem
|
||||
} from '../data/types'
|
||||
|
||||
export const dataDir = path.join(process.cwd(), 'data/v2-pre')
|
||||
|
||||
@@ -17,6 +27,11 @@ export const stigmataCatalogPath = path.join(dataDir, 'stigmata-catalog.yaml')
|
||||
export const stigmataSetsDir = path.join(dataDir, 'stigmata-sets')
|
||||
export const stigmataSetCatalogPath = path.join(dataDir, 'stigmata-set-catalog.yaml')
|
||||
|
||||
export const erBattlesuitCatalogPath = path.join(dataDir, 'er-battlesuits-catalog.yaml')
|
||||
export const erBattlesuitsDir = path.join(dataDir, 'er-battlesuits')
|
||||
export const erSignetsDir = path.join(dataDir, 'er-signets')
|
||||
export const erSignetGroupsPath = path.join(dataDir, 'er-signet-groups.yaml')
|
||||
|
||||
export function loadBattlesuitCatalog(): BattlesuitCatalogItem[] {
|
||||
return readYamlFile(battlesuitCatalogPath)
|
||||
}
|
||||
@@ -35,7 +50,7 @@ export function loadWeaponData(id: string) {
|
||||
return readYamlFile(weaponDataPath)
|
||||
}
|
||||
|
||||
export function loadStigmataCatalog(): WeaponCatalogItem[] {
|
||||
export function loadStigmataCatalog(): StigmataCatalogItem[] {
|
||||
return readYamlFile(stigmataCatalogPath)
|
||||
}
|
||||
|
||||
@@ -44,7 +59,7 @@ export function loadStigmaData(id: string): RootStigma {
|
||||
return readYamlFile(stigmaDataPath)
|
||||
}
|
||||
|
||||
export function loadStigmataSetCatalog(): WeaponCatalogItem[] {
|
||||
export function loadStigmataSetCatalog(): StigmataSetCatalogItem[] {
|
||||
return readYamlFile(stigmataSetCatalogPath)
|
||||
}
|
||||
|
||||
@@ -53,6 +68,20 @@ export function loadStigmataSetData(id: string): StigmataSet {
|
||||
return readYamlFile(stigmataSetPath)
|
||||
}
|
||||
|
||||
export function loadErBattlesuitCatalog(): ErBattlesuitCatalogItem[] {
|
||||
return readYamlFile(erBattlesuitCatalogPath)
|
||||
}
|
||||
|
||||
export function loadErBattlesuit(id: string): ErBattlesuit {
|
||||
const erBattlesuitPath = path.join(erBattlesuitsDir, `${id}.yaml`)
|
||||
return readYamlFile(erBattlesuitPath)
|
||||
}
|
||||
|
||||
export function loadErSignets(id: string): ErSignet[] {
|
||||
const erSignetsPath = path.join(erSignetsDir, `${id}.yaml`)
|
||||
return readYamlFile(erSignetsPath)
|
||||
}
|
||||
|
||||
function readYamlFile(pathname: string) {
|
||||
return YAML.parse(fs.readFileSync(pathname).toString())
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { loadRawData } from './loadRawData'
|
||||
|
||||
export function getRawGodWarAvatarAbilityMap(): RawGodWarAvatarAbilityMap {
|
||||
return loadRawData('GodWarAvatarAbility.json')
|
||||
}
|
||||
|
||||
export type RawGodWarAvatarAbilityMap = {
|
||||
[key: string]: RawGodWarAvatarAbility
|
||||
}
|
||||
|
||||
export interface RawGodWarAvatarAbility {
|
||||
AbilityType: number
|
||||
AbilityTitle: number
|
||||
AbilityDes: number
|
||||
AbilityIcon: string
|
||||
IsShowInAvatarChallenge: boolean
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { loadRawData } from './loadRawData'
|
||||
|
||||
export function getRawGodWarBuffMap(): RawGodWarBuffMap {
|
||||
return loadRawData('GodWarBuff.json')
|
||||
}
|
||||
|
||||
export type RawGodWarBuffMap = {
|
||||
[key: string]: {
|
||||
[key: string]: RawGodWarBuff
|
||||
}
|
||||
}
|
||||
|
||||
export interface RawGodWarBuff {
|
||||
BuffSuit: number
|
||||
BuffQuality: number
|
||||
AbilityName: string
|
||||
ParamList: string[]
|
||||
BuffIcon: string // 'SpriteOutput/Rogue/BuffIcon/RogueGodIcon_1'
|
||||
BuffName: number
|
||||
BuffDesc: number
|
||||
BuffUpDesc: number
|
||||
SimpleBuffDesc: number
|
||||
BuffTagList: unknown[]
|
||||
ShowBuffIconEffect: boolean
|
||||
BuffGroup: number
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { loadRawData } from './loadRawData'
|
||||
|
||||
export function getRawGodWarBuffSuitMap(): RawGodWarBuffSuitMap {
|
||||
return loadRawData('GodWarBuffSuit.json')
|
||||
}
|
||||
|
||||
export type RawGodWarBuffSuitMap = {
|
||||
[key: string]: RawGodWarBuffSuit
|
||||
}
|
||||
|
||||
export interface RawGodWarBuffSuit {
|
||||
SuitIcon: string
|
||||
SuitName: number
|
||||
SuitDesc: number
|
||||
SuitImage: string
|
||||
ShowSuitIconEffect: boolean
|
||||
ShowFilterOption: boolean
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { loadRawData } from './loadRawData'
|
||||
|
||||
export function getRawGodWarMainAvatarMap(): RawGodWarMainAvataMap {
|
||||
return loadRawData('GodWarMainAvatar.json')
|
||||
}
|
||||
|
||||
export type RawGodWarMainAvataMap = {
|
||||
[key: string]: {
|
||||
[key: string]: RawGodWarAvatarData
|
||||
}
|
||||
}
|
||||
|
||||
export interface RawGodWarAvatarData {
|
||||
AbilityName: string
|
||||
ParamList: string[]
|
||||
StepUnlockMissionMap: {
|
||||
MissionID: number
|
||||
StepID: number
|
||||
}[]
|
||||
AvatarAbilityID: number[]
|
||||
AvatarMissionList: number[]
|
||||
RecommendLink: string
|
||||
AvatarChallengeStageIDList: number[]
|
||||
}
|
||||
Reference in New Issue
Block a user