Add 'guests entertained' statistic for entertainers (#26327)

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
This commit is contained in:
MarcelVos96
2026-05-06 08:53:21 +02:00
committed by GitHub
parent bcb38ee336
commit c311d68458
6 changed files with 26 additions and 9 deletions
+1
View File
@@ -3826,3 +3826,4 @@ STR_7026 :Makes the whole ride visible
STR_7027 :{MOVE_X}{29}{STRINGID}
STR_7028 :Quarter Helix up
STR_7029 :Quarter Helix down
STR_7030 :{WINDOW_COLOUR_2}Guests entertained: {BLACK}{COMMA32}
+1
View File
@@ -2,6 +2,7 @@
------------------------------------------------------------------------
- Feature: [#24242] [Plugin] Add ride-breakdown hooktype.
- Feature: [#24879] [Plugin] Add methods for showing and hiding gridlines.
- Feature: [#26327] Add guests entertained statistic to entertainers.
- Improved: [#26374] Add higher resolution app icons for Android.
- Improved: [#26386] Initial window scale and toolbar options on fresh Android installations.
- Change: [#26476] Limit creation of new station styles to prepare for more flexibility with ride stations and entrances.
+1
View File
@@ -1899,6 +1899,7 @@ namespace OpenRCT2
STR_STAFF_STAT_RIDES_FIXED = 2355,
STR_STAFF_STAT_RIDES_INSPECTED = 2356,
STR_STAFF_STAT_VANDALS_STOPPED = 6435,
STR_STAFF_STAT_GUESTS_ENTERTAINED = 7030,
STR_STAFF_STAT_WAGES = 2349,
STR_STAFF_TITLE_STAFF_MEMBER_NAME = 2977,
+4
View File
@@ -988,6 +988,10 @@ namespace OpenRCT2::Ui::Windows
drawText(rt, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft);
break;
case StaffType::entertainer:
ft = Formatter();
ft.Add<uint32_t>(staff->staffGuestsEntertained);
drawText(rt, screenCoords, STR_STAFF_STAT_GUESTS_ENTERTAINED, ft);
break;
case StaffType::count:
break;
}
+9 -4
View File
@@ -252,6 +252,7 @@ namespace OpenRCT2
peep->StaffLitterSwept = 0;
peep->StaffVandalsStopped = 0;
peep->StaffBinsEmptied = 0;
peep->staffGuestsEntertained = 0;
}
}
@@ -865,7 +866,7 @@ namespace OpenRCT2
*
* rct2: 0x006C086D
*/
void Staff::EntertainerUpdateNearbyPeeps() const
void Staff::EntertainerUpdateNearbyPeeps()
{
// Iterate over tiles within a 3-tile radius (96 units)
constexpr auto kTileRadius = 3;
@@ -896,11 +897,15 @@ namespace OpenRCT2
if (guest->State == PeepState::walking)
{
guest->HappinessTarget = std::min(guest->HappinessTarget + 4, kPeepMaxHappiness);
staffGuestsEntertained = AddClamp(staffGuestsEntertained, 1u);
WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS;
}
else if (guest->State == PeepState::queuing)
{
guest->TimeInQueue = std::max(0, guest->TimeInQueue - 200);
guest->HappinessTarget = std::min(guest->HappinessTarget + 3, kPeepMaxHappiness);
staffGuestsEntertained = AddClamp(staffGuestsEntertained, 1u);
WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS;
}
}
}
@@ -2631,9 +2636,9 @@ namespace OpenRCT2
stream << HireDate;
stream << StaffOrders;
stream << StaffMowingTimeout;
stream << StaffLawnsMown;
stream << StaffGardensWatered;
stream << StaffLitterSwept;
stream << StaffLawnsMown; // union with StaffRidesFixed, staffGuestsEntertained
stream << StaffGardensWatered; // union with StaffRidesInspected
stream << StaffLitterSwept; // union with StaffVandalsStopped
stream << StaffBinsEmptied;
}
} // namespace OpenRCT2
+9 -4
View File
@@ -53,22 +53,27 @@ namespace OpenRCT2
int32_t HireDate;
uint8_t StaffOrders;
uint8_t StaffMowingTimeout;
union
union // 1st statistic
{
uint32_t StaffLawnsMown;
uint32_t StaffRidesFixed;
uint32_t staffGuestsEntertained;
};
union
union // 2nd statistic
{
uint32_t StaffGardensWatered;
uint32_t StaffRidesInspected;
};
union
union // 3rd statistic
{
uint32_t StaffLitterSwept;
uint32_t StaffVandalsStopped;
};
union // 4th statistic
{
uint32_t StaffBinsEmptied;
};
void Update();
void Tick128UpdateStaff();
@@ -122,7 +127,7 @@ namespace OpenRCT2
Direction HandymanDirectionRandSurface(uint8_t validDirections) const;
void EntertainerUpdateNearbyPeeps() const;
void EntertainerUpdateNearbyPeeps();
bool SecurityGuardPathIsCrowded() const;
uint8_t GetValidPatrolDirections(const CoordsXY& loc) const;