@gamepark/mythologies 0.7.1 → 0.7.2
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/CustomMoveType.d.ts +3 -4
- package/dist/CustomMoveType.js +3 -4
- package/dist/MythologiesRules.d.ts +1 -1
- package/dist/MythologiesRules.js +33 -9
- package/dist/material/Entity.d.ts +2 -2
- package/dist/material/Entity.js +2 -2
- package/dist/material/LocationType.d.ts +2 -1
- package/dist/material/LocationType.js +1 -0
- package/dist/material/Pantheon.d.ts +1 -0
- package/dist/material/Pantheon.js +16 -12
- package/dist/material/entity/Effect.d.ts +10 -6
- package/dist/material/entity/Effect.js +48 -9
- package/dist/material/entity/SimultaneousMoveEffectRule.d.ts +0 -1
- package/dist/material/entity/SimultaneousMoveEffectRule.js +0 -4
- package/dist/material/entity/SimultaneousSacrificeEffectRule.d.ts +0 -1
- package/dist/material/entity/SimultaneousSacrificeEffectRule.js +0 -4
- package/dist/material/entity/celtic/Banshee.js +2 -2
- package/dist/material/entity/celtic/Dagda.js +3 -2
- package/dist/material/entity/chinese/ChangE.js +3 -5
- package/dist/material/entity/chinese/Fenghuang.js +3 -1
- package/dist/material/entity/chinese/Mogwai.js +4 -4
- package/dist/material/entity/chinese/SunWukong.js +3 -2
- package/dist/material/entity/egyptian/Isis.js +3 -2
- package/dist/material/entity/greek/Cyclops.js +7 -12
- package/dist/material/entity/greek/Poseidon.js +3 -2
- package/dist/material/entity/inca/Puma.js +4 -1
- package/dist/material/entity/inca/Ukuku.js +4 -4
- package/dist/material/entity/zulu/Inkanyamba.js +4 -1
- package/dist/rules/PlaceCardsRule.d.ts +0 -2
- package/dist/rules/PlaceCardsRule.js +3 -15
- package/dist/rules/PlaceTokenRule.js +5 -3
- package/dist/rules/effects/CentaurEffectRule.d.ts +1 -0
- package/dist/rules/effects/CentaurEffectRule.js +8 -44
- package/dist/rules/effects/CyclopsEffectRule.d.ts +5 -4
- package/dist/rules/effects/CyclopsEffectRule.js +58 -49
- package/dist/rules/effects/DraugrEffectRule.d.ts +1 -1
- package/dist/rules/effects/DraugrEffectRule.js +1 -1
- package/dist/rules/effects/FenrirEffectRule.js +6 -1
- package/dist/rules/effects/IllapaEffectRule.d.ts +4 -2
- package/dist/rules/effects/IllapaEffectRule.js +17 -12
- package/dist/rules/effects/MinotaurEffectRule.d.ts +2 -0
- package/dist/rules/effects/MinotaurEffectRule.js +11 -1
- package/dist/rules/effects/NuwaEffectRule.d.ts +3 -1
- package/dist/rules/effects/NuwaEffectRule.js +20 -12
- package/dist/rules/effects/ThorEffectRule.js +1 -1
- package/dist/rules/effects/TianlongEffectRule.d.ts +1 -0
- package/dist/rules/effects/TianlongEffectRule.js +19 -48
- package/dist/rules/effects/TriggerEffectsRule.d.ts +3 -3
- package/dist/rules/effects/TriggerEffectsRule.js +22 -18
- package/package.json +4 -4
|
@@ -122,9 +122,11 @@ var PlaceTokenRule = (function (_super) {
|
|
|
122
122
|
return [this.startRule(RuleId_1.RuleId.DrawDestinyCard)];
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
|
|
125
|
+
var selectedCardsIndexes = tokensPlaced.getItems().map(function (item) { return item.location.parent; });
|
|
126
|
+
var selectedCards = this.material(MaterialType_1.MaterialType.EntityCard).index(selectedCardsIndexes);
|
|
127
|
+
var deckCardsToReveal = selectedCards.location(LocationType_1.LocationType.CreaturesDeck);
|
|
128
|
+
var sanctuaryCardsToReveal = selectedCards.location(function (l) { return (l.type === LocationType_1.LocationType.SanctuaryCreatureSpot || l.type === LocationType_1.LocationType.CreaturesDeck) && l.rotation !== undefined; });
|
|
129
|
+
return __spreadArray(__spreadArray(__spreadArray([], __read(deckCardsToReveal.rotateItems(true)), false), __read(sanctuaryCardsToReveal.rotateItems(undefined)), false), [
|
|
128
130
|
this.startPlayerTurn(RuleId_1.RuleId.PlaceCards, this.material(MaterialType_1.MaterialType.FirstPlayerToken).getItem().location.player)
|
|
129
131
|
], false);
|
|
130
132
|
}
|
|
@@ -13,5 +13,6 @@ export declare class CentaurEffectRule extends MoveEffectRule {
|
|
|
13
13
|
startSacrificeEffect(): MaterialMove<number, number, number, number>[];
|
|
14
14
|
}
|
|
15
15
|
export declare class CentaurEffectSacrificeRule extends SimultaneousSacrificeEffectRule {
|
|
16
|
+
ruleId: RuleId;
|
|
16
17
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
17
18
|
}
|
|
@@ -39,17 +39,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
39
39
|
}
|
|
40
40
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
41
|
};
|
|
42
|
-
var __values = (this && this.__values) || function(o) {
|
|
43
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
44
|
-
if (m) return m.call(o);
|
|
45
|
-
if (o && typeof o.length === "number") return {
|
|
46
|
-
next: function () {
|
|
47
|
-
if (o && i >= o.length) o = void 0;
|
|
48
|
-
return { value: o && o[i++], done: !o };
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
52
|
-
};
|
|
53
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
43
|
exports.CentaurEffectSacrificeRule = exports.CentaurEffectRule = void 0;
|
|
55
44
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
@@ -95,39 +84,12 @@ var CentaurEffectRule = (function (_super) {
|
|
|
95
84
|
return [];
|
|
96
85
|
};
|
|
97
86
|
CentaurEffectRule.prototype.startSacrificeEffect = function () {
|
|
98
|
-
var _a
|
|
99
|
-
var _this = this;
|
|
87
|
+
var _a;
|
|
100
88
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
101
89
|
(_a = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_a, __spreadArray([], __read(pantheon.updateGrid()), false));
|
|
102
|
-
var centaur = this.getEffect().cardIndex;
|
|
103
|
-
var centaurLine = this.material(MaterialType_1.MaterialType.EntityCard).getItem(centaur).location.y;
|
|
104
90
|
var moves = pantheon.gainBonus();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var sacrificeRule = new CentaurEffectSacrificeRule(this.game);
|
|
108
|
-
try {
|
|
109
|
-
for (var sacrificingPlayers_1 = __values(sacrificingPlayers), sacrificingPlayers_1_1 = sacrificingPlayers_1.next(); !sacrificingPlayers_1_1.done; sacrificingPlayers_1_1 = sacrificingPlayers_1.next()) {
|
|
110
|
-
var player = sacrificingPlayers_1_1.value;
|
|
111
|
-
var legalMoves = sacrificeRule.getActivePlayerLegalMoves(player);
|
|
112
|
-
if (legalMoves.length === 1) {
|
|
113
|
-
moves.push(legalMoves[0]);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
playersToActivate.push(player);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
121
|
-
finally {
|
|
122
|
-
try {
|
|
123
|
-
if (sacrificingPlayers_1_1 && !sacrificingPlayers_1_1.done && (_b = sacrificingPlayers_1.return)) _b.call(sacrificingPlayers_1);
|
|
124
|
-
}
|
|
125
|
-
finally { if (e_1) throw e_1.error; }
|
|
126
|
-
}
|
|
127
|
-
if (playersToActivate.length) {
|
|
128
|
-
moves.push(this.startSimultaneousRule(RuleId_1.RuleId.CentaurEffectSacrifice, playersToActivate));
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
91
|
+
moves.push.apply(moves, __spreadArray([], __read(new CentaurEffectSacrificeRule(this.game).playEffect()), false));
|
|
92
|
+
if (!moves.some(rules_api_1.isStartSimultaneousRule)) {
|
|
131
93
|
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
132
94
|
}
|
|
133
95
|
return moves;
|
|
@@ -138,15 +100,17 @@ exports.CentaurEffectRule = CentaurEffectRule;
|
|
|
138
100
|
var CentaurEffectSacrificeRule = (function (_super) {
|
|
139
101
|
__extends(CentaurEffectSacrificeRule, _super);
|
|
140
102
|
function CentaurEffectSacrificeRule() {
|
|
141
|
-
|
|
103
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
104
|
+
_this.ruleId = RuleId_1.RuleId.CentaurEffectSacrifice;
|
|
105
|
+
return _this;
|
|
142
106
|
}
|
|
143
107
|
CentaurEffectSacrificeRule.prototype.getCardsToSacrifice = function (player) {
|
|
108
|
+
var _this = this;
|
|
144
109
|
var cardIndex = this.remind(Memory_1.Memory.OngoingEffect).cardIndex;
|
|
145
|
-
var centaurLine = this.material(MaterialType_1.MaterialType.EntityCard).getItem(cardIndex).location.y;
|
|
146
110
|
return _super.prototype.getCardsToSacrifice.call(this, player)
|
|
147
111
|
.index(function (index) { return index !== cardIndex; })
|
|
148
112
|
.id(function (id) { return (0, Entity_1.isCreature)(id.front); })
|
|
149
|
-
.location(function (l) { return l.y ===
|
|
113
|
+
.location(function (l) { return l.y === _this.card.location.y; });
|
|
150
114
|
};
|
|
151
115
|
return CentaurEffectSacrificeRule;
|
|
152
116
|
}(SimultaneousSacrificeEffectRule_1.SimultaneousSacrificeEffectRule));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PlayerEffectRule } from '../../material/entity/Effect';
|
|
1
|
+
import { ItemMove, MaterialMove } from '@gamepark/rules-api';
|
|
2
|
+
import { ColumnEvent, LineEvent, 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>[];
|
|
7
6
|
getPlayerMoves(): MaterialMove<number, number, number, number>[];
|
|
8
|
-
|
|
7
|
+
afterItemMove(move: ItemMove): (import("@gamepark/rules-api").CustomMove<number> | import("@gamepark/rules-api").MoveItem<number, number, number>)[];
|
|
8
|
+
takeNeighborsBonus(event?: LineEvent | ColumnEvent): import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
9
|
+
getBonus(event?: LineEvent | ColumnEvent): import("@gamepark/rules-api").Material<number, number, number>;
|
|
9
10
|
}
|
|
@@ -14,16 +14,30 @@ 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
|
|
18
|
-
var
|
|
19
|
-
if (m) return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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);
|
|
24
28
|
}
|
|
25
|
-
|
|
26
|
-
|
|
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));
|
|
27
41
|
};
|
|
28
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
43
|
exports.CyclopsEffectRule = void 0;
|
|
@@ -31,6 +45,7 @@ var rules_api_1 = require("@gamepark/rules-api");
|
|
|
31
45
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
32
46
|
var Effect_1 = require("../../material/entity/Effect");
|
|
33
47
|
var LocationType_1 = require("../../material/LocationType");
|
|
48
|
+
var MaterialType_1 = require("../../material/MaterialType");
|
|
34
49
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
35
50
|
var Memory_1 = require("../../Memory");
|
|
36
51
|
var RuleId_1 = require("../RuleId");
|
|
@@ -41,56 +56,50 @@ var CyclopsEffectRule = (function (_super) {
|
|
|
41
56
|
_this.ruleId = RuleId_1.RuleId.CyclopsEffect;
|
|
42
57
|
return _this;
|
|
43
58
|
}
|
|
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
|
-
};
|
|
52
59
|
CyclopsEffectRule.prototype.getPlayerMoves = function () {
|
|
53
|
-
var e_1, _a;
|
|
54
60
|
var moves = [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
55
61
|
var canPay = new Pantheon_1.Pantheon(this.game, this.player).gems > 0;
|
|
56
62
|
if (canPay) {
|
|
57
|
-
|
|
58
|
-
try {
|
|
59
|
-
for (var _b = __values((0, rules_api_1.getNeighbors)(this.player, this.game.players)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
60
|
-
var neighbor = _c.value;
|
|
61
|
-
var pantheon = new Pantheon_1.Pantheon(this.game, neighbor);
|
|
62
|
-
var bonus = event.type === Effect_1.TriggerEventType.LineEvent ? pantheon.getBonusGem(event.y) : pantheon.getBonusFavor(event.x);
|
|
63
|
-
if (bonus.length) {
|
|
64
|
-
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.ChoosePlayer, neighbor));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
69
|
-
finally {
|
|
70
|
-
try {
|
|
71
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
72
|
-
}
|
|
73
|
-
finally { if (e_1) throw e_1.error; }
|
|
74
|
-
}
|
|
63
|
+
moves.push(new Pantheon_1.Pantheon(this.game, this.player).spendGems(1));
|
|
75
64
|
}
|
|
76
65
|
return moves;
|
|
77
66
|
};
|
|
78
|
-
CyclopsEffectRule.prototype.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
else {
|
|
87
|
-
moves.push(new Pantheon_1.Pantheon(this.game, neighbor).getBonusFavor(event.x).moveItem({ type: LocationType_1.LocationType.PlayerFavor, player: this.player }));
|
|
88
|
-
}
|
|
89
|
-
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
90
|
-
return moves;
|
|
67
|
+
CyclopsEffectRule.prototype.afterItemMove = function (move) {
|
|
68
|
+
var _this = this;
|
|
69
|
+
if ((0, rules_api_1.isDeleteItemType)(MaterialType_1.MaterialType.GemToken)(move)) {
|
|
70
|
+
this.memorize(Memory_1.Memory.OncePerTurn, function (indexes) {
|
|
71
|
+
if (indexes === void 0) { indexes = []; }
|
|
72
|
+
return indexes.concat(_this.getEffect().cardIndex);
|
|
73
|
+
});
|
|
74
|
+
return __spreadArray(__spreadArray([], __read(this.takeNeighborsBonus()), false), [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)], false);
|
|
91
75
|
}
|
|
92
76
|
return [];
|
|
93
77
|
};
|
|
78
|
+
CyclopsEffectRule.prototype.takeNeighborsBonus = function (event) {
|
|
79
|
+
if (event === void 0) { event = this.getEffect().triggerEvent; }
|
|
80
|
+
if (event.type === Effect_1.TriggerEventType.LineEvent) {
|
|
81
|
+
return this.getBonus().moveItems({ type: LocationType_1.LocationType.PlayerGems, player: event.player });
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return this.getBonus().moveItems({ type: LocationType_1.LocationType.PlayerFavor, player: event.player });
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
CyclopsEffectRule.prototype.getBonus = function (event) {
|
|
88
|
+
if (event === void 0) { event = this.getEffect().triggerEvent; }
|
|
89
|
+
var neighbors = (0, rules_api_1.getNeighbors)(event.player, this.game.players);
|
|
90
|
+
if (event.type === Effect_1.TriggerEventType.LineEvent) {
|
|
91
|
+
return this.material(MaterialType_1.MaterialType.GemToken)
|
|
92
|
+
.location(LocationType_1.LocationType.PantheonLineBonus)
|
|
93
|
+
.player(function (player) { return neighbors.includes(player); })
|
|
94
|
+
.location(function (l) { return l.y === event.y; });
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
return this.material(MaterialType_1.MaterialType.FavorToken)
|
|
98
|
+
.location(LocationType_1.LocationType.PantheonColumnBonus)
|
|
99
|
+
.player(function (player) { return neighbors.includes(player); })
|
|
100
|
+
.location(function (l) { return l.x === event.x; });
|
|
101
|
+
}
|
|
102
|
+
};
|
|
94
103
|
return CyclopsEffectRule;
|
|
95
104
|
}(Effect_1.PlayerEffectRule));
|
|
96
105
|
exports.CyclopsEffectRule = CyclopsEffectRule;
|
|
@@ -5,7 +5,7 @@ import { RuleId } from '../RuleId';
|
|
|
5
5
|
export declare class DraugrEffectRule extends SimultaneousSacrificeEffectRule {
|
|
6
6
|
ruleId: RuleId;
|
|
7
7
|
playEffect(): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
8
|
-
getAffectedPlayers():
|
|
8
|
+
getAffectedPlayers(): number[];
|
|
9
9
|
getActivePlayerLegalMoves(player: PlayerColor): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
10
10
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
11
11
|
beforeItemMove(move: ItemMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
@@ -36,7 +36,7 @@ var DraugrEffectRule = (function (_super) {
|
|
|
36
36
|
};
|
|
37
37
|
DraugrEffectRule.prototype.getAffectedPlayers = function () {
|
|
38
38
|
var _this = this;
|
|
39
|
-
return
|
|
39
|
+
return this.game.players.filter(function (player) { return _this.isOpponent(player); });
|
|
40
40
|
};
|
|
41
41
|
DraugrEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
42
42
|
var moves = _super.prototype.getActivePlayerLegalMoves.call(this, player);
|
|
@@ -88,7 +88,12 @@ var FenrirChoiceRule = (function (_super) {
|
|
|
88
88
|
}
|
|
89
89
|
finally { if (e_1) throw e_1.error; }
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
if (playersWithChoice.length > 0) {
|
|
92
|
+
moves.push(this.startSimultaneousRule(RuleId_1.RuleId.FenrirEffect, playersWithChoice));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
96
|
+
}
|
|
92
97
|
return moves;
|
|
93
98
|
}
|
|
94
99
|
return [];
|
|
@@ -6,9 +6,11 @@ import { RuleId } from '../RuleId';
|
|
|
6
6
|
export declare class IllapaEffectRule extends PlayerEffectRule {
|
|
7
7
|
ruleId: RuleId;
|
|
8
8
|
getPlayerMoves(): CustomMove<number>[];
|
|
9
|
-
onCustomMove(move: CustomMove):
|
|
10
|
-
getPlayersHavingToSacrifice(line: number): number[];
|
|
9
|
+
onCustomMove(move: CustomMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
11
10
|
}
|
|
12
11
|
export declare class IllapaSacrificeRule extends SimultaneousSacrificeEffectRule {
|
|
12
|
+
ruleId: RuleId;
|
|
13
|
+
getAffectedPlayers(): number[];
|
|
13
14
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
15
|
+
onRuleEnd(): never[];
|
|
14
16
|
}
|
|
@@ -16,12 +16,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.IllapaSacrificeRule = exports.IllapaEffectRule = void 0;
|
|
19
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
19
20
|
var lodash_1 = require("lodash");
|
|
20
21
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
21
22
|
var Entity_1 = require("../../material/Entity");
|
|
22
23
|
var Effect_1 = require("../../material/entity/Effect");
|
|
23
24
|
var SimultaneousSacrificeEffectRule_1 = require("../../material/entity/SimultaneousSacrificeEffectRule");
|
|
24
|
-
var Pantheon_1 = require("../../material/Pantheon");
|
|
25
25
|
var Memory_1 = require("../../Memory");
|
|
26
26
|
var RuleId_1 = require("../RuleId");
|
|
27
27
|
var IllapaEffectRule = (function (_super) {
|
|
@@ -38,34 +38,39 @@ var IllapaEffectRule = (function (_super) {
|
|
|
38
38
|
IllapaEffectRule.prototype.onCustomMove = function (move) {
|
|
39
39
|
if (move.type === CustomMoveType_1.CustomMoveType.ChooseLine) {
|
|
40
40
|
this.memorize(Memory_1.Memory.TargetLine, move.data);
|
|
41
|
-
var
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
else {
|
|
46
|
-
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
41
|
+
var moves = new IllapaSacrificeRule(this.game).playEffect();
|
|
42
|
+
if (!moves.some(rules_api_1.isStartSimultaneousRule)) {
|
|
43
|
+
this.forget(Memory_1.Memory.TargetLine);
|
|
44
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
47
45
|
}
|
|
46
|
+
return moves;
|
|
48
47
|
}
|
|
49
48
|
return [];
|
|
50
49
|
};
|
|
51
|
-
IllapaEffectRule.prototype.getPlayersHavingToSacrifice = function (line) {
|
|
52
|
-
var _this = this;
|
|
53
|
-
return this.game.players.filter(function (player) { return player !== _this.player && new Pantheon_1.Pantheon(_this.game, player).grid[line].filter(Entity_1.isCreature).length > 0; });
|
|
54
|
-
};
|
|
55
50
|
return IllapaEffectRule;
|
|
56
51
|
}(Effect_1.PlayerEffectRule));
|
|
57
52
|
exports.IllapaEffectRule = IllapaEffectRule;
|
|
58
53
|
var IllapaSacrificeRule = (function (_super) {
|
|
59
54
|
__extends(IllapaSacrificeRule, _super);
|
|
60
55
|
function IllapaSacrificeRule() {
|
|
61
|
-
|
|
56
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
57
|
+
_this.ruleId = RuleId_1.RuleId.IllapaSacrifice;
|
|
58
|
+
return _this;
|
|
62
59
|
}
|
|
60
|
+
IllapaSacrificeRule.prototype.getAffectedPlayers = function () {
|
|
61
|
+
var _this = this;
|
|
62
|
+
return this.game.players.filter(function (player) { return _this.isOpponent(player); });
|
|
63
|
+
};
|
|
63
64
|
IllapaSacrificeRule.prototype.getCardsToSacrifice = function (player) {
|
|
64
65
|
var line = this.remind(Memory_1.Memory.TargetLine);
|
|
65
66
|
return _super.prototype.getCardsToSacrifice.call(this, player)
|
|
66
67
|
.id(function (id) { return (0, Entity_1.isCreature)(id.front); })
|
|
67
68
|
.location(function (l) { return l.y === line; });
|
|
68
69
|
};
|
|
70
|
+
IllapaSacrificeRule.prototype.onRuleEnd = function () {
|
|
71
|
+
this.forget(Memory_1.Memory.TargetLine);
|
|
72
|
+
return [];
|
|
73
|
+
};
|
|
69
74
|
return IllapaSacrificeRule;
|
|
70
75
|
}(SimultaneousSacrificeEffectRule_1.SimultaneousSacrificeEffectRule));
|
|
71
76
|
exports.IllapaSacrificeRule = IllapaSacrificeRule;
|
|
@@ -4,6 +4,8 @@ import { PlayerColor } from '../../PlayerColor';
|
|
|
4
4
|
import { RuleId } from '../RuleId';
|
|
5
5
|
export declare class MinotaurEffectRule extends SimultaneousMoveEffectRule {
|
|
6
6
|
ruleId: RuleId;
|
|
7
|
+
onRuleStart(): never[];
|
|
7
8
|
getMovingCards(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
9
|
isLegalDestination(space: XYCoordinates, cardLocation: Location): boolean;
|
|
10
|
+
onRuleEnd(): never[];
|
|
9
11
|
}
|
|
@@ -19,6 +19,7 @@ exports.MinotaurEffectRule = void 0;
|
|
|
19
19
|
var Entity_1 = require("../../material/Entity");
|
|
20
20
|
var SimultaneousMoveEffectRule_1 = require("../../material/entity/SimultaneousMoveEffectRule");
|
|
21
21
|
var Pantheon_1 = require("../../material/Pantheon");
|
|
22
|
+
var Memory_1 = require("../../Memory");
|
|
22
23
|
var RuleId_1 = require("../RuleId");
|
|
23
24
|
var MinotaurEffectRule = (function (_super) {
|
|
24
25
|
__extends(MinotaurEffectRule, _super);
|
|
@@ -27,13 +28,22 @@ var MinotaurEffectRule = (function (_super) {
|
|
|
27
28
|
_this.ruleId = RuleId_1.RuleId.MinotaurEffect;
|
|
28
29
|
return _this;
|
|
29
30
|
}
|
|
31
|
+
MinotaurEffectRule.prototype.onRuleStart = function () {
|
|
32
|
+
this.memorize(Memory_1.Memory.TargetLine, this.card.location.x);
|
|
33
|
+
return [];
|
|
34
|
+
};
|
|
30
35
|
MinotaurEffectRule.prototype.getMovingCards = function (player) {
|
|
31
|
-
var column = this.
|
|
36
|
+
var column = this.remind(Memory_1.Memory.TargetLine);
|
|
32
37
|
return new Pantheon_1.Pantheon(this.game, player).visibleEntities.location(function (l) { return l.x === column; }).id(function (id) { return (0, Entity_1.isCreature)(id.front); });
|
|
33
38
|
};
|
|
34
39
|
MinotaurEffectRule.prototype.isLegalDestination = function (space, cardLocation) {
|
|
35
40
|
return space.y === cardLocation.y;
|
|
36
41
|
};
|
|
42
|
+
MinotaurEffectRule.prototype.onRuleEnd = function () {
|
|
43
|
+
this.forget(Memory_1.Memory.TargetLine);
|
|
44
|
+
_super.prototype.onRuleEnd.call(this);
|
|
45
|
+
return [];
|
|
46
|
+
};
|
|
37
47
|
return MinotaurEffectRule;
|
|
38
48
|
}(SimultaneousMoveEffectRule_1.SimultaneousMoveEffectRule));
|
|
39
49
|
exports.MinotaurEffectRule = MinotaurEffectRule;
|
|
@@ -4,9 +4,11 @@ import { PlayerColor } from '../../PlayerColor';
|
|
|
4
4
|
import { RuleId } from '../RuleId';
|
|
5
5
|
export declare class NuwaEffectRule extends SimultaneousSacrificeEffectRule {
|
|
6
6
|
ruleId: RuleId;
|
|
7
|
-
getAffectedPlayers():
|
|
7
|
+
getAffectedPlayers(): number[];
|
|
8
|
+
onRuleStart(): never[];
|
|
8
9
|
getActivePlayerLegalMoves(player: PlayerColor): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
9
10
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
10
11
|
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
11
12
|
beforeItemMove(move: ItemMove): import("@gamepark/rules-api").MaterialMove<number, number, number, number>[];
|
|
13
|
+
onRuleEnd(): never[];
|
|
12
14
|
}
|
|
@@ -43,18 +43,15 @@ var NuwaEffectRule = (function (_super) {
|
|
|
43
43
|
return _this;
|
|
44
44
|
}
|
|
45
45
|
NuwaEffectRule.prototype.getAffectedPlayers = function () {
|
|
46
|
+
var _this = this;
|
|
47
|
+
return this.game.players.filter(function (player) { return (0, rules_api_1.areNeighbors)(player, _this.card.location.player, _this.game.players); });
|
|
48
|
+
};
|
|
49
|
+
NuwaEffectRule.prototype.onRuleStart = function () {
|
|
46
50
|
var e_1, _a;
|
|
47
|
-
var players = [];
|
|
48
51
|
try {
|
|
49
|
-
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
52
|
+
for (var _b = __values(this.game.rule.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
50
53
|
var player = _c.value;
|
|
51
|
-
|
|
52
|
-
var creatures = new Pantheon_1.Pantheon(this.game, player).visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); }).getIndexes();
|
|
53
|
-
if (creatures.length > 0) {
|
|
54
|
-
this.memorize(Memory_1.Memory.TargetEntities, creatures, player);
|
|
55
|
-
players.push(player);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
54
|
+
this.memorize(Memory_1.Memory.TargetEntities, this.getCardsToSacrifice(player).getIndexes(), player);
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
57
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -64,19 +61,26 @@ var NuwaEffectRule = (function (_super) {
|
|
|
64
61
|
}
|
|
65
62
|
finally { if (e_1) throw e_1.error; }
|
|
66
63
|
}
|
|
67
|
-
return
|
|
64
|
+
return [];
|
|
68
65
|
};
|
|
69
66
|
NuwaEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
70
67
|
var moves = _super.prototype.getActivePlayerLegalMoves.call(this, player);
|
|
71
68
|
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(player);
|
|
72
|
-
var creatures = this.
|
|
69
|
+
var creatures = this.getCardsToSacrifice(player);
|
|
73
70
|
if (gems.getQuantity() >= creatures.length) {
|
|
74
71
|
moves.push(gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: this.card.location.player }, creatures.length));
|
|
75
72
|
}
|
|
76
73
|
return moves;
|
|
77
74
|
};
|
|
78
75
|
NuwaEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
79
|
-
|
|
76
|
+
var targets = this.remind(Memory_1.Memory.TargetEntities, player);
|
|
77
|
+
var visibleEntities = new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
78
|
+
if (targets) {
|
|
79
|
+
return visibleEntities.index(targets);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); });
|
|
83
|
+
}
|
|
80
84
|
};
|
|
81
85
|
NuwaEffectRule.prototype.onSacrifice = function (move) {
|
|
82
86
|
var player = move.location.player;
|
|
@@ -92,6 +96,10 @@ var NuwaEffectRule = (function (_super) {
|
|
|
92
96
|
return _super.prototype.beforeItemMove.call(this, move);
|
|
93
97
|
}
|
|
94
98
|
};
|
|
99
|
+
NuwaEffectRule.prototype.onRuleEnd = function () {
|
|
100
|
+
this.forget(Memory_1.Memory.TargetEntities);
|
|
101
|
+
return [];
|
|
102
|
+
};
|
|
95
103
|
return NuwaEffectRule;
|
|
96
104
|
}(SimultaneousSacrificeEffectRule_1.SimultaneousSacrificeEffectRule));
|
|
97
105
|
exports.NuwaEffectRule = NuwaEffectRule;
|
|
@@ -32,7 +32,7 @@ var ThorEffectRule = (function (_super) {
|
|
|
32
32
|
}
|
|
33
33
|
ThorEffectRule.prototype.getAffectedPlayers = function () {
|
|
34
34
|
var _this = this;
|
|
35
|
-
return
|
|
35
|
+
return this.game.players.filter(function (player) { return _this.isOpponent(player); });
|
|
36
36
|
};
|
|
37
37
|
ThorEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
38
38
|
var moves = _super.prototype.getActivePlayerLegalMoves.call(this, player);
|
|
@@ -9,6 +9,7 @@ export declare class TianlongEffectRule extends MoveEffectRule {
|
|
|
9
9
|
onCardMoved(move: MoveItem): MaterialMove<number, number, number, number>[];
|
|
10
10
|
}
|
|
11
11
|
export declare class TianlongOpponentsEffectRule extends SimultaneousMoveEffectRule {
|
|
12
|
+
ruleId: RuleId;
|
|
12
13
|
getAffectedPlayers(): number[];
|
|
13
14
|
getMovingCards(player: PlayerColor): import("@gamepark/rules-api").Material<number, number, number>;
|
|
14
15
|
isLegalDestination(space: XYCoordinates): boolean;
|
|
@@ -39,19 +39,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
39
39
|
}
|
|
40
40
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
41
|
};
|
|
42
|
-
var __values = (this && this.__values) || function(o) {
|
|
43
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
44
|
-
if (m) return m.call(o);
|
|
45
|
-
if (o && typeof o.length === "number") return {
|
|
46
|
-
next: function () {
|
|
47
|
-
if (o && i >= o.length) o = void 0;
|
|
48
|
-
return { value: o && o[i++], done: !o };
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
52
|
-
};
|
|
53
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
43
|
exports.TianlongOpponentsEffectRule = exports.TianlongEffectRule = void 0;
|
|
44
|
+
var rules_api_1 = require("@gamepark/rules-api");
|
|
55
45
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
56
46
|
var MoveEffectRule_1 = require("../../material/entity/MoveEffectRule");
|
|
57
47
|
var SimultaneousMoveEffectRule_1 = require("../../material/entity/SimultaneousMoveEffectRule");
|
|
@@ -74,43 +64,22 @@ var TianlongEffectRule = (function (_super) {
|
|
|
74
64
|
return moves;
|
|
75
65
|
};
|
|
76
66
|
TianlongEffectRule.prototype.onCardMoved = function (move) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var player = affectedPlayers_1_1.value;
|
|
90
|
-
var legalMoves = opponentsEffectRule.getActivePlayerLegalMoves(player);
|
|
91
|
-
if (legalMoves.length === 1) {
|
|
92
|
-
moves.push(legalMoves[0]);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
playersWithChoice.push(player);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
100
|
-
finally {
|
|
101
|
-
try {
|
|
102
|
-
if (affectedPlayers_1_1 && !affectedPlayers_1_1.done && (_a = affectedPlayers_1.return)) _a.call(affectedPlayers_1);
|
|
67
|
+
if (move.location.player === this.player) {
|
|
68
|
+
var _a = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.itemIndex).location, x = _a.x, y = _a.y;
|
|
69
|
+
this.memorize(Memory_1.Memory.TargetLocations, [
|
|
70
|
+
{ x: x, y: y },
|
|
71
|
+
{ x: move.location.x, y: move.location.y }
|
|
72
|
+
]);
|
|
73
|
+
var opponentsEffectRule = new TianlongOpponentsEffectRule(this.game);
|
|
74
|
+
var moves = [new Pantheon_1.Pantheon(this.game, this.player).spendGems(1)];
|
|
75
|
+
moves.push.apply(moves, __spreadArray([], __read(opponentsEffectRule.playEffect()), false));
|
|
76
|
+
if (!moves.some(rules_api_1.isStartSimultaneousRule)) {
|
|
77
|
+
this.forget(Memory_1.Memory.TargetLocations);
|
|
78
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
103
79
|
}
|
|
104
|
-
|
|
80
|
+
return moves;
|
|
105
81
|
}
|
|
106
|
-
|
|
107
|
-
moves.push(this.startSimultaneousRule(RuleId_1.RuleId.TianlongOpponentsEffect, playersWithChoice));
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
this.forget(Memory_1.Memory.TargetLocations);
|
|
111
|
-
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
112
|
-
}
|
|
113
|
-
return moves;
|
|
82
|
+
return [];
|
|
114
83
|
};
|
|
115
84
|
return TianlongEffectRule;
|
|
116
85
|
}(MoveEffectRule_1.MoveEffectRule));
|
|
@@ -118,11 +87,13 @@ exports.TianlongEffectRule = TianlongEffectRule;
|
|
|
118
87
|
var TianlongOpponentsEffectRule = (function (_super) {
|
|
119
88
|
__extends(TianlongOpponentsEffectRule, _super);
|
|
120
89
|
function TianlongOpponentsEffectRule() {
|
|
121
|
-
|
|
90
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
91
|
+
_this.ruleId = RuleId_1.RuleId.TianlongOpponentsEffect;
|
|
92
|
+
return _this;
|
|
122
93
|
}
|
|
123
94
|
TianlongOpponentsEffectRule.prototype.getAffectedPlayers = function () {
|
|
124
95
|
var _this = this;
|
|
125
|
-
return this.game.players.filter(function (player) { return _this.isOpponent(player)
|
|
96
|
+
return this.game.players.filter(function (player) { return _this.isOpponent(player); });
|
|
126
97
|
};
|
|
127
98
|
TianlongOpponentsEffectRule.prototype.getMovingCards = function (player) {
|
|
128
99
|
var _a = this.remind(Memory_1.Memory.TargetLocations)[0], x = _a.x, y = _a.y;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Location, MaterialRulesPart } from '@gamepark/rules-api';
|
|
2
2
|
import { PendingEffect, TriggerEvent } from '../../material/entity/Effect';
|
|
3
3
|
import { PlayerColor } from '../../PlayerColor';
|
|
4
4
|
export declare class TriggerEffectsRule extends MaterialRulesPart {
|
|
5
5
|
triggerEffects(...triggerEvents: TriggerEvent[]): void;
|
|
6
6
|
triggerPlayerEffects(player: PlayerColor, ...triggerEvents: TriggerEvent[]): void;
|
|
7
7
|
getPlayerEffects(player: PlayerColor, ...triggerEvents: TriggerEvent[]): PendingEffect<TriggerEvent>[];
|
|
8
|
-
triggerCardEffect(
|
|
9
|
-
getCardEffects(
|
|
8
|
+
triggerCardEffect(cardIndex: number, cardLocation: Location, triggerEvent: TriggerEvent): void;
|
|
9
|
+
getCardEffects(cardIndex: number, cardLocation: Location, triggerEvent: TriggerEvent): PendingEffect[];
|
|
10
10
|
private getPlayersByEffectPriorityOrder;
|
|
11
11
|
}
|