implement cost formula for asteroid expansion
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
#include "BuilderModeExitedEvent.h"
|
||||
#include "BlueprintModeExitedEvent.h"
|
||||
#include "BuildingBlocksChangedEvent.h"
|
||||
#include "ExpansionCostChangedEvent.h"
|
||||
#include "GameSpeedChangedEvent.h"
|
||||
#include "SchematicChoicesAvailableEvent.h"
|
||||
#include "TickAdvancedEvent.h"
|
||||
@@ -276,6 +277,7 @@ void GameWorldView::onFrame()
|
||||
{
|
||||
const Tick newTick = m_sim->currentTick();
|
||||
const int newBlocks = m_sim->buildingBlocksStock();
|
||||
const int newExpCost = m_sim->currentExpansionCost();
|
||||
const int newBoss = m_sim->bossWaveCounter();
|
||||
const Tick newCountdown = m_sim->bossCountdownTicks();
|
||||
|
||||
@@ -291,6 +293,12 @@ void GameWorldView::onFrame()
|
||||
EventManager::getInstance()->sendEventImmediately(
|
||||
std::make_shared<BuildingBlocksChangedEvent>(newBlocks));
|
||||
}
|
||||
if (newExpCost != m_lastExpansionCost)
|
||||
{
|
||||
m_lastExpansionCost = newExpCost;
|
||||
EventManager::getInstance()->sendEventImmediately(
|
||||
std::make_shared<ExpansionCostChangedEvent>(newExpCost));
|
||||
}
|
||||
if (newBoss != m_lastBossCounter || newCountdown != m_lastBossCountdown)
|
||||
{
|
||||
m_lastBossCounter = newBoss;
|
||||
@@ -435,7 +443,7 @@ QRect GameWorldView::viewportRect() const
|
||||
|
||||
float GameWorldView::asteroidLeftEdge() const
|
||||
{
|
||||
float leftX = -static_cast<float>(m_config->world.regions.asteroidWidth_tiles);
|
||||
float leftX = -static_cast<float>(m_sim->currentAsteroidWidth_tiles());
|
||||
for (const Building& b : m_sim->buildings().allBuildings())
|
||||
{
|
||||
for (const QPoint& cell : b.bodyCells)
|
||||
@@ -1827,6 +1835,7 @@ void GameWorldView::resetForNewGame()
|
||||
m_prevNonZeroSpeed = 1.0;
|
||||
m_lastTick = Tick(-1);
|
||||
m_lastBlocks = -1;
|
||||
m_lastExpansionCost = -1;
|
||||
m_lastBossCounter = -1;
|
||||
m_lastBossCountdown = Tick(-1);
|
||||
m_lastArtifactCount = -1;
|
||||
|
||||
Reference in New Issue
Block a user