@gamepark/zenith 0.0.2 → 0.1.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/PlayerId.js +1 -2
- package/dist/TeamColor.js +7 -13
- package/dist/ZenithOptions.js +1 -4
- package/dist/ZenithRules.js +71 -122
- package/dist/ZenithSetup.js +123 -266
- package/dist/index.js +3 -9
- package/dist/material/Agent.js +4 -7
- package/dist/material/Agents.js +920 -923
- package/dist/material/Bonus.js +5 -8
- package/dist/material/Bonuses.js +29 -33
- package/dist/material/Credit.js +4 -7
- package/dist/material/Faction.js +4 -7
- package/dist/material/Influence.js +4 -7
- package/dist/material/LocationType.js +2 -5
- package/dist/material/MaterialType.js +2 -5
- package/dist/material/effect/Effect.js +5 -10
- package/dist/material/effect/EffectType.js +2 -5
- package/dist/rules/CustomMoveType.js +2 -5
- package/dist/rules/DiscardActionRule.js +26 -75
- package/dist/rules/Memory.js +2 -5
- package/dist/rules/MulliganRule.js +47 -126
- package/dist/rules/PlayCardRule.js +68 -134
- package/dist/rules/RefillRule.js +83 -190
- package/dist/rules/RuleId.js +2 -5
- package/dist/rules/discard-action/DiplomacyActions.js +15 -20
- package/dist/rules/discard-action/DiplomacyBoardRule.js +27 -64
- package/dist/rules/discard-action/TechnologyActions.js +44 -48
- package/dist/rules/discard-action/TechnologyBoardRule.js +34 -102
- package/dist/rules/effect/ChoiceRule.js +21 -81
- package/dist/rules/effect/ConditionalRule.js +77 -141
- package/dist/rules/effect/DevelopTechnologyRule.js +53 -119
- package/dist/rules/effect/DiscardRule.js +37 -90
- package/dist/rules/effect/EffectRule.js +60 -138
- package/dist/rules/effect/ExileRule.js +62 -147
- package/dist/rules/effect/GiveCreditRule.js +24 -73
- package/dist/rules/effect/GiveInfluenceRule.js +38 -101
- package/dist/rules/effect/GiveLeaderBadgeRule.js +18 -46
- package/dist/rules/effect/GiveZenithiumRule.js +25 -79
- package/dist/rules/effect/MobilizeRule.js +38 -93
- package/dist/rules/effect/ResetInfluenceRule.js +21 -58
- package/dist/rules/effect/SpendCreditRule.js +29 -102
- package/dist/rules/effect/SpendZenithiumRule.js +32 -109
- package/dist/rules/effect/StealCreditRule.js +15 -64
- package/dist/rules/effect/TakeBonusRule.js +30 -91
- package/dist/rules/effect/TakeLeaderBadgeRule.js +31 -88
- package/dist/rules/effect/TakeTechnologyBonusTokenRule.js +45 -112
- package/dist/rules/effect/TransferRule.js +47 -81
- package/dist/rules/effect/WinCreditRule.js +60 -130
- package/dist/rules/effect/WinInfluenceRule.js +128 -248
- package/dist/rules/effect/WinZenithiumRule.js +24 -80
- package/dist/rules/effect/index.js +19 -35
- package/dist/rules/helper/BonusHelper.js +32 -64
- package/dist/rules/helper/CreditHelper.js +19 -44
- package/dist/rules/helper/EffectHelper.js +81 -123
- package/dist/rules/helper/EffectRuleIds.js +25 -29
- package/dist/rules/helper/EndGameHelper.js +24 -57
- package/dist/rules/helper/InfluenceHelper.js +18 -44
- package/dist/rules/helper/MobilizeHelper.js +27 -53
- package/dist/rules/helper/PlanetHelper.js +45 -78
- package/dist/rules/helper/PlayerHelper.js +24 -60
- package/dist/rules/helper/TechnologyHelper.js +31 -87
- package/dist/rules/helper/ZenithiumHelper.js +25 -48
- package/package.json +4 -3
|
@@ -1,68 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.DiplomacyBoardRule = void 0;
|
|
30
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
31
|
-
var MaterialType_1 = require("../../material/MaterialType");
|
|
32
|
-
var CustomMoveType_1 = require("../CustomMoveType");
|
|
33
|
-
var EffectHelper_1 = require("../helper/EffectHelper");
|
|
34
|
-
var Memory_1 = require("../Memory");
|
|
35
|
-
var RuleId_1 = require("../RuleId");
|
|
36
|
-
var DiplomacyActions_1 = require("./DiplomacyActions");
|
|
37
|
-
var DiplomacyBoardRule = (function (_super) {
|
|
38
|
-
__extends(DiplomacyBoardRule, _super);
|
|
39
|
-
function DiplomacyBoardRule() {
|
|
40
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1
|
+
import { isCustomMoveType, isStartPlayerTurn, isStartRule, PlayerTurnRule } from '@gamepark/rules-api';
|
|
2
|
+
import { MaterialType } from '../../material/MaterialType';
|
|
3
|
+
import { CustomMoveType } from '../CustomMoveType';
|
|
4
|
+
import { EffectHelper } from '../helper/EffectHelper';
|
|
5
|
+
import { Memory } from '../Memory';
|
|
6
|
+
import { RuleId } from '../RuleId';
|
|
7
|
+
import { getDiplomacyActions } from './DiplomacyActions';
|
|
8
|
+
export class DiplomacyBoardRule extends PlayerTurnRule {
|
|
9
|
+
getPlayerMoves() {
|
|
10
|
+
return [this.customMove(CustomMoveType.Diplomacy)];
|
|
11
|
+
}
|
|
12
|
+
get faction() {
|
|
13
|
+
return this.remind(Memory.DiscardFaction);
|
|
41
14
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
DiplomacyBoardRule.prototype.applyDiplomacy = function () {
|
|
53
|
-
var _this = this;
|
|
54
|
-
this.memorize(Memory_1.Memory.Effects, JSON.parse(JSON.stringify((0, DiplomacyActions_1.getDiplomacyActions)(this.game.players.length)[this.faction].map(function (effect) { return (__assign(__assign({}, effect), { effectSource: { type: MaterialType_1.MaterialType.DiplomacyBoard, key: _this.faction } })); }))));
|
|
55
|
-
return new EffectHelper_1.EffectHelper(this.game, this.player).applyFirstEffect();
|
|
56
|
-
};
|
|
57
|
-
DiplomacyBoardRule.prototype.onCustomMove = function (move) {
|
|
58
|
-
if (!(0, rules_api_1.isCustomMoveType)(CustomMoveType_1.CustomMoveType.Diplomacy)(move))
|
|
15
|
+
applyDiplomacy() {
|
|
16
|
+
this.memorize(Memory.Effects, JSON.parse(JSON.stringify(getDiplomacyActions(this.game.players.length)[this.faction].map((effect) => ({
|
|
17
|
+
...effect,
|
|
18
|
+
effectSource: { type: MaterialType.DiplomacyBoard, key: this.faction }
|
|
19
|
+
})))));
|
|
20
|
+
return new EffectHelper(this.game, this.player).applyFirstEffect();
|
|
21
|
+
}
|
|
22
|
+
onCustomMove(move) {
|
|
23
|
+
if (!isCustomMoveType(CustomMoveType.Diplomacy)(move))
|
|
59
24
|
return [];
|
|
60
|
-
|
|
61
|
-
if (effectMoves.some(
|
|
25
|
+
const effectMoves = this.applyDiplomacy();
|
|
26
|
+
if (effectMoves.some((move) => isStartRule(move) || isStartPlayerTurn(move))) {
|
|
62
27
|
return effectMoves;
|
|
63
28
|
}
|
|
64
|
-
return [this.startRule(
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}(rules_api_1.PlayerTurnRule));
|
|
68
|
-
exports.DiplomacyBoardRule = DiplomacyBoardRule;
|
|
29
|
+
return [this.startRule(RuleId.Refill)];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var EffectType_1 = require("../../material/effect/EffectType");
|
|
6
|
-
var Faction_1 = require("../../material/Faction");
|
|
7
|
-
var getTechnologyAction = function (id) {
|
|
1
|
+
import { ConditionType } from '../../material/effect/Effect';
|
|
2
|
+
import { EffectType } from '../../material/effect/EffectType';
|
|
3
|
+
import { Faction } from '../../material/Faction';
|
|
4
|
+
export const getTechnologyAction = (id) => {
|
|
8
5
|
switch (id) {
|
|
9
6
|
case 'S':
|
|
10
7
|
return TechnologySActions;
|
|
@@ -15,173 +12,172 @@ var getTechnologyAction = function (id) {
|
|
|
15
12
|
return TechnologyNActions;
|
|
16
13
|
}
|
|
17
14
|
};
|
|
18
|
-
|
|
19
|
-
var TechnologySActions = [
|
|
15
|
+
const TechnologySActions = [
|
|
20
16
|
[
|
|
21
17
|
{
|
|
22
|
-
type:
|
|
18
|
+
type: EffectType.WinCredit,
|
|
23
19
|
quantity: 2
|
|
24
20
|
}
|
|
25
21
|
],
|
|
26
22
|
[
|
|
27
23
|
{
|
|
28
|
-
type:
|
|
24
|
+
type: EffectType.WinInfluence,
|
|
29
25
|
pattern: [1, 1]
|
|
30
26
|
},
|
|
31
27
|
{
|
|
32
|
-
type:
|
|
33
|
-
faction:
|
|
28
|
+
type: EffectType.TakeTechnologyBonusToken,
|
|
29
|
+
faction: Faction.Animod,
|
|
34
30
|
x: 2
|
|
35
31
|
}
|
|
36
32
|
],
|
|
37
33
|
[
|
|
38
34
|
{
|
|
39
|
-
type:
|
|
35
|
+
type: EffectType.Transfer,
|
|
40
36
|
quantity: 3
|
|
41
37
|
}
|
|
42
38
|
],
|
|
43
39
|
[
|
|
44
40
|
{
|
|
45
|
-
type:
|
|
41
|
+
type: EffectType.Conditional,
|
|
46
42
|
mandatory: true,
|
|
47
43
|
condition: {
|
|
48
|
-
type:
|
|
44
|
+
type: ConditionType.DoEffect,
|
|
49
45
|
effect: {
|
|
50
|
-
type:
|
|
46
|
+
type: EffectType.Mobilize
|
|
51
47
|
}
|
|
52
48
|
},
|
|
53
49
|
effect: {
|
|
54
|
-
type:
|
|
50
|
+
type: EffectType.WinInfluence,
|
|
55
51
|
quantity: 1
|
|
56
52
|
}
|
|
57
53
|
},
|
|
58
54
|
{
|
|
59
|
-
type:
|
|
55
|
+
type: EffectType.Conditional,
|
|
60
56
|
mandatory: true,
|
|
61
57
|
condition: {
|
|
62
|
-
type:
|
|
58
|
+
type: ConditionType.DoEffect,
|
|
63
59
|
effect: {
|
|
64
|
-
type:
|
|
60
|
+
type: EffectType.Mobilize
|
|
65
61
|
}
|
|
66
62
|
},
|
|
67
63
|
effect: {
|
|
68
|
-
type:
|
|
64
|
+
type: EffectType.WinInfluence,
|
|
69
65
|
quantity: 1
|
|
70
66
|
}
|
|
71
67
|
},
|
|
72
68
|
{
|
|
73
|
-
type:
|
|
69
|
+
type: EffectType.Conditional,
|
|
74
70
|
mandatory: true,
|
|
75
71
|
condition: {
|
|
76
|
-
type:
|
|
72
|
+
type: ConditionType.DoEffect,
|
|
77
73
|
effect: {
|
|
78
|
-
type:
|
|
74
|
+
type: EffectType.Mobilize
|
|
79
75
|
}
|
|
80
76
|
},
|
|
81
77
|
effect: {
|
|
82
|
-
type:
|
|
78
|
+
type: EffectType.WinInfluence,
|
|
83
79
|
quantity: 1
|
|
84
80
|
}
|
|
85
81
|
}
|
|
86
82
|
],
|
|
87
83
|
[
|
|
88
84
|
{
|
|
89
|
-
type:
|
|
85
|
+
type: EffectType.WinInfluence,
|
|
90
86
|
quantity: 2
|
|
91
87
|
}
|
|
92
88
|
]
|
|
93
89
|
];
|
|
94
|
-
|
|
90
|
+
const TechnologyUActions = [
|
|
95
91
|
[
|
|
96
92
|
{
|
|
97
|
-
type:
|
|
93
|
+
type: EffectType.WinInfluence,
|
|
98
94
|
quantity: 1
|
|
99
95
|
}
|
|
100
96
|
],
|
|
101
97
|
[
|
|
102
98
|
{
|
|
103
|
-
type:
|
|
99
|
+
type: EffectType.Mobilize,
|
|
104
100
|
quantity: 2
|
|
105
101
|
},
|
|
106
102
|
{
|
|
107
|
-
type:
|
|
108
|
-
faction:
|
|
103
|
+
type: EffectType.TakeTechnologyBonusToken,
|
|
104
|
+
faction: Faction.Human,
|
|
109
105
|
x: 2
|
|
110
106
|
}
|
|
111
107
|
],
|
|
112
108
|
[
|
|
113
109
|
{
|
|
114
|
-
type:
|
|
110
|
+
type: EffectType.StealCredit,
|
|
115
111
|
quantity: 3
|
|
116
112
|
}
|
|
117
113
|
],
|
|
118
114
|
[
|
|
119
115
|
{
|
|
120
|
-
type:
|
|
116
|
+
type: EffectType.WinInfluence,
|
|
121
117
|
pattern: [1, 1, 1]
|
|
122
118
|
}
|
|
123
119
|
],
|
|
124
120
|
[
|
|
125
121
|
{
|
|
126
|
-
type:
|
|
122
|
+
type: EffectType.WinInfluence,
|
|
127
123
|
quantity: 2
|
|
128
124
|
}
|
|
129
125
|
]
|
|
130
126
|
];
|
|
131
|
-
|
|
127
|
+
const TechnologyNActions = [
|
|
132
128
|
[
|
|
133
129
|
{
|
|
134
|
-
type:
|
|
130
|
+
type: EffectType.Transfer,
|
|
135
131
|
quantity: 1
|
|
136
132
|
}
|
|
137
133
|
],
|
|
138
134
|
[
|
|
139
135
|
{
|
|
140
|
-
type:
|
|
136
|
+
type: EffectType.TakeLeaderBadge
|
|
141
137
|
},
|
|
142
138
|
{
|
|
143
|
-
type:
|
|
144
|
-
faction:
|
|
139
|
+
type: EffectType.TakeTechnologyBonusToken,
|
|
140
|
+
faction: Faction.Robot,
|
|
145
141
|
x: 2
|
|
146
142
|
}
|
|
147
143
|
],
|
|
148
144
|
[
|
|
149
145
|
{
|
|
150
|
-
type:
|
|
146
|
+
type: EffectType.WinInfluence,
|
|
151
147
|
resetDifferentPlanet: true,
|
|
152
148
|
quantity: 2
|
|
153
149
|
},
|
|
154
150
|
{
|
|
155
|
-
type:
|
|
151
|
+
type: EffectType.WinInfluence,
|
|
156
152
|
differentPlanet: true,
|
|
157
153
|
quantity: 1
|
|
158
154
|
}
|
|
159
155
|
],
|
|
160
156
|
[
|
|
161
157
|
{
|
|
162
|
-
type:
|
|
158
|
+
type: EffectType.WinCredit,
|
|
163
159
|
quantity: 20
|
|
164
160
|
}
|
|
165
161
|
],
|
|
166
162
|
[
|
|
167
163
|
{
|
|
168
|
-
type:
|
|
164
|
+
type: EffectType.WinInfluence,
|
|
169
165
|
resetDifferentPlanet: true,
|
|
170
166
|
quantity: 2
|
|
171
167
|
}
|
|
172
168
|
]
|
|
173
169
|
];
|
|
174
|
-
|
|
170
|
+
export const TechnologyLineBonuses = [
|
|
175
171
|
{
|
|
176
|
-
type:
|
|
172
|
+
type: EffectType.WinInfluence,
|
|
177
173
|
quantity: 1
|
|
178
174
|
},
|
|
179
175
|
{
|
|
180
|
-
type:
|
|
176
|
+
type: EffectType.WinInfluence,
|
|
181
177
|
quantity: 2
|
|
182
178
|
},
|
|
183
179
|
{
|
|
184
|
-
type:
|
|
180
|
+
type: EffectType.WinInfluence,
|
|
185
181
|
quantity: 3
|
|
186
182
|
}
|
|
187
183
|
];
|
|
@@ -1,109 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
29
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
-
if (!m) return o;
|
|
31
|
-
var i = m.call(o), r, ar = [], e;
|
|
32
|
-
try {
|
|
33
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
-
}
|
|
35
|
-
catch (error) { e = { error: error }; }
|
|
36
|
-
finally {
|
|
37
|
-
try {
|
|
38
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
-
}
|
|
40
|
-
finally { if (e) throw e.error; }
|
|
41
|
-
}
|
|
42
|
-
return ar;
|
|
43
|
-
};
|
|
44
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
45
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
46
|
-
if (ar || !(i in from)) {
|
|
47
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
48
|
-
ar[i] = from[i];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.TechnologyBoardRule = void 0;
|
|
55
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
56
|
-
var LocationType_1 = require("../../material/LocationType");
|
|
57
|
-
var MaterialType_1 = require("../../material/MaterialType");
|
|
58
|
-
var EffectHelper_1 = require("../helper/EffectHelper");
|
|
59
|
-
var PlayerHelper_1 = require("../helper/PlayerHelper");
|
|
60
|
-
var TechnologyHelper_1 = require("../helper/TechnologyHelper");
|
|
61
|
-
var Memory_1 = require("../Memory");
|
|
62
|
-
var RuleId_1 = require("../RuleId");
|
|
63
|
-
var TechnologyBoardRule = (function (_super) {
|
|
64
|
-
__extends(TechnologyBoardRule, _super);
|
|
65
|
-
function TechnologyBoardRule() {
|
|
66
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
67
|
-
}
|
|
68
|
-
TechnologyBoardRule.prototype.getPlayerMoves = function () {
|
|
69
|
-
var marker = this.marker;
|
|
70
|
-
var item = marker.getItem();
|
|
1
|
+
import { isMoveItemType, isStartPlayerTurn, isStartRule, PlayerTurnRule } from '@gamepark/rules-api';
|
|
2
|
+
import { LocationType } from '../../material/LocationType';
|
|
3
|
+
import { MaterialType } from '../../material/MaterialType';
|
|
4
|
+
import { EffectHelper } from '../helper/EffectHelper';
|
|
5
|
+
import { PlayerHelper } from '../helper/PlayerHelper';
|
|
6
|
+
import { TechnologyHelper } from '../helper/TechnologyHelper';
|
|
7
|
+
import { Memory } from '../Memory';
|
|
8
|
+
import { RuleId } from '../RuleId';
|
|
9
|
+
export class TechnologyBoardRule extends PlayerTurnRule {
|
|
10
|
+
getPlayerMoves() {
|
|
11
|
+
const marker = this.marker;
|
|
12
|
+
const item = marker.getItem();
|
|
71
13
|
if (item.location.x >= 5)
|
|
72
14
|
return [];
|
|
73
|
-
|
|
74
|
-
if (new
|
|
15
|
+
const zenithiumCost = item.location.x + 1;
|
|
16
|
+
if (new PlayerHelper(this.game, this.player).zenithium < zenithiumCost)
|
|
75
17
|
return [];
|
|
76
|
-
return this.marker.moveItems(
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (!
|
|
18
|
+
return this.marker.moveItems((item) => ({ ...item.location, x: item.location.x + 1 }));
|
|
19
|
+
}
|
|
20
|
+
afterItemMove(move) {
|
|
21
|
+
if (!isMoveItemType(MaterialType.TechMarker)(move))
|
|
80
22
|
return [];
|
|
81
|
-
|
|
82
|
-
moves.push(new
|
|
83
|
-
|
|
84
|
-
if (effectMoves.some(
|
|
85
|
-
moves.push
|
|
23
|
+
const moves = new TechnologyHelper(this.game).applyTechnology(move);
|
|
24
|
+
moves.push(new PlayerHelper(this.game, this.player).zenithiumMaterial.deleteItem(move.location.x));
|
|
25
|
+
const effectMoves = new EffectHelper(this.game, this.player).applyFirstEffect();
|
|
26
|
+
if (effectMoves.some((move) => isStartRule(move) || isStartPlayerTurn(move))) {
|
|
27
|
+
moves.push(...effectMoves);
|
|
86
28
|
return moves;
|
|
87
29
|
}
|
|
88
|
-
moves.push(this.startRule(
|
|
30
|
+
moves.push(this.startRule(RuleId.Refill));
|
|
89
31
|
return moves;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Object.defineProperty(TechnologyBoardRule.prototype, "faction", {
|
|
101
|
-
get: function () {
|
|
102
|
-
return this.remind(Memory_1.Memory.DiscardFaction);
|
|
103
|
-
},
|
|
104
|
-
enumerable: false,
|
|
105
|
-
configurable: true
|
|
106
|
-
});
|
|
107
|
-
return TechnologyBoardRule;
|
|
108
|
-
}(rules_api_1.PlayerTurnRule));
|
|
109
|
-
exports.TechnologyBoardRule = TechnologyBoardRule;
|
|
32
|
+
}
|
|
33
|
+
get marker() {
|
|
34
|
+
const playerHelper = new PlayerHelper(this.game, this.player);
|
|
35
|
+
const board = this.material(MaterialType.TechnologyBoard).location(LocationType.TechnologyBoardPlace).locationId(this.faction);
|
|
36
|
+
return this.material(MaterialType.TechMarker).location(LocationType.TechnologyBoardTokenSpace).player(playerHelper.team).parent(board.getIndex());
|
|
37
|
+
}
|
|
38
|
+
get faction() {
|
|
39
|
+
return this.remind(Memory.DiscardFaction);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,91 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
29
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
-
if (!m) return o;
|
|
31
|
-
var i = m.call(o), r, ar = [], e;
|
|
32
|
-
try {
|
|
33
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
-
}
|
|
35
|
-
catch (error) { e = { error: error }; }
|
|
36
|
-
finally {
|
|
37
|
-
try {
|
|
38
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
-
}
|
|
40
|
-
finally { if (e) throw e.error; }
|
|
41
|
-
}
|
|
42
|
-
return ar;
|
|
43
|
-
};
|
|
44
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
45
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
46
|
-
if (ar || !(i in from)) {
|
|
47
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
48
|
-
ar[i] = from[i];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.ChoiceRule = exports.Choice = void 0;
|
|
55
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
56
|
-
var MaterialType_1 = require("../../material/MaterialType");
|
|
57
|
-
var CustomMoveType_1 = require("../CustomMoveType");
|
|
58
|
-
var Memory_1 = require("../Memory");
|
|
59
|
-
var index_1 = require("./index");
|
|
60
|
-
var Choice;
|
|
1
|
+
import { isCustomMoveType } from '@gamepark/rules-api';
|
|
2
|
+
import { MaterialType } from '../../material/MaterialType';
|
|
3
|
+
import { CustomMoveType } from '../CustomMoveType';
|
|
4
|
+
import { Memory } from '../Memory';
|
|
5
|
+
import { EffectRule } from './index';
|
|
6
|
+
export var Choice;
|
|
61
7
|
(function (Choice) {
|
|
62
8
|
Choice[Choice["LEFT"] = 1] = "LEFT";
|
|
63
9
|
Choice[Choice["RIGHT"] = 2] = "RIGHT";
|
|
64
|
-
})(Choice || (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
10
|
+
})(Choice || (Choice = {}));
|
|
11
|
+
export class ChoiceRule extends EffectRule {
|
|
12
|
+
getPlayerMoves() {
|
|
13
|
+
return [this.customMove(CustomMoveType.Choice, Choice.LEFT), this.customMove(CustomMoveType.Choice, Choice.RIGHT)];
|
|
69
14
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
ChoiceRule.prototype.onCustomMove = function (move) {
|
|
74
|
-
if (!(0, rules_api_1.isCustomMoveType)(MaterialType_1.MaterialType.InfluenceDisc)(move))
|
|
15
|
+
onCustomMove(move) {
|
|
16
|
+
if (!isCustomMoveType(MaterialType.InfluenceDisc)(move))
|
|
75
17
|
return [];
|
|
76
18
|
this.choice(move.data);
|
|
77
19
|
return this.applyFirstEffect();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
this.memorize(
|
|
81
|
-
|
|
82
|
-
|
|
20
|
+
}
|
|
21
|
+
choice(choice) {
|
|
22
|
+
this.memorize(Memory.Effects, (effects) => {
|
|
23
|
+
const firstEffect = effects[0];
|
|
24
|
+
const { left, right } = firstEffect;
|
|
83
25
|
if (choice === Choice.LEFT) {
|
|
84
|
-
return
|
|
26
|
+
return [{ ...left, effectSource: firstEffect.effectSource }, ...effects.slice(1)];
|
|
85
27
|
}
|
|
86
|
-
return
|
|
28
|
+
return [{ ...right, effectSource: firstEffect.effectSource }, ...effects.slice(1)];
|
|
87
29
|
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}(index_1.EffectRule));
|
|
91
|
-
exports.ChoiceRule = ChoiceRule;
|
|
30
|
+
}
|
|
31
|
+
}
|