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