@gamepark/zenith 0.0.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.
Files changed (125) hide show
  1. package/dist/PlayerId.d.ts +1 -0
  2. package/dist/PlayerId.js +2 -0
  3. package/dist/TeamColor.d.ts +9 -0
  4. package/dist/TeamColor.js +16 -0
  5. package/dist/ZenithOptions.d.ts +5 -0
  6. package/dist/ZenithOptions.js +4 -0
  7. package/dist/ZenithRules.d.ts +68 -0
  8. package/dist/ZenithRules.js +128 -0
  9. package/dist/ZenithSetup.d.ts +24 -0
  10. package/dist/ZenithSetup.js +316 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +9 -0
  13. package/dist/material/Agent.d.ts +93 -0
  14. package/dist/material/Agent.js +98 -0
  15. package/dist/material/Agents.d.ts +102 -0
  16. package/dist/material/Agents.js +2305 -0
  17. package/dist/material/Bonus.d.ts +12 -0
  18. package/dist/material/Bonus.js +34 -0
  19. package/dist/material/Bonuses.d.ts +14 -0
  20. package/dist/material/Bonuses.js +63 -0
  21. package/dist/material/Credit.d.ts +6 -0
  22. package/dist/material/Credit.js +11 -0
  23. package/dist/material/Faction.d.ts +6 -0
  24. package/dist/material/Faction.js +11 -0
  25. package/dist/material/Influence.d.ts +8 -0
  26. package/dist/material/Influence.js +13 -0
  27. package/dist/material/LocationType.d.ts +23 -0
  28. package/dist/material/LocationType.js +27 -0
  29. package/dist/material/MaterialType.d.ts +12 -0
  30. package/dist/material/MaterialType.js +16 -0
  31. package/dist/material/effect/Effect.d.ts +144 -0
  32. package/dist/material/effect/Effect.js +14 -0
  33. package/dist/material/effect/EffectType.d.ts +23 -0
  34. package/dist/material/effect/EffectType.js +27 -0
  35. package/dist/rules/CustomMoveType.d.ts +8 -0
  36. package/dist/rules/CustomMoveType.js +12 -0
  37. package/dist/rules/DiscardActionRule.d.ts +8 -0
  38. package/dist/rules/DiscardActionRule.js +84 -0
  39. package/dist/rules/Memory.d.ts +25 -0
  40. package/dist/rules/Memory.js +19 -0
  41. package/dist/rules/MulliganRule.d.ts +12 -0
  42. package/dist/rules/MulliganRule.js +138 -0
  43. package/dist/rules/PlayCardRule.d.ts +15 -0
  44. package/dist/rules/PlayCardRule.js +147 -0
  45. package/dist/rules/RefillRule.d.ts +17 -0
  46. package/dist/rules/RefillRule.js +211 -0
  47. package/dist/rules/RuleId.d.ts +27 -0
  48. package/dist/rules/RuleId.js +31 -0
  49. package/dist/rules/discard-action/DiplomacyActions.d.ts +3 -0
  50. package/dist/rules/discard-action/DiplomacyActions.js +39 -0
  51. package/dist/rules/discard-action/DiplomacyBoardRule.d.ts +9 -0
  52. package/dist/rules/discard-action/DiplomacyBoardRule.js +68 -0
  53. package/dist/rules/discard-action/TechnologyActions.d.ts +3 -0
  54. package/dist/rules/discard-action/TechnologyActions.js +187 -0
  55. package/dist/rules/discard-action/TechnologyBoardRule.d.ts +8 -0
  56. package/dist/rules/discard-action/TechnologyBoardRule.js +109 -0
  57. package/dist/rules/effect/ChoiceRule.d.ts +12 -0
  58. package/dist/rules/effect/ChoiceRule.js +91 -0
  59. package/dist/rules/effect/ConditionalRule.d.ts +17 -0
  60. package/dist/rules/effect/ConditionalRule.js +197 -0
  61. package/dist/rules/effect/DevelopTechnologyRule.d.ts +11 -0
  62. package/dist/rules/effect/DevelopTechnologyRule.js +133 -0
  63. package/dist/rules/effect/DiscardRule.d.ts +18 -0
  64. package/dist/rules/effect/DiscardRule.js +107 -0
  65. package/dist/rules/effect/EffectRule.d.ts +27 -0
  66. package/dist/rules/effect/EffectRule.js +161 -0
  67. package/dist/rules/effect/ExileRule.d.ts +22 -0
  68. package/dist/rules/effect/ExileRule.js +182 -0
  69. package/dist/rules/effect/GiveCreditRule.d.ts +13 -0
  70. package/dist/rules/effect/GiveCreditRule.js +79 -0
  71. package/dist/rules/effect/GiveInfluenceRule.d.ts +10 -0
  72. package/dist/rules/effect/GiveInfluenceRule.js +119 -0
  73. package/dist/rules/effect/GiveLeaderBadgeRule.d.ts +9 -0
  74. package/dist/rules/effect/GiveLeaderBadgeRule.js +54 -0
  75. package/dist/rules/effect/GiveZenithiumRule.d.ts +9 -0
  76. package/dist/rules/effect/GiveZenithiumRule.js +85 -0
  77. package/dist/rules/effect/MobilizeRule.d.ts +18 -0
  78. package/dist/rules/effect/MobilizeRule.js +117 -0
  79. package/dist/rules/effect/ResetInfluenceRule.d.ts +9 -0
  80. package/dist/rules/effect/ResetInfluenceRule.js +63 -0
  81. package/dist/rules/effect/SpendCreditRule.d.ts +16 -0
  82. package/dist/rules/effect/SpendCreditRule.js +109 -0
  83. package/dist/rules/effect/SpendZenithiumRule.d.ts +17 -0
  84. package/dist/rules/effect/SpendZenithiumRule.js +116 -0
  85. package/dist/rules/effect/StealCreditRule.d.ts +7 -0
  86. package/dist/rules/effect/StealCreditRule.js +67 -0
  87. package/dist/rules/effect/TakeBonusRule.d.ts +11 -0
  88. package/dist/rules/effect/TakeBonusRule.js +98 -0
  89. package/dist/rules/effect/TakeLeaderBadgeRule.d.ts +9 -0
  90. package/dist/rules/effect/TakeLeaderBadgeRule.js +102 -0
  91. package/dist/rules/effect/TakeTechnologyBonusTokenRule.d.ts +11 -0
  92. package/dist/rules/effect/TakeTechnologyBonusTokenRule.js +122 -0
  93. package/dist/rules/effect/TransferRule.d.ts +19 -0
  94. package/dist/rules/effect/TransferRule.js +104 -0
  95. package/dist/rules/effect/WinCreditRule.d.ts +13 -0
  96. package/dist/rules/effect/WinCreditRule.js +142 -0
  97. package/dist/rules/effect/WinInfluenceRule.d.ts +23 -0
  98. package/dist/rules/effect/WinInfluenceRule.js +328 -0
  99. package/dist/rules/effect/WinZenithiumRule.d.ts +9 -0
  100. package/dist/rules/effect/WinZenithiumRule.js +92 -0
  101. package/dist/rules/effect/index.d.ts +19 -0
  102. package/dist/rules/effect/index.js +35 -0
  103. package/dist/rules/helper/BonusHelper.d.ts +15 -0
  104. package/dist/rules/helper/BonusHelper.js +86 -0
  105. package/dist/rules/helper/CreditHelper.d.ts +9 -0
  106. package/dist/rules/helper/CreditHelper.js +45 -0
  107. package/dist/rules/helper/EffectHelper.d.ts +16 -0
  108. package/dist/rules/helper/EffectHelper.js +133 -0
  109. package/dist/rules/helper/EffectRuleIds.d.ts +3 -0
  110. package/dist/rules/helper/EffectRuleIds.js +29 -0
  111. package/dist/rules/helper/EndGameHelper.d.ts +13 -0
  112. package/dist/rules/helper/EndGameHelper.js +70 -0
  113. package/dist/rules/helper/InfluenceHelper.d.ts +13 -0
  114. package/dist/rules/helper/InfluenceHelper.js +47 -0
  115. package/dist/rules/helper/MobilizeHelper.d.ts +10 -0
  116. package/dist/rules/helper/MobilizeHelper.js +56 -0
  117. package/dist/rules/helper/PlanetHelper.d.ts +19 -0
  118. package/dist/rules/helper/PlanetHelper.js +104 -0
  119. package/dist/rules/helper/PlayerHelper.d.ts +12 -0
  120. package/dist/rules/helper/PlayerHelper.js +61 -0
  121. package/dist/rules/helper/TechnologyHelper.d.ts +4 -0
  122. package/dist/rules/helper/TechnologyHelper.js +96 -0
  123. package/dist/rules/helper/ZenithiumHelper.d.ts +10 -0
  124. package/dist/rules/helper/ZenithiumHelper.js +59 -0
  125. package/package.json +33 -0
@@ -0,0 +1,68 @@
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;
41
+ }
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))
59
+ 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); })) {
62
+ return effectMoves;
63
+ }
64
+ return [this.startRule(RuleId_1.RuleId.Refill)];
65
+ };
66
+ return DiplomacyBoardRule;
67
+ }(rules_api_1.PlayerTurnRule));
68
+ exports.DiplomacyBoardRule = DiplomacyBoardRule;
@@ -0,0 +1,3 @@
1
+ import { Effect } from '../../material/effect/Effect';
2
+ export declare const getTechnologyAction: (id: string) => Effect[][];
3
+ export declare const TechnologyLineBonuses: Effect[];
@@ -0,0 +1,187 @@
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) {
8
+ switch (id) {
9
+ case 'S':
10
+ return TechnologySActions;
11
+ case 'U':
12
+ return TechnologyUActions;
13
+ case 'N':
14
+ default:
15
+ return TechnologyNActions;
16
+ }
17
+ };
18
+ exports.getTechnologyAction = getTechnologyAction;
19
+ var TechnologySActions = [
20
+ [
21
+ {
22
+ type: EffectType_1.EffectType.WinCredit,
23
+ quantity: 2
24
+ }
25
+ ],
26
+ [
27
+ {
28
+ type: EffectType_1.EffectType.WinInfluence,
29
+ pattern: [1, 1]
30
+ },
31
+ {
32
+ type: EffectType_1.EffectType.TakeTechnologyBonusToken,
33
+ faction: Faction_1.Faction.Animod,
34
+ x: 2
35
+ }
36
+ ],
37
+ [
38
+ {
39
+ type: EffectType_1.EffectType.Transfer,
40
+ quantity: 3
41
+ }
42
+ ],
43
+ [
44
+ {
45
+ type: EffectType_1.EffectType.Conditional,
46
+ mandatory: true,
47
+ condition: {
48
+ type: Effect_1.ConditionType.DoEffect,
49
+ effect: {
50
+ type: EffectType_1.EffectType.Mobilize
51
+ }
52
+ },
53
+ effect: {
54
+ type: EffectType_1.EffectType.WinInfluence,
55
+ quantity: 1
56
+ }
57
+ },
58
+ {
59
+ type: EffectType_1.EffectType.Conditional,
60
+ mandatory: true,
61
+ condition: {
62
+ type: Effect_1.ConditionType.DoEffect,
63
+ effect: {
64
+ type: EffectType_1.EffectType.Mobilize
65
+ }
66
+ },
67
+ effect: {
68
+ type: EffectType_1.EffectType.WinInfluence,
69
+ quantity: 1
70
+ }
71
+ },
72
+ {
73
+ type: EffectType_1.EffectType.Conditional,
74
+ mandatory: true,
75
+ condition: {
76
+ type: Effect_1.ConditionType.DoEffect,
77
+ effect: {
78
+ type: EffectType_1.EffectType.Mobilize
79
+ }
80
+ },
81
+ effect: {
82
+ type: EffectType_1.EffectType.WinInfluence,
83
+ quantity: 1
84
+ }
85
+ }
86
+ ],
87
+ [
88
+ {
89
+ type: EffectType_1.EffectType.WinInfluence,
90
+ quantity: 2
91
+ }
92
+ ]
93
+ ];
94
+ var TechnologyUActions = [
95
+ [
96
+ {
97
+ type: EffectType_1.EffectType.WinInfluence,
98
+ quantity: 1
99
+ }
100
+ ],
101
+ [
102
+ {
103
+ type: EffectType_1.EffectType.Mobilize,
104
+ quantity: 2
105
+ },
106
+ {
107
+ type: EffectType_1.EffectType.TakeTechnologyBonusToken,
108
+ faction: Faction_1.Faction.Human,
109
+ x: 2
110
+ }
111
+ ],
112
+ [
113
+ {
114
+ type: EffectType_1.EffectType.StealCredit,
115
+ quantity: 3
116
+ }
117
+ ],
118
+ [
119
+ {
120
+ type: EffectType_1.EffectType.WinInfluence,
121
+ pattern: [1, 1, 1]
122
+ }
123
+ ],
124
+ [
125
+ {
126
+ type: EffectType_1.EffectType.WinInfluence,
127
+ quantity: 2
128
+ }
129
+ ]
130
+ ];
131
+ var TechnologyNActions = [
132
+ [
133
+ {
134
+ type: EffectType_1.EffectType.Transfer,
135
+ quantity: 1
136
+ }
137
+ ],
138
+ [
139
+ {
140
+ type: EffectType_1.EffectType.TakeLeaderBadge
141
+ },
142
+ {
143
+ type: EffectType_1.EffectType.TakeTechnologyBonusToken,
144
+ faction: Faction_1.Faction.Robot,
145
+ x: 2
146
+ }
147
+ ],
148
+ [
149
+ {
150
+ type: EffectType_1.EffectType.WinInfluence,
151
+ resetDifferentPlanet: true,
152
+ quantity: 2
153
+ },
154
+ {
155
+ type: EffectType_1.EffectType.WinInfluence,
156
+ differentPlanet: true,
157
+ quantity: 1
158
+ }
159
+ ],
160
+ [
161
+ {
162
+ type: EffectType_1.EffectType.WinCredit,
163
+ quantity: 20
164
+ }
165
+ ],
166
+ [
167
+ {
168
+ type: EffectType_1.EffectType.WinInfluence,
169
+ resetDifferentPlanet: true,
170
+ quantity: 2
171
+ }
172
+ ]
173
+ ];
174
+ exports.TechnologyLineBonuses = [
175
+ {
176
+ type: EffectType_1.EffectType.WinInfluence,
177
+ quantity: 1
178
+ },
179
+ {
180
+ type: EffectType_1.EffectType.WinInfluence,
181
+ quantity: 2
182
+ },
183
+ {
184
+ type: EffectType_1.EffectType.WinInfluence,
185
+ quantity: 3
186
+ }
187
+ ];
@@ -0,0 +1,8 @@
1
+ import { ItemMove, MaterialMove, PlayerTurnRule } from '@gamepark/rules-api';
2
+ import { Faction } from '../../material/Faction';
3
+ export declare class TechnologyBoardRule extends PlayerTurnRule {
4
+ getPlayerMoves(): import("@gamepark/rules-api").MoveItem<number, number, number>[];
5
+ afterItemMove(move: ItemMove): MaterialMove[];
6
+ get marker(): import("@gamepark/rules-api").Material<number, number, number>;
7
+ get faction(): Faction;
8
+ }
@@ -0,0 +1,109 @@
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();
71
+ if (item.location.x >= 5)
72
+ return [];
73
+ var zenithiumCost = item.location.x + 1;
74
+ if (new PlayerHelper_1.PlayerHelper(this.game, this.player).zenithium < zenithiumCost)
75
+ 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))
80
+ 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));
86
+ return moves;
87
+ }
88
+ moves.push(this.startRule(RuleId_1.RuleId.Refill));
89
+ 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;
@@ -0,0 +1,12 @@
1
+ import { CustomMove } from '@gamepark/rules-api';
2
+ import { ChoiceEffect } from '../../material/effect/Effect';
3
+ import { EffectRule } from './index';
4
+ export declare enum Choice {
5
+ LEFT = 1,
6
+ RIGHT = 2
7
+ }
8
+ export declare class ChoiceRule extends EffectRule<ChoiceEffect> {
9
+ getPlayerMoves(): CustomMove[];
10
+ onCustomMove(move: CustomMove): import("@gamepark/rules-api").StartRule<import("../RuleId").RuleId>[];
11
+ choice(choice: Choice): void;
12
+ }
@@ -0,0 +1,91 @@
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;
61
+ (function (Choice) {
62
+ Choice[Choice["LEFT"] = 1] = "LEFT";
63
+ 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;
69
+ }
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))
75
+ return [];
76
+ this.choice(move.data);
77
+ 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;
83
+ if (choice === Choice.LEFT) {
84
+ return __spreadArray([__assign(__assign({}, left), { effectSource: firstEffect.effectSource })], __read(effects.slice(1)), false);
85
+ }
86
+ return __spreadArray([__assign(__assign({}, right), { effectSource: firstEffect.effectSource })], __read(effects.slice(1)), false);
87
+ });
88
+ };
89
+ return ChoiceRule;
90
+ }(index_1.EffectRule));
91
+ exports.ChoiceRule = ChoiceRule;
@@ -0,0 +1,17 @@
1
+ import { CustomMove, ItemMove, MaterialMove } from '@gamepark/rules-api';
2
+ import { Condition, ConditionalEffect, DoEffectCondition, HaveCreditsCondition, LeaderCondition } from '../../material/effect/Effect';
3
+ import { EffectRule } from './index';
4
+ export declare class ConditionalRule extends EffectRule<ConditionalEffect> {
5
+ onRuleStart(): MaterialMove[];
6
+ getPlayerMoves(): MaterialMove[];
7
+ onCustomMove(move: CustomMove): MaterialMove[];
8
+ afterItemMove(move: ItemMove): MaterialMove[];
9
+ onEffectPlayed(move: ItemMove | CustomMove): boolean | undefined;
10
+ get isAutomaticEffect(): boolean;
11
+ isDoCondition(condition: Condition): condition is DoEffectCondition;
12
+ isLeaderCondition(condition: Condition): condition is LeaderCondition;
13
+ isHaveCreditCondition(condition: Condition): condition is HaveCreditsCondition;
14
+ isPossible(): boolean;
15
+ addEffectAndRemoveCondition(extraData?: Record<string, unknown>): void;
16
+ onRuleEnd(): never[];
17
+ }