Merge pull request #25020 from AaronVanGeffen/scenario-split

Split Scenario headers into smaller headers
This commit is contained in:
Tulio Leao authored and GitHub committed 2025-08-23 06:15:09 -03:00
commit 488d6f7a0d
56 files changed
+913 -770

No files matched your search

@@ -24,6 +24,7 @@
#include <openrct2/platform/Platform.h>
#include <openrct2/rct2/T6Exporter.h>
#include <openrct2/ride/TrackDesign.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/ui/UiContext.h>
#include <openrct2/ui/WindowManager.h>
#include <openrct2/windows/Intent.h>
+7 -7
View File
@@ -14,7 +14,7 @@
#include <openrct2/localisation/Localisation.Date.h>
#include <openrct2/ride/Ride.h>
#include <openrct2/ride/RideData.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/scenario/ScenarioObjective.h>
namespace OpenRCT2::Ui
{
@@ -33,9 +33,9 @@ namespace OpenRCT2::Ui
STR_OBJECTIVE_MONTHLY_FOOD_INCOME,
};
void formatObjective(Formatter& ft, Objective objective)
void formatObjective(Formatter& ft, const Scenario::Objective& objective)
{
if (objective.Type == OBJECTIVE_BUILD_THE_BEST)
if (objective.Type == Scenario::ObjectiveType::buildTheBest)
{
StringId rideTypeString = kStringIdNone;
auto rideTypeId = objective.RideId;
@@ -45,16 +45,16 @@ namespace OpenRCT2::Ui
}
ft.Add<StringId>(rideTypeString);
}
else if (objective.Type == OBJECTIVE_GUESTS_BY)
else if (objective.Type == Scenario::ObjectiveType::guestsBy)
{
ft.Add<int32_t>(objective.NumGuests);
ft.Add<int16_t>(DateGetTotalMonths(MONTH_OCTOBER, objective.Year));
}
else if (objective.Type == OBJECTIVE_GUESTS_AND_RATING)
else if (objective.Type == Scenario::ObjectiveType::guestsAndRating)
{
ft.Add<int32_t>(objective.NumGuests);
}
else if (objective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH)
else if (objective.Type == Scenario::ObjectiveType::tenRollercoastersLength)
{
ft.Add<int16_t>(objective.MinimumLength);
}
@@ -62,7 +62,7 @@ namespace OpenRCT2::Ui
{
ft.Add<int16_t>(objective.NumGuests);
ft.Add<int16_t>(DateGetTotalMonths(MONTH_OCTOBER, objective.Year));
if (objective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS)
if (objective.Type == Scenario::ObjectiveType::finishFiveRollercoasters)
ft.Add<RideRating_t>(objective.MinimumExcitement);
else
ft.Add<money64>(objective.Currency);
+6 -2
View File
@@ -13,11 +13,15 @@
#include <openrct2/localisation/StringIdType.h>
class Formatter;
struct Objective;
namespace OpenRCT2::Scenario
{
struct Objective;
}
namespace OpenRCT2::Ui
{
void formatObjective(Formatter& ft, Objective objective);
void formatObjective(Formatter& ft, const Scenario::Objective& objective);
extern const StringId kObjectiveNames[12];
} // namespace OpenRCT2::Ui
@@ -20,6 +20,7 @@
#include <openrct2/core/String.hpp>
#include <openrct2/entity/EntityRegistry.h>
#include <openrct2/object/ObjectManager.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/scenes/title/TitleScene.h>
#include <openrct2/scenes/title/TitleSequence.h>
#include <openrct2/scenes/title/TitleSequenceManager.h>
+12 -12
View File
@@ -22,7 +22,7 @@
#include <memory>
#include <openrct2/Context.h>
#include <openrct2/Input.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/scenario/ScenarioCategory.h>
#include <openrct2/scenario/ScenarioRepository.h>
#include <openrct2/scripting/Duktape.hpp>
#include <openrct2/scripting/ScriptEngine.h>
@@ -40,16 +40,16 @@ namespace OpenRCT2::Ui::Windows
namespace OpenRCT2::Scripting
{
static const DukEnumMap<ScenarioCategory> ScenarioCategoryMap(
static const DukEnumMap<Scenario::Category> ScenarioCategoryMap(
{
{ "beginner", ScenarioCategory::beginner },
{ "challenging", ScenarioCategory::challenging },
{ "expert", ScenarioCategory::expert },
{ "real", ScenarioCategory::real },
{ "other", ScenarioCategory::other },
{ "dlc", ScenarioCategory::dlc },
{ "build_your_own", ScenarioCategory::buildYourOwn },
{ "competitions", ScenarioCategory::competitions },
{ "beginner", Scenario::Category::beginner },
{ "challenging", Scenario::Category::challenging },
{ "expert", Scenario::Category::expert },
{ "real", Scenario::Category::real },
{ "other", Scenario::Category::other },
{ "dlc", Scenario::Category::dlc },
{ "build_your_own", Scenario::Category::buildYourOwn },
{ "competitions", Scenario::Category::competitions },
});
static const DukEnumMap<ScenarioSource> ScenarioSourceMap(
@@ -66,12 +66,12 @@ namespace OpenRCT2::Scripting
});
template<>
inline DukValue ToDuk(duk_context* ctx, const ScenarioCategory& value)
inline DukValue ToDuk(duk_context* ctx, const Scenario::Category& value)
{
const auto& entry = ScenarioCategoryMap.find(value);
if (entry != ScenarioCategoryMap.end())
return ToDuk(ctx, entry->first);
return ToDuk(ctx, ScenarioCategoryMap[ScenarioCategory::other]);
return ToDuk(ctx, ScenarioCategoryMap[Scenario::Category::other]);
}
template<>
@@ -22,6 +22,7 @@
#include <openrct2/audio/Audio.h>
#include <openrct2/entity/EntityList.h>
#include <openrct2/management/Research.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/scripting/ScriptEngine.h>
#include <openrct2/ui/WindowManager.h>
#include <openrct2/windows/Intent.h>
@@ -21,6 +21,7 @@
#include <openrct2/SpriteIds.h>
#include <openrct2/actions/ParkSetNameAction.h>
#include <openrct2/actions/ScenarioSetSettingAction.h>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Font.h>
#include <openrct2/drawing/Text.h>
@@ -680,7 +681,7 @@ namespace OpenRCT2::Ui::Windows
*
* rct2: 0x0067201D
*/
void SetObjective(int32_t objective)
void SetObjective(Scenario::ObjectiveType objective)
{
auto& gameState = getGameState();
auto& scenarioOptions = gameState.scenarioOptions;
@@ -691,37 +692,39 @@ namespace OpenRCT2::Ui::Windows
// Set default objective arguments
switch (objective)
{
case OBJECTIVE_NONE:
case OBJECTIVE_HAVE_FUN:
case OBJECTIVE_BUILD_THE_BEST:
case OBJECTIVE_10_ROLLERCOASTERS:
case Scenario::ObjectiveType::none:
case Scenario::ObjectiveType::haveFun:
case Scenario::ObjectiveType::buildTheBest:
case Scenario::ObjectiveType::tenRollercoasters:
break;
case OBJECTIVE_GUESTS_BY:
case Scenario::ObjectiveType::guestsBy:
scenarioOptions.objective.Year = 3;
scenarioOptions.objective.NumGuests = 1500;
break;
case OBJECTIVE_PARK_VALUE_BY:
case Scenario::ObjectiveType::parkValueBy:
scenarioOptions.objective.Year = 3;
scenarioOptions.objective.Currency = 50000.00_GBP;
break;
case OBJECTIVE_GUESTS_AND_RATING:
case Scenario::ObjectiveType::guestsAndRating:
scenarioOptions.objective.NumGuests = 2000;
break;
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case Scenario::ObjectiveType::monthlyRideIncome:
scenarioOptions.objective.Currency = 10000.00_GBP;
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case Scenario::ObjectiveType::tenRollercoastersLength:
scenarioOptions.objective.MinimumLength = 1200;
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
case Scenario::ObjectiveType::finishFiveRollercoasters:
scenarioOptions.objective.MinimumExcitement = RideRating::make(6, 70);
break;
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case Scenario::ObjectiveType::repayLoanAndParkValue:
scenarioOptions.objective.Currency = 50000.00_GBP;
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
case Scenario::ObjectiveType::monthlyFoodIncome:
scenarioOptions.objective.Currency = 1000.00_GBP;
break;
default:
break;
}
}
@@ -730,18 +733,20 @@ namespace OpenRCT2::Ui::Windows
const auto& gameState = getGameState();
const auto& scenarioOptions = gameState.scenarioOptions;
int32_t numItems = 0, objectiveType;
for (auto i = 0; i < OBJECTIVE_COUNT; i++)
int32_t numItems = 0;
for (auto i = 0; i < EnumValue(Scenario::ObjectiveType::count); i++)
{
if (i == OBJECTIVE_NONE || i == OBJECTIVE_BUILD_THE_BEST)
auto obj = Scenario::ObjectiveType(i);
if (obj == Scenario::ObjectiveType::none || obj == Scenario::ObjectiveType::buildTheBest)
continue;
const bool objectiveAllowedByMoneyUsage = !(gameState.park.flags & PARK_FLAGS_NO_MONEY)
|| !ObjectiveNeedsMoney(i);
|| !Scenario::ObjectiveNeedsMoney(obj);
// This objective can only work if the player can ask money for rides.
const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME)
const bool objectiveAllowedByPaymentSettings = (obj != Scenario::ObjectiveType::monthlyRideIncome)
|| Park::RidePricesUnlocked();
if (objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings)
{
gDropdownItems[numItems].format = STR_DROPDOWN_MENU_LABEL;
@@ -755,7 +760,7 @@ namespace OpenRCT2::Ui::Windows
{ windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1,
colours[1], 0, Dropdown::Flag::StayOpen, numItems, dropdownWidget->width() - 3);
objectiveType = scenarioOptions.objective.Type;
auto objectiveType = EnumValue(scenarioOptions.objective.Type);
for (int32_t j = 0; j < numItems; j++)
{
if (gDropdownItems[j].args - STR_OBJECTIVE_DROPDOWN_NONE == objectiveType)
@@ -768,10 +773,10 @@ namespace OpenRCT2::Ui::Windows
void ShowCategoryDropdown()
{
for (int32_t i = EnumValue(ScenarioCategory::beginner); i <= EnumValue(ScenarioCategory::other); i++)
for (int32_t i = EnumValue(Scenario::Category::beginner); i <= EnumValue(Scenario::Category::other); i++)
{
gDropdownItems[i].format = STR_DROPDOWN_MENU_LABEL;
gDropdownItems[i].args = kScenarioCategoryStringIds[i];
gDropdownItems[i].args = Scenario::kScenarioCategoryStringIds[i];
}
Widget* dropdownWidget = &widgets[WIDX_CATEGORY];
@@ -789,9 +794,9 @@ namespace OpenRCT2::Ui::Windows
switch (scenarioOptions.objective.Type)
{
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case Scenario::ObjectiveType::parkValueBy:
case Scenario::ObjectiveType::monthlyRideIncome:
case Scenario::ObjectiveType::repayLoanAndParkValue:
if (scenarioOptions.objective.Currency >= kObjectiveCurrencyLoanAndValueMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
@@ -802,7 +807,7 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
}
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
case Scenario::ObjectiveType::monthlyFoodIncome:
if (scenarioOptions.objective.Currency >= kObjectiveCurrencyFoodMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
@@ -813,7 +818,7 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
}
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case Scenario::ObjectiveType::tenRollercoastersLength:
if (scenarioOptions.objective.MinimumLength >= kObjectiveLengthMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
@@ -824,7 +829,7 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
}
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
case Scenario::ObjectiveType::finishFiveRollercoasters:
if (scenarioOptions.objective.MinimumExcitement >= kObjectiveExcitementMax)
{
ContextShowError(STR_CANT_INCREASE_FURTHER, kStringIdNone, {});
@@ -856,9 +861,9 @@ namespace OpenRCT2::Ui::Windows
switch (scenarioOptions.objective.Type)
{
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case Scenario::ObjectiveType::parkValueBy:
case Scenario::ObjectiveType::monthlyRideIncome:
case Scenario::ObjectiveType::repayLoanAndParkValue:
if (scenarioOptions.objective.Currency <= kObjectiveCurrencyLoanAndValueMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
@@ -869,7 +874,7 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
}
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
case Scenario::ObjectiveType::monthlyFoodIncome:
if (scenarioOptions.objective.Currency <= kObjectiveCurrencyFoodMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
@@ -880,7 +885,7 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
}
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case Scenario::ObjectiveType::tenRollercoastersLength:
if (scenarioOptions.objective.MinimumLength <= kObjectiveLengthMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
@@ -891,7 +896,7 @@ namespace OpenRCT2::Ui::Windows
Invalidate();
}
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
case Scenario::ObjectiveType::finishFiveRollercoasters:
if (scenarioOptions.objective.MinimumExcitement <= kObjectiveExcitementMin)
{
ContextShowError(STR_CANT_REDUCE_FURTHER, kStringIdNone, {});
@@ -1007,7 +1012,6 @@ namespace OpenRCT2::Ui::Windows
void ObjectiveOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex)
{
auto& gameState = getGameState();
uint8_t newObjectiveType;
if (dropdownIndex == -1)
return;
@@ -1016,7 +1020,8 @@ namespace OpenRCT2::Ui::Windows
{
case WIDX_OBJECTIVE_DROPDOWN:
// TODO: Don't rely on string ID order
newObjectiveType = static_cast<uint8_t>(gDropdownItems[dropdownIndex].args - STR_OBJECTIVE_DROPDOWN_NONE);
auto newObjectiveType = static_cast<Scenario::ObjectiveType>(
gDropdownItems[dropdownIndex].args - STR_OBJECTIVE_DROPDOWN_NONE);
if (gameState.scenarioOptions.objective.Type != newObjectiveType)
SetObjective(newObjectiveType);
break;
@@ -1029,24 +1034,24 @@ namespace OpenRCT2::Ui::Windows
*/
void ObjectiveOnUpdate()
{
uint8_t objectiveType;
frame_no++;
OnPrepareDraw();
InvalidateWidget(WIDX_TAB_1);
objectiveType = getGameState().scenarioOptions.objective.Type;
auto objectiveType = getGameState().scenarioOptions.objective.Type;
// Check if objective is allowed by money and pay-per-ride settings.
const bool objectiveAllowedByMoneyUsage = !(getGameState().park.flags & PARK_FLAGS_NO_MONEY)
|| !ObjectiveNeedsMoney(objectiveType);
// This objective can only work if the player can ask money for rides.
const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME)
const bool objectiveAllowedByPaymentSettings = (objectiveType != Scenario::ObjectiveType::monthlyRideIncome)
|| Park::RidePricesUnlocked();
if (!objectiveAllowedByMoneyUsage || !objectiveAllowedByPaymentSettings)
{
// Reset objective
SetObjective(OBJECTIVE_GUESTS_AND_RATING);
SetObjective(Scenario::ObjectiveType::guestsAndRating);
}
}
@@ -1062,8 +1067,8 @@ namespace OpenRCT2::Ui::Windows
switch (gameState.scenarioOptions.objective.Type)
{
case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_PARK_VALUE_BY:
case Scenario::ObjectiveType::guestsBy:
case Scenario::ObjectiveType::parkValueBy:
widgets[WIDX_OBJECTIVE_ARG_1_LABEL].type = WidgetType::label;
widgets[WIDX_OBJECTIVE_ARG_1].type = WidgetType::spinner;
widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WidgetType::button;
@@ -1073,12 +1078,12 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WidgetType::button;
widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WidgetType::button;
break;
case OBJECTIVE_GUESTS_AND_RATING:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case OBJECTIVE_MONTHLY_FOOD_INCOME:
case Scenario::ObjectiveType::guestsAndRating:
case Scenario::ObjectiveType::monthlyRideIncome:
case Scenario::ObjectiveType::tenRollercoastersLength:
case Scenario::ObjectiveType::finishFiveRollercoasters:
case Scenario::ObjectiveType::repayLoanAndParkValue:
case Scenario::ObjectiveType::monthlyFoodIncome:
widgets[WIDX_OBJECTIVE_ARG_1_LABEL].type = WidgetType::label;
widgets[WIDX_OBJECTIVE_ARG_1].type = WidgetType::spinner;
widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WidgetType::button;
@@ -1106,21 +1111,21 @@ namespace OpenRCT2::Ui::Windows
// Objective argument 1 label
switch (gameState.scenarioOptions.objective.Type)
{
case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_GUESTS_AND_RATING:
case Scenario::ObjectiveType::guestsBy:
case Scenario::ObjectiveType::guestsAndRating:
arg1StringId = STR_WINDOW_OBJECTIVE_GUEST_COUNT;
break;
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case Scenario::ObjectiveType::parkValueBy:
case Scenario::ObjectiveType::repayLoanAndParkValue:
arg1StringId = STR_WINDOW_OBJECTIVE_PARK_VALUE;
break;
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case Scenario::ObjectiveType::monthlyRideIncome:
arg1StringId = STR_WINDOW_OBJECTIVE_MONTHLY_INCOME;
break;
case OBJECTIVE_MONTHLY_FOOD_INCOME:
case Scenario::ObjectiveType::monthlyFoodIncome:
arg1StringId = STR_WINDOW_OBJECTIVE_MONTHLY_PROFIT;
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case Scenario::ObjectiveType::tenRollercoastersLength:
arg1StringId = STR_WINDOW_OBJECTIVE_MINIMUM_LENGTH;
break;
default:
@@ -1151,7 +1156,7 @@ namespace OpenRCT2::Ui::Windows
// Objective value
auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE].left + 1, widgets[WIDX_OBJECTIVE].top };
auto ft = Formatter();
ft.Add<StringId>(ObjectiveDropdownOptionNames[scenarioOptions.objective.Type]);
ft.Add<StringId>(ObjectiveDropdownOptionNames[EnumValue(scenarioOptions.objective.Type)]);
DrawTextBasic(rt, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
if (widgets[WIDX_OBJECTIVE_ARG_1].type != WidgetType::empty)
@@ -1165,23 +1170,23 @@ namespace OpenRCT2::Ui::Windows
ft = Formatter();
switch (scenarioOptions.objective.Type)
{
case OBJECTIVE_GUESTS_BY:
case OBJECTIVE_GUESTS_AND_RATING:
case Scenario::ObjectiveType::guestsBy:
case Scenario::ObjectiveType::guestsAndRating:
stringId = STR_WINDOW_COLOUR_2_COMMA32;
ft.Add<int32_t>(scenarioOptions.objective.NumGuests);
break;
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_MONTHLY_FOOD_INCOME:
case Scenario::ObjectiveType::parkValueBy:
case Scenario::ObjectiveType::repayLoanAndParkValue:
case Scenario::ObjectiveType::monthlyRideIncome:
case Scenario::ObjectiveType::monthlyFoodIncome:
stringId = STR_CURRENCY_FORMAT_LABEL;
ft.Add<money64>(scenarioOptions.objective.Currency);
break;
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case Scenario::ObjectiveType::tenRollercoastersLength:
stringId = STR_WINDOW_COLOUR_2_LENGTH;
ft.Add<uint16_t>(scenarioOptions.objective.MinimumLength);
break;
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
case Scenario::ObjectiveType::finishFiveRollercoasters:
stringId = STR_WINDOW_COLOUR_2_COMMA2DP32;
ft.Add<uint16_t>(scenarioOptions.objective.MinimumExcitement);
break;
@@ -1257,9 +1262,9 @@ namespace OpenRCT2::Ui::Windows
case WIDX_CATEGORY_DROPDOWN:
{
auto& gameState = getGameState();
if (gameState.scenarioOptions.category != static_cast<ScenarioCategory>(dropdownIndex))
if (gameState.scenarioOptions.category != static_cast<Scenario::Category>(dropdownIndex))
{
gameState.scenarioOptions.category = static_cast<ScenarioCategory>(dropdownIndex);
gameState.scenarioOptions.category = static_cast<Scenario::Category>(dropdownIndex);
Invalidate();
}
break;
@@ -1320,7 +1325,7 @@ namespace OpenRCT2::Ui::Windows
// Scenario category value
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_CATEGORY].left + 1, widgets[WIDX_CATEGORY].top };
ft = Formatter();
ft.Add<StringId>(kScenarioCategoryStringIds[EnumValue(gameState.scenarioOptions.category)]);
ft.Add<StringId>(Scenario::kScenarioCategoryStringIds[EnumValue(gameState.scenarioOptions.category)]);
DrawTextBasic(rt, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
+1 -1
View File
@@ -636,7 +636,7 @@ namespace OpenRCT2::Ui::Windows
DrawTextBasic(rt, windowPos + ScreenCoordsXY{ 8, titleBarBottom + 280 }, stringId, ft);
// Objective related financial information
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME)
if (gameState.scenarioOptions.objective.Type == Scenario::ObjectiveType::monthlyFoodIncome)
{
auto lastMonthProfit = FinanceGetLastMonthShopProfit();
ft = Formatter();
+4 -3
View File
@@ -29,6 +29,7 @@
#include <openrct2/management/Award.h>
#include <openrct2/object/PeepAnimationsObject.h>
#include <openrct2/ride/RideData.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/ui/WindowManager.h>
#include <openrct2/world/Park.h>
@@ -521,7 +522,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage);
// Only allow closing of park for guest / rating objective
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioOptions.objective.Type == Scenario::ObjectiveType::guestsAndRating)
disabled_widgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT);
else
disabled_widgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT));
@@ -545,7 +546,7 @@ namespace OpenRCT2::Ui::Windows
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK)
{
widgets[WIDX_OPEN_OR_CLOSE].type = WidgetType::empty;
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioOptions.objective.Type == Scenario::ObjectiveType::guestsAndRating)
{
widgets[WIDX_CLOSE_LIGHT].type = WidgetType::flatBtn;
widgets[WIDX_OPEN_LIGHT].type = WidgetType::flatBtn;
@@ -1086,7 +1087,7 @@ namespace OpenRCT2::Ui::Windows
formatObjective(ft, gameState.scenarioOptions.objective);
screenCoords.y += DrawTextWrapped(
rt, screenCoords, 221, kObjectiveNames[gameState.scenarioOptions.objective.Type], ft);
rt, screenCoords, 221, kObjectiveNames[EnumValue(gameState.scenarioOptions.objective.Type)], ft);
screenCoords.y += 5;
// Objective outcome
+8 -7
View File
@@ -29,6 +29,7 @@
#include <openrct2/park/ParkPreview.h>
#include <openrct2/ride/RideData.h>
#include <openrct2/scenario/Scenario.h>
#include <openrct2/scenario/ScenarioCategory.h>
#include <openrct2/scenario/ScenarioRepository.h>
#include <openrct2/scenario/ScenarioSources.h>
#include <openrct2/ui/WindowManager.h>
@@ -392,13 +393,13 @@ namespace OpenRCT2::Ui::Windows
screenPos.y += DrawTextWrapped(rt, screenPos, previewPaneWidth, STR_BLACK_STRING, ft) + 5;
// Scenario objective
Objective objective = { .Type = scenario->ObjectiveType,
.Year = scenario->ObjectiveArg1,
.NumGuests = static_cast<uint16_t>(scenario->ObjectiveArg3),
.Currency = scenario->ObjectiveArg2 };
Scenario::Objective objective = { .Type = scenario->ObjectiveType,
.Year = scenario->ObjectiveArg1,
.NumGuests = static_cast<uint16_t>(scenario->ObjectiveArg3),
.Currency = scenario->ObjectiveArg2 };
ft = Formatter();
ft.Add<StringId>(kObjectiveNames[scenario->ObjectiveType]);
ft.Add<StringId>(kObjectiveNames[EnumValue(scenario->ObjectiveType)]);
formatObjective(ft, objective);
screenPos.y += DrawTextWrapped(rt, screenPos, previewPaneWidth, STR_OBJECTIVE, ft) + 5;
@@ -682,7 +683,7 @@ namespace OpenRCT2::Ui::Windows
union
{
uint8_t raw = UINT8_MAX;
ScenarioCategory category;
Scenario::Category category;
ScenarioSource source;
} currentHeading{};
for (size_t i = 0; i < numScenarios; i++)
@@ -697,7 +698,7 @@ namespace OpenRCT2::Ui::Windows
if (selected_tab != EnumValue(ScenarioSource::Real) && currentHeading.category != scenario->Category)
{
currentHeading.category = scenario->Category;
headingStringId = kScenarioCategoryStringIds[currentHeading.raw];
headingStringId = Scenario::kScenarioCategoryStringIds[currentHeading.raw];
}
if (headingStringId != kStringIdNone)
+1
View File
@@ -60,6 +60,7 @@
#include "profiling/Profiling.h"
#include "rct2/RCT2.h"
#include "ride/TrackDesignRepository.h"
#include "scenario/Scenario.h"
#include "scenario/ScenarioRepository.h"
#include "scenes/game/GameScene.h"
#include "scenes/intro/IntroScene.h"
+3 -2
View File
@@ -38,6 +38,7 @@
#include "object/ObjectRepository.h"
#include "peep/PeepAnimations.h"
#include "rct1/RCT1.h"
#include "scenario/Scenario.h"
#include "scripting/ScriptEngine.h"
#include "ui/WindowManager.h"
#include "windows/Intent.h"
@@ -112,7 +113,7 @@ namespace OpenRCT2::Editor
gLegacyScene = LegacyScene::scenarioEditor;
gameState.editorStep = EditorStep::ObjectSelection;
gameState.park.flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
gameState.scenarioOptions.category = ScenarioCategory::other;
gameState.scenarioOptions.category = Scenario::Category::other;
ObjectListLoad();
ViewportInitAll();
WindowBase* mainWindow = OpenEditorWindows();
@@ -156,7 +157,7 @@ namespace OpenRCT2::Editor
gLegacyScene = LegacyScene::scenarioEditor;
gameState.editorStep = EditorStep::OptionsSelection;
gameState.scenarioOptions.category = ScenarioCategory::other;
gameState.scenarioOptions.category = Scenario::Category::other;
ViewportInitAll();
OpenEditorWindows();
FinaliseMainView();
+1
View File
@@ -57,6 +57,7 @@
#include "ride/TrackDesign.h"
#include "ride/Vehicle.h"
#include "sawyer_coding/SawyerCoding.h"
#include "scenario/Scenario.h"
#include "scenes/title/TitleScene.h"
#include "scripting/ScriptEngine.h"
#include "ui/UiContext.h"
+1
View File
@@ -22,6 +22,7 @@
#include "platform/Platform.h"
#include "profiling/Profiling.h"
#include "ride/Vehicle.h"
#include "scenario/Scenario.h"
#include "scenes/title/TitleScene.h"
#include "scenes/title/TitleSequencePlayer.h"
#include "scripting/ScriptEngine.h"
+1
View File
@@ -13,6 +13,7 @@
#include "Date.h"
#include "Editor.h"
#include "Limits.h"
#include "core/Random.hpp"
#include "entity/EntityRegistry.h"
#include "interface/ZoomLevel.h"
#include "management/Finance.h"
+1
View File
@@ -37,6 +37,7 @@
#include "object/ObjectManager.h"
#include "object/ObjectRepository.h"
#include "park/ParkFile.h"
#include "scenario/Scenario.h"
#include "world/Park.h"
#include <chrono>
+3 -1
View File
@@ -27,6 +27,8 @@
#include "../ride/Ride.h"
#include "../ride/RideManager.hpp"
#include "../ride/Vehicle.h"
#include "../scenario/Scenario.h"
#include "../scenario/ScenarioObjective.h"
#include "../ui/WindowManager.h"
#include "../util/Util.h"
#include "../windows/Intent.h"
@@ -234,7 +236,7 @@ GameActions::Result CheatSetAction::Execute() const
ParkSetOpen(!Park::IsOpen(gameState.park));
break;
case CheatType::HaveFun:
gameState.scenarioOptions.objective.Type = OBJECTIVE_HAVE_FUN;
gameState.scenarioOptions.objective.Type = Scenario::ObjectiveType::haveFun;
break;
case CheatType::SetForcedParkRating:
Park::SetForcedRating(_param1);
+1
View File
@@ -21,6 +21,7 @@
#include "../network/Network.h"
#include "../platform/Platform.h"
#include "../profiling/Profiling.h"
#include "../scenario/Scenario.h"
#include "../scripting/Duktape.hpp"
#include "../scripting/HookEngine.h"
#include "../scripting/ScriptEngine.h"
+1 -1
View File
@@ -226,7 +226,7 @@ GameActions::Result RideCreateAction::Execute() const
ride->price[1] = GetShopItemDescriptor(rideEntry->shop_item[1]).DefaultPrice;
}
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_BUILD_THE_BEST)
if (gameState.scenarioOptions.objective.Type == Scenario::ObjectiveType::buildTheBest)
{
ride->price[0] = 0;
}
@@ -14,6 +14,7 @@
#include "../OpenRCT2.h"
#include "../entity/Peep.h"
#include "../management/Finance.h"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "../world/Park.h"
@@ -23,6 +23,7 @@
#include "../object/ObjectManager.h"
#include "../object/PeepAnimationsObject.h"
#include "../ride/Ride.h"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "../world/Entrance.h"
#include "../world/Park.h"
@@ -16,8 +16,10 @@
#include "../config/Config.h"
#include "../core/Console.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../object/ObjectManager.h"
#include "../park/ParkFile.h"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "CommandLine.hpp"
+2
View File
@@ -200,3 +200,5 @@ namespace OpenRCT2::Random
using State = Engine::state_type;
} // namespace RCT2
} // namespace OpenRCT2::Random
using random_engine_t = OpenRCT2::Random::RCT2::Engine;
+2
View File
@@ -6,6 +6,7 @@
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "Duck.h"
#include "../Game.h"
@@ -16,6 +17,7 @@
#include "../entity/EntityList.h"
#include "../paint/Paint.h"
#include "../profiling/Profiling.h"
#include "../scenario/Scenario.h"
#include "../world/tile_element/SurfaceElement.h"
#include "EntityRegistry.h"
+1
View File
@@ -15,6 +15,7 @@
#include "../object/PathAdditionEntry.h"
#include "../paint/Paint.h"
#include "../profiling/Profiling.h"
#include "../scenario/Scenario.h"
#include "../world/Footpath.h"
#include "../world/Location.hpp"
#include "../world/Map.h"
+1
View File
@@ -52,6 +52,7 @@
#include "../ride/Station.h"
#include "../ride/Track.h"
#include "../ride/Vehicle.h"
#include "../scenario/Scenario.h"
#include "../scripting/HookEngine.h"
#include "../scripting/ScriptEngine.h"
#include "../ui/WindowManager.h"
+1
View File
@@ -49,6 +49,7 @@
#include "../ride/ShopItem.h"
#include "../ride/Station.h"
#include "../ride/Track.h"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "../util/Util.h"
#include "../windows/Intent.h"
+1
View File
@@ -39,6 +39,7 @@
#include "../ride/Station.h"
#include "../ride/Track.h"
#include "../ride/Vehicle.h"
#include "../scenario/Scenario.h"
#include "../util/Util.h"
#include "../windows/Intent.h"
#include "../world/Entrance.h"
+4
View File
@@ -548,6 +548,8 @@
<ClInclude Include="sawyer_coding\SawyerChunkReader.h" />
<ClInclude Include="sawyer_coding\SawyerChunkWriter.h" />
<ClInclude Include="scenario\Scenario.h" />
<ClInclude Include="scenario\ScenarioCategory.h" />
<ClInclude Include="scenario\ScenarioObjective.h" />
<ClInclude Include="scenario\ScenarioOptions.h" />
<ClInclude Include="scenario\ScenarioRepository.h" />
<ClInclude Include="scenario\ScenarioSources.h" />
@@ -1085,6 +1087,8 @@
<ClCompile Include="sawyer_coding\SawyerChunkReader.cpp" />
<ClCompile Include="sawyer_coding\SawyerChunkWriter.cpp" />
<ClCompile Include="scenario\Scenario.cpp" />
<ClCompile Include="scenario\ScenarioCategory.cpp" />
<ClCompile Include="scenario\ScenarioObjective.cpp" />
<ClCompile Include="scenario\ScenarioRepository.cpp" />
<ClCompile Include="scenario\ScenarioSources.cpp" />
<ClCompile Include="scenes\Scene.cpp" />
+1
View File
@@ -17,6 +17,7 @@
#include "../ride/Ride.h"
#include "../ride/RideData.h"
#include "../ride/RideManager.hpp"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "../world/Park.h"
#include "NewsItem.h"
+1
View File
@@ -33,6 +33,7 @@
#include "../ride/RideData.h"
#include "../ride/RideEntry.h"
#include "../ride/TrackData.h"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "../windows/Intent.h"
#include "../world/Park.h"
+1
View File
@@ -3,6 +3,7 @@
#include "../System.hpp"
#include "../actions/GameAction.h"
#include "../object/Object.h"
#include "../scenario/Scenario.h"
#include "NetworkConnection.h"
#include "NetworkGroup.h"
#include "NetworkPlayer.h"
+3 -2
View File
@@ -49,6 +49,7 @@
#include "../ride/RideManager.hpp"
#include "../ride/ShopItem.h"
#include "../ride/Vehicle.h"
#include "../scenario/Scenario.h"
#include "../scenario/ScenarioRepository.h"
#include "../scripting/ScriptEngine.h"
#include "../ui/WindowManager.h"
@@ -218,7 +219,7 @@ namespace OpenRCT2
ScenarioIndexEntry entry{};
auto& os = *_os;
os.readWriteChunk(ParkFileChunkType::SCENARIO, [&entry](OrcaStream::ChunkStream& cs) {
entry.Category = cs.read<ScenarioCategory>();
entry.Category = cs.read<Scenario::Category>();
std::string name;
ReadWriteStringTable(cs, name, "en-GB");
@@ -233,7 +234,7 @@ namespace OpenRCT2
entry.Details = scenarioDetails;
// wrong order is intentional here due to ReadWriteScenarioChunk writing guests first
entry.ObjectiveType = cs.read<uint8_t>();
entry.ObjectiveType = cs.read<Scenario::ObjectiveType>();
entry.ObjectiveArg1 = cs.read<uint8_t>();
entry.ObjectiveArg3 = cs.read<uint16_t>();
entry.ObjectiveArg2 = cs.read<int32_t>();
+1
View File
@@ -18,6 +18,7 @@
#include "../ride/RideData.h"
#include "../ride/Station.h"
#include "../ride/Track.h"
#include "../scenario/Scenario.h"
#include "../world/Entrance.h"
#include "../world/Footpath.h"
#include "../world/tile_element/BannerElement.h"
+6 -1
View File
@@ -18,6 +18,11 @@
enum class VehicleColourSettings : uint8_t;
namespace OpenRCT2::Scenario
{
enum class ObjectiveType : uint8_t;
}
namespace OpenRCT2::RCT1
{
constexpr uint8_t RCT1ResearchFlagsSeparator = 0xFF;
@@ -800,7 +805,7 @@ namespace OpenRCT2::RCT1
money16 GuestInitialCash;
uint8_t GuestInitialHunger;
uint8_t GuestInitialThirst;
uint8_t ScenarioObjectiveType;
Scenario::ObjectiveType ScenarioObjectiveType;
uint8_t ScenarioObjectiveYears;
uint16_t Unk199552;
money32 ScenarioObjectiveCurrency;
+9 -7
View File
@@ -63,6 +63,8 @@
#include "../ride/TrainManager.h"
#include "../ride/Vehicle.h"
#include "../sawyer_coding/SawyerCoding.h"
#include "../scenario/Scenario.h"
#include "../scenario/ScenarioObjective.h"
#include "../scenario/ScenarioRepository.h"
#include "../scenario/ScenarioSources.h"
#include "../world/Climate.h"
@@ -234,7 +236,7 @@ namespace OpenRCT2::RCT1
bool isOfficial = ScenarioSources::TryGetById(_s4.ScenarioSlotIndex, &desc);
// Perform an additional name check if this is detected to be a competition scenario
if (isOfficial && desc.category == ScenarioCategory::competitions)
if (isOfficial && desc.category == Scenario::Category::competitions)
isOfficial = ScenarioSources::TryGetByName(_s4.ScenarioName, &desc);
dst->Category = desc.category;
@@ -245,13 +247,13 @@ namespace OpenRCT2::RCT1
dst->ObjectiveType = _s4.ScenarioObjectiveType;
dst->ObjectiveArg1 = _s4.ScenarioObjectiveYears;
// RCT1 used another way of calculating park value.
if (_s4.ScenarioObjectiveType == OBJECTIVE_PARK_VALUE_BY)
if (_s4.ScenarioObjectiveType == Scenario::ObjectiveType::parkValueBy)
dst->ObjectiveArg2 = CorrectRCT1ParkValue(_s4.ScenarioObjectiveCurrency);
else
dst->ObjectiveArg2 = _s4.ScenarioObjectiveCurrency;
dst->ObjectiveArg3 = _s4.ScenarioObjectiveNumGuests;
// This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead.
if (_s4.ScenarioObjectiveType == OBJECTIVE_BUILD_THE_BEST)
if (_s4.ScenarioObjectiveType == Scenario::ObjectiveType::buildTheBest)
{
dst->ObjectiveArg3 = GetBuildTheBestRideId();
}
@@ -358,7 +360,7 @@ namespace OpenRCT2::RCT1
gameStateInitAll(gameState, { mapSize, mapSize });
gameState.editorStep = EditorStep::ObjectSelection;
gameState.park.flags |= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
gameState.scenarioOptions.category = ScenarioCategory::other;
gameState.scenarioOptions.category = Scenario::Category::other;
}
std::string GetRCT1ScenarioName()
@@ -2430,7 +2432,7 @@ namespace OpenRCT2::RCT1
bool isOfficial = ScenarioSources::TryGetById(_s4.ScenarioSlotIndex, &desc);
// Perform an additional name check if this is detected to be a competition scenario
if (isOfficial && desc.category == ScenarioCategory::competitions)
if (isOfficial && desc.category == Scenario::Category::competitions)
isOfficial = ScenarioSources::TryGetByName(_s4.ScenarioName, &desc);
if (isOfficial && !desc.textObjectId.empty())
@@ -2465,13 +2467,13 @@ namespace OpenRCT2::RCT1
// RCT1 used a different way of calculating the park value.
// This is corrected here, but since scenario_objective_currency doubles as minimum excitement rating,
// we need to check the goal to avoid affecting scenarios like Volcania.
if (_s4.ScenarioObjectiveType == OBJECTIVE_PARK_VALUE_BY)
if (_s4.ScenarioObjectiveType == Scenario::ObjectiveType::parkValueBy)
gameState.scenarioOptions.objective.Currency = CorrectRCT1ParkValue(_s4.ScenarioObjectiveCurrency);
else
gameState.scenarioOptions.objective.Currency = ToMoney64(_s4.ScenarioObjectiveCurrency);
// This does not seem to be saved in the objective arguments, so look up the ID from the available rides instead.
if (_s4.ScenarioObjectiveType == OBJECTIVE_BUILD_THE_BEST)
if (_s4.ScenarioObjectiveType == Scenario::ObjectiveType::buildTheBest)
gameState.scenarioOptions.objective.RideId = GetBuildTheBestRideId();
}
+25 -11
View File
@@ -22,12 +22,26 @@
struct RideObjectEntry;
enum class EditorStep : uint8_t;
enum class VehicleColourSettings : uint8_t;
enum class ScenarioCategory : uint8_t;
namespace OpenRCT2
namespace OpenRCT2::Scenario
{
class ObjectList;
}
enum class Category : uint8_t;
enum class ObjectiveType : uint8_t;
} // namespace OpenRCT2::Scenario
enum
{
S6_TYPE_SAVEDGAME,
S6_TYPE_SCENARIO
};
// For legacy scores file
enum
{
SCENARIO_FLAGS_VISIBLE = (1 << 0),
SCENARIO_FLAGS_COMPLETED = (1 << 1),
SCENARIO_FLAGS_SIXFLAGS = (1 << 2)
};
namespace OpenRCT2::RCT2
{
@@ -394,7 +408,7 @@ namespace OpenRCT2::RCT2
char Path[256];
uint8_t Category;
uint8_t Pad0101[0x1F];
int8_t ObjectiveType;
Scenario::ObjectiveType ObjectiveType;
int8_t ObjectiveArg1;
int32_t objectiveArg2;
uint16_t objectiveArg3;
@@ -762,11 +776,11 @@ namespace OpenRCT2::RCT2
struct S6Info
{
::EditorStep EditorStep;
ScenarioCategory Category; // 0x01
uint8_t ObjectiveType; // 0x02
uint8_t ObjectiveArg1; // 0x03
int32_t ObjectiveArg2; // 0x04
uint16_t ObjectiveArg3; // 0x08
Scenario::Category Category; // 0x01
Scenario::ObjectiveType ObjectiveType; // 0x02
uint8_t ObjectiveArg1; // 0x03
int32_t ObjectiveArg2; // 0x04
uint16_t ObjectiveArg3; // 0x08
uint8_t Pad00A[0x3E];
char Name[64]; // 0x48
char Details[256]; // 0x88
@@ -883,7 +897,7 @@ namespace OpenRCT2::RCT2
money16 GuestInitialCash;
uint8_t GuestInitialHunger;
uint8_t GuestInitialThirst;
uint8_t ObjectiveType;
Scenario::ObjectiveType ObjectiveType;
uint8_t ObjectiveYear;
uint8_t Pad013580FA[2];
money32 ObjectiveCurrency;
+3 -2
View File
@@ -68,6 +68,7 @@
#include "../ride/Vehicle.h"
#include "../sawyer_coding/SawyerChunkReader.h"
#include "../sawyer_coding/SawyerCoding.h"
#include "../scenario/Scenario.h"
#include "../scenario/ScenarioRepository.h"
#include "../scenario/ScenarioSources.h"
#include "../world/Climate.h"
@@ -279,7 +280,7 @@ namespace OpenRCT2::RCT2
{
dst->ScenarioId = SC_UNIDENTIFIED;
dst->SourceIndex = -1;
if (dst->Category == ScenarioCategory::real)
if (dst->Category == Scenario::Category::real)
{
dst->SourceGame = ScenarioSource::Real;
}
@@ -474,7 +475,7 @@ namespace OpenRCT2::RCT2
gameState.scenarioOptions.objective.Currency = _s6.ObjectiveCurrency;
// In RCT2, the ride string IDs start at index STR_0002 and are directly mappable.
// This is not always the case in OpenRCT2, so we use the actual ride ID.
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_BUILD_THE_BEST)
if (gameState.scenarioOptions.objective.Type == Scenario::ObjectiveType::buildTheBest)
gameState.scenarioOptions.objective.RideId = _s6.ObjectiveGuests - kRCT2RideStringStart;
else
gameState.scenarioOptions.objective.NumGuests = _s6.ObjectiveGuests;
+1
View File
@@ -47,6 +47,7 @@
#include "../object/StationObject.h"
#include "../profiling/Profiling.h"
#include "../rct1/RCT1.h"
#include "../scenario/Scenario.h"
#include "../ui/WindowManager.h"
#include "../util/Util.h"
#include "../windows/Intent.h"
+1
View File
@@ -12,6 +12,7 @@
#include "../Game.h"
#include "../GameState.h"
#include "../entity/Guest.h"
#include "../scenario/Scenario.h"
#include "../world/Location.hpp"
#include "../world/tile_element/TileElement.h"
#include "../world/tile_element/TrackElement.h"
+1
View File
@@ -38,6 +38,7 @@
#include "../platform/Platform.h"
#include "../profiling/Profiling.h"
#include "../rct12/RCT12.h"
#include "../scenario/Scenario.h"
#include "../scripting/HookEngine.h"
#include "../scripting/ScriptEngine.h"
#include "../ui/WindowManager.h"
+11 -302
View File
@@ -7,6 +7,8 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "Scenario.h"
#include "../Cheats.h"
#include "../Context.h"
#include "../Date.h"
@@ -65,11 +67,7 @@
#include <chrono>
using namespace OpenRCT2;
const StringId kScenarioCategoryStringIds[EnumValue(ScenarioCategory::count)] = {
STR_BEGINNER_PARKS, STR_CHALLENGING_PARKS, STR_EXPERT_PARKS, STR_REAL_PARKS, STR_OTHER_PARKS,
STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS, STR_COMPETITIONS, STR_UCES_TM, STR_UCES_KD,
};
using namespace OpenRCT2::Scenario;
std::string gScenarioSavePath;
bool gFirstTimeSaving = true;
@@ -84,7 +82,7 @@ void ScenarioBegin(GameState_t& gameState)
GameLoadInit();
ScenarioReset(gameState);
if (gameState.scenarioOptions.objective.Type != OBJECTIVE_NONE && !gLoadKeepWindowsOpen)
if (gameState.scenarioOptions.objective.Type != ObjectiveType::none && !gLoadKeepWindowsOpen)
ContextOpenWindowView(WV_PARK_OBJECTIVE);
gScreenAge = 0;
@@ -287,11 +285,11 @@ static void ScenarioDayUpdate(GameState_t& gameState)
PeepUpdateDaysInQueue();
switch (gameState.scenarioOptions.objective.Type)
{
case OBJECTIVE_10_ROLLERCOASTERS:
case OBJECTIVE_GUESTS_AND_RATING:
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case ObjectiveType::tenRollercoasters:
case ObjectiveType::guestsAndRating:
case ObjectiveType::tenRollercoastersLength:
case ObjectiveType::finishFiveRollercoasters:
case ObjectiveType::repayLoanAndParkValue:
ScenarioCheckObjective(gameState);
break;
default:
@@ -526,7 +524,7 @@ uint32_t ScenarioRandMax(uint32_t max)
*/
static ResultWithMessage ScenarioPrepareRidesForSave(GameState_t& gameState)
{
int32_t isFiveCoasterObjective = gameState.scenarioOptions.objective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS;
bool isFiveCoasterObjective = gameState.scenarioOptions.objective.Type == ObjectiveType::finishFiveRollercoasters;
uint8_t rcs = 0;
for (auto& ride : GetRideManager())
@@ -592,7 +590,7 @@ ResultWithMessage ScenarioPrepareForSave(GameState_t& gameState)
return { false, prepareRidesResult.Message };
}
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::guestsAndRating)
gameState.park.flags |= PARK_FLAGS_PARK_OPEN;
ScenarioReset(gameState);
@@ -600,245 +598,6 @@ ResultWithMessage ScenarioPrepareForSave(GameState_t& gameState)
return { true };
}
ObjectiveStatus Objective::CheckGuestsBy() const
{
auto parkRating = getGameState().park.rating;
int32_t currentMonthYear = GetDate().GetMonthsElapsed();
if (currentMonthYear == MONTH_COUNT * Year || AllowEarlyCompletion())
{
if (parkRating >= 600 && getGameState().park.numGuestsInPark >= NumGuests)
{
return ObjectiveStatus::Success;
}
if (currentMonthYear == MONTH_COUNT * Year)
{
return ObjectiveStatus::Failure;
}
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckParkValueBy() const
{
int32_t currentMonthYear = GetDate().GetMonthsElapsed();
money64 objectiveParkValue = Currency;
money64 parkValue = getGameState().park.value;
if (currentMonthYear == MONTH_COUNT * Year || AllowEarlyCompletion())
{
if (parkValue >= objectiveParkValue)
{
return ObjectiveStatus::Success;
}
if (currentMonthYear == MONTH_COUNT * Year)
{
return ObjectiveStatus::Failure;
}
}
return ObjectiveStatus::Undecided;
}
/**
* Checks if there are 10 rollercoasters of different subtype with
* excitement >= 600 .
* rct2:
**/
ObjectiveStatus Objective::Check10RollerCoasters() const
{
auto rcs = 0;
BitSet<kMaxRideObjects> type_already_counted;
for (const auto& ride : GetRideManager())
{
if (ride.status == RideStatus::open && ride.ratings.excitement >= RideRating::make(6, 00)
&& ride.subtype != kObjectEntryIndexNull)
{
auto rideEntry = ride.getRideEntry();
if (rideEntry != nullptr)
{
if (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && !type_already_counted[ride.subtype])
{
type_already_counted[ride.subtype] = true;
rcs++;
}
}
}
}
if (rcs >= 10)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
/**
*
* rct2: 0x0066A13C
*/
ObjectiveStatus Objective::CheckGuestsAndRating() const
{
auto& gameState = getGameState();
if (gameState.park.rating < 700 && GetDate().GetMonthsElapsed() >= 1)
{
gameState.scenarioParkRatingWarningDays++;
if (gameState.scenarioParkRatingWarningDays == 1)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_4_WEEKS_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 8)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_3_WEEKS_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 15)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_2_WEEKS_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 22)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_1_WEEK_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 29)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_HAS_BEEN_CLOSED_DOWN, 0, {});
gameState.park.flags &= ~PARK_FLAGS_PARK_OPEN;
gameState.scenarioOptions.guestInitialHappiness = 50;
return ObjectiveStatus::Failure;
}
}
else if (gameState.scenarioCompletedCompanyValue != kCompanyValueOnFailedObjective)
{
gameState.scenarioParkRatingWarningDays = 0;
}
if (gameState.park.rating >= 700)
if (gameState.park.numGuestsInPark >= NumGuests)
return ObjectiveStatus::Success;
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckMonthlyRideIncome() const
{
money64 lastMonthRideIncome = getGameState().park.expenditureTable[1][EnumValue(ExpenditureType::parkRideTickets)];
if (lastMonthRideIncome >= Currency)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
/**
* Checks if there are 10 rollercoasters of different subtype with
* excitement > 700 and a minimum length;
* rct2: 0x0066A6B5
*/
ObjectiveStatus Objective::Check10RollerCoastersLength() const
{
BitSet<kMaxRideObjects> type_already_counted;
auto rcs = 0;
for (const auto& ride : GetRideManager())
{
if (ride.status == RideStatus::open && ride.ratings.excitement >= RideRating::make(7, 00)
&& ride.subtype != kObjectEntryIndexNull)
{
auto rideEntry = ride.getRideEntry();
if (rideEntry != nullptr)
{
if (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && !type_already_counted[ride.subtype])
{
if (ToHumanReadableRideLength(ride.getTotalLength()) >= MinimumLength)
{
type_already_counted[ride.subtype] = true;
rcs++;
}
}
}
}
}
if (rcs >= 10)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckFinish5RollerCoasters() const
{
// Originally, this did not check for null rides, neither did it check if
// the rides are even rollercoasters, never mind the right rollercoasters to be finished.
auto rcs = 0;
for (const auto& ride : GetRideManager())
{
if (ride.status != RideStatus::closed && ride.ratings.excitement >= MinimumExcitement)
{
auto rideEntry = ride.getRideEntry();
if (rideEntry != nullptr)
{
if ((ride.lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
&& RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster))
{
rcs++;
}
}
}
}
if (rcs >= 5)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckRepayLoanAndParkValue() const
{
const auto& gameState = getGameState();
money64 parkValue = gameState.park.value;
money64 currentLoan = gameState.park.bankLoan;
if (currentLoan <= 0 && parkValue >= Currency)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckMonthlyFoodIncome() const
{
const auto* lastMonthExpenditure = getGameState().park.expenditureTable[1];
auto lastMonthProfit = lastMonthExpenditure[EnumValue(ExpenditureType::shopSales)]
+ lastMonthExpenditure[EnumValue(ExpenditureType::shopStock)]
+ lastMonthExpenditure[EnumValue(ExpenditureType::foodDrinkSales)]
+ lastMonthExpenditure[EnumValue(ExpenditureType::foodDrinkStock)];
if (lastMonthProfit >= Currency)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
/*
* Returns the AllowEarlyCompletion-Option to be used
* depending on the Current Network-Mode.
@@ -868,53 +627,3 @@ static void ScenarioCheckObjective(GameState_t& gameState)
ScenarioFailure(gameState);
}
}
/**
* Checks the win/lose conditions of the current objective.
* rct2: 0x0066A4B2
*/
ObjectiveStatus Objective::Check(GameState_t& gameState) const
{
if (gameState.scenarioCompletedCompanyValue != kMoney64Undefined)
{
return ObjectiveStatus::Undecided;
}
switch (Type)
{
case OBJECTIVE_GUESTS_BY:
return CheckGuestsBy();
case OBJECTIVE_PARK_VALUE_BY:
return CheckParkValueBy();
case OBJECTIVE_10_ROLLERCOASTERS:
return Check10RollerCoasters();
case OBJECTIVE_GUESTS_AND_RATING:
return CheckGuestsAndRating();
case OBJECTIVE_MONTHLY_RIDE_INCOME:
return CheckMonthlyRideIncome();
case OBJECTIVE_10_ROLLERCOASTERS_LENGTH:
return Check10RollerCoastersLength();
case OBJECTIVE_FINISH_5_ROLLERCOASTERS:
return CheckFinish5RollerCoasters();
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
return CheckRepayLoanAndParkValue();
case OBJECTIVE_MONTHLY_FOOD_INCOME:
return CheckMonthlyFoodIncome();
}
return ObjectiveStatus::Undecided;
}
bool ObjectiveNeedsMoney(const uint8_t objective)
{
switch (objective)
{
case OBJECTIVE_PARK_VALUE_BY:
case OBJECTIVE_MONTHLY_RIDE_INCOME:
case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE:
case OBJECTIVE_MONTHLY_FOOD_INCOME:
return true;
}
return false;
}
-109
View File
@@ -9,124 +9,17 @@
#pragma once
#include "../core/EnumUtils.hpp"
#include "../core/Money.hpp"
#include "../core/Random.hpp"
#include "../core/String.hpp"
#include "../localisation/StringIdType.h"
#include "../ride/RideRatings.h"
struct ResultWithMessage;
using random_engine_t = OpenRCT2::Random::RCT2::Engine;
namespace OpenRCT2
{
struct GameState_t;
}
enum
{
SCENARIO_FLAGS_VISIBLE = (1 << 0),
SCENARIO_FLAGS_COMPLETED = (1 << 1),
SCENARIO_FLAGS_SIXFLAGS = (1 << 2)
};
enum
{
S6_TYPE_SAVEDGAME,
S6_TYPE_SCENARIO
};
enum class ScenarioCategory : uint8_t
{
// RCT2 categories (keep order)
beginner,
challenging,
expert,
real,
other,
// OpenRCT2 categories
dlc,
buildYourOwn,
competitions,
timeMachine,
katysDreamworld,
count,
};
enum
{
OBJECTIVE_NONE,
OBJECTIVE_GUESTS_BY,
OBJECTIVE_PARK_VALUE_BY,
OBJECTIVE_HAVE_FUN,
OBJECTIVE_BUILD_THE_BEST,
OBJECTIVE_10_ROLLERCOASTERS,
OBJECTIVE_GUESTS_AND_RATING,
OBJECTIVE_MONTHLY_RIDE_INCOME,
OBJECTIVE_10_ROLLERCOASTERS_LENGTH,
OBJECTIVE_FINISH_5_ROLLERCOASTERS,
OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE,
OBJECTIVE_MONTHLY_FOOD_INCOME,
OBJECTIVE_COUNT
};
bool ObjectiveNeedsMoney(const uint8_t objective);
enum class ObjectiveStatus : uint8_t
{
Undecided,
Success,
Failure,
};
struct Objective
{
uint8_t Type;
uint8_t Year;
union
{
uint16_t NumGuests;
StringId RideId;
uint16_t MinimumLength; // For the "Build 10 coasters of minimum length" objective.
};
union
{
money64 Currency;
OpenRCT2::RideRating_t MinimumExcitement; // For the "Finish 5 coaster with a minimum excitement rating" objective.
};
bool NeedsMoney() const
{
return ObjectiveNeedsMoney(Type);
}
bool IsValid(bool useMoney, bool canAskMoneyForRides) const
{
const bool objectiveAllowedByMoneyUsage = useMoney || !NeedsMoney();
// This objective can only work if the player can ask money for rides.
const bool objectiveAllowedByPaymentSettings = (Type != OBJECTIVE_MONTHLY_RIDE_INCOME) || canAskMoneyForRides;
return objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings;
}
ObjectiveStatus Check(OpenRCT2::GameState_t& gameState) const;
private:
ObjectiveStatus CheckGuestsBy() const;
ObjectiveStatus CheckParkValueBy() const;
ObjectiveStatus Check10RollerCoasters() const;
ObjectiveStatus CheckGuestsAndRating() const;
ObjectiveStatus CheckMonthlyRideIncome() const;
ObjectiveStatus Check10RollerCoastersLength() const;
ObjectiveStatus CheckFinish5RollerCoasters() const;
ObjectiveStatus CheckRepayLoanAndParkValue() const;
ObjectiveStatus CheckMonthlyFoodIncome() const;
};
enum
{
AUTOSAVE_EVERY_MINUTE,
@@ -142,8 +35,6 @@ constexpr uint8_t kDefaultNumAutosavesToKeep = 10;
static constexpr money64 kCompanyValueOnFailedObjective = 0x8000000000000001;
extern const StringId kScenarioCategoryStringIds[EnumValue(ScenarioCategory::count)];
extern bool gAllowEarlyCompletionInNetworkPlay;
extern std::string gScenarioSavePath;
@@ -0,0 +1,20 @@
/*****************************************************************************
* Copyright (c) 2014-2025 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "ScenarioCategory.h"
#include "../localisation/StringIds.h"
namespace OpenRCT2::Scenario
{
const StringId kScenarioCategoryStringIds[EnumValue(Category::count)] = {
STR_BEGINNER_PARKS, STR_CHALLENGING_PARKS, STR_EXPERT_PARKS, STR_REAL_PARKS, STR_OTHER_PARKS,
STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS, STR_COMPETITIONS, STR_UCES_TM, STR_UCES_KD,
};
}
+37
View File
@@ -0,0 +1,37 @@
/*****************************************************************************
* Copyright (c) 2014-2025 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../core/EnumUtils.hpp"
#include "../localisation/StringIdType.h"
namespace OpenRCT2::Scenario
{
enum class Category : uint8_t
{
// RCT2 categories (keep order)
beginner,
challenging,
expert,
real,
other,
// OpenRCT2 categories
dlc,
buildYourOwn,
competitions,
timeMachine,
katysDreamworld,
count,
};
extern const StringId kScenarioCategoryStringIds[EnumValue(Category::count)];
} // namespace OpenRCT2::Scenario
+309
View File
@@ -0,0 +1,309 @@
/*****************************************************************************
* Copyright (c) 2014-2025 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "ScenarioObjective.h"
#include "../GameState.h"
#include "../config/Config.h"
#include "../core/UnitConversion.h"
#include "../object/ObjectLimits.h"
#include "../ride/RideManager.hpp"
#include "Scenario.h"
namespace OpenRCT2::Scenario
{
ObjectiveStatus Objective::CheckGuestsBy() const
{
auto parkRating = getGameState().park.rating;
int32_t currentMonthYear = GetDate().GetMonthsElapsed();
if (currentMonthYear == MONTH_COUNT * Year || AllowEarlyCompletion())
{
if (parkRating >= 600 && getGameState().park.numGuestsInPark >= NumGuests)
{
return ObjectiveStatus::Success;
}
if (currentMonthYear == MONTH_COUNT * Year)
{
return ObjectiveStatus::Failure;
}
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckParkValueBy() const
{
int32_t currentMonthYear = GetDate().GetMonthsElapsed();
money64 objectiveParkValue = Currency;
money64 parkValue = getGameState().park.value;
if (currentMonthYear == MONTH_COUNT * Year || AllowEarlyCompletion())
{
if (parkValue >= objectiveParkValue)
{
return ObjectiveStatus::Success;
}
if (currentMonthYear == MONTH_COUNT * Year)
{
return ObjectiveStatus::Failure;
}
}
return ObjectiveStatus::Undecided;
}
/**
* Checks if there are 10 rollercoasters of different subtype with
* excitement >= 600 .
* rct2:
**/
ObjectiveStatus Objective::Check10RollerCoasters() const
{
auto rcs = 0;
BitSet<kMaxRideObjects> type_already_counted;
for (const auto& ride : GetRideManager())
{
if (ride.status == RideStatus::open && ride.ratings.excitement >= RideRating::make(6, 00)
&& ride.subtype != kObjectEntryIndexNull)
{
auto rideEntry = ride.getRideEntry();
if (rideEntry != nullptr)
{
if (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && !type_already_counted[ride.subtype])
{
type_already_counted[ride.subtype] = true;
rcs++;
}
}
}
}
if (rcs >= 10)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
/**
*
* rct2: 0x0066A13C
*/
ObjectiveStatus Objective::CheckGuestsAndRating() const
{
auto& gameState = getGameState();
if (gameState.park.rating < 700 && GetDate().GetMonthsElapsed() >= 1)
{
gameState.scenarioParkRatingWarningDays++;
if (gameState.scenarioParkRatingWarningDays == 1)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_4_WEEKS_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 8)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_3_WEEKS_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 15)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_2_WEEKS_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 22)
{
if (Config::Get().notifications.ParkRatingWarnings)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_RATING_WARNING_1_WEEK_REMAINING, 0, {});
}
}
else if (gameState.scenarioParkRatingWarningDays == 29)
{
News::AddItemToQueue(News::ItemType::graph, STR_PARK_HAS_BEEN_CLOSED_DOWN, 0, {});
gameState.park.flags &= ~PARK_FLAGS_PARK_OPEN;
gameState.scenarioOptions.guestInitialHappiness = 50;
return ObjectiveStatus::Failure;
}
}
else if (gameState.scenarioCompletedCompanyValue != kCompanyValueOnFailedObjective)
{
gameState.scenarioParkRatingWarningDays = 0;
}
if (gameState.park.rating >= 700)
if (gameState.park.numGuestsInPark >= NumGuests)
return ObjectiveStatus::Success;
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckMonthlyRideIncome() const
{
money64 lastMonthRideIncome = getGameState().park.expenditureTable[1][EnumValue(ExpenditureType::parkRideTickets)];
if (lastMonthRideIncome >= Currency)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
/**
* Checks if there are 10 rollercoasters of different subtype with
* excitement > 700 and a minimum length;
* rct2: 0x0066A6B5
*/
ObjectiveStatus Objective::Check10RollerCoastersLength() const
{
BitSet<kMaxRideObjects> type_already_counted;
auto rcs = 0;
for (const auto& ride : GetRideManager())
{
if (ride.status == RideStatus::open && ride.ratings.excitement >= RideRating::make(7, 00)
&& ride.subtype != kObjectEntryIndexNull)
{
auto rideEntry = ride.getRideEntry();
if (rideEntry != nullptr)
{
if (RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster) && !type_already_counted[ride.subtype])
{
if (ToHumanReadableRideLength(ride.getTotalLength()) >= MinimumLength)
{
type_already_counted[ride.subtype] = true;
rcs++;
}
}
}
}
}
if (rcs >= 10)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckFinish5RollerCoasters() const
{
// Originally, this did not check for null rides, neither did it check if
// the rides are even rollercoasters, never mind the right rollercoasters to be finished.
auto rcs = 0;
for (const auto& ride : GetRideManager())
{
if (ride.status != RideStatus::closed && ride.ratings.excitement >= MinimumExcitement)
{
auto rideEntry = ride.getRideEntry();
if (rideEntry != nullptr)
{
if ((ride.lifecycleFlags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)
&& RideEntryHasCategory(*rideEntry, RideCategory::rollerCoaster))
{
rcs++;
}
}
}
}
if (rcs >= 5)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckRepayLoanAndParkValue() const
{
const auto& gameState = getGameState();
money64 parkValue = gameState.park.value;
money64 currentLoan = gameState.park.bankLoan;
if (currentLoan <= 0 && parkValue >= Currency)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
ObjectiveStatus Objective::CheckMonthlyFoodIncome() const
{
const auto* lastMonthExpenditure = getGameState().park.expenditureTable[1];
auto lastMonthProfit = lastMonthExpenditure[EnumValue(ExpenditureType::shopSales)]
+ lastMonthExpenditure[EnumValue(ExpenditureType::shopStock)]
+ lastMonthExpenditure[EnumValue(ExpenditureType::foodDrinkSales)]
+ lastMonthExpenditure[EnumValue(ExpenditureType::foodDrinkStock)];
if (lastMonthProfit >= Currency)
{
return ObjectiveStatus::Success;
}
return ObjectiveStatus::Undecided;
}
/**
* Checks the win/lose conditions of the current objective.
* rct2: 0x0066A4B2
*/
ObjectiveStatus Objective::Check(GameState_t& gameState) const
{
if (gameState.scenarioCompletedCompanyValue != kMoney64Undefined)
{
return ObjectiveStatus::Undecided;
}
switch (Type)
{
case ObjectiveType::guestsBy:
return CheckGuestsBy();
case ObjectiveType::parkValueBy:
return CheckParkValueBy();
case ObjectiveType::tenRollercoasters:
return Check10RollerCoasters();
case ObjectiveType::guestsAndRating:
return CheckGuestsAndRating();
case ObjectiveType::monthlyRideIncome:
return CheckMonthlyRideIncome();
case ObjectiveType::tenRollercoastersLength:
return Check10RollerCoastersLength();
case ObjectiveType::finishFiveRollercoasters:
return CheckFinish5RollerCoasters();
case ObjectiveType::repayLoanAndParkValue:
return CheckRepayLoanAndParkValue();
case ObjectiveType::monthlyFoodIncome:
return CheckMonthlyFoodIncome();
default:
return ObjectiveStatus::Undecided;
}
}
bool ObjectiveNeedsMoney(const ObjectiveType objective)
{
switch (objective)
{
case ObjectiveType::parkValueBy:
case ObjectiveType::monthlyRideIncome:
case ObjectiveType::repayLoanAndParkValue:
case ObjectiveType::monthlyFoodIncome:
return true;
default:
return false;
}
}
} // namespace OpenRCT2::Scenario
+92
View File
@@ -0,0 +1,92 @@
/*****************************************************************************
* Copyright (c) 2014-2025 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../core/Money.hpp"
#include "../localisation/StringIdType.h"
#include "../ride/RideRatings.h"
namespace OpenRCT2
{
struct GameState_t;
}
namespace OpenRCT2::Scenario
{
enum class ObjectiveType : uint8_t
{
none,
guestsBy,
parkValueBy,
haveFun,
buildTheBest,
tenRollercoasters,
guestsAndRating,
monthlyRideIncome,
tenRollercoastersLength,
finishFiveRollercoasters,
repayLoanAndParkValue,
monthlyFoodIncome,
count
};
bool ObjectiveNeedsMoney(const ObjectiveType objective);
enum class ObjectiveStatus : uint8_t
{
Undecided,
Success,
Failure,
};
struct Objective
{
ObjectiveType Type;
uint8_t Year;
union
{
uint16_t NumGuests;
StringId RideId;
uint16_t MinimumLength; // For the "Build 10 coasters of minimum length" objective.
};
union
{
money64 Currency;
RideRating_t MinimumExcitement; // For the "Finish 5 coaster with a minimum excitement rating" objective.
};
bool NeedsMoney() const
{
return ObjectiveNeedsMoney(Type);
}
bool IsValid(bool useMoney, bool canAskMoneyForRides) const
{
const bool objectiveAllowedByMoneyUsage = useMoney || !NeedsMoney();
// This objective can only work if the player can ask money for rides.
const bool objectiveAllowedByPaymentSettings = (Type != ObjectiveType::monthlyRideIncome) || canAskMoneyForRides;
return objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings;
}
ObjectiveStatus Check(GameState_t& gameState) const;
private:
ObjectiveStatus CheckGuestsBy() const;
ObjectiveStatus CheckParkValueBy() const;
ObjectiveStatus Check10RollerCoasters() const;
ObjectiveStatus CheckGuestsAndRating() const;
ObjectiveStatus CheckMonthlyRideIncome() const;
ObjectiveStatus Check10RollerCoastersLength() const;
ObjectiveStatus CheckFinish5RollerCoasters() const;
ObjectiveStatus CheckRepayLoanAndParkValue() const;
ObjectiveStatus CheckMonthlyFoodIncome() const;
};
} // namespace OpenRCT2::Scenario
+3 -2
View File
@@ -10,7 +10,8 @@
#pragma once
#include "../core/Money.hpp"
#include "Scenario.h"
#include "ScenarioCategory.h"
#include "ScenarioObjective.h"
#include <string>
@@ -19,7 +20,7 @@ namespace OpenRCT2::Scenario
struct Options
{
Objective objective;
ScenarioCategory category;
Category category;
std::string name;
std::string details;
+8 -7
View File
@@ -30,6 +30,7 @@
#include "../rct2/RCT2.h"
#include "../sawyer_coding/SawyerChunkReader.h"
#include "Scenario.h"
#include "ScenarioCategory.h"
#include "ScenarioSources.h"
#include <memory>
@@ -38,17 +39,17 @@
using namespace OpenRCT2;
static int32_t ScenarioCategoryCompare(ScenarioCategory categoryA, ScenarioCategory categoryB)
static int32_t ScenarioCategoryCompare(Scenario::Category categoryA, Scenario::Category categoryB)
{
if (categoryA == categoryB)
return 0;
if (categoryA == ScenarioCategory::dlc)
if (categoryA == Scenario::Category::dlc)
return -1;
if (categoryB == ScenarioCategory::dlc)
if (categoryB == Scenario::Category::dlc)
return 1;
if (categoryA == ScenarioCategory::buildYourOwn)
if (categoryA == Scenario::Category::buildYourOwn)
return -1;
if (categoryB == ScenarioCategory::buildYourOwn)
if (categoryB == Scenario::Category::buildYourOwn)
return 1;
if (categoryA < categoryB)
return -1;
@@ -72,8 +73,8 @@ static int32_t ScenarioIndexEntryCompareByCategory(const ScenarioIndexEntry& ent
return static_cast<int32_t>(entryA.SourceGame) - static_cast<int32_t>(entryB.SourceGame);
}
return strcmp(entryA.Name.c_str(), entryB.Name.c_str());
case ScenarioCategory::real:
case ScenarioCategory::other:
case Scenario::Category::real:
case Scenario::Category::other:
return strcmp(entryA.Name.c_str(), entryB.Name.c_str());
}
}
+8 -3
View File
@@ -12,11 +12,16 @@
#include "../core/DateTime.h"
#include "../core/Money.hpp"
#include "../core/StringTypes.h"
#include "ScenarioObjective.h"
#include <memory>
struct RCTObjectEntry;
enum class ScenarioCategory : uint8_t;
namespace OpenRCT2::Scenario
{
enum class Category : uint8_t;
}
struct ScenarioHighscoreEntry
{
@@ -46,13 +51,13 @@ struct ScenarioIndexEntry
uint64_t Timestamp;
// Category / sequence
ScenarioCategory Category;
OpenRCT2::Scenario::Category Category;
ScenarioSource SourceGame;
int16_t SourceIndex = -1;
uint16_t ScenarioId;
// Objective
uint8_t ObjectiveType;
OpenRCT2::Scenario::ObjectiveType ObjectiveType;
uint8_t ObjectiveArg1; // years
int64_t ObjectiveArg2; // money or excitement
uint16_t ObjectiveArg3; // guests or rideID or coasterLength
+184 -184
View File
@@ -12,7 +12,7 @@
#include "../Diagnostic.h"
#include "../core/Guard.hpp"
#include "../core/String.hpp"
#include "Scenario.h"
#include "ScenarioCategory.h"
#include "ScenarioRepository.h"
#include <iterator>
@@ -30,7 +30,7 @@ namespace OpenRCT2::ScenarioSources
{
const uint8_t Id;
const utf8* Title;
const ScenarioCategory Category;
const Scenario::Category Category;
u8string_view TextObjectId;
};
@@ -121,226 +121,226 @@ namespace OpenRCT2::ScenarioSources
// RCT
static constexpr ScenarioTitleDescriptor kScenarioTitlesRCT1[] =
{
{ SC_FOREST_FRONTIERS, "Forest Frontiers", ScenarioCategory::beginner, "rct1.scenario_meta.forest_frontiers" },
{ SC_DYNAMITE_DUNES, "Dynamite Dunes", ScenarioCategory::beginner, "rct1.scenario_meta.dynamite_dunes" },
{ SC_LEAFY_LAKE, "Leafy Lake", ScenarioCategory::beginner, "rct1.scenario_meta.leafy_lake" },
{ SC_DIAMOND_HEIGHTS, "Diamond Heights", ScenarioCategory::beginner, "rct1.scenario_meta.diamond_heights" },
{ SC_EVERGREEN_GARDENS, "Evergreen Gardens", ScenarioCategory::beginner, "rct1.scenario_meta.evergreen_gardens" },
{ SC_BUMBLY_BEACH, "Bumbly Beach", ScenarioCategory::beginner, "rct1.scenario_meta.bumbly_beach" },
{ SC_TRINITY_ISLANDS, "Trinity Islands", ScenarioCategory::challenging, "rct1.scenario_meta.trinity_islands" },
{ SC_KATIES_DREAMLAND, "Katie's Dreamland", ScenarioCategory::challenging, "rct1.scenario_meta.katies_dreamland" },
{ SC_POKEY_PARK, "Pokey Park", ScenarioCategory::challenging, "rct1.scenario_meta.pokey_park" },
{ SC_WHITE_WATER_PARK, "White Water Park", ScenarioCategory::challenging, "rct1.scenario_meta.white_water_park" },
{ SC_MILLENNIUM_MINES, "Millennium Mines", ScenarioCategory::challenging, "rct1.scenario_meta.millennium_mines" },
{ SC_KARTS_COASTERS, "Karts & Coasters", ScenarioCategory::challenging, "rct1.scenario_meta.karts_coasters" },
{ SC_MELS_WORLD, "Mel's World", ScenarioCategory::challenging, "rct1.scenario_meta.mels_world" },
{ SC_MYSTIC_MOUNTAIN, "Mystic Mountain", ScenarioCategory::challenging, "rct1.scenario_meta.mystic_mountain" },
{ SC_PACIFIC_PYRAMIDS, "Pacific Pyramids", ScenarioCategory::challenging, "rct1.scenario_meta.pacific_pyramids" },
{ SC_CRUMBLY_WOODS, "Crumbly Woods", ScenarioCategory::challenging, "rct1.scenario_meta.crumbly_woods" },
{ SC_PARADISE_PIER, "Paradise Pier", ScenarioCategory::challenging, "rct1.scenario_meta.paradise_pier" },
{ SC_LIGHTNING_PEAKS, "Lightning Peaks", ScenarioCategory::expert, "rct1.scenario_meta.lightning_peaks" },
{ SC_IVORY_TOWERS, "Ivory Towers", ScenarioCategory::expert, "rct1.scenario_meta.ivory_towers" },
{ SC_RAINBOW_VALLEY, "Rainbow Valley", ScenarioCategory::expert, "rct1.scenario_meta.rainbow_valley" },
{ SC_THUNDER_ROCK, "Thunder Rock", ScenarioCategory::expert, "rct1.scenario_meta.thunder_rock" },
{ SC_MEGA_PARK, "Mega Park", ScenarioCategory::other, "rct1.scenario_meta.mega_park" },
{ SC_FOREST_FRONTIERS, "Forest Frontiers", Scenario::Category::beginner, "rct1.scenario_meta.forest_frontiers" },
{ SC_DYNAMITE_DUNES, "Dynamite Dunes", Scenario::Category::beginner, "rct1.scenario_meta.dynamite_dunes" },
{ SC_LEAFY_LAKE, "Leafy Lake", Scenario::Category::beginner, "rct1.scenario_meta.leafy_lake" },
{ SC_DIAMOND_HEIGHTS, "Diamond Heights", Scenario::Category::beginner, "rct1.scenario_meta.diamond_heights" },
{ SC_EVERGREEN_GARDENS, "Evergreen Gardens", Scenario::Category::beginner, "rct1.scenario_meta.evergreen_gardens" },
{ SC_BUMBLY_BEACH, "Bumbly Beach", Scenario::Category::beginner, "rct1.scenario_meta.bumbly_beach" },
{ SC_TRINITY_ISLANDS, "Trinity Islands", Scenario::Category::challenging, "rct1.scenario_meta.trinity_islands" },
{ SC_KATIES_DREAMLAND, "Katie's Dreamland", Scenario::Category::challenging, "rct1.scenario_meta.katies_dreamland" },
{ SC_POKEY_PARK, "Pokey Park", Scenario::Category::challenging, "rct1.scenario_meta.pokey_park" },
{ SC_WHITE_WATER_PARK, "White Water Park", Scenario::Category::challenging, "rct1.scenario_meta.white_water_park" },
{ SC_MILLENNIUM_MINES, "Millennium Mines", Scenario::Category::challenging, "rct1.scenario_meta.millennium_mines" },
{ SC_KARTS_COASTERS, "Karts & Coasters", Scenario::Category::challenging, "rct1.scenario_meta.karts_coasters" },
{ SC_MELS_WORLD, "Mel's World", Scenario::Category::challenging, "rct1.scenario_meta.mels_world" },
{ SC_MYSTIC_MOUNTAIN, "Mystic Mountain", Scenario::Category::challenging, "rct1.scenario_meta.mystic_mountain" },
{ SC_PACIFIC_PYRAMIDS, "Pacific Pyramids", Scenario::Category::challenging, "rct1.scenario_meta.pacific_pyramids" },
{ SC_CRUMBLY_WOODS, "Crumbly Woods", Scenario::Category::challenging, "rct1.scenario_meta.crumbly_woods" },
{ SC_PARADISE_PIER, "Paradise Pier", Scenario::Category::challenging, "rct1.scenario_meta.paradise_pier" },
{ SC_LIGHTNING_PEAKS, "Lightning Peaks", Scenario::Category::expert, "rct1.scenario_meta.lightning_peaks" },
{ SC_IVORY_TOWERS, "Ivory Towers", Scenario::Category::expert, "rct1.scenario_meta.ivory_towers" },
{ SC_RAINBOW_VALLEY, "Rainbow Valley", Scenario::Category::expert, "rct1.scenario_meta.rainbow_valley" },
{ SC_THUNDER_ROCK, "Thunder Rock", Scenario::Category::expert, "rct1.scenario_meta.thunder_rock" },
{ SC_MEGA_PARK, "Mega Park", Scenario::Category::other, "rct1.scenario_meta.mega_park" },
};
// RCT: Added Attractions
static constexpr ScenarioTitleDescriptor kScenarioTitlesRCT1AA[] =
{
{ SC_WHISPERING_CLIFFS, "Whispering Cliffs", ScenarioCategory::beginner, "rct1aa.scenario_meta.whispering_cliffs" },
{ SC_THREE_MONKEYS_PARK, "Three Monkeys Park", ScenarioCategory::beginner, "rct1aa.scenario_meta.three_monkeys_park" },
{ SC_CANARY_MINES, "Canary Mines", ScenarioCategory::beginner, "rct1aa.scenario_meta.canary_mines" },
{ SC_BARONY_BRIDGE, "Barony Bridge", ScenarioCategory::beginner, "rct1aa.scenario_meta.barony_bridge" },
{ SC_FUNTOPIA, "Funtopia", ScenarioCategory::beginner, "rct1aa.scenario_meta.funtopia" },
{ SC_HAUNTED_HARBOUR, "Haunted Harbour", ScenarioCategory::beginner, "rct1aa.scenario_meta.haunted_harbour" },
{ SC_FUN_FORTRESS, "Fun Fortress", ScenarioCategory::beginner, "rct1aa.scenario_meta.fun_fortress" },
{ SC_FUTURE_WORLD, "Future World", ScenarioCategory::beginner, "rct1aa.scenario_meta.future_world" },
{ SC_GENTLE_GLEN, "Gentle Glen", ScenarioCategory::beginner, "rct1aa.scenario_meta.gentle_glen" },
{ SC_JOLLY_JUNGLE, "Jolly Jungle", ScenarioCategory::challenging, "rct1aa.scenario_meta.jolly_jungle" },
{ SC_HYDRO_HILLS, "Hydro Hills", ScenarioCategory::challenging, "rct1aa.scenario_meta.hydro_hills" },
{ SC_SPRIGHTLY_PARK, "Sprightly Park", ScenarioCategory::challenging, "rct1aa.scenario_meta.sprightly_park" },
{ SC_MAGIC_QUARTERS, "Magic Quarters", ScenarioCategory::challenging, "rct1aa.scenario_meta.magic_quarters" },
{ SC_FRUIT_FARM, "Fruit Farm", ScenarioCategory::challenging, "rct1aa.scenario_meta.fruit_farm" },
{ SC_BUTTERFLY_DAM, "Butterfly Dam", ScenarioCategory::challenging, "rct1aa.scenario_meta.butterfly_dam" },
{ SC_COASTER_CANYON, "Coaster Canyon", ScenarioCategory::challenging, "rct1aa.scenario_meta.coaster_canyon" },
{ SC_THUNDERSTORM_PARK, "Thunderstorm Park", ScenarioCategory::challenging, "rct1aa.scenario_meta.thunderstorm_park" },
{ SC_HARMONIC_HILLS, "Harmonic Hills", ScenarioCategory::challenging, "rct1aa.scenario_meta.harmonic_hills" },
{ SC_ROMAN_VILLAGE, "Roman Village", ScenarioCategory::challenging, "rct1aa.scenario_meta.roman_village" },
{ SC_SWAMP_COVE, "Swamp Cove", ScenarioCategory::challenging, "rct1aa.scenario_meta.swamp_cove" },
{ SC_ADRENALINE_HEIGHTS, "Adrenaline Heights", ScenarioCategory::challenging, "rct1aa.scenario_meta.adrenaline_heights" },
{ SC_UTOPIA_PARK, "Utopia Park", ScenarioCategory::challenging, "rct1aa.scenario_meta.utopia_park" },
{ SC_ROTTING_HEIGHTS, "Rotting Heights", ScenarioCategory::expert, "rct1aa.scenario_meta.rotting_heights" },
{ SC_FIASCO_FOREST, "Fiasco Forest", ScenarioCategory::expert, "rct1aa.scenario_meta.fiasco_forest" },
{ SC_PICKLE_PARK, "Pickle Park", ScenarioCategory::expert, "rct1aa.scenario_meta.pickle_park" },
{ SC_GIGGLE_DOWNS, "Giggle Downs", ScenarioCategory::expert, "rct1aa.scenario_meta.giggle_downs" },
{ SC_MINERAL_PARK, "Mineral Park", ScenarioCategory::expert, "rct1aa.scenario_meta.mineral_park" },
{ SC_COASTER_CRAZY, "Coaster Crazy", ScenarioCategory::expert, "rct1aa.scenario_meta.coaster_crazy" },
{ SC_URBAN_PARK, "Urban Park", ScenarioCategory::expert, "rct1aa.scenario_meta.urban_park" },
{ SC_GEOFFREY_GARDENS, "Geoffrey Gardens", ScenarioCategory::expert, "rct1aa.scenario_meta.geoffrey_gardens" },
{ SC_WHISPERING_CLIFFS, "Whispering Cliffs", Scenario::Category::beginner, "rct1aa.scenario_meta.whispering_cliffs" },
{ SC_THREE_MONKEYS_PARK, "Three Monkeys Park", Scenario::Category::beginner, "rct1aa.scenario_meta.three_monkeys_park" },
{ SC_CANARY_MINES, "Canary Mines", Scenario::Category::beginner, "rct1aa.scenario_meta.canary_mines" },
{ SC_BARONY_BRIDGE, "Barony Bridge", Scenario::Category::beginner, "rct1aa.scenario_meta.barony_bridge" },
{ SC_FUNTOPIA, "Funtopia", Scenario::Category::beginner, "rct1aa.scenario_meta.funtopia" },
{ SC_HAUNTED_HARBOUR, "Haunted Harbour", Scenario::Category::beginner, "rct1aa.scenario_meta.haunted_harbour" },
{ SC_FUN_FORTRESS, "Fun Fortress", Scenario::Category::beginner, "rct1aa.scenario_meta.fun_fortress" },
{ SC_FUTURE_WORLD, "Future World", Scenario::Category::beginner, "rct1aa.scenario_meta.future_world" },
{ SC_GENTLE_GLEN, "Gentle Glen", Scenario::Category::beginner, "rct1aa.scenario_meta.gentle_glen" },
{ SC_JOLLY_JUNGLE, "Jolly Jungle", Scenario::Category::challenging, "rct1aa.scenario_meta.jolly_jungle" },
{ SC_HYDRO_HILLS, "Hydro Hills", Scenario::Category::challenging, "rct1aa.scenario_meta.hydro_hills" },
{ SC_SPRIGHTLY_PARK, "Sprightly Park", Scenario::Category::challenging, "rct1aa.scenario_meta.sprightly_park" },
{ SC_MAGIC_QUARTERS, "Magic Quarters", Scenario::Category::challenging, "rct1aa.scenario_meta.magic_quarters" },
{ SC_FRUIT_FARM, "Fruit Farm", Scenario::Category::challenging, "rct1aa.scenario_meta.fruit_farm" },
{ SC_BUTTERFLY_DAM, "Butterfly Dam", Scenario::Category::challenging, "rct1aa.scenario_meta.butterfly_dam" },
{ SC_COASTER_CANYON, "Coaster Canyon", Scenario::Category::challenging, "rct1aa.scenario_meta.coaster_canyon" },
{ SC_THUNDERSTORM_PARK, "Thunderstorm Park", Scenario::Category::challenging, "rct1aa.scenario_meta.thunderstorm_park" },
{ SC_HARMONIC_HILLS, "Harmonic Hills", Scenario::Category::challenging, "rct1aa.scenario_meta.harmonic_hills" },
{ SC_ROMAN_VILLAGE, "Roman Village", Scenario::Category::challenging, "rct1aa.scenario_meta.roman_village" },
{ SC_SWAMP_COVE, "Swamp Cove", Scenario::Category::challenging, "rct1aa.scenario_meta.swamp_cove" },
{ SC_ADRENALINE_HEIGHTS, "Adrenaline Heights", Scenario::Category::challenging, "rct1aa.scenario_meta.adrenaline_heights" },
{ SC_UTOPIA_PARK, "Utopia Park", Scenario::Category::challenging, "rct1aa.scenario_meta.utopia_park" },
{ SC_ROTTING_HEIGHTS, "Rotting Heights", Scenario::Category::expert, "rct1aa.scenario_meta.rotting_heights" },
{ SC_FIASCO_FOREST, "Fiasco Forest", Scenario::Category::expert, "rct1aa.scenario_meta.fiasco_forest" },
{ SC_PICKLE_PARK, "Pickle Park", Scenario::Category::expert, "rct1aa.scenario_meta.pickle_park" },
{ SC_GIGGLE_DOWNS, "Giggle Downs", Scenario::Category::expert, "rct1aa.scenario_meta.giggle_downs" },
{ SC_MINERAL_PARK, "Mineral Park", Scenario::Category::expert, "rct1aa.scenario_meta.mineral_park" },
{ SC_COASTER_CRAZY, "Coaster Crazy", Scenario::Category::expert, "rct1aa.scenario_meta.coaster_crazy" },
{ SC_URBAN_PARK, "Urban Park", Scenario::Category::expert, "rct1aa.scenario_meta.urban_park" },
{ SC_GEOFFREY_GARDENS, "Geoffrey Gardens", Scenario::Category::expert, "rct1aa.scenario_meta.geoffrey_gardens" },
};
// RCT: Loopy Landscapes
static constexpr ScenarioTitleDescriptor kScenarioTitlesRCT1LL[] =
{
{ SC_ICEBERG_ISLANDS, "Iceberg Islands", ScenarioCategory::beginner, "rct1ll.scenario_meta.iceberg_islands" },
{ SC_VOLCANIA, "Volcania", ScenarioCategory::beginner, "rct1ll.scenario_meta.volcania" },
{ SC_ARID_HEIGHTS, "Arid Heights", ScenarioCategory::beginner, "rct1ll.scenario_meta.arid_heights" },
{ SC_RAZOR_ROCKS, "Razor Rocks", ScenarioCategory::beginner, "rct1ll.scenario_meta.razor_rocks" },
{ SC_CRATER_LAKE, "Crater Lake", ScenarioCategory::beginner, "rct1ll.scenario_meta.crater_lake" },
{ SC_VERTIGO_VIEWS, "Vertigo Views", ScenarioCategory::beginner, "rct1ll.scenario_meta.vertigo_views" },
{ SC_PARADISE_PIER_2, "Paradise Pier 2", ScenarioCategory::challenging, "rct1ll.scenario_meta.paradise_pier_2" },
{ SC_DRAGONS_COVE, "Dragon's Cove", ScenarioCategory::challenging, "rct1ll.scenario_meta.dragons_cove" },
{ SC_GOOD_KNIGHT_PARK, "Good Knight Park", ScenarioCategory::challenging, "rct1ll.scenario_meta.good_knight_park" },
{ SC_WACKY_WARREN, "Wacky Warren", ScenarioCategory::challenging, "rct1ll.scenario_meta.wacky_warren" },
{ SC_GRAND_GLACIER, "Grand Glacier", ScenarioCategory::challenging, "rct1ll.scenario_meta.grand_glacier" },
{ SC_CRAZY_CRATERS, "Crazy Craters", ScenarioCategory::challenging, "rct1ll.scenario_meta.crazy_craters" },
{ SC_DUSTY_DESERT, "Dusty Desert", ScenarioCategory::challenging, "rct1ll.scenario_meta.dusty_desert" },
{ SC_WOODWORM_PARK, "Woodworm Park", ScenarioCategory::challenging, "rct1ll.scenario_meta.woodworm_park" },
{ SC_ICARUS_PARK, "Icarus Park", ScenarioCategory::challenging, "rct1ll.scenario_meta.icarus_park" },
{ SC_SUNNY_SWAMPS, "Sunny Swamps", ScenarioCategory::challenging, "rct1ll.scenario_meta.sunny_swamps" },
{ SC_FRIGHTMARE_HILLS, "Frightmare Hills", ScenarioCategory::challenging, "rct1ll.scenario_meta.frightmare_hills" },
{ SC_THUNDER_ROCKS, "Thunder Rocks", ScenarioCategory::challenging, "rct1ll.scenario_meta.thunder_rocks" },
{ SC_OCTAGON_PARK, "Octagon Park", ScenarioCategory::challenging, "rct1ll.scenario_meta.octagon_park" },
{ SC_PLEASURE_ISLAND, "Pleasure Island", ScenarioCategory::challenging, "rct1ll.scenario_meta.pleasure_island" },
{ SC_ICICLE_WORLDS, "Icicle Worlds", ScenarioCategory::challenging, "rct1ll.scenario_meta.icicle_worlds" },
{ SC_SOUTHERN_SANDS, "Southern Sands", ScenarioCategory::expert, "rct1ll.scenario_meta.southern_sands" },
{ SC_TINY_TOWERS, "Tiny Towers", ScenarioCategory::expert, "rct1ll.scenario_meta.tiny_towers" },
{ SC_NEVERMORE_PARK, "Nevermore Park", ScenarioCategory::expert, "rct1ll.scenario_meta.nevermore_park" },
{ SC_PACIFICA, "Pacifica", ScenarioCategory::expert, "rct1ll.scenario_meta.pacifica" },
{ SC_URBAN_JUNGLE, "Urban Jungle", ScenarioCategory::expert, "rct1ll.scenario_meta.urban_jungle" },
{ SC_TERROR_TOWN, "Terror Town", ScenarioCategory::expert, "rct1ll.scenario_meta.terror_town" },
{ SC_MEGAWORLD_PARK, "Megaworld Park", ScenarioCategory::expert, "rct1ll.scenario_meta.megaworld_park" },
{ SC_VENUS_PONDS, "Venus Ponds", ScenarioCategory::expert, "rct1ll.scenario_meta.venus_ponds" },
{ SC_MICRO_PARK, "Micro Park", ScenarioCategory::expert, "rct1ll.scenario_meta.micro_park" },
{ SC_ICEBERG_ISLANDS, "Iceberg Islands", Scenario::Category::beginner, "rct1ll.scenario_meta.iceberg_islands" },
{ SC_VOLCANIA, "Volcania", Scenario::Category::beginner, "rct1ll.scenario_meta.volcania" },
{ SC_ARID_HEIGHTS, "Arid Heights", Scenario::Category::beginner, "rct1ll.scenario_meta.arid_heights" },
{ SC_RAZOR_ROCKS, "Razor Rocks", Scenario::Category::beginner, "rct1ll.scenario_meta.razor_rocks" },
{ SC_CRATER_LAKE, "Crater Lake", Scenario::Category::beginner, "rct1ll.scenario_meta.crater_lake" },
{ SC_VERTIGO_VIEWS, "Vertigo Views", Scenario::Category::beginner, "rct1ll.scenario_meta.vertigo_views" },
{ SC_PARADISE_PIER_2, "Paradise Pier 2", Scenario::Category::challenging, "rct1ll.scenario_meta.paradise_pier_2" },
{ SC_DRAGONS_COVE, "Dragon's Cove", Scenario::Category::challenging, "rct1ll.scenario_meta.dragons_cove" },
{ SC_GOOD_KNIGHT_PARK, "Good Knight Park", Scenario::Category::challenging, "rct1ll.scenario_meta.good_knight_park" },
{ SC_WACKY_WARREN, "Wacky Warren", Scenario::Category::challenging, "rct1ll.scenario_meta.wacky_warren" },
{ SC_GRAND_GLACIER, "Grand Glacier", Scenario::Category::challenging, "rct1ll.scenario_meta.grand_glacier" },
{ SC_CRAZY_CRATERS, "Crazy Craters", Scenario::Category::challenging, "rct1ll.scenario_meta.crazy_craters" },
{ SC_DUSTY_DESERT, "Dusty Desert", Scenario::Category::challenging, "rct1ll.scenario_meta.dusty_desert" },
{ SC_WOODWORM_PARK, "Woodworm Park", Scenario::Category::challenging, "rct1ll.scenario_meta.woodworm_park" },
{ SC_ICARUS_PARK, "Icarus Park", Scenario::Category::challenging, "rct1ll.scenario_meta.icarus_park" },
{ SC_SUNNY_SWAMPS, "Sunny Swamps", Scenario::Category::challenging, "rct1ll.scenario_meta.sunny_swamps" },
{ SC_FRIGHTMARE_HILLS, "Frightmare Hills", Scenario::Category::challenging, "rct1ll.scenario_meta.frightmare_hills" },
{ SC_THUNDER_ROCKS, "Thunder Rocks", Scenario::Category::challenging, "rct1ll.scenario_meta.thunder_rocks" },
{ SC_OCTAGON_PARK, "Octagon Park", Scenario::Category::challenging, "rct1ll.scenario_meta.octagon_park" },
{ SC_PLEASURE_ISLAND, "Pleasure Island", Scenario::Category::challenging, "rct1ll.scenario_meta.pleasure_island" },
{ SC_ICICLE_WORLDS, "Icicle Worlds", Scenario::Category::challenging, "rct1ll.scenario_meta.icicle_worlds" },
{ SC_SOUTHERN_SANDS, "Southern Sands", Scenario::Category::expert, "rct1ll.scenario_meta.southern_sands" },
{ SC_TINY_TOWERS, "Tiny Towers", Scenario::Category::expert, "rct1ll.scenario_meta.tiny_towers" },
{ SC_NEVERMORE_PARK, "Nevermore Park", Scenario::Category::expert, "rct1ll.scenario_meta.nevermore_park" },
{ SC_PACIFICA, "Pacifica", Scenario::Category::expert, "rct1ll.scenario_meta.pacifica" },
{ SC_URBAN_JUNGLE, "Urban Jungle", Scenario::Category::expert, "rct1ll.scenario_meta.urban_jungle" },
{ SC_TERROR_TOWN, "Terror Town", Scenario::Category::expert, "rct1ll.scenario_meta.terror_town" },
{ SC_MEGAWORLD_PARK, "Megaworld Park", Scenario::Category::expert, "rct1ll.scenario_meta.megaworld_park" },
{ SC_VENUS_PONDS, "Venus Ponds", Scenario::Category::expert, "rct1ll.scenario_meta.venus_ponds" },
{ SC_MICRO_PARK, "Micro Park", Scenario::Category::expert, "rct1ll.scenario_meta.micro_park" },
};
// RCT2
static constexpr ScenarioTitleDescriptor kScenarioTitlesRCT2[] =
{
{ SC_UNIDENTIFIED, "Electric Fields", ScenarioCategory::beginner, "rct2.scenario_meta.electric_fields" },
{ SC_UNIDENTIFIED, "Factory Capers", ScenarioCategory::beginner, "rct2.scenario_meta.factory_capers" },
{ SC_UNIDENTIFIED, "Crazy Castle", ScenarioCategory::beginner, "rct2.scenario_meta.crazy_castle" },
{ SC_UNIDENTIFIED, "Dusty Greens", ScenarioCategory::beginner, "rct2.scenario_meta.dusty_greens" },
{ SC_UNIDENTIFIED, "Bumbly Bazaar", ScenarioCategory::beginner, "rct2.scenario_meta.bumbly_bazaar" },
{ SC_UNIDENTIFIED, "Infernal Views", ScenarioCategory::challenging, "rct2.scenario_meta.infernal_views" },
{ SC_UNIDENTIFIED, "Lucky Lake", ScenarioCategory::challenging, "rct2.scenario_meta.lucky_lake" },
{ SC_UNIDENTIFIED, "Botany Breakers", ScenarioCategory::challenging, "rct2.scenario_meta.botany_breakers" },
{ SC_UNIDENTIFIED, "Alpine Adventures", ScenarioCategory::challenging, "rct2.scenario_meta.alpine_adventures" },
{ SC_UNIDENTIFIED, "Gravity Gardens", ScenarioCategory::expert, "rct2.scenario_meta.gravity_gardens" },
{ SC_UNIDENTIFIED, "Extreme Heights", ScenarioCategory::expert, "rct2.scenario_meta.extreme_heights" },
{ SC_UNIDENTIFIED, "Amity Airfield", ScenarioCategory::expert, "rct2.scenario_meta.amity_airfield" },
{ SC_UNIDENTIFIED, "Ghost Town", ScenarioCategory::expert, "rct2.scenario_meta.ghost_town" },
{ SC_UNIDENTIFIED, "Fungus Woods", ScenarioCategory::expert, "rct2.scenario_meta.fungus_woods" },
{ SC_UNIDENTIFIED, "Rainbow Summit", ScenarioCategory::expert, "rct2.scenario_meta.rainbow_summit" },
{ SC_UNIDENTIFIED, "Electric Fields", Scenario::Category::beginner, "rct2.scenario_meta.electric_fields" },
{ SC_UNIDENTIFIED, "Factory Capers", Scenario::Category::beginner, "rct2.scenario_meta.factory_capers" },
{ SC_UNIDENTIFIED, "Crazy Castle", Scenario::Category::beginner, "rct2.scenario_meta.crazy_castle" },
{ SC_UNIDENTIFIED, "Dusty Greens", Scenario::Category::beginner, "rct2.scenario_meta.dusty_greens" },
{ SC_UNIDENTIFIED, "Bumbly Bazaar", Scenario::Category::beginner, "rct2.scenario_meta.bumbly_bazaar" },
{ SC_UNIDENTIFIED, "Infernal Views", Scenario::Category::challenging, "rct2.scenario_meta.infernal_views" },
{ SC_UNIDENTIFIED, "Lucky Lake", Scenario::Category::challenging, "rct2.scenario_meta.lucky_lake" },
{ SC_UNIDENTIFIED, "Botany Breakers", Scenario::Category::challenging, "rct2.scenario_meta.botany_breakers" },
{ SC_UNIDENTIFIED, "Alpine Adventures", Scenario::Category::challenging, "rct2.scenario_meta.alpine_adventures" },
{ SC_UNIDENTIFIED, "Gravity Gardens", Scenario::Category::expert, "rct2.scenario_meta.gravity_gardens" },
{ SC_UNIDENTIFIED, "Extreme Heights", Scenario::Category::expert, "rct2.scenario_meta.extreme_heights" },
{ SC_UNIDENTIFIED, "Amity Airfield", Scenario::Category::expert, "rct2.scenario_meta.amity_airfield" },
{ SC_UNIDENTIFIED, "Ghost Town", Scenario::Category::expert, "rct2.scenario_meta.ghost_town" },
{ SC_UNIDENTIFIED, "Fungus Woods", Scenario::Category::expert, "rct2.scenario_meta.fungus_woods" },
{ SC_UNIDENTIFIED, "Rainbow Summit", Scenario::Category::expert, "rct2.scenario_meta.rainbow_summit" },
};
// RCT2: Wacky Worlds
static constexpr ScenarioTitleDescriptor kScenarioTitlesRCT2WW[] =
{
{ SC_UNIDENTIFIED, "North America - Grand Canyon", ScenarioCategory::beginner, "rct2ww.scenario_meta.canyon_calamities" },
{ SC_UNIDENTIFIED, "Asia - Great Wall of China Tourism Enhancement", ScenarioCategory::beginner, "rct2ww.scenario_meta.great_wall_of_china" },
{ SC_UNIDENTIFIED, "Africa - African Diamond Mine", ScenarioCategory::beginner, "rct2ww.scenario_meta.mines_of_africa" },
{ SC_UNIDENTIFIED, "Australasia - Ayers Rock", ScenarioCategory::beginner, "rct2ww.scenario_meta.ayers_adventure" },
{ SC_UNIDENTIFIED, "North America - Rollercoaster Heaven", ScenarioCategory::beginner, "rct2ww.scenario_meta.rollercoaster_heaven" },
{ SC_UNIDENTIFIED, "Africa - Oasis", ScenarioCategory::challenging, "rct2ww.scenario_meta.mirage_madness" },
{ SC_UNIDENTIFIED, "South America - Rio Carnival", ScenarioCategory::challenging, "rct2ww.scenario_meta.sugarloaf_shores" },
{ SC_UNIDENTIFIED, "Asia - Maharaja Palace", ScenarioCategory::challenging, "rct2ww.scenario_meta.park_maharaja" },
{ SC_UNIDENTIFIED, "Africa - Victoria Falls", ScenarioCategory::challenging, "rct2ww.scenario_meta.over_the_edge" },
{ SC_UNIDENTIFIED, "N. America - Extreme Hawaiian Island", ScenarioCategory::challenging, "rct2ww.scenario_meta.wacky_waikiki" },
{ SC_UNIDENTIFIED, "South America - Rain Forest Plateau", ScenarioCategory::challenging, "rct2ww.scenario_meta.rainforest_romp" },
{ SC_UNIDENTIFIED, "Europe - Renovation", ScenarioCategory::challenging, "rct2ww.scenario_meta.from_the_ashes" },
{ SC_UNIDENTIFIED, "Antarctic - Ecological Salvage", ScenarioCategory::expert, "rct2ww.scenario_meta.icy_adventures" },
{ SC_UNIDENTIFIED, "Europe - European Cultural Festival", ScenarioCategory::expert, "rct2ww.scenario_meta.european_extravaganza" },
{ SC_UNIDENTIFIED, "Australasia - Fun at the Beach", ScenarioCategory::expert, "rct2ww.scenario_meta.beach_barbecue_blast" },
{ SC_UNIDENTIFIED, "South America - Inca Lost City", ScenarioCategory::expert, "rct2ww.scenario_meta.lost_city_founder" },
{ SC_UNIDENTIFIED, "Asia - Japanese Coastal Reclaim", ScenarioCategory::expert, "rct2ww.scenario_meta.okinawa_coast" },
{ SC_UNIDENTIFIED, "North America - Grand Canyon", Scenario::Category::beginner, "rct2ww.scenario_meta.canyon_calamities" },
{ SC_UNIDENTIFIED, "Asia - Great Wall of China Tourism Enhancement", Scenario::Category::beginner, "rct2ww.scenario_meta.great_wall_of_china" },
{ SC_UNIDENTIFIED, "Africa - African Diamond Mine", Scenario::Category::beginner, "rct2ww.scenario_meta.mines_of_africa" },
{ SC_UNIDENTIFIED, "Australasia - Ayers Rock", Scenario::Category::beginner, "rct2ww.scenario_meta.ayers_adventure" },
{ SC_UNIDENTIFIED, "North America - Rollercoaster Heaven", Scenario::Category::beginner, "rct2ww.scenario_meta.rollercoaster_heaven" },
{ SC_UNIDENTIFIED, "Africa - Oasis", Scenario::Category::challenging, "rct2ww.scenario_meta.mirage_madness" },
{ SC_UNIDENTIFIED, "South America - Rio Carnival", Scenario::Category::challenging, "rct2ww.scenario_meta.sugarloaf_shores" },
{ SC_UNIDENTIFIED, "Asia - Maharaja Palace", Scenario::Category::challenging, "rct2ww.scenario_meta.park_maharaja" },
{ SC_UNIDENTIFIED, "Africa - Victoria Falls", Scenario::Category::challenging, "rct2ww.scenario_meta.over_the_edge" },
{ SC_UNIDENTIFIED, "N. America - Extreme Hawaiian Island", Scenario::Category::challenging, "rct2ww.scenario_meta.wacky_waikiki" },
{ SC_UNIDENTIFIED, "South America - Rain Forest Plateau", Scenario::Category::challenging, "rct2ww.scenario_meta.rainforest_romp" },
{ SC_UNIDENTIFIED, "Europe - Renovation", Scenario::Category::challenging, "rct2ww.scenario_meta.from_the_ashes" },
{ SC_UNIDENTIFIED, "Antarctic - Ecological Salvage", Scenario::Category::expert, "rct2ww.scenario_meta.icy_adventures" },
{ SC_UNIDENTIFIED, "Europe - European Cultural Festival", Scenario::Category::expert, "rct2ww.scenario_meta.european_extravaganza" },
{ SC_UNIDENTIFIED, "Australasia - Fun at the Beach", Scenario::Category::expert, "rct2ww.scenario_meta.beach_barbecue_blast" },
{ SC_UNIDENTIFIED, "South America - Inca Lost City", Scenario::Category::expert, "rct2ww.scenario_meta.lost_city_founder" },
{ SC_UNIDENTIFIED, "Asia - Japanese Coastal Reclaim", Scenario::Category::expert, "rct2ww.scenario_meta.okinawa_coast" },
};
// RCT2: Time Twister
static constexpr ScenarioTitleDescriptor kScenarioTitlesRCT2TT[] =
{
{ SC_UNIDENTIFIED, "Dark Age - Robin Hood", ScenarioCategory::beginner, "rct2tt.scenario_meta.sherwood_forest" },
{ SC_UNIDENTIFIED, "Prehistoric - After the Asteroid", ScenarioCategory::beginner, "rct2tt.scenario_meta.crater_carnage" },
{ SC_UNIDENTIFIED, "Roaring Twenties - Prison Island", ScenarioCategory::beginner, "rct2tt.scenario_meta.alcatraz" },
{ SC_UNIDENTIFIED, "Future - First Encounters", ScenarioCategory::beginner, "rct2tt.scenario_meta.extraterrestrial_extravaganza" },
{ SC_UNIDENTIFIED, "Roaring Twenties - Schneider Cup", ScenarioCategory::challenging, "rct2tt.scenario_meta.schneider_shores" },
{ SC_UNIDENTIFIED, "Prehistoric - Stone Age", ScenarioCategory::challenging, "rct2tt.scenario_meta.rocky_rambles" },
{ SC_UNIDENTIFIED, "Mythological - Cradle of Civilisation", ScenarioCategory::challenging, "rct2tt.scenario_meta.mythological_madness" },
{ SC_UNIDENTIFIED, "Rock 'n' Roll - Rock 'n' Roll", ScenarioCategory::challenging, "rct2tt.scenario_meta.rock_n_roll_revival" },
{ SC_UNIDENTIFIED, "Future - Future World", ScenarioCategory::challenging, "rct2tt.scenario_meta.gemini_city" },
{ SC_UNIDENTIFIED, "Roaring Twenties - Skyscrapers", ScenarioCategory::expert, "rct2tt.scenario_meta.metropolis" },
{ SC_UNIDENTIFIED, "Rock 'n' Roll - Flower Power", ScenarioCategory::expert, "rct2tt.scenario_meta.woodstock" },
{ SC_UNIDENTIFIED, "Dark Age - Castle", ScenarioCategory::expert, "rct2tt.scenario_meta.cliffside_castle" },
{ SC_UNIDENTIFIED, "Mythological - Animatronic Film Set", ScenarioCategory::expert, "rct2tt.scenario_meta.animatronic_antics" },
{ SC_UNIDENTIFIED, "Prehistoric - Jurassic Safari", ScenarioCategory::expert, "rct2tt.scenario_meta.coastersaurus" },
{ SC_UNIDENTIFIED, "Dark Age - Robin Hood", Scenario::Category::beginner, "rct2tt.scenario_meta.sherwood_forest" },
{ SC_UNIDENTIFIED, "Prehistoric - After the Asteroid", Scenario::Category::beginner, "rct2tt.scenario_meta.crater_carnage" },
{ SC_UNIDENTIFIED, "Roaring Twenties - Prison Island", Scenario::Category::beginner, "rct2tt.scenario_meta.alcatraz" },
{ SC_UNIDENTIFIED, "Future - First Encounters", Scenario::Category::beginner, "rct2tt.scenario_meta.extraterrestrial_extravaganza" },
{ SC_UNIDENTIFIED, "Roaring Twenties - Schneider Cup", Scenario::Category::challenging, "rct2tt.scenario_meta.schneider_shores" },
{ SC_UNIDENTIFIED, "Prehistoric - Stone Age", Scenario::Category::challenging, "rct2tt.scenario_meta.rocky_rambles" },
{ SC_UNIDENTIFIED, "Mythological - Cradle of Civilisation", Scenario::Category::challenging, "rct2tt.scenario_meta.mythological_madness" },
{ SC_UNIDENTIFIED, "Rock 'n' Roll - Rock 'n' Roll", Scenario::Category::challenging, "rct2tt.scenario_meta.rock_n_roll_revival" },
{ SC_UNIDENTIFIED, "Future - Future World", Scenario::Category::challenging, "rct2tt.scenario_meta.gemini_city" },
{ SC_UNIDENTIFIED, "Roaring Twenties - Skyscrapers", Scenario::Category::expert, "rct2tt.scenario_meta.metropolis" },
{ SC_UNIDENTIFIED, "Rock 'n' Roll - Flower Power", Scenario::Category::expert, "rct2tt.scenario_meta.woodstock" },
{ SC_UNIDENTIFIED, "Dark Age - Castle", Scenario::Category::expert, "rct2tt.scenario_meta.cliffside_castle" },
{ SC_UNIDENTIFIED, "Mythological - Animatronic Film Set", Scenario::Category::expert, "rct2tt.scenario_meta.animatronic_antics" },
{ SC_UNIDENTIFIED, "Prehistoric - Jurassic Safari", Scenario::Category::expert, "rct2tt.scenario_meta.coastersaurus" },
};
// User Created Expansion Sets
static constexpr ScenarioTitleDescriptor kScenarioTitlesUCES[] =
{
{ SC_UNIDENTIFIED, "Lighthouse of Alexandria by Katatude for UCES", ScenarioCategory::timeMachine, "uces.scenario_meta.the_lighthouse_of_alexandria" },
{ SC_UNIDENTIFIED, "Cleveland's Luna Park", ScenarioCategory::timeMachine, "uces.scenario_meta.luna_park_cleveland" },
{ SC_UNIDENTIFIED, "Mount Vesuvius 1700 A.D. by Katatude for UCES", ScenarioCategory::timeMachine, "uces.scenario_meta.mount_vesuvius" },
{ SC_UNIDENTIFIED, "The Sandbox by Katatude for UCES", ScenarioCategory::timeMachine, "uces.scenario_meta.the_sandbox" },
{ SC_UNIDENTIFIED, "Niagara Falls & Gorge by Katatude for UCES", ScenarioCategory::timeMachine, "uces.scenario_meta.niagara_falls_gorge" },
{ SC_UNIDENTIFIED, "Rocky Mountain Miners", ScenarioCategory::timeMachine, "uces.scenario_meta.rocky_mountain_miners" },
{ SC_UNIDENTIFIED, "The Time Machine by Katatude for UCES", ScenarioCategory::timeMachine, "uces.scenario_meta.the_time_machine" },
{ SC_UNIDENTIFIED, "Tower of Babel", ScenarioCategory::timeMachine, "uces.scenario_meta.tower_of_babel" },
{ SC_UNIDENTIFIED, "Transformation", ScenarioCategory::timeMachine, "uces.scenario_meta.transformation" },
{ SC_UNIDENTIFIED, "Urbis Incognitus", ScenarioCategory::timeMachine, "uces.scenario_meta.urbis_incognitus" },
{ SC_UNIDENTIFIED, "Beneath the Christmas Tree by Katatude for UCES", ScenarioCategory::katysDreamworld, "uces.scenario_meta.beneath_the_christmas_tree" },
{ SC_UNIDENTIFIED, "Bigrock Blast", ScenarioCategory::katysDreamworld, "uces.scenario_meta.bigrock_blast" },
{ SC_UNIDENTIFIED, "Camp Mockingbird for UCES by Katatude", ScenarioCategory::katysDreamworld, "uces.scenario_meta.camp_mockingbird" },
{ SC_UNIDENTIFIED, "Choo Choo Town", ScenarioCategory::katysDreamworld, "uces.scenario_meta.choochoo_town" },
{ SC_UNIDENTIFIED, "Dragon Islands", ScenarioCategory::katysDreamworld, "uces.scenario_meta.dragon_islands" },
{ SC_UNIDENTIFIED, "Kiddy Karnival II", ScenarioCategory::katysDreamworld, "uces.scenario_meta.kiddie_karnival_ii" },
{ SC_UNIDENTIFIED, "Sand Dune", ScenarioCategory::katysDreamworld, "uces.scenario_meta.sand_dune" },
{ SC_UNIDENTIFIED, "UCES Halloween", ScenarioCategory::other, "uces.scenario_meta.cemetery_ridge" },
{ SC_UNIDENTIFIED, "Lighthouse of Alexandria by Katatude for UCES", Scenario::Category::timeMachine, "uces.scenario_meta.the_lighthouse_of_alexandria" },
{ SC_UNIDENTIFIED, "Cleveland's Luna Park", Scenario::Category::timeMachine, "uces.scenario_meta.luna_park_cleveland" },
{ SC_UNIDENTIFIED, "Mount Vesuvius 1700 A.D. by Katatude for UCES", Scenario::Category::timeMachine, "uces.scenario_meta.mount_vesuvius" },
{ SC_UNIDENTIFIED, "The Sandbox by Katatude for UCES", Scenario::Category::timeMachine, "uces.scenario_meta.the_sandbox" },
{ SC_UNIDENTIFIED, "Niagara Falls & Gorge by Katatude for UCES", Scenario::Category::timeMachine, "uces.scenario_meta.niagara_falls_gorge" },
{ SC_UNIDENTIFIED, "Rocky Mountain Miners", Scenario::Category::timeMachine, "uces.scenario_meta.rocky_mountain_miners" },
{ SC_UNIDENTIFIED, "The Time Machine by Katatude for UCES", Scenario::Category::timeMachine, "uces.scenario_meta.the_time_machine" },
{ SC_UNIDENTIFIED, "Tower of Babel", Scenario::Category::timeMachine, "uces.scenario_meta.tower_of_babel" },
{ SC_UNIDENTIFIED, "Transformation", Scenario::Category::timeMachine, "uces.scenario_meta.transformation" },
{ SC_UNIDENTIFIED, "Urbis Incognitus", Scenario::Category::timeMachine, "uces.scenario_meta.urbis_incognitus" },
{ SC_UNIDENTIFIED, "Beneath the Christmas Tree by Katatude for UCES", Scenario::Category::katysDreamworld, "uces.scenario_meta.beneath_the_christmas_tree" },
{ SC_UNIDENTIFIED, "Bigrock Blast", Scenario::Category::katysDreamworld, "uces.scenario_meta.bigrock_blast" },
{ SC_UNIDENTIFIED, "Camp Mockingbird for UCES by Katatude", Scenario::Category::katysDreamworld, "uces.scenario_meta.camp_mockingbird" },
{ SC_UNIDENTIFIED, "Choo Choo Town", Scenario::Category::katysDreamworld, "uces.scenario_meta.choochoo_town" },
{ SC_UNIDENTIFIED, "Dragon Islands", Scenario::Category::katysDreamworld, "uces.scenario_meta.dragon_islands" },
{ SC_UNIDENTIFIED, "Kiddy Karnival II", Scenario::Category::katysDreamworld, "uces.scenario_meta.kiddie_karnival_ii" },
{ SC_UNIDENTIFIED, "Sand Dune", Scenario::Category::katysDreamworld, "uces.scenario_meta.sand_dune" },
{ SC_UNIDENTIFIED, "UCES Halloween", Scenario::Category::other, "uces.scenario_meta.cemetery_ridge" },
};
// Real parks
static constexpr ScenarioTitleDescriptor kScenarioTitlesRealParks[] =
{
{ SC_ALTON_TOWERS, "Alton Towers", ScenarioCategory::real, "rct1ll.scenario_meta.alton_towers" },
{ SC_HEIDE_PARK, "Heide-Park", ScenarioCategory::real, "rct1ll.scenario_meta.heidepark" },
{ SC_BLACKPOOL_PLEASURE_BEACH, "Blackpool Pleasure Beach", ScenarioCategory::real, "rct1ll.scenario_meta.blackpool_pleasure_beach" },
{ SC_UNIDENTIFIED, "Six Flags Belgium", ScenarioCategory::real, "rct2.scenario_meta.six_flags_belgium" },
{ SC_UNIDENTIFIED, "Six Flags Great Adventure", ScenarioCategory::real, "rct2.scenario_meta.six_flags_great_adventure" },
{ SC_UNIDENTIFIED, "Six Flags Holland", ScenarioCategory::real, "rct2.scenario_meta.six_flags_holland" },
{ SC_UNIDENTIFIED, "Six Flags Magic Mountain", ScenarioCategory::real, "rct2.scenario_meta.six_flags_magic_mountain" },
{ SC_UNIDENTIFIED, "Six Flags over Texas", ScenarioCategory::real, "rct2.scenario_meta.six_flags_over_texas" },
{ SC_ALTON_TOWERS, "Alton Towers", Scenario::Category::real, "rct1ll.scenario_meta.alton_towers" },
{ SC_HEIDE_PARK, "Heide-Park", Scenario::Category::real, "rct1ll.scenario_meta.heidepark" },
{ SC_BLACKPOOL_PLEASURE_BEACH, "Blackpool Pleasure Beach", Scenario::Category::real, "rct1ll.scenario_meta.blackpool_pleasure_beach" },
{ SC_UNIDENTIFIED, "Six Flags Belgium", Scenario::Category::real, "rct2.scenario_meta.six_flags_belgium" },
{ SC_UNIDENTIFIED, "Six Flags Great Adventure", Scenario::Category::real, "rct2.scenario_meta.six_flags_great_adventure" },
{ SC_UNIDENTIFIED, "Six Flags Holland", Scenario::Category::real, "rct2.scenario_meta.six_flags_holland" },
{ SC_UNIDENTIFIED, "Six Flags Magic Mountain", Scenario::Category::real, "rct2.scenario_meta.six_flags_magic_mountain" },
{ SC_UNIDENTIFIED, "Six Flags over Texas", Scenario::Category::real, "rct2.scenario_meta.six_flags_over_texas" },
};
// Other parks
static constexpr ScenarioTitleDescriptor kScenarioTitlesExtrasParks[] =
{
{ SC_FORT_ANACHRONISM, "Fort Anachronism", ScenarioCategory::dlc, "rct1dlc.scenario_meta.fort_anachronism" },
{ SC_TAIWAN_PARK, "Taiwan Park", ScenarioCategory::dlc, "rct1tw.scenario_meta.taiwan_park" },
{ SC_PCPLAYER, "PC Player", ScenarioCategory::dlc, "rct1dlc.scenario_meta.pc_player" },
{ SC_PCGW, "PC Gaming World", ScenarioCategory::dlc, "rct1dlc.scenario_meta.pc_gaming_world" },
{ SC_GAMEPLAY, "gameplay", ScenarioCategory::dlc, "rct1dlc.scenario_meta.gameplay" },
{ SC_UNIDENTIFIED, "Panda World", ScenarioCategory::dlc, "rct2dlc.scenario_meta.panda_world" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Belgium", ScenarioCategory::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_belgium" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Great Adventure", ScenarioCategory::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_great_adventure" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Holland", ScenarioCategory::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_holland" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Magic Mountain", ScenarioCategory::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_magic_mountain" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Park", ScenarioCategory::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_park" },
{ SC_UNIDENTIFIED, "Build your own Six Flags over Texas", ScenarioCategory::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_over_texas" },
{ SC_UNIDENTIFIED, "Competition Land 1", ScenarioCategory::competitions, "rct1dlc.scenario_meta.competition_land_1" },
{ SC_UNIDENTIFIED, "Competition Land 2", ScenarioCategory::competitions, "rct1dlc.scenario_meta.competition_land_2" },
{ SC_BOBSLED_COMPETITION, "Bobsled Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.bobsled_roller_coaster_competition" },
{ SC_GO_KARTS_COMPETITION, "Go Karts Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.go_karts_competition" },
{ SC_INVERTED_ROLLER_COASTER_COMPETITION, "Inverted Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.inverted_roller_coaster_competition" },
{ SC_MINE_TRAIN_COMPETITION, "Mine Train Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.mine_train_roller_coaster_competition" },
{ SC_STAND_UP_STEEL_ROLLER_COASTER_COMPETITION, "Stand-Up Steel Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.stand_up_steel_roller_coaster_competition" },
{ SC_STEEL_CORKSCREW_COMPETITION, "Steel Corkscrew Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.steel_corkscrew_roller_coaster_competition" },
{ SC_STEEL_MINI_ROLLER_COASTER_COMPETITION, "Steel Mini-Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.steel_mini_roller_coaster_competition" },
{ SC_STEEL_ROLLER_COASTER_COMPETITION, "Steel Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.steel_roller_coaster_competition" },
{ SC_STEEL_TWISTER_COMPETITION, "Steel Twister Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.steel_twister_roller_coaster_competition" },
{ SC_SUSPENDED_ROLLER_COASTER_COMPETITION, "Suspended Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.suspended_roller_coaster_competition" },
{ SC_WOODEN_ROLLER_COASTER_COMPETITION, "Wooden Roller Coaster Competition", ScenarioCategory::competitions, "rct1dlc.scenario_meta.wooden_roller_coaster_competition" },
{ SC_UNIDENTIFIED, "Tycoon Park", ScenarioCategory::other, "rct2.scenario_meta.tycoon_park" },
{ SC_FORT_ANACHRONISM, "Fort Anachronism", Scenario::Category::dlc, "rct1dlc.scenario_meta.fort_anachronism" },
{ SC_TAIWAN_PARK, "Taiwan Park", Scenario::Category::dlc, "rct1tw.scenario_meta.taiwan_park" },
{ SC_PCPLAYER, "PC Player", Scenario::Category::dlc, "rct1dlc.scenario_meta.pc_player" },
{ SC_PCGW, "PC Gaming World", Scenario::Category::dlc, "rct1dlc.scenario_meta.pc_gaming_world" },
{ SC_GAMEPLAY, "gameplay", Scenario::Category::dlc, "rct1dlc.scenario_meta.gameplay" },
{ SC_UNIDENTIFIED, "Panda World", Scenario::Category::dlc, "rct2dlc.scenario_meta.panda_world" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Belgium", Scenario::Category::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_belgium" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Great Adventure", Scenario::Category::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_great_adventure" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Holland", Scenario::Category::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_holland" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Magic Mountain", Scenario::Category::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_magic_mountain" },
{ SC_UNIDENTIFIED, "Build your own Six Flags Park", Scenario::Category::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_park" },
{ SC_UNIDENTIFIED, "Build your own Six Flags over Texas", Scenario::Category::buildYourOwn, "rct2.scenario_meta.build_your_own_six_flags_over_texas" },
{ SC_UNIDENTIFIED, "Competition Land 1", Scenario::Category::competitions, "rct1dlc.scenario_meta.competition_land_1" },
{ SC_UNIDENTIFIED, "Competition Land 2", Scenario::Category::competitions, "rct1dlc.scenario_meta.competition_land_2" },
{ SC_BOBSLED_COMPETITION, "Bobsled Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.bobsled_roller_coaster_competition" },
{ SC_GO_KARTS_COMPETITION, "Go Karts Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.go_karts_competition" },
{ SC_INVERTED_ROLLER_COASTER_COMPETITION, "Inverted Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.inverted_roller_coaster_competition" },
{ SC_MINE_TRAIN_COMPETITION, "Mine Train Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.mine_train_roller_coaster_competition" },
{ SC_STAND_UP_STEEL_ROLLER_COASTER_COMPETITION, "Stand-Up Steel Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.stand_up_steel_roller_coaster_competition" },
{ SC_STEEL_CORKSCREW_COMPETITION, "Steel Corkscrew Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.steel_corkscrew_roller_coaster_competition" },
{ SC_STEEL_MINI_ROLLER_COASTER_COMPETITION, "Steel Mini-Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.steel_mini_roller_coaster_competition" },
{ SC_STEEL_ROLLER_COASTER_COMPETITION, "Steel Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.steel_roller_coaster_competition" },
{ SC_STEEL_TWISTER_COMPETITION, "Steel Twister Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.steel_twister_roller_coaster_competition" },
{ SC_SUSPENDED_ROLLER_COASTER_COMPETITION, "Suspended Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.suspended_roller_coaster_competition" },
{ SC_WOODEN_ROLLER_COASTER_COMPETITION, "Wooden Roller Coaster Competition", Scenario::Category::competitions, "rct1dlc.scenario_meta.wooden_roller_coaster_competition" },
{ SC_UNIDENTIFIED, "Tycoon Park", Scenario::Category::other, "rct2.scenario_meta.tycoon_park" },
};
constexpr std::span<const ScenarioTitleDescriptor> kScenarioTitlesBySource[] = {
@@ -386,7 +386,7 @@ namespace OpenRCT2::ScenarioSources
outDesc->id = SC_UNIDENTIFIED;
outDesc->source = static_cast<uint8_t>(ScenarioSource::Other);
outDesc->index = -1;
outDesc->category = ScenarioCategory::other;
outDesc->category = Scenario::Category::other;
outDesc->textObjectId = {};
return false;
}
@@ -419,7 +419,7 @@ namespace OpenRCT2::ScenarioSources
outDesc->id = SC_UNIDENTIFIED;
outDesc->source = static_cast<uint8_t>(ScenarioSource::Other);
outDesc->index = -1;
outDesc->category = ScenarioCategory::other;
outDesc->category = Scenario::Category::other;
outDesc->textObjectId = {};
return false;
}
+5 -2
View File
@@ -11,7 +11,10 @@
#include "../core/StringTypes.h"
enum class ScenarioCategory : uint8_t;
namespace OpenRCT2::Scenario
{
enum class Category : uint8_t;
}
struct SourceDescriptor
{
@@ -19,7 +22,7 @@ struct SourceDescriptor
uint8_t id;
uint8_t source;
int32_t index;
ScenarioCategory category;
OpenRCT2::Scenario::Category category;
u8string_view textObjectId;
};
@@ -16,6 +16,7 @@
#include "../../../interface/Screenshot.h"
#include "../../../localisation/Formatting.h"
#include "../../../object/ObjectManager.h"
#include "../../../scenario/Scenario.h"
#include "../../Duktape.hpp"
#include "../../HookEngine.h"
#include "../../IconNames.hpp"
@@ -14,26 +14,29 @@
#include "../../../Context.h"
#include "../../../GameState.h"
#include "../../../core/StringTypes.h"
#include "../../../scenario/Scenario.h"
#include "../../../world/Park.h"
#include "../../Duktape.hpp"
#include "../../ScriptEngine.h"
namespace OpenRCT2::Scripting
{
static const DukEnumMap<uint32_t> ScenarioObjectiveTypeMap(
using namespace OpenRCT2::Scenario;
static const DukEnumMap<ObjectiveType> ScenarioObjectiveTypeMap(
{
{ "none", OBJECTIVE_NONE },
{ "guestsBy", OBJECTIVE_GUESTS_BY },
{ "parkValueBy", OBJECTIVE_PARK_VALUE_BY },
{ "haveFun", OBJECTIVE_HAVE_FUN },
{ "buildTheBest", OBJECTIVE_BUILD_THE_BEST },
{ "10Rollercoasters", OBJECTIVE_10_ROLLERCOASTERS },
{ "guestsAndRating", OBJECTIVE_GUESTS_AND_RATING },
{ "monthlyRideIncome", OBJECTIVE_MONTHLY_RIDE_INCOME },
{ "10RollercoastersLength", OBJECTIVE_10_ROLLERCOASTERS_LENGTH },
{ "finish5Rollercoasters", OBJECTIVE_FINISH_5_ROLLERCOASTERS },
{ "repayLoanAndParkValue", OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE },
{ "monthlyFoodIncome", OBJECTIVE_MONTHLY_FOOD_INCOME },
{ "none", ObjectiveType::none },
{ "guestsBy", ObjectiveType::guestsBy },
{ "parkValueBy", ObjectiveType::parkValueBy },
{ "haveFun", ObjectiveType::haveFun },
{ "buildTheBest", ObjectiveType::buildTheBest },
{ "10Rollercoasters", ObjectiveType::tenRollercoasters },
{ "guestsAndRating", ObjectiveType::guestsAndRating },
{ "monthlyRideIncome", ObjectiveType::monthlyRideIncome },
{ "10RollercoastersLength", ObjectiveType::tenRollercoastersLength },
{ "finish5Rollercoasters", ObjectiveType::finishFiveRollercoasters },
{ "repayLoanAndParkValue", ObjectiveType::repayLoanAndParkValue },
{ "monthlyFoodIncome", ObjectiveType::monthlyFoodIncome },
});
class ScScenarioObjective
@@ -53,8 +56,8 @@ namespace OpenRCT2::Scripting
uint16_t guests_get()
{
auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::guestsBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::guestsAndRating)
{
return gameState.scenarioOptions.objective.NumGuests;
}
@@ -65,8 +68,8 @@ namespace OpenRCT2::Scripting
{
ThrowIfGameStateNotMutable();
auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_AND_RATING)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::guestsBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::guestsAndRating)
{
gameState.scenarioOptions.objective.NumGuests = value;
}
@@ -75,8 +78,8 @@ namespace OpenRCT2::Scripting
uint8_t year_get()
{
const auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_PARK_VALUE_BY)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::guestsBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::parkValueBy)
{
return gameState.scenarioOptions.objective.Year;
}
@@ -87,8 +90,8 @@ namespace OpenRCT2::Scripting
{
auto& gameState = getGameState();
ThrowIfGameStateNotMutable();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_GUESTS_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_PARK_VALUE_BY)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::guestsBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::parkValueBy)
{
gameState.scenarioOptions.objective.Year = value;
}
@@ -97,7 +100,7 @@ namespace OpenRCT2::Scripting
uint16_t length_get()
{
const auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::tenRollercoastersLength)
{
return gameState.scenarioOptions.objective.NumGuests;
}
@@ -108,7 +111,7 @@ namespace OpenRCT2::Scripting
{
ThrowIfGameStateNotMutable();
auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::tenRollercoastersLength)
{
gameState.scenarioOptions.objective.NumGuests = value;
}
@@ -117,7 +120,7 @@ namespace OpenRCT2::Scripting
money64 excitement_get()
{
const auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::finishFiveRollercoasters)
{
return gameState.scenarioOptions.objective.Currency;
}
@@ -128,7 +131,7 @@ namespace OpenRCT2::Scripting
{
ThrowIfGameStateNotMutable();
auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::finishFiveRollercoasters)
{
gameState.scenarioOptions.objective.Currency = value;
}
@@ -137,8 +140,8 @@ namespace OpenRCT2::Scripting
money64 parkValue_get()
{
const auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_PARK_VALUE_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::parkValueBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::repayLoanAndParkValue)
{
return gameState.scenarioOptions.objective.Currency;
}
@@ -149,8 +152,8 @@ namespace OpenRCT2::Scripting
{
ThrowIfGameStateNotMutable();
auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_PARK_VALUE_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::parkValueBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::repayLoanAndParkValue)
{
gameState.scenarioOptions.objective.Currency = value;
}
@@ -159,8 +162,8 @@ namespace OpenRCT2::Scripting
money64 monthlyIncome_get()
{
const auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_MONTHLY_RIDE_INCOME
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::monthlyRideIncome
|| gameState.scenarioOptions.objective.Type == ObjectiveType::monthlyFoodIncome)
{
return gameState.scenarioOptions.objective.Currency;
}
@@ -171,8 +174,8 @@ namespace OpenRCT2::Scripting
{
ThrowIfGameStateNotMutable();
auto& gameState = getGameState();
if (gameState.scenarioOptions.objective.Type == OBJECTIVE_PARK_VALUE_BY
|| gameState.scenarioOptions.objective.Type == OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE)
if (gameState.scenarioOptions.objective.Type == ObjectiveType::parkValueBy
|| gameState.scenarioOptions.objective.Type == ObjectiveType::repayLoanAndParkValue)
{
gameState.scenarioOptions.objective.Currency = value;
}
+1
View File
@@ -22,6 +22,7 @@
#include "../object/ClimateObject.h"
#include "../object/ObjectManager.h"
#include "../profiling/Profiling.h"
#include "../scenario/Scenario.h"
#include "../util/Util.h"
#include "../windows/Intent.h"
+2 -1
View File
@@ -33,6 +33,7 @@
#include "../ride/RideData.h"
#include "../ride/RideManager.hpp"
#include "../ride/ShopItem.h"
#include "../scenario/Scenario.h"
#include "../scripting/ScriptEngine.h"
#include "../ui/WindowManager.h"
#include "../util/Util.h"
@@ -313,7 +314,7 @@ namespace OpenRCT2::Park
gameState.scenarioOptions.guestInitialHappiness = Park::CalculateGuestInitialHappiness(50);
gameState.scenarioOptions.guestInitialHunger = 200;
gameState.scenarioOptions.guestInitialThirst = 200;
gameState.scenarioOptions.objective.Type = OBJECTIVE_GUESTS_BY;
gameState.scenarioOptions.objective.Type = Scenario::ObjectiveType::guestsBy;
gameState.scenarioOptions.objective.Year = 4;
gameState.scenarioOptions.objective.NumGuests = 1000;
gameState.scenarioOptions.landPrice = 90.00_GBP;