@gamepark/mythologies 0.4.0 → 0.5.0
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/Memory.d.ts +9 -6
- package/dist/Memory.js +9 -6
- package/dist/MythologiesRules.d.ts +42 -32
- package/dist/MythologiesRules.js +10 -0
- package/dist/MythologiesSetup.js +1 -1
- package/dist/material/Entity.d.ts +5 -1
- package/dist/material/Entity.js +1 -1
- package/dist/material/Mythology.d.ts +0 -1
- package/dist/material/Mythology.js +1 -3
- package/dist/material/Pantheon.d.ts +11 -6
- package/dist/material/Pantheon.js +97 -48
- package/dist/material/entity/Effect.d.ts +20 -12
- package/dist/material/entity/Effect.js +4 -5
- package/dist/material/entity/EntityDescription.d.ts +2 -0
- package/dist/material/entity/EntityDescription.js +6 -3
- package/dist/material/entity/MoveEffectRule.d.ts +4 -1
- package/dist/material/entity/MoveEffectRule.js +53 -6
- package/dist/material/entity/PlaceCardEffectRule.js +4 -27
- package/dist/material/entity/SacrificeEffectRule.d.ts +2 -1
- package/dist/material/entity/SacrificeEffectRule.js +15 -37
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +8 -2
- package/dist/material/entity/SimultaneousMoveEffectRule.js +43 -11
- package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +1 -0
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +12 -35
- package/dist/material/entity/celtic/Banshee.js +33 -1
- package/dist/material/entity/celtic/Brigid.js +34 -1
- package/dist/material/entity/celtic/Cernunnos.js +37 -1
- package/dist/material/entity/celtic/Dagda.js +43 -1
- package/dist/material/entity/celtic/Dullahan.js +7 -1
- package/dist/material/entity/celtic/Fairy.d.ts +2 -0
- package/dist/material/entity/celtic/Fairy.js +12 -0
- package/dist/material/entity/celtic/Kelpie.js +33 -1
- package/dist/material/entity/celtic/Leprechaun.js +7 -1
- package/dist/material/entity/celtic/Morrigan.js +6 -1
- package/dist/material/entity/celtic/Selkie.js +12 -1
- package/dist/material/entity/egyptian/Beetle.js +19 -13
- package/dist/material/entity/hindu/Naga.js +36 -30
- package/dist/material/entity/norse/Troll.js +4 -1
- package/dist/material/entity/zulu/Tokoloshe.js +22 -17
- package/dist/rules/PlaceCardsRule.js +3 -2
- package/dist/rules/RuleId.d.ts +37 -32
- package/dist/rules/RuleId.js +37 -32
- package/dist/rules/effects/AthenaEffectRule.js +29 -1
- package/dist/rules/effects/CentaurEffectRule.d.ts +5 -3
- package/dist/rules/effects/CentaurEffectRule.js +90 -14
- package/dist/rules/effects/CondorEffectRule.d.ts +1 -1
- package/dist/rules/effects/CondorEffectRule.js +5 -1
- package/dist/rules/effects/DullahanEffectRule.d.ts +11 -0
- package/dist/rules/effects/DullahanEffectRule.js +73 -0
- package/dist/rules/effects/FairyEffectRule.d.ts +10 -0
- package/dist/rules/effects/FairyEffectRule.js +55 -0
- package/dist/rules/effects/FenrirEffectRule.js +2 -1
- package/dist/rules/effects/GarudaEffectRule.d.ts +1 -1
- package/dist/rules/effects/GarudaEffectRule.js +3 -2
- package/dist/rules/effects/GorgonEffectRule.d.ts +1 -1
- package/dist/rules/effects/GorgonEffectRule.js +2 -26
- package/dist/rules/effects/HadesEffectRule.d.ts +8 -4
- package/dist/rules/effects/HadesEffectRule.js +12 -50
- package/dist/rules/effects/IdloziEffectRule.d.ts +2 -2
- package/dist/rules/effects/IdloziEffectRule.js +4 -1
- package/dist/rules/effects/IllapaEffectRule.d.ts +1 -1
- package/dist/rules/effects/IllapaEffectRule.js +1 -1
- package/dist/rules/effects/JiangshiEffectRule.d.ts +1 -1
- package/dist/rules/effects/JiangshiEffectRule.js +6 -27
- package/dist/rules/effects/LeprechaunEffectRule.d.ts +9 -0
- package/dist/rules/effects/LeprechaunEffectRule.js +49 -0
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.d.ts +13 -0
- package/dist/rules/effects/MultipleSimultaneousMoveEffectRule.js +160 -0
- package/dist/rules/effects/PermanentEffectsRule.d.ts +7 -0
- package/dist/rules/effects/PermanentEffectsRule.js +54 -0
- package/dist/rules/effects/QilinEffectRule.js +6 -5
- package/dist/rules/effects/RaEffectRule.d.ts +8 -4
- package/dist/rules/effects/RaEffectRule.js +12 -50
- package/dist/rules/effects/ResolveEffectsRule.js +1 -1
- package/dist/rules/effects/SelkieEffectRule.d.ts +8 -0
- package/dist/rules/effects/SelkieEffectRule.js +44 -0
- package/dist/rules/effects/ShivaEffectRule.d.ts +2 -2
- package/dist/rules/effects/ShivaEffectRule.js +16 -36
- package/dist/rules/effects/SphinxEffectRule.d.ts +2 -2
- package/dist/rules/effects/SphinxEffectRule.js +4 -1
- package/dist/rules/effects/TianlongEffectRule.d.ts +2 -3
- package/dist/rules/effects/TianlongEffectRule.js +33 -39
- package/dist/rules/effects/TriggerEffectsRule.d.ts +1 -1
- package/dist/rules/effects/TriggerEffectsRule.js +36 -18
- package/dist/rules/effects/VetalaEffectRule.d.ts +3 -2
- package/dist/rules/effects/VetalaEffectRule.js +10 -5
- package/dist/rules/effects/ViracochaEffectRule.d.ts +1 -1
- package/dist/rules/effects/ViracochaEffectRule.js +2 -26
- package/package.json +2 -2
|
@@ -14,39 +14,16 @@ 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
|
-
};
|
|
42
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
18
|
exports.JiangshiEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
45
21
|
var Effect_1 = require("../../material/entity/Effect");
|
|
46
22
|
var LocationType_1 = require("../../material/LocationType");
|
|
47
23
|
var MaterialType_1 = require("../../material/MaterialType");
|
|
48
24
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
49
25
|
var RuleId_1 = require("../RuleId");
|
|
26
|
+
var PermanentEffectsRule_1 = require("./PermanentEffectsRule");
|
|
50
27
|
var JiangshiEffectRule = (function (_super) {
|
|
51
28
|
__extends(JiangshiEffectRule, _super);
|
|
52
29
|
function JiangshiEffectRule() {
|
|
@@ -58,7 +35,8 @@ var JiangshiEffectRule = (function (_super) {
|
|
|
58
35
|
var _this = this;
|
|
59
36
|
var location = this.card.location;
|
|
60
37
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
61
|
-
var
|
|
38
|
+
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
39
|
+
var piles = pantheon.getPiles(function (space) { return space.y === location.y; }).filter(function (pile) { return rule.canSacrifice(pile.maxBy(function (item) { return item.location.z; }).getItem()); });
|
|
62
40
|
return piles.map(function (pile) { return pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerDiscard, player: _this.player }); });
|
|
63
41
|
};
|
|
64
42
|
JiangshiEffectRule.prototype.beforeItemMove = function (move) {
|
|
@@ -67,7 +45,8 @@ var JiangshiEffectRule = (function (_super) {
|
|
|
67
45
|
var topCard = this.material(MaterialType_1.MaterialType.EntityCard)
|
|
68
46
|
.index(move.indexes)
|
|
69
47
|
.maxBy(function (item) { return item.location.z; });
|
|
70
|
-
|
|
48
|
+
pantheon.onEntitySacrificed(topCard);
|
|
49
|
+
return [pantheon.gainGems(2), this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
71
50
|
}
|
|
72
51
|
return [];
|
|
73
52
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class LeprechaunEffectRule extends PlayerEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
canPlayEffect(cardIndex: number): boolean;
|
|
7
|
+
getPlayerMoves(cardIndex?: number): import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
8
|
+
afterItemMove(move: ItemMove): import("@gamepark/rules-api").CustomMove<number>[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.LeprechaunEffectRule = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
21
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
22
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
23
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
24
|
+
var RuleId_1 = require("../RuleId");
|
|
25
|
+
var LeprechaunEffectRule = (function (_super) {
|
|
26
|
+
__extends(LeprechaunEffectRule, _super);
|
|
27
|
+
function LeprechaunEffectRule() {
|
|
28
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
_this.ruleId = RuleId_1.RuleId.LeprechaunEffect;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
LeprechaunEffectRule.prototype.canPlayEffect = function (cardIndex) {
|
|
33
|
+
return this.getPlayerMoves(cardIndex).length > 0;
|
|
34
|
+
};
|
|
35
|
+
LeprechaunEffectRule.prototype.getPlayerMoves = function (cardIndex) {
|
|
36
|
+
if (cardIndex === void 0) { cardIndex = this.getEffect().cardIndex; }
|
|
37
|
+
var _a = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location, x = _a.x, y = _a.y, player = _a.player;
|
|
38
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
39
|
+
return pantheon.gainLineBonus(y).concat(pantheon.gainColumnBonus(x));
|
|
40
|
+
};
|
|
41
|
+
LeprechaunEffectRule.prototype.afterItemMove = function (move) {
|
|
42
|
+
if ((0, rules_api_1.isMoveItem)(move) && (move.itemType === MaterialType_1.MaterialType.GemToken || move.itemType === MaterialType_1.MaterialType.FavorToken)) {
|
|
43
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
44
|
+
}
|
|
45
|
+
return [];
|
|
46
|
+
};
|
|
47
|
+
return LeprechaunEffectRule;
|
|
48
|
+
}(Effect_1.PlayerEffectRule));
|
|
49
|
+
exports.LeprechaunEffectRule = LeprechaunEffectRule;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MaterialMove, MoveItem } from '@gamepark/rules-api';
|
|
2
|
+
import { SimultaneousMoveEffectRule } from '../../material/entity/SimultaneousMoveEffectRule';
|
|
3
|
+
import { PlayerColor } from '../../PlayerColor';
|
|
4
|
+
export declare abstract class MultipleSimultaneousMoveEffectRule extends SimultaneousMoveEffectRule {
|
|
5
|
+
playEffect(): MaterialMove[];
|
|
6
|
+
getTargetEntitiesAbleToMove(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
7
|
+
getTargetEntities(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
+
getEffectCount(player: PlayerColor): number;
|
|
9
|
+
getMovingCards(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
10
|
+
onCardMoved(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
11
|
+
onCardSacrificed(move: MoveItem): MaterialMove[];
|
|
12
|
+
onRuleEnd(): never[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
var __values = (this && this.__values) || function(o) {
|
|
18
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
+
if (m) return m.call(o);
|
|
20
|
+
if (o && typeof o.length === "number") return {
|
|
21
|
+
next: function () {
|
|
22
|
+
if (o && i >= o.length) o = void 0;
|
|
23
|
+
return { value: o && o[i++], done: !o };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
+
};
|
|
28
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
29
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
+
if (!m) return o;
|
|
31
|
+
var i = m.call(o), r, ar = [], e;
|
|
32
|
+
try {
|
|
33
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
+
}
|
|
35
|
+
catch (error) { e = { error: error }; }
|
|
36
|
+
finally {
|
|
37
|
+
try {
|
|
38
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
+
}
|
|
40
|
+
finally { if (e) throw e.error; }
|
|
41
|
+
}
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
45
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
46
|
+
if (ar || !(i in from)) {
|
|
47
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
48
|
+
ar[i] = from[i];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.MultipleSimultaneousMoveEffectRule = void 0;
|
|
55
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
56
|
+
var SimultaneousMoveEffectRule_1 = require("../../material/entity/SimultaneousMoveEffectRule");
|
|
57
|
+
var LocationType_1 = require("../../material/LocationType");
|
|
58
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
59
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
60
|
+
var Memory_1 = require("../../Memory");
|
|
61
|
+
var TriggerEffectsRule_1 = require("./TriggerEffectsRule");
|
|
62
|
+
var MultipleSimultaneousMoveEffectRule = (function (_super) {
|
|
63
|
+
__extends(MultipleSimultaneousMoveEffectRule, _super);
|
|
64
|
+
function MultipleSimultaneousMoveEffectRule() {
|
|
65
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
66
|
+
}
|
|
67
|
+
MultipleSimultaneousMoveEffectRule.prototype.playEffect = function () {
|
|
68
|
+
var e_1, _a;
|
|
69
|
+
var _this = this;
|
|
70
|
+
var moves = [];
|
|
71
|
+
var playersToActivate = [];
|
|
72
|
+
var _loop_1 = function (player) {
|
|
73
|
+
var e_2, _d;
|
|
74
|
+
var effectCount = this_1.getEffectCount(player);
|
|
75
|
+
var targetEntities = this_1.getTargetEntitiesAbleToMove(player);
|
|
76
|
+
var pantheon = new Pantheon_1.Pantheon(this_1.game, player);
|
|
77
|
+
var canSacrificeToPreventMove = targetEntities.length > 0 && effectCount > 0 && pantheon.sacrificeToPreventMove().length > 0;
|
|
78
|
+
if (canSacrificeToPreventMove ||
|
|
79
|
+
effectCount < targetEntities.length ||
|
|
80
|
+
targetEntities.getItems().some(function (entity) { return _this.getAvailableDestinations(player, entity).length > 1; })) {
|
|
81
|
+
this_1.memorize(Memory_1.Memory.TargetEntities, targetEntities.getIndexes(), player);
|
|
82
|
+
this_1.memorize(Memory_1.Memory.EffectCount, effectCount, player);
|
|
83
|
+
playersToActivate.push(player);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
try {
|
|
87
|
+
for (var _e = (e_2 = void 0, __values(targetEntities.getIndexes())), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
88
|
+
var index = _f.value;
|
|
89
|
+
var card = targetEntities.index(index);
|
|
90
|
+
var destinations = this_1.getAvailableDestinations(player, card.getItem());
|
|
91
|
+
if (destinations.length) {
|
|
92
|
+
var _g = destinations[0], x = _g.x, y = _g.y;
|
|
93
|
+
moves.push(card.moveItem({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y }));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
98
|
+
finally {
|
|
99
|
+
try {
|
|
100
|
+
if (_f && !_f.done && (_d = _e.return)) _d.call(_e);
|
|
101
|
+
}
|
|
102
|
+
finally { if (e_2) throw e_2.error; }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var this_1 = this;
|
|
107
|
+
try {
|
|
108
|
+
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
109
|
+
var player = _c.value;
|
|
110
|
+
_loop_1(player);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
114
|
+
finally {
|
|
115
|
+
try {
|
|
116
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
117
|
+
}
|
|
118
|
+
finally { if (e_1) throw e_1.error; }
|
|
119
|
+
}
|
|
120
|
+
if (this.ruleId && playersToActivate.length) {
|
|
121
|
+
moves.push(this.startSimultaneousRule(this.ruleId, playersToActivate));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
moves.push.apply(moves, __spreadArray([], __read(this.updatePlayersGrids()), false));
|
|
125
|
+
}
|
|
126
|
+
return moves;
|
|
127
|
+
};
|
|
128
|
+
MultipleSimultaneousMoveEffectRule.prototype.getTargetEntitiesAbleToMove = function (player) {
|
|
129
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
130
|
+
return this.getTargetEntities(player).filter(function (item) { return pantheon.isAbleToMove(item); });
|
|
131
|
+
};
|
|
132
|
+
MultipleSimultaneousMoveEffectRule.prototype.getTargetEntities = function (player) {
|
|
133
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
134
|
+
return pantheon.visibleEntities;
|
|
135
|
+
};
|
|
136
|
+
MultipleSimultaneousMoveEffectRule.prototype.getEffectCount = function (player) {
|
|
137
|
+
return this.getTargetEntitiesAbleToMove(player).length;
|
|
138
|
+
};
|
|
139
|
+
MultipleSimultaneousMoveEffectRule.prototype.getMovingCards = function (player) {
|
|
140
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).index(this.remind(Memory_1.Memory.TargetEntities, player));
|
|
141
|
+
};
|
|
142
|
+
MultipleSimultaneousMoveEffectRule.prototype.onCardMoved = function (move) {
|
|
143
|
+
this.memorize(Memory_1.Memory.TargetEntities, function (entities) { return entities.filter(function (index) { return index !== move.itemIndex; }); }, move.location.player);
|
|
144
|
+
var count = this.memorize(Memory_1.Memory.EffectCount, function (count) { return count - 1; }, move.location.player);
|
|
145
|
+
return count ? [] : [this.endPlayerTurn(move.location.player)];
|
|
146
|
+
};
|
|
147
|
+
MultipleSimultaneousMoveEffectRule.prototype.onCardSacrificed = function (move) {
|
|
148
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
149
|
+
new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntitySacrificed, card: card.getItem(), cardIndex: card.getIndex() });
|
|
150
|
+
return this.onCardMoved(move);
|
|
151
|
+
};
|
|
152
|
+
MultipleSimultaneousMoveEffectRule.prototype.onRuleEnd = function () {
|
|
153
|
+
this.forget(Memory_1.Memory.EntityMoved);
|
|
154
|
+
this.forget(Memory_1.Memory.TargetEntities);
|
|
155
|
+
this.forget(Memory_1.Memory.EffectCount);
|
|
156
|
+
return [];
|
|
157
|
+
};
|
|
158
|
+
return MultipleSimultaneousMoveEffectRule;
|
|
159
|
+
}(SimultaneousMoveEffectRule_1.SimultaneousMoveEffectRule));
|
|
160
|
+
exports.MultipleSimultaneousMoveEffectRule = MultipleSimultaneousMoveEffectRule;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MaterialRulesPart } from '@gamepark/rules-api';
|
|
2
|
+
import { EntityItem } from '../../material/Entity';
|
|
3
|
+
export declare class PermanentEffectsRule extends MaterialRulesPart {
|
|
4
|
+
canSacrifice(card: EntityItem): boolean;
|
|
5
|
+
canCrush(card: EntityItem): boolean;
|
|
6
|
+
canMove(card: EntityItem): boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.PermanentEffectsRule = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
21
|
+
var EntityDescription_1 = require("../../material/entity/EntityDescription");
|
|
22
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
23
|
+
var PermanentEffectsRule = (function (_super) {
|
|
24
|
+
__extends(PermanentEffectsRule, _super);
|
|
25
|
+
function PermanentEffectsRule() {
|
|
26
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
+
}
|
|
28
|
+
PermanentEffectsRule.prototype.canSacrifice = function (card) {
|
|
29
|
+
var _this = this;
|
|
30
|
+
return !this.game.players.some(function (player) {
|
|
31
|
+
return new Pantheon_1.Pantheon(_this.game, player).visibleEntities
|
|
32
|
+
.getItems()
|
|
33
|
+
.some(function (effectCard) { return (0, EntityDescription_1.getEffects)(effectCard.id.front).some(function (effect) { var _a; return !(0, Effect_1.isTriggeredEffect)(effect) && ((_a = effect.preventSacrifice) === null || _a === void 0 ? void 0 : _a.call(effect, card, effectCard)); }); });
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
PermanentEffectsRule.prototype.canCrush = function (card) {
|
|
37
|
+
var _this = this;
|
|
38
|
+
return !this.game.players.some(function (player) {
|
|
39
|
+
return new Pantheon_1.Pantheon(_this.game, player).visibleEntities
|
|
40
|
+
.getItems()
|
|
41
|
+
.some(function (effectCard) { return (0, EntityDescription_1.getEffects)(effectCard.id.front).some(function (effect) { var _a; return !(0, Effect_1.isTriggeredEffect)(effect) && ((_a = effect.preventCrush) === null || _a === void 0 ? void 0 : _a.call(effect, card, effectCard)); }); });
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
PermanentEffectsRule.prototype.canMove = function (card) {
|
|
45
|
+
var _this = this;
|
|
46
|
+
return !this.game.players.some(function (player) {
|
|
47
|
+
return new Pantheon_1.Pantheon(_this.game, player).visibleEntities
|
|
48
|
+
.getItems()
|
|
49
|
+
.some(function (effectCard) { return (0, EntityDescription_1.getEffects)(effectCard.id.front).some(function (effect) { var _a; return !(0, Effect_1.isTriggeredEffect)(effect) && ((_a = effect.preventMove) === null || _a === void 0 ? void 0 : _a.call(effect, card, effectCard)); }); });
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return PermanentEffectsRule;
|
|
53
|
+
}(rules_api_1.MaterialRulesPart));
|
|
54
|
+
exports.PermanentEffectsRule = PermanentEffectsRule;
|
|
@@ -78,10 +78,9 @@ var QilinEffectRule = (function (_super) {
|
|
|
78
78
|
cardsToCopy.push.apply(cardsToCopy, __spreadArray([], __read(new Pantheon_1.Pantheon(this.game, player).visibleEntities
|
|
79
79
|
.location(function (l) { return l.x === _this.card.location.x; })
|
|
80
80
|
.id(function (id) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return (0, Entity_1.isCreature)(entity) && trigger === Effect_1.isPlaced && entity !== Entity_1.Entity.Qilin;
|
|
81
|
+
return (0, Entity_1.isCreature)(id.front) &&
|
|
82
|
+
id.front !== Entity_1.Entity.Qilin &&
|
|
83
|
+
(0, EntityDescription_1.getEffects)(id.front).some(function (effect) { return (0, Effect_1.isTriggeredEffect)(effect) && effect.trigger === Effect_1.isPlaced; });
|
|
85
84
|
})
|
|
86
85
|
.getIndexes()), false));
|
|
87
86
|
}
|
|
@@ -99,7 +98,9 @@ var QilinEffectRule = (function (_super) {
|
|
|
99
98
|
QilinEffectRule.prototype.onCustomMove = function (move) {
|
|
100
99
|
if (move.type === CustomMoveType_1.CustomMoveType.ChooseEntityCard) {
|
|
101
100
|
var card = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.data);
|
|
102
|
-
var effect = EntityDescription_1.
|
|
101
|
+
var effect = (0, EntityDescription_1.getEffects)(card.id.front)
|
|
102
|
+
.filter(Effect_1.isTriggeredEffect)
|
|
103
|
+
.find(function (effect) { return effect.trigger === Effect_1.isPlaced; });
|
|
103
104
|
var moves = new effect.rule(this.game).playEffect();
|
|
104
105
|
if (!moves.some(function (move) { return move.kind === rules_api_1.MoveKind.RulesMove; })) {
|
|
105
106
|
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Location, XYCoordinates } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerColor } from '../../PlayerColor';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
import { MultipleSimultaneousMoveEffectRule } from './MultipleSimultaneousMoveEffectRule';
|
|
5
|
+
export declare class RaEffectRule extends MultipleSimultaneousMoveEffectRule {
|
|
6
|
+
ruleId: RuleId;
|
|
7
|
+
getTargetEntities(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
+
isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
|
|
5
9
|
}
|
|
@@ -14,64 +14,26 @@ 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 __values = (this && this.__values) || function(o) {
|
|
18
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
-
if (m) return m.call(o);
|
|
20
|
-
if (o && typeof o.length === "number") return {
|
|
21
|
-
next: function () {
|
|
22
|
-
if (o && i >= o.length) o = void 0;
|
|
23
|
-
return { value: o && o[i++], done: !o };
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
-
};
|
|
28
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
18
|
exports.RaEffectRule = void 0;
|
|
30
19
|
var Entity_1 = require("../../material/Entity");
|
|
31
|
-
var SimultaneousMoveEffectRule_1 = require("../../material/entity/SimultaneousMoveEffectRule");
|
|
32
|
-
var LocationType_1 = require("../../material/LocationType");
|
|
33
20
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
21
|
+
var RuleId_1 = require("../RuleId");
|
|
22
|
+
var MultipleSimultaneousMoveEffectRule_1 = require("./MultipleSimultaneousMoveEffectRule");
|
|
34
23
|
var RaEffectRule = (function (_super) {
|
|
35
24
|
__extends(RaEffectRule, _super);
|
|
36
25
|
function RaEffectRule() {
|
|
37
|
-
|
|
26
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
27
|
+
_this.ruleId = RuleId_1.RuleId.RaEffect;
|
|
28
|
+
return _this;
|
|
38
29
|
}
|
|
39
|
-
RaEffectRule.prototype.
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
46
|
-
var entities = pantheon.visibleEntities;
|
|
47
|
-
try {
|
|
48
|
-
for (var _e = (e_2 = void 0, __values(entities.getIndexes())), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
49
|
-
var index = _f.value;
|
|
50
|
-
var entity = entities.getItem(index);
|
|
51
|
-
var _g = entity.location, x = _g.x, y = _g.y;
|
|
52
|
-
if (y !== 0 && !(0, Entity_1.isGod)(entity.id.front) && pantheon.isFreeSpace({ x: x, y: y - 1 })) {
|
|
53
|
-
moves.push(entities.index(index).moveItem({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y - 1 }));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
58
|
-
finally {
|
|
59
|
-
try {
|
|
60
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
61
|
-
}
|
|
62
|
-
finally { if (e_2) throw e_2.error; }
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
67
|
-
finally {
|
|
68
|
-
try {
|
|
69
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
70
|
-
}
|
|
71
|
-
finally { if (e_1) throw e_1.error; }
|
|
72
|
-
}
|
|
73
|
-
return moves;
|
|
30
|
+
RaEffectRule.prototype.getTargetEntities = function (player) {
|
|
31
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
32
|
+
return pantheon.visibleEntities.id(function (id) { return !(0, Entity_1.isGod)(id.front); }).location(function (l) { return l.y > 0 && pantheon.isFreeSpace({ x: l.x, y: l.y - 1 }); });
|
|
33
|
+
};
|
|
34
|
+
RaEffectRule.prototype.isLegalDestination = function (space, cardLocation) {
|
|
35
|
+
return cardLocation.x === space.x && cardLocation.y === space.y + 1;
|
|
74
36
|
};
|
|
75
37
|
return RaEffectRule;
|
|
76
|
-
}(
|
|
38
|
+
}(MultipleSimultaneousMoveEffectRule_1.MultipleSimultaneousMoveEffectRule));
|
|
77
39
|
exports.RaEffectRule = RaEffectRule;
|
|
@@ -58,7 +58,7 @@ var ResolveEffectsRule = (function (_super) {
|
|
|
58
58
|
ResolveEffectsRule.prototype.playEffect = function (pendingEffect) {
|
|
59
59
|
this.memorize(Memory_1.Memory.OngoingEffect, pendingEffect);
|
|
60
60
|
var card = this.material(MaterialType_1.MaterialType.EntityCard).getItem(pendingEffect.cardIndex);
|
|
61
|
-
var effect = EntityDescription_1.
|
|
61
|
+
var effect = (0, EntityDescription_1.getEffects)(card.id.front)[pendingEffect.effectIndex];
|
|
62
62
|
if (effect.trigger === Effect_1.oncePerTurn) {
|
|
63
63
|
this.memorize(Memory_1.Memory.OncePerTurn, function (indexes) {
|
|
64
64
|
if (indexes === void 0) { indexes = []; }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ItemMove } from '@gamepark/rules-api';
|
|
2
|
+
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
3
|
+
import { RuleId } from '../RuleId';
|
|
4
|
+
export declare class SelkieEffectRule extends PlayerEffectRule {
|
|
5
|
+
ruleId: RuleId;
|
|
6
|
+
getPlayerMoves(): import("@gamepark/rules-api").CreateItem<number, number, number>[];
|
|
7
|
+
afterItemMove(move: ItemMove): import("@gamepark/rules-api").CustomMove<number>[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.SelkieEffectRule = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
21
|
+
var Effect_1 = require("../../material/entity/Effect");
|
|
22
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
23
|
+
var Pantheon_1 = require("../../material/Pantheon");
|
|
24
|
+
var RuleId_1 = require("../RuleId");
|
|
25
|
+
var SelkieEffectRule = (function (_super) {
|
|
26
|
+
__extends(SelkieEffectRule, _super);
|
|
27
|
+
function SelkieEffectRule() {
|
|
28
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
_this.ruleId = RuleId_1.RuleId.SelkieEffect;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
SelkieEffectRule.prototype.getPlayerMoves = function () {
|
|
33
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
34
|
+
return [pantheon.gainFavor(1), pantheon.gainGems(1)];
|
|
35
|
+
};
|
|
36
|
+
SelkieEffectRule.prototype.afterItemMove = function (move) {
|
|
37
|
+
if ((0, rules_api_1.isCreateItemType)(MaterialType_1.MaterialType.GemToken)(move) || (0, rules_api_1.isCreateItemType)(MaterialType_1.MaterialType.FavorToken)(move)) {
|
|
38
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
39
|
+
}
|
|
40
|
+
return [];
|
|
41
|
+
};
|
|
42
|
+
return SelkieEffectRule;
|
|
43
|
+
}(Effect_1.PlayerEffectRule));
|
|
44
|
+
exports.SelkieEffectRule = SelkieEffectRule;
|
|
@@ -5,6 +5,6 @@ export declare class ShivaEffectRule extends PlayerEffectRule {
|
|
|
5
5
|
ruleId: RuleId;
|
|
6
6
|
canPlayEffect(cardIndex: number): boolean;
|
|
7
7
|
onRuleStart(): MaterialMove[];
|
|
8
|
-
getPlayerMoves():
|
|
9
|
-
beforeItemMove(move: ItemMove):
|
|
8
|
+
getPlayerMoves(cardIndex?: number): import("@gamepark/rules-api").MoveItemsAtOnce<number, number, number>[];
|
|
9
|
+
beforeItemMove(move: ItemMove): (import("@gamepark/rules-api").CustomMove<number> | import("@gamepark/rules-api").CreateItem<number, number, number>)[];
|
|
10
10
|
}
|
|
@@ -14,39 +14,16 @@ 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
|
-
};
|
|
42
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
18
|
exports.ShivaEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
45
21
|
var Effect_1 = require("../../material/entity/Effect");
|
|
46
22
|
var LocationType_1 = require("../../material/LocationType");
|
|
47
23
|
var MaterialType_1 = require("../../material/MaterialType");
|
|
48
24
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
49
25
|
var RuleId_1 = require("../RuleId");
|
|
26
|
+
var PermanentEffectsRule_1 = require("./PermanentEffectsRule");
|
|
50
27
|
var ShivaEffectRule = (function (_super) {
|
|
51
28
|
__extends(ShivaEffectRule, _super);
|
|
52
29
|
function ShivaEffectRule() {
|
|
@@ -55,20 +32,22 @@ var ShivaEffectRule = (function (_super) {
|
|
|
55
32
|
return _this;
|
|
56
33
|
}
|
|
57
34
|
ShivaEffectRule.prototype.canPlayEffect = function (cardIndex) {
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
return pantheon.gems > 0 && cards.location(function (l) { return (0, rules_api_1.areAdjacentSquares)(l, location); }).length > 0;
|
|
35
|
+
var player = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location.player;
|
|
36
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
37
|
+
return pantheon.gems > 0 && this.getPlayerMoves(cardIndex).length > 0;
|
|
62
38
|
};
|
|
63
39
|
ShivaEffectRule.prototype.onRuleStart = function () {
|
|
64
40
|
return [new Pantheon_1.Pantheon(this.game, this.player).spendGems(1)];
|
|
65
41
|
};
|
|
66
|
-
ShivaEffectRule.prototype.getPlayerMoves = function () {
|
|
67
|
-
|
|
68
|
-
var location = this.
|
|
69
|
-
var pantheon = new Pantheon_1.Pantheon(this.game,
|
|
70
|
-
var
|
|
71
|
-
|
|
42
|
+
ShivaEffectRule.prototype.getPlayerMoves = function (cardIndex) {
|
|
43
|
+
if (cardIndex === void 0) { cardIndex = this.getEffect().cardIndex; }
|
|
44
|
+
var location = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location;
|
|
45
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, location.player);
|
|
46
|
+
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
47
|
+
var piles = pantheon
|
|
48
|
+
.getPiles(function (space) { return (0, rules_api_1.areAdjacentSquares)(space, location); })
|
|
49
|
+
.filter(function (pile) { return rule.canSacrifice(pile.maxBy(function (item) { return item.location.z; }).getItem()); });
|
|
50
|
+
return piles.map(function (pile) { return pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerDiscard, player: location.player }); });
|
|
72
51
|
};
|
|
73
52
|
ShivaEffectRule.prototype.beforeItemMove = function (move) {
|
|
74
53
|
if ((0, rules_api_1.isMoveItemTypeAtOnce)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
@@ -76,7 +55,8 @@ var ShivaEffectRule = (function (_super) {
|
|
|
76
55
|
var topCard = this.material(MaterialType_1.MaterialType.EntityCard)
|
|
77
56
|
.index(move.indexes)
|
|
78
57
|
.maxBy(function (item) { return item.location.z; });
|
|
79
|
-
|
|
58
|
+
pantheon.onEntitySacrificed(topCard);
|
|
59
|
+
return [pantheon.gainFavor(move.indexes.length), this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
80
60
|
}
|
|
81
61
|
return [];
|
|
82
62
|
};
|