Release Healer Man 0.1.49
This commit is contained in:
1 parent
39425f2494
commit
612170afd0
91 files changed
+2278
-263
No files matched your search
@@ -20,7 +20,11 @@ import { CharacterModel } from "../avatar/CharacterModel";
|
||||
import { ProceduralAvatar } from "../avatar/ProceduralAvatar";
|
||||
import { useCombatStore } from "../game/combatStore";
|
||||
import { resolvedEquipmentItems } from "../game/heirloomEquipment";
|
||||
import type { CharacterCombatAnimationEvent } from "../game/combatAnimation";
|
||||
import {
|
||||
characterCombatAnimationForPresentation,
|
||||
type CharacterCombatAnimationEvent,
|
||||
} from "../game/combatAnimation";
|
||||
import { subscribeCombatPresentation } from "../game/combatPresentation";
|
||||
import { resolveDungeonAssets, resolveManastormStageAssets } from "../game/dungeonAssets";
|
||||
import { activeManastormStageAssetPackage } from "../game/manastormStageLoader";
|
||||
import { derivePartySpawnSlots } from "../game/partySpawnSlots";
|
||||
@@ -351,7 +355,6 @@ function PartyActors({
|
||||
const movingSignalsRef = useRef(new Map<string, { current: boolean }>());
|
||||
const animationEventSignalsRef = useRef(new Map<string, { current: CharacterCombatAnimationEvent | null }>());
|
||||
const animationRevisionRef = useRef(0);
|
||||
const lastNextActionAtRef = useRef(new Map<string, number>());
|
||||
const lastHealthRef = useRef(new Map<string, number>());
|
||||
const routeRef = useRef<PartyRouteState>(emptyPartyRouteState());
|
||||
const combatRoutesRef = useRef(new Map<string, PartyRouteState>());
|
||||
@@ -476,9 +479,6 @@ function PartyActors({
|
||||
for (const id of animationEventSignalsRef.current.keys()) {
|
||||
if (!activeIds.has(id)) animationEventSignalsRef.current.delete(id);
|
||||
}
|
||||
for (const id of lastNextActionAtRef.current.keys()) {
|
||||
if (!activeIds.has(id)) lastNextActionAtRef.current.delete(id);
|
||||
}
|
||||
for (const id of lastHealthRef.current.keys()) {
|
||||
if (!activeIds.has(id)) lastHealthRef.current.delete(id);
|
||||
}
|
||||
@@ -502,9 +502,6 @@ function PartyActors({
|
||||
const cleanups = members.map((member, index) => {
|
||||
const position = positionsRef.current.get(member.id) ?? initialMemberPosition(index);
|
||||
positionsRef.current.set(member.id, position);
|
||||
if (!lastNextActionAtRef.current.has(member.id)) {
|
||||
lastNextActionAtRef.current.set(member.id, member.nextActionAt);
|
||||
}
|
||||
if (!lastHealthRef.current.has(member.id)) lastHealthRef.current.set(member.id, member.health);
|
||||
actorRefs.current[index]?.position.set(position[0], position[1], position[2]);
|
||||
const runtimeCleanup = registerPartyRuntimePosition(member.id, position);
|
||||
@@ -529,6 +526,23 @@ function PartyActors({
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [memberIdKey]);
|
||||
|
||||
useEffect(() => subscribeCombatPresentation((message) => {
|
||||
if (message.kind === "reset") {
|
||||
for (const signal of animationEventSignalsRef.current.values()) {
|
||||
animationRevisionRef.current += 1;
|
||||
signal.current = { revision: animationRevisionRef.current, kind: "ability-cancel" };
|
||||
}
|
||||
return;
|
||||
}
|
||||
const signal = animationEventSignalsRef.current.get(message.event.sourceActorId);
|
||||
if (!signal) return;
|
||||
const revision = animationRevisionRef.current + 1;
|
||||
const animationEvent = characterCombatAnimationForPresentation(message.event, revision);
|
||||
if (!animationEvent) return;
|
||||
animationRevisionRef.current = revision;
|
||||
signal.current = animationEvent;
|
||||
}), []);
|
||||
|
||||
useEffect(() => {
|
||||
const game = useGameStore.getState();
|
||||
const spawnSlots = derivePartySpawnSlots(game.activeSpawn, members.length + 1);
|
||||
@@ -1061,14 +1075,6 @@ function PartyActors({
|
||||
const actor = actorRefs.current[index];
|
||||
const body = bodyRefs.current[index];
|
||||
const current = positionsRef.current.get(member.id);
|
||||
const previousNextActionAt = lastNextActionAtRef.current.get(member.id)
|
||||
?? member.nextActionAt;
|
||||
if (member.nextActionAt > 0 && member.nextActionAt !== previousNextActionAt) {
|
||||
const signal = animationEventSignalsRef.current.get(member.id);
|
||||
animationRevisionRef.current += 1;
|
||||
if (signal) signal.current = { revision: animationRevisionRef.current, kind: "attack" };
|
||||
}
|
||||
lastNextActionAtRef.current.set(member.id, member.nextActionAt);
|
||||
const previousHealth = lastHealthRef.current.get(member.id) ?? member.health;
|
||||
if (previousHealth > 0 && member.health <= 0) {
|
||||
const signal = animationEventSignalsRef.current.get(member.id);
|
||||
|
||||
Reference in new issue
Block a user