From 9cb5a0e3cb63cc15e805f9336b562fb3df50bb1f Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 22 Mar 2022 00:09:59 -0700 Subject: [PATCH 1/2] Add changing elements to Class Champion Weapons --- components/WeaponUnit/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/WeaponUnit/index.tsx b/components/WeaponUnit/index.tsx index ad740df8..faecf00f 100644 --- a/components/WeaponUnit/index.tsx +++ b/components/WeaponUnit/index.tsx @@ -76,7 +76,7 @@ const WeaponUnit = (props: Props) => { const weapon = gridWeapon.object return weapon.ax > 0 || - (weapon.series) && [2, 3, 17, 22].includes(weapon.series) + (weapon.series) && [2, 3, 17, 22, 24].includes(weapon.series) } const image = ( From 97420e85e20a7d2db3b150c4522d733bde6f5ed9 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 22 Mar 2022 00:10:08 -0700 Subject: [PATCH 2/2] Add support for Lyria element switching --- components/CharacterResult/index.tsx | 14 ++++++++++++-- components/CharacterUnit/index.tsx | 23 ++++++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/components/CharacterResult/index.tsx b/components/CharacterResult/index.tsx index f2395019..582bdf2c 100644 --- a/components/CharacterResult/index.tsx +++ b/components/CharacterResult/index.tsx @@ -19,9 +19,19 @@ const CharacterResult = (props: Props) => { const character = props.data - return( + const characterUrl = () => { + let url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}chara-grid/${character.granblue_id}_01.jpg` + + if (character.granblue_id === '3030182000') { + url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}chara-grid/${character.granblue_id}_01_01.jpg` + } + + return url + } + + return (
  • - {character.name[locale]} + {character.name[locale]}
    {character.name[locale]}
    { const { t } = useTranslation('common') + const { party, grid } = useSnapshot(appState) + const router = useRouter() const locale = (router.locale && ['en', 'ja'].includes(router.locale)) ? router.locale : 'en' @@ -55,7 +60,19 @@ const CharacterUnit = (props: Props) => { else if (props.gridCharacter.uncap_level > 2) suffix = '02' - imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/chara-main/${character.granblue_id}_${suffix}.jpg` + // Special casing for Lyria (and Young Cat eventually) + if (props.gridCharacter.object.granblue_id === '3030182000') { + let element = 1 + if (grid.weapons.mainWeapon && grid.weapons.mainWeapon.element) { + element = grid.weapons.mainWeapon.element + } else if (party.element != 0) { + element = party.element + } + + suffix = `${suffix}_0${element}` + } + + imgSrc = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}chara-main/${character.granblue_id}_${suffix}.jpg` } setImageUrl(imgSrc)