@gamepark/its-a-wonderful-world 1.6.0 → 1.7.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.
@@ -19,7 +19,7 @@ export declare const numberOfRounds = 4;
19
19
  export default class ItsAWonderfulWorld extends SimultaneousGame<GameState, Move, EmpireName> implements SecretInformation<GameState, GameView, Move, MoveView, EmpireName>, Undo<GameState, Move, EmpireName>, Competitive<GameState, Move, EmpireName>, Eliminations<GameState, Move, EmpireName>, TimeLimit<GameState, Move, EmpireName> {
20
20
  constructor(state: GameState);
21
21
  constructor(options: ItsAWonderfulWorldOptions);
22
- isActive(playerId: EmpireName): boolean;
22
+ isTurnToPlay(playerId: EmpireName): boolean;
23
23
  isOver(): boolean;
24
24
  getAutomaticMove(): Move | void;
25
25
  getLegalMoves(empire: EmpireName): Move[];
@@ -143,7 +143,7 @@ var ItsAWonderfulWorld = (function (_super) {
143
143
  }
144
144
  return _this;
145
145
  }
146
- ItsAWonderfulWorld.prototype.isActive = function (playerId) {
146
+ ItsAWonderfulWorld.prototype.isTurnToPlay = function (playerId) {
147
147
  var player = this.state.players.find(function (player) { return player.empire === playerId; });
148
148
  if (!player)
149
149
  return false;
@@ -0,0 +1,15 @@
1
+ import DevelopmentType from './material/DevelopmentType';
2
+ import Resource from './material/Resource';
3
+ import Player from './Player';
4
+ import PlayerView from './PlayerView';
5
+ declare type ProductionFactor = {
6
+ resource: Resource;
7
+ factor: DevelopmentType;
8
+ };
9
+ declare type Production = Resource | {
10
+ [key in Resource]?: number;
11
+ } | ProductionFactor;
12
+ export default Production;
13
+ export declare function isProductionFactor(production: Production): production is ProductionFactor;
14
+ export declare function getProductionAndCorruption(player: Player | PlayerView, resource: Resource): number;
15
+ export declare function getProduction(player: Player | PlayerView, resource: Resource): number;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getProduction = exports.getProductionAndCorruption = exports.isProductionFactor = void 0;
7
+ var Developments_1 = require("./material/Developments");
8
+ var Empires_1 = __importDefault(require("./material/Empires"));
9
+ var Resource_1 = require("./material/Resource");
10
+ function isProductionFactor(production) {
11
+ var productionFactor = production;
12
+ return productionFactor.resource !== undefined && productionFactor.factor !== undefined;
13
+ }
14
+ exports.isProductionFactor = isProductionFactor;
15
+ function getProductionAndCorruption(player, resource) {
16
+ var developmentsProduction = player.constructedDevelopments.reduce(function (sum, card) {
17
+ return sum + getResourceProduction(player, resource, (0, Developments_1.getCardDetails)(card).production);
18
+ }, 0);
19
+ return getEmpireProduction(player, resource) + developmentsProduction;
20
+ }
21
+ exports.getProductionAndCorruption = getProductionAndCorruption;
22
+ function getProduction(player, resource) {
23
+ return Math.max(0, getProductionAndCorruption(player, resource));
24
+ }
25
+ exports.getProduction = getProduction;
26
+ function getEmpireProduction(player, resource) {
27
+ return getResourceProduction(player, resource, Empires_1.default[player.empire][player.empireSide].production);
28
+ }
29
+ function getResourceProduction(player, resource, production) {
30
+ var _a;
31
+ if (!production) {
32
+ return 0;
33
+ }
34
+ if ((0, Resource_1.isResource)(production)) {
35
+ return production === resource ? 1 : 0;
36
+ }
37
+ if (!isProductionFactor(production)) {
38
+ return (_a = production[resource]) !== null && _a !== void 0 ? _a : 0;
39
+ }
40
+ if (production.resource === resource) {
41
+ return player.constructedDevelopments.reduce(function (sum, card) { return (0, Developments_1.getCardDetails)(card).type === production.factor ? sum + 1 : sum; }, 0);
42
+ }
43
+ return 0;
44
+ }
@@ -0,0 +1,26 @@
1
+ import Character from './material/Character';
2
+ import DevelopmentType from './material/DevelopmentType';
3
+ import Player from './Player';
4
+ import PlayerView from './PlayerView';
5
+ export declare type ScoreMultiplier = DevelopmentType | Character;
6
+ export declare type ComboVictoryPoints = {
7
+ quantity: number;
8
+ per: ScoreMultiplier | ScoreMultiplier[];
9
+ };
10
+ export declare type VictoryPoints = number | ComboVictoryPoints;
11
+ export declare type ScoringDetails = {
12
+ flatVictoryPoints: number;
13
+ scoreMultipliers: {
14
+ [key in ScoreMultiplier]: number;
15
+ };
16
+ comboVictoryPoints: ComboVictoryPoints[];
17
+ };
18
+ export declare function getPlayerScore(player: Player | PlayerView): number;
19
+ export declare function getScoringDetails(player: Player | PlayerView, ignoreBaseCharacterValue?: boolean): ScoringDetails;
20
+ export declare function getScoreFromScoringDetails(scoringDetails: ScoringDetails): number;
21
+ export declare function getComboValue(combo: ComboVictoryPoints, scoreMultipliers: {
22
+ [key in ScoreMultiplier]: number;
23
+ }): number;
24
+ export declare function getComboMultiplier(combo: ComboVictoryPoints, scoreMultipliers: {
25
+ [key in ScoreMultiplier]: number;
26
+ }): number;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __values = (this && this.__values) || function(o) {
14
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
15
+ if (m) return m.call(o);
16
+ if (o && typeof o.length === "number") return {
17
+ next: function () {
18
+ if (o && i >= o.length) o = void 0;
19
+ return { value: o && o[i++], done: !o };
20
+ }
21
+ };
22
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
23
+ };
24
+ var __read = (this && this.__read) || function (o, n) {
25
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
26
+ if (!m) return o;
27
+ var i = m.call(o), r, ar = [], e;
28
+ try {
29
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
30
+ }
31
+ catch (error) { e = { error: error }; }
32
+ finally {
33
+ try {
34
+ if (r && !r.done && (m = i["return"])) m.call(i);
35
+ }
36
+ finally { if (e) throw e.error; }
37
+ }
38
+ return ar;
39
+ };
40
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
41
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
42
+ if (ar || !(i in from)) {
43
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
44
+ ar[i] = from[i];
45
+ }
46
+ }
47
+ return to.concat(ar || Array.prototype.slice.call(from));
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.getComboMultiplier = exports.getComboValue = exports.getScoreFromScoringDetails = exports.getScoringDetails = exports.getPlayerScore = void 0;
54
+ var Character_1 = __importDefault(require("./material/Character"));
55
+ var Developments_1 = require("./material/Developments");
56
+ var DevelopmentType_1 = __importDefault(require("./material/DevelopmentType"));
57
+ var Empires_1 = __importDefault(require("./material/Empires"));
58
+ function getPlayerScore(player) {
59
+ var scoringDetails = getScoringDetails(player);
60
+ return getScoreFromScoringDetails(scoringDetails);
61
+ }
62
+ exports.getPlayerScore = getPlayerScore;
63
+ function getScoringDetails(player, ignoreBaseCharacterValue) {
64
+ var _a, e_1, _b;
65
+ if (ignoreBaseCharacterValue === void 0) { ignoreBaseCharacterValue = false; }
66
+ var scoringDetails = {
67
+ flatVictoryPoints: 0,
68
+ scoreMultipliers: (_a = {},
69
+ _a[DevelopmentType_1.default.Structure] = 0,
70
+ _a[DevelopmentType_1.default.Vehicle] = 0,
71
+ _a[DevelopmentType_1.default.Research] = 0,
72
+ _a[DevelopmentType_1.default.Project] = 0,
73
+ _a[DevelopmentType_1.default.Discovery] = 0,
74
+ _a[Character_1.default.Financier] = player.characters[Character_1.default.Financier],
75
+ _a[Character_1.default.General] = player.characters[Character_1.default.General],
76
+ _a),
77
+ comboVictoryPoints: ignoreBaseCharacterValue ? [] : [{ quantity: 1, per: Character_1.default.Financier }, { quantity: 1, per: Character_1.default.General }]
78
+ };
79
+ var empireScoring = Empires_1.default[player.empire][player.empireSide].victoryPoints;
80
+ if (empireScoring) {
81
+ var existingCombo = scoringDetails.comboVictoryPoints.find(function (combo) { return isSameCombo(combo, empireScoring); });
82
+ if (existingCombo) {
83
+ existingCombo.quantity += empireScoring.quantity;
84
+ }
85
+ else {
86
+ scoringDetails.comboVictoryPoints.push(__assign({}, empireScoring));
87
+ }
88
+ }
89
+ var _loop_1 = function (constructedDevelopment) {
90
+ var development = (0, Developments_1.getCardDetails)(constructedDevelopment);
91
+ scoringDetails.scoreMultipliers[development.type]++;
92
+ if (typeof development.victoryPoints === 'number') {
93
+ scoringDetails.flatVictoryPoints += development.victoryPoints;
94
+ }
95
+ else if (development.victoryPoints) {
96
+ var newCombo_1 = development.victoryPoints;
97
+ var existingCombo = scoringDetails.comboVictoryPoints.find(function (combo) { return isSameCombo(combo, newCombo_1); });
98
+ if (existingCombo) {
99
+ existingCombo.quantity += newCombo_1.quantity;
100
+ }
101
+ else {
102
+ scoringDetails.comboVictoryPoints.push(__assign({}, newCombo_1));
103
+ }
104
+ }
105
+ };
106
+ try {
107
+ for (var _c = __values(player.constructedDevelopments), _d = _c.next(); !_d.done; _d = _c.next()) {
108
+ var constructedDevelopment = _d.value;
109
+ _loop_1(constructedDevelopment);
110
+ }
111
+ }
112
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
113
+ finally {
114
+ try {
115
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
116
+ }
117
+ finally { if (e_1) throw e_1.error; }
118
+ }
119
+ return scoringDetails;
120
+ }
121
+ exports.getScoringDetails = getScoringDetails;
122
+ function getScoreFromScoringDetails(scoringDetails) {
123
+ return scoringDetails.flatVictoryPoints + scoringDetails.comboVictoryPoints.reduce(function (sum, combo) { return sum + getComboValue(combo, scoringDetails.scoreMultipliers); }, 0);
124
+ }
125
+ exports.getScoreFromScoringDetails = getScoreFromScoringDetails;
126
+ function isSameCombo(combo, newCombo) {
127
+ if (combo.per === newCombo.per)
128
+ return true;
129
+ if (Array.isArray(combo.per) && Array.isArray(newCombo.per)) {
130
+ var combos_1 = combo.per;
131
+ var newCombos = newCombo.per;
132
+ return combos_1.length === newCombos.length && newCombos.every(function (v) { return combos_1.includes(v); });
133
+ }
134
+ return false;
135
+ }
136
+ function getComboValue(combo, scoreMultipliers) {
137
+ return combo.quantity * getComboMultiplier(combo, scoreMultipliers);
138
+ }
139
+ exports.getComboValue = getComboValue;
140
+ function getComboMultiplier(combo, scoreMultipliers) {
141
+ if (Array.isArray(combo.per)) {
142
+ return Math.min.apply(Math, __spreadArray([], __read(combo.per.map(function (scoreMultiplier) { return scoreMultipliers[scoreMultiplier]; })), false));
143
+ }
144
+ else {
145
+ return scoreMultipliers[combo.per];
146
+ }
147
+ }
148
+ exports.getComboMultiplier = getComboMultiplier;
@@ -1,40 +1,40 @@
1
- import Development from './Development';
2
- export declare const BorderPatrol: Development;
3
- export declare const KrystalliumPowerPlant: Development;
4
- export declare const RobotFactory: Development;
5
- export declare const GoldMine: Development;
6
- export declare const SecretBase: Development;
7
- export declare const LawlessZone: Development;
8
- export declare const OccultDistrict: Development;
9
- export declare const OffshoreLaboratory: Development;
10
- export declare const FloatingPalace: Development;
11
- export declare const GiantRobot: Development;
12
- export declare const ArmoredConvoy: Development;
13
- export declare const MobileBase: Development;
14
- export declare const Inquisitors: Development;
15
- export declare const Raiders: Development;
16
- export declare const PlanetaryArchives: Development;
17
- export declare const Telekinesis: Development;
18
- export declare const ArtificialIntelligence: Development;
19
- export declare const DarkMatter: Development;
20
- export declare const ArtificialSun: Development;
21
- export declare const Immortality: Development;
22
- export declare const Utopia: Development;
23
- export declare const TaxHaven: Development;
24
- export declare const CelestialCathedral: Development;
25
- export declare const IntercontinentalNetwork: Development;
26
- export declare const HighSecurityPrison: Development;
27
- export declare const OrbitalStation: Development;
28
- export declare const WorldBank: Development;
29
- export declare const LuxuryClinic: Development;
30
- export declare const TheWall: Development;
31
- export declare const Consortium: Development;
32
- export declare const MiningAsteroid: Development;
33
- export declare const Hyperborea: Development;
34
- export declare const Valhalla: Development;
35
- export declare const MysteriousVessel: Development;
36
- export declare const Pandemonium: Development;
37
- export declare const PandoraBox: Development;
38
- export declare const AlphaCentauri: Development;
39
- export declare const Shambhala: Development;
40
- export declare const ascensionDevelopments: Development[];
1
+ import DevelopmentDetails from './DevelopmentDetails';
2
+ export declare const BorderPatrol: DevelopmentDetails;
3
+ export declare const KrystalliumPowerPlant: DevelopmentDetails;
4
+ export declare const RobotFactory: DevelopmentDetails;
5
+ export declare const GoldMine: DevelopmentDetails;
6
+ export declare const SecretBase: DevelopmentDetails;
7
+ export declare const LawlessZone: DevelopmentDetails;
8
+ export declare const OccultDistrict: DevelopmentDetails;
9
+ export declare const OffshoreLaboratory: DevelopmentDetails;
10
+ export declare const FloatingPalace: DevelopmentDetails;
11
+ export declare const GiantRobot: DevelopmentDetails;
12
+ export declare const ArmoredConvoy: DevelopmentDetails;
13
+ export declare const MobileBase: DevelopmentDetails;
14
+ export declare const Inquisitors: DevelopmentDetails;
15
+ export declare const Raiders: DevelopmentDetails;
16
+ export declare const PlanetaryArchives: DevelopmentDetails;
17
+ export declare const Telekinesis: DevelopmentDetails;
18
+ export declare const ArtificialIntelligence: DevelopmentDetails;
19
+ export declare const DarkMatter: DevelopmentDetails;
20
+ export declare const ArtificialSun: DevelopmentDetails;
21
+ export declare const Immortality: DevelopmentDetails;
22
+ export declare const Utopia: DevelopmentDetails;
23
+ export declare const TaxHaven: DevelopmentDetails;
24
+ export declare const CelestialCathedral: DevelopmentDetails;
25
+ export declare const IntercontinentalNetwork: DevelopmentDetails;
26
+ export declare const HighSecurityPrison: DevelopmentDetails;
27
+ export declare const OrbitalStation: DevelopmentDetails;
28
+ export declare const WorldBank: DevelopmentDetails;
29
+ export declare const LuxuryClinic: DevelopmentDetails;
30
+ export declare const TheWall: DevelopmentDetails;
31
+ export declare const Consortium: DevelopmentDetails;
32
+ export declare const MiningAsteroid: DevelopmentDetails;
33
+ export declare const Hyperborea: DevelopmentDetails;
34
+ export declare const Valhalla: DevelopmentDetails;
35
+ export declare const MysteriousVessel: DevelopmentDetails;
36
+ export declare const Pandemonium: DevelopmentDetails;
37
+ export declare const PandoraBox: DevelopmentDetails;
38
+ export declare const AlphaCentauri: DevelopmentDetails;
39
+ export declare const Shambhala: DevelopmentDetails;
40
+ export declare const ascensionDevelopments: DevelopmentDetails[];
@@ -2,31 +2,34 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
5
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ascensionDevelopments = exports.Shambhala = exports.AlphaCentauri = exports.PandoraBox = exports.Pandemonium = exports.MysteriousVessel = exports.Valhalla = exports.Hyperborea = exports.MiningAsteroid = exports.Consortium = exports.TheWall = exports.LuxuryClinic = exports.WorldBank = exports.OrbitalStation = exports.HighSecurityPrison = exports.IntercontinentalNetwork = exports.CelestialCathedral = exports.TaxHaven = exports.Utopia = exports.Immortality = exports.ArtificialSun = exports.DarkMatter = exports.ArtificialIntelligence = exports.Telekinesis = exports.PlanetaryArchives = exports.Raiders = exports.Inquisitors = exports.MobileBase = exports.ArmoredConvoy = exports.GiantRobot = exports.FloatingPalace = exports.OffshoreLaboratory = exports.OccultDistrict = exports.LawlessZone = exports.SecretBase = exports.GoldMine = exports.RobotFactory = exports.KrystalliumPowerPlant = exports.BorderPatrol = void 0;
8
8
  var Character_1 = __importDefault(require("./Character"));
9
+ var DeckType_1 = __importDefault(require("./DeckType"));
9
10
  var DevelopmentType_1 = __importDefault(require("./DevelopmentType"));
10
11
  var Resource_1 = __importDefault(require("./Resource"));
11
12
  var Energy = Resource_1.default.Energy, Materials = Resource_1.default.Materials, Science = Resource_1.default.Science, Gold = Resource_1.default.Gold, Exploration = Resource_1.default.Exploration, Krystallium = Resource_1.default.Krystallium;
12
13
  var Structure = DevelopmentType_1.default.Structure, Vehicle = DevelopmentType_1.default.Vehicle, Research = DevelopmentType_1.default.Research, Project = DevelopmentType_1.default.Project, Discovery = DevelopmentType_1.default.Discovery;
13
14
  var Financier = Character_1.default.Financier, General = Character_1.default.General;
14
15
  exports.BorderPatrol = {
16
+ deck: DeckType_1.default.Ascension,
15
17
  type: Structure,
16
18
  constructionCost: (_a = {}, _a[Materials] = 2, _a),
17
- constructionBonus: General,
19
+ constructionBonus: [General],
18
20
  production: (_b = {}, _b[Gold] = 1, _b[Exploration] = -1, _b),
19
21
  recyclingBonus: Exploration,
20
22
  numberOfCopies: 3
21
23
  };
22
24
  exports.KrystalliumPowerPlant = {
25
+ deck: DeckType_1.default.Ascension,
23
26
  type: Structure,
24
27
  constructionCost: (_c = {}, _c[Materials] = 1, _c[Science] = 2, _c[Krystallium] = 1, _c),
25
28
  production: (_d = {}, _d[Materials] = 3, _d[Energy] = 3, _d),
26
- recyclingBonus: Science,
27
- numberOfCopies: 1
29
+ recyclingBonus: Science
28
30
  };
29
31
  exports.RobotFactory = {
32
+ deck: DeckType_1.default.Ascension,
30
33
  type: Structure,
31
34
  constructionCost: (_e = {}, _e[Materials] = 2, _e[Science] = 2, _e),
32
35
  production: (_f = {}, _f[Materials] = -1, _f[Energy] = 2, _f[Science] = 2, _f),
@@ -34,6 +37,7 @@ exports.RobotFactory = {
34
37
  numberOfCopies: 2
35
38
  };
36
39
  exports.GoldMine = {
40
+ deck: DeckType_1.default.Ascension,
37
41
  type: Structure,
38
42
  constructionCost: (_g = {}, _g[Materials] = 3, _g[Energy] = 1, _g[Exploration] = 1, _g),
39
43
  production: (_h = {}, _h[Gold] = 3, _h),
@@ -41,14 +45,16 @@ exports.GoldMine = {
41
45
  numberOfCopies: 2
42
46
  };
43
47
  exports.SecretBase = {
48
+ deck: DeckType_1.default.Ascension,
44
49
  type: Structure,
45
50
  constructionCost: (_j = {}, _j[Materials] = 4, _j[Energy] = 1, _j[Science] = 1, _j),
46
- constructionBonus: General,
51
+ constructionBonus: [General],
47
52
  production: (_k = {}, _k[Energy] = -1, _k[Exploration] = 3, _k),
48
53
  recyclingBonus: Exploration,
49
54
  numberOfCopies: 2
50
55
  };
51
56
  exports.LawlessZone = {
57
+ deck: DeckType_1.default.Ascension,
52
58
  type: Structure,
53
59
  constructionCost: (_l = {}, _l[Materials] = 2, _l),
54
60
  production: (_m = {}, _m[Materials] = 1, _m[Energy] = 1, _m[Gold] = -1, _m),
@@ -56,221 +62,250 @@ exports.LawlessZone = {
56
62
  numberOfCopies: 3
57
63
  };
58
64
  exports.OccultDistrict = {
65
+ deck: DeckType_1.default.Ascension,
59
66
  type: Structure,
60
67
  constructionCost: (_o = {}, _o[Materials] = 1, _o),
61
- constructionBonus: Krystallium,
68
+ constructionBonus: [Krystallium],
62
69
  production: (_p = {}, _p[Materials] = 1, _p[Science] = -1, _p),
63
70
  recyclingBonus: Materials,
64
71
  numberOfCopies: 3
65
72
  };
66
73
  exports.OffshoreLaboratory = {
74
+ deck: DeckType_1.default.Ascension,
67
75
  type: Structure,
68
76
  constructionCost: (_q = {}, _q[Materials] = 2, _q[Gold] = 1, _q),
69
- constructionBonus: Financier,
77
+ constructionBonus: [Financier],
70
78
  production: (_r = {}, _r[Energy] = -1, _r[Science] = 1, _r[Gold] = 1, _r),
71
79
  recyclingBonus: Energy,
72
80
  numberOfCopies: 3
73
81
  };
74
82
  exports.FloatingPalace = {
83
+ deck: DeckType_1.default.Ascension,
75
84
  type: Vehicle,
76
85
  constructionCost: (_s = {}, _s[Energy] = 2, _s[Science] = 1, _s[Gold] = 2, _s[General] = 1, _s),
77
86
  production: (_t = {}, _t[Energy] = 2, _t),
78
- victoryPoints: { quantity: 2, per: [Vehicle] },
79
- recyclingBonus: Energy,
80
- numberOfCopies: 2
87
+ victoryPoints: { quantity: 2, per: Vehicle },
88
+ recyclingBonus: Energy
81
89
  };
82
90
  exports.GiantRobot = {
91
+ deck: DeckType_1.default.Ascension,
83
92
  type: Vehicle,
84
93
  constructionCost: (_u = {}, _u[Materials] = 3, _u[Energy] = 5, _u[Science] = 2, _u[Krystallium] = 1, _u),
85
- constructionBonus: (_v = {}, _v[General] = 2, _v),
94
+ constructionBonus: [General, General],
86
95
  victoryPoints: { quantity: 6, per: [Structure, Vehicle] },
87
- recyclingBonus: Materials,
88
- numberOfCopies: 2
96
+ recyclingBonus: Materials
89
97
  };
90
98
  exports.ArmoredConvoy = {
99
+ deck: DeckType_1.default.Ascension,
91
100
  type: Vehicle,
92
- constructionCost: (_w = {}, _w[Materials] = 1, _w[Energy] = 2, _w),
93
- production: (_x = {}, _x[Materials] = -1, _x[Gold] = 2, _x),
101
+ constructionCost: (_v = {}, _v[Materials] = 1, _v[Energy] = 2, _v),
102
+ production: (_w = {}, _w[Materials] = -1, _w[Gold] = 2, _w),
94
103
  recyclingBonus: Gold,
95
104
  numberOfCopies: 2
96
105
  };
97
106
  exports.MobileBase = {
107
+ deck: DeckType_1.default.Ascension,
98
108
  type: Vehicle,
99
- constructionCost: (_y = {}, _y[Materials] = 2, _y[Energy] = 3, _y[Science] = 1, _y),
100
- constructionBonus: General,
101
- production: (_z = {}, _z[Materials] = -1, _z[Science] = 2, _z[Exploration] = 2, _z),
109
+ constructionCost: (_x = {}, _x[Materials] = 2, _x[Energy] = 3, _x[Science] = 1, _x),
110
+ constructionBonus: [General],
111
+ production: (_y = {}, _y[Materials] = -1, _y[Science] = 2, _y[Exploration] = 2, _y),
102
112
  recyclingBonus: Science,
103
113
  numberOfCopies: 2
104
114
  };
105
115
  exports.Inquisitors = {
116
+ deck: DeckType_1.default.Ascension,
106
117
  type: Vehicle,
107
- constructionCost: (_0 = {}, _0[Materials] = 1, _0[Energy] = 2, _0),
108
- production: (_1 = {}, _1[Science] = -1, _1[Gold] = 1, _1[Exploration] = 1, _1),
118
+ constructionCost: (_z = {}, _z[Materials] = 1, _z[Energy] = 2, _z),
119
+ production: (_0 = {}, _0[Science] = -1, _0[Gold] = 1, _0[Exploration] = 1, _0),
109
120
  recyclingBonus: Science,
110
121
  numberOfCopies: 3
111
122
  };
112
123
  exports.Raiders = {
124
+ deck: DeckType_1.default.Ascension,
113
125
  type: Vehicle,
114
- constructionCost: (_2 = {}, _2[Energy] = 1, _2[Gold] = 1, _2),
115
- production: (_3 = {}, _3[Gold] = -1, _3[Exploration] = 2, _3),
126
+ constructionCost: (_1 = {}, _1[Energy] = 1, _1[Gold] = 1, _1),
127
+ production: (_2 = {}, _2[Gold] = -1, _2[Exploration] = 2, _2),
116
128
  recyclingBonus: Gold,
117
129
  numberOfCopies: 3
118
130
  };
119
131
  exports.PlanetaryArchives = {
132
+ deck: DeckType_1.default.Ascension,
120
133
  type: Research,
121
- constructionCost: (_4 = {}, _4[Science] = 4, _4[Exploration] = 2, _4),
122
- production: (_5 = {}, _5[Science] = 2, _5),
134
+ constructionCost: (_3 = {}, _3[Science] = 4, _3[Exploration] = 2, _3),
135
+ production: (_4 = {}, _4[Science] = 2, _4),
123
136
  victoryPoints: { quantity: 3, per: Discovery },
124
137
  recyclingBonus: Exploration
125
138
  };
126
139
  exports.Telekinesis = {
140
+ deck: DeckType_1.default.Ascension,
127
141
  type: Research,
128
- constructionCost: (_6 = {}, _6[Science] = 5, _6[Krystallium] = 1, _6),
142
+ constructionCost: (_5 = {}, _5[Science] = 5, _5[Krystallium] = 1, _5),
129
143
  victoryPoints: { quantity: 6, per: [Vehicle, Financier] },
130
144
  recyclingBonus: Science
131
145
  };
132
146
  exports.ArtificialIntelligence = {
147
+ deck: DeckType_1.default.Ascension,
133
148
  type: Research,
134
- constructionCost: (_7 = {}, _7[Science] = 3, _7),
135
- production: (_8 = {}, _8[Science] = Vehicle, _8),
149
+ constructionCost: (_6 = {}, _6[Science] = 3, _6),
150
+ production: { resource: Science, factor: Vehicle },
136
151
  victoryPoints: 1,
137
152
  recyclingBonus: Science
138
153
  };
139
154
  exports.DarkMatter = {
155
+ deck: DeckType_1.default.Ascension,
140
156
  type: Research,
141
- constructionCost: (_9 = {}, _9[Materials] = 5, _9[Science] = 5, _9[Krystallium] = 2, _9),
157
+ constructionCost: (_7 = {}, _7[Materials] = 5, _7[Science] = 5, _7[Krystallium] = 2, _7),
142
158
  victoryPoints: { quantity: 6, per: [Structure, Research] },
143
159
  recyclingBonus: Materials
144
160
  };
145
161
  exports.ArtificialSun = {
162
+ deck: DeckType_1.default.Ascension,
146
163
  type: Research,
147
- constructionCost: (_10 = {}, _10[Energy] = 4, _10[Science] = 7, _10[Gold] = 2, _10[Krystallium] = 1, _10),
164
+ constructionCost: (_8 = {}, _8[Energy] = 4, _8[Science] = 7, _8[Gold] = 2, _8[Krystallium] = 1, _8),
148
165
  victoryPoints: 25,
149
166
  recyclingBonus: Energy
150
167
  };
151
168
  exports.Immortality = {
169
+ deck: DeckType_1.default.Ascension,
152
170
  type: Research,
153
- constructionCost: (_11 = {}, _11[Energy] = 3, _11[Science] = 8, _11[Financier] = 1, _11[General] = 1, _11),
154
- constructionBonus: Financier,
171
+ constructionCost: (_9 = {}, _9[Energy] = 3, _9[Science] = 8, _9[Financier] = 1, _9[General] = 1, _9),
155
172
  victoryPoints: { quantity: 9, per: [Research, Project] },
156
173
  recyclingBonus: Science
157
174
  };
158
175
  exports.Utopia = {
176
+ deck: DeckType_1.default.Ascension,
159
177
  type: Research,
160
- constructionCost: (_12 = {}, _12[Materials] = 2, _12[Energy] = 2, _12[Science] = 2, _12[Gold] = 2, _12[Exploration] = 2, _12[Financier] = 2, _12),
178
+ constructionCost: (_10 = {}, _10[Materials] = 2, _10[Energy] = 2, _10[Science] = 2, _10[Gold] = 2, _10[Exploration] = 2, _10[Financier] = 2, _10),
161
179
  victoryPoints: { quantity: 12, per: [Project, Discovery] },
162
180
  recyclingBonus: Gold
163
181
  };
164
182
  exports.TaxHaven = {
183
+ deck: DeckType_1.default.Ascension,
165
184
  type: Research,
166
- constructionCost: (_13 = {}, _13[Science] = 2, _13[Gold] = 2, _13),
167
- constructionBonus: (_14 = {}, _14[Financier] = 2, _14),
168
- production: (_15 = {}, _15[Energy] = -1, _15[Gold] = 2, _15),
185
+ constructionCost: (_11 = {}, _11[Science] = 2, _11[Gold] = 2, _11),
186
+ constructionBonus: [Financier, Financier],
187
+ production: (_12 = {}, _12[Energy] = -1, _12[Gold] = 2, _12),
169
188
  victoryPoints: 1,
170
189
  recyclingBonus: Gold
171
190
  };
172
191
  exports.CelestialCathedral = {
192
+ deck: DeckType_1.default.Ascension,
173
193
  type: Project,
174
- constructionCost: (_16 = {}, _16[Materials] = 4, _16[Gold] = 5, _16[Exploration] = 2, _16),
194
+ constructionCost: (_13 = {}, _13[Materials] = 4, _13[Gold] = 5, _13[Exploration] = 2, _13),
175
195
  victoryPoints: { quantity: 8, per: [Vehicle, Project] },
176
196
  recyclingBonus: Gold
177
197
  };
178
198
  exports.IntercontinentalNetwork = {
199
+ deck: DeckType_1.default.Ascension,
179
200
  type: Project,
180
- constructionCost: (_17 = {}, _17[Materials] = 2, _17[Energy] = 2, _17[Gold] = 3, _17),
201
+ constructionCost: (_14 = {}, _14[Materials] = 2, _14[Energy] = 2, _14[Gold] = 3, _14),
181
202
  victoryPoints: { quantity: 6, per: [Discovery, Financier] },
182
203
  recyclingBonus: Materials
183
204
  };
184
205
  exports.HighSecurityPrison = {
206
+ deck: DeckType_1.default.Ascension,
185
207
  type: Project,
186
- constructionCost: (_18 = {}, _18[Materials] = 2, _18[Gold] = 4, _18[Financier] = 1, _18),
208
+ constructionCost: (_15 = {}, _15[Materials] = 2, _15[Gold] = 4, _15[Financier] = 1, _15),
187
209
  victoryPoints: { quantity: 5, per: [Structure, General] },
188
210
  recyclingBonus: Materials
189
211
  };
190
212
  exports.OrbitalStation = {
213
+ deck: DeckType_1.default.Ascension,
191
214
  type: Project,
192
- constructionCost: (_19 = {}, _19[Energy] = 3, _19[Science] = 3, _19[Gold] = 5, _19),
215
+ constructionCost: (_16 = {}, _16[Energy] = 3, _16[Science] = 3, _16[Gold] = 5, _16),
193
216
  victoryPoints: { quantity: 6, per: [Financier, General] },
194
217
  recyclingBonus: Science
195
218
  };
196
219
  exports.WorldBank = {
220
+ deck: DeckType_1.default.Ascension,
197
221
  type: Project,
198
- constructionCost: (_20 = {}, _20[Gold] = 7, _20[Exploration] = 5, _20[General] = 1, _20),
222
+ constructionCost: (_17 = {}, _17[Gold] = 7, _17[Exploration] = 5, _17[General] = 1, _17),
199
223
  victoryPoints: { quantity: 7, per: [Structure, Project] },
200
224
  recyclingBonus: Gold
201
225
  };
202
226
  exports.LuxuryClinic = {
227
+ deck: DeckType_1.default.Ascension,
203
228
  type: Project,
204
- constructionCost: (_21 = {}, _21[Science] = 1, _21[Gold] = 2, _21),
205
- production: (_22 = {}, _22[Energy] = -1, _22[Science] = 2, _22),
229
+ constructionCost: (_18 = {}, _18[Science] = 1, _18[Gold] = 2, _18),
230
+ production: (_19 = {}, _19[Energy] = -1, _19[Science] = 2, _19),
206
231
  victoryPoints: 3,
207
232
  recyclingBonus: Energy,
208
233
  numberOfCopies: 2
209
234
  };
210
235
  exports.TheWall = {
236
+ deck: DeckType_1.default.Ascension,
211
237
  type: Project,
212
- constructionCost: (_23 = {}, _23[Materials] = 9, _23[Gold] = 4, _23[General] = 2, _23),
238
+ constructionCost: (_20 = {}, _20[Materials] = 9, _20[Gold] = 4, _20[General] = 2, _20),
213
239
  victoryPoints: 25,
214
240
  recyclingBonus: Materials
215
241
  };
216
242
  exports.Consortium = {
243
+ deck: DeckType_1.default.Ascension,
217
244
  type: Project,
218
- constructionCost: (_24 = {}, _24[Energy] = 3, _24[Gold] = 3, _24),
219
- constructionBonus: Financier,
220
- production: (_25 = {}, _25[Gold] = 3, _25[Exploration] = 2, _25),
245
+ constructionCost: (_21 = {}, _21[Energy] = 3, _21[Gold] = 3, _21),
246
+ constructionBonus: [Financier],
247
+ production: (_22 = {}, _22[Gold] = 3, _22[Exploration] = 2, _22),
221
248
  victoryPoints: 1,
222
249
  recyclingBonus: Gold
223
250
  };
224
251
  exports.MiningAsteroid = {
252
+ deck: DeckType_1.default.Ascension,
225
253
  type: Project,
226
- constructionCost: (_26 = {}, _26[Energy] = 2, _26[Science] = 2, _26[Gold] = 2, _26),
227
- constructionBonus: (_27 = {}, _27[Krystallium] = 2, _27),
228
- production: (_28 = {}, _28[Materials] = 4, _28),
254
+ constructionCost: (_23 = {}, _23[Energy] = 2, _23[Science] = 2, _23[Gold] = 2, _23),
255
+ constructionBonus: [Krystallium, Krystallium],
256
+ production: (_24 = {}, _24[Materials] = 4, _24),
229
257
  victoryPoints: 3,
230
258
  recyclingBonus: Materials
231
259
  };
232
260
  exports.Hyperborea = {
261
+ deck: DeckType_1.default.Ascension,
233
262
  type: Discovery,
234
- constructionCost: (_29 = {}, _29[Science] = 4, _29[Exploration] = 5, _29[General] = 2, _29),
263
+ constructionCost: (_25 = {}, _25[Science] = 4, _25[Exploration] = 5, _25[General] = 2, _25),
235
264
  victoryPoints: { quantity: 10, per: [Research, Discovery] },
236
265
  recyclingBonus: Science
237
266
  };
238
267
  exports.Valhalla = {
268
+ deck: DeckType_1.default.Ascension,
239
269
  type: Discovery,
240
- constructionCost: (_30 = {}, _30[Gold] = 2, _30[Exploration] = 5, _30[Krystallium] = 1, _30),
270
+ constructionCost: (_26 = {}, _26[Gold] = 2, _26[Exploration] = 5, _26[Krystallium] = 1, _26),
241
271
  victoryPoints: { quantity: 6, per: [Project, General] },
242
272
  recyclingBonus: Gold
243
273
  };
244
274
  exports.MysteriousVessel = {
275
+ deck: DeckType_1.default.Ascension,
245
276
  type: Discovery,
246
- constructionCost: (_31 = {}, _31[Science] = 2, _31[Exploration] = 6, _31),
277
+ constructionCost: (_27 = {}, _27[Science] = 2, _27[Exploration] = 6, _27),
247
278
  victoryPoints: { quantity: 6, per: [Vehicle, Research] },
248
279
  recyclingBonus: Exploration
249
280
  };
250
281
  exports.Pandemonium = {
282
+ deck: DeckType_1.default.Ascension,
251
283
  type: Discovery,
252
- constructionCost: (_32 = {}, _32[Exploration] = 4, _32[Financier] = 2, _32),
253
- victoryPoints: { quantity: 2, per: [Structure] },
284
+ constructionCost: (_28 = {}, _28[Exploration] = 4, _28[Financier] = 2, _28),
285
+ victoryPoints: { quantity: 2, per: Structure },
254
286
  recyclingBonus: Energy
255
287
  };
256
288
  exports.PandoraBox = {
289
+ deck: DeckType_1.default.Ascension,
257
290
  type: Discovery,
258
- constructionCost: (_33 = {}, _33[Exploration] = 4, _33),
259
- constructionBonus: Krystallium,
260
- production: (_34 = {}, _34[Materials] = 1, _34[Energy] = 1, _34[Science] = 1, _34[Gold] = 1, _34),
291
+ constructionCost: (_29 = {}, _29[Exploration] = 4, _29),
292
+ constructionBonus: [Krystallium],
293
+ production: (_30 = {}, _30[Materials] = 1, _30[Energy] = 1, _30[Science] = 1, _30[Gold] = 1, _30),
261
294
  victoryPoints: 1,
262
295
  recyclingBonus: Exploration
263
296
  };
264
297
  exports.AlphaCentauri = {
298
+ deck: DeckType_1.default.Ascension,
265
299
  type: Discovery,
266
- constructionCost: (_35 = {}, _35[Energy] = 3, _35[Science] = 3, _35[Exploration] = 8, _35),
300
+ constructionCost: (_31 = {}, _31[Energy] = 3, _31[Science] = 3, _31[Exploration] = 8, _31),
267
301
  victoryPoints: 25,
268
302
  recyclingBonus: Exploration
269
303
  };
270
304
  exports.Shambhala = {
305
+ deck: DeckType_1.default.Ascension,
271
306
  type: Discovery,
272
- constructionCost: (_36 = {}, _36[Exploration] = 4, _36),
273
- production: (_37 = {}, _37[Exploration] = Project, _37),
307
+ constructionCost: (_32 = {}, _32[Exploration] = 4, _32),
308
+ production: { resource: Exploration, factor: Project },
274
309
  victoryPoints: 4,
275
310
  recyclingBonus: Exploration
276
311
  };
@@ -0,0 +1,22 @@
1
+ import Production from '../Production';
2
+ import { VictoryPoints } from '../Scoring';
3
+ import Character from './Character';
4
+ import DeckType from './DeckType';
5
+ import DevelopmentType from './DevelopmentType';
6
+ import Resource from './Resource';
7
+ declare type DevelopmentDetails = {
8
+ deck: DeckType;
9
+ type: DevelopmentType;
10
+ constructionCost: {
11
+ [key in Resource | Character]?: number;
12
+ };
13
+ constructionBonus?: ConstructionBonus[];
14
+ production?: Production;
15
+ victoryPoints?: VictoryPoints;
16
+ recyclingBonus: Resource;
17
+ numberOfCopies?: number;
18
+ };
19
+ export default DevelopmentDetails;
20
+ export declare type ConstructionBonus = Character | Resource.Krystallium;
21
+ export declare function isConstructionBonus(item: any): item is ConstructionBonus;
22
+ export declare function totalCost(development: DevelopmentDetails): number;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.totalCost = exports.isConstructionBonus = void 0;
7
+ var Character_1 = require("./Character");
8
+ var Resource_1 = __importDefault(require("./Resource"));
9
+ function isConstructionBonus(item) {
10
+ return (0, Character_1.isCharacter)(item) || item === Resource_1.default.Krystallium;
11
+ }
12
+ exports.isConstructionBonus = isConstructionBonus;
13
+ function totalCost(development) {
14
+ return Object.values(development.constructionCost).reduce(function (sum, cost) { return cost ? sum + cost : sum; }, 0);
15
+ }
16
+ exports.totalCost = totalCost;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/its-a-wonderful-world",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "It's a Wonderful World rules for Game Park",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "access": "public"
14
14
  },
15
15
  "dependencies": {
16
- "@gamepark/rules-api": "~5.0.0"
16
+ "@gamepark/rules-api": "~5.10.0"
17
17
  },
18
18
  "scripts": {
19
19
  "build": "tsc",
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "i18next": "^20.2.4"
24
24
  },
25
- "gitHead": "650663169ba7329014bcb9a9ef3abe11ad09253a"
25
+ "gitHead": "e416a925c594476a98a1c7252fb6301138ce049a"
26
26
  }