The facing ribbon rides the mount
While the pane possesses a creature, the keymap's golden ribbon moves to the mount's token — same shallow triangle, sized to the smaller body, turning with the borrowed eyes — and leaves the wizard's brow until the rider returns. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
This commit is contained in:
co-authored by
Claude Fable 5
parent
714c5bef80
commit
e499df22d7
@@ -17,7 +17,7 @@
|
||||
import { untrack } from "svelte";
|
||||
import type { GameEvent, GameView, Side } from "@wizwar/engine";
|
||||
|
||||
let { view, batch, onhide, onstride = null, canStride = false, ontarget = null, onfacing = null, litCells = null, onpickup = null, onCreatureMove = null, onCreatureAttack = null }: {
|
||||
let { view, batch, onhide, onstride = null, canStride = false, ontarget = null, onfacing = null, litCells = null, onpickup = null, onCreatureMove = null, onCreatureAttack = null, onbody = null }: {
|
||||
view: GameView;
|
||||
/** The latest live event batch, numbered so each plays once, with
|
||||
* the view the server sent alongside it. */
|
||||
@@ -40,6 +40,9 @@
|
||||
/** Possession: ride a creature's eyes and drive it from the pane. */
|
||||
onCreatureMove?: ((creatureId: string, side: Side) => void) | null;
|
||||
onCreatureAttack?: ((creatureId: string, targetId: string) => void) | null;
|
||||
/** Reports which creature (if any) the pane is riding, so the keymap
|
||||
* can move the facing ribbon to the mount's token. */
|
||||
onbody?: ((creatureId: string | null) => void) | null;
|
||||
} = $props();
|
||||
|
||||
const povId = $derived(view.you);
|
||||
@@ -363,6 +366,7 @@
|
||||
raf = requestAnimationFrame(tick);
|
||||
return () => cancelAnimationFrame(raf);
|
||||
});
|
||||
$effect(() => { onbody?.(possessedId); });
|
||||
let lastQuad = -99;
|
||||
$effect(() => {
|
||||
const q = ((Math.round(cam.facing / (Math.PI / 2)) % 4) + 4) % 4;
|
||||
|
||||
Reference in New Issue
Block a user