@korial29/tiny-fps 0.177.0 → 0.178.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -341,9 +341,11 @@ var [NECK, HIPS, MIDLINE] = [
341
341
  /**
342
342
  * The ninja's parry (the user, 2026-11-16): with the katana in hand, a ball (not a grenade or an arc)
343
343
  * that comes at him within PARRY_ARC radians of his facing is struck back PARRY of the time (Kit.parry),
344
- * along his look.
344
+ * along his look; PARRY_WIDE of those (the user, 2026-11-16: so the foe in front is not killed too
345
+ * easily) go off to his left or right instead, PARRY_SIDE radians off the look.
345
346
  */
346
347
  var PARRY = .7;
348
+ var PARRY_SIDE = 1.2;
347
349
  var RIFLE_DRIFT = .012;
348
350
  var RULES = {
349
351
  maxPlayers: 16,
@@ -9216,14 +9218,18 @@ var Room = class {
9216
9218
  }
9217
9219
  /**
9218
9220
  * The katana of `p` met the ball `b`: it ends on the blade (its burst, no hit), and one as strong
9219
- * leaves his eye along his look, his own and his team's, its range full again. Its id runs on from
9220
- * his `shots` by 64 plus his parries: the sum only grows, so it names no ball of his still in flight.
9221
+ * leaves his eye along his look, or PARRY_WIDE of the time PARRY_SIDE off it to one side, his own
9222
+ * and his team's, its range full again. Its id runs on from his `shots` by 64 plus his parries: the
9223
+ * sum only grows, so it names no ball of his still in flight.
9221
9224
  */
9222
9225
  deflect(p, b) {
9223
9226
  p.parries = (p.parries ?? 0) + 1 & 255;
9227
+ const r = roll(this.ticks, b.by, b.id, p.info.id, p.parries);
9228
+ const yaw = p.state.yaw + (r < .3 ? r < .3 / 2 ? -PARRY_SIDE : PARRY_SIDE : 0);
9224
9229
  this.shoot(p, this.ticks, {
9225
9230
  ...launch$1({
9226
9231
  ...p.state,
9232
+ yaw,
9227
9233
  rifled: false
9228
9234
  }, p.info.team),
9229
9235
  id: p.state.shots + 64 + p.parries & 255,
@@ -404,10 +404,13 @@ export declare const SHOCK_KNOCK = 4;
404
404
  /**
405
405
  * The ninja's parry (the user, 2026-11-16): with the katana in hand, a ball (not a grenade or an arc)
406
406
  * that comes at him within PARRY_ARC radians of his facing is struck back PARRY of the time (Kit.parry),
407
- * along his look.
407
+ * along his look; PARRY_WIDE of those (the user, 2026-11-16: so the foe in front is not killed too
408
+ * easily) go off to his left or right instead, PARRY_SIDE radians off the look.
408
409
  */
409
410
  export declare const PARRY = 0.7;
410
411
  export declare const PARRY_ARC = 1.2;
412
+ export declare const PARRY_WIDE = 0.3;
413
+ export declare const PARRY_SIDE = 1.2;
411
414
  /**
412
415
  * The saber lock (the user, 2026-11-07, after Jedi Outcast): two foes whose cuts strike within
413
416
  * LOCK_WINDOW ticks (0.15 s) of each other, each in the other's reach and facing him (within
@@ -152,8 +152,9 @@ export declare class Room {
152
152
  private fly;
153
153
  /**
154
154
  * The katana of `p` met the ball `b`: it ends on the blade (its burst, no hit), and one as strong
155
- * leaves his eye along his look, his own and his team's, its range full again. Its id runs on from
156
- * his `shots` by 64 plus his parries: the sum only grows, so it names no ball of his still in flight.
155
+ * leaves his eye along his look, or PARRY_WIDE of the time PARRY_SIDE off it to one side, his own
156
+ * and his team's, its range full again. Its id runs on from his `shots` by 64 plus his parries: the
157
+ * sum only grows, so it names no ball of his still in flight.
157
158
  */
158
159
  private deflect;
159
160
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.177.0",
5
+ "version": "0.178.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"