feat: add notification for buildings sold due to insufficient gold
Handle 'buildingSold' events to inform players when their buildings are automatically sold to cover upkeep costs, displaying the building name and city where the sale occurred.
This commit is contained in:
parent
93b4877c2d
commit
79c18c595e
|
|
@ -1483,6 +1483,11 @@ export default class CivilizationGame extends Phaser.Scene {
|
|||
});
|
||||
},
|
||||
});
|
||||
} else if (e.type === 'buildingSold' && e.civ === human) {
|
||||
const city = Logic.cityById(this.state, e.cityId);
|
||||
const building = this.rules.buildings[e.building];
|
||||
if (!city || !building) continue;
|
||||
this.announceStatus(`Not enough gold! ${building.name} in ${city.name} was sold to cover upkeep.`);
|
||||
} else if (e.type === 'spaceshipPart' && e.civ === human) {
|
||||
const city = Logic.cityById(this.state, e.cityId);
|
||||
const part = this.rules.units[e.part];
|
||||
|
|
|
|||
Loading…
Reference in New Issue