@gamepark/mythologies 0.4.1 → 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 -7
- package/dist/Memory.js +9 -7
- package/dist/MythologiesRules.d.ts +41 -33
- package/dist/MythologiesRules.js +8 -0
- package/dist/MythologiesSetup.js +1 -1
- package/dist/material/Mythology.d.ts +0 -1
- package/dist/material/Mythology.js +1 -3
- package/dist/material/Pantheon.d.ts +1 -0
- package/dist/material/Pantheon.js +5 -0
- package/dist/material/entity/Effect.d.ts +2 -2
- package/dist/material/entity/Effect.js +1 -4
- package/dist/material/entity/MoveEffectRule.d.ts +4 -1
- package/dist/material/entity/MoveEffectRule.js +24 -5
- package/dist/material/entity/PlaceCardEffectRule.js +4 -27
- package/dist/material/entity/SacrificeEffectRule.d.ts +1 -1
- package/dist/material/entity/SacrificeEffectRule.js +2 -1
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +8 -2
- package/dist/material/entity/SimultaneousMoveEffectRule.js +34 -6
- package/dist/material/entity/celtic/Dullahan.js +7 -1
- package/dist/material/entity/celtic/Leprechaun.js +7 -1
- package/dist/material/entity/celtic/Selkie.js +12 -1
- package/dist/rules/RuleId.d.ts +37 -33
- package/dist/rules/RuleId.js +37 -33
- package/dist/rules/effects/CentaurEffectRule.d.ts +5 -3
- package/dist/rules/effects/CentaurEffectRule.js +64 -16
- 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/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 +2 -26
- 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/RaEffectRule.d.ts +8 -4
- package/dist/rules/effects/RaEffectRule.js +12 -50
- 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 +8 -32
- 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/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
|
@@ -43,7 +43,7 @@ var IllapaEffectRule = (function (_super) {
|
|
|
43
43
|
return [this.startSimultaneousRule(RuleId_1.RuleId.IllapaSacrifice, players)];
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
return
|
|
46
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return [];
|
|
@@ -4,5 +4,5 @@ import { RuleId } from '../RuleId';
|
|
|
4
4
|
export declare class JiangshiEffectRule extends PlayerEffectRule {
|
|
5
5
|
ruleId: RuleId;
|
|
6
6
|
getPlayerMoves(): MaterialMove[];
|
|
7
|
-
beforeItemMove(move: ItemMove):
|
|
7
|
+
beforeItemMove(move: ItemMove): (import("@gamepark/rules-api").CustomMove<number> | import("@gamepark/rules-api").CreateItem<number, number, number>)[];
|
|
8
8
|
}
|
|
@@ -14,34 +14,10 @@ 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");
|
|
@@ -70,7 +46,7 @@ var JiangshiEffectRule = (function (_super) {
|
|
|
70
46
|
.index(move.indexes)
|
|
71
47
|
.maxBy(function (item) { return item.location.z; });
|
|
72
48
|
pantheon.onEntitySacrificed(topCard);
|
|
73
|
-
return
|
|
49
|
+
return [pantheon.gainGems(2), this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
74
50
|
}
|
|
75
51
|
return [];
|
|
76
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;
|
|
@@ -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;
|
|
@@ -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,34 +14,10 @@ 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");
|
|
@@ -58,20 +34,20 @@ var ShivaEffectRule = (function (_super) {
|
|
|
58
34
|
ShivaEffectRule.prototype.canPlayEffect = function (cardIndex) {
|
|
59
35
|
var player = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location.player;
|
|
60
36
|
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
61
|
-
return pantheon.gems > 0 && this.getPlayerMoves(
|
|
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
|
-
if (
|
|
68
|
-
var location = this.
|
|
69
|
-
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
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);
|
|
70
46
|
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
71
47
|
var piles = pantheon
|
|
72
48
|
.getPiles(function (space) { return (0, rules_api_1.areAdjacentSquares)(space, location); })
|
|
73
49
|
.filter(function (pile) { return rule.canSacrifice(pile.maxBy(function (item) { return item.location.z; }).getItem()); });
|
|
74
|
-
return piles.map(function (pile) { return pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerDiscard, player: player }); });
|
|
50
|
+
return piles.map(function (pile) { return pile.moveItemsAtOnce({ type: LocationType_1.LocationType.PlayerDiscard, player: location.player }); });
|
|
75
51
|
};
|
|
76
52
|
ShivaEffectRule.prototype.beforeItemMove = function (move) {
|
|
77
53
|
if ((0, rules_api_1.isMoveItemTypeAtOnce)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
@@ -80,7 +56,7 @@ var ShivaEffectRule = (function (_super) {
|
|
|
80
56
|
.index(move.indexes)
|
|
81
57
|
.maxBy(function (item) { return item.location.z; });
|
|
82
58
|
pantheon.onEntitySacrificed(topCard);
|
|
83
|
-
return
|
|
59
|
+
return [pantheon.gainFavor(move.indexes.length), this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
84
60
|
}
|
|
85
61
|
return [];
|
|
86
62
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Location, Material,
|
|
1
|
+
import { Location, Material, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
3
3
|
import { RuleId } from '../RuleId';
|
|
4
4
|
export declare class SphinxEffectRule extends MoveEffectRule {
|
|
5
5
|
ruleId: RuleId;
|
|
6
6
|
getMovingCards(): Material;
|
|
7
7
|
isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
|
|
8
|
-
onCardMoved(move: MoveItem): MaterialMove[];
|
|
8
|
+
onCardMoved(move: MoveItem): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
9
9
|
}
|
|
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.SphinxEffectRule = void 0;
|
|
19
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
19
20
|
var MoveEffectRule_1 = require("../../material/entity/MoveEffectRule");
|
|
20
21
|
var MaterialType_1 = require("../../material/MaterialType");
|
|
21
22
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
@@ -36,7 +37,9 @@ var SphinxEffectRule = (function (_super) {
|
|
|
36
37
|
};
|
|
37
38
|
SphinxEffectRule.prototype.onCardMoved = function (move) {
|
|
38
39
|
var entity = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.itemIndex).id.front;
|
|
39
|
-
|
|
40
|
+
var moves = new Pantheon_1.Pantheon(this.game, this.player).getInvokeGains(entity, move.location.y);
|
|
41
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
42
|
+
return moves;
|
|
40
43
|
};
|
|
41
44
|
return SphinxEffectRule;
|
|
42
45
|
}(MoveEffectRule_1.MoveEffectRule));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MaterialMove, MoveItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { MoveEffectRule } from '../../material/entity/MoveEffectRule';
|
|
3
3
|
import { SimultaneousMoveEffectRule } from '../../material/entity/SimultaneousMoveEffectRule';
|
|
4
4
|
import { PlayerColor } from '../../PlayerColor';
|
|
@@ -6,8 +6,7 @@ import { RuleId } from '../RuleId';
|
|
|
6
6
|
export declare class TianlongEffectRule extends MoveEffectRule {
|
|
7
7
|
ruleId: RuleId;
|
|
8
8
|
getPlayerMoves(): MaterialMove<number, number, number, number>[];
|
|
9
|
-
|
|
10
|
-
onCardMoved(): never[];
|
|
9
|
+
onCardMoved(move: MoveItem): MaterialMove<number, number, number, number>[];
|
|
11
10
|
}
|
|
12
11
|
export declare class TianlongOpponentsEffectRule extends SimultaneousMoveEffectRule {
|
|
13
12
|
getAffectedPlayers(): number[];
|