implement cost formula for asteroid expansion

This commit is contained in:
2026-07-04 15:28:19 +02:00
parent fc622670d2
commit e8786c3922
17 changed files with 141 additions and 15 deletions

View File

@@ -72,6 +72,12 @@ public:
// The seed this run was (re)initialized with; written to the replay header.
unsigned int getSeed() const;
int buildingBlocksStock() const;
// Current asteroid width in tiles = base width + purchased expansions
// (REQ-EXP-UNLOCK, REQ-GW-ASTEROID-EXPAND).
int currentAsteroidWidth_tiles() const;
// Building block cost of the next expansion, floored to an integer
// (REQ-EXP-COST); x = number of expansions already purchased.
int currentExpansionCost() const;
bool isGameOver() const;
bool isWon() const;
int artifactCount() const;
@@ -136,6 +142,11 @@ private:
// Clears the pending choices after application.
void applySchematicChoice(int choiceIndex);
// Unlocks one asteroid expansion if affordable (REQ-EXP-UNLOCK): checks the
// current cost against the stock, deducts it, increments the expansion
// counter, and widens the buildable asteroid. No-op if blocks are short.
void tryExpandAsteroid();
// Mutable subsystem accessors; same chokepoint rule as the mutators above.
BuildingSystem& buildingsMutable();
BeltSystem& beltsMutable();
@@ -165,6 +176,7 @@ private:
Tick m_nextDepartureTick;
BuildingId m_nextBuildingId;
int m_buildingBlocksStock;
int m_expansionsPurchased = 0; // REQ-EXP-COST formula variable x
bool m_gameOver = false;
bool m_isWon = false;
int m_artifactCount = 0;