BlueGit

timfa questward

Spellcast shove FX on caster

timfa Tim Falken · pushed by timfa

Authored 2026-09-03 · 2 months ago

Hash
05b5e76e355da83d83fb93c71f0ff5e3069b64b3
1 file changed +11 −0
client/src/render/worldView.js +11 −0
@@ -1923,6 +1923,17 @@ export class WorldView
1923 1923 payload.tileX,
1924 1924 payload.tileY
1925 1925 );
1926 // Spell casts push the caster visually toward the spell's target.
1927 // (Presentation only; server authority remains combat-resolution.)
1928 const caster = payload.casterId != null
1929 ? this.entities.get(payload.casterId)
1930 : null;
1931 if (caster && !caster.dying)
1932 {
1933 const casterPivotX = caster.visualX + (caster.stackOffsetX ?? 0);
1934 const casterPivotY = caster.visualY + (caster.stackOffsetY ?? 0);
1935 this.#applyShoveInDirection(caster, toPivot.x - casterPivotX, toPivot.y - casterPivotY);
1936 }
1926 1937 const sortY = Math.max(fromPivot.y, toPivot.y) + 0.02;
1927 1938 const angle = Math.atan2(toPivot.y - fromPivot.y, toPivot.x - fromPivot.x) * (180 / Math.PI);
1928 1939 const object = new GameObject(0, 0, image, SORT_FX);
@@ -1923,6 +1923,17 @@ export class WorldView
1923 payload.tileX,
1923 payload.tileX,
1924 payload.tileY
1924 payload.tileY
1925 );
1925 );
1926 // Spell casts push the caster visually toward the spell's target.
1927 // (Presentation only; server authority remains combat-resolution.)
1928 const caster = payload.casterId != null
1929 ? this.entities.get(payload.casterId)
1930 : null;
1931 if (caster && !caster.dying)
1932 {
1933 const casterPivotX = caster.visualX + (caster.stackOffsetX ?? 0);
1934 const casterPivotY = caster.visualY + (caster.stackOffsetY ?? 0);
1935 this.#applyShoveInDirection(caster, toPivot.x - casterPivotX, toPivot.y - casterPivotY);
1936 }
1926 const sortY = Math.max(fromPivot.y, toPivot.y) + 0.02;
1937 const sortY = Math.max(fromPivot.y, toPivot.y) + 0.02;
1927 const angle = Math.atan2(toPivot.y - fromPivot.y, toPivot.x - fromPivot.x) * (180 / Math.PI);
1938 const angle = Math.atan2(toPivot.y - fromPivot.y, toPivot.x - fromPivot.x) * (180 / Math.PI);
1928 const object = new GameObject(0, 0, image, SORT_FX);
1939 const object = new GameObject(0, 0, image, SORT_FX);