Update Healer Man server
This commit is contained in:
1 parent
39458d5de6
commit
6cc1b9217f
203 files changed
+133929
-31271
No files matched your search
@@ -4,9 +4,33 @@ export type MutablePartyWorldPosition = [x: number, y: number, z: number];
|
||||
const positions = new Map<string, MutablePartyWorldPosition>();
|
||||
const targetVisibility = new Map<string, { targetId: string | null; visible: boolean }>();
|
||||
const rejoins = new Map<string, { position: PartyWorldPosition; pending: boolean }>();
|
||||
const combatRelocations = new Map<string, { position: PartyWorldPosition; yaw: number }>();
|
||||
|
||||
/** One-shot movement authored by combat, without an attached return-to-player task. */
|
||||
export function requestPartyRuntimeCombatRelocation(
|
||||
id: string,
|
||||
position: PartyWorldPosition,
|
||||
yaw: number,
|
||||
): void {
|
||||
const destination: PartyWorldPosition = [finite(position[0]), finite(position[1]), finite(position[2])];
|
||||
const facing = finite(yaw);
|
||||
combatRelocations.set(id, { position: destination, yaw: facing });
|
||||
updatePartyRuntimePosition(id, destination[0], destination[1], destination[2]);
|
||||
}
|
||||
|
||||
/** Returns and clears a pending combat relocation so the scene applies it once. */
|
||||
export function consumePartyRuntimeCombatRelocation(
|
||||
id: string,
|
||||
): { readonly position: PartyWorldPosition; readonly yaw: number } | null {
|
||||
const relocation = combatRelocations.get(id);
|
||||
if (!relocation) return null;
|
||||
combatRelocations.delete(id);
|
||||
return { position: [...relocation.position], yaw: relocation.yaw };
|
||||
}
|
||||
|
||||
/** A one-shot scene relocation followed by an individual return-to-player task. */
|
||||
export function beginPartyRuntimeRejoin(id: string, position: PartyWorldPosition): void {
|
||||
combatRelocations.delete(id);
|
||||
rejoins.set(id, { position: [...position], pending: true });
|
||||
updatePartyRuntimePosition(id, position[0], position[1], position[2]);
|
||||
targetVisibility.delete(id);
|
||||
@@ -45,6 +69,7 @@ export function registerPartyRuntimePosition(
|
||||
positions.delete(id);
|
||||
targetVisibility.delete(id);
|
||||
rejoins.delete(id);
|
||||
combatRelocations.delete(id);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -136,6 +161,7 @@ export function removePartyRuntimePosition(id: string): void {
|
||||
positions.delete(id);
|
||||
targetVisibility.delete(id);
|
||||
rejoins.delete(id);
|
||||
combatRelocations.delete(id);
|
||||
}
|
||||
|
||||
export function getPartyRuntimePosition(id: string): PartyWorldPosition | null {
|
||||
@@ -192,5 +218,6 @@ export function clearPartyRuntimeRegistry(): void {
|
||||
positions.clear();
|
||||
targetVisibility.clear();
|
||||
rejoins.clear();
|
||||
combatRelocations.clear();
|
||||
attackCorridor = null;
|
||||
}
|
||||
Reference in new issue
Block a user