2017-10-13 10:06:36 +02:00
|
|
|
/*****************************************************************************
|
2024-01-01 12:52:28 +01:00
|
|
|
* Copyright (c) 2014-2024 OpenRCT2 developers
|
2017-10-13 10:06:36 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2017-10-13 10:06:36 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2017-10-13 10:06:36 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2021-08-21 09:43:26 +02:00
|
|
|
#pragma once
|
2017-10-13 10:06:36 +02:00
|
|
|
|
2021-11-07 16:53:15 +01:00
|
|
|
#include "../Identifiers.h"
|
2017-10-13 10:06:36 +02:00
|
|
|
#include "../common.h"
|
2021-11-24 15:48:33 +01:00
|
|
|
#include "../entity/EntityBase.h"
|
2019-01-12 11:11:55 +01:00
|
|
|
#include "../ride/RideTypes.h"
|
2021-10-28 22:38:23 +02:00
|
|
|
#include "../ride/Station.h"
|
2020-10-06 06:56:52 +02:00
|
|
|
#include "../util/Util.h"
|
2018-03-13 13:14:02 +01:00
|
|
|
#include "../world/Location.hpp"
|
2017-10-13 10:06:36 +02:00
|
|
|
|
2020-05-09 13:23:45 +02:00
|
|
|
#include <algorithm>
|
2021-12-12 00:06:06 +01:00
|
|
|
#include <array>
|
2020-02-01 22:11:45 +01:00
|
|
|
#include <optional>
|
2019-01-20 16:47:31 +01:00
|
|
|
|
2024-04-15 17:21:49 +02:00
|
|
|
constexpr uint8_t kPeepMinEnergy = 32;
|
|
|
|
constexpr uint8_t kPeepMaxEnergy = 128;
|
2024-04-15 17:36:43 +02:00
|
|
|
constexpr uint8_t kPeepMaxEnergyTarget = 255; // Oddly, this differs from max energy!
|
2017-10-13 10:06:36 +02:00
|
|
|
|
2020-01-04 12:01:35 +01:00
|
|
|
constexpr auto PEEP_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP;
|
|
|
|
|
2020-04-21 12:38:59 +02:00
|
|
|
class Formatter;
|
2018-11-01 13:53:50 +01:00
|
|
|
struct TileElement;
|
2022-10-14 20:26:36 +02:00
|
|
|
struct PaintSession;
|
2021-05-09 20:12:44 +02:00
|
|
|
|
2020-10-15 03:04:39 +02:00
|
|
|
namespace GameActions
|
|
|
|
{
|
|
|
|
class Result;
|
|
|
|
}
|
2018-03-13 13:14:02 +01:00
|
|
|
|
2020-08-17 00:25:32 +02:00
|
|
|
enum class StaffType : uint8_t
|
|
|
|
{
|
|
|
|
Handyman,
|
|
|
|
Mechanic,
|
|
|
|
Security,
|
|
|
|
Entertainer,
|
|
|
|
|
|
|
|
Count
|
|
|
|
};
|
|
|
|
|
2020-09-28 20:51:49 +02:00
|
|
|
enum class PeepState : uint8_t
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2020-09-28 20:51:49 +02:00
|
|
|
Falling = 0, // Drowning is part of falling
|
|
|
|
One = 1, // was PEEP_STATE_1
|
|
|
|
QueuingFront = 2,
|
|
|
|
OnRide = 3,
|
|
|
|
LeavingRide = 4,
|
|
|
|
Walking = 5,
|
|
|
|
Queuing = 6,
|
|
|
|
EnteringRide = 7,
|
|
|
|
Sitting = 8,
|
|
|
|
Picked = 9,
|
|
|
|
Patrolling = 10, // Not sure
|
|
|
|
Mowing = 11,
|
|
|
|
Sweeping = 12,
|
|
|
|
EnteringPark = 13,
|
|
|
|
LeavingPark = 14,
|
|
|
|
Answering = 15,
|
|
|
|
Fixing = 16,
|
|
|
|
Buying = 17,
|
|
|
|
Watching = 18,
|
|
|
|
EmptyingBin = 19,
|
|
|
|
UsingBin = 20,
|
|
|
|
Watering = 21,
|
|
|
|
HeadingToInspection = 22,
|
|
|
|
Inspecting = 23
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
|
2020-09-14 21:11:17 +02:00
|
|
|
enum class PeepSittingSubState : uint8_t
|
2018-02-27 23:05:51 +01:00
|
|
|
{
|
2020-09-14 21:11:17 +02:00
|
|
|
TryingToSit, // was = 0
|
|
|
|
SatDown // was unassigned
|
2018-02-27 23:05:51 +01:00
|
|
|
};
|
|
|
|
|
2020-09-30 23:33:58 +02:00
|
|
|
enum class PeepRideSubState : uint8_t
|
2018-02-27 23:05:51 +01:00
|
|
|
{
|
2020-09-30 23:33:58 +02:00
|
|
|
AtEntrance = 0,
|
|
|
|
InEntrance = 1,
|
|
|
|
FreeVehicleCheck = 2, // Spend money on ride
|
2021-01-10 19:23:35 +01:00
|
|
|
LeaveEntrance = 3, // Calculate what direction and where to go after committing to entering vehicle
|
2020-09-30 23:33:58 +02:00
|
|
|
ApproachVehicle = 4,
|
|
|
|
EnterVehicle = 5,
|
|
|
|
OnRide = 6,
|
|
|
|
LeaveVehicle = 7,
|
|
|
|
ApproachExit = 8,
|
|
|
|
InExit = 9,
|
2021-01-30 17:20:01 +01:00
|
|
|
InQueue = 10,
|
|
|
|
AtQueueFront = 11,
|
2020-09-30 23:33:58 +02:00
|
|
|
ApproachVehicleWaypoints = 12,
|
|
|
|
ApproachExitWaypoints = 13,
|
|
|
|
ApproachSpiralSlide = 14,
|
|
|
|
OnSpiralSlide = 15,
|
|
|
|
LeaveSpiralSlide = 16,
|
|
|
|
MazePathfinding = 17,
|
|
|
|
LeaveExit = 18,
|
|
|
|
ApproachShop = 19,
|
|
|
|
InteractShop = 20,
|
|
|
|
LeaveShop = 21
|
2018-02-27 23:05:51 +01:00
|
|
|
};
|
|
|
|
|
2020-10-20 03:22:24 +02:00
|
|
|
enum class PeepUsingBinSubState : uint8_t
|
2018-04-05 00:41:38 +02:00
|
|
|
{
|
2020-10-20 03:22:24 +02:00
|
|
|
WalkingToBin = 0,
|
|
|
|
GoingBack,
|
2018-04-05 00:41:38 +02:00
|
|
|
};
|
|
|
|
|
2020-09-30 23:19:10 +02:00
|
|
|
enum class PeepActionType : uint8_t
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2020-09-30 23:19:10 +02:00
|
|
|
CheckTime = 0,
|
2017-10-13 10:06:36 +02:00
|
|
|
// If no food then check watch
|
2020-09-30 23:19:10 +02:00
|
|
|
EatFood = 1,
|
|
|
|
ShakeHead = 2,
|
|
|
|
EmptyPockets = 3,
|
|
|
|
SittingEatFood = 4,
|
|
|
|
SittingCheckWatch = 4,
|
|
|
|
SittingLookAroundLeft = 5,
|
|
|
|
SittingLookAroundRight = 6,
|
|
|
|
Wow = 7,
|
|
|
|
ThrowUp = 8,
|
|
|
|
Jump = 9,
|
|
|
|
StaffSweep = 10,
|
|
|
|
Drowning = 11,
|
|
|
|
StaffAnswerCall = 12,
|
|
|
|
StaffAnswerCall2 = 13,
|
|
|
|
StaffCheckboard = 14,
|
|
|
|
StaffFix = 15,
|
|
|
|
StaffFix2 = 16,
|
|
|
|
StaffFixGround = 17,
|
|
|
|
StaffFix3 = 18,
|
|
|
|
StaffWatering = 19,
|
|
|
|
Joy = 20,
|
|
|
|
ReadMap = 21,
|
|
|
|
Wave = 22,
|
|
|
|
StaffEmptyBin = 23,
|
|
|
|
Wave2 = 24,
|
|
|
|
TakePhoto = 25,
|
|
|
|
Clap = 26,
|
|
|
|
Disgust = 27,
|
|
|
|
DrawPicture = 28,
|
|
|
|
BeingWatched = 29,
|
|
|
|
WithdrawMoney = 30,
|
|
|
|
|
2021-05-11 08:44:41 +02:00
|
|
|
Idle = 254,
|
|
|
|
Walking = 255,
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
|
2020-09-27 01:52:45 +02:00
|
|
|
enum class PeepActionSpriteType : uint8_t
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2020-09-27 01:52:45 +02:00
|
|
|
None = 0,
|
|
|
|
CheckTime = 1,
|
|
|
|
WatchRide = 2,
|
|
|
|
EatFood = 3,
|
|
|
|
ShakeHead = 4,
|
|
|
|
EmptyPockets = 5,
|
|
|
|
HoldMat = 6,
|
|
|
|
SittingIdle = 7,
|
|
|
|
SittingEatFood = 8,
|
|
|
|
SittingLookAroundLeft = 9,
|
|
|
|
SittingLookAroundRight = 10,
|
|
|
|
Ui = 11,
|
|
|
|
StaffMower = 12,
|
|
|
|
Wow = 13,
|
|
|
|
ThrowUp = 14,
|
|
|
|
Jump = 15,
|
|
|
|
StaffSweep = 16,
|
|
|
|
Drowning = 17,
|
|
|
|
StaffAnswerCall = 18,
|
|
|
|
StaffAnswerCall2 = 19,
|
|
|
|
StaffCheckboard = 20,
|
|
|
|
StaffFix = 21,
|
|
|
|
StaffFix2 = 22,
|
|
|
|
StaffFixGround = 23,
|
|
|
|
StaffFix3 = 24,
|
|
|
|
StaffWatering = 25,
|
|
|
|
Joy = 26,
|
|
|
|
ReadMap = 27,
|
|
|
|
Wave = 28,
|
|
|
|
StaffEmptyBin = 29,
|
|
|
|
Wave2 = 30,
|
|
|
|
TakePhoto = 31,
|
|
|
|
Clap = 32,
|
|
|
|
Disgust = 33,
|
|
|
|
DrawPicture = 34,
|
|
|
|
BeingWatched = 35,
|
|
|
|
WithdrawMoney = 36,
|
|
|
|
|
|
|
|
Invalid = 255
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
|
2019-01-02 15:10:05 +01:00
|
|
|
enum PeepFlags : uint32_t
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_FLAGS_LEAVING_PARK = (1 << 0),
|
|
|
|
PEEP_FLAGS_SLOW_WALK = (1 << 1),
|
2024-02-22 22:07:15 +01:00
|
|
|
PEEP_FLAGS_DEBUG_PATHFINDING = (1 << 2), // Enables debug logging for path finding
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_FLAGS_TRACKING = (1 << 3),
|
|
|
|
PEEP_FLAGS_WAVING = (1 << 4), // Makes the peep wave
|
|
|
|
PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY = (1 << 5), // Set on paying to enter park
|
|
|
|
PEEP_FLAGS_PHOTO = (1 << 6), // Makes the peep take a picture
|
|
|
|
PEEP_FLAGS_PAINTING = (1 << 7),
|
|
|
|
PEEP_FLAGS_WOW = (1 << 8), // Makes a peep WOW2
|
|
|
|
PEEP_FLAGS_LITTER = (1 << 9), // Makes the peep throw litter
|
|
|
|
PEEP_FLAGS_LOST = (1 << 10), // Makes the peep feel lost (animation triggered)
|
|
|
|
PEEP_FLAGS_HUNGER = (1 << 11), // Makes the peep become hungry quicker
|
2020-04-25 15:34:43 +02:00
|
|
|
PEEP_FLAGS_TOILET = (1 << 12), // Makes the peep want to go to the toilet
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_FLAGS_CROWDED = (1 << 13), // The peep will start feeling crowded
|
|
|
|
PEEP_FLAGS_HAPPINESS = (1 << 14), // The peep will start increasing happiness
|
|
|
|
PEEP_FLAGS_NAUSEA = (1 << 15), // Makes the peep feel sick (e.g. after an extreme ride)
|
|
|
|
PEEP_FLAGS_PURPLE = (1 << 16), // Makes surrounding peeps purple
|
|
|
|
PEEP_FLAGS_PIZZA = (1 << 17), // Gives passing peeps pizza
|
|
|
|
PEEP_FLAGS_EXPLODE = (1 << 18),
|
2017-10-13 10:06:36 +02:00
|
|
|
PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE = (1 << 19),
|
|
|
|
PEEP_FLAGS_PARK_ENTRANCE_CHOSEN = (1 << 20), // Set when the nearest park entrance has been chosen
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_FLAGS_21 = (1 << 21),
|
2017-10-13 10:06:36 +02:00
|
|
|
PEEP_FLAGS_CONTAGIOUS = (1 << 22), // Makes any peeps in surrounding tiles sick
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_FLAGS_JOY = (1 << 23), // Makes the peep jump in joy
|
|
|
|
PEEP_FLAGS_ANGRY = (1 << 24),
|
2018-07-21 11:50:45 +02:00
|
|
|
PEEP_FLAGS_ICE_CREAM = (1 << 25), // Gives passing peeps ice cream and they wave back
|
|
|
|
PEEP_FLAGS_NICE_RIDE_DEPRECATED = (1 << 26), // Used to make the peep think "Nice ride! But not as good as the Phoenix..."
|
|
|
|
// on exiting a ride
|
|
|
|
PEEP_FLAGS_INTAMIN_DEPRECATED = (1 << 27), // Used to make the peep think "I'm so excited - It's an Intamin ride!" while
|
|
|
|
// riding on a Intamin ride.
|
|
|
|
PEEP_FLAGS_HERE_WE_ARE = (1 << 28), // Makes the peep think "...and here we are on X!" while riding a ride
|
2020-05-27 16:03:56 +02:00
|
|
|
PEEP_FLAGS_TWITCH_DEPRECATED = (1u << 31), // Formerly used for twitch integration
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
|
2019-01-02 15:10:05 +01:00
|
|
|
enum PeepNextFlags
|
2018-04-04 19:50:07 +02:00
|
|
|
{
|
|
|
|
PEEP_NEXT_FLAG_DIRECTION_MASK = 0x3,
|
|
|
|
PEEP_NEXT_FLAG_IS_SLOPED = (1 << 2),
|
|
|
|
PEEP_NEXT_FLAG_IS_SURFACE = (1 << 3),
|
2018-07-11 00:49:11 +02:00
|
|
|
PEEP_NEXT_FLAG_UNUSED = (1 << 4),
|
2018-04-04 19:50:07 +02:00
|
|
|
};
|
|
|
|
|
2020-10-06 06:56:52 +02:00
|
|
|
enum class PeepSpriteType : uint8_t
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2020-10-06 06:56:52 +02:00
|
|
|
Normal = 0,
|
|
|
|
Handyman = 1,
|
|
|
|
Mechanic = 2,
|
|
|
|
Security = 3,
|
|
|
|
EntertainerPanda = 4,
|
|
|
|
EntertainerTiger = 5,
|
|
|
|
EntertainerElephant = 6,
|
|
|
|
EntertainerRoman = 7,
|
|
|
|
EntertainerGorilla = 8,
|
|
|
|
EntertainerSnowman = 9,
|
|
|
|
EntertainerKnight = 10,
|
|
|
|
EntertainerAstronaut = 11,
|
|
|
|
EntertainerBandit = 12,
|
|
|
|
EntertainerSheriff = 13,
|
|
|
|
EntertainerPirate = 14,
|
|
|
|
IceCream = 15,
|
|
|
|
Chips = 16,
|
|
|
|
Burger = 17,
|
|
|
|
Drink = 18,
|
|
|
|
Balloon = 19,
|
|
|
|
Candyfloss = 20,
|
|
|
|
Umbrella = 21,
|
|
|
|
Pizza = 22,
|
|
|
|
SecurityAlt = 23,
|
|
|
|
Popcorn = 24,
|
|
|
|
ArmsCrossed = 25,
|
|
|
|
HeadDown = 26,
|
|
|
|
Nauseous = 27,
|
|
|
|
VeryNauseous = 28,
|
|
|
|
RequireToilet = 29,
|
|
|
|
Hat = 30,
|
|
|
|
HotDog = 31,
|
|
|
|
Tentacle = 32,
|
|
|
|
ToffeeApple = 33,
|
|
|
|
Doughnut = 34,
|
|
|
|
Coffee = 35,
|
|
|
|
Chicken = 36,
|
|
|
|
Lemonade = 37,
|
|
|
|
Watching = 38,
|
|
|
|
Pretzel = 39,
|
|
|
|
Sunglasses = 40,
|
|
|
|
SuJongkwa = 41,
|
|
|
|
Juice = 42,
|
|
|
|
FunnelCake = 43,
|
|
|
|
Noodles = 44,
|
|
|
|
Sausage = 45,
|
|
|
|
Soup = 46,
|
|
|
|
Sandwich = 47,
|
|
|
|
Count = 48,
|
|
|
|
|
|
|
|
Invalid = 255
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
|
2020-06-09 03:25:54 +02:00
|
|
|
// Flags used by peep->WindowInvalidateFlags
|
2019-01-02 15:10:05 +01:00
|
|
|
enum PeepInvalidate
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_INVALIDATE_PEEP_THOUGHTS = 1,
|
|
|
|
PEEP_INVALIDATE_PEEP_STATS = 1 << 1,
|
|
|
|
PEEP_INVALIDATE_PEEP_2 = 1 << 2,
|
2017-10-13 10:06:36 +02:00
|
|
|
PEEP_INVALIDATE_PEEP_INVENTORY = 1 << 3,
|
2018-06-22 23:04:19 +02:00
|
|
|
PEEP_INVALIDATE_STAFF_STATS = 1 << 4,
|
2020-05-31 23:02:31 +02:00
|
|
|
PEEP_INVALIDATE_PEEP_ACTION = 1 << 5, // Currently set only when GuestHeadingToRideId is changed
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
|
2019-02-28 20:28:58 +01:00
|
|
|
struct Guest;
|
|
|
|
struct Staff;
|
|
|
|
|
2021-08-25 16:42:09 +02:00
|
|
|
struct Peep : EntityBase
|
2017-10-13 10:06:36 +02:00
|
|
|
{
|
2020-06-14 07:31:08 +02:00
|
|
|
char* Name;
|
2020-02-11 23:01:14 +01:00
|
|
|
CoordsXYZ NextLoc;
|
2020-06-14 07:31:08 +02:00
|
|
|
uint8_t NextFlags;
|
|
|
|
PeepState State;
|
2020-09-14 21:11:17 +02:00
|
|
|
union
|
|
|
|
{
|
|
|
|
uint8_t SubState;
|
|
|
|
PeepSittingSubState SittingSubState;
|
2020-09-30 23:33:58 +02:00
|
|
|
PeepRideSubState RideSubState;
|
2020-10-20 03:22:24 +02:00
|
|
|
PeepUsingBinSubState UsingBinSubState;
|
2020-09-14 21:11:17 +02:00
|
|
|
};
|
2020-06-14 07:31:08 +02:00
|
|
|
PeepSpriteType SpriteType;
|
|
|
|
uint8_t TshirtColour;
|
|
|
|
uint8_t TrousersColour;
|
|
|
|
uint16_t DestinationX; // Location that the peep is trying to get to
|
|
|
|
uint16_t DestinationY;
|
|
|
|
uint8_t DestinationTolerance; // How close to destination before next action/state 0 = exact
|
2020-06-09 04:47:45 +02:00
|
|
|
uint8_t Var37;
|
2020-06-09 04:34:35 +02:00
|
|
|
uint8_t Energy;
|
2020-06-09 04:32:22 +02:00
|
|
|
uint8_t EnergyTarget;
|
2020-06-09 04:07:31 +02:00
|
|
|
uint8_t Mass;
|
2020-06-09 03:25:54 +02:00
|
|
|
uint8_t WindowInvalidateFlags;
|
2022-01-19 14:17:11 +01:00
|
|
|
RideId CurrentRide;
|
2020-06-08 03:18:17 +02:00
|
|
|
StationIndex CurrentRideStation;
|
2020-06-08 03:10:09 +02:00
|
|
|
uint8_t CurrentTrain;
|
2018-06-22 23:04:19 +02:00
|
|
|
union
|
|
|
|
{
|
2017-10-13 10:06:36 +02:00
|
|
|
struct
|
|
|
|
{
|
2020-06-08 02:51:11 +02:00
|
|
|
uint8_t CurrentCar;
|
2020-06-08 02:48:05 +02:00
|
|
|
uint8_t CurrentSeat;
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
2020-06-08 02:45:12 +02:00
|
|
|
uint16_t TimeToSitdown;
|
2017-10-13 10:06:36 +02:00
|
|
|
struct
|
|
|
|
{
|
2020-06-08 02:28:35 +02:00
|
|
|
uint8_t TimeToStand;
|
2020-06-08 02:26:21 +02:00
|
|
|
uint8_t StandingFlags;
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
// Normally 0, 1 for carrying sliding board on spiral slide ride, 2 for carrying lawn mower
|
2020-06-08 02:23:59 +02:00
|
|
|
uint8_t SpecialSprite;
|
2020-06-08 02:22:13 +02:00
|
|
|
PeepActionSpriteType ActionSpriteType;
|
2018-03-31 11:01:43 +02:00
|
|
|
// Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which
|
2017-10-13 10:06:36 +02:00
|
|
|
// reads this again
|
2020-06-08 02:19:44 +02:00
|
|
|
PeepActionSpriteType NextActionSpriteType;
|
2020-06-08 01:23:21 +02:00
|
|
|
uint8_t ActionSpriteImageOffset;
|
2020-06-08 01:18:42 +02:00
|
|
|
PeepActionType Action;
|
|
|
|
uint8_t ActionFrame;
|
2020-06-08 01:00:07 +02:00
|
|
|
uint8_t StepProgress;
|
2018-06-22 23:04:19 +02:00
|
|
|
union
|
|
|
|
{
|
2020-06-06 16:18:58 +02:00
|
|
|
uint8_t MazeLastEdge;
|
2023-04-07 21:46:25 +02:00
|
|
|
::Direction PeepDirection; // Direction ?
|
2017-10-13 10:06:36 +02:00
|
|
|
};
|
2022-01-19 14:17:11 +01:00
|
|
|
RideId InteractionRideIndex;
|
2023-01-27 18:11:04 +01:00
|
|
|
uint32_t PeepId;
|
2020-05-31 23:28:20 +02:00
|
|
|
uint8_t PathCheckOptimisation; // see peep.checkForPath
|
2021-07-27 19:28:07 +02:00
|
|
|
TileCoordsXYZD PathfindGoal;
|
|
|
|
std::array<TileCoordsXYZD, 4> PathfindHistory;
|
2020-06-04 03:45:15 +02:00
|
|
|
uint8_t WalkingFrameNum;
|
2021-05-11 13:41:13 +02:00
|
|
|
uint32_t PeepFlags;
|
2018-04-03 17:12:53 +02:00
|
|
|
|
2018-04-03 20:40:31 +02:00
|
|
|
public: // Peep
|
2018-03-27 22:04:57 +02:00
|
|
|
void Update();
|
2019-08-15 19:32:19 +02:00
|
|
|
std::optional<CoordsXY> UpdateAction(int16_t& xy_distance);
|
|
|
|
std::optional<CoordsXY> UpdateAction();
|
2019-01-02 15:10:05 +01:00
|
|
|
void SetState(PeepState new_state);
|
2018-03-27 22:04:57 +02:00
|
|
|
void Remove();
|
2018-03-31 11:01:43 +02:00
|
|
|
void UpdateCurrentActionSpriteType();
|
2018-06-20 17:28:51 +02:00
|
|
|
void SwitchToSpecialSprite(uint8_t special_sprite_id);
|
2018-04-02 19:18:15 +02:00
|
|
|
void StateReset();
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] uint8_t GetNextDirection() const;
|
2018-04-04 19:50:07 +02:00
|
|
|
bool GetNextIsSloped() const;
|
|
|
|
bool GetNextIsSurface() const;
|
2018-06-20 17:28:51 +02:00
|
|
|
void SetNextFlags(uint8_t next_direction, bool is_sloped, bool is_surface);
|
2021-02-08 23:31:29 +01:00
|
|
|
bool CanBePickedUp() const;
|
2018-04-26 17:15:29 +02:00
|
|
|
void Pickup();
|
2018-06-20 17:28:51 +02:00
|
|
|
void PickupAbort(int32_t old_x);
|
2021-11-24 08:35:08 +01:00
|
|
|
[[nodiscard]] GameActions::Result Place(const TileCoordsXYZ& location, bool apply);
|
2019-02-28 20:28:58 +01:00
|
|
|
void RemoveFromRide();
|
2020-04-21 12:38:59 +02:00
|
|
|
void FormatActionTo(Formatter&) const;
|
|
|
|
void FormatNameTo(Formatter&) const;
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] std::string GetName() const;
|
2021-01-06 17:22:22 +01:00
|
|
|
bool SetName(std::string_view value);
|
2021-05-11 09:15:02 +02:00
|
|
|
bool IsActionWalking() const;
|
|
|
|
bool IsActionIdle() const;
|
|
|
|
bool IsActionInterruptable() const;
|
2019-02-28 20:28:58 +01:00
|
|
|
|
2020-09-17 02:22:36 +02:00
|
|
|
// Reset the peep's stored goal, which means they will forget any stored pathfinding history
|
2022-05-14 21:28:24 +02:00
|
|
|
// on the next GuestPathfinding::ChooseDirection call.
|
2020-09-17 02:22:36 +02:00
|
|
|
void ResetPathfindGoal();
|
|
|
|
|
2021-02-10 18:27:31 +01:00
|
|
|
void SetDestination(const CoordsXY& coords);
|
2021-02-10 20:18:27 +01:00
|
|
|
void SetDestination(const CoordsXY& coords, int32_t tolerance);
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] CoordsXY GetDestination() const;
|
2021-02-10 18:27:31 +01:00
|
|
|
|
2021-11-26 08:25:04 +01:00
|
|
|
void Serialise(class DataSerialiser& stream);
|
2022-10-14 20:26:36 +02:00
|
|
|
void Paint(PaintSession& session, int32_t imageDirection) const;
|
2021-11-26 08:25:04 +01:00
|
|
|
|
2019-02-28 20:28:58 +01:00
|
|
|
// TODO: Make these private again when done refactoring
|
|
|
|
public: // Peep
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] bool CheckForPath();
|
2022-10-09 11:01:10 +02:00
|
|
|
bool ShouldWaitForLevelCrossing();
|
2022-10-01 19:09:51 +02:00
|
|
|
bool IsOnLevelCrossing();
|
2022-10-31 19:57:50 +01:00
|
|
|
bool IsOnPathBlockedByVehicle();
|
2019-02-28 20:28:58 +01:00
|
|
|
void PerformNextAction(uint8_t& pathing_result);
|
|
|
|
void PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result);
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] int32_t GetZOnSlope(int32_t tile_x, int32_t tile_y);
|
2019-02-28 20:28:58 +01:00
|
|
|
void SwitchNextActionSpriteType();
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] PeepActionSpriteType GetActionSpriteType();
|
2018-06-22 23:04:19 +02:00
|
|
|
|
2019-02-28 20:28:58 +01:00
|
|
|
private:
|
|
|
|
void UpdateFalling();
|
|
|
|
void Update1();
|
|
|
|
void UpdatePicked();
|
|
|
|
};
|
|
|
|
|
2018-03-27 22:04:57 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PATHING_DESTINATION_REACHED = 1 << 0,
|
|
|
|
PATHING_OUTSIDE_PARK = 1 << 1,
|
|
|
|
PATHING_RIDE_EXIT = 1 << 2,
|
|
|
|
PATHING_RIDE_ENTRANCE = 1 << 3,
|
|
|
|
};
|
|
|
|
|
2018-04-04 20:25:15 +02:00
|
|
|
extern const bool gSpriteTypeToSlowWalkMap[48];
|
2017-10-13 10:06:36 +02:00
|
|
|
|
2023-01-17 22:16:36 +01:00
|
|
|
int32_t PeepGetStaffCount();
|
|
|
|
void PeepUpdateAll();
|
|
|
|
void PeepProblemWarningsUpdate();
|
|
|
|
void PeepStopCrowdNoise();
|
|
|
|
void PeepUpdateCrowdNoise();
|
|
|
|
void PeepUpdateDaysInQueue();
|
|
|
|
void PeepApplause();
|
|
|
|
int32_t GetPeepFaceSpriteSmall(Guest* peep);
|
|
|
|
int32_t GetPeepFaceSpriteLarge(Guest* peep);
|
|
|
|
void PeepEntityRemove(Peep* peep);
|
|
|
|
|
|
|
|
void PeepWindowStateUpdate(Peep* peep);
|
|
|
|
void PeepDecrementNumRiders(Peep* peep);
|
|
|
|
|
|
|
|
void PeepSetMapTooltip(Peep* peep);
|
|
|
|
int32_t PeepCompare(const EntityId sprite_index_a, const EntityId sprite_index_b);
|
|
|
|
|
|
|
|
void PeepUpdateNames(bool realNames);
|
|
|
|
|
|
|
|
StringId GetRealNameStringIDFromPeepID(uint32_t id);
|