@gamepark/mythologies 0.7.4 → 0.7.5
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/MythologiesRules.js +1 -1
- package/dist/material/entity/greek/Poseidon.js +1 -1
- package/dist/rules/EndGameRule.d.ts +3 -3
- package/dist/rules/EndGameRule.js +62 -1
- package/dist/rules/effects/ImpunduluEffectRule.d.ts +5 -1
- package/dist/rules/effects/ImpunduluEffectRule.js +41 -7
- package/dist/rules/effects/MinotaurEffectRule.js +2 -1
- package/dist/rules/effects/ViracochaEffectRule.js +1 -1
- package/package.json +2 -2
package/dist/MythologiesRules.js
CHANGED
|
@@ -244,7 +244,7 @@ var MythologiesRules = (function (_super) {
|
|
|
244
244
|
if (pendingRule) {
|
|
245
245
|
this.forget(Memory_1.Memory.PendingRule);
|
|
246
246
|
if (pendingRule.id === RuleId_1.RuleId.EndGame) {
|
|
247
|
-
moves.push(this.endGame());
|
|
247
|
+
moves.push.apply(moves, __spreadArray(__spreadArray([], __read(new EndGameRule_1.EndGameRule(this.game).convertGems()), false), [this.endGame()], false));
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
250
250
|
moves.push(this.startPlayerTurn(RuleId_1.RuleId.PlaceCards, pendingRule.player));
|
|
@@ -22,7 +22,7 @@ var Entity_1 = require("../../Entity");
|
|
|
22
22
|
var Pantheon_1 = require("../../Pantheon");
|
|
23
23
|
var Effect_1 = require("../Effect");
|
|
24
24
|
exports.Poseidon = {
|
|
25
|
-
invoke: [{}, { gem:
|
|
25
|
+
invoke: [{}, { gem: 1 }, { favor: 1 }],
|
|
26
26
|
effect: {
|
|
27
27
|
trigger: function (event, _a) {
|
|
28
28
|
var cardLocation = _a.cardLocation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PlayerTurnRule } from '@gamepark/rules-api';
|
|
2
|
-
import { RuleId } from './RuleId';
|
|
1
|
+
import { MaterialMove, PlayerTurnRule } from '@gamepark/rules-api';
|
|
3
2
|
export declare class EndGameRule extends PlayerTurnRule {
|
|
4
|
-
onRuleStart():
|
|
3
|
+
onRuleStart(): MaterialMove<number, number, number, number>[];
|
|
4
|
+
convertGems(): MaterialMove<number, number, number, number>[];
|
|
5
5
|
}
|
|
@@ -14,11 +14,48 @@ 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
|
+
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
|
+
};
|
|
17
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
54
|
exports.EndGameRule = void 0;
|
|
19
55
|
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
56
|
var Effect_1 = require("../material/entity/Effect");
|
|
21
57
|
var MaterialType_1 = require("../material/MaterialType");
|
|
58
|
+
var Pantheon_1 = require("../material/Pantheon");
|
|
22
59
|
var Memory_1 = require("../Memory");
|
|
23
60
|
var TriggerEffectsRule_1 = require("./effects/TriggerEffectsRule");
|
|
24
61
|
var RuleId_1 = require("./RuleId");
|
|
@@ -36,8 +73,32 @@ var EndGameRule = (function (_super) {
|
|
|
36
73
|
return [this.startPlayerTurn(RuleId_1.RuleId.ResolveEffects, player)];
|
|
37
74
|
}
|
|
38
75
|
else {
|
|
39
|
-
return [this.endGame()];
|
|
76
|
+
return __spreadArray(__spreadArray([], __read(this.convertGems()), false), [this.endGame()], false);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
EndGameRule.prototype.convertGems = function () {
|
|
80
|
+
var e_1, _a;
|
|
81
|
+
var moves = [];
|
|
82
|
+
try {
|
|
83
|
+
for (var _b = __values(this.game.players), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
84
|
+
var player = _c.value;
|
|
85
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, player);
|
|
86
|
+
var gems = pantheon.gems;
|
|
87
|
+
if (gems >= 3) {
|
|
88
|
+
var favor = Math.floor(gems / 3);
|
|
89
|
+
moves.push(pantheon.spendGems(favor * 3));
|
|
90
|
+
moves.push(pantheon.gainFavor(favor));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
95
|
+
finally {
|
|
96
|
+
try {
|
|
97
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
98
|
+
}
|
|
99
|
+
finally { if (e_1) throw e_1.error; }
|
|
40
100
|
}
|
|
101
|
+
return moves;
|
|
41
102
|
};
|
|
42
103
|
return EndGameRule;
|
|
43
104
|
}(rules_api_1.PlayerTurnRule));
|
|
@@ -2,6 +2,10 @@ import { InvokeEffectRule } from '../../material/entity/PlaceCardEffectRule';
|
|
|
2
2
|
import { RuleId } from '../RuleId';
|
|
3
3
|
export declare class ImpunduluEffectRule extends InvokeEffectRule {
|
|
4
4
|
ruleId: RuleId;
|
|
5
|
-
playEffect(): import("@gamepark/rules-api").
|
|
5
|
+
playEffect(): import("@gamepark/rules-api").StartRule<RuleId>[];
|
|
6
|
+
onRuleStart(): import("@gamepark/rules-api").MoveItem<number, number, number>[];
|
|
6
7
|
getCardsToPlace(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
8
|
+
get availableSanctuaryCards(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
9
|
+
get topCreaturesDeckCard(): import("@gamepark/rules-api").Material<number, number, number>;
|
|
10
|
+
get mythology(): import("../../material/Mythology").Mythology;
|
|
7
11
|
}
|
|
@@ -32,16 +32,50 @@ var ImpunduluEffectRule = (function (_super) {
|
|
|
32
32
|
}
|
|
33
33
|
ImpunduluEffectRule.prototype.playEffect = function () {
|
|
34
34
|
var player = this.card.location.player;
|
|
35
|
-
return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ?
|
|
35
|
+
return new Pantheon_1.Pantheon(this.game, player).hasCrushed(this.card) ? [this.startRule(this.ruleId)] : [];
|
|
36
|
+
};
|
|
37
|
+
ImpunduluEffectRule.prototype.onRuleStart = function () {
|
|
38
|
+
if (this.availableSanctuaryCards.length === 0) {
|
|
39
|
+
return [this.topCreaturesDeckCard.rotateItem(true)];
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
36
42
|
};
|
|
37
43
|
ImpunduluEffectRule.prototype.getCardsToPlace = function () {
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
var availableSanctuaryCards = this.availableSanctuaryCards;
|
|
45
|
+
if (availableSanctuaryCards.length) {
|
|
46
|
+
return availableSanctuaryCards;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return this.topCreaturesDeckCard;
|
|
50
|
+
}
|
|
44
51
|
};
|
|
52
|
+
Object.defineProperty(ImpunduluEffectRule.prototype, "availableSanctuaryCards", {
|
|
53
|
+
get: function () {
|
|
54
|
+
var _this = this;
|
|
55
|
+
var board = this.material(MaterialType_1.MaterialType.MythologyBoard).id(function (id) { return id.mythology === _this.mythology; });
|
|
56
|
+
return new Destiny_1.Destiny(this.game).cardsWithoutToken.location(LocationType_1.LocationType.SanctuaryCreatureSpot).parent(board.getIndex());
|
|
57
|
+
},
|
|
58
|
+
enumerable: false,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(ImpunduluEffectRule.prototype, "topCreaturesDeckCard", {
|
|
62
|
+
get: function () {
|
|
63
|
+
var deck = this.material(MaterialType_1.MaterialType.EntityCard).location(LocationType_1.LocationType.CreaturesDeck).locationId(this.mythology);
|
|
64
|
+
return deck.maxBy(function (item) { return item.location.x; });
|
|
65
|
+
},
|
|
66
|
+
enumerable: false,
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(ImpunduluEffectRule.prototype, "mythology", {
|
|
70
|
+
get: function () {
|
|
71
|
+
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
72
|
+
var _a = this.card.location, x = _a.x, y = _a.y;
|
|
73
|
+
var crushed = pantheon.coveredEntities.location(function (l) { return l.x === x && l.y === y; }).maxBy(function (item) { return item.location.z; });
|
|
74
|
+
return (0, Entity_1.entityMythology)(crushed.getItem().id.front);
|
|
75
|
+
},
|
|
76
|
+
enumerable: false,
|
|
77
|
+
configurable: true
|
|
78
|
+
});
|
|
45
79
|
return ImpunduluEffectRule;
|
|
46
80
|
}(PlaceCardEffectRule_1.InvokeEffectRule));
|
|
47
81
|
exports.ImpunduluEffectRule = ImpunduluEffectRule;
|
|
@@ -33,7 +33,8 @@ var MinotaurEffectRule = (function (_super) {
|
|
|
33
33
|
return _super.prototype.onRuleStart.call(this);
|
|
34
34
|
};
|
|
35
35
|
MinotaurEffectRule.prototype.getMovingCards = function (player) {
|
|
36
|
-
var
|
|
36
|
+
var _a;
|
|
37
|
+
var column = (_a = this.remind(Memory_1.Memory.TargetLine)) !== null && _a !== void 0 ? _a : this.card.location.x;
|
|
37
38
|
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); });
|
|
38
39
|
};
|
|
39
40
|
MinotaurEffectRule.prototype.isLegalDestination = function (space, cardLocation) {
|
|
@@ -33,7 +33,7 @@ var ViracochaEffectRule = (function (_super) {
|
|
|
33
33
|
};
|
|
34
34
|
ViracochaEffectRule.prototype.onSacrifice = function () {
|
|
35
35
|
var pantheon = new Pantheon_1.Pantheon(this.game, this.player);
|
|
36
|
-
return [pantheon.
|
|
36
|
+
return [pantheon.gainFavor(2), this.customMove(CustomMoveType_1.CustomMoveType.EndEffect)];
|
|
37
37
|
};
|
|
38
38
|
return ViracochaEffectRule;
|
|
39
39
|
}(SacrificeEffectRule_1.SacrificeEffectRule));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/mythologies",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
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": "bbba515638381571625dafa8ebcfd509082d316a"
|
|
33
33
|
}
|