)
}
}
function telumaImage(index: number) {
const baseUrl = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-keys/`
// If there is a grid weapon, it is a Draconic Weapon and it has keys
if (
gridWeapon &&
(gridWeapon.object.series === 3 || gridWeapon.object.series == 34) &&
gridWeapon.weapon_keys
) {
const weaponKey = gridWeapon.weapon_keys[index]
const altText = weaponKey.name[locale]
let filename = `${weaponKey.slug}`
if (
index === 1 ||
(index === 2 && parseInt(weaponKey.granblue_id) === 15008)
) {
filename += `-${gridWeapon.object.element}`
}
return (
)
}
}
function telumaImages() {
let images: JSX.Element[] = []
if (
gridWeapon &&
(gridWeapon.object.series === 3 || gridWeapon.object.series === 34) &&
gridWeapon.weapon_keys &&
gridWeapon.weapon_keys.length > 0
) {
for (let i = 0; i < gridWeapon.weapon_keys.length; i++) {
const image = telumaImage(i)
if (image) images.push(image)
}
}
return images
}
function ultimaImage(index: number) {
const baseUrl = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-keys/`
// If there is a grid weapon, it is a Dark Opus Weapon and it has keys
if (
gridWeapon &&
gridWeapon.object.series === 17 &&
gridWeapon.weapon_keys
) {
const weaponKey = gridWeapon.weapon_keys[index]
const altText = weaponKey.name[locale]
let filename = weaponKey.slug
if (weaponKey.slot === 0) {
filename += `-${gridWeapon.object.proficiency}`
}
return (
)
}
}
function ultimaImages() {
let images: JSX.Element[] = []
if (
gridWeapon &&
gridWeapon.object.series === 17 &&
gridWeapon.weapon_keys &&
gridWeapon.weapon_keys.length > 0
) {
for (let i = 0; i < gridWeapon.weapon_keys.length; i++) {
const image = ultimaImage(i)
if (image) images.push(image)
}
}
return images
}
function opusImage(index: number) {
const baseUrl = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-keys/`
// If there is a grid weapon, it is a Dark Opus Weapon and it has keys
if (
gridWeapon &&
gridWeapon.object.series === 2 &&
gridWeapon.weapon_keys
) {
const weaponKey = gridWeapon.weapon_keys[index]
const altText = weaponKey.name[locale]
let filename = weaponKey.slug
if (weaponKey.slot === 1) {
const element = gridWeapon.object.element
const mod = gridWeapon.object.name.en.includes('Repudiation')
? 'primal'
: 'magna'
const suffixes = [
'pendulum-strength',
'pendulum-zeal',
'pendulum-strife',
'chain-temperament',
'chain-restoration',
'chain-glorification',
]
if (suffixes.includes(weaponKey.slug)) {
filename += `-${mod}-${element}`
}
}
return (
)
}
}
function opusImages() {
let images: JSX.Element[] = []
if (
gridWeapon &&
gridWeapon.object.series === 2 &&
gridWeapon.weapon_keys &&
gridWeapon.weapon_keys.length > 0
) {
for (let i = 0; i < gridWeapon.weapon_keys.length; i++) {
const image = opusImage(i)
if (image) images.push(image)
}
}
return images
}
function axImage(index: number) {
const axSkill = getCanonicalAxSkill(index)
if (
gridWeapon &&
gridWeapon.object.ax &&
gridWeapon.object.ax_type > 0 &&
gridWeapon.ax &&
axSkill
) {
const altText = `${axSkill.name[locale]} Lv${gridWeapon.ax[index].strength}`
return (
)
}
}
function axImages() {
let images: JSX.Element[] = []
if (
gridWeapon &&
gridWeapon.object.ax &&
gridWeapon.ax &&
gridWeapon.ax.length > 0
) {
const numSkills = gridWeapon.ax[1].modifier ? 2 : 1
for (let i = 0; i < numSkills; i++) {
const image = axImage(i)
if (image) images.push(image)
}
}
return images
}
// Methods: Layer element rendering
const weaponModal = () => {
if (gridWeapon) {
return (