powergrid-engine 1.10.0 → 1.12.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.
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.map = exports.Cities = exports.Regions = void 0;
4
+ // by John and Cici
5
+ const lodash_1 = require("lodash");
6
+ const engine_1 = require("../engine");
7
+ const utils_1 = require("../utils");
8
+ const powerPlants_1 = require("./../powerPlants");
4
9
  var Regions;
5
10
  (function (Regions) {
6
11
  Regions["Orange"] = "orange";
@@ -11,142 +16,260 @@ var Regions;
11
16
  })(Regions = exports.Regions || (exports.Regions = {}));
12
17
  var Cities;
13
18
  (function (Cities) {
14
- Cities["Zimbaswe"] = "Zimbaswe";
19
+ Cities["Zimbabwe"] = "Zimbabwe";
15
20
  Cities["Musina"] = "Musina";
16
21
  Cities["Botswana"] = "Botswana";
17
22
  Cities["Polokwane"] = "Polokwane";
18
- Cities["Pretoria1"] = "Pretoria 1";
19
- Cities["Pretoria2"] = "Pretoria 2";
20
- Cities["Rustenburc"] = "Rustenburc";
23
+ Cities["PretoriaN"] = "Pretoria N";
24
+ Cities["PretoriaS"] = "Pretoria S";
25
+ Cities["Rustenburg"] = "Rustenburg";
21
26
  Cities["Mozambique"] = "Mozambique";
22
27
  Cities["Mbombela"] = "Mbombela";
23
- Cities["Iswaini"] = "Iswaini";
28
+ Cities["Eswatini"] = "Eswatini";
24
29
  Cities["Germiston"] = "Germiston";
25
- Cities["Johannesburg1"] = "Johannesburg 1";
26
- Cities["Johannesburg2"] = "Johannesburg 2";
30
+ Cities["JohannesburgN"] = "Johannesburg N";
31
+ Cities["JohannesburgS"] = "Johannesburg S";
27
32
  Cities["Ladysmith"] = "Ladysmith";
28
- Cities["Abc"] = "Abc";
29
- Cities["Def"] = "Def";
30
- Cities["Ghi1"] = "Ghi 1";
31
- Cities["Ghi2"] = "Ghi 2";
32
- Cities["Jkl"] = "Jkl";
33
- Cities["Mno"] = "Mno";
34
- Cities["Qrs"] = "Qrs";
35
- Cities["Keerksorp"] = "Keerksorp";
36
- Cities["Weikom"] = "Weikom";
37
- Cities["Xuruman"] = "Xuruman";
33
+ Cities["Newcastle"] = "Newcastle";
34
+ Cities["Pietermaritzburg"] = "Pietermaritzburg";
35
+ Cities["DurbanN"] = "Durban N";
36
+ Cities["DurbanS"] = "Durban S";
37
+ Cities["Mthatha"] = "Mthatha";
38
+ Cities["Lesotho"] = "Lesotho";
39
+ Cities["Bloemfontein"] = "Bloemfontein";
40
+ Cities["Klerksdorp"] = "Klerksdorp";
41
+ Cities["Welkom"] = "Welkom";
42
+ Cities["Kuruman"] = "Kuruman";
38
43
  Cities["Kimberly"] = "Kimberly";
39
- Cities["Upincion"] = "Upincion";
40
- Cities["Sprincbom"] = "Sprincbom";
44
+ Cities["Upington"] = "Upington";
45
+ Cities["Springbok"] = "Springbok";
41
46
  Cities["Namibia"] = "Namibia";
42
- Cities["Deaar"] = "Deaar";
43
- Cities["Beaufortwest"] = "Beaufort West";
44
- Cities["Eastlondon"] = "East London";
45
- Cities["Portelizabeth"] = "Port Elizabeth";
46
- Cities["Ceorci"] = "Ceorci";
47
- Cities["Capetown1"] = "Capetown 1";
48
- Cities["Capetown2"] = "Capetown2";
47
+ Cities["DeAar"] = "De Aar";
48
+ Cities["BeaufortWest"] = "Beaufort West";
49
+ Cities["EastLondon"] = "East London";
50
+ Cities["PortElizabeth"] = "Port Elizabeth";
51
+ Cities["George"] = "George";
52
+ Cities["CapeTownN"] = "Cape Town N";
53
+ Cities["CapeTownS"] = "Cape Town S";
49
54
  })(Cities = exports.Cities || (exports.Cities = {}));
50
55
  exports.map = {
51
56
  name: 'South Africa',
52
57
  cities: [
53
- { name: Cities.Zimbaswe, region: Regions.Orange, x: 1060, y: 29 },
54
- { name: Cities.Musina, region: Regions.Orange, x: 1027, y: 125 },
55
- { name: Cities.Botswana, region: Regions.Orange, x: 665, y: 186 },
56
- { name: Cities.Polokwane, region: Regions.Orange, x: 944, y: 188 },
57
- { name: Cities.Pretoria1, region: Regions.Orange, x: 894, y: 271 },
58
- { name: Cities.Pretoria2, region: Regions.Orange, x: 894, y: 306 },
59
- { name: Cities.Rustenburc, region: Regions.Orange, x: 787, y: 327 },
60
- { name: Cities.Mozambique, region: Regions.Green, x: 1184, y: 167 },
61
- { name: Cities.Mbombela, region: Regions.Green, x: 1046, y: 287 },
62
- { name: Cities.Iswaini, region: Regions.Green, x: 1086, y: 375 },
63
- { name: Cities.Germiston, region: Regions.Green, x: 983, y: 375 },
64
- { name: Cities.Johannesburg1, region: Regions.Green, x: 887, y: 365 },
65
- { name: Cities.Johannesburg2, region: Regions.Green, x: 889, y: 398 },
66
- { name: Cities.Ladysmith, region: Regions.Green, x: 968, y: 495 },
67
- { name: Cities.Abc, region: Regions.Yellow, x: 1122, y: 521 },
68
- { name: Cities.Def, region: Regions.Yellow, x: 1000, y: 558 },
69
- { name: Cities.Ghi1, region: Regions.Yellow, x: 1049, y: 618 },
70
- { name: Cities.Ghi2, region: Regions.Yellow, x: 1048, y: 651 },
71
- { name: Cities.Jkl, region: Regions.Yellow, x: 931, y: 733 },
72
- { name: Cities.Mno, region: Regions.Yellow, x: 894, y: 572 },
73
- { name: Cities.Qrs, region: Regions.Yellow, x: 776, y: 556 },
74
- { name: Cities.Keerksorp, region: Regions.Brown, x: 780, y: 387 },
75
- { name: Cities.Weikom, region: Regions.Brown, x: 771, y: 467 },
76
- { name: Cities.Xuruman, region: Regions.Brown, x: 595, y: 415 },
77
- { name: Cities.Kimberly, region: Regions.Brown, x: 670, y: 541 },
78
- { name: Cities.Upincion, region: Regions.Brown, x: 456, y: 492 },
79
- { name: Cities.Sprincbom, region: Regions.Brown, x: 264, y: 580 },
80
- { name: Cities.Namibia, region: Regions.Brown, x: 239, y: 329 },
81
- { name: Cities.Deaar, region: Regions.Red, x: 641, y: 735 },
82
- { name: Cities.Beaufortwest, region: Regions.Red, x: 513, y: 782 },
83
- { name: Cities.Eastlondon, region: Regions.Red, x: 852, y: 833 },
84
- { name: Cities.Portelizabeth, region: Regions.Red, x: 712, y: 903 },
85
- { name: Cities.Ceorci, region: Regions.Red, x: 526, y: 903 },
86
- { name: Cities.Capetown1, region: Regions.Red, x: 290, y: 871 },
87
- { name: Cities.Capetown2, region: Regions.Red, x: 287, y: 904 },
58
+ { name: Cities.Zimbabwe, region: Regions.Orange, x: 903, y: 50, singleOccupancy: true },
59
+ { name: Cities.Musina, region: Regions.Orange, x: 874, y: 134 },
60
+ { name: Cities.Botswana, region: Regions.Orange, x: 560, y: 187, singleOccupancy: true },
61
+ { name: Cities.Polokwane, region: Regions.Orange, x: 802, y: 189 },
62
+ { name: Cities.PretoriaN, region: Regions.Orange, x: 759, y: 261 },
63
+ { name: Cities.PretoriaS, region: Regions.Orange, x: 759, y: 291 },
64
+ { name: Cities.Rustenburg, region: Regions.Orange, x: 666, y: 310 },
65
+ { name: Cities.Mozambique, region: Regions.Green, x: 1011, y: 170, singleOccupancy: true },
66
+ { name: Cities.Mbombela, region: Regions.Green, x: 891, y: 275 },
67
+ { name: Cities.Eswatini, region: Regions.Green, x: 926, y: 351, singleOccupancy: true },
68
+ { name: Cities.Germiston, region: Regions.Green, x: 836, y: 351 },
69
+ { name: Cities.JohannesburgN, region: Regions.Green, x: 753, y: 343 },
70
+ { name: Cities.JohannesburgS, region: Regions.Green, x: 754, y: 371 },
71
+ { name: Cities.Ladysmith, region: Regions.Green, x: 823, y: 456 },
72
+ { name: Cities.Newcastle, region: Regions.Yellow, x: 957, y: 478 },
73
+ { name: Cities.Pietermaritzburg, region: Regions.Yellow, x: 851, y: 511 },
74
+ { name: Cities.DurbanN, region: Regions.Yellow, x: 894, y: 563 },
75
+ { name: Cities.DurbanS, region: Regions.Yellow, x: 893, y: 592 },
76
+ { name: Cities.Mthatha, region: Regions.Yellow, x: 791, y: 663 },
77
+ { name: Cities.Lesotho, region: Regions.Yellow, x: 759, y: 523, singleOccupancy: true },
78
+ { name: Cities.Bloemfontein, region: Regions.Yellow, x: 656, y: 509 },
79
+ { name: Cities.Klerksdorp, region: Regions.Brown, x: 660, y: 362 },
80
+ { name: Cities.Welkom, region: Regions.Brown, x: 652, y: 431 },
81
+ { name: Cities.Kuruman, region: Regions.Brown, x: 499, y: 386 },
82
+ { name: Cities.Kimberly, region: Regions.Brown, x: 564, y: 496 },
83
+ { name: Cities.Upington, region: Regions.Brown, x: 378, y: 453 },
84
+ { name: Cities.Springbok, region: Regions.Brown, x: 211, y: 530 },
85
+ { name: Cities.Namibia, region: Regions.Brown, x: 189, y: 311, singleOccupancy: true },
86
+ { name: Cities.DeAar, region: Regions.Red, x: 539, y: 665 },
87
+ { name: Cities.BeaufortWest, region: Regions.Red, x: 427, y: 705 },
88
+ { name: Cities.EastLondon, region: Regions.Red, x: 722, y: 750 },
89
+ { name: Cities.PortElizabeth, region: Regions.Red, x: 600, y: 811 },
90
+ { name: Cities.George, region: Regions.Red, x: 439, y: 811 },
91
+ { name: Cities.CapeTownN, region: Regions.Red, x: 233, y: 783 },
92
+ { name: Cities.CapeTownS, region: Regions.Red, x: 231, y: 812 },
88
93
  ],
89
94
  connections: [
90
- { nodes: [Cities.Sprincbom, Cities.Namibia], cost: 30 },
91
- { nodes: [Cities.Qrs, Cities.Mno], cost: 30 },
92
- { nodes: [Cities.Germiston, Cities.Iswaini], cost: 30 },
95
+ { nodes: [Cities.Springbok, Cities.Namibia], cost: 30 },
96
+ { nodes: [Cities.Bloemfontein, Cities.Lesotho], cost: 30 },
97
+ { nodes: [Cities.Germiston, Cities.Eswatini], cost: 30 },
93
98
  { nodes: [Cities.Mbombela, Cities.Mozambique], cost: 30 },
94
- { nodes: [Cities.Botswana, Cities.Rustenburc], cost: 30 },
95
- { nodes: [Cities.Zimbaswe, Cities.Musina], cost: 30 },
96
- { nodes: [Cities.Capetown2, Cities.Capetown1], cost: 0 },
97
- { nodes: [Cities.Capetown2, Cities.Ceorci], cost: 16 },
98
- { nodes: [Cities.Ceorci, Cities.Portelizabeth], cost: 12 },
99
- { nodes: [Cities.Portelizabeth, Cities.Eastlondon], cost: 13 },
100
- { nodes: [Cities.Eastlondon, Cities.Jkl], cost: 8 },
101
- { nodes: [Cities.Jkl, Cities.Ghi2], cost: 13 },
102
- { nodes: [Cities.Ghi2, Cities.Ghi1], cost: 0 },
103
- { nodes: [Cities.Ghi1, Cities.Def], cost: 3 },
104
- { nodes: [Cities.Ghi1, Cities.Abc], cost: 9 },
105
- { nodes: [Cities.Abc, Cities.Def], cost: 9 },
106
- { nodes: [Cities.Def, Cities.Ladysmith], cost: 5 },
107
- { nodes: [Cities.Ladysmith, Cities.Abc], cost: 10 },
108
- { nodes: [Cities.Qrs, Cities.Jkl], cost: 18 },
109
- { nodes: [Cities.Qrs, Cities.Eastlondon], cost: 22 },
110
- { nodes: [Cities.Eastlondon, Cities.Deaar], cost: 22 },
111
- { nodes: [Cities.Deaar, Cities.Portelizabeth], cost: 18 },
112
- { nodes: [Cities.Ceorci, Cities.Deaar], cost: 17 },
113
- { nodes: [Cities.Deaar, Cities.Beaufortwest], cost: 10 },
114
- { nodes: [Cities.Beaufortwest, Cities.Ceorci], cost: 8 },
115
- { nodes: [Cities.Beaufortwest, Cities.Capetown1], cost: 22 },
116
- { nodes: [Cities.Capetown1, Cities.Sprincbom], cost: 22 },
117
- { nodes: [Cities.Sprincbom, Cities.Beaufortwest], cost: 24 },
118
- { nodes: [Cities.Deaar, Cities.Sprincbom], cost: 26 },
119
- { nodes: [Cities.Sprincbom, Cities.Upincion], cost: 16 },
120
- { nodes: [Cities.Upincion, Cities.Deaar], cost: 16 },
121
- { nodes: [Cities.Deaar, Cities.Qrs], cost: 13 },
122
- { nodes: [Cities.Qrs, Cities.Kimberly], cost: 6 },
123
- { nodes: [Cities.Kimberly, Cities.Deaar], cost: 10 },
124
- { nodes: [Cities.Kimberly, Cities.Upincion], cost: 14 },
125
- { nodes: [Cities.Kimberly, Cities.Weikom], cost: 9 },
126
- { nodes: [Cities.Weikom, Cities.Qrs], cost: 6 },
127
- { nodes: [Cities.Qrs, Cities.Ladysmith], cost: 19 },
128
- { nodes: [Cities.Jkl, Cities.Def], cost: 12 },
129
- { nodes: [Cities.Upincion, Cities.Xuruman], cost: 11 },
99
+ { nodes: [Cities.Botswana, Cities.Rustenburg], cost: 30 },
100
+ { nodes: [Cities.Zimbabwe, Cities.Musina], cost: 30 },
101
+ { nodes: [Cities.CapeTownS, Cities.CapeTownN], cost: 0 },
102
+ { nodes: [Cities.CapeTownS, Cities.George], cost: 16 },
103
+ { nodes: [Cities.George, Cities.PortElizabeth], cost: 12 },
104
+ { nodes: [Cities.PortElizabeth, Cities.EastLondon], cost: 13 },
105
+ { nodes: [Cities.EastLondon, Cities.Mthatha], cost: 8 },
106
+ { nodes: [Cities.Mthatha, Cities.DurbanS], cost: 13 },
107
+ { nodes: [Cities.DurbanS, Cities.DurbanN], cost: 0 },
108
+ { nodes: [Cities.DurbanN, Cities.Pietermaritzburg], cost: 3 },
109
+ { nodes: [Cities.DurbanN, Cities.Newcastle], cost: 9 },
110
+ { nodes: [Cities.Newcastle, Cities.Pietermaritzburg], cost: 9 },
111
+ { nodes: [Cities.Pietermaritzburg, Cities.Ladysmith], cost: 5 },
112
+ { nodes: [Cities.Ladysmith, Cities.Newcastle], cost: 10 },
113
+ { nodes: [Cities.Bloemfontein, Cities.Mthatha], cost: 18 },
114
+ { nodes: [Cities.Bloemfontein, Cities.EastLondon], cost: 22 },
115
+ { nodes: [Cities.EastLondon, Cities.DeAar], cost: 22 },
116
+ { nodes: [Cities.DeAar, Cities.PortElizabeth], cost: 18 },
117
+ { nodes: [Cities.George, Cities.DeAar], cost: 17 },
118
+ { nodes: [Cities.DeAar, Cities.BeaufortWest], cost: 10 },
119
+ { nodes: [Cities.BeaufortWest, Cities.George], cost: 8 },
120
+ { nodes: [Cities.BeaufortWest, Cities.CapeTownN], cost: 22 },
121
+ { nodes: [Cities.CapeTownN, Cities.Springbok], cost: 22 },
122
+ { nodes: [Cities.Springbok, Cities.BeaufortWest], cost: 24 },
123
+ { nodes: [Cities.DeAar, Cities.Springbok], cost: 26 },
124
+ { nodes: [Cities.Springbok, Cities.Upington], cost: 16 },
125
+ { nodes: [Cities.Upington, Cities.DeAar], cost: 16 },
126
+ { nodes: [Cities.DeAar, Cities.Bloemfontein], cost: 13 },
127
+ { nodes: [Cities.Bloemfontein, Cities.Kimberly], cost: 6 },
128
+ { nodes: [Cities.Kimberly, Cities.DeAar], cost: 10 },
129
+ { nodes: [Cities.Kimberly, Cities.Upington], cost: 14 },
130
+ { nodes: [Cities.Kimberly, Cities.Welkom], cost: 9 },
131
+ { nodes: [Cities.Welkom, Cities.Bloemfontein], cost: 6 },
132
+ { nodes: [Cities.Bloemfontein, Cities.Ladysmith], cost: 19 },
133
+ { nodes: [Cities.Mthatha, Cities.Pietermaritzburg], cost: 12 },
134
+ { nodes: [Cities.Upington, Cities.Kuruman], cost: 11 },
130
135
  { nodes: [Cities.Musina, Cities.Polokwane], cost: 8 },
131
- { nodes: [Cities.Polokwane, Cities.Pretoria1], cost: 11 },
132
- { nodes: [Cities.Pretoria1, Cities.Pretoria2], cost: 0 },
133
- { nodes: [Cities.Pretoria2, Cities.Johannesburg1], cost: 2 },
134
- { nodes: [Cities.Johannesburg1, Cities.Johannesburg2], cost: 0 },
135
- { nodes: [Cities.Johannesburg2, Cities.Germiston], cost: 1 },
136
- { nodes: [Cities.Johannesburg1, Cities.Mbombela], cost: 13 },
136
+ { nodes: [Cities.Polokwane, Cities.PretoriaN], cost: 11 },
137
+ { nodes: [Cities.PretoriaN, Cities.PretoriaS], cost: 0 },
138
+ { nodes: [Cities.PretoriaS, Cities.JohannesburgN], cost: 2 },
139
+ { nodes: [Cities.JohannesburgN, Cities.JohannesburgS], cost: 0 },
140
+ { nodes: [Cities.JohannesburgS, Cities.Germiston], cost: 1 },
141
+ { nodes: [Cities.JohannesburgN, Cities.Mbombela], cost: 13 },
137
142
  { nodes: [Cities.Mbombela, Cities.Germiston], cost: 13 },
138
- { nodes: [Cities.Pretoria1, Cities.Mbombela], cost: 13 },
143
+ { nodes: [Cities.PretoriaN, Cities.Mbombela], cost: 13 },
139
144
  { nodes: [Cities.Mbombela, Cities.Polokwane], cost: 10 },
140
145
  { nodes: [Cities.Musina, Cities.Mbombela], cost: 15 },
141
- { nodes: [Cities.Pretoria1, Cities.Rustenburc], cost: 4 },
142
- { nodes: [Cities.Rustenburc, Cities.Johannesburg1], cost: 4 },
143
- { nodes: [Cities.Johannesburg1, Cities.Keerksorp], cost: 7 },
144
- { nodes: [Cities.Keerksorp, Cities.Weikom], cost: 5 },
145
- { nodes: [Cities.Qrs, Cities.Johannesburg2], cost: 16 },
146
- { nodes: [Cities.Xuruman, Cities.Rustenburc], cost: 18 },
147
- { nodes: [Cities.Keerksorp, Cities.Xuruman], cost: 12 },
148
- { nodes: [Cities.Xuruman, Cities.Kimberly], cost: 8 },
149
- { nodes: [Cities.Johannesburg2, Cities.Ladysmith], cost: 13 },
146
+ { nodes: [Cities.PretoriaN, Cities.Rustenburg], cost: 4 },
147
+ { nodes: [Cities.Rustenburg, Cities.JohannesburgN], cost: 4 },
148
+ { nodes: [Cities.JohannesburgN, Cities.Klerksdorp], cost: 7 },
149
+ { nodes: [Cities.Klerksdorp, Cities.Welkom], cost: 5 },
150
+ { nodes: [Cities.Bloemfontein, Cities.JohannesburgS], cost: 16 },
151
+ { nodes: [Cities.Kuruman, Cities.Rustenburg], cost: 18 },
152
+ { nodes: [Cities.Klerksdorp, Cities.Kuruman], cost: 12 },
153
+ { nodes: [Cities.Kuruman, Cities.Kimberly], cost: 8 },
154
+ { nodes: [Cities.JohannesburgS, Cities.Ladysmith], cost: 13 },
150
155
  { nodes: [Cities.Ladysmith, Cities.Germiston], cost: 13 },
151
156
  ],
157
+ // Resupply per South Africa refill summary cards. Indexed as
158
+ // [resource][playerCount-2][step-1]. Note: 2P and 3P rows are intentionally
159
+ // identical on the printed cards (same pattern as North America).
160
+ resupply: [
161
+ // Coal
162
+ [
163
+ [4, 7, 5],
164
+ [4, 7, 5],
165
+ [5, 8, 6],
166
+ [6, 9, 7],
167
+ [7, 10, 8], // 6P
168
+ ],
169
+ // Oil
170
+ [
171
+ [1, 2, 1],
172
+ [1, 2, 1],
173
+ [2, 3, 2],
174
+ [2, 4, 3],
175
+ [4, 5, 4], // 6P
176
+ ],
177
+ // Garbage
178
+ [
179
+ [1, 3, 3],
180
+ [1, 3, 3],
181
+ [2, 4, 4],
182
+ [3, 4, 5],
183
+ [3, 6, 6], // 6P
184
+ ],
185
+ // Uranium
186
+ [
187
+ [1, 1, 2],
188
+ [1, 1, 2],
189
+ [2, 2, 3],
190
+ [2, 3, 3],
191
+ [2, 3, 4], // 6P
192
+ ],
193
+ ],
194
+ layout: 'Landscape',
195
+ // Cities authored at photo-coord scale (~1200x863). First-pass fit into the
196
+ // standard 1500x800 landscape viewBox — tune after first render.
197
+ adjustRatio: [0.9, 0.75],
198
+ mapPosition: [70, 50],
199
+ mapRotation: 0,
200
+ // SA uses the engine default 8-price market (24 coal / 24 oil / 24 garbage
201
+ // slots + 12 uranium 1–8 + 10/12/14/16), so we don't override coal/oil/
202
+ // garbage/uranium Prices. Only the starting fill differs:
203
+ // coal 1–8 full = 24
204
+ // oil 4–8 = 15
205
+ // garbage 5–8 = 12
206
+ // uranium 12–16 only = 3
207
+ startingResources: [24, 15, 12, 3],
208
+ // Total cubes in the game (used cubes return here; refill draws from here).
209
+ // For SA, USED coal goes to the separate coalStorage pool instead — see
210
+ // GameState.coalStorage and the UsePowerPlant/resupply branches in engine.ts.
211
+ startingSupply: [24, 24, 24, 12],
212
+ // SA removes oil power plant 07 from the deck; the rest follows the standard
213
+ // recharged/original deck setup. With 07 gone the "starter pool" is one
214
+ // plant shorter (12 instead of 13 for recharged; future market shifts to
215
+ // 8/9/10/11 instead of 7/8/9/10 for original).
216
+ setupDeck(numPlayers, variant, rng) {
217
+ let powerPlantsDeck = lodash_1.cloneDeep(powerPlants_1.powerPlants).filter((pp) => pp.number !== 7);
218
+ let actualMarket;
219
+ let futureMarket;
220
+ if (variant == 'original') {
221
+ powerPlantsDeck = powerPlantsDeck.slice(8);
222
+ const powerPlant13Idx = powerPlantsDeck.findIndex((pp) => pp.number == 13);
223
+ const powerPlant13 = powerPlantsDeck.splice(powerPlant13Idx, 1)[0];
224
+ const step3 = powerPlantsDeck.pop();
225
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck, rng() + '');
226
+ if (numPlayers == 2 || numPlayers == 3) {
227
+ powerPlantsDeck = powerPlantsDeck.slice(8);
228
+ }
229
+ else if (numPlayers == 4) {
230
+ powerPlantsDeck = powerPlantsDeck.slice(4);
231
+ }
232
+ powerPlantsDeck.unshift(powerPlant13);
233
+ powerPlantsDeck.push(step3);
234
+ actualMarket = [engine_1.getPowerPlant(3), engine_1.getPowerPlant(4), engine_1.getPowerPlant(5), engine_1.getPowerPlant(6)];
235
+ futureMarket = [engine_1.getPowerPlant(8), engine_1.getPowerPlant(9), engine_1.getPowerPlant(10), engine_1.getPowerPlant(11)];
236
+ }
237
+ else {
238
+ let initialPowerPlants = utils_1.shuffle(powerPlantsDeck.splice(0, 12), rng() + '');
239
+ let initialPlantMarket = initialPowerPlants.splice(0, 8);
240
+ initialPlantMarket = initialPlantMarket.sort((a, b) => a.number - b.number);
241
+ actualMarket = initialPlantMarket.slice(0, 4);
242
+ futureMarket = initialPlantMarket.slice(4);
243
+ const first = initialPowerPlants.shift();
244
+ const step3 = powerPlantsDeck.pop();
245
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck, rng() + '');
246
+ if (numPlayers == 2 || numPlayers == 3) {
247
+ initialPowerPlants = initialPowerPlants.slice(2);
248
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(6).concat(initialPowerPlants), rng() + '');
249
+ }
250
+ else if (numPlayers == 4) {
251
+ initialPowerPlants = initialPowerPlants.slice(1);
252
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(3).concat(initialPowerPlants), rng() + '');
253
+ }
254
+ else {
255
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.concat(initialPowerPlants), rng() + '');
256
+ }
257
+ powerPlantsDeck.unshift(first);
258
+ powerPlantsDeck.push(step3);
259
+ }
260
+ return { actualMarket, futureMarket, powerPlantsDeck };
261
+ },
262
+ mapSpecificRules: 'Coal storage: there is a separate storage space below the resource market, ' +
263
+ 'empty at game start. Coal used to power plants returns to this storage space ' +
264
+ '(not the main supply). The resource-market refill draws coal from storage ' +
265
+ 'first, then from the main supply. Players can always buy coal for $8 from ' +
266
+ 'the storage space (in addition to the standard market price). ' +
267
+ 'Metropolises: Cape Town, Durban, Johannesburg and Pretoria each consist of ' +
268
+ 'two cities (N and S) connected by a 0-cost edge. ' +
269
+ 'Cross-border connections: the six 30-Elektro connections to neighboring ' +
270
+ 'countries (Namibia, Botswana, Zimbabwe, Mozambique, Eswatini, Lesotho) are ' +
271
+ 'available from the start of the game. The 30 Elektro is the complete cost ' +
272
+ '— no house-base cost is added on top. Only a single player can build on ' +
273
+ 'each cross-border space (cap of 1 instead of the standard 3). ' +
274
+ 'Power plant 07 is removed from the deck.',
152
275
  };
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.map = exports.Cities = exports.Regions = void 0;
4
+ // by John and Cici
5
+ const lodash_1 = require("lodash");
6
+ const engine_1 = require("../engine");
7
+ const utils_1 = require("../utils");
8
+ const powerPlants_1 = require("./../powerPlants");
4
9
  var Regions;
5
10
  (function (Regions) {
6
11
  Regions["Red"] = "red";
@@ -56,46 +61,46 @@ var Cities;
56
61
  exports.map = {
57
62
  name: 'UK & Ireland',
58
63
  cities: [
59
- { name: Cities.Norwich, region: Regions.Red, x: 646, y: 702 },
60
- { name: Cities.London1, region: Regions.Red, x: 554, y: 756 },
61
- { name: Cities.London2, region: Regions.Red, x: 550, y: 780 },
62
- { name: Cities.Brighton, region: Regions.Red, x: 537, y: 837 },
63
- { name: Cities.Southampton, region: Regions.Red, x: 451, y: 805 },
64
- { name: Cities.Plymouth, region: Regions.Red, x: 312, y: 814 },
65
- { name: Cities.Leicester, region: Regions.Red, x: 540, y: 680 },
66
- { name: Cities.Bristol, region: Regions.Red, x: 425, y: 762 },
67
- { name: Cities.Newcastleupontyne, region: Regions.Pink, x: 550, y: 414 },
68
- { name: Cities.Leeds, region: Regions.Pink, x: 559, y: 541 },
69
- { name: Cities.Sheffield, region: Regions.Pink, x: 530, y: 590 },
70
- { name: Cities.Nottingham, region: Regions.Pink, x: 531, y: 632 },
71
- { name: Cities.Birmingham, region: Regions.Pink, x: 465, y: 663 },
72
- { name: Cities.Manchester, region: Regions.Pink, x: 479, y: 543 },
73
- { name: Cities.Liverpool, region: Regions.Pink, x: 433, y: 576 },
74
- { name: Cities.Newportcasnewydd, region: Regions.Yellow, x: 425, y: 722 },
75
- { name: Cities.Bangor, region: Regions.Yellow, x: 348, y: 574 },
76
- { name: Cities.Aberystwyth, region: Regions.Yellow, x: 357, y: 639 },
77
- { name: Cities.Swanseaabertawe, region: Regions.Yellow, x: 346, y: 706 },
78
- { name: Cities.Cardiffcaerdydd, region: Regions.Yellow, x: 357, y: 741 },
79
- { name: Cities.Haverfordwesthwlffordd, region: Regions.Yellow, x: 303, y: 673 },
80
- { name: Cities.Invernessinbhirnis, region: Regions.Brown, x: 479, y: 208 },
81
- { name: Cities.Aberdeenobardheathain, region: Regions.Brown, x: 588, y: 245 },
82
- { name: Cities.Dundeedundeach, region: Regions.Brown, x: 552, y: 286 },
83
- { name: Cities.Perthpeairt, region: Regions.Brown, x: 489, y: 307 },
84
- { name: Cities.Edinburgh, region: Regions.Brown, x: 494, y: 350 },
85
- { name: Cities.Dumfries, region: Regions.Brown, x: 441, y: 417 },
86
- { name: Cities.Glasgow, region: Regions.Brown, x: 422, y: 335 },
87
- { name: Cities.Coleraine, region: Regions.Orange, x: 330, y: 367 },
88
- { name: Cities.Derry, region: Regions.Orange, x: 256, y: 362 },
89
- { name: Cities.Belfast, region: Regions.Orange, x: 342, y: 421 },
90
- { name: Cities.Newry, region: Regions.Orange, x: 298, y: 462 },
91
- { name: Cities.Omagh, region: Regions.Orange, x: 260, y: 403 },
92
- { name: Cities.Sligo, region: Regions.Green, x: 181, y: 411 },
93
- { name: Cities.Dublin, region: Regions.Green, x: 274, y: 530 },
94
- { name: Cities.Waterford, region: Regions.Green, x: 210, y: 611 },
95
- { name: Cities.Cork, region: Regions.Green, x: 114, y: 626 },
96
- { name: Cities.Athlone, region: Regions.Green, x: 200, y: 489 },
97
- { name: Cities.Galway, region: Regions.Green, x: 112, y: 486 },
98
- { name: Cities.Limerick, region: Regions.Green, x: 122, y: 546 },
64
+ { name: Cities.Norwich, region: Regions.Red, island: 'gb', x: 646, y: 702 },
65
+ { name: Cities.London1, region: Regions.Red, island: 'gb', x: 554, y: 756 },
66
+ { name: Cities.London2, region: Regions.Red, island: 'gb', x: 550, y: 780 },
67
+ { name: Cities.Brighton, region: Regions.Red, island: 'gb', x: 537, y: 837 },
68
+ { name: Cities.Southampton, region: Regions.Red, island: 'gb', x: 451, y: 805 },
69
+ { name: Cities.Plymouth, region: Regions.Red, island: 'gb', x: 312, y: 814 },
70
+ { name: Cities.Leicester, region: Regions.Red, island: 'gb', x: 540, y: 680 },
71
+ { name: Cities.Bristol, region: Regions.Red, island: 'gb', x: 425, y: 762 },
72
+ { name: Cities.Newcastleupontyne, region: Regions.Pink, island: 'gb', x: 550, y: 414 },
73
+ { name: Cities.Leeds, region: Regions.Pink, island: 'gb', x: 559, y: 541 },
74
+ { name: Cities.Sheffield, region: Regions.Pink, island: 'gb', x: 530, y: 590 },
75
+ { name: Cities.Nottingham, region: Regions.Pink, island: 'gb', x: 531, y: 632 },
76
+ { name: Cities.Birmingham, region: Regions.Pink, island: 'gb', x: 465, y: 663 },
77
+ { name: Cities.Manchester, region: Regions.Pink, island: 'gb', x: 479, y: 543 },
78
+ { name: Cities.Liverpool, region: Regions.Pink, island: 'gb', x: 433, y: 576 },
79
+ { name: Cities.Newportcasnewydd, region: Regions.Yellow, island: 'gb', x: 425, y: 722 },
80
+ { name: Cities.Bangor, region: Regions.Yellow, island: 'gb', x: 348, y: 574 },
81
+ { name: Cities.Aberystwyth, region: Regions.Yellow, island: 'gb', x: 357, y: 639 },
82
+ { name: Cities.Swanseaabertawe, region: Regions.Yellow, island: 'gb', x: 346, y: 706 },
83
+ { name: Cities.Cardiffcaerdydd, region: Regions.Yellow, island: 'gb', x: 357, y: 741 },
84
+ { name: Cities.Haverfordwesthwlffordd, region: Regions.Yellow, island: 'gb', x: 303, y: 673 },
85
+ { name: Cities.Invernessinbhirnis, region: Regions.Brown, island: 'gb', x: 479, y: 208 },
86
+ { name: Cities.Aberdeenobardheathain, region: Regions.Brown, island: 'gb', x: 588, y: 245 },
87
+ { name: Cities.Dundeedundeach, region: Regions.Brown, island: 'gb', x: 552, y: 286 },
88
+ { name: Cities.Perthpeairt, region: Regions.Brown, island: 'gb', x: 489, y: 307 },
89
+ { name: Cities.Edinburgh, region: Regions.Brown, island: 'gb', x: 494, y: 350 },
90
+ { name: Cities.Dumfries, region: Regions.Brown, island: 'gb', x: 441, y: 417 },
91
+ { name: Cities.Glasgow, region: Regions.Brown, island: 'gb', x: 422, y: 335 },
92
+ { name: Cities.Coleraine, region: Regions.Orange, island: 'ie', x: 330, y: 367 },
93
+ { name: Cities.Derry, region: Regions.Orange, island: 'ie', x: 256, y: 362 },
94
+ { name: Cities.Belfast, region: Regions.Orange, island: 'ie', x: 342, y: 421 },
95
+ { name: Cities.Newry, region: Regions.Orange, island: 'ie', x: 298, y: 462 },
96
+ { name: Cities.Omagh, region: Regions.Orange, island: 'ie', x: 260, y: 403 },
97
+ { name: Cities.Sligo, region: Regions.Green, island: 'ie', x: 181, y: 411 },
98
+ { name: Cities.Dublin, region: Regions.Green, island: 'ie', x: 274, y: 530 },
99
+ { name: Cities.Waterford, region: Regions.Green, island: 'ie', x: 210, y: 611 },
100
+ { name: Cities.Cork, region: Regions.Green, island: 'ie', x: 114, y: 626 },
101
+ { name: Cities.Athlone, region: Regions.Green, island: 'ie', x: 200, y: 489 },
102
+ { name: Cities.Galway, region: Regions.Green, island: 'ie', x: 112, y: 486 },
103
+ { name: Cities.Limerick, region: Regions.Green, island: 'ie', x: 122, y: 546 },
99
104
  ],
100
105
  connections: [
101
106
  { nodes: [Cities.Nottingham, Cities.Leicester], cost: 4 },
@@ -173,4 +178,122 @@ exports.map = {
173
178
  { nodes: [Cities.Omagh, Cities.Derry], cost: 5 },
174
179
  { nodes: [Cities.Omagh, Cities.Sligo], cost: 10 },
175
180
  ],
181
+ layout: 'Portrait',
182
+ // Stub coords are at photo scale (x range ~110-650, y range ~200-840 — taller
183
+ // than wide). First-pass fit into the default portrait viewBox — tune after
184
+ // first render against the printed board.
185
+ adjustRatio: [1.1, 1.1],
186
+ mapPosition: [10, -75],
187
+ mapRotation: 0,
188
+ // Resupply table read from the printed UK & Ireland refill summary cards.
189
+ // Indexed [resource][playerCount-2][step-1]. Note: 2P and 3P rows are NOT
190
+ // identical on this map (unlike NA / SA), except for the Garbage row.
191
+ resupply: [
192
+ // Coal
193
+ [
194
+ [3, 4, 3],
195
+ [3, 5, 3],
196
+ [4, 6, 4],
197
+ [4, 7, 5],
198
+ [6, 8, 6], // 6P
199
+ ],
200
+ // Oil
201
+ [
202
+ [2, 3, 2],
203
+ [2, 4, 2],
204
+ [3, 5, 3],
205
+ [4, 6, 4],
206
+ [5, 7, 5], // 6P
207
+ ],
208
+ // Garbage
209
+ [
210
+ [1, 2, 2],
211
+ [1, 2, 2],
212
+ [2, 3, 3],
213
+ [3, 3, 5],
214
+ [3, 5, 5], // 6P
215
+ ],
216
+ // Uranium
217
+ [
218
+ [1, 1, 1],
219
+ [1, 2, 1],
220
+ [1, 3, 1],
221
+ [2, 4, 2],
222
+ [2, 4, 3], // 6P
223
+ ],
224
+ ],
225
+ // Standard 8-price market (no overrides). Starting fill from the rulebook:
226
+ // coal 1-8 full = 24
227
+ // oil 3-8 = 18
228
+ // garbage 5-8 = 12
229
+ // uranium none = 0
230
+ startingResources: [24, 18, 12, 0],
231
+ startingSupply: [24, 24, 24, 12],
232
+ // Two-network mechanic: 20 Elektro surcharge to start a network on an
233
+ // island where the player has no city. The cross-island build skips the
234
+ // dijkstra path (there is no sea edge) and pays house base + 20.
235
+ crossIslandSurcharge: 20,
236
+ // Step 3 is placed 3rd from last in the deck (two plants below it) so Step
237
+ // 3 starts earlier than on most maps. Otherwise standard recharged/original
238
+ // deck prep.
239
+ setupDeck(numPlayers, variant, rng) {
240
+ let powerPlantsDeck = lodash_1.cloneDeep(powerPlants_1.powerPlants);
241
+ let actualMarket;
242
+ let futureMarket;
243
+ if (variant == 'original') {
244
+ powerPlantsDeck = powerPlantsDeck.slice(8);
245
+ const powerPlant13Idx = powerPlantsDeck.findIndex((pp) => pp.number == 13);
246
+ const powerPlant13 = powerPlantsDeck.splice(powerPlant13Idx, 1)[0];
247
+ const step3 = powerPlantsDeck.pop();
248
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck, rng() + '');
249
+ if (numPlayers == 2 || numPlayers == 3) {
250
+ powerPlantsDeck = powerPlantsDeck.slice(8);
251
+ }
252
+ else if (numPlayers == 4) {
253
+ powerPlantsDeck = powerPlantsDeck.slice(4);
254
+ }
255
+ powerPlantsDeck.unshift(powerPlant13);
256
+ // UK&I: Step 3 sits 3rd from last (two plants below it).
257
+ powerPlantsDeck.splice(powerPlantsDeck.length - 2, 0, step3);
258
+ actualMarket = [engine_1.getPowerPlant(3), engine_1.getPowerPlant(4), engine_1.getPowerPlant(5), engine_1.getPowerPlant(6)];
259
+ futureMarket = [engine_1.getPowerPlant(7), engine_1.getPowerPlant(8), engine_1.getPowerPlant(9), engine_1.getPowerPlant(10)];
260
+ }
261
+ else {
262
+ let initialPowerPlants = utils_1.shuffle(powerPlantsDeck.splice(0, 13), rng() + '');
263
+ let initialPlantMarket = initialPowerPlants.splice(0, 8);
264
+ initialPlantMarket = initialPlantMarket.sort((a, b) => a.number - b.number);
265
+ actualMarket = initialPlantMarket.slice(0, 4);
266
+ futureMarket = initialPlantMarket.slice(4);
267
+ const first = initialPowerPlants.shift();
268
+ const step3 = powerPlantsDeck.pop();
269
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck, rng() + '');
270
+ if (numPlayers == 2 || numPlayers == 3) {
271
+ initialPowerPlants = initialPowerPlants.slice(2);
272
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(6).concat(initialPowerPlants), rng() + '');
273
+ }
274
+ else if (numPlayers == 4) {
275
+ initialPowerPlants = initialPowerPlants.slice(1);
276
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.slice(3).concat(initialPowerPlants), rng() + '');
277
+ }
278
+ else {
279
+ powerPlantsDeck = utils_1.shuffle(powerPlantsDeck.concat(initialPowerPlants), rng() + '');
280
+ }
281
+ powerPlantsDeck.unshift(first);
282
+ // UK&I: Step 3 sits 3rd from last (two plants below it). The engine's
283
+ // standard Step 3 trigger already reshuffles plants below + discard
284
+ // into the new face-down deck, so we only need the placement here.
285
+ powerPlantsDeck.splice(powerPlantsDeck.length - 2, 0, step3);
286
+ }
287
+ return { actualMarket, futureMarket, powerPlantsDeck };
288
+ },
289
+ mapSpecificRules: 'Two networks: Ireland (Green and Orange regions) and Great Britain ' +
290
+ '(Red, Pink, Yellow, Brown) have no sea connection. A player may run ' +
291
+ 'one network on each island. Starting a second network on the other ' +
292
+ 'island costs an extra 20 Elektro on top of the normal first-house cost. ' +
293
+ 'Nuclear restriction: a player whose network is entirely in the Republic ' +
294
+ 'of Ireland (Green region) cannot bid on or auction a nuclear power plant ' +
295
+ 'until they build a city in Scotland, Wales, England, or Northern Ireland. ' +
296
+ 'Early Step 3: the Step 3 card is placed 3rd from last in the deck (two ' +
297
+ 'plants below it). Step 2 begins when a player connects their 7th city ' +
298
+ '(6th for 6 players).',
176
299
  };