forked from phenom/healer-man
Honor RoM off-hand and ranged equipment slots
This commit is contained in:
1 parent
0206fda9e2
commit
7449abdad2
15 files changed
+150
-29
No files matched your search
@@ -30,6 +30,7 @@ function itemType(inventorySlot: string): string {
|
||||
export function BossLootWindow() {
|
||||
const reward = useCombatStore((state) => state.bossLootRewards[0] ?? null);
|
||||
const classId = useCombatStore((state) => state.classId);
|
||||
const secondaryClassId = useCombatStore((state) => state.secondaryClassId);
|
||||
const specializationId = useCombatStore((state) => state.specializationId);
|
||||
const role = useCombatStore((state) => state.gearRole);
|
||||
const level = useCombatStore((state) => state.level);
|
||||
@@ -52,6 +53,7 @@ export function BossLootWindow() {
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player" as const,
|
||||
classId,
|
||||
secondaryClassId,
|
||||
specializationId,
|
||||
role,
|
||||
level,
|
||||
@@ -88,7 +90,7 @@ export function BossLootWindow() {
|
||||
<b aria-hidden="true">◆</b><p><strong>{BOSS_CARD_RARITY_INFO[rarity].label} Boss Card</strong><small>{reward.bossName} · Collection log</small></p><em>+1</em>
|
||||
</article>)}
|
||||
{reward.items.map((item) => {
|
||||
const comparison = classCanEquipItem(classId, item)
|
||||
const comparison = classCanEquipItem(classId, item, { secondaryClassId, level })
|
||||
? compareEquipmentUpgrade(item, loadout, profile, heirloomContext)
|
||||
: null;
|
||||
return <article
|
||||
|
||||
@@ -53,6 +53,7 @@ interface EquipmentOwner {
|
||||
readonly name: string;
|
||||
readonly detail: string;
|
||||
readonly classId: ClassId;
|
||||
readonly secondaryClassId?: ClassId | null;
|
||||
readonly specializationId: string | null;
|
||||
readonly role: PartyRole;
|
||||
readonly level: number;
|
||||
@@ -189,6 +190,7 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
const inventory = useCombatStore((state) => state.inventory);
|
||||
const equipment = useCombatStore((state) => state.equipment);
|
||||
const playerClassId = useCombatStore((state) => state.classId);
|
||||
const playerSecondaryClassId = useCombatStore((state) => state.secondaryClassId);
|
||||
const playerLevel = useCombatStore((state) => state.level);
|
||||
const playerMaxHealth = useCombatStore((state) => state.maxHealth);
|
||||
const playerGearStats = useCombatStore((state) => state.gearStats);
|
||||
@@ -204,6 +206,7 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
name: character?.name ?? "You",
|
||||
detail: "Player",
|
||||
classId: playerClassId,
|
||||
secondaryClassId: playerSecondaryClassId,
|
||||
specializationId: playerSpecializationId,
|
||||
role: playerGearRole,
|
||||
level: playerLevel,
|
||||
@@ -214,12 +217,13 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
name: member.name,
|
||||
detail: `${member.specialization} · ${member.role === "damage" ? "DPS" : member.role}`,
|
||||
classId: member.classId,
|
||||
secondaryClassId: member.secondaryClassId,
|
||||
specializationId: member.specializationId,
|
||||
role: member.role,
|
||||
level: member.level,
|
||||
ownerKind: "party" as const,
|
||||
})),
|
||||
], [character?.name, members, playerClassId, playerGearRole, playerLevel, playerSpecializationId]);
|
||||
], [character?.name, members, playerClassId, playerSecondaryClassId, playerGearRole, playerLevel, playerSpecializationId]);
|
||||
const [ownerId, setOwnerId] = useState(PLAYER_EQUIPMENT_OWNER_ID);
|
||||
const [inspectedId, setInspectedId] = useState(() => inventory.at(-1)?.instanceId ?? "");
|
||||
const [statPage, setStatPage] = useState<StatPage>("attributes");
|
||||
@@ -240,13 +244,14 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
ownerId: owner.id,
|
||||
ownerKind: owner.ownerKind,
|
||||
classId: owner.classId,
|
||||
secondaryClassId: owner.secondaryClassId,
|
||||
specializationId: owner.specializationId,
|
||||
role: owner.role,
|
||||
level: owner.level,
|
||||
};
|
||||
const loadout = useMemo(
|
||||
() => resolvedEquipmentLoadout(equipment, inventory, heirloomContext),
|
||||
[equipment, inventory, owner.classId, owner.id, owner.level, owner.ownerKind, owner.role, owner.specializationId],
|
||||
[equipment, inventory, owner.classId, owner.secondaryClassId, owner.id, owner.level, owner.ownerKind, owner.role, owner.specializationId],
|
||||
);
|
||||
const earnedLoadout = equipment[owner.id] ?? {};
|
||||
const sortedInventory = useMemo(() => [...inventory].sort((left, right) => (
|
||||
@@ -285,7 +290,7 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
|
||||
const inspectedOwnerId = inspected ? equippedOwnerId(equipment, inspected.instanceId) : null;
|
||||
const inspectedOwner = inspectedOwnerId ? ownerById.get(inspectedOwnerId) : null;
|
||||
const compatible = inspected ? classCanEquipItem(owner.classId, inspected) : false;
|
||||
const compatible = inspected ? classCanEquipItem(owner.classId, inspected, owner) : false;
|
||||
const gearLevel = resolvedAverageItemLevel(equipment, inventory, heirloomContext);
|
||||
const gearProfile = gearProfileFor(owner.classId, owner.specializationId, owner.role);
|
||||
const inspectedComparison = inspected && compatible
|
||||
@@ -345,6 +350,7 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
ownerId: candidate.id,
|
||||
ownerKind: candidate.ownerKind,
|
||||
classId: candidate.classId,
|
||||
secondaryClassId: candidate.secondaryClassId,
|
||||
specializationId: candidate.specializationId,
|
||||
role: candidate.role,
|
||||
level: candidate.level,
|
||||
@@ -415,7 +421,7 @@ function EquipmentDialog({ readOnly = false }: { readOnly?: boolean }) {
|
||||
{sortedInventory.map((item) => {
|
||||
const assignedId = equippedOwnerId(equipment, item.instanceId);
|
||||
const assignedOwner = assignedId ? ownerById.get(assignedId) : null;
|
||||
const canEquip = classCanEquipItem(owner.classId, item);
|
||||
const canEquip = classCanEquipItem(owner.classId, item, owner);
|
||||
const comparison = canEquip ? compareEquipmentUpgrade(item, loadout, gearProfile, heirloomContext) : null;
|
||||
return (
|
||||
<ControllerButton
|
||||
|
||||
Reference in new issue
Block a user