From 5cb208b9a09471faa5973ee3610eaf8df053b0cb Mon Sep 17 00:00:00 2001 From: Sakura Knoll Date: Sat, 15 Jul 2023 12:44:38 +0900 Subject: [PATCH] Implement battlesuit filters --- data/en-US/battlesuit-catalog.yaml | 376 ++++++++++++++++++++++ data/ko-KR/battlesuit-catalog.yaml | 376 ++++++++++++++++++++++ src/components/atoms/FilterButton.tsx | 34 +- src/lib/v2/data/text.ts | 150 ++++++++- src/lib/v2/data/types.ts | 2 +- src/lib/v2/data/utils.ts | 56 +++- src/pages/honkai3rd/battlesuits/index.tsx | 120 ++++++- src/scripts/compileRawData.ts | 3 +- 8 files changed, 1070 insertions(+), 47 deletions(-) diff --git a/data/en-US/battlesuit-catalog.yaml b/data/en-US/battlesuit-catalog.yaml index 2f3fbe2a..b140ce2d 100644 --- a/data/en-US/battlesuit-catalog.yaml +++ b/data/en-US/battlesuit-catalog.yaml @@ -4,543 +4,919 @@ weapon: pistols character: kiana initialStar: b + tags: + - physical-dmg + - stun + - burst + - time-mastery - id: "102" fullName: Valkyrie Ranger attributeType: mech weapon: pistols character: kiana initialStar: a + tags: + - physical-dmg + - gather + - bleed - id: "103" fullName: Knight Moonbeam attributeType: bio weapon: pistols character: kiana initialStar: s + tags: + - physical-dmg + - time-mastery + - fast-atk - id: "104" fullName: Divine Prayer attributeType: psy weapon: pistols character: kiana initialStar: a + tags: + - physical-dmg + - heal + - impair + - burst + - time-mastery - id: "105" fullName: Herrscher of Flamescion attributeType: psy weapon: pistols character: kiana initialStar: s + tags: + - fire-dmg + - time-mastery + - heal + - gather + - aerial - id: "106" fullName: Herrscher of Finality attributeType: img weapon: pistols character: kiana initialStar: s + tags: + - fire-dmg + - aerial + - time-mastery + - ignite - id: "111" fullName: Sixth Serenade attributeType: psy weapon: pistols character: kallen initialStar: s + tags: + - ice-dmg + - freeze - id: "112" fullName: Ritual Imayoh attributeType: mech weapon: pistols character: kallen initialStar: a + tags: + - physical-dmg + - stun + - time-mastery - id: "113" fullName: Herrscher of the Void attributeType: bio weapon: pistols character: kiana initialStar: s + tags: + - physical-dmg + - time-mastery + - fast-atk + - aerial - id: "114" fullName: Sündenjäger attributeType: mech weapon: pistols character: kallen initialStar: a + tags: + - physical-dmg + - impair + - fast-atk - id: "201" fullName: Crimson Impulse attributeType: bio weapon: katana character: mei initialStar: b + tags: + - physical-dmg + - bleed + - burst + - time-mastery - id: "202" fullName: Shadow Dash attributeType: mech weapon: katana character: mei initialStar: a + tags: + - physical-dmg + - fast-atk - id: "203" fullName: Valkyrie Bladestrike attributeType: bio weapon: katana character: mei initialStar: a + tags: + - physical-dmg + - burst + - fast-atk + - time-mastery - id: "204" fullName: Lightning Empress attributeType: psy weapon: katana character: mei initialStar: s + tags: + - lightning-dmg + - paralyze - id: "205" fullName: Herrscher of Thunder attributeType: psy weapon: katana character: mei initialStar: s + tags: + - lightning-dmg + - paralyze + - fast-atk + - burst + - time-mastery - id: "206" fullName: Herrscher of Origin attributeType: img weapon: katana character: mei initialStar: s + tags: + - lightning-dmg + - fast-atk - id: "211" fullName: Gyakushinn Miko attributeType: bio weapon: katana character: sakura initialStar: a + tags: + - physical-dmg + - bleed + - burst - id: "212" fullName: Goushinnso Memento attributeType: mech weapon: katana character: sakura initialStar: s + tags: + - ice-dmg + - freeze - id: "213" fullName: Flame Sakitama attributeType: bio weapon: katana character: sakura initialStar: a + tags: + - fire-dmg + - ignite + - time-mastery - id: "214" fullName: Darkbolt Jonin attributeType: bio weapon: katana character: sakura initialStar: a + tags: + - lightning-dmg + - paralyze + - time-mastery - id: "301" fullName: Valkyrie Chariot attributeType: psy weapon: cannon character: bronya initialStar: b + tags: + - physical-dmg + - gather + - ignite + - time-mastery - id: "302" fullName: Yamabuki Armor attributeType: psy weapon: cannon character: bronya initialStar: a + tags: + - physical-dmg + - impair + - burst + - time-mastery + - heal - id: "303" fullName: Snowy Sniper attributeType: bio weapon: cannon character: bronya initialStar: a + tags: + - physical-dmg + - freeze - id: "304" fullName: Dimension Breaker attributeType: mech weapon: cannon character: bronya initialStar: s + tags: + - physical-dmg + - burst + - paralyze + - bleed + - time-mastery - id: "311" fullName: Wolf's Dawn attributeType: psy weapon: cannon character: bronya initialStar: a + tags: + - physical-dmg + - stun + - weaken + - time-mastery - id: "312" fullName: Black Nucleus attributeType: bio weapon: cannon character: bronya initialStar: s + tags: + - physical-dmg + - stun - id: "313" fullName: Herrscher of Reason attributeType: mech weapon: cannon character: bronya initialStar: s + tags: + - ice-dmg + - freeze + - burst + - time-mastery - id: "314" fullName: Haxxor Bunny attributeType: psy weapon: cannon character: bronya initialStar: a + tags: + - ice-dmg + - time-mastery + - fast-atk - id: "315" fullName: "SILVERWING: N-EX" attributeType: bio weapon: cannon character: bronya initialStar: s + tags: + - ice-dmg + - fast-atk + - time-mastery + - gather + - aerial - id: "316" fullName: Bronya attributeType: bio weapon: cannon character: bronya initialStar: s + tags: [] - id: "317" fullName: Herrscher of Truth attributeType: img weapon: cannon character: bronya initialStar: s + tags: + - ice-dmg + - time-mastery + - fast-atk + - gather + - aerial - id: "401" fullName: Valkyrie Triumph attributeType: bio weapon: 2-handed character: himeko initialStar: a + tags: + - physical-dmg + - heavy-atk + - time-mastery + - stun + - heal - id: "402" fullName: Scarlet Fusion attributeType: mech weapon: 2-handed character: himeko initialStar: a + tags: + - lightning-dmg + - heavy-atk + - burst + - paralyze - id: "403" fullName: Battle Storm attributeType: bio weapon: 2-handed character: himeko initialStar: b + tags: + - physical-dmg + - heavy-atk + - stun + - time-mastery - id: "404" fullName: Blood Rose attributeType: psy weapon: 2-handed character: himeko initialStar: s + tags: + - fire-dmg + - ignite + - heavy-atk + - burst - id: "411" fullName: Kriegsmesser attributeType: psy weapon: 2-handed character: himeko initialStar: a + tags: + - ice-dmg + - freeze - id: "412" fullName: "Vermilion Knight: Eclipse" attributeType: mech weapon: 2-handed character: himeko initialStar: s + tags: + - fire-dmg + - ignite - id: "421" fullName: Blueberry Blitz attributeType: mech weapon: 2-handed character: olenyevas initialStar: a + tags: + - physical-dmg + - freeze - id: "422" fullName: Molotov Cherry attributeType: psy weapon: 2-handed character: olenyevas initialStar: s + tags: + - physical-dmg + - gather + - time-mastery - id: "501" fullName: Valkyrie Pledge attributeType: psy weapon: cross character: theresa initialStar: a + tags: + - lightning-dmg + - paralyze + - time-mastery + - fast-atk - id: "502" fullName: Violet Executer attributeType: mech weapon: cross character: theresa initialStar: s + tags: + - physical-dmg + - bleed + - heavy-atk + - burst + - fast-atk - id: "503" fullName: Sakuno Rondo attributeType: psy weapon: cross character: theresa initialStar: a + tags: + - fire-dmg + - ignite + - burst + - fast-atk - id: "504" fullName: Celestial Hymn attributeType: bio weapon: cross character: theresa initialStar: s + tags: + - physical-dmg + - gather + - impair + - fast-atk - id: "506" fullName: Starlit Astrologos attributeType: bio weapon: cross character: theresa initialStar: a + tags: + - physical-dmg + - time-mastery + - stun + - gather + - heal - id: "511" fullName: Luna Kindred attributeType: bio weapon: cross character: theresa initialStar: a + tags: + - physical-dmg + - heavy-atk + - bleed + - time-mastery - id: "601" fullName: Valkyrie Accipiter attributeType: psy weapon: fists character: fuhua initialStar: a + tags: + - physical-dmg + - stun + - heal + - time-mastery - id: "602" fullName: Shadow Knight attributeType: mech weapon: fists character: fuhua initialStar: s + tags: + - lightning-dmg + - bleed + - burst + - fast-atk + - time-mastery - id: "603" fullName: Night Squire attributeType: bio weapon: fists character: fuhua initialStar: a + tags: + - physical-dmg + - bleed + - burst + - fast-atk + - time-mastery - id: "604" fullName: Phoenix attributeType: psy weapon: fists character: fuhua initialStar: s + tags: + - fire-dmg + - weaken + - time-mastery - id: "611" fullName: Azure Empyrea attributeType: psy weapon: fists character: fuhua initialStar: s + tags: + - fire-dmg + - ignite + - time-mastery + - gather - id: "612" fullName: Herrscher of Sentience attributeType: bio weapon: fists character: fuhua initialStar: s + tags: + - physical-dmg + - impair + - time-mastery + - gather + - burst - id: "702" fullName: Phantom Iron attributeType: mech weapon: scythe character: rita initialStar: a + tags: + - lightning-dmg + - paralyze - id: "703" fullName: Umbral Rose attributeType: psy weapon: scythe character: rita initialStar: a + tags: + - physical-dmg + - time-mastery - id: "704" fullName: "Argent Knight: Artemis" attributeType: bio weapon: scythe character: rita initialStar: s + tags: + - ice-dmg + - freeze + - burst - id: "705" fullName: Fallen Rosemary attributeType: qua weapon: scythe character: rita initialStar: s + tags: + - lightning-dmg + - paralyze + - time-mastery + - gather - id: "706" fullName: Spina Astera attributeType: mech weapon: scythe character: rita initialStar: s + tags: + - fire-dmg + - ignite + - time-mastery + - gather - id: "711" fullName: Swallowtail Phantasm attributeType: qua weapon: scythe character: seele initialStar: a + tags: + - physical-dmg + - burst - id: "712" fullName: Stygian Nymph attributeType: qua weapon: scythe character: seele initialStar: s + tags: + - physical-dmg + - heavy-atk + - time-mastery - id: "713" fullName: Starchasm Nyx attributeType: qua weapon: scythe character: seele initialStar: s + tags: + - ice-dmg + - freeze + - time-mastery + - burst - id: "801" fullName: Valkyrie Gloria attributeType: qua weapon: lance character: durandal initialStar: a + tags: + - fire-dmg + - ignite + - time-mastery - id: "802" fullName: "Bright Knight: Excelsis" attributeType: mech weapon: lance character: durandal initialStar: s + tags: + - physical-dmg + - heavy-atk + - time-mastery + - burst - id: "803" fullName: Dea Anchora attributeType: bio weapon: lance character: durandal initialStar: s + tags: + - fire-dmg + - ignite + - time-mastery + - gather - id: "804" fullName: Palatinus Equinox attributeType: img weapon: lance character: durandal initialStar: s + tags: + - physical-dmg + - time-mastery - id: "805" fullName: Durandal attributeType: img weapon: lance character: durandal initialStar: s + tags: [] - id: "901" fullName: Blazing Hope attributeType: bio weapon: lance character: asuka initialStar: a + tags: + - physical-dmg + - time-mastery - id: "1203" fullName: Mei attributeType: none weapon: katana character: apho-mei initialStar: b + tags: [] - id: "1304" fullName: Carole attributeType: none weapon: cannon character: apho-carol initialStar: b + tags: [] - id: "1411" fullName: "{DLC_NICKNAME}" attributeType: none weapon: 2-handed character: apho-adam initialStar: b + tags: [] - id: "2001" fullName: Driving Thunder attributeType: bio weapon: katana character: keqing initialStar: s + tags: [] - id: "2101" fullName: Prinzessin der Verurteilung! attributeType: bio weapon: bow character: fischl initialStar: a + tags: + - lightning-dmg + - fast-atk + - time-mastery + - aerial - id: "2201" fullName: Miss Pink Elf♪ attributeType: psy weapon: bow character: elysia initialStar: s + tags: + - physical-dmg + - fast-atk + - time-mastery + - aerial - id: "2202" fullName: "Herrscher of Human: Ego" attributeType: psy weapon: bow character: elysia initialStar: s + tags: + - ice-dmg + - freeze + - time-mastery + - burst + - gather - id: "2301" fullName: Infinite Ouroboros attributeType: mech weapon: cross character: mobius initialStar: s + tags: + - lightning-dmg + - time-mastery + - aerial - id: "2401" fullName: Midnight Absinthe attributeType: img weapon: bow character: raven initialStar: a + tags: + - fire-dmg + - time-mastery - id: "2501" fullName: Sweet 'n' Spicy attributeType: mech weapon: fists character: apho-carol initialStar: a + tags: + - physical-dmg + - time-mastery + - aerial + - gather + - stun + - heavy-atk - id: "2601" fullName: Reverist Calico attributeType: img weapon: chakram character: pardofelis initialStar: a + tags: + - ice-dmg + - freeze + - time-mastery + - gather - id: "2701" fullName: Disciplinary Perdition attributeType: bio weapon: chakram character: aponia initialStar: s + tags: + - lightning-dmg + - time-mastery + - aerial - id: "2801" fullName: Golden Diva attributeType: img weapon: pistols character: eden initialStar: a + tags: + - lightning-dmg + - time-mastery + - paralyze - id: "2901" fullName: Starry Impression attributeType: psy weapon: cross character: griseo initialStar: a + tags: + - physical-dmg + - bleed + - time-mastery - id: "3001" fullName: Helical Contraption attributeType: qua weapon: cannon character: vill-v initialStar: s + tags: + - fire-dmg + - fast-atk + - burst + - aerial + - time-mastery - id: "3101" fullName: Jade Knight attributeType: psy weapon: fists character: sushang initialStar: s + tags: + - ice-dmg + - fast-atk + - gather - id: "3201" fullName: Chrono Navi attributeType: mech weapon: chakram character: ai initialStar: a + tags: + - fire-dmg + - fast-atk + - gather + - ignite - id: "3301" fullName: Valkyrie Quicksand attributeType: qua weapon: chakram character: susannah initialStar: a + tags: + - physical-dmg + - bleed - id: "3401" fullName: Dreamweaver attributeType: mech weapon: javelin character: hare initialStar: s + tags: + - physical-dmg + - gather + - time-mastery - id: "3501" fullName: Terminal Aide 0017 attributeType: img weapon: fists character: prometheus initialStar: a + tags: + - physical-dmg + - gather + - stun + - time-mastery + - impair - id: "3601" fullName: Sugary Starburst attributeType: mech weapon: pistols character: kira initialStar: a + tags: + - ice-dmg + - freeze + - time-mastery + - aerial - id: "9011" fullName: "{DLC2_NICKNAME}" attributeType: none weapon: pistols character: apho-adam initialStar: b + tags: [] - id: "9021" fullName: Mei attributeType: none weapon: pistols character: apho-mei initialStar: b + tags: [] - id: "9031" fullName: Carole attributeType: none weapon: pistols character: apho-carol initialStar: b + tags: [] - id: "9041" fullName: Bronya attributeType: none weapon: pistols character: apho-bronya initialStar: b + tags: [] - id: "9051" fullName: Timido attributeType: none weapon: pistols character: apho-timido initialStar: b + tags: [] diff --git a/data/ko-KR/battlesuit-catalog.yaml b/data/ko-KR/battlesuit-catalog.yaml index 31987e75..7adffa09 100644 --- a/data/ko-KR/battlesuit-catalog.yaml +++ b/data/ko-KR/battlesuit-catalog.yaml @@ -4,543 +4,919 @@ weapon: pistols character: kiana initialStar: b + tags: + - physical-dmg + - stun + - burst + - time-mastery - id: "102" fullName: 발키리·레인저 attributeType: mech weapon: pistols character: kiana initialStar: a + tags: + - physical-dmg + - gather + - bleed - id: "103" fullName: 백기사·월광 attributeType: bio weapon: pistols character: kiana initialStar: s + tags: + - physical-dmg + - time-mastery + - fast-atk - id: "104" fullName: 성녀의 기도 attributeType: psy weapon: pistols character: kiana initialStar: a + tags: + - physical-dmg + - heal + - impair + - burst + - time-mastery - id: "105" fullName: 신염의 율자 attributeType: psy weapon: pistols character: kiana initialStar: s + tags: + - fire-dmg + - time-mastery + - heal + - gather + - aerial - id: "106" fullName: 종언의 율자 attributeType: img weapon: pistols character: kiana initialStar: s + tags: + - fire-dmg + - aerial + - time-mastery + - ignite - id: "111" fullName: 제6 야상곡 attributeType: psy weapon: pistols character: kallen initialStar: s + tags: + - ice-dmg + - freeze - id: "112" fullName: 성결 예장·금양 attributeType: mech weapon: pistols character: kallen initialStar: a + tags: + - physical-dmg + - stun + - time-mastery - id: "113" fullName: 공간의 율자 attributeType: bio weapon: pistols character: kiana initialStar: s + tags: + - physical-dmg + - time-mastery + - fast-atk + - aerial - id: "114" fullName: 원죄 사냥꾼 attributeType: mech weapon: pistols character: kallen initialStar: a + tags: + - physical-dmg + - impair + - fast-atk - id: "201" fullName: 펄스 슈트·비홍 attributeType: bio weapon: katana character: mei initialStar: b + tags: + - physical-dmg + - bleed + - burst + - time-mastery - id: "202" fullName: 그림자의 춤 attributeType: mech weapon: katana character: mei initialStar: a + tags: + - physical-dmg + - fast-atk - id: "203" fullName: 발키리·스트라이크 attributeType: bio weapon: katana character: mei initialStar: a + tags: + - physical-dmg + - burst + - fast-atk + - time-mastery - id: "204" fullName: 뇌전 여왕의 귀신 갑주 attributeType: psy weapon: katana character: mei initialStar: s + tags: + - lightning-dmg + - paralyze - id: "205" fullName: 번개의 율자 attributeType: psy weapon: katana character: mei initialStar: s + tags: + - lightning-dmg + - paralyze + - fast-atk + - burst + - time-mastery - id: "206" fullName: 기원의 율자 attributeType: img weapon: katana character: mei initialStar: s + tags: + - lightning-dmg + - fast-atk - id: "211" fullName: 역신무녀 attributeType: bio weapon: katana character: sakura initialStar: a + tags: + - physical-dmg + - bleed + - burst - id: "212" fullName: 현신화·물망초 attributeType: mech weapon: katana character: sakura initialStar: s + tags: + - ice-dmg + - freeze - id: "213" fullName: 진염행혼 attributeType: bio weapon: katana character: sakura initialStar: a + tags: + - fire-dmg + - ignite + - time-mastery - id: "214" fullName: 밤 그림자 카스미 attributeType: bio weapon: katana character: sakura initialStar: a + tags: + - lightning-dmg + - paralyze + - time-mastery - id: "301" fullName: 발키리·채리엇 attributeType: psy weapon: cannon character: bronya initialStar: b + tags: + - physical-dmg + - gather + - ignite + - time-mastery - id: "302" fullName: 기동장갑·황매화 attributeType: psy weapon: cannon character: bronya initialStar: a + tags: + - physical-dmg + - impair + - burst + - time-mastery + - heal - id: "303" fullName: 설원 저격수 attributeType: bio weapon: cannon character: bronya initialStar: a + tags: + - physical-dmg + - freeze - id: "304" fullName: 차원 경계 돌파 attributeType: mech weapon: cannon character: bronya initialStar: s + tags: + - physical-dmg + - burst + - paralyze + - bleed + - time-mastery - id: "311" fullName: 은랑의 여명 attributeType: psy weapon: cannon character: bronya initialStar: a + tags: + - physical-dmg + - stun + - weaken + - time-mastery - id: "312" fullName: 이도 흑핵 침식 attributeType: bio weapon: cannon character: bronya initialStar: s + tags: + - physical-dmg + - stun - id: "313" fullName: 이치의 율자 attributeType: mech weapon: cannon character: bronya initialStar: s + tags: + - ice-dmg + - freeze + - burst + - time-mastery - id: "314" fullName: 핵서 버니 attributeType: psy weapon: cannon character: bronya initialStar: a + tags: + - ice-dmg + - time-mastery + - fast-atk - id: "315" fullName: 차생의 은익 attributeType: bio weapon: cannon character: bronya initialStar: s + tags: + - ice-dmg + - fast-atk + - time-mastery + - gather + - aerial - id: "316" fullName: 브로냐 attributeType: bio weapon: cannon character: bronya initialStar: s + tags: [] - id: "317" fullName: 진리의 율자 attributeType: img weapon: cannon character: bronya initialStar: s + tags: + - ice-dmg + - time-mastery + - fast-atk + - gather + - aerial - id: "401" fullName: 발키리·개선 attributeType: bio weapon: 2-handed character: himeko initialStar: a + tags: + - physical-dmg + - heavy-atk + - time-mastery + - stun + - heal - id: "402" fullName: 퓨전 아머·스칼렛 attributeType: mech weapon: 2-handed character: himeko initialStar: a + tags: + - lightning-dmg + - heavy-atk + - burst + - paralyze - id: "403" fullName: 전장의 질풍 attributeType: bio weapon: 2-handed character: himeko initialStar: b + tags: + - physical-dmg + - heavy-atk + - stun + - time-mastery - id: "404" fullName: 핏빛 장미 attributeType: psy weapon: 2-handed character: himeko initialStar: s + tags: + - fire-dmg + - ignite + - heavy-atk + - burst - id: "411" fullName: 극지전인 attributeType: psy weapon: 2-handed character: himeko initialStar: a + tags: + - ice-dmg + - freeze - id: "412" fullName: 진홍의 기사·월식 attributeType: mech weapon: 2-handed character: himeko initialStar: s + tags: + - fire-dmg + - ignite - id: "421" fullName: 블루베리 특공 attributeType: mech weapon: 2-handed character: olenyevas initialStar: a + tags: + - physical-dmg + - freeze - id: "422" fullName: 체리 폭탄 attributeType: psy weapon: 2-handed character: olenyevas initialStar: s + tags: + - physical-dmg + - gather + - time-mastery - id: "501" fullName: 발키리·서약 attributeType: psy weapon: cross character: theresa initialStar: a + tags: + - lightning-dmg + - paralyze + - time-mastery + - fast-atk - id: "502" fullName: 처형복·반혼초 attributeType: mech weapon: cross character: theresa initialStar: s + tags: + - physical-dmg + - bleed + - heavy-atk + - burst + - fast-atk - id: "503" fullName: 앵화윤무 attributeType: psy weapon: cross character: theresa initialStar: a + tags: + - fire-dmg + - ignite + - burst + - fast-atk - id: "504" fullName: 신은송가 attributeType: bio weapon: cross character: theresa initialStar: s + tags: + - physical-dmg + - gather + - impair + - fast-atk - id: "506" fullName: 삭야관성 attributeType: bio weapon: cross character: theresa initialStar: a + tags: + - physical-dmg + - time-mastery + - stun + - gather + - heal - id: "511" fullName: 월하초옹 attributeType: bio weapon: cross character: theresa initialStar: a + tags: + - physical-dmg + - heavy-atk + - bleed + - time-mastery - id: "601" fullName: 발키리·해청 attributeType: psy weapon: fists character: fuhua initialStar: a + tags: + - physical-dmg + - stun + - heal + - time-mastery - id: "602" fullName: 영기사·월륜 attributeType: mech weapon: fists character: fuhua initialStar: s + tags: + - lightning-dmg + - bleed + - burst + - fast-atk + - time-mastery - id: "603" fullName: 백야집사 attributeType: bio weapon: fists character: fuhua initialStar: a + tags: + - physical-dmg + - bleed + - burst + - fast-atk + - time-mastery - id: "604" fullName: 치령 attributeType: psy weapon: fists character: fuhua initialStar: s + tags: + - fire-dmg + - weaken + - time-mastery - id: "611" fullName: 단심의 먹구름 attributeType: psy weapon: fists character: fuhua initialStar: s + tags: + - fire-dmg + - ignite + - time-mastery + - gather - id: "612" fullName: 의식의 율자 attributeType: bio weapon: fists character: fuhua initialStar: s + tags: + - physical-dmg + - impair + - time-mastery + - gather + - burst - id: "702" fullName: 헌트 슈트·팬텀 아이언 attributeType: mech weapon: scythe character: rita initialStar: a + tags: + - lightning-dmg + - paralyze - id: "703" fullName: 검은 장미 attributeType: psy weapon: scythe character: rita initialStar: a + tags: + - physical-dmg + - time-mastery - id: "704" fullName: 창기사·월혼 attributeType: bio weapon: scythe character: rita initialStar: s + tags: + - ice-dmg + - freeze + - burst - id: "705" fullName: 로스트 로즈마리 attributeType: qua weapon: scythe character: rita initialStar: s + tags: + - lightning-dmg + - paralyze + - time-mastery + - gather - id: "706" fullName: 성극요란 attributeType: mech weapon: scythe character: rita initialStar: s + tags: + - fire-dmg + - ignite + - time-mastery + - gather - id: "711" fullName: 환해의 꿈나비 attributeType: qua weapon: scythe character: seele initialStar: a + tags: + - physical-dmg + - burst - id: "712" fullName: 피안쌍생 attributeType: qua weapon: scythe character: seele initialStar: s + tags: + - physical-dmg + - heavy-atk + - time-mastery - id: "713" fullName: 염야성연 attributeType: qua weapon: scythe character: seele initialStar: s + tags: + - ice-dmg + - freeze + - time-mastery + - burst - id: "801" fullName: 발키리·영광 attributeType: qua weapon: lance character: durandal initialStar: a + tags: + - fire-dmg + - ignite + - time-mastery - id: "802" fullName: 성휘의 기사·월백 attributeType: mech weapon: lance character: durandal initialStar: s + tags: + - physical-dmg + - heavy-atk + - time-mastery + - burst - id: "803" fullName: 데아 앵커 attributeType: bio weapon: lance character: durandal initialStar: s + tags: + - fire-dmg + - ignite + - time-mastery + - gather - id: "804" fullName: 천원기사 attributeType: img weapon: lance character: durandal initialStar: s + tags: + - physical-dmg + - time-mastery - id: "805" fullName: 듀란달 attributeType: img weapon: lance character: durandal initialStar: s + tags: [] - id: "901" fullName: 내일을 향한 기도 attributeType: bio weapon: lance character: asuka initialStar: a + tags: + - physical-dmg + - time-mastery - id: "1203" fullName: 메이 attributeType: none weapon: katana character: apho-mei initialStar: b + tags: [] - id: "1304" fullName: 캐롤 attributeType: none weapon: cannon character: apho-carol initialStar: b + tags: [] - id: "1411" fullName: "{DLC_NICKNAME}" attributeType: none weapon: 2-handed character: apho-adam initialStar: b + tags: [] - id: "2001" fullName: 질뢰쾌우 attributeType: bio weapon: katana character: keqing initialStar: s + tags: [] - id: "2101" fullName: 단죄의 황녀!! attributeType: bio weapon: bow character: fischl initialStar: a + tags: + - lightning-dmg + - fast-atk + - time-mastery + - aerial - id: "2201" fullName: 핑크 엘프양♪ attributeType: psy weapon: bow character: elysia initialStar: s + tags: + - physical-dmg + - fast-atk + - time-mastery + - aerial - id: "2202" fullName: 진아·인간의 율자 attributeType: psy weapon: bow character: elysia initialStar: s + tags: + - ice-dmg + - freeze + - time-mastery + - burst + - gather - id: "2301" fullName: 무한·우로보로스 attributeType: mech weapon: cross character: mobius initialStar: s + tags: + - lightning-dmg + - time-mastery + - aerial - id: "2401" fullName: 한밤의 압생트 attributeType: img weapon: bow character: raven initialStar: a + tags: + - fire-dmg + - time-mastery - id: "2501" fullName: 매콤달콤 소녀 attributeType: mech weapon: fists character: apho-carol initialStar: a + tags: + - physical-dmg + - time-mastery + - aerial + - gather + - stun + - heavy-atk - id: "2601" fullName: 환몽·꿈꾸는 고양이 attributeType: img weapon: chakram character: pardofelis initialStar: a + tags: + - ice-dmg + - freeze + - time-mastery + - gather - id: "2701" fullName: 계율·죄의 심연 attributeType: bio weapon: chakram character: aponia initialStar: s + tags: + - lightning-dmg + - time-mastery + - aerial - id: "2801" fullName: 황금·찬란한 노래 attributeType: img weapon: pistols character: eden initialStar: a + tags: + - lightning-dmg + - time-mastery + - paralyze - id: "2901" fullName: 번성·세상을 그리는 별 attributeType: psy weapon: cross character: griseo initialStar: a + tags: + - physical-dmg + - bleed + - time-mastery - id: "3001" fullName: 나선·환상의 상자 attributeType: qua weapon: cannon character: vill-v initialStar: s + tags: + - fire-dmg + - fast-atk + - burst + - aerial + - time-mastery - id: "3101" fullName: 옥기사·월흔 attributeType: psy weapon: fists character: sushang initialStar: s + tags: + - ice-dmg + - fast-atk + - gather - id: "3201" fullName: 시간의 인도자 attributeType: mech weapon: chakram character: ai initialStar: a + tags: + - fire-dmg + - fast-atk + - gather + - ignite - id: "3301" fullName: 발키리·열정의 사막 attributeType: qua weapon: chakram character: susannah initialStar: a + tags: + - physical-dmg + - bleed - id: "3401" fullName: 드림위버 attributeType: mech weapon: javelin character: hare initialStar: s + tags: + - physical-dmg + - gather + - time-mastery - id: "3501" fullName: 터미널 에이드 0017 attributeType: img weapon: fists character: prometheus initialStar: a + tags: + - physical-dmg + - gather + - stun + - time-mastery + - impair - id: "3601" fullName: 슈가스타 attributeType: mech weapon: pistols character: kira initialStar: a + tags: + - ice-dmg + - freeze + - time-mastery + - aerial - id: "9011" fullName: "{DLC2_NICKNAME}" attributeType: none weapon: pistols character: apho-adam initialStar: b + tags: [] - id: "9021" fullName: 메이 attributeType: none weapon: pistols character: apho-mei initialStar: b + tags: [] - id: "9031" fullName: 캐롤 attributeType: none weapon: pistols character: apho-carol initialStar: b + tags: [] - id: "9041" fullName: 브로냐 attributeType: none weapon: pistols character: apho-bronya initialStar: b + tags: [] - id: "9051" fullName: 티미도 attributeType: none weapon: pistols character: apho-timido initialStar: b + tags: [] diff --git a/src/components/atoms/FilterButton.tsx b/src/components/atoms/FilterButton.tsx index 8cc30d96..3610b9bc 100644 --- a/src/components/atoms/FilterButton.tsx +++ b/src/components/atoms/FilterButton.tsx @@ -1,26 +1,17 @@ /** @jsxImportSource theme-ui */ import { useRouter } from 'next/router' -import { Link, Text } from 'theme-ui' -import { assetsBucketBaseUrl } from '../../lib/consts' -import SquareImageBox from './SquareImageBox' +import { ReactNode } from 'react' +import { Link } from 'theme-ui' interface FilterButtonProps { active?: boolean icon?: string - label: string href: string m?: string | number - close?: () => void + children: ReactNode } -const FilterButton = ({ - active = false, - icon, - label, - href, - m, - close, -}: FilterButtonProps) => { +const FilterButton = ({ active = false, children, href, m }: FilterButtonProps) => { const { push } = useRouter() return ( { + variant="buttons.primary" + onClick={event => { event.preventDefault() - if (close != null) { - close() - } push(href, href, { shallow: true }) }} > - {icon != null && ( - - )} - {label} + {children} ) } diff --git a/src/lib/v2/data/text.ts b/src/lib/v2/data/text.ts index 07ac486e..379249a9 100644 --- a/src/lib/v2/data/text.ts +++ b/src/lib/v2/data/text.ts @@ -84,7 +84,89 @@ export function getSkillTypeLabel(type: SkillType) { } } -export function getCharacterTypeLabel(type: CharacterType) { +export function getCharacterTypeLabel(type: CharacterType, locale: string = 'en-US') { + if (locale === 'en-US') { + switch (type) { + case 'kiana': + return 'Kiana' + case 'mei': + return 'Mei' + case 'bronya': + return 'Bronya' + case 'himeko': + return 'Himeko' + case 'theresa': + return 'Theresa' + case 'fuhua': + return 'Fu Hua' + case 'rita': + return 'Rita' + case 'sakura': + return 'Sakura' + case 'kallen': + return 'Kallen' + case 'olenyevas': + return 'Olenyevas' + case 'seele': + return 'Seele' + case 'durandal': + return 'Durandal' + case 'fischl': + return 'Fischl' + case 'elysia': + return 'Elysia' + case 'mobius': + return 'Mobius' + case 'raven': + return 'Raven' + case 'carole': + return 'Carole' + case 'pardofelis': + return 'Pardofelis' + case 'aponia': + return 'Aponia' + case 'eden': + return 'Eden' + case 'griseo': + return 'Griseo' + case 'vill-v': + return 'Vill V' + case 'sushang': + return 'Sushang' + case 'ai': + return 'AI' + case 'susannah': + return 'Susannah' + case 'hare': + return 'Hare' + case 'prometheus': + return 'Prometheus' + case 'kira': + return 'Kira' + case 'asuka': + return 'Asuka' + + // Event Only + case 'keqing': + return 'Keqing' + + // APHO + + case 'apho-mei': + return '후서 메이' + case 'apho-adam': + return '후서 아담' + case 'apho-carol': + return '후서 캐롤' + case 'apho-bronya': + return '후서 브로냐' + case 'apho-timido': + return '후서 티미도' + + default: + return `Unknown Character Type (${type})` + } + } switch (type) { case 'kiana': return '키아나' @@ -167,7 +249,63 @@ export function getCharacterTypeLabel(type: CharacterType) { } } -export function getTagTypeLabel(type: TagType) { +export function getTagTypeLabel(type: TagType, locale: string = 'en-US') { + if (type) { + switch (type) { + case 'branch': + return 'Branch' + case 'charge': + return 'Charge' + case 'physical-dmg': + return 'Physical DMG' + case 'fire-dmg': + return 'Fire DMG' + case 'ice-dmg': + return 'Ice DMG' + case 'lightning-dmg': + return 'Lightning DMG' + case 'freeze': + return 'Freeze' + case 'paralyze': + return 'Paralyze' + case 'stun': + return 'Stun' + case 'ignite': + return 'Ignite' + case 'bleed': + return 'Bleed' + case 'heavy-atk': + return 'Heavy ATK' + case 'weaken': + return 'Weaken' + case 'impair': + return 'Impair' + case 'float': + return 'Float' + case 'slow-down': + return 'Slow Down' + case 'time-mastery': + return 'Time Mastery' + case 'gather': + return 'Gather' + case 'heal': + return 'Heal' + case 'fast-atk': + return 'Fast ATK' + case 'aerial': + return 'Aerial' + case 'burst': + return 'Burst' + case 'shield': + return 'Shield' + case 'meele': + return 'Meele' + case 'ranged': + return 'Ranged' + default: + return `Unknown Tag Type (${type})` + } + } switch (type) { case 'branch': return '분기' @@ -210,11 +348,11 @@ export function getTagTypeLabel(type: TagType) { case 'fast-atk': return '높은 빈도' case 'aerial': - return '버스트' - case 'burst': - return '실드' - case 'shield': return '대공' + case 'burst': + return '버스트' + case 'shield': + return '실드' case 'meele': return '근접' case 'ranged': diff --git a/src/lib/v2/data/types.ts b/src/lib/v2/data/types.ts index 163b58dd..1c61be4f 100644 --- a/src/lib/v2/data/types.ts +++ b/src/lib/v2/data/types.ts @@ -103,7 +103,7 @@ export interface Battlesuit { export type BattlesuitCatalogItem = Pick< Battlesuit, - 'id' | 'fullName' | 'attributeType' | 'weapon' | 'character' | 'initialStar' + 'id' | 'fullName' | 'attributeType' | 'weapon' | 'character' | 'initialStar' | 'tags' > export interface SkillTagItem { diff --git a/src/lib/v2/data/utils.ts b/src/lib/v2/data/utils.ts index ecaad68f..34bb1686 100644 --- a/src/lib/v2/data/utils.ts +++ b/src/lib/v2/data/utils.ts @@ -1,7 +1,61 @@ -import { BattlesuitSkill } from './types' +import { BattlesuitSkill, CharacterType, TagType } from './types' export function sortBattlesuitSkill(a: BattlesuitSkill, b: BattlesuitSkill) { return reversedSkillTypeOrder.indexOf(b.skillType) - reversedSkillTypeOrder.indexOf(a.skillType) } const reversedSkillTypeOrder = ['leader', 'passive', 'evasion', 'special', 'ultimate', 'basic', 'sp', 'none'].reverse() + +export const characterFilterTypes: CharacterType[] = [ + 'kiana', + 'mei', + 'bronya', + 'himeko', + 'theresa', + 'fuhua', + 'rita', + 'sakura', + 'kallen', + 'olenyevas', + 'seele', + 'durandal', + 'fischl', + 'elysia', + 'mobius', + 'raven', + 'carole', + 'pardofelis', + 'aponia', + 'eden', + 'griseo', + 'vill-v', + 'sushang', + 'ai', + 'susannah', + 'hare', + 'prometheus', + 'kira', + 'asuka', + 'keqing' +] + +export const tagFilterTypes: TagType[] = [ + 'physical-dmg', + 'fire-dmg', + 'ice-dmg', + 'lightning-dmg', + 'freeze', + 'paralyze', + 'stun', + 'ignite', + 'bleed', + 'heavy-atk', + 'weaken', + 'impair', + 'time-mastery', + 'gather', + 'heal', + 'fast-atk', + 'aerial', + 'burst' +] diff --git a/src/pages/honkai3rd/battlesuits/index.tsx b/src/pages/honkai3rd/battlesuits/index.tsx index cf31bad1..aa3df967 100644 --- a/src/pages/honkai3rd/battlesuits/index.tsx +++ b/src/pages/honkai3rd/battlesuits/index.tsx @@ -1,15 +1,23 @@ /** @jsxImportSource theme-ui */ -import { Box } from '@theme-ui/components' +import { Box, Heading } from '@theme-ui/components' import { NextPageContext } from 'next' -import { Flex, Link } from 'theme-ui' +import { Flex, Link, Text } from 'theme-ui' import { loadBattlesuitCatalog } from '../../../lib/v2/server/loadData' -import { BattlesuitCatalogItem } from '../../../lib/v2/data/types' +import { BattlesuitCatalogItem, TagType } from '../../../lib/v2/data/types' import BattlesuitCatalogItemCard from '../../../components/v2/BattlesuitCatalogItemCard' import Head from '../../../components/atoms/Head' import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout' import { useTranslation } from 'next-i18next' import Breadcrumb from '../../../components/organisms/Breadcrumb' import { getI18NProps } from '../../../server/i18n' +import FilterButton from '../../../components/atoms/FilterButton' +import { translate } from '../../../lib/i18n' +import { characterFilterTypes } from '../../../lib/v2/data/utils' +import { useRouter } from 'next/router' +import { useMemo } from 'react' +import { getCharacterTypeLabel, getTagTypeLabel } from '../../../lib/v2/data/text' +import ChibiIcon from '../../../components/v2/ChibiIcon' +import TagIcon from '../../../components/v2/TagIcon' interface BattlesuitListPageProps { battlesuitCatalog: BattlesuitCatalogItem[] @@ -17,6 +25,42 @@ interface BattlesuitListPageProps { const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => { const { t } = useTranslation() + const { locale, query } = useRouter() + + const valkyrieFilter = useMemo(() => { + if (query.valkyrie == null) { + return 'all' + } + + return typeof query.valkyrie === 'string' ? query.valkyrie : query.valkyrie[0] + }, [query]) + + const tagFilter = useMemo(() => { + if (query.tag == null) { + return 'all' + } + + return typeof query.tag === 'string' ? query.tag : query.tag[0] + }, [query]) + + const battlesuitsFilteredByValkyrie = useMemo(() => { + return battlesuitCatalog.filter(battlesuit => { + if (valkyrieFilter === 'all') { + return true + } + + return valkyrieFilter === battlesuit.character + }) + }, [battlesuitCatalog, valkyrieFilter]) + + const tagFilterTypes = useMemo(() => { + const tagSet = battlesuitsFilteredByValkyrie.reduce>((set, battlesuit) => { + battlesuit.tags.forEach(tag => set.add(tag)) + return set + }, new Set()) + return [...tagSet] + }, [battlesuitsFilteredByValkyrie]) + return ( { } ]} /> -

{t('battlesuits-list.heading')}

- - {battlesuitCatalog.map(battlesuit => { + + {t('battlesuits-list.heading')} + + {t('battlesuits-list.filter-by-valkyries')} + + {characterFilterTypes.map(type => { + const active = type === valkyrieFilter return ( - - - - - + + + + + {translate(locale, { 'ko-KR': getCharacterTypeLabel(type, 'ko-KR') }, getCharacterTypeLabel(type))} + + + ) })} + + {tagFilterTypes.length > 0 && ( + <> + {t('battlesuits-list.filter-by-features')} + + {tagFilterTypes.map(type => { + const active = type === tagFilter + return ( + + + + + {translate(locale, { 'ko-KR': getTagTypeLabel(type, 'ko-KR') }, getTagTypeLabel(type))} + + + + ) + })} + + + )} + + + {battlesuitsFilteredByValkyrie + .filter(battlesuit => { + if (tagFilter === 'all') { + return true + } + return battlesuit.tags.findIndex(tag => tag === tagFilter) > -1 + }) + .map(battlesuit => { + return ( + + + + + + ) + })} +
) diff --git a/src/scripts/compileRawData.ts b/src/scripts/compileRawData.ts index 3dd8c974..9b107dfb 100644 --- a/src/scripts/compileRawData.ts +++ b/src/scripts/compileRawData.ts @@ -58,7 +58,8 @@ function writeBattlesuitData(locale: string) { attributeType: battlesuit.attributeType, weapon: battlesuit.weapon, character: battlesuit.character, - initialStar: battlesuit.initialStar + initialStar: battlesuit.initialStar, + tags: battlesuit.tags } })