@gamepark/mythologies 1.0.1 → 1.0.2

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.
@@ -1,4 +1,4 @@
1
- import { FillGapStrategy, hideFront, hideFrontToOthers, hideItemId, isMoveItemType, PositiveSequenceStrategy, SecretMaterialRules, StackingStrategy } from '@gamepark/rules-api';
1
+ import { FillGapStrategy, hideFront, hideFrontToOthers, hideItemId, isMoveItemType, isMoveItemTypeAtOnce, PositiveSequenceStrategy, SecretMaterialRules, StackingStrategy } from '@gamepark/rules-api';
2
2
  import { Destiny } from './material/Destiny';
3
3
  import { isGod } from './material/Entity';
4
4
  import { LineEventType, TriggerEventType } from './material/entity/Effect';
@@ -189,6 +189,12 @@ export class MythologiesRules extends SecretMaterialRules {
189
189
  new Pantheon(this.game, card.location.player).onEntitySacrificed(move.itemIndex);
190
190
  }
191
191
  }
192
+ if (isMoveItemTypeAtOnce(MaterialType.EntityCard)(move) && move.location.type === LocationType.PlayerDiscard) {
193
+ const firstCard = this.material(MaterialType.EntityCard).getItem(move.indexes[0]);
194
+ if (firstCard.location.type === LocationType.Pantheon) {
195
+ new Pantheon(this.game, firstCard.location.player).onPileSacrificed(move.indexes);
196
+ }
197
+ }
192
198
  return super.beforeItemMove(move);
193
199
  }
194
200
  getAutomaticMoves() {
@@ -44,6 +44,7 @@ export declare class Pantheon extends MaterialRulesPart {
44
44
  get mythologies(): import("./Mythology").Mythology[];
45
45
  get missingMythologies(): import("./Mythology").Mythology[];
46
46
  onEntitySacrificed(cardIndex: number): void;
47
+ onPileSacrificed(indexes: number[]): void;
47
48
  isOpponentOngoingEffect(): boolean;
48
49
  replaceSacrifice(cards: EntityItem[]): Material<number, number, number>;
49
50
  sacrificeToPreventMove(): MoveItem<number, number, number>[];
@@ -283,6 +283,17 @@ export class Pantheon extends MaterialRulesPart {
283
283
  new TriggerEffectsRule(this.game).triggerEffects({ type: TriggerEventType.EntitySacrificed, card: card, cardIndex });
284
284
  }
285
285
  }
286
+ onPileSacrificed(indexes) {
287
+ const cards = indexes.map((index) => this.material(MaterialType.EntityCard).getItem(index));
288
+ const { x, y } = cards[0].location;
289
+ const grid = this.indexGrid;
290
+ grid[y][x] = null;
291
+ this.memorize(Memory.PlayerGrid, grid, this.player);
292
+ const triggerEffects = new TriggerEffectsRule(this.game);
293
+ for (const cardIndex of indexes) {
294
+ triggerEffects.triggerEffects({ type: TriggerEventType.EntitySacrificed, card: cards[indexes.indexOf(cardIndex)], cardIndex });
295
+ }
296
+ }
286
297
  isOpponentOngoingEffect() {
287
298
  const ongoingEffect = this.remind(Memory.OngoingEffect);
288
299
  if (!ongoingEffect)
@@ -5,9 +5,10 @@ export const Brahma = {
5
5
  summon: [{ gem: 1, favor: 1 }, {}, { gem: 1 }],
6
6
  effect: {
7
7
  trigger: (event) => event.type === TriggerEventType.EntitySacrificed,
8
+ auto: true,
8
9
  rule: class BrahmaEffectRule extends PlayerEffectRule {
9
10
  playEffect() {
10
- return [new Pantheon(this.game, this.player).gainGems(2)];
11
+ return [new Pantheon(this.game, this.card.location.player).gainGems(2)];
11
12
  }
12
13
  }
13
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/mythologies",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "The rules of Mythologies adapted for Game Park",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -27,6 +27,5 @@
27
27
  "devDependencies": {
28
28
  "@gamepark/rules-api": "~7.2.0",
29
29
  "es-toolkit": "^1.44.0"
30
- },
31
- "gitHead": "624406ecd16bb8dbc98345789e5d767fdf49f1f8"
30
+ }
32
31
  }