powergrid-viewer 2.0.11 → 2.0.12
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/package.json
CHANGED
package/src/components/Game.vue
CHANGED
|
@@ -642,6 +642,11 @@
|
|
|
642
642
|
Starts after building phase where a player has
|
|
643
643
|
<strong>{{ G.citiesToStep2 }}</strong> or more cities
|
|
644
644
|
</li>
|
|
645
|
+
<li v-if="G.map.name !== 'Middle East'">
|
|
646
|
+
Also starts after a building phase where <strong>every city</strong> has a house
|
|
647
|
+
(all Step 1 slots filled), even if no player reached
|
|
648
|
+
{{ G.citiesToStep2 }}
|
|
649
|
+
</li>
|
|
645
650
|
<li><strong>Two</strong> players per city</li>
|
|
646
651
|
<li>
|
|
647
652
|
Resource Resupply: <strong>{{ G.resourceResupply[1] }}</strong>
|
|
@@ -1148,7 +1153,8 @@ export default class Game extends Vue {
|
|
|
1148
1153
|
const player = this.G.players[this.player];
|
|
1149
1154
|
if (player && player.availableMoves && Object.keys(player.availableMoves).length > 1) {
|
|
1150
1155
|
if (this.G.phase == Phase.Bureaucracy && player.powerPlantsNotUsed.length > 0
|
|
1151
|
-
&& Object.keys(player.availableMoves).includes('UsePowerPlant')
|
|
1156
|
+
&& Object.keys(player.availableMoves).includes('UsePowerPlant')
|
|
1157
|
+
&& !this.canPowerAllCitiesWithUsedPlants(player)) {
|
|
1152
1158
|
this.confirmMessage = 'Are you sure you want to pass? You have unused power plants!';
|
|
1153
1159
|
this.confirmVisible = true;
|
|
1154
1160
|
return;
|
|
@@ -1815,6 +1821,14 @@ export default class Game extends Vue {
|
|
|
1815
1821
|
}
|
|
1816
1822
|
}
|
|
1817
1823
|
|
|
1824
|
+
// Whether the power plants the player has already used this Bureaucracy
|
|
1825
|
+
// phase can cover every city they own — if so, the unused plants are
|
|
1826
|
+
// surplus and passing without them is not worth a warning.
|
|
1827
|
+
canPowerAllCitiesWithUsedPlants(player: Player): boolean {
|
|
1828
|
+
const usedPlants = player.powerPlants.filter((p) => !player.powerPlantsNotUsed.includes(p.number));
|
|
1829
|
+
return usedPlants.reduce((sum, p) => sum + p.citiesPowered, 0) >= player.cities.length;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1818
1832
|
canPowerAllPlants(player: Player): boolean {
|
|
1819
1833
|
// Calculate total resource requirements for all power plants
|
|
1820
1834
|
let coalUsed = 0;
|