Close #12387: Refactored PeepThoughtType to use strong enum. (#13541)

This commit is contained in:
Jamie Quigley 2020-12-07 19:48:36 +00:00 committed by GitHub
parent 80f442c706
commit 03a9ac9f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 250 additions and 253 deletions

View file

@ -996,7 +996,7 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
int32_t i = 0; int32_t i = 0;
for (; i < PEEP_MAX_THOUGHTS; ++i) for (; i < PEEP_MAX_THOUGHTS; ++i)
{ {
if (peep->Thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) if (peep->Thoughts[i].type == PeepThoughtType::None)
{ {
w->list_information_type = 0; w->list_information_type = 0;
return; return;
@ -1102,7 +1102,7 @@ void window_guest_overview_update(rct_window* w)
int32_t random = util_rand() & 0xFFFF; int32_t random = util_rand() & 0xFFFF;
if (random <= 0x2AAA) if (random <= 0x2AAA)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_WATCHED, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::Watched, PEEP_THOUGHT_ITEM_NONE);
} }
} }
} }
@ -1798,7 +1798,7 @@ void window_guest_thoughts_paint(rct_window* w, rct_drawpixelinfo* dpi)
screenCoords.y += 10; screenCoords.y += 10;
for (rct_peep_thought* thought = peep->Thoughts; thought < &peep->Thoughts[PEEP_MAX_THOUGHTS]; ++thought) for (rct_peep_thought* thought = peep->Thoughts; thought < &peep->Thoughts[PEEP_MAX_THOUGHTS]; ++thought)
{ {
if (thought->type == PEEP_THOUGHT_TYPE_NONE) if (thought->type == PeepThoughtType::None)
return; return;
if (thought->freshness == 0) if (thought->freshness == 0)
continue; continue;

View file

@ -793,7 +793,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
for (uint32_t j = 0; j < PEEP_MAX_THOUGHTS; j++) for (uint32_t j = 0; j < PEEP_MAX_THOUGHTS; j++)
{ {
thought = &peep->Thoughts[j]; thought = &peep->Thoughts[j];
if (thought->type == PEEP_THOUGHT_TYPE_NONE) if (thought->type == PeepThoughtType::None)
break; break;
if (thought->freshness == 0) if (thought->freshness == 0)
continue; continue;
@ -912,7 +912,7 @@ static FilterArguments get_arguments_from_peep(const Peep* peep)
case VIEW_THOUGHTS: case VIEW_THOUGHTS:
{ {
auto thought = &peep->Thoughts[0]; auto thought = &peep->Thoughts[0];
if (thought->freshness <= 5 && thought->type != PEEP_THOUGHT_TYPE_NONE) if (thought->freshness <= 5 && thought->type != PeepThoughtType::None)
{ {
peep_thought_set_format_args(thought, ft); peep_thought_set_format_args(thought, ft);
} }

View file

@ -225,14 +225,14 @@ private:
{ {
// Don't touch items after the first NONE thought as they are not valid // Don't touch items after the first NONE thought as they are not valid
// fixes issues with clearing out bad thought data in multiplayer // fixes issues with clearing out bad thought data in multiplayer
if (peep->Thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) if (peep->Thoughts[i].type == PeepThoughtType::None)
break; break;
if (peep->Thoughts[i].type != PEEP_THOUGHT_TYPE_NONE && peep->Thoughts[i].item == _rideIndex) if (peep->Thoughts[i].type != PeepThoughtType::None && peep->Thoughts[i].item == _rideIndex)
{ {
// Clear top thought, push others up // Clear top thought, push others up
memmove(&peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); memmove(&peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1));
peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PeepThoughtType::None;
peep->Thoughts[PEEP_MAX_THOUGHTS - 1].item = PEEP_THOUGHT_ITEM_NONE; peep->Thoughts[PEEP_MAX_THOUGHTS - 1].item = PEEP_THOUGHT_ITEM_NONE;
// Next iteration, check the new thought at this index // Next iteration, check the new thought at this index
i--; i--;

View file

@ -93,9 +93,8 @@ static bool award_is_deserved_most_untidy(int32_t activeAwardTypes)
if (peep->Thoughts[0].freshness > 5) if (peep->Thoughts[0].freshness > 5)
continue; continue;
if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER if (peep->Thoughts[0].type == PeepThoughtType::BadLitter || peep->Thoughts[0].type == PeepThoughtType::PathDisgusting
|| peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING || peep->Thoughts[0].type == PeepThoughtType::Vandalism)
|| peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM)
{ {
negativeCount++; negativeCount++;
} }
@ -122,12 +121,11 @@ static bool award_is_deserved_most_tidy(int32_t activeAwardTypes)
if (peep->Thoughts[0].freshness > 5) if (peep->Thoughts[0].freshness > 5)
continue; continue;
if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VERY_CLEAN) if (peep->Thoughts[0].type == PeepThoughtType::VeryClean)
positiveCount++; positiveCount++;
if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER if (peep->Thoughts[0].type == PeepThoughtType::BadLitter || peep->Thoughts[0].type == PeepThoughtType::PathDisgusting
|| peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING || peep->Thoughts[0].type == PeepThoughtType::Vandalism)
|| peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM)
{ {
negativeCount++; negativeCount++;
} }
@ -203,12 +201,11 @@ static bool award_is_deserved_most_beautiful(int32_t activeAwardTypes)
if (peep->Thoughts[0].freshness > 5) if (peep->Thoughts[0].freshness > 5)
continue; continue;
if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_SCENERY) if (peep->Thoughts[0].type == PeepThoughtType::Scenery)
positiveCount++; positiveCount++;
if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER if (peep->Thoughts[0].type == PeepThoughtType::BadLitter || peep->Thoughts[0].type == PeepThoughtType::PathDisgusting
|| peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING || peep->Thoughts[0].type == PeepThoughtType::Vandalism)
|| peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM)
{ {
negativeCount++; negativeCount++;
} }
@ -241,7 +238,7 @@ static bool award_is_deserved_safest([[maybe_unused]] int32_t activeAwardTypes)
{ {
if (peep->OutsideOfPark) if (peep->OutsideOfPark)
continue; continue;
if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PeepThoughtType::Vandalism)
peepsWhoDislikeVandalism++; peepsWhoDislikeVandalism++;
} }
@ -323,7 +320,7 @@ static bool award_is_deserved_best_food(int32_t activeAwardTypes)
if (peep->OutsideOfPark) if (peep->OutsideOfPark)
continue; continue;
if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PeepThoughtType::Hungry)
hungryPeeps++; hungryPeeps++;
} }
return (hungryPeeps <= 12); return (hungryPeeps <= 12);
@ -367,7 +364,7 @@ static bool award_is_deserved_worst_food(int32_t activeAwardTypes)
if (peep->OutsideOfPark) if (peep->OutsideOfPark)
continue; continue;
if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PeepThoughtType::Hungry)
hungryPeeps++; hungryPeeps++;
} }
return (hungryPeeps > 15); return (hungryPeeps > 15);
@ -397,7 +394,7 @@ static bool award_is_deserved_best_restrooms([[maybe_unused]] int32_t activeAwar
if (peep->OutsideOfPark) if (peep->OutsideOfPark)
continue; continue;
if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_TOILET) if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PeepThoughtType::Toilet)
guestsWhoNeedRestroom++; guestsWhoNeedRestroom++;
} }
return (guestsWhoNeedRestroom <= 16); return (guestsWhoNeedRestroom <= 16);
@ -526,7 +523,7 @@ static bool award_is_deserved_most_confusing_layout([[maybe_unused]] int32_t act
peepsCounted++; peepsCounted++;
if (peep->Thoughts[0].freshness <= 5 if (peep->Thoughts[0].freshness <= 5
&& (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_LOST || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_CANT_FIND)) && (peep->Thoughts[0].type == PeepThoughtType::Lost || peep->Thoughts[0].type == PeepThoughtType::CantFind))
peepsLost++; peepsLost++;
} }

View file

@ -272,22 +272,22 @@ static constexpr const uint8_t item_consumption_time[] = {
/** rct2: 009823AC */ /** rct2: 009823AC */
static constexpr const PeepThoughtType crowded_thoughts[] = { static constexpr const PeepThoughtType crowded_thoughts[] = {
PEEP_THOUGHT_TYPE_LOST, PeepThoughtType::Lost,
PEEP_THOUGHT_TYPE_TIRED, PeepThoughtType::Tired,
PEEP_THOUGHT_TYPE_BAD_LITTER, PeepThoughtType::BadLitter,
PEEP_THOUGHT_TYPE_HUNGRY, PeepThoughtType::Hungry,
PEEP_THOUGHT_TYPE_THIRSTY, PeepThoughtType::Thirsty,
PEEP_THOUGHT_TYPE_VERY_CLEAN, PeepThoughtType::VeryClean,
PEEP_THOUGHT_TYPE_CROWDED, PeepThoughtType::Crowded,
PEEP_THOUGHT_TYPE_SCENERY, PeepThoughtType::Scenery,
PEEP_THOUGHT_TYPE_VERY_CLEAN, PeepThoughtType::VeryClean,
PEEP_THOUGHT_TYPE_MUSIC, PeepThoughtType::Music,
PEEP_THOUGHT_TYPE_WATCHED, PeepThoughtType::Watched,
PEEP_THOUGHT_TYPE_NOT_HUNGRY, PeepThoughtType::NotHungry,
PEEP_THOUGHT_TYPE_NOT_THIRSTY, PeepThoughtType::NotThirsty,
PEEP_THOUGHT_TYPE_TOILET, PeepThoughtType::Toilet,
PEEP_THOUGHT_TYPE_NONE, PeepThoughtType::None,
PEEP_THOUGHT_TYPE_NONE, PeepThoughtType::None,
}; };
/** rct2: 0x00982326 */ /** rct2: 0x00982326 */
@ -877,7 +877,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
if (PeepFlags & PEEP_FLAGS_CROWDED) if (PeepFlags & PEEP_FLAGS_CROWDED)
{ {
PeepThoughtType thought_type = crowded_thoughts[scenario_rand() & 0xF]; PeepThoughtType thought_type = crowded_thoughts[scenario_rand() & 0xF];
if (thought_type != PEEP_THOUGHT_TYPE_NONE) if (thought_type != PeepThoughtType::None)
{ {
InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE);
} }
@ -938,7 +938,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
{ {
PeepThoughtType thought_type = peep_assess_surroundings(x & 0xFFE0, y & 0xFFE0, z); PeepThoughtType thought_type = peep_assess_surroundings(x & 0xFFE0, y & 0xFFE0, z);
if (thought_type != PEEP_THOUGHT_TYPE_NONE) if (thought_type != PeepThoughtType::None)
{ {
InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE);
HappinessTarget = std::min(PEEP_MAX_HAPPINESS, HappinessTarget + 45); HappinessTarget = std::min(PEEP_MAX_HAPPINESS, HappinessTarget + 45);
@ -955,7 +955,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
if (PeepFlags & PEEP_FLAGS_WOW) if (PeepFlags & PEEP_FLAGS_WOW)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_WOW2, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::Wow2, PEEP_THOUGHT_ITEM_NONE);
} }
if (GuestTimeOnRide > 15) if (GuestTimeOnRide > 15)
@ -968,8 +968,8 @@ void Guest::Tick128UpdateGuest(int32_t index)
if (ride != nullptr) if (ride != nullptr)
{ {
PeepThoughtType thought_type = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) PeepThoughtType thought_type = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE)
? PEEP_THOUGHT_TYPE_GET_OUT ? PeepThoughtType::GetOut
: PEEP_THOUGHT_TYPE_GET_OFF; : PeepThoughtType::GetOff;
InsertNewThought(thought_type, CurrentRide); InsertNewThought(thought_type, CurrentRide);
} }
@ -1019,28 +1019,28 @@ void Guest::Tick128UpdateGuest(int32_t index)
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK) if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
{ {
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_GO_HOME; possible_thoughts[num_thoughts++] = PeepThoughtType::GoHome;
} }
else else
{ {
if (Energy <= 70 && Happiness < 128) if (Energy <= 70 && Happiness < 128)
{ {
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_TIRED; possible_thoughts[num_thoughts++] = PeepThoughtType::Tired;
} }
if (Hunger <= 10 && !HasFood()) if (Hunger <= 10 && !HasFood())
{ {
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_HUNGRY; possible_thoughts[num_thoughts++] = PeepThoughtType::Hungry;
} }
if (Thirst <= 25 && !HasFood()) if (Thirst <= 25 && !HasFood())
{ {
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_THIRSTY; possible_thoughts[num_thoughts++] = PeepThoughtType::Thirsty;
} }
if (Toilet >= 160) if (Toilet >= 160)
{ {
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_TOILET; possible_thoughts[num_thoughts++] = PeepThoughtType::Toilet;
} }
if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && CashInPocket <= MONEY(9, 00) && Happiness >= 105 && Energy >= 70) if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && CashInPocket <= MONEY(9, 00) && Happiness >= 105 && Energy >= 70)
@ -1052,7 +1052,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
* 70 is also the threshold for tired thoughts (see above) and * 70 is also the threshold for tired thoughts (see above) and
* it makes sense that a tired peep might not think about getting * it makes sense that a tired peep might not think about getting
* more money. */ * more money. */
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_RUNNING_OUT; possible_thoughts[num_thoughts++] = PeepThoughtType::RunningOut;
} }
} }
@ -1064,16 +1064,16 @@ void Guest::Tick128UpdateGuest(int32_t index)
switch (chosen_thought) switch (chosen_thought)
{ {
case PEEP_THOUGHT_TYPE_HUNGRY: case PeepThoughtType::Hungry:
peep_head_for_nearest_ride_with_flags(this, RIDE_TYPE_FLAG_SELLS_FOOD); peep_head_for_nearest_ride_with_flags(this, RIDE_TYPE_FLAG_SELLS_FOOD);
break; break;
case PEEP_THOUGHT_TYPE_THIRSTY: case PeepThoughtType::Thirsty:
peep_head_for_nearest_ride_with_flags(this, RIDE_TYPE_FLAG_SELLS_DRINKS); peep_head_for_nearest_ride_with_flags(this, RIDE_TYPE_FLAG_SELLS_DRINKS);
break; break;
case PEEP_THOUGHT_TYPE_TOILET: case PeepThoughtType::Toilet:
peep_head_for_nearest_ride_with_flags(this, RIDE_TYPE_FLAG_IS_TOILET); peep_head_for_nearest_ride_with_flags(this, RIDE_TYPE_FLAG_IS_TOILET);
break; break;
case PEEP_THOUGHT_TYPE_RUNNING_OUT: case PeepThoughtType::RunningOut:
peep_head_for_nearest_ride_type(this, RIDE_TYPE_CASH_MACHINE); peep_head_for_nearest_ride_type(this, RIDE_TYPE_CASH_MACHINE);
break; break;
default: default:
@ -1090,10 +1090,10 @@ void Guest::Tick128UpdateGuest(int32_t index)
* the alternate time to the true branch). */ * the alternate time to the true branch). */
if (Nausea >= 140) if (Nausea >= 140)
{ {
PeepThoughtType thought_type = PEEP_THOUGHT_TYPE_SICK; PeepThoughtType thought_type = PeepThoughtType::Sick;
if (Nausea >= 200) if (Nausea >= 200)
{ {
thought_type = PEEP_THOUGHT_TYPE_VERY_SICK; thought_type = PeepThoughtType::VerySick;
peep_head_for_nearest_ride_type(this, RIDE_TYPE_FIRST_AID); peep_head_for_nearest_ride_type(this, RIDE_TYPE_FIRST_AID);
} }
InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(thought_type, PEEP_THOUGHT_ITEM_NONE);
@ -1393,7 +1393,7 @@ void Guest::CheckIfLost()
return; return;
TimeLost = 230; TimeLost = 230;
} }
InsertNewThought(PEEP_THOUGHT_TYPE_LOST, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::Lost, PEEP_THOUGHT_ITEM_NONE);
HappinessTarget = std::max(HappinessTarget - 30, 0); HappinessTarget = std::max(HappinessTarget - 30, 0);
} }
@ -1411,7 +1411,7 @@ void Guest::CheckCantFindRide()
// Peeps will think "I can't find ride X" twice before giving up completely. // Peeps will think "I can't find ride X" twice before giving up completely.
if (GuestIsLostCountdown == 30 || GuestIsLostCountdown == 60) if (GuestIsLostCountdown == 30 || GuestIsLostCountdown == 60)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_FIND, GuestHeadingToRideId); InsertNewThought(PeepThoughtType::CantFind, GuestHeadingToRideId);
HappinessTarget = std::max(HappinessTarget - 30, 0); HappinessTarget = std::max(HappinessTarget - 30, 0);
} }
@ -1443,7 +1443,7 @@ void Guest::CheckCantFindExit()
// Peeps who can't find the park exit will continue to get less happy until they find it. // Peeps who can't find the park exit will continue to get less happy until they find it.
if (GuestIsLostCountdown == 1) if (GuestIsLostCountdown == 1)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_FIND_EXIT, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::CantFindExit, PEEP_THOUGHT_ITEM_NONE);
HappinessTarget = std::max(HappinessTarget - 30, 0); HappinessTarget = std::max(HappinessTarget - 30, 0);
} }
@ -1479,7 +1479,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
if (HasItem(shopItem)) if (HasItem(shopItem))
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_ALREADY_GOT, EnumValue(shopItem)); InsertNewThought(PeepThoughtType::AlreadyGot, EnumValue(shopItem));
return false; return false;
} }
@ -1488,12 +1488,12 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
int32_t food = -1; int32_t food = -1;
if ((food = HasFoodStandardFlag()) != 0) if ((food = HasFoodStandardFlag()) != 0)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_HAVENT_FINISHED, bitscanforward(food)); InsertNewThought(PeepThoughtType::HaventFinished, bitscanforward(food));
return false; return false;
} }
else if ((food = HasFoodExtraFlag()) != 0) else if ((food = HasFoodExtraFlag()) != 0)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_HAVENT_FINISHED, bitscanforward(food) + 32); InsertNewThought(PeepThoughtType::HaventFinished, bitscanforward(food) + 32);
return false; return false;
} }
else if (Nausea >= 145) else if (Nausea >= 145)
@ -1514,13 +1514,13 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
if (GetShopItemDescriptor(shopItem).IsFood() && (Hunger > 75)) if (GetShopItemDescriptor(shopItem).IsFood() && (Hunger > 75))
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_NOT_HUNGRY, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::NotHungry, PEEP_THOUGHT_ITEM_NONE);
return false; return false;
} }
if (GetShopItemDescriptor(shopItem).IsDrink() && (Thirst > 75)) if (GetShopItemDescriptor(shopItem).IsDrink() && (Thirst > 75))
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_NOT_THIRSTY, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::NotThirsty, PEEP_THOUGHT_ITEM_NONE);
return false; return false;
} }
@ -1536,12 +1536,12 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
{ {
if (CashInPocket == 0) if (CashInPocket == 0)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE);
return false; return false;
} }
if (price > CashInPocket) if (price > CashInPocket)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD, EnumValue(shopItem)); InsertNewThought(PeepThoughtType::CantAffordItem, EnumValue(shopItem));
return false; return false;
} }
} }
@ -1571,8 +1571,8 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
// "I'm not paying that much for x" // "I'm not paying that much for x"
PeepThoughtType thought_type = static_cast<PeepThoughtType>( PeepThoughtType thought_type = static_cast<PeepThoughtType>(
shopItem >= ShopItem::Photo2 shopItem >= ShopItem::Photo2
? PEEP_THOUGHT_TYPE_PHOTO2_MUCH + static_cast<uint8_t>(shopItem - ShopItem::Photo2) ? EnumValue(PeepThoughtType::Photo2Much) + EnumValue(shopItem - ShopItem::Photo2)
: PEEP_THOUGHT_TYPE_BALLOON_MUCH + static_cast<uint8_t>(shopItem)); : EnumValue(PeepThoughtType::BalloonMuch) + EnumValue(shopItem));
InsertNewThought(thought_type, ride->id); InsertNewThought(thought_type, ride->id);
return false; return false;
} }
@ -1590,8 +1590,8 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
// "This x is a really good value" // "This x is a really good value"
PeepThoughtType thought_item = static_cast<PeepThoughtType>( PeepThoughtType thought_item = static_cast<PeepThoughtType>(
shopItem >= ShopItem::Photo2 shopItem >= ShopItem::Photo2
? PEEP_THOUGHT_TYPE_PHOTO2 + static_cast<uint8_t>(shopItem - ShopItem::Photo2) ? static_cast<uint8_t>(PeepThoughtType::Photo2) + static_cast<uint8_t>(shopItem - ShopItem::Photo2)
: PEEP_THOUGHT_TYPE_BALLOON + static_cast<uint8_t>(shopItem)); : static_cast<uint8_t>(PeepThoughtType::Balloon) + static_cast<uint8_t>(shopItem));
InsertNewThought(thought_item, ride->id); InsertNewThought(thought_item, ride->id);
} }
} }
@ -1791,7 +1791,7 @@ void Guest::OnExitRide(ride_id_t rideIndex)
if (ride != nullptr && peep_really_liked_ride(this, ride)) if (ride != nullptr && peep_really_liked_ride(this, ride))
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_WAS_GREAT, rideIndex); InsertNewThought(PeepThoughtType::WasGreat, rideIndex);
static constexpr OpenRCT2::Audio::SoundId laughs[3] = { OpenRCT2::Audio::SoundId::Laugh1, static constexpr OpenRCT2::Audio::SoundId laughs[3] = { OpenRCT2::Audio::SoundId::Laugh1,
OpenRCT2::Audio::SoundId::Laugh2, OpenRCT2::Audio::SoundId::Laugh2,
@ -2035,11 +2035,11 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (CashInPocket <= 0) if (CashInPocket <= 0)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE);
} }
else else
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD_0, ride->id); InsertNewThought(PeepThoughtType::CantAffordRide, ride->id);
} }
} }
ChoseNotToGoOnRide(ride, peepAtRide, true); ChoseNotToGoOnRide(ride, peepAtRide, true);
@ -2052,7 +2052,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (peepAtRide) if (peepAtRide)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_NOT_SAFE, ride->id); InsertNewThought(PeepThoughtType::NotSafe, ride->id);
if (HappinessTarget >= 64) if (HappinessTarget >= 64)
{ {
HappinessTarget -= 8; HappinessTarget -= 8;
@ -2082,7 +2082,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (peepAtRide) if (peepAtRide)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_NOT_WHILE_RAINING, ride->id); InsertNewThought(PeepThoughtType::NotWhileRaining, ride->id);
if (HappinessTarget >= 64) if (HappinessTarget >= 64)
{ {
HappinessTarget -= 8; HappinessTarget -= 8;
@ -2104,7 +2104,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (peepAtRide) if (peepAtRide)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_MORE_THRILLING, ride->id); InsertNewThought(PeepThoughtType::MoreThrilling, ride->id);
if (HappinessTarget >= 64) if (HappinessTarget >= 64)
{ {
HappinessTarget -= 8; HappinessTarget -= 8;
@ -2127,7 +2127,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (peepAtRide) if (peepAtRide)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_SICKENING, ride->id); InsertNewThought(PeepThoughtType::Sickening, ride->id);
if (HappinessTarget >= 64) if (HappinessTarget >= 64)
{ {
HappinessTarget -= 8; HappinessTarget -= 8;
@ -2183,7 +2183,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (peepAtRide) if (peepAtRide)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_BAD_VALUE, ride->id); InsertNewThought(PeepThoughtType::BadValue, ride->id);
if (HappinessTarget >= 60) if (HappinessTarget >= 60)
{ {
HappinessTarget -= 16; HappinessTarget -= 16;
@ -2201,7 +2201,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
{ {
if (!(PeepFlags & PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY)) if (!(PeepFlags & PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY))
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_GOOD_VALUE, ride->id); InsertNewThought(PeepThoughtType::GoodValue, ride->id);
} }
} }
} }
@ -2250,7 +2250,7 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop)
{ {
if (peepAtShop) if (peepAtShop)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_NOT_PAYING, ride->id); InsertNewThought(PeepThoughtType::NotPaying, ride->id);
if (HappinessTarget >= 60) if (HappinessTarget >= 60)
{ {
HappinessTarget -= 16; HappinessTarget -= 16;
@ -2279,11 +2279,11 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop)
{ {
if (CashInPocket <= 0) if (CashInPocket <= 0)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE);
} }
else else
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD_0, ride->id); InsertNewThought(PeepThoughtType::CantAffordRide, ride->id);
} }
} }
ChoseNotToGoOnRide(ride, peepAtShop, true); ChoseNotToGoOnRide(ride, peepAtShop, true);
@ -2431,7 +2431,7 @@ static void peep_ride_is_too_intense(Guest* peep, Ride* ride, bool peepAtRide)
{ {
if (peepAtRide) if (peepAtRide)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_INTENSE, ride->id); peep->InsertNewThought(PeepThoughtType::Intense, ride->id);
if (peep->HappinessTarget >= 64) if (peep->HappinessTarget >= 64)
{ {
peep->HappinessTarget -= 8; peep->HappinessTarget -= 8;
@ -2628,14 +2628,14 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r
if (peep->CashInPocket <= 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) if (peep->CashInPocket <= 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY))
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::SpentMoney, PEEP_THOUGHT_ITEM_NONE);
peep_update_ride_at_entrance_try_leave(peep); peep_update_ride_at_entrance_try_leave(peep);
return false; return false;
} }
if (ridePrice > peep->CashInPocket) if (ridePrice > peep->CashInPocket)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD_0, peep->CurrentRide); peep->InsertNewThought(PeepThoughtType::CantAffordRide, peep->CurrentRide);
peep_update_ride_at_entrance_try_leave(peep); peep_update_ride_at_entrance_try_leave(peep);
return false; return false;
} }
@ -2645,7 +2645,7 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r
{ {
if (value * 2 < ridePrice) if (value * 2 < ridePrice)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_VALUE, peep->CurrentRide); peep->InsertNewThought(PeepThoughtType::BadValue, peep->CurrentRide);
peep_update_ride_at_entrance_try_leave(peep); peep_update_ride_at_entrance_try_leave(peep);
return false; return false;
} }
@ -2916,7 +2916,7 @@ static bool peep_really_liked_ride(Peep* peep, Ride* ride)
static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre_y, int16_t centre_z) static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre_y, int16_t centre_z)
{ {
if ((tile_element_height({ centre_x, centre_y })) > centre_z) if ((tile_element_height({ centre_x, centre_y })) > centre_z)
return PEEP_THOUGHT_TYPE_NONE; return PeepThoughtType::None;
uint16_t num_scenery = 0; uint16_t num_scenery = 0;
uint16_t num_fountains = 0; uint16_t num_fountains = 0;
@ -2949,7 +2949,7 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre
scenery = tileElement->AsPath()->GetAdditionEntry(); scenery = tileElement->AsPath()->GetAdditionEntry();
if (scenery == nullptr) if (scenery == nullptr)
{ {
return PEEP_THOUGHT_TYPE_NONE; return PeepThoughtType::None;
} }
if (tileElement->AsPath()->AdditionIsGhost()) if (tileElement->AsPath()->AdditionIsGhost())
break; break;
@ -3012,19 +3012,19 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre
} }
if (num_fountains >= 5 && num_rubbish < 20) if (num_fountains >= 5 && num_rubbish < 20)
return PEEP_THOUGHT_TYPE_FOUNTAINS; return PeepThoughtType::Fountains;
if (num_scenery >= 40 && num_rubbish < 8) if (num_scenery >= 40 && num_rubbish < 8)
return PEEP_THOUGHT_TYPE_SCENERY; return PeepThoughtType::Scenery;
if (nearby_music == 1 && num_rubbish < 20) if (nearby_music == 1 && num_rubbish < 20)
return PEEP_THOUGHT_TYPE_MUSIC; return PeepThoughtType::Music;
if (num_rubbish < 2 && !gCheatsDisableLittering) if (num_rubbish < 2 && !gCheatsDisableLittering)
// if disable littering cheat is enabled, peeps will not have the "clean and tidy park" thought // if disable littering cheat is enabled, peeps will not have the "clean and tidy park" thought
return PEEP_THOUGHT_TYPE_VERY_CLEAN; return PeepThoughtType::VeryClean;
return PEEP_THOUGHT_TYPE_NONE; return PeepThoughtType::None;
} }
/** /**
@ -3117,7 +3117,7 @@ static void peep_leave_park(Peep* peep)
peep->PeepFlags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN; peep->PeepFlags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
} }
peep->InsertNewThought(PEEP_THOUGHT_TYPE_GO_HOME, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::GoHome, PEEP_THOUGHT_ITEM_NONE);
rct_window* w = window_find_by_number(WC_PEEP, peep->sprite_index); rct_window* w = window_find_by_number(WC_PEEP, peep->sprite_index);
if (w != nullptr) if (w != nullptr)
@ -3260,17 +3260,17 @@ static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeF
*/ */
void Guest::StopPurchaseThought(uint8_t ride_type) void Guest::StopPurchaseThought(uint8_t ride_type)
{ {
uint8_t thoughtType = PEEP_THOUGHT_TYPE_HUNGRY; auto thoughtType = PeepThoughtType::Hungry;
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_FOOD)) if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_FOOD))
{ {
thoughtType = PEEP_THOUGHT_TYPE_THIRSTY; thoughtType = PeepThoughtType::Thirsty;
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_DRINKS)) if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_DRINKS))
{ {
thoughtType = PEEP_THOUGHT_TYPE_RUNNING_OUT; thoughtType = PeepThoughtType::RunningOut;
if (ride_type != RIDE_TYPE_CASH_MACHINE) if (ride_type != RIDE_TYPE_CASH_MACHINE)
{ {
thoughtType = PEEP_THOUGHT_TYPE_TOILET; thoughtType = PeepThoughtType::Toilet;
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_IS_TOILET)) if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_IS_TOILET))
{ {
return; return;
@ -3284,7 +3284,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type)
{ {
rct_peep_thought* thought = &Thoughts[i]; rct_peep_thought* thought = &Thoughts[i];
if (thought->type == PEEP_THOUGHT_TYPE_NONE) if (thought->type == PeepThoughtType::None)
break; break;
if (thought->type != thoughtType) if (thought->type != thoughtType)
@ -3295,7 +3295,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type)
memmove(thought, thought + 1, sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); memmove(thought, thought + 1, sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1));
} }
Thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; Thoughts[PEEP_MAX_THOUGHTS - 1].type = PeepThoughtType::None;
WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_THOUGHTS; WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_THOUGHTS;
i--; i--;
@ -5510,11 +5510,11 @@ void Guest::UpdateWalking()
if (CurrentSeat & 1) if (CurrentSeat & 1)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_NEW_RIDE, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::NewRide, PEEP_THOUGHT_ITEM_NONE);
} }
if (CurrentRide == RIDE_ID_NULL) if (CurrentRide == RIDE_ID_NULL)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_SCENERY, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::Scenery, PEEP_THOUGHT_ITEM_NONE);
} }
} }
@ -5588,7 +5588,7 @@ void Guest::UpdateQueuing()
if (TimeInQueue >= 3500 && (0xFFFF & scenario_rand()) <= 93) if (TimeInQueue >= 3500 && (0xFFFF & scenario_rand()) <= 93)
{ {
// Create the I have been waiting in line ages thought // Create the I have been waiting in line ages thought
InsertNewThought(PEEP_THOUGHT_TYPE_QUEUING_AGES, CurrentRide); InsertNewThought(PeepThoughtType::QueuingAges, CurrentRide);
} }
} }
else else

View file

@ -918,7 +918,7 @@ void Peep::UpdateFalling()
peep_release_balloon(guest, height); peep_release_balloon(guest, height);
} }
InsertNewThought(PEEP_THOUGHT_TYPE_DROWNING, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::Drowning, PEEP_THOUGHT_ITEM_NONE);
Action = PeepActionType::Drowning; Action = PeepActionType::Drowning;
ActionFrame = 0; ActionFrame = 0;
@ -1010,7 +1010,7 @@ void Peep::UpdatePicked()
SubState++; SubState++;
if (SubState == 13) if (SubState == 13)
{ {
InsertNewThought(PEEP_THOUGHT_TYPE_HELP, PEEP_THOUGHT_ITEM_NONE); InsertNewThought(PeepThoughtType::Help, PEEP_THOUGHT_ITEM_NONE);
} }
} }
@ -1025,7 +1025,7 @@ static void peep_update_thoughts(Peep* peep)
int32_t fresh_thought = -1; int32_t fresh_thought = -1;
for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; i++) for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; i++)
{ {
if (peep->Thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) if (peep->Thoughts[i].type == PeepThoughtType::None)
break; break;
if (peep->Thoughts[i].freshness == 1) if (peep->Thoughts[i].freshness == 1)
@ -1056,7 +1056,7 @@ static void peep_update_thoughts(Peep* peep)
memmove( memmove(
&peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); &peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1));
} }
peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PeepThoughtType::None;
} }
} }
} }
@ -1173,11 +1173,11 @@ void peep_problem_warnings_update()
switch (peep->Thoughts[0].type) switch (peep->Thoughts[0].type)
{ {
case PEEP_THOUGHT_TYPE_LOST: // 0x10 case PeepThoughtType::Lost: // 0x10
lost_counter++; lost_counter++;
break; break;
case PEEP_THOUGHT_TYPE_HUNGRY: // 0x14 case PeepThoughtType::Hungry: // 0x14
if (peep->GuestHeadingToRideId == RIDE_ID_NULL) if (peep->GuestHeadingToRideId == RIDE_ID_NULL)
{ {
hunger_counter++; hunger_counter++;
@ -1188,7 +1188,7 @@ void peep_problem_warnings_update()
hunger_counter++; hunger_counter++;
break; break;
case PEEP_THOUGHT_TYPE_THIRSTY: case PeepThoughtType::Thirsty:
if (peep->GuestHeadingToRideId == RIDE_ID_NULL) if (peep->GuestHeadingToRideId == RIDE_ID_NULL)
{ {
thirst_counter++; thirst_counter++;
@ -1199,7 +1199,7 @@ void peep_problem_warnings_update()
thirst_counter++; thirst_counter++;
break; break;
case PEEP_THOUGHT_TYPE_TOILET: case PeepThoughtType::Toilet:
if (peep->GuestHeadingToRideId == RIDE_ID_NULL) if (peep->GuestHeadingToRideId == RIDE_ID_NULL)
{ {
toilet_counter++; toilet_counter++;
@ -1210,16 +1210,16 @@ void peep_problem_warnings_update()
toilet_counter++; toilet_counter++;
break; break;
case PEEP_THOUGHT_TYPE_BAD_LITTER: // 0x1a case PeepThoughtType::BadLitter: // 0x1a
litter_counter++; litter_counter++;
break; break;
case PEEP_THOUGHT_TYPE_CANT_FIND_EXIT: // 0x1b case PeepThoughtType::CantFindExit: // 0x1b
noexit_counter++; noexit_counter++;
break; break;
case PEEP_THOUGHT_TYPE_PATH_DISGUSTING: // 0x1f case PeepThoughtType::PathDisgusting: // 0x1f
disgust_counter++; disgust_counter++;
break; break;
case PEEP_THOUGHT_TYPE_VANDALISM: // 0x21 case PeepThoughtType::Vandalism: // 0x21
vandalism_counter++; vandalism_counter++;
break; break;
default: default:
@ -1532,7 +1532,7 @@ static constexpr const uint8_t tshirt_colours[] = {
*/ */
void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArguments) void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArguments)
{ {
PeepActionType newAction = PeepThoughtToActionMap[thoughtType].action; PeepActionType newAction = PeepThoughtToActionMap[EnumValue(thoughtType)].action;
if (newAction != PeepActionType::None2 && this->Action >= PeepActionType::None1) if (newAction != PeepActionType::None2 && this->Action >= PeepActionType::None1)
{ {
Action = newAction; Action = newAction;
@ -1545,7 +1545,7 @@ void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgument
{ {
rct_peep_thought* thought = &Thoughts[i]; rct_peep_thought* thought = &Thoughts[i];
// Remove the oldest thought by setting it to NONE. // Remove the oldest thought by setting it to NONE.
if (thought->type == PEEP_THOUGHT_TYPE_NONE) if (thought->type == PeepThoughtType::None)
break; break;
if (thought->type == thoughtType && thought->item == thoughtArguments) if (thought->type == thoughtType && thought->item == thoughtArguments)
@ -1606,7 +1606,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords)
peep->InteractionRideIndex = RIDE_ID_NULL; peep->InteractionRideIndex = RIDE_ID_NULL;
peep->AssignedPeepType = PeepType::Guest; peep->AssignedPeepType = PeepType::Guest;
peep->PreviousRide = RIDE_ID_NULL; peep->PreviousRide = RIDE_ID_NULL;
peep->Thoughts->type = PEEP_THOUGHT_TYPE_NONE; peep->Thoughts->type = PeepThoughtType::None;
peep->WindowInvalidateFlags = 0; peep->WindowInvalidateFlags = 0;
uint8_t intensityHighest = (scenario_rand() & 0x7) + 3; uint8_t intensityHighest = (scenario_rand() & 0x7) + 3;
@ -1996,9 +1996,9 @@ bool Peep::SetName(const std::string_view& value)
*/ */
void peep_thought_set_format_args(const rct_peep_thought* thought, Formatter& ft) void peep_thought_set_format_args(const rct_peep_thought* thought, Formatter& ft)
{ {
ft.Add<rct_string_id>(PeepThoughts[thought->type]); ft.Add<rct_string_id>(PeepThoughts[EnumValue(thought->type)]);
PeepThoughtToActionFlag flags = PeepThoughtToActionMap[thought->type].flags; PeepThoughtToActionFlag flags = PeepThoughtToActionMap[EnumValue(thought->type)].flags;
if (flags & PEEP_THOUGHT_ACTION_FLAG_RIDE) if (flags & PEEP_THOUGHT_ACTION_FLAG_RIDE)
{ {
auto ride = get_ride(thought->item); auto ride = get_ride(thought->item);
@ -2617,7 +2617,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool
{ {
if ((scenario_rand() & 0xFFFF) <= 10922) if ((scenario_rand() & 0xFFFF) <= 10922)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_VANDALISM, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::Vandalism, PEEP_THOUGHT_ITEM_NONE);
peep->HappinessTarget = std::max(0, peep->HappinessTarget - 17); peep->HappinessTarget = std::max(0, peep->HappinessTarget - 17);
} }
vandalThoughtTimeout = 3; vandalThoughtTimeout = 3;
@ -2662,7 +2662,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool
if (crowded >= 10 && peep->State == PeepState::Walking && (scenario_rand() & 0xFFFF) <= 21845) if (crowded >= 10 && peep->State == PeepState::Walking && (scenario_rand() & 0xFFFF) <= 21845)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_CROWDED, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::Crowded, PEEP_THOUGHT_ITEM_NONE);
peep->HappinessTarget = std::max(0, peep->HappinessTarget - 14); peep->HappinessTarget = std::max(0, peep->HappinessTarget - 14);
} }
@ -2688,7 +2688,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool
if (total_sick >= 3 && (scenario_rand() & 0xFFFF) <= 10922) if (total_sick >= 3 && (scenario_rand() & 0xFFFF) <= 10922)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_PATH_DISGUSTING, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::PathDisgusting, PEEP_THOUGHT_ITEM_NONE);
peep->HappinessTarget = std::max(0, peep->HappinessTarget - 17); peep->HappinessTarget = std::max(0, peep->HappinessTarget - 17);
// Reset disgusting time // Reset disgusting time
peep->DisgustingCount |= 0xC0; peep->DisgustingCount |= 0xC0;
@ -2714,7 +2714,7 @@ static void peep_footpath_move_forward(Peep* peep, const CoordsXYE& coords, bool
if (total_litter >= 3 && (scenario_rand() & 0xFFFF) <= 10922) if (total_litter >= 3 && (scenario_rand() & 0xFFFF) <= 10922)
{ {
peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_LITTER, PEEP_THOUGHT_ITEM_NONE); peep->InsertNewThought(PeepThoughtType::BadLitter, PEEP_THOUGHT_ITEM_NONE);
peep->HappinessTarget = std::max(0, peep->HappinessTarget - 17); peep->HappinessTarget = std::max(0, peep->HappinessTarget - 17);
// Reset litter time // Reset litter time
peep->LitterCount |= 0xC0; peep->LitterCount |= 0xC0;

View file

@ -74,148 +74,148 @@ enum class StaffType : uint8_t
Count Count
}; };
enum PeepThoughtType : uint8_t enum class PeepThoughtType : uint8_t
{ {
PEEP_THOUGHT_TYPE_CANT_AFFORD_0 = 0, // "I can't afford" CantAffordRide = 0, // "I can't afford"
PEEP_THOUGHT_TYPE_SPENT_MONEY = 1, // "I've spent all my money" SpentMoney = 1, // "I've spent all my money"
PEEP_THOUGHT_TYPE_SICK = 2, // "I feel sick" Sick = 2, // "I feel sick"
PEEP_THOUGHT_TYPE_VERY_SICK = 3, // "I feel very sick" VerySick = 3, // "I feel very sick"
PEEP_THOUGHT_TYPE_MORE_THRILLING = 4, // "I want to go on something more thrilling than X" MoreThrilling = 4, // "I want to go on something more thrilling than X"
PEEP_THOUGHT_TYPE_INTENSE = 5, // "X looks too intense for me" Intense = 5, // "X looks too intense for me"
PEEP_THOUGHT_TYPE_HAVENT_FINISHED = 6, // "I haven't finished my X yet" HaventFinished = 6, // "I haven't finished my X yet"
PEEP_THOUGHT_TYPE_SICKENING = 7, // "Just looking at X makes me feel sick" Sickening = 7, // "Just looking at X makes me feel sick"
PEEP_THOUGHT_TYPE_BAD_VALUE = 8, // "I'm not paying that much to go on X" BadValue = 8, // "I'm not paying that much to go on X"
PEEP_THOUGHT_TYPE_GO_HOME = 9, // "I want to go home" GoHome = 9, // "I want to go home"
PEEP_THOUGHT_TYPE_GOOD_VALUE = 10, // "X is really good value" GoodValue = 10, // "X is really good value"
PEEP_THOUGHT_TYPE_ALREADY_GOT = 11, // "I've already got" AlreadyGot = 11, // "I've already got"
PEEP_THOUGHT_TYPE_CANT_AFFORD = 12, // "I can't afford" CantAffordItem = 12, // "I can't afford"
PEEP_THOUGHT_TYPE_NOT_HUNGRY = 13, // "I'm not hungry" NotHungry = 13, // "I'm not hungry"
PEEP_THOUGHT_TYPE_NOT_THIRSTY = 14, // "I'm not thirsty" NotThirsty = 14, // "I'm not thirsty"
PEEP_THOUGHT_TYPE_DROWNING = 15, // "Help! I'm drowning!" Drowning = 15, // "Help! I'm drowning!"
PEEP_THOUGHT_TYPE_LOST = 16, // "I'm lost!" Lost = 16, // "I'm lost!"
PEEP_THOUGHT_TYPE_WAS_GREAT = 17, // "X was great" WasGreat = 17, // "X was great"
PEEP_THOUGHT_TYPE_QUEUING_AGES = 18, // "I've been queuing for X for ages" QueuingAges = 18, // "I've been queuing for X for ages"
PEEP_THOUGHT_TYPE_TIRED = 19, // "I'm tired" Tired = 19, // "I'm tired"
PEEP_THOUGHT_TYPE_HUNGRY = 20, // "I'm hungry" Hungry = 20, // "I'm hungry"
PEEP_THOUGHT_TYPE_THIRSTY = 21, // "I'm thirsty" Thirsty = 21, // "I'm thirsty"
PEEP_THOUGHT_TYPE_TOILET = 22, // "I need to go to the toilet" Toilet = 22, // "I need to go to the toilet"
PEEP_THOUGHT_TYPE_CANT_FIND = 23, // "I can't find X" CantFind = 23, // "I can't find X"
PEEP_THOUGHT_TYPE_NOT_PAYING = 24, // "I'm not paying that much to use X" NotPaying = 24, // "I'm not paying that much to use X"
PEEP_THOUGHT_TYPE_NOT_WHILE_RAINING = 25, // "I'm not going on X while it's raining" NotWhileRaining = 25, // "I'm not going on X while it's raining"
PEEP_THOUGHT_TYPE_BAD_LITTER = 26, // "The litter here is really bad" BadLitter = 26, // "The litter here is really bad"
PEEP_THOUGHT_TYPE_CANT_FIND_EXIT = 27, // "I can't find the exit" CantFindExit = 27, // "I can't find the exit"
PEEP_THOUGHT_TYPE_GET_OFF = 28, // "I want to get off X" GetOff = 28, // "I want to get off X"
PEEP_THOUGHT_TYPE_GET_OUT = 29, // "I want to get out of X" GetOut = 29, // "I want to get out of X"
PEEP_THOUGHT_TYPE_NOT_SAFE = 30, // "I'm not going on X - it isn't safe" NotSafe = 30, // "I'm not going on X - it isn't safe"
PEEP_THOUGHT_TYPE_PATH_DISGUSTING = 31, // "This path is disgusting" PathDisgusting = 31, // "This path is disgusting"
PEEP_THOUGHT_TYPE_CROWDED = 32, // "It's too crowded here" Crowded = 32, // "It's too crowded here"
PEEP_THOUGHT_TYPE_VANDALISM = 33, // "The vandalism here is really bad" Vandalism = 33, // "The vandalism here is really bad"
PEEP_THOUGHT_TYPE_SCENERY = 34, // "Great scenery!" Scenery = 34, // "Great scenery!"
PEEP_THOUGHT_TYPE_VERY_CLEAN = 35, // "This park is very clean and tidy" VeryClean = 35, // "This park is very clean and tidy"
PEEP_THOUGHT_TYPE_FOUNTAINS = 36, // "The jumping fountains are great" Fountains = 36, // "The jumping fountains are great"
PEEP_THOUGHT_TYPE_MUSIC = 37, // "The music is nice here" Music = 37, // "The music is nice here"
PEEP_THOUGHT_TYPE_BALLOON = 38, // "This balloon from X is really good value" Balloon = 38, // "This balloon from X is really good value"
PEEP_THOUGHT_TYPE_TOY = 39, // "This cuddly toy from X is really good value" Toy = 39, // "This cuddly toy from X is really good value"
PEEP_THOUGHT_TYPE_MAP = 40, Map = 40,
PEEP_THOUGHT_TYPE_PHOTO = 41, // "This on ride photo from X is really good value" Photo = 41, // "This on ride photo from X is really good value"
PEEP_THOUGHT_TYPE_UMBRELLA = 42, Umbrella = 42,
PEEP_THOUGHT_TYPE_DRINK = 43, Drink = 43,
PEEP_THOUGHT_TYPE_BURGER = 44, Burger = 44,
PEEP_THOUGHT_TYPE_CHIPS = 45, Chips = 45,
PEEP_THOUGHT_TYPE_ICE_CREAM = 46, IceCream = 46,
PEEP_THOUGHT_TYPE_CANDYFLOSS = 47, Candyfloss = 47,
PEEP_THOUGHT_TYPE_PIZZA = 51, Pizza = 51,
PEEP_THOUGHT_TYPE_POPCORN = 53, Popcorn = 53,
PEEP_THOUGHT_TYPE_HOT_DOG = 54, HotDog = 54,
PEEP_THOUGHT_TYPE_TENTACLE = 55, Tentacle = 55,
PEEP_THOUGHT_TYPE_HAT = 56, Hat = 56,
PEEP_THOUGHT_TYPE_TOFFEE_APPLE = 57, ToffeeApple = 57,
PEEP_THOUGHT_TYPE_TSHIRT = 58, Tshirt = 58,
PEEP_THOUGHT_TYPE_DOUGHNUT = 59, Doughnut = 59,
PEEP_THOUGHT_TYPE_COFFEE = 60, Coffee = 60,
PEEP_THOUGHT_TYPE_CHICKEN = 62, Chicken = 62,
PEEP_THOUGHT_TYPE_LEMONADE = 63, Lemonade = 63,
PEEP_THOUGHT_TYPE_WOW = 67, // "Wow!" Wow = 67, // "Wow!"
PEEP_THOUGHT_TYPE_WOW2 = 70, // "Wow!" Wow2 = 70, // "Wow!"
PEEP_THOUGHT_TYPE_WATCHED = 71, // "I have the strangest feeling someone is watching me" Watched = 71, // "I have the strangest feeling someone is watching me"
PEEP_THOUGHT_TYPE_BALLOON_MUCH = 72, // "I'm not paying that much to get a balloon from X" BalloonMuch = 72, // "I'm not paying that much to get a balloon from X"
PEEP_THOUGHT_TYPE_TOY_MUCH = 73, ToyMuch = 73,
PEEP_THOUGHT_TYPE_MAP_MUCH = 74, MapMuch = 74,
PEEP_THOUGHT_TYPE_PHOTO_MUCH = 75, PhotoMuch = 75,
PEEP_THOUGHT_TYPE_UMBRELLA_MUCH = 76, UmbrellaMuch = 76,
PEEP_THOUGHT_TYPE_DRINK_MUCH = 77, DrinkMuch = 77,
PEEP_THOUGHT_TYPE_BURGER_MUCH = 78, BurgerMuch = 78,
PEEP_THOUGHT_TYPE_CHIPS_MUCH = 79, ChipsMuch = 79,
PEEP_THOUGHT_TYPE_ICE_CREAM_MUCH = 80, IceCreamMuch = 80,
PEEP_THOUGHT_TYPE_CANDYFLOSS_MUCH = 81, CandyflossMuch = 81,
PEEP_THOUGHT_TYPE_PIZZA_MUCH = 85, PizzaMuch = 85,
PEEP_THOUGHT_TYPE_POPCORN_MUCH = 87, PopcornMuch = 87,
PEEP_THOUGHT_TYPE_HOT_DOG_MUCH = 88, Hot_dogMuch = 88,
PEEP_THOUGHT_TYPE_TENTACLE_MUCH = 89, TentacleMuch = 89,
PEEP_THOUGHT_TYPE_HAT_MUCH = 90, HatMuch = 90,
PEEP_THOUGHT_TYPE_TOFFEE_APPLE_MUCH = 91, ToffeeAppleMuch = 91,
PEEP_THOUGHT_TYPE_TSHIRT_MUCH = 92, TshirtMuch = 92,
PEEP_THOUGHT_TYPE_DOUGHNUT_MUCH = 93, DoughnutMuch = 93,
PEEP_THOUGHT_TYPE_COFFEE_MUCH = 94, CoffeeMuch = 94,
PEEP_THOUGHT_TYPE_CHICKEN_MUCH = 96, ChickenMuch = 96,
PEEP_THOUGHT_TYPE_LEMONADE_MUCH = 97, LemonadeMuch = 97,
PEEP_THOUGHT_TYPE_PHOTO2 = 104, // "This on-ride photo from X is really good value" Photo2 = 104, // "This on-ride photo from X is really good value"
PEEP_THOUGHT_TYPE_PHOTO3 = 105, Photo3 = 105,
PEEP_THOUGHT_TYPE_PHOTO4 = 106, Photo4 = 106,
PEEP_THOUGHT_TYPE_PRETZEL = 107, Pretzel = 107,
PEEP_THOUGHT_TYPE_HOT_CHOCOLATE = 108, HotChocolate = 108,
PEEP_THOUGHT_TYPE_ICED_TEA = 109, IcedTea = 109,
PEEP_THOUGHT_TYPE_FUNNEL_CAKE = 110, FunnelCake = 110,
PEEP_THOUGHT_TYPE_SUNGLASSES = 111, Sunglasses = 111,
PEEP_THOUGHT_TYPE_BEEF_NOODLES = 112, BeefNoodles = 112,
PEEP_THOUGHT_TYPE_FRIED_RICE_NOODLES = 113, FriedRiceNoodles = 113,
PEEP_THOUGHT_TYPE_WONTON_SOUP = 114, WontonSoup = 114,
PEEP_THOUGHT_TYPE_MEATBALL_SOUP = 115, MeatballSoup = 115,
PEEP_THOUGHT_TYPE_FRUIT_JUICE = 116, FruitJuice = 116,
PEEP_THOUGHT_TYPE_SOYBEAN_MILK = 117, SoybeanMilk = 117,
PEEP_THOUGHT_TYPE_SU_JONGKWA = 118, Sujongkwa = 118,
PEEP_THOUGHT_TYPE_SUB_SANDWICH = 119, SubSandwich = 119,
PEEP_THOUGHT_TYPE_COOKIE = 120, Cookie = 120,
PEEP_THOUGHT_TYPE_ROAST_SAUSAGE = 124, RoastSausage = 124,
PEEP_THOUGHT_TYPE_PHOTO2_MUCH = 136, Photo2Much = 136,
PEEP_THOUGHT_TYPE_PHOTO3_MUCH = 137, Photo3Much = 137,
PEEP_THOUGHT_TYPE_PHOTO4_MUCH = 138, Photo4Much = 138,
PEEP_THOUGHT_TYPE_PRETZEL_MUCH = 139, PretzelMuch = 139,
PEEP_THOUGHT_TYPE_HOT_CHOCOLATE_MUCH = 140, HotChocolateMuch = 140,
PEEP_THOUGHT_TYPE_ICED_TEA_MUCH = 141, IcedTeaMuch = 141,
PEEP_THOUGHT_TYPE_FUNNEL_CAKE_MUCH = 142, FunnelCakeMuch = 142,
PEEP_THOUGHT_TYPE_SUNGLASSES_MUCH = 143, SunglassesMuch = 143,
PEEP_THOUGHT_TYPE_BEEF_NOODLES_MUCH = 144, BeefNoodlesMuch = 144,
PEEP_THOUGHT_TYPE_FRIED_RICE_NOODLES_MUCH = 145, FriedRiceNoodlesMuch = 145,
PEEP_THOUGHT_TYPE_WONTON_SOUP_MUCH = 146, WontonSoupMuch = 146,
PEEP_THOUGHT_TYPE_MEATBALL_SOUP_MUCH = 147, MeatballSoupMuch = 147,
PEEP_THOUGHT_TYPE_FRUIT_JUICE_MUCH = 148, FruitJuiceMuch = 148,
PEEP_THOUGHT_TYPE_SOYBEAN_MILK_MUCH = 149, SoybeanMilkMuch = 149,
PEEP_THOUGHT_TYPE_SU_JONGKWA_MUCH = 150, SujongkwaMuch = 150,
PEEP_THOUGHT_TYPE_SUB_SANDWICH_MUCH = 151, SubSandwichMuch = 151,
PEEP_THOUGHT_TYPE_COOKIE_MUCH = 152, CookieMuch = 152,
PEEP_THOUGHT_TYPE_ROAST_SAUSAGE_MUCH = 156, RoastSausageMuch = 156,
PEEP_THOUGHT_TYPE_HELP = 168, // "Help! Put me down!" Help = 168, // "Help! Put me down!"
PEEP_THOUGHT_TYPE_RUNNING_OUT = 169, // "I'm running out of cash!" RunningOut = 169, // "I'm running out of cash!"
PEEP_THOUGHT_TYPE_NEW_RIDE = 170, // "Wow! A new ride being built!" NewRide = 170, // "Wow! A new ride being built!"
PEEP_THOUGHT_TYPE_NICE_RIDE_DEPRECATED = 171, // "Nice ride! But not as good as the Phoenix..." NiceRideDeprecated = 171, // "Nice ride! But not as good as the Phoenix..."
PEEP_THOUGHT_TYPE_EXCITED_DEPRECATED = 172, // "I'm so excited - It's an Intamin ride!" ExcitedDeprecated = 172, // "I'm so excited - It's an Intamin ride!"
PEEP_THOUGHT_TYPE_HERE_WE_ARE = 173, // "...and here we are on X!" HereWeAre = 173, // "...and here we are on X!"
PEEP_THOUGHT_TYPE_NONE = 255 None = 255
}; };
enum class PeepState : uint8_t enum class PeepState : uint8_t

View file

@ -3024,7 +3024,7 @@ void Vehicle::PeepEasterEggHereWeAre() const
auto* curPeep = GetEntity<Guest>(vehicle->peep[i]); auto* curPeep = GetEntity<Guest>(vehicle->peep[i]);
if (curPeep != nullptr && curPeep->PeepFlags & PEEP_FLAGS_HERE_WE_ARE) if (curPeep != nullptr && curPeep->PeepFlags & PEEP_FLAGS_HERE_WE_ARE)
{ {
curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->CurrentRide); curPeep->InsertNewThought(PeepThoughtType::HereWeAre, curPeep->CurrentRide);
} }
} }
} }