Skip to content

Commit 2194b10

Browse files
authored
Add Nola (#133)
2 parents 69c91b9 + fb0af79 commit 2194b10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+572
-38
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tof-tools",
3-
"version": "3.16.0",
3+
"version": "3.17.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

public/icons/elements/altered.png

-2.74 KB
Binary file not shown.

public/icons/elements/altered.webp

1.21 KB
Binary file not shown.
1.68 KB
Binary file not shown.

public/icons/elements/flame.png

-2.24 KB
Binary file not shown.

public/icons/elements/flame.webp

1.27 KB
Binary file not shown.

public/icons/elements/frost-volt.webp

1.56 KB
Binary file not shown.

public/icons/elements/frost.png

-2.4 KB
Binary file not shown.

public/icons/elements/frost.webp

1.36 KB
Binary file not shown.
1.72 KB
Binary file not shown.

public/icons/elements/physical.png

-2.11 KB
Binary file not shown.

public/icons/elements/physical.webp

1.08 KB
Binary file not shown.

public/icons/elements/volt-frost.webp

1.44 KB
Binary file not shown.

public/icons/elements/volt.png

-1.88 KB
Binary file not shown.

public/icons/elements/volt.webp

1.02 KB
Binary file not shown.

public/icons/matrices/nola.webp

42.2 KB
Binary file not shown.

public/icons/weapons/nola.png

8.02 KB
Loading

src/components/ElementalStyledText/ElementalStyledText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { TypographyProps } from '@mui/material';
22
import { Typography } from '@mui/material';
33

4-
import type { ElementalType } from '../../constants/elemental-type';
4+
import type { WeaponElementalType } from '../../constants/elemental-type';
55
import { pascalCaseToCamelCase } from '../../utils/string-utils';
66

77
export interface ElementalStyledTextProps
88
extends TypographyProps<'span', { component?: 'span' }> {
9-
elementalType: ElementalType;
9+
elementalType: WeaponElementalType;
1010
}
1111

1212
export function ElementalStyledText({
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { ElementalTypeIcon } from './ElementalTypeIcon';
4+
5+
const meta: Meta<typeof ElementalTypeIcon> = {
6+
title: 'Elemental Type Icon',
7+
component: ElementalTypeIcon,
8+
tags: ['autodocs'],
9+
};
10+
11+
export default meta;
12+
type Story = StoryObj<typeof ElementalTypeIcon>;
13+
14+
export const Initial: Story = {
15+
args: {
16+
elementalType: 'Flame-Physical',
17+
width: 30,
18+
height: 30,
19+
},
20+
};

src/components/ElementalTypeIcon/ElementalTypeIcon.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Image from 'next/image';
22

3-
import type { ElementalType } from '../../constants/elemental-type';
4-
import { pascalCaseToCamelCase } from '../../utils/string-utils';
3+
import type { FusionWeaponElementalType } from '../../constants/elemental-type';
4+
import { pascalCaseToKebabCase } from '../../utils/string-utils';
55

66
export interface ElementalTypeIconProps {
7-
elementalType: ElementalType;
7+
elementalType: FusionWeaponElementalType;
88
width?: number;
99
height?: number;
1010
}
@@ -14,8 +14,8 @@ export function ElementalTypeIcon({
1414
width = 24,
1515
height = 22,
1616
}: ElementalTypeIconProps) {
17-
const imageName = pascalCaseToCamelCase(elementalType);
18-
const imagePath = `/icons/elements/${imageName}.png`;
17+
const imageName = pascalCaseToKebabCase(elementalType);
18+
const imagePath = `/icons/elements/${imageName}.webp`;
1919

2020
return (
2121
<Image
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { WeaponIcon } from './WeaponIcon';
4+
5+
const meta: Meta<typeof WeaponIcon> = {
6+
title: 'Weapon Icon',
7+
component: WeaponIcon,
8+
tags: ['autodocs'],
9+
};
10+
11+
export default meta;
12+
type Story = StoryObj<typeof WeaponIcon>;
13+
14+
export const Initial: Story = {
15+
args: {
16+
weaponName: 'Nola',
17+
size: 100,
18+
elementalIcon: 'Flame-Physical',
19+
},
20+
};

src/components/WeaponIcon/WeaponIcon.tsx

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,46 @@ import QuestionMarkIcon from '@mui/icons-material/QuestionMark';
22
import { Box } from '@mui/material';
33
import Image from 'next/image';
44

5+
import type { FusionWeaponElementalType } from '../../constants/elemental-type';
56
import type { WeaponName } from '../../constants/weapons/weapon-definitions';
67
import { normalCaseToKebabCase } from '../../utils/string-utils';
8+
import { ElementalTypeIcon } from '../ElementalTypeIcon/ElementalTypeIcon';
79

810
export interface WeaponIconProps {
911
weaponName: WeaponName | undefined;
1012
size?: number;
13+
/** If defined, will overlay the elemental type icon on top of the weapon icon */
14+
elementalIcon?: FusionWeaponElementalType;
1115
}
1216

13-
export const WeaponIcon = ({ weaponName, size = 100 }: WeaponIconProps) => {
17+
export const WeaponIcon = ({
18+
weaponName,
19+
size = 100,
20+
elementalIcon,
21+
}: WeaponIconProps) => {
1422
if (weaponName) {
1523
const imageName = normalCaseToKebabCase(weaponName);
1624
const imagePath = `/icons/weapons/${imageName}.png`;
1725

1826
return (
19-
<Image
20-
src={imagePath}
21-
alt={weaponName}
22-
title={weaponName}
23-
width={size}
24-
height={size}
25-
></Image>
27+
<Box width={size} height={size} position={'relative'}>
28+
<Image
29+
src={imagePath}
30+
alt={weaponName}
31+
title={weaponName}
32+
width={size}
33+
height={size}
34+
></Image>
35+
{elementalIcon && (
36+
<Box position={'absolute'} right={0} bottom={0}>
37+
<ElementalTypeIcon
38+
elementalType={elementalIcon}
39+
width={size / 4}
40+
height={size / 4}
41+
/>
42+
</Box>
43+
)}
44+
</Box>
2645
);
2746
}
2847
return (

src/constants/changelog.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,11 @@ export const changelog: Changelog = [
223223
date: new Date(Date.UTC(2024, 6, 6)),
224224
title: 'Add Anka',
225225
},
226+
{
227+
semver: '3.17.0',
228+
date: new Date(Date.UTC(2024, 7, 20)),
229+
title: 'Add Nola',
230+
description:
231+
'Since simulacra trait selection has not been added to the gear comparer yet, the calculator assumes you might also equip her trait when using Nola. (Nola trait buffs all ATK for every altered weapon equipped)',
232+
},
226233
];

src/constants/elemental-type.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@ export type CoreElementalType = 'Flame' | 'Frost' | 'Physical' | 'Volt';
22

33
export type WeaponElementalType = CoreElementalType | 'Altered';
44

5-
export type ElementalType = WeaponElementalType | 'None' | 'All';
5+
// TODO: merge this with `WeaponElementalType` above in the future
6+
export type FusionWeaponElementalType =
7+
| WeaponElementalType
8+
| 'Flame-Physical'
9+
| 'Frost-Volt'
10+
| 'Physical-Flame'
11+
| 'Volt-Frost';
12+
13+
export type StatTypeElementalType = WeaponElementalType | 'None' | 'All';

src/constants/matrix-set-definitions.ts

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ import type { WeaponName } from './weapons/weapon-definitions';
99
export const matrixSet2pcLabel = '2pc';
1010
export const matrixSet4pcLabel = '4pc';
1111

12-
export type MatrixSetBaseName = WeaponName | 'Haboela' | 'Scylla';
12+
export type MatrixSetBaseName =
13+
| Exclude<
14+
WeaponName,
15+
| 'Nola (Altered)'
16+
| 'Nola (Flame-Physical)'
17+
| 'Nola (Frost-Volt)'
18+
| 'Nola (Physical-Flame)'
19+
| 'Nola (Volt-Frost)'
20+
>
21+
| 'Haboela'
22+
| 'Scylla';
1323

1424
export const matrixSet2pcOrder: DataAllIds<MatrixSet2pcName> = [
1525
'Alyss 2pc',
@@ -41,6 +51,7 @@ export const matrixSet2pcOrder: DataAllIds<MatrixSet2pcName> = [
4151
'Ming Jing 2pc',
4252
'Nan Yin 2pc',
4353
'Nemesis 2pc',
54+
'Nola 2pc',
4455
'Plotti 2pc',
4556
'Rei 2pc',
4657
'Roslyn 2pc',
@@ -89,6 +100,7 @@ export const matrixSet4pcOrder: DataAllIds<MatrixSet4pcName> = [
89100
'Ming Jing 4pc',
90101
'Nan Yin 4pc',
91102
'Nemesis 4pc',
103+
'Nola 4pc',
92104
'Plotti 4pc',
93105
'Rei 4pc',
94106
'Roslyn 4pc',
@@ -620,6 +632,37 @@ export const matrixSetDefinitionsLookup: DataById<
620632
critDamageBuffs: [],
621633
buffs: [],
622634
},
635+
'Nola 2pc': {
636+
id: 'Nola 2pc',
637+
displayName: 'Nola 2pc',
638+
pieces: 2,
639+
attackPercentBuffs: [
640+
{
641+
description:
642+
"When Nola's weapon is equipped, increase all ATK, works off-hand",
643+
starValues: [
644+
{ star: 0, value: 0.24 },
645+
{ star: 1, value: 0.26 },
646+
{ star: 2, value: 0.28 },
647+
{ star: 3, value: 0.3 },
648+
],
649+
elementalTypes: ['Flame', 'Frost', 'Physical', 'Volt'],
650+
canStack: false,
651+
isActivePassively: true,
652+
weaponRequirements: [
653+
'Nola',
654+
'Nola (Altered)',
655+
'Nola (Flame-Physical)',
656+
'Nola (Frost-Volt)',
657+
'Nola (Physical-Flame)',
658+
'Nola (Volt-Frost)',
659+
],
660+
},
661+
],
662+
critRateBuffs: [],
663+
critDamageBuffs: [],
664+
buffs: [],
665+
},
623666
'Plotti 2pc': {
624667
id: 'Plotti 2pc',
625668
displayName: 'Plotti 2pc',
@@ -868,7 +911,7 @@ export const matrixSetDefinitionsLookup: DataById<
868911
],
869912
canStack: false,
870913
isActivePassively: true,
871-
weaponRequirement: 'Anka',
914+
weaponRequirements: ['Anka'],
872915
},
873916
],
874917
buffs: [],
@@ -1106,7 +1149,7 @@ export const matrixSetDefinitionsLookup: DataById<
11061149
],
11071150
canStack: false,
11081151
isActivePassively: true,
1109-
weaponRequirement: 'Ji Yu',
1152+
weaponRequirements: ['Ji Yu'],
11101153
},
11111154
],
11121155
buffs: [
@@ -1202,7 +1245,7 @@ export const matrixSetDefinitionsLookup: DataById<
12021245
elementalTypes: ['Altered', 'Flame', 'Frost', 'Physical', 'Volt'],
12031246
canStack: false,
12041247
isActivePassively: true,
1205-
weaponRequirement: 'Ling Han',
1248+
weaponRequirements: ['Ling Han'],
12061249
},
12071250
],
12081251
critRateBuffs: [],
@@ -1277,7 +1320,7 @@ export const matrixSetDefinitionsLookup: DataById<
12771320
],
12781321
canStack: false,
12791322
isActivePassively: true,
1280-
weaponRequirement: 'Nan Yin',
1323+
weaponRequirements: ['Nan Yin'],
12811324
},
12821325
],
12831326
buffs: [],
@@ -1291,6 +1334,15 @@ export const matrixSetDefinitionsLookup: DataById<
12911334
critDamageBuffs: [],
12921335
buffs: [],
12931336
},
1337+
'Nola 4pc': {
1338+
id: 'Nola 4pc',
1339+
displayName: 'Nola 4pc',
1340+
pieces: 4,
1341+
attackPercentBuffs: [],
1342+
critRateBuffs: [],
1343+
critDamageBuffs: [],
1344+
buffs: [],
1345+
},
12941346
'Plotti 4pc': {
12951347
id: 'Plotti 4pc',
12961348
displayName: 'Plotti 4pc',
@@ -1317,7 +1369,7 @@ export const matrixSetDefinitionsLookup: DataById<
13171369
elementalTypes: ['Volt', 'Frost'],
13181370
canStack: false,
13191371
isActivePassively: false,
1320-
weaponRequirement: 'Rei',
1372+
weaponRequirements: ['Rei'],
13211373
},
13221374
],
13231375
critRateBuffs: [],

src/constants/simulacrum-traits.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import type { Data } from '../models/data';
22
import type { SimulacrumTrait } from '../models/v4/simulacrum-trait';
33
import type { WeaponName } from './weapons/weapon-definitions';
44

5-
export type SimulacrumName = WeaponName;
5+
export type SimulacrumName = Exclude<
6+
WeaponName,
7+
| 'Nola (Altered)'
8+
| 'Nola (Flame-Physical)'
9+
| 'Nola (Frost-Volt)'
10+
| 'Nola (Physical-Flame)'
11+
| 'Nola (Volt-Frost)'
12+
>;
613

714
export const simulacrumTraits: Data<SimulacrumName, SimulacrumTrait> = {
815
allIds: [
@@ -33,6 +40,7 @@ export const simulacrumTraits: Data<SimulacrumName, SimulacrumTrait> = {
3340
'Ming Jing',
3441
'Nan Yin',
3542
'Nemesis',
43+
'Nola',
3644
'Plotti',
3745
'Rei',
3846
'Roslyn',
@@ -890,6 +898,11 @@ export const simulacrumTraits: Data<SimulacrumName, SimulacrumTrait> = {
890898
displayName: 'Nemesis',
891899
buffs: [],
892900
},
901+
Nola: {
902+
id: 'Nola',
903+
displayName: 'Nola',
904+
buffs: [],
905+
},
893906
Plotti: {
894907
id: 'Plotti',
895908
displayName: 'Plotti',

src/constants/weapons/definitions/alyss.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { WeaponDefinition } from '../../../models/weapon-definition';
33
export const alyss = {
44
id: 'Alyss',
55
displayName: 'Alyss',
6+
elementalIcon: 'Frost',
67
resonanceElements: ['Frost'],
78
calculationElements: ['Frost'],
89
damageElement: 'Frost',

src/constants/weapons/definitions/anka.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { WeaponDefinition } from '../../../models/weapon-definition';
33
export const anka = {
44
id: 'Anka',
55
displayName: 'Anka',
6+
elementalIcon: 'Physical-Flame',
67
resonanceElements: ['Physical', 'Flame'],
78
calculationElements: ['Physical', 'Flame'],
89
damageElement: 'Physical',

src/constants/weapons/definitions/annabella.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { WeaponDefinition } from '../../../models/weapon-definition';
33
export const annabella = {
44
id: 'Annabella',
55
displayName: 'Annabella',
6+
elementalIcon: 'Flame',
67
resonanceElements: ['Flame'],
78
calculationElements: ['Flame'],
89
damageElement: 'Flame',

src/constants/weapons/definitions/asuka.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { WeaponDefinition } from '../../../models/weapon-definition';
33
export const asuka = {
44
id: 'Asuka',
55
displayName: 'Asuka',
6+
elementalIcon: 'Physical-Flame',
67
resonanceElements: ['Physical', 'Flame'],
78
calculationElements: ['Physical', 'Flame'],
89
damageElement: 'Physical',

src/constants/weapons/definitions/brevey.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { minEventDuration } from '../../tick';
1010
export const brevey = {
1111
id: 'Brevey',
1212
displayName: 'Brevey',
13+
elementalIcon: 'Volt-Frost',
1314
resonanceElements: ['Volt', 'Frost'],
1415
calculationElements: ['Volt', 'Frost'],
1516
damageElement: 'Volt',

src/constants/weapons/definitions/claudia.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { WeaponDefinition } from '../../../models/weapon-definition';
33
export const claudia = {
44
id: 'Claudia',
55
displayName: 'Claudia',
6+
elementalIcon: 'Physical',
67
resonanceElements: ['Physical'],
78
calculationElements: ['Physical'],
89
damageElement: 'Physical',

src/constants/weapons/definitions/cobalt-b.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { WeaponDefinition } from '../../../models/weapon-definition';
33
export const cobaltB = {
44
id: 'Cobalt-B',
55
displayName: 'Cobalt-B',
6+
elementalIcon: 'Flame',
67
resonanceElements: ['Flame'],
78
calculationElements: ['Flame'],
89
damageElement: 'Flame',

0 commit comments

Comments
 (0)