forked from phenom/healer-man
Update class mechanics, stat rulesets, and CoA reference catalogs
This commit is contained in:
1 parent
b16821e92e
commit
39458d5de6
221 files changed
+2584962
-568
No files matched your search
+31
-1
@@ -1,5 +1,10 @@
|
||||
import { PLAYER_AGGRO_ID } from "../game/aggro";
|
||||
import { useCombatStore } from "../game/combatStore";
|
||||
import { useShellStore } from "../app/shellStore";
|
||||
import {
|
||||
isWow335HunterPetFamily,
|
||||
WOW335_HUNTER_PET_FAMILY_CHOICES,
|
||||
} from "../game/wow335HunterPetFamilySelection";
|
||||
|
||||
export function SummonFrames({ now }: { readonly now: number }) {
|
||||
const summons = useCombatStore((state) => state.summons);
|
||||
@@ -8,10 +13,21 @@ export function SummonFrames({ now }: { readonly now: number }) {
|
||||
const selectFriendlyActor = useCombatStore((state) => state.selectFriendlyActor);
|
||||
const commandHunterPet = useCombatStore((state) => state.commandHunterPet);
|
||||
const setHunterPetReactMode = useCombatStore((state) => state.setHunterPetReactMode);
|
||||
const hunterPetFamily = useCombatStore((state) => state.hunterPetFamily);
|
||||
const setHunterPetFamily = useCombatStore((state) => state.setHunterPetFamily);
|
||||
const mobs = useCombatStore((state) => state.mobs);
|
||||
const setHunterPetGrowlAutocast = useCombatStore((state) => state.setHunterPetGrowlAutocast);
|
||||
const hunterPetFamilyLocked = Object.values(mobs).some((mob) => mob.engaged && !mob.dead && !mob.despawned);
|
||||
const hasPlayerHunterPet = summons.some((summon) => summon.hunterPet && summon.ownerActorId === PLAYER_AGGRO_ID);
|
||||
const chooseHunterPetFamily = (value: unknown) => {
|
||||
if (!isWow335HunterPetFamily(value)) return;
|
||||
const previousFamily = hunterPetFamily;
|
||||
if (!setHunterPetFamily(value)) return;
|
||||
if (!useShellStore.getState().saveActiveHunterPetFamily(value)) setHunterPetFamily(previousFamily);
|
||||
};
|
||||
if (!summons.length) return null;
|
||||
return (
|
||||
<section className="summon-frames" aria-label="Pets, totems, and summons">
|
||||
<section className={`summon-frames${hasPlayerHunterPet ? " summon-frames--player-hunter-pet" : ""}`} aria-label="Pets, totems, and summons">
|
||||
{summons.map((summon) => {
|
||||
const healthPercent = summon.maxHealth > 0 ? Math.max(0, Math.min(100, summon.health / summon.maxHealth * 100)) : 0;
|
||||
const remaining = summon.expiresAt >= Number.MAX_SAFE_INTEGER
|
||||
@@ -48,6 +64,20 @@ export function SummonFrames({ now }: { readonly now: number }) {
|
||||
>{petCommand}</button>
|
||||
))}
|
||||
</div>
|
||||
<label className="hunter-pet-controls__react">
|
||||
<span>Family</span>
|
||||
<select
|
||||
aria-label="Pet family"
|
||||
value={hunterPetFamily}
|
||||
disabled={hunterPetFamilyLocked}
|
||||
title={hunterPetFamilyLocked ? "End the current encounter before changing pet family." : undefined}
|
||||
onChange={(event) => chooseHunterPetFamily(event.currentTarget.value)}
|
||||
>
|
||||
{WOW335_HUNTER_PET_FAMILY_CHOICES.map((family) => (
|
||||
<option key={family.id} value={family.id}>{family.name}</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<label className="hunter-pet-controls__react">
|
||||
<span>React</span>
|
||||
<select
|
||||
|
||||
Reference in new issue
Block a user