feat: add weapon series utility and i18n messages
This commit is contained in:
parent
8b078cdfd8
commit
5e77bb3093
3 changed files with 156 additions and 2 deletions
|
|
@ -24,5 +24,44 @@
|
|||
|
||||
"context_view_details": "View Details",
|
||||
"context_replace": "Replace",
|
||||
"context_remove": "Remove"
|
||||
"context_remove": "Remove",
|
||||
|
||||
"conflict_title": "Conflict Detected",
|
||||
"conflict_character_message": "Only one version of a character can be included in each party. Do you want to replace them?",
|
||||
"conflict_weapon_series": "Only one weapon from the {series} Series can be included in each party. Do you want to replace it?",
|
||||
"conflict_weapon_opus_draconic": "Only one Dark Opus or Draconic Weapon can be included in each party. Do you want to replace it?",
|
||||
"conflict_confirm": "Replace",
|
||||
"conflict_cancel": "Cancel",
|
||||
|
||||
"series_seraphic": "Seraphic",
|
||||
"series_grand": "Grand",
|
||||
"series_opus": "Dark Opus",
|
||||
"series_draconic": "Draconic",
|
||||
"series_revenant": "Revenant",
|
||||
"series_primal": "Primal",
|
||||
"series_beast": "Beast",
|
||||
"series_regalia": "Regalia",
|
||||
"series_omega": "Omega",
|
||||
"series_olden_primal": "Olden Primal",
|
||||
"series_militis": "Militis",
|
||||
"series_hollowsky": "Hollowsky",
|
||||
"series_xeno": "Xeno",
|
||||
"series_astral": "Astral",
|
||||
"series_rose": "Rose",
|
||||
"series_bahamut": "Bahamut",
|
||||
"series_ultima": "Ultima",
|
||||
"series_epic": "Epic",
|
||||
"series_ennead": "Ennead",
|
||||
"series_cosmic": "Cosmic",
|
||||
"series_ancestral": "Ancestral",
|
||||
"series_superlative": "Superlative",
|
||||
"series_vintage": "Vintage",
|
||||
"series_class_champion": "Class Champion",
|
||||
"series_proving": "Proving Grounds",
|
||||
"series_sephira": "Sephira",
|
||||
"series_new_world": "New World",
|
||||
"series_disaster": "Disaster",
|
||||
"series_illustrious": "Illustrious",
|
||||
"series_world": "World",
|
||||
"series_draconic_providence": "Draconic Providence"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,44 @@
|
|||
|
||||
"context_view_details": "詳細を見る",
|
||||
"context_replace": "交換",
|
||||
"context_remove": "削除"
|
||||
"context_remove": "削除",
|
||||
|
||||
"conflict_title": "コンフリクト検出",
|
||||
"conflict_character_message": "同じ名前のキャラクターがパーティに編成されています。以下のキャラクターを入れ替えますか?",
|
||||
"conflict_weapon_series": "{series}シリーズの武器は1本しか装備できません。以下の武器を入れ替えますか?",
|
||||
"conflict_weapon_opus_draconic": "終末の神器シリーズとドラコニックシリーズから1本しか装備できません。以下の武器を入れ替えますか?",
|
||||
"conflict_confirm": "入れ替える",
|
||||
"conflict_cancel": "キャンセル",
|
||||
|
||||
"series_seraphic": "セラフィック",
|
||||
"series_grand": "リミテッド",
|
||||
"series_opus": "終末の神器",
|
||||
"series_draconic": "ドラゴニック",
|
||||
"series_revenant": "天星器",
|
||||
"series_primal": "マグナ",
|
||||
"series_beast": "四象",
|
||||
"series_regalia": "レガリア",
|
||||
"series_omega": "オメガ",
|
||||
"series_olden_primal": "オールド・プライマル",
|
||||
"series_militis": "ミリティス",
|
||||
"series_hollowsky": "虚空",
|
||||
"series_xeno": "ゼノ",
|
||||
"series_astral": "アストラル",
|
||||
"series_rose": "ローズ",
|
||||
"series_bahamut": "バハムート",
|
||||
"series_ultima": "アルティメット",
|
||||
"series_epic": "エピック",
|
||||
"series_ennead": "エニアド",
|
||||
"series_cosmic": "コスミック",
|
||||
"series_ancestral": "六道",
|
||||
"series_superlative": "スペリオル",
|
||||
"series_vintage": "ヴィンテージ",
|
||||
"series_class_champion": "クラス・チャンピオン",
|
||||
"series_proving": "プロヴィングラウンド",
|
||||
"series_sephira": "セフィラ",
|
||||
"series_new_world": "ニューワールド",
|
||||
"series_disaster": "ディザスター",
|
||||
"series_illustrious": "イラストリアス",
|
||||
"series_world": "ワールド",
|
||||
"series_draconic_providence": "ドラコニック・プロヴィデンス"
|
||||
}
|
||||
|
|
|
|||
76
src/lib/utils/weaponSeries.ts
Normal file
76
src/lib/utils/weaponSeries.ts
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* Weapon Series Utilities
|
||||
*
|
||||
* Provides helpers for weapon series identification and conflict messaging.
|
||||
*
|
||||
* @module utils/weaponSeries
|
||||
*/
|
||||
|
||||
export interface WeaponSeries {
|
||||
id: number
|
||||
slug: string
|
||||
}
|
||||
|
||||
/**
|
||||
* All weapon series with their IDs and slugs.
|
||||
* The slug is used for i18n message keys.
|
||||
*/
|
||||
export const weaponSeries: WeaponSeries[] = [
|
||||
{ id: 0, slug: 'seraphic' },
|
||||
{ id: 1, slug: 'grand' },
|
||||
{ id: 2, slug: 'opus' },
|
||||
{ id: 3, slug: 'draconic' },
|
||||
{ id: 4, slug: 'revenant' },
|
||||
{ id: 6, slug: 'primal' },
|
||||
{ id: 7, slug: 'beast' },
|
||||
{ id: 8, slug: 'regalia' },
|
||||
{ id: 9, slug: 'omega' },
|
||||
{ id: 10, slug: 'olden_primal' },
|
||||
{ id: 11, slug: 'militis' },
|
||||
{ id: 12, slug: 'hollowsky' },
|
||||
{ id: 13, slug: 'xeno' },
|
||||
{ id: 14, slug: 'astral' },
|
||||
{ id: 15, slug: 'rose' },
|
||||
{ id: 16, slug: 'bahamut' },
|
||||
{ id: 17, slug: 'ultima' },
|
||||
{ id: 18, slug: 'epic' },
|
||||
{ id: 19, slug: 'ennead' },
|
||||
{ id: 20, slug: 'cosmic' },
|
||||
{ id: 21, slug: 'ancestral' },
|
||||
{ id: 22, slug: 'superlative' },
|
||||
{ id: 23, slug: 'vintage' },
|
||||
{ id: 24, slug: 'class_champion' },
|
||||
{ id: 25, slug: 'proving' },
|
||||
{ id: 28, slug: 'sephira' },
|
||||
{ id: 29, slug: 'new_world' },
|
||||
{ id: 30, slug: 'disaster' },
|
||||
{ id: 31, slug: 'illustrious' },
|
||||
{ id: 32, slug: 'world' },
|
||||
{ id: 34, slug: 'draconic_providence' }
|
||||
]
|
||||
|
||||
/**
|
||||
* Series IDs that share the Opus/Draconic conflict rule.
|
||||
* Only one weapon from these series can be in a party at a time.
|
||||
*/
|
||||
export const OPUS_DRACONIC_SERIES = [2, 3, 34]
|
||||
|
||||
/**
|
||||
* Get the slug for a weapon series by ID.
|
||||
*
|
||||
* @param id - The series ID
|
||||
* @returns The series slug or undefined if not found
|
||||
*/
|
||||
export function getWeaponSeriesSlug(id: number): string | undefined {
|
||||
return weaponSeries.find((s) => s.id === id)?.slug
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a series ID belongs to the Opus/Draconic conflict group.
|
||||
*
|
||||
* @param seriesId - The series ID to check
|
||||
* @returns True if the series is Opus, Draconic, or Draconic Providence
|
||||
*/
|
||||
export function isOpusDraconicSeries(seriesId: number): boolean {
|
||||
return OPUS_DRACONIC_SERIES.includes(seriesId)
|
||||
}
|
||||
Loading…
Reference in a new issue