volleyballsimtypes 0.0.413 → 0.0.415

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.
@@ -4,15 +4,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const dayjs_1 = __importDefault(require("dayjs"));
7
+ const utc_1 = __importDefault(require("dayjs/plugin/utc"));
7
8
  const uuid_1 = require("uuid");
8
9
  const match_1 = require("./match");
9
10
  const utils_1 = require("../utils");
10
11
  const data_1 = require("../../data");
12
+ dayjs_1.default.extend(utc_1.default);
11
13
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
12
14
  class MatchGenerator {
13
15
  static generateMatches(teams, baseDate) {
14
16
  const t = new Set(teams.map(x => x.id));
15
- let date = (0, dayjs_1.default)(baseDate).startOf('hour');
17
+ // Anchor the first match to 00:00 UTC of the iteration's start day (Monday), so league rounds fall on the
18
+ // same wall-clock time everywhere regardless of the host timezone. startOf('day') in UTC avoids the
19
+ // local-timezone roll the old startOf('hour') was exposed to on a fractional-hour-offset host.
20
+ let date = dayjs_1.default.utc(baseDate).startOf('day');
16
21
  if (t.size !== teams.length) {
17
22
  throw new Error('DUPLICATE_TEAMS');
18
23
  }
@@ -17,7 +17,9 @@ export declare enum TraitEnum {
17
17
  */
18
18
  MOVING_WALL = "MOVING_WALL",
19
19
  /**
20
- * Enables the player making the second touch to spike or dump
20
+ * Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
21
+ * awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
22
+ * a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
21
23
  */
22
24
  SURPRISE_ATTACK = "SURPRISE_ATTACK",
23
25
  /**
@@ -22,7 +22,9 @@ var TraitEnum;
22
22
  */
23
23
  TraitEnum["MOVING_WALL"] = "MOVING_WALL";
24
24
  /**
25
- * Enables the player making the second touch to spike or dump
25
+ * Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
26
+ * awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
27
+ * a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
26
28
  */
27
29
  TraitEnum["SURPRISE_ATTACK"] = "SURPRISE_ATTACK";
28
30
  /**
@@ -11,10 +11,12 @@
11
11
  {
12
12
  "name": "SURPRISE_ATTACK",
13
13
  "modifier": 1.2,
14
- "chance": 0.07,
14
+ "chance": 0.15,
15
15
  "roles": [
16
16
  "SETTER",
17
- "OPPOSITE_HITTER"
17
+ "OPPOSITE_HITTER",
18
+ "OUTSIDE_HITTER",
19
+ "MIDDLE_BLOCKER"
18
20
  ]
19
21
  },
20
22
  {
@@ -1,13 +1,18 @@
1
1
  import dayjs from 'dayjs';
2
+ import utc from 'dayjs/plugin/utc';
2
3
  import { v4 as uuidv4 } from 'uuid';
3
4
  import { Match } from './match';
4
5
  import { shuffle } from '../utils';
5
6
  import { StatusEnum } from '../../data';
7
+ dayjs.extend(utc);
6
8
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
7
9
  export default class MatchGenerator {
8
10
  static generateMatches(teams, baseDate) {
9
11
  const t = new Set(teams.map(x => x.id));
10
- let date = dayjs(baseDate).startOf('hour');
12
+ // Anchor the first match to 00:00 UTC of the iteration's start day (Monday), so league rounds fall on the
13
+ // same wall-clock time everywhere regardless of the host timezone. startOf('day') in UTC avoids the
14
+ // local-timezone roll the old startOf('hour') was exposed to on a fractional-hour-offset host.
15
+ let date = dayjs.utc(baseDate).startOf('day');
11
16
  if (t.size !== teams.length) {
12
17
  throw new Error('DUPLICATE_TEAMS');
13
18
  }
@@ -17,7 +17,9 @@ export declare enum TraitEnum {
17
17
  */
18
18
  MOVING_WALL = "MOVING_WALL",
19
19
  /**
20
- * Enables the player making the second touch to spike or dump
20
+ * Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
21
+ * awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
22
+ * a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
21
23
  */
22
24
  SURPRISE_ATTACK = "SURPRISE_ATTACK",
23
25
  /**
@@ -15,7 +15,9 @@ export var TraitEnum;
15
15
  */
16
16
  TraitEnum["MOVING_WALL"] = "MOVING_WALL";
17
17
  /**
18
- * Enables the player making the second touch to spike or dump
18
+ * Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
19
+ * awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
20
+ * a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
19
21
  */
20
22
  TraitEnum["SURPRISE_ATTACK"] = "SURPRISE_ATTACK";
21
23
  /**
@@ -11,10 +11,12 @@
11
11
  {
12
12
  "name": "SURPRISE_ATTACK",
13
13
  "modifier": 1.2,
14
- "chance": 0.07,
14
+ "chance": 0.15,
15
15
  "roles": [
16
16
  "SETTER",
17
- "OPPOSITE_HITTER"
17
+ "OPPOSITE_HITTER",
18
+ "OUTSIDE_HITTER",
19
+ "MIDDLE_BLOCKER"
18
20
  ]
19
21
  },
20
22
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.413",
3
+ "version": "0.0.415",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",