@bct-app/game-engine 0.1.19 → 0.1.20

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/index.js CHANGED
@@ -519,19 +519,18 @@ var applyStatusChange = createEffectHandler("STATUS_CHANGE", ({
519
519
  effect,
520
520
  payloads,
521
521
  makePlayersEffect,
522
- operationInTimelineIdx,
522
+ operationTurn,
523
523
  abilityMap,
524
524
  operation
525
525
  }) => {
526
526
  const maybeStatus = getSourceValue(effect.source, payloads);
527
527
  if (maybeStatus === "DEAD") {
528
528
  const ability = abilityMap.get(operation.abilityId);
529
- const turn = operationInTimelineIdx >= 0 ? operationInTimelineIdx : 0;
530
529
  const cause = effect.deathCause ?? (ability?.category === "STORYTELLER" ? "STORYTELLER" : "ABILITY");
531
530
  makePlayersEffect.forEach((player) => {
532
531
  player.isDead = true;
533
532
  player.deathCause = cause;
534
- player.deathTurn = turn;
533
+ player.deathTurn = operationTurn;
535
534
  });
536
535
  return;
537
536
  }
@@ -1708,6 +1707,7 @@ var applyOperationToPlayers = ({
1708
1707
  abilityMap,
1709
1708
  nowTimelineIndex,
1710
1709
  operationInTimelineIdx: record.operationInTimelineIdx,
1710
+ operationTurn: timelines[record.operationInTimelineIdx]?.turn ?? 0,
1711
1711
  makePlayersEffect
1712
1712
  };
1713
1713
  handler(context);
package/dist/index.mjs CHANGED
@@ -463,19 +463,18 @@ var applyStatusChange = createEffectHandler("STATUS_CHANGE", ({
463
463
  effect,
464
464
  payloads,
465
465
  makePlayersEffect,
466
- operationInTimelineIdx,
466
+ operationTurn,
467
467
  abilityMap,
468
468
  operation
469
469
  }) => {
470
470
  const maybeStatus = getSourceValue(effect.source, payloads);
471
471
  if (maybeStatus === "DEAD") {
472
472
  const ability = abilityMap.get(operation.abilityId);
473
- const turn = operationInTimelineIdx >= 0 ? operationInTimelineIdx : 0;
474
473
  const cause = effect.deathCause ?? (ability?.category === "STORYTELLER" ? "STORYTELLER" : "ABILITY");
475
474
  makePlayersEffect.forEach((player) => {
476
475
  player.isDead = true;
477
476
  player.deathCause = cause;
478
- player.deathTurn = turn;
477
+ player.deathTurn = operationTurn;
479
478
  });
480
479
  return;
481
480
  }
@@ -1652,6 +1651,7 @@ var applyOperationToPlayers = ({
1652
1651
  abilityMap,
1653
1652
  nowTimelineIndex,
1654
1653
  operationInTimelineIdx: record.operationInTimelineIdx,
1654
+ operationTurn: timelines[record.operationInTimelineIdx]?.turn ?? 0,
1655
1655
  makePlayersEffect
1656
1656
  };
1657
1657
  handler(context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bct-app/game-engine",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Game engine utilities for BCT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@bct-app/game-model": "0.1.12"
33
+ "@bct-app/game-model": "0.1.13"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@vitest/ui": "^4.1.3",