Skip to content

Commit

Permalink
Merge pull request #1058 from OutpostUniverse/PrepForV085
Browse files Browse the repository at this point in the history
Prep for v085
  • Loading branch information
ldicker83 authored Sep 27, 2021
2 parents 9345b14 + 62193db commit 814df54
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 42 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# Change Log
This is the changelog for OutpostHD.

## [0.8.5] - 2021-09-26

Introduces integrity decay and the Maintenance Facility.

### Added
- Maintenance Facility
- Structure Integrity & Decay
- Criminal Activity

### Changed
- Structures will now slowly lose integrity (decay) over time
- Decayed roads will negatively affect route traversal times
- Maintenance Facility required to repair decaying buildings
- Improved descriptions of criminal activity
- Adjusted cost of structures to make it a little less punishing

### Fixed
- Factories will no longer push new products into warehouses that aren't operational
- Fixed misreported warehouse usage in full-screen warehouse UI
- Fixed display of tilemap overlays being cleared when turns are run
- Fixed a mistake in route cost calculation that caused extremely low movement of resources
- Fixed an issue that made it impossible to place robots before the Command Center was built
- Fixed an issue that caused roads to be set to an incorrect animation state during loading
- Fixed an issue where the "Take Me There" button on the Notification Window failed to set the tilemap depth


## [0.8.3] - 2021-06-6

Introduces the NotificationArea UI element to inform users of non-critical issues or notifications that don't interrupt gameplay and the user can look at and respond to at their leisure.
Expand Down
2 changes: 1 addition & 1 deletion OPHD/Constants/Strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace constants
// =====================================
// = MISCELLANEOUS
// =====================================
const std::string Version = "v0.8.3";
const std::string Version = "v0.8.5";
const std::string EmptyString = ""; /**< Used in a few places to return an empty string without having to create one. */

const std::string TileBulldozed = "Bulldozed";
Expand Down
3 changes: 3 additions & 0 deletions OPHD/States/CrimeExecution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void CrimeExecution::stealFood(FoodProduction& structure)
"Food Stolen",
NAS2D::stringFrom(foodStolen) + " units of food was pilfered from a " + structure.name() + ". " + getReasonForStealing() + ".",
structureTile.position(),
structureTile.depth(),
NotificationArea::NotificationType::Warning);
}
}
Expand Down Expand Up @@ -100,6 +101,7 @@ void CrimeExecution::stealResources(Structure& structure, const std::array<std::
"Resources Stolen",
NAS2D::stringFrom(amountStolen) + " units of " + resourceNames[indexToStealFrom] + " were stolen from a " + structure.name() + ". " + getReasonForStealing() + ".",
structureTile.position(),
structureTile.depth(),
NotificationArea::NotificationType::Warning);
}

Expand All @@ -114,6 +116,7 @@ void CrimeExecution::vandalize(Structure& structure)
"Vandalism",
"A " + structure.name() + " was vandalized.",
structureTile.position(),
structureTile.depth(),
NotificationArea::NotificationType::Warning);
}

Expand Down
11 changes: 8 additions & 3 deletions OPHD/States/MapViewState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static NAS2D::Rectangle<int> buildAreaRectFromTile(const Tile& centerTile, int r
}


static void pushAgingRobotMessage(const Robot* robot, const Point<int> position, NotificationArea& notificationArea)
static void pushAgingRobotMessage(const Robot* robot, const Point<int> position, int depth, NotificationArea& notificationArea)
{
const auto robotLocationText = "(" + std::to_string(position.x) + ", " + std::to_string(position.y) + ")";

Expand All @@ -97,6 +97,7 @@ static void pushAgingRobotMessage(const Robot* robot, const Point<int> position,
"Aging Robot",
"Robot '" + robot->name() + "' at location " + robotLocationText + " is approaching its maximum age.",
position,
depth,
NotificationArea::NotificationType::Warning);
}
else if (robot->fuelCellAge() == 195) /// \fixme magic number
Expand All @@ -105,6 +106,7 @@ static void pushAgingRobotMessage(const Robot* robot, const Point<int> position,
"Aging Robot",
"Robot '" + robot->name() + "' at location " + robotLocationText + " will fail in a few turns. Replace immediately.",
position,
depth,
NotificationArea::NotificationType::Critical);
}
}
Expand Down Expand Up @@ -1326,7 +1328,9 @@ void MapViewState::updateRobots()
robot->update();

const auto position = tile->position();
pushAgingRobotMessage(robot, position, mNotificationArea);
const auto depth = tile->depth();

pushAgingRobotMessage(robot, position, depth, mNotificationArea);

if (robot->dead())
{
Expand All @@ -1340,12 +1344,13 @@ void MapViewState::updateRobots()
"Robot Self-Destructed",
robot->name() + " at location " + robotLocationText + " self destructed.",
position,
depth,
NotificationArea::NotificationType::Critical);
}
else if (robot->type() != Robot::Type::Miner)
{
const auto text = "Your " + robot->name() + " at location " + robotLocationText + " has broken down. It will not be able to complete its task and will be removed from your inventory.";
mNotificationArea.push("Robot Broke Down", text, position, NotificationArea::NotificationType::Critical);
mNotificationArea.push("Robot Broke Down", text, position, depth, NotificationArea::NotificationType::Critical);
resetTileIndexFromDozer(robot, tile);
}

Expand Down
2 changes: 1 addition & 1 deletion OPHD/States/MapViewState.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class MapViewState : public Wrapper

void onFileIoAction(const std::string& filePath, FileIo::FileOperation fileOp);

void onNotificationWindowTakeMeThere(NAS2D::Point<int> position);
void onNotificationWindowTakeMeThere(NAS2D::Point<int> position, int depth);

private:
MainReportsUiState& mMainReportsState;
Expand Down
15 changes: 12 additions & 3 deletions OPHD/States/MapViewStateTurn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ void MapViewState::updateMorale()
"Baby Born",
std::to_string(birthCount) + (birthCount > 1 ? " babies were born." : " baby was born."),
{-1, -1},
0,
NotificationArea::NotificationType::Information);
}

Expand All @@ -246,6 +247,7 @@ void MapViewState::updateMorale()
"Colonist Died",
std::to_string(deathCount) + (birthCount > 1 ? " colonists met their demise." : " colonist met their demise."),
{-1, -1},
0,
NotificationArea::NotificationType::Warning);
}
}
Expand Down Expand Up @@ -530,20 +532,24 @@ void MapViewState::checkAgingStructures()

for (auto structure : structures)
{
const auto& structureTile = NAS2D::Utility<StructureManager>::get().tileFromStructure(structure);

if (structure->age() == structure->maxAge() - 10)
{
mNotificationArea.push(
"Aging Structure",
structure->name() + " is getting old. You should replace it soon.",
NAS2D::Utility<StructureManager>::get().tileFromStructure(structure).position(),
structureTile.position(),
structureTile.depth(),
NotificationArea::NotificationType::Warning);
}
else if (structure->age() == structure->maxAge() - 5)
{
mNotificationArea.push(
"Aging Structure",
structure->name() + " is about to collapse. You should replace it right away or consider demolishing it.",
NAS2D::Utility<StructureManager>::get().tileFromStructure(structure).position(),
structureTile.position(),
structureTile.depth(),
NotificationArea::NotificationType::Critical);
}
}
Expand All @@ -556,10 +562,13 @@ void MapViewState::checkNewlyBuiltStructures()

for (auto structure : structures)
{
const auto& structureTile = NAS2D::Utility<StructureManager>::get().tileFromStructure(structure);

mNotificationArea.push(
"Construction Finished",
structure->name() + " completed construction.",
NAS2D::Utility<StructureManager>::get().tileFromStructure(structure).position(),
structureTile.position(),
structureTile.depth(),
NotificationArea::NotificationType::Information);
}
}
Expand Down
3 changes: 2 additions & 1 deletion OPHD/States/MapViewStateUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,10 @@ void MapViewState::onFileIoAction(const std::string& filePath, FileIo::FileOpera
}


void MapViewState::onNotificationWindowTakeMeThere(NAS2D::Point<int> position)
void MapViewState::onNotificationWindowTakeMeThere(NAS2D::Point<int> position, int depth)
{
mTileMap->centerMapOnTile(&mTileMap->getTile(position));
mTileMap->currentDepth(depth);
}


Expand Down
46 changes: 23 additions & 23 deletions OPHD/StructureCatalogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,34 +262,34 @@ bool StructureCatalogue::canBuild(const StorableResources& source, StructureID t
void StructureCatalogue::buildCostTable()
{
// RESOURCES: CommonMetals | CommonMinerals | RareMetals | RareMinerals
mStructureCostTable[StructureID::SID_AGRIDOME] = {20, 10, 5, 0};
mStructureCostTable[StructureID::SID_CHAP] = {50, 10, 20, 5};
mStructureCostTable[StructureID::SID_AGRIDOME] = {12, 10, 2, 2};
mStructureCostTable[StructureID::SID_CHAP] = {25, 10, 10, 5};
mStructureCostTable[StructureID::SID_COMMAND_CENTER] = {100, 75, 65, 35};
mStructureCostTable[StructureID::SID_COMMERCIAL] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_COMM_TOWER] = {30, 10, 5, 5};
mStructureCostTable[StructureID::SID_FUSION_REACTOR] = {75, 25, 50, 30};
mStructureCostTable[StructureID::SID_HOT_LABORATORY] = {45, 10, 15, 5};
mStructureCostTable[StructureID::SID_COMMERCIAL] = {15, 8, 5, 2};
mStructureCostTable[StructureID::SID_COMM_TOWER] = {10, 5, 5, 3};
mStructureCostTable[StructureID::SID_FUSION_REACTOR] = {50, 30, 25, 15};
mStructureCostTable[StructureID::SID_HOT_LABORATORY] = {30, 10, 15, 5};
mStructureCostTable[StructureID::SID_LABORATORY] = {20, 10, 10, 5};
mStructureCostTable[StructureID::SID_MAINTENANCE_FACILITY] = {15, 10, 2, 1};
mStructureCostTable[StructureID::SID_MEDICAL_CENTER] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_NURSERY] = {20, 10, 5, 0};
mStructureCostTable[StructureID::SID_PARK] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_SURFACE_POLICE] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_UNDERGROUND_POLICE] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_RECREATION_CENTER] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_RECYCLING] = {20, 10, 8, 3};
mStructureCostTable[StructureID::SID_RED_LIGHT_DISTRICT] = {20, 5, 2, 0};
mStructureCostTable[StructureID::SID_RESIDENCE] = {25, 5, 2, 0};
mStructureCostTable[StructureID::SID_MEDICAL_CENTER] = {15, 5, 5, 3};
mStructureCostTable[StructureID::SID_NURSERY] = {15, 5, 5, 3};
mStructureCostTable[StructureID::SID_PARK] = {10, 10, 3, 2};
mStructureCostTable[StructureID::SID_SURFACE_POLICE] = {15, 5, 8, 2};
mStructureCostTable[StructureID::SID_UNDERGROUND_POLICE] = {15, 5, 8, 2};
mStructureCostTable[StructureID::SID_RECREATION_CENTER] = {20, 5, 2, 0};
mStructureCostTable[StructureID::SID_RECYCLING] = {15, 10, 8, 3};
mStructureCostTable[StructureID::SID_RED_LIGHT_DISTRICT] = {20, 10, 10, 3};
mStructureCostTable[StructureID::SID_RESIDENCE] = {15, 5, 2, 0};
mStructureCostTable[StructureID::SID_ROAD] = {10, 15, 0, 0};
mStructureCostTable[StructureID::SID_ROBOT_COMMAND] = {75, 50, 45, 25};
mStructureCostTable[StructureID::SID_ROBOT_COMMAND] = {35, 20, 25, 10};
mStructureCostTable[StructureID::SID_SMELTER] = {30, 20, 10, 5};
mStructureCostTable[StructureID::SID_SOLAR_PANEL1] = {10, 20, 5, 5};
mStructureCostTable[StructureID::SID_SOLAR_PLANT] = {50, 25, 50, 20};
mStructureCostTable[StructureID::SID_STORAGE_TANKS] = {15, 5, 6, 1};
mStructureCostTable[StructureID::SID_SURFACE_FACTORY] = {20, 10, 10, 5};
mStructureCostTable[StructureID::SID_UNDERGROUND_FACTORY] = {20, 10, 10, 5};
mStructureCostTable[StructureID::SID_STORAGE_TANKS] = {10, 5, 6, 1};
mStructureCostTable[StructureID::SID_SURFACE_FACTORY] = {25, 10, 10, 5};
mStructureCostTable[StructureID::SID_UNDERGROUND_FACTORY] = {25, 10, 10, 5};
mStructureCostTable[StructureID::SID_UNIVERSITY] = {20, 10, 10, 5};
mStructureCostTable[StructureID::SID_WAREHOUSE] = {15, 5, 6, 1};
mStructureCostTable[StructureID::SID_WAREHOUSE] = {10, 8, 5, 5};
}


Expand Down Expand Up @@ -331,16 +331,16 @@ void StructureCatalogue::buildPopulationRequirementsTable()
mPopulationRequirementsTable[StructureID::SID_MEDICAL_CENTER] = {1, 2};
mPopulationRequirementsTable[StructureID::SID_NURSERY] = {1, 1};
mPopulationRequirementsTable[StructureID::SID_PARK] = {1, 0};
mPopulationRequirementsTable[StructureID::SID_SURFACE_POLICE] = {5, 0};
mPopulationRequirementsTable[StructureID::SID_UNDERGROUND_POLICE] = {5, 0};
mPopulationRequirementsTable[StructureID::SID_SURFACE_POLICE] = {3, 0};
mPopulationRequirementsTable[StructureID::SID_UNDERGROUND_POLICE] = {3, 0};
mPopulationRequirementsTable[StructureID::SID_RECREATION_CENTER] = {2, 0};
mPopulationRequirementsTable[StructureID::SID_RECYCLING] = {1, 1};
mPopulationRequirementsTable[StructureID::SID_RED_LIGHT_DISTRICT] = {2, 0};
mPopulationRequirementsTable[StructureID::SID_ROBOT_COMMAND] = {4, 0};
mPopulationRequirementsTable[StructureID::SID_SEED_FACTORY] = {2, 0};
mPopulationRequirementsTable[StructureID::SID_SEED_SMELTER] = {2, 0};
mPopulationRequirementsTable[StructureID::SID_SMELTER] = {4, 0};
mPopulationRequirementsTable[StructureID::SID_SOLAR_PANEL1] = {1, 0};
mPopulationRequirementsTable[StructureID::SID_SOLAR_PANEL1] = {0, 0};
mPopulationRequirementsTable[StructureID::SID_SURFACE_FACTORY] = {4, 0};
mPopulationRequirementsTable[StructureID::SID_UNDERGROUND_FACTORY] = {2, 0};
mPopulationRequirementsTable[StructureID::SID_UNIVERSITY] = {1, 3};
Expand Down
4 changes: 2 additions & 2 deletions OPHD/UI/NotificationArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ NotificationArea::~NotificationArea()
}


void NotificationArea::push(const std::string& brief, const std::string& message, NAS2D::Point<int> position, NotificationType type)
void NotificationArea::push(const std::string& brief, const std::string& message, NAS2D::Point<int> position, int depth, NotificationType type)
{
mNotificationList.emplace_back(Notification{brief, message, position, type});
mNotificationList.emplace_back(Notification{brief, message, position, depth, type});

const int posX = positionX() + (Width / 2) - 16;
const int posY = positionY() + size().y - (Offset * static_cast<int>(mNotificationList.size()));
Expand Down
3 changes: 2 additions & 1 deletion OPHD/UI/NotificationArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class NotificationArea : public Control
std::string brief{""};
std::string message{""};
NAS2D::Point<int> position{-1, -1};
int depth{0};
NotificationType type{NotificationType::Information};
};

Expand All @@ -38,7 +39,7 @@ class NotificationArea : public Control
NotificationArea();
~NotificationArea() override;

void push(const std::string& brief, const std::string& message, NAS2D::Point<int> position, NotificationType type);
void push(const std::string& brief, const std::string& message, NAS2D::Point<int> position, int depth, NotificationType type);

void clear()
{
Expand Down
2 changes: 1 addition & 1 deletion OPHD/UI/NotificationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void NotificationWindow::btnOkayClicked()

void NotificationWindow::btnTakeMeThereClicked()
{
mTakeMeThereClicked(mNotification.position);
mTakeMeThereClicked(mNotification.position, mNotification.depth);
hide();
}

Expand Down
2 changes: 1 addition & 1 deletion OPHD/UI/NotificationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class NotificationWindow : public Window
{
public:
using Signal = NAS2D::Signal<NAS2D::Point<int>>;
using Signal = NAS2D::Signal<NAS2D::Point<int>, int>;

public:
NotificationWindow();
Expand Down
2 changes: 1 addition & 1 deletion OPHD/UI/StructureInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ StructureInspector::StructureInspector() :
btnClose{"Close", {this, &StructureInspector::onClose}},
mIcons{imageCache.load("ui/icons.png")}
{
size({350, 240});
size({350, 250});

btnClose.size({50, 20});
add(btnClose, {rect().width - btnClose.rect().width - 5, rect().height - btnClose.rect().height - 5,});
Expand Down
8 changes: 4 additions & 4 deletions OPHD/ophd.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ IDI_ICON1 ICON "outpost.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,8,3,0
PRODUCTVERSION 0,8,3,0
FILEVERSION 0,8,5,0
PRODUCTVERSION 0,8,5,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "LairWorks Entertainment, LLC"
VALUE "FileDescription", "OutpostHD"
VALUE "FileVersion", "0.8.3.0"
VALUE "FileVersion", "0.8.5.0"
VALUE "InternalName", "OutpostHD"
VALUE "LegalCopyright", "Copyright � 2015 - 2021, Leeor Dicker"
VALUE "OriginalFilename", "OPHD.EXE"
VALUE "ProductName", "OutpostHD"
VALUE "ProductVersion", "0.8.3.0"
VALUE "ProductVersion", "0.8.5.0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 814df54

Please sign in to comment.