@gamepark/mythologies 1.0.15 → 1.0.17

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.
@@ -95,9 +95,13 @@ export class Pantheon extends MaterialRulesPart {
95
95
  moves.push(this.spendGems(4));
96
96
  }
97
97
  const grid = this.indexGrid;
98
- const crush = grid[move.location.y][move.location.x] !== null;
98
+ const crushedIndex = grid[move.location.y][move.location.x];
99
99
  grid[move.location.y][move.location.x] = move.itemIndex;
100
- new TriggerEffectsRule(this.game).triggerCardEffect(move.itemIndex, location, { type: TriggerEventType.SelfPlaced, crush }, entity);
100
+ const event = { type: TriggerEventType.SelfPlaced };
101
+ if (crushedIndex !== null) {
102
+ event.crushed = this.material(MaterialType.EntityCard).getItem(crushedIndex).id.front;
103
+ }
104
+ new TriggerEffectsRule(this.game).triggerCardEffect(move.itemIndex, location, event, entity);
101
105
  const summoned = this.isSummon;
102
106
  if (summoned) {
103
107
  moves.push(...this.onSummon(move));
@@ -40,7 +40,7 @@ export declare enum TriggerEventType {
40
40
  }
41
41
  export type SelfPlaced = {
42
42
  type: TriggerEventType.SelfPlaced;
43
- crush: boolean;
43
+ crushed?: Entity;
44
44
  };
45
45
  export type EndOfGameEvent = {
46
46
  type: TriggerEventType.EndOfGame;
@@ -14,7 +14,7 @@ export var TriggerEventType;
14
14
  })(TriggerEventType || (TriggerEventType = {}));
15
15
  export const isEndOfGame = (event) => event.type === TriggerEventType.EndOfGame;
16
16
  export const isPlaced = (event) => event.type === TriggerEventType.SelfPlaced;
17
- export const isPlacedCrush = (event) => isPlaced(event) && event.crush;
17
+ export const isPlacedCrush = (event) => isPlaced(event) && !!event.crushed;
18
18
  export var LineEventType;
19
19
  (function (LineEventType) {
20
20
  LineEventType[LineEventType["BonusGain"] = 1] = "BonusGain";
@@ -3,7 +3,6 @@ import { entityMythology } from '../../material/Entity';
3
3
  import { SummonEffectRule } from '../../material/entity/PlaceCardEffectRule';
4
4
  import { LocationType } from '../../material/LocationType';
5
5
  import { MaterialType } from '../../material/MaterialType';
6
- import { Pantheon } from '../../material/Pantheon';
7
6
  import { RuleId } from '../RuleId';
8
7
  export class ImpunduluEffectRule extends SummonEffectRule {
9
8
  ruleId = RuleId.ImpunduluEffect;
@@ -31,9 +30,7 @@ export class ImpunduluEffectRule extends SummonEffectRule {
31
30
  return deck.maxBy((item) => item.location.x);
32
31
  }
33
32
  get mythology() {
34
- const pantheon = new Pantheon(this.game, this.player);
35
- const { x, y } = this.card.location;
36
- const crushed = pantheon.coveredEntities.location((l) => l.x === x && l.y === y).maxBy((item) => item.location.z);
37
- return entityMythology(crushed.getItem().id.front);
33
+ const { triggerEvent } = this.getEffect();
34
+ return entityMythology(triggerEvent.crushed);
38
35
  }
39
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/mythologies",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "The rules of Mythologies adapted for Game Park",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -25,8 +25,8 @@
25
25
  "es-toolkit": "^1.44.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@gamepark/rules-api": "~7.4.1",
28
+ "@gamepark/rules-api": "~7.5.0",
29
29
  "es-toolkit": "^1.44.0"
30
30
  },
31
- "gitHead": "214dbf3d9235eda59b4fbb5912f34cce66a1dca2"
31
+ "gitHead": "62da510f4af0d6790751ef8c24e1faba3e3709af"
32
32
  }