import type { PartyMember } from "./types";

export function isPartyWiped(party: readonly PartyMember[]) {
  return party.length > 0 && party.every((member) => member.hp <= 0);
}

export function areAllNonHealerAlliesDefeated(party: readonly PartyMember[]) {
  let hasAlly = false;
  for (const member of party) {
    if (member.id === "aelia") continue;
    hasAlly = true;
    if (member.hp > 0) return false;
  }
  return hasAlly;
}
