RDR-Classes/script/globals/PlayerStatusSyncData.hpp

457 lines
12 KiB
C++
Raw Normal View History

#pragma once
#include "script/types.hpp"
enum class PlayerStatus
{
INITIALIZATION,
PLAYING,
JUST_DIED,
DEAD,
RESPAWN,
POST_RESPAWN,
RESPAWN_INIT,
RESPAWN_FADE_WAIT,
RESPAWN_INVENTORY_OVERRIDE_WAIT,
RESPAWN_FIND_DESIRED_SPAWN,
RESPAWN_RESURRECT,
RESPAWN_UPDATE_TELEPORT,
RESPAWN_STREAM_LOCATION,
RESPAWN_REGION_RESET,
RESPAWN_REGION_WAIT_FOR_RESET,
RESPAWN_CREATE_PERSONAL_TRANSPORT,
RESPAWN_INITIALIZE_PLAYER,
RESPAWN_STREAM_WEAPONS,
RESPAWN_ALLOW_WEAPONS_TO_EQUIP,
RESPAWN_ON_SOMETHING,
RESPAWN_VALIDATE_SCENARIO,
RESPAWN_ARBITRARY_STREAM_WAIT,
RESPAWN_EXIT,
DEAD_INIT,
DEAD_SHOW_DEATH,
DEAD_EXIT,
INVALID,
CLEANUP
};
enum class ParentStatus
{
INITIALIZATION,
PLAYING,
JUST_DIED,
DEAD,
RESPAWN,
POST_RESPAWN
};
enum class ScanState
{
INIT,
FIND_DESIRED_SPAWN,
START_SPAWN_SEARCH,
PROCESS_SPAWN_SEARCH,
VERIFY_SPAWN_LOCATION,
CLEANUP,
COMPLETE
};
// TODO
enum class PlayerFlags
{
SPECTATING = 5,
DEAD_EYE_ACTIVE = 9,
IN_JAIL = 20
};
enum class PlayerStatusFlags
{
FORCE_RESPAWN,
IN_RESPAWN_SEQUENCE,
BYPASS_RESSURRECT_AND_TELEPORT,
FORCE_RESPAWN_DESIRED,
FORCE_RESPAWN_ABSOLUTE,
FORCE_RESPAWN_AT_CAMP,
FORCE_RESPAWN_IN_MOONSHINE,
FORCE_RESPAWN_JAIL,
FORCE_RESPAWN_FAST_TRAVEL_STATION,
FORCE_RESPAWN_TRADE,
FORCE_RESPAWN_DEBUG,
FORCE_RESPAWN_ASAP,
SCRIPT_CONTROL_OVERRIDE,
MODE_OVERRIDE,
MISSION_OVERRIDE,
VERSUS_OVERRIDE,
GENERIC_SPAWN_FAR_ONCE,
PAUSE_RESPAWN_FADE_UP,
SKIP_RESPAWN_FADE_IN,
SKIP_RESPAWN_FADE_OUT,
SKIP_LOADING_SCREEN_SHUTDOWN,
DISABLE_POST_FX,
DISABLE_POST_FX_ONCE,
CLEANUP_MATCHMAKING_POST_FX,
RESPAWN_INVISIBLE_ONCE,
RESPAWN_WITHOUT_CONTROL_ONCE,
REQUEST_SCRIPT_CONTROL_INFO,
PREVENT_REGION_RESET,
HIDE_SPECTATOR_UI,
SKIP_SPECTATOR_MODE_ON_DEATH,
DISABLE_SPECTATOR_MODE_ON_DEATH,
INVISIBLE_TO_SPECTATOR_CAM,
DISABLE_DEATH_CAM_HOLD_TIME,
MAINTAIN_DEATH_CAM_ON_RESPAWN,
DISABLE_LOCKON,
DISABLE_FIRING,
SECURITY_CLIENT,
PREVENT_RESPAWN_INVINCIBILITY,
CAMP_RELOAD,
RESPAWN_GHOSTTOWN,
FAKE_GAMER_TAG,
REQUEST_CUSTOM_INVENTORY_CONFIG,
RESPAWN_USE_CUSTOM_INVENTORY_CONFIG,
REQUEST_CUSTOM_AMMO_UI_CONFIG,
RESPAWN_USE_CUSTOM_AMMO_UI_CONFIG,
DISABLE_DROP_WEAPONS_ON_DEATH,
DISABLE_LOOTING,
ACTIVATE_CUSTOM_CAM_ON_RESPAWN,
REQUEST_CUSTOM_SPAWN_CONFIG,
RESPAWN_USE_CUSTOM_SPAWN_CONFIG,
USE_CUSTOM_POSITION_WITH_MOUNT,
RESPAWN_WITH_COUPON,
RESPAWN_WITH_COUPON_ONCE,
RESPAWN_WITH_HUB,
RESPAWN_WITH_HUB_ONCE,
RESPAWN_WITH_HANDHELD = 59,
RESPAWN_WITH_HANDHELD_ONCE,
RESPAWN_WITH_BLACKBOARD,
RESPAWN_WITH_BLACKBOARD_ONCE,
RESPAWN_WITH_ANIMATION,
RESPAWN_WITH_ANIMATION_ONCE,
RESPAWN_WITH_MOUNT,
RESPAWN_WITH_MOUNT_ONCE,
RESPAWN_WITH_RESPOT_DISABLED,
RESPAWN_WITH_RESPOT_DISABLED_ONCE,
RESPAWN_ON_MOUNT,
RESPAWN_ON_MOUNT_ONCE,
RESPAWN_ON_TARGET_MOUNT,
RESPAWN_ON_TARGET_MOUNT_ONCE,
DESTROY_MOUNT_ON_RESPAWN,
RESPAWN_ON_VEHICLE,
RESPAWN_ON_VEHICLE_ONCE,
DESTROY_VEHICLE_ON_RESPAWN,
RESPAWN_WITH_VEHICLE,
RESPAWN_WITH_VEHICLE_ONCE,
RESPAWN_ON_VEHICLE_NAVMESH,
RESPAWN_ON_VEHICLE_NAVMESH_ONCE,
RESPAWN_ON_TRAIN,
RESPAWN_ON_TRAIN_ONCE,
RESPAWN_ON_TARGET_TRAIN,
RESPAWN_ON_TARGET_TRAIN_ONCE,
RESPAWN_ON_TARGET_VEHICLE,
RESPAWN_ON_TARGET_VEHICLE_ONCE,
RESPAWN_USE_ADJUSTED_OFFSET_FOR_TRANSPORT,
RESPAWN_USE_ADJUSTED_OFFSET_FOR_TRANSPORT_ONCE,
RESPAWN_DISABLE_WATER_FAILSAFE,
RESPAWN_SPAWN_IN_WATER,
RESPAWN_SPAWN_IN_WATER_ONCE,
RESPAWN_WITH_RANDOM_SEED,
RESPAWN_SPAWN_NEAR_LOCATION_ONCE,
DONT_RESPAWN_IN_VOLUME_LOCKS_ONCE,
REGENERATE_PEDSHOT_ONCE,
RESPAWN_WITH_DESIRED_WEAPON_IN_HAND,
RESPAWN_WITH_DESIRED_WEAPON_IN_HAND_ONCE,
RESPAWN_WITH_BEST_WEAPON_IN_HAND,
RESPAWN_WITH_BEST_WEAPON_IN_HAND_ONCE,
RESPAWN_WITH_LAST_WEAPON_IN_HAND,
RESPAWN_WITH_LAST_WEAPON_IN_HAND_ONCE,
RESPAWN_WITH_NO_WEAPON_IN_HAND,
RESPAWN_WITH_NO_WEAPON_IN_HAND_ONCE,
RESPAWN_WITH_NO_WEAPON_PROCESSING,
RESPAWN_WITH_NO_WEAPON_PROCESSING_ONCE,
RESPAWN_WITH_NO_ANIMAL_INVULNERABILITY,
RESPAWN_WITH_NO_ANIMAL_INVULNERABILITY_ONCE,
PREVENT_MOUNT_RELEASE,
DONT_USE_ALPHA_FADE_ON_RESPAWN,
DONT_USE_ALPHA_FADE_ON_RESPAWN_ONCE,
RESPAWN_LEAVES_ALIVE_PED_ONCE,
FORCE_COLLISION_WHEN_RESPOT_TIMER_FINISHED,
ALLOW_INCAPACITATION,
STORE_DAMAGE_EVENT,
PAY_BOUNTY_ON_RESPAWN,
RESPAWN_PRESERVE_DEADEYE,
RESPAWN_PRESERVE_HEALTH,
RESPAWN_SANS_WEAPONS,
REGISTER_LOADOUT_OVERRIDE_ON_RESPAWN,
REQUEST_LOADOUT_OVERRIDE_REGISTRATION,
CLEAR_LOADOUT_OVERRIDE_ON_RESPAWN,
REFRESH_WEAPONS_IN_HAND,
REFRESH_LOADOUT,
REFRESH_INVENTORY_OVERRIDE,
REFRESH_OUTFIT_OVERRIDE,
REFRESH_AMMO_TYPE_UNLOCKS,
SPECIAL_ABILITY_OVERRIDE_DEACTIVATION,
SPECIAL_ABILITY_DEACTIVATE_ON_CANCEL,
RESPAWN_NO_COMPONENT_LOAD,
RESPAWN_NO_EXPRESSION_LOAD,
RESPAWN_BLOCK_TEAM_RESET,
PAUSE_RELATIONSHIP_UPDATE,
DONT_PROCESS_FAST_INSTANCING,
RESPAWN_INTO_FAST_INSTANCE,
GANG_FEUDS_ARE_UNLOCKED,
OVERRIDE_PLAYER_ABILITIES,
DESTROY_CORPSE_ON_RESPAWN_ONCE,
DESTROY_CORPSE_ON_RESPAWN,
KEEP_CORPSE_ON_RESPAWN_ONCE,
KEEP_CORPSE_ON_RESPAWN,
CANNOT_BE_CARRIED_WHEN_DEAD,
CLEANUP_TRANSITION_SETTINGS,
DONT_CLEAR_DRUNK_FOR_SPAWNING_OR_CUTSCENES = 144,
DONT_SESSION_ON_RESPAWN_ONCE,
MAX
};
// TODO: move this somewhere else
enum class Region
{
INVALID = -1,
BAY_CRAWDADWILLIES,
BAY_MACOMBS_END,
BAY_MERKINSWALLER,
BAY_LAGRAS,
BAY_LAKAY,
BAY_SAINT_DENIS,
BAY_ORANGE_PLANTATION,
BAY_SERIAL_KILLER,
BAY_SERENDIPITY,
BAY_SHADYBELLE,
BAY_SILTWATERSTRAND,
BGV_APPLESEEDTIMBER,
BGV_BERYLS_DREAM,
BGV_BLACKBONEFOREST_TRAPPER,
BGV_DAKOTARIVER_TRAPPER,
BGV_FORTRIGGS,
BGV_HANGINGDOG,
BGV_LONEMULESTEAD,
BGV_MISSING_HUSBAND,
BGV_MONTO_REST,
BGV_OWANJILA_DAM,
BGV_PAINTEDSKY,
BGV_PRONGHORN,
BGV_RIGGS_STATION,
BGV_SHACK,
BGV_SHEPHERDS_RISE,
BGV_STRAWBERRY,
BGV_VALLEY_VIEW,
BGV_WALLACE_STATION,
BGV_OLD_MAN_JONES,
BGV_WATSONSCABIN,
BLU_CANEBREAK_MANOR,
BLU_COPPERHEAD,
BLU_SISIKA,
BLU_TRAVELLING_SALESMAN,
CML_BACCHUSBRIDGE,
CML_DINO_LADY,
CML_OLDFORTWALLACE,
CML_SIXPOINTCABIN,
GRT_BEECHERS,
GRT_BLACKWATER,
GRT_QUAKERS_COVE,
GRZ_ADLERRANCH,
GRZ_DEAD_RIVAL,
GRZ_CHEZPORTER,
GRZ_COLTER,
GRZ_FROZEN_EXPLORER,
GRZ_MILLESANI_CLAIM,
GRZ_MOUNTAIN_MAN,
GRZ_MOUNT_HAGEN_PEAK,
GRZ_STARVING_CHILDREN,
GRZ_TEMPEST_RIM,
GRZ_WINTERMINING_TOWN,
GRZ_CALUMETRAVINE,
GRE_CIVIL_WAR_BRIDE,
GRZ_COHUTTA,
GRZ_COTORRA_SPRINGS,
GRZ_GUNFIGHT,
GRZ_THELOFT,
GRE_VETERAN,
GRZ_WAPITI,
GRZ_TRAVELLING_SALESMAN,
GUA_AGUASDULCES,
GUA_CAMP,
GUA_CINCOTORRES,
GUA_LACAPILLA,
GUA_MANICATO,
HRT_ABANDONED_MILL,
ROA_BEECHERS_C,
HRT_CARMODYDELL,
HRT_CORNWALLKEROSENE,
HRT_CROP_FARM,
HRT_CUMBERLANDFALLS,
HRT_DOWNSRANCH,
HRT_EMERALDRANCH,
HRT_GRANGERS_HOGGERY,
HRT_HORSESHOEOVERLOOK,
HRT_LARNEDSOD,
HRT_LOONY_CULT,
HRT_LUCKYSCABIN,
HRT_SWANSONS_STATION,
HRT_VALENTINE,
ROA_ABERDEENPIGFARM,
ROA_ANNESBURG,
ROA_BEAVERHOLLOW,
ROA_BLACK_BALSAM_RISE,
ROA_BRANDYWINE_DROP,
ROA_BUTCHERCREEK,
ROA_DOVERHILL,
ROA_HAPPY_FAMILY,
ROA_ISOLATIONIST,
ROA_MACLEANSHOUSE,
ROA_MOSSY_FLATS,
ROA_ROANOKE_VALLEY,
ROA_ROCKYSEVEN,
ROA_TRAPPER,
ROA_OLD_MAN_JONES,
ROA_VANHORNMANSION,
ROA_VANHORNPOST,
SCM_BRAITHWAITEMANOR,
SCM_BULGERGLADE,
SCM_CALIGAHALL,
SCM_CATFISHJACKSONS,
SCM_CLEMENSCOVE,
SCM_CLEMENSPOINT,
SCM_COMPSONS_STEAD,
SCM_DAIRY_FARM,
SCM_HORSE_SHOP,
SCM_LONNIESSHACK,
SCM_LOVE_TRIANGLE,
SCM_RADLEYS_PASTURE,
SCM_RHODES,
SCM_SLAVE_PEN,
TAL_AURORA_BASIN,
TAL_DEAD_SETTLER,
TAL_COCHINAY,
TAL_MANZANITAPOST,
TAL_PACIFICUNIONRR,
TAL_TANNERSREACH,
TAL_TRAPPER,
GAP_GAPTOOTH_BREACH,
GAP_TUMBLEWEED,
GAP_RATHSKELLER_FORK,
RIO_BENEDICT_POINT,
RIO_FORT_MERCER,
RIO_PLAIN_VIEW,
RIO_TRAVELLING_SALESMAN,
CHO_ARMADILLO,
CHO_COOTS_CHAPEL,
CHO_DON_JULIO_HOUSE,
CHO_RILEYS_CHARGE,
CHO_RIDGEWOOD_FARM,
CHO_TWIN_ROCKS,
CHO_TRAVELLING_SALESMAN,
CHO_TRAPPER,
HEN_MACFARLANES_RANCH,
HEN_THIEVES_LANDING,
HEN_TRAVELLING_SALESMAN,
HEN_HARRIET,
CENTRALUNIONRR,
MAX
};
enum class District
{
INVALID = -1,
BAYOU_NWA,
BIG_VALLEY,
BLUEGILL_MARSH,
CUMBERLAND_FOREST,
GREAT_PLAINS,
GRIZZLIES,
GRIZZLIES_EAST,
GRIZZLIES_WEST,
GUAMA,
HEARTLAND,
ROANOKE_RIDGE,
SCARLETT_MEADOWS,
TALL_TREES,
GAPTOOTH_RIDGE,
RIO_BRAVO,
CHOLLA_SPRINGS,
HENNIGANS_STEAD
};
// seriously move this somewhere else
enum class Language
{
UNDEFINED = -1,
ENGLISH,
FRENCH,
GERMAN,
ITALIAN,
SPANISH,
PORTUGESE,
POLISH,
RUSSIAN,
KOREAN,
CHINESE_TRAD,
JAPANESE,
MEXICAN,
CHINESE_SIMP
};
enum class PassiveState
{
NOT_PASSIVE,
WAITING_FOR_PASSIVE,
PASSIVE,
WAITING_FOR_NOT_PASSIVE,
FORCED_FROM_PASSIVE
};
enum class AnimalTransformationFlag
{
IS_ANIMAL,
PENDING_TRANSFORMATION_TO_HUMAN
};
struct ANIMAL_TRANSFORMATION_DATA
{
SCR_INT TransitionTimestamp;
SCR_BITSET<AnimalTransformationFlag> Flags;
};
// WARNING: the first 20 fields of this struct are overwritten every tick from another global
struct PLAYER_STATUS_SYNC_DATA_ENTRY
{
alignas(8) PlayerStatus Status;
alignas(8) ParentStatus ParentStatus; // essentially a condensed version of Status
alignas(8) ScanState ScanState;
SCR_BITSET<PlayerFlags> Flags;
SCR_BITSET_LARGE<PlayerStatusFlags, static_cast<int>(PlayerStatusFlags::MAX)> StatusFlags;
alignas(8) Region CurrentRegion;
alignas(8) District CurrentDistrict;
TEXT_LABEL_31 FakeGamerTag;
SCR_BOOL CompletedFirstRespawn;
alignas(8) Language PlayerLanguage; // can't name this Language because GCC
SCR_FLOAT GangNotoriety;
PLAYER_INDEX SpectateTarget;
// ----------------------------------------------------------------------------------------------
GAMER_HANDLE LastPlayerKilledHandle;
SCR_INT LastPlayerKilledTime;
PLAYER_INDEX LastPlayerKilled;
GAMER_HANDLE LastPlayerKilledByHandle;
GAMER_HANDLE LastPlayerKilledByHandle2; // seemingly the same thing
SCR_INT LastPlayerKilledByTime;
PLAYER_INDEX LastPlayerKilledBy;
SCR_FLOAT Notoriety;
SCR_INT PassiveRequestTime;
SCR_INT PassiveUpdateTime;
alignas(8) PassiveState PassiveState;
SCR_BOOL PassivePenaltyApplied;
SCR_INT NotorietyFlags;
ANIMAL_TRANSFORMATION_DATA AnimalTransformationData;
};
static_assert(sizeof(PLAYER_STATUS_SYNC_DATA_ENTRY) == 38 * 8);
struct PLAYER_STATUS_SYNC_DATA
{
SCR_ARRAY<PLAYER_STATUS_SYNC_DATA_ENTRY, 32> Entries;
};
static_assert(sizeof(PLAYER_STATUS_SYNC_DATA) == 1217 * 8);