ตัวละคร
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
characterKey,
weaponKey:
null,
artifactKey:
null,
secondArtifactKey:
null,
constellation: 0,
refinement: 1,
}
: candidate,
),
}
: item,
),
)
}
/>
Damage
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
damage:
event
.target
.value,
}
: candidate,
),
}
: item,
),
)
}
/>
Constellation
{
const constellation = selected[0];
if (constellation)
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
constellation:
Number(
constellation.slice(
1,
),
),
}
: candidate,
),
}
: item,
),
);
}}
>
{[0, 1, 2, 3, 4, 5, 6].map(
(constellation) => (
C{constellation}
),
)}
Weapon
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
weaponKey:
weaponKey ||
null,
}
: candidate,
),
}
: item,
),
)
}
/>
Refinement
{
const refinement = selected[0];
if (refinement)
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
refinement:
Number(
refinement.slice(
1,
),
),
}
: candidate,
),
}
: item,
),
);
}}
>
{[1, 2, 3, 4, 5].map(
(refinement) => (
R{refinement}
),
)}
Artifact set 1
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
artifactKey:
artifactKey ||
null,
}
: candidate,
),
}
: item,
),
)
}
/>
Artifact set 2
setTeams(
teams.map((item, index) =>
index === teamIndex
? {
...item,
members:
item.members.map(
(
candidate,
inner,
) =>
inner ===
memberIndex
? {
...candidate,
secondArtifactKey:
secondArtifactKey ||
null,
}
: candidate,
),
}
: item,
),
)
}
/>