@gamepark/mythologies 0.6.0 → 0.7.1

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.
Files changed (32) hide show
  1. package/dist/MythologiesRules.d.ts +8 -9
  2. package/dist/MythologiesRules.js +2 -3
  3. package/dist/material/Destiny.d.ts +1 -0
  4. package/dist/material/Destiny.js +9 -0
  5. package/dist/material/Entity.d.ts +2 -2
  6. package/dist/material/Entity.js +2 -2
  7. package/dist/material/LocationType.d.ts +2 -1
  8. package/dist/material/LocationType.js +1 -0
  9. package/dist/material/MaterialType.d.ts +2 -1
  10. package/dist/material/MaterialType.js +1 -0
  11. package/dist/material/Pantheon.js +2 -4
  12. package/dist/material/entity/EntityDescription.js +4 -4
  13. package/dist/material/entity/celtic/Banshee.js +8 -1
  14. package/dist/material/entity/egyptian/Ammit.d.ts +2 -0
  15. package/dist/material/entity/egyptian/Ammit.js +12 -0
  16. package/dist/material/entity/greek/Cyclops.js +7 -2
  17. package/dist/material/entity/greek/Poseidon.js +1 -1
  18. package/dist/material/entity/inca/Amaru.js +1 -1
  19. package/dist/material/entity/inca/Puma.d.ts +2 -0
  20. package/dist/material/entity/inca/Puma.js +36 -0
  21. package/dist/material/entity/zulu/Shembe.js +5 -5
  22. package/dist/rules/PlaceCardsRule.d.ts +2 -0
  23. package/dist/rules/PlaceCardsRule.js +15 -3
  24. package/dist/rules/RuleId.d.ts +9 -7
  25. package/dist/rules/RuleId.js +9 -7
  26. package/dist/rules/effects/AmmitEffectRule.d.ts +6 -0
  27. package/dist/rules/effects/AmmitEffectRule.js +40 -0
  28. package/dist/rules/effects/CyclopsEffectRule.d.ts +1 -0
  29. package/dist/rules/effects/CyclopsEffectRule.js +9 -0
  30. package/dist/rules/effects/WerehyenaEffectRule.d.ts +5 -8
  31. package/dist/rules/effects/WerehyenaEffectRule.js +51 -7
  32. package/package.json +2 -2
@@ -5,9 +5,9 @@ import { PlayerColor } from './PlayerColor';
5
5
  import { ChooseDraftTokenRule } from './rules/ChooseDraftTokenRule';
6
6
  import { DrawDestinyCardRule } from './rules/DrawDestinyCardRule';
7
7
  import { AlfEffectRule } from './rules/effects/AlfEffectRule';
8
+ import { AmmitEffectRule } from './rules/effects/AmmitEffectRule';
8
9
  import { AnubisEffectRule } from './rules/effects/AnubisEffectRule';
9
10
  import { AthenaEffectRule } from './rules/effects/AthenaEffectRule';
10
- import { BabaiEffectRule } from './rules/effects/BabaiEffectRule';
11
11
  import { BennuEffectRule } from './rules/effects/BennuEffectRule';
12
12
  import { CaimanEffectRule } from './rules/effects/CaimanEffectRule';
13
13
  import { CentaurEffectRule, CentaurEffectSacrificeRule } from './rules/effects/CentaurEffectRule';
@@ -47,7 +47,7 @@ import { TianlongEffectRule, TianlongOpponentsEffectRule } from './rules/effects
47
47
  import { UkukuEffectRule, UkukuPlaceEffectRule } from './rules/effects/UkukuEffectRule';
48
48
  import { VetalaEffectRule } from './rules/effects/VetalaEffectRule';
49
49
  import { ViracochaEffectRule } from './rules/effects/ViracochaEffectRule';
50
- import { WerehyenaCallEffectRule, WerehyenaEffectRule } from './rules/effects/WerehyenaEffectRule';
50
+ import { WerehyenaEffectRule } from './rules/effects/WerehyenaEffectRule';
51
51
  import { YanluoWangEffectRule } from './rules/effects/YanluoWangEffectRule';
52
52
  import { EndGameRule } from './rules/EndGameRule';
53
53
  import { PlaceCardsRule } from './rules/PlaceCardsRule';
@@ -82,7 +82,7 @@ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, M
82
82
  28: typeof SphinxEffectRule;
83
83
  29: typeof CobraEffectRule;
84
84
  30: typeof CobraInvokeEffect;
85
- 31: typeof BabaiEffectRule;
85
+ 31: typeof AmmitEffectRule;
86
86
  32: typeof BennuEffectRule;
87
87
  33: typeof ShivaEffectRule;
88
88
  34: typeof RakshasaEffectRule;
@@ -108,12 +108,11 @@ export declare class MythologiesRules extends SecretMaterialRules<PlayerColor, M
108
108
  54: typeof InkosazanaEffectRule;
109
109
  55: typeof ImpunduluEffectRule;
110
110
  56: typeof WerehyenaEffectRule;
111
- 57: typeof WerehyenaCallEffectRule;
112
- 58: typeof IdloziEffectRule;
113
- 59: typeof FairyEffectRule;
114
- 60: typeof LeprechaunEffectRule;
115
- 61: typeof SelkieEffectRule;
116
- 62: typeof DullahanEffectRule;
111
+ 57: typeof IdloziEffectRule;
112
+ 58: typeof FairyEffectRule;
113
+ 59: typeof LeprechaunEffectRule;
114
+ 60: typeof SelkieEffectRule;
115
+ 61: typeof DullahanEffectRule;
117
116
  };
118
117
  locationsStrategies: {
119
118
  2: {
@@ -28,9 +28,9 @@ var Memory_1 = require("./Memory");
28
28
  var ChooseDraftTokenRule_1 = require("./rules/ChooseDraftTokenRule");
29
29
  var DrawDestinyCardRule_1 = require("./rules/DrawDestinyCardRule");
30
30
  var AlfEffectRule_1 = require("./rules/effects/AlfEffectRule");
31
+ var AmmitEffectRule_1 = require("./rules/effects/AmmitEffectRule");
31
32
  var AnubisEffectRule_1 = require("./rules/effects/AnubisEffectRule");
32
33
  var AthenaEffectRule_1 = require("./rules/effects/AthenaEffectRule");
33
- var BabaiEffectRule_1 = require("./rules/effects/BabaiEffectRule");
34
34
  var BennuEffectRule_1 = require("./rules/effects/BennuEffectRule");
35
35
  var CaimanEffectRule_1 = require("./rules/effects/CaimanEffectRule");
36
36
  var CentaurEffectRule_1 = require("./rules/effects/CentaurEffectRule");
@@ -111,7 +111,7 @@ var MythologiesRules = (function (_super) {
111
111
  _a[RuleId_1.RuleId.SphinxEffect] = SphinxEffectRule_1.SphinxEffectRule,
112
112
  _a[RuleId_1.RuleId.CobraEffect] = CobraEffectRule_1.CobraEffectRule,
113
113
  _a[RuleId_1.RuleId.CobraInvokeEffect] = CobraEffectRule_1.CobraInvokeEffect,
114
- _a[RuleId_1.RuleId.BabaiEffect] = BabaiEffectRule_1.BabaiEffectRule,
114
+ _a[RuleId_1.RuleId.AmmitEffect] = AmmitEffectRule_1.AmmitEffectRule,
115
115
  _a[RuleId_1.RuleId.BennuEffect] = BennuEffectRule_1.BennuEffectRule,
116
116
  _a[RuleId_1.RuleId.ShivaEffect] = ShivaEffectRule_1.ShivaEffectRule,
117
117
  _a[RuleId_1.RuleId.RakshasaEffect] = RakshasaEffectRule_1.RakshasaEffectRule,
@@ -137,7 +137,6 @@ var MythologiesRules = (function (_super) {
137
137
  _a[RuleId_1.RuleId.InkosazanaEffect] = InkosazanaEffectRule_1.InkosazanaEffectRule,
138
138
  _a[RuleId_1.RuleId.ImpunduluEffect] = ImpunduluEffectRule_1.ImpunduluEffectRule,
139
139
  _a[RuleId_1.RuleId.WerehyenaEffect] = WerehyenaEffectRule_1.WerehyenaEffectRule,
140
- _a[RuleId_1.RuleId.WerehyenaCallEffect] = WerehyenaEffectRule_1.WerehyenaCallEffectRule,
141
140
  _a[RuleId_1.RuleId.IdloziEffect] = IdloziEffectRule_1.IdloziEffectRule,
142
141
  _a[RuleId_1.RuleId.FairyEffect] = FairyEffectRule_1.FairyEffectRule,
143
142
  _a[RuleId_1.RuleId.LeprechaunEffect] = LeprechaunEffectRule_1.LeprechaunEffectRule,
@@ -1,6 +1,7 @@
1
1
  import { MaterialRulesPart } from '@gamepark/rules-api';
2
2
  import { PlayerColor } from '../PlayerColor';
3
3
  export declare class Destiny extends MaterialRulesPart {
4
+ get mythologies(): import("./Mythology").Mythology[];
4
5
  getMythologyBoard(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
5
6
  getMythology(player: PlayerColor): import("./Mythology").Mythology;
6
7
  getDestinyMap(destiny: number): PlayerColor[][];
@@ -25,6 +25,15 @@ var Destiny = (function (_super) {
25
25
  function Destiny() {
26
26
  return _super !== null && _super.apply(this, arguments) || this;
27
27
  }
28
+ Object.defineProperty(Destiny.prototype, "mythologies", {
29
+ get: function () {
30
+ return this.material(MaterialType_1.MaterialType.MythologyBoard)
31
+ .getItems()
32
+ .map(function (item) { return item.id.mythology; });
33
+ },
34
+ enumerable: false,
35
+ configurable: true
36
+ });
28
37
  Destiny.prototype.getMythologyBoard = function (player) {
29
38
  var destiny = this.material(MaterialType_1.MaterialType.DestinyCard)
30
39
  .location(LocationType_1.LocationType.CurrentDestiny)
@@ -31,7 +31,7 @@ export declare enum Entity {
31
31
  Mummy = 26,
32
32
  Sphinx = 27,
33
33
  Cobra = 28,
34
- Babai = 29,
34
+ Ammit = 29,
35
35
  Bennu = 30,
36
36
  Brahma = 31,
37
37
  Vishnu = 32,
@@ -47,7 +47,7 @@ export declare enum Entity {
47
47
  MamaQucha = 42,
48
48
  Illapa = 43,
49
49
  Inti = 44,
50
- Pumapunku = 45,
50
+ Puma = 45,
51
51
  Amaru = 46,
52
52
  Caiman = 47,
53
53
  Condor = 48,
@@ -31,7 +31,7 @@ var Entity;
31
31
  Entity[Entity["Mummy"] = 26] = "Mummy";
32
32
  Entity[Entity["Sphinx"] = 27] = "Sphinx";
33
33
  Entity[Entity["Cobra"] = 28] = "Cobra";
34
- Entity[Entity["Babai"] = 29] = "Babai";
34
+ Entity[Entity["Ammit"] = 29] = "Ammit";
35
35
  Entity[Entity["Bennu"] = 30] = "Bennu";
36
36
  Entity[Entity["Brahma"] = 31] = "Brahma";
37
37
  Entity[Entity["Vishnu"] = 32] = "Vishnu";
@@ -47,7 +47,7 @@ var Entity;
47
47
  Entity[Entity["MamaQucha"] = 42] = "MamaQucha";
48
48
  Entity[Entity["Illapa"] = 43] = "Illapa";
49
49
  Entity[Entity["Inti"] = 44] = "Inti";
50
- Entity[Entity["Pumapunku"] = 45] = "Pumapunku";
50
+ Entity[Entity["Puma"] = 45] = "Puma";
51
51
  Entity[Entity["Amaru"] = 46] = "Amaru";
52
52
  Entity[Entity["Caiman"] = 47] = "Caiman";
53
53
  Entity[Entity["Condor"] = 48] = "Condor";
@@ -21,6 +21,7 @@ export declare enum LocationType {
21
21
  PlayerGems = 20,
22
22
  PlayerFavor = 21,
23
23
  PlayerDiscard = 22,
24
- PlayerBufferArea = 23
24
+ PlayerBufferArea = 23,
25
+ GameHelpArea = 24
25
26
  }
26
27
  export declare const isInSanctuary: (type?: LocationType) => boolean;
@@ -26,6 +26,7 @@ var LocationType;
26
26
  LocationType[LocationType["PlayerFavor"] = 21] = "PlayerFavor";
27
27
  LocationType[LocationType["PlayerDiscard"] = 22] = "PlayerDiscard";
28
28
  LocationType[LocationType["PlayerBufferArea"] = 23] = "PlayerBufferArea";
29
+ LocationType[LocationType["GameHelpArea"] = 24] = "GameHelpArea";
29
30
  })(LocationType = exports.LocationType || (exports.LocationType = {}));
30
31
  var isInSanctuary = function (type) { return type === LocationType.SanctuaryCreatureSpot || type === LocationType.SanctuaryGodSpot; };
31
32
  exports.isInSanctuary = isInSanctuary;
@@ -8,5 +8,6 @@ export declare enum MaterialType {
8
8
  FirstPlayerToken = 7,
9
9
  RoundCounterBoard = 8,
10
10
  RoundToken = 9,
11
- DestinyCard = 10
11
+ DestinyCard = 10,
12
+ HelpCard = 11
12
13
  }
@@ -13,4 +13,5 @@ var MaterialType;
13
13
  MaterialType[MaterialType["RoundCounterBoard"] = 8] = "RoundCounterBoard";
14
14
  MaterialType[MaterialType["RoundToken"] = 9] = "RoundToken";
15
15
  MaterialType[MaterialType["DestinyCard"] = 10] = "DestinyCard";
16
+ MaterialType[MaterialType["HelpCard"] = 11] = "HelpCard";
16
17
  })(MaterialType = exports.MaterialType || (exports.MaterialType = {}));
@@ -58,6 +58,7 @@ var Memory_1 = require("../Memory");
58
58
  var MythologiesRules_1 = require("../MythologiesRules");
59
59
  var PermanentEffectsRule_1 = require("../rules/effects/PermanentEffectsRule");
60
60
  var TriggerEffectsRule_1 = require("../rules/effects/TriggerEffectsRule");
61
+ var Destiny_1 = require("./Destiny");
61
62
  var Entity_1 = require("./Entity");
62
63
  var Effect_1 = require("./entity/Effect");
63
64
  var EntityDescription_1 = require("./entity/EntityDescription");
@@ -431,10 +432,7 @@ var Pantheon = (function (_super) {
431
432
  });
432
433
  Object.defineProperty(Pantheon.prototype, "missingMythologies", {
433
434
  get: function () {
434
- var mythologies = this.material(MaterialType_1.MaterialType.MythologyBoard)
435
- .getItems()
436
- .map(function (item) { return item.id.mythology; });
437
- return (0, lodash_1.difference)(mythologies, this.mythologies);
435
+ return (0, lodash_1.difference)(new Destiny_1.Destiny(this.game).mythologies, this.mythologies);
438
436
  },
439
437
  enumerable: false,
440
438
  configurable: true
@@ -24,7 +24,7 @@ var SunWukong_1 = require("./chinese/SunWukong");
24
24
  var Tianlong_1 = require("./chinese/Tianlong");
25
25
  var YanluoWang_1 = require("./chinese/YanluoWang");
26
26
  var Anubis_1 = require("./egyptian/Anubis");
27
- var Babai_1 = require("./egyptian/Babai");
27
+ var Ammit_1 = require("./egyptian/Ammit");
28
28
  var Beetle_1 = require("./egyptian/Beetle");
29
29
  var Bennu_1 = require("./egyptian/Bennu");
30
30
  var Cobra_1 = require("./egyptian/Cobra");
@@ -59,7 +59,7 @@ var Condor_1 = require("./inca/Condor");
59
59
  var Illapa_1 = require("./inca/Illapa");
60
60
  var Inti_1 = require("./inca/Inti");
61
61
  var MamaQucha_1 = require("./inca/MamaQucha");
62
- var Pumapunku_1 = require("./inca/Pumapunku");
62
+ var Puma_1 = require("./inca/Puma");
63
63
  var Supay_1 = require("./inca/Supay");
64
64
  var Ukuku_1 = require("./inca/Ukuku");
65
65
  var Viracocha_1 = require("./inca/Viracocha");
@@ -115,7 +115,7 @@ exports.entities = (_a = {},
115
115
  _a[Entity_1.Entity.Mummy] = Mummy_1.Mummy,
116
116
  _a[Entity_1.Entity.Sphinx] = Sphinx_1.Sphinx,
117
117
  _a[Entity_1.Entity.Cobra] = Cobra_1.Cobra,
118
- _a[Entity_1.Entity.Babai] = Babai_1.Babai,
118
+ _a[Entity_1.Entity.Ammit] = Ammit_1.Ammit,
119
119
  _a[Entity_1.Entity.Bennu] = Bennu_1.Bennu,
120
120
  _a[Entity_1.Entity.Brahma] = Brahma_1.Brahma,
121
121
  _a[Entity_1.Entity.Vishnu] = Vishnu_1.Vishnu,
@@ -131,7 +131,7 @@ exports.entities = (_a = {},
131
131
  _a[Entity_1.Entity.MamaQucha] = MamaQucha_1.MamaQucha,
132
132
  _a[Entity_1.Entity.Illapa] = Illapa_1.Illapa,
133
133
  _a[Entity_1.Entity.Inti] = Inti_1.Inti,
134
- _a[Entity_1.Entity.Pumapunku] = Pumapunku_1.Pumapunku,
134
+ _a[Entity_1.Entity.Puma] = Puma_1.Puma,
135
135
  _a[Entity_1.Entity.Amaru] = Amaru_1.Amaru,
136
136
  _a[Entity_1.Entity.Caiman] = Caiman_1.Caiman,
137
137
  _a[Entity_1.Entity.Condor] = Condor_1.Condor,
@@ -28,9 +28,16 @@ exports.Banshee = {
28
28
  return _super !== null && _super.apply(this, arguments) || this;
29
29
  }
30
30
  BansheeEffectRule.prototype.playEffect = function () {
31
+ var moves = [];
31
32
  var _a = this.card.location, x = _a.x, y = _a.y, player = _a.player;
32
33
  var pantheon = new Pantheon_1.Pantheon(this.game, player);
33
- return pantheon.grid[y].every(function (entity, column) { return column !== x || !entity; }) ? [pantheon.gainFavor(1)] : [];
34
+ if (pantheon.grid[y].every(function (entity, column) { return column !== x || !entity; })) {
35
+ moves.push(pantheon.gainFavor(1));
36
+ }
37
+ if (pantheon.grid.every(function (line, lineY) { return lineY !== y || !line[x]; })) {
38
+ moves.push(pantheon.gainGems(1));
39
+ }
40
+ return moves;
34
41
  };
35
42
  return BansheeEffectRule;
36
43
  }(Effect_1.AutoEffectRule))
@@ -0,0 +1,2 @@
1
+ import { EntityDescription } from '../EntityDescription';
2
+ export declare const Ammit: EntityDescription;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Ammit = void 0;
4
+ var AmmitEffectRule_1 = require("../../../rules/effects/AmmitEffectRule");
5
+ var Effect_1 = require("../Effect");
6
+ exports.Ammit = {
7
+ invoke: [{}, {}, { gem: 2 }],
8
+ effect: {
9
+ trigger: Effect_1.isPlaced,
10
+ rule: AmmitEffectRule_1.AmmitEffectRule
11
+ }
12
+ };
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cyclops = void 0;
4
+ var Memory_1 = require("../../../Memory");
5
+ var MythologiesRules_1 = require("../../../MythologiesRules");
4
6
  var CyclopsEffectRule_1 = require("../../../rules/effects/CyclopsEffectRule");
5
7
  var Effect_1 = require("../Effect");
6
8
  exports.Cyclops = {
7
9
  invoke: [{ favor: 1 }, { gem: 1 }, {}],
8
10
  effect: {
9
- trigger: function (event, card) {
11
+ trigger: function (event, card, game) {
12
+ var _a;
10
13
  if (event.type !== Effect_1.TriggerEventType.LineEvent && event.type !== Effect_1.TriggerEventType.ColumnEvent)
11
14
  return false;
12
- var _a = card.getItem().location, x = _a.x, y = _a.y, player = _a.player;
15
+ var _b = card.getItem().location, x = _b.x, y = _b.y, player = _b.player;
13
16
  if (event.eventType !== Effect_1.LineEventType.BonusGain || event.player !== player)
14
17
  return false;
18
+ if ((_a = new MythologiesRules_1.MythologiesRules(game).remind(Memory_1.Memory.OncePerTurn)) === null || _a === void 0 ? void 0 : _a.includes(card.getIndex()))
19
+ return false;
15
20
  return event.type === Effect_1.TriggerEventType.LineEvent ? event.y === y : event.x === x;
16
21
  },
17
22
  rule: CyclopsEffectRule_1.CyclopsEffectRule
@@ -22,7 +22,7 @@ var Entity_1 = require("../../Entity");
22
22
  var Pantheon_1 = require("../../Pantheon");
23
23
  var Effect_1 = require("../Effect");
24
24
  exports.Poseidon = {
25
- invoke: [{ gem: 1 }, { gem: 2, favor: 1 }, { favor: 1 }],
25
+ invoke: [{}, { gem: 2 }, { favor: 1 }],
26
26
  effect: {
27
27
  trigger: function (event, card) {
28
28
  return event.type === Effect_1.TriggerEventType.EntityPlaced && event.invoked && (0, Entity_1.isGod)(event.entity) && event.location.player === card.getItem().location.player;
@@ -29,7 +29,7 @@ exports.Amaru = {
29
29
  }
30
30
  AmaruEffectRule.prototype.playEffect = function () {
31
31
  var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
32
- return pantheon.mythologies.length > 1 ? [pantheon.gainGems(pantheon.mythologies.length - 1)] : [];
32
+ return [pantheon.gainGems(pantheon.mythologies.length)];
33
33
  };
34
34
  return AmaruEffectRule;
35
35
  }(Effect_1.PlayerEffectRule))
@@ -0,0 +1,2 @@
1
+ import { EntityDescription } from '../EntityDescription';
2
+ export declare const Puma: EntityDescription;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.Puma = void 0;
19
+ var Pantheon_1 = require("../../Pantheon");
20
+ var Effect_1 = require("../Effect");
21
+ exports.Puma = {
22
+ invoke: [{}, { favor: 1 }, {}],
23
+ effect: {
24
+ trigger: function (event, card) { return event.type === Effect_1.TriggerEventType.EntityCrushed && card.getItem().location.player === event.card.location.player; },
25
+ rule: (function (_super) {
26
+ __extends(PumaEffectRule, _super);
27
+ function PumaEffectRule() {
28
+ return _super !== null && _super.apply(this, arguments) || this;
29
+ }
30
+ PumaEffectRule.prototype.playEffect = function () {
31
+ return [new Pantheon_1.Pantheon(this.game, this.player).gainGems(1)];
32
+ };
33
+ return PumaEffectRule;
34
+ }(Effect_1.PlayerEffectRule))
35
+ }
36
+ };
@@ -16,7 +16,6 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Shembe = void 0;
19
- var lodash_1 = require("lodash");
20
19
  var Entity_1 = require("../../Entity");
21
20
  var Mythology_1 = require("../../Mythology");
22
21
  var Pantheon_1 = require("../../Pantheon");
@@ -32,10 +31,11 @@ exports.Shembe = {
32
31
  }
33
32
  ShembeEffectRule.prototype.playEffect = function () {
34
33
  var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
35
- var creatures = pantheon.visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front) && (0, Entity_1.entityMythology)(id.front) !== Mythology_1.Mythology.Zulu; });
36
- var groups = (0, lodash_1.groupBy)(creatures.getItems(), function (creature) { return (0, Entity_1.entityMythology)(creature.id.front); });
37
- var pairs = (0, lodash_1.sumBy)((0, lodash_1.values)(groups), function (group) { return Math.floor(group.length / 2); });
38
- return pairs > 0 ? [pantheon.gainFavor(pairs * 2)] : [];
34
+ var mythologies = pantheon.mythologies.filter(function (mythology) {
35
+ return mythology !== Mythology_1.Mythology.Zulu &&
36
+ pantheon.visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front) && (0, Entity_1.entityMythology)(id.front) === mythology; }).length >= 2;
37
+ });
38
+ return mythologies.length > 0 ? [pantheon.gainFavor(mythologies.length * 2)] : [];
39
39
  };
40
40
  return ShembeEffectRule;
41
41
  }(Effect_1.PlayerEffectRule))
@@ -2,6 +2,8 @@ import { CustomMove, ItemMove, MaterialMove, PlayerTurnRule } from '@gamepark/ru
2
2
  import { RuleId } from './RuleId';
3
3
  export declare class PlaceCardsRule extends PlayerTurnRule {
4
4
  isInvoke: boolean;
5
+ onRuleStart(): import("@gamepark/rules-api").MoveItem<number, number, number>[];
6
+ get selectedCards(): import("@gamepark/rules-api").Material<number, number, number>;
5
7
  getPlayerMoves(): MaterialMove<number, number, number, number>[];
6
8
  get infiniteEffects(): import("../material/entity/Effect").PendingEffect<import("../material/entity/Effect").TriggerEvent>[];
7
9
  isOncePerTurnAvailable(cardIndex: number): boolean;
@@ -72,12 +72,22 @@ var PlaceCardsRule = (function (_super) {
72
72
  _this.isInvoke = true;
73
73
  return _this;
74
74
  }
75
+ PlaceCardsRule.prototype.onRuleStart = function () {
76
+ return this.selectedCards.rotation(function (rotation) { return rotation !== undefined; }).rotateItems(undefined);
77
+ };
78
+ Object.defineProperty(PlaceCardsRule.prototype, "selectedCards", {
79
+ get: function () {
80
+ var tokens = this.tokens.getItems();
81
+ return this.material(MaterialType_1.MaterialType.EntityCard).index(tokens.map(function (token) { return token.location.parent; }));
82
+ },
83
+ enumerable: false,
84
+ configurable: true
85
+ });
75
86
  PlaceCardsRule.prototype.getPlayerMoves = function () {
76
87
  var e_1, _a;
77
88
  var _this = this;
78
89
  var moves = this.infiniteEffects.map(function (effect) { return _this.customMove(CustomMoveType_1.CustomMoveType.PlayEffect, effect); });
79
- var tokens = this.tokens.getItems();
80
- var cards = this.material(MaterialType_1.MaterialType.EntityCard).index(tokens.map(function (token) { return token.location.parent; }));
90
+ var cards = this.selectedCards;
81
91
  if (cards.length) {
82
92
  var cardsICanInvoke = new Pantheon_1.Pantheon(this.game, this.player).gems < 4 ? cards.id(function (id) { return !(0, Entity_1.isGod)(id.front); }) : cards;
83
93
  try {
@@ -135,7 +145,9 @@ var PlaceCardsRule = (function (_super) {
135
145
  });
136
146
  PlaceCardsRule.prototype.beforeItemMove = function (move) {
137
147
  var moves = [];
138
- if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
148
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) &&
149
+ move.location.type !== LocationType_1.LocationType.SanctuaryCreatureSpot &&
150
+ move.location.type !== LocationType_1.LocationType.SanctuaryGodSpot) {
139
151
  var token = this.tokens.parent(move.itemIndex);
140
152
  if (token.length) {
141
153
  moves.push(token.moveItem({ type: LocationType_1.LocationType.PlayerHand, player: this.player }));
@@ -26,7 +26,7 @@ export declare enum RuleId {
26
26
  SphinxEffect = 28,
27
27
  CobraEffect = 29,
28
28
  CobraInvokeEffect = 30,
29
- BabaiEffect = 31,
29
+ AmmitEffect = 31,
30
30
  BennuEffect = 32,
31
31
  ShivaEffect = 33,
32
32
  RakshasaEffect = 34,
@@ -52,10 +52,12 @@ export declare enum RuleId {
52
52
  InkosazanaEffect = 54,
53
53
  ImpunduluEffect = 55,
54
54
  WerehyenaEffect = 56,
55
- WerehyenaCallEffect = 57,
56
- IdloziEffect = 58,
57
- FairyEffect = 59,
58
- LeprechaunEffect = 60,
59
- SelkieEffect = 61,
60
- DullahanEffect = 62
55
+ IdloziEffect = 57,
56
+ FairyEffect = 58,
57
+ LeprechaunEffect = 59,
58
+ SelkieEffect = 60,
59
+ DullahanEffect = 61,
60
+ Mythology = 1000,
61
+ Creature = 1001,
62
+ Divinity = 1002
61
63
  }
@@ -30,7 +30,7 @@ var RuleId;
30
30
  RuleId[RuleId["SphinxEffect"] = 28] = "SphinxEffect";
31
31
  RuleId[RuleId["CobraEffect"] = 29] = "CobraEffect";
32
32
  RuleId[RuleId["CobraInvokeEffect"] = 30] = "CobraInvokeEffect";
33
- RuleId[RuleId["BabaiEffect"] = 31] = "BabaiEffect";
33
+ RuleId[RuleId["AmmitEffect"] = 31] = "AmmitEffect";
34
34
  RuleId[RuleId["BennuEffect"] = 32] = "BennuEffect";
35
35
  RuleId[RuleId["ShivaEffect"] = 33] = "ShivaEffect";
36
36
  RuleId[RuleId["RakshasaEffect"] = 34] = "RakshasaEffect";
@@ -56,10 +56,12 @@ var RuleId;
56
56
  RuleId[RuleId["InkosazanaEffect"] = 54] = "InkosazanaEffect";
57
57
  RuleId[RuleId["ImpunduluEffect"] = 55] = "ImpunduluEffect";
58
58
  RuleId[RuleId["WerehyenaEffect"] = 56] = "WerehyenaEffect";
59
- RuleId[RuleId["WerehyenaCallEffect"] = 57] = "WerehyenaCallEffect";
60
- RuleId[RuleId["IdloziEffect"] = 58] = "IdloziEffect";
61
- RuleId[RuleId["FairyEffect"] = 59] = "FairyEffect";
62
- RuleId[RuleId["LeprechaunEffect"] = 60] = "LeprechaunEffect";
63
- RuleId[RuleId["SelkieEffect"] = 61] = "SelkieEffect";
64
- RuleId[RuleId["DullahanEffect"] = 62] = "DullahanEffect";
59
+ RuleId[RuleId["IdloziEffect"] = 57] = "IdloziEffect";
60
+ RuleId[RuleId["FairyEffect"] = 58] = "FairyEffect";
61
+ RuleId[RuleId["LeprechaunEffect"] = 59] = "LeprechaunEffect";
62
+ RuleId[RuleId["SelkieEffect"] = 60] = "SelkieEffect";
63
+ RuleId[RuleId["DullahanEffect"] = 61] = "DullahanEffect";
64
+ RuleId[RuleId["Mythology"] = 1000] = "Mythology";
65
+ RuleId[RuleId["Creature"] = 1001] = "Creature";
66
+ RuleId[RuleId["Divinity"] = 1002] = "Divinity";
65
67
  })(RuleId = exports.RuleId || (exports.RuleId = {}));
@@ -0,0 +1,6 @@
1
+ import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
2
+ import { RuleId } from '../RuleId';
3
+ export declare class AmmitEffectRule extends InvokeEffectRule {
4
+ ruleId: RuleId;
5
+ getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
6
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AmmitEffectRule = void 0;
19
+ var Entity_1 = require("../../material/Entity");
20
+ var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
21
+ var LocationType_1 = require("../../material/LocationType");
22
+ var MaterialType_1 = require("../../material/MaterialType");
23
+ var Pantheon_1 = require("../../material/Pantheon");
24
+ var RuleId_1 = require("../RuleId");
25
+ var AmmitEffectRule = (function (_super) {
26
+ __extends(AmmitEffectRule, _super);
27
+ function AmmitEffectRule() {
28
+ var _this = _super !== null && _super.apply(this, arguments) || this;
29
+ _this.ruleId = RuleId_1.RuleId.AmmitEffect;
30
+ return _this;
31
+ }
32
+ AmmitEffectRule.prototype.getCardsToPlace = function () {
33
+ var mythologies = new Pantheon_1.Pantheon(this.game, this.player).missingMythologies;
34
+ return this.material(MaterialType_1.MaterialType.EntityCard)
35
+ .location(LocationType_1.LocationType.PlayerDiscard)
36
+ .id(function (id) { return mythologies.includes((0, Entity_1.entityMythology)(id.front)); });
37
+ };
38
+ return AmmitEffectRule;
39
+ }(PlaceCardEffectRule_1.InvokeEffectRule));
40
+ exports.AmmitEffectRule = AmmitEffectRule;
@@ -3,6 +3,7 @@ import { PlayerEffectRule } from '../../material/entity/Effect';
3
3
  import { RuleId } from '../RuleId';
4
4
  export declare class CyclopsEffectRule extends PlayerEffectRule {
5
5
  ruleId: RuleId;
6
+ onRuleStart(): MaterialMove<number, number, number, number>[];
6
7
  getPlayerMoves(): MaterialMove<number, number, number, number>[];
7
8
  onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
8
9
  }
@@ -32,6 +32,7 @@ var CustomMoveType_1 = require("../../CustomMoveType");
32
32
  var Effect_1 = require("../../material/entity/Effect");
33
33
  var LocationType_1 = require("../../material/LocationType");
34
34
  var Pantheon_1 = require("../../material/Pantheon");
35
+ var Memory_1 = require("../../Memory");
35
36
  var RuleId_1 = require("../RuleId");
36
37
  var CyclopsEffectRule = (function (_super) {
37
38
  __extends(CyclopsEffectRule, _super);
@@ -40,6 +41,14 @@ var CyclopsEffectRule = (function (_super) {
40
41
  _this.ruleId = RuleId_1.RuleId.CyclopsEffect;
41
42
  return _this;
42
43
  }
44
+ CyclopsEffectRule.prototype.onRuleStart = function () {
45
+ var _this = this;
46
+ this.memorize(Memory_1.Memory.OncePerTurn, function (indexes) {
47
+ if (indexes === void 0) { indexes = []; }
48
+ return indexes.concat(_this.getEffect().cardIndex);
49
+ });
50
+ return _super.prototype.onRuleStart.call(this);
51
+ };
43
52
  CyclopsEffectRule.prototype.getPlayerMoves = function () {
44
53
  var e_1, _a;
45
54
  var moves = [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
@@ -1,11 +1,8 @@
1
- import { PlaceCardEffectRule } from '../../material/entity/PlaceCardEffectRule';
2
- import { SacrificeEffectRule } from '../../material/entity/SacrificeEffectRule';
1
+ import { ItemMove } from '@gamepark/rules-api';
2
+ import { PlayerEffectRule } from '../../material/entity/Effect';
3
3
  import { RuleId } from '../RuleId';
4
- export declare class WerehyenaEffectRule extends SacrificeEffectRule {
4
+ export declare class WerehyenaEffectRule extends PlayerEffectRule {
5
5
  ruleId: RuleId;
6
- getCardsToSacrifice(): import("@gamepark/rules-api").Material<number, number, number>;
7
- onSacrifice(): import("@gamepark/rules-api").StartRule<RuleId.WerehyenaCallEffect>[];
8
- }
9
- export declare class WerehyenaCallEffectRule extends PlaceCardEffectRule {
10
- getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
6
+ getPlayerMoves(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
7
+ beforeItemMove(move: ItemMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
11
8
  }
@@ -14,9 +14,36 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __read = (this && this.__read) || function (o, n) {
18
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
19
+ if (!m) return o;
20
+ var i = m.call(o), r, ar = [], e;
21
+ try {
22
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
23
+ }
24
+ catch (error) { e = { error: error }; }
25
+ finally {
26
+ try {
27
+ if (r && !r.done && (m = i["return"])) m.call(i);
28
+ }
29
+ finally { if (e) throw e.error; }
30
+ }
31
+ return ar;
32
+ };
33
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
34
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
35
+ if (ar || !(i in from)) {
36
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
37
+ ar[i] = from[i];
38
+ }
39
+ }
40
+ return to.concat(ar || Array.prototype.slice.call(from));
41
+ };
17
42
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.WerehyenaCallEffectRule = exports.WerehyenaEffectRule = void 0;
43
+ exports.WerehyenaEffectRule = void 0;
44
+ var rules_api_1 = require("@gamepark/rules-api");
19
45
  var Entity_1 = require("../../material/Entity");
46
+ var Effect_1 = require("../../material/entity/Effect");
20
47
  var PlaceCardEffectRule_1 = require("../../material/entity/PlaceCardEffectRule");
21
48
  var SacrificeEffectRule_1 = require("../../material/entity/SacrificeEffectRule");
22
49
  var LocationType_1 = require("../../material/LocationType");
@@ -29,15 +56,33 @@ var WerehyenaEffectRule = (function (_super) {
29
56
  _this.ruleId = RuleId_1.RuleId.WerehyenaEffect;
30
57
  return _this;
31
58
  }
32
- WerehyenaEffectRule.prototype.getCardsToSacrifice = function () {
33
- return _super.prototype.getCardsToSacrifice.call(this).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
59
+ WerehyenaEffectRule.prototype.getPlayerMoves = function () {
60
+ return __spreadArray(__spreadArray([], __read(new WerehyenaSacrificeEffectRule(this.game).getPlayerMoves()), false), __read(new WerehyenaCallEffectRule(this.game).getPlayerMoves()), false);
34
61
  };
35
- WerehyenaEffectRule.prototype.onSacrifice = function () {
36
- return [this.startRule(RuleId_1.RuleId.WerehyenaCallEffect)];
62
+ WerehyenaEffectRule.prototype.beforeItemMove = function (move) {
63
+ if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
64
+ if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
65
+ return new WerehyenaSacrificeEffectRule(this.game).beforeItemMove(move);
66
+ }
67
+ else if (move.location.type === LocationType_1.LocationType.Pantheon) {
68
+ return new WerehyenaCallEffectRule(this.game).beforeItemMove(move);
69
+ }
70
+ }
71
+ return [];
37
72
  };
38
73
  return WerehyenaEffectRule;
39
- }(SacrificeEffectRule_1.SacrificeEffectRule));
74
+ }(Effect_1.PlayerEffectRule));
40
75
  exports.WerehyenaEffectRule = WerehyenaEffectRule;
76
+ var WerehyenaSacrificeEffectRule = (function (_super) {
77
+ __extends(WerehyenaSacrificeEffectRule, _super);
78
+ function WerehyenaSacrificeEffectRule() {
79
+ return _super !== null && _super.apply(this, arguments) || this;
80
+ }
81
+ WerehyenaSacrificeEffectRule.prototype.getCardsToSacrifice = function () {
82
+ return _super.prototype.getCardsToSacrifice.call(this).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
83
+ };
84
+ return WerehyenaSacrificeEffectRule;
85
+ }(SacrificeEffectRule_1.SacrificeEffectRule));
41
86
  var WerehyenaCallEffectRule = (function (_super) {
42
87
  __extends(WerehyenaCallEffectRule, _super);
43
88
  function WerehyenaCallEffectRule() {
@@ -51,4 +96,3 @@ var WerehyenaCallEffectRule = (function (_super) {
51
96
  };
52
97
  return WerehyenaCallEffectRule;
53
98
  }(PlaceCardEffectRule_1.PlaceCardEffectRule));
54
- exports.WerehyenaCallEffectRule = WerehyenaCallEffectRule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/mythologies",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "The rules of Mythologies adapted for Game Park",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",
@@ -29,5 +29,5 @@
29
29
  "i18next": "^22.0.3",
30
30
  "lodash": "^4.17.21"
31
31
  },
32
- "gitHead": "f76b0aacdbd5c018c996cbb4174953c54206539e"
32
+ "gitHead": "c14d682186f3955885026c16a9446734b4002eb0"
33
33
  }