())
+
+ return [...stigmataMainIdStigmataMap.values()]
+}
+
+function convertStigmataType(rawType: number): StigmaType {
+ switch (rawType) {
+ case 1:
+ return 'top'
+ case 2:
+ return 'mid'
+ case 3:
+ return 'bot'
+ default:
+ throw new Error(`Unknown Raw Stigmata Base Type (${rawType})`)
+ }
+}
diff --git a/src/lib/v2-pre/server/compileData/compileWeaponData.ts b/src/lib/v2-pre/server/compileData/compileWeaponData.ts
index f95f256e..a757d7e3 100644
--- a/src/lib/v2-pre/server/compileData/compileWeaponData.ts
+++ b/src/lib/v2-pre/server/compileData/compileWeaponData.ts
@@ -1,7 +1,7 @@
import { RootWeaponData, WeaponData } from '../../data/types'
-import { getRawEquipmentSkillDataMap, RawEquipmentSkillData } from '../raw/equipmentSkillData'
+import { getRawEquipmentSkillDataMap } from '../raw/equipmentSkillData'
import { getRawWeaponDataMap } from '../raw/weaponData'
-import { convertTagType, convertWeaponType, getText } from './utils'
+import { convertEquipmentSkill, convertWeaponType, getText } from './utils'
export function compileWeaponData(): RootWeaponData[] {
const rawWeaponDataMap = getRawWeaponDataMap()
@@ -21,7 +21,7 @@ export function compileWeaponData(): RootWeaponData[] {
const rawSkill = rawEquipmentSkillDataMap[skillId]
skills.push({
id: skillId,
- ...convertWeaponSkill(rawSkill),
+ ...convertEquipmentSkill(rawSkill),
param1: rawData.Prop1Param1,
param1Add: rawData.Prop1Param1Add,
param2: rawData.Prop1Param2,
@@ -35,7 +35,7 @@ export function compileWeaponData(): RootWeaponData[] {
const rawSkill = rawEquipmentSkillDataMap[skillId]
skills.push({
id: skillId,
- ...convertWeaponSkill(rawSkill),
+ ...convertEquipmentSkill(rawSkill),
param1: rawData.Prop2Param1,
param1Add: rawData.Prop2Param1Add,
param2: rawData.Prop2Param2,
@@ -49,7 +49,7 @@ export function compileWeaponData(): RootWeaponData[] {
const rawSkill = rawEquipmentSkillDataMap[skillId]
skills.push({
id: skillId,
- ...convertWeaponSkill(rawSkill),
+ ...convertEquipmentSkill(rawSkill),
param1: rawData.Prop3Param1,
param1Add: rawData.Prop3Param1Add,
param2: rawData.Prop3Param2,
@@ -100,22 +100,4 @@ export function compileWeaponData(): RootWeaponData[] {
weapons: rawWeaponMainIdWeaponDataMap.get(weaponId) || []
}
})
-
- function convertWeaponSkill(rawSkill: RawEquipmentSkillData) {
- const iconName = rawSkill.SkillIconPath.split('/').pop()
- return {
- name: getText(rawSkill.SkillName),
- info: getText(rawSkill.SkillDisplay),
- icon: iconName != null && iconName.length > 0 ? iconName : undefined,
- skillCd: rawSkill.SkillCD,
- skillSpCost: rawSkill.SPCost,
- skillSpNeed: rawSkill.SPNeed,
- tags: rawSkill.TagList.map(rawEquipmentSkillTag => {
- return {
- type: convertTagType(rawEquipmentSkillTag.TagID),
- comment: getText(rawEquipmentSkillTag.TagComment)
- }
- })
- }
- }
}
diff --git a/src/lib/v2-pre/server/compileData/utils.ts b/src/lib/v2-pre/server/compileData/utils.ts
index 4a69c618..b1ccdc9d 100644
--- a/src/lib/v2-pre/server/compileData/utils.ts
+++ b/src/lib/v2-pre/server/compileData/utils.ts
@@ -1,4 +1,5 @@
import { TagType, WeaponType } from '../../data/types'
+import { RawEquipmentSkillData } from '../raw/equipmentSkillData'
import { getRawTextMap } from '../raw/textMap'
export function getText(id: string | number) {
@@ -91,3 +92,21 @@ export function convertTagType(rawTagId: number): TagType {
throw new Error(`Unsupported raw show order(Skill) (${rawTagId})`)
}
+
+export function convertEquipmentSkill(rawSkill: RawEquipmentSkillData) {
+ const iconName = rawSkill.SkillIconPath.split('/').pop()
+ return {
+ name: getText(rawSkill.SkillName),
+ info: getText(rawSkill.SkillDisplay),
+ icon: iconName != null && iconName.length > 0 ? iconName : undefined,
+ skillCd: rawSkill.SkillCD,
+ skillSpCost: rawSkill.SPCost,
+ skillSpNeed: rawSkill.SPNeed,
+ tags: rawSkill.TagList.map(rawEquipmentSkillTag => {
+ return {
+ type: convertTagType(rawEquipmentSkillTag.TagID),
+ comment: getText(rawEquipmentSkillTag.TagComment)
+ }
+ })
+ }
+}
diff --git a/src/lib/v2-pre/server/loadData.ts b/src/lib/v2-pre/server/loadData.ts
index 1763dfef..ba369f2d 100644
--- a/src/lib/v2-pre/server/loadData.ts
+++ b/src/lib/v2-pre/server/loadData.ts
@@ -11,6 +11,9 @@ export const battlesuitCatalogPath = path.join(dataDir, 'battlesuit-catalog.yaml
export const weaponsDir = path.join(dataDir, 'weapons')
export const weaopnCatalogPath = path.join(dataDir, 'weapon-catalog.yaml')
+export const stigmataDir = path.join(dataDir, 'stigmata')
+export const stigmataCatalogPath = path.join(dataDir, 'stigmata-catalog.yaml')
+
export function loadBattlesuitCatalog(): BattlesuitCatalogItem[] {
return readYamlFile(battlesuitCatalogPath)
}
@@ -29,6 +32,15 @@ export function loadWeaponData(id: string) {
return readYamlFile(weaponDataPath)
}
+export function loadStigmataCatalog(): WeaponCatalogItem[] {
+ return readYamlFile(stigmataCatalogPath)
+}
+
+export function loadStigmaData(id: string) {
+ const stigmaDataPath = path.join(stigmataDir, `${id}.yaml`)
+ return readYamlFile(stigmaDataPath)
+}
+
function readYamlFile(pathname: string) {
return YAML.parse(fs.readFileSync(pathname).toString())
}
diff --git a/src/lib/v2-pre/server/raw/stigmataData.ts b/src/lib/v2-pre/server/raw/stigmataData.ts
new file mode 100644
index 00000000..b3134b62
--- /dev/null
+++ b/src/lib/v2-pre/server/raw/stigmataData.ts
@@ -0,0 +1,99 @@
+import { loadRawData } from './loadRawData'
+
+export function getRawStigmataDataMap(): RawStigmataDataMap {
+ return loadRawData('StigmataData.json')
+}
+
+export type RawStigmataDataMap = {
+ [key: string]: RawStigmaData
+}
+
+export interface RawStigmaData {
+ Rarity: 1 | 2 | 3 | 4 | 5
+ MaxRarity: 1 | 2 | 3 | 4 | 5
+ SubRarity: number
+ SubMaxRarity: number
+ Cost: number
+ PowerType: number
+ MaxLv: number
+ ExpType: number
+ SellPriceBase: number
+ SellPriceAdd: number
+ GearExpProvideBase: number
+ GearExpPorvideAdd: number
+ BaseType: number
+ LabelPath: string
+ DisplayTitle: number
+ DisplayDescription: number
+ DisplayNumber: number
+ IconPath: string // 'SpriteOutput/StigmataIcons/S1A_1'
+ ImagePath: string // 'S1A_1'
+ HPBase: number
+ HPAdd: number
+ SPBase: number
+ SPAdd: number
+ AttackBase: number
+ AttackAdd: number
+ DefenceBase: number
+ DefenceAdd: number
+ CriticalBase: number
+ CriticalAdd: number
+ DurabilityMax: number
+ EvoMaterial: [
+ {
+ ID: number
+ Num: number
+ }
+ ]
+ EvoID: number
+ Prop1ID: number
+ Prop1Param1: number
+ Prop1Param2: number
+ Prop1Param3: number
+ Prop1Param1Add: number
+ Prop1Param2Add: number
+ Prop1Param3Add: number
+ Prop2ID: number
+ Prop2Param1: number
+ Prop2Param2: number
+ Prop2Param3: number
+ Prop2Param1Add: number
+ Prop2Param2Add: number
+ Prop2Param3Add: number
+ Prop3ID: number
+ Prop3Param1: number
+ Prop3Param2: number
+ Prop3Param3: number
+ Prop3Param1Add: number
+ Prop3Param2Add: number
+ Prop3Param3Add: number
+ Protect: boolean
+ SetID: number
+ SmallIcon: string
+ TattooPath: string
+ OffsetX: number
+ OffsetY: number
+ Scale: number
+ AffixTreeId: number
+ CanRefine: boolean
+ RecycleID: number
+ DisjoinScoinCost: number
+ DisjoinAddMaterial: [
+ {
+ ID: number
+ Num: number
+ }
+ ]
+ LinkIDList: number[]
+ Quality: number
+ StigmataMainID: number
+ ShortName: number
+ SellPriceID: number
+ Transcendent: boolean
+ Target: number
+ IsSecurityProtect: boolean
+ GachaMainDropDisplayConfig: number[]
+ GachaGiftDropDisplayConfig: number[]
+ StigmataFilterList: number[]
+ CollaborationSetID: number
+}
diff --git a/src/pages/v2-pre/battlesuits/[battlesuitId].tsx b/src/pages/v2-pre/battlesuits/[battlesuitId].tsx
index 6170b23c..15803785 100644
--- a/src/pages/v2-pre/battlesuits/[battlesuitId].tsx
+++ b/src/pages/v2-pre/battlesuits/[battlesuitId].tsx
@@ -139,7 +139,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
)
})}
- {JSON.stringify(battlesuit, null, 2)}
+ {/* {JSON.stringify(battlesuit, null, 2)} */}
)
}
diff --git a/src/pages/v2-pre/index.tsx b/src/pages/v2-pre/index.tsx
index cce87214..f768688e 100644
--- a/src/pages/v2-pre/index.tsx
+++ b/src/pages/v2-pre/index.tsx
@@ -4,6 +4,7 @@ const HomePage = () => {
V2 Pre
Battlesuits
Weapons
+ Stigmata
)
}
diff --git a/src/pages/v2-pre/stigmata/[stigmaId].tsx b/src/pages/v2-pre/stigmata/[stigmaId].tsx
new file mode 100644
index 00000000..f1d98c60
--- /dev/null
+++ b/src/pages/v2-pre/stigmata/[stigmaId].tsx
@@ -0,0 +1,122 @@
+import { NextPageContext } from 'next'
+import { Box, Card, Flex, Heading } from 'theme-ui'
+import FormattedText from '../../../components/v2-pre/FormattedText'
+import { formatSubSkillInfo, replaceNewLine } from '../../../lib/v2-pre/data/formatText'
+import { loadStigmaData, loadStigmataCatalog } from '../../../lib/v2-pre/server/loadData'
+import { RootStigma, SkillTagItem } from '../../../lib/v2-pre/data/types'
+import { Fragment } from 'react'
+import TagIcon from '../../../components/v2-pre/TagIcon'
+import { getStigmaTypeLabel } from '../../../lib/v2-pre/data/text'
+import StigmaTypeIcon from '../../../components/v2-pre/StigmaTypeIcon'
+import StigmaIcon from '../../../components/v2-pre/StigmaIcon'
+import StigmaFigureImage from '../../../components/v2-pre/StigmaFigureImage'
+
+interface WeaponShowPageProps {
+ rootStigma: RootStigma
+}
+
+const StigmaShowPage = ({ rootStigma }: WeaponShowPageProps) => {
+ const stigma = rootStigma.stigmata[rootStigma.stigmata.length - 1]
+ return (
+
+ {stigma.name}
+
+
+
+
+
+
+
+
+
+
+ {replaceNewLine(stigma.description)}
+
+
+ {getStigmaTypeLabel(stigma.type)}
+
+
+ HP : {Math.floor(stigma.hpBase + stigma.hpAdd * (stigma.maxLv - 1))} / ATK :{' '}
+ {Math.floor(stigma.attackBase + stigma.attackAdd * (stigma.maxLv - 1))} / DEF :{' '}
+ {Math.floor(stigma.defenceBase + stigma.defenceAdd * (stigma.maxLv - 1))} / CRT :{' '}
+ {Math.floor(stigma.criticalBase + stigma.criticalAdd * (stigma.maxLv - 1))} (at Max Lv {stigma.maxLv})
+
+
+
+ Skills
+
+ {stigma.skills.map(skill => {
+ return (
+
+
+
+ {skill.name}
+
+
+
+
+ {formatSubSkillInfo({
+ info: skill.info,
+ maxLv: stigma.maxLv,
+ paramBase1: skill.param1,
+ paramBase2: skill.param2,
+ paramBase3: skill.param3,
+ paramAdd1: skill.param1Add,
+ paramAdd2: skill.param2Add,
+ paramAdd3: skill.param3Add
+ })}
+
+
+
+ )
+ })}
+
+ {/* {JSON.stringify(weapon, null, 2)} */}
+
+ )
+}
+
+export default StigmaShowPage
+
+export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmaId: string } }) {
+ const rootStigma = loadStigmaData(params.stigmaId)
+
+ return {
+ props: { rootStigma }
+ }
+}
+
+export async function getStaticPaths() {
+ const stigmataCatalog = loadStigmataCatalog()
+
+ return {
+ paths: stigmataCatalog.map(catalogItem => {
+ return {
+ params: { stigmaId: catalogItem.id }
+ }
+ }),
+ fallback: false
+ }
+}
+
+interface SkillTagBoxProps {
+ tag: SkillTagItem
+}
+
+const SkillTagItem = ({ tag }: SkillTagBoxProps) => {
+ return
+}
diff --git a/src/pages/v2-pre/stigmata/index.tsx b/src/pages/v2-pre/stigmata/index.tsx
new file mode 100644
index 00000000..11b57293
--- /dev/null
+++ b/src/pages/v2-pre/stigmata/index.tsx
@@ -0,0 +1,73 @@
+/** @jsxImportSource theme-ui */
+import { Box, Card } from '@theme-ui/components'
+import { NextPageContext } from 'next'
+import { Flex, Link } from 'theme-ui'
+
+import { StigmataCatalogItem } from '../../../lib/v2-pre/data/types'
+import { loadStigmataCatalog } from '../../../lib/v2-pre/server/loadData'
+import StigmaIcon from '../../../components/v2-pre/StigmaIcon'
+
+interface StigmataListPageProps {
+ stigmataCatalog: StigmataCatalogItem[]
+}
+
+const StigmataListPage = ({ stigmataCatalog }: StigmataListPageProps) => {
+ return (
+
+ Stigmata
+
+ {stigmataCatalog
+ .filter(filterStigmata)
+ .sort(sortStigmata)
+ .map(stigma => {
+ return (
+
+
+
+
+
+
+
+ {stigma.name}
+
+ {/* {stigma.id} */}
+
+
+
+ )
+ })}
+
+
+ )
+}
+
+export default StigmataListPage
+
+export async function getStaticProps({ locale }: NextPageContext) {
+ const stigmataCatalog = loadStigmataCatalog()
+
+ return {
+ props: { stigmataCatalog }
+ }
+}
+
+function filterStigmata(weapon: StigmataCatalogItem) {
+ return true
+}
+
+function sortStigmata(a: StigmataCatalogItem, b: StigmataCatalogItem) {
+ let aId = parseInt(a.id)
+
+ let bId = parseInt(b.id)
+
+ return bId - aId
+}
diff --git a/src/pages/v2-pre/weapons/[weaponId].tsx b/src/pages/v2-pre/weapons/[weaponId].tsx
index bf0bcdd7..b3c8c484 100644
--- a/src/pages/v2-pre/weapons/[weaponId].tsx
+++ b/src/pages/v2-pre/weapons/[weaponId].tsx
@@ -1,7 +1,7 @@
import { NextPageContext } from 'next'
import { Box, Card, Flex, Heading } from 'theme-ui'
import FormattedText from '../../../components/v2-pre/FormattedText'
-import { formatSubSkillInfo } from '../../../lib/v2-pre/data/formatText'
+import { formatSubSkillInfo, replaceNewLine } from '../../../lib/v2-pre/data/formatText'
import { loadWeaponCatalog, loadWeaponData } from '../../../lib/v2-pre/server/loadData'
import { RootWeaponData, SkillTagItem } from '../../../lib/v2-pre/data/types'
import { Fragment } from 'react'
@@ -25,7 +25,7 @@ const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
- {weapon.description}
+ {replaceNewLine(weapon.description)}
{getWeaponTypeLabel(weapon.type)}
diff --git a/src/pages/v2-pre/weapons/index.tsx b/src/pages/v2-pre/weapons/index.tsx
index 897735f5..d4f1b013 100644
--- a/src/pages/v2-pre/weapons/index.tsx
+++ b/src/pages/v2-pre/weapons/index.tsx
@@ -6,11 +6,11 @@ import { loadWeaponCatalog } from '../../../lib/v2-pre/server/loadData'
import { WeaponCatalogItem } from '../../../lib/v2-pre/data/types'
import WeaponIcon from '../../../components/v2-pre/WeaponIcon'
-interface BattlesuitListPageProps {
+interface WeaponListPageProps {
weaponCatalog: WeaponCatalogItem[]
}
-const BattlesuitListPage = ({ weaponCatalog }: BattlesuitListPageProps) => {
+const WeaponListPage = ({ weaponCatalog }: WeaponListPageProps) => {
return (
Weapons
@@ -49,7 +49,7 @@ const BattlesuitListPage = ({ weaponCatalog }: BattlesuitListPageProps) => {
)
}
-export default BattlesuitListPage
+export default WeaponListPage
export async function getStaticProps({ locale }: NextPageContext) {
const weaponCatalog = loadWeaponCatalog()
diff --git a/src/scripts/compileRawData.ts b/src/scripts/compileRawData.ts
index d8dea5ef..bfcf49a9 100644
--- a/src/scripts/compileRawData.ts
+++ b/src/scripts/compileRawData.ts
@@ -7,17 +7,21 @@ import {
battlesuitCatalogPath,
battlesuitsDir,
dataDir,
+ stigmataCatalogPath,
+ stigmataDir,
weaopnCatalogPath,
weaponsDir
} from '../lib/v2-pre/server/loadData'
-import { BattlesuitCatalogItem, WeaponCatalogItem } from '../lib/v2-pre/data/types'
+import { BattlesuitCatalogItem, StigmataCatalogItem, WeaponCatalogItem } from '../lib/v2-pre/data/types'
import { compileBattlesuitData } from '../lib/v2-pre/server/compileData/compileBattlesuitData'
import { compileWeaponData } from '../lib/v2-pre/server/compileData/compileWeaponData'
+import { compileStigmataData } from '../lib/v2-pre/server/compileData/compileStigmataData'
runScript(async () => {
createDirIfNotExist(dataDir)
- writeBattlesuitData()
- writeWeaponData()
+ // writeBattlesuitData()
+ // writeWeaponData()
+ writeStigmataData()
})
function writeBattlesuitData() {
@@ -47,10 +51,10 @@ function writeBattlesuitData() {
function writeWeaponData() {
const weaponDataList = compileWeaponData()
- const catalogList: WeaponCatalogItem[] = weaponDataList.map(weapon => {
- const maxedWeapon = weapon.weapons[weapon.weapons.length - 1]
+ const catalogList: WeaponCatalogItem[] = weaponDataList.map(rootWeapon => {
+ const maxedWeapon = rootWeapon.weapons[rootWeapon.weapons.length - 1]
return {
- id: weapon.id,
+ id: rootWeapon.id,
name: maxedWeapon.name,
icon: maxedWeapon.icon,
type: maxedWeapon.type,
@@ -67,3 +71,27 @@ function writeWeaponData() {
fs.writeFileSync(weaponDataPath, YAML.stringify(weaponData))
}
}
+
+function writeStigmataData() {
+ const stigmataDataList = compileStigmataData()
+
+ const catalogList: StigmataCatalogItem[] = stigmataDataList.map(rootStigma => {
+ const maxedStigma = rootStigma.stigmata[rootStigma.stigmata.length - 1]
+ return {
+ id: rootStigma.id,
+ name: maxedStigma.name,
+ icon: maxedStigma.icon,
+ type: maxedStigma.type,
+ maxRarity: maxedStigma.maxRarity
+ }
+ })
+
+ fs.writeFileSync(stigmataCatalogPath, YAML.stringify(catalogList))
+
+ createDirIfNotExist(stigmataDir)
+
+ for (const stigmataData of stigmataDataList) {
+ const stigmaDataPath = path.join(stigmataDir, `${stigmataData.id}.yaml`)
+ fs.writeFileSync(stigmaDataPath, YAML.stringify(stigmataData))
+ }
+}