@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
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { Location, Material, MaterialGame,
|
|
1
|
+
import { Location, Material, MaterialGame, MaterialMove, MaterialRulesPart, PlayerTurnRule, SimultaneousRule, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { PlayerColor } from '../../PlayerColor';
|
|
3
3
|
import { RuleId } from '../../rules/RuleId';
|
|
4
|
-
import { Entity, EntityId } from '../Entity';
|
|
5
|
-
|
|
6
|
-
import { MaterialType } from '../MaterialType';
|
|
7
|
-
export type Effect = {
|
|
4
|
+
import { Entity, EntityId, EntityItem } from '../Entity';
|
|
5
|
+
export type TriggeredEffect = {
|
|
8
6
|
trigger: (event: TriggerEvent, card: Material, game: MaterialGame) => boolean;
|
|
9
7
|
rule: new (game: MaterialGame) => EffectRule;
|
|
10
8
|
auto?: boolean;
|
|
11
9
|
};
|
|
10
|
+
export declare const isTriggeredEffect: (effect: Effect) => effect is TriggeredEffect;
|
|
11
|
+
export type PermanentEffect = {
|
|
12
|
+
preventSacrifice?: (card: EntityItem, effectCard: EntityItem) => boolean;
|
|
13
|
+
preventMove?: (card: EntityItem, effectCard: EntityItem) => boolean;
|
|
14
|
+
preventCrush?: (card: EntityItem, effectCard: EntityItem) => boolean;
|
|
15
|
+
replaceSacrifice?: (card: EntityItem, effectCard: EntityItem) => boolean;
|
|
16
|
+
favorTax?: (space: XYCoordinates, card: EntityItem) => number;
|
|
17
|
+
sacrificeInsteadOfMove?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type Effect = TriggeredEffect | PermanentEffect;
|
|
12
20
|
interface EffectRule {
|
|
13
21
|
canPlayEffect(cardIndex: number): boolean;
|
|
14
22
|
playEffect(): MaterialMove[];
|
|
@@ -17,10 +25,9 @@ export declare abstract class PlayerEffectRule extends PlayerTurnRule implements
|
|
|
17
25
|
canPlayEffect(_cardIndex: number): boolean;
|
|
18
26
|
ruleId?: RuleId;
|
|
19
27
|
playEffect(): MaterialMove[];
|
|
20
|
-
onRuleStart(): MaterialMove
|
|
21
|
-
get card(): MaterialItem<number, number, EntityId>;
|
|
28
|
+
onRuleStart(): MaterialMove[];
|
|
29
|
+
get card(): import("@gamepark/rules-api").MaterialItem<number, number, EntityId>;
|
|
22
30
|
getEffect<Event extends TriggerEvent>(): PendingEffect<Event>;
|
|
23
|
-
endEffect(): MaterialMove[];
|
|
24
31
|
}
|
|
25
32
|
export declare abstract class SimultaneousEffectRule extends SimultaneousRule implements EffectRule {
|
|
26
33
|
canPlayEffect(_cardIndex: number): boolean;
|
|
@@ -28,7 +35,7 @@ export declare abstract class SimultaneousEffectRule extends SimultaneousRule im
|
|
|
28
35
|
playEffect(): MaterialMove[];
|
|
29
36
|
getAffectedPlayers(): PlayerColor[];
|
|
30
37
|
isOpponent(player: PlayerColor): boolean;
|
|
31
|
-
get card(): MaterialItem<number, number, EntityId>;
|
|
38
|
+
get card(): import("@gamepark/rules-api").MaterialItem<number, number, EntityId>;
|
|
32
39
|
getEffect<Event extends TriggerEvent>(): PendingEffect<Event>;
|
|
33
40
|
getMovesAfterPlayersDone(): MaterialMove[];
|
|
34
41
|
}
|
|
@@ -36,7 +43,7 @@ export declare abstract class AutoEffectRule extends MaterialRulesPart implement
|
|
|
36
43
|
canPlayEffect: () => boolean;
|
|
37
44
|
abstract playEffect(): MaterialMove[];
|
|
38
45
|
getEffect<Event extends TriggerEvent>(): PendingEffect<Event>;
|
|
39
|
-
get card(): MaterialItem<number, number, EntityId>;
|
|
46
|
+
get card(): import("@gamepark/rules-api").MaterialItem<number, number, EntityId>;
|
|
40
47
|
get player(): PlayerColor;
|
|
41
48
|
}
|
|
42
49
|
export declare enum TriggerEventType {
|
|
@@ -88,13 +95,13 @@ export type Infinite = {
|
|
|
88
95
|
export declare const oncePerTurn: (event: TriggerEvent) => event is Infinite;
|
|
89
96
|
export type EntityCrushed = {
|
|
90
97
|
type: TriggerEventType.EntityCrushed;
|
|
91
|
-
card:
|
|
98
|
+
card: EntityItem;
|
|
92
99
|
cardIndex: number;
|
|
93
100
|
};
|
|
94
101
|
export declare const isCrushed: (event: TriggerEvent, card: Material) => event is EntityCrushed;
|
|
95
102
|
export type EntitySacrificed = {
|
|
96
103
|
type: TriggerEventType.EntitySacrificed;
|
|
97
|
-
card:
|
|
104
|
+
card: EntityItem;
|
|
98
105
|
cardIndex: number;
|
|
99
106
|
};
|
|
100
107
|
export declare const isSacrificed: (event: TriggerEvent, card: Material) => event is EntityCrushed;
|
|
@@ -111,6 +118,7 @@ export declare const isEndOfMyTurn: (event: TriggerEvent, card: Material) => eve
|
|
|
111
118
|
export type TriggerEvent = EndOfGameEvent | SelfPlaced | EntityInvoked | LineEvent | ColumnEvent | Infinite | EntityCrushed | EntitySacrificed | EntitiesMoved | EndOfTurn;
|
|
112
119
|
export type PendingEffect<Event extends TriggerEvent = TriggerEvent> = {
|
|
113
120
|
cardIndex: number;
|
|
121
|
+
effectIndex: number;
|
|
114
122
|
triggerEvent: Event;
|
|
115
123
|
auto: boolean;
|
|
116
124
|
};
|
|
@@ -15,11 +15,13 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.isEndOfMyTurn = exports.isSacrificed = exports.isCrushed = exports.oncePerTurn = exports.LineEventType = exports.isEndOfGame = exports.isPlaced = exports.TriggerEventType = exports.AutoEffectRule = exports.SimultaneousEffectRule = exports.PlayerEffectRule = void 0;
|
|
18
|
+
exports.isEndOfMyTurn = exports.isSacrificed = exports.isCrushed = exports.oncePerTurn = exports.LineEventType = exports.isEndOfGame = exports.isPlaced = exports.TriggerEventType = exports.AutoEffectRule = exports.SimultaneousEffectRule = exports.PlayerEffectRule = exports.isTriggeredEffect = void 0;
|
|
19
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
20
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
21
21
|
var Memory_1 = require("../../Memory");
|
|
22
22
|
var MaterialType_1 = require("../MaterialType");
|
|
23
|
+
var isTriggeredEffect = function (effect) { return typeof effect.trigger === 'function'; };
|
|
24
|
+
exports.isTriggeredEffect = isTriggeredEffect;
|
|
23
25
|
var PlayerEffectRule = (function (_super) {
|
|
24
26
|
__extends(PlayerEffectRule, _super);
|
|
25
27
|
function PlayerEffectRule() {
|
|
@@ -33,7 +35,7 @@ var PlayerEffectRule = (function (_super) {
|
|
|
33
35
|
};
|
|
34
36
|
PlayerEffectRule.prototype.onRuleStart = function () {
|
|
35
37
|
if (!this.getPlayerMoves().length) {
|
|
36
|
-
return this.
|
|
38
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
37
39
|
}
|
|
38
40
|
return [];
|
|
39
41
|
};
|
|
@@ -48,9 +50,6 @@ var PlayerEffectRule = (function (_super) {
|
|
|
48
50
|
PlayerEffectRule.prototype.getEffect = function () {
|
|
49
51
|
return this.remind(Memory_1.Memory.OngoingEffect);
|
|
50
52
|
};
|
|
51
|
-
PlayerEffectRule.prototype.endEffect = function () {
|
|
52
|
-
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
53
|
-
};
|
|
54
53
|
return PlayerEffectRule;
|
|
55
54
|
}(rules_api_1.PlayerTurnRule));
|
|
56
55
|
exports.PlayerEffectRule = PlayerEffectRule;
|
|
@@ -3,7 +3,9 @@ import { Effect } from './Effect';
|
|
|
3
3
|
export type EntityDescription = {
|
|
4
4
|
invoke: [InvokeGain, InvokeGain, InvokeGain];
|
|
5
5
|
effect?: Effect;
|
|
6
|
+
effects?: Effect[];
|
|
6
7
|
};
|
|
8
|
+
export declare const getEffects: (entity?: Entity) => Effect[];
|
|
7
9
|
export type InvokeGain = {
|
|
8
10
|
gem?: number;
|
|
9
11
|
favor?: number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.entities = void 0;
|
|
4
|
+
exports.entities = exports.getEffects = void 0;
|
|
5
5
|
var Entity_1 = require("../Entity");
|
|
6
6
|
var Banshee_1 = require("./celtic/Banshee");
|
|
7
7
|
var Brigid_1 = require("./celtic/Brigid");
|
|
8
8
|
var Cernunnos_1 = require("./celtic/Cernunnos");
|
|
9
9
|
var Dagda_1 = require("./celtic/Dagda");
|
|
10
|
-
var
|
|
10
|
+
var Fairy_1 = require("./celtic/Fairy");
|
|
11
11
|
var Dullahan_1 = require("./celtic/Dullahan");
|
|
12
12
|
var Kelpie_1 = require("./celtic/Kelpie");
|
|
13
13
|
var Leprechaun_1 = require("./celtic/Leprechaun");
|
|
@@ -83,6 +83,9 @@ var Umvelinqangi_1 = require("./zulu/Umvelinqangi");
|
|
|
83
83
|
var Unkulunkulu_1 = require("./zulu/Unkulunkulu");
|
|
84
84
|
var Unwabu_1 = require("./zulu/Unwabu");
|
|
85
85
|
var Werehyena_1 = require("./zulu/Werehyena");
|
|
86
|
+
var getEffects = function (entity) { return (entity ? getDescriptionEffects(exports.entities[entity]) : []); };
|
|
87
|
+
exports.getEffects = getEffects;
|
|
88
|
+
var getDescriptionEffects = function (description) { var _a; return (description.effect ? [description.effect] : ((_a = description.effects) !== null && _a !== void 0 ? _a : [])); };
|
|
86
89
|
exports.entities = (_a = {},
|
|
87
90
|
_a[Entity_1.Entity.Zeus] = Zeus_1.Zeus,
|
|
88
91
|
_a[Entity_1.Entity.Poseidon] = Poseidon_1.Poseidon,
|
|
@@ -160,7 +163,7 @@ exports.entities = (_a = {},
|
|
|
160
163
|
_a[Entity_1.Entity.Morrigan] = Morrigan_1.Morrigan,
|
|
161
164
|
_a[Entity_1.Entity.Kelpie] = Kelpie_1.Kelpie,
|
|
162
165
|
_a[Entity_1.Entity.Banshee] = Banshee_1.Banshee,
|
|
163
|
-
_a[Entity_1.Entity.
|
|
166
|
+
_a[Entity_1.Entity.Fairy] = Fairy_1.Fairy,
|
|
164
167
|
_a[Entity_1.Entity.Leprechaun] = Leprechaun_1.Leprechaun,
|
|
165
168
|
_a[Entity_1.Entity.Selkie] = Selkie_1.Selkie,
|
|
166
169
|
_a[Entity_1.Entity.Dullahan] = Dullahan_1.Dullahan,
|
|
@@ -4,12 +4,15 @@ export declare abstract class MoveEffectRule extends PlayerEffectRule {
|
|
|
4
4
|
canPlayEffect(cardIndex: number): boolean;
|
|
5
5
|
playEffect(): MaterialMove[];
|
|
6
6
|
getPlayerMoves(): MaterialMove[];
|
|
7
|
+
getSacrificeToPreventMove(): MoveItem<number, number, number>[];
|
|
7
8
|
getMoveCardsMoves(effectCardIndex?: number): MoveItem<number, number, number>[];
|
|
8
9
|
getCardsAbleToMove(effectCardIndex: number): Material<number, number, number>;
|
|
9
10
|
getMovingCards(effectCardIndex: number): Material;
|
|
10
11
|
getAvailableDestinations(card: MaterialItem, _cardIndex: number): XYCoordinates[];
|
|
11
12
|
isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
|
|
12
|
-
|
|
13
|
+
beforeItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
13
14
|
onCardMoved(_move: MoveItem): MaterialMove[];
|
|
15
|
+
onCardSacrificed(move: MoveItem): MaterialMove[];
|
|
14
16
|
onCustomMove(move: CustomMove): MaterialMove<number, number, number, number>[];
|
|
17
|
+
onRuleEnd(): never[];
|
|
15
18
|
}
|
|
@@ -14,10 +14,37 @@ 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
|
+
};
|
|
17
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
43
|
exports.MoveEffectRule = void 0;
|
|
19
44
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
45
|
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
46
|
+
var Memory_1 = require("../../Memory");
|
|
47
|
+
var TriggerEffectsRule_1 = require("../../rules/effects/TriggerEffectsRule");
|
|
21
48
|
var LocationType_1 = require("../LocationType");
|
|
22
49
|
var MaterialType_1 = require("../MaterialType");
|
|
23
50
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -36,7 +63,10 @@ var MoveEffectRule = (function (_super) {
|
|
|
36
63
|
return _super.prototype.playEffect.call(this);
|
|
37
64
|
};
|
|
38
65
|
MoveEffectRule.prototype.getPlayerMoves = function () {
|
|
39
|
-
return this.getMoveCardsMoves();
|
|
66
|
+
return this.getMoveCardsMoves().concat(this.getSacrificeToPreventMove());
|
|
67
|
+
};
|
|
68
|
+
MoveEffectRule.prototype.getSacrificeToPreventMove = function () {
|
|
69
|
+
return this.remind(Memory_1.Memory.EntityMoved, this.player) ? [] : new Pantheon_1.Pantheon(this.game, this.player).sacrificeToPreventMove();
|
|
40
70
|
};
|
|
41
71
|
MoveEffectRule.prototype.getMoveCardsMoves = function (effectCardIndex) {
|
|
42
72
|
var _this = this;
|
|
@@ -65,22 +95,39 @@ var MoveEffectRule = (function (_super) {
|
|
|
65
95
|
MoveEffectRule.prototype.isLegalDestination = function (_space, _cardLocation) {
|
|
66
96
|
return true;
|
|
67
97
|
};
|
|
68
|
-
MoveEffectRule.prototype.
|
|
69
|
-
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)
|
|
70
|
-
|
|
98
|
+
MoveEffectRule.prototype.beforeItemMove = function (move) {
|
|
99
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
|
|
100
|
+
if (move.location.type === LocationType_1.LocationType.Pantheon) {
|
|
101
|
+
this.memorize(Memory_1.Memory.EntityMoved, true, this.player);
|
|
102
|
+
return this.onCardMoved(move);
|
|
103
|
+
}
|
|
104
|
+
else if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
105
|
+
return this.onCardSacrificed(move);
|
|
106
|
+
}
|
|
71
107
|
}
|
|
72
108
|
return [];
|
|
73
109
|
};
|
|
74
110
|
MoveEffectRule.prototype.onCardMoved = function (_move) {
|
|
75
|
-
return this.
|
|
111
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
112
|
+
};
|
|
113
|
+
MoveEffectRule.prototype.onCardSacrificed = function (move) {
|
|
114
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
115
|
+
new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntitySacrificed, card: card.getItem(), cardIndex: card.getIndex() });
|
|
116
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
76
117
|
};
|
|
77
118
|
MoveEffectRule.prototype.onCustomMove = function (move) {
|
|
119
|
+
var _a;
|
|
78
120
|
if (move.type === CustomMoveType_1.CustomMoveType.EndEffect) {
|
|
79
121
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
80
|
-
|
|
122
|
+
(_a = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_a, __spreadArray([], __read(pantheon.updateGrid()), false));
|
|
123
|
+
return pantheon.gainBonus();
|
|
81
124
|
}
|
|
82
125
|
return [];
|
|
83
126
|
};
|
|
127
|
+
MoveEffectRule.prototype.onRuleEnd = function () {
|
|
128
|
+
this.forget(Memory_1.Memory.EntityMoved);
|
|
129
|
+
return [];
|
|
130
|
+
};
|
|
84
131
|
return MoveEffectRule;
|
|
85
132
|
}(Effect_1.PlayerEffectRule));
|
|
86
133
|
exports.MoveEffectRule = MoveEffectRule;
|
|
@@ -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.InvokeEffectRule = exports.PlaceCardEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
45
21
|
var Entity_1 = require("../Entity");
|
|
46
22
|
var LocationType_1 = require("../LocationType");
|
|
47
23
|
var MaterialType_1 = require("../MaterialType");
|
|
@@ -80,8 +56,9 @@ var PlaceCardEffectRule = (function (_super) {
|
|
|
80
56
|
return [];
|
|
81
57
|
};
|
|
82
58
|
PlaceCardEffectRule.prototype.onCardPlaced = function (move) {
|
|
83
|
-
var
|
|
84
|
-
|
|
59
|
+
var moves = new Pantheon_1.Pantheon(this.game, this.player).onCardPlaced(move);
|
|
60
|
+
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
61
|
+
return moves;
|
|
85
62
|
};
|
|
86
63
|
return PlaceCardEffectRule;
|
|
87
64
|
}(Effect_1.PlayerEffectRule));
|
|
@@ -4,7 +4,8 @@ export declare abstract class SacrificeEffectRule extends PlayerEffectRule {
|
|
|
4
4
|
canPlayEffect(_cardIndex: number): boolean;
|
|
5
5
|
playEffect(): MaterialMove[];
|
|
6
6
|
getPlayerMoves(): MoveItem<number, number, number>[];
|
|
7
|
+
private getCardsAbleToSacrifice;
|
|
7
8
|
getCardsToSacrifice(): Material;
|
|
8
9
|
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
|
-
onSacrifice(_move: MoveItem): MaterialMove
|
|
10
|
+
onSacrifice(_move: MoveItem): MaterialMove[];
|
|
10
11
|
}
|
|
@@ -14,35 +14,11 @@ 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.SacrificeEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
45
|
-
var
|
|
20
|
+
var CustomMoveType_1 = require("../../CustomMoveType");
|
|
21
|
+
var PermanentEffectsRule_1 = require("../../rules/effects/PermanentEffectsRule");
|
|
46
22
|
var LocationType_1 = require("../LocationType");
|
|
47
23
|
var MaterialType_1 = require("../MaterialType");
|
|
48
24
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -56,32 +32,34 @@ var SacrificeEffectRule = (function (_super) {
|
|
|
56
32
|
return this.getCardsToSacrifice().length > 0;
|
|
57
33
|
};
|
|
58
34
|
SacrificeEffectRule.prototype.playEffect = function () {
|
|
59
|
-
if (!this.
|
|
35
|
+
if (!this.getCardsAbleToSacrifice().length)
|
|
60
36
|
return [];
|
|
61
37
|
return _super.prototype.playEffect.call(this);
|
|
62
38
|
};
|
|
63
39
|
SacrificeEffectRule.prototype.getPlayerMoves = function () {
|
|
64
|
-
var
|
|
65
|
-
var moves =
|
|
66
|
-
var indexes =
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
40
|
+
var cards = this.getCardsAbleToSacrifice();
|
|
41
|
+
var moves = cards.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player });
|
|
42
|
+
var indexes = cards.getIndexes();
|
|
43
|
+
var replaceSacrifice = new Pantheon_1.Pantheon(this.game, this.player).replaceSacrifice(cards.getItems()).index(function (index) { return !indexes.includes(index); });
|
|
44
|
+
return moves.concat(replaceSacrifice.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: this.player }));
|
|
45
|
+
};
|
|
46
|
+
SacrificeEffectRule.prototype.getCardsAbleToSacrifice = function () {
|
|
47
|
+
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
48
|
+
return this.getCardsToSacrifice().filter(function (card) { return rule.canSacrifice(card); });
|
|
71
49
|
};
|
|
72
50
|
SacrificeEffectRule.prototype.getCardsToSacrifice = function () {
|
|
73
51
|
return new Pantheon_1.Pantheon(this.game, this.player).visibleEntities;
|
|
74
52
|
};
|
|
75
53
|
SacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
76
|
-
var _a;
|
|
77
54
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
78
55
|
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
79
|
-
|
|
56
|
+
new Pantheon_1.Pantheon(this.game, this.player).onEntitySacrificed(card);
|
|
57
|
+
return this.onSacrifice(move);
|
|
80
58
|
}
|
|
81
59
|
return [];
|
|
82
60
|
};
|
|
83
61
|
SacrificeEffectRule.prototype.onSacrifice = function (_move) {
|
|
84
|
-
return this.
|
|
62
|
+
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
85
63
|
};
|
|
86
64
|
return SacrificeEffectRule;
|
|
87
65
|
}(Effect_1.PlayerEffectRule));
|
|
@@ -2,12 +2,18 @@ import { ItemMove, Location, Material, MaterialItem, MaterialMove, MoveItem, XYC
|
|
|
2
2
|
import { PlayerColor } from '../../PlayerColor';
|
|
3
3
|
import { SimultaneousEffectRule } from './Effect';
|
|
4
4
|
export declare abstract class SimultaneousMoveEffectRule extends SimultaneousEffectRule {
|
|
5
|
+
getAffectedPlayers(): PlayerColor[];
|
|
5
6
|
getActivePlayerLegalMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
7
|
+
getSacrificeToPreventMove(player: PlayerColor): MoveItem<number, number, number>[];
|
|
8
|
+
getMovementMoves(player: PlayerColor): MoveItem<number, number, number>[];
|
|
6
9
|
private getCardsAbleToMove;
|
|
7
10
|
getMovingCards(player: PlayerColor): Material;
|
|
8
|
-
getAvailableDestinations(player: PlayerColor, card: MaterialItem
|
|
11
|
+
getAvailableDestinations(player: PlayerColor, card: MaterialItem): XYCoordinates[];
|
|
9
12
|
isLegalDestination(_space: XYCoordinates, _cardLocation: Location): boolean;
|
|
10
|
-
|
|
13
|
+
beforeItemMove(move: ItemMove): MaterialMove<number, number, number, number>[];
|
|
11
14
|
onCardMoved(move: MoveItem): MaterialMove[];
|
|
15
|
+
onCardSacrificed(move: MoveItem): MaterialMove[];
|
|
12
16
|
getMovesAfterPlayersDone(): MaterialMove[];
|
|
17
|
+
updatePlayersGrids(): MaterialMove[];
|
|
18
|
+
onRuleEnd(): never[];
|
|
13
19
|
}
|
|
@@ -53,6 +53,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.SimultaneousMoveEffectRule = void 0;
|
|
55
55
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
56
|
+
var Memory_1 = require("../../Memory");
|
|
57
|
+
var TriggerEffectsRule_1 = require("../../rules/effects/TriggerEffectsRule");
|
|
56
58
|
var LocationType_1 = require("../LocationType");
|
|
57
59
|
var MaterialType_1 = require("../MaterialType");
|
|
58
60
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -62,12 +64,22 @@ var SimultaneousMoveEffectRule = (function (_super) {
|
|
|
62
64
|
function SimultaneousMoveEffectRule() {
|
|
63
65
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
66
|
}
|
|
67
|
+
SimultaneousMoveEffectRule.prototype.getAffectedPlayers = function () {
|
|
68
|
+
var _this = this;
|
|
69
|
+
return this.game.players.filter(function (player) { return _this.getMovementMoves(player).length > 0; });
|
|
70
|
+
};
|
|
65
71
|
SimultaneousMoveEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
72
|
+
return this.getMovementMoves(player).concat(this.getSacrificeToPreventMove(player));
|
|
73
|
+
};
|
|
74
|
+
SimultaneousMoveEffectRule.prototype.getSacrificeToPreventMove = function (player) {
|
|
75
|
+
return this.remind(Memory_1.Memory.EntityMoved, player) ? [] : new Pantheon_1.Pantheon(this.game, player).sacrificeToPreventMove();
|
|
76
|
+
};
|
|
77
|
+
SimultaneousMoveEffectRule.prototype.getMovementMoves = function (player) {
|
|
66
78
|
var _this = this;
|
|
67
79
|
var cards = this.getCardsAbleToMove(player);
|
|
68
80
|
return cards.getIndexes().flatMap(function (cardIndex) {
|
|
69
81
|
var card = cards.index(cardIndex);
|
|
70
|
-
return _this.getAvailableDestinations(player, card.getItem()
|
|
82
|
+
return _this.getAvailableDestinations(player, card.getItem()).map(function (_a) {
|
|
71
83
|
var x = _a.x, y = _a.y;
|
|
72
84
|
return card.moveItem({ type: LocationType_1.LocationType.Pantheon, player: player, x: x, y: y });
|
|
73
85
|
});
|
|
@@ -80,42 +92,62 @@ var SimultaneousMoveEffectRule = (function (_super) {
|
|
|
80
92
|
SimultaneousMoveEffectRule.prototype.getMovingCards = function (player) {
|
|
81
93
|
return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
82
94
|
};
|
|
83
|
-
SimultaneousMoveEffectRule.prototype.getAvailableDestinations = function (player, card
|
|
95
|
+
SimultaneousMoveEffectRule.prototype.getAvailableDestinations = function (player, card) {
|
|
84
96
|
var _this = this;
|
|
85
97
|
return new Pantheon_1.Pantheon(this.game, player).legalSpaces.filter(function (space) { return (space.y !== card.location.y || space.x !== card.location.x) && _this.isLegalDestination(space, card.location); });
|
|
86
98
|
};
|
|
87
99
|
SimultaneousMoveEffectRule.prototype.isLegalDestination = function (_space, _cardLocation) {
|
|
88
100
|
return true;
|
|
89
101
|
};
|
|
90
|
-
SimultaneousMoveEffectRule.prototype.
|
|
91
|
-
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)
|
|
92
|
-
|
|
102
|
+
SimultaneousMoveEffectRule.prototype.beforeItemMove = function (move) {
|
|
103
|
+
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move)) {
|
|
104
|
+
if (move.location.type === LocationType_1.LocationType.Pantheon) {
|
|
105
|
+
this.memorize(Memory_1.Memory.EntityMoved, true, move.location.player);
|
|
106
|
+
return this.onCardMoved(move);
|
|
107
|
+
}
|
|
108
|
+
else if (move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
109
|
+
return this.onCardSacrificed(move);
|
|
110
|
+
}
|
|
93
111
|
}
|
|
94
112
|
return [];
|
|
95
113
|
};
|
|
96
114
|
SimultaneousMoveEffectRule.prototype.onCardMoved = function (move) {
|
|
97
115
|
return [this.endPlayerTurn(move.location.player)];
|
|
98
116
|
};
|
|
117
|
+
SimultaneousMoveEffectRule.prototype.onCardSacrificed = function (move) {
|
|
118
|
+
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
119
|
+
new TriggerEffectsRule_1.TriggerEffectsRule(this.game).triggerEffects({ type: Effect_1.TriggerEventType.EntitySacrificed, card: card.getItem(), cardIndex: card.getIndex() });
|
|
120
|
+
return [this.endPlayerTurn(move.location.player)];
|
|
121
|
+
};
|
|
99
122
|
SimultaneousMoveEffectRule.prototype.getMovesAfterPlayersDone = function () {
|
|
100
|
-
|
|
123
|
+
return this.updatePlayersGrids().concat(_super.prototype.getMovesAfterPlayersDone.call(this));
|
|
124
|
+
};
|
|
125
|
+
SimultaneousMoveEffectRule.prototype.updatePlayersGrids = function () {
|
|
126
|
+
var e_1, _a, _b;
|
|
101
127
|
var moves = [];
|
|
128
|
+
var events = [];
|
|
102
129
|
try {
|
|
103
|
-
for (var
|
|
104
|
-
var player =
|
|
130
|
+
for (var _c = __values(this.game.players), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
131
|
+
var player = _d.value;
|
|
105
132
|
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
106
|
-
|
|
133
|
+
events.push.apply(events, __spreadArray([], __read(pantheon.updateGrid()), false));
|
|
134
|
+
moves.push.apply(moves, __spreadArray([], __read(pantheon.gainBonus()), false));
|
|
107
135
|
}
|
|
108
136
|
}
|
|
109
137
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
110
138
|
finally {
|
|
111
139
|
try {
|
|
112
|
-
if (
|
|
140
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
113
141
|
}
|
|
114
142
|
finally { if (e_1) throw e_1.error; }
|
|
115
143
|
}
|
|
116
|
-
|
|
144
|
+
(_b = new TriggerEffectsRule_1.TriggerEffectsRule(this.game)).triggerEffects.apply(_b, __spreadArray([], __read(events), false));
|
|
117
145
|
return moves;
|
|
118
146
|
};
|
|
147
|
+
SimultaneousMoveEffectRule.prototype.onRuleEnd = function () {
|
|
148
|
+
this.forget(Memory_1.Memory.EntityMoved);
|
|
149
|
+
return [];
|
|
150
|
+
};
|
|
119
151
|
return SimultaneousMoveEffectRule;
|
|
120
152
|
}(Effect_1.SimultaneousEffectRule));
|
|
121
153
|
exports.SimultaneousMoveEffectRule = SimultaneousMoveEffectRule;
|
|
@@ -4,6 +4,7 @@ import { SimultaneousEffectRule } from './Effect';
|
|
|
4
4
|
export declare abstract class SimultaneousSacrificeEffectRule extends SimultaneousEffectRule {
|
|
5
5
|
getAffectedPlayers(): PlayerColor[];
|
|
6
6
|
getActivePlayerLegalMoves(player: PlayerColor): MaterialMove[];
|
|
7
|
+
private getCardsAbleToSacrifice;
|
|
7
8
|
getCardsToSacrifice(player: PlayerColor): Material;
|
|
8
9
|
beforeItemMove(move: ItemMove): MaterialMove[];
|
|
9
10
|
onSacrifice(move: MoveItem): import("@gamepark/rules-api").EndPlayerTurn<number>[];
|
|
@@ -14,35 +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.SimultaneousSacrificeEffectRule = void 0;
|
|
44
19
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
45
|
-
var
|
|
20
|
+
var PermanentEffectsRule_1 = require("../../rules/effects/PermanentEffectsRule");
|
|
46
21
|
var LocationType_1 = require("../LocationType");
|
|
47
22
|
var MaterialType_1 = require("../MaterialType");
|
|
48
23
|
var Pantheon_1 = require("../Pantheon");
|
|
@@ -57,22 +32,24 @@ var SimultaneousSacrificeEffectRule = (function (_super) {
|
|
|
57
32
|
return this.game.players.filter(function (player) { return _this.getCardsToSacrifice(player).length; });
|
|
58
33
|
};
|
|
59
34
|
SimultaneousSacrificeEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
60
|
-
var
|
|
61
|
-
var moves =
|
|
62
|
-
var indexes =
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
35
|
+
var cards = this.getCardsAbleToSacrifice(player);
|
|
36
|
+
var moves = cards.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: player });
|
|
37
|
+
var indexes = cards.getIndexes();
|
|
38
|
+
var replaceSacrifice = new Pantheon_1.Pantheon(this.game, player).replaceSacrifice(cards.getItems()).index(function (index) { return !indexes.includes(index); });
|
|
39
|
+
return moves.concat(replaceSacrifice.moveItems({ type: LocationType_1.LocationType.PlayerDiscard, player: player }));
|
|
40
|
+
};
|
|
41
|
+
SimultaneousSacrificeEffectRule.prototype.getCardsAbleToSacrifice = function (player) {
|
|
42
|
+
var rule = new PermanentEffectsRule_1.PermanentEffectsRule(this.game);
|
|
43
|
+
return this.getCardsToSacrifice(player).filter(function (card) { return rule.canSacrifice(card); });
|
|
67
44
|
};
|
|
68
45
|
SimultaneousSacrificeEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
69
46
|
return new Pantheon_1.Pantheon(this.game, player).visibleEntities;
|
|
70
47
|
};
|
|
71
48
|
SimultaneousSacrificeEffectRule.prototype.beforeItemMove = function (move) {
|
|
72
|
-
var _a;
|
|
73
49
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.EntityCard)(move) && move.location.type === LocationType_1.LocationType.PlayerDiscard) {
|
|
74
50
|
var card = this.material(MaterialType_1.MaterialType.EntityCard).index(move.itemIndex);
|
|
75
|
-
|
|
51
|
+
new Pantheon_1.Pantheon(this.game, move.location.player).onEntitySacrificed(card);
|
|
52
|
+
return this.onSacrifice(move);
|
|
76
53
|
}
|
|
77
54
|
return [];
|
|
78
55
|
};
|