@gamepark/mythologies 1.0.3 → 1.0.4

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.
@@ -119,7 +119,6 @@ export class Trial extends MaterialRulesPart {
119
119
  getTrialLeftReward(mythology) {
120
120
  switch (mythology) {
121
121
  case Mythology.Greek:
122
- case Mythology.Norse:
123
122
  case Mythology.Egyptian:
124
123
  case Mythology.Inca:
125
124
  return 1;
@@ -13,5 +13,4 @@ export declare abstract class PlaceCardEffectRule extends PlayerEffectRule {
13
13
  }
14
14
  export declare abstract class SummonEffectRule extends PlaceCardEffectRule {
15
15
  isSummon: boolean;
16
- getAvailableDestinations(cardIndex: number): XYCoordinates[];
17
16
  }
@@ -1,7 +1,6 @@
1
1
  import { isMoveItemType } from '@gamepark/rules-api';
2
2
  import { CustomMoveType } from '../../CustomMoveType';
3
3
  import { Memory } from '../../Memory';
4
- import { isGod } from '../Entity';
5
4
  import { LocationType } from '../LocationType';
6
5
  import { MaterialType } from '../MaterialType';
7
6
  import { Pantheon } from '../Pantheon';
@@ -32,8 +31,11 @@ export class PlaceCardEffectRule extends PlayerEffectRule {
32
31
  getPlayerMoves(cardIndex = this.getEffect().cardIndex) {
33
32
  const player = this.material(MaterialType.EntityCard).getItem(cardIndex).location.player;
34
33
  const cards = this.getCardsToPlace(cardIndex);
35
- const cardsICanPlace = new Pantheon(this.game, player).gems < 4 ? cards.id((id) => !isGod(id.front)) : cards;
36
- return this.getAvailableDestinations(cardIndex).flatMap(({ x, y }) => cardsICanPlace.moveItems({ type: LocationType.Pantheon, player, x, y }));
34
+ const pantheon = new Pantheon(this.game, player);
35
+ return this.getAvailableDestinations(cardIndex).flatMap(({ x, y }) => {
36
+ const cardsICanPlace = cards.id((id) => pantheon.isLegalSpaceToSummon({ x, y }, id.front));
37
+ return cardsICanPlace.moveItems({ type: LocationType.Pantheon, player, x, y });
38
+ });
37
39
  }
38
40
  getAvailableDestinations(_cardIndex) {
39
41
  return new Pantheon(this.game, this.player).legalSpaces;
@@ -52,8 +54,4 @@ export class PlaceCardEffectRule extends PlayerEffectRule {
52
54
  }
53
55
  export class SummonEffectRule extends PlaceCardEffectRule {
54
56
  isSummon = true;
55
- getAvailableDestinations(cardIndex) {
56
- const entity = this.material(MaterialType.EntityCard).getItem(cardIndex).id.front;
57
- return new Pantheon(this.game, this.player).getLegalSpacesToSummon(entity);
58
- }
59
57
  }
@@ -4,4 +4,5 @@ import { RuleId } from '../RuleId';
4
4
  export declare class CaimanEffectRule extends SacrificeEffectRule {
5
5
  ruleId: RuleId;
6
6
  onSacrifice(move: MoveItem): (import("@gamepark/rules-api").CustomMove | import("@gamepark/rules-api").CreateItem<number, number, number> | MoveItem<number, number, number>)[];
7
+ onRuleEnd(): never[];
7
8
  }
@@ -4,20 +4,29 @@ import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
4
4
  import { LocationType } from '../../material/LocationType';
5
5
  import { MaterialType } from '../../material/MaterialType';
6
6
  import { Pantheon } from '../../material/Pantheon';
7
+ import { Memory } from '../../Memory';
7
8
  import { RuleId } from '../RuleId';
8
9
  export class CaimanEffectRule extends SacrificeEffectRule {
9
10
  ruleId = RuleId.CaimanEffect;
10
11
  onSacrifice(move) {
12
+ if (this.remind(Memory.EffectCount)) {
13
+ return [];
14
+ }
11
15
  const card = this.material(MaterialType.EntityCard).getItem(move.itemIndex);
12
16
  const mythology = entityMythology(card.id.front);
13
17
  const pantheon = new Pantheon(this.game, this.player);
14
18
  const others = pantheon.visibleEntities
15
19
  .location((l) => l.x !== card.location.x || l.y !== card.location.y)
16
20
  .id((id) => entityMythology(id.front) === mythology);
21
+ this.memorize(Memory.EffectCount, 1 + others.length);
17
22
  return [
18
23
  ...others.moveItems({ type: LocationType.PlayerDiscard, player: this.player }),
19
24
  pantheon.gainGems(1 + others.length),
20
25
  this.customMove(CustomMoveType.EndEffect)
21
26
  ];
22
27
  }
28
+ onRuleEnd() {
29
+ this.forget(Memory.EffectCount);
30
+ return [];
31
+ }
23
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/mythologies",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "The rules of Mythologies adapted for Game Park",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -28,5 +28,5 @@
28
28
  "@gamepark/rules-api": "~7.2.0",
29
29
  "es-toolkit": "^1.44.0"
30
30
  },
31
- "gitHead": "5979bb8560edd48228052e30e8097060c49e6ff8"
31
+ "gitHead": "6333853529378cbbf1535c58e13a015919adf186"
32
32
  }