mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 20:43:04 +01:00
Part of #13874: Replace pricing tables
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/world/Park.h>
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
static constexpr const rct_string_id WINDOW_TITLE = STR_NONE;
|
||||
constexpr size_t AVAILABILITY_STRING_SIZE = 256;
|
||||
static constexpr const int32_t WH = 382;
|
||||
@@ -943,7 +945,8 @@ static void window_new_ride_paint_ride_information(
|
||||
// Get price of ride
|
||||
int32_t unk2 = GetRideTypeDescriptor(item.Type).StartTrackPiece;
|
||||
money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[unk2];
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(unk2);
|
||||
price *= teDescriptor.Pricing;
|
||||
price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier;
|
||||
|
||||
//
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "../ride/RideData.h"
|
||||
#include "../ride/TrackData.h"
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
MazePlaceTrackAction::MazePlaceTrackAction(const CoordsXYZ& location, NetworkRideId_t rideIndex, uint16_t mazeEntry)
|
||||
: _loc(location)
|
||||
, _rideIndex(rideIndex)
|
||||
@@ -113,7 +115,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const
|
||||
return res;
|
||||
}
|
||||
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze);
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16));
|
||||
res->Cost = canBuild->Cost + price / 2 * 10;
|
||||
|
||||
return res;
|
||||
@@ -154,7 +157,8 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const
|
||||
return canBuild;
|
||||
}
|
||||
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze);
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16));
|
||||
res->Cost = canBuild->Cost + price / 2 * 10;
|
||||
|
||||
auto startLoc = _loc.ToTileStart();
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "../world/Footpath.h"
|
||||
#include "../world/Park.h"
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
MazeSetTrackAction::MazeSetTrackAction(
|
||||
const CoordsXYZD& location, bool initialPlacement, NetworkRideId_t rideIndex, uint8_t mode)
|
||||
: _loc(location)
|
||||
@@ -134,7 +136,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const
|
||||
return res;
|
||||
}
|
||||
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze);
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16));
|
||||
res->Cost = price / 2 * 10;
|
||||
|
||||
return res;
|
||||
@@ -169,7 +172,8 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const
|
||||
auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(TrackElemType::Maze);
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * teDescriptor.Pricing) >> 16));
|
||||
res->Cost = price / 2 * 10;
|
||||
|
||||
auto startLoc = _loc.ToTileStart();
|
||||
|
||||
@@ -368,7 +368,8 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
||||
}
|
||||
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[_trackType];
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(_trackType);
|
||||
price *= teDescriptor.Pricing;
|
||||
|
||||
price >>= 16;
|
||||
res->Cost = cost + ((price / 2) * 10);
|
||||
@@ -656,7 +657,8 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
||||
}
|
||||
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[_trackType];
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(_trackType);
|
||||
price *= teDescriptor.Pricing;
|
||||
|
||||
price >>= 16;
|
||||
res->Cost = cost + ((price / 2) * 10);
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "../world/Surface.h"
|
||||
#include "RideSetSettingAction.h"
|
||||
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
TrackRemoveAction::TrackRemoveAction(track_type_t trackType, int32_t sequence, const CoordsXYZD& origin)
|
||||
: _trackType(trackType)
|
||||
, _sequence(sequence)
|
||||
@@ -226,7 +228,8 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const
|
||||
}
|
||||
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[trackType];
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(trackType);
|
||||
price *= teDescriptor.Pricing;
|
||||
price >>= 16;
|
||||
price = (price + cost) / 2;
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)
|
||||
@@ -473,7 +476,8 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
||||
}
|
||||
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[trackType];
|
||||
const auto& teDescriptor = GetTrackElementDescriptor(trackType);
|
||||
price *= teDescriptor.Pricing;
|
||||
price >>= 16;
|
||||
price = (price + cost) / 2;
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)
|
||||
|
||||
@@ -3774,7 +3774,7 @@ const static track_type_t AlternativeTrackTypes[TrackElemType::Count] = {
|
||||
};
|
||||
|
||||
/** rct2: 0x0099DA34 */
|
||||
const money32 TrackPricing[TrackElemType::Count] = {
|
||||
const static money32 TrackPricing[TrackElemType::Count] = {
|
||||
65536, // TrackElemType::Flat
|
||||
98304, // TrackElemType::EndStation
|
||||
98304, // TrackElemType::BeginStation
|
||||
|
||||
@@ -40,8 +40,6 @@ struct track_descriptor
|
||||
|
||||
extern const track_descriptor gTrackDescriptors[142];
|
||||
|
||||
extern const money32 TrackPricing[TrackElemType::Count];
|
||||
|
||||
struct dodgems_track_size
|
||||
{
|
||||
uint8_t left;
|
||||
|
||||
Reference in New Issue
Block a user