@gamepark/mythologies 0.8.0 → 0.8.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.
- package/dist/material/Destiny.d.ts +6 -3
- package/dist/material/Destiny.js +16 -3
- package/dist/material/entity/hindu/Asura.js +1 -1
- package/dist/rules/PlaceTokenRule.d.ts +1 -3
- package/dist/rules/PlaceTokenRule.js +6 -9
- package/dist/rules/effects/RakshasaEffectRule.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { MaterialRulesPart } from '@gamepark/rules-api';
|
|
2
2
|
import { PlayerColor } from '../PlayerColor';
|
|
3
|
+
import { Mythology } from './Mythology';
|
|
3
4
|
export declare class Destiny extends MaterialRulesPart {
|
|
4
|
-
get mythologies():
|
|
5
|
+
get mythologies(): Mythology[];
|
|
5
6
|
getMythologyBoard(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
6
|
-
getMythology(player: PlayerColor):
|
|
7
|
+
getMythology(player: PlayerColor): Mythology;
|
|
7
8
|
getDestinyMap(destiny: number): PlayerColor[][];
|
|
8
9
|
get cardsWithoutToken(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
9
|
-
|
|
10
|
+
getAvailableCards(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
11
|
+
getAvailableCardsOnBoard(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
12
|
+
getTopDeckCreature(mythology: Mythology): import("@gamepark/rules-api").MaterialDeck<number, number, number>;
|
|
10
13
|
getBoardsWithoutPlayer(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
11
14
|
get creaturesOnTopOfDecks(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
12
15
|
}
|
package/dist/material/Destiny.js
CHANGED
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.Destiny = void 0;
|
|
19
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
20
|
var PlayerColor_1 = require("../PlayerColor");
|
|
21
|
+
var Entity_1 = require("./Entity");
|
|
21
22
|
var LocationType_1 = require("./LocationType");
|
|
22
23
|
var MaterialType_1 = require("./MaterialType");
|
|
23
24
|
var Destiny = (function (_super) {
|
|
@@ -82,9 +83,21 @@ var Destiny = (function (_super) {
|
|
|
82
83
|
enumerable: false,
|
|
83
84
|
configurable: true
|
|
84
85
|
});
|
|
85
|
-
Destiny.prototype.
|
|
86
|
-
var
|
|
87
|
-
|
|
86
|
+
Destiny.prototype.getAvailableCards = function (player) {
|
|
87
|
+
var entities = this.getAvailableCardsOnBoard(player);
|
|
88
|
+
if (entities.getItems().some(function (item) { return (0, Entity_1.isCreature)(item.id.front); })) {
|
|
89
|
+
return entities;
|
|
90
|
+
}
|
|
91
|
+
var topDeckCreature = this.getTopDeckCreature(this.getMythology(player));
|
|
92
|
+
var indexes = entities.getIndexes().concat(topDeckCreature.getIndex());
|
|
93
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).index(indexes);
|
|
94
|
+
};
|
|
95
|
+
Destiny.prototype.getAvailableCardsOnBoard = function (player) {
|
|
96
|
+
var boardCards = this.cardsWithoutToken.location(function (l) { return l.type === LocationType_1.LocationType.SanctuaryGodSpot || l.type === LocationType_1.LocationType.SanctuaryCreatureSpot; });
|
|
97
|
+
return boardCards.parent(this.getMythologyBoard(player).getIndex());
|
|
98
|
+
};
|
|
99
|
+
Destiny.prototype.getTopDeckCreature = function (mythology) {
|
|
100
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).locationId(mythology).deck();
|
|
88
101
|
};
|
|
89
102
|
Destiny.prototype.getBoardsWithoutPlayer = function () {
|
|
90
103
|
var _this = this;
|
|
@@ -54,7 +54,7 @@ exports.Asura = {
|
|
|
54
54
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
55
55
|
}
|
|
56
56
|
AsuraEffectRule.prototype.playEffect = function () {
|
|
57
|
-
var cardsToExile = new Destiny_1.Destiny(this.game).
|
|
57
|
+
var cardsToExile = new Destiny_1.Destiny(this.game).getAvailableCardsOnBoard(this.player);
|
|
58
58
|
if (!cardsToExile.length)
|
|
59
59
|
return [];
|
|
60
60
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ItemMove, MaterialMove, SimultaneousRule } from '@gamepark/rules-api';
|
|
2
2
|
import { EntityItem } from '../material/Entity';
|
|
3
|
-
import { Mythology } from '../material/Mythology';
|
|
4
3
|
import { PlayerColor } from '../PlayerColor';
|
|
5
4
|
import { RuleId } from './RuleId';
|
|
6
5
|
export declare class PlaceTokenRule extends SimultaneousRule {
|
|
7
6
|
onRuleStart(): MaterialMove<number, number, number, number>[];
|
|
8
7
|
getActivePlayerLegalMoves(player: PlayerColor): import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
9
|
-
getAvailableCards(player: PlayerColor): number
|
|
10
|
-
getTopDeckCreature(mythology: Mythology): number;
|
|
8
|
+
getAvailableCards(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
11
9
|
afterItemMove(move: ItemMove): import("@gamepark/rules-api").EndPlayerTurn<PlayerColor>[];
|
|
12
10
|
getMovesAfterPlayersDone(): import("@gamepark/rules-api").StartRule<RuleId.DrawDestinyCard>[] | (import("@gamepark/rules-api").MoveItem<number, number, number> | import("@gamepark/rules-api").StartPlayerTurn<number, RuleId.PlaceCards>)[];
|
|
13
11
|
getMythologyBoardIndex(item: EntityItem): number;
|
|
@@ -92,22 +92,19 @@ var PlaceTokenRule = (function (_super) {
|
|
|
92
92
|
.location(LocationType_1.LocationType.PlayedTokenSpot);
|
|
93
93
|
if (!token.length)
|
|
94
94
|
return [];
|
|
95
|
-
return this.getAvailableCards(player)
|
|
95
|
+
return this.getAvailableCards(player)
|
|
96
|
+
.getIndexes()
|
|
97
|
+
.map(function (parent) { return token.moveItem({ type: LocationType_1.LocationType.OnEntityCard, parent: parent }); });
|
|
96
98
|
};
|
|
97
99
|
PlaceTokenRule.prototype.getAvailableCards = function (player) {
|
|
98
100
|
var destiny = new Destiny_1.Destiny(this.game);
|
|
99
101
|
var mythology = destiny.getMythology(player);
|
|
100
102
|
if (this.remind(Memory_1.Memory.TargetMythology) === mythology && !new Pantheon_1.Pantheon(this.game, player).hasEntity(Entity_1.Entity.Odin)) {
|
|
101
|
-
return
|
|
103
|
+
return destiny.getTopDeckCreature(mythology);
|
|
102
104
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return entities.getIndexes().concat(this.getTopDeckCreature(mythology));
|
|
105
|
+
else {
|
|
106
|
+
return destiny.getAvailableCards(player);
|
|
106
107
|
}
|
|
107
|
-
return entities.getIndexes();
|
|
108
|
-
};
|
|
109
|
-
PlaceTokenRule.prototype.getTopDeckCreature = function (mythology) {
|
|
110
|
-
return this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).locationId(mythology).deck().getIndex();
|
|
111
108
|
};
|
|
112
109
|
PlaceTokenRule.prototype.afterItemMove = function (move) {
|
|
113
110
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.DraftToken)(move) && move.location.type === LocationType_1.LocationType.OnEntityCard) {
|
|
@@ -36,7 +36,7 @@ var RakshasaEffectRule = (function (_super) {
|
|
|
36
36
|
return [new Pantheon_1.Pantheon(this.game, this.player).spendGems(1)];
|
|
37
37
|
};
|
|
38
38
|
RakshasaEffectRule.prototype.getCardsToPlace = function () {
|
|
39
|
-
return new Destiny_1.Destiny(this.game).
|
|
39
|
+
return new Destiny_1.Destiny(this.game).getAvailableCards(this.player);
|
|
40
40
|
};
|
|
41
41
|
RakshasaEffectRule.prototype.getAvailableDestinations = function (cardIndex) {
|
|
42
42
|
var location = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.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": "
|
|
32
|
+
"gitHead": "c165b112d35146faa43a2fef4be62ee710c4ec22"
|
|
33
33
|
}
|