From c311d684587c486777bb4c4e598950386e1433fb Mon Sep 17 00:00:00 2001 From: MarcelVos96 Date: Wed, 6 May 2026 08:53:21 +0200 Subject: [PATCH] Add 'guests entertained' statistic for entertainers (#26327) Co-authored-by: Aaron van Geffen --- data/language/en-GB.txt | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/UiStringIds.h | 1 + src/openrct2-ui/windows/Staff.cpp | 4 ++++ src/openrct2/entity/Staff.cpp | 13 +++++++++---- src/openrct2/entity/Staff.h | 15 ++++++++++----- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 9e95a3272d..2581f463a6 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -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} diff --git a/distribution/changelog.txt b/distribution/changelog.txt index af442c0a18..c05590dbc5 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -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. diff --git a/src/openrct2-ui/UiStringIds.h b/src/openrct2-ui/UiStringIds.h index caa3408816..58b58b5120 100644 --- a/src/openrct2-ui/UiStringIds.h +++ b/src/openrct2-ui/UiStringIds.h @@ -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, diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index cd86b629f9..3dec55f35e 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -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(staff->staffGuestsEntertained); + drawText(rt, screenCoords, STR_STAFF_STAT_GUESTS_ENTERTAINED, ft); + break; case StaffType::count: break; } diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 0ed38f87f0..8216496023 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -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 diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index b141301eaa..a9f1f14fc5 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -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; }; - uint32_t StaffBinsEmptied; + 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;