@gamepark/mythologies 0.7.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.
@@ -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)
@@ -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
@@ -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 }));
@@ -56,5 +56,8 @@ export declare enum RuleId {
56
56
  FairyEffect = 58,
57
57
  LeprechaunEffect = 59,
58
58
  SelkieEffect = 60,
59
- DullahanEffect = 61
59
+ DullahanEffect = 61,
60
+ Mythology = 1000,
61
+ Creature = 1001,
62
+ Divinity = 1002
60
63
  }
@@ -61,4 +61,7 @@ var RuleId;
61
61
  RuleId[RuleId["LeprechaunEffect"] = 59] = "LeprechaunEffect";
62
62
  RuleId[RuleId["SelkieEffect"] = 60] = "SelkieEffect";
63
63
  RuleId[RuleId["DullahanEffect"] = 61] = "DullahanEffect";
64
+ RuleId[RuleId["Mythology"] = 1000] = "Mythology";
65
+ RuleId[RuleId["Creature"] = 1001] = "Creature";
66
+ RuleId[RuleId["Divinity"] = 1002] = "Divinity";
64
67
  })(RuleId = exports.RuleId || (exports.RuleId = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/mythologies",
3
- "version": "0.7.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": "ad6cfe5b8d58ff7701ca5d7f5ae17f02914edfab"
32
+ "gitHead": "c14d682186f3955885026c16a9446734b4002eb0"
33
33
  }