Update Healer Man server
This commit is contained in:
1 parent
48a678dcc5
commit
9c5fb4c614
18 files changed
+397
-46
No files matched your search
@@ -2,7 +2,7 @@ import { useEffect, useState } from "react";
|
||||
import { abilityById } from "../game/abilityCatalog";
|
||||
import { PLAYER_AGGRO_ID } from "../game/aggro";
|
||||
import { useCombatStore } from "../game/combatStore";
|
||||
import { formatTimedEffectTimer, timedEffectRemainingMs } from "../game/timedEffectDisplay";
|
||||
import { formatTimedEffectTimer, groupTimedEffectsForDisplay, timedEffectRemainingMs } from "../game/timedEffectDisplay";
|
||||
import { AuraStrip } from "./AuraStrip";
|
||||
import {
|
||||
auraDisplaysInPlayerStatusPanel,
|
||||
@@ -33,19 +33,18 @@ export function PlayerStatusPanel({ now }: { readonly now: number }) {
|
||||
const activeAuras = groupAurasForDisplay(auras.filter((aura) => (
|
||||
auraDisplaysInPlayerStatusPanel(aura, now)
|
||||
)));
|
||||
const activeEffects = effects.filter((effect) => (
|
||||
const activeEffects = groupTimedEffectsForDisplay(effects.filter((effect) => (
|
||||
PLAYER_EFFECT_TARGETS.includes(effect.targetId)
|
||||
&& timedEffectRemainingMs(effect, now) > 0
|
||||
));
|
||||
)), now);
|
||||
const shieldActive = shield > 0 && (shieldExpiresAt <= 0 || shieldExpiresAt > now);
|
||||
const buffCount = activeAuras.filter((aura) => aura.definition.disposition === "buff").length
|
||||
+ activeEffects.filter((effect) => effect.kind === "hot").length
|
||||
+ activeEffects.filter(({ effect }) => effect.kind === "hot").length
|
||||
+ (shieldActive ? 1 : 0);
|
||||
const debuffCount = activeAuras.filter((aura) => aura.definition.disposition === "debuff").length
|
||||
+ activeEffects.filter((effect) => effect.kind === "dot").length;
|
||||
+ activeEffects.filter(({ effect }) => effect.kind === "dot").length;
|
||||
const activeInspectionIds = new Set([
|
||||
...activeAuras.map((aura) => aura.instanceId),
|
||||
...activeEffects.map((effect) => effect.id),
|
||||
...activeEffects.map(({ effect }) => effect.id),
|
||||
...(shieldActive ? ["player-absorb-shield"] : []),
|
||||
]);
|
||||
const inspectedIsActive = inspected ? activeInspectionIds.has(inspected.id) : true;
|
||||
@@ -79,8 +78,9 @@ export function PlayerStatusPanel({ now }: { readonly now: number }) {
|
||||
: {}),
|
||||
} satisfies StatusEffectInspection;
|
||||
}
|
||||
const effect = activeEffects.find((candidate) => candidate.id === inspected.id);
|
||||
if (effect) {
|
||||
const displayedEffect = activeEffects.find(({ effect }) => effect.id === inspected.id);
|
||||
if (displayedEffect) {
|
||||
const { effect, stacks } = displayedEffect;
|
||||
const ability = abilityById(effect.sourceAbilityId);
|
||||
return {
|
||||
...inspected,
|
||||
@@ -88,6 +88,7 @@ export function PlayerStatusPanel({ now }: { readonly now: number }) {
|
||||
disposition: effect.kind === "hot" ? "buff" : "debuff",
|
||||
description: timedEffectDescription(effect.kind, ability?.description),
|
||||
remainingLabel: `${formatTimedEffectTimer(timedEffectRemainingMs(effect, now))} remaining`,
|
||||
stacks,
|
||||
} satisfies StatusEffectInspection;
|
||||
}
|
||||
return inspected;
|
||||
|
||||
Reference in new issue
Block a user