@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,122 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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.TakeTechnologyBonusTokenRule = void 0;
|
|
55
|
-
var LocationType_1 = require("../../material/LocationType");
|
|
56
|
-
var MaterialType_1 = require("../../material/MaterialType");
|
|
57
|
-
var BonusHelper_1 = require("../helper/BonusHelper");
|
|
58
|
-
var Memory_1 = require("../Memory");
|
|
59
|
-
var EffectRule_1 = require("./EffectRule");
|
|
60
|
-
var TakeTechnologyBonusTokenRule = (function (_super) {
|
|
61
|
-
__extends(TakeTechnologyBonusTokenRule, _super);
|
|
62
|
-
function TakeTechnologyBonusTokenRule() {
|
|
63
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
-
}
|
|
65
|
-
TakeTechnologyBonusTokenRule.prototype.onRuleStart = function () {
|
|
66
|
-
var _this = this;
|
|
67
|
-
var moves = _super.prototype.onRuleStart.call(this);
|
|
1
|
+
import { LocationType } from '../../material/LocationType';
|
|
2
|
+
import { MaterialType } from '../../material/MaterialType';
|
|
3
|
+
import { BonusHelper } from '../helper/BonusHelper';
|
|
4
|
+
import { Memory } from '../Memory';
|
|
5
|
+
import { EffectRule } from './EffectRule';
|
|
6
|
+
export class TakeTechnologyBonusTokenRule extends EffectRule {
|
|
7
|
+
onRuleStart() {
|
|
8
|
+
const moves = super.onRuleStart();
|
|
68
9
|
if (moves.length > 0)
|
|
69
10
|
return moves;
|
|
70
|
-
|
|
71
|
-
this.memorize(
|
|
11
|
+
const bonusEffect = this.bonusEffect;
|
|
12
|
+
this.memorize(Memory.CurrentEffect, JSON.parse(JSON.stringify(this.effect)));
|
|
72
13
|
this.removeFirstEffect();
|
|
73
14
|
if (bonusEffect) {
|
|
74
|
-
this.memorize(
|
|
75
|
-
this.memorize(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
15
|
+
this.memorize(Memory.WonBonus, bonusEffect.bonusId);
|
|
16
|
+
this.memorize(Memory.Effects, (effects = []) => {
|
|
17
|
+
effects.unshift({
|
|
18
|
+
...bonusEffect.effect,
|
|
19
|
+
effectSource: {
|
|
20
|
+
type: MaterialType.TechnologyBoard,
|
|
21
|
+
value: this.board.getItem().location.id
|
|
22
|
+
}
|
|
23
|
+
});
|
|
81
24
|
return effects;
|
|
82
25
|
});
|
|
83
|
-
moves.push
|
|
26
|
+
moves.push(...bonusEffect.moves);
|
|
84
27
|
}
|
|
85
|
-
moves.push
|
|
28
|
+
moves.push(...this.afterEffectPlayed());
|
|
86
29
|
return moves;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
get: function () {
|
|
106
|
-
var effect = this.effect;
|
|
107
|
-
return this.material(MaterialType_1.MaterialType.TechnologyBoard).locationId(effect.faction);
|
|
108
|
-
},
|
|
109
|
-
enumerable: false,
|
|
110
|
-
configurable: true
|
|
111
|
-
});
|
|
112
|
-
TakeTechnologyBonusTokenRule.prototype.isPossible = function () {
|
|
30
|
+
}
|
|
31
|
+
get bonusEffect() {
|
|
32
|
+
const effect = this.effect;
|
|
33
|
+
const board = this.board;
|
|
34
|
+
const token = this.material(MaterialType.TechMarker)
|
|
35
|
+
.location(LocationType.TechnologyBoardTokenSpace)
|
|
36
|
+
.parent(board.getIndex())
|
|
37
|
+
.player(this.playerHelper.team);
|
|
38
|
+
const item = token.getItem();
|
|
39
|
+
if (item.location.x !== effect.x)
|
|
40
|
+
return undefined;
|
|
41
|
+
return new BonusHelper(this.game).getTechnologyBonus(token);
|
|
42
|
+
}
|
|
43
|
+
get board() {
|
|
44
|
+
const effect = this.effect;
|
|
45
|
+
return this.material(MaterialType.TechnologyBoard).locationId(effect.faction);
|
|
46
|
+
}
|
|
47
|
+
isPossible() {
|
|
113
48
|
return this.bonusEffect !== undefined;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
this.forget(
|
|
117
|
-
this.forget(
|
|
49
|
+
}
|
|
50
|
+
onRuleEnd() {
|
|
51
|
+
this.forget(Memory.WonBonus);
|
|
52
|
+
this.forget(Memory.CurrentEffect);
|
|
118
53
|
return [];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
}(EffectRule_1.EffectRule));
|
|
122
|
-
exports.TakeTechnologyBonusTokenRule = TakeTechnologyBonusTokenRule;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,55 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.TransferRule = void 0;
|
|
19
|
-
var rules_api_1 = require("@gamepark/rules-api");
|
|
20
|
-
var Agents_1 = require("../../material/Agents");
|
|
21
|
-
var Influence_1 = require("../../material/Influence");
|
|
22
|
-
var LocationType_1 = require("../../material/LocationType");
|
|
23
|
-
var MaterialType_1 = require("../../material/MaterialType");
|
|
24
|
-
var index_1 = require("./index");
|
|
25
|
-
var TransferRule = (function (_super) {
|
|
26
|
-
__extends(TransferRule, _super);
|
|
27
|
-
function TransferRule() {
|
|
28
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
-
}
|
|
30
|
-
TransferRule.prototype.onRuleStart = function () {
|
|
31
|
-
var _a;
|
|
32
|
-
var moves = _super.prototype.onRuleStart.call(this);
|
|
1
|
+
import { isMoveItemType } from '@gamepark/rules-api';
|
|
2
|
+
import { Agents } from '../../material/Agents';
|
|
3
|
+
import { influences } from '../../material/Influence';
|
|
4
|
+
import { LocationType } from '../../material/LocationType';
|
|
5
|
+
import { MaterialType } from '../../material/MaterialType';
|
|
6
|
+
import { EffectRule } from './index';
|
|
7
|
+
export class TransferRule extends EffectRule {
|
|
8
|
+
onRuleStart() {
|
|
9
|
+
const moves = super.onRuleStart();
|
|
33
10
|
if (moves.length > 0)
|
|
34
11
|
return moves;
|
|
35
|
-
if (this.effect.influence && (
|
|
12
|
+
if (this.effect.influence && (this.effect.quantity ?? 1) === 1)
|
|
36
13
|
return this.transferOneCard();
|
|
37
14
|
return moves;
|
|
38
|
-
}
|
|
39
|
-
|
|
15
|
+
}
|
|
16
|
+
getPlayerMoves() {
|
|
40
17
|
return this.transferOneCard();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!
|
|
18
|
+
}
|
|
19
|
+
decrement(move) {
|
|
20
|
+
if (!isMoveItemType(MaterialType.AgentCard)(move) || move.location.type !== LocationType.Influence)
|
|
44
21
|
return false;
|
|
45
22
|
if (this.effect.quantity) {
|
|
46
23
|
this.effect.quantity--;
|
|
47
24
|
return this.effect.quantity === 0 || !this.isPossible();
|
|
48
25
|
}
|
|
49
26
|
return true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (!
|
|
27
|
+
}
|
|
28
|
+
afterItemMove(move) {
|
|
29
|
+
if (!isMoveItemType(MaterialType.AgentCard)(move) || move.location.type !== LocationType.Influence)
|
|
53
30
|
return [];
|
|
54
31
|
if (this.effect.quantity) {
|
|
55
32
|
this.effect.quantity--;
|
|
@@ -59,46 +36,35 @@ var TransferRule = (function (_super) {
|
|
|
59
36
|
return this.afterEffectPlayed();
|
|
60
37
|
}
|
|
61
38
|
return [];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var allInfluences = Influence_1.influences;
|
|
70
|
-
var allCards = this.influenceCards;
|
|
39
|
+
}
|
|
40
|
+
isPossible() {
|
|
41
|
+
return this.influenceCards.length >= (this.effect.quantity ?? 1);
|
|
42
|
+
}
|
|
43
|
+
transferOneCard() {
|
|
44
|
+
const allInfluences = influences;
|
|
45
|
+
const allCards = this.influenceCards;
|
|
71
46
|
return allInfluences
|
|
72
|
-
.filter(
|
|
73
|
-
.flatMap(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
enumerable: false,
|
|
93
|
-
configurable: true
|
|
94
|
-
});
|
|
95
|
-
TransferRule.prototype.getExtraDataFromMove = function (move) {
|
|
96
|
-
if ((0, rules_api_1.isMoveItemType)(MaterialType_1.MaterialType.AgentCard)(move) && move.location.type === LocationType_1.LocationType.Influence) {
|
|
97
|
-
var card = this.material(MaterialType_1.MaterialType.AgentCard).getItem(move.itemIndex);
|
|
98
|
-
return { quantity: Agents_1.Agents[card.id].cost, influence: Agents_1.Agents[card.id].influence };
|
|
47
|
+
.filter((influence) => (this.effect.influence ? influence === this.effect.influence : true))
|
|
48
|
+
.flatMap((influence) => allCards
|
|
49
|
+
.locationId(influence)
|
|
50
|
+
.maxBy((item) => item.location.x)
|
|
51
|
+
.moveItems({
|
|
52
|
+
type: LocationType.Influence,
|
|
53
|
+
id: influence,
|
|
54
|
+
player: this.playerHelper.team
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
get influenceCards() {
|
|
58
|
+
const cards = this.material(MaterialType.AgentCard).location(LocationType.Influence).player(this.opponentTeam);
|
|
59
|
+
if (this.effect.influence)
|
|
60
|
+
return cards.filter((item) => Agents[item.id].influence === this.effect.influence);
|
|
61
|
+
return cards;
|
|
62
|
+
}
|
|
63
|
+
getExtraDataFromMove(move) {
|
|
64
|
+
if (isMoveItemType(MaterialType.AgentCard)(move) && move.location.type === LocationType.Influence) {
|
|
65
|
+
const card = this.material(MaterialType.AgentCard).getItem(move.itemIndex);
|
|
66
|
+
return { quantity: Agents[card.id].cost, influence: Agents[card.id].influence };
|
|
99
67
|
}
|
|
100
68
|
return {};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}(index_1.EffectRule));
|
|
104
|
-
exports.TransferRule = TransferRule;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,89 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
|
-
};
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.WinCreditRule = void 0;
|
|
47
|
-
var uniq_1 = __importDefault(require("lodash/uniq"));
|
|
48
|
-
var Agents_1 = require("../../material/Agents");
|
|
49
|
-
var LocationType_1 = require("../../material/LocationType");
|
|
50
|
-
var MaterialType_1 = require("../../material/MaterialType");
|
|
51
|
-
var CustomMoveType_1 = require("../CustomMoveType");
|
|
52
|
-
var Memory_1 = require("../Memory");
|
|
53
|
-
var index_1 = require("./index");
|
|
54
|
-
var WinCreditRule = (function (_super) {
|
|
55
|
-
__extends(WinCreditRule, _super);
|
|
56
|
-
function WinCreditRule() {
|
|
57
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
58
|
-
}
|
|
59
|
-
WinCreditRule.prototype.onRuleStart = function () {
|
|
60
|
-
var moves = [];
|
|
61
|
-
var money = this.creditMoney;
|
|
62
|
-
var credits = this.wonCredit;
|
|
63
|
-
this.memorize(Memory_1.Memory.Credit, credits);
|
|
64
|
-
this.memorize(Memory_1.Memory.CurrentEffect, JSON.parse(JSON.stringify(this.effect)));
|
|
65
|
-
moves.push(this.customMove(CustomMoveType_1.CustomMoveType.WinCreditLog, credits));
|
|
66
|
-
moves.push.apply(moves, __spreadArray([], __read(money.addMoney(credits, { type: LocationType_1.LocationType.TeamCredit, player: this.effect.opponent ? this.opponentTeam : this.playerHelper.team })), false));
|
|
1
|
+
import uniq from 'lodash/uniq';
|
|
2
|
+
import { Agents } from '../../material/Agents';
|
|
3
|
+
import { LocationType } from '../../material/LocationType';
|
|
4
|
+
import { MaterialType } from '../../material/MaterialType';
|
|
5
|
+
import { CustomMoveType } from '../CustomMoveType';
|
|
6
|
+
import { Memory } from '../Memory';
|
|
7
|
+
import { EffectRule } from './index';
|
|
8
|
+
export class WinCreditRule extends EffectRule {
|
|
9
|
+
onRuleStart() {
|
|
10
|
+
const moves = [];
|
|
11
|
+
const money = this.creditMoney;
|
|
12
|
+
const credits = this.wonCredit;
|
|
13
|
+
this.memorize(Memory.Credit, credits);
|
|
14
|
+
this.memorize(Memory.CurrentEffect, JSON.parse(JSON.stringify(this.effect)));
|
|
15
|
+
moves.push(this.customMove(CustomMoveType.WinCreditLog, credits));
|
|
16
|
+
moves.push(...money.addMoney(credits, { type: LocationType.TeamCredit, player: this.effect.opponent ? this.opponentTeam : this.playerHelper.team }));
|
|
67
17
|
this.removeFirstEffect();
|
|
68
|
-
moves.push
|
|
18
|
+
moves.push(...this.afterEffectPlayed());
|
|
69
19
|
return moves;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
enumerable: false,
|
|
84
|
-
configurable: true
|
|
85
|
-
});
|
|
86
|
-
WinCreditRule.prototype.isPossible = function () {
|
|
20
|
+
}
|
|
21
|
+
get wonCredit() {
|
|
22
|
+
if (this.effect.quantity)
|
|
23
|
+
return this.effect.quantity;
|
|
24
|
+
if (this.effect.perLevel1Technology)
|
|
25
|
+
return this.effect.perLevel1Technology[this.level1Technology - 1];
|
|
26
|
+
if (this.effect.factorPerDifferentInfluence)
|
|
27
|
+
return this.distinctInfluence * this.effect.factorPerDifferentInfluence;
|
|
28
|
+
if (this.effect.factorPerDifferentOpponentInfluence)
|
|
29
|
+
return this.opponentDistinctInfluence * this.effect.factorPerDifferentOpponentInfluence;
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
isPossible() {
|
|
87
33
|
if (this.effect.perLevel1Technology)
|
|
88
34
|
return this.level1Technology > 0;
|
|
89
35
|
if (this.effect.factorPerDifferentInfluence)
|
|
@@ -91,52 +37,36 @@ var WinCreditRule = (function (_super) {
|
|
|
91
37
|
if (this.effect.factorPerDifferentOpponentInfluence)
|
|
92
38
|
return this.opponentDistinctInfluence > 0;
|
|
93
39
|
return true;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
configurable: true
|
|
118
|
-
});
|
|
119
|
-
Object.defineProperty(WinCreditRule.prototype, "level1Technology", {
|
|
120
|
-
get: function () {
|
|
121
|
-
return this.material(MaterialType_1.MaterialType.TechMarker)
|
|
122
|
-
.player(this.playerHelper.team)
|
|
123
|
-
.location(function (l) { return l.type === LocationType_1.LocationType.TechnologyBoardTokenSpace && l.x === 1; }).length;
|
|
124
|
-
},
|
|
125
|
-
enumerable: false,
|
|
126
|
-
configurable: true
|
|
127
|
-
});
|
|
128
|
-
WinCreditRule.prototype.setExtraData = function (_extraData) {
|
|
129
|
-
var _a;
|
|
130
|
-
var _b;
|
|
40
|
+
}
|
|
41
|
+
get distinctInfluence() {
|
|
42
|
+
const items = this.material(MaterialType.AgentCard)
|
|
43
|
+
.location(LocationType.Influence)
|
|
44
|
+
.player(this.playerHelper.team)
|
|
45
|
+
.getItems()
|
|
46
|
+
.map((a) => Agents[a.id].influence);
|
|
47
|
+
return uniq(items).length;
|
|
48
|
+
}
|
|
49
|
+
get opponentDistinctInfluence() {
|
|
50
|
+
const items = this.material(MaterialType.AgentCard)
|
|
51
|
+
.location(LocationType.Influence)
|
|
52
|
+
.player(this.opponentTeam)
|
|
53
|
+
.getItems()
|
|
54
|
+
.map((a) => Agents[a.id].influence);
|
|
55
|
+
return uniq(items).length;
|
|
56
|
+
}
|
|
57
|
+
get level1Technology() {
|
|
58
|
+
return this.material(MaterialType.TechMarker)
|
|
59
|
+
.player(this.playerHelper.team)
|
|
60
|
+
.location((l) => l.type === LocationType.TechnologyBoardTokenSpace && l.x === 1).length;
|
|
61
|
+
}
|
|
62
|
+
setExtraData(_extraData) {
|
|
131
63
|
if (_extraData.quantity) {
|
|
132
|
-
|
|
64
|
+
this.effect.quantity ??= _extraData.quantity;
|
|
133
65
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
this.forget(
|
|
137
|
-
this.forget(
|
|
66
|
+
}
|
|
67
|
+
onRuleEnd() {
|
|
68
|
+
this.forget(Memory.Credit);
|
|
69
|
+
this.forget(Memory.CurrentEffect);
|
|
138
70
|
return [];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
}(index_1.EffectRule));
|
|
142
|
-
exports.WinCreditRule = WinCreditRule;
|
|
71
|
+
}
|
|
72
|
+
}
|