8 lines
258 B
TypeScript
8 lines
258 B
TypeScript
export default function getElementForParty(party: Party) {
|
|
const mainhand = party.weapons.find((weapon) => weapon.mainhand)
|
|
if (mainhand && mainhand.object.element === 0) {
|
|
return mainhand.element
|
|
} else {
|
|
return mainhand?.object.element
|
|
}
|
|
}
|