@gamepark/mythologies 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Memory.d.ts +3 -10
- package/dist/Memory.js +3 -10
- package/dist/material/Pantheon.js +3 -2
- package/dist/material/entity/Effect.d.ts +7 -6
- package/dist/material/entity/Effect.js +4 -4
- package/dist/material/entity/chinese/ChangE.js +5 -4
- package/dist/material/entity/greek/Poseidon.js +2 -2
- package/dist/rules/PlaceTokenRule.js +1 -1
- package/dist/rules/effects/AnubisEffectRule.js +3 -3
- package/dist/rules/effects/FairyEffectRule.js +4 -4
- package/dist/rules/effects/FenrirEffectRule.js +3 -3
- package/dist/rules/effects/GarudaEffectRule.js +3 -3
- package/dist/rules/effects/IllapaEffectRule.js +2 -2
- package/dist/rules/effects/InkosazanaEffectRule.js +3 -3
- package/dist/rules/effects/NuwaEffectRule.js +4 -4
- package/dist/rules/effects/OdinEffectRule.js +2 -2
- package/dist/rules/effects/TianlongEffectRule.js +5 -5
- package/dist/rules/effects/TriggerEffectsRule.js +3 -0
- package/dist/rules/effects/YanluoWangEffectRule.js +3 -3
- package/package.json +2 -2
package/dist/Memory.d.ts
CHANGED
|
@@ -8,14 +8,7 @@ export declare enum Memory {
|
|
|
8
8
|
TargetEntities = 7,
|
|
9
9
|
EffectCount = 8,
|
|
10
10
|
EntityMoved = 9,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
GarudaSacrificeCount = 13,
|
|
15
|
-
IllapaLine = 14,
|
|
16
|
-
YanluoWangCount = 15,
|
|
17
|
-
NuwaPlayerCreatures = 16,
|
|
18
|
-
TianlongVector = 17,
|
|
19
|
-
InkosazanaInvoke1 = 18,
|
|
20
|
-
FairyTargets = 19
|
|
11
|
+
TargetMythology = 10,
|
|
12
|
+
TargetLine = 11,
|
|
13
|
+
TargetLocations = 12
|
|
21
14
|
}
|
package/dist/Memory.js
CHANGED
|
@@ -12,14 +12,7 @@ var Memory;
|
|
|
12
12
|
Memory[Memory["TargetEntities"] = 7] = "TargetEntities";
|
|
13
13
|
Memory[Memory["EffectCount"] = 8] = "EffectCount";
|
|
14
14
|
Memory[Memory["EntityMoved"] = 9] = "EntityMoved";
|
|
15
|
-
Memory[Memory["
|
|
16
|
-
Memory[Memory["
|
|
17
|
-
Memory[Memory["
|
|
18
|
-
Memory[Memory["GarudaSacrificeCount"] = 13] = "GarudaSacrificeCount";
|
|
19
|
-
Memory[Memory["IllapaLine"] = 14] = "IllapaLine";
|
|
20
|
-
Memory[Memory["YanluoWangCount"] = 15] = "YanluoWangCount";
|
|
21
|
-
Memory[Memory["NuwaPlayerCreatures"] = 16] = "NuwaPlayerCreatures";
|
|
22
|
-
Memory[Memory["TianlongVector"] = 17] = "TianlongVector";
|
|
23
|
-
Memory[Memory["InkosazanaInvoke1"] = 18] = "InkosazanaInvoke1";
|
|
24
|
-
Memory[Memory["FairyTargets"] = 19] = "FairyTargets";
|
|
15
|
+
Memory[Memory["TargetMythology"] = 10] = "TargetMythology";
|
|
16
|
+
Memory[Memory["TargetLine"] = 11] = "TargetLine";
|
|
17
|
+
Memory[Memory["TargetLocations"] = 12] = "TargetLocations";
|
|
25
18
|
})(Memory = exports.Memory || (exports.Memory = {}));
|
|
@@ -210,10 +210,11 @@ var Pantheon = (function (_super) {
|
|
|
210
210
|
var triggerEffectsRule = new TriggerEffectsRule_1.TriggerEffectsRule(this.game);
|
|
211
211
|
triggerEffectsRule.triggerCardEffect(card, { type: Effect_1.TriggerEventType.SelfPlaced, location: location });
|
|
212
212
|
var triggerEvents = this.updateGrid(grid);
|
|
213
|
-
|
|
213
|
+
var invoked = this.isInvoke;
|
|
214
|
+
if (invoked) {
|
|
214
215
|
moves.push.apply(moves, __spreadArray([], __read(this.onInvoke(move)), false));
|
|
215
|
-
triggerEvents.push({ type: Effect_1.TriggerEventType.EntityInvoked, cardIndex: move.itemIndex, entity: entity, cardLocation: location });
|
|
216
216
|
}
|
|
217
|
+
triggerEvents.push({ type: Effect_1.TriggerEventType.EntityPlaced, cardIndex: move.itemIndex, entity: entity, location: location, invoked: invoked });
|
|
217
218
|
if (triggerEvents.length) {
|
|
218
219
|
triggerEffectsRule.triggerEffects.apply(triggerEffectsRule, __spreadArray([], __read(triggerEvents), false));
|
|
219
220
|
}
|
|
@@ -49,7 +49,7 @@ export declare abstract class AutoEffectRule extends MaterialRulesPart implement
|
|
|
49
49
|
export declare enum TriggerEventType {
|
|
50
50
|
EndOfGame = 1,
|
|
51
51
|
SelfPlaced = 2,
|
|
52
|
-
|
|
52
|
+
EntityPlaced = 3,
|
|
53
53
|
LineEvent = 4,
|
|
54
54
|
ColumnEvent = 5,
|
|
55
55
|
Infinite = 6,
|
|
@@ -62,17 +62,18 @@ export type SelfPlaced = {
|
|
|
62
62
|
type: TriggerEventType.SelfPlaced;
|
|
63
63
|
location: Location;
|
|
64
64
|
};
|
|
65
|
-
export declare const isPlaced: (event: TriggerEvent) => event is SelfPlaced;
|
|
66
65
|
export type EndOfGameEvent = {
|
|
67
66
|
type: TriggerEventType.EndOfGame;
|
|
68
67
|
};
|
|
69
68
|
export declare const isEndOfGame: (event: TriggerEvent) => event is EndOfGameEvent;
|
|
70
|
-
export type
|
|
71
|
-
type: TriggerEventType.
|
|
69
|
+
export type EntityPlaced = {
|
|
70
|
+
type: TriggerEventType.EntityPlaced;
|
|
72
71
|
cardIndex: number;
|
|
73
72
|
entity: Entity;
|
|
74
|
-
|
|
73
|
+
location: Location;
|
|
74
|
+
invoked: boolean;
|
|
75
75
|
};
|
|
76
|
+
export declare const isPlaced: (event: TriggerEvent) => event is SelfPlaced;
|
|
76
77
|
export declare enum LineEventType {
|
|
77
78
|
BonusGain = 1,
|
|
78
79
|
Completed = 2
|
|
@@ -115,7 +116,7 @@ export type EndOfTurn = {
|
|
|
115
116
|
player: PlayerColor;
|
|
116
117
|
};
|
|
117
118
|
export declare const isEndOfMyTurn: (event: TriggerEvent, card: Material) => event is EndOfTurn;
|
|
118
|
-
export type TriggerEvent = EndOfGameEvent | SelfPlaced |
|
|
119
|
+
export type TriggerEvent = EndOfGameEvent | SelfPlaced | EntityPlaced | LineEvent | ColumnEvent | Infinite | EntityCrushed | EntitySacrificed | EntitiesMoved | EndOfTurn;
|
|
119
120
|
export type PendingEffect<Event extends TriggerEvent = TriggerEvent> = {
|
|
120
121
|
cardIndex: number;
|
|
121
122
|
effectIndex: number;
|
|
@@ -15,7 +15,7 @@ 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.
|
|
18
|
+
exports.isEndOfMyTurn = exports.isSacrificed = exports.isCrushed = exports.oncePerTurn = exports.LineEventType = exports.isPlaced = exports.isEndOfGame = 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");
|
|
@@ -121,7 +121,7 @@ var TriggerEventType;
|
|
|
121
121
|
(function (TriggerEventType) {
|
|
122
122
|
TriggerEventType[TriggerEventType["EndOfGame"] = 1] = "EndOfGame";
|
|
123
123
|
TriggerEventType[TriggerEventType["SelfPlaced"] = 2] = "SelfPlaced";
|
|
124
|
-
TriggerEventType[TriggerEventType["
|
|
124
|
+
TriggerEventType[TriggerEventType["EntityPlaced"] = 3] = "EntityPlaced";
|
|
125
125
|
TriggerEventType[TriggerEventType["LineEvent"] = 4] = "LineEvent";
|
|
126
126
|
TriggerEventType[TriggerEventType["ColumnEvent"] = 5] = "ColumnEvent";
|
|
127
127
|
TriggerEventType[TriggerEventType["Infinite"] = 6] = "Infinite";
|
|
@@ -130,10 +130,10 @@ var TriggerEventType;
|
|
|
130
130
|
TriggerEventType[TriggerEventType["EntitiesMoved"] = 9] = "EntitiesMoved";
|
|
131
131
|
TriggerEventType[TriggerEventType["EndOfTurn"] = 10] = "EndOfTurn";
|
|
132
132
|
})(TriggerEventType = exports.TriggerEventType || (exports.TriggerEventType = {}));
|
|
133
|
-
var isPlaced = function (event) { return event.type === TriggerEventType.SelfPlaced; };
|
|
134
|
-
exports.isPlaced = isPlaced;
|
|
135
133
|
var isEndOfGame = function (event) { return event.type === TriggerEventType.EndOfGame; };
|
|
136
134
|
exports.isEndOfGame = isEndOfGame;
|
|
135
|
+
var isPlaced = function (event) { return event.type === TriggerEventType.SelfPlaced; };
|
|
136
|
+
exports.isPlaced = isPlaced;
|
|
137
137
|
var LineEventType;
|
|
138
138
|
(function (LineEventType) {
|
|
139
139
|
LineEventType[LineEventType["BonusGain"] = 1] = "BonusGain";
|
|
@@ -23,9 +23,10 @@ exports.ChangE = {
|
|
|
23
23
|
invoke: [{ gem: 1, favor: 2 }, { gem: 2 }, {}],
|
|
24
24
|
effect: {
|
|
25
25
|
trigger: function (event, card) {
|
|
26
|
-
return (event.type === Effect_1.TriggerEventType.
|
|
27
|
-
|
|
28
|
-
card.getItem().location.
|
|
26
|
+
return (event.type === Effect_1.TriggerEventType.EntityPlaced &&
|
|
27
|
+
event.invoked &&
|
|
28
|
+
card.getItem().location.player !== event.location.player &&
|
|
29
|
+
card.getItem().location.y === event.location.y);
|
|
29
30
|
},
|
|
30
31
|
rule: (function (_super) {
|
|
31
32
|
__extends(ChangeEEffectRule, _super);
|
|
@@ -33,7 +34,7 @@ exports.ChangE = {
|
|
|
33
34
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
35
|
}
|
|
35
36
|
ChangeEEffectRule.prototype.playEffect = function () {
|
|
36
|
-
var playerInvoked = this.getEffect().triggerEvent.
|
|
37
|
+
var playerInvoked = this.getEffect().triggerEvent.location.player;
|
|
37
38
|
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(playerInvoked);
|
|
38
39
|
return gems.getQuantity() > 0 ? [gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: this.player }, 1)] : [];
|
|
39
40
|
};
|
|
@@ -25,7 +25,7 @@ exports.Poseidon = {
|
|
|
25
25
|
invoke: [{ gem: 1 }, { gem: 2, favor: 1 }, { favor: 1 }],
|
|
26
26
|
effect: {
|
|
27
27
|
trigger: function (event, card) {
|
|
28
|
-
return event.type === Effect_1.TriggerEventType.
|
|
28
|
+
return event.type === Effect_1.TriggerEventType.EntityPlaced && event.invoked && (0, Entity_1.isGod)(event.entity) && event.location.player === card.getItem().location.player;
|
|
29
29
|
},
|
|
30
30
|
rule: (function (_super) {
|
|
31
31
|
__extends(PoseidonEffectRule, _super);
|
|
@@ -33,7 +33,7 @@ exports.Poseidon = {
|
|
|
33
33
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
34
|
}
|
|
35
35
|
PoseidonEffectRule.prototype.playEffect = function () {
|
|
36
|
-
var cardLocation = this.remind(Memory_1.Memory.OngoingEffect).triggerEvent.
|
|
36
|
+
var cardLocation = this.remind(Memory_1.Memory.OngoingEffect).triggerEvent.location;
|
|
37
37
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
38
38
|
var gain = pantheon.visibleEntities.location(function (l) { return (0, rules_api_1.areAdjacentSquares)(l, cardLocation); }).length;
|
|
39
39
|
return gain > 0 ? [pantheon.gainFavor(gain)] : [];
|
|
@@ -97,7 +97,7 @@ var PlaceTokenRule = (function (_super) {
|
|
|
97
97
|
PlaceTokenRule.prototype.getAvailableCards = function (player) {
|
|
98
98
|
var destiny = new Destiny_1.Destiny(this.game);
|
|
99
99
|
var mythology = destiny.getMythology(player);
|
|
100
|
-
if (this.remind(Memory_1.Memory.
|
|
100
|
+
if (this.remind(Memory_1.Memory.TargetMythology) === mythology && !new Pantheon_1.Pantheon(this.game, player).hasEntity(Entity_1.Entity.Odin)) {
|
|
101
101
|
return [this.getTopDeckCreature(mythology)];
|
|
102
102
|
}
|
|
103
103
|
var entities = destiny.getAvailableEntities(player);
|
|
@@ -29,12 +29,12 @@ var AnubisEffectRule = (function (_super) {
|
|
|
29
29
|
return _this;
|
|
30
30
|
}
|
|
31
31
|
AnubisEffectRule.prototype.onRuleStart = function () {
|
|
32
|
-
if (!this.remind(Memory_1.Memory.
|
|
32
|
+
if (!this.remind(Memory_1.Memory.EffectCount)) {
|
|
33
33
|
this.remind(Memory_1.Memory.PendingEffects).unshift([this.getEffect()]);
|
|
34
|
-
this.memorize(Memory_1.Memory.
|
|
34
|
+
this.memorize(Memory_1.Memory.EffectCount, true);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
this.forget(Memory_1.Memory.
|
|
37
|
+
this.forget(Memory_1.Memory.EffectCount);
|
|
38
38
|
}
|
|
39
39
|
return _super.prototype.onRuleStart.call(this);
|
|
40
40
|
};
|
|
@@ -32,22 +32,22 @@ var FairyEffectRule = (function (_super) {
|
|
|
32
32
|
FairyEffectRule.prototype.playEffect = function () {
|
|
33
33
|
var _a = this.card.location, x = _a.x, y = _a.y;
|
|
34
34
|
var targets = new Pantheon_1.Pantheon(this.game, this.player).visibleEntities.location(function (l) { return l.y === y && l.x !== x; }).sort(function (item) { return item.location.x; }).getIndexes();
|
|
35
|
-
this.memorize(Memory_1.Memory.
|
|
35
|
+
this.memorize(Memory_1.Memory.TargetEntities, targets);
|
|
36
36
|
return _super.prototype.playEffect.call(this);
|
|
37
37
|
};
|
|
38
38
|
FairyEffectRule.prototype.getCardsToSacrifice = function () {
|
|
39
|
-
return this.material(MaterialType_1.MaterialType.EntityCard).index(this.remind(Memory_1.Memory.
|
|
39
|
+
return this.material(MaterialType_1.MaterialType.EntityCard).index(this.remind(Memory_1.Memory.TargetEntities)[0]);
|
|
40
40
|
};
|
|
41
41
|
FairyEffectRule.prototype.onSacrifice = function () {
|
|
42
42
|
var moves = [new Pantheon_1.Pantheon(this.game, this.player).gainGems(2)];
|
|
43
|
-
var targets = this.memorize(Memory_1.Memory.
|
|
43
|
+
var targets = this.memorize(Memory_1.Memory.TargetEntities, function (targets) { return targets.slice(1); });
|
|
44
44
|
if (!targets.length) {
|
|
45
45
|
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
46
46
|
}
|
|
47
47
|
return moves;
|
|
48
48
|
};
|
|
49
49
|
FairyEffectRule.prototype.onRuleEnd = function () {
|
|
50
|
-
this.forget(Memory_1.Memory.
|
|
50
|
+
this.forget(Memory_1.Memory.TargetEntities);
|
|
51
51
|
return [];
|
|
52
52
|
};
|
|
53
53
|
return FairyEffectRule;
|
|
@@ -115,8 +115,8 @@ var FenrirEffectRule = (function (_super) {
|
|
|
115
115
|
FenrirEffectRule.prototype.beforeItemMove = function (move) {
|
|
116
116
|
if ((0, rules_api_1.isDeleteItem)(move)) {
|
|
117
117
|
var player = this.material(move.itemType).getItem(move.itemIndex).location.player;
|
|
118
|
-
if (!this.remind(Memory_1.Memory.
|
|
119
|
-
this.memorize(Memory_1.Memory.
|
|
118
|
+
if (!this.remind(Memory_1.Memory.EffectCount, player)) {
|
|
119
|
+
this.memorize(Memory_1.Memory.EffectCount, true, player);
|
|
120
120
|
}
|
|
121
121
|
else {
|
|
122
122
|
return [this.endPlayerTurn(player)];
|
|
@@ -125,7 +125,7 @@ var FenrirEffectRule = (function (_super) {
|
|
|
125
125
|
return [];
|
|
126
126
|
};
|
|
127
127
|
FenrirEffectRule.prototype.onRuleEnd = function () {
|
|
128
|
-
this.forget(Memory_1.Memory.
|
|
128
|
+
this.forget(Memory_1.Memory.EffectCount);
|
|
129
129
|
return [];
|
|
130
130
|
};
|
|
131
131
|
return FenrirEffectRule;
|
|
@@ -58,7 +58,7 @@ var GarudaEffectRule = (function (_super) {
|
|
|
58
58
|
var count = this.getCardsToSacrifice().length;
|
|
59
59
|
if (!count)
|
|
60
60
|
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
61
|
-
this.memorize(Memory_1.Memory.
|
|
61
|
+
this.memorize(Memory_1.Memory.EffectCount, count);
|
|
62
62
|
var moves = [new Pantheon_1.Pantheon(this.game, this.player).gainGems(count)];
|
|
63
63
|
var playerMoves = this.getPlayerMoves();
|
|
64
64
|
if (playerMoves.length === count) {
|
|
@@ -71,12 +71,12 @@ var GarudaEffectRule = (function (_super) {
|
|
|
71
71
|
return pantheon.visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); }).location(function (l) { return l.y === 1; });
|
|
72
72
|
};
|
|
73
73
|
GarudaEffectRule.prototype.onSacrifice = function () {
|
|
74
|
-
var sacrificeLeft = this.memorize(Memory_1.Memory.
|
|
74
|
+
var sacrificeLeft = this.memorize(Memory_1.Memory.EffectCount, function (count) { return count - 1; });
|
|
75
75
|
if (sacrificeLeft) {
|
|
76
76
|
return [];
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
this.forget(Memory_1.Memory.
|
|
79
|
+
this.forget(Memory_1.Memory.EffectCount);
|
|
80
80
|
return [this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
81
81
|
}
|
|
82
82
|
};
|
|
@@ -37,7 +37,7 @@ var IllapaEffectRule = (function (_super) {
|
|
|
37
37
|
};
|
|
38
38
|
IllapaEffectRule.prototype.onCustomMove = function (move) {
|
|
39
39
|
if (move.type === CustomMoveType_1.CustomMoveType.ChooseLine) {
|
|
40
|
-
this.memorize(Memory_1.Memory.
|
|
40
|
+
this.memorize(Memory_1.Memory.TargetLine, move.data);
|
|
41
41
|
var players = this.getPlayersHavingToSacrifice(move.data);
|
|
42
42
|
if (players.length) {
|
|
43
43
|
return [this.startSimultaneousRule(RuleId_1.RuleId.IllapaSacrifice, players)];
|
|
@@ -61,7 +61,7 @@ var IllapaSacrificeRule = (function (_super) {
|
|
|
61
61
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
62
62
|
}
|
|
63
63
|
IllapaSacrificeRule.prototype.getCardsToSacrifice = function (player) {
|
|
64
|
-
var line = this.remind(Memory_1.Memory.
|
|
64
|
+
var line = this.remind(Memory_1.Memory.TargetLine);
|
|
65
65
|
return _super.prototype.getCardsToSacrifice.call(this, player)
|
|
66
66
|
.id(function (id) { return (0, Entity_1.isCreature)(id.front); })
|
|
67
67
|
.location(function (l) { return l.y === line; });
|
|
@@ -29,12 +29,12 @@ var InkosazanaEffectRule = (function (_super) {
|
|
|
29
29
|
return _this;
|
|
30
30
|
}
|
|
31
31
|
InkosazanaEffectRule.prototype.onRuleStart = function () {
|
|
32
|
-
if (!this.remind(Memory_1.Memory.
|
|
32
|
+
if (!this.remind(Memory_1.Memory.EffectCount)) {
|
|
33
33
|
this.remind(Memory_1.Memory.PendingEffects).unshift([this.getEffect()]);
|
|
34
|
-
this.memorize(Memory_1.Memory.
|
|
34
|
+
this.memorize(Memory_1.Memory.EffectCount, true);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
this.forget(Memory_1.Memory.
|
|
37
|
+
this.forget(Memory_1.Memory.EffectCount);
|
|
38
38
|
}
|
|
39
39
|
return _super.prototype.onRuleStart.call(this);
|
|
40
40
|
};
|
|
@@ -51,7 +51,7 @@ var NuwaEffectRule = (function (_super) {
|
|
|
51
51
|
if (this.isOpponent(player)) {
|
|
52
52
|
var creatures = new Pantheon_1.Pantheon(this.game, player).visibleEntities.id(function (id) { return (0, Entity_1.isCreature)(id.front); }).getIndexes();
|
|
53
53
|
if (creatures.length > 0) {
|
|
54
|
-
this.memorize(Memory_1.Memory.
|
|
54
|
+
this.memorize(Memory_1.Memory.TargetEntities, creatures, player);
|
|
55
55
|
players.push(player);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -69,18 +69,18 @@ var NuwaEffectRule = (function (_super) {
|
|
|
69
69
|
NuwaEffectRule.prototype.getActivePlayerLegalMoves = function (player) {
|
|
70
70
|
var moves = _super.prototype.getActivePlayerLegalMoves.call(this, player);
|
|
71
71
|
var gems = this.material(MaterialType_1.MaterialType.GemToken).location(LocationType_1.LocationType.PlayerGems).player(player);
|
|
72
|
-
var creatures = this.remind(Memory_1.Memory.
|
|
72
|
+
var creatures = this.remind(Memory_1.Memory.TargetEntities, player);
|
|
73
73
|
if (gems.getQuantity() >= creatures.length) {
|
|
74
74
|
moves.push(gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: this.card.location.player }, creatures.length));
|
|
75
75
|
}
|
|
76
76
|
return moves;
|
|
77
77
|
};
|
|
78
78
|
NuwaEffectRule.prototype.getCardsToSacrifice = function (player) {
|
|
79
|
-
return _super.prototype.getCardsToSacrifice.call(this, player).index(this.remind(Memory_1.Memory.
|
|
79
|
+
return _super.prototype.getCardsToSacrifice.call(this, player).index(this.remind(Memory_1.Memory.TargetEntities, player));
|
|
80
80
|
};
|
|
81
81
|
NuwaEffectRule.prototype.onSacrifice = function (move) {
|
|
82
82
|
var player = move.location.player;
|
|
83
|
-
var creaturesLeft = this.memorize(Memory_1.Memory.
|
|
83
|
+
var creaturesLeft = this.memorize(Memory_1.Memory.TargetEntities, function (creatures) { return creatures.filter(function (c) { return c !== move.itemIndex; }); }, player);
|
|
84
84
|
return creaturesLeft.length ? [] : [this.endPlayerTurn(player)];
|
|
85
85
|
};
|
|
86
86
|
NuwaEffectRule.prototype.beforeItemMove = function (move) {
|
|
@@ -37,14 +37,14 @@ var OdinEffectRule = (function (_super) {
|
|
|
37
37
|
};
|
|
38
38
|
OdinEffectRule.prototype.onCustomMove = function (move) {
|
|
39
39
|
if (move.type === CustomMoveType_1.CustomMoveType.ChooseMythology) {
|
|
40
|
-
this.memorize(Memory_1.Memory.
|
|
40
|
+
this.memorize(Memory_1.Memory.TargetMythology, move.data);
|
|
41
41
|
return [this.startRule(RuleId_1.RuleId.DrawDestinyCard)];
|
|
42
42
|
}
|
|
43
43
|
return [];
|
|
44
44
|
};
|
|
45
45
|
OdinEffectRule.prototype.isCardRestricted = function (card, player) {
|
|
46
46
|
return ((card.location.type === LocationType_1.LocationType.SanctuaryCreatureSpot || card.location.type === LocationType_1.LocationType.SanctuaryGodSpot) &&
|
|
47
|
-
(0, Entity_1.entityMythology)(card.id.front) === this.remind(Memory_1.Memory.
|
|
47
|
+
(0, Entity_1.entityMythology)(card.id.front) === this.remind(Memory_1.Memory.TargetMythology) &&
|
|
48
48
|
(!player || !new Pantheon_1.Pantheon(this.game, player).hasEntity(Entity_1.Entity.Odin)));
|
|
49
49
|
};
|
|
50
50
|
return OdinEffectRule;
|
|
@@ -76,7 +76,7 @@ var TianlongEffectRule = (function (_super) {
|
|
|
76
76
|
TianlongEffectRule.prototype.onCardMoved = function (move) {
|
|
77
77
|
var e_1, _a;
|
|
78
78
|
var _b = this.material(MaterialType_1.MaterialType.EntityCard).getItem(move.itemIndex).location, x = _b.x, y = _b.y;
|
|
79
|
-
this.memorize(Memory_1.Memory.
|
|
79
|
+
this.memorize(Memory_1.Memory.TargetLocations, [
|
|
80
80
|
{ x: x, y: y },
|
|
81
81
|
{ x: move.location.x, y: move.location.y }
|
|
82
82
|
]);
|
|
@@ -107,7 +107,7 @@ var TianlongEffectRule = (function (_super) {
|
|
|
107
107
|
moves.push(this.startSimultaneousRule(RuleId_1.RuleId.TianlongOpponentsEffect, playersWithChoice));
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
|
-
this.forget(Memory_1.Memory.
|
|
110
|
+
this.forget(Memory_1.Memory.TargetLocations);
|
|
111
111
|
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.EndEffect));
|
|
112
112
|
}
|
|
113
113
|
return moves;
|
|
@@ -125,16 +125,16 @@ var TianlongOpponentsEffectRule = (function (_super) {
|
|
|
125
125
|
return this.game.players.filter(function (player) { return _this.isOpponent(player) && _this.getActivePlayerLegalMoves(player).length > 0; });
|
|
126
126
|
};
|
|
127
127
|
TianlongOpponentsEffectRule.prototype.getMovingCards = function (player) {
|
|
128
|
-
var _a = this.remind(Memory_1.Memory.
|
|
128
|
+
var _a = this.remind(Memory_1.Memory.TargetLocations)[0], x = _a.x, y = _a.y;
|
|
129
129
|
return _super.prototype.getMovingCards.call(this, player).location(function (l) { return l.x === x && l.y === y; });
|
|
130
130
|
};
|
|
131
131
|
TianlongOpponentsEffectRule.prototype.isLegalDestination = function (space) {
|
|
132
|
-
var _a = this.remind(Memory_1.Memory.
|
|
132
|
+
var _a = this.remind(Memory_1.Memory.TargetLocations)[1], x = _a.x, y = _a.y;
|
|
133
133
|
return space.x === x && space.y === y;
|
|
134
134
|
};
|
|
135
135
|
TianlongOpponentsEffectRule.prototype.onRuleEnd = function () {
|
|
136
136
|
this.forget(Memory_1.Memory.EntityMoved);
|
|
137
|
-
this.forget(Memory_1.Memory.
|
|
137
|
+
this.forget(Memory_1.Memory.TargetLocations);
|
|
138
138
|
return [];
|
|
139
139
|
};
|
|
140
140
|
return TianlongOpponentsEffectRule;
|
|
@@ -110,6 +110,9 @@ var TriggerEffectsRule = (function (_super) {
|
|
|
110
110
|
if (event.type === Effect_1.TriggerEventType.EntityCrushed && material.getItem(event.cardIndex).location.player === player && !cards.includes(event.cardIndex)) {
|
|
111
111
|
cards.push(event.cardIndex);
|
|
112
112
|
}
|
|
113
|
+
if (event.type === Effect_1.TriggerEventType.EntityPlaced && event.location.player === player && !cards.includes(event.cardIndex)) {
|
|
114
|
+
cards.push(event.cardIndex);
|
|
115
|
+
}
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -50,7 +50,7 @@ var YanluoWangEffectRule = (function (_super) {
|
|
|
50
50
|
var player = _c.value;
|
|
51
51
|
if (player !== this.player) {
|
|
52
52
|
var emptySpace = new Pantheon_1.Pantheon(this.game, player).grid[2].filter(function (space) { return space === undefined; }).length;
|
|
53
|
-
this.memorize(Memory_1.Memory.
|
|
53
|
+
this.memorize(Memory_1.Memory.EffectCount, emptySpace, player);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -75,7 +75,7 @@ var YanluoWangEffectRule = (function (_super) {
|
|
|
75
75
|
try {
|
|
76
76
|
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
77
77
|
var player = _c.value;
|
|
78
|
-
if (this.remind(Memory_1.Memory.
|
|
78
|
+
if (this.remind(Memory_1.Memory.EffectCount, player) && new Pantheon_1.Pantheon(this.game, player).favor) {
|
|
79
79
|
moves.push(gems.moveItem({ type: LocationType_1.LocationType.PlayerGems, player: player }, 1));
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -93,7 +93,7 @@ var YanluoWangEffectRule = (function (_super) {
|
|
|
93
93
|
YanluoWangEffectRule.prototype.afterItemMove = function (move) {
|
|
94
94
|
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.GemToken)(move)) {
|
|
95
95
|
var player = move.location.player;
|
|
96
|
-
this.memorize(Memory_1.Memory.
|
|
96
|
+
this.memorize(Memory_1.Memory.EffectCount, function (count) { return count - 1; }, player);
|
|
97
97
|
var favor = this.material(MaterialType_1.MaterialType.FavorToken).location(LocationType_1.LocationType.PlayerFavor).player(player);
|
|
98
98
|
return [favor.moveItem({ type: LocationType_1.LocationType.PlayerFavor, player: this.player }, 1)];
|
|
99
99
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "The rules of Mythologies adapted for Game Park",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"i18next": "^22.0.3",
|
|
30
30
|
"lodash": "^4.17.21"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "2a9168d4a7d37a2588e10d2f2e9794a2657a7d60"
|
|
33
33
|
}
|