mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Add ride age and improve documentation
This commit is contained in:
6
distribution/openrct2.d.ts
vendored
6
distribution/openrct2.d.ts
vendored
@@ -771,9 +771,15 @@ declare global {
|
||||
|
||||
/**
|
||||
* The date in months when the ride was built.
|
||||
* Subtract this from `date.monthsElapsed` to get the age.
|
||||
*/
|
||||
buildDate: number;
|
||||
|
||||
/**
|
||||
* How old the ride is in months.
|
||||
*/
|
||||
readonly age: number;
|
||||
|
||||
/**
|
||||
* The running cost of the ride billed every fortnight. Multiply this by 16 to get the cost per hour (~ 1 year).
|
||||
*/
|
||||
|
||||
@@ -561,6 +561,12 @@ namespace OpenRCT2::Scripting
|
||||
}
|
||||
}
|
||||
|
||||
int32_t age_get() const
|
||||
{
|
||||
auto ride = GetRide();
|
||||
return ride != nullptr ? ride->GetAge() : 0;
|
||||
}
|
||||
|
||||
int16_t runningCost_get() const
|
||||
{
|
||||
auto ride = GetRide();
|
||||
@@ -651,6 +657,7 @@ namespace OpenRCT2::Scripting
|
||||
dukglue_register_property(ctx, &ScRide::nausea_get, &ScRide::nausea_set, "nausea");
|
||||
dukglue_register_property(ctx, &ScRide::totalCustomers_get, &ScRide::totalCustomers_set, "totalCustomers");
|
||||
dukglue_register_property(ctx, &ScRide::buildDate_get, &ScRide::buildDate_set, "buildDate");
|
||||
dukglue_register_property(ctx, &ScRide::age_get, nullptr, "age");
|
||||
dukglue_register_property(ctx, &ScRide::runningCost_get, &ScRide::runningCost_set, "runningCost");
|
||||
dukglue_register_property(
|
||||
ctx, &ScRide::inspectionInterval_get, &ScRide::inspectionInterval_set, "inspectionInterval");
|
||||
|
||||
Reference in New Issue
Block a user